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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
private void secondPassDateProcess(OccurrenceModel occModel){
//make sure the year is valid
//start date
if(occModel.getSyear() !=null && occModel.getSyear() < MIN_DATE){
occModel.setSyear(null);
}
if(occModel.getSyear() !=null && occModel.getSyear() > MAX_DATE){
occModel.setSyear(null);
}
/... | void function(OccurrenceModel occModel){ if(occModel.getSyear() !=null && occModel.getSyear() < MIN_DATE){ occModel.setSyear(null); } if(occModel.getSyear() !=null && occModel.getSyear() > MAX_DATE){ occModel.setSyear(null); } if(occModel.getEyear() !=null && occModel.getEyear() < MIN_DATE){ occModel.setSyear(null); } ... | /**
* Make sure the date is within accepted range and set the decade.
* @param occModel
*/ | Make sure the date is within accepted range and set the decade | secondPassDateProcess | {
"repo_name": "Canadensys/canadensys-harvester",
"path": "canadensys-harvester-lib/src/main/java/net/canadensys/harvester/occurrence/processor/OccurrenceProcessor.java",
"license": "mit",
"size": 18247
} | [
"java.util.Calendar",
"net.canadensys.dataportal.occurrence.model.OccurrenceModel",
"net.canadensys.utils.ArrayUtils"
] | import java.util.Calendar; import net.canadensys.dataportal.occurrence.model.OccurrenceModel; import net.canadensys.utils.ArrayUtils; | import java.util.*; import net.canadensys.dataportal.occurrence.model.*; import net.canadensys.utils.*; | [
"java.util",
"net.canadensys.dataportal",
"net.canadensys.utils"
] | java.util; net.canadensys.dataportal; net.canadensys.utils; | 719,738 |
static public void miscError(CommonTree token, Object msg) {
Util.printError(token, "E#MISC: " + msg);
} | static void function(CommonTree token, Object msg) { Util.printError(token, STR + msg); } | /**
* Miscellaneous error message (for errors which do not fit any other
* method). Note: all "standard" errors should fit in one of the previous
* categories.
*
* @param token
* ANTLR token (for line/column numbering). If null, no
* meaningful line/column information will be given.... | Miscellaneous error message (for errors which do not fit any other method). Note: all "standard" errors should fit in one of the previous categories | miscError | {
"repo_name": "yjegu/Projet_Comp",
"path": "src/Errors.java",
"license": "gpl-2.0",
"size": 3558
} | [
"org.antlr.runtime.tree.CommonTree"
] | import org.antlr.runtime.tree.CommonTree; | import org.antlr.runtime.tree.*; | [
"org.antlr.runtime"
] | org.antlr.runtime; | 288,095 |
public void unlock(@Nullable Runnable runnable) {
unlock(runnable, true);
} | void function(@Nullable Runnable runnable) { unlock(runnable, true); } | /**
* Unlocks keyguard and runs {@link Runnable runnable} when unlocked.
*/ | Unlocks keyguard and runs <code>Runnable runnable</code> when unlocked | unlock | {
"repo_name": "AChep/AcDisplay",
"path": "project/app/src/main/java/com/achep/acdisplay/ui/activities/KeyguardActivity.java",
"license": "gpl-2.0",
"size": 20245
} | [
"androidx.annotation.Nullable"
] | import androidx.annotation.Nullable; | import androidx.annotation.*; | [
"androidx.annotation"
] | androidx.annotation; | 910,200 |
public Observable<ServiceResponse<Page<VirtualNetworkInner>>> listNextSinglePageAsync(final String nextPageLink) {
if (nextPageLink == null) {
throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
} | Observable<ServiceResponse<Page<VirtualNetworkInner>>> function(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException(STR); } | /**
* Gets all virtual networks in a subscription.
*
ServiceResponse<PageImpl<VirtualNetworkInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<Virtu... | Gets all virtual networks in a subscription | listNextSinglePageAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2019_11_01/src/main/java/com/microsoft/azure/management/network/v2019_11_01/implementation/VirtualNetworksInner.java",
"license": "mit",
"size": 90099
} | [
"com.microsoft.azure.Page",
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.azure.Page; import com.microsoft.rest.ServiceResponse; | import com.microsoft.azure.*; import com.microsoft.rest.*; | [
"com.microsoft.azure",
"com.microsoft.rest"
] | com.microsoft.azure; com.microsoft.rest; | 1,877,816 |
InterceptStrategy getDefaultTracer(); | InterceptStrategy getDefaultTracer(); | /**
* Gets the default tracer
*
* @return the default tracer
*/ | Gets the default tracer | getDefaultTracer | {
"repo_name": "grgrzybek/camel",
"path": "camel-core/src/main/java/org/apache/camel/CamelContext.java",
"license": "apache-2.0",
"size": 61294
} | [
"org.apache.camel.spi.InterceptStrategy"
] | import org.apache.camel.spi.InterceptStrategy; | import org.apache.camel.spi.*; | [
"org.apache.camel"
] | org.apache.camel; | 68,909 |
return new ShouldHaveAtIndex(actual, condition, index, found);
}
private <T> ShouldHaveAtIndex(List<? extends T> actual, Condition<? super T> condition, Index index, T found) {
super("%nExpecting actual:%n %s%nat index %s to have:%n %s%nin:%n %s%n", found, index.value, condition, actual);
} | return new ShouldHaveAtIndex(actual, condition, index, found); } private <T> ShouldHaveAtIndex(List<? extends T> actual, Condition<? super T> condition, Index index, T found) { super(STR, found, index.value, condition, actual); } | /**
* Creates a new <code>{@link ShouldHaveAtIndex}</code>.
* @param <T> guarantees that the type of the actual value and the generic type of the {@code Condition} are the same.
* @param actual the actual value in the failed assertion.
* @param condition the {@code Condition}.
* @param index the index of... | Creates a new <code><code>ShouldHaveAtIndex</code></code> | shouldHaveAtIndex | {
"repo_name": "hazendaz/assertj-core",
"path": "src/main/java/org/assertj/core/error/ShouldHaveAtIndex.java",
"license": "apache-2.0",
"size": 1956
} | [
"java.util.List",
"org.assertj.core.api.Condition",
"org.assertj.core.data.Index"
] | import java.util.List; import org.assertj.core.api.Condition; import org.assertj.core.data.Index; | import java.util.*; import org.assertj.core.api.*; import org.assertj.core.data.*; | [
"java.util",
"org.assertj.core"
] | java.util; org.assertj.core; | 829,377 |
@see org.hl7.rim.Message#setAcceptAckCode
*/
public void setAcceptAckCode(CS acceptAckCode) {
if(acceptAckCode instanceof org.hl7.hibernate.ClonableCollection)
acceptAckCode = ((org.hl7.hibernate.ClonableCollection<CS>) acceptAckCode).cloneHibernateCollectionIfNecessary();
_acceptAckCode = acceptAckCo... | @see org.hl7.rim.Message#setAcceptAckCode */ void function(CS acceptAckCode) { if(acceptAckCode instanceof org.hl7.hibernate.ClonableCollection) acceptAckCode = ((org.hl7.hibernate.ClonableCollection<CS>) acceptAckCode).cloneHibernateCollectionIfNecessary(); _acceptAckCode = acceptAckCode; } | /** Sets the property acceptAckCode.
@see org.hl7.rim.Message#setAcceptAckCode
*/ | Sets the property acceptAckCode | setAcceptAckCode | {
"repo_name": "markusgumbel/dshl7",
"path": "hl7-javasig/gencode/org/hl7/rim/impl/MessageImpl.java",
"license": "apache-2.0",
"size": 8628
} | [
"org.hl7.rim.Message"
] | import org.hl7.rim.Message; | import org.hl7.rim.*; | [
"org.hl7.rim"
] | org.hl7.rim; | 1,866,980 |
@Override
public String getText(Object object) {
ResourceRequirement resourceRequirement = (ResourceRequirement)object;
return getString("_UI_ResourceRequirement_type") + " " + resourceRequirement.getRequiredCpu();
}
| String function(Object object) { ResourceRequirement resourceRequirement = (ResourceRequirement)object; return getString(STR) + " " + resourceRequirement.getRequiredCpu(); } | /**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This returns the label text for the adapted class. | getText | {
"repo_name": "ZsoltKovari/incquery-examples-cps",
"path": "domains/org.eclipse.incquery.examples.cps.model.edit/src/org/eclipse/incquery/examples/cps/cyberPhysicalSystem/provider/ResourceRequirementItemProvider.java",
"license": "epl-1.0",
"size": 7338
} | [
"org.eclipse.incquery.examples.cps.cyberPhysicalSystem.ResourceRequirement"
] | import org.eclipse.incquery.examples.cps.cyberPhysicalSystem.ResourceRequirement; | import org.eclipse.incquery.examples.cps.*; | [
"org.eclipse.incquery"
] | org.eclipse.incquery; | 1,690,248 |
@Nullable public RunfilesSupport getRunfilesSupport() {
return runfilesSupport;
} | @Nullable RunfilesSupport function() { return runfilesSupport; } | /**
* Returns the {@RunfilesSupport} object associated with the target or null if it does not exist.
*/ | Returns the object associated with the target or null if it does not exist | getRunfilesSupport | {
"repo_name": "twitter-forks/bazel",
"path": "src/main/java/com/google/devtools/build/lib/analysis/FilesToRunProvider.java",
"license": "apache-2.0",
"size": 3754
} | [
"javax.annotation.Nullable"
] | import javax.annotation.Nullable; | import javax.annotation.*; | [
"javax.annotation"
] | javax.annotation; | 2,821,513 |
public static long computeNextOccurance(ScheduleSpec spec, long afterTimeInMillis)
{
if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled()))
{
log.debug(".computeNextOccurance Computing next occurance, afterTimeInMillis=" + (new Date(afterTimeInMillis)) +
... | static long function(ScheduleSpec spec, long afterTimeInMillis) { if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled())) { log.debug(STR + (new Date(afterTimeInMillis)) + STR + afterTimeInMillis + STR + spec); } if (spec.getUnitValues().containsKey(ScheduleUnit.SECONDS)) { afterTimeInMillis += MIN_OFFSET... | /**
* Computes the next lowest date in milliseconds based on a specification and the
* from-time passed in.
* @param spec defines the schedule
* @param afterTimeInMillis defines the start time
* @return a long date millisecond value for the next schedule occurance matching the spec
*... | Computes the next lowest date in milliseconds based on a specification and the from-time passed in | computeNextOccurance | {
"repo_name": "sungsoo/esper",
"path": "esper/src/main/java/com/espertech/esper/schedule/ScheduleComputeHelper.java",
"license": "gpl-2.0",
"size": 23901
} | [
"com.espertech.esper.type.ScheduleUnit",
"com.espertech.esper.util.ExecutionPathDebugLog",
"java.util.Date"
] | import com.espertech.esper.type.ScheduleUnit; import com.espertech.esper.util.ExecutionPathDebugLog; import java.util.Date; | import com.espertech.esper.type.*; import com.espertech.esper.util.*; import java.util.*; | [
"com.espertech.esper",
"java.util"
] | com.espertech.esper; java.util; | 313,146 |
public static class CallNotification implements ICallNotification {
public void process(AGateway gateway, String callerId) {
logger.info(">>> New call detected from Gateway: "
+ gateway.getGatewayId() + " : " + callerId);
}
}
| static class CallNotification implements ICallNotification { public void function(AGateway gateway, String callerId) { logger.info(STR + gateway.getGatewayId() + STR + callerId); } } | /**
* We just log an incoming call detected
*/ | We just log an incoming call detected | process | {
"repo_name": "barbaramartina/Java-SMSLib-PatientMonitoring",
"path": "SMSMonitoring/src/sms/receivers/SMSLibReceiver.java",
"license": "gpl-3.0",
"size": 8044
} | [
"org.smslib.AGateway",
"org.smslib.ICallNotification"
] | import org.smslib.AGateway; import org.smslib.ICallNotification; | import org.smslib.*; | [
"org.smslib"
] | org.smslib; | 441,407 |
public byte[] deriveKey(final String info, final int length) throws IllegalStateException {
return deriveKey((info != null ? info.getBytes(StringUtils.UTF8) : null), length);
} | byte[] function(final String info, final int length) throws IllegalStateException { return deriveKey((info != null ? info.getBytes(StringUtils.UTF8) : null), length); } | /**
* Returns a pseudorandom key of <code>length</code> bytes.
*
* @param info
* optional context and application specific information (can be
* a zero-length string). This will be treated as UTF-8.
* @param length
* the length of the output key in byt... | Returns a pseudorandom key of <code>length</code> bytes | deriveKey | {
"repo_name": "smartpcr/aws-dynamodb-encryption-java",
"path": "src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/internal/Hkdf.java",
"license": "apache-2.0",
"size": 12591
} | [
"com.amazonaws.util.StringUtils"
] | import com.amazonaws.util.StringUtils; | import com.amazonaws.util.*; | [
"com.amazonaws.util"
] | com.amazonaws.util; | 620,691 |
@DoesServiceRequest
public boolean deleteIfExists(QueueRequestOptions options, OperationContext opContext) throws StorageException {
options = QueueRequestOptions.applyDefaults(options, this.queueServiceClient);
boolean exists = this.exists(true, options, opContext);
if (exists) {
... | boolean function(QueueRequestOptions options, OperationContext opContext) throws StorageException { options = QueueRequestOptions.applyDefaults(options, this.queueServiceClient); boolean exists = this.exists(true, options, opContext); if (exists) { try { this.delete(options, opContext); return true; } catch (StorageExc... | /**
* Deletes the queue if it exists, using the specified request options and operation context.
*
* @param options
* A {@link QueueRequestOptions} object that specifies any additional options for the request. Specifying
* <code>null</code> will use the default request op... | Deletes the queue if it exists, using the specified request options and operation context | deleteIfExists | {
"repo_name": "peterhoeltschi/AzureStorage",
"path": "microsoft-azure-storage/src/com/microsoft/azure/storage/queue/CloudQueue.java",
"license": "apache-2.0",
"size": 84043
} | [
"com.microsoft.azure.storage.OperationContext",
"com.microsoft.azure.storage.StorageErrorCodeStrings",
"com.microsoft.azure.storage.StorageException",
"java.net.HttpURLConnection"
] | import com.microsoft.azure.storage.OperationContext; import com.microsoft.azure.storage.StorageErrorCodeStrings; import com.microsoft.azure.storage.StorageException; import java.net.HttpURLConnection; | import com.microsoft.azure.storage.*; import java.net.*; | [
"com.microsoft.azure",
"java.net"
] | com.microsoft.azure; java.net; | 138,852 |
public void send(final MidiMessage message, final long deltaTime){
final ShortMessage shortMessage = (ShortMessage) message;
// get messageInfos
final int midiChannel = shortMessage.getChannel();
if (midiIns[midiChannel] == null)
return;
final int midiCommand = shortMessage.getCommand();
... | void function(final MidiMessage message, final long deltaTime){ final ShortMessage shortMessage = (ShortMessage) message; final int midiChannel = shortMessage.getChannel(); if (midiIns[midiChannel] == null) return; final int midiCommand = shortMessage.getCommand(); final int midiData1 = shortMessage.getData1(); final i... | /**
* Sorts the incoming MidiIO data in the different Arrays.
* @invisible
* @param message MidiMessage
* @param deltaTime long
*/ | Sorts the incoming MidiIO data in the different Arrays | send | {
"repo_name": "dearmash/Processing",
"path": "libraries/promidi/promidi/MidiInDevice.java",
"license": "mit",
"size": 3793
} | [
"javax.sound.midi.MidiMessage",
"javax.sound.midi.ShortMessage"
] | import javax.sound.midi.MidiMessage; import javax.sound.midi.ShortMessage; | import javax.sound.midi.*; | [
"javax.sound"
] | javax.sound; | 2,217,971 |
public static void cleanExpiredMobFiles(FileSystem fs, Configuration conf, TableName tableName,
HColumnDescriptor columnDescriptor, CacheConfig cacheConfig, long current)
throws IOException {
long timeToLive = columnDescriptor.getTimeToLive();
if (Integer.MAX_VALUE == timeToLive) {
// no nee... | static void function(FileSystem fs, Configuration conf, TableName tableName, HColumnDescriptor columnDescriptor, CacheConfig cacheConfig, long current) throws IOException { long timeToLive = columnDescriptor.getTimeToLive(); if (Integer.MAX_VALUE == timeToLive) { return; } Calendar calendar = Calendar.getInstance(); ca... | /**
* Cleans the expired mob files.
* Cleans the files whose creation date is older than (current - columnFamily.ttl), and
* the minVersions of that column family is 0.
* @param fs The current file system.
* @param conf The current configuration.
* @param tableName The current table name.
* @param ... | Cleans the expired mob files. Cleans the files whose creation date is older than (current - columnFamily.ttl), and the minVersions of that column family is 0 | cleanExpiredMobFiles | {
"repo_name": "gustavoanatoly/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/mob/MobUtils.java",
"license": "apache-2.0",
"size": 39255
} | [
"java.io.FileNotFoundException",
"java.io.IOException",
"java.util.ArrayList",
"java.util.Calendar",
"java.util.Date",
"java.util.List",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.fs.FileStatus",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.h... | import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.... | import java.io.*; import java.util.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.io.*; import org.apache.hadoop.hbase.io.hfile.*; import org.apache.hadoop.hbase.regionserver.*; import org.apache.hadoop.hbase.util.*; | [
"java.io",
"java.util",
"org.apache.hadoop"
] | java.io; java.util; org.apache.hadoop; | 1,947,808 |
public ServiceFuture<VirtualMachineScaleSetVMInner> updateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters, final ServiceCallback<VirtualMachineScaleSetVMInner> serviceCallback) {
return ServiceFuture.fromResponse(updateWithServiceResponseAsy... | ServiceFuture<VirtualMachineScaleSetVMInner> function(String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters, final ServiceCallback<VirtualMachineScaleSetVMInner> serviceCallback) { return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, ... | /**
* Updates a virtual machine of a VM scale set.
*
* @param resourceGroupName The name of the resource group.
* @param vmScaleSetName The name of the VM scale set where the extension should be create or updated.
* @param instanceId The instance ID of the virtual machine.
* @param paramet... | Updates a virtual machine of a VM scale set | updateAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/compute/mgmt-v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineScaleSetVMsInner.java",
"license": "mit",
"size": 158623
} | [
"com.microsoft.rest.ServiceCallback",
"com.microsoft.rest.ServiceFuture"
] | import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 1,799,957 |
public void onConnect(Platform platform) {
setDatasourcePlatform(platform);
if(!isCustomQualifier) {
qualifier = getDatasourcePlatform().getTableQualifier();
}
onConnect();
depth++;
}
| void function(Platform platform) { setDatasourcePlatform(platform); if(!isCustomQualifier) { qualifier = getDatasourcePlatform().getTableQualifier(); } onConnect(); depth++; } | /**
* INTERNAL:
* This method is called when Sequencing object is created.
* Don't override this method.
*/ | This method is called when Sequencing object is created. Don't override this method | onConnect | {
"repo_name": "bfg-repo-cleaner-demos/eclipselink.runtime-bfg-strip-big-blobs",
"path": "foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/sequencing/Sequence.java",
"license": "epl-1.0",
"size": 14462
} | [
"org.eclipse.persistence.internal.databaseaccess.Platform"
] | import org.eclipse.persistence.internal.databaseaccess.Platform; | import org.eclipse.persistence.internal.databaseaccess.*; | [
"org.eclipse.persistence"
] | org.eclipse.persistence; | 1,980,537 |
public static Read<PubsubMessage> readMessagesWithAttributes() {
return new AutoValue_PubsubIO_Read.Builder<PubsubMessage>()
.setCoder(PubsubMessageWithAttributesCoder.of())
.setParseFn(new IdentityMessageFn())
.setNeedsAttributes(true)
.build();
} | static Read<PubsubMessage> function() { return new AutoValue_PubsubIO_Read.Builder<PubsubMessage>() .setCoder(PubsubMessageWithAttributesCoder.of()) .setParseFn(new IdentityMessageFn()) .setNeedsAttributes(true) .build(); } | /**
* Returns A {@link PTransform} that continuously reads from a Google Cloud Pub/Sub stream. The
* messages will contain both a {@link PubsubMessage#getPayload() payload} and {@link
* PubsubMessage#getAttributeMap() attributes}.
*/ | Returns A <code>PTransform</code> that continuously reads from a Google Cloud Pub/Sub stream. The messages will contain both a <code>PubsubMessage#getPayload() payload</code> and <code>PubsubMessage#getAttributeMap() attributes</code> | readMessagesWithAttributes | {
"repo_name": "rangadi/beam",
"path": "sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubIO.java",
"license": "apache-2.0",
"size": 39555
} | [
"com.google.auto.value.AutoValue"
] | import com.google.auto.value.AutoValue; | import com.google.auto.value.*; | [
"com.google.auto"
] | com.google.auto; | 287,525 |
private void showSplash() {
splash = new JFrame();
ImageIcon spl =
new ImageIcon(App.class.getResource("resources/splash.png"));
JLabel l = new JLabel();
l.setSize(400, 300);
l.setIcon(spl);
splash.getContentPane().add(l);
splash.setSize(400, 300);
Dimension screenSize = Toolkit.getDefaultToolkit(... | void function() { splash = new JFrame(); ImageIcon spl = new ImageIcon(App.class.getResource(STR)); JLabel l = new JLabel(); l.setSize(400, 300); l.setIcon(spl); splash.getContentPane().add(l); splash.setSize(400, 300); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); splash.setLocation( (screenSize.... | /**
* Method showSplash.
*/ | Method showSplash | showSplash | {
"repo_name": "cst316/spring16project-Lisp",
"path": "src/net/sf/memoranda/ui/App.java",
"license": "gpl-2.0",
"size": 5221
} | [
"java.awt.Dimension",
"java.awt.Toolkit",
"javax.swing.ImageIcon",
"javax.swing.JFrame",
"javax.swing.JLabel"
] | import java.awt.Dimension; import java.awt.Toolkit; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JLabel; | import java.awt.*; import javax.swing.*; | [
"java.awt",
"javax.swing"
] | java.awt; javax.swing; | 571,292 |
public static BigInteger removeDigit(BigInteger s, int d)
{
s = s.subtract(s.mod(BigInteger.valueOf(d)));
s = s.divide(BigInteger.valueOf(d));
return s;
} | static BigInteger function(BigInteger s, int d) { s = s.subtract(s.mod(BigInteger.valueOf(d))); s = s.divide(BigInteger.valueOf(d)); return s; } | /**
* remove a digit of domain d from source s
* @param s source
* @param d domain (max value)
* @return trimmed source
*/ | remove a digit of domain d from source s | removeDigit | {
"repo_name": "vanitasvitae/EnigmAndroid",
"path": "app/src/main/java/de/vanitasvitae/enigmandroid/enigma/Enigma.java",
"license": "gpl-3.0",
"size": 7691
} | [
"java.math.BigInteger"
] | import java.math.BigInteger; | import java.math.*; | [
"java.math"
] | java.math; | 1,647,677 |
public void run() {
try {
final ServerBootstrap bootstrap = createServerBootStrap();
bootstrap.setOption("reuseAddr", true);
bootstrap.setOption("child.keepAlive", true);
bootstrap.setOption("child.tcpNoDelay", true);
bootstrap.setOption("child.s... | void function() { try { final ServerBootstrap bootstrap = createServerBootStrap(); bootstrap.setOption(STR, true); bootstrap.setOption(STR, true); bootstrap.setOption(STR, true); bootstrap.setOption(STR, Controller.SEND_BUFFER_SIZE); ChannelPipelineFactory pfact = new OpenflowPipelineFactory(this, null, sslContext); bo... | /**
* Tell controller that we're ready to accept switches loop.
*/ | Tell controller that we're ready to accept switches loop | run | {
"repo_name": "maheshraju-Huawei/actn",
"path": "protocols/openflow/ctl/src/main/java/org/onosproject/openflow/controller/impl/Controller.java",
"license": "apache-2.0",
"size": 11389
} | [
"java.net.InetSocketAddress",
"org.jboss.netty.bootstrap.ServerBootstrap",
"org.jboss.netty.channel.ChannelPipelineFactory",
"org.jboss.netty.channel.group.DefaultChannelGroup"
] | import java.net.InetSocketAddress; import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.channel.ChannelPipelineFactory; import org.jboss.netty.channel.group.DefaultChannelGroup; | import java.net.*; import org.jboss.netty.bootstrap.*; import org.jboss.netty.channel.*; import org.jboss.netty.channel.group.*; | [
"java.net",
"org.jboss.netty"
] | java.net; org.jboss.netty; | 2,831,042 |
String getValidMultiLineComment(@Nullable String comment, @Nullable String defaultComment); | String getValidMultiLineComment(@Nullable String comment, @Nullable String defaultComment); | /**
* Validate multi-line comment to be used inside a <script>...</script> or <style>...</style> block. Multi-line
* comment end block is disallowed.
*
* @param comment the comment to be used
* @param defaultComment a default value to use if the comment is {... | Validate multi-line comment to be used inside a <script>...</script> or <style>...</style> block. Multi-line comment end block is disallowed | getValidMultiLineComment | {
"repo_name": "plutext/sling",
"path": "bundles/extensions/xss/src/main/java/org/apache/sling/xss/XSSAPI.java",
"license": "apache-2.0",
"size": 10073
} | [
"javax.annotation.Nullable"
] | import javax.annotation.Nullable; | import javax.annotation.*; | [
"javax.annotation"
] | javax.annotation; | 2,267,850 |
// even function
if (x <= 0) {
if (x == 0) {
return 1;
}
x = -x;
}
// boost/math/special_functions/detail/bessel_i0.hpp
// Modified Bessel function of the first kind of order zero
// we use the approximating forms derived in:
// "Rational Approximations for the Modifi... | if (x <= 0) { if (x == 0) { return 1; } x = -x; } if (x < 7.75) { final double a = x * x / 4; final double a2 = a * a; double p0; double p1; p0 = 9.07926920085624812e-25 * a2 + 2.63417742690109154e-20; p1 = 1.13943037744822825e-22 * a2 + 4.34709704153272287e-18; p0 = p0 * a2 + 6.27767773636292611e-16; p1 = p1 * a2 + 7.... | /**
* Compute the zero th order modified Bessel function of the first kind.
*
* @param x the x value
* @return the modified Bessel function I0
*/ | Compute the zero th order modified Bessel function of the first kind | i0 | {
"repo_name": "aherbert/GDSC-SMLM",
"path": "src/main/java/uk/ac/sussex/gdsc/smlm/function/Bessel.java",
"license": "gpl-3.0",
"size": 21905
} | [
"org.apache.commons.math3.util.FastMath"
] | import org.apache.commons.math3.util.FastMath; | import org.apache.commons.math3.util.*; | [
"org.apache.commons"
] | org.apache.commons; | 2,472,887 |
public Observable<ServiceResponse<ArmDisasterRecoveryInner>> getWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
... | Observable<ServiceResponse<ArmDisasterRecoveryInner>> function(String resourceGroupName, String namespaceName, String alias) { if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (namespaceName == null) { throw new IllegalArgumentException(STR); } if (alias == null) { throw new IllegalArgumen... | /**
* Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param namespaceName The namespace name
* @param alias The Disaster Recovery configuration name
* @throws Ille... | Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace | getWithServiceResponseAsync | {
"repo_name": "navalev/azure-sdk-for-java",
"path": "sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/DisasterRecoveryConfigsInner.java",
"license": "mit",
"size": 84486
} | [
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.rest.ServiceResponse; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 1,005,556 |
void testCompletionVariants(@NotNull @TestDataFile @NonNls String fileBefore, @NotNull @NonNls String... items); | void testCompletionVariants(@NotNull @TestDataFile @NonNls String fileBefore, @NotNull @NonNls String... items); | /**
* Runs basic completion in caret position in fileBefore.
* Checks that lookup is shown and it contains items with given lookup strings
*
* @param items most probably will contain > 1 items
*/ | Runs basic completion in caret position in fileBefore. Checks that lookup is shown and it contains items with given lookup strings | testCompletionVariants | {
"repo_name": "supersven/intellij-community",
"path": "platform/testFramework/src/com/intellij/testFramework/fixtures/CodeInsightTestFixture.java",
"license": "apache-2.0",
"size": 22637
} | [
"com.intellij.testFramework.TestDataFile",
"org.jetbrains.annotations.NonNls",
"org.jetbrains.annotations.NotNull"
] | import com.intellij.testFramework.TestDataFile; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; | import com.intellij.*; import org.jetbrains.annotations.*; | [
"com.intellij",
"org.jetbrains.annotations"
] | com.intellij; org.jetbrains.annotations; | 1,448,742 |
private void checkFilter( ExprNode filter ) throws LdapException
{
if ( filter == null )
{
String message = I18n.err( I18n.ERR_49 );
LOG.error( message );
throw new LdapException( message );
}
if ( filter instanceof ObjectClassNode )
{... | void function( ExprNode filter ) throws LdapException { if ( filter == null ) { String message = I18n.err( I18n.ERR_49 ); LOG.error( message ); throw new LdapException( message ); } if ( filter instanceof ObjectClassNode ) { return; } if ( filter.isLeaf() ) { if ( filter instanceof EqualityNode ) { EqualityNode node = ... | /**
* Check that the filter values are compatible with the AttributeType. Typically,
* a HumanReadible filter should have a String value. The substring filter should
* not be used with binary attributes.
*/ | Check that the filter values are compatible with the AttributeType. Typically, a HumanReadible filter should have a String value. The substring filter should not be used with binary attributes | checkFilter | {
"repo_name": "TremoloSecurity/MyVirtualDirectory",
"path": "src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java",
"license": "apache-2.0",
"size": 70193
} | [
"org.apache.directory.api.ldap.model.entry.Value",
"org.apache.directory.api.ldap.model.exception.LdapException",
"org.apache.directory.api.ldap.model.filter.ApproximateNode",
"org.apache.directory.api.ldap.model.filter.BranchNode",
"org.apache.directory.api.ldap.model.filter.EqualityNode",
"org.apache.di... | import org.apache.directory.api.ldap.model.entry.Value; import org.apache.directory.api.ldap.model.exception.LdapException; import org.apache.directory.api.ldap.model.filter.ApproximateNode; import org.apache.directory.api.ldap.model.filter.BranchNode; import org.apache.directory.api.ldap.model.filter.EqualityNode; imp... | import org.apache.directory.api.ldap.model.entry.*; import org.apache.directory.api.ldap.model.exception.*; import org.apache.directory.api.ldap.model.filter.*; import org.apache.directory.server.i18n.*; | [
"org.apache.directory"
] | org.apache.directory; | 609,141 |
@Test
public void testClean() throws Exception {
LOG.info("testClean");
setUp(false);
int result = ToolRunner.run(shell, args);
assertTrue("fsck should return 0, but returns " +
Integer.toString(result), result == 0);
} | void function() throws Exception { LOG.info(STR); setUp(false); int result = ToolRunner.run(shell, args); assertTrue(STR + Integer.toString(result), result == 0); } | /**
* checks fsck with no missing blocks
*/ | checks fsck with no missing blocks | testClean | {
"repo_name": "steveloughran/hadoop-mapreduce",
"path": "src/contrib/raid/src/test/org/apache/hadoop/raid/TestRaidShellFsck.java",
"license": "apache-2.0",
"size": 25716
} | [
"org.apache.hadoop.util.ToolRunner",
"org.junit.Assert"
] | import org.apache.hadoop.util.ToolRunner; import org.junit.Assert; | import org.apache.hadoop.util.*; import org.junit.*; | [
"org.apache.hadoop",
"org.junit"
] | org.apache.hadoop; org.junit; | 1,304,380 |
private static Predicate<LibraryToLink> ccLibraryNotYetLinked(
final HashSet<Artifact> linkedLibraryArtifacts) {
return new Predicate<LibraryToLink>() { | static Predicate<LibraryToLink> function( final HashSet<Artifact> linkedLibraryArtifacts) { return new Predicate<LibraryToLink>() { | /**
* Returns a predicate which returns true for a given {@link LibraryToLink} if the library
* artifact is not contained in a given set.
*
* @param linkedLibraryArtifacts if a given library's artifact is present in this set, the
* predicate will return false
*/ | Returns a predicate which returns true for a given <code>LibraryToLink</code> if the library artifact is not contained in a given set | ccLibraryNotYetLinked | {
"repo_name": "Asana/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/objc/ObjcProvider.java",
"license": "apache-2.0",
"size": 41230
} | [
"com.google.common.base.Predicate",
"com.google.devtools.build.lib.actions.Artifact",
"com.google.devtools.build.lib.rules.cpp.LinkerInputs",
"java.util.HashSet"
] | import com.google.common.base.Predicate; import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.rules.cpp.LinkerInputs; import java.util.HashSet; | import com.google.common.base.*; import com.google.devtools.build.lib.actions.*; import com.google.devtools.build.lib.rules.cpp.*; import java.util.*; | [
"com.google.common",
"com.google.devtools",
"java.util"
] | com.google.common; com.google.devtools; java.util; | 2,043,771 |
public void setOnClosedListener(OnClosedListener listener) {
mViewAbove.setOnClosedListener(listener);
}
public static class SavedState extends BaseSavedState {
private final int mItem;
public SavedState(Parcelable superState, int item) {
super(superState);
... | void function(OnClosedListener listener) { mViewAbove.setOnClosedListener(listener); } public static class SavedState extends BaseSavedState { private final int mItem; public SavedState(Parcelable superState, int item) { super(superState); mItem = item; } private SavedState(Parcel in) { super(in); mItem = in.readInt();... | /**
* Sets the OnClosedListener. {@link OnClosedListener#onClosed() OnClosedListener.onClosed()} will be called after the SlidingMenu is closed
*
* @param listener the new OnClosedListener
*/ | Sets the OnClosedListener. <code>OnClosedListener#onClosed() OnClosedListener.onClosed()</code> will be called after the SlidingMenu is closed | setOnClosedListener | {
"repo_name": "jjhesk/BringItBackAdvanceSlidingMenu",
"path": "AdvancedSlidingMenu/slidingmenulib/src/main/java/com/hkm/slidingmenulib/gestured/SlidingMenu.java",
"license": "apache-2.0",
"size": 37535
} | [
"android.os.Parcel",
"android.os.Parcelable"
] | import android.os.Parcel; import android.os.Parcelable; | import android.os.*; | [
"android.os"
] | android.os; | 671,731 |
List<InterceptStrategy> getInterceptStrategies(); | List<InterceptStrategy> getInterceptStrategies(); | /**
* Gets the interceptor strategies
*
* @return the list of current interceptor strategies
*/ | Gets the interceptor strategies | getInterceptStrategies | {
"repo_name": "gnodet/camel",
"path": "core/camel-api/src/main/java/org/apache/camel/ExtendedCamelContext.java",
"license": "apache-2.0",
"size": 24074
} | [
"java.util.List",
"org.apache.camel.spi.InterceptStrategy"
] | import java.util.List; import org.apache.camel.spi.InterceptStrategy; | import java.util.*; import org.apache.camel.spi.*; | [
"java.util",
"org.apache.camel"
] | java.util; org.apache.camel; | 877,058 |
void setMaxResultTimeForOffering(String offering, DateTime maxTime); | void setMaxResultTimeForOffering(String offering, DateTime maxTime); | /**
* Sets the maximal result time for the specified offering to the specified
* time.
*
* @param offering
* the offering
* @param maxTime
* the max result time
*/ | Sets the maximal result time for the specified offering to the specified time | setMaxResultTimeForOffering | {
"repo_name": "nuest/SOS",
"path": "core/api/src/main/java/org/n52/sos/cache/WritableContentCache.java",
"license": "gpl-2.0",
"size": 46330
} | [
"org.joda.time.DateTime"
] | import org.joda.time.DateTime; | import org.joda.time.*; | [
"org.joda.time"
] | org.joda.time; | 1,630,708 |
public static CompletableFuture<AsyncConnection> createAsyncConnection(Configuration conf) {
User user;
try {
user = AuthUtil.loginClient(conf);
} catch (IOException e) {
CompletableFuture<AsyncConnection> future = new CompletableFuture<>();
future.completeExceptionally(e);
return ... | static CompletableFuture<AsyncConnection> function(Configuration conf) { User user; try { user = AuthUtil.loginClient(conf); } catch (IOException e) { CompletableFuture<AsyncConnection> future = new CompletableFuture<>(); future.completeExceptionally(e); return future; } return createAsyncConnection(conf, user); } | /**
* Call {@link #createAsyncConnection(Configuration, User)} using the given {@code conf} and a
* User object created by {@link UserProvider}. The given {@code conf} will also be used to
* initialize the {@link UserProvider}.
* @param conf configuration
* @return AsyncConnection object wrapped by Compl... | Call <code>#createAsyncConnection(Configuration, User)</code> using the given conf and a User object created by <code>UserProvider</code>. The given conf will also be used to initialize the <code>UserProvider</code> | createAsyncConnection | {
"repo_name": "Eshcar/hbase",
"path": "hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionFactory.java",
"license": "apache-2.0",
"size": 11941
} | [
"java.io.IOException",
"java.util.concurrent.CompletableFuture",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.hbase.AuthUtil",
"org.apache.hadoop.hbase.security.User"
] | import java.io.IOException; import java.util.concurrent.CompletableFuture; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.AuthUtil; import org.apache.hadoop.hbase.security.User; | import java.io.*; import java.util.concurrent.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.security.*; | [
"java.io",
"java.util",
"org.apache.hadoop"
] | java.io; java.util; org.apache.hadoop; | 385,157 |
@Override
protected String getPathPrefix(final HttpServletRequest request) {
// Repeat the servlet path (e.g. /webdav/) in the listing path
String contextPath = request.getContextPath();
if (request.getServletPath() != null) {
contextPath = contextPath + request.getServletPa... | String function(final HttpServletRequest request) { String contextPath = request.getContextPath(); if (request.getServletPath() != null) { contextPath = contextPath + request.getServletPath(); } return contextPath; } | /**
* Determines the prefix for standard directory GET listings.
*/ | Determines the prefix for standard directory GET listings | getPathPrefix | {
"repo_name": "plumer/codana",
"path": "tomcat_files/8.0.0/WebdavServlet.java",
"license": "mit",
"size": 104517
} | [
"javax.servlet.http.HttpServletRequest"
] | import javax.servlet.http.HttpServletRequest; | import javax.servlet.http.*; | [
"javax.servlet"
] | javax.servlet; | 1,315,298 |
public boolean checkDoctypeLabel(MaintenanceDocument document) {
boolean isValid = true;
DocumentType bo = (DocumentType) document.getNewMaintainableObject().getDataObject();
isValid = !StringUtils.isBlank(bo.getLabel());
return isValid;
}
| boolean function(MaintenanceDocument document) { boolean isValid = true; DocumentType bo = (DocumentType) document.getNewMaintainableObject().getDataObject(); isValid = !StringUtils.isBlank(bo.getLabel()); return isValid; } | /**
* Checks that the doctype label is specified.
*
* @param document
* @return false if doctype label is blank, otherwise true.
*/ | Checks that the doctype label is specified | checkDoctypeLabel | {
"repo_name": "ricepanda/rice-git3",
"path": "rice-middleware/impl/src/main/java/org/kuali/rice/kew/document/DocumentTypeMaintainableBusRule.java",
"license": "apache-2.0",
"size": 2939
} | [
"org.apache.commons.lang.StringUtils",
"org.kuali.rice.kew.doctype.bo.DocumentType",
"org.kuali.rice.kns.document.MaintenanceDocument"
] | import org.apache.commons.lang.StringUtils; import org.kuali.rice.kew.doctype.bo.DocumentType; import org.kuali.rice.kns.document.MaintenanceDocument; | import org.apache.commons.lang.*; import org.kuali.rice.kew.doctype.bo.*; import org.kuali.rice.kns.document.*; | [
"org.apache.commons",
"org.kuali.rice"
] | org.apache.commons; org.kuali.rice; | 1,369,078 |
public BobcatWait ignoring(List<Class<? extends Throwable>> exceptions) {
ignoredExceptions.addAll(exceptions);
return this;
} | BobcatWait function(List<Class<? extends Throwable>> exceptions) { ignoredExceptions.addAll(exceptions); return this; } | /**
* Adds a list of exception to be ignored during condition evaluation
*
* @param exceptions list of exceptions to be ignored
* @return a self reference
* @see org.openqa.selenium.support.ui.FluentWait#ignoreAll(Collection)
*/ | Adds a list of exception to be ignored during condition evaluation | ignoring | {
"repo_name": "Cognifide/bobcat",
"path": "bb-core/src/main/java/com/cognifide/qa/bb/wait/BobcatWait.java",
"license": "apache-2.0",
"size": 5174
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,918,109 |
public CategoryToolTipGenerator getToolTipGenerator(int row, int column);
/**
* Returns the tool tip generator that will be used for ALL items in the
* dataset (the "layer 0" generator).
*
* @return A tool tip generator (possibly <code>null</code>).
*
* @see #setToolTipGenerato... | CategoryToolTipGenerator function(int row, int column); /** * Returns the tool tip generator that will be used for ALL items in the * dataset (the STR generator). * * @return A tool tip generator (possibly <code>null</code>). * * @see #setToolTipGenerator(CategoryToolTipGenerator) * * @deprecated This method should no ... | /**
* Returns the tool tip generator that should be used for the specified
* item. This method looks up the generator using the "three-layer"
* approach outlined in the general description of this interface.
*
* @param row the row index (zero-based).
* @param column the column index... | Returns the tool tip generator that should be used for the specified item. This method looks up the generator using the "three-layer" approach outlined in the general description of this interface | getToolTipGenerator | {
"repo_name": "ibestvina/multithread-centiscape",
"path": "CentiScaPe2.1/src/main/java/org/jfree/chart/renderer/category/CategoryItemRenderer.java",
"license": "mit",
"size": 66885
} | [
"org.jfree.chart.labels.CategoryToolTipGenerator"
] | import org.jfree.chart.labels.CategoryToolTipGenerator; | import org.jfree.chart.labels.*; | [
"org.jfree.chart"
] | org.jfree.chart; | 1,517,024 |
public ModelCriterion getSelectedCriterion() {
if (table.getSelection() == null || table.getSelection().length == 0) {
return null;
}
return (ModelCriterion)table.getSelection()[0].getData();
} | ModelCriterion function() { if (table.getSelection() == null table.getSelection().length == 0) { return null; } return (ModelCriterion)table.getSelection()[0].getData(); } | /**
* Returns the currently selected criterion, if any
* @return
*/ | Returns the currently selected criterion, if any | getSelectedCriterion | {
"repo_name": "COWYARD/arx",
"path": "src/gui/org/deidentifier/arx/gui/view/impl/define/ViewCriteriaList.java",
"license": "apache-2.0",
"size": 10891
} | [
"org.deidentifier.arx.gui.model.ModelCriterion"
] | import org.deidentifier.arx.gui.model.ModelCriterion; | import org.deidentifier.arx.gui.model.*; | [
"org.deidentifier.arx"
] | org.deidentifier.arx; | 1,256,045 |
void enterSourceClause(@NotNull CQLParser.SourceClauseContext ctx);
void exitSourceClause(@NotNull CQLParser.SourceClauseContext ctx); | void enterSourceClause(@NotNull CQLParser.SourceClauseContext ctx); void exitSourceClause(@NotNull CQLParser.SourceClauseContext ctx); | /**
* Exit a parse tree produced by {@link CQLParser#sourceClause}.
* @param ctx the parse tree
*/ | Exit a parse tree produced by <code>CQLParser#sourceClause</code> | exitSourceClause | {
"repo_name": "jack6215/StreamCQL",
"path": "cql/src/main/java/com/huawei/streaming/cql/semanticanalyzer/parser/CQLParserListener.java",
"license": "apache-2.0",
"size": 62500
} | [
"org.antlr.v4.runtime.misc.NotNull"
] | import org.antlr.v4.runtime.misc.NotNull; | import org.antlr.v4.runtime.misc.*; | [
"org.antlr.v4"
] | org.antlr.v4; | 2,115,561 |
protected Object convertFromBytesMessage(BytesMessage message, JavaType targetJavaType)
throws JMSException, IOException {
String encoding = this.encoding;
if (this.encodingPropertyName != null && message.propertyExists(this.encodingPropertyName)) {
encoding = message.getStringProperty(this.encodingProper... | Object function(BytesMessage message, JavaType targetJavaType) throws JMSException, IOException { String encoding = this.encoding; if (this.encodingPropertyName != null && message.propertyExists(this.encodingPropertyName)) { encoding = message.getStringProperty(this.encodingPropertyName); } byte[] bytes = new byte[(int... | /**
* Convert a BytesMessage to a Java Object with the specified type.
* @param message the input message
* @param targetJavaType the target type
* @return the message converted to an object
* @throws JMSException if thrown by JMS
* @throws IOException in case of I/O errors
*/ | Convert a BytesMessage to a Java Object with the specified type | convertFromBytesMessage | {
"repo_name": "kingtang/spring-learn",
"path": "spring-jms/src/main/java/org/springframework/jms/support/converter/MappingJacksonMessageConverter.java",
"license": "gpl-3.0",
"size": 13824
} | [
"java.io.IOException",
"java.io.UnsupportedEncodingException",
"javax.jms.BytesMessage",
"javax.jms.JMSException",
"org.codehaus.jackson.type.JavaType"
] | import java.io.IOException; import java.io.UnsupportedEncodingException; import javax.jms.BytesMessage; import javax.jms.JMSException; import org.codehaus.jackson.type.JavaType; | import java.io.*; import javax.jms.*; import org.codehaus.jackson.type.*; | [
"java.io",
"javax.jms",
"org.codehaus.jackson"
] | java.io; javax.jms; org.codehaus.jackson; | 1,709,800 |
public static void deleteIfExists(Path path) {
try {
FileSystem fs = path.getFileSystem(CONF);
if (!fs.exists(path)) return;
fs.delete(path);
} catch (IOException e) {
LOG.warn("Encountered an exception deleting file at path " + path.toString(), e);
}
} | static void function(Path path) { try { FileSystem fs = path.getFileSystem(CONF); if (!fs.exists(path)) return; fs.delete(path); } catch (IOException e) { LOG.warn(STR + path.toString(), e); } } | /**
* Delete the file at 'path' if it exists.
*/ | Delete the file at 'path' if it exists | deleteIfExists | {
"repo_name": "924060929/impala-frontend",
"path": "fe/src/main/java/org/apache/impala/common/FileSystemUtil.java",
"license": "apache-2.0",
"size": 16351
} | [
"java.io.IOException",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path"
] | import java.io.IOException; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; | import java.io.*; import org.apache.hadoop.fs.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 230,442 |
public void setNodes(Vector<MRFNode> nodes) {
m_Nodes = nodes;
} | void function(Vector<MRFNode> nodes) { m_Nodes = nodes; } | /**
* <p>Method : setNodes
* <p>Purpose : Sets the set of vertices in an undirected graph
* <p>@param nodes void
*/ | Method : setNodes Purpose : Sets the set of vertices in an undirected graph @param nodes void | setNodes | {
"repo_name": "Khalian/WSDAlphaExpansion",
"path": "code/MRFGraph.java",
"license": "apache-2.0",
"size": 2330
} | [
"java.util.Vector"
] | import java.util.Vector; | import java.util.*; | [
"java.util"
] | java.util; | 1,602,188 |
public void setLanguage(LanguageMode language) {
Preconditions.checkState(languageIn != LanguageMode.NO_TRANSPILE);
this.languageIn = language;
this.languageOut = language;
} | void function(LanguageMode language) { Preconditions.checkState(languageIn != LanguageMode.NO_TRANSPILE); this.languageIn = language; this.languageOut = language; } | /**
* Sets ECMAScript version to use.
*/ | Sets ECMAScript version to use | setLanguage | {
"repo_name": "mweissbacher/closure-compiler",
"path": "src/com/google/javascript/jscomp/CompilerOptions.java",
"license": "apache-2.0",
"size": 75983
} | [
"com.google.common.base.Preconditions"
] | import com.google.common.base.Preconditions; | import com.google.common.base.*; | [
"com.google.common"
] | com.google.common; | 2,673,935 |
public void setAlbumNamesToGroup(HashSet<String> albumNamesToGroup) {
this.albumNamesToGroup = albumNamesToGroup;
saveSettingsFile();
} | void function(HashSet<String> albumNamesToGroup) { this.albumNamesToGroup = albumNamesToGroup; saveSettingsFile(); } | /**
* Sets the album names to group
*/ | Sets the album names to group | setAlbumNamesToGroup | {
"repo_name": "kuhnmi/jukefox",
"path": "JukefoxModel/src/ch/ethz/dcg/jukefox/data/settings/ModelSettings.java",
"license": "gpl-3.0",
"size": 10657
} | [
"java.util.HashSet"
] | import java.util.HashSet; | import java.util.*; | [
"java.util"
] | java.util; | 2,042,454 |
public PairIterator xgtitle(String wildmat)
throws IOException
{
StringBuffer buffer = new StringBuffer(XGTITLE);
if (wildmat != null)
{
buffer.append(' ');
buffer.append(wildmat);
}
send(buffer.toString());
StatusResponse response = parseResponse(read());
switch ... | PairIterator function(String wildmat) throws IOException { StringBuffer buffer = new StringBuffer(XGTITLE); if (wildmat != null) { buffer.append(' '); buffer.append(wildmat); } send(buffer.toString()); StatusResponse response = parseResponse(read()); switch (response.status) { case XGTITLE_LIST_FOLLOWS: PairIterator pi... | /**
* Returns an iterator over the list of newsgroup descriptions.
* @param wildmat if non-null, the newsgroups to match
*/ | Returns an iterator over the list of newsgroup descriptions | xgtitle | {
"repo_name": "SeekingFor/jfniki",
"path": "alien/src/gnu/inet/nntp/NNTPConnection.java",
"license": "gpl-2.0",
"size": 42972
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,708,294 |
private static String getVirtualHostPidForSipEndpoint(Map<String, Object> sipEndpointProperties, ConfigurationAdmin configAdminRef) throws IOException, InvalidSyntaxException{
String virtualHostPid = null;
boolean isSipConnectorVH = isSipConnectorReferenecedEndpoint(sipEndpointProperties, configAdminRef);
if(i... | static String function(Map<String, Object> sipEndpointProperties, ConfigurationAdmin configAdminRef) throws IOException, InvalidSyntaxException{ String virtualHostPid = null; boolean isSipConnectorVH = isSipConnectorReferenecedEndpoint(sipEndpointProperties, configAdminRef); if(isSipConnectorVH){ virtualHostPid= getVir... | /**
* Gets virtual host pid for SIP endpoint.
*
*
* @param sipEndpointProperties configuration properties of SIP endpoint.
* @param configAdminRef ConfigurationAdmin reference.
* @return virtual host pid for SIP endpoint.
*
* @throws IOException
* @throws InvalidSyntaxException
*/ | Gets virtual host pid for SIP endpoint | getVirtualHostPidForSipEndpoint | {
"repo_name": "kgibm/open-liberty",
"path": "dev/com.ibm.ws.sipcontainer/src/com/ibm/ws/sip/stack/transport/virtualhost/SipVirtualHostAdapter.java",
"license": "epl-1.0",
"size": 31382
} | [
"java.io.IOException",
"java.util.Map",
"org.osgi.framework.InvalidSyntaxException",
"org.osgi.service.cm.ConfigurationAdmin"
] | import java.io.IOException; import java.util.Map; import org.osgi.framework.InvalidSyntaxException; import org.osgi.service.cm.ConfigurationAdmin; | import java.io.*; import java.util.*; import org.osgi.framework.*; import org.osgi.service.cm.*; | [
"java.io",
"java.util",
"org.osgi.framework",
"org.osgi.service"
] | java.io; java.util; org.osgi.framework; org.osgi.service; | 1,625,796 |
protected String getStandardDialect(String clientType, ApplicationConfig appConfig) {
Map<String, String> claimMappings = appConfig.getClaimMappings();
if (FrameworkConstants.RequestType.CLAIM_TYPE_OIDC.equals(clientType)) {
return "http://wso2.org/oidc/claim";
} else if (Framew... | String function(String clientType, ApplicationConfig appConfig) { Map<String, String> claimMappings = appConfig.getClaimMappings(); if (FrameworkConstants.RequestType.CLAIM_TYPE_OIDC.equals(clientType)) { return STRhttp: } else if (FrameworkConstants.RequestType.CLAIM_TYPE_OPENID.equals(clientType)) { return STRurn:sci... | /**
* Returns the claim dialect URI based on the client type
*
* @param clientType
* @param appConfig
* @return standard dialect -> SP uses standard dialect; carbon or other
* null -> SP uses custom dialect
*/ | Returns the claim dialect URI based on the client type | getStandardDialect | {
"repo_name": "nuwandi-is/identity-framework",
"path": "components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/handler/claims/impl/DefaultClaimHandler.java",
"license": "apache-2.0",
"size": 4... | [
"java.util.Map",
"org.wso2.carbon.identity.application.authentication.framework.config.model.ApplicationConfig",
"org.wso2.carbon.identity.application.authentication.framework.util.FrameworkConstants",
"org.wso2.carbon.identity.application.mgt.ApplicationConstants"
] | import java.util.Map; import org.wso2.carbon.identity.application.authentication.framework.config.model.ApplicationConfig; import org.wso2.carbon.identity.application.authentication.framework.util.FrameworkConstants; import org.wso2.carbon.identity.application.mgt.ApplicationConstants; | import java.util.*; import org.wso2.carbon.identity.application.authentication.framework.config.model.*; import org.wso2.carbon.identity.application.authentication.framework.util.*; import org.wso2.carbon.identity.application.mgt.*; | [
"java.util",
"org.wso2.carbon"
] | java.util; org.wso2.carbon; | 1,734,791 |
protected void ensureCapacity(int reqCapacity) {
int curCapacity = data.length;
if (reqCapacity <= curCapacity) {
return;
}
int newCapacity = curCapacity * GROWTH_FACTOR_MULTIPLIER / GROWTH_FACTOR_DIVISOR;
if ((newCapacity - curCapacity) < MIN_GROWTH_SIZE) {... | void function(int reqCapacity) { int curCapacity = data.length; if (reqCapacity <= curCapacity) { return; } int newCapacity = curCapacity * GROWTH_FACTOR_MULTIPLIER / GROWTH_FACTOR_DIVISOR; if ((newCapacity - curCapacity) < MIN_GROWTH_SIZE) { newCapacity = curCapacity + MIN_GROWTH_SIZE; } if (newCapacity < reqCapacity)... | /**
* Internal implementation to ensure that the internal storage array has
* at least the specified size.
*
* @param reqCapacity the amount to expand to
*/ | Internal implementation to ensure that the internal storage array has at least the specified size | ensureCapacity | {
"repo_name": "fengshao0907/joda-primitives",
"path": "src/main/java/org/joda/primitives/collection/impl/ArrayCharCollection.java",
"license": "apache-2.0",
"size": 13408
} | [
"org.joda.primitives.iterator.CharIterator"
] | import org.joda.primitives.iterator.CharIterator; | import org.joda.primitives.iterator.*; | [
"org.joda.primitives"
] | org.joda.primitives; | 2,383,586 |
public DatabaseResults getRawResults(); | DatabaseResults function(); | /**
* Return the underlying database results object if any. May return null. This should not be used unless you know
* what you are doing.
*/ | Return the underlying database results object if any. May return null. This should not be used unless you know what you are doing | getRawResults | {
"repo_name": "lobo12/ormlite-core",
"path": "src/main/java/com/j256/ormlite/dao/CloseableIterator.java",
"license": "isc",
"size": 2364
} | [
"com.j256.ormlite.support.DatabaseResults"
] | import com.j256.ormlite.support.DatabaseResults; | import com.j256.ormlite.support.*; | [
"com.j256.ormlite"
] | com.j256.ormlite; | 27,531 |
public boolean isCurrency(int column) throws SQLException {
return false;
} | boolean function(int column) throws SQLException { return false; } | /**
* Is the column a cash value?
*
* @param column
* the first column is 1, the second is 2...
*
* @return true if its a cash column
*
* @throws SQLException
* if a database access error occurs
*/ | Is the column a cash value | isCurrency | {
"repo_name": "yyuu/libmysql-java",
"path": "src/com/mysql/jdbc/ResultSetMetaData.java",
"license": "gpl-2.0",
"size": 22734
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,248,548 |
protected void logStartupProfileInfo(ConfigurableApplicationContext context) {
Log log = getApplicationLog();
if (log.isInfoEnabled()) {
String[] activeProfiles = context.getEnvironment().getActiveProfiles();
if (ObjectUtils.isEmpty(activeProfiles)) {
String[] defaultProfiles = context.getEnvironment()... | void function(ConfigurableApplicationContext context) { Log log = getApplicationLog(); if (log.isInfoEnabled()) { String[] activeProfiles = context.getEnvironment().getActiveProfiles(); if (ObjectUtils.isEmpty(activeProfiles)) { String[] defaultProfiles = context.getEnvironment().getDefaultProfiles(); log.info(STR + St... | /**
* Called to log active profile information.
* @param context the application context
*/ | Called to log active profile information | logStartupProfileInfo | {
"repo_name": "bijukunjummen/spring-boot",
"path": "spring-boot/src/main/java/org/springframework/boot/SpringApplication.java",
"license": "apache-2.0",
"size": 44386
} | [
"org.apache.commons.logging.Log",
"org.springframework.context.ConfigurableApplicationContext",
"org.springframework.util.ObjectUtils",
"org.springframework.util.StringUtils"
] | import org.apache.commons.logging.Log; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.util.ObjectUtils; import org.springframework.util.StringUtils; | import org.apache.commons.logging.*; import org.springframework.context.*; import org.springframework.util.*; | [
"org.apache.commons",
"org.springframework.context",
"org.springframework.util"
] | org.apache.commons; org.springframework.context; org.springframework.util; | 1,991,285 |
EReference getProcessType_Property(); | EReference getProcessType_Property(); | /**
* Returns the meta object for the containment reference list '{@link org.eclipse.bpel.apache.ode.deploy.model.dd.ProcessType#getProperty <em>Property</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference list '<em>Property</em>'.
* @see org.eclip... | Returns the meta object for the containment reference list '<code>org.eclipse.bpel.apache.ode.deploy.model.dd.ProcessType#getProperty Property</code>'. | getProcessType_Property | {
"repo_name": "chanakaudaya/developer-studio",
"path": "bps/org.eclipse.bpel.apache.ode.deploy.model/src/org/eclipse/bpel/apache/ode/deploy/model/dd/ddPackage.java",
"license": "apache-2.0",
"size": 55505
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,658,224 |
@JsonProperty("FixedAmount")
private Double fixedAmount;
public EarningsLine earningsRateID(UUID earningsRateID) {
this.earningsRateID = earningsRateID;
return this;
} | @JsonProperty(STR) Double fixedAmount; public EarningsLine function(UUID earningsRateID) { this.earningsRateID = earningsRateID; return this; } | /**
* Xero unique id for earnings rate
*
* @param earningsRateID UUID
* @return EarningsLine
*/ | Xero unique id for earnings rate | earningsRateID | {
"repo_name": "XeroAPI/Xero-Java",
"path": "src/main/java/com/xero/models/payrollau/EarningsLine.java",
"license": "mit",
"size": 11007
} | [
"com.fasterxml.jackson.annotation.JsonProperty"
] | import com.fasterxml.jackson.annotation.JsonProperty; | import com.fasterxml.jackson.annotation.*; | [
"com.fasterxml.jackson"
] | com.fasterxml.jackson; | 2,009,479 |
final public OQLExpression parse() throws ParseException {
OQLExpression root;
root = Expression();
jj_consume_token(0);
{if (true) return root;}
throw new Error("Missing return statement in function");
} | final OQLExpression function() throws ParseException { OQLExpression root; root = Expression(); jj_consume_token(0); {if (true) return root;} throw new Error(STR); } | /**********************************************
* THE OOEE EXPRESSION GRAMMAR STARTS HERE *
**********************************************/ | THE OOEE EXPRESSION GRAMMAR STARTS HERE | parse | {
"repo_name": "shaolinwu/uimaster",
"path": "modules/javacc/src/main/java/org/shaolin/javacc/sql/parser/OQLExprParser.java",
"license": "apache-2.0",
"size": 26464
} | [
"org.shaolin.javacc.sql.node.OQLExpression"
] | import org.shaolin.javacc.sql.node.OQLExpression; | import org.shaolin.javacc.sql.node.*; | [
"org.shaolin.javacc"
] | org.shaolin.javacc; | 155,419 |
public int getCallsCount() {
Cursor c = getReadableDatabase().rawQuery(
"SELECT " + CallsColumns.TIMESTAMP + " FROM " + CALLS_TABLE_NAME, null);
int count = c.getCount();
c.close();
return count;
} | int function() { Cursor c = getReadableDatabase().rawQuery( STR + CallsColumns.TIMESTAMP + STR + CALLS_TABLE_NAME, null); int count = c.getCount(); c.close(); return count; } | /**
* Gets the total number of calls this user has made
*/ | Gets the total number of calls this user has made | getCallsCount | {
"repo_name": "5calls/android",
"path": "5calls/app/src/main/java/org/a5calls/android/a5calls/model/DatabaseHelper.java",
"license": "mit",
"size": 13134
} | [
"android.database.Cursor"
] | import android.database.Cursor; | import android.database.*; | [
"android.database"
] | android.database; | 1,427,050 |
protected Context getBoundContext()
throws NamingException {
if (initialContext) {
String ICName = IC_PREFIX;
if (ContextBindings.isThreadBound()) {
ICName += ContextBindings.getThreadName();
} else if (ContextBindings.isClassLoaderBound()) {
... | Context function() throws NamingException { if (initialContext) { String ICName = IC_PREFIX; if (ContextBindings.isThreadBound()) { ICName += ContextBindings.getThreadName(); } else if (ContextBindings.isClassLoaderBound()) { ICName += ContextBindings.getClassLoaderName(); } Context initialContext = ContextBindings.get... | /**
* Get the bound context.
*/ | Get the bound context | getBoundContext | {
"repo_name": "plumer/codana",
"path": "tomcat_files/6.0.0/SelectorContext.java",
"license": "mit",
"size": 24725
} | [
"javax.naming.Context",
"javax.naming.NamingException"
] | import javax.naming.Context; import javax.naming.NamingException; | import javax.naming.*; | [
"javax.naming"
] | javax.naming; | 2,735,569 |
public IotHubProperties withEventHubEndpoints(Map<String, EventHubProperties> eventHubEndpoints) {
this.eventHubEndpoints = eventHubEndpoints;
return this;
} | IotHubProperties function(Map<String, EventHubProperties> eventHubEndpoints) { this.eventHubEndpoints = eventHubEndpoints; return this; } | /**
* Set the Event Hub-compatible endpoint properties. The only possible keys to this dictionary is events. This key has to be present in the dictionary while making create or update calls for the IoT hub.
*
* @param eventHubEndpoints the eventHubEndpoints value to set
* @return the IotHubPropertie... | Set the Event Hub-compatible endpoint properties. The only possible keys to this dictionary is events. This key has to be present in the dictionary while making create or update calls for the IoT hub | withEventHubEndpoints | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/iothub/mgmt-v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubProperties.java",
"license": "mit",
"size": 12077
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 404,066 |
@Override
public Collection<V> values() {
synchronized (theList) {
return new ArrayList<V>(theList.values());
}
} | Collection<V> function() { synchronized (theList) { return new ArrayList<V>(theList.values()); } } | /**
* Get the values as Collection.
*/ | Get the values as Collection | values | {
"repo_name": "breandan/java-algebra-system",
"path": "mpi/src/edu/jas/util/DistHashTableMPI.java",
"license": "gpl-2.0",
"size": 15471
} | [
"java.util.ArrayList",
"java.util.Collection"
] | import java.util.ArrayList; import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 1,973,416 |
public Path startLocalOutput(Path fsOutputFile, Path tmpLocalFile)
throws IOException {
return tmpLocalFile;
} | Path function(Path fsOutputFile, Path tmpLocalFile) throws IOException { return tmpLocalFile; } | /**
* Returns a local File that the user can write output to. The caller
* provides both the eventual FS target name and the local working
* file. If the FS is local, we write directly into the target. If
* the FS is remote, we write into the tmp local area.
*/ | Returns a local File that the user can write output to. The caller provides both the eventual FS target name and the local working file. If the FS is local, we write directly into the target. If the FS is remote, we write into the tmp local area | startLocalOutput | {
"repo_name": "jayantgolhar/Hadoop-0.21.0",
"path": "common/src/java/org/apache/hadoop/fs/FileSystem.java",
"license": "apache-2.0",
"size": 67991
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,647,117 |
void setCursorPosition(TextPosition position); | void setCursorPosition(TextPosition position); | /**
* Changes the cursor position.
*
* @param position
* the new position
*/ | Changes the cursor position | setCursorPosition | {
"repo_name": "Ori-Libhaber/che-core",
"path": "ide/che-core-ide-jseditor/src/main/java/org/eclipse/che/ide/jseditor/client/document/Document.java",
"license": "epl-1.0",
"size": 3322
} | [
"org.eclipse.che.ide.jseditor.client.text.TextPosition"
] | import org.eclipse.che.ide.jseditor.client.text.TextPosition; | import org.eclipse.che.ide.jseditor.client.text.*; | [
"org.eclipse.che"
] | org.eclipse.che; | 1,378,279 |
static boolean isAclTable(HTableDescriptor desc) {
return ACL_TABLE_NAME.equals(desc.getTableName());
}
/**
* Loads all of the permission grants stored in a region of the {@code _acl_} | static boolean isAclTable(HTableDescriptor desc) { return ACL_TABLE_NAME.equals(desc.getTableName()); } /** * Loads all of the permission grants stored in a region of the {@code _acl_} | /**
* Returns {@code true} if the given table is {@code _acl_} metadata table.
*/ | Returns true if the given table is _acl_ metadata table | isAclTable | {
"repo_name": "throughsky/lywebank",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlLists.java",
"license": "apache-2.0",
"size": 25182
} | [
"org.apache.hadoop.hbase.HTableDescriptor"
] | import org.apache.hadoop.hbase.HTableDescriptor; | import org.apache.hadoop.hbase.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 2,005,133 |
public void testDescendingKeySetToArray() {
ConcurrentNavigableMap map = map5();
Set s = map.descendingKeySet();
Object[] ar = s.toArray();
assertEquals(5, ar.length);
assertTrue(s.containsAll(Arrays.asList(ar)));
ar[0] = m10;
assertFalse(s.containsAll(Arrays.... | void function() { ConcurrentNavigableMap map = map5(); Set s = map.descendingKeySet(); Object[] ar = s.toArray(); assertEquals(5, ar.length); assertTrue(s.containsAll(Arrays.asList(ar))); ar[0] = m10; assertFalse(s.containsAll(Arrays.asList(ar))); } | /**
* descendingkeySet.toArray returns contains all keys
*/ | descendingkeySet.toArray returns contains all keys | testDescendingKeySetToArray | {
"repo_name": "AdmireTheDistance/android_libcore",
"path": "jsr166-tests/src/test/java/jsr166/ConcurrentSkipListSubMapTest.java",
"license": "gpl-2.0",
"size": 42185
} | [
"java.util.Arrays",
"java.util.Set",
"java.util.concurrent.ConcurrentNavigableMap"
] | import java.util.Arrays; import java.util.Set; import java.util.concurrent.ConcurrentNavigableMap; | import java.util.*; import java.util.concurrent.*; | [
"java.util"
] | java.util; | 2,605,762 |
@Override
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="user_id")
public UserMining getUser() {
return this.user;
} | @ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name=STR) UserMining function() { return this.user; } | /**
* standard getter for the attribute user
*
* @return the user who interact with the resource
*/ | standard getter for the attribute user | getUser | {
"repo_name": "LemoProject/lemo2",
"path": "src/main/java/de/lemo/dms/db/mapping/WikiLogMining.java",
"license": "gpl-3.0",
"size": 8230
} | [
"javax.persistence.FetchType",
"javax.persistence.JoinColumn",
"javax.persistence.ManyToOne"
] | import javax.persistence.FetchType; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; | import javax.persistence.*; | [
"javax.persistence"
] | javax.persistence; | 430,613 |
@Path("{id}")
@DELETE
@NoCache
public Response deleteUser(final @PathParam("id") String id) {
auth.requireManage();
UserModel user = session.users().getUserById(id, realm);
if (user == null) {
throw new NotFoundException("User not found");
}
... | @Path("{id}") Response function(final @PathParam("id") String id) { auth.requireManage(); UserModel user = session.users().getUserById(id, realm); if (user == null) { throw new NotFoundException(STR); } boolean removed = new UserManager(session).removeUser(realm, user); if (removed) { adminEvent.operation(OperationType... | /**
* delete this user
*
* @param id user id
*/ | delete this user | deleteUser | {
"repo_name": "cmoulliard/keycloak",
"path": "services/src/main/java/org/keycloak/services/resources/admin/UsersResource.java",
"license": "apache-2.0",
"size": 38079
} | [
"javax.ws.rs.Path",
"javax.ws.rs.PathParam",
"javax.ws.rs.core.Response",
"org.jboss.resteasy.spi.NotFoundException",
"org.keycloak.events.admin.OperationType",
"org.keycloak.models.UserModel",
"org.keycloak.services.ErrorResponse",
"org.keycloak.services.managers.UserManager"
] | import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.core.Response; import org.jboss.resteasy.spi.NotFoundException; import org.keycloak.events.admin.OperationType; import org.keycloak.models.UserModel; import org.keycloak.services.ErrorResponse; import org.keycloak.services.managers.UserManager; | import javax.ws.rs.*; import javax.ws.rs.core.*; import org.jboss.resteasy.spi.*; import org.keycloak.events.admin.*; import org.keycloak.models.*; import org.keycloak.services.*; import org.keycloak.services.managers.*; | [
"javax.ws",
"org.jboss.resteasy",
"org.keycloak.events",
"org.keycloak.models",
"org.keycloak.services"
] | javax.ws; org.jboss.resteasy; org.keycloak.events; org.keycloak.models; org.keycloak.services; | 2,307,701 |
//---------------------------------------------------------------------------------
private static String encode(String password) throws Exception {
if (key == null)
throw new IllegalStateException("invalid key");
try {
Cipher cipher = Cipher.getInstance("DESede/CBC/PKCS5Padding");
cipher.init(Cipher.E... | static String function(String password) throws Exception { if (key == null) throw new IllegalStateException(STR); try { Cipher cipher = Cipher.getInstance(STR); cipher.init(Cipher.ENCRYPT_MODE,key,IvParameters); byte[] encoded = cipher.doFinal(password.getBytes("UTF-8")); return Base64.encode(encoded); } catch (Invalid... | /** Encodes <code>password</code> and returns the encoded version.
* @throws Exception if any problem occurs
*/ | Encodes <code>password</code> and returns the encoded version | encode | {
"repo_name": "lgulyas/MEME",
"path": "src/ai/aitia/meme/paramsweep/gui/MonitorConfigurationDialog.java",
"license": "gpl-3.0",
"size": 30561
} | [
"com.sun.org.apache.xerces.internal.impl.dv.util.Base64",
"java.security.InvalidKeyException",
"java.security.NoSuchAlgorithmException",
"javax.crypto.Cipher"
] | import com.sun.org.apache.xerces.internal.impl.dv.util.Base64; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import javax.crypto.Cipher; | import com.sun.org.apache.xerces.internal.impl.dv.util.*; import java.security.*; import javax.crypto.*; | [
"com.sun.org",
"java.security",
"javax.crypto"
] | com.sun.org; java.security; javax.crypto; | 428,358 |
public static void exportAsZip(Context context, ItemIterator items,
String destDirName, String zipFileName,
int seqStart, boolean migrate) throws Exception
{
String workDir = getExportWorkDirectory() +
System.... | static void function(Context context, ItemIterator items, String destDirName, String zipFileName, int seqStart, boolean migrate) throws Exception { String workDir = getExportWorkDirectory() + System.getProperty(STR) + zipFileName; File wkDir = new File(workDir); if (!wkDir.exists() && !wkDir.mkdirs()) { log.error(STR);... | /**
* Method to perform an export and save it as a zip file.
*
* @param context The DSpace Context
* @param items The items to export
* @param destDirName The directory to save the export in
* @param zipFileName The name to save the zip file as
* @param seqStart The first number in th... | Method to perform an export and save it as a zip file | exportAsZip | {
"repo_name": "mdiggory/dryad-repo",
"path": "dspace-api/src/main/java/org/dspace/app/itemexport/ItemExport.java",
"license": "bsd-3-clause",
"size": 51938
} | [
"java.io.File",
"org.dspace.content.ItemIterator",
"org.dspace.core.Context"
] | import java.io.File; import org.dspace.content.ItemIterator; import org.dspace.core.Context; | import java.io.*; import org.dspace.content.*; import org.dspace.core.*; | [
"java.io",
"org.dspace.content",
"org.dspace.core"
] | java.io; org.dspace.content; org.dspace.core; | 1,206,180 |
private void repopulateFromDisk() {
try {
synchronized (mLinkedHashMap) {
for (File file : mCacheDir.listFiles(cacheFileFilter)) {
final String path = mCacheDir.getPath() + File.separator
+ file.getName();
final String encoded = file.getName().substring(
... | void function() { try { synchronized (mLinkedHashMap) { for (File file : mCacheDir.listFiles(cacheFileFilter)) { final String path = mCacheDir.getPath() + File.separator + file.getName(); final String encoded = file.getName().substring( CACHE_FILENAME_PREFIX.length()); try { final String key = URLDecoder.decode(encoded... | /**
* Puts entries in the map of URL -> file path based off of what is on disk.
*/ | Puts entries in the map of URL -> file path based off of what is on disk | repopulateFromDisk | {
"repo_name": "Macarse/50AH-code",
"path": "hack040/src/com/manning/androidhacks/hack040/util/DiskLruCache.java",
"license": "mit",
"size": 12058
} | [
"android.util.Log",
"java.io.File",
"java.io.UnsupportedEncodingException",
"java.net.URLDecoder"
] | import android.util.Log; import java.io.File; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; | import android.util.*; import java.io.*; import java.net.*; | [
"android.util",
"java.io",
"java.net"
] | android.util; java.io; java.net; | 2,319,966 |
@WaitUntil(TimeoutPolicy.RETURN_FALSE)
public boolean isNotVisibleOnPage(String place) {
return isNotVisibleOnPageIn(place, null);
} | @WaitUntil(TimeoutPolicy.RETURN_FALSE) boolean function(String place) { return isNotVisibleOnPageIn(place, null); } | /**
* Determines whether element is not on the page (or disappears within the specified timeout)
* @param place element to check.
* @return true if element is not on the page (anymore).
*/ | Determines whether element is not on the page (or disappears within the specified timeout) | isNotVisibleOnPage | {
"repo_name": "GDasai/hsac-fitnesse-fixtures",
"path": "src/main/java/nl/hsac/fitnesse/fixture/slim/web/BrowserTest.java",
"license": "apache-2.0",
"size": 86267
} | [
"nl.hsac.fitnesse.fixture.slim.web.annotation.TimeoutPolicy",
"nl.hsac.fitnesse.fixture.slim.web.annotation.WaitUntil"
] | import nl.hsac.fitnesse.fixture.slim.web.annotation.TimeoutPolicy; import nl.hsac.fitnesse.fixture.slim.web.annotation.WaitUntil; | import nl.hsac.fitnesse.fixture.slim.web.annotation.*; | [
"nl.hsac.fitnesse"
] | nl.hsac.fitnesse; | 814,613 |
public final List<String> getLinkopts() {
return this.linkopts;
} | final List<String> function() { return this.linkopts; } | /**
* Returns command line options for this link action.
*/ | Returns command line options for this link action | getLinkopts | {
"repo_name": "LuminateWireless/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java",
"license": "apache-2.0",
"size": 67732
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 58,201 |
public void ConfigDelete(String name) throws java.rmi.RemoteException; | void function(String name) throws java.rmi.RemoteException; | /**
* Web service operation
*/ | Web service operation | ConfigDelete | {
"repo_name": "ethanpeng/openacs",
"path": "acs-ejb/src/java/org/openacs/ws/OpenACSSEI.java",
"license": "gpl-3.0",
"size": 1790
} | [
"java.rmi.RemoteException"
] | import java.rmi.RemoteException; | import java.rmi.*; | [
"java.rmi"
] | java.rmi; | 2,579,930 |
public JobScheduleUpdateOptions withIfUnmodifiedSince(DateTime ifUnmodifiedSince) {
if (ifUnmodifiedSince == null) {
this.ifUnmodifiedSince = null;
} else {
this.ifUnmodifiedSince = new DateTimeRfc1123(ifUnmodifiedSince);
}
return this;
} | JobScheduleUpdateOptions function(DateTime ifUnmodifiedSince) { if (ifUnmodifiedSince == null) { this.ifUnmodifiedSince = null; } else { this.ifUnmodifiedSince = new DateTimeRfc1123(ifUnmodifiedSince); } return this; } | /**
* Set a timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time.
*
* @param ifUnmodifiedSince the ifUnmodifiedSince value to set
* @return the JobScheduleUp... | Set a timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time | withIfUnmodifiedSince | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/batch/microsoft-azure-batch/src/main/java/com/microsoft/azure/batch/protocol/models/JobScheduleUpdateOptions.java",
"license": "mit",
"size": 9514
} | [
"com.microsoft.rest.DateTimeRfc1123",
"org.joda.time.DateTime"
] | import com.microsoft.rest.DateTimeRfc1123; import org.joda.time.DateTime; | import com.microsoft.rest.*; import org.joda.time.*; | [
"com.microsoft.rest",
"org.joda.time"
] | com.microsoft.rest; org.joda.time; | 1,147,034 |
@Test
public void testEnable() {
assertNotNull(dialog.enable());
assertEquals(dialog.enable().render().toString(),
"$('#anId').dialog('enable');");
} | void function() { assertNotNull(dialog.enable()); assertEquals(dialog.enable().render().toString(), STR); } | /**
* Test method for {@link org.odlabs.wiquery.ui.dialog.Dialog#enable()}.
*/ | Test method for <code>org.odlabs.wiquery.ui.dialog.Dialog#enable()</code> | testEnable | {
"repo_name": "openengsb-attic/forks-org.odlabs.wiquery",
"path": "src/test/java/org/odlabs/wiquery/ui/dialog/DialogTestCase.java",
"license": "mit",
"size": 15104
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 956,782 |
public static int sizeUsingGoogleGuava(final Iterable data) {
return Iterables.size(data);
} | static int function(final Iterable data) { return Iterables.size(data); } | /**
* Get the size of {@code Iterable} using Google Guava.
*
* @param data the iterable
* @return the size of the iterable
*/ | Get the size of Iterable using Google Guava | sizeUsingGoogleGuava | {
"repo_name": "Niky4000/UsefulUtils",
"path": "projects/tutorials-master/tutorials-master/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/iterable/IterableSize.java",
"license": "gpl-3.0",
"size": 1593
} | [
"com.google.common.collect.Iterables"
] | import com.google.common.collect.Iterables; | import com.google.common.collect.*; | [
"com.google.common"
] | com.google.common; | 793,886 |
@Test
public void testSimpleCoLocatedSlotScheduling() throws ExecutionException, InterruptedException {
final BlockingQueue<AllocationID> allocationIds = new ArrayBlockingQueue<>(2);
final TestingResourceManagerGateway testingResourceManagerGateway = slotPoolResource.getTestingResourceManagerGateway();
test... | void function() throws ExecutionException, InterruptedException { final BlockingQueue<AllocationID> allocationIds = new ArrayBlockingQueue<>(2); final TestingResourceManagerGateway testingResourceManagerGateway = slotPoolResource.getTestingResourceManagerGateway(); testingResourceManagerGateway.setRequestSlotConsumer( ... | /**
* Tests the scheduling of two tasks with a parallelism of 2 and a co-location constraint.
*/ | Tests the scheduling of two tasks with a parallelism of 2 and a co-location constraint | testSimpleCoLocatedSlotScheduling | {
"repo_name": "ueshin/apache-flink",
"path": "flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/slotpool/SlotPoolCoLocationTest.java",
"license": "apache-2.0",
"size": 6295
} | [
"java.util.Collection",
"java.util.Collections",
"java.util.concurrent.ArrayBlockingQueue",
"java.util.concurrent.BlockingQueue",
"java.util.concurrent.CompletableFuture",
"java.util.concurrent.ExecutionException",
"org.apache.flink.runtime.clusterframework.types.AllocationID",
"org.apache.flink.runti... | import java.util.Collection; import java.util.Collections; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import org.apache.flink.runtime.clusterframework.types.AllocationID; import... | import java.util.*; import java.util.concurrent.*; import org.apache.flink.runtime.*; import org.apache.flink.runtime.clusterframework.types.*; import org.apache.flink.runtime.executiongraph.utils.*; import org.apache.flink.runtime.instance.*; import org.apache.flink.runtime.jobgraph.*; import org.apache.flink.runtime.... | [
"java.util",
"org.apache.flink",
"org.junit"
] | java.util; org.apache.flink; org.junit; | 1,197,020 |
@Test
public void equalNullValueEquals()
{
NumberProperty nullValueProperty1 = new IntegerProperty();
nullValueProperty1.setValue(null);
Assert.assertNull(nullValueProperty1.getValue());
NumberProperty nullValueProperty2 = new IntegerProperty();
nullValueProperty2.se... | void function() { NumberProperty nullValueProperty1 = new IntegerProperty(); nullValueProperty1.setValue(null); Assert.assertNull(nullValueProperty1.getValue()); NumberProperty nullValueProperty2 = new IntegerProperty(); nullValueProperty2.setValue(null); Assert.assertNull(nullValueProperty2.getValue()); Assert.assertT... | /**
* Verify that we can compare two null valued number properties without having a NPE (<a
* href="https://jira.xwiki.org/browse/XWIKI-9326">XWIKI-9326</a>).
*/ | Verify that we can compare two null valued number properties without having a NPE (XWIKI-9326) | equalNullValueEquals | {
"repo_name": "pbondoer/xwiki-platform",
"path": "xwiki-platform-core/xwiki-platform-oldcore/src/test/java/com/xpn/xwiki/objects/NumberPropertyTest.java",
"license": "lgpl-2.1",
"size": 4615
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 81,375 |
public void fireStateChanged()
{
RenderEvent e = new RenderEvent(this, RenderEvent.TRANSPARENCY);
for (int i = 0; i < renderEventListenerList.size(); i++)
renderEventListenerList.get(i).renderExtentChanged(e);
} | void function() { RenderEvent e = new RenderEvent(this, RenderEvent.TRANSPARENCY); for (int i = 0; i < renderEventListenerList.size(); i++) renderEventListenerList.get(i).renderExtentChanged(e); } | /**
* Notifies all registered listeners about the event.
*
* @param object Parameter #1 of the <CODE>ChangeEvent<CODE> constructor.
*/ | Notifies all registered listeners about the event | fireStateChanged | {
"repo_name": "IcmVis/VisNow-Pro",
"path": "src/pl/edu/icm/visnow/geometries/parameters/TransparencyParams.java",
"license": "gpl-3.0",
"size": 5237
} | [
"pl.edu.icm.visnow.geometries.viewer3d.eventslisteners.render.RenderEvent"
] | import pl.edu.icm.visnow.geometries.viewer3d.eventslisteners.render.RenderEvent; | import pl.edu.icm.visnow.geometries.viewer3d.eventslisteners.render.*; | [
"pl.edu.icm"
] | pl.edu.icm; | 206,463 |
public final HoopMultiSplitNode lastWeightedChild()
{
List<HoopMultiSplitNode> children = getChildren();
HoopMultiSplitNode weightedChild = null;
for(HoopMultiSplitNode child : children) {
if (child.getWeight() > 0.0) {
weightedChild = child;
}
}
return weightedChild;
} | final HoopMultiSplitNode function() { List<HoopMultiSplitNode> children = getChildren(); HoopMultiSplitNode weightedChild = null; for(HoopMultiSplitNode child : children) { if (child.getWeight() > 0.0) { weightedChild = child; } } return weightedChild; } | /**
* Convenience method that returns the last child whose weight
* is > 0.0.
*
* @return the last child whose weight is > 0.0.
* @see #getChildren
* @see MultiSplitNode#getWeight
*/ | Convenience method that returns the last child whose weight is > 0.0 | lastWeightedChild | {
"repo_name": "Mindtoeye/Hoop",
"path": "src/edu/cmu/cs/in/controls/splitpanel/HoopMultiSplitSplitter.java",
"license": "lgpl-3.0",
"size": 4417
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 416,892 |
public Diagnostic analyzeResourceProblems(Resource resource, Exception exception)
{
if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty())
{
BasicDiagnostic basicDiagnostic =
new BasicDiagnostic
(Diagnostic.ERROR,
"org.eclipse.emf.examples.library.edito... | Diagnostic function(Resource resource, Exception exception) { if (!resource.getErrors().isEmpty() !resource.getWarnings().isEmpty()) { BasicDiagnostic basicDiagnostic = new BasicDiagnostic (Diagnostic.ERROR, STR, 0, getString(STR, resource.getURI()), new Object [] { exception == null ? (Object)resource : exception }); ... | /**
* Returns a diagnostic describing the errors and warnings listed in the resource
* and the specified exception (if any).
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | Returns a diagnostic describing the errors and warnings listed in the resource and the specified exception (if any). | analyzeResourceProblems | {
"repo_name": "ohaegi/emfshell",
"path": "tests/org.eclipse.emf.examples.library.editor/src/org/eclipse/emf/examples/extlibrary/presentation/EXTLibraryEditor.java",
"license": "epl-1.0",
"size": 60131
} | [
"org.eclipse.emf.common.util.BasicDiagnostic",
"org.eclipse.emf.common.util.Diagnostic",
"org.eclipse.emf.ecore.resource.Resource",
"org.eclipse.emf.ecore.util.EcoreUtil"
] | import org.eclipse.emf.common.util.BasicDiagnostic; import org.eclipse.emf.common.util.Diagnostic; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.ecore.util.EcoreUtil; | import org.eclipse.emf.common.util.*; import org.eclipse.emf.ecore.resource.*; import org.eclipse.emf.ecore.util.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,978,247 |
public void registerResultHandler(int code, TiActivityResultHandler resultHandler) {
if (resultHandler == null) {
Log.w(TAG, "Received a null result handler");
}
resultHandlers.put(code, resultHandler);
} | void function(int code, TiActivityResultHandler resultHandler) { if (resultHandler == null) { Log.w(TAG, STR); } resultHandlers.put(code, resultHandler); } | /**
* Registers the resultHandler into a HashMap<Integer, TiActivityResultHandler>
* @param code resultHandler's id.
* @param resultHandler the resultHandler.
*/ | Registers the resultHandler into a HashMap | registerResultHandler | {
"repo_name": "perdona/titanium_mobile",
"path": "android/titanium/src/java/org/appcelerator/titanium/util/TiActivitySupportHelper.java",
"license": "apache-2.0",
"size": 4760
} | [
"org.appcelerator.kroll.common.Log"
] | import org.appcelerator.kroll.common.Log; | import org.appcelerator.kroll.common.*; | [
"org.appcelerator.kroll"
] | org.appcelerator.kroll; | 1,357,769 |
public void setMaxRows(int max) throws SQLException {
synchronized (checkClosed()) {
if ((max > MysqlDefs.MAX_ROWS) || (max < 0)) {
throw SQLError
.createSQLException(
Messages.getString("Statement.15") + max //$NON-NLS-1$
+ " > " //$NON-NLS-1$ //$NON-NLS-2$
+ MysqlDefs.MAX... | void function(int max) throws SQLException { synchronized (checkClosed()) { if ((max > MysqlDefs.MAX_ROWS) (max < 0)) { throw SQLError .createSQLException( Messages.getString(STR) + max + STR + MysqlDefs.MAX_ROWS + ".", SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); } if (max == 0) { max = -1; } this.... | /**
* Set the maximum number of rows
*
* @param max
* the new max rows limit; zero means unlimited
*
* @exception SQLException
* if a database access error occurs
*
* @see getMaxRows
*/ | Set the maximum number of rows | setMaxRows | {
"repo_name": "vaisaghvt/gameAnalyzer",
"path": "mysql-connector-java-5.1.22/src/com/mysql/jdbc/StatementImpl.java",
"license": "mit",
"size": 86957
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 911,997 |
@Override
public void importThis(String fName, final java.io.InputStream is, final MWC.GUI.Layers theData)
{
final MWCXMLReader handler = new LayersHandler(theData);
// import the datafile into this set of layers
doImport(new InputSource(is), handler);
//
theData.fireModified(null);
}
| void function(String fName, final java.io.InputStream is, final MWC.GUI.Layers theData) { final MWCXMLReader handler = new LayersHandler(theData); doImport(new InputSource(is), handler); theData.fireModified(null); } | /**
* handle the import of XML data into an existing session
*/ | handle the import of XML data into an existing session | importThis | {
"repo_name": "theanuradha/debrief",
"path": "org.mwc.asset.legacy/src/ASSET/Util/XML/ASSETReaderWriter.java",
"license": "epl-1.0",
"size": 15975
} | [
"org.xml.sax.InputSource"
] | import org.xml.sax.InputSource; | import org.xml.sax.*; | [
"org.xml.sax"
] | org.xml.sax; | 347,634 |
public String[] readNext() throws IOException {
String nextLine = getNextLine();
return hasNext ? parseLine(nextLine) : null;
} | String[] function() throws IOException { String nextLine = getNextLine(); return hasNext ? parseLine(nextLine) : null; } | /**
* Reads the next line from the buffer and converts to a string array.
*
* @return a string array with each comma-separated element as a separate
* entry.
*
* @throws IOException
* if bad things happen during the read
*/ | Reads the next line from the buffer and converts to a string array | readNext | {
"repo_name": "Hitchwiki/MyHitchhikingSpots-for-Android",
"path": "app/src/main/java/com/myhitchhikingspots/utilities/CSVReader.java",
"license": "mit",
"size": 6231
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,694,854 |
@ServiceMethod(returns = ReturnType.SINGLE)
public PolicySetDefinitionInner createOrUpdate(
String policySetDefinitionName, PolicySetDefinitionInner parameters) {
return createOrUpdateAsync(policySetDefinitionName, parameters).block();
} | @ServiceMethod(returns = ReturnType.SINGLE) PolicySetDefinitionInner function( String policySetDefinitionName, PolicySetDefinitionInner parameters) { return createOrUpdateAsync(policySetDefinitionName, parameters).block(); } | /**
* This operation creates or updates a policy set definition in the given subscription with the given name.
*
* @param policySetDefinitionName The name of the policy set definition to create.
* @param parameters The policy set definition properties.
* @throws IllegalArgumentException thrown ... | This operation creates or updates a policy set definition in the given subscription with the given name | createOrUpdate | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicySetDefinitionsClientImpl.java",
"license": "mit",
"size": 122213
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.resourcemanager.resources.fluent.models.PolicySetDefinitionInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.resources.fluent.models.PolicySetDefinitionInner; | import com.azure.core.annotation.*; import com.azure.resourcemanager.resources.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 1,686,208 |
private synchronized void dispatchChunk() {
if (cancelled) {
return;
}
try {
// Pop off the next chunk and send it to the client.
Chunk chunk = chunks.remove();
if (chunk == completionChunk) {
responseStream.onCompleted();
} else {
respon... | synchronized void function() { if (cancelled) { return; } try { Chunk chunk = chunks.remove(); if (chunk == completionChunk) { responseStream.onCompleted(); } else { responseStream.onNext(chunk.toResponse()); } } catch (Throwable e) { failure = e; if (Status.fromThrowable(e).getCode() == Status.CANCELLED.getCode()) { c... | /**
* Dispatches the current response chunk to the client. This is only called by the executor. At
* any time, a given dispatch task should only be registered with the executor once.
*/ | Dispatches the current response chunk to the client. This is only called by the executor. At any time, a given dispatch task should only be registered with the executor once | dispatchChunk | {
"repo_name": "elandau/grpc-java",
"path": "interop-testing/src/main/java/io/grpc/testing/integration/TestServiceImpl.java",
"license": "apache-2.0",
"size": 21088
} | [
"io.grpc.Status"
] | import io.grpc.Status; | import io.grpc.*; | [
"io.grpc"
] | io.grpc; | 2,613,285 |
super.initialize(cordova, webView);
ga = GoogleAnalytics.getInstance(cordova.getActivity());
} | super.initialize(cordova, webView); ga = GoogleAnalytics.getInstance(cordova.getActivity()); } | /**
* Initializes the plugin
*
* @param cordova The context of the main Activity.
* @param webView The associated CordovaWebView.
*/ | Initializes the plugin | initialize | {
"repo_name": "mib200/google-analytics-plugin",
"path": "android/GoogleAnalyticsPlugin.java",
"license": "mit",
"size": 6662
} | [
"com.google.android.gms.analytics.GoogleAnalytics"
] | import com.google.android.gms.analytics.GoogleAnalytics; | import com.google.android.gms.analytics.*; | [
"com.google.android"
] | com.google.android; | 815,857 |
@Override
public void initialize(URL url, ResourceBundle rb) {
// TODO
} | void function(URL url, ResourceBundle rb) { } | /**
* Initializes the controller class.
*/ | Initializes the controller class | initialize | {
"repo_name": "LucasReSilva/DS2-OpenCarShop",
"path": "Tentativa/src/opencarshop/controller/SistemaController.java",
"license": "apache-2.0",
"size": 4056
} | [
"java.util.ResourceBundle"
] | import java.util.ResourceBundle; | import java.util.*; | [
"java.util"
] | java.util; | 864,713 |
public Cursor getAllUniqueArtistsNoBlacklist(String selection) {
String selectDistinctQuery = "SELECT DISTINCT(" + SONG_ARTIST + "), " +
_ID + ", " + SONG_FILE_PATH + ", " + ARTIST_ART_LOCATION + ", " + BLACKLIST_STATUS + ", "
+ SONG_SOURCE + ", " + SONG_ALBUM_ART_PATH + " FROM " + M... | Cursor function(String selection) { String selectDistinctQuery = STR + SONG_ARTIST + STR + _ID + STR + SONG_FILE_PATH + STR + ARTIST_ART_LOCATION + STR + BLACKLIST_STATUS + STR + SONG_SOURCE + STR + SONG_ALBUM_ART_PATH + STR + MUSIC_LIBRARY_TABLE + STR + SONG_ARTIST + STR + SONG_ARTIST + STR; return getDatabase().rawQu... | /**
* Returns a cursor with unique artists within the database, regardless of the blacklist status.
*/ | Returns a cursor with unique artists within the database, regardless of the blacklist status | getAllUniqueArtistsNoBlacklist | {
"repo_name": "yongjiliu/MusicPlayer",
"path": "ACEMusicPlayer/src/main/java/com/aniruddhc/acemusic/player/DBHelpers/DBAccessHelper.java",
"license": "gpl-2.0",
"size": 72380
} | [
"android.database.Cursor"
] | import android.database.Cursor; | import android.database.*; | [
"android.database"
] | android.database; | 1,181,025 |
protected void onPtrRestoreInstanceState(Bundle savedInstanceState) {
} | void function(Bundle savedInstanceState) { } | /**
* Called by {@link #onRestoreInstanceState(Parcelable)} so that derivative
* classes can handle their saved instance state.
*
* @param savedInstanceState
* - Bundle which contains saved instance state.
*/ | Called by <code>#onRestoreInstanceState(Parcelable)</code> so that derivative classes can handle their saved instance state | onPtrRestoreInstanceState | {
"repo_name": "liufeiit/itmarry",
"path": "source/MyYaHoo/src/com/way/pulltorefresh/PullToRefreshBase.java",
"license": "mit",
"size": 45952
} | [
"android.os.Bundle"
] | import android.os.Bundle; | import android.os.*; | [
"android.os"
] | android.os; | 2,193,542 |
private void parseIndexSpec(JSONObject indexSpec) {
StringBuilder request = new StringBuilder();
String type = indexSpec.getString(TYPE);
JSONArray keys = indexSpec.getJSONArray(KEYS);
List<String> propertyNames = new ArrayList<String>();
String propertyDecl... | void function(JSONObject indexSpec) { StringBuilder request = new StringBuilder(); String type = indexSpec.getString(TYPE); JSONArray keys = indexSpec.getJSONArray(KEYS); List<String> propertyNames = new ArrayList<String>(); String propertyDeclarations = buildPropertyDeclarations(keys, propertyNames); request.append(pr... | /**
* Parses a single index specification, declaring it, and any properties it
* uses, to DB.
*/ | Parses a single index specification, declaring it, and any properties it uses, to DB | parseIndexSpec | {
"repo_name": "stucco/graph-db-connection",
"path": "src/main/java/gov/pnnl/stucco/dbconnect/orientdb/IndexDefinitionsToOrientDB.java",
"license": "mit",
"size": 14102
} | [
"java.util.ArrayList",
"java.util.List",
"org.json.JSONArray",
"org.json.JSONObject"
] | import java.util.ArrayList; import java.util.List; import org.json.JSONArray; import org.json.JSONObject; | import java.util.*; import org.json.*; | [
"java.util",
"org.json"
] | java.util; org.json; | 2,223,129 |
public Paint getPaint() {
return this.paint;
} | Paint function() { return this.paint; } | /**
* Returns the current <code>Paint</code> of the <code>Graphics2D</code>
* context.
*
* @return the current <code>Graphics2D</code> <code>Paint</code>, which
* defines a color or pattern.
* @see #setPaint
* @see java.awt.Graphics#setColor
*/ | Returns the current <code>Paint</code> of the <code>Graphics2D</code> context | getPaint | {
"repo_name": "Guronzan/Apache-XmlGraphics",
"path": "src/main/java/org/apache/xmlgraphics/java2d/GraphicContext.java",
"license": "apache-2.0",
"size": 35705
} | [
"java.awt.Paint"
] | import java.awt.Paint; | import java.awt.*; | [
"java.awt"
] | java.awt; | 2,067,007 |
public static List<Fight> mergeEqualFights(List<Fight> fights, String prefix) {
List<List<Fight>> fightGrouping = new ArrayList<List<Fight>>();
List<Fight> fightsCopy = new ArrayList<Fight>(fights);
//Find mobs with equal names and group them up.
while (true) {
... | static List<Fight> function(List<Fight> fights, String prefix) { List<List<Fight>> fightGrouping = new ArrayList<List<Fight>>(); List<Fight> fightsCopy = new ArrayList<Fight>(fights); while (true) { outerFor: for (int k = 0; k < fightsCopy.size(); k++) { Fight f = fightsCopy.get(k); boolean found = false; for (List<Fig... | /**
* Merge all fights that have the same name.
* @param fights The fights
* @param prefix A prefix to put in front of the fight name after merging.
* @return A list with the merged fights.
*/ | Merge all fights that have the same name | mergeEqualFights | {
"repo_name": "setjmp2013/WowLogParser",
"path": "src/wowlogparserbase/Fight.java",
"license": "gpl-2.0",
"size": 45864
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,429,774 |
private void printRunningTotal (PrintData pd, int levelNo, int rowNo)
{
if (m_runningTotalLines < 1) // -1 = none
return;
log.fine("(" + m_runningTotalLines + ") - Row=" + rowNo
+ ", mod=" + rowNo % m_runningTotalLines);
if (rowNo % m_runningTotalLines != 0)
return;
log.fine("Row=" + ... | void function (PrintData pd, int levelNo, int rowNo) { if (m_runningTotalLines < 1) return; log.fine("(" + m_runningTotalLines + STR + rowNo + STR + rowNo % m_runningTotalLines); if (rowNo % m_runningTotalLines != 0) return; log.fine("Row=" + rowNo); PrintDataColumn pdc = null; int start = 0; if (rowNo == 0) start = 1;... | /**
* Print Running Total
* @param pd Print Data to add lines to
* @param levelNo level no
* @param rowNo row no
*/ | Print Running Total | printRunningTotal | {
"repo_name": "armenrz/adempiere",
"path": "base/src/org/compiere/print/DataEngine.java",
"license": "gpl-2.0",
"size": 41400
} | [
"org.compiere.util.DisplayType"
] | import org.compiere.util.DisplayType; | import org.compiere.util.*; | [
"org.compiere.util"
] | org.compiere.util; | 1,041,570 |
public void parseContents(Parser parser) {
final SymbolTable stable = parser.getSymbolTable();
// Add the implicit mapping of 'xml' to the XML namespace URI
addPrefixMapping("xml", "http://www.w3.org/XML/1998/namespace");
// Report and error if more than one stylesheet def... | void function(Parser parser) { final SymbolTable stable = parser.getSymbolTable(); addPrefixMapping("xml", "http: final Stylesheet sheet = stable.addStylesheet(_name, this); if (sheet != null) { ErrorMsg err = new ErrorMsg(ErrorMsg.MULTIPLE_STYLESHEET_ERR,this); parser.reportError(Constants.ERROR, err); } if (_simplifi... | /**
* Parse the version and uri fields of the stylesheet and add an
* entry to the symbol table mapping the name <tt>__stylesheet_</tt>
* to an instance of this class.
*/ | Parse the version and uri fields of the stylesheet and add an entry to the symbol table mapping the name __stylesheet_ to an instance of this class | parseContents | {
"repo_name": "TheTypoMaster/Scaper",
"path": "openjdk/jaxp/drop_included/jaxp_src/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Stylesheet.java",
"license": "gpl-2.0",
"size": 52004
} | [
"com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg"
] | import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg; | import com.sun.org.apache.xalan.internal.xsltc.compiler.util.*; | [
"com.sun.org"
] | com.sun.org; | 66,001 |
@EventHandler(
ignoreCancelled = true, priority = EventPriority.MONITOR)
public void onPlayerVelocity(final PlayerVelocityEvent event) {
final Player player = event.getPlayer();
final MovingData data = MovingData.getData(player);
// Ignore velocity if inside of vehicles.... | @EventHandler( ignoreCancelled = true, priority = EventPriority.MONITOR) void function(final PlayerVelocityEvent event) { final Player player = event.getPlayer(); final MovingData data = MovingData.getData(player); if (player.isInsideVehicle()) { data.removeAllVelocity(); return; } final MovingConfig cc = MovingConfig.... | /**
* Player got a velocity packet. The server can't keep track of actual velocity values (by design), so we have to
* try and do that ourselves. Very rough estimates.
*
* @param event
* the event
*/ | Player got a velocity packet. The server can't keep track of actual velocity values (by design), so we have to try and do that ourselves. Very rough estimates | onPlayerVelocity | {
"repo_name": "MyPictures/NoCheatPlus",
"path": "NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java",
"license": "gpl-3.0",
"size": 63675
} | [
"fr.neatmonster.nocheatplus.utilities.TickTask",
"org.bukkit.entity.Player",
"org.bukkit.event.EventHandler",
"org.bukkit.event.EventPriority",
"org.bukkit.event.player.PlayerVelocityEvent",
"org.bukkit.util.Vector"
] | import fr.neatmonster.nocheatplus.utilities.TickTask; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.player.PlayerVelocityEvent; import org.bukkit.util.Vector; | import fr.neatmonster.nocheatplus.utilities.*; import org.bukkit.entity.*; import org.bukkit.event.*; import org.bukkit.event.player.*; import org.bukkit.util.*; | [
"fr.neatmonster.nocheatplus",
"org.bukkit.entity",
"org.bukkit.event",
"org.bukkit.util"
] | fr.neatmonster.nocheatplus; org.bukkit.entity; org.bukkit.event; org.bukkit.util; | 2,080,959 |
public Callback<Collection<AlbumData>> getAddNewReleasesToCacheCallback(String cacheId,
Callback<Collection<AlbumData>> callback) {
return new CallbackExtension<Collection<AlbumData>>(callback) { | Callback<Collection<AlbumData>> function(String cacheId, Callback<Collection<AlbumData>> callback) { return new CallbackExtension<Collection<AlbumData>>(callback) { | /**
* Wraps the given <code>callback</code> in an internal callback which adds the result of the given
* <code>callback</code> to the cache and calls the original callback afterwards.
*
* @param cacheId
* the ID which is used as key in the cache, e.g. genre ID
* @param callback
* ... | Wraps the given <code>callback</code> in an internal callback which adds the result of the given <code>callback</code> to the cache and calls the original callback afterwards | getAddNewReleasesToCacheCallback | {
"repo_name": "kaiwinter/rhapsody-java-sdk",
"path": "src/main/java/com/github/kaiwinter/rhapsody/cache/DataCache.java",
"license": "apache-2.0",
"size": 3259
} | [
"com.github.kaiwinter.rhapsody.model.AlbumData",
"java.util.Collection"
] | import com.github.kaiwinter.rhapsody.model.AlbumData; import java.util.Collection; | import com.github.kaiwinter.rhapsody.model.*; import java.util.*; | [
"com.github.kaiwinter",
"java.util"
] | com.github.kaiwinter; java.util; | 1,669,189 |
protected RuntimeManager createRuntimeManager(Strategy strategy, Map<String, ResourceType> resources) {
return createRuntimeManager(strategy, resources, null);
} | RuntimeManager function(Strategy strategy, Map<String, ResourceType> resources) { return createRuntimeManager(strategy, resources, null); } | /**
* Creates default configuration of <code>RuntimeManager</code> with given <code>strategy</code> and all
* <code>resources</code> being added to knowledge base.
* <br/>
* There should be only one <code>RuntimeManager</code> created during single test.
* @param strategy - selected strategy of... | Creates default configuration of <code>RuntimeManager</code> with given <code>strategy</code> and all <code>resources</code> being added to knowledge base. There should be only one <code>RuntimeManager</code> created during single test | createRuntimeManager | {
"repo_name": "Salaboy/jbpm",
"path": "jbpm-test/src/main/java/org/jbpm/test/JbpmJUnitBaseTestCase.java",
"license": "apache-2.0",
"size": 40652
} | [
"java.util.Map",
"org.kie.api.io.ResourceType",
"org.kie.api.runtime.manager.RuntimeManager"
] | import java.util.Map; import org.kie.api.io.ResourceType; import org.kie.api.runtime.manager.RuntimeManager; | import java.util.*; import org.kie.api.io.*; import org.kie.api.runtime.manager.*; | [
"java.util",
"org.kie.api"
] | java.util; org.kie.api; | 1,533,175 |
public void readProduct(Object input) throws IOException {
File file;
if (input instanceof String) {
file = getFile((String) input);
} else if (input instanceof File) {
file = (File) input;
file = getFile(file.getAbsolutePath());
} else {
... | void function(Object input) throws IOException { File file; if (input instanceof String) { file = getFile((String) input); } else if (input instanceof File) { file = (File) input; file = getFile(file.getAbsolutePath()); } else { throw new IllegalArgumentException("input"); } final ImageInputStream iis = getImageInputSt... | /**
* Reads a data product and returns a in-memory representation of it. This method was called by
* <code>readProductNodes(input, subsetInfo)</code> of the abstract superclass.
*
* @param input A file or path to the aux file
*
* @throws java.lang.IllegalArgumentException if <code>input</c... | Reads a data product and returns a in-memory representation of it. This method was called by <code>readProductNodes(input, subsetInfo)</code> of the abstract superclass | readProduct | {
"repo_name": "seadas/beam",
"path": "beam-envisat-reader/src/main/java/org/esa/beam/dataio/envisat/EnvisatAuxReader.java",
"license": "gpl-3.0",
"size": 6230
} | [
"java.io.File",
"java.io.IOException",
"javax.imageio.stream.ImageInputStream",
"org.esa.beam.framework.dataio.IllegalFileFormatException"
] | import java.io.File; import java.io.IOException; import javax.imageio.stream.ImageInputStream; import org.esa.beam.framework.dataio.IllegalFileFormatException; | import java.io.*; import javax.imageio.stream.*; import org.esa.beam.framework.dataio.*; | [
"java.io",
"javax.imageio",
"org.esa.beam"
] | java.io; javax.imageio; org.esa.beam; | 774,913 |
public void attachServoController(String sc, Integer pin, Double pos, Double speed) {
if (controller != null && controller.equals(sc)) {
log.info("{} already attached", sc);
return;
}
// update pin if non-null value supplied
if (pin != null) {
setPin(pin);
}
// update pos if ... | void function(String sc, Integer pin, Double pos, Double speed) { if (controller != null && controller.equals(sc)) { log.info(STR, sc); return; } if (pin != null) { setPin(pin); } if (pos != null) { targetPos = pos; } if (speed != null) { setSpeed(speed); } addListener(STR, sc); addListener(STR, sc); addListener(STR, s... | /**
* maximum complexity attach with reference to controller FIXME - max
* complexity service should use NAME not a direct reference to
* ServoController !!!!
*/ | maximum complexity attach with reference to controller FIXME - max complexity service should use NAME not a direct reference to ServoController !!! | attachServoController | {
"repo_name": "MyRobotLab/myrobotlab",
"path": "src/main/java/org/myrobotlab/service/abstracts/AbstractServo.java",
"license": "apache-2.0",
"size": 30820
} | [
"org.myrobotlab.service.Runtime",
"org.myrobotlab.service.interfaces.ServoController"
] | import org.myrobotlab.service.Runtime; import org.myrobotlab.service.interfaces.ServoController; | import org.myrobotlab.service.*; import org.myrobotlab.service.interfaces.*; | [
"org.myrobotlab.service"
] | org.myrobotlab.service; | 173,805 |
WorkerRunnable create() throws EngineException; | WorkerRunnable create() throws EngineException; | /**
* Factory method.
*
* @return A new {@code WorkerRunnable}.
* @throws EngineException If creation failed.
*/ | Factory method | create | {
"repo_name": "slantview/DrupalLoadTest",
"path": "lib/grinder/grinder-core/src/main/java/net/grinder/engine/process/WorkerRunnableFactory.java",
"license": "gpl-2.0",
"size": 1571
} | [
"net.grinder.engine.common.EngineException",
"net.grinder.scriptengine.ScriptEngineService"
] | import net.grinder.engine.common.EngineException; import net.grinder.scriptengine.ScriptEngineService; | import net.grinder.engine.common.*; import net.grinder.scriptengine.*; | [
"net.grinder.engine",
"net.grinder.scriptengine"
] | net.grinder.engine; net.grinder.scriptengine; | 2,619,595 |
String getMessage(String key, Map<String, Object> args, String defaultMessage); | String getMessage(String key, Map<String, Object> args, String defaultMessage); | /**
* Try to resolve the message.
*
* @param key Key to lookup, such as 'log4j.appenders.console'
* @param args Arguments that will be filled in for params within the message (params look like "{key}" within a message, but this might differ between implementations), or null if n... | Try to resolve the message | getMessage | {
"repo_name": "griffon/griffon-i18n-support-plugin",
"path": "src/main/griffon/plugins/i18n/ExtendedMessageSource.java",
"license": "apache-2.0",
"size": 3348
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,243,176 |
@Override
public void close(WebSocketClose reason, String text)
{
Objects.requireNonNull(reason);
if (_state.isClosed()) {
return;
}
_state = _state.closeSelf();
_frameOut.close(reason, text);
if (_state.isClosed()) {
disconnect();
}
} | void function(WebSocketClose reason, String text) { Objects.requireNonNull(reason); if (_state.isClosed()) { return; } _state = _state.closeSelf(); _frameOut.close(reason, text); if (_state.isClosed()) { disconnect(); } } | /**
* Close the websocket.
*/ | Close the websocket | close | {
"repo_name": "baratine/baratine",
"path": "web/src/main/java/com/caucho/v5/http/websocket/WebSocketBase.java",
"license": "gpl-2.0",
"size": 18117
} | [
"io.baratine.web.WebSocketClose",
"java.util.Objects"
] | import io.baratine.web.WebSocketClose; import java.util.Objects; | import io.baratine.web.*; import java.util.*; | [
"io.baratine.web",
"java.util"
] | io.baratine.web; java.util; | 413,912 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.