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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
// for empty array means there is no data to remove dictionary.
if (null == byteBufferArr || byteBufferArr.length == 0) {
return null;
}
int noOfCol = byteBufferArr.length;
short toDetermineLengthOfByteArr = 2;
short offsetLen = (short) (noOfCol * 2 + toDetermineLengthOfByteArr);
int total... | if (null == byteBufferArr byteBufferArr.length == 0) { return null; } int noOfCol = byteBufferArr.length; short toDetermineLengthOfByteArr = 2; short offsetLen = (short) (noOfCol * 2 + toDetermineLengthOfByteArr); int totalBytes = calculateTotalBytes(byteBufferArr) + offsetLen; ByteBuffer buffer = ByteBuffer.allocate(t... | /**
* This method will form one single byte [] for all the high card dims.
* For example if you need to pack 2 columns c1 and c2 , it stores in following way
* <total_len(short)><offsetLen(short)><offsetLen+c1_len(short)><c1(byte[])><c2(byte[])>
* @param byteBufferArr
* @return
*/ | This method will form one single byte [] for all the high card dims. For example if you need to pack 2 columns c1 and c2 , it stores in following way | packByteBufferIntoSingleByteArray | {
"repo_name": "sgururajshetty/carbondata",
"path": "core/src/main/java/org/apache/carbondata/core/util/NonDictionaryUtil.java",
"license": "apache-2.0",
"size": 4050
} | [
"java.nio.ByteBuffer"
] | import java.nio.ByteBuffer; | import java.nio.*; | [
"java.nio"
] | java.nio; | 795,252 |
@Override
public IndexedInts getRow()
{
final IndexedInts row = selector.getRow();
if (row.size() == 1) {
if (nullAdjustment == 0) {
return row;
} else {
nullAdjustedRow.setValue(row.get(0) + nullAdjustment);
return nullAdjustedRow;
}
} else {
// Can't ... | IndexedInts function() { final IndexedInts row = selector.getRow(); if (row.size() == 1) { if (nullAdjustment == 0) { return row; } else { nullAdjustedRow.setValue(row.get(0) + nullAdjustment); return nullAdjustedRow; } } else { return ZeroIndexedInts.instance(); } } | /**
* Treats any non-single-valued row as a row containing a single null value, to ensure consistency with
* other expression selectors. See also {@link ExpressionSelectors#supplierFromDimensionSelector} for similar
* behavior.
*/ | Treats any non-single-valued row as a row containing a single null value, to ensure consistency with other expression selectors. See also <code>ExpressionSelectors#supplierFromDimensionSelector</code> for similar behavior | getRow | {
"repo_name": "dkhwangbo/druid",
"path": "processing/src/main/java/org/apache/druid/segment/virtual/SingleStringInputDimensionSelector.java",
"license": "apache-2.0",
"size": 4937
} | [
"org.apache.druid.segment.data.IndexedInts",
"org.apache.druid.segment.data.ZeroIndexedInts"
] | import org.apache.druid.segment.data.IndexedInts; import org.apache.druid.segment.data.ZeroIndexedInts; | import org.apache.druid.segment.data.*; | [
"org.apache.druid"
] | org.apache.druid; | 622,909 |
public void updateConfigRollback(com.actiontech.dble.alarm.UcoreInterface.UpdateConfigRollbackInput request,
io.grpc.stub.StreamObserver<com.actiontech.dble.alarm.UcoreInterface.Empty> responseObserver) {
asyncUnaryCall(
getChannel().newCall(METHOD_UPDATE_CONFIG_... | void function(com.actiontech.dble.alarm.UcoreInterface.UpdateConfigRollbackInput request, io.grpc.stub.StreamObserver<com.actiontech.dble.alarm.UcoreInterface.Empty> responseObserver) { asyncUnaryCall( getChannel().newCall(METHOD_UPDATE_CONFIG_ROLLBACK, getCallOptions()), request, responseObserver); } | /**
* <pre>
* UpdateConfigRollback is of 3-phase commit.
* </pre>
*/ | <code> UpdateConfigRollback is of 3-phase commit. </code> | updateConfigRollback | {
"repo_name": "actiontech/dble",
"path": "src/main/java/com/actiontech/dble/alarm/UcoreGrpc.java",
"license": "gpl-2.0",
"size": 134635
} | [
"io.grpc.stub.ClientCalls",
"io.grpc.stub.ServerCalls"
] | import io.grpc.stub.ClientCalls; import io.grpc.stub.ServerCalls; | import io.grpc.stub.*; | [
"io.grpc.stub"
] | io.grpc.stub; | 1,859,872 |
public boolean onOptionsItemSelected (MenuItem item)
{
switch (item.getItemId ()) {
case R.id.em_refresh:
listener.refresh ();
break;
case R.id.em_settings:
settings ();
break;
case R.id.em_dashboard:
listener.dashboard ();
break;
case R.id.em_export:
listener.export ();
b... | boolean function (MenuItem item) { switch (item.getItemId ()) { case R.id.em_refresh: listener.refresh (); break; case R.id.em_settings: settings (); break; case R.id.em_dashboard: listener.dashboard (); break; case R.id.em_export: listener.export (); break; case R.id.em_import: listener.importFile (); break; case R.id... | /**
* Activities should call this method in their
* implementation of {@link Activity#onOptionsItemSelected}.
* @param item the selected item
* @return <tt>true</tt> if the event has been consumed
*/ | Activities should call this method in their implementation of <code>Activity#onOptionsItemSelected</code> | onOptionsItemSelected | {
"repo_name": "WaniKani/Android-Notification",
"path": "src/com/wanikani/androidnotifier/MenuHandler.java",
"license": "gpl-3.0",
"size": 5030
} | [
"android.view.MenuItem"
] | import android.view.MenuItem; | import android.view.*; | [
"android.view"
] | android.view; | 2,769,030 |
public static Object readField(final Field field, final Object target, final boolean forceAccess) throws IllegalAccessException {
if (field == null) {
throw new IllegalArgumentException("The field must not be null");
}
if (forceAccess && !field.isAccessible()) {
field... | static Object function(final Field field, final Object target, final boolean forceAccess) throws IllegalAccessException { if (field == null) { throw new IllegalArgumentException(STR); } if (forceAccess && !field.isAccessible()) { field.setAccessible(true); } else { MemberUtils.setAccessibleWorkaround(field); } return f... | /**
* Read a Field.
* @param field the field to use
* @param target the object to call on, may be null for static fields
* @param forceAccess whether to break scope restrictions using the
* <code>setAccessible</code> method.
* @return the field value
* @throws IllegalArgumentExcep... | Read a Field | readField | {
"repo_name": "zycgit/configuration",
"path": "utils/util/reflect/FieldUtils.java",
"license": "apache-2.0",
"size": 26713
} | [
"java.lang.reflect.Field"
] | import java.lang.reflect.Field; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 1,345,083 |
public WebhookEventSubscriptionDestination withAzureActiveDirectoryTenantId(String azureActiveDirectoryTenantId) {
if (this.innerProperties() == null) {
this.innerProperties = new WebhookEventSubscriptionDestinationProperties();
}
this.innerProperties().withAzureActiveDirectoryTe... | WebhookEventSubscriptionDestination function(String azureActiveDirectoryTenantId) { if (this.innerProperties() == null) { this.innerProperties = new WebhookEventSubscriptionDestinationProperties(); } this.innerProperties().withAzureActiveDirectoryTenantId(azureActiveDirectoryTenantId); return this; } | /**
* Set the azureActiveDirectoryTenantId property: The Azure Active Directory Tenant ID to get the access token that
* will be included as the bearer token in delivery requests.
*
* @param azureActiveDirectoryTenantId the azureActiveDirectoryTenantId value to set.
* @return the WebhookEventSu... | Set the azureActiveDirectoryTenantId property: The Azure Active Directory Tenant ID to get the access token that will be included as the bearer token in delivery requests | withAzureActiveDirectoryTenantId | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/WebhookEventSubscriptionDestination.java",
"license": "mit",
"size": 8500
} | [
"com.azure.resourcemanager.eventgrid.fluent.models.WebhookEventSubscriptionDestinationProperties"
] | import com.azure.resourcemanager.eventgrid.fluent.models.WebhookEventSubscriptionDestinationProperties; | import com.azure.resourcemanager.eventgrid.fluent.models.*; | [
"com.azure.resourcemanager"
] | com.azure.resourcemanager; | 1,331,814 |
@Override
public Control getControl2() {
return getControl();
} | Control function() { return getControl(); } | /**
* Returns the control for this manager.
*
* @return the control, or <code>null</code> if none
* @since 3.2
*/ | Returns the control for this manager | getControl2 | {
"repo_name": "css-iter/org.csstudio.iter",
"path": "plugins/org.eclipse.jface/src/org/eclipse/jface/internal/provisional/action/CoolBarManager2.java",
"license": "epl-1.0",
"size": 2775
} | [
"org.eclipse.swt.widgets.Control"
] | import org.eclipse.swt.widgets.Control; | import org.eclipse.swt.widgets.*; | [
"org.eclipse.swt"
] | org.eclipse.swt; | 2,467,064 |
public static Toolbar inflate(final Activity activity, final int stubId) {
ViewStub stub = activity.findViewById(stubId);
stub.setLayoutResource(ColorPref.getAppBarLayout(activity));
AppBarLayout appBarLayout = (AppBarLayout) stub.inflate();
Toolbar toolbar = (Toolbar) appBarLayout.g... | static Toolbar function(final Activity activity, final int stubId) { ViewStub stub = activity.findViewById(stubId); stub.setLayoutResource(ColorPref.getAppBarLayout(activity)); AppBarLayout appBarLayout = (AppBarLayout) stub.inflate(); Toolbar toolbar = (Toolbar) appBarLayout.getChildAt(0); toolbar.setBackgroundColor(C... | /**
* Inflate AppBar layout and the toolbar according to the primary color
* AppBar theme.
*
* @param activity Activity
* @param stubId ViewStub id
* @return Inflated toolbar
*/ | Inflate AppBar layout and the toolbar according to the primary color AppBar theme | inflate | {
"repo_name": "Alkisum/Notepad",
"path": "app/src/main/java/com/alkisum/android/cloudnotes/ui/AppBar.java",
"license": "mit",
"size": 1378
} | [
"android.app.Activity",
"android.view.ViewStub",
"androidx.appcompat.widget.Toolbar",
"com.google.android.material.appbar.AppBarLayout"
] | import android.app.Activity; import android.view.ViewStub; import androidx.appcompat.widget.Toolbar; import com.google.android.material.appbar.AppBarLayout; | import android.app.*; import android.view.*; import androidx.appcompat.widget.*; import com.google.android.material.appbar.*; | [
"android.app",
"android.view",
"androidx.appcompat",
"com.google.android"
] | android.app; android.view; androidx.appcompat; com.google.android; | 1,822,011 |
public IRunner getRunner(String runnerId) {
return getDescriptor(runnerId).getRunner();
} | IRunner function(String runnerId) { return getDescriptor(runnerId).getRunner(); } | /**
* Returns the registered runner with the given ID. Throws an {@link IllegalArgumentException} if not found.
*/ | Returns the registered runner with the given ID. Throws an <code>IllegalArgumentException</code> if not found | getRunner | {
"repo_name": "lbeurerkellner/n4js",
"path": "plugins/org.eclipse.n4js.runner/src/org/eclipse/n4js/runner/extension/RunnerRegistry.java",
"license": "epl-1.0",
"size": 4474
} | [
"org.eclipse.n4js.runner.IRunner"
] | import org.eclipse.n4js.runner.IRunner; | import org.eclipse.n4js.runner.*; | [
"org.eclipse.n4js"
] | org.eclipse.n4js; | 1,569,325 |
public NJudgeOrder parse(final dip.world.Map map,
final OrderFactory orderFactory, final Phase.PhaseType phaseType,
final String line)
throws OrderException
{
// create order parsing context
final ParseContext pc = new ParseContext(map, orderFactory, phaseType, line);
// parse results. This also remo... | NJudgeOrder function(final dip.world.Map map, final OrderFactory orderFactory, final Phase.PhaseType phaseType, final String line) throws OrderException { final ParseContext pc = new ParseContext(map, orderFactory, phaseType, line); final ArrayList resultList = new ArrayList(5); final String newOrderLine = removeTraili... | /**
* Parse a single line order.
* <p>
* Null arguments are not permitted, except for phaseType.
* If phaseType is Phase.PhaseType.RETREAT, "Move" format orders will
* be made into Retreat orders, and convoyed moves will be disallowed.
*/ | Parse a single line order. Null arguments are not permitted, except for phaseType. If phaseType is Phase.PhaseType.RETREAT, "Move" format orders will be made into Retreat orders, and convoyed moves will be disallowed | parse | {
"repo_name": "thechrisjohnson/JDip",
"path": "src/dip/order/NJudgeOrderParser.java",
"license": "gpl-2.0",
"size": 38298
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 76,587 |
public static void validateFactoryOptions(
Set<ConfigOption<?>> requiredOptions,
Set<ConfigOption<?>> optionalOptions,
ReadableConfig options) {
// currently Flink's options have no validation feature which is why we access them eagerly
// to provoke a parsing err... | static void function( Set<ConfigOption<?>> requiredOptions, Set<ConfigOption<?>> optionalOptions, ReadableConfig options) { final List<String> missingRequiredOptions = requiredOptions.stream() .filter( option -> allKeys(option) .noneMatch(k -> k.contains(PLACEHOLDER_SYMBOL))) .filter(option -> readOption(options, optio... | /**
* Validates the required options and optional options.
*
* <p>Note: It does not check for left-over options.
*/ | Validates the required options and optional options. Note: It does not check for left-over options | validateFactoryOptions | {
"repo_name": "wwjiang007/flink",
"path": "flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/FactoryUtil.java",
"license": "apache-2.0",
"size": 59280
} | [
"java.util.List",
"java.util.Set",
"java.util.stream.Collectors",
"org.apache.flink.configuration.ConfigOption",
"org.apache.flink.configuration.ReadableConfig",
"org.apache.flink.table.api.ValidationException"
] | import java.util.List; import java.util.Set; import java.util.stream.Collectors; import org.apache.flink.configuration.ConfigOption; import org.apache.flink.configuration.ReadableConfig; import org.apache.flink.table.api.ValidationException; | import java.util.*; import java.util.stream.*; import org.apache.flink.configuration.*; import org.apache.flink.table.api.*; | [
"java.util",
"org.apache.flink"
] | java.util; org.apache.flink; | 1,292,257 |
private double getLengthGeschlAbschn(final int gewId, final double from, final double till) {
double length = 0;
for (final KatasterGewObj tmp : parts) {
if (tmp.getId() == gewId) {
if (tmp.getArt().equals("g")) {
length += tmp.getLengthInGewPart(gewI... | double function(final int gewId, final double from, final double till) { double length = 0; for (final KatasterGewObj tmp : parts) { if (tmp.getId() == gewId) { if (tmp.getArt().equals("g")) { length += tmp.getLengthInGewPart(gewId, from, till); } } } return length; } | /**
* DOCUMENT ME!
*
* @param gewId DOCUMENT ME!
* @param from DOCUMENT ME!
* @param till DOCUMENT ME!
*
* @return DOCUMENT ME!
*/ | DOCUMENT ME | getLengthGeschlAbschn | {
"repo_name": "cismet/watergis-client",
"path": "src/main/java/de/cismet/watergis/reports/KatasterGewaesserReport.java",
"license": "lgpl-3.0",
"size": 87202
} | [
"de.cismet.watergis.reports.types.KatasterGewObj"
] | import de.cismet.watergis.reports.types.KatasterGewObj; | import de.cismet.watergis.reports.types.*; | [
"de.cismet.watergis"
] | de.cismet.watergis; | 1,760,179 |
public DocFilePersistence getDocFilePersistence() {
return docFilePersistence;
} | DocFilePersistence function() { return docFilePersistence; } | /**
* Returns the doc file persistence.
*
* @return the doc file persistence
*/ | Returns the doc file persistence | getDocFilePersistence | {
"repo_name": "thongdv/OEPv2",
"path": "portlets/oep-core-dossiermgt-portlet/docroot/WEB-INF/src/org/oep/core/dossiermgt/service/base/DossierFolder2RoleServiceBaseImpl.java",
"license": "apache-2.0",
"size": 36759
} | [
"org.oep.core.dossiermgt.service.persistence.DocFilePersistence"
] | import org.oep.core.dossiermgt.service.persistence.DocFilePersistence; | import org.oep.core.dossiermgt.service.persistence.*; | [
"org.oep.core"
] | org.oep.core; | 1,984,051 |
public int getGenerationSteps() {
int steps = 0;
if (introspectedTables != null) {
for (IntrospectedTable introspectedTable : introspectedTables) {
steps += introspectedTable.getGenerationSteps();
}
}
return steps;
} | int function() { int steps = 0; if (introspectedTables != null) { for (IntrospectedTable introspectedTable : introspectedTables) { steps += introspectedTable.getGenerationSteps(); } } return steps; } | /**
* Gets the generation steps.
*
* @return the generation steps
*/ | Gets the generation steps | getGenerationSteps | {
"repo_name": "victzero/ezjs-generator",
"path": "generator/src/main/java/me/ezjs/generator/mybatis/config/Context.java",
"license": "apache-2.0",
"size": 25193
} | [
"me.ezjs.generator.mybatis.api.IntrospectedTable"
] | import me.ezjs.generator.mybatis.api.IntrospectedTable; | import me.ezjs.generator.mybatis.api.*; | [
"me.ezjs.generator"
] | me.ezjs.generator; | 386,751 |
public static PercentType getPercentTypeFromDimLevel(int value) {
value = Math.min(value, 31);
return new PercentType(BigDecimal.valueOf(value).multiply(BigDecimal.valueOf(100))
.divide(BigDecimal.valueOf(31), 0, BigDecimal.ROUND_UP).intValue());
} | static PercentType function(int value) { value = Math.min(value, 31); return new PercentType(BigDecimal.valueOf(value).multiply(BigDecimal.valueOf(100)) .divide(BigDecimal.valueOf(31), 0, BigDecimal.ROUND_UP).intValue()); } | /**
* Convert a 0-31 scale value to a percent type.
*
* @param pt
* percent type to convert
* @return converted value 0-31
*/ | Convert a 0-31 scale value to a percent type | getPercentTypeFromDimLevel | {
"repo_name": "cvanorman/openhab",
"path": "bundles/binding/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting5Message.java",
"license": "epl-1.0",
"size": 13898
} | [
"java.math.BigDecimal",
"org.openhab.core.library.types.PercentType"
] | import java.math.BigDecimal; import org.openhab.core.library.types.PercentType; | import java.math.*; import org.openhab.core.library.types.*; | [
"java.math",
"org.openhab.core"
] | java.math; org.openhab.core; | 2,741,742 |
void setMediaItems(List<MediaItem> mediaItems, int startWindowIndex, long startPositionMs); | void setMediaItems(List<MediaItem> mediaItems, int startWindowIndex, long startPositionMs); | /**
* Clears the playlist and adds the specified {@link MediaItem MediaItems}.
*
* @param mediaItems The new {@link MediaItem MediaItems}.
* @param startWindowIndex The window index to start playback from. If {@link C#INDEX_UNSET} is
* passed, the current position is not reset.
* @param startPosit... | Clears the playlist and adds the specified <code>MediaItem MediaItems</code> | setMediaItems | {
"repo_name": "amzn/exoplayer-amazon-port",
"path": "library/common/src/main/java/com/google/android/exoplayer2/Player.java",
"license": "apache-2.0",
"size": 62371
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,578,760 |
JcrPackageManager getPackageManager(Session session); | JcrPackageManager getPackageManager(Session session); | /**
* Returns a repository based package manager.
* @param session repository session
* @return the package manager
*/ | Returns a repository based package manager | getPackageManager | {
"repo_name": "apache/jackrabbit-filevault",
"path": "vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/Packaging.java",
"license": "apache-2.0",
"size": 4433
} | [
"javax.jcr.Session"
] | import javax.jcr.Session; | import javax.jcr.*; | [
"javax.jcr"
] | javax.jcr; | 2,486,187 |
public ModelDoNotHash_ onVisibilityChanged(
OnModelVisibilityChangedListener<ModelDoNotHash_, Object> listener) {
onMutation();
this.onModelVisibilityChangedListener_epoxyGeneratedModel = listener;
return this;
} | ModelDoNotHash_ function( OnModelVisibilityChangedListener<ModelDoNotHash_, Object> listener) { onMutation(); this.onModelVisibilityChangedListener_epoxyGeneratedModel = listener; return this; } | /**
* Register a listener that will be called when this model visibility has changed.
* <p>
* The listener will contribute to this model's hashCode state per the {@link
* com.airbnb.epoxy.EpoxyAttribute.Option#DoNotHash} rules.
*/ | Register a listener that will be called when this model visibility has changed. The listener will contribute to this model's hashCode state per the <code>com.airbnb.epoxy.EpoxyAttribute.Option#DoNotHash</code> rules | onVisibilityChanged | {
"repo_name": "airbnb/epoxy",
"path": "epoxy-processortest/src/test/resources/ModelDoNotHash_.java",
"license": "apache-2.0",
"size": 8835
} | [
"java.lang.Object"
] | import java.lang.Object; | import java.lang.*; | [
"java.lang"
] | java.lang; | 2,892,055 |
public static void setAlarm(Context context, int alarmID) {
cancelAlarm(context, alarmID);
Alarm alarm = getAlarm(alarmID);
if (alarm.isGroupAlarm()) {
setAlarm(context, getNextAlarmTime(alarm), createIntent(context, alarm, ParseHelper.getGroupFromAlarm(alarm)));
} else ... | static void function(Context context, int alarmID) { cancelAlarm(context, alarmID); Alarm alarm = getAlarm(alarmID); if (alarm.isGroupAlarm()) { setAlarm(context, getNextAlarmTime(alarm), createIntent(context, alarm, ParseHelper.getGroupFromAlarm(alarm))); } else { setAlarm(context, getNextAlarmTime(alarm), createInten... | /**
* Sets a single Alarm in the database to ring.
*
* @param context The Application Context.
* @param alarmID The ID of the alarm to set.
*/ | Sets a single Alarm in the database to ring | setAlarm | {
"repo_name": "AlexanderHederstaf/groupalarm",
"path": "GroupAlarm/app/src/main/java/com/groupalarm/asijge/groupalarm/AlarmManaging/AlarmHelper.java",
"license": "gpl-2.0",
"size": 13370
} | [
"android.content.Context",
"com.groupalarm.asijge.groupalarm.Data"
] | import android.content.Context; import com.groupalarm.asijge.groupalarm.Data; | import android.content.*; import com.groupalarm.asijge.groupalarm.*; | [
"android.content",
"com.groupalarm.asijge"
] | android.content; com.groupalarm.asijge; | 1,511,262 |
Object parse(Reader input, JsonDecoder decoder) throws JsonParseException; | Object parse(Reader input, JsonDecoder decoder) throws JsonParseException; | /**
* Walk along the json <code>input</code> calling methods on
* <code>decoder</code> as we discover new tokens in the input.
* @param input The json data source
* @param decoder The decoder to turn parse events into a data tree.
* @return The object constructed by the {@link JsonDecoder}.
... | Walk along the json <code>input</code> calling methods on <code>decoder</code> as we discover new tokens in the input | parse | {
"repo_name": "TheOpenCloudEngine/metaworks",
"path": "metaworks-dwr/core/api/main/java/org/directwebremoting/json/parse/JsonParser.java",
"license": "mit",
"size": 1301
} | [
"java.io.Reader"
] | import java.io.Reader; | import java.io.*; | [
"java.io"
] | java.io; | 1,439,478 |
public static JobResource newJobResource() {
return new JobResource(newJobConfiguration());
} | static JobResource function() { return new JobResource(newJobConfiguration()); } | /**
* Creates a dummy job resource.
*
* @return a dummy job resource.
*/ | Creates a dummy job resource | newJobResource | {
"repo_name": "ALIADA/aliada-tool",
"path": "aliada/aliada-rdfizer/src/test/java/eu/aliada/rdfizer/TestUtils.java",
"license": "gpl-3.0",
"size": 1499
} | [
"eu.aliada.rdfizer.rest.JobResource"
] | import eu.aliada.rdfizer.rest.JobResource; | import eu.aliada.rdfizer.rest.*; | [
"eu.aliada.rdfizer"
] | eu.aliada.rdfizer; | 1,190,203 |
public PermalinkList getPermalinks() {
// TODO: shall we cache this?
PermalinkList permalinks = new PermalinkList(Permalink.BUILTIN);
for (PermalinkProjectAction ppa : getActions(PermalinkProjectAction.class)) {
permalinks.addAll(ppa.getPermalinks());
}
return per... | PermalinkList function() { PermalinkList permalinks = new PermalinkList(Permalink.BUILTIN); for (PermalinkProjectAction ppa : getActions(PermalinkProjectAction.class)) { permalinks.addAll(ppa.getPermalinks()); } return permalinks; } | /**
* Gets all the {@link Permalink}s defined for this job.
*
* @return never null
*/ | Gets all the <code>Permalink</code>s defined for this job | getPermalinks | {
"repo_name": "ErikVerheul/jenkins",
"path": "core/src/main/java/hudson/model/Job.java",
"license": "mit",
"size": 61181
} | [
"hudson.model.PermalinkProjectAction"
] | import hudson.model.PermalinkProjectAction; | import hudson.model.*; | [
"hudson.model"
] | hudson.model; | 2,438,541 |
private static Consumer<ResultSet> sortedResultSetChecker(String column,
RelFieldCollation.Direction direction) {
Objects.requireNonNull(column, "column");
return rset -> {
try {
final List<Comparable<?>> states = new ArrayList<>();
while (rset.next()) {
Object object = r... | static Consumer<ResultSet> function(String column, RelFieldCollation.Direction direction) { Objects.requireNonNull(column, STR); return rset -> { try { final List<Comparable<?>> states = new ArrayList<>(); while (rset.next()) { Object object = rset.getObject(column); if (object != null && !(object instanceof Comparable... | /**
* Throws {@code AssertionError} if result set is not sorted by {@code column}.
* {@code null}s are ignored.
*
* @param column column to be extracted (as comparable object).
* @param direction ascending / descending
* @return consumer which throws exception
*/ | Throws AssertionError if result set is not sorted by column. nulls are ignored | sortedResultSetChecker | {
"repo_name": "datametica/calcite",
"path": "elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/ElasticSearchAdapterTest.java",
"license": "apache-2.0",
"size": 30693
} | [
"java.sql.ResultSet",
"java.sql.SQLException",
"java.util.ArrayList",
"java.util.List",
"java.util.Locale",
"java.util.Objects",
"java.util.function.Consumer",
"org.apache.calcite.rel.RelFieldCollation",
"org.apache.calcite.util.TestUtil"
] | import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import java.util.Locale; import java.util.Objects; import java.util.function.Consumer; import org.apache.calcite.rel.RelFieldCollation; import org.apache.calcite.util.TestUtil; | import java.sql.*; import java.util.*; import java.util.function.*; import org.apache.calcite.rel.*; import org.apache.calcite.util.*; | [
"java.sql",
"java.util",
"org.apache.calcite"
] | java.sql; java.util; org.apache.calcite; | 2,234,831 |
public List<Name> getReferencesAt(Node site) {
Preconditions.checkArgument(
site.isGetProp() || site.isName());
List<Name> result = new ArrayList<>();
for (Name target : referenceMap.get(site)) {
result.add(target);
}
return result;
} | List<Name> function(Node site) { Preconditions.checkArgument( site.isGetProp() site.isName()); List<Name> result = new ArrayList<>(); for (Name target : referenceMap.get(site)) { result.add(target); } return result; } | /**
* Retrieves a list of all possible Names that this site is referring to.
*/ | Retrieves a list of all possible Names that this site is referring to | getReferencesAt | {
"repo_name": "zombiezen/cardcpx",
"path": "third_party/closure-compiler/src/com/google/javascript/jscomp/NameReferenceGraph.java",
"license": "apache-2.0",
"size": 12002
} | [
"com.google.common.base.Preconditions",
"com.google.javascript.rhino.Node",
"java.util.ArrayList",
"java.util.List"
] | import com.google.common.base.Preconditions; import com.google.javascript.rhino.Node; import java.util.ArrayList; import java.util.List; | import com.google.common.base.*; import com.google.javascript.rhino.*; import java.util.*; | [
"com.google.common",
"com.google.javascript",
"java.util"
] | com.google.common; com.google.javascript; java.util; | 1,371,210 |
public static ApprovalDialog getDialog(Frame owner) {
return getDialog(owner, true);
} | static ApprovalDialog function(Frame owner) { return getDialog(owner, true); } | /**
* Returns a basic (modal) approval dialog (ok/cancel).
*
* @param owner the owner of the dialog
*/ | Returns a basic (modal) approval dialog (ok/cancel) | getDialog | {
"repo_name": "waikato-datamining/adams-base",
"path": "adams-core/src/main/java/adams/gui/dialog/ApprovalDialog.java",
"license": "gpl-3.0",
"size": 15461
} | [
"java.awt.Frame"
] | import java.awt.Frame; | import java.awt.*; | [
"java.awt"
] | java.awt; | 1,395,049 |
private void decorateConf() {
this.conf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER,
this.conf.getInt("replication.sink.client.retries.number", 4));
this.conf.setInt(HConstants.HBASE_CLIENT_OPERATION_TIMEOUT,
this.conf.getInt("replication.sink.client.ops.timeout", 10000));
String replica... | void function() { this.conf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, this.conf.getInt(STR, 4)); this.conf.setInt(HConstants.HBASE_CLIENT_OPERATION_TIMEOUT, this.conf.getInt(STR, 10000)); String replicationCodec = this.conf.get(HConstants.REPLICATION_CODEC_CONF_KEY); if (StringUtils.isNotEmpty(replicationCodec)) {... | /**
* decorate the Configuration object to make replication more receptive to delays:
* lessen the timeout and numTries.
*/ | decorate the Configuration object to make replication more receptive to delays: lessen the timeout and numTries | decorateConf | {
"repo_name": "ndimiduk/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSink.java",
"license": "apache-2.0",
"size": 19903
} | [
"org.apache.commons.lang3.StringUtils",
"org.apache.hadoop.hbase.HConstants"
] | import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.hbase.HConstants; | import org.apache.commons.lang3.*; import org.apache.hadoop.hbase.*; | [
"org.apache.commons",
"org.apache.hadoop"
] | org.apache.commons; org.apache.hadoop; | 2,515,507 |
@Test
public void fromFiles_Single_toFiles() throws IOException
{
// given
File f1 = new File("src/test/resources/Thumbnailator/grid.png");
File outFile1 = new File("src/test/resources/Thumbnailator/thumbnail.grid.png");
outFile1.deleteOnExit();
// when
Thumbnails.fromFiles(Arrays.asList(... | void function() throws IOException { File f1 = new File(STR); File outFile1 = new File(STR); outFile1.deleteOnExit(); Thumbnails.fromFiles(Arrays.asList(f1)) .size(50, 50) .toFiles(Rename.PREFIX_DOT_THUMBNAIL); BufferedImage fromFileImage1 = ImageIO.read(outFile1); assertEquals(50, fromFileImage1.getWidth()); assertEqu... | /**
* Test for the {@link Thumbnails.Builder} class where,
* <ol>
* <li>Thumbnails.fromFiles([File])</li>
* <li>toFiles(Rename)</li>
* </ol>
* and the expected outcome is,
* <ol>
* <li>An image is generated and written to a file whose name is generated
* from the Rename object.</li>
* </ol... | Test for the <code>Thumbnails.Builder</code> class where, Thumbnails.fromFiles([File]) toFiles(Rename) and the expected outcome is, An image is generated and written to a file whose name is generated from the Rename object. | fromFiles_Single_toFiles | {
"repo_name": "passerby4j/thumbnailator",
"path": "src/test/java/net/coobird/thumbnailator/ThumbnailsBuilderInputOutputTest.java",
"license": "mit",
"size": 303967
} | [
"java.awt.image.BufferedImage",
"java.io.File",
"java.io.IOException",
"java.util.Arrays",
"javax.imageio.ImageIO",
"net.coobird.thumbnailator.name.Rename",
"org.junit.Assert"
] | import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.util.Arrays; import javax.imageio.ImageIO; import net.coobird.thumbnailator.name.Rename; import org.junit.Assert; | import java.awt.image.*; import java.io.*; import java.util.*; import javax.imageio.*; import net.coobird.thumbnailator.name.*; import org.junit.*; | [
"java.awt",
"java.io",
"java.util",
"javax.imageio",
"net.coobird.thumbnailator",
"org.junit"
] | java.awt; java.io; java.util; javax.imageio; net.coobird.thumbnailator; org.junit; | 272,278 |
private Bundle installBundleRecord(String location, int startLevel) {
try {
// install
Bundle installedBundle = bundleContext.installBundle(location);
// set start level
startLevelService.setBundleStartLevel(installedBundle, startLevel);
... | Bundle function(String location, int startLevel) { try { Bundle installedBundle = bundleContext.installBundle(location); startLevelService.setBundleStartLevel(installedBundle, startLevel); return installedBundle; } catch (BundleException e) { log.error(STR + location); } return null; } | /**
* install the bundle to framework
* @param location
* @param startLevel
* @return the bundle object of the installed bundle. null if install failed.
*/ | install the bundle to framework | installBundleRecord | {
"repo_name": "apache/geronimo",
"path": "framework/modules/geronimo-bundle-recorder/src/main/java/org/apache/geronimo/system/bundle/BundleRecorderGBean.java",
"license": "apache-2.0",
"size": 9668
} | [
"org.osgi.framework.Bundle",
"org.osgi.framework.BundleException"
] | import org.osgi.framework.Bundle; import org.osgi.framework.BundleException; | import org.osgi.framework.*; | [
"org.osgi.framework"
] | org.osgi.framework; | 828,155 |
Observable<SiteExtensionInfo> listSiteExtensionsAsync(final String resourceGroupName, final String name); | Observable<SiteExtensionInfo> listSiteExtensionsAsync(final String resourceGroupName, final String name); | /**
* Get list of siteextensions for a web site, or a deployment slot.
* Description for Get list of siteextensions for a web site, or a deployment slot.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Site name.
* @throws IllegalArgumen... | Get list of siteextensions for a web site, or a deployment slot. Description for Get list of siteextensions for a web site, or a deployment slot | listSiteExtensionsAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/appservice/mgmt-v2019_08_01/src/main/java/com/microsoft/azure/management/appservice/v2019_08_01/WebApps.java",
"license": "mit",
"size": 242740
} | [
"com.microsoft.azure.management.appservice.v2019_08_01.SiteExtensionInfo"
] | import com.microsoft.azure.management.appservice.v2019_08_01.SiteExtensionInfo; | import com.microsoft.azure.management.appservice.v2019_08_01.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 665,544 |
AbstractProject<?, ?> project = build.getProject();
if (project instanceof BuildableItemWithBuildWrappers) {
BuildableItemWithBuildWrappers biwbw = (BuildableItemWithBuildWrappers) project;
for (BuildWrapper bw : biwbw.getBuildWrappersList())
bw.preCheckout(build... | AbstractProject<?, ?> project = build.getProject(); if (project instanceof BuildableItemWithBuildWrappers) { BuildableItemWithBuildWrappers biwbw = (BuildableItemWithBuildWrappers) project; for (BuildWrapper bw : biwbw.getBuildWrappersList()) bw.preCheckout(build,launcher,listener); } } | /**
* Performs the pre checkout step.
*
* This method is called by the {@link Executor} that's carrying out the build.
*
* @param build
* Build being in progress. Never null.
* @param launcher
* Allows you to launch process on the node where the build is actually runn... | Performs the pre checkout step. This method is called by the <code>Executor</code> that's carrying out the build | preCheckout | {
"repo_name": "lindzh/jenkins",
"path": "core/src/main/java/jenkins/scm/SCMCheckoutStrategy.java",
"license": "mit",
"size": 3949
} | [
"hudson.model.AbstractProject",
"hudson.model.BuildableItemWithBuildWrappers",
"hudson.tasks.BuildWrapper"
] | import hudson.model.AbstractProject; import hudson.model.BuildableItemWithBuildWrappers; import hudson.tasks.BuildWrapper; | import hudson.model.*; import hudson.tasks.*; | [
"hudson.model",
"hudson.tasks"
] | hudson.model; hudson.tasks; | 1,108,005 |
void transformMatrixToGlobal(Matrix m) {
m.preTranslate(mAttachInfo.mWindowLeft, mAttachInfo.mWindowTop);
} | void transformMatrixToGlobal(Matrix m) { m.preTranslate(mAttachInfo.mWindowLeft, mAttachInfo.mWindowTop); } | /**
* Modifies the input matrix such that it maps view-local coordinates to
* on-screen coordinates.
*
* @param m input matrix to modify
*/ | Modifies the input matrix such that it maps view-local coordinates to on-screen coordinates | transformMatrixToGlobal | {
"repo_name": "xorware/android_frameworks_base",
"path": "core/java/android/view/ViewRootImpl.java",
"license": "apache-2.0",
"size": 312532
} | [
"android.graphics.Matrix"
] | import android.graphics.Matrix; | import android.graphics.*; | [
"android.graphics"
] | android.graphics; | 382,884 |
@Test(expected=IllegalArgumentException.class)
public void testTypeWithNull()
{
final DataFlowParam param = new DataFlowParam("int");
param.setType(null);
} | @Test(expected=IllegalArgumentException.class) void function() { final DataFlowParam param = new DataFlowParam("int"); param.setType(null); } | /**
* Tests the type with null param.
*/ | Tests the type with null param | testTypeWithNull | {
"repo_name": "kayahr/jollada",
"path": "src/test/java/de/ailis/jollada/model/DataFlowParamTest.java",
"license": "mit",
"size": 2466
} | [
"de.ailis.jollada.model.DataFlowParam",
"org.junit.Test"
] | import de.ailis.jollada.model.DataFlowParam; import org.junit.Test; | import de.ailis.jollada.model.*; import org.junit.*; | [
"de.ailis.jollada",
"org.junit"
] | de.ailis.jollada; org.junit; | 2,868,990 |
if(statusCodes == null || statusCodes.size() == 0){
throw new IdentityException("No Status Values");
}
response.setIssuer(SAMLSSOUtil.getIssuer());
Status status = new StatusBuilder().buildObject();
StatusCode statusCode = null;
for(String statCode:statusCodes){
... | if(statusCodes == null statusCodes.size() == 0){ throw new IdentityException(STR); } response.setIssuer(SAMLSSOUtil.getIssuer()); Status status = new StatusBuilder().buildObject(); StatusCode statusCode = null; for(String statCode:statusCodes){ statusCode = buildStatusCode(statCode, statusCode); } status.setStatusCode(... | /**
* Build the error response
*
* @param inResponseToID
* @param statusCodes
* @param statusMsg
* @return
*/ | Build the error response | buildResponse | {
"repo_name": "maheshika/carbon-identity",
"path": "components/identity/org.wso2.carbon.identity.sso.saml/src/main/java/org/wso2/carbon/identity/sso/saml/builders/ErrorResponseBuilder.java",
"license": "apache-2.0",
"size": 4056
} | [
"org.joda.time.DateTime",
"org.opensaml.common.SAMLVersion",
"org.opensaml.saml2.core.Status",
"org.opensaml.saml2.core.StatusCode",
"org.opensaml.saml2.core.impl.StatusBuilder",
"org.wso2.carbon.identity.base.IdentityException",
"org.wso2.carbon.identity.sso.saml.util.SAMLSSOUtil"
] | import org.joda.time.DateTime; import org.opensaml.common.SAMLVersion; import org.opensaml.saml2.core.Status; import org.opensaml.saml2.core.StatusCode; import org.opensaml.saml2.core.impl.StatusBuilder; import org.wso2.carbon.identity.base.IdentityException; import org.wso2.carbon.identity.sso.saml.util.SAMLSSOUtil; | import org.joda.time.*; import org.opensaml.common.*; import org.opensaml.saml2.core.*; import org.opensaml.saml2.core.impl.*; import org.wso2.carbon.identity.base.*; import org.wso2.carbon.identity.sso.saml.util.*; | [
"org.joda.time",
"org.opensaml.common",
"org.opensaml.saml2",
"org.wso2.carbon"
] | org.joda.time; org.opensaml.common; org.opensaml.saml2; org.wso2.carbon; | 775,604 |
public void insertBaseballCards(List<BaseballCard> cards) throws BBCTIOException; | void function(List<BaseballCard> cards) throws BBCTIOException; | /**
* Insert a batch of {@link BaseballCard}s to the underlying persistent
* storage.
*
* @param cards The {@link BaseballCard}s to insert.
* @throws BBCTIOException If any I/O errors occur while inserting.
*/ | Insert a batch of <code>BaseballCard</code>s to the underlying persistent storage | insertBaseballCards | {
"repo_name": "BaseballCardTracker/bbct",
"path": "swing/src/main/java/bbct/common/data/BaseballCardIO.java",
"license": "gpl-3.0",
"size": 5354
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 120,012 |
private IgniteInternalFuture<V> getAsync0(KeyCacheObject key,
boolean forcePrimary,
String taskName,
boolean deserializeBinary,
boolean recovery,
boolean readRepair,
@Nullable ExpiryPolicy expiryPlc,
boolean skipVals,
boolean skipStore,
boolean... | IgniteInternalFuture<V> function(KeyCacheObject key, boolean forcePrimary, String taskName, boolean deserializeBinary, boolean recovery, boolean readRepair, @Nullable ExpiryPolicy expiryPlc, boolean skipVals, boolean skipStore, boolean needVer ) { AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion(... | /**
* Entry point to all public API single get methods.
*
* @param key Key.
* @param forcePrimary Force primary flag.
* @param taskName Task name.
* @param deserializeBinary Deserialize binary flag.
* @param readRepair Read Repair flag.
* @param expiryPlc Expiry policy.
* @p... | Entry point to all public API single get methods | getAsync0 | {
"repo_name": "chandresh-pancholi/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java",
"license": "apache-2.0",
"size": 138878
} | [
"java.util.Collections",
"javax.cache.expiry.ExpiryPolicy",
"org.apache.ignite.internal.IgniteInternalFuture",
"org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion",
"org.apache.ignite.internal.processors.cache.IgniteCacheExpiryPolicy",
"org.apache.ignite.internal.processors.cache.KeyCa... | import java.util.Collections; import javax.cache.expiry.ExpiryPolicy; import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; import org.apache.ignite.internal.processors.cache.IgniteCacheExpiryPolicy; import org.apache.ignite.internal.proce... | import java.util.*; import javax.cache.expiry.*; import org.apache.ignite.internal.*; import org.apache.ignite.internal.processors.affinity.*; import org.apache.ignite.internal.processors.cache.*; import org.apache.ignite.internal.processors.cache.distributed.dht.*; import org.apache.ignite.internal.processors.cache.di... | [
"java.util",
"javax.cache",
"org.apache.ignite",
"org.jetbrains.annotations"
] | java.util; javax.cache; org.apache.ignite; org.jetbrains.annotations; | 938,316 |
@ServiceMethod(returns = ReturnType.SINGLE)
void resyncReplication(String resourceGroupName, String accountName, String poolName, String volumeName); | @ServiceMethod(returns = ReturnType.SINGLE) void resyncReplication(String resourceGroupName, String accountName, String poolName, String volumeName); | /**
* Resync the connection on the destination volume. If the operation is ran on the source volume it will
* reverse-resync the connection and sync from destination to source.
*
* @param resourceGroupName The name of the resource group.
* @param accountName The name of the NetApp account.
... | Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from destination to source | resyncReplication | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/VolumesClient.java",
"license": "mit",
"size": 47258
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; | import com.azure.core.annotation.*; | [
"com.azure.core"
] | com.azure.core; | 1,544,457 |
public boolean hasTriangleCollision(TriMesh toCheck, int requiredOnBits) {
CollisionTree thisCT = CollisionTreeManager.getInstance()
.getCollisionTree(this);
CollisionTree checkCT = CollisionTreeManager.getInstance()
.getCollisionTree(toCheck);
if (thisCT == ... | boolean function(TriMesh toCheck, int requiredOnBits) { CollisionTree thisCT = CollisionTreeManager.getInstance() .getCollisionTree(this); CollisionTree checkCT = CollisionTreeManager.getInstance() .getCollisionTree(toCheck); if (thisCT == null checkCT == null !isCollidable(requiredOnBits) !toCheck.isCollidable(require... | /**
* This function checks for intersection between this trimesh and the given
* one. On the first intersection, true is returned.
*
* @param toCheck The intersection testing mesh.
* @param requiredOnBits Collision will only be considered if both 'this'
* and 'toCheck' have these b... | This function checks for intersection between this trimesh and the given one. On the first intersection, true is returned | hasTriangleCollision | {
"repo_name": "accelazh/ThreeBodyProblem",
"path": "lib/jME2_0_1-Stable/src/com/jme/scene/TriMesh.java",
"license": "mit",
"size": 21869
} | [
"com.jme.bounding.CollisionTree",
"com.jme.bounding.CollisionTreeManager"
] | import com.jme.bounding.CollisionTree; import com.jme.bounding.CollisionTreeManager; | import com.jme.bounding.*; | [
"com.jme.bounding"
] | com.jme.bounding; | 2,445,519 |
public Boolean getAllowsCopy(Document document);
| Boolean function(Document document); | /**
* Returns whether or not this document's data dictionary file has flagged it to allow document copies
*
* @param document - document instance to check copy flag for
* @return boolean true if copies are allowed, false otherwise
*/ | Returns whether or not this document's data dictionary file has flagged it to allow document copies | getAllowsCopy | {
"repo_name": "ricepanda/rice-git3",
"path": "rice-framework/krad-web-framework/src/main/java/org/kuali/rice/krad/service/DocumentDictionaryService.java",
"license": "apache-2.0",
"size": 11254
} | [
"org.kuali.rice.krad.document.Document"
] | import org.kuali.rice.krad.document.Document; | import org.kuali.rice.krad.document.*; | [
"org.kuali.rice"
] | org.kuali.rice; | 2,833,193 |
public TimedMultimap<K, V> onEmpty(IUpdateSubscriber<TimedMultimap<K, V>> subscriber) {
PreCon.notNull(subscriber);
_agents.getAgent("onEmpty").addSubscriber(subscriber);
return this;
} | TimedMultimap<K, V> function(IUpdateSubscriber<TimedMultimap<K, V>> subscriber) { PreCon.notNull(subscriber); _agents.getAgent(STR).addSubscriber(subscriber); return this; } | /**
* Register a subscriber to be notified when the collection becomes
* empty due to an entry's lifespan ending.
*
* @param subscriber The subscriber.
*
* @return Self for chaining.
*/ | Register a subscriber to be notified when the collection becomes empty due to an entry's lifespan ending | onEmpty | {
"repo_name": "JCThePants/NucleusFramework",
"path": "src/com/jcwhatever/nucleus/collections/timed/TimedMultimap.java",
"license": "mit",
"size": 21681
} | [
"com.jcwhatever.nucleus.utils.PreCon",
"com.jcwhatever.nucleus.utils.observer.update.IUpdateSubscriber"
] | import com.jcwhatever.nucleus.utils.PreCon; import com.jcwhatever.nucleus.utils.observer.update.IUpdateSubscriber; | import com.jcwhatever.nucleus.utils.*; import com.jcwhatever.nucleus.utils.observer.update.*; | [
"com.jcwhatever.nucleus"
] | com.jcwhatever.nucleus; | 2,759,420 |
@Override public Method resolveAction(DefaultActionContext ctx) {
try {
LOGGER.debug("Resolving action to ErrorController::presentMissingControllerError");
Class<? extends ErrorController> errorController = ControllerHelper
.findErrorController();
return errorController.get... | @Override Method function(DefaultActionContext ctx) { try { LOGGER.debug(STR); Class<? extends ErrorController> errorController = ControllerHelper .findErrorController(); return errorController.getDeclaredMethod( ErrorController.MISSING_CONTROLLER_ACTION, ActionContext.class); } catch (NoSuchMethodException e) { LOGGER... | /**
* Returns a reference to the error controller method.
*
* @param ctx the current action context
* @return method reference
*/ | Returns a reference to the error controller method | resolveAction | {
"repo_name": "mheck136/TUB_RPWF",
"path": "RPWF_Core/src/main/java/org/rpwf/controller/resolver/ErrorControllerResolver.java",
"license": "mit",
"size": 1685
} | [
"java.lang.reflect.Method",
"org.rpwf.action.ActionContext",
"org.rpwf.action.DefaultActionContext",
"org.rpwf.controller.ErrorController",
"org.rpwf.util.ControllerHelper"
] | import java.lang.reflect.Method; import org.rpwf.action.ActionContext; import org.rpwf.action.DefaultActionContext; import org.rpwf.controller.ErrorController; import org.rpwf.util.ControllerHelper; | import java.lang.reflect.*; import org.rpwf.action.*; import org.rpwf.controller.*; import org.rpwf.util.*; | [
"java.lang",
"org.rpwf.action",
"org.rpwf.controller",
"org.rpwf.util"
] | java.lang; org.rpwf.action; org.rpwf.controller; org.rpwf.util; | 335,926 |
RawErasureEncoder createEncoder(ErasureCoderOptions coderOptions); | RawErasureEncoder createEncoder(ErasureCoderOptions coderOptions); | /**
* Create raw erasure encoder.
* @param coderOptions the options used to create the encoder
* @return raw erasure encoder
*/ | Create raw erasure encoder | createEncoder | {
"repo_name": "dennishuo/hadoop",
"path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/RawErasureCoderFactory.java",
"license": "apache-2.0",
"size": 1841
} | [
"org.apache.hadoop.io.erasurecode.ErasureCoderOptions"
] | import org.apache.hadoop.io.erasurecode.ErasureCoderOptions; | import org.apache.hadoop.io.erasurecode.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 860,879 |
public ValueAxis getRangeAxis() {
ValueAxis result = this.rangeAxis;
return result;
} | ValueAxis function() { ValueAxis result = this.rangeAxis; return result; } | /**
* Returns the range axis for the plot.
*
* @return The range axis.
*/ | Returns the range axis for the plot | getRangeAxis | {
"repo_name": "ceabie/jfreechart",
"path": "source/org/jfree/chart/plot/ContourPlot.java",
"license": "lgpl-2.1",
"size": 59758
} | [
"org.jfree.chart.axis.ValueAxis"
] | import org.jfree.chart.axis.ValueAxis; | import org.jfree.chart.axis.*; | [
"org.jfree.chart"
] | org.jfree.chart; | 1,289,920 |
public boolean hasBehaviors() {
return (behaviors != null && !behaviors.isEmpty());
}
/**
* Add the given <tt>Behavior</tt> to the control's Set of
* {@link #getBehaviors() Behaviors}.
* <p/>
* In addition, the Control will be registered with the
* {@link org.apach... | boolean function() { return (behaviors != null && !behaviors.isEmpty()); } /** * Add the given <tt>Behavior</tt> to the control's Set of * {@link #getBehaviors() Behaviors}. * <p/> * In addition, the Control will be registered with the * {@link org.apache.click.ControlRegistry#registerAjaxTarget(org.apache.click.Contro... | /**
* Returns <tt>true</tt> if this control has any
* <tt>Behavior</tt>s registered, <tt>false</tt> otherwise.
*
* @return <tt>true</tt> if this control has any <tt>Behavior</tt>s registered,
* <tt>false</tt> otherwise
*/ | Returns true if this control has any Behaviors registered, false otherwise | hasBehaviors | {
"repo_name": "medgar/click",
"path": "framework/src/org/apache/click/control/AbstractControl.java",
"license": "apache-2.0",
"size": 37798
} | [
"java.util.Set",
"org.apache.click.Behavior",
"org.apache.click.Control",
"org.apache.click.ControlRegistry"
] | import java.util.Set; import org.apache.click.Behavior; import org.apache.click.Control; import org.apache.click.ControlRegistry; | import java.util.*; import org.apache.click.*; | [
"java.util",
"org.apache.click"
] | java.util; org.apache.click; | 1,124,981 |
public List<Double> getFloatValid() throws ServiceException {
try {
Call<ResponseBody> call = service.getFloatValid();
ServiceResponse<List<Double>> response = getFloatValidDelegate(call.execute(), null);
return response.getBody();
} catch (ServiceException ex) {
... | List<Double> function() throws ServiceException { try { Call<ResponseBody> call = service.getFloatValid(); ServiceResponse<List<Double>> response = getFloatValidDelegate(call.execute(), null); return response.getBody(); } catch (ServiceException ex) { throw ex; } catch (Exception ex) { throw new ServiceException(ex); }... | /**
* Get float array value [0, -0.01, 1.2e20]
*
* @return the List<Double> object if successful.
* @throws ServiceException the exception wrapped in ServiceException if failed.
*/ | Get float array value [0, -0.01, 1.2e20] | getFloatValid | {
"repo_name": "BretJohnson/autorest",
"path": "AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/bodyarray/ArrayImpl.java",
"license": "mit",
"size": 128720
} | [
"com.microsoft.rest.ServiceException",
"com.microsoft.rest.ServiceResponse",
"com.squareup.okhttp.ResponseBody",
"java.util.List"
] | import com.microsoft.rest.ServiceException; import com.microsoft.rest.ServiceResponse; import com.squareup.okhttp.ResponseBody; import java.util.List; | import com.microsoft.rest.*; import com.squareup.okhttp.*; import java.util.*; | [
"com.microsoft.rest",
"com.squareup.okhttp",
"java.util"
] | com.microsoft.rest; com.squareup.okhttp; java.util; | 1,406,145 |
protected void sequence_ExpressionArgument(ISerializationContext context, ExpressionArgument semanticObject) {
if (errorAcceptor != null) {
if (transientValues.isValueTransient(semanticObject, SolverLanguagePackage.Literals.EXPRESSION_ARGUMENT__EXPRESSION) == ValueTransient.YES)
errorAcceptor.accept(diag... | void function(ISerializationContext context, ExpressionArgument semanticObject) { if (errorAcceptor != null) { if (transientValues.isValueTransient(semanticObject, SolverLanguagePackage.Literals.EXPRESSION_ARGUMENT__EXPRESSION) == ValueTransient.YES) errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(sem... | /**
* Contexts:
* Argument returns ExpressionArgument
* ExpressionArgument returns ExpressionArgument
*
* Constraint:
* expression=ComparisonExpression
*/ | Contexts: Argument returns ExpressionArgument ExpressionArgument returns ExpressionArgument Constraint: expression=ComparisonExpression | sequence_ExpressionArgument | {
"repo_name": "viatra/VIATRA-Generator",
"path": "Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/serializer/SolverLanguageSemanticSequencer.java",
"license": "epl-1.0",
"size": 90825
} | [
"org.eclipse.viatra.solver.language.solverLanguage.ExpressionArgument",
"org.eclipse.viatra.solver.language.solverLanguage.SolverLanguagePackage",
"org.eclipse.xtext.serializer.ISerializationContext",
"org.eclipse.xtext.serializer.acceptor.SequenceFeeder",
"org.eclipse.xtext.serializer.sequencer.ITransientV... | import org.eclipse.viatra.solver.language.solverLanguage.ExpressionArgument; import org.eclipse.viatra.solver.language.solverLanguage.SolverLanguagePackage; import org.eclipse.xtext.serializer.ISerializationContext; import org.eclipse.xtext.serializer.acceptor.SequenceFeeder; import org.eclipse.xtext.serializer.sequenc... | import org.eclipse.viatra.solver.language.*; import org.eclipse.xtext.serializer.*; import org.eclipse.xtext.serializer.acceptor.*; import org.eclipse.xtext.serializer.sequencer.*; | [
"org.eclipse.viatra",
"org.eclipse.xtext"
] | org.eclipse.viatra; org.eclipse.xtext; | 192,571 |
PatchId addArchive(URL fileUrl, PatchId oneoffId, Set<PatchId> dependencies, boolean force) throws IOException; | PatchId addArchive(URL fileUrl, PatchId oneoffId, Set<PatchId> dependencies, boolean force) throws IOException; | /**
* Add the given patch archive
* @param fileUrl The file URL to the patch archive
* @param oneoffId An optional patch id if the given URL is a one-off patch
* @param dependencies An optional set of patch dependencies
*/ | Add the given patch archive | addArchive | {
"repo_name": "tdiesler/fuse-patch",
"path": "core/src/main/java/org/wildfly/extras/patch/Repository.java",
"license": "apache-2.0",
"size": 2655
} | [
"java.io.IOException",
"java.util.Set"
] | import java.io.IOException; import java.util.Set; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 1,957,149 |
@Test(timeout=100000)
public void testBalancerWithExcludeListWithPorts() throws Exception {
final Configuration conf = new HdfsConfiguration();
initConf(conf);
doTest(conf, new long[]{CAPACITY, CAPACITY}, new String[]{RACK0, RACK1},
CAPACITY, RACK2, new PortNumberBasedNodes(3, 2, 0), false, fals... | @Test(timeout=100000) void function() throws Exception { final Configuration conf = new HdfsConfiguration(); initConf(conf); doTest(conf, new long[]{CAPACITY, CAPACITY}, new String[]{RACK0, RACK1}, CAPACITY, RACK2, new PortNumberBasedNodes(3, 2, 0), false, false); } | /**
* Test a cluster with even distribution,
* then three nodes are added to the cluster,
* runs balancer with two of the nodes in the exclude list
*/ | Test a cluster with even distribution, then three nodes are added to the cluster, runs balancer with two of the nodes in the exclude list | testBalancerWithExcludeListWithPorts | {
"repo_name": "jingjidejuren/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/balancer/TestBalancer.java",
"license": "apache-2.0",
"size": 64934
} | [
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.hdfs.HdfsConfiguration",
"org.junit.Test"
] | import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hdfs.HdfsConfiguration; import org.junit.Test; | import org.apache.hadoop.conf.*; import org.apache.hadoop.hdfs.*; import org.junit.*; | [
"org.apache.hadoop",
"org.junit"
] | org.apache.hadoop; org.junit; | 1,258,998 |
@Override
public void setFile(String fileName) {
file = new COSString(fileName);
} | void function(String fileName) { file = new COSString(fileName); } | /**
* This will set the file name.
*
* @param fileName The name of the file.
*/ | This will set the file name | setFile | {
"repo_name": "sencko/NALB",
"path": "nalb2013/src/org/apache/pdfbox/pdmodel/common/filespecification/PDSimpleFileSpecification.java",
"license": "gpl-2.0",
"size": 2010
} | [
"org.apache.pdfbox.cos.COSString"
] | import org.apache.pdfbox.cos.COSString; | import org.apache.pdfbox.cos.*; | [
"org.apache.pdfbox"
] | org.apache.pdfbox; | 199,469 |
public void updateTransactionLineTaxLotsByTransactionAmount(boolean isUpdate, HoldingAdjustmentDocument holdingAdjustmentDocument, EndowmentTransactionLine transLine, boolean isSource);
| void function(boolean isUpdate, HoldingAdjustmentDocument holdingAdjustmentDocument, EndowmentTransactionLine transLine, boolean isSource); | /**
* Updates the tax lots related to the given transaction line in the Holding Adjustment document when
* Transaction Amount is entered.
*
* @param isUpdate boolean indicator if update
* @param holdingAdjustmentDocument the Holding Adjustment Document for which we compute the transaction... | Updates the tax lots related to the given transaction line in the Holding Adjustment document when Transaction Amount is entered | updateTransactionLineTaxLotsByTransactionAmount | {
"repo_name": "ua-eas/ua-kfs-5.3",
"path": "work/src/org/kuali/kfs/module/endow/document/service/UpdateHoldingAdjustmentDocumentTaxLotsService.java",
"license": "agpl-3.0",
"size": 2542
} | [
"org.kuali.kfs.module.endow.businessobject.EndowmentTransactionLine",
"org.kuali.kfs.module.endow.document.HoldingAdjustmentDocument"
] | import org.kuali.kfs.module.endow.businessobject.EndowmentTransactionLine; import org.kuali.kfs.module.endow.document.HoldingAdjustmentDocument; | import org.kuali.kfs.module.endow.businessobject.*; import org.kuali.kfs.module.endow.document.*; | [
"org.kuali.kfs"
] | org.kuali.kfs; | 1,072,440 |
@Nonnull
public ColumnDefinitionCollectionRequest orderBy(@Nonnull final String value) {
addOrderByOption(value);
return this;
} | ColumnDefinitionCollectionRequest function(@Nonnull final String value) { addOrderByOption(value); return this; } | /**
* Sets the order by clause for the request
*
* @param value the order by clause
* @return the updated request
*/ | Sets the order by clause for the request | orderBy | {
"repo_name": "microsoftgraph/msgraph-sdk-java",
"path": "src/main/java/com/microsoft/graph/requests/ColumnDefinitionCollectionRequest.java",
"license": "mit",
"size": 5903
} | [
"com.microsoft.graph.requests.ColumnDefinitionCollectionRequest",
"javax.annotation.Nonnull"
] | import com.microsoft.graph.requests.ColumnDefinitionCollectionRequest; import javax.annotation.Nonnull; | import com.microsoft.graph.requests.*; import javax.annotation.*; | [
"com.microsoft.graph",
"javax.annotation"
] | com.microsoft.graph; javax.annotation; | 1,601,270 |
public void addAction(Action action) {
getActions().add(action);
} | void function(Action action) { getActions().add(action); } | /**
* Adds an Action.
*
* @param action
* The action to set
*/ | Adds an Action | addAction | {
"repo_name": "aduprat/james-jsieve",
"path": "core/src/test/java/org/apache/jsieve/utils/SieveMailAdapter.java",
"license": "apache-2.0",
"size": 8825
} | [
"org.apache.jsieve.mail.Action"
] | import org.apache.jsieve.mail.Action; | import org.apache.jsieve.mail.*; | [
"org.apache.jsieve"
] | org.apache.jsieve; | 1,324,632 |
@Test
public void testQueryDirectSqlQuery() {
// search for correct mid
final ContentResolver cr = getContentResolver();
Cursor cursor = cr.query(FlashCardsContract.Note.CONTENT_URI_V2, null, String.format("mid=%d", mModelId), null, null);
assertNotNull(cursor);
try {
... | void function() { final ContentResolver cr = getContentResolver(); Cursor cursor = cr.query(FlashCardsContract.Note.CONTENT_URI_V2, null, String.format(STR, mModelId), null, null); assertNotNull(cursor); try { assertEquals(STR, mCreatedNotes.size(), cursor.getCount()); } finally { cursor.close(); } cursor = cr.query(Fl... | /**
* Test queries to notes table using direct SQL URI
*/ | Test queries to notes table using direct SQL URI | testQueryDirectSqlQuery | {
"repo_name": "ankidroid/Anki-Android",
"path": "AnkiDroid/src/androidTest/java/com/ichi2/anki/tests/ContentProviderTest.java",
"license": "gpl-3.0",
"size": 51370
} | [
"android.content.ContentResolver",
"android.database.Cursor",
"com.ichi2.anki.FlashCardsContract",
"com.ichi2.libanki.Note",
"org.junit.Assert"
] | import android.content.ContentResolver; import android.database.Cursor; import com.ichi2.anki.FlashCardsContract; import com.ichi2.libanki.Note; import org.junit.Assert; | import android.content.*; import android.database.*; import com.ichi2.anki.*; import com.ichi2.libanki.*; import org.junit.*; | [
"android.content",
"android.database",
"com.ichi2.anki",
"com.ichi2.libanki",
"org.junit"
] | android.content; android.database; com.ichi2.anki; com.ichi2.libanki; org.junit; | 537,243 |
@Override
public RestAgent getRestAgent() {
return this.restAgent;
} | RestAgent function() { return this.restAgent; } | /**
* Used by Hydra tests to get handle of Rest Agent
*
* @return RestAgent
*/ | Used by Hydra tests to get handle of Rest Agent | getRestAgent | {
"repo_name": "charliemblack/geode",
"path": "geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java",
"license": "apache-2.0",
"size": 186222
} | [
"org.apache.geode.management.internal.RestAgent"
] | import org.apache.geode.management.internal.RestAgent; | import org.apache.geode.management.internal.*; | [
"org.apache.geode"
] | org.apache.geode; | 1,073,247 |
private static void writeSetToFile(String path, Set<String> set) throws IOException {
Writer out = null;
try {
out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path), StandardCharsets.UTF_8));
boolean first = true;
for (String s : set) {
... | static void function(String path, Set<String> set) throws IOException { Writer out = null; try { out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path), StandardCharsets.UTF_8)); boolean first = true; for (String s : set) { if (!first) { out.write('\n'); } else { first = false; } out.write(s); } } f... | /**
* Write set to file, each element in its own line.
*
* @param path path to file
* @param set set to write
* @throws IOException
*/ | Write set to file, each element in its own line | writeSetToFile | {
"repo_name": "budi-github/SrtFixer",
"path": "src/main/data/cleaner/DataCleaner.java",
"license": "mit",
"size": 2271
} | [
"java.io.BufferedWriter",
"java.io.FileOutputStream",
"java.io.IOException",
"java.io.OutputStreamWriter",
"java.io.Writer",
"java.nio.charset.StandardCharsets",
"java.util.Set"
] | import java.io.BufferedWriter; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.Writer; import java.nio.charset.StandardCharsets; import java.util.Set; | import java.io.*; import java.nio.charset.*; import java.util.*; | [
"java.io",
"java.nio",
"java.util"
] | java.io; java.nio; java.util; | 18,601 |
@SuppressWarnings("rawtypes")
public static List<Handler> sortHandlers(List<Handler> handlers) {
List<LogicalHandler<?>> logicalHandlers = new ArrayList<LogicalHandler<?>>();
List<Handler<?>> protocolHandlers = new ArrayList<Handler<?>>();
for (Handler<?> handler : handlers) {
... | @SuppressWarnings(STR) static List<Handler> function(List<Handler> handlers) { List<LogicalHandler<?>> logicalHandlers = new ArrayList<LogicalHandler<?>>(); List<Handler<?>> protocolHandlers = new ArrayList<Handler<?>>(); for (Handler<?> handler : handlers) { if (handler instanceof LogicalHandler) { logicalHandlers.add... | /**
* sorts the handlers into correct order. All of the logical handlers first
* followed by the protocol handlers
*
* @param handlers
* @return sorted list of handlers
*/ | sorts the handlers into correct order. All of the logical handlers first followed by the protocol handlers | sortHandlers | {
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.jaxws.2.3.clientcontainer/src/com/ibm/ws/jaxws/metadata/builder/HandlerChainInfoBuilder.java",
"license": "epl-1.0",
"size": 21519
} | [
"com.ibm.wsspi.anno.info.AnnotationInfo",
"com.ibm.wsspi.anno.info.ClassInfo",
"java.util.ArrayList",
"java.util.List",
"javax.xml.ws.handler.Handler",
"javax.xml.ws.handler.LogicalHandler"
] | import com.ibm.wsspi.anno.info.AnnotationInfo; import com.ibm.wsspi.anno.info.ClassInfo; import java.util.ArrayList; import java.util.List; import javax.xml.ws.handler.Handler; import javax.xml.ws.handler.LogicalHandler; | import com.ibm.wsspi.anno.info.*; import java.util.*; import javax.xml.ws.handler.*; | [
"com.ibm.wsspi",
"java.util",
"javax.xml"
] | com.ibm.wsspi; java.util; javax.xml; | 1,457,458 |
public void put(String key, File file) throws FileNotFoundException {
put(key, new FileInputStream(file), file.getName());
} | void function(String key, File file) throws FileNotFoundException { put(key, new FileInputStream(file), file.getName()); } | /**
* Adds a file to the request.
*
* @param key
* the key name for the new param.
* @param file
* the file to add.
*/ | Adds a file to the request | put | {
"repo_name": "ice-coffee/WormBook",
"path": "app/src/main/java/com/jie/book/work/download/RequestParams.java",
"license": "apache-2.0",
"size": 10067
} | [
"java.io.File",
"java.io.FileInputStream",
"java.io.FileNotFoundException"
] | import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; | import java.io.*; | [
"java.io"
] | java.io; | 1,291,462 |
@Test(expectedExceptions = IllegalArgumentException.class)
public void dateAfterPaymentTest() {
ZonedDateTime valuationDate = PAYMENT_DATE.plusDays(1);
DoubleTimeSeries<ZonedDateTime>[] htsArray = new DoubleTimeSeries[] {INDEX_FIXING_TS_SAME, FX_FIXING_TS_10 };
CPN_SAME_FIXING_DATES.toDerivative(valuati... | @Test(expectedExceptions = IllegalArgumentException.class) void function() { ZonedDateTime valuationDate = PAYMENT_DATE.plusDays(1); DoubleTimeSeries<ZonedDateTime>[] htsArray = new DoubleTimeSeries[] {INDEX_FIXING_TS_SAME, FX_FIXING_TS_10 }; CPN_SAME_FIXING_DATES.toDerivative(valuationDate, htsArray); } | /**
* reference data is after payment date
*/ | reference data is after payment date | dateAfterPaymentTest | {
"repo_name": "jeorme/OG-Platform",
"path": "projects/OG-Analytics/src/test/java/com/opengamma/analytics/financial/instrument/payment/CouponIborFxResetDefinitionTest.java",
"license": "apache-2.0",
"size": 40358
} | [
"com.opengamma.timeseries.DoubleTimeSeries",
"org.testng.annotations.Test",
"org.threeten.bp.ZonedDateTime"
] | import com.opengamma.timeseries.DoubleTimeSeries; import org.testng.annotations.Test; import org.threeten.bp.ZonedDateTime; | import com.opengamma.timeseries.*; import org.testng.annotations.*; import org.threeten.bp.*; | [
"com.opengamma.timeseries",
"org.testng.annotations",
"org.threeten.bp"
] | com.opengamma.timeseries; org.testng.annotations; org.threeten.bp; | 1,596,677 |
public List<BulkWriteError> getWriteErrors() {
return writeErrors;
} | List<BulkWriteError> function() { return writeErrors; } | /**
* The list of errors, which will not be null, but may be empty (if the write concern error is not null).
*
* @return the list of errors
*/ | The list of errors, which will not be null, but may be empty (if the write concern error is not null) | getWriteErrors | {
"repo_name": "MaOrKsSi/HZS.Durian",
"path": "增强/org.hzs.mongodb/src/com/mongodb/BulkWriteException.java",
"license": "lgpl-3.0",
"size": 4058
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,188,925 |
private void reportError(Element e, String msg, Object... msgParams) {
String formattedMessage = String.format(msg, msgParams);
processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, formattedMessage, e);
} | void function(Element e, String msg, Object... msgParams) { String formattedMessage = String.format(msg, msgParams); processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, formattedMessage, e); } | /**
* Issue a compilation error. This method does not throw an exception, since we want to
* continue processing and perhaps report other errors.
*/ | Issue a compilation error. This method does not throw an exception, since we want to continue processing and perhaps report other errors | reportError | {
"repo_name": "adriancole/auto",
"path": "value/src/main/java/com/google/auto/value/processor/AutoAnnotationProcessor.java",
"license": "apache-2.0",
"size": 19200
} | [
"javax.lang.model.element.Element",
"javax.tools.Diagnostic"
] | import javax.lang.model.element.Element; import javax.tools.Diagnostic; | import javax.lang.model.element.*; import javax.tools.*; | [
"javax.lang",
"javax.tools"
] | javax.lang; javax.tools; | 916,518 |
private DataPoint findValley(DataPoint downIntercept, DataPoint upIntercept, DataPointStream data) {
DataPoint result = new DataPoint(upIntercept);
List<DataPoint> temp = new ArrayList<DataPoint>();
for (int i = 0; i < data.data.size(); i++) { //Identify potential data points
if... | DataPoint function(DataPoint downIntercept, DataPoint upIntercept, DataPointStream data) { DataPoint result = new DataPoint(upIntercept); List<DataPoint> temp = new ArrayList<DataPoint>(); for (int i = 0; i < data.data.size(); i++) { if (downIntercept.timestamp < data.data.get(i).timestamp && data.data.get(i).timestamp... | /**
* Identifies valleys in a datastream
* <p>
* Reference: Matlab code \\TODO
* </p>
*
* @param downIntercept Down intercept DataPoint
* @param upIntercept Up intercept DataPoint
* @param data Input datastream
* @return Valley point from data located between the ... | Identifies valleys in a datastream Reference: Matlab code \\TODO | findValley | {
"repo_name": "MD2Korg/stream-processor",
"path": "src/main/java/md2k/mcerebrum/cstress/features/RIPPuffmarkerFeatures.java",
"license": "bsd-2-clause",
"size": 28411
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,710,032 |
public static Consumer<String> stringConsumer( RabbitConnection connection, String routingKey )
{
return stringConsumer( connection, DEFAULT_TOPIC, routingKey );
} | static Consumer<String> function( RabbitConnection connection, String routingKey ) { return stringConsumer( connection, DEFAULT_TOPIC, routingKey ); } | /**
* Convenience method that returns a {@link Consumer} of String that will publish to the remote default topic
* <p>
* Note: If the string being consumed is null or empty then no action will be taken. This will mean that only messages with
* content will be sent.
* <p>
* @param connectio... | Convenience method that returns a <code>Consumer</code> of String that will publish to the remote default topic Note: If the string being consumed is null or empty then no action will be taken. This will mean that only messages with content will be sent. | stringConsumer | {
"repo_name": "peter-mount/opendata-common",
"path": "brokers/rabbitmq/src/main/java/uk/trainwatch/rabbitmq/RabbitMQ.java",
"license": "apache-2.0",
"size": 29777
} | [
"java.util.function.Consumer"
] | import java.util.function.Consumer; | import java.util.function.*; | [
"java.util"
] | java.util; | 1,264,940 |
private void updateShareIntent() {
if (mShareIntent == null) {
//FIX: crash when orientation is changed
return;
}
String shareText;
if (mNoteView != null && mTitleView != null) {
shareText = mTitleView.getText().toString() + "\n\n" + mNoteView.get... | void function() { if (mShareIntent == null) { return; } String shareText; if (mNoteView != null && mTitleView != null) { shareText = mTitleView.getText().toString() + "\n\n" + mNoteView.getNoteContent().toString(); } else { shareText = ""; } mShareIntent.putExtra(Intent.EXTRA_TEXT, shareText.trim()); } | /**
* Update share intent with current note values
*/ | Update share intent with current note values | updateShareIntent | {
"repo_name": "vishesh/sealnote",
"path": "Sealnote/src/main/java/com/twistedplane/sealnote/NoteActivity.java",
"license": "mit",
"size": 23232
} | [
"android.content.Intent"
] | import android.content.Intent; | import android.content.*; | [
"android.content"
] | android.content; | 2,265,621 |
void setTextAttributes(TextAttributesKey key); | void setTextAttributes(TextAttributesKey key); | /**
* Sets custom attributes for highlighting the inspection result. Can be used only when the severity of the problem is INFORMATION.
*
* @param key the text attributes key for highlighting the result.
* @since 9.0
*/ | Sets custom attributes for highlighting the inspection result. Can be used only when the severity of the problem is INFORMATION | setTextAttributes | {
"repo_name": "IllusionRom-deprecated/android_platform_tools_idea",
"path": "platform/analysis-api/src/com/intellij/codeInspection/ProblemDescriptor.java",
"license": "apache-2.0",
"size": 2156
} | [
"com.intellij.openapi.editor.colors.TextAttributesKey"
] | import com.intellij.openapi.editor.colors.TextAttributesKey; | import com.intellij.openapi.editor.colors.*; | [
"com.intellij.openapi"
] | com.intellij.openapi; | 1,678,808 |
@Override
public void allocateNew() {
if (!allocateNewSafe()) {
throw new OutOfMemoryException("Failure while allocating memory.");
}
} | void function() { if (!allocateNewSafe()) { throw new OutOfMemoryException(STR); } } | /**
* Same as {@link #allocateNewSafe()}.
*/ | Same as <code>#allocateNewSafe()</code> | allocateNew | {
"repo_name": "wagavulin/arrow",
"path": "java/vector/src/main/java/org/apache/arrow/vector/BaseFixedWidthVector.java",
"license": "apache-2.0",
"size": 28058
} | [
"org.apache.arrow.memory.OutOfMemoryException"
] | import org.apache.arrow.memory.OutOfMemoryException; | import org.apache.arrow.memory.*; | [
"org.apache.arrow"
] | org.apache.arrow; | 49,300 |
synchronized void addOrUpdate(RequestStatusVO vo) {
Long reqid = Long.valueOf(vo.getReqId());
IMap<Long, RequestStatusVO> failOverMap = Hazelcast.getMap(ILabelNameSize.FAILOVER_MAP);
if (failOverMap.containsKey(reqid)) {
failOverMap.remove(reqid);
}
failOverMap.put(reqid, vo);
... | synchronized void addOrUpdate(RequestStatusVO vo) { Long reqid = Long.valueOf(vo.getReqId()); IMap<Long, RequestStatusVO> failOverMap = Hazelcast.getMap(ILabelNameSize.FAILOVER_MAP); if (failOverMap.containsKey(reqid)) { failOverMap.remove(reqid); } failOverMap.put(reqid, vo); } | /**
* Helper method that adds or updates the given {@link RequestStatusVO} value object.
* @param vo {@link RequestStatusVO} value object.
*/ | Helper method that adds or updates the given <code>RequestStatusVO</code> value object | addOrUpdate | {
"repo_name": "MastekLtd/JBEAM",
"path": "supporting_libraries/AdvancedPRE/pre/src/main/java/stg/pr/engine/PREContextImpl.java",
"license": "lgpl-3.0",
"size": 7983
} | [
"com.hazelcast.core.Hazelcast",
"com.hazelcast.core.IMap"
] | import com.hazelcast.core.Hazelcast; import com.hazelcast.core.IMap; | import com.hazelcast.core.*; | [
"com.hazelcast.core"
] | com.hazelcast.core; | 2,388,609 |
public static ActivityNotFoundDialogFragment newInstance(int title, int message,
String appGooglePlayUri, String appFDroidQuery) {
ActivityNotFoundDialogFragment frag = new ActivityNotFoundDialogFragment();
Bundle args = new Bundle();
args.putInt(ARG_TITLE, title);
args.... | static ActivityNotFoundDialogFragment function(int title, int message, String appGooglePlayUri, String appFDroidQuery) { ActivityNotFoundDialogFragment frag = new ActivityNotFoundDialogFragment(); Bundle args = new Bundle(); args.putInt(ARG_TITLE, title); args.putInt(ARG_MESSAGE, message); args.putString(ARG_APP_GOOGLE... | /**
* Creates new instance of this delete file dialog fragment
*/ | Creates new instance of this delete file dialog fragment | newInstance | {
"repo_name": "error454/offline-calendar",
"path": "Offline-Calendar/src/main/java/org/sufficientlysecure/localcalendar/ui/ActivityNotFoundDialogFragment.java",
"license": "gpl-3.0",
"size": 4341
} | [
"android.os.Bundle"
] | import android.os.Bundle; | import android.os.*; | [
"android.os"
] | android.os; | 2,481,974 |
private void CheckBluetoothStatus() {
Bluetooth = BluetoothAdapter.getDefaultAdapter();
//Check if device has bluetooth
if (Bluetooth == null) {
Log.i(TAG, "Device doesn't have bluetooth");
Toast.makeText(getBaseContext(), "Device doesn't have bluetooth", Toast.LENGT... | void function() { Bluetooth = BluetoothAdapter.getDefaultAdapter(); if (Bluetooth == null) { Log.i(TAG, STR); Toast.makeText(getBaseContext(), STR, Toast.LENGTH_SHORT).show(); finish(); } else { if (!Bluetooth.isEnabled()) { Log.i(TAG, STR); Intent enable_Bluetooth = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE); ... | /**
* Check if device support bluetooth.
* If so, check is it's On or Off.
* If Off, ask user to turn it On.
*/ | Check if device support bluetooth. If so, check is it's On or Off. If Off, ask user to turn it On | CheckBluetoothStatus | {
"repo_name": "Andr3Carvalh0/Hub",
"path": "Android_Hub/app/src/main/java/project/wardenclyffe/Hub/Setup.java",
"license": "gpl-2.0",
"size": 9261
} | [
"android.bluetooth.BluetoothAdapter",
"android.content.Intent",
"android.util.Log",
"android.widget.Toast"
] | import android.bluetooth.BluetoothAdapter; import android.content.Intent; import android.util.Log; import android.widget.Toast; | import android.bluetooth.*; import android.content.*; import android.util.*; import android.widget.*; | [
"android.bluetooth",
"android.content",
"android.util",
"android.widget"
] | android.bluetooth; android.content; android.util; android.widget; | 2,504,859 |
public void shutdown() {
// clean-up activities
// TODO: reclaim scope to free up resources. Currently
// this is not implemented and throws an exception
// hence, for now, we won't call it.
//
// pigContext.getExecutionEngine().reclaimScope(this.scope);
File... | void function() { FileLocalizer.deleteTempFiles(); } | /**
* Reclaims resources used by this instance of PigServer. This method
* deletes all temporary files generated by the current thread while
* executing Pig commands.
*/ | Reclaims resources used by this instance of PigServer. This method deletes all temporary files generated by the current thread while executing Pig commands | shutdown | {
"repo_name": "apache/pig",
"path": "src/org/apache/pig/PigServer.java",
"license": "apache-2.0",
"size": 77089
} | [
"org.apache.pig.impl.io.FileLocalizer"
] | import org.apache.pig.impl.io.FileLocalizer; | import org.apache.pig.impl.io.*; | [
"org.apache.pig"
] | org.apache.pig; | 892,080 |
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<Void>, Void> beginDelete(String resourceGroupName, String name); | @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller<PollResult<Void>, Void> beginDelete(String resourceGroupName, String name); | /**
* Description for Delete a Kubernetes Environment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the Kubernetes Environment.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.r... | Description for Delete a Kubernetes Environment | beginDelete | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/KubeEnvironmentsClient.java",
"license": "mit",
"size": 25824
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.management.polling.PollResult",
"com.azure.core.util.polling.SyncPoller"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.management.polling.PollResult; import com.azure.core.util.polling.SyncPoller; | import com.azure.core.annotation.*; import com.azure.core.management.polling.*; import com.azure.core.util.polling.*; | [
"com.azure.core"
] | com.azure.core; | 1,041,758 |
public Properties removeHadoopProperties(Properties properties) {
Properties newprops = new Properties();
if (properties == null)
return newprops;
// iterate over the properties to remove all the hadoop specific properties.
final Enumeration<?> propNames = properties.propertyNames();
while ... | Properties function(Properties properties) { Properties newprops = new Properties(); if (properties == null) return newprops; final Enumeration<?> propNames = properties.propertyNames(); while (propNames.hasMoreElements()) { final String propName = (String)propNames.nextElement(); String propValue = properties.getPrope... | /**
* Remove Hadoop specific properties from the boot properties.
* This function is currently called when you want to remove the
* hadoop properties that are polluting the boot props.
*
* @param properties
* @return
*/ | Remove Hadoop specific properties from the boot properties. This function is currently called when you want to remove the hadoop properties that are polluting the boot props | removeHadoopProperties | {
"repo_name": "SnappyDataInc/snappy-store",
"path": "gemfirexd/core/src/main/java/com/pivotal/gemfirexd/internal/hadoop/HadoopGfxdLonerConfig.java",
"license": "apache-2.0",
"size": 7370
} | [
"com.pivotal.gemfirexd.internal.iapi.reference.Property",
"java.util.Enumeration",
"java.util.Properties"
] | import com.pivotal.gemfirexd.internal.iapi.reference.Property; import java.util.Enumeration; import java.util.Properties; | import com.pivotal.gemfirexd.internal.iapi.reference.*; import java.util.*; | [
"com.pivotal.gemfirexd",
"java.util"
] | com.pivotal.gemfirexd; java.util; | 60,172 |
@Test
public void testTranspose()
{
final MutableMat3f matrix = new MutableMat3f();
matrix.setRow(0, 1.f, 1.f, 1.f);
matrix.setRow(1, 6.f, 5.f, 4.f);
matrix.setRow(2, 1.f, 1.f, 0.f);
final MutableMat3f transposedMatrix = new MutableMat3f();
transposedMatrix.setRow(0, 1.f, 6.f, 1.f);
transpos... | void function() { final MutableMat3f matrix = new MutableMat3f(); matrix.setRow(0, 1.f, 1.f, 1.f); matrix.setRow(1, 6.f, 5.f, 4.f); matrix.setRow(2, 1.f, 1.f, 0.f); final MutableMat3f transposedMatrix = new MutableMat3f(); transposedMatrix.setRow(0, 1.f, 6.f, 1.f); transposedMatrix.setRow(1, 1.f, 5.f, 1.f); transposedM... | /**
* Tests transpose of Matrix3f.
*/ | Tests transpose of Matrix3f | testTranspose | {
"repo_name": "stkromm/java2d-game-math",
"path": "vine-math/src/test/java/vine/math/Matrix3fTest.java",
"license": "mit",
"size": 5525
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 2,230,366 |
public static String printXmlDateTime(Object cal, boolean includeTime) {
Calendar c = null;
if (cal == null) {
c = new GregorianCalendar();
} else if (cal instanceof Calendar) {
c = (Calendar) cal;
} else if (cal instanceof Date) {
c = new GregorianCalendar();
c.setTime((Date) cal);
} else {
... | static String function(Object cal, boolean includeTime) { Calendar c = null; if (cal == null) { c = new GregorianCalendar(); } else if (cal instanceof Calendar) { c = (Calendar) cal; } else if (cal instanceof Date) { c = new GregorianCalendar(); c.setTime((Date) cal); } else { throw new PaxmlRuntimeException(STR + cal.... | /**
* Print date/time into xml format.
*
* @param cal
* the calendar or date that represents the datetime. If null
* given, it will take the current system time.
* @param includeTime
* true to include time part, false exclude time part
* @return the xml standard date/ti... | Print date/time into xml format | printXmlDateTime | {
"repo_name": "niuxuetao/paxml",
"path": "PaxmlCore/src/main/java/org/paxml/el/UtilFunctions.java",
"license": "agpl-3.0",
"size": 25987
} | [
"java.util.Calendar",
"java.util.Date",
"java.util.GregorianCalendar",
"javax.xml.bind.DatatypeConverter",
"org.paxml.core.PaxmlRuntimeException"
] | import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import javax.xml.bind.DatatypeConverter; import org.paxml.core.PaxmlRuntimeException; | import java.util.*; import javax.xml.bind.*; import org.paxml.core.*; | [
"java.util",
"javax.xml",
"org.paxml.core"
] | java.util; javax.xml; org.paxml.core; | 2,649,309 |
public Element getDragHelper() {
return m_dragHelper;
} | Element function() { return m_dragHelper; } | /**
* Returns the drag helper element.<p>
*
* @return the drag helper
*/ | Returns the drag helper element | getDragHelper | {
"repo_name": "it-tavis/opencms-core",
"path": "src-gwt/org/opencms/gwt/client/dnd/CmsDNDHandler.java",
"license": "lgpl-2.1",
"size": 30436
} | [
"com.google.gwt.dom.client.Element"
] | import com.google.gwt.dom.client.Element; | import com.google.gwt.dom.client.*; | [
"com.google.gwt"
] | com.google.gwt; | 1,577,329 |
public static void schemaReplaceNullAlias(Schema sch){
if(sch == null)
return ;
for(FieldSchema fs : sch.getFields()){
if(fs.alias != null && fs.alias.toLowerCase().startsWith("nullalias")){
fs.alias = null;
}
schemaReplaceNullAlias(fs.... | static void function(Schema sch){ if(sch == null) return ; for(FieldSchema fs : sch.getFields()){ if(fs.alias != null && fs.alias.toLowerCase().startsWith(STR)){ fs.alias = null; } schemaReplaceNullAlias(fs.schema); } } | /**
* Replaces any alias in given schema that has name that starts with
* "NullAlias" with null . it does a case insensitive comparison of
* the alias name
* @param sch
*/ | Replaces any alias in given schema that has name that starts with "NullAlias" with null . it does a case insensitive comparison of the alias name | schemaReplaceNullAlias | {
"repo_name": "ljl1988com/pig",
"path": "test/org/apache/pig/test/Util.java",
"license": "apache-2.0",
"size": 53036
} | [
"org.apache.pig.impl.logicalLayer.schema.Schema"
] | import org.apache.pig.impl.logicalLayer.schema.Schema; | import org.apache.pig.impl.*; | [
"org.apache.pig"
] | org.apache.pig; | 1,915,860 |
public DateTime getDateTime(String key) {
return this.get(key,toDateTime,Optional.<DateTime>absent()).orNull();
} | DateTime function(String key) { return this.get(key,toDateTime,Optional.<DateTime>absent()).orNull(); } | /**
* Return the value of the property if it exists, casting to a DateTime
* object.
* @param key String
* @return DateTime
*/ | Return the value of the property if it exists, casting to a DateTime object | getDateTime | {
"repo_name": "worldline-messaging/activitystreams",
"path": "core/src/main/java/com/ibm/common/activitystreams/ASObject.java",
"license": "apache-2.0",
"size": 65559
} | [
"com.google.common.base.Optional",
"org.joda.time.DateTime"
] | import com.google.common.base.Optional; import org.joda.time.DateTime; | import com.google.common.base.*; import org.joda.time.*; | [
"com.google.common",
"org.joda.time"
] | com.google.common; org.joda.time; | 2,266,801 |
public DocImage NewImage( Bitmap bmp, boolean has_alpha )
{
int ret = newImage(hand_val, bmp, has_alpha);
if( ret != 0 )
{
DocImage img = new DocImage();
img.hand = ret;
return img;
}
else return null;
} | DocImage function( Bitmap bmp, boolean has_alpha ) { int ret = newImage(hand_val, bmp, has_alpha); if( ret != 0 ) { DocImage img = new DocImage(); img.hand = ret; return img; } else return null; } | /**
* create an image from Bitmap object.<br/>
* a premium license is needed for this method.
* @param bmp Bitmap object in ARGB_8888 format.
* @param has_alpha generate alpha channel information?
* @return DocImage object or null.
*/ | create an image from Bitmap object. a premium license is needed for this method | NewImage | {
"repo_name": "gearit/RadaeePDF-B4A",
"path": "Source/Wrapper/RSPDFViewer/src/com/radaee/pdf/Document.java",
"license": "apache-2.0",
"size": 21414
} | [
"android.graphics.Bitmap"
] | import android.graphics.Bitmap; | import android.graphics.*; | [
"android.graphics"
] | android.graphics; | 2,290,268 |
public void setShadowZFadeLength(float length) {
if (length == 0) {
fadeInfo = null;
fadeLength = 0;
postshadowMat.clearParam("FadeInfo");
} else {
if (zFarOverride == 0) {
fadeInfo = new Vector2f(0, 0);
} else {
... | void function(float length) { if (length == 0) { fadeInfo = null; fadeLength = 0; postshadowMat.clearParam(STR); } else { if (zFarOverride == 0) { fadeInfo = new Vector2f(0, 0); } else { fadeInfo = new Vector2f(zFarOverride - length, 1.0f / length); } fadeLength = length; postshadowMat.setVector2(STR, fadeInfo); } } | /**
* Define the length over which the shadow will fade out when using a
* shadowZextend This is useful to make dynamic shadows fade into baked
* shadows in the distance.
*
* @param length the fade length in world units
*/ | Define the length over which the shadow will fade out when using a shadowZextend This is useful to make dynamic shadows fade into baked shadows in the distance | setShadowZFadeLength | {
"repo_name": "PlanetWaves/clockworkengine",
"path": "branches/3.0/engine/src/core/com/clockwork/shadow/SpotLightShadowRenderer.java",
"license": "apache-2.0",
"size": 7310
} | [
"com.clockwork.math.Vector2f"
] | import com.clockwork.math.Vector2f; | import com.clockwork.math.*; | [
"com.clockwork.math"
] | com.clockwork.math; | 1,866,976 |
@Deprecated
public String toString(Directory dir, int delCount) {
return toString(delCount);
} | String function(Directory dir, int delCount) { return toString(delCount); } | /**
* Used for debugging.
*
* @deprecated Use {@link #toString(int)} instead.
*/ | Used for debugging | toString | {
"repo_name": "q474818917/solr-5.2.0",
"path": "lucene/core/src/java/org/apache/lucene/index/SegmentInfo.java",
"license": "apache-2.0",
"size": 9350
} | [
"org.apache.lucene.store.Directory"
] | import org.apache.lucene.store.Directory; | import org.apache.lucene.store.*; | [
"org.apache.lucene"
] | org.apache.lucene; | 1,920,924 |
public void save(UserEntity user) {
for(AddressEntity address: user.getAddresses()) {
address.setUser(user);
}
userRepository.save(user);
} | void function(UserEntity user) { for(AddressEntity address: user.getAddresses()) { address.setUser(user); } userRepository.save(user); } | /**
* save user
* @param user
*/ | save user | save | {
"repo_name": "codev777/spring-boot-all",
"path": "spring-boot-samples/src/main/java/com/lance/service/UserServiceImpl.java",
"license": "apache-2.0",
"size": 720
} | [
"com.lance.entity.AddressEntity",
"com.lance.entity.UserEntity"
] | import com.lance.entity.AddressEntity; import com.lance.entity.UserEntity; | import com.lance.entity.*; | [
"com.lance.entity"
] | com.lance.entity; | 2,844,082 |
Index getIndexForColumns(boolean[] columnCheck) {
Index indexChoice = null;
int colCount = 0;
for (int i = 0; i < indexList.length; i++) {
Index index = indexList[i];
boolean result = ArrayUtil.containsAllTrueElements(columnCheck,
index.colCheck... | Index getIndexForColumns(boolean[] columnCheck) { Index indexChoice = null; int colCount = 0; for (int i = 0; i < indexList.length; i++) { Index index = indexList[i]; boolean result = ArrayUtil.containsAllTrueElements(columnCheck, index.colCheck); if (result && index.getVisibleColumns() > colCount) { colCount = index.g... | /**
* Used for TableFilter to get an index for the columns
*/ | Used for TableFilter to get an index for the columns | getIndexForColumns | {
"repo_name": "proudh0n/emergencymasta",
"path": "hsqldb/src/org/hsqldb/Table.java",
"license": "gpl-2.0",
"size": 109936
} | [
"org.hsqldb.lib.ArrayUtil"
] | import org.hsqldb.lib.ArrayUtil; | import org.hsqldb.lib.*; | [
"org.hsqldb.lib"
] | org.hsqldb.lib; | 2,503,976 |
private void createLabel(final String message, final Composite parent, final Image image) {
Label imageLabel = new Label(parent, SWT.NONE);
imageLabel.setImage(image);
Label lbl1 = new Label(parent, SWT.NONE);
lbl1.setText(message); // $NON-NLS-1$
}
| void function(final String message, final Composite parent, final Image image) { Label imageLabel = new Label(parent, SWT.NONE); imageLabel.setImage(image); Label lbl1 = new Label(parent, SWT.NONE); lbl1.setText(message); } | /**
* Creates the Label in the Beginning
*
* @param message
* The Message Text of the Label
* @param parent
* The Parent Composite
*/ | Creates the Label in the Beginning | createLabel | {
"repo_name": "WiednerF/ARXPlugin",
"path": "src/org/deidentifier/arx/kettle/define/ViewCriteriaList.java",
"license": "apache-2.0",
"size": 31226
} | [
"org.eclipse.swt.graphics.Image",
"org.eclipse.swt.widgets.Composite",
"org.eclipse.swt.widgets.Label"
] | import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; | import org.eclipse.swt.graphics.*; import org.eclipse.swt.widgets.*; | [
"org.eclipse.swt"
] | org.eclipse.swt; | 2,040,638 |
private void validateNoLargeDirectBufferAllocated() throws Exception {
// Make the fields in the Thread class that store ThreadLocals
// accessible
Field threadLocalsField = Thread.class.getDeclaredField("threadLocals");
threadLocalsField.setAccessible(true);
// Make the unde... | void function() throws Exception { Field threadLocalsField = Thread.class.getDeclaredField(STR); threadLocalsField.setAccessible(true); Class<?> tlmClass = Class.forName(STR); Field tableField = tlmClass.getDeclaredField("table"); tableField.setAccessible(true); for (Thread thread : Thread.getAllStackTraces().keySet())... | /**
* Validates that all the thread local allocated ByteBuffer in sun.nio under the Util$BufferCache
* are not greater than 1mb.
*/ | Validates that all the thread local allocated ByteBuffer in sun.nio under the Util$BufferCache are not greater than 1mb | validateNoLargeDirectBufferAllocated | {
"repo_name": "anti-social/elasticsearch",
"path": "src/test/java/org/elasticsearch/network/DirectBufferNetworkTests.java",
"license": "apache-2.0",
"size": 6439
} | [
"java.lang.reflect.Field",
"java.nio.ByteBuffer",
"org.hamcrest.Matchers"
] | import java.lang.reflect.Field; import java.nio.ByteBuffer; import org.hamcrest.Matchers; | import java.lang.reflect.*; import java.nio.*; import org.hamcrest.*; | [
"java.lang",
"java.nio",
"org.hamcrest"
] | java.lang; java.nio; org.hamcrest; | 43,349 |
public static void closeQuietly(OutputStream output) {
try {
if (output != null) {
output.close();
}
} catch (IOException ioe) {
//logger.warning("OutputStream - exception ignored - exception: " + ioe); //$NON-NLS-1$
// ignore
}
} | static void function(OutputStream output) { try { if (output != null) { output.close(); } } catch (IOException ioe) { } } | /**
* Unconditionally close an <code>OutputStream</code>.
* <p>
* Equivalent to {@link OutputStream#close()}, except any exceptions will be
* ignored. This is typically used in finally blocks.
*
* @param output
* the OutputStream to close, may be null or already closed
*/ | Unconditionally close an <code>OutputStream</code>. Equivalent to <code>OutputStream#close()</code>, except any exceptions will be ignored. This is typically used in finally blocks | closeQuietly | {
"repo_name": "opensagres/xdocreport.eclipse",
"path": "commons/fr.opensagres.eclipse.forms/src/fr/opensagres/eclipse/forms/internal/IOUtils.java",
"license": "lgpl-2.1",
"size": 46409
} | [
"java.io.IOException",
"java.io.OutputStream"
] | import java.io.IOException; import java.io.OutputStream; | import java.io.*; | [
"java.io"
] | java.io; | 297,496 |
public TargetController createTargetController(final Reader description)
throws TargetCreationException;
| TargetController function(final Reader description) throws TargetCreationException; | /**
* Create a {@link TargetController} according the given description
*
* @param description
* @return
* @throws TargetCreationException
*/ | Create a <code>TargetController</code> according the given description | createTargetController | {
"repo_name": "DEEDS-TUD/AUTOGRINDER",
"path": "server/ext/executor/src/main/java/de/grinder/executor/TargetFactory.java",
"license": "agpl-3.0",
"size": 382
} | [
"java.io.Reader"
] | import java.io.Reader; | import java.io.*; | [
"java.io"
] | java.io; | 631,211 |
NamedClusterOsgi nonOsgiFromXmlForEmbed( Node node ); | NamedClusterOsgi nonOsgiFromXmlForEmbed( Node node ); | /**
* This is the NamedClusterOsgi equivalent of the line commented above. The NamedCluster interface is used in OSGI
* and should be phased out over time as this interface is adopted instead. We had to create a unique method name
* here for the time being since the signature is identical.
*/ | This is the NamedClusterOsgi equivalent of the line commented above. The NamedCluster interface is used in OSGI and should be phased out over time as this interface is adopted instead. We had to create a unique method name here for the time being since the signature is identical | nonOsgiFromXmlForEmbed | {
"repo_name": "TatsianaKasiankova/pentaho-kettle",
"path": "core/src/main/java/org/pentaho/di/core/osgi/api/NamedClusterOsgi.java",
"license": "apache-2.0",
"size": 3887
} | [
"org.w3c.dom.Node"
] | import org.w3c.dom.Node; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 2,829,823 |
private void showGlobalContextActionBar() {
ActionBar actionBar = getActionBar();
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
actionBar.setTitle(R.string.app_name);
} | void function() { ActionBar actionBar = getActionBar(); actionBar.setDisplayShowTitleEnabled(true); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); actionBar.setTitle(R.string.app_name); } | /**
* Per the navigation drawer design guidelines, updates the action bar to show the global app
* 'context', rather than just what's in the current screen.
*/ | Per the navigation drawer design guidelines, updates the action bar to show the global app 'context', rather than just what's in the current screen | showGlobalContextActionBar | {
"repo_name": "skyforce77/AndroidFbleau-EDT",
"path": "app/src/main/java/fr/skyforce77/apkiutedt/NavigationDrawerFragment.java",
"license": "lgpl-3.0",
"size": 11658
} | [
"android.app.ActionBar"
] | import android.app.ActionBar; | import android.app.*; | [
"android.app"
] | android.app; | 588,073 |
public Long getFilterId()
{
return filterId;
} | Long function() { return filterId; } | /**
* Get the filterId
* @generated
* @return get the filterId
*/ | Get the filterId | getFilterId | {
"repo_name": "schnurlei/jdynameta",
"path": "jdy/jdy.model.metadata/src/main/java/de/jdynameta/metamodel/filter/AppQuery.java",
"license": "apache-2.0",
"size": 2714
} | [
"java.lang.Long"
] | import java.lang.Long; | import java.lang.*; | [
"java.lang"
] | java.lang; | 1,266,943 |
static String createResultsName(MemoryPeakResults sourceResults, Settings settings) {
if (settings.outputSuffix) {
return sourceResults.getName() + " " + settings.outputName.trim();
}
return settings.outputName;
} | static String createResultsName(MemoryPeakResults sourceResults, Settings settings) { if (settings.outputSuffix) { return sourceResults.getName() + " " + settings.outputName.trim(); } return settings.outputName; } | /**
* Creates the results name.
*
* @param sourceResults the source results
* @param settings the settings
* @return the string
*/ | Creates the results name | createResultsName | {
"repo_name": "aherbert/GDSC-SMLM",
"path": "src/main/java/uk/ac/sussex/gdsc/smlm/ij/plugins/FilterMolecules.java",
"license": "gpl-3.0",
"size": 20862
} | [
"uk.ac.sussex.gdsc.smlm.results.MemoryPeakResults"
] | import uk.ac.sussex.gdsc.smlm.results.MemoryPeakResults; | import uk.ac.sussex.gdsc.smlm.results.*; | [
"uk.ac.sussex"
] | uk.ac.sussex; | 2,464,047 |
void onClientUpdated(Messenger clientMessenger); | void onClientUpdated(Messenger clientMessenger); | /**
* Call this when you get {@link
* IDownloaderClient.onServiceConnected(Messenger m)} from the
* DownloaderClient to register the client with the service. It will
* automatically send the current status to the client.
*
* @param clientMessenger
*/ | Call this when you get <code>IDownloaderClient.onServiceConnected(Messenger m)</code> from the DownloaderClient to register the client with the service. It will automatically send the current status to the client | onClientUpdated | {
"repo_name": "okamstudio/godot",
"path": "platform/android/java/src/com/google/android/vending/expansion/downloader/IDownloaderService.java",
"license": "mit",
"size": 2876
} | [
"android.os.Messenger"
] | import android.os.Messenger; | import android.os.*; | [
"android.os"
] | android.os; | 2,279,463 |
@SuppressWarnings("unchecked")
public void setEffects(BiomeConfig config)
{
this.temperature = config.biomeTemperature;
this.rainfall = config.biomeWetness;
if (this.rainfall == 0)
{
this.setDisableRain();
}
this.waterColorMultiplier = config.water... | @SuppressWarnings(STR) void function(BiomeConfig config) { this.temperature = config.biomeTemperature; this.rainfall = config.biomeWetness; if (this.rainfall == 0) { this.setDisableRain(); } this.waterColorMultiplier = config.waterColor; this.skyColor = config.skyColor; this.grassColor = config.grassColor; this.grassCo... | /**
* Needs a BiomeConfig that has all the visual settings present.
*
* @param config
*/ | Needs a BiomeConfig that has all the visual settings present | setEffects | {
"repo_name": "whichonespink44/TerrainControl",
"path": "platforms/forge/src/main/java/com/khorn/terraincontrol/forge/generator/BiomeGenCustom.java",
"license": "mit",
"size": 4908
} | [
"com.khorn.terraincontrol.configuration.BiomeConfig"
] | import com.khorn.terraincontrol.configuration.BiomeConfig; | import com.khorn.terraincontrol.configuration.*; | [
"com.khorn.terraincontrol"
] | com.khorn.terraincontrol; | 632,363 |
public int getColor() {
return Color.HSVToColor(mAlpha, new float[] { mHue, mSat, mVal });
} | int function() { return Color.HSVToColor(mAlpha, new float[] { mHue, mSat, mVal }); } | /**
* Get the current color this view is showing.
*
* @return the current color.
*/ | Get the current color this view is showing | getColor | {
"repo_name": "kiooeht/pesterdroid",
"path": "src/com/evacipated/preferences/colorpicker/ColorPickerView.java",
"license": "gpl-3.0",
"size": 20944
} | [
"android.graphics.Color"
] | import android.graphics.Color; | import android.graphics.*; | [
"android.graphics"
] | android.graphics; | 2,785,206 |
public APIKeyInfoDTO[] getSubscribedUsersForAPI(APIInfoDTO apiInfoDTO) throws APIManagementException {
APIKeyInfoDTO[] apiKeyInfoDTOs = null;
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs = null;
List<APIKeyInfoDTO> apiKeyInfoList = new ArrayList<APIKeyInf... | APIKeyInfoDTO[] function(APIInfoDTO apiInfoDTO) throws APIManagementException { APIKeyInfoDTO[] apiKeyInfoDTOs = null; Connection conn = null; PreparedStatement ps = null; ResultSet rs = null; List<APIKeyInfoDTO> apiKeyInfoList = new ArrayList<APIKeyInfoDTO>(); String sqlQuery = SQLConstants.GET_SUBSCRIBED_USERS_FOR_AP... | /**
* Get API key information for given API
*
* @param apiInfoDTO API info
* @return APIKeyInfoDTO[]
* @throws APIManagementException if failed to get key info for given API
*/ | Get API key information for given API | getSubscribedUsersForAPI | {
"repo_name": "dhanuka84/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java",
"license": "apache-2.0",
"size": 461690
} | [
"java.sql.Connection",
"java.sql.PreparedStatement",
"java.sql.ResultSet",
"java.sql.SQLException",
"java.util.ArrayList",
"java.util.List",
"org.wso2.carbon.apimgt.api.APIManagementException",
"org.wso2.carbon.apimgt.impl.APIConstants",
"org.wso2.carbon.apimgt.impl.dao.constants.SQLConstants",
"o... | import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.impl.APIConstants; import org.wso2.carbon.apimgt.impl.dao.con... | import java.sql.*; import java.util.*; import org.wso2.carbon.apimgt.api.*; import org.wso2.carbon.apimgt.impl.*; import org.wso2.carbon.apimgt.impl.dao.constants.*; import org.wso2.carbon.apimgt.impl.dto.*; import org.wso2.carbon.apimgt.impl.utils.*; | [
"java.sql",
"java.util",
"org.wso2.carbon"
] | java.sql; java.util; org.wso2.carbon; | 2,822,651 |
public void setAmt (BigDecimal Amt)
{
set_Value (COLUMNNAME_Amt, Amt);
} | void function (BigDecimal Amt) { set_Value (COLUMNNAME_Amt, Amt); } | /** Set Amount.
@param Amt
Amount
*/ | Set Amount | setAmt | {
"repo_name": "klst-com/metasfresh",
"path": "de.metas.adempiere.adempiere/base/src/main/java-gen/org/compiere/model/X_C_DunningRunLine.java",
"license": "gpl-2.0",
"size": 10864
} | [
"java.math.BigDecimal"
] | import java.math.BigDecimal; | import java.math.*; | [
"java.math"
] | java.math; | 913,776 |
public static RouteAttributeDecoder<RouteAttributeDst> decoder() {
return (int length, int type, byte[] value) -> {
IpAddress dstAddress;
if (value.length == Ip4Address.BYTE_LENGTH) {
dstAddress = IpAddress.valueOf(IpAddress.Version.INET, value);
} else i... | static RouteAttributeDecoder<RouteAttributeDst> function() { return (int length, int type, byte[] value) -> { IpAddress dstAddress; if (value.length == Ip4Address.BYTE_LENGTH) { dstAddress = IpAddress.valueOf(IpAddress.Version.INET, value); } else if (value.length == Ip6Address.BYTE_LENGTH) { dstAddress = IpAddress.val... | /**
* Returns a decoder for a destination address route attribute.
*
* @return destination address route attribute decoder
*/ | Returns a decoder for a destination address route attribute | decoder | {
"repo_name": "sonu283304/onos",
"path": "apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeDst.java",
"license": "apache-2.0",
"size": 2538
} | [
"org.onlab.packet.DeserializationException",
"org.onlab.packet.Ip4Address",
"org.onlab.packet.Ip6Address",
"org.onlab.packet.IpAddress"
] | import org.onlab.packet.DeserializationException; import org.onlab.packet.Ip4Address; import org.onlab.packet.Ip6Address; import org.onlab.packet.IpAddress; | import org.onlab.packet.*; | [
"org.onlab.packet"
] | org.onlab.packet; | 2,421,751 |
public X509Certificate generateX509Certificate(
PrivateKey key,
SecureRandom random)
throws SecurityException, SignatureException, InvalidKeyException
{
try
{
return generateX509Certificate(key, "BC", random);
}
catch (NoSuchProviderExc... | X509Certificate function( PrivateKey key, SecureRandom random) throws SecurityException, SignatureException, InvalidKeyException { try { return generateX509Certificate(key, "BC", random); } catch (NoSuchProviderException e) { throw new SecurityException(STR); } } | /**
* generate an X509 certificate, based on the current issuer and subject
* using the default provider "BC" and the passed in source of randomness
* @deprecated use generate(key, random, "BC")
*/ | generate an X509 certificate, based on the current issuer and subject using the default provider "BC" and the passed in source of randomness | generateX509Certificate | {
"repo_name": "bullda/DroidText",
"path": "src/bouncycastle/repack/org/bouncycastle/x509/X509V1CertificateGenerator.java",
"license": "lgpl-3.0",
"size": 11886
} | [
"java.security.InvalidKeyException",
"java.security.NoSuchProviderException",
"java.security.PrivateKey",
"java.security.SecureRandom",
"java.security.SignatureException",
"java.security.cert.X509Certificate"
] | import java.security.InvalidKeyException; import java.security.NoSuchProviderException; import java.security.PrivateKey; import java.security.SecureRandom; import java.security.SignatureException; import java.security.cert.X509Certificate; | import java.security.*; import java.security.cert.*; | [
"java.security"
] | java.security; | 2,783,224 |
@Step
MapArray<String, MapArray<String, ICell>> rows(String... colNameValues); | MapArray<String, MapArray<String, ICell>> rows(String... colNameValues); | /**
* Searches Rows in table matches specified criteria colNameValues - list of search criteria in format columnName=columnValue<br>
* = - Equals
* ~= - Contains
* *= - Match RegEx
* e.g. rows("Name=Roman", "Profession=QA") <br>
* e.g. rows("Name*=.* +*", "Profession~=Test") <br>
* Ea... | Searches Rows in table matches specified criteria colNameValues - list of search criteria in format columnName=columnValue = - Equals ~= - Contains = - Match RegEx e.g. rows("Name=Roman", "Profession=QA") e.g. rows("Name*=.* +*", "Profession~=Test") Each Row is map: columnName:cell | rows | {
"repo_name": "bes422/JDI",
"path": "Java/JDI/jdi-uitest-core/src/main/java/com/epam/jdi/uitests/core/interfaces/complex/tables/ITable.java",
"license": "gpl-3.0",
"size": 10479
} | [
"com.epam.commons.map.MapArray"
] | import com.epam.commons.map.MapArray; | import com.epam.commons.map.*; | [
"com.epam.commons"
] | com.epam.commons; | 2,836,126 |
EClass getContentsType(); | EClass getContentsType(); | /**
* Returns the meta object for class '{@link net.opengis.wcs11.ContentsType <em>Contents Type</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Contents Type</em>'.
* @see net.opengis.wcs11.ContentsType
* @generated
*/ | Returns the meta object for class '<code>net.opengis.wcs11.ContentsType Contents Type</code>'. | getContentsType | {
"repo_name": "geotools/geotools",
"path": "modules/ogc/net.opengis.wcs/src/net/opengis/wcs11/Wcs11Package.java",
"license": "lgpl-2.1",
"size": 160605
} | [
"org.eclipse.emf.ecore.EClass"
] | import org.eclipse.emf.ecore.EClass; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 895,568 |
public static Response getTaskNameToZone(StateStore stateStore, String taskName) {
try {
Map<String, String> tasksZones = getTasksZones(stateStore);
if (tasksZones.containsKey(taskName)) {
return ResponseUtils.plainOkResponse(tasksZones.get(taskName));
} else {
LOGGER.error("No z... | static Response function(StateStore stateStore, String taskName) { try { Map<String, String> tasksZones = getTasksZones(stateStore); if (tasksZones.containsKey(taskName)) { return ResponseUtils.plainOkResponse(tasksZones.get(taskName)); } else { LOGGER.error(STR); return Response.status(Response.Status.NOT_FOUND).build... | /**
* Returns the Zone information for a given task.
*/ | Returns the Zone information for a given task | getTaskNameToZone | {
"repo_name": "mesosphere/dcos-commons",
"path": "sdk/scheduler/src/main/java/com/mesosphere/sdk/http/queries/StateQueries.java",
"license": "apache-2.0",
"size": 12120
} | [
"com.mesosphere.sdk.http.ResponseUtils",
"com.mesosphere.sdk.state.StateStore",
"com.mesosphere.sdk.state.StateStoreException",
"java.util.Map",
"javax.ws.rs.core.Response"
] | import com.mesosphere.sdk.http.ResponseUtils; import com.mesosphere.sdk.state.StateStore; import com.mesosphere.sdk.state.StateStoreException; import java.util.Map; import javax.ws.rs.core.Response; | import com.mesosphere.sdk.http.*; import com.mesosphere.sdk.state.*; import java.util.*; import javax.ws.rs.core.*; | [
"com.mesosphere.sdk",
"java.util",
"javax.ws"
] | com.mesosphere.sdk; java.util; javax.ws; | 51,939 |
public void register() {
removeHandler();
m_handlerRegistration = Event.addNativePreviewHandler(this);
}
| void function() { removeHandler(); m_handlerRegistration = Event.addNativePreviewHandler(this); } | /**
* Registers the handler.<p>
*/ | Registers the handler | register | {
"repo_name": "mediaworx/opencms-core",
"path": "src-gwt/org/opencms/gwt/client/util/CmsFocusedScrollingHandler.java",
"license": "lgpl-2.1",
"size": 4981
} | [
"com.google.gwt.user.client.Event"
] | import com.google.gwt.user.client.Event; | import com.google.gwt.user.client.*; | [
"com.google.gwt"
] | com.google.gwt; | 2,530,914 |
private Point getCornerPoint(Point p1, short alpha1, Point p2, short alpha2)
{
Point p3 = new Point();
//je nach winkel wird ein guenstiger eckpunkt gesucht
//winkel zeigt in positive y-richtung -> groeßerer der beiden y-werte usw.
if (alpha1 < 45)
{
p3.y = Math.max(p1.y, p2.y);
// wenn y von p1 übe... | Point function(Point p1, short alpha1, Point p2, short alpha2) { Point p3 = new Point(); if (alpha1 < 45) { p3.y = Math.max(p1.y, p2.y); p3.x = (p3.y == p1.y) ? p2.x : p1.x; } else if (alpha1 < 135) { p3.x = Math.min(p1.x, p2.x); p3.y = (p3.x == p1.x) ? p2.y : p1.y; } else if (alpha1 < 225) { p3.y = Math.min(p1.y, p2.y... | /**
* Private method called by drawLine
* Returns a Point specifying the Corner Point for this line, considering
* the position and rotation of the connected connectors.
* @param p1 Contains first point
* @param alpha1 Rotation of first point
* @param p2 Contains second point
* @param alpha2 Rot... | Private method called by drawLine Returns a Point specifying the Corner Point for this line, considering the position and rotation of the connected connectors | getCornerPoint | {
"repo_name": "Akkarin1212/BlitzEdit",
"path": "src/blitzEdit/core/Line.java",
"license": "mit",
"size": 3898
} | [
"java.awt.Point"
] | import java.awt.Point; | import java.awt.*; | [
"java.awt"
] | java.awt; | 374,458 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.