method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
sequence
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
sequence
libraries_info
stringlengths
6
661
id
int64
0
2.92M
@SuppressWarnings("MismatchedQueryAndUpdateOfCollection") private void updateStopForecast(StopForecast stopForecast) { final String GAEILGE = "ga"; final String DUE = "DUE"; EnglishGaeilgeMap mapEnglishGaeilge = new EnglishGaeilgeMap(); String min = " " + getString(R.string.min); String mins = " " + getString(R.string.mins); String minOrMins; if (stopForecast != null) { String status; boolean operatingNormally = false; if (stopForecast.getStopForecastStatusDirectionInbound().getOperatingNormally() && stopForecast.getStopForecastStatusDirectionOutbound().getOperatingNormally()) { operatingNormally = true; } if (localeDefault.startsWith(GAEILGE)) { status = getString(R.string.message_success); } else { status = stopForecast.getMessage(); } if (operatingNormally || status.toLowerCase().contains("lift")) { statusCardView.setStatus(status); statusCardView.setStatusColor(R.color.message_success); imageViewBottomNavAlerts.setImageResource( R.drawable.ic_error_alerts ); textViewBottomNavAlerts.setTextColor( ContextCompat.getColor(context, android.R.color.white) ); } else { if (status.equals("")) { statusCardView.setStatus( getString(R.string.message_no_status) ); } else { statusCardView.setStatus(status); } statusCardView.setStatusColor(R.color.message_error); imageViewBottomNavAlerts.setImageResource( R.drawable.ic_error_alerts_red ); textViewBottomNavAlerts.setTextColor( ContextCompat.getColor(context, R.color.message_error) ); } if (stopForecast.getInboundTrams() != null) { if (stopForecast.getInboundTrams().size() == 0) { inboundStopForecastCardView.setNoTramsForecast(); } else { String inboundTram; for (int i = 0; i < stopForecast.getInboundTrams().size(); i++) { String dueMinutes = stopForecast.getInboundTrams().get(i).getDueMinutes(); if (i < 6) { if (localeDefault.startsWith(GAEILGE)) { inboundTram = mapEnglishGaeilge.get( stopForecast.getInboundTrams() .get(i) .getDestination() ); } else { inboundTram = stopForecast.getInboundTrams() .get(i) .getDestination(); } if (dueMinutes.equalsIgnoreCase(DUE)) { if (localeDefault.startsWith(GAEILGE)) { dueMinutes = mapEnglishGaeilge.get(dueMinutes); } minOrMins = ""; } else if (Integer.parseInt(dueMinutes) > 1) { minOrMins = mins; } else { minOrMins = min; } inboundStopForecastCardView.setStopNames( i, inboundTram ); inboundStopForecastCardView.setStopTimes( i, dueMinutes + minOrMins ); } } } } if (stopForecast.getOutboundTrams() != null) { if (stopForecast.getOutboundTrams().size() == 0) { outboundStopForecastCardView.setNoTramsForecast(); } else { String outboundTram; for (int i = 0; i < stopForecast.getOutboundTrams().size(); i++) { String dueMinutes = stopForecast.getOutboundTrams().get(i).getDueMinutes(); if (i < 6) { if (localeDefault.startsWith(GAEILGE)) { outboundTram = mapEnglishGaeilge.get( stopForecast.getOutboundTrams() .get(i) .getDestination() ); } else { outboundTram = stopForecast.getOutboundTrams() .get(i).getDestination(); } if (dueMinutes.equalsIgnoreCase(DUE)) { if (localeDefault.startsWith(GAEILGE)) { dueMinutes = mapEnglishGaeilge.get(dueMinutes); } minOrMins = ""; } else if (Integer.parseInt(dueMinutes) > 1) { minOrMins = mins; } else { minOrMins = min; } outboundStopForecastCardView.setStopNames( i, outboundTram ); outboundStopForecastCardView.setStopTimes( i, dueMinutes + minOrMins ); } } } } } else { statusCardView.setStatus( getString(R.string.message_error) ); statusCardView.setStatusColor(R.color.message_error); } }
@SuppressWarnings(STR) void function(StopForecast stopForecast) { final String GAEILGE = "ga"; final String DUE = "DUE"; EnglishGaeilgeMap mapEnglishGaeilge = new EnglishGaeilgeMap(); String min = " " + getString(R.string.min); String mins = " " + getString(R.string.mins); String minOrMins; if (stopForecast != null) { String status; boolean operatingNormally = false; if (stopForecast.getStopForecastStatusDirectionInbound().getOperatingNormally() && stopForecast.getStopForecastStatusDirectionOutbound().getOperatingNormally()) { operatingNormally = true; } if (localeDefault.startsWith(GAEILGE)) { status = getString(R.string.message_success); } else { status = stopForecast.getMessage(); } if (operatingNormally status.toLowerCase().contains("lift")) { statusCardView.setStatus(status); statusCardView.setStatusColor(R.color.message_success); imageViewBottomNavAlerts.setImageResource( R.drawable.ic_error_alerts ); textViewBottomNavAlerts.setTextColor( ContextCompat.getColor(context, android.R.color.white) ); } else { if (status.equals(STRSTR"; } else if (Integer.parseInt(dueMinutes) > 1) { minOrMins = mins; } else { minOrMins = min; } outboundStopForecastCardView.setStopNames( i, outboundTram ); outboundStopForecastCardView.setStopTimes( i, dueMinutes + minOrMins ); } } } } } else { statusCardView.setStatus( getString(R.string.message_error) ); statusCardView.setStatusColor(R.color.message_error); } }
/** * Draw stop forecast to screen. * @param stopForecast StopForecast object containing data for requested stop. */
Draw stop forecast to screen
updateStopForecast
{ "repo_name": "thecosmicfrog/LuasataGlance", "path": "mobile/src/main/java/org/thecosmicfrog/luasataglance/activity/LineFragment.java", "license": "gpl-3.0", "size": 45307 }
[ "androidx.core.content.ContextCompat", "org.thecosmicfrog.luasataglance.object.EnglishGaeilgeMap", "org.thecosmicfrog.luasataglance.object.StopForecast" ]
import androidx.core.content.ContextCompat; import org.thecosmicfrog.luasataglance.object.EnglishGaeilgeMap; import org.thecosmicfrog.luasataglance.object.StopForecast;
import androidx.core.content.*; import org.thecosmicfrog.luasataglance.object.*;
[ "androidx.core", "org.thecosmicfrog.luasataglance" ]
androidx.core; org.thecosmicfrog.luasataglance;
1,434,146
@Override public int read(byte[] bytes, int off, int len) throws IOException { int numOfBytesRead = in.read(bytes, off, len); if (numOfBytesRead != -1) { hasher.putBytes(bytes, off, numOfBytesRead); } return numOfBytesRead; }
int function(byte[] bytes, int off, int len) throws IOException { int numOfBytesRead = in.read(bytes, off, len); if (numOfBytesRead != -1) { hasher.putBytes(bytes, off, numOfBytesRead); } return numOfBytesRead; }
/** * Reads the specified bytes of data from the underlying input stream and updates the hasher with * the bytes read. */
Reads the specified bytes of data from the underlying input stream and updates the hasher with the bytes read
read
{ "repo_name": "Allive1/pinpoint", "path": "thirdparty/google-guava/src/main/java/com/google/common/hash/HashingInputStream.java", "license": "apache-2.0", "size": 2985 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,508,118
public void setLazyDataset(ILazyDataset lazy);
void function(ILazyDataset lazy);
/** * Instead of specifying a dataset name(s) to loop over * one can specify an ILazyDataset to use instead. In this * case the datasetName(s) will be ignored. * */
Instead of specifying a dataset name(s) to loop over one can specify an ILazyDataset to use instead. In this case the datasetName(s) will be ignored
setLazyDataset
{ "repo_name": "colinpalmer/dawnsci", "path": "org.eclipse.dawnsci.analysis.api/src/org/eclipse/dawnsci/analysis/api/conversion/IConversionContext.java", "license": "epl-1.0", "size": 11548 }
[ "org.eclipse.dawnsci.analysis.api.dataset.ILazyDataset" ]
import org.eclipse.dawnsci.analysis.api.dataset.ILazyDataset;
import org.eclipse.dawnsci.analysis.api.dataset.*;
[ "org.eclipse.dawnsci" ]
org.eclipse.dawnsci;
739,624
public Observable<ServiceResponse<RemediationInner>> getByResourceGroupWithServiceResponseAsync(String subscriptionId, String resourceGroupName, String remediationName) { if (subscriptionId == null) { throw new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."); } if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (remediationName == null) { throw new IllegalArgumentException("Parameter remediationName is required and cannot be null."); }
Observable<ServiceResponse<RemediationInner>> function(String subscriptionId, String resourceGroupName, String remediationName) { if (subscriptionId == null) { throw new IllegalArgumentException(STR); } if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (remediationName == null) { throw new IllegalArgumentException(STR); }
/** * Gets an existing remediation at resource group scope. * * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param remediationName The name of the remediation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the RemediationInner object */
Gets an existing remediation at resource group scope
getByResourceGroupWithServiceResponseAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/policyinsights/mgmt-v2018_07_01_preview/src/main/java/com/microsoft/azure/management/policyinsights/v2018_07_01_preview/implementation/RemediationsInner.java", "license": "mit", "size": 261004 }
[ "com.microsoft.rest.ServiceResponse" ]
import com.microsoft.rest.ServiceResponse;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
2,336,717
File createReportInstanceDirectory() { // if report directory is null, then used the default directory if (reportDirectory == null) { setReportDirectory(getDefaultReportDirectory()); } // create report directory name StringBuilder reportDirName = new StringBuilder(); reportDirName.append("report-"); reportDirName.append(timestampFormat.format(new Date())); // define report directory for this report File newReportDir = new File(reportDirectory, reportDirName.toString()); // if directory doesn't exist then create it if (!newReportDir.exists()) { // log debug message if (logger.isDebugEnabled()) { String message = messageProvider.get("bhrg.create_instance_directory", newReportDir.getAbsolutePath()); logger.debug(message); } newReportDir.mkdirs(); } return newReportDir; }
File createReportInstanceDirectory() { if (reportDirectory == null) { setReportDirectory(getDefaultReportDirectory()); } StringBuilder reportDirName = new StringBuilder(); reportDirName.append(STR); reportDirName.append(timestampFormat.format(new Date())); File newReportDir = new File(reportDirectory, reportDirName.toString()); if (!newReportDir.exists()) { if (logger.isDebugEnabled()) { String message = messageProvider.get(STR, newReportDir.getAbsolutePath()); logger.debug(message); } newReportDir.mkdirs(); } return newReportDir; }
/** * Create time stamped report directory for this report. * * @return time stamped report directory for this report. */
Create time stamped report directory for this report
createReportInstanceDirectory
{ "repo_name": "athrane/pineapple", "path": "reporting/pineapple-basic-html-report-generator/src/main/java/com/alpha/pineapple/report/basichtml/BasicHtmlReportGeneratorImpl.java", "license": "gpl-3.0", "size": 15201 }
[ "java.io.File", "java.util.Date" ]
import java.io.File; import java.util.Date;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,099,049
@Override public boolean onStartNestedScroll(View child, View target, int axes) { // Only return true if the NestedScrollingChild view wants to scroll this view vertically. // Note: This is because the Android ListView class only supports vertical scrolling. return ((axes & ViewCompat.SCROLL_AXIS_VERTICAL) != 0); }
boolean function(View child, View target, int axes) { return ((axes & ViewCompat.SCROLL_AXIS_VERTICAL) != 0); }
/** * Called by a NestedScrollingChild when its startNestedScroll() method has been called. * This asks this view if it supports nested scrolling with along the given axes. * @param child * Reference to either the NestedScrollingChild or the ViewGroup owned by this parent view * that contains the NestedScrollingChild. * @param target The nested scrollable child that has been started. * @param axes * Bit mask set to flags ViewCompat.SCROLL_AXIS_HORIZONTAL and/or * ViewCompat.SCROLL_AXIS_VERTICAL that the child wants to scroll the parent by. * @return * Returns true if this view is will to scroll in the direction(s) indicated by argument "axes". * Returns false if unwilling to do the requested nested scrolling. */
Called by a NestedScrollingChild when its startNestedScroll() method has been called. This asks this view if it supports nested scrolling with along the given axes
onStartNestedScroll
{ "repo_name": "mano-mykingdom/titanium_mobile", "path": "android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/TiNestedListView.java", "license": "apache-2.0", "size": 17486 }
[ "android.support.v4.view.ViewCompat", "android.view.View" ]
import android.support.v4.view.ViewCompat; import android.view.View;
import android.support.v4.view.*; import android.view.*;
[ "android.support", "android.view" ]
android.support; android.view;
607,689
public static String getArgsLine (final Object ... args) { final int numArgs=(null == args) ? 0 : args.length; if (numArgs <= 0) return null; else return asStringList(Arrays.asList(args), ' '); }
static String function (final Object ... args) { final int numArgs=(null == args) ? 0 : args.length; if (numArgs <= 0) return null; else return asStringList(Arrays.asList(args), ' '); }
/** * Builds a <I>main</I> invocation command line from given argument * @param args arguments list - may be null/empty and contain null/empty * elements (which are ignored) * @return updated command line - may be null/empty if no arguments found */
Builds a main invocation command line from given argument
getArgsLine
{ "repo_name": "lgoldstein/communitychest", "path": "chest/base-utils/jdk/src/main/java/net/community/chest/lang/StringUtil.java", "license": "apache-2.0", "size": 52084 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
1,507,504
private boolean isAfterParent(final BSPTree<Sphere1D> node) { final BSPTree<Sphere1D> parent = node.getParent(); if (parent == null) { return false; } else { return node == childAfter(parent); } }
boolean function(final BSPTree<Sphere1D> node) { final BSPTree<Sphere1D> parent = node.getParent(); if (parent == null) { return false; } else { return node == childAfter(parent); } }
/** Check if a node is the child after its parent in trigonometric order. * @param node child node considered * @return true is the node has a parent end is after it in trigonometric order */
Check if a node is the child after its parent in trigonometric order
isAfterParent
{ "repo_name": "sdinot/hipparchus", "path": "hipparchus-geometry/src/main/java/org/hipparchus/geometry/spherical/oned/ArcsSet.java", "license": "apache-2.0", "size": 37319 }
[ "org.hipparchus.geometry.partitioning.BSPTree" ]
import org.hipparchus.geometry.partitioning.BSPTree;
import org.hipparchus.geometry.partitioning.*;
[ "org.hipparchus.geometry" ]
org.hipparchus.geometry;
2,219,200
default AdvancedTwilioEndpointConsumerBuilder exchangePattern( ExchangePattern exchangePattern) { doSetProperty("exchangePattern", exchangePattern); return this; }
default AdvancedTwilioEndpointConsumerBuilder exchangePattern( ExchangePattern exchangePattern) { doSetProperty(STR, exchangePattern); return this; }
/** * Sets the exchange pattern when the consumer creates an exchange. * * The option is a: * &lt;code&gt;org.apache.camel.ExchangePattern&lt;/code&gt; type. * * Group: consumer (advanced) * * @param exchangePattern the value to set * @return the dsl builder */
Sets the exchange pattern when the consumer creates an exchange. The option is a: &lt;code&gt;org.apache.camel.ExchangePattern&lt;/code&gt; type. Group: consumer (advanced)
exchangePattern
{ "repo_name": "nikhilvibhav/camel", "path": "core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/TwilioEndpointBuilderFactory.java", "license": "apache-2.0", "size": 37918 }
[ "org.apache.camel.ExchangePattern" ]
import org.apache.camel.ExchangePattern;
import org.apache.camel.*;
[ "org.apache.camel" ]
org.apache.camel;
2,346,751
public OneResponse snapshotDelete(int snapId) { return snapshotDelete(client, id, snapId); }
OneResponse function(int snapId) { return snapshotDelete(client, id, snapId); }
/** * Deletes a VM snapshot * * @param snapId Id of the snapshot * @return If an error occurs the error message contains the reason. */
Deletes a VM snapshot
snapshotDelete
{ "repo_name": "tuxmea/one", "path": "src/oca/java/src/org/opennebula/client/vm/VirtualMachine.java", "license": "apache-2.0", "size": 42818 }
[ "org.opennebula.client.OneResponse" ]
import org.opennebula.client.OneResponse;
import org.opennebula.client.*;
[ "org.opennebula.client" ]
org.opennebula.client;
586,654
private static JAXBContext JAXBContext_newInstance(final String context, final ClassLoader classloader) throws Exception { // NOTE: This method must remain private because it uses AccessController JAXBContext jaxbContext = null; try { if (log.isDebugEnabled()) { if (context == null || context.length() == 0) { log.debug("JAXBContext is constructed without a context String."); } else { log.debug("JAXBContext is constructed with a context of:" + context); } }
static JAXBContext function(final String context, final ClassLoader classloader) throws Exception { JAXBContext jaxbContext = null; try { if (log.isDebugEnabled()) { if (context == null context.length() == 0) { log.debug(STR); } else { log.debug(STR + context); } }
/** * Create JAXBContext from context String and ClassLoader * * @param context * @param classloader * @return * @throws Exception */
Create JAXBContext from context String and ClassLoader
JAXBContext_newInstance
{ "repo_name": "intalio/axis2", "path": "modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBUtils.java", "license": "apache-2.0", "size": 50242 }
[ "javax.xml.bind.JAXBContext" ]
import javax.xml.bind.JAXBContext;
import javax.xml.bind.*;
[ "javax.xml" ]
javax.xml;
1,203,589
protected BeanPropertyDescriptor createPropertyDescriptor(IPropertyDeclaration property, Annotation annotation) { ArcteryxBeanProperty propertyAnnotation = (ArcteryxBeanProperty) annotation; BeanPropertyDescriptor descriptor = new BeanPropertyDescriptor(); descriptor.setName(property.getPropertyName()); descriptor.setDescription(propertyAnnotation.description()); return descriptor; }
BeanPropertyDescriptor function(IPropertyDeclaration property, Annotation annotation) { ArcteryxBeanProperty propertyAnnotation = (ArcteryxBeanProperty) annotation; BeanPropertyDescriptor descriptor = new BeanPropertyDescriptor(); descriptor.setName(property.getPropertyName()); descriptor.setDescription(propertyAnnotation.description()); return descriptor; }
/** * create property descriptor * * @param property * @param annotation * @return */
create property descriptor
createPropertyDescriptor
{ "repo_name": "bradwoo8621/nest-old", "path": "arcteryx-meta-beans/src/main/java/com/github/nest/arcteryx/meta/beans/annotation/scan/BeanPropertyDescriptorGenerator.java", "license": "apache-2.0", "size": 6005 }
[ "com.github.nest.arcteryx.meta.beans.annotation.ArcteryxBeanProperty", "com.github.nest.arcteryx.meta.beans.internal.BeanPropertyDescriptor", "java.lang.annotation.Annotation" ]
import com.github.nest.arcteryx.meta.beans.annotation.ArcteryxBeanProperty; import com.github.nest.arcteryx.meta.beans.internal.BeanPropertyDescriptor; import java.lang.annotation.Annotation;
import com.github.nest.arcteryx.meta.beans.annotation.*; import com.github.nest.arcteryx.meta.beans.internal.*; import java.lang.annotation.*;
[ "com.github.nest", "java.lang" ]
com.github.nest; java.lang;
2,758,498
public void setImageBitmap(Bitmap bitmap) { mBitmap = bitmap; mImageView.setImageBitmap(mBitmap); if (mCropOverlayView != null) { mCropOverlayView.resetCropOverlayView(); } }
void function(Bitmap bitmap) { mBitmap = bitmap; mImageView.setImageBitmap(mBitmap); if (mCropOverlayView != null) { mCropOverlayView.resetCropOverlayView(); } }
/** * Sets a Bitmap as the content of the CropImageView. * * @param bitmap the Bitmap to set */
Sets a Bitmap as the content of the CropImageView
setImageBitmap
{ "repo_name": "cymcsg/UltimateAndroid", "path": "deprecated/UltimateAndroidGradle/ultimateandroiduicomponent/src/main/java/com/marshalchen/common/uimodule/cropperimage/CropImageView.java", "license": "apache-2.0", "size": 19614 }
[ "android.graphics.Bitmap" ]
import android.graphics.Bitmap;
import android.graphics.*;
[ "android.graphics" ]
android.graphics;
2,063,456
public void glNormalPointer(int stride, FloatBuffer pointer);
void function(int stride, FloatBuffer pointer);
/** * Define an array of normals. * * @param stride * Specifies the byte offset between consecutive normals. If * stride is 0, the normals are understood to be tightly packed * in the array. The initial value is 0. * @param pointer * Specifies a pointer to the first coordinate of the first * normal in the array. The initial value is 0. */
Define an array of normals
glNormalPointer
{ "repo_name": "kayahr/threedee", "path": "threedee-core/src/main/java/de/ailis/threedee/rendering/GL.java", "license": "mit", "size": 38281 }
[ "java.nio.FloatBuffer" ]
import java.nio.FloatBuffer;
import java.nio.*;
[ "java.nio" ]
java.nio;
2,427,473
@VisibleForTesting Response listDnsRecords(String projectId, String zoneName, String query) { Map<String, Object> options = OptionParsers.parseListDnsRecordsOptions(query); Response response = checkListOptions(options); if (response != null) { return response; } ZoneContainer zoneContainer = findZone(projectId, zoneName); if (zoneContainer == null) { return Error.NOT_FOUND.response(String.format( "The 'parameters.managedZone' resource named '%s' does not exist.", zoneName)); } ImmutableSortedMap<String, ResourceRecordSet> dnsRecords = zoneContainer.dnsRecords().get(); String[] fields = (String[]) options.get("fields"); String name = (String) options.get("name"); String type = (String) options.get("type"); String pageToken = (String) options.get("pageToken"); ImmutableSortedMap<String, ResourceRecordSet> fragment = pageToken != null ? dnsRecords.tailMap(pageToken, false) : dnsRecords; Integer maxResults = options.get("maxResults") == null ? null : Integer.valueOf((String) options.get("maxResults")); boolean sizeReached = false; boolean hasMorePages = false; LinkedList<String> serializedRrsets = new LinkedList<>(); String lastRecordId = null; for (String recordSetId : fragment.keySet()) { ResourceRecordSet recordSet = fragment.get(recordSetId); if (matchesCriteria(recordSet, name, type)) { if (sizeReached) { // we do not add this, just note that there would be more and there should be a token hasMorePages = true; break; } else { lastRecordId = recordSetId; try { serializedRrsets.addLast(jsonFactory.toString( OptionParsers.extractFields(recordSet, fields))); } catch (IOException e) { return Error.INTERNAL_ERROR.response(String.format( "Error when serializing resource record set in managed zone %s in project %s", zoneName, projectId)); } } } sizeReached = maxResults != null && maxResults.equals(serializedRrsets.size()); } boolean includePageToken = hasMorePages && (fields == null || Arrays.asList(fields).contains("nextPageToken")); return toListResponse(serializedRrsets, "rrsets", lastRecordId, includePageToken); }
Response listDnsRecords(String projectId, String zoneName, String query) { Map<String, Object> options = OptionParsers.parseListDnsRecordsOptions(query); Response response = checkListOptions(options); if (response != null) { return response; } ZoneContainer zoneContainer = findZone(projectId, zoneName); if (zoneContainer == null) { return Error.NOT_FOUND.response(String.format( STR, zoneName)); } ImmutableSortedMap<String, ResourceRecordSet> dnsRecords = zoneContainer.dnsRecords().get(); String[] fields = (String[]) options.get(STR); String name = (String) options.get("name"); String type = (String) options.get("type"); String pageToken = (String) options.get(STR); ImmutableSortedMap<String, ResourceRecordSet> fragment = pageToken != null ? dnsRecords.tailMap(pageToken, false) : dnsRecords; Integer maxResults = options.get(STR) == null ? null : Integer.valueOf((String) options.get(STR)); boolean sizeReached = false; boolean hasMorePages = false; LinkedList<String> serializedRrsets = new LinkedList<>(); String lastRecordId = null; for (String recordSetId : fragment.keySet()) { ResourceRecordSet recordSet = fragment.get(recordSetId); if (matchesCriteria(recordSet, name, type)) { if (sizeReached) { hasMorePages = true; break; } else { lastRecordId = recordSetId; try { serializedRrsets.addLast(jsonFactory.toString( OptionParsers.extractFields(recordSet, fields))); } catch (IOException e) { return Error.INTERNAL_ERROR.response(String.format( STR, zoneName, projectId)); } } } sizeReached = maxResults != null && maxResults.equals(serializedRrsets.size()); } boolean includePageToken = hasMorePages && (fields == null Arrays.asList(fields).contains(STR)); return toListResponse(serializedRrsets, STR, lastRecordId, includePageToken); }
/** * Lists record sets for a zone. Next page token is the ID of the last record listed. */
Lists record sets for a zone. Next page token is the ID of the last record listed
listDnsRecords
{ "repo_name": "aozarov/gcloud-java", "path": "gcloud-java-dns/src/main/java/com/google/cloud/dns/testing/LocalDnsHelper.java", "license": "apache-2.0", "size": 50076 }
[ "com.google.api.services.dns.model.ResourceRecordSet", "com.google.common.collect.ImmutableSortedMap", "java.io.IOException", "java.util.Arrays", "java.util.LinkedList", "java.util.Map" ]
import com.google.api.services.dns.model.ResourceRecordSet; import com.google.common.collect.ImmutableSortedMap; import java.io.IOException; import java.util.Arrays; import java.util.LinkedList; import java.util.Map;
import com.google.api.services.dns.model.*; import com.google.common.collect.*; import java.io.*; import java.util.*;
[ "com.google.api", "com.google.common", "java.io", "java.util" ]
com.google.api; com.google.common; java.io; java.util;
1,792,772
private void recordSubclassPrototypePropUse( FunctionType classType, String prop, Reference ref) { if (classType.getPrototype().hasOwnProperty(prop)) { graph.connect(getNamedContainingFunction(), ref, graph.defineNameIfNotExists( classType.getReferenceName() + ".prototype." + prop, false)); } if (classType.getSubTypes() != null) { for (FunctionType subclass : classType.getSubTypes()) { recordSubclassPrototypePropUse(subclass, prop, ref); } } }
void function( FunctionType classType, String prop, Reference ref) { if (classType.getPrototype().hasOwnProperty(prop)) { graph.connect(getNamedContainingFunction(), ref, graph.defineNameIfNotExists( classType.getReferenceName() + STR + prop, false)); } if (classType.getSubTypes() != null) { for (FunctionType subclass : classType.getSubTypes()) { recordSubclassPrototypePropUse(subclass, prop, ref); } } }
/** * Conservatively assumes that all subclass implementation of this property * might be called. */
Conservatively assumes that all subclass implementation of this property might be called
recordSubclassPrototypePropUse
{ "repo_name": "selkhateeb/closure-compiler", "path": "src/com/google/javascript/jscomp/NameReferenceGraphConstruction.java", "license": "apache-2.0", "size": 20320 }
[ "com.google.javascript.jscomp.NameReferenceGraph", "com.google.javascript.rhino.jstype.FunctionType" ]
import com.google.javascript.jscomp.NameReferenceGraph; import com.google.javascript.rhino.jstype.FunctionType;
import com.google.javascript.jscomp.*; import com.google.javascript.rhino.jstype.*;
[ "com.google.javascript" ]
com.google.javascript;
1,526,137
@Test public void testGetCommandKey() { // Build up an access profile RowFilters filters = new RowFilters(); Set<FieldName> selects = new HashSet<FieldName>(); AccessProfile accessProfile = new AccessProfile(filters, selects); // Build up some column metadata with a primary key Map<String, Integer> map = new HashMap<String, Integer>(); map.put("col1", java.sql.Types.VARCHAR); map.put("col2", java.sql.Types.INTEGER); ColumnTypesMap columnTypesMap = new ColumnTypesMap(map, "col1"); String keyValue = "aKeyValue"; // Create the builder SqlBuilder builder = null; try { builder = SqlBuilderFactory.getSqlBuilder(TEST_TABLE_NAME, keyValue, accessProfile, columnTypesMap, null, null, null, null); } catch (Exception e) { fail(); } // Get the command. String actualCommand = builder.getCommand(); assertEquals("SELECT * FROM \"" + TEST_TABLE_NAME + "\" WHERE \"col1\"" + "='" + keyValue + "'" + " ORDER BY \"col1\"", actualCommand); }
void function() { RowFilters filters = new RowFilters(); Set<FieldName> selects = new HashSet<FieldName>(); AccessProfile accessProfile = new AccessProfile(filters, selects); Map<String, Integer> map = new HashMap<String, Integer>(); map.put("col1", java.sql.Types.VARCHAR); map.put("col2", java.sql.Types.INTEGER); ColumnTypesMap columnTypesMap = new ColumnTypesMap(map, "col1"); String keyValue = STR; SqlBuilder builder = null; try { builder = SqlBuilderFactory.getSqlBuilder(TEST_TABLE_NAME, keyValue, accessProfile, columnTypesMap, null, null, null, null); } catch (Exception e) { fail(); } String actualCommand = builder.getCommand(); assertEquals(STRSTR\STRcol1\STR='STR'STR ORDER BY \"col1\"", actualCommand); }
/** * Test a command with a key. */
Test a command with a key
testGetCommandKey
{ "repo_name": "schwadorf/IRIS", "path": "interaction-jdbc-producer/src/test/java/com/temenos/interaction/jdbc/producer/sql/builder/TestOracleBuilder.java", "license": "agpl-3.0", "size": 26620 }
[ "com.temenos.interaction.jdbc.producer.sql.ColumnTypesMap", "com.temenos.interaction.jdbc.producer.sql.SqlBuilder", "com.temenos.interaction.jdbc.producer.sql.SqlBuilderFactory", "com.temenos.interaction.odataext.odataparser.data.AccessProfile", "com.temenos.interaction.odataext.odataparser.data.FieldName", "com.temenos.interaction.odataext.odataparser.data.RowFilters", "java.util.HashMap", "java.util.HashSet", "java.util.Map", "java.util.Set", "org.junit.Assert" ]
import com.temenos.interaction.jdbc.producer.sql.ColumnTypesMap; import com.temenos.interaction.jdbc.producer.sql.SqlBuilder; import com.temenos.interaction.jdbc.producer.sql.SqlBuilderFactory; import com.temenos.interaction.odataext.odataparser.data.AccessProfile; import com.temenos.interaction.odataext.odataparser.data.FieldName; import com.temenos.interaction.odataext.odataparser.data.RowFilters; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.junit.Assert;
import com.temenos.interaction.jdbc.producer.sql.*; import com.temenos.interaction.odataext.odataparser.data.*; import java.util.*; import org.junit.*;
[ "com.temenos.interaction", "java.util", "org.junit" ]
com.temenos.interaction; java.util; org.junit;
616,319
public static Area getScreenResolution() { Cookie res = Functions.getCookie(Stapler.getCurrentRequest(),"screenResolution"); if(res!=null) return Area.parse(res.getValue()); return null; } public static final class RunUrl { private final String head, base, rest; private final Run run; public RunUrl(Run run, String head, String base, String rest) { this.run = run; this.head = head; this.base = base; this.rest = rest; }
static Area function() { Cookie res = Functions.getCookie(Stapler.getCurrentRequest(),STR); if(res!=null) return Area.parse(res.getValue()); return null; } public static final class RunUrl { private final String head, base, rest; private final Run run; public RunUrl(Run run, String head, String base, String rest) { this.run = run; this.head = head; this.base = base; this.rest = rest; }
/** * If we know the user's screen resolution, return it. Otherwise null. * @since 1.213 */
If we know the user's screen resolution, return it. Otherwise null
getScreenResolution
{ "repo_name": "iterate/coding-dojo", "path": "2011-04-26-refactoring_hudson/core/src/main/java/hudson/Functions.java", "license": "apache-2.0", "size": 48096 }
[ "hudson.model.Run", "hudson.util.Area", "javax.servlet.http.Cookie", "org.kohsuke.stapler.Stapler" ]
import hudson.model.Run; import hudson.util.Area; import javax.servlet.http.Cookie; import org.kohsuke.stapler.Stapler;
import hudson.model.*; import hudson.util.*; import javax.servlet.http.*; import org.kohsuke.stapler.*;
[ "hudson.model", "hudson.util", "javax.servlet", "org.kohsuke.stapler" ]
hudson.model; hudson.util; javax.servlet; org.kohsuke.stapler;
1,320,721
int even = 0; int sum = 0; final int[][] sums = { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, { 0, 2, 4, 6, 8, 1, 3, 5, 7, 9 } }; CharacterIterator iter = new StringCharacterIterator(number); for (char c = iter.last(); c != CharacterIterator.DONE; c = iter.previous()) { if (!Character.isDigit(c)) { return false; } int cInt = c - '0'; sum += sums[even++ & 0x1][cInt]; } return sum % 10 == 0; }
int even = 0; int sum = 0; final int[][] sums = { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, { 0, 2, 4, 6, 8, 1, 3, 5, 7, 9 } }; CharacterIterator iter = new StringCharacterIterator(number); for (char c = iter.last(); c != CharacterIterator.DONE; c = iter.previous()) { if (!Character.isDigit(c)) { return false; } int cInt = c - '0'; sum += sums[even++ & 0x1][cInt]; } return sum % 10 == 0; }
/** * Checks if the given string represents a number that passes the Luhn Checksum which all valid * CCs will pass. * * @param number * @return true if the number does pass the checksum, else false */
Checks if the given string represents a number that passes the Luhn Checksum which all valid CCs will pass
passesLuhnChecksum
{ "repo_name": "carlospontual/card.io-Android-source", "path": "card.io/src/main/java/io/card/payment/CreditCardNumber.java", "license": "mit", "size": 5887 }
[ "java.text.CharacterIterator", "java.text.StringCharacterIterator" ]
import java.text.CharacterIterator; import java.text.StringCharacterIterator;
import java.text.*;
[ "java.text" ]
java.text;
1,227,807
public void addNoSubclassDependency(RVMClass source, int dependent_cmid) { MethodSet s = findOrCreateMethodSet(noSubclassHash, source); s.add(dependent_cmid); }
void function(RVMClass source, int dependent_cmid) { MethodSet s = findOrCreateMethodSet(noSubclassHash, source); s.add(dependent_cmid); }
/** * Record that if a particular RVMClass ever has a subclass, then * the CompiledMethod encoded by the cmid must be invalidated. */
Record that if a particular RVMClass ever has a subclass, then the CompiledMethod encoded by the cmid must be invalidated
addNoSubclassDependency
{ "repo_name": "CodeOffloading/JikesRVM-CCO", "path": "jikesrvm-3.1.3/rvm/src/org/jikesrvm/compilers/opt/inlining/InvalidationDatabase.java", "license": "epl-1.0", "size": 6013 }
[ "org.jikesrvm.classloader.RVMClass" ]
import org.jikesrvm.classloader.RVMClass;
import org.jikesrvm.classloader.*;
[ "org.jikesrvm.classloader" ]
org.jikesrvm.classloader;
2,205,119
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { formatLabel = new javax.swing.JLabel(); formatChoice = new javax.swing.JComboBox(); colorsLabel = new javax.swing.JLabel(); colorsChoice = new javax.swing.JComboBox(); infoLabel = new javax.swing.JLabel(); startStopButton = new javax.swing.JButton(); mouseLabel = new javax.swing.JLabel(); cursorChoice = new javax.swing.JComboBox(); audioRateLabel = new javax.swing.JLabel(); audioRateChoice = new javax.swing.JComboBox(); screenRateLabel = new javax.swing.JLabel(); screenRateField = new javax.swing.JSpinner(); mouseRateLabel = new javax.swing.JLabel(); mouseRateField = new javax.swing.JSpinner(); encodingLabel = new javax.swing.JLabel(); encodingChoice = new javax.swing.JComboBox(); areaLabel = new javax.swing.JLabel(); areaChoice = new javax.swing.JComboBox(); selectAreaButton = new javax.swing.JButton(); stateLabel = new javax.swing.JLabel(); audioSourceLabel = new javax.swing.JLabel(); audioSourceChoice = new javax.swing.JComboBox(); FormListener formListener = new FormListener(); setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); setTitle("Monte Screen Recorder"); setResizable(false); addWindowListener(formListener); formatLabel.setText("Format:"); formatChoice.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "AVI", "QuickTime" })); formatChoice.addActionListener(formListener); colorsLabel.setText("Colors:"); colorsChoice.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Hundreds", "Thousands", "Millions" })); infoLabel.setFont(new java.awt.Font("Lucida Grande", 0, 11)); // NOI18N infoLabel.setText("<html>The recording will be stored in the folder \"Movies\".<br> Drop a folder on this text to change the storage location.<br> A new file will be created every hour or when the file size limit is reached.<br> <br>This window will be minized before the recording starts.<br> To stop the recording, restore this window and press the Stop button.<br> "); startStopButton.setText("Start"); startStopButton.addActionListener(formListener); mouseLabel.setText("Mouse:"); cursorChoice.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "No Cursor", "Black Cursor", "White Cursor" })); audioRateLabel.setText("Audio Rate:"); audioRateChoice.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "44.100 kHz" })); screenRateLabel.setText("Screen Rate:"); mouseRateLabel.setText("Mouse Rate:"); encodingLabel.setText("Encoding:"); encodingChoice.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Screen Capture", "Run Length", "None", "PNG", "JPEG 100 %", "JPEG 50 %" })); areaLabel.setText("Area:"); areaChoice.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Entire Screen", "0 0, 1024 x 768", " " })); selectAreaButton.setText("Custom Area..."); selectAreaButton.addActionListener(formListener); stateLabel.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); stateLabel.setText(" "); audioSourceLabel.setText("Audio:"); audioSourceChoice.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "No Audio", "44.100 kHz" })); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(stateLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(startStopButton) .addGap(10, 10, 10)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(colorsLabel) .addComponent(mouseLabel) .addComponent(formatLabel) .addComponent(areaLabel) .addComponent(audioSourceLabel)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(formatChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(colorsChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(cursorChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(audioSourceChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(screenRateLabel, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(mouseRateLabel, javax.swing.GroupLayout.Alignment.TRAILING)) .addComponent(encodingLabel) .addComponent(audioRateLabel)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(audioRateChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(encodingChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(screenRateField, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(mouseRateField, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(layout.createSequentialGroup() .addComponent(areaChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(selectAreaButton)))) .addComponent(infoLabel)) .addContainerGap()) ); layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {audioRateChoice, colorsChoice, cursorChoice, formatChoice}); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(formatChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(formatLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(colorsChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(colorsLabel)) .addGap(11, 11, 11) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cursorChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(mouseLabel))) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(encodingChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(encodingLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(screenRateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(screenRateLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(mouseRateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(mouseRateLabel)))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(audioRateChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(audioRateLabel) .addComponent(audioSourceLabel) .addComponent(audioSourceChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(areaChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(areaLabel) .addComponent(selectAreaButton)) .addGap(18, 18, 18) .addComponent(infoLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(startStopButton) .addComponent(stateLabel)) .addContainerGap()) ); pack(); } // Code for dispatching events from components to event handlers. private class FormListener implements java.awt.event.ActionListener, java.awt.event.WindowListener { FormListener() {}
@SuppressWarnings(STR) void function() { formatLabel = new javax.swing.JLabel(); formatChoice = new javax.swing.JComboBox(); colorsLabel = new javax.swing.JLabel(); colorsChoice = new javax.swing.JComboBox(); infoLabel = new javax.swing.JLabel(); startStopButton = new javax.swing.JButton(); mouseLabel = new javax.swing.JLabel(); cursorChoice = new javax.swing.JComboBox(); audioRateLabel = new javax.swing.JLabel(); audioRateChoice = new javax.swing.JComboBox(); screenRateLabel = new javax.swing.JLabel(); screenRateField = new javax.swing.JSpinner(); mouseRateLabel = new javax.swing.JLabel(); mouseRateField = new javax.swing.JSpinner(); encodingLabel = new javax.swing.JLabel(); encodingChoice = new javax.swing.JComboBox(); areaLabel = new javax.swing.JLabel(); areaChoice = new javax.swing.JComboBox(); selectAreaButton = new javax.swing.JButton(); stateLabel = new javax.swing.JLabel(); audioSourceLabel = new javax.swing.JLabel(); audioSourceChoice = new javax.swing.JComboBox(); FormListener formListener = new FormListener(); setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); setTitle(STR); setResizable(false); addWindowListener(formListener); formatLabel.setText(STR); formatChoice.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "AVI", STR })); formatChoice.addActionListener(formListener); colorsLabel.setText(STR); colorsChoice.setModel(new javax.swing.DefaultComboBoxModel(new String[] { STR, STR, STR })); infoLabel.setFont(new java.awt.Font(STR, 0, 11)); infoLabel.setText(STRMovies\STR); startStopButton.setText("Start"); startStopButton.addActionListener(formListener); mouseLabel.setText(STR); cursorChoice.setModel(new javax.swing.DefaultComboBoxModel(new String[] { STR, STR, STR })); audioRateLabel.setText(STR); audioRateChoice.setModel(new javax.swing.DefaultComboBoxModel(new String[] { STR })); screenRateLabel.setText(STR); mouseRateLabel.setText(STR); encodingLabel.setText(STR); encodingChoice.setModel(new javax.swing.DefaultComboBoxModel(new String[] { STR, STR, "None", "PNG", STR, STR })); areaLabel.setText("Area:"); areaChoice.setModel(new javax.swing.DefaultComboBoxModel(new String[] { STR, STR, " " })); selectAreaButton.setText(STR); selectAreaButton.addActionListener(formListener); stateLabel.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); stateLabel.setText(" "); audioSourceLabel.setText(STR); audioSourceChoice.setModel(new javax.swing.DefaultComboBoxModel(new String[] { STR, STR })); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(stateLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(startStopButton) .addGap(10, 10, 10)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(colorsLabel) .addComponent(mouseLabel) .addComponent(formatLabel) .addComponent(areaLabel) .addComponent(audioSourceLabel)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(formatChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(colorsChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(cursorChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(audioSourceChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(screenRateLabel, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(mouseRateLabel, javax.swing.GroupLayout.Alignment.TRAILING)) .addComponent(encodingLabel) .addComponent(audioRateLabel)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(audioRateChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(encodingChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(screenRateField, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(mouseRateField, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(layout.createSequentialGroup() .addComponent(areaChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(selectAreaButton)))) .addComponent(infoLabel)) .addContainerGap()) ); layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {audioRateChoice, colorsChoice, cursorChoice, formatChoice}); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(formatChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(formatLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(colorsChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(colorsLabel)) .addGap(11, 11, 11) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cursorChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(mouseLabel))) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(encodingChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(encodingLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(screenRateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(screenRateLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(mouseRateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(mouseRateLabel)))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(audioRateChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(audioRateLabel) .addComponent(audioSourceLabel) .addComponent(audioSourceChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(areaChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(areaLabel) .addComponent(selectAreaButton)) .addGap(18, 18, 18) .addComponent(infoLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(startStopButton) .addComponent(stateLabel)) .addContainerGap()) ); pack(); } private class FormListener implements java.awt.event.ActionListener, java.awt.event.WindowListener { FormListener() {}
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */
This method is called from within the constructor to initialize the form. regenerated by the Form Editor
initComponents
{ "repo_name": "sebkur/montemedia", "path": "src/main/org/monte/screenrecorder/ScreenRecorderMain.java", "license": "lgpl-3.0", "size": 46142 }
[ "java.awt.Component", "java.awt.event.ActionListener", "javax.swing.DefaultComboBoxModel", "javax.swing.SwingConstants" ]
import java.awt.Component; import java.awt.event.ActionListener; import javax.swing.DefaultComboBoxModel; import javax.swing.SwingConstants;
import java.awt.*; import java.awt.event.*; import javax.swing.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
585,560
public void initializePackageContents() { if (isInitialized) return; isInitialized = true; // Initialize package setName(eNAME); setNsPrefix(eNS_PREFIX); setNsURI(eNS_URI); // Obtain other dependent packages MdfPackage theMdfPackage = (MdfPackage)EPackage.Registry.INSTANCE.getEPackage(MdfPackage.eNS_URI); EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); TranslationDslPackage theTranslationDslPackage = (TranslationDslPackage)EPackage.Registry.INSTANCE.getEPackage(TranslationDslPackage.eNS_URI); // Create type parameters // Set bounds for type parameters // Add supertypes to classes // Initialize classes and features; add operations and parameters initEClass(localReferenceApplicationEClass, LocalReferenceApplication.class, "LocalReferenceApplication", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getLocalReferenceApplication_LocalField(), this.getLocalField(), null, "localField", null, 1, -1, LocalReferenceApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getLocalReferenceApplication_ForApplication(), theMdfPackage.getMdfClass(), null, "forApplication", null, 0, 1, LocalReferenceApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(localFieldEClass, LocalField.class, "LocalField", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getLocalField_GroupName(), theEcorePackage.getEString(), "groupName", null, 0, 1, LocalField.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getLocalField_LocalRefID(), theEcorePackage.getEString(), "localRefID", "", 1, 1, LocalField.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getLocalField_Label(), theTranslationDslPackage.getTranslations(), null, "label", null, 0, 1, LocalField.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getLocalField_ToolTip(), theTranslationDslPackage.getTranslations(), null, "toolTip", null, 0, 1, LocalField.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); // Create resource createResource(eNS_URI); // Create annotations // http:///org/eclipse/emf/ecore/util/ExtendedMetaData createExtendedMetaDataAnnotations(); }
void function() { if (isInitialized) return; isInitialized = true; setName(eNAME); setNsPrefix(eNS_PREFIX); setNsURI(eNS_URI); MdfPackage theMdfPackage = (MdfPackage)EPackage.Registry.INSTANCE.getEPackage(MdfPackage.eNS_URI); EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); TranslationDslPackage theTranslationDslPackage = (TranslationDslPackage)EPackage.Registry.INSTANCE.getEPackage(TranslationDslPackage.eNS_URI); initEClass(localReferenceApplicationEClass, LocalReferenceApplication.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getLocalReferenceApplication_LocalField(), this.getLocalField(), null, STR, null, 1, -1, LocalReferenceApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getLocalReferenceApplication_ForApplication(), theMdfPackage.getMdfClass(), null, STR, null, 0, 1, LocalReferenceApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(localFieldEClass, LocalField.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getLocalField_GroupName(), theEcorePackage.getEString(), STR, null, 0, 1, LocalField.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getLocalField_LocalRefID(), theEcorePackage.getEString(), STR, STRlabelSTRtoolTip", null, 0, 1, LocalField.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); createResource(eNS_URI); createExtendedMetaDataAnnotations(); }
/** * Complete the initialization of the package and its meta-model. This * method is guarded to have no affect on any invocation but its first. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
Complete the initialization of the package and its meta-model. This method is guarded to have no affect on any invocation but its first.
initializePackageContents
{ "repo_name": "debabratahazra/DS", "path": "designstudio/components/t24/core/com.odcgroup.t24.application.localref/src/main/generated/com/odcgroup/t24/localReferenceApplication/impl/LocalReferenceApplicationPackageImpl.java", "license": "epl-1.0", "size": 10434 }
[ "com.odcgroup.mdf.ecore.MdfPackage", "com.odcgroup.t24.localReferenceApplication.LocalField", "com.odcgroup.t24.localReferenceApplication.LocalReferenceApplication", "com.odcgroup.translation.translationDsl.TranslationDslPackage", "org.eclipse.emf.ecore.EPackage", "org.eclipse.emf.ecore.EcorePackage" ]
import com.odcgroup.mdf.ecore.MdfPackage; import com.odcgroup.t24.localReferenceApplication.LocalField; import com.odcgroup.t24.localReferenceApplication.LocalReferenceApplication; import com.odcgroup.translation.translationDsl.TranslationDslPackage; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EcorePackage;
import com.odcgroup.mdf.ecore.*; import com.odcgroup.t24.*; import com.odcgroup.translation.*; import org.eclipse.emf.ecore.*;
[ "com.odcgroup.mdf", "com.odcgroup.t24", "com.odcgroup.translation", "org.eclipse.emf" ]
com.odcgroup.mdf; com.odcgroup.t24; com.odcgroup.translation; org.eclipse.emf;
254,588
Patch applySmartPatch(SmartPatch smartPatch, boolean force) throws IOException;
Patch applySmartPatch(SmartPatch smartPatch, boolean force) throws IOException;
/** * Apply a smart patch and return the result * @param smartPatch The patch to apply * @param force Whether to force application of the patch * @return The patched that was applied * @throws java.io.IOException If an IO exception occurred */
Apply a smart patch and return the result
applySmartPatch
{ "repo_name": "ASzc/fuse-patch-jdk6", "path": "core/src/main/java/org/wildfly/extras/patch/Server.java", "license": "apache-2.0", "size": 2375 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
962,827
public void update(Observable o, Object arg) { int index = DownloadManager.getInstance().getDownloadList().indexOf(o); // Fire table row update notification to table. fireTableRowsUpdated(index, index); }
void function(Observable o, Object arg) { int index = DownloadManager.getInstance().getDownloadList().indexOf(o); fireTableRowsUpdated(index, index); }
/** * Update is called when a Download notifies its observers of any changes */
Update is called when a Download notifies its observers of any changes
update
{ "repo_name": "prashant31191/Java-Download-Manager", "path": "src/com/luugiathuy/apps/downloadmanager/DownloadTableModel.java", "license": "mit", "size": 4217 }
[ "java.util.Observable" ]
import java.util.Observable;
import java.util.*;
[ "java.util" ]
java.util;
239,767
public synchronized String addTest( Connection conn, String suiteId, CMnDbAcceptanceTestData test) throws SQLException { String testId = null; StringBuffer sql = new StringBuffer(); sql.append("INSERT INTO " + TEST_TABLE + " "); sql.append("(" + SUITE_ID); if (test.getStartTime() != null) sql.append(", " + TEST_START_DATE); if (test.getEndTime() != null) sql.append(", " + TEST_END_DATE); if ((test.getGroupName() != null) && (test.getGroupName().length() > 0)) { sql.append(", " + TEST_GROUP_NAME); } sql.append(", " + TEST_FILE); sql.append(", " + TEST_SUMMARY); sql.append(", " + TEST_AUTHOR); sql.append(", " + TEST_MESSAGE); sql.append(", " + TEST_STATUS + ") "); sql.append("VALUES "); sql.append("(\"" + suiteId + "\""); if (test.getStartTime() != null) sql.append(", \"" + DATETIME.format(test.getStartTime()) + "\""); if (test.getEndTime() != null) sql.append(", \"" + DATETIME.format(test.getEndTime()) + "\""); if ((test.getGroupName() != null) && (test.getGroupName().length() > 0)) { sql.append(", \"" + test.getGroupName() + "\""); } sql.append(", \"" + test.getScriptName() + "\""); sql.append(", \"" + escapeQueryText(test.getSummary(), TEXT_SIZE) + "\""); sql.append(", \"" + test.getAuthor() + "\""); sql.append(", \"" + escapeQueryText(test.getMessage(), TEXT_SIZE) + "\""); sql.append(", \"" + getTestStatus(test) + "\")"); Statement st = conn.createStatement(); ResultSet rs = null; try { executeInsert(st, "addTest", sql.toString()); //st.execute(sql.toString(), Statement.RETURN_GENERATED_KEYS); //rs = st.getGeneratedKeys(); rs = getGeneratedKeys(st); if (rs != null) { rs.first(); testId = rs.getString(1); // Add the mapping between stories and test ID Enumeration stories = test.getStories(); while ((stories != null) && stories.hasMoreElements()) { String story = (String) stories.nextElement(); try { // Only add the story if the string is not null or blank if (story != null) { story = story.trim(); if (story.length() > 0) { addStory(conn, testId, story); } } } catch (SQLException exStory) { System.err.println("Unable to add story: testId = " + testId + ", story = " + story); } } // Add the mapping between testcase and test ID Enumeration testcases = test.getTestCases(); while ((testcases != null) && testcases.hasMoreElements()) { String testcase = (String) testcases.nextElement(); try { // Only add the testcase if the string is not null or blank if (testcase != null) { testcase = testcase.trim(); if (testcase.length() > 0) { addTestCase(conn, testId, testcase); } } } catch (SQLException exTestCase) { System.err.println("Unable to add test case: testId = " + testId + ", testcase = " + testcase); } } } else { System.err.println("Unable to obtain generated key."); } } catch (SQLException ex) { System.err.println("Failed to add test."); System.err.println("SQL Query: " + sql.toString()); ex.printStackTrace(); } finally { if (rs != null) rs.close(); if (st != null) st.close(); } return testId; }
synchronized String function( Connection conn, String suiteId, CMnDbAcceptanceTestData test) throws SQLException { String testId = null; StringBuffer sql = new StringBuffer(); sql.append(STR + TEST_TABLE + " "); sql.append("(" + SUITE_ID); if (test.getStartTime() != null) sql.append(STR + TEST_START_DATE); if (test.getEndTime() != null) sql.append(STR + TEST_END_DATE); if ((test.getGroupName() != null) && (test.getGroupName().length() > 0)) { sql.append(STR + TEST_GROUP_NAME); } sql.append(STR + TEST_FILE); sql.append(STR + TEST_SUMMARY); sql.append(STR + TEST_AUTHOR); sql.append(STR + TEST_MESSAGE); sql.append(STR + TEST_STATUS + STR); sql.append(STR); sql.append("(\"STR\STR, \STR\STR, \STR\STR, \STR\STR, \STR\STR, \STR\STR, \STR\STR, \STR\STR, \STR\")"); Statement st = conn.createStatement(); ResultSet rs = null; try { executeInsert(st, STR, sql.toString()); rs = getGeneratedKeys(st); if (rs != null) { rs.first(); testId = rs.getString(1); Enumeration stories = test.getStories(); while ((stories != null) && stories.hasMoreElements()) { String story = (String) stories.nextElement(); try { if (story != null) { story = story.trim(); if (story.length() > 0) { addStory(conn, testId, story); } } } catch (SQLException exStory) { System.err.println(STR + testId + STR + story); } } Enumeration testcases = test.getTestCases(); while ((testcases != null) && testcases.hasMoreElements()) { String testcase = (String) testcases.nextElement(); try { if (testcase != null) { testcase = testcase.trim(); if (testcase.length() > 0) { addTestCase(conn, testId, testcase); } } } catch (SQLException exTestCase) { System.err.println(STR + testId + STR + testcase); } } } else { System.err.println(STR); } } catch (SQLException ex) { System.err.println(STR); System.err.println(STR + sql.toString()); ex.printStackTrace(); } finally { if (rs != null) rs.close(); if (st != null) st.close(); } return testId; }
/** * Store an ACT test result in the database. * * @param conn Database connection * @param suiteId Foreign key that links the test to the suite * @param test Test data * * @return Auto-generated key that identifies the test */
Store an ACT test result in the database
addTest
{ "repo_name": "ModelN/build-management", "path": "mn-build-core/src/main/java/com/modeln/testfw/reporting/CMnAcceptanceTestTable.java", "license": "mit", "size": 36442 }
[ "java.sql.Connection", "java.sql.ResultSet", "java.sql.SQLException", "java.sql.Statement", "java.util.Enumeration" ]
import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.Enumeration;
import java.sql.*; import java.util.*;
[ "java.sql", "java.util" ]
java.sql; java.util;
662,967
public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { int j1 = par9; if (par5 == 1 && this.canPlaceTorchOn(par1World, par2, par3 - 1, par4)) { j1 = 5; } if (par5 == 2 && par1World.isSideSolid(par2, par3, par4 + 1, ForgeDirection.NORTH, true)) { j1 = 4; } if (par5 == 3 && par1World.isSideSolid(par2, par3, par4 - 1, ForgeDirection.SOUTH, true)) { j1 = 3; } if (par5 == 4 && par1World.isSideSolid(par2 + 1, par3, par4, ForgeDirection.WEST, true)) { j1 = 2; } if (par5 == 5 && par1World.isSideSolid(par2 - 1, par3, par4, ForgeDirection.EAST, true)) { j1 = 1; } return j1; }
int function(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { int j1 = par9; if (par5 == 1 && this.canPlaceTorchOn(par1World, par2, par3 - 1, par4)) { j1 = 5; } if (par5 == 2 && par1World.isSideSolid(par2, par3, par4 + 1, ForgeDirection.NORTH, true)) { j1 = 4; } if (par5 == 3 && par1World.isSideSolid(par2, par3, par4 - 1, ForgeDirection.SOUTH, true)) { j1 = 3; } if (par5 == 4 && par1World.isSideSolid(par2 + 1, par3, par4, ForgeDirection.WEST, true)) { j1 = 2; } if (par5 == 5 && par1World.isSideSolid(par2 - 1, par3, par4, ForgeDirection.EAST, true)) { j1 = 1; } return j1; }
/** * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata */
Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata
onBlockPlaced
{ "repo_name": "OwnAgePau/Soul-Forest", "path": "src/main/java/com/Mod_Ores/Blocks/Special/SoulTorch.java", "license": "lgpl-2.1", "size": 11315 }
[ "net.minecraft.world.World", "net.minecraftforge.common.util.ForgeDirection" ]
import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection;
import net.minecraft.world.*; import net.minecraftforge.common.util.*;
[ "net.minecraft.world", "net.minecraftforge.common" ]
net.minecraft.world; net.minecraftforge.common;
1,330,302
public void disable() throws IOException { // This has to be synchronized or it can collide with the check in the task. synchronized (optOutLock) { // Check if the server owner has already set opt-out, if not, set it. if (!isOptOut()) { configuration.set("opt-out", true); configuration.save(configurationFile); } // Disable Task, if it is running if (task != null) { task.cancel(); task = null; } } }
void function() throws IOException { synchronized (optOutLock) { if (!isOptOut()) { configuration.set(STR, true); configuration.save(configurationFile); } if (task != null) { task.cancel(); task = null; } } }
/** * Disables metrics for the server by setting "opt-out" to true in the config file and canceling the metrics task. * * @throws java.io.IOException */
Disables metrics for the server by setting "opt-out" to true in the config file and canceling the metrics task
disable
{ "repo_name": "AydinE/GPTownship", "path": "GPTownship/src/com/OmniTekMC/GPTownship/Metrics.java", "license": "gpl-3.0", "size": 24832 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,926,911
public RouteNextHopType nextHopType() { return this.nextHopType; }
RouteNextHopType function() { return this.nextHopType; }
/** * Get the type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None'. * * @return the nextHopType value */
Get the type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None'
nextHopType
{ "repo_name": "navalev/azure-sdk-for-java", "path": "sdk/network/mgmt-v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/RouteInner.java", "license": "mit", "size": 5938 }
[ "com.microsoft.azure.management.network.v2017_10_01.RouteNextHopType" ]
import com.microsoft.azure.management.network.v2017_10_01.RouteNextHopType;
import com.microsoft.azure.management.network.v2017_10_01.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
1,482,720
public static boolean filter(String name, Pattern[] included, Pattern[] excluded) { if (null == name) { return false; } boolean accepted = false; // retain only the includes if (null == included) { accepted = true; } else { Pattern pattern; for (int i = 0; i < included.length; i++) { pattern = included[i]; if (pattern != null && pattern.matcher(name).matches()) { accepted = true; break; } } } // remove the excludes if (accepted && excluded != null) { Pattern pattern; for (int i = 0; i < excluded.length; i++) { pattern = excluded[i]; if (pattern != null && pattern.matcher(name).matches()) { accepted = false; break; } } } return accepted; }
static boolean function(String name, Pattern[] included, Pattern[] excluded) { if (null == name) { return false; } boolean accepted = false; if (null == included) { accepted = true; } else { Pattern pattern; for (int i = 0; i < included.length; i++) { pattern = included[i]; if (pattern != null && pattern.matcher(name).matches()) { accepted = true; break; } } } if (accepted && excluded != null) { Pattern pattern; for (int i = 0; i < excluded.length; i++) { pattern = excluded[i]; if (pattern != null && pattern.matcher(name).matches()) { accepted = false; break; } } } return accepted; }
/** * Checks if the name filters through a series of including and excluding * regular expressions. * * @param name The <code>String</code> that will be filtered. * @param included An array of regular expressions that need to succeed * @param excluded An array of regular expressions that need to fail * * @return <code>true</code> if the name filtered through correctly; or * <p> * <code>false</code> otherwise. * * @since 1.0 */
Checks if the name filters through a series of including and excluding regular expressions
filter
{ "repo_name": "codesearch-github/codesearch", "path": "src/custom-libs/Codesearch-JHighlight/src/main/java/com/uwyn/jhighlight/tools/StringUtils.java", "license": "gpl-3.0", "size": 22699 }
[ "java.util.regex.Pattern" ]
import java.util.regex.Pattern;
import java.util.regex.*;
[ "java.util" ]
java.util;
301,894
@FIXVersion(introduced = "5.0SP1") @TagNumRef(tagNum = TagNum.DerivativeInstrAttribType) public void setDerivativeInstrAttribType(InstrAttribType derivativeInstrAttribType) { this.derivativeInstrAttribType = derivativeInstrAttribType; }
@FIXVersion(introduced = STR) @TagNumRef(tagNum = TagNum.DerivativeInstrAttribType) void function(InstrAttribType derivativeInstrAttribType) { this.derivativeInstrAttribType = derivativeInstrAttribType; }
/** * Message field setter. * @param derivativeInstrAttribType field value */
Message field setter
setDerivativeInstrAttribType
{ "repo_name": "marvisan/HadesFIX", "path": "Model/src/main/java/net/hades/fix/message/group/DerivativeInstrAttribGroup.java", "license": "gpl-3.0", "size": 8027 }
[ "net.hades.fix.message.anno.FIXVersion", "net.hades.fix.message.anno.TagNumRef", "net.hades.fix.message.type.InstrAttribType", "net.hades.fix.message.type.TagNum" ]
import net.hades.fix.message.anno.FIXVersion; import net.hades.fix.message.anno.TagNumRef; import net.hades.fix.message.type.InstrAttribType; import net.hades.fix.message.type.TagNum;
import net.hades.fix.message.anno.*; import net.hades.fix.message.type.*;
[ "net.hades.fix" ]
net.hades.fix;
932,581
public void setReportOnlyScrubberProcess(ScrubberProcess reportOnlyScrubberProcess) { this.reportOnlyScrubberProcess = reportOnlyScrubberProcess; }
void function(ScrubberProcess reportOnlyScrubberProcess) { this.reportOnlyScrubberProcess = reportOnlyScrubberProcess; }
/** * Sets the reportOnlyScrubberProcess attribute value. * @param reportOnlyScrubberProcess The reportOnlyScrubberProcess to set. */
Sets the reportOnlyScrubberProcess attribute value
setReportOnlyScrubberProcess
{ "repo_name": "Ariah-Group/Finance", "path": "af_webapp/src/main/java/org/kuali/kfs/gl/service/impl/ScrubberServiceImpl.java", "license": "apache-2.0", "size": 5064 }
[ "org.kuali.kfs.gl.batch.service.ScrubberProcess" ]
import org.kuali.kfs.gl.batch.service.ScrubberProcess;
import org.kuali.kfs.gl.batch.service.*;
[ "org.kuali.kfs" ]
org.kuali.kfs;
1,072,698
public TermVectorsRequest doc(BytesReference doc, boolean generateRandomId) { // assign a random id to this artificial document, for routing if (generateRandomId) { this.id(String.valueOf(randomInt.getAndAdd(1))); } this.doc = doc; return this; }
TermVectorsRequest function(BytesReference doc, boolean generateRandomId) { if (generateRandomId) { this.id(String.valueOf(randomInt.getAndAdd(1))); } this.doc = doc; return this; }
/** * Sets an artificial document from which term vectors are requested for. */
Sets an artificial document from which term vectors are requested for
doc
{ "repo_name": "wuranbo/elasticsearch", "path": "core/src/main/java/org/elasticsearch/action/termvectors/TermVectorsRequest.java", "license": "apache-2.0", "size": 24229 }
[ "org.elasticsearch.common.bytes.BytesReference" ]
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.bytes.*;
[ "org.elasticsearch.common" ]
org.elasticsearch.common;
1,681,556
public T caseComponent(Component object) { return null; }
T function(Component object) { return null; }
/** * Returns the result of interpreting the object as an instance of '<em>Component</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Component</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */
Returns the result of interpreting the object as an instance of 'Component'. This implementation returns null; returning a non-null result will terminate the switch.
caseComponent
{ "repo_name": "Nasdanika/amur-it-js", "path": "org.nasdanika.amur.it.js/src/org/nasdanika/amur/it/js/util/JsSwitch.java", "license": "epl-1.0", "size": 16789 }
[ "org.nasdanika.amur.it.js.Component" ]
import org.nasdanika.amur.it.js.Component;
import org.nasdanika.amur.it.js.*;
[ "org.nasdanika.amur" ]
org.nasdanika.amur;
1,444,908
@Override public Description getDescription() { return suiteDescription; }
Description function() { return suiteDescription; }
/** * Return the current tree of test descriptions (filtered). */
Return the current tree of test descriptions (filtered)
getDescription
{ "repo_name": "roaporl/randomizedtesting", "path": "randomized-runner/src/main/java/com/carrotsearch/randomizedtesting/RandomizedRunner.java", "license": "apache-2.0", "size": 64962 }
[ "org.junit.runner.Description" ]
import org.junit.runner.Description;
import org.junit.runner.*;
[ "org.junit.runner" ]
org.junit.runner;
1,506,202
private void setSubtreeSpecification( Subentry subentry, Entry entry ) throws LdapException { String subtree = entry.get( SUBTREE_SPECIFICATION_AT ).getString(); SubtreeSpecification ss; try { ss = ssParser.parse( subtree ); } catch ( Exception e ) { String msg = I18n.err( I18n.ERR_307, entry.getDn() ); LOG.warn( msg ); throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, msg ); } subentry.setSubtreeSpecification( ss ); }
void function( Subentry subentry, Entry entry ) throws LdapException { String subtree = entry.get( SUBTREE_SPECIFICATION_AT ).getString(); SubtreeSpecification ss; try { ss = ssParser.parse( subtree ); } catch ( Exception e ) { String msg = I18n.err( I18n.ERR_307, entry.getDn() ); LOG.warn( msg ); throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, msg ); } subentry.setSubtreeSpecification( ss ); }
/** * Get the SubtreeSpecification, parse it and stores it into the subentry */
Get the SubtreeSpecification, parse it and stores it into the subentry
setSubtreeSpecification
{ "repo_name": "drankye/directory-server", "path": "interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java", "license": "apache-2.0", "size": 62937 }
[ "org.apache.directory.api.ldap.model.entry.Entry", "org.apache.directory.api.ldap.model.exception.LdapException", "org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException", "org.apache.directory.api.ldap.model.message.ResultCodeEnum", "org.apache.directory.api.ldap.model.subtree.Subentry", "org.apache.directory.api.ldap.model.subtree.SubtreeSpecification", "org.apache.directory.server.i18n.I18n" ]
import org.apache.directory.api.ldap.model.entry.Entry; import org.apache.directory.api.ldap.model.exception.LdapException; import org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException; import org.apache.directory.api.ldap.model.message.ResultCodeEnum; import org.apache.directory.api.ldap.model.subtree.Subentry; import org.apache.directory.api.ldap.model.subtree.SubtreeSpecification; import org.apache.directory.server.i18n.I18n;
import org.apache.directory.api.ldap.model.entry.*; import org.apache.directory.api.ldap.model.exception.*; import org.apache.directory.api.ldap.model.message.*; import org.apache.directory.api.ldap.model.subtree.*; import org.apache.directory.server.i18n.*;
[ "org.apache.directory" ]
org.apache.directory;
2,760,039
public static java.util.List extractPatientList(ims.domain.ILightweightDomainFactory domainFactory, ims.core.vo.PatientForVTERiskAssessmentVoCollection voCollection) { return extractPatientList(domainFactory, voCollection, null, new HashMap()); }
static java.util.List function(ims.domain.ILightweightDomainFactory domainFactory, ims.core.vo.PatientForVTERiskAssessmentVoCollection voCollection) { return extractPatientList(domainFactory, voCollection, null, new HashMap()); }
/** * Create the ims.core.patient.domain.objects.Patient list from the value object collection. * @param domainFactory - used to create existing (persistent) domain objects. * @param voCollection - the collection of value objects */
Create the ims.core.patient.domain.objects.Patient list from the value object collection
extractPatientList
{ "repo_name": "open-health-hub/openMAXIMS", "path": "openmaxims_workspace/ValueObjects/src/ims/core/vo/domain/PatientForVTERiskAssessmentVoAssembler.java", "license": "agpl-3.0", "size": 19313 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
493,395
public void parseAndExitUponError(OptionPriority priority, String source, String[] args) { for (String arg : args) { if (arg.equals("--help")) { System.out.println(describeOptions(Collections.<String, String>emptyMap(), HelpVerbosity.LONG)); System.exit(0); } } try { parse(priority, source, Arrays.asList(args)); } catch (OptionsParsingException e) { System.err.println("Error parsing command line: " + e.getMessage()); System.err.println("Try --help."); System.exit(2); } } public static final class OptionDescription { private final String name; private final Object defaultValue; private final Converter<?> converter; private final boolean allowMultiple; public OptionDescription(String name, Object defaultValue, Converter<?> converter, boolean allowMultiple) { this.name = name; this.defaultValue = defaultValue; this.converter = converter; this.allowMultiple = allowMultiple; }
void function(OptionPriority priority, String source, String[] args) { for (String arg : args) { if (arg.equals(STR)) { System.out.println(describeOptions(Collections.<String, String>emptyMap(), HelpVerbosity.LONG)); System.exit(0); } } try { parse(priority, source, Arrays.asList(args)); } catch (OptionsParsingException e) { System.err.println(STR + e.getMessage()); System.err.println(STR); System.exit(2); } } public static final class OptionDescription { private final String name; private final Object defaultValue; private final Converter<?> converter; private final boolean allowMultiple; public OptionDescription(String name, Object defaultValue, Converter<?> converter, boolean allowMultiple) { this.name = name; this.defaultValue = defaultValue; this.converter = converter; this.allowMultiple = allowMultiple; }
/** * A convenience function for use in main methods. Parses the command line * parameters, and exits upon error. Also, prints out the usage message * if "--help" appears anywhere within {@code args}. */
A convenience function for use in main methods. Parses the command line parameters, and exits upon error. Also, prints out the usage message if "--help" appears anywhere within args
parseAndExitUponError
{ "repo_name": "anupcshan/bazel", "path": "src/main/java/com/google/devtools/common/options/OptionsParser.java", "license": "apache-2.0", "size": 21059 }
[ "java.util.Arrays", "java.util.Collections" ]
import java.util.Arrays; import java.util.Collections;
import java.util.*;
[ "java.util" ]
java.util;
732,537
public void assertDoesNotHaveDuplicates(AssertionInfo info, long[] actual) { arrays.assertDoesNotHaveDuplicates(info, failures, actual); }
void function(AssertionInfo info, long[] actual) { arrays.assertDoesNotHaveDuplicates(info, failures, actual); }
/** * Asserts that the given array does not have duplicate values. * @param info contains information about the assertion. * @param actual the given array. * @throws NullPointerException if the array of values is {@code null}. * @throws IllegalArgumentException if the array of values is empty. * @throws AssertionError if the given array is {@code null}. * @throws AssertionError if the given array contains duplicate values. */
Asserts that the given array does not have duplicate values
assertDoesNotHaveDuplicates
{ "repo_name": "nicstrong/fest-assertions-android", "path": "fest-assert-android/src/main/java/org/fest/assertions/internal/LongArrays.java", "license": "apache-2.0", "size": 10095 }
[ "org.fest.assertions.core.AssertionInfo" ]
import org.fest.assertions.core.AssertionInfo;
import org.fest.assertions.core.*;
[ "org.fest.assertions" ]
org.fest.assertions;
564,294
public void setUpddat(Date upddat) { this.upddat = upddat; }
void function(Date upddat) { this.upddat = upddat; }
/** * This method was generated by MyBatis Generator. * This method sets the value of the database column ACTTBC.UPDDAT * * @param upddat the value for ACTTBC.UPDDAT * * @mbggenerated Sun Nov 21 21:36:06 CST 2010 */
This method was generated by MyBatis Generator. This method sets the value of the database column ACTTBC.UPDDAT
setUpddat
{ "repo_name": "rongshang/fbi-cbs2", "path": "common/main/java/cbs/repository/code/model/Acttbc.java", "license": "unlicense", "size": 3556 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
2,645,955
private ImmutableSet<String> getWantedPrimaryDexEntries( ProguardTranslatorFactory translatorFactory, Supplier<ImmutableList<ClassNode>> classesSupplier) throws IOException { ImmutableSet.Builder<String> builder = ImmutableSet.builder(); // If there is a scenario file and overflow is allowed, then the scenario dependencies // are wanted but not required, and therefore get added here. if (dexSplitMode.isPrimaryDexScenarioOverflowAllowed() && primaryDexScenarioFile.isPresent()) { addScenarioClasses(translatorFactory, classesSupplier, builder, primaryDexScenarioFile.get()); } return builder .build() .stream() .map(input -> input + ".class") .collect(ImmutableSet.toImmutableSet()); }
ImmutableSet<String> function( ProguardTranslatorFactory translatorFactory, Supplier<ImmutableList<ClassNode>> classesSupplier) throws IOException { ImmutableSet.Builder<String> builder = ImmutableSet.builder(); if (dexSplitMode.isPrimaryDexScenarioOverflowAllowed() && primaryDexScenarioFile.isPresent()) { addScenarioClasses(translatorFactory, classesSupplier, builder, primaryDexScenarioFile.get()); } return builder .build() .stream() .map(input -> input + STR) .collect(ImmutableSet.toImmutableSet()); }
/** * Construct a {@link Set} of zip file entry names that should go into the primary dex to improve * performance. * * <p> * * @return ImmutableList of zip file entry names. */
Construct a <code>Set</code> of zip file entry names that should go into the primary dex to improve performance.
getWantedPrimaryDexEntries
{ "repo_name": "brettwooldridge/buck", "path": "src/com/facebook/buck/android/SplitZipStep.java", "license": "apache-2.0", "size": 20539 }
[ "com.google.common.collect.ImmutableList", "com.google.common.collect.ImmutableSet", "java.io.IOException", "java.util.function.Supplier", "org.objectweb.asm.tree.ClassNode" ]
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import java.io.IOException; import java.util.function.Supplier; import org.objectweb.asm.tree.ClassNode;
import com.google.common.collect.*; import java.io.*; import java.util.function.*; import org.objectweb.asm.tree.*;
[ "com.google.common", "java.io", "java.util", "org.objectweb.asm" ]
com.google.common; java.io; java.util; org.objectweb.asm;
1,293,310
public void setPreferences(SharedPreferences prefs) { mSettings = prefs; }
void function(SharedPreferences prefs) { mSettings = prefs; }
/** * Some data (the actual sampling rate used by the phone and the AAC profile) needs to be stored once {@link #getSessionDescription()} is called. * @param prefs The SharedPreferences that will be used to store the sampling rate */
Some data (the actual sampling rate used by the phone and the AAC profile) needs to be stored once <code>#getSessionDescription()</code> is called
setPreferences
{ "repo_name": "MichaelChansn/RemoteEye", "path": "RemoteEye/src/freescale/ks/remoteeye/streaming/audio/AACStream.java", "license": "gpl-3.0", "size": 12629 }
[ "android.content.SharedPreferences" ]
import android.content.SharedPreferences;
import android.content.*;
[ "android.content" ]
android.content;
607,017
public static Collection<String> newRandomStringList(int size, String... strings) { if (size < 0) { throw new IllegalArgumentException("Size cannot be less than 0. "); } if (strings == null || strings.length == 0) { throw new IllegalArgumentException("strings must contains at least one String. "); } List<String> list = new ArrayList<String>(size); for (String string : strings) { for (int i = 0; i < size / 3; i++) { list.add(string); } } if (list.size() < size) { for (int i = list.size(); i < size; i++) { list.add(strings[i % strings.length]); } } Collections.shuffle(list, RANDOM); return list; }
static Collection<String> function(int size, String... strings) { if (size < 0) { throw new IllegalArgumentException(STR); } if (strings == null strings.length == 0) { throw new IllegalArgumentException(STR); } List<String> list = new ArrayList<String>(size); for (String string : strings) { for (int i = 0; i < size / 3; i++) { list.add(string); } } if (list.size() < size) { for (int i = list.size(); i < size; i++) { list.add(strings[i % strings.length]); } } Collections.shuffle(list, RANDOM); return list; }
/** * Create a Collection containing the given size of the given strings. The order of strings in the collection is * random. * * @param size The size of the collection to create. * @param strings The strings to use to fill the collection. * * @return A Collection containing the given number of strings taken from the strings. * * @throws IllegalArgumentException If size is less than 0 or if strings doesn't contains at least one String. */
Create a Collection containing the given size of the given strings. The order of strings in the collection is random
newRandomStringList
{ "repo_name": "wichtounet/benchmark-utils", "path": "src/com/wicht/benchmark/utils/BenchUtils.java", "license": "apache-2.0", "size": 3075 }
[ "java.util.ArrayList", "java.util.Collection", "java.util.Collections", "java.util.List" ]
import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
119,100
public static void generateExplorerTypesXml( Element startNode, List<CmsExplorerTypeSettings> explorerTypes, boolean module) { // we need the default access node later to check if the explorer type is an individual setting CmsExplorerTypeAccess defaultAccess = null; if (OpenCms.getWorkplaceManager() != null) { defaultAccess = OpenCms.getWorkplaceManager().getDefaultAccess(); } // get the menu rule translator to eliminate eventual legacy menu rules CmsMenuRuleTranslator menuRuleTranslator = new CmsMenuRuleTranslator(); Iterator<CmsExplorerTypeSettings> i = explorerTypes.iterator(); while (i.hasNext()) { // create an explorer type node CmsExplorerTypeSettings settings = i.next(); if (settings.isAddititionalModuleExplorerType() == module) { Element explorerTypeElement = startNode.addElement(N_EXPLORERTYPE); explorerTypeElement.addAttribute(A_NAME, settings.getName()); explorerTypeElement.addAttribute(A_KEY, settings.getKey()); String originalIcon = settings.getOriginalIcon(); if (CmsStringUtil.isNotEmpty(originalIcon)) { explorerTypeElement.addAttribute(A_ICON, settings.getOriginalIcon()); } if (CmsStringUtil.isNotEmpty(settings.getBigIcon())) { explorerTypeElement.addAttribute(A_BIGICON, settings.getBigIcon()); } if (settings.getReference() != null) { explorerTypeElement.addAttribute(A_REFERENCE, settings.getReference()); } if (settings.getElementView() != null) { explorerTypeElement.addAttribute(A_ELEMENTVIEW, settings.getElementView()); } if (settings.isView()) { explorerTypeElement.addAttribute(A_ISVIEW, "true"); } if (settings.getNamePattern() != null) { explorerTypeElement.addAttribute(A_NAME_PATTERN, settings.getNamePattern()); } if (settings.getViewOrder(false) != null) { explorerTypeElement.addAttribute(A_VIEW_ORDER, "" + settings.getViewOrder(false)); } // create subnode <newresource> Element newResElement = explorerTypeElement.addElement(N_NEWRESOURCE); if (CmsStringUtil.isNotEmpty(settings.getNewResourcePage())) { newResElement.addAttribute(A_PAGE, settings.getNewResourcePage()); } newResElement.addAttribute(A_HANDLER, settings.getNewResourceHandlerClassName()); newResElement.addAttribute(A_URI, CmsEncoder.escapeXml(settings.getNewResourceUri())); newResElement.addAttribute(A_ORDER, settings.getNewResourceOrder()); newResElement.addAttribute(A_AUTOSETNAVIGATION, String.valueOf(settings.isAutoSetNavigation())); newResElement.addAttribute(A_AUTOSETTITLE, String.valueOf(settings.isAutoSetTitle())); newResElement.addAttribute(A_INFO, settings.getInfo()); newResElement.addAttribute(A_ICON, settings.getDescriptionImage()); newResElement.addAttribute(A_KEY, settings.getTitleKey()); // create subnode <accesscontrol> CmsExplorerTypeAccess access = settings.getAccess(); if (access != defaultAccess) { // don't output the node if this is in fact the default access settings List<String> accessEntries = new ArrayList<String>(access.getAccessEntries().keySet()); // sort accessEntries Collections.sort(accessEntries); if (accessEntries.size() > 0) { Element accessControlElement = explorerTypeElement.addElement(N_ACCESSCONTROL); Iterator<String> k = accessEntries.iterator(); while (k.hasNext()) { String key = k.next(); String value = settings.getAccess().getAccessEntries().get(key); Element accessEntryElement = accessControlElement.addElement(N_ACCESSENTRY); accessEntryElement.addAttribute(A_PRINCIPAL, key); accessEntryElement.addAttribute(A_PERMISSIONS, value); } } } // create subnode <editoptions> if (settings.hasEditOptions()) { Element editOptionsElement = explorerTypeElement.addElement(N_EDITOPTIONS); Element defaultPropertiesElement = editOptionsElement.addElement(N_DEFAULTPROPERTIES); defaultPropertiesElement.addAttribute(A_ENABLED, String.valueOf(settings.isPropertiesEnabled())); defaultPropertiesElement.addAttribute( A_SHOWNAVIGATION, String.valueOf(settings.isShowNavigation())); Iterator<String> m = settings.getProperties().iterator(); while (m.hasNext()) { defaultPropertiesElement.addElement(N_DEFAULTPROPERTY).addAttribute(A_NAME, m.next()); } Element contextMenuElement = editOptionsElement.addElement(N_CONTEXTMENU); Iterator<CmsExplorerContextMenuItem> contextMenuEntries = settings.getContextMenuEntries().iterator(); while (contextMenuEntries.hasNext()) { CmsExplorerContextMenuItem item = contextMenuEntries.next(); generateContextMenuItemXml(contextMenuElement, menuRuleTranslator, item); } } Map<String, CmsIconRule> iconRules = settings.getIconRules(); if ((iconRules != null) && !iconRules.isEmpty()) { Element iconRulesElem = explorerTypeElement.addElement(N_ICONRULES); for (Map.Entry<String, CmsIconRule> entry : iconRules.entrySet()) { CmsIconRule rule = entry.getValue(); Element ruleElem = iconRulesElem.addElement(N_ICONRULE); String icon = rule.getIcon(); String bigIcon = rule.getBigIcon(); String extension = rule.getExtension(); ruleElem.addAttribute(A_EXTENSION, extension); ruleElem.addAttribute(A_ICON, icon); if (bigIcon != null) { ruleElem.addAttribute(A_BIGICON, bigIcon); } } } } } }
static void function( Element startNode, List<CmsExplorerTypeSettings> explorerTypes, boolean module) { CmsExplorerTypeAccess defaultAccess = null; if (OpenCms.getWorkplaceManager() != null) { defaultAccess = OpenCms.getWorkplaceManager().getDefaultAccess(); } CmsMenuRuleTranslator menuRuleTranslator = new CmsMenuRuleTranslator(); Iterator<CmsExplorerTypeSettings> i = explorerTypes.iterator(); while (i.hasNext()) { CmsExplorerTypeSettings settings = i.next(); if (settings.isAddititionalModuleExplorerType() == module) { Element explorerTypeElement = startNode.addElement(N_EXPLORERTYPE); explorerTypeElement.addAttribute(A_NAME, settings.getName()); explorerTypeElement.addAttribute(A_KEY, settings.getKey()); String originalIcon = settings.getOriginalIcon(); if (CmsStringUtil.isNotEmpty(originalIcon)) { explorerTypeElement.addAttribute(A_ICON, settings.getOriginalIcon()); } if (CmsStringUtil.isNotEmpty(settings.getBigIcon())) { explorerTypeElement.addAttribute(A_BIGICON, settings.getBigIcon()); } if (settings.getReference() != null) { explorerTypeElement.addAttribute(A_REFERENCE, settings.getReference()); } if (settings.getElementView() != null) { explorerTypeElement.addAttribute(A_ELEMENTVIEW, settings.getElementView()); } if (settings.isView()) { explorerTypeElement.addAttribute(A_ISVIEW, "true"); } if (settings.getNamePattern() != null) { explorerTypeElement.addAttribute(A_NAME_PATTERN, settings.getNamePattern()); } if (settings.getViewOrder(false) != null) { explorerTypeElement.addAttribute(A_VIEW_ORDER, "" + settings.getViewOrder(false)); } Element newResElement = explorerTypeElement.addElement(N_NEWRESOURCE); if (CmsStringUtil.isNotEmpty(settings.getNewResourcePage())) { newResElement.addAttribute(A_PAGE, settings.getNewResourcePage()); } newResElement.addAttribute(A_HANDLER, settings.getNewResourceHandlerClassName()); newResElement.addAttribute(A_URI, CmsEncoder.escapeXml(settings.getNewResourceUri())); newResElement.addAttribute(A_ORDER, settings.getNewResourceOrder()); newResElement.addAttribute(A_AUTOSETNAVIGATION, String.valueOf(settings.isAutoSetNavigation())); newResElement.addAttribute(A_AUTOSETTITLE, String.valueOf(settings.isAutoSetTitle())); newResElement.addAttribute(A_INFO, settings.getInfo()); newResElement.addAttribute(A_ICON, settings.getDescriptionImage()); newResElement.addAttribute(A_KEY, settings.getTitleKey()); CmsExplorerTypeAccess access = settings.getAccess(); if (access != defaultAccess) { List<String> accessEntries = new ArrayList<String>(access.getAccessEntries().keySet()); Collections.sort(accessEntries); if (accessEntries.size() > 0) { Element accessControlElement = explorerTypeElement.addElement(N_ACCESSCONTROL); Iterator<String> k = accessEntries.iterator(); while (k.hasNext()) { String key = k.next(); String value = settings.getAccess().getAccessEntries().get(key); Element accessEntryElement = accessControlElement.addElement(N_ACCESSENTRY); accessEntryElement.addAttribute(A_PRINCIPAL, key); accessEntryElement.addAttribute(A_PERMISSIONS, value); } } } if (settings.hasEditOptions()) { Element editOptionsElement = explorerTypeElement.addElement(N_EDITOPTIONS); Element defaultPropertiesElement = editOptionsElement.addElement(N_DEFAULTPROPERTIES); defaultPropertiesElement.addAttribute(A_ENABLED, String.valueOf(settings.isPropertiesEnabled())); defaultPropertiesElement.addAttribute( A_SHOWNAVIGATION, String.valueOf(settings.isShowNavigation())); Iterator<String> m = settings.getProperties().iterator(); while (m.hasNext()) { defaultPropertiesElement.addElement(N_DEFAULTPROPERTY).addAttribute(A_NAME, m.next()); } Element contextMenuElement = editOptionsElement.addElement(N_CONTEXTMENU); Iterator<CmsExplorerContextMenuItem> contextMenuEntries = settings.getContextMenuEntries().iterator(); while (contextMenuEntries.hasNext()) { CmsExplorerContextMenuItem item = contextMenuEntries.next(); generateContextMenuItemXml(contextMenuElement, menuRuleTranslator, item); } } Map<String, CmsIconRule> iconRules = settings.getIconRules(); if ((iconRules != null) && !iconRules.isEmpty()) { Element iconRulesElem = explorerTypeElement.addElement(N_ICONRULES); for (Map.Entry<String, CmsIconRule> entry : iconRules.entrySet()) { CmsIconRule rule = entry.getValue(); Element ruleElem = iconRulesElem.addElement(N_ICONRULE); String icon = rule.getIcon(); String bigIcon = rule.getBigIcon(); String extension = rule.getExtension(); ruleElem.addAttribute(A_EXTENSION, extension); ruleElem.addAttribute(A_ICON, icon); if (bigIcon != null) { ruleElem.addAttribute(A_BIGICON, bigIcon); } } } } } }
/** * Creates the xml output for explorer type nodes.<p> * * @param startNode the startnode to add all rescource types to * @param explorerTypes the list of explorer types * @param module true if the XML tree for the module config should be generated, false otherwise */
Creates the xml output for explorer type nodes
generateExplorerTypesXml
{ "repo_name": "ggiudetti/opencms-core", "path": "src/org/opencms/configuration/CmsWorkplaceConfiguration.java", "license": "lgpl-2.1", "size": 83465 }
[ "java.util.ArrayList", "java.util.Collections", "java.util.Iterator", "java.util.List", "java.util.Map", "org.dom4j.Element", "org.opencms.i18n.CmsEncoder", "org.opencms.main.OpenCms", "org.opencms.util.CmsStringUtil", "org.opencms.workplace.explorer.CmsExplorerContextMenuItem", "org.opencms.workplace.explorer.CmsExplorerTypeAccess", "org.opencms.workplace.explorer.CmsExplorerTypeSettings", "org.opencms.workplace.explorer.CmsIconRule", "org.opencms.workplace.explorer.menu.CmsMenuRuleTranslator" ]
import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Map; import org.dom4j.Element; import org.opencms.i18n.CmsEncoder; import org.opencms.main.OpenCms; import org.opencms.util.CmsStringUtil; import org.opencms.workplace.explorer.CmsExplorerContextMenuItem; import org.opencms.workplace.explorer.CmsExplorerTypeAccess; import org.opencms.workplace.explorer.CmsExplorerTypeSettings; import org.opencms.workplace.explorer.CmsIconRule; import org.opencms.workplace.explorer.menu.CmsMenuRuleTranslator;
import java.util.*; import org.dom4j.*; import org.opencms.i18n.*; import org.opencms.main.*; import org.opencms.util.*; import org.opencms.workplace.explorer.*; import org.opencms.workplace.explorer.menu.*;
[ "java.util", "org.dom4j", "org.opencms.i18n", "org.opencms.main", "org.opencms.util", "org.opencms.workplace" ]
java.util; org.dom4j; org.opencms.i18n; org.opencms.main; org.opencms.util; org.opencms.workplace;
2,168,393
public static String toString(Node node) { Buffer buf = new Buffer(4); node.modelRepr(buf); return buf.toString(); }
static String function(Node node) { Buffer buf = new Buffer(4); node.modelRepr(buf); return buf.toString(); }
/** * Return a string representation of a node. */
Return a string representation of a node
toString
{ "repo_name": "Squarespace/less-compiler", "path": "src/main/java/com/squarespace/less/model/ModelUtils.java", "license": "apache-2.0", "size": 1408 }
[ "com.squarespace.less.core.Buffer" ]
import com.squarespace.less.core.Buffer;
import com.squarespace.less.core.*;
[ "com.squarespace.less" ]
com.squarespace.less;
1,625,384
public Parameter createEntryPoint() { Parameter param = new Parameter(); entryPointParams.add(param); return param; } /** * Converts {@code <define/>} nested elements into Compiler {@code @define}
Parameter function() { Parameter param = new Parameter(); entryPointParams.add(param); return param; } /** * Converts {@code <define/>} nested elements into Compiler {@code @define}
/** * Creates a new {@code <entrypoint/>} nested element. Supports name * attribute. */
Creates a new nested element. Supports name attribute
createEntryPoint
{ "repo_name": "robbert/closure-compiler", "path": "src/com/google/javascript/jscomp/ant/CompileTask.java", "license": "apache-2.0", "size": 22384 }
[ "com.google.javascript.jscomp.Compiler", "org.apache.tools.ant.types.Parameter" ]
import com.google.javascript.jscomp.Compiler; import org.apache.tools.ant.types.Parameter;
import com.google.javascript.jscomp.*; import org.apache.tools.ant.types.*;
[ "com.google.javascript", "org.apache.tools" ]
com.google.javascript; org.apache.tools;
2,492,125
public void setArray(E[] array){ Validate.notNull(array, "The array must not be null."); _array = array; }
void function(E[] array){ Validate.notNull(array, STR); _array = array; }
/** * Set this wrapper to wrap a new array instance. * @param array The new wrapped array. */
Set this wrapper to wrap a new array instance
setArray
{ "repo_name": "JohnnPM/PartyLobby", "path": "src/net/amoebaman/util/ArrayWrapper.java", "license": "gpl-2.0", "size": 2841 }
[ "org.apache.commons.lang.Validate" ]
import org.apache.commons.lang.Validate;
import org.apache.commons.lang.*;
[ "org.apache.commons" ]
org.apache.commons;
568,370
EAttribute getReadingType_DefaultValueDataType();
EAttribute getReadingType_DefaultValueDataType();
/** * Returns the meta object for the attribute '{@link CIM.IEC61968.Metering.ReadingType#getDefaultValueDataType <em>Default Value Data Type</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Default Value Data Type</em>'. * @see CIM.IEC61968.Metering.ReadingType#getDefaultValueDataType() * @see #getReadingType() * @generated */
Returns the meta object for the attribute '<code>CIM.IEC61968.Metering.ReadingType#getDefaultValueDataType Default Value Data Type</code>'.
getReadingType_DefaultValueDataType
{ "repo_name": "georghinkel/ttc2017smartGrids", "path": "solutions/ModelJoin/src/main/java/CIM/IEC61968/Metering/MeteringPackage.java", "license": "mit", "size": 264485 }
[ "org.eclipse.emf.ecore.EAttribute" ]
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
660,791
public void setModifiedDate(Date modifiedDate);
void function(Date modifiedDate);
/** * Sets the modified date of this template file. * * @param modifiedDate the modified date of this template file */
Sets the modified date of this template file
setModifiedDate
{ "repo_name": "hltn/opencps", "path": "portlets/opencps-portlet/docroot/WEB-INF/service/org/opencps/servicemgt/model/TemplateFileModel.java", "license": "agpl-3.0", "size": 6637 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
682,544
@Nonnull public TeamworkRequest select(@Nonnull final String value) { addSelectOption(value); return this; }
TeamworkRequest function(@Nonnull final String value) { addSelectOption(value); return this; }
/** * Sets the select clause for the request * * @param value the select clause * @return the updated request */
Sets the select clause for the request
select
{ "repo_name": "microsoftgraph/msgraph-sdk-java", "path": "src/main/java/com/microsoft/graph/requests/TeamworkRequest.java", "license": "mit", "size": 5705 }
[ "javax.annotation.Nonnull" ]
import javax.annotation.Nonnull;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
1,350,717
public ParameterList getQueryStringParams() { try { final ParameterList result = new ParameterList(); final String queryString = new URL(url).getQuery(); result.addQuerystring(queryString); result.addAll(querystringParams); return result; } catch (MalformedURLException mue) { throw new OAuthException("Malformed URL", mue); } }
ParameterList function() { try { final ParameterList result = new ParameterList(); final String queryString = new URL(url).getQuery(); result.addQuerystring(queryString); result.addAll(querystringParams); return result; } catch (MalformedURLException mue) { throw new OAuthException(STR, mue); } }
/** * Get a {@link ParameterList} with the query string parameters. * * @return a {@link ParameterList} containing the query string parameters. * @throws OAuthException if the request URL is not valid. */
Get a <code>ParameterList</code> with the query string parameters
getQueryStringParams
{ "repo_name": "chooco13/scribejava", "path": "scribejava-core/src/main/java/com/github/scribejava/core/model/AbstractRequest.java", "license": "mit", "size": 8838 }
[ "com.github.scribejava.core.exceptions.OAuthException", "java.net.MalformedURLException" ]
import com.github.scribejava.core.exceptions.OAuthException; import java.net.MalformedURLException;
import com.github.scribejava.core.exceptions.*; import java.net.*;
[ "com.github.scribejava", "java.net" ]
com.github.scribejava; java.net;
737,817
public void setDoubleClickSpeed(int speed) { setValue(Property.DOUBLE_CLICK_SPEED, Checker.positiveOrZero(speed)); }
void function(int speed) { setValue(Property.DOUBLE_CLICK_SPEED, Checker.positiveOrZero(speed)); }
/** * Sets the double-click speed in milliseconds used to distinguish single-clicks from double-clicks whenever you need to capture both. * * @param speed the double-click speed in milliseconds */
Sets the double-click speed in milliseconds used to distinguish single-clicks from double-clicks whenever you need to capture both
setDoubleClickSpeed
{ "repo_name": "pepstock-org/Charba", "path": "src/org/pepstock/charba/client/annotation/AnnotationOptions.java", "license": "apache-2.0", "size": 9591 }
[ "org.pepstock.charba.client.commons.Checker" ]
import org.pepstock.charba.client.commons.Checker;
import org.pepstock.charba.client.commons.*;
[ "org.pepstock.charba" ]
org.pepstock.charba;
1,971,473
public void registerInput(String varName, MLMatrix df) throws DMLRuntimeException { registerInput(varName, MLMatrix.getRDDLazily(df), df.mc); }
void function(String varName, MLMatrix df) throws DMLRuntimeException { registerInput(varName, MLMatrix.getRDDLazily(df), df.mc); }
/** * Experimental API. Not supported in Python MLContext API. * @param varName * @param df * @throws DMLRuntimeException */
Experimental API. Not supported in Python MLContext API
registerInput
{ "repo_name": "Wenpei/incubator-systemml", "path": "src/main/java/org/apache/sysml/api/MLContext.java", "license": "apache-2.0", "size": 58727 }
[ "org.apache.sysml.runtime.DMLRuntimeException" ]
import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.*;
[ "org.apache.sysml" ]
org.apache.sysml;
1,290,795
public void setIcon(Drawable icon) { this.icon = icon; }
void function(Drawable icon) { this.icon = icon; }
/** * Set action icon * * @param icon {@link Drawable} action icon */
Set action icon
setIcon
{ "repo_name": "djcoin/svn2git_gvsig_mini", "path": "src/es/prodevelop/gvsig/mini/util/ActionItem.java", "license": "gpl-2.0", "size": 1490 }
[ "android.graphics.drawable.Drawable" ]
import android.graphics.drawable.Drawable;
import android.graphics.drawable.*;
[ "android.graphics" ]
android.graphics;
2,129,553
@Nonnull public static <E> ObservableSet<E> uiThreadAwareObservableSet(@Nonnull ObservableSet<E> source) { requireNonNull(source, ERROR_SOURCE_NULL); return source instanceof UIThreadAware ? source : new UIThreadAwareObservableSet<>(source); } private static class UIThreadAwareObservableSet<E> extends DelegatingObservableSet<E> implements UIThreadAware { protected UIThreadAwareObservableSet(ObservableSet<E> delegate) { super(delegate); }
static <E> ObservableSet<E> function(@Nonnull ObservableSet<E> source) { requireNonNull(source, ERROR_SOURCE_NULL); return source instanceof UIThreadAware ? source : new UIThreadAwareObservableSet<>(source); } private static class UIThreadAwareObservableSet<E> extends DelegatingObservableSet<E> implements UIThreadAware { protected UIThreadAwareObservableSet(ObservableSet<E> delegate) { super(delegate); }
/** * Wraps an <tt>ObservableSet</tt>, publishing updates inside the UI thread. * * @param source the <tt>ObservableSet</tt> to be wrapped * @param <E> the set's parameter type. * * @return a new <tt>ObservableSet</tt> */
Wraps an ObservableSet, publishing updates inside the UI thread
uiThreadAwareObservableSet
{ "repo_name": "griffon/griffon", "path": "subprojects/griffon-javafx/src/main/java/griffon/javafx/collections/GriffonFXCollections.java", "license": "apache-2.0", "size": 5206 }
[ "java.util.Objects" ]
import java.util.Objects;
import java.util.*;
[ "java.util" ]
java.util;
2,059,870
Log.d("mylog","JavascriptHandler.handlerToast is called : " + val); this.parentActivity.activityToast(val); }
Log.d("mylog",STR + val); this.parentActivity.activityToast(val); }
/** Method called by android.js, which simply passes the string to the {@link MainActivity#activityToast(String) activityToast} method to be toasted. * * @param val A string to be passed onto the {@link MainActivity MainActivity} to be toasted. */
Method called by android.js, which simply passes the string to the <code>MainActivity#activityToast(String) activityToast</code> method to be toasted
handlerToast
{ "repo_name": "GrayGwizdz/droidstrap", "path": "src/com/gray/gwizdz/example/droidstrap/JavascriptHandler.java", "license": "apache-2.0", "size": 1535 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
996,461
@ApiModelProperty(example = "null", required = true, value = "Was the war declared mutual by both parties") public Boolean getMutual() { return mutual; }
@ApiModelProperty(example = "null", required = true, value = STR) Boolean function() { return mutual; }
/** * Was the war declared mutual by both parties * @return mutual **/
Was the war declared mutual by both parties
getMutual
{ "repo_name": "Tmin10/EVE-Security-Service", "path": "server-api/src/main/java/ru/tmin10/EVESecurityService/serverApi/model/GetWarsWarIdOk.java", "license": "gpl-3.0", "size": 8579 }
[ "io.swagger.annotations.ApiModelProperty" ]
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.*;
[ "io.swagger.annotations" ]
io.swagger.annotations;
2,588,921
public Builder compoundingMethod(CompoundingMethod compoundingMethod) { this.compoundingMethod = compoundingMethod; return this; }
Builder function(CompoundingMethod compoundingMethod) { this.compoundingMethod = compoundingMethod; return this; }
/** * Sets the compounding method to use when there is more than one accrual period * in each payment period, optional with defaulting getter. * <p> * Compounding is used when combining accrual periods. * <p> * This will default to 'None' if not specified. * @param compoundingMethod the new value * @return this, for chaining, not null */
Sets the compounding method to use when there is more than one accrual period in each payment period, optional with defaulting getter. Compounding is used when combining accrual periods. This will default to 'None' if not specified
compoundingMethod
{ "repo_name": "nssales/Strata", "path": "modules/finance/src/main/java/com/opengamma/strata/finance/rate/swap/type/IborRateSwapLegConvention.java", "license": "apache-2.0", "size": 58626 }
[ "com.opengamma.strata.finance.rate.swap.CompoundingMethod" ]
import com.opengamma.strata.finance.rate.swap.CompoundingMethod;
import com.opengamma.strata.finance.rate.swap.*;
[ "com.opengamma.strata" ]
com.opengamma.strata;
1,749,230
@CheckReturnValue Stream<RelationType> relationTypes();
Stream<RelationType> relationTypes();
/** * Returns the RelationTypes that this Role takes part in. * @see RelationType * * @return The RelationTypes which this role takes part in. */
Returns the RelationTypes that this Role takes part in
relationTypes
{ "repo_name": "sheldonkhall/grakn", "path": "grakn-core/src/main/java/ai/grakn/concept/Role.java", "license": "gpl-3.0", "size": 3013 }
[ "java.util.stream.Stream" ]
import java.util.stream.Stream;
import java.util.stream.*;
[ "java.util" ]
java.util;
1,134,719
@Test public void testEmpty1() { setMethod(M_EMPTY); assertTrue(getPosition(), empty(null)); }
void function() { setMethod(M_EMPTY); assertTrue(getPosition(), empty(null)); }
/** * Validator.empty: true */
Validator.empty: true
testEmpty1
{ "repo_name": "silentbalanceyh/lyra", "path": "lyra-bus/util-comet/src/test/java/com/test/lyra/util/internal/Validator1TestCase.java", "license": "gpl-3.0", "size": 2067 }
[ "com.lyra.util.internal.Validator", "org.junit.Assert" ]
import com.lyra.util.internal.Validator; import org.junit.Assert;
import com.lyra.util.internal.*; import org.junit.*;
[ "com.lyra.util", "org.junit" ]
com.lyra.util; org.junit;
1,810,211
public Map<String,Float> getParameters() { return parameters; }
Map<String,Float> function() { return parameters; }
/** * Returns an unmodifiable view of the parameters. * * @return the parameters */
Returns an unmodifiable view of the parameters
getParameters
{ "repo_name": "jnhankins/JavaFlameFractals", "path": "JFF/src/com/jnhankins/jff/flame/VariationDefinition.java", "license": "mit", "size": 55446 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,614,352
public void setCookies(Cookie[] cookies) { this.cookies = cookies; }
void function(Cookie[] cookies) { this.cookies = cookies; }
/** Sets the cookies. * * @param cookies * the new cookies */
Sets the cookies
setCookies
{ "repo_name": "alarulrajan/CodeFest", "path": "test/com/technoetic/xplanner/XPlannerTestSupport.java", "license": "gpl-2.0", "size": 25627 }
[ "javax.servlet.http.Cookie" ]
import javax.servlet.http.Cookie;
import javax.servlet.http.*;
[ "javax.servlet" ]
javax.servlet;
9,622
@Test void propertyNameIsTranslationKey() throws Exception { this.config.getQuery().getProperties().add("releaseDate"); this.defaultConfig.getQuery().getSource().setParameter("translationPrefix", "release.livetable."); LiveDataPropertyDescriptor propertyDescriptorReleaseDate = new LiveDataPropertyDescriptor(); propertyDescriptorReleaseDate.setId("releaseDate"); propertyDescriptorReleaseDate.setName("Release Date"); when(((LiveDataPropertyDescriptorStore) this.propertyStore).get()) .thenReturn(singletonList(propertyDescriptorReleaseDate)); when(this.l10n.getTranslationPlain("release.livetable.releaseDate")).thenReturn("Released On"); LiveDataConfiguration actualConfig = this.resolver.resolve(this.config); assertEquals("[{\"id\":\"releaseDate\",\"name\":\"Released On\"}]", this.objectMapper.writeValueAsString(actualConfig.getMeta().getPropertyDescriptors())); }
void propertyNameIsTranslationKey() throws Exception { this.config.getQuery().getProperties().add(STR); this.defaultConfig.getQuery().getSource().setParameter(STR, STR); LiveDataPropertyDescriptor propertyDescriptorReleaseDate = new LiveDataPropertyDescriptor(); propertyDescriptorReleaseDate.setId(STR); propertyDescriptorReleaseDate.setName(STR); when(((LiveDataPropertyDescriptorStore) this.propertyStore).get()) .thenReturn(singletonList(propertyDescriptorReleaseDate)); when(this.l10n.getTranslationPlain(STR)).thenReturn(STR); LiveDataConfiguration actualConfig = this.resolver.resolve(this.config); assertEquals("[{\"id\":\"releaseDate\",\"name\":\"Released On\"}]", this.objectMapper.writeValueAsString(actualConfig.getMeta().getPropertyDescriptors())); }
/** * This test asserts that the translation is used for the name of a property, even if the property has a defined * pretty name. */
This test asserts that the translation is used for the name of a property, even if the property has a defined pretty name
propertyNameIsTranslationKey
{ "repo_name": "xwiki/xwiki-platform", "path": "xwiki-platform-core/xwiki-platform-livedata/xwiki-platform-livedata-livetable/src/test/java/org/xwiki/livedata/internal/livetable/DefaultLiveDataConfigurationResolverTest.java", "license": "lgpl-2.1", "size": 12742 }
[ "org.junit.jupiter.api.Assertions", "org.mockito.Mockito", "org.xwiki.livedata.LiveDataConfiguration", "org.xwiki.livedata.LiveDataPropertyDescriptor", "org.xwiki.livedata.LiveDataPropertyDescriptorStore" ]
import org.junit.jupiter.api.Assertions; import org.mockito.Mockito; import org.xwiki.livedata.LiveDataConfiguration; import org.xwiki.livedata.LiveDataPropertyDescriptor; import org.xwiki.livedata.LiveDataPropertyDescriptorStore;
import org.junit.jupiter.api.*; import org.mockito.*; import org.xwiki.livedata.*;
[ "org.junit.jupiter", "org.mockito", "org.xwiki.livedata" ]
org.junit.jupiter; org.mockito; org.xwiki.livedata;
592,385
public void setExcludedTaskNames(Iterable<String> excludedTaskNames) { this.excludedTaskNames = Sets.newLinkedHashSet(excludedTaskNames); }
void function(Iterable<String> excludedTaskNames) { this.excludedTaskNames = Sets.newLinkedHashSet(excludedTaskNames); }
/** * Sets the tasks to exclude from this build. * * @param excludedTaskNames The task names. */
Sets the tasks to exclude from this build
setExcludedTaskNames
{ "repo_name": "robinverduijn/gradle", "path": "subprojects/core-api/src/main/java/org/gradle/StartParameter.java", "license": "apache-2.0", "size": 27616 }
[ "com.google.common.collect.Sets" ]
import com.google.common.collect.Sets;
import com.google.common.collect.*;
[ "com.google.common" ]
com.google.common;
2,012,864
ServiceCall<Void> post307Async(Boolean booleanValue, final ServiceCallback<Void> serviceCallback) throws IllegalArgumentException;
ServiceCall<Void> post307Async(Boolean booleanValue, final ServiceCallback<Void> serviceCallback) throws IllegalArgumentException;
/** * Post redirected with 307, resulting in a 200 after redirect. * * @param booleanValue Simple boolean value true * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link ServiceCall} object */
Post redirected with 307, resulting in a 200 after redirect
post307Async
{ "repo_name": "yaqiyang/autorest", "path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/http/HttpRedirects.java", "license": "mit", "size": 22215 }
[ "com.microsoft.rest.ServiceCall", "com.microsoft.rest.ServiceCallback" ]
import com.microsoft.rest.ServiceCall; import com.microsoft.rest.ServiceCallback;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
110,816
public static void setTranslationX(View view, float value) { IMPL.setTranslationX(view, value); }
static void function(View view, float value) { IMPL.setTranslationX(view, value); }
/** * Sets the horizontal location of this view relative to its left position. * This effectively positions the object post-layout, in addition to wherever the object's * layout placed it. * * <p>Prior to API 11 this will have no effect.</p> * * @param value The horizontal position of this view relative to its left position, * in pixels. */
Sets the horizontal location of this view relative to its left position. This effectively positions the object post-layout, in addition to wherever the object's layout placed it. Prior to API 11 this will have no effect
setTranslationX
{ "repo_name": "madhavanks26/com.vliesaputra.deviceinformation", "path": "src/com/vliesaputra/cordova/plugins/android/support/v4/src/java/android/support/v4/view/ViewCompat.java", "license": "mit", "size": 127830 }
[ "android.view.View" ]
import android.view.View;
import android.view.*;
[ "android.view" ]
android.view;
757,727
public boolean setStringValue( Object item, Object element, String key, String newValue ) throws SemanticException { if ( key.equals( SortKey.KEY_MEMBER ) ) { String value = DEUtil.getExpression( getResultSetColumn( newValue ) ); if ( value != null ) newValue = value; } String saveValue = newValue; StructureHandle handle = (StructureHandle) element; if ( key.equals( SortKey.DIRECTION_MEMBER ) ) { IChoice choice = choiceSetDirection.findChoiceByDisplayName( newValue ); if ( choice == null ) saveValue = null; else saveValue = choice.getName( ); } handle.getMember( key ).setStringValue( saveValue ); return true; }
boolean function( Object item, Object element, String key, String newValue ) throws SemanticException { if ( key.equals( SortKey.KEY_MEMBER ) ) { String value = DEUtil.getExpression( getResultSetColumn( newValue ) ); if ( value != null ) newValue = value; } String saveValue = newValue; StructureHandle handle = (StructureHandle) element; if ( key.equals( SortKey.DIRECTION_MEMBER ) ) { IChoice choice = choiceSetDirection.findChoiceByDisplayName( newValue ); if ( choice == null ) saveValue = null; else saveValue = choice.getName( ); } handle.getMember( key ).setStringValue( saveValue ); return true; }
/** * Saves new property value to sort * * @param element * DesignElementHandle object. * @param element * Sort object * @param key * Property key * @param newValue * new value * @return * @throws SemanticException * @throws NameException */
Saves new property value to sort
setStringValue
{ "repo_name": "Charling-Huang/birt", "path": "UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/views/attributes/providers/SortingModelProvider.java", "license": "epl-1.0", "size": 10597 }
[ "org.eclipse.birt.report.designer.util.DEUtil", "org.eclipse.birt.report.model.api.StructureHandle", "org.eclipse.birt.report.model.api.activity.SemanticException", "org.eclipse.birt.report.model.api.elements.structures.SortKey", "org.eclipse.birt.report.model.api.metadata.IChoice" ]
import org.eclipse.birt.report.designer.util.DEUtil; import org.eclipse.birt.report.model.api.StructureHandle; import org.eclipse.birt.report.model.api.activity.SemanticException; import org.eclipse.birt.report.model.api.elements.structures.SortKey; import org.eclipse.birt.report.model.api.metadata.IChoice;
import org.eclipse.birt.report.designer.util.*; import org.eclipse.birt.report.model.api.*; import org.eclipse.birt.report.model.api.activity.*; import org.eclipse.birt.report.model.api.elements.structures.*; import org.eclipse.birt.report.model.api.metadata.*;
[ "org.eclipse.birt" ]
org.eclipse.birt;
931,447
public ConnectionFactoryBuilder setTranscoder(Transcoder<Object> t) { transcoder = t; return this; }
ConnectionFactoryBuilder function(Transcoder<Object> t) { transcoder = t; return this; }
/** * Set the default transcoder. */
Set the default transcoder
setTranscoder
{ "repo_name": "couchbase/spymemcached", "path": "src/main/java/net/spy/memcached/ConnectionFactoryBuilder.java", "license": "mit", "size": 13625 }
[ "net.spy.memcached.transcoders.Transcoder" ]
import net.spy.memcached.transcoders.Transcoder;
import net.spy.memcached.transcoders.*;
[ "net.spy.memcached" ]
net.spy.memcached;
2,435,639
public void setRestrictedUserAgents(Pattern[] restrictedUserAgents) { this.restrictedUserAgents = restrictedUserAgents; }
void function(Pattern[] restrictedUserAgents) { this.restrictedUserAgents = restrictedUserAgents; }
/** * Set restricted user agent list (this method is best when used with * a large number of connectors, where it would be better to have all of * them referenced a single array). */
Set restricted user agent list (this method is best when used with a large number of connectors, where it would be better to have all of them referenced a single array)
setRestrictedUserAgents
{ "repo_name": "plumer/codana", "path": "tomcat_files/6.0.0/Http11NioProcessor.java", "license": "mit", "size": 54880 }
[ "java.util.regex.Pattern" ]
import java.util.regex.Pattern;
import java.util.regex.*;
[ "java.util" ]
java.util;
2,368,240
public long updateAuxiliary(RelationshipAttribute relationshipAttribute);
long function(RelationshipAttribute relationshipAttribute);
/** * Este metodo es encargado de actualizar el valor seleccionado de un helper table * @param relationshipAttribute la relacion */
Este metodo es encargado de actualizar el valor seleccionado de un helper table
updateAuxiliary
{ "repo_name": "MedicalTrends/semantikos", "path": "SemantikosKernelEJB/src/cl/minsal/semantikos/kernel/daos/HelperTableDAO.java", "license": "gpl-3.0", "size": 4660 }
[ "cl.minsal.semantikos.model.relationships.RelationshipAttribute" ]
import cl.minsal.semantikos.model.relationships.RelationshipAttribute;
import cl.minsal.semantikos.model.relationships.*;
[ "cl.minsal.semantikos" ]
cl.minsal.semantikos;
2,249,647
public int writeBulk(int out_ep_address, byte[] data, int size, int timeout, boolean reopenOnTimeout) throws USBException { if (usbDevHandle == 0) { throw new USBException("invalid device handle"); } if (data == null) { throw new USBException("data must not be null"); } if (size <= 0 || size > data.length) { throw new ArrayIndexOutOfBoundsException("invalid size: " + size); } int lenWritten = LibusbJava.usb_bulk_write(usbDevHandle, out_ep_address, data, size, timeout); if (lenWritten < 0) { if (lenWritten == LibusbJava.ERROR_TIMEDOUT) { // try to reopen the device and send the data again if (reopenOnTimeout) { logger.info("try to reopen"); reset(); open(dev_configuration, dev_interface, dev_altinterface); return writeBulk(out_ep_address, data, size, timeout, false); } throw new USBTimeoutException("LibusbJava.usb_bulk_write: " + LibusbJava.usb_strerror()); } throw new USBException("LibusbJava.usb_bulk_write: " + LibusbJava.usb_strerror()); } logger.info("length written: " + lenWritten); if (logger.isLoggable(Level.FINEST)) { StringBuffer sb = new StringBuffer("bulkwrite, ep 0x" + Integer.toHexString(out_ep_address) + ": " + lenWritten + " Bytes sent: "); for (int i = 0; i < lenWritten; i++) { sb.append("0x" + String.format("%1$02X", data[i]) + " "); } logger.info(sb.toString()); } return lenWritten; }
int function(int out_ep_address, byte[] data, int size, int timeout, boolean reopenOnTimeout) throws USBException { if (usbDevHandle == 0) { throw new USBException(STR); } if (data == null) { throw new USBException(STR); } if (size <= 0 size > data.length) { throw new ArrayIndexOutOfBoundsException(STR + size); } int lenWritten = LibusbJava.usb_bulk_write(usbDevHandle, out_ep_address, data, size, timeout); if (lenWritten < 0) { if (lenWritten == LibusbJava.ERROR_TIMEDOUT) { if (reopenOnTimeout) { logger.info(STR); reset(); open(dev_configuration, dev_interface, dev_altinterface); return writeBulk(out_ep_address, data, size, timeout, false); } throw new USBTimeoutException(STR + LibusbJava.usb_strerror()); } throw new USBException(STR + LibusbJava.usb_strerror()); } logger.info(STR + lenWritten); if (logger.isLoggable(Level.FINEST)) { StringBuffer sb = new StringBuffer(STR + Integer.toHexString(out_ep_address) + STR + lenWritten + STR); for (int i = 0; i < lenWritten; i++) { sb.append("0x" + String.format(STR, data[i]) + " "); } logger.info(sb.toString()); } return lenWritten; }
/** * Write data to the device using a bulk transfer.<br> * * @param out_ep_address * endpoint address to write to * @param data * data to write to this endpoint * @param size * size of the data * @param timeout * amount of time in ms the device will try to send the data * until a timeout exception is thrown * @param reopenOnTimeout * if set to true, the device will try to open the connection and * send the data again before a timeout exception is thrown * @return the actual number of bytes written * @throws USBException */
Write data to the device using a bulk transfer
writeBulk
{ "repo_name": "vpereira/golden_unicorn", "path": "ztex/libusbJava-src/ch/ntb/usb/Device.java", "license": "gpl-3.0", "size": 24062 }
[ "java.util.logging.Level" ]
import java.util.logging.Level;
import java.util.logging.*;
[ "java.util" ]
java.util;
761,782
BucketedSort newBucketedSort(BigArrays bigArrays, @Nullable Object missingValue, MultiValueMode sortMode, Nested nested, SortOrder sortOrder, DocValueFormat format, int bucketSize, BucketedSort.ExtraData extra);
BucketedSort newBucketedSort(BigArrays bigArrays, @Nullable Object missingValue, MultiValueMode sortMode, Nested nested, SortOrder sortOrder, DocValueFormat format, int bucketSize, BucketedSort.ExtraData extra);
/** * Build a sort implementation specialized for aggregations. */
Build a sort implementation specialized for aggregations
newBucketedSort
{ "repo_name": "HonzaKral/elasticsearch", "path": "server/src/main/java/org/elasticsearch/index/fielddata/IndexFieldData.java", "license": "apache-2.0", "size": 10867 }
[ "org.elasticsearch.common.Nullable", "org.elasticsearch.common.util.BigArrays", "org.elasticsearch.index.fielddata.IndexFieldData", "org.elasticsearch.search.DocValueFormat", "org.elasticsearch.search.MultiValueMode", "org.elasticsearch.search.sort.BucketedSort", "org.elasticsearch.search.sort.SortOrder" ]
import org.elasticsearch.common.Nullable; import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.MultiValueMode; import org.elasticsearch.search.sort.BucketedSort; import org.elasticsearch.search.sort.SortOrder;
import org.elasticsearch.common.*; import org.elasticsearch.common.util.*; import org.elasticsearch.index.fielddata.*; import org.elasticsearch.search.*; import org.elasticsearch.search.sort.*;
[ "org.elasticsearch.common", "org.elasticsearch.index", "org.elasticsearch.search" ]
org.elasticsearch.common; org.elasticsearch.index; org.elasticsearch.search;
468,036
@PUT @Path("/{ruleId}") @Consumes("application/json") public Response editExistingRule(RuleDTO ruleUpdate, @PathParam("apiKey") String apiKey, @PathParam("ruleId") long ruleId) { // We first have to retrieve the application. We send an error if it is not found. App app = appDAO.get(apiKey); if (app == null) {return Response.status(400).entity("This app doesn't seem to exist").build();} // We get a reference to the rule. We send an error if the reference is null (the rule couldn't be found) Rule rule = appDAO.getRule(app, ruleId); if (rule == null) {return Response.status(400).entity("This rule doesn't seem to exist").build();} // We update the rule with the data in the DTO ruleUpdate.updateEntity(rule); // We tell the client everything's ok return Response.ok().build(); }
@Path(STR) @Consumes(STR) Response function(RuleDTO ruleUpdate, @PathParam(STR) String apiKey, @PathParam(STR) long ruleId) { App app = appDAO.get(apiKey); if (app == null) {return Response.status(400).entity(STR).build();} Rule rule = appDAO.getRule(app, ruleId); if (rule == null) {return Response.status(400).entity(STR).build();} ruleUpdate.updateEntity(rule); return Response.ok().build(); }
/** * Edition of rules * * @param ruleId : the id of the rule to be edited * @param rule : the new data of the rule * @param apiKey : the apiKey of the application that owns the rule * @return will update the specified rule with the provided data */
Edition of rules
editExistingRule
{ "repo_name": "jurporan/Teaching-HEIGVD-AMT-2015-Project", "path": "src/Gary/src/main/java/ch/heigvd/amt/gary/rest/ressources/Rules.java", "license": "mit", "size": 5227 }
[ "ch.heigvd.amt.gary.models.entities.App", "ch.heigvd.amt.gary.models.entities.Rule", "ch.heigvd.amt.gary.rest.dto.RuleDTO", "javax.ws.rs.Consumes", "javax.ws.rs.Path", "javax.ws.rs.PathParam", "javax.ws.rs.core.Response" ]
import ch.heigvd.amt.gary.models.entities.App; import ch.heigvd.amt.gary.models.entities.Rule; import ch.heigvd.amt.gary.rest.dto.RuleDTO; import javax.ws.rs.Consumes; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.core.Response;
import ch.heigvd.amt.gary.models.entities.*; import ch.heigvd.amt.gary.rest.dto.*; import javax.ws.rs.*; import javax.ws.rs.core.*;
[ "ch.heigvd.amt", "javax.ws" ]
ch.heigvd.amt; javax.ws;
2,195,851
public TypedFieldId getFieldIdIfMatches(int id, SchemaPath expectedPath);
TypedFieldId function(int id, SchemaPath expectedPath);
/** * Traverse the object graph and determine whether the provided SchemaPath matches data within the Wrapper. If so, return a TypedFieldId associated with this path. * @return TypedFieldId */
Traverse the object graph and determine whether the provided SchemaPath matches data within the Wrapper. If so, return a TypedFieldId associated with this path
getFieldIdIfMatches
{ "repo_name": "pwong-mapr/incubator-drill", "path": "exec/java-exec/src/main/java/org/apache/drill/exec/record/VectorWrapper.java", "license": "apache-2.0", "size": 1708 }
[ "org.apache.drill.common.expression.SchemaPath" ]
import org.apache.drill.common.expression.SchemaPath;
import org.apache.drill.common.expression.*;
[ "org.apache.drill" ]
org.apache.drill;
488,985
@JsonProperty("from") public Email getFrom() { return this.from; }
@JsonProperty("from") Email function() { return this.from; }
/** * Get the email's from address. * @return the email's from address. */
Get the email's from address
getFrom
{ "repo_name": "pushkyn/sendgrid-java", "path": "src/main/java/com/sendgrid/helpers/mail/Mail.java", "license": "mit", "size": 15678 }
[ "com.fasterxml.jackson.annotation.JsonProperty" ]
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.*;
[ "com.fasterxml.jackson" ]
com.fasterxml.jackson;
169,914
Collection<? extends TimePeriod> getCoversTimePeriod();
Collection<? extends TimePeriod> getCoversTimePeriod();
/** * Gets all property values for the coversTimePeriod property.<p> * * @returns a collection of values for the coversTimePeriod property. */
Gets all property values for the coversTimePeriod property
getCoversTimePeriod
{ "repo_name": "cybershare/elseweb-v2", "path": "harvester/src/main/java/edu/utep/cybershare/elseweb/ontology/PublishedMODISDataset.java", "license": "gpl-2.0", "size": 7822 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
484,697
static protected void assemblyException( AssemblyException exception ) throws AssemblyException { throw exception; }
static void function( AssemblyException exception ) throws AssemblyException { throw exception; }
/** * This method is called when there was an AssemblyException in the creation of the Qi4j application model. * <p> * Override this method to catch valid failures to place into satisfiedBy suites. * </p> * * @param exception the exception thrown. * * @throws org.qi4j.bootstrap.AssemblyException The default implementation of this method will simply re-throw the exception. */
This method is called when there was an AssemblyException in the creation of the Qi4j application model. Override this method to catch valid failures to place into satisfiedBy suites.
assemblyException
{ "repo_name": "joobn72/qi4j-sdk", "path": "core/testsupport/src/main/java/org/qi4j/test/AbstractQi4jScenarioTest.java", "license": "apache-2.0", "size": 4819 }
[ "org.qi4j.bootstrap.AssemblyException" ]
import org.qi4j.bootstrap.AssemblyException;
import org.qi4j.bootstrap.*;
[ "org.qi4j.bootstrap" ]
org.qi4j.bootstrap;
2,141,251
private static void matlabToSvdlibcSparseBinary(File input, File output, boolean transpose) throws IOException { MATRIX_IO_LOGGER.info("Converting from Matlab double values to " + "SVDLIBC float values; possible loss of " + "precision"); BufferedReader br = new BufferedReader(new FileReader(input)); Map<Integer,Integer> colToNonZero = new HashMap<Integer,Integer>(); // read through once to get matrix dimensions int rows = 0, cols = 0, nonZero = 0; for (String line = null; (line = br.readLine()) != null; ) { String[] rowColVal = line.split("\\s+"); int row, col; if (transpose) { row = Integer.parseInt(rowColVal[1]); col = Integer.parseInt(rowColVal[0]); } else { row = Integer.parseInt(rowColVal[0]); col = Integer.parseInt(rowColVal[1]); } if (row > rows) rows = row; if (col > cols) cols = col; ++nonZero; // NOTE: subtract by 1 here because Matlab arrays start at 1, while // SVDLIBC arrays start at 0. Integer colCount = colToNonZero.get(col-1); colToNonZero.put(col-1, (colCount == null) ? 1 : colCount + 1); } br.close(); // Print out the header information DataOutputStream dos = new DataOutputStream( new BufferedOutputStream(new FileOutputStream(output))); dos.writeInt(rows); dos.writeInt(cols); dos.writeInt(nonZero); // Process the entire array in chunks in case the matlab array is too // big to fit into memory. // REMINDER: this should probably be chosen based on the number of rows // and their expected density int chunkSize = 1000; // This keeps track of the last columns printed. We need this outside // the loop to ensure that blank columns at the end of a chunk are still // printed by the next non-zero chunk int lastCol = -1; // lower bound inclusive, upper bound exclusive for (int lowerBound = 0, upperBound = chunkSize ; lowerBound < rows; lowerBound = upperBound, upperBound += chunkSize) { // Once the dimensions and number of non-zero values are known, // reprocess the matrix, storing the rows and values for each column // that are inside the bounds br = new BufferedReader(new FileReader(input)); // for each column, keep track of which in the next index into the // rows array that should be used to store the row index. Also keep // track of the value associated for that row int[] colIndices = new int[cols]; // columns are kept in sorted order SortedMap<Integer,int[]> colToRowIndex = new TreeMap<Integer,int[]>(); SortedMap<Integer,float[]> colToRowValues = new TreeMap<Integer,float[]>(); for (String line = null; (line = br.readLine()) != null; ) { String[] rowColVal = line.split("\\s+"); int row, col; if (transpose) { row = Integer.parseInt(rowColVal[1]) - 1; col = Integer.parseInt(rowColVal[0]) - 1; } else { row = Integer.parseInt(rowColVal[0]) - 1; col = Integer.parseInt(rowColVal[1]) - 1; } // NOTE: SVDLIBC uses floats instead of doubles, which can cause // a loss of precision float val = Double.valueOf(rowColVal[2]).floatValue(); // check that the current column is within the current chunk if (col < lowerBound || col >= upperBound) continue; // get the arrays used to store the non-zero row indices for // this column and the parallel array that stores the // row-index's value int[] rowIndices = colToRowIndex.get(col); float[] rowValues = colToRowValues.get(col); if (rowIndices == null) { rowIndices = new int[colToNonZero.get(col)]; rowValues = new float[colToNonZero.get(col)]; colToRowIndex.put(col,rowIndices); colToRowValues.put(col,rowValues); } // determine what is the current index in the non-zero row array // that can be used to store this row. int curColIndex = colIndices[col]; rowIndices[curColIndex] = row; rowValues[curColIndex] = val; colIndices[col] += 1; } br.close(); // loop through the stored column and row values, printing out for // each column, the number of non zero rows, followed by each row // index and the value. This is the SVDLIBC sparse text format. for (Map.Entry<Integer,int[]> e : colToRowIndex.entrySet()) { int col = e.getKey().intValue(); int[] nonZeroRows = e.getValue(); float[] values = colToRowValues.get(col); if (col != lastCol) { // print any missing columns in case not all the columns // have data for (int i = lastCol + 1; i < col; ++i) dos.writeInt(0); // print the new header int colCount = colToNonZero.get(col); lastCol = col; dos.writeInt(colCount); } for (int i = 0; i < nonZeroRows.length; ++i) { dos.writeInt(nonZeroRows[i]); dos.writeFloat(values[i]); } } } dos.close(); }
static void function(File input, File output, boolean transpose) throws IOException { MATRIX_IO_LOGGER.info(STR + STR + STR); BufferedReader br = new BufferedReader(new FileReader(input)); Map<Integer,Integer> colToNonZero = new HashMap<Integer,Integer>(); int rows = 0, cols = 0, nonZero = 0; for (String line = null; (line = br.readLine()) != null; ) { String[] rowColVal = line.split("\\s+"); int row, col; if (transpose) { row = Integer.parseInt(rowColVal[1]); col = Integer.parseInt(rowColVal[0]); } else { row = Integer.parseInt(rowColVal[0]); col = Integer.parseInt(rowColVal[1]); } if (row > rows) rows = row; if (col > cols) cols = col; ++nonZero; Integer colCount = colToNonZero.get(col-1); colToNonZero.put(col-1, (colCount == null) ? 1 : colCount + 1); } br.close(); DataOutputStream dos = new DataOutputStream( new BufferedOutputStream(new FileOutputStream(output))); dos.writeInt(rows); dos.writeInt(cols); dos.writeInt(nonZero); int chunkSize = 1000; int lastCol = -1; for (int lowerBound = 0, upperBound = chunkSize ; lowerBound < rows; lowerBound = upperBound, upperBound += chunkSize) { br = new BufferedReader(new FileReader(input)); int[] colIndices = new int[cols]; SortedMap<Integer,int[]> colToRowIndex = new TreeMap<Integer,int[]>(); SortedMap<Integer,float[]> colToRowValues = new TreeMap<Integer,float[]>(); for (String line = null; (line = br.readLine()) != null; ) { String[] rowColVal = line.split("\\s+"); int row, col; if (transpose) { row = Integer.parseInt(rowColVal[1]) - 1; col = Integer.parseInt(rowColVal[0]) - 1; } else { row = Integer.parseInt(rowColVal[0]) - 1; col = Integer.parseInt(rowColVal[1]) - 1; } float val = Double.valueOf(rowColVal[2]).floatValue(); if (col < lowerBound col >= upperBound) continue; int[] rowIndices = colToRowIndex.get(col); float[] rowValues = colToRowValues.get(col); if (rowIndices == null) { rowIndices = new int[colToNonZero.get(col)]; rowValues = new float[colToNonZero.get(col)]; colToRowIndex.put(col,rowIndices); colToRowValues.put(col,rowValues); } int curColIndex = colIndices[col]; rowIndices[curColIndex] = row; rowValues[curColIndex] = val; colIndices[col] += 1; } br.close(); for (Map.Entry<Integer,int[]> e : colToRowIndex.entrySet()) { int col = e.getKey().intValue(); int[] nonZeroRows = e.getValue(); float[] values = colToRowValues.get(col); if (col != lastCol) { for (int i = lastCol + 1; i < col; ++i) dos.writeInt(0); int colCount = colToNonZero.get(col); lastCol = col; dos.writeInt(colCount); } for (int i = 0; i < nonZeroRows.length; ++i) { dos.writeInt(nonZeroRows[i]); dos.writeFloat(values[i]); } } } dos.close(); }
/** * Reads in a matrix in the {@link Format#MATLAB_SPARSE} format and writes * it to the output file in {@link Format#SVDLIBC_SPARSE_BINARY} format. */
Reads in a matrix in the <code>Format#MATLAB_SPARSE</code> format and writes it to the output file in <code>Format#SVDLIBC_SPARSE_BINARY</code> format
matlabToSvdlibcSparseBinary
{ "repo_name": "fozziethebeat/S-Space", "path": "src/main/java/edu/ucla/sspace/matrix/MatrixIO.java", "license": "gpl-2.0", "size": 58264 }
[ "java.io.BufferedOutputStream", "java.io.BufferedReader", "java.io.DataOutputStream", "java.io.File", "java.io.FileOutputStream", "java.io.FileReader", "java.io.IOException", "java.util.HashMap", "java.util.Map", "java.util.SortedMap", "java.util.TreeMap" ]
import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.DataOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; import java.util.HashMap; import java.util.Map; import java.util.SortedMap; import java.util.TreeMap;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
1,447,020
// Cache the shell and display. this.shell = view.tabFolder.getShell(); this.display = this.shell.getDisplay(); // Remove old table if present boolean initResources = this.table == null; if (this.table != null) { disposeTable(); } // Create the "children" table int style = SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION; this.table = new Table(view.tabFolder, style); this.table.setLinesVisible (true); this.table.setHeaderVisible (true); GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1); gridData.heightHint = 150; this.table.setLayoutData (gridData); this.gc = new GC(this.table); // Init resources if (initResources) initResources(); // Add columns to the table TableColumn firstColumn = new TableColumn(this.table, SWT.CENTER); firstColumn.setText(""); PerformanceResultsElement results = view.getResults(); String [] configDescriptions = results.getConfigDescriptions(); int length = configDescriptions.length; for (int i = 0; i < length; i++) { TableColumn column = new TableColumn(this.table, SWT.CENTER); column.setText(configDescriptions[i]); } // Add lines to the table this.toolTips = new HashMap(); boolean fingerprints = this.preferences.getBoolean(IPerformancesConstants.PRE_FILTER_ADVANCED_SCENARIOS, IPerformancesConstants.DEFAULT_FILTER_ADVANCED_SCENARIOS); fillTable(results, view.currentBuild, view.referenceBuild, fingerprints); // Updated columns for (int i=0; i<=length; i++) { TableColumn column = this.table.getColumn(i); column.setWidth(i==0?120:100); } // Store table info this.columnsCount = length;
this.shell = view.tabFolder.getShell(); this.display = this.shell.getDisplay(); boolean initResources = this.table == null; if (this.table != null) { disposeTable(); } int style = SWT.MULTI SWT.BORDER SWT.H_SCROLL SWT.V_SCROLL SWT.FULL_SELECTION; this.table = new Table(view.tabFolder, style); this.table.setLinesVisible (true); this.table.setHeaderVisible (true); GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1); gridData.heightHint = 150; this.table.setLayoutData (gridData); this.gc = new GC(this.table); if (initResources) initResources(); TableColumn firstColumn = new TableColumn(this.table, SWT.CENTER); firstColumn.setText(""); PerformanceResultsElement results = view.getResults(); String [] configDescriptions = results.getConfigDescriptions(); int length = configDescriptions.length; for (int i = 0; i < length; i++) { TableColumn column = new TableColumn(this.table, SWT.CENTER); column.setText(configDescriptions[i]); } this.toolTips = new HashMap(); boolean fingerprints = this.preferences.getBoolean(IPerformancesConstants.PRE_FILTER_ADVANCED_SCENARIOS, IPerformancesConstants.DEFAULT_FILTER_ADVANCED_SCENARIOS); fillTable(results, view.currentBuild, view.referenceBuild, fingerprints); for (int i=0; i<=length; i++) { TableColumn column = this.table.getColumn(i); column.setWidth(i==0?120:100); } this.columnsCount = length;
/** * Creates the tab folder page. * * @param view The view on which to create the tab folder page * @return the new page for the tab folder */
Creates the tab folder page
createTabFolderPage
{ "repo_name": "HossainKhademian/Studio3", "path": "tests/org.eclipse.test.performance.ui/src/org/eclipse/test/internal/performance/results/ui/BuildsComparisonTab.java", "license": "gpl-3.0", "size": 18193 }
[ "java.util.HashMap", "org.eclipse.swt.layout.GridData", "org.eclipse.swt.widgets.Table", "org.eclipse.swt.widgets.TableColumn", "org.eclipse.test.internal.performance.results.model.PerformanceResultsElement", "org.eclipse.test.internal.performance.results.utils.IPerformancesConstants" ]
import java.util.HashMap; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; import org.eclipse.test.internal.performance.results.model.PerformanceResultsElement; import org.eclipse.test.internal.performance.results.utils.IPerformancesConstants;
import java.util.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; import org.eclipse.test.internal.performance.results.model.*; import org.eclipse.test.internal.performance.results.utils.*;
[ "java.util", "org.eclipse.swt", "org.eclipse.test" ]
java.util; org.eclipse.swt; org.eclipse.test;
2,474,770
public static <T> PulsarSourceBuilder<T> builder(DeserializationSchema<T> deserializationSchema) { Preconditions.checkNotNull(deserializationSchema, "deserializationSchema cannot be null"); return new PulsarSourceBuilder<>(deserializationSchema); }
static <T> PulsarSourceBuilder<T> function(DeserializationSchema<T> deserializationSchema) { Preconditions.checkNotNull(deserializationSchema, STR); return new PulsarSourceBuilder<>(deserializationSchema); }
/** * Creates a PulsarSourceBuilder. * * @param deserializationSchema the deserializer used to convert between Pulsar's byte messages and Flink's objects. * @return a builder */
Creates a PulsarSourceBuilder
builder
{ "repo_name": "merlimat/pulsar", "path": "pulsar-flink/src/main/java/org/apache/flink/streaming/connectors/pulsar/PulsarSourceBuilder.java", "license": "apache-2.0", "size": 13936 }
[ "org.apache.flink.api.common.serialization.DeserializationSchema", "org.apache.flink.util.Preconditions" ]
import org.apache.flink.api.common.serialization.DeserializationSchema; import org.apache.flink.util.Preconditions;
import org.apache.flink.api.common.serialization.*; import org.apache.flink.util.*;
[ "org.apache.flink" ]
org.apache.flink;
375,620
public void release() { for(String name : allMetrics) { Metrics.remove(factory.createMetricName(name)); } // latency metrics contain multiple metrics internally and need to be released manually readLatency.release(); writeLatency.release(); rangeLatency.release(); }
void function() { for(String name : allMetrics) { Metrics.remove(factory.createMetricName(name)); } readLatency.release(); writeLatency.release(); rangeLatency.release(); }
/** * Release all associated metrics. */
Release all associated metrics
release
{ "repo_name": "mourao666/cassandra-sim", "path": "src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java", "license": "apache-2.0", "size": 12912 }
[ "org.apache.cassandra.metrics.CassandraMetricsRegistry" ]
import org.apache.cassandra.metrics.CassandraMetricsRegistry;
import org.apache.cassandra.metrics.*;
[ "org.apache.cassandra" ]
org.apache.cassandra;
892,526
void waitForNotVisible() throws WidgetException, WidgetTimeoutException;
void waitForNotVisible() throws WidgetException, WidgetTimeoutException;
/** * Implementing this method would allow for the test to wait until the * element is no longer visible before progressing * * @throws WidgetException */
Implementing this method would allow for the test to wait until the element is no longer visible before progressing
waitForNotVisible
{ "repo_name": "knappk/JTAF-ExtWebDriver", "path": "src/main/java/org/finra/jtaf/ewd/widget/IElement.java", "license": "apache-2.0", "size": 16930 }
[ "org.finra.jtaf.ewd.timer.WidgetTimeoutException" ]
import org.finra.jtaf.ewd.timer.WidgetTimeoutException;
import org.finra.jtaf.ewd.timer.*;
[ "org.finra.jtaf" ]
org.finra.jtaf;
2,474,247
public void setContents(String contents) { annot.setString(COSName.CONTENTS, contents); }
void function(String contents) { annot.setString(COSName.CONTENTS, contents); }
/** * Set the contents, or a description, for an annotation. * * @param contents The annotation contents, or a description. */
Set the contents, or a description, for an annotation
setContents
{ "repo_name": "benmccann/pdfbox", "path": "pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotation.java", "license": "apache-2.0", "size": 27440 }
[ "org.apache.pdfbox.cos.COSName" ]
import org.apache.pdfbox.cos.COSName;
import org.apache.pdfbox.cos.*;
[ "org.apache.pdfbox" ]
org.apache.pdfbox;
2,788,747
public void translate(SecondPassData secondPassData, boolean insideDoInitAction, GraphSourceItem lineStartIns, TranslateStack stack, List<GraphTargetItem> output, HashMap<Integer, String> regNames, HashMap<String, GraphTargetItem> variables, HashMap<String, GraphTargetItem> functions, int staticOperation, String path) throws InterruptedException { }
void function(SecondPassData secondPassData, boolean insideDoInitAction, GraphSourceItem lineStartIns, TranslateStack stack, List<GraphTargetItem> output, HashMap<Integer, String> regNames, HashMap<String, GraphTargetItem> variables, HashMap<String, GraphTargetItem> functions, int staticOperation, String path) throws InterruptedException { }
/** * Translates this function to stack and output. * * @param secondPassData * @param insideDoInitAction * @param lineStartIns Line start instruction * @param stack Stack * @param output Output * @param regNames Register names * @param variables Variables * @param functions Functions * @param staticOperation the value of staticOperation * @param path the value of path * @throws java.lang.InterruptedException */
Translates this function to stack and output
translate
{ "repo_name": "jindrapetrik/jpexs-decompiler", "path": "libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java", "license": "gpl-3.0", "size": 49360 }
[ "com.jpexs.decompiler.graph.GraphSourceItem", "com.jpexs.decompiler.graph.GraphTargetItem", "com.jpexs.decompiler.graph.SecondPassData", "com.jpexs.decompiler.graph.TranslateStack", "java.util.HashMap", "java.util.List" ]
import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SecondPassData; import com.jpexs.decompiler.graph.TranslateStack; import java.util.HashMap; import java.util.List;
import com.jpexs.decompiler.graph.*; import java.util.*;
[ "com.jpexs.decompiler", "java.util" ]
com.jpexs.decompiler; java.util;
1,050,876
public void setByteArrayValue(@Nullable byte[] value);
void function(@Nullable byte[] value);
/** * Sets a single {@code byte[]} value to this object. * <p> * After calling this function, the type of this object is set to * {@link Type#BYTE_ARRAY}, all previous values of this object is cleared, and * the new value is set to this object. * </p> * * @param value * the new {@code byte[]} value to be set to this object, which * may be null. Note that the cloned copy of this object will be * stored in this object. */
Sets a single byte[] value to this object. After calling this function, the type of this object is set to <code>Type#BYTE_ARRAY</code>, all previous values of this object is cleared, and the new value is set to this object.
setByteArrayValue
{ "repo_name": "Haixing-Hu/commons", "path": "src/main/java/com/github/haixing_hu/util/value/MultiValues.java", "license": "apache-2.0", "size": 81305 }
[ "javax.annotation.Nullable" ]
import javax.annotation.Nullable;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
2,409,827
private void populateCurrentChatMember() { try { if (currentChatMember == null) { // Remember this locally currentChatMember = Utils.getSetting(this, Const.CHAT_MEMBER, ChatMember.class); // Load the private key from the shared prefs currentPrivateKey = Utils.getPrivateKeyFromSharedPrefs(this); // Proceed with registering checkPlayServicesAndRegister(); } } catch (RetrofitError e) { Utils.log(e); } }
void function() { try { if (currentChatMember == null) { currentChatMember = Utils.getSetting(this, Const.CHAT_MEMBER, ChatMember.class); currentPrivateKey = Utils.getPrivateKeyFromSharedPrefs(this); checkPlayServicesAndRegister(); } } catch (RetrofitError e) { Utils.log(e); } }
/** * Checks device for Play Services APK. * Initializes current chat member, if not already initialized * shows dialog to enter display name. */
Checks device for Play Services APK. Initializes current chat member, if not already initialized shows dialog to enter display name
populateCurrentChatMember
{ "repo_name": "DerGenaue/TumCampusApp", "path": "app/src/main/java/de/tum/in/tumcampus/activities/ChatRoomsActivity.java", "license": "gpl-2.0", "size": 19104 }
[ "de.tum.in.tumcampus.auxiliary.Const", "de.tum.in.tumcampus.auxiliary.Utils", "de.tum.in.tumcampus.models.ChatMember" ]
import de.tum.in.tumcampus.auxiliary.Const; import de.tum.in.tumcampus.auxiliary.Utils; import de.tum.in.tumcampus.models.ChatMember;
import de.tum.in.tumcampus.auxiliary.*; import de.tum.in.tumcampus.models.*;
[ "de.tum.in" ]
de.tum.in;
546,925
public List<JSTypeExpression> getThrownTypes() { if (info == null || info.thrownTypes == null) { return ImmutableList.of(); } return Collections.unmodifiableList(info.thrownTypes); }
List<JSTypeExpression> function() { if (info == null info.thrownTypes == null) { return ImmutableList.of(); } return Collections.unmodifiableList(info.thrownTypes); }
/** * Returns the list of thrown types. */
Returns the list of thrown types
getThrownTypes
{ "repo_name": "ehsan/js-symbolic-executor", "path": "closure-compiler/src/com/google/javascript/rhino/JSDocInfo.java", "license": "apache-2.0", "size": 31979 }
[ "com.google.common.collect.ImmutableList", "java.util.Collections", "java.util.List" ]
import com.google.common.collect.ImmutableList; import java.util.Collections; import java.util.List;
import com.google.common.collect.*; import java.util.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
1,059,934
public BucketLoggingConfiguration getBucketLoggingConfiguration(String bucketName) throws AmazonClientException, AmazonServiceException;
BucketLoggingConfiguration function(String bucketName) throws AmazonClientException, AmazonServiceException;
/** * <p> * Gets the logging configuration for the specified bucket. * The bucket * logging configuration object indicates if server access logging is * enabled the specified bucket, the destination bucket * where server access logs are delivered, and the optional log file prefix. * </p> * * @param bucketName * The name of the bucket whose bucket logging configuration is * being retrieved. * * @return The bucket logging configuration for the specified bucket. * * @throws AmazonClientException * If any errors are encountered in the client while making the * request or handling the response. * @throws AmazonServiceException * If any errors occurred in Amazon S3 while processing the * request. * * @see AmazonS3#setBucketLoggingConfiguration(SetBucketLoggingConfigurationRequest) */
Gets the logging configuration for the specified bucket. The bucket logging configuration object indicates if server access logging is enabled the specified bucket, the destination bucket where server access logs are delivered, and the optional log file prefix.
getBucketLoggingConfiguration
{ "repo_name": "vromero/aws-sdk-java", "path": "aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3.java", "license": "apache-2.0", "size": 189693 }
[ "com.amazonaws.AmazonClientException", "com.amazonaws.AmazonServiceException", "com.amazonaws.services.s3.model.BucketLoggingConfiguration" ]
import com.amazonaws.AmazonClientException; import com.amazonaws.AmazonServiceException; import com.amazonaws.services.s3.model.BucketLoggingConfiguration;
import com.amazonaws.*; import com.amazonaws.services.s3.model.*;
[ "com.amazonaws", "com.amazonaws.services" ]
com.amazonaws; com.amazonaws.services;
1,370,892
@SuppressWarnings("unchecked") @Test public void testEvaluateFilterEventTimeRangeFilter() throws Exception { CalendarFilterEvaluater evaluater = new CalendarFilterEvaluater(); Calendar calendar = getCalendar("cal1.ics"); CalendarFilter filter = new CalendarFilter(); ComponentFilter compFilter = new ComponentFilter("VCALENDAR"); ComponentFilter eventFilter = new ComponentFilter("VEVENT"); filter.setFilter(compFilter); compFilter.getComponentFilters().add(eventFilter); DateTime start = new DateTime("20050816T115000Z"); DateTime end = new DateTime("20050916T115000Z"); Period period = new Period(start, end); TimeRangeFilter timeRangeFilter = new TimeRangeFilter(period); eventFilter.setTimeRangeFilter(timeRangeFilter); Assert.assertTrue(evaluater.evaluate(calendar, filter)); start = new DateTime("20050818T115000Z"); period = new Period(start, end); timeRangeFilter.setPeriod(period); Assert.assertFalse(evaluater.evaluate(calendar, filter)); }
@SuppressWarnings(STR) void function() throws Exception { CalendarFilterEvaluater evaluater = new CalendarFilterEvaluater(); Calendar calendar = getCalendar(STR); CalendarFilter filter = new CalendarFilter(); ComponentFilter compFilter = new ComponentFilter(STR); ComponentFilter eventFilter = new ComponentFilter(STR); filter.setFilter(compFilter); compFilter.getComponentFilters().add(eventFilter); DateTime start = new DateTime(STR); DateTime end = new DateTime(STR); Period period = new Period(start, end); TimeRangeFilter timeRangeFilter = new TimeRangeFilter(period); eventFilter.setTimeRangeFilter(timeRangeFilter); Assert.assertTrue(evaluater.evaluate(calendar, filter)); start = new DateTime(STR); period = new Period(start, end); timeRangeFilter.setPeriod(period); Assert.assertFalse(evaluater.evaluate(calendar, filter)); }
/** * Tests evaluate filter event: time range filter. * @throws Exception - if something is wrong this exception is thrown. */
Tests evaluate filter event: time range filter
testEvaluateFilterEventTimeRangeFilter
{ "repo_name": "Eisler/cosmo", "path": "cosmo-core/src/test/unit/java/org/unitedinternet/cosmo/calendar/query/CalendarFilterEvaluaterTest.java", "license": "apache-2.0", "size": 23775 }
[ "net.fortuna.ical4j.model.Calendar", "net.fortuna.ical4j.model.DateTime", "net.fortuna.ical4j.model.Period", "org.junit.Assert" ]
import net.fortuna.ical4j.model.Calendar; import net.fortuna.ical4j.model.DateTime; import net.fortuna.ical4j.model.Period; import org.junit.Assert;
import net.fortuna.ical4j.model.*; import org.junit.*;
[ "net.fortuna.ical4j", "org.junit" ]
net.fortuna.ical4j; org.junit;
1,370,749
private static String buildUserAgent(Context context) { try { final PackageManager manager = context.getPackageManager(); final PackageInfo info = manager.getPackageInfo(context.getPackageName(), 0); // Some APIs require "(gzip)" in the user-agent string. return info.packageName + "/" + info.versionName + " (" + info.versionCode + ") (gzip)"; } catch (NameNotFoundException e) { return null; } } private static class InflatingEntity extends HttpEntityWrapper { public InflatingEntity(HttpEntity wrapped) { super(wrapped); }
static String function(Context context) { try { final PackageManager manager = context.getPackageManager(); final PackageInfo info = manager.getPackageInfo(context.getPackageName(), 0); return info.packageName + "/" + info.versionName + STR + info.versionCode + STR; } catch (NameNotFoundException e) { return null; } } private static class InflatingEntity extends HttpEntityWrapper { public InflatingEntity(HttpEntity wrapped) { super(wrapped); }
/** * Build and return a user-agent string that can identify this application * to remote servers. Contains the package name and version code. */
Build and return a user-agent string that can identify this application to remote servers. Contains the package name and version code
buildUserAgent
{ "repo_name": "mak0t0san/VimeoDroid", "path": "src/com/makotosan/vimeodroid/common/HttpHelper.java", "license": "gpl-2.0", "size": 5540 }
[ "android.content.Context", "android.content.pm.PackageInfo", "android.content.pm.PackageManager", "org.apache.http.HttpEntity", "org.apache.http.entity.HttpEntityWrapper" ]
import android.content.Context; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import org.apache.http.HttpEntity; import org.apache.http.entity.HttpEntityWrapper;
import android.content.*; import android.content.pm.*; import org.apache.http.*; import org.apache.http.entity.*;
[ "android.content", "org.apache.http" ]
android.content; org.apache.http;
1,350,897
val list = new ArrayList<String>(items.size()); items.forEach(d -> { if (d instanceof XSURI) { list.add(((XSURI) d).getURI()); } else if (d instanceof XSString) { list.add(((XSString) d).getValue()); } }); return list; }
val list = new ArrayList<String>(items.size()); items.forEach(d -> { if (d instanceof XSURI) { list.add(((XSURI) d).getURI()); } else if (d instanceof XSString) { list.add(((XSString) d).getValue()); } }); return list; }
/** * Gets string values from the list of mdui objects. * * @param items the items * @return the string values */
Gets string values from the list of mdui objects
getStringValues
{ "repo_name": "fogbeam/cas_mirror", "path": "support/cas-server-support-saml-mdui-core/src/main/java/org/apereo/cas/support/saml/mdui/SamlMetadataUIInfo.java", "license": "apache-2.0", "size": 7704 }
[ "java.util.ArrayList", "org.opensaml.core.xml.schema.XSString" ]
import java.util.ArrayList; import org.opensaml.core.xml.schema.XSString;
import java.util.*; import org.opensaml.core.xml.schema.*;
[ "java.util", "org.opensaml.core" ]
java.util; org.opensaml.core;
2,611,727
protected void setFixture(ItemFlow fixture) { this.fixture = fixture; }
void function(ItemFlow fixture) { this.fixture = fixture; }
/** * Sets the fixture for this Item Flow test case. * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */
Sets the fixture for this Item Flow test case.
setFixture
{ "repo_name": "bmaggi/Papyrus-SysML11", "path": "tests/org.eclipse.papyrus.sysml.tests/src/org/eclipse/papyrus/sysml/portandflows/tests/ItemFlowTest.java", "license": "epl-1.0", "size": 2418 }
[ "org.eclipse.papyrus.sysml.portandflows.ItemFlow" ]
import org.eclipse.papyrus.sysml.portandflows.ItemFlow;
import org.eclipse.papyrus.sysml.portandflows.*;
[ "org.eclipse.papyrus" ]
org.eclipse.papyrus;
1,692,832
public void setTarget(Notifier newTarget) { this.target = newTarget; } }
void function(Notifier newTarget) { this.target = newTarget; } }
/** * Sets the target. * * @param newTarget * The target */
Sets the target
setTarget
{ "repo_name": "debabratahazra/DS", "path": "designstudio/components/page/ui/com.odcgroup.page.ui/src/main/java/com/odcgroup/page/ui/editor/CodePropertyEditor.java", "license": "epl-1.0", "size": 11295 }
[ "org.eclipse.emf.common.notify.Notifier" ]
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.notify.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,261,642
@Override protected Connection chooseConnection(final RequestMessage msg) throws TimeoutException, ConnectionException { if (close.isDone()) throw new IllegalStateException("Client is closed"); return clusteredClient.chooseConnection(msg); }
Connection function(final RequestMessage msg) throws TimeoutException, ConnectionException { if (close.isDone()) throw new IllegalStateException(STR); return clusteredClient.chooseConnection(msg); }
/** * Delegates to the underlying {@link org.apache.tinkerpop.gremlin.driver.Client.ClusteredClient}. */
Delegates to the underlying <code>org.apache.tinkerpop.gremlin.driver.Client.ClusteredClient</code>
chooseConnection
{ "repo_name": "rmagen/incubator-tinkerpop", "path": "gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Client.java", "license": "apache-2.0", "size": 19652 }
[ "java.util.concurrent.TimeoutException", "org.apache.tinkerpop.gremlin.driver.exception.ConnectionException", "org.apache.tinkerpop.gremlin.driver.message.RequestMessage" ]
import java.util.concurrent.TimeoutException; import org.apache.tinkerpop.gremlin.driver.exception.ConnectionException; import org.apache.tinkerpop.gremlin.driver.message.RequestMessage;
import java.util.concurrent.*; import org.apache.tinkerpop.gremlin.driver.exception.*; import org.apache.tinkerpop.gremlin.driver.message.*;
[ "java.util", "org.apache.tinkerpop" ]
java.util; org.apache.tinkerpop;
1,945,280
@Test public void testHashCodeEquals() { ResolvedConfigLink<DateSet> other = new ResolvedConfigLink<>(DateSet.of(Collections.singleton(LocalDate.of(2018, 1, 1)))); assertEquals(RESOLVED, RESOLVED); assertNotEquals(null, RESOLVED); assertNotEquals(CONFIG, RESOLVED); assertEquals(RESOLVED, other); assertEquals(RESOLVED.hashCode(), other.hashCode()); other = new ResolvedConfigLink<>(DateSet.of(Collections.singleton(LocalDate.of(2018, 1, 12)))); assertNotEquals(RESOLVED, other); }
void function() { ResolvedConfigLink<DateSet> other = new ResolvedConfigLink<>(DateSet.of(Collections.singleton(LocalDate.of(2018, 1, 1)))); assertEquals(RESOLVED, RESOLVED); assertNotEquals(null, RESOLVED); assertNotEquals(CONFIG, RESOLVED); assertEquals(RESOLVED, other); assertEquals(RESOLVED.hashCode(), other.hashCode()); other = new ResolvedConfigLink<>(DateSet.of(Collections.singleton(LocalDate.of(2018, 1, 12)))); assertNotEquals(RESOLVED, other); }
/** * Tests the hashCode and equals method. */
Tests the hashCode and equals method
testHashCodeEquals
{ "repo_name": "McLeodMoores/starling", "path": "projects/core/src/test/java/com/opengamma/core/link/ResolvedConfigLinkTest.java", "license": "apache-2.0", "size": 2305 }
[ "com.opengamma.core.DateSet", "java.util.Collections", "org.testng.Assert", "org.threeten.bp.LocalDate" ]
import com.opengamma.core.DateSet; import java.util.Collections; import org.testng.Assert; import org.threeten.bp.LocalDate;
import com.opengamma.core.*; import java.util.*; import org.testng.*; import org.threeten.bp.*;
[ "com.opengamma.core", "java.util", "org.testng", "org.threeten.bp" ]
com.opengamma.core; java.util; org.testng; org.threeten.bp;
2,035,409
void close() throws IOException;
void close() throws IOException;
/** * Closes the iterator and its underlying resources. * @throws IOException error closing the iterator */
Closes the iterator and its underlying resources
close
{ "repo_name": "papicella/snappy-store", "path": "gemfire-core/src/main/java/com/gemstone/gemfire/cache/snapshot/SnapshotIterator.java", "license": "apache-2.0", "size": 1993 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,957,299
@Test public void testPoolConstraints() throws Exception { IElementType pool = ProcessElementTypes.Pool_1001; ShapeEditPart pshape = createShapeUsingTool(pool, new Point(100,100), getDiagramEditPart()); if (pshape.getModel() instanceof Node) { Node node = (Node) pshape.getModel(); EObject obj = node.getElement(); setProperty(obj, ProcessPackage.eINSTANCE.getNamedElement_Name(), "poolName"); setProperty(obj, ProcessPackage.eINSTANCE.getNamedElement_ID(), "poolId"); } // Select the decisionstate. EditPartViewer rootViewer = getDiagramEditPart().getRoot().getViewer(); rootViewer.deselectAll(); rootViewer.select(pshape); flushEventQueue(); String[] msgs = validateModel(pshape); ISection section = getCurrentTab().getSectionAtIndex(0); Assert.assertTrue(section instanceof NamedElementPropertySection); NamedElementPropertySection is = (NamedElementPropertySection) section; is.refresh(); String errorMsg = "Participant Information is required for the Pool<<poolName>>"; // check for error messages Assert.assertEquals("Error ", errorMsg, msgs[0].trim()); rootViewer.deselectAll(); pshape.deactivate(); }
void function() throws Exception { IElementType pool = ProcessElementTypes.Pool_1001; ShapeEditPart pshape = createShapeUsingTool(pool, new Point(100,100), getDiagramEditPart()); if (pshape.getModel() instanceof Node) { Node node = (Node) pshape.getModel(); EObject obj = node.getElement(); setProperty(obj, ProcessPackage.eINSTANCE.getNamedElement_Name(), STR); setProperty(obj, ProcessPackage.eINSTANCE.getNamedElement_ID(), STR); } EditPartViewer rootViewer = getDiagramEditPart().getRoot().getViewer(); rootViewer.deselectAll(); rootViewer.select(pshape); flushEventQueue(); String[] msgs = validateModel(pshape); ISection section = getCurrentTab().getSectionAtIndex(0); Assert.assertTrue(section instanceof NamedElementPropertySection); NamedElementPropertySection is = (NamedElementPropertySection) section; is.refresh(); String errorMsg = STR; Assert.assertEquals(STR, errorMsg, msgs[0].trim()); rootViewer.deselectAll(); pshape.deactivate(); }
/** * test the constraints for the pool root element */
test the constraints for the pool root element
testPoolConstraints
{ "repo_name": "debabratahazra/DS", "path": "designstudio/components/process/tests/com.odcgroup.process.editor.diagram.tests/src/com/odcgroup/process/editor/validation/tests/PoolSketchValidationEditorTests.java", "license": "epl-1.0", "size": 2982 }
[ "com.odcgroup.process.diagram.custom.properties.sections.NamedElementPropertySection", "com.odcgroup.process.diagram.providers.ProcessElementTypes", "com.odcgroup.process.model.ProcessPackage", "org.eclipse.draw2d.geometry.Point", "org.eclipse.emf.ecore.EObject", "org.eclipse.gef.EditPartViewer", "org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeEditPart", "org.eclipse.gmf.runtime.emf.type.core.IElementType", "org.eclipse.gmf.runtime.notation.Node", "org.eclipse.ui.views.properties.tabbed.ISection", "org.junit.Assert" ]
import com.odcgroup.process.diagram.custom.properties.sections.NamedElementPropertySection; import com.odcgroup.process.diagram.providers.ProcessElementTypes; import com.odcgroup.process.model.ProcessPackage; import org.eclipse.draw2d.geometry.Point; import org.eclipse.emf.ecore.EObject; import org.eclipse.gef.EditPartViewer; import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeEditPart; import org.eclipse.gmf.runtime.emf.type.core.IElementType; import org.eclipse.gmf.runtime.notation.Node; import org.eclipse.ui.views.properties.tabbed.ISection; import org.junit.Assert;
import com.odcgroup.process.diagram.custom.properties.sections.*; import com.odcgroup.process.diagram.providers.*; import com.odcgroup.process.model.*; import org.eclipse.draw2d.geometry.*; import org.eclipse.emf.ecore.*; import org.eclipse.gef.*; import org.eclipse.gmf.runtime.diagram.ui.editparts.*; import org.eclipse.gmf.runtime.emf.type.core.*; import org.eclipse.gmf.runtime.notation.*; import org.eclipse.ui.views.properties.tabbed.*; import org.junit.*;
[ "com.odcgroup.process", "org.eclipse.draw2d", "org.eclipse.emf", "org.eclipse.gef", "org.eclipse.gmf", "org.eclipse.ui", "org.junit" ]
com.odcgroup.process; org.eclipse.draw2d; org.eclipse.emf; org.eclipse.gef; org.eclipse.gmf; org.eclipse.ui; org.junit;
946,499
@PostMapping(value="/add-note") public String noteAddNote(@ModelAttribute("noteDto") @Valid NoteDTO noteDto, BindingResult result){ if (result.hasErrors()){ return "addNote"; }else{ Note note = new Note(); Date date = new Date(); String currentDate = DATE_FORMAT.format(date); note.setTitle(noteDto.getTitle()); note.setContent(noteDto.getContent()); note.setAuthor(noteDto.getAuthor()); note.setDate(currentDate); writerFile.fileWriter(note, date); noteRepository.save(note); return "redirect:/"; } }
@PostMapping(value=STR) String function(@ModelAttribute(STR) @Valid NoteDTO noteDto, BindingResult result){ if (result.hasErrors()){ return STR; }else{ Note note = new Note(); Date date = new Date(); String currentDate = DATE_FORMAT.format(date); note.setTitle(noteDto.getTitle()); note.setContent(noteDto.getContent()); note.setAuthor(noteDto.getAuthor()); note.setDate(currentDate); writerFile.fileWriter(note, date); noteRepository.save(note); return STR; } }
/** * This method is creating Note object from index.jsp form and saving Note in database * @return Main page of application */
This method is creating Note object from index.jsp form and saving Note in database
noteAddNote
{ "repo_name": "devkamil/spring-boot-app", "path": "src/main/java/pl/devkamil/NoteController.java", "license": "epl-1.0", "size": 4157 }
[ "java.util.Date", "javax.validation.Valid", "org.springframework.validation.BindingResult", "org.springframework.web.bind.annotation.ModelAttribute", "org.springframework.web.bind.annotation.PostMapping" ]
import java.util.Date; import javax.validation.Valid; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PostMapping;
import java.util.*; import javax.validation.*; import org.springframework.validation.*; import org.springframework.web.bind.annotation.*;
[ "java.util", "javax.validation", "org.springframework.validation", "org.springframework.web" ]
java.util; javax.validation; org.springframework.validation; org.springframework.web;
266,115
private synchronized LispValue tell(String query, ErrorSet errors) throws AlgernonRuntimeException { LispValue tell = null; try { tell = algernon.tell(query, errors); } catch (RuntimeException e) { String message = "A runtime exception occurs for query " + query; LOG.error(message, e); throw new AlgernonRuntimeException(message, e); } return tell; }
synchronized LispValue function(String query, ErrorSet errors) throws AlgernonRuntimeException { LispValue tell = null; try { tell = algernon.tell(query, errors); } catch (RuntimeException e) { String message = STR + query; LOG.error(message, e); throw new AlgernonRuntimeException(message, e); } return tell; }
/** * Tells the algernon rule rule_machine. * * @param query the query. * @param errors the errors. * @return the lisp value. * @throws AlgernonRuntimeException if runtime exception in org.algernon occurs */
Tells the algernon rule rule_machine
tell
{ "repo_name": "prowim/prowim", "path": "prowim-algernon-connector/src/org/prowim/jca/connector/algernon/impl/RuleMachine.java", "license": "gpl-3.0", "size": 23570 }
[ "org.algernon.util.ErrorSet", "org.jatha.dynatype.LispValue", "org.prowim.jca.connector.algernon.AlgernonRuntimeException" ]
import org.algernon.util.ErrorSet; import org.jatha.dynatype.LispValue; import org.prowim.jca.connector.algernon.AlgernonRuntimeException;
import org.algernon.util.*; import org.jatha.dynatype.*; import org.prowim.jca.connector.algernon.*;
[ "org.algernon.util", "org.jatha.dynatype", "org.prowim.jca" ]
org.algernon.util; org.jatha.dynatype; org.prowim.jca;
366,895
private void restoreSyncReports(Intent restoreIntent) { // restore the reports if lost setupSyncReports(SYNC_REPORTS_ALL_ACCOUNTS_IF_EMPTY); synchronized (mSyncReports) { long[] accountInfo = restoreIntent.getLongArrayExtra(EXTRA_ACCOUNT_INFO); if (accountInfo == null) { Log.d(LOG_TAG, "no data in intent to restore"); return; } int accountInfoIndex = 0; int accountInfoLimit = accountInfo.length; while (accountInfoIndex < accountInfoLimit) { long accountId = accountInfo[accountInfoIndex++]; long prevSync = accountInfo[accountInfoIndex++]; AccountSyncReport report = mSyncReports.get(accountId); if (report != null) { if (report.prevSyncTime == 0) { report.prevSyncTime = prevSync; report.setNextSyncTime(); } } } } }
void function(Intent restoreIntent) { setupSyncReports(SYNC_REPORTS_ALL_ACCOUNTS_IF_EMPTY); synchronized (mSyncReports) { long[] accountInfo = restoreIntent.getLongArrayExtra(EXTRA_ACCOUNT_INFO); if (accountInfo == null) { Log.d(LOG_TAG, STR); return; } int accountInfoIndex = 0; int accountInfoLimit = accountInfo.length; while (accountInfoIndex < accountInfoLimit) { long accountId = accountInfo[accountInfoIndex++]; long prevSync = accountInfo[accountInfoIndex++]; AccountSyncReport report = mSyncReports.get(accountId); if (report != null) { if (report.prevSyncTime == 0) { report.prevSyncTime = prevSync; report.setNextSyncTime(); } } } } }
/** * when we receive an alarm, update the account sync reports list if necessary * this will be the case when if we have restarted the process and lost the data * in the global. * * @param restoreIntent the intent with the list */
when we receive an alarm, update the account sync reports list if necessary this will be the case when if we have restarted the process and lost the data in the global
restoreSyncReports
{ "repo_name": "craigacgomez/flaming_monkey_packages_apps_Email", "path": "src/com/android/email/service/MailService.java", "license": "apache-2.0", "size": 32123 }
[ "android.content.Intent", "android.util.Log" ]
import android.content.Intent; import android.util.Log;
import android.content.*; import android.util.*;
[ "android.content", "android.util" ]
android.content; android.util;
2,611,110
public ReloadableRegistrationHandle<T> put(String pluginName, Key<T> key, Provider<T> item) { requireNonNull(item); String exportName = ((Export) key.getAnnotation()).value(); NamePair np = new NamePair(pluginName, exportName); items.put(np, item); return new ReloadableHandle(np, key, item); } private class ReloadableHandle implements ReloadableRegistrationHandle<T> { private final NamePair np; private final Key<T> key; private final Provider<T> item; ReloadableHandle(NamePair np, Key<T> key, Provider<T> item) { this.np = np; this.key = key; this.item = item; }
ReloadableRegistrationHandle<T> function(String pluginName, Key<T> key, Provider<T> item) { requireNonNull(item); String exportName = ((Export) key.getAnnotation()).value(); NamePair np = new NamePair(pluginName, exportName); items.put(np, item); return new ReloadableHandle(np, key, item); } private class ReloadableHandle implements ReloadableRegistrationHandle<T> { private final NamePair np; private final Key<T> key; private final Provider<T> item; ReloadableHandle(NamePair np, Key<T> key, Provider<T> item) { this.np = np; this.key = key; this.item = item; }
/** * Store one new element that may be hot-replaceable in the future. * * @param pluginName unique name of the plugin providing the export. * @param key unique description from the item's Guice binding. This can be later obtained from * the registration handle to facilitate matching with the new equivalent instance during a * hot reload. The key must use an {@link Export} annotation. * @param item the item to add to the collection right now. Must not be null. * @return a handle that can remove this item later, or hot-swap the item without it ever leaving * the collection. */
Store one new element that may be hot-replaceable in the future
put
{ "repo_name": "qtproject/qtqa-gerrit", "path": "java/com/google/gerrit/extensions/registration/PrivateInternals_DynamicMapImpl.java", "license": "apache-2.0", "size": 3189 }
[ "com.google.gerrit.extensions.annotations.Export", "com.google.inject.Key", "com.google.inject.Provider", "java.util.Objects" ]
import com.google.gerrit.extensions.annotations.Export; import com.google.inject.Key; import com.google.inject.Provider; import java.util.Objects;
import com.google.gerrit.extensions.annotations.*; import com.google.inject.*; import java.util.*;
[ "com.google.gerrit", "com.google.inject", "java.util" ]
com.google.gerrit; com.google.inject; java.util;
1,415,592