method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public BusinessObjectFormatEntity createBusinessObjectFormatEntity(String namespaceCode, String businessObjectDefinitionName, String businessObjectFormatUsage, String fileType, Integer businessObjectFormatVersion, String businessObjectFormatDescription, String businessObjectFormatDocumentSchema, Str...
BusinessObjectFormatEntity function(String namespaceCode, String businessObjectDefinitionName, String businessObjectFormatUsage, String fileType, Integer businessObjectFormatVersion, String businessObjectFormatDescription, String businessObjectFormatDocumentSchema, String businessObjectFormatDocumentSchemaUrl, Boolean ...
/** * Creates and persists a new business object format entity. * * @return the newly created business object format entity. */
Creates and persists a new business object format entity
createBusinessObjectFormatEntity
{ "repo_name": "FINRAOS/herd", "path": "herd-code/herd-dao/src/test/java/org/finra/herd/dao/BusinessObjectFormatDaoTestHelper.java", "license": "apache-2.0", "size": 26068 }
[ "java.util.List", "org.apache.commons.lang3.StringUtils", "org.finra.herd.model.api.xml.Attribute", "org.finra.herd.model.api.xml.BusinessObjectDefinitionKey", "org.finra.herd.model.api.xml.SchemaColumn", "org.finra.herd.model.jpa.BusinessObjectDefinitionEntity", "org.finra.herd.model.jpa.BusinessObject...
import java.util.List; import org.apache.commons.lang3.StringUtils; import org.finra.herd.model.api.xml.Attribute; import org.finra.herd.model.api.xml.BusinessObjectDefinitionKey; import org.finra.herd.model.api.xml.SchemaColumn; import org.finra.herd.model.jpa.BusinessObjectDefinitionEntity; import org.finra.herd.mode...
import java.util.*; import org.apache.commons.lang3.*; import org.finra.herd.model.api.xml.*; import org.finra.herd.model.jpa.*;
[ "java.util", "org.apache.commons", "org.finra.herd" ]
java.util; org.apache.commons; org.finra.herd;
2,311,873
@Override public Adapter createActivationPropertyAdapter() { if (activationPropertyItemProvider == null) { activationPropertyItemProvider = new ActivationPropertyItemProvider(this); } return activationPropertyItemProvider; } protected BuildItemProvider buildItemProvider;
Adapter function() { if (activationPropertyItemProvider == null) { activationPropertyItemProvider = new ActivationPropertyItemProvider(this); } return activationPropertyItemProvider; } protected BuildItemProvider buildItemProvider;
/** * This creates an adapter for a {@link eu.hohenegger.xsd.pom.ActivationProperty}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This creates an adapter for a <code>eu.hohenegger.xsd.pom.ActivationProperty</code>.
createActivationPropertyAdapter
{ "repo_name": "Treehopper/EclipseAugments", "path": "pom-editor/eu.hohenegger.xsd.pom.ui/src-gen/eu/hohenegger/xsd/pom/provider/PomItemProviderAdapterFactory.java", "license": "epl-1.0", "size": 67666 }
[ "org.eclipse.emf.common.notify.Adapter" ]
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,740,754
boolean acceptDrop(View v, int x, int y, String tag, String placeTag, Object dragInfo);
boolean acceptDrop(View v, int x, int y, String tag, String placeTag, Object dragInfo);
/** * Check if a drop action can occur at, or near, the requested location. * This may be called repeatedly during a drag, so any calls should return * quickly. * * @param v View where the drag started * @param x X coordinate of the drop location * @param y Y coordinate of the drop lo...
Check if a drop action can occur at, or near, the requested location. This may be called repeatedly during a drag, so any calls should return quickly
acceptDrop
{ "repo_name": "gvoltr/fragmentdnd", "path": "fragmentdnd/src/main/java/com/gvoltr/fragmentdnd/DropTarget.java", "license": "apache-2.0", "size": 1265 }
[ "android.view.View" ]
import android.view.View;
import android.view.*;
[ "android.view" ]
android.view;
2,423,723
EReference getDocumentRoot_MetaData();
EReference getDocumentRoot_MetaData();
/** * Returns the meta object for the containment reference '{@link net.opengis.gml.DocumentRoot#getMetaData <em>Meta Data</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the containment reference '<em>Meta Data</em>'. * @see net.opengis.gml.DocumentRoot#getMetaData() ...
Returns the meta object for the containment reference '<code>net.opengis.gml.DocumentRoot#getMetaData Meta Data</code>'.
getDocumentRoot_MetaData
{ "repo_name": "geotools/geotools", "path": "modules/ogc/net.opengis.wcs/src/net/opengis/gml/GmlPackage.java", "license": "lgpl-2.1", "size": 136786 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
367,074
public Observable<ServiceResponse<OperationStatusResponseInner>> restartWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (vm...
Observable<ServiceResponse<OperationStatusResponseInner>> function(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (vmName == null) { throw new IllegalArgumentException(STR); } if (this.client.subscriptionId() == null) { throw new IllegalArgument...
/** * The operation to restart a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
The operation to restart a virtual machine
restartWithServiceResponseAsync
{ "repo_name": "martinsawicki/azure-sdk-for-java", "path": "azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesInner.java", "license": "mit", "size": 170852 }
[ "com.google.common.reflect.TypeToken", "com.microsoft.rest.ServiceResponse" ]
import com.google.common.reflect.TypeToken; import com.microsoft.rest.ServiceResponse;
import com.google.common.reflect.*; import com.microsoft.rest.*;
[ "com.google.common", "com.microsoft.rest" ]
com.google.common; com.microsoft.rest;
38,358
public ShortVoid journal(JournalRequestInfo reqInfo) throws IOException;
ShortVoid function(JournalRequestInfo reqInfo) throws IOException;
/** * Journal edit records. This message is sent by the active name-node to the * JournalNodes to write edits to their local logs. */
Journal edit records. This message is sent by the active name-node to the JournalNodes to write edits to their local logs
journal
{ "repo_name": "shakamunyi/hadoop-20", "path": "src/hdfs/org/apache/hadoop/hdfs/qjournal/protocol/QJournalProtocol.java", "license": "apache-2.0", "size": 6631 }
[ "java.io.IOException", "org.apache.hadoop.io.ShortVoid" ]
import java.io.IOException; import org.apache.hadoop.io.ShortVoid;
import java.io.*; import org.apache.hadoop.io.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
2,540,354
private String exportCloseLink() { String closeLink = null; if (getRequest().getAttribute(I_CmsDialogConstants.ATTR_CLOSE_LINK) != null) { closeLink = (String)getRequest().getAttribute(I_CmsDialogConstants.ATTR_CLOSE_LINK); } if (CmsStringUtil.isEmptyOrWhitespaceOn...
String function() { String closeLink = null; if (getRequest().getAttribute(I_CmsDialogConstants.ATTR_CLOSE_LINK) != null) { closeLink = (String)getRequest().getAttribute(I_CmsDialogConstants.ATTR_CLOSE_LINK); } if (CmsStringUtil.isEmptyOrWhitespaceOnly(closeLink)) { closeLink = CmsWorkplace.FILE_EXPLORER_FILELIST; } St...
/** * Returns a javascript tag that contains a variable deceleration that has the close link as value.<p> * * @return a javascript tag that contains a variable deceleration that has the close link as value */
Returns a javascript tag that contains a variable deceleration that has the close link as value
exportCloseLink
{ "repo_name": "ggiudetti/opencms-core", "path": "src/org/opencms/ade/postupload/CmsPostUploadDialogActionElement.java", "license": "lgpl-2.1", "size": 5858 }
[ "org.opencms.util.CmsStringUtil", "org.opencms.workplace.CmsWorkplace" ]
import org.opencms.util.CmsStringUtil; import org.opencms.workplace.CmsWorkplace;
import org.opencms.util.*; import org.opencms.workplace.*;
[ "org.opencms.util", "org.opencms.workplace" ]
org.opencms.util; org.opencms.workplace;
1,343,009
public void renameSnapshot(String snapshotDir, String snapshotOldName, String snapshotNewName) throws IOException { checkOpen(); try { namenode.renameSnapshot(snapshotDir, snapshotOldName, snapshotNewName); } catch(RemoteException re) { throw re.unwrapRemoteException(); } }
void function(String snapshotDir, String snapshotOldName, String snapshotNewName) throws IOException { checkOpen(); try { namenode.renameSnapshot(snapshotDir, snapshotOldName, snapshotNewName); } catch(RemoteException re) { throw re.unwrapRemoteException(); } }
/** * Rename a snapshot. * @param snapshotDir The directory path where the snapshot was taken * @param snapshotOldName Old name of the snapshot * @param snapshotNewName New name of the snapshot * @throws IOException * @see ClientProtocol#renameSnapshot(String, String, String) */
Rename a snapshot
renameSnapshot
{ "repo_name": "tomatoKiller/Hadoop_Source_Learn", "path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java", "license": "apache-2.0", "size": 95752 }
[ "java.io.IOException", "org.apache.hadoop.ipc.RemoteException" ]
import java.io.IOException; import org.apache.hadoop.ipc.RemoteException;
import java.io.*; import org.apache.hadoop.ipc.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
1,287,728
try { FriendlyCustomerInteraction dialog = new FriendlyCustomerInteraction(customer); dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); dialog.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } public FriendlyCustomerInteraction(ICustomer customer) throws RemoteException ...
try { FriendlyCustomerInteraction dialog = new FriendlyCustomerInteraction(customer); dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); dialog.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } public FriendlyCustomerInteraction(ICustomer customer) throws RemoteException { this.customer = custo...
/** * Launch the dialog. */
Launch the dialog
open
{ "repo_name": "SDU-Software-Engineering/opn", "path": "rmi/BankingForRMI/src/dk/sdu/mmmi/opn/banking/client/FriendlyCustomerInteraction.java", "license": "gpl-3.0", "size": 6840 }
[ "dk.sdu.mmmi.opn.banking.common.ICustomer", "java.awt.BorderLayout", "java.rmi.RemoteException", "javax.swing.JDialog", "javax.swing.JLabel", "javax.swing.JSeparator", "javax.swing.JTextField", "javax.swing.border.EmptyBorder" ]
import dk.sdu.mmmi.opn.banking.common.ICustomer; import java.awt.BorderLayout; import java.rmi.RemoteException; import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JSeparator; import javax.swing.JTextField; import javax.swing.border.EmptyBorder;
import dk.sdu.mmmi.opn.banking.common.*; import java.awt.*; import java.rmi.*; import javax.swing.*; import javax.swing.border.*;
[ "dk.sdu.mmmi", "java.awt", "java.rmi", "javax.swing" ]
dk.sdu.mmmi; java.awt; java.rmi; javax.swing;
1,931,121
@SuppressWarnings({ "unchecked", "rawtypes" }) @Test public void testKeyValueImporter() throws Exception { KeyValueImporter importer = new KeyValueImporter(); Configuration configuration = new Configuration(); Context ctx = mock(Context.class); when(ctx.getConfiguration()).thenReturn(configuration...
@SuppressWarnings({ STR, STR }) void function() throws Exception { KeyValueImporter importer = new KeyValueImporter(); Configuration configuration = new Configuration(); Context ctx = mock(Context.class); when(ctx.getConfiguration()).thenReturn(configuration); doAnswer(new Answer<Void>() {
/** * Test map method of Importer */
Test map method of Importer
testKeyValueImporter
{ "repo_name": "toshimasa-nasu/hbase", "path": "hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java", "license": "apache-2.0", "size": 25433 }
[ "org.apache.hadoop.conf.Configuration", "org.apache.hadoop.hbase.mapreduce.Import", "org.apache.hadoop.mapreduce.Mapper", "org.mockito.Mockito", "org.mockito.stubbing.Answer" ]
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.mapreduce.Import; import org.apache.hadoop.mapreduce.Mapper; import org.mockito.Mockito; import org.mockito.stubbing.Answer;
import org.apache.hadoop.conf.*; import org.apache.hadoop.hbase.mapreduce.*; import org.apache.hadoop.mapreduce.*; import org.mockito.*; import org.mockito.stubbing.*;
[ "org.apache.hadoop", "org.mockito", "org.mockito.stubbing" ]
org.apache.hadoop; org.mockito; org.mockito.stubbing;
1,528,243
public List getCodeSpaceRanges() { return this.codeSpaceRanges; }
List function() { return this.codeSpaceRanges; }
/** * Getter for property codeSpaceRanges. * * @return Value of property codeSpaceRanges. */
Getter for property codeSpaceRanges
getCodeSpaceRanges
{ "repo_name": "venanciolm/afirma-ui-miniapplet_x_x", "path": "afirma_ui_miniapplet/src/main/java/com/lowagie/text/pdf/fonts/cmaps/CMap.java", "license": "mit", "size": 4465 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
326,269
public long getStorageLowBytes(File path) { final long lowPercent = Settings.Global.getInt(mResolver, Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE, DEFAULT_THRESHOLD_PERCENTAGE); final long lowBytes = (path.getTotalSpace() * lowPercent) / 100; final long maxLowBytes = Se...
long function(File path) { final long lowPercent = Settings.Global.getInt(mResolver, Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE, DEFAULT_THRESHOLD_PERCENTAGE); final long lowBytes = (path.getTotalSpace() * lowPercent) / 100; final long maxLowBytes = Settings.Global.getLong(mResolver, Settings.Global.SYS_STORAGE_T...
/** * Return the number of available bytes at which the given path is * considered running low on storage. * * @hide */
Return the number of available bytes at which the given path is considered running low on storage
getStorageLowBytes
{ "repo_name": "Ant-Droid/android_frameworks_base_OLD", "path": "core/java/android/os/storage/StorageManager.java", "license": "apache-2.0", "size": 35197 }
[ "android.provider.Settings", "java.io.File" ]
import android.provider.Settings; import java.io.File;
import android.provider.*; import java.io.*;
[ "android.provider", "java.io" ]
android.provider; java.io;
1,909,393
boolean hasAnyRole(Set<String> roles);
boolean hasAnyRole(Set<String> roles);
/** * Tell if the actor has any of the specified security roles. * * @param roles The roles. * * @return {@code true} if the actor has any of the roles. */
Tell if the actor has any of the specified security roles
hasAnyRole
{ "repo_name": "boylesoftware/thymes2", "path": "src/main/java/org/bsworks/x2/Actor.java", "license": "apache-2.0", "size": 3916 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
121,913
private static String makeHTML(final Action action) { String name = (String) action.getValue(Action.NAME); if (name == null || name.trim().isEmpty()) { return ""; } // if only part of the text should appear as link, <a href> tag is defined in i18n if (name.contains("<") || name.contains(">")) { retur...
static String function(final Action action) { String name = (String) action.getValue(Action.NAME); if (name == null name.trim().isEmpty()) { return STR<STR>STRicons/16/" + iconName); } } if (iconUrl != null) { return String.format(TEMPLATE_ICON_HTML, iconUrl.toString(), name); } else { if (Boolean.parseBoolean(String.v...
/** * Creates the HTML text which will represent the link button. * * @param action * @return */
Creates the HTML text which will represent the link button
makeHTML
{ "repo_name": "transwarpio/rapidminer", "path": "rapidMiner/rapidminer-studio-core/src/main/java/com/rapidminer/gui/tools/components/AbstractLinkButton.java", "license": "gpl-3.0", "size": 5326 }
[ "javax.swing.Action" ]
import javax.swing.Action;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
2,071,359
public static GeoGridAggregationBuilder geohashGrid(String name) { return new GeoGridAggregationBuilder(name); }
static GeoGridAggregationBuilder function(String name) { return new GeoGridAggregationBuilder(name); }
/** * Create a new {@link GeoHashGrid} aggregation with the given name. */
Create a new <code>GeoHashGrid</code> aggregation with the given name
geohashGrid
{ "repo_name": "strahanjen/strahanjen.github.io", "path": "elasticsearch-master/core/src/main/java/org/elasticsearch/search/aggregations/AggregationBuilders.java", "license": "bsd-3-clause", "size": 13428 }
[ "org.elasticsearch.search.aggregations.bucket.geogrid.GeoGridAggregationBuilder" ]
import org.elasticsearch.search.aggregations.bucket.geogrid.GeoGridAggregationBuilder;
import org.elasticsearch.search.aggregations.bucket.geogrid.*;
[ "org.elasticsearch.search" ]
org.elasticsearch.search;
765,749
public void sendFileCommand() { if (isRunning() == false || isPaused() == true || gCode==null || gCode.isFileOpened() == false || (getConnection() != null && isPortConfirmed() == false) ) return; // are there any more commands? if( gCode.moreLinesAvailable() == false ) { // end of fi...
void function() { if (isRunning() == false isPaused() == true gCode==null gCode.isFileOpened() == false (getConnection() != null && isPortConfirmed() == false) ) return; if( gCode.moreLinesAvailable() == false ) { halt(); int x = gCode.getLinesTotal(); if(myPanel!=null) myPanel.statusBar.setProgress(x, x); SoundSystem....
/** * Take the next line from the file and send it to the robot, if permitted. */
Take the next line from the file and send it to the robot, if permitted
sendFileCommand
{ "repo_name": "paulhurleyuk/Makelangelo", "path": "java/src/main/java/com/marginallyclever/makelangeloRobot/MakelangeloRobot.java", "license": "gpl-2.0", "size": 19943 }
[ "com.marginallyclever.makelangelo.SoundSystem" ]
import com.marginallyclever.makelangelo.SoundSystem;
import com.marginallyclever.makelangelo.*;
[ "com.marginallyclever.makelangelo" ]
com.marginallyclever.makelangelo;
1,924,166
public List<MetaData> getMetaData(boolean unfold) { List<MetaData> results = new LinkedList<MetaData>(); for (InputPort port : getManagedPorts()) { MetaData data = port.getMetaData(); if (data != null) { if (unfold && data instanceof CollectionMetaData) { results.add(((CollectionMetaData) da...
List<MetaData> function(boolean unfold) { List<MetaData> results = new LinkedList<MetaData>(); for (InputPort port : getManagedPorts()) { MetaData data = port.getMetaData(); if (data != null) { if (unfold && data instanceof CollectionMetaData) { results.add(((CollectionMetaData) data).getElementMetaDataRecursive()); } ...
/** * Returns a list of non-null meta data of all input ports. */
Returns a list of non-null meta data of all input ports
getMetaData
{ "repo_name": "transwarpio/rapidminer", "path": "rapidMiner/rapidminer-studio-core/src/main/java/com/rapidminer/operator/ports/InputPortExtender.java", "license": "gpl-3.0", "size": 9104 }
[ "com.rapidminer.operator.ports.metadata.CollectionMetaData", "com.rapidminer.operator.ports.metadata.MetaData", "java.util.LinkedList", "java.util.List" ]
import com.rapidminer.operator.ports.metadata.CollectionMetaData; import com.rapidminer.operator.ports.metadata.MetaData; import java.util.LinkedList; import java.util.List;
import com.rapidminer.operator.ports.metadata.*; import java.util.*;
[ "com.rapidminer.operator", "java.util" ]
com.rapidminer.operator; java.util;
1,710,967
private State2 handleArea (final String ns, final String lnam, final String qnam, final Attributes atts) throws SAXException { State2 ret = null; done : if ("area".equals(lnam)) { final String href = atts.getValue("", HREF_ATT)...
State2 function (final String ns, final String lnam, final String qnam, final Attributes atts) throws SAXException { State2 ret = null; done : if ("area".equals(lnam)) { final String href = atts.getValue(STR", HREF_ATT); newAtts.setValue(idx, newHref); xmlReceiver.startElement(ns, lnam, qnam, newAtts); } return ret; }
/** * Handler for {http://www.w3.org/1999/xhtml}area. Assumes namespace test has already * happened. Implements : * <pre> * <xsl:template match="xhtml:area[@href]" > * <xsl:copy> * <xsl:copy-of select="@*[namespace-uri() = '']"/> * <xs...
Handler for {HREF}area. Assumes namespace test has already happened. Implements : <code> </code> If match is satisfied then modified event is sent to destination contentHandler
handleArea
{ "repo_name": "joansmith/orbeon-forms", "path": "src/main/java/org/orbeon/oxf/processor/converter/AbstractRewrite.java", "license": "lgpl-2.1", "size": 39658 }
[ "org.xml.sax.Attributes", "org.xml.sax.SAXException" ]
import org.xml.sax.Attributes; import org.xml.sax.SAXException;
import org.xml.sax.*;
[ "org.xml.sax" ]
org.xml.sax;
1,483,713
if (request.getCookies() != null) { for (Cookie cook : request.getCookies()) { if (cook.getName().equals(BLOB)) { ObjectMapper o = new ObjectMapper(); try { SessionBlob blob = o.readValue(URLDecoder.decode(cook.getValue(), "UTF-8"), SessionBlob.class); if (blob != null) { return blo...
if (request.getCookies() != null) { for (Cookie cook : request.getCookies()) { if (cook.getName().equals(BLOB)) { ObjectMapper o = new ObjectMapper(); try { SessionBlob blob = o.readValue(URLDecoder.decode(cook.getValue(), "UTF-8"), SessionBlob.class); if (blob != null) { return blob; } } catch (IOException e) { throw ...
/** * Try to read the SessionBlob from the cookie. If no SessioBlob exist, a new * SessionBlob is created. If the SessionBlob is corrupted, an * IlligalStateException is thrown. * * @param request servlet request * @return SessionBlob */
Try to read the SessionBlob from the cookie. If no SessioBlob exist, a new SessionBlob is created. If the SessionBlob is corrupted, an IlligalStateException is thrown
getSessionBlob
{ "repo_name": "DescartesResearch/Pet-Supply-Store", "path": "services/tools.descartes.teastore.webui/src/main/java/tools/descartes/teastore/webui/servlet/AbstractUIServlet.java", "license": "apache-2.0", "size": 11747 }
[ "com.fasterxml.jackson.databind.ObjectMapper", "jakarta.servlet.http.Cookie", "java.io.IOException", "java.net.URLDecoder", "tools.descartes.teastore.entities.message.SessionBlob" ]
import com.fasterxml.jackson.databind.ObjectMapper; import jakarta.servlet.http.Cookie; import java.io.IOException; import java.net.URLDecoder; import tools.descartes.teastore.entities.message.SessionBlob;
import com.fasterxml.jackson.databind.*; import jakarta.servlet.http.*; import java.io.*; import java.net.*; import tools.descartes.teastore.entities.message.*;
[ "com.fasterxml.jackson", "jakarta.servlet.http", "java.io", "java.net", "tools.descartes.teastore" ]
com.fasterxml.jackson; jakarta.servlet.http; java.io; java.net; tools.descartes.teastore;
979,497
private void defineActions(IPageLayout layout) { // Add "new wizards". // layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");//$NON-NLS-1$ // layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");//$NON-NLS-1$ // Add "show views". layout.addShowViewShortcut(IPageLayout.ID_PROJECT_EXPL...
void function(IPageLayout layout) { layout.addShowViewShortcut(IPageLayout.ID_PROJECT_EXPLORER); layout.addShowViewShortcut(IPageLayout.ID_BOOKMARKS); layout.addShowViewShortcut(IPageLayout.ID_OUTLINE); layout.addShowViewShortcut(IPageLayout.ID_PROP_SHEET); layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW); if (i...
/** * Defines the initial actions for a page. * * @param layout * The layout we are filling */
Defines the initial actions for a page
defineActions
{ "repo_name": "GerardT/Arro", "path": "Arro/src/arro/perspective/ArroPerspective.java", "license": "epl-1.0", "size": 4044 }
[ "org.eclipse.ui.IPageLayout" ]
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.*;
[ "org.eclipse.ui" ]
org.eclipse.ui;
2,900,009
public static void openCustomTab(Activity activity, CustomTabsIntent customTabsIntent, Uri uri, CustomTabFallback fallback) { String packageName = CustomTabsHelper.getPackageNameToUse(activity); ...
static void function(Activity activity, CustomTabsIntent customTabsIntent, Uri uri, CustomTabFallback fallback) { String packageName = CustomTabsHelper.getPackageNameToUse(activity); if (packageName == null) { if (fallback != null) { fallback.openUri(activity, uri); } } else { customTabsIntent.intent.setPackage(package...
/** * Opens the URL on a Custom Tab if possible. Otherwise fallsback to opening it on a WebView * * @param activity The host activity * @param customTabsIntent a CustomTabsIntent to be used if Custom Tabs is available * @param uri the Uri to be opened * @param fallback a CustomTabFallback ...
Opens the URL on a Custom Tab if possible. Otherwise fallsback to opening it on a WebView
openCustomTab
{ "repo_name": "T-Rex96/Easy_xkcd", "path": "app/src/main/java/de/tap/easy_xkcd/CustomTabHelpers/CustomTabActivityHelper.java", "license": "apache-2.0", "size": 5170 }
[ "android.app.Activity", "android.net.Uri", "androidx.browser.customtabs.CustomTabsIntent" ]
import android.app.Activity; import android.net.Uri; import androidx.browser.customtabs.CustomTabsIntent;
import android.app.*; import android.net.*; import androidx.browser.customtabs.*;
[ "android.app", "android.net", "androidx.browser" ]
android.app; android.net; androidx.browser;
169,019
@SuppressWarnings("unchecked") ResultStep addIngredients(Supplier<? extends ItemType>... ingredients);
@SuppressWarnings(STR) ResultStep addIngredients(Supplier<? extends ItemType>... ingredients);
/** * Adds ingredients for this recipe. * * @param ingredients The ingredients to add * * @return This builder, for chaining */
Adds ingredients for this recipe
addIngredients
{ "repo_name": "SpongePowered/SpongeAPI", "path": "src/main/java/org/spongepowered/api/item/recipe/crafting/ShapelessCraftingRecipe.java", "license": "mit", "size": 5975 }
[ "java.util.function.Supplier", "org.spongepowered.api.item.ItemType" ]
import java.util.function.Supplier; import org.spongepowered.api.item.ItemType;
import java.util.function.*; import org.spongepowered.api.item.*;
[ "java.util", "org.spongepowered.api" ]
java.util; org.spongepowered.api;
1,350,618
public FSDataOutputStream create(Path f, short replication, Progressable progress) throws IOException { return create(f, true, getConf().getInt( CommonConfigurationKeysPublic.IO_FILE_BUFFER_SIZE_KEY, CommonConfigurationKeysPublic.IO_FILE_BUFFER...
FSDataOutputStream function(Path f, short replication, Progressable progress) throws IOException { return create(f, true, getConf().getInt( CommonConfigurationKeysPublic.IO_FILE_BUFFER_SIZE_KEY, CommonConfigurationKeysPublic.IO_FILE_BUFFER_SIZE_DEFAULT), replication, getDefaultBlockSize(f), progress); }
/** * Create an FSDataOutputStream at the indicated Path with write-progress * reporting. * Files are overwritten by default. * @param f the file to create * @param replication the replication factor * @param progress to report progress */
Create an FSDataOutputStream at the indicated Path with write-progress reporting. Files are overwritten by default
create
{ "repo_name": "fyqls/hadoop-2.4.0", "path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java", "license": "apache-2.0", "size": 102531 }
[ "java.io.IOException", "org.apache.hadoop.util.Progressable" ]
import java.io.IOException; import org.apache.hadoop.util.Progressable;
import java.io.*; import org.apache.hadoop.util.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
780,396
protected void addLength(Document doc, String propertyName, InternalValue value) { long length = Util.getLength(value); if (length != -1) { doc.add(new Field(FieldNames.PROPERTY_LENGTHS, false, FieldNames .crea...
void function(Document doc, String propertyName, InternalValue value) { long length = Util.getLength(value); if (length != -1) { doc.add(new Field(FieldNames.PROPERTY_LENGTHS, false, FieldNames .createNamedLength(propertyName, length), Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS, Field.TermVector.NO)); } }
/** * Adds a {@link FieldNames#PROPERTY_LENGTHS} field to <code>document</code> * with a named length value. * * @param doc the lucene document. * @param propertyName the property name. * @param value the internal value. */
Adds a <code>FieldNames#PROPERTY_LENGTHS</code> field to <code>document</code> with a named length value
addLength
{ "repo_name": "sdmcraft/jackrabbit", "path": "jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java", "license": "apache-2.0", "size": 41332 }
[ "org.apache.jackrabbit.core.value.InternalValue", "org.apache.lucene.document.Document", "org.apache.lucene.document.Field" ]
import org.apache.jackrabbit.core.value.InternalValue; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field;
import org.apache.jackrabbit.core.value.*; import org.apache.lucene.document.*;
[ "org.apache.jackrabbit", "org.apache.lucene" ]
org.apache.jackrabbit; org.apache.lucene;
303,403
public void clearCache() { log.info("Clear cache called: cacheRoot:"+getAbsCacheRoot() ); if ( this == singletonWADO ) { log.info("Clear WADO cache!"); File[] files = getAbsCacheRoot().listFiles(); if ( files == null ) { log.warn("WADO cache not cleared! Reason: cache root is not a directory or cant...
void function() { log.info(STR+getAbsCacheRoot() ); if ( this == singletonWADO ) { log.info(STR); File[] files = getAbsCacheRoot().listFiles(); if ( files == null ) { log.warn(STR); return; } for ( int i = 0, len = files.length ; i < len ; i++ ) { if ( ! files[i].getName().equals( DEFAULT_RID_SUBDIR ) ) { delTree( file...
/** * Clears this cache. * <p> * Remove all images in this cache. */
Clears this cache. Remove all images in this cache
clearCache
{ "repo_name": "medicayun/medicayundicom", "path": "dcm4jboss-all/tags/DCM4CHEE_2_10_9/dcm4jboss-wado/src/java/org/dcm4chex/wado/mbean/cache/WADOCacheImpl.java", "license": "apache-2.0", "size": 25588 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
1,719,194
private int addRepeat(SequenceEntry se, String repeat) { if (!repeat.equals("")) { try { int rep = Integer.decode(repeat); se.setRepeatEntry(new Repeat(new FixedIntegerValue(rep))); return rep; } catch (NumberFormatException e) { ...
int function(SequenceEntry se, String repeat) { if (!repeat.equals(STRCannot find the parameter for repeat " + repeat); } se.setRepeatEntry(new Repeat(new DynamicIntegerValue(new ParameterInstanceRef(repeatparam, true)))); return -1; } } else { return 1; } }
/** * If repeat != "", decodes it to either an integer or a parameter and adds it to the SequenceEntry If repeat is an * integer, this integer is returned */
If repeat != "", decodes it to either an integer or a parameter and adds it to the SequenceEntry If repeat is an integer, this integer is returned
addRepeat
{ "repo_name": "m-sc/yamcs", "path": "yamcs-core/src/main/java/org/yamcs/xtce/xlsv6/V6Loader.java", "license": "agpl-3.0", "size": 113816 }
[ "org.yamcs.xtce.DynamicIntegerValue", "org.yamcs.xtce.ParameterInstanceRef", "org.yamcs.xtce.Repeat", "org.yamcs.xtce.SequenceEntry" ]
import org.yamcs.xtce.DynamicIntegerValue; import org.yamcs.xtce.ParameterInstanceRef; import org.yamcs.xtce.Repeat; import org.yamcs.xtce.SequenceEntry;
import org.yamcs.xtce.*;
[ "org.yamcs.xtce" ]
org.yamcs.xtce;
480,511
//@Async public void increaseSearchTermCounterForUser(String user, String key) { User user2 = null; if(key == "" || key == null || key.trim().length() ==0 || key.equalsIgnoreCase("None")){ return; } if(user == null || user.trim().length() ==0 || user.trim().equalsIgnoreCase("ano...
void function(String user, String key) { User user2 = null; if(key == STRNoneSTRanonymousSTRUser can nopt be null"); } Keyword keyword = keywordRepository.findKeywordByText(key); if (keyword == null) { keyword = keywordRepository.save(new Keyword(key)); } UserKeywordRelation obj = searchRepository.findUserKeywordRelati...
/** * Increase search term counter for either normal user or anonymous user. * @param user * @param key */
Increase search term counter for either normal user or anonymous user
increaseSearchTermCounterForUser
{ "repo_name": "GrandViewTech/bookSystem", "path": "src/main/java/com/v2tech/services/UserKeywordRelationService.java", "license": "gpl-3.0", "size": 5481 }
[ "com.v2tech.domain.Keyword", "com.v2tech.domain.User", "com.v2tech.domain.UserKeywordRelation" ]
import com.v2tech.domain.Keyword; import com.v2tech.domain.User; import com.v2tech.domain.UserKeywordRelation;
import com.v2tech.domain.*;
[ "com.v2tech.domain" ]
com.v2tech.domain;
1,963,177
private static String getMethodFromDeclarationName(String fullDeclarationName) { String[] parts = fullDeclarationName.split("\\.prototype\\."); Preconditions.checkState(parts.length == 1 || parts.length == 2); if (parts.length == 2) { return parts[1]; } return null; }
static String function(String fullDeclarationName) { String[] parts = fullDeclarationName.split(STR); Preconditions.checkState(parts.length == 1 parts.length == 2); if (parts.length == 2) { return parts[1]; } return null; }
/** * From a provide name extract the method name. */
From a provide name extract the method name
getMethodFromDeclarationName
{ "repo_name": "phistuck/closure-compiler", "path": "src/com/google/javascript/jscomp/ReplaceStrings.java", "license": "apache-2.0", "size": 17300 }
[ "com.google.common.base.Preconditions" ]
import com.google.common.base.Preconditions;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
1,715,926
boolean isNamespaceEqualsToFacilityUnixGroupNameNamespace(PerunSessionImpl sess, Facility facility, String namespace) throws InternalErrorException, AttributeNotExistsException, WrongAttributeAssignmentException;
boolean isNamespaceEqualsToFacilityUnixGroupNameNamespace(PerunSessionImpl sess, Facility facility, String namespace) throws InternalErrorException, AttributeNotExistsException, WrongAttributeAssignmentException;
/** * If attribute "def_facility_unixGroup_namespace" is "null" return false. * If value of attribute "def_facility_unixGroup_namespace" is not same like "namespace", return false. * Else return true. * * Facility, sess and namespace can't be null, otherwise throw InternalErrorException * * @param sess ...
If attribute "def_facility_unixGroup_namespace" is "null" return false. If value of attribute "def_facility_unixGroup_namespace" is not same like "namespace", return false. Else return true. Facility, sess and namespace can't be null, otherwise throw InternalErrorException
isNamespaceEqualsToFacilityUnixGroupNameNamespace
{ "repo_name": "ondrocks/perun", "path": "perun-core/src/main/java/cz/metacentrum/perun/core/bl/ModulesUtilsBl.java", "license": "bsd-2-clause", "size": 14201 }
[ "cz.metacentrum.perun.core.api.Facility", "cz.metacentrum.perun.core.api.exceptions.AttributeNotExistsException", "cz.metacentrum.perun.core.api.exceptions.InternalErrorException", "cz.metacentrum.perun.core.api.exceptions.WrongAttributeAssignmentException", "cz.metacentrum.perun.core.impl.PerunSessionImpl"...
import cz.metacentrum.perun.core.api.Facility; import cz.metacentrum.perun.core.api.exceptions.AttributeNotExistsException; import cz.metacentrum.perun.core.api.exceptions.InternalErrorException; import cz.metacentrum.perun.core.api.exceptions.WrongAttributeAssignmentException; import cz.metacentrum.perun.core.impl.Per...
import cz.metacentrum.perun.core.api.*; import cz.metacentrum.perun.core.api.exceptions.*; import cz.metacentrum.perun.core.impl.*;
[ "cz.metacentrum.perun" ]
cz.metacentrum.perun;
1,763,376
private boolean validateBotUsernameAndToken(TelegramBot telegramBot) { return !Strings.isNullOrEmpty(telegramBot.getBotToken()) && !Strings.isNullOrEmpty(telegramBot.getBotUsername()); }
boolean function(TelegramBot telegramBot) { return !Strings.isNullOrEmpty(telegramBot.getBotToken()) && !Strings.isNullOrEmpty(telegramBot.getBotUsername()); }
/** * Checks that the username and token are presented * @param telegramBot bot to register * @return False if username or token are empty or null, true otherwise */
Checks that the username and token are presented
validateBotUsernameAndToken
{ "repo_name": "rubenlagus/TelegramBots", "path": "telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/TelegramBotsApi.java", "license": "mit", "size": 4361 }
[ "com.google.common.base.Strings", "org.telegram.telegrambots.meta.generics.TelegramBot" ]
import com.google.common.base.Strings; import org.telegram.telegrambots.meta.generics.TelegramBot;
import com.google.common.base.*; import org.telegram.telegrambots.meta.generics.*;
[ "com.google.common", "org.telegram.telegrambots" ]
com.google.common; org.telegram.telegrambots;
1,728,958
public List<Step> listSteps(String headStepId, PreparationRepository repository) { return listSteps(repository.get(headStepId, Step.class), Step.ROOT_STEP.getId(), repository); }
List<Step> function(String headStepId, PreparationRepository repository) { return listSteps(repository.get(headStepId, Step.class), Step.ROOT_STEP.getId(), repository); }
/** * Returns a list of all steps available from <code>step</code> parameter. Since all preparations share the same * root, calling this method is equivalent to: * <code> * listSteps(step, PreparationActions.ROOT_CONTENT.getId(), repository); * </code> * * @param headStepId The head s...
Returns a list of all steps available from <code>step</code> parameter. Since all preparations share the same root, calling this method is equivalent to: <code> listSteps(step, PreparationActions.ROOT_CONTENT.getId(), repository); </code>
listSteps
{ "repo_name": "Talend/data-prep", "path": "dataprep-backend-service/src/main/java/org/talend/dataprep/api/preparation/PreparationUtils.java", "license": "apache-2.0", "size": 9486 }
[ "java.util.List", "org.talend.dataprep.preparation.store.PreparationRepository" ]
import java.util.List; import org.talend.dataprep.preparation.store.PreparationRepository;
import java.util.*; import org.talend.dataprep.preparation.store.*;
[ "java.util", "org.talend.dataprep" ]
java.util; org.talend.dataprep;
792,070
void getFile(String projectName, String dataId, HttpServletResponse httpServletResponse, Principal principal);
void getFile(String projectName, String dataId, HttpServletResponse httpServletResponse, Principal principal);
/** * Retrieves file from file system * * @param projectName * @param dataId * @param httpServletResponse * @param principal */
Retrieves file from file system
getFile
{ "repo_name": "talisman1234/service-api", "path": "src/main/java/com/epam/ta/reportportal/ws/controller/IFileStorageController.java", "license": "gpl-3.0", "size": 2118 }
[ "java.security.Principal", "javax.servlet.http.HttpServletResponse" ]
import java.security.Principal; import javax.servlet.http.HttpServletResponse;
import java.security.*; import javax.servlet.http.*;
[ "java.security", "javax.servlet" ]
java.security; javax.servlet;
587,854
@Test(timeout = 2000) public void testAppXML() throws Exception { String appId = submitApplication(); List<AppInfo> responses = performGetCalls( RM_WEB_SERVICE_PATH + format(APPS_APPID, appId), AppInfo.class, null, null); AppInfo routerResponse = responses.get(0); AppInfo rmRespon...
@Test(timeout = 2000) void function() throws Exception { String appId = submitApplication(); List<AppInfo> responses = performGetCalls( RM_WEB_SERVICE_PATH + format(APPS_APPID, appId), AppInfo.class, null, null); AppInfo routerResponse = responses.get(0); AppInfo rmResponse = responses.get(1); assertNotNull(routerRespo...
/** * This test validates the correctness of * {@link RMWebServiceProtocol#getApp()} inside Router. */
This test validates the correctness of <code>RMWebServiceProtocol#getApp()</code> inside Router
testAppXML
{ "repo_name": "apurtell/hadoop", "path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/test/java/org/apache/hadoop/yarn/server/router/webapp/TestRouterWebServicesREST.java", "license": "apache-2.0", "size": 51798 }
[ "java.util.List", "org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppInfo", "org.junit.Assert", "org.junit.Test" ]
import java.util.List; import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppInfo; import org.junit.Assert; import org.junit.Test;
import java.util.*; import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.*; import org.junit.*;
[ "java.util", "org.apache.hadoop", "org.junit" ]
java.util; org.apache.hadoop; org.junit;
501,526
public void testInvalidRestoreFrom() throws SQLException { // No ordering imposed by JUnit, so we create our own db and backup. String dbName = "encryptionKeyDBToInvalidRestoreFrom"; String dbNameRestored = dbName + "Restored"; createBackupRestore(dbName, dbNameRestored);...
void function() throws SQLException { String dbName = STR; String dbNameRestored = dbName + STR; createBackupRestore(dbName, dbNameRestored); shutdown(dbNameRestored, STR); confirmNonBootedDB(STR + dbNameRestored); con = getConnection(STR + dbNameRestored, CORRECT_KEY); validateDBContents(con); con.close(); shutdown(db...
/** * Try to recover database with an invalid key. * <p> * It should be noted that the existing database, which has been previously * recovered from the same backup image, is deleted/overwritten even though * Derby is unable to boot the backup image. */
Try to recover database with an invalid key. It should be noted that the existing database, which has been previously recovered from the same backup image, is deleted/overwritten even though Derby is unable to boot the backup image
testInvalidRestoreFrom
{ "repo_name": "kavin256/Derby", "path": "java/testing/org/apache/derbyTesting/functionTests/tests/store/EncryptionKeyTest.java", "license": "apache-2.0", "size": 26437 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
70,208
public Font getFont() { return g.getFont(); }
Font function() { return g.getFont(); }
/** * Gets the current font. * @return this graphics context's current font. * @see java.awt.Font * @see java.awt.Graphics#setFont */
Gets the current font
getFont
{ "repo_name": "TheTypoMaster/Scaper", "path": "openjdk/jdk/src/share/classes/sun/print/ProxyGraphics.java", "license": "gpl-2.0", "size": 53194 }
[ "java.awt.Font" ]
import java.awt.Font;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,871,565
public static byte[] computeAuthenticationChallenge(byte[] nonce, String realm, boolean access, boolean userID) throws IOException { byte[] authChall = null; if (nonce.length != 16) { throw new IllegalArgumentException("Nonce must ...
static byte[] function(byte[] nonce, String realm, boolean access, boolean userID) throws IOException { byte[] authChall = null; if (nonce.length != 16) { throw new IllegalArgumentException(STR); } if (realm == null) { authChall = new byte[21]; } else { if (realm.length() >= 255) { throw new IllegalArgumentException(ST...
/** * Computes an authentication challenge header. * @param nonce the challenge that will be provided to the peer; the * challenge must be 16 bytes long * @param realm a short description that describes what password to use * @param access if <code>true</code> then full access will be gr...
Computes an authentication challenge header
computeAuthenticationChallenge
{ "repo_name": "dzungductran/blaster", "path": "app/src/main/java/javax/obex/ObexHelper.java", "license": "apache-2.0", "size": 39337 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,600,377
public static void main(String[] args) { // If filename given as first command-line argument, replace filename // set above. if (args.length == 1) filename = args[0]; try { // Filename represents single .vm file. if (filename.endsWith(".v...
static void function(String[] args) { if (args.length == 1) filename = args[0]; try { if (filename.endsWith(".vm")) { CodeWriter codeWriter = new CodeWriter( filename.replace(".vm", ".asm")); translateFile(codeWriter, filename); codeWriter.close(); } else { String noPathFilename = filename.substring( filename.lastIndex...
/** * Translate a Hack VM language input file... * * @param args Command-line arguments. Optional first argument may be used * to specify an input file. */
Translate a Hack VM language input file..
main
{ "repo_name": "nerdkid93/cis384", "path": "chapter08_2/VmTranslator.java", "license": "mit", "size": 3813 }
[ "java.io.File", "java.io.FileNotFoundException" ]
import java.io.File; import java.io.FileNotFoundException;
import java.io.*;
[ "java.io" ]
java.io;
1,891,684
public SoyData get(String keyStr) { List<String> keys = split(keyStr, '.'); int numKeys = keys.size(); CollectionData collectionData = this; for (int i = 0; i <= numKeys - 2; ++i) { SoyData soyData = collectionData.getSingle(keys.get(i)); if (!(soyData instanceof CollectionData)) { ...
SoyData function(String keyStr) { List<String> keys = split(keyStr, '.'); int numKeys = keys.size(); CollectionData collectionData = this; for (int i = 0; i <= numKeys - 2; ++i) { SoyData soyData = collectionData.getSingle(keys.get(i)); if (!(soyData instanceof CollectionData)) { return null; } collectionData = (Collec...
/** * Gets the data at the specified key string. * @param keyStr One or more map keys and/or list indices (separated by '.' if multiple parts). * Indicates the path to the location within this data tree. * @return The data at the specified key string, or null if there's no data at the location. */
Gets the data at the specified key string
get
{ "repo_name": "viqueen/closure-templates", "path": "java/src/com/google/template/soy/data/restricted/CollectionData.java", "license": "apache-2.0", "size": 13843 }
[ "com.google.template.soy.data.SoyData", "java.util.List" ]
import com.google.template.soy.data.SoyData; import java.util.List;
import com.google.template.soy.data.*; import java.util.*;
[ "com.google.template", "java.util" ]
com.google.template; java.util;
2,170,999
public void addLayoutFrame(JFrame frame) { this.frame = frame; }
void function(JFrame frame) { this.frame = frame; }
/** * Add main JFrame * @param frame */
Add main JFrame
addLayoutFrame
{ "repo_name": "adrian-tilita/ezDuplicateFileFinder", "path": "src/layout/helper/MainHelper.java", "license": "mit", "size": 15551 }
[ "javax.swing.JFrame" ]
import javax.swing.JFrame;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
390,222
@SuppressWarnings("unused") private void setVisible(JSONArray args, CallbackContext callbackContext) throws JSONException { boolean visible = args.getBoolean(0); if (this.windowLayer == null) { if (visible) { mapView.setVisibility(View.VISIBLE); } else { mapView.setVisibil...
@SuppressWarnings(STR) void function(JSONArray args, CallbackContext callbackContext) throws JSONException { boolean visible = args.getBoolean(0); if (this.windowLayer == null) { if (visible) { mapView.setVisibility(View.VISIBLE); } else { mapView.setVisibility(View.INVISIBLE); } } this.sendNoResult(callbackContext); }
/** * Set visibility of the map * @param args * @param callbackContext * @throws JSONException */
Set visibility of the map
setVisible
{ "repo_name": "MasGaNo/gameofcode", "path": "GameOfCode/plugins/cordova-plugin-googlemaps/src/android/plugin/google/maps/GoogleMaps.java", "license": "apache-2.0", "size": 78095 }
[ "android.view.View", "org.apache.cordova.CallbackContext", "org.json.JSONArray", "org.json.JSONException" ]
import android.view.View; import org.apache.cordova.CallbackContext; import org.json.JSONArray; import org.json.JSONException;
import android.view.*; import org.apache.cordova.*; import org.json.*;
[ "android.view", "org.apache.cordova", "org.json" ]
android.view; org.apache.cordova; org.json;
1,611,703
private static void testClientRejectingOcspStaple(SslProvider sslProvider) throws Exception { final AtomicReference<Throwable> causeRef = new AtomicReference<Throwable>(); final CountDownLatch latch = new CountDownLatch(1);
static void function(SslProvider sslProvider) throws Exception { final AtomicReference<Throwable> causeRef = new AtomicReference<Throwable>(); final CountDownLatch latch = new CountDownLatch(1);
/** * The Server provides an OCSP staple and the Client rejects it. */
The Server provides an OCSP staple and the Client rejects it
testClientRejectingOcspStaple
{ "repo_name": "imangry/netty-zh", "path": "handler/src/test/java/io/netty/handler/ssl/ocsp/OcspTest.java", "license": "apache-2.0", "size": 18838 }
[ "io.netty.handler.ssl.SslProvider", "java.util.concurrent.CountDownLatch", "java.util.concurrent.atomic.AtomicReference" ]
import io.netty.handler.ssl.SslProvider; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicReference;
import io.netty.handler.ssl.*; import java.util.concurrent.*; import java.util.concurrent.atomic.*;
[ "io.netty.handler", "java.util" ]
io.netty.handler; java.util;
590,152
private void fitImageToView() { Drawable drawable = getDrawable(); if (drawable == null || drawable.getIntrinsicWidth() == 0 || drawable.getIntrinsicHeight() == 0) { return; } if (matrix == null || prevMatrix == null) { return; } int drawableWi...
void function() { Drawable drawable = getDrawable(); if (drawable == null drawable.getIntrinsicWidth() == 0 drawable.getIntrinsicHeight() == 0) { return; } if (matrix == null prevMatrix == null) { return; } int drawableWidth = drawable.getIntrinsicWidth(); int drawableHeight = drawable.getIntrinsicHeight(); float scale...
/** * If the normalizedScale is equal to 1, then the image is made to fit the screen. Otherwise, * it is made to fit the screen according to the dimensions of the previous image matrix. This * allows the image to maintain its zoom after rotation. */
If the normalizedScale is equal to 1, then the image is made to fit the screen. Otherwise, it is made to fit the screen according to the dimensions of the previous image matrix. This allows the image to maintain its zoom after rotation
fitImageToView
{ "repo_name": "LSL-Git/ImageLabelerApp", "path": "photo-selector/src/main/java/com/sleepyzzz/photo_selector/view/TouchImageView.java", "license": "apache-2.0", "size": 40804 }
[ "android.graphics.Matrix", "android.graphics.drawable.Drawable" ]
import android.graphics.Matrix; import android.graphics.drawable.Drawable;
import android.graphics.*; import android.graphics.drawable.*;
[ "android.graphics" ]
android.graphics;
1,325,945
INodeSymlink addSymlink(String path, String target, PermissionStatus dirPerms, boolean createParent, boolean logRetryCache) throws UnresolvedLinkException, FileAlreadyExistsException, QuotaExceededException, SnapshotAccessControlException, AclException { waitForReady(); final long modTime =...
INodeSymlink addSymlink(String path, String target, PermissionStatus dirPerms, boolean createParent, boolean logRetryCache) throws UnresolvedLinkException, FileAlreadyExistsException, QuotaExceededException, SnapshotAccessControlException, AclException { waitForReady(); final long modTime = now(); if (createParent) { f...
/** * Add the given symbolic link to the fs. Record it in the edits log. */
Add the given symbolic link to the fs. Record it in the edits log
addSymlink
{ "repo_name": "yelshater/hadoop-2.3.0", "path": "hadoop-hdfs-2.3.0-cdh5.1.0/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java", "license": "apache-2.0", "size": 110238 }
[ "org.apache.hadoop.fs.FileAlreadyExistsException", "org.apache.hadoop.fs.Path", "org.apache.hadoop.fs.UnresolvedLinkException", "org.apache.hadoop.fs.permission.FsPermission", "org.apache.hadoop.fs.permission.PermissionStatus", "org.apache.hadoop.hdfs.protocol.AclException", "org.apache.hadoop.hdfs.prot...
import org.apache.hadoop.fs.FileAlreadyExistsException; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.UnresolvedLinkException; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.fs.permission.PermissionStatus; import org.apache.hadoop.hdfs.protocol.AclException; import org.apa...
import org.apache.hadoop.fs.*; import org.apache.hadoop.fs.permission.*; import org.apache.hadoop.hdfs.protocol.*; import org.apache.hadoop.util.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,343,456
private void serveProject(ProjectBean bean, TarWriter writer, ResourceResponse response, OpenBisClient openbisClient) { String filename = bean.getCode() + ".tar"; response.setContentType(writer.getContentType()); StringBuilder sb = new StringBuilder("attachement; filename=\""); sb.append(filena...
void function(ProjectBean bean, TarWriter writer, ResourceResponse response, OpenBisClient openbisClient) { String filename = bean.getCode() + ".tar"; response.setContentType(writer.getContentType()); StringBuilder sb = new StringBuilder(STRSTR\STRContent-DispositionSTRContent-LengthSTR/STRSTR/STR/STR/" + entry.getKey(...
/** * * Note: the provided stream will be closed. * * @param bean bean containing datasets. * @param writer writes * @param response writer writes to its outputstream * @param openbisClient */
Note: the provided stream will be closed
serveProject
{ "repo_name": "qbicsoftware/qnavigator", "path": "QBiCMainPortlet/src/de/uni_tuebingen/qbic/qbicmainportlet/CustomVaadinPortlet.java", "license": "gpl-3.0", "size": 28859 }
[ "javax.portlet.ResourceResponse", "life.qbic.openbis.openbisclient.OpenBisClient" ]
import javax.portlet.ResourceResponse; import life.qbic.openbis.openbisclient.OpenBisClient;
import javax.portlet.*; import life.qbic.openbis.openbisclient.*;
[ "javax.portlet", "life.qbic.openbis" ]
javax.portlet; life.qbic.openbis;
651,657
@ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<Flux<ByteBuffer>>> deleteMongoDBDatabaseWithResponseAsync( String resourceGroupName, String accountName, String databaseName);
@ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<Flux<ByteBuffer>>> deleteMongoDBDatabaseWithResponseAsync( String resourceGroupName, String accountName, String databaseName);
/** * Deletes an existing Azure Cosmos DB MongoDB database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thr...
Deletes an existing Azure Cosmos DB MongoDB database
deleteMongoDBDatabaseWithResponseAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/MongoDBResourcesClient.java", "license": "mit", "size": 104176 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "java.nio.ByteBuffer" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import java.nio.ByteBuffer;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import java.nio.*;
[ "com.azure.core", "java.nio" ]
com.azure.core; java.nio;
1,805,551
private int getSourceInfoOffset(Node provideStringNode) { if (provideStringNode == null) { return 0; } int indexOfLastDot = namespace.lastIndexOf('.'); // +1 for the opening quote // +1 for the dot // if there's no dot, then the -1 index cancels it out // so elega...
int function(Node provideStringNode) { if (provideStringNode == null) { return 0; } int indexOfLastDot = namespace.lastIndexOf('.'); return 2 + indexOfLastDot; }
/** * Get the offset into the provide node where the symbol appears. */
Get the offset into the provide node where the symbol appears
getSourceInfoOffset
{ "repo_name": "jimmytuc/closure-compiler", "path": "src/com/google/javascript/jscomp/ProcessClosurePrimitives.java", "license": "apache-2.0", "size": 54595 }
[ "com.google.javascript.rhino.Node" ]
import com.google.javascript.rhino.Node;
import com.google.javascript.rhino.*;
[ "com.google.javascript" ]
com.google.javascript;
226,989
public ArrayList<Request> getRequestsByKeyword(String keyword){ ArrayList<Request> gotRequest = new ArrayList<>(); ElasticSearchController.GetRequests getRequestsTask = new ElasticSearchController.GetRequests(); try { gotRequest = getRequestsTask.execute(ElasticSearchQueries.KEY...
ArrayList<Request> function(String keyword){ ArrayList<Request> gotRequest = new ArrayList<>(); ElasticSearchController.GetRequests getRequestsTask = new ElasticSearchController.GetRequests(); try { gotRequest = getRequestsTask.execute(ElasticSearchQueries.KEYWORD, keyword).get(); } catch (Exception e) { e.printStackTr...
/** * Wrapper for ElasticSearch get that focusses on the request keyword * @param keyword the string you wish to find in the request description * @return Arraylist of requests that contain the string in their description */
Wrapper for ElasticSearch get that focusses on the request keyword
getRequestsByKeyword
{ "repo_name": "CMPUT301F16T05/legendary-telegram", "path": "app/src/main/java/com/cmput301fa16t5/legendary_telegram/CentralController.java", "license": "gpl-3.0", "size": 17944 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
1,167,498
private void setPriceListVersion(int M_PriceList_Version_ID) { log.config("M_PriceList_Version_ID=" + M_PriceList_Version_ID); for (int i = 0; i < pickPriceList.getItemCount(); i++) { KeyNamePair kn = (KeyNamePair)pickPriceList.getItemAt(i); if (kn.getKey() == M_PriceList_Version_ID) { pi...
void function(int M_PriceList_Version_ID) { log.config(STR + M_PriceList_Version_ID); for (int i = 0; i < pickPriceList.getItemCount(); i++) { KeyNamePair kn = (KeyNamePair)pickPriceList.getItemAt(i); if (kn.getKey() == M_PriceList_Version_ID) { pickPriceList.setSelectedIndex(i); return; } } log.fine(STR); }
/** * Set PriceList * * @param M_PriceList_Version_ID price list */
Set PriceList
setPriceListVersion
{ "repo_name": "arthurmelo88/palmetalADP", "path": "adempiereTrunk/client/src/org/compiere/apps/search/InfoProduct.java", "license": "gpl-2.0", "size": 47467 }
[ "org.compiere.util.KeyNamePair" ]
import org.compiere.util.KeyNamePair;
import org.compiere.util.*;
[ "org.compiere.util" ]
org.compiere.util;
2,334,064
private void processSpecial(String inString) throws BadSpecial, QuitNow, SQLException, SqlToolError { int index = 0; int special; String arg1, other = null; if (inString.length() < 1) { throw new BadSpecial("Null special command"); } ...
void function(String inString) throws BadSpecial, QuitNow, SQLException, SqlToolError { int index = 0; int special; String arg1, other = null; if (inString.length() < 1) { throw new BadSpecial(STR); } if (plMode) { inString = dereference(inString, false); } StringTokenizer toker = new StringTokenizer(inString); arg1 = ...
/** * Process a Special Command. * * @param inString Complete command, less the leading '\' character. * @throws SQLException Passed through from processSQL() * @throws BadSpecial Runtime error() * @throws QuitNot Command execution (but not the JVM!) should stop */
Process a Special Command
processSpecial
{ "repo_name": "simeshev/parabuild-ci", "path": "3rdparty/hsqldb1733/src/org/hsqldb/util/SqlFile.java", "license": "lgpl-3.0", "size": 92903 }
[ "java.sql.SQLException", "java.util.StringTokenizer" ]
import java.sql.SQLException; import java.util.StringTokenizer;
import java.sql.*; import java.util.*;
[ "java.sql", "java.util" ]
java.sql; java.util;
450,510
public Button getEditEmailPropertiesButton() { return editEmailPropertiesButton; }
Button function() { return editEmailPropertiesButton; }
/** * To get Edit Email Properties Button. * * @return Button */
To get Edit Email Properties Button
getEditEmailPropertiesButton
{ "repo_name": "kuzavas/ephesoft", "path": "dcma-gwt/dcma-gwt-admin/src/main/java/com/ephesoft/dcma/gwt/admin/bm/client/view/email/EmailDetailView.java", "license": "agpl-3.0", "size": 8299 }
[ "com.google.gwt.user.client.ui.Button" ]
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.*;
[ "com.google.gwt" ]
com.google.gwt;
2,735,984
@SuppressLint("SdCardPath") @Deprecated public static boolean isExternalFile(String mediaPath) { Log.w(LOG_TAG, "Calling deprecated version of isExternalFile", new IllegalAccessException()); return mediaPath.startsWith(QUtil.getExternalStoragePath(Form.getActiveForm())) || mediaPath.startsWith("/s...
@SuppressLint(STR) static boolean function(String mediaPath) { Log.w(LOG_TAG, STR, new IllegalAccessException()); return mediaPath.startsWith(QUtil.getExternalStoragePath(Form.getActiveForm())) mediaPath.startsWith(STR) isExternalFileUrl(Form.getActiveForm(), mediaPath); }
/** * Tests whether the given path is a pathname pointing to an external file. * * <p> * This function is deprecated. Developers should use * {@link #isExternalFile(Context, String)} instead. * </p> * * @param mediaPath path to a media file * @return true if the mediaPath is on external stora...
Tests whether the given path is a pathname pointing to an external file. This function is deprecated. Developers should use <code>#isExternalFile(Context, String)</code> instead.
isExternalFile
{ "repo_name": "mit-cml/appinventor-sources", "path": "appinventor/components/src/com/google/appinventor/components/runtime/util/MediaUtil.java", "license": "apache-2.0", "size": 30913 }
[ "android.annotation.SuppressLint", "android.util.Log", "com.google.appinventor.components.runtime.Form" ]
import android.annotation.SuppressLint; import android.util.Log; import com.google.appinventor.components.runtime.Form;
import android.annotation.*; import android.util.*; import com.google.appinventor.components.runtime.*;
[ "android.annotation", "android.util", "com.google.appinventor" ]
android.annotation; android.util; com.google.appinventor;
1,133,887
@SuppressWarnings("unchecked") public <T extends IAbstractNodeData> T encodeLive(final T node) { if (node == null) throw new IllegalArgumentException(); if (node.isCoded()) { // already coded. throw new IllegalStateException(); } ...
@SuppressWarnings(STR) <T extends IAbstractNodeData> T function(final T node) { if (node == null) throw new IllegalArgumentException(); if (node.isCoded()) { throw new IllegalStateException(); } if (_writeBuffer == null) { allocWriteBuffer(); } else { _writeBuffer.reset(); } final T codedNode; if(node.isLeaf()) { coded...
/** * Encode a node or leaf and return a coded instance of the persistent data * for that node or leaf backed by an exact fit byte[] (NOT thread-safe). * The operation writes on an internal buffer which is automatically * extended as required. * * @param node * The node or...
Encode a node or leaf and return a coded instance of the persistent data for that node or leaf backed by an exact fit byte[] (NOT thread-safe). The operation writes on an internal buffer which is automatically extended as required
encodeLive
{ "repo_name": "blazegraph/database", "path": "bigdata-core/bigdata/src/java/com/bigdata/btree/NodeSerializer.java", "license": "gpl-2.0", "size": 20131 }
[ "com.bigdata.btree.data.IAbstractNodeData", "com.bigdata.btree.data.ILeafData", "com.bigdata.btree.data.INodeData", "com.bigdata.io.DataOutputBuffer" ]
import com.bigdata.btree.data.IAbstractNodeData; import com.bigdata.btree.data.ILeafData; import com.bigdata.btree.data.INodeData; import com.bigdata.io.DataOutputBuffer;
import com.bigdata.btree.data.*; import com.bigdata.io.*;
[ "com.bigdata.btree", "com.bigdata.io" ]
com.bigdata.btree; com.bigdata.io;
1,890,912
private String processAssignmentFeedbackFromBrowser(SessionState state, String strFromBrowser) { if (strFromBrowser == null || strFromBrowser.length() == 0) return strFromBrowser; StringBuilder buf = new StringBuilder(strFromBrowser); int pos = -1; int numopentags = 0; while ((pos = buf.indexOf("{{")) !...
String function(SessionState state, String strFromBrowser) { if (strFromBrowser == null strFromBrowser.length() == 0) return strFromBrowser; StringBuilder buf = new StringBuilder(strFromBrowser); int pos = -1; int numopentags = 0; while ((pos = buf.indexOf("{{")) != -1) { buf.replace(pos, pos + "{{".length(), "<ins>");...
/** * Processes the given assignmnent feedback text, as returned from the user's browser. Makes sure that the Chef-style markup {{like this}} is properly balanced. */
Processes the given assignmnent feedback text, as returned from the user's browser. Makes sure that the Chef-style markup {{like this}} is properly balanced
processAssignmentFeedbackFromBrowser
{ "repo_name": "frasese/sakai", "path": "assignment/assignment-tool/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java", "license": "apache-2.0", "size": 686269 }
[ "org.sakaiproject.event.api.SessionState" ]
import org.sakaiproject.event.api.SessionState;
import org.sakaiproject.event.api.*;
[ "org.sakaiproject.event" ]
org.sakaiproject.event;
1,497,006
private JPanel getJPanelStopSettings() { if (jPanelStopSettings == null) { jLabelStopDate = new JLabel(); jLabelStopDate.setFont(new Font("Dialog", Font.PLAIN, 11)); jLabelStopDate.setText("Datum"); jLabelStopDate.setText(Language.translate(jLabelStopDate.getText())+ ":"); jLabelStopDate.setPref...
JPanel function() { if (jPanelStopSettings == null) { jLabelStopDate = new JLabel(); jLabelStopDate.setFont(new Font(STR, Font.PLAIN, 11)); jLabelStopDate.setText("Datum"); jLabelStopDate.setText(Language.translate(jLabelStopDate.getText())+ ":"); jLabelStopDate.setPreferredSize(new Dimension(35, 16)); jLabelStopMillis...
/** * This method initializes jPanelStopSettings * @return javax.swing.JPanel */
This method initializes jPanelStopSettings
getJPanelStopSettings
{ "repo_name": "EnFlexIT/AgentWorkbench", "path": "eclipseProjects/org.agentgui/bundles/org.awb.env.networkModel/src/org/awb/env/networkModel/controller/ui/timeModel/JPanelTimeModelDiscrete.java", "license": "lgpl-2.1", "size": 25248 }
[ "java.awt.Dimension", "java.awt.FlowLayout", "java.awt.Font", "javax.swing.JLabel", "javax.swing.JPanel" ]
import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Font; import javax.swing.JLabel; import javax.swing.JPanel;
import java.awt.*; import javax.swing.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
2,323,370
@Test public void testShowRoleGrantRole() throws Exception { DDLWork work = analyze("SHOW ROLE GRANT ROLE " + ROLE); RoleDDLDesc roleDesc = work.getRoleDDLDesc(); Assert.assertNotNull("Role should not be null", roleDesc); Assert.assertEquals(RoleOperation.SHOW_ROLE_GRANT, roleDesc.getOperation()); ...
void function() throws Exception { DDLWork work = analyze(STR + ROLE); RoleDDLDesc roleDesc = work.getRoleDDLDesc(); Assert.assertNotNull(STR, roleDesc); Assert.assertEquals(RoleOperation.SHOW_ROLE_GRANT, roleDesc.getOperation()); Assert.assertEquals(PrincipalType.ROLE, roleDesc.getPrincipalType()); Assert.assertEquals...
/** * SHOW ROLE GRANT ROLE ... */
SHOW ROLE GRANT ROLE ..
testShowRoleGrantRole
{ "repo_name": "cschenyuan/hive-hack", "path": "ql/src/test/org/apache/hadoop/hive/ql/parse/authorization/TestHiveAuthorizationTaskFactory.java", "license": "apache-2.0", "size": 21349 }
[ "junit.framework.Assert", "org.apache.hadoop.hive.metastore.api.PrincipalType", "org.apache.hadoop.hive.ql.plan.DDLWork", "org.apache.hadoop.hive.ql.plan.RoleDDLDesc" ]
import junit.framework.Assert; import org.apache.hadoop.hive.metastore.api.PrincipalType; import org.apache.hadoop.hive.ql.plan.DDLWork; import org.apache.hadoop.hive.ql.plan.RoleDDLDesc;
import junit.framework.*; import org.apache.hadoop.hive.metastore.api.*; import org.apache.hadoop.hive.ql.plan.*;
[ "junit.framework", "org.apache.hadoop" ]
junit.framework; org.apache.hadoop;
565,817
@Test(expected = IllegalStateException.class) public void testStartGame() { this.state.startGame(new ArrayList<StonePlayer>()); }
@Test(expected = IllegalStateException.class) void function() { this.state.startGame(new ArrayList<StonePlayer>()); }
/** * Test of startGame method, of class GameStateCreated. */
Test of startGame method, of class GameStateCreated
testStartGame
{ "repo_name": "sayraozden/java-stone-board-game", "path": "game-service/src/test/java/com/sayraozden/game/stone/GameStateCreatedTest.java", "license": "gpl-3.0", "size": 2141 }
[ "java.util.ArrayList", "org.junit.Test" ]
import java.util.ArrayList; import org.junit.Test;
import java.util.*; import org.junit.*;
[ "java.util", "org.junit" ]
java.util; org.junit;
1,613,609
boolean isRuneType(World world, int x, int y, int z, int meta, int runeType);
boolean isRuneType(World world, int x, int y, int z, int meta, int runeType);
/** * x, y, and z give the position of the Ritual Stone * @param world * @param x * @param y * @param z * @param meta * @param runeType * @return */
x, y, and z give the position of the Ritual Stone
isRuneType
{ "repo_name": "TGMP/ModularArmour", "path": "src/api/java/WayofTime/alchemicalWizardry/api/rituals/IRitualStone.java", "license": "gpl-3.0", "size": 367 }
[ "net.minecraft.world.World" ]
import net.minecraft.world.World;
import net.minecraft.world.*;
[ "net.minecraft.world" ]
net.minecraft.world;
314,339
public boolean dbWrite(String sql, Object[] fields) { if (LOG.isDebugEnabled()) { LOG.debug("dbWrite(String " + sql + ", Object[] " + Arrays.toString(fields) + ")"); } return dbWrite(sql, fields, null, null, false); }
boolean function(String sql, Object[] fields) { if (LOG.isDebugEnabled()) { LOG.debug(STR + sql + STR + Arrays.toString(fields) + ")"); } return dbWrite(sql, fields, null, null, false); }
/** * Execute the "write" sql - no response, using a set of fields from an array plus one more as params. * * @param sql * The sql statement. * @param fields * The array of fields for parameters. * @return true if successful, false if not. */
Execute the "write" sql - no response, using a set of fields from an array plus one more as params
dbWrite
{ "repo_name": "eemirtekin/Sakai-10.6-TR", "path": "kernel/kernel-impl/src/main/java/org/sakaiproject/db/impl/BasicSqlService.java", "license": "apache-2.0", "size": 65596 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
2,448,987
private static void storeDefaultUrlsInPreferences(Context c) { String configUrl = Preferences.getDynamicConfigServerUrl(c); String updateUrl = Preferences.getDynamicUpdateServerUrl(c); if(configUrl == null) configUrl = DYNAMIC_CONFIG_SERVER_DEFAULT_URL; if(updateUrl == null) updateUrl = DYNAMIC_...
static void function(Context c) { String configUrl = Preferences.getDynamicConfigServerUrl(c); String updateUrl = Preferences.getDynamicUpdateServerUrl(c); if(configUrl == null) configUrl = DYNAMIC_CONFIG_SERVER_DEFAULT_URL; if(updateUrl == null) updateUrl = DYNAMIC_CONFIG_SERVER_URL_UPDATE; Preferences.setDynamicConfi...
/** * Sets config server URLs in shared prefs to defaul when not set already. It keeps * URLs when already set in shared preferences. * @param c */
Sets config server URLs in shared prefs to defaul when not set already. It keeps URLs when already set in shared preferences
storeDefaultUrlsInPreferences
{ "repo_name": "mkodekar/Fennece-Browser", "path": "thirdparty/com/keepsafe/switchboard/SwitchBoard.java", "license": "mpl-2.0", "size": 15487 }
[ "android.content.Context" ]
import android.content.Context;
import android.content.*;
[ "android.content" ]
android.content;
1,853,380
boolean supports(ConfigAttribute attribute);
boolean supports(ConfigAttribute attribute);
/** * Indicates whether this <code>AfterInvocationManager</code> is able to process * "after invocation" requests presented with the passed <code>ConfigAttribute</code>. * <p> * This allows the <code>AbstractSecurityInterceptor</code> to check every * configuration attribute can be consumed by the configured ...
Indicates whether this <code>AfterInvocationManager</code> is able to process "after invocation" requests presented with the passed <code>ConfigAttribute</code>. This allows the <code>AbstractSecurityInterceptor</code> to check every configuration attribute can be consumed by the configured <code>AccessDecisionManager<...
supports
{ "repo_name": "panchenko/spring-security", "path": "core/src/main/java/org/springframework/security/access/intercept/AfterInvocationManager.java", "license": "apache-2.0", "size": 4209 }
[ "org.springframework.security.access.ConfigAttribute" ]
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.access.*;
[ "org.springframework.security" ]
org.springframework.security;
1,737,976
protected String getFindingMessage( @SuppressWarnings("unused") Assessment assessment) { return findingMessage; }
String function( @SuppressWarnings(STR) Assessment assessment) { return findingMessage; }
/** * Gets the finding message for the given {@link Assessment}. Sub-classes of * {@link LocalAssessorBase} may overwrite this method for specific message. */
Gets the finding message for the given <code>Assessment</code>. Sub-classes of <code>LocalAssessorBase</code> may overwrite this method for specific message
getFindingMessage
{ "repo_name": "vimaier/conqat", "path": "org.conqat.engine.commons/src/org/conqat/engine/commons/assessment/LocalAssessorBase.java", "license": "apache-2.0", "size": 12820 }
[ "org.conqat.lib.commons.assessment.Assessment" ]
import org.conqat.lib.commons.assessment.Assessment;
import org.conqat.lib.commons.assessment.*;
[ "org.conqat.lib" ]
org.conqat.lib;
2,550,774
private Edge treatEdge(final Edge edge) { final Edge eNew = this.edgeMap.get(edge); if (eNew == null) { this.edgeMap.put(edge, edge); return edge; } else { return eNew; } }
Edge function(final Edge edge) { final Edge eNew = this.edgeMap.get(edge); if (eNew == null) { this.edgeMap.put(edge, edge); return edge; } else { return eNew; } }
/** * Checks if the edge doesn't already exists, and if it does, returns only * one reference for other edges which have the same values. * * @param edge * the edge to check * @return the edge parameter if it doesn't already exists, otherwise the * edge which alrea...
Checks if the edge doesn't already exists, and if it does, returns only one reference for other edges which have the same values
treatEdge
{ "repo_name": "Nantes1900/Nantes-1900-Stage-D.Lefevre", "path": "src/fr/nantes1900/utils/ParserSTL.java", "license": "gpl-3.0", "size": 17937 }
[ "fr.nantes1900.models.basis.Edge" ]
import fr.nantes1900.models.basis.Edge;
import fr.nantes1900.models.basis.*;
[ "fr.nantes1900.models" ]
fr.nantes1900.models;
23,459
private static Path getNormalizedResourceDirectory(String filename) { Path resDir = Paths.get(filename).getParent().getParent(); if (resDir.getName(0).toString().startsWith("blaze-")) { // strip off stuff like blaze-out/k8-fastbuild/bin/. return resDir.subpath(3, resDir.getNameCount()); } else...
static Path function(String filename) { Path resDir = Paths.get(filename).getParent().getParent(); if (resDir.getName(0).toString().startsWith(STR)) { return resDir.subpath(3, resDir.getNameCount()); } else { return resDir; } }
/** * Returns the resource directory (e.g. {@code java/com/pkg/res/}) which contains a file, * stripping off any {@code blaze-*} prefix for normalization. */
Returns the resource directory (e.g. java/com/pkg/res/) which contains a file, stripping off any blaze-* prefix for normalization
getNormalizedResourceDirectory
{ "repo_name": "bazelbuild/bazel", "path": "src/tools/android/java/com/google/devtools/build/android/AndroidCompiledDataDeserializer.java", "license": "apache-2.0", "size": 44828 }
[ "java.nio.file.Path", "java.nio.file.Paths" ]
import java.nio.file.Path; import java.nio.file.Paths;
import java.nio.file.*;
[ "java.nio" ]
java.nio;
2,632,390
public Plot getPlot() { return this.plot; }
Plot function() { return this.plot; }
/** * The plot involved * * @return Plot */
The plot involved
getPlot
{ "repo_name": "boy0001/PlotSquared", "path": "PlotSquared/src/com/intellectualcrafters/plot/events/PlayerPlotTrustedEvent.java", "license": "gpl-3.0", "size": 1359 }
[ "com.intellectualcrafters.plot.Plot" ]
import com.intellectualcrafters.plot.Plot;
import com.intellectualcrafters.plot.*;
[ "com.intellectualcrafters.plot" ]
com.intellectualcrafters.plot;
1,322,747
response.setContentType("text/html;charset=UTF-8"); Util.configMessageLogFile(); try (PrintWriter out = response.getWriter()) { out.println("<!DOCTYPE html>"); out.println("<html>"); out.println("<head>"); out.println...
response.setContentType(STR); Util.configMessageLogFile(); try (PrintWriter out = response.getWriter()) { out.println(STR); out.println(STR); out.println(STR); out.println(STR); out.println(STR); out.println(STR); out.println(STR + pingWithNormalOnBehalfOf()); out.println(STR); out.println(STR); } }
/** * Processes requests for both HTTP <code>GET</code> and <code>POST</code> * methods. * * @param request servlet request * @param response servlet response * @throws IOException if an I/O error occurs */
Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods
processRequest
{ "repo_name": "Safewhere/kombit-service-java", "path": "Consumer/src/java/consumer/client/ServiceConsumerWithNormalOBO.java", "license": "mit", "size": 4605 }
[ "java.io.PrintWriter" ]
import java.io.PrintWriter;
import java.io.*;
[ "java.io" ]
java.io;
506,437
@Override protected void doGet(HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws IOException, ServletException { Map<String, Object> referenceMap = new HashMap<String, Object>(); checkLocaleAttributesForFirstTime(httpRequest); // we need to save current user language in refe...
void function(HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws IOException, ServletException { Map<String, Object> referenceMap = new HashMap<String, Object>(); checkLocaleAttributesForFirstTime(httpRequest); if (httpRequest.getSession().getAttribute(FilterUtil.LOCALE_ATTRIBUTE) != null) { refer...
/** * Called by {@link #doFilter(ServletRequest, ServletResponse, FilterChain)} on GET requests * * @param httpRequest * @param httpResponse */
Called by <code>#doFilter(ServletRequest, ServletResponse, FilterChain)</code> on GET requests
doGet
{ "repo_name": "jamesfeshner/openmrs-module", "path": "web/src/main/java/org/openmrs/web/filter/update/UpdateFilter.java", "license": "mpl-2.0", "size": 26976 }
[ "java.io.IOException", "java.util.HashMap", "java.util.Map", "javax.servlet.ServletException", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "org.openmrs.web.filter.util.FilterUtil" ]
import java.io.IOException; import java.util.HashMap; import java.util.Map; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.openmrs.web.filter.util.FilterUtil;
import java.io.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import org.openmrs.web.filter.util.*;
[ "java.io", "java.util", "javax.servlet", "org.openmrs.web" ]
java.io; java.util; javax.servlet; org.openmrs.web;
1,120,770
protected void doFillIntoGrid(Composite parent, int numColumns) { this.getLabelControl(parent);
void function(Composite parent, int numColumns) { this.getLabelControl(parent);
/** * Fills this <code>TableFieldEditor</code>'s basic controls into the * given parent. * * @param parent the composite used as a parent for the basic controls; the * parent's layout must be a <code>GridLayout</code> * @param numColumns the number of columnHeaders * @see ...
Fills this <code>TableFieldEditor</code>'s basic controls into the given parent
doFillIntoGrid
{ "repo_name": "edeoliveira/Mailster", "path": "org/mailster/gui/prefs/widgets/TableFieldEditor.java", "license": "gpl-2.0", "size": 21235 }
[ "org.eclipse.swt.widgets.Composite" ]
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.*;
[ "org.eclipse.swt" ]
org.eclipse.swt;
1,701,029
private int initParams(int channels, int sampleRate, int bitrate, MPEGMode mode, int quality, boolean VBR, boolean bigEndian) { // Set parameters lame.getFlags().setInNumChannels(channels); lame.getFlags().setInSampleRate(sampleRate); lame.getFlags().setMode(mode); i...
int function(int channels, int sampleRate, int bitrate, MPEGMode mode, int quality, boolean VBR, boolean bigEndian) { lame.getFlags().setInNumChannels(channels); lame.getFlags().setInSampleRate(sampleRate); lame.getFlags().setMode(mode); if (VBR) { lame.getFlags().setVBR(VbrMode.vbr_default); lame.getFlags().setVBRQual...
/** * Initializes the lame encoder. Throws IllegalArgumentException when * parameters are not supported by LAME. */
Initializes the lame encoder. Throws IllegalArgumentException when parameters are not supported by LAME
initParams
{ "repo_name": "nwaldispuehl/java-lame", "path": "src/main/java/net/sourceforge/lame/lowlevel/LameEncoder.java", "license": "lgpl-3.0", "size": 14670 }
[ "net.sourceforge.lame.mp3.MPEGMode", "net.sourceforge.lame.mp3.VbrMode" ]
import net.sourceforge.lame.mp3.MPEGMode; import net.sourceforge.lame.mp3.VbrMode;
import net.sourceforge.lame.mp3.*;
[ "net.sourceforge.lame" ]
net.sourceforge.lame;
624,214
@Override public boolean invokeMenuActionSync(Activity targetActivity, int id, int flag) { return this.mBase.invokeMenuActionSync(targetActivity, id, flag); }
boolean function(Activity targetActivity, int id, int flag) { return this.mBase.invokeMenuActionSync(targetActivity, id, flag); }
/** * Execute a particular menu item. * * @param targetActivity The activity in question. * @param id The identifier associated with the menu item. * @param flag Additional flags, if any. * @return Whether the invocation was successful (for example, it could be * false if item...
Execute a particular menu item
invokeMenuActionSync
{ "repo_name": "liujianying/OpenAtlas", "path": "OpenAtlasCore/src/com/openatlas/runtime/InstrumentationHook.java", "license": "mit", "size": 38585 }
[ "android.app.Activity" ]
import android.app.Activity;
import android.app.*;
[ "android.app" ]
android.app;
865,728
private void scheduleCacheCleanup(Context context) { // Only schedule the Alarm if it's not already scheduled. if (!isAlarmActive(context)) { // Schedule an alarm after a certain timeout to start a // service to delete expired data from Database. mAlarmManager.s...
void function(Context context) { if (!isAlarmActive(context)) { mAlarmManager.setInexactRepeating (AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + CLEANUP_SCHEDULER_TIME_INTERVAL, CLEANUP_SCHEDULER_TIME_INTERVAL, DeleteCacheReceiver.makeReceiverPendingIntent(context)); } }
/** * Helper method that uses AlarmManager to schedule Cache Cleanup * at regular intervals. * * @param context */
Helper method that uses AlarmManager to schedule Cache Cleanup at regular intervals
scheduleCacheCleanup
{ "repo_name": "codingvirtual/mobilecloud-15", "path": "assignments/assignment1/src/vandy/mooc/provider/cache/ContentProviderTimeoutCache.java", "license": "apache-2.0", "size": 11585 }
[ "android.app.AlarmManager", "android.content.Context", "android.os.SystemClock" ]
import android.app.AlarmManager; import android.content.Context; import android.os.SystemClock;
import android.app.*; import android.content.*; import android.os.*;
[ "android.app", "android.content", "android.os" ]
android.app; android.content; android.os;
2,551,006
public void setLexicalPhrase(LexicalPhrase lexicalPhrase) { this.lexicalPhrase = lexicalPhrase; }
void function(LexicalPhrase lexicalPhrase) { this.lexicalPhrase = lexicalPhrase; }
/** * Sets this list's LexicalPhrase to the specified LexicalPhrase object * @param lexicalPhrase - the new LexicalPhrase object for this list */
Sets this list's LexicalPhrase to the specified LexicalPhrase object
setLexicalPhrase
{ "repo_name": "abryant/Plinth", "path": "src/eu/bryants/anthony/plinth/parser/parseAST/ParseList.java", "license": "bsd-3-clause", "size": 3202 }
[ "eu.bryants.anthony.plinth.ast.LexicalPhrase" ]
import eu.bryants.anthony.plinth.ast.LexicalPhrase;
import eu.bryants.anthony.plinth.ast.*;
[ "eu.bryants.anthony" ]
eu.bryants.anthony;
952,035
public AmplifierType getAmplifier(ItemStack stack);
AmplifierType function(ItemStack stack);
/** * Gets the amplifier associated with the item * @param stack ItemStack containing the item */
Gets the amplifier associated with the item
getAmplifier
{ "repo_name": "sirsavary/Realistic-Terrain-Generation", "path": "src/api/java/com/shinoow/abyssalcraft/api/energy/IAmplifierCharm.java", "license": "gpl-3.0", "size": 1383 }
[ "com.shinoow.abyssalcraft.api.energy.EnergyEnum", "net.minecraft.item.ItemStack" ]
import com.shinoow.abyssalcraft.api.energy.EnergyEnum; import net.minecraft.item.ItemStack;
import com.shinoow.abyssalcraft.api.energy.*; import net.minecraft.item.*;
[ "com.shinoow.abyssalcraft", "net.minecraft.item" ]
com.shinoow.abyssalcraft; net.minecraft.item;
1,746,425
List<Tool> tools = getToolService().findAll(); return ResponseEntity.ok(tools); }
List<Tool> tools = getToolService().findAll(); return ResponseEntity.ok(tools); }
/** * Lists all the registered tools * * @param globalSearch * @param pageable * @return ResponseEntity */
Lists all the registered tools
list
{ "repo_name": "DISID/disid-proofs", "path": "spring-integration/server-app/src/main/java/com/disid/proofs/server/web/api/ToolsCollectionJsonController.java", "license": "gpl-3.0", "size": 1138 }
[ "com.disid.proofs.server.domain.Tool", "java.util.List", "org.springframework.http.ResponseEntity" ]
import com.disid.proofs.server.domain.Tool; import java.util.List; import org.springframework.http.ResponseEntity;
import com.disid.proofs.server.domain.*; import java.util.*; import org.springframework.http.*;
[ "com.disid.proofs", "java.util", "org.springframework.http" ]
com.disid.proofs; java.util; org.springframework.http;
1,438,498
public static Iterator<ImageWriter> getImageWritersByFormatName(String formatName) { if (formatName == null) { throw new IllegalArgumentException("formatName == null!"); } Iterator iter; // Ensure category is present try { iter = theRegistr...
static Iterator<ImageWriter> function(String formatName) { if (formatName == null) { throw new IllegalArgumentException(STR); } Iterator iter; try { iter = theRegistry.getServiceProviders(ImageWriterSpi.class, new ContainsFilter(writerFormatNamesMethod, formatName), true); } catch (IllegalArgumentException e) { return ...
/** * Returns an <code>Iterator</code> containing all currently * registered <code>ImageWriter</code>s that claim to be able to * encode the named format. * * @param formatName a <code>String</code> containing the informal * name of a format (<i>e.g.</i>, "jpeg" or "tiff". * * @r...
Returns an <code>Iterator</code> containing all currently registered <code>ImageWriter</code>s that claim to be able to encode the named format
getImageWritersByFormatName
{ "repo_name": "haikuowuya/android_system_code", "path": "src/javax/imageio/ImageIO.java", "license": "apache-2.0", "size": 57777 }
[ "java.util.Collections", "java.util.Iterator", "javax.imageio.spi.ImageWriterSpi" ]
import java.util.Collections; import java.util.Iterator; import javax.imageio.spi.ImageWriterSpi;
import java.util.*; import javax.imageio.spi.*;
[ "java.util", "javax.imageio" ]
java.util; javax.imageio;
2,340,721
CmsObject doLogin(String principal);
CmsObject doLogin(String principal);
/** * Returns a cms object initialized for the passed principal.<p> * * @param principal the principal (i.e. name of a user) * @return a cms object or <code>null</code> if the cms object could not be initialized. */
Returns a cms object initialized for the passed principal
doLogin
{ "repo_name": "it-tavis/opencms-core", "path": "src/org/opencms/security/I_CmsLoginAction.java", "license": "lgpl-2.1", "size": 1576 }
[ "org.opencms.file.CmsObject" ]
import org.opencms.file.CmsObject;
import org.opencms.file.*;
[ "org.opencms.file" ]
org.opencms.file;
1,984,822
public RedisTransaction time(Handler<AsyncResult<String>> handler) { delegate.time(handler); return this; }
RedisTransaction function(Handler<AsyncResult<String>> handler) { delegate.time(handler); return this; }
/** * Return the current server time * @param handler * @return */
Return the current server time
time
{ "repo_name": "brianjcj/vertx-redis-client", "path": "src/main/generated/io/vertx/rxjava/redis/RedisTransaction.java", "license": "apache-2.0", "size": 184983 }
[ "io.vertx.core.AsyncResult", "io.vertx.core.Handler" ]
import io.vertx.core.AsyncResult; import io.vertx.core.Handler;
import io.vertx.core.*;
[ "io.vertx.core" ]
io.vertx.core;
638,698
boolean onLongClick(@NonNull android.support.v7.preference.Preference preference, @NonNull View view);
boolean onLongClick(@NonNull android.support.v7.preference.Preference preference, @NonNull View view);
/** * Called when a view has been clicked and held. * * @param preference The preference that was clicked and held. * @param view The view that was clicked and held. * @return true if the callback consumed the long click, false otherwise. */
Called when a view has been clicked and held
onLongClick
{ "repo_name": "consp1racy/android-support-preference", "path": "support-preference/src/main/java/net/xpece/android/support/preference/OnPreferenceLongClickListener.java", "license": "apache-2.0", "size": 698 }
[ "android.support.annotation.NonNull", "android.view.View" ]
import android.support.annotation.NonNull; import android.view.View;
import android.support.annotation.*; import android.view.*;
[ "android.support", "android.view" ]
android.support; android.view;
1,021,063
private void clear(JSONArray ids){ for (int i = 0; i < ids.length(); i++) { int id = ids.optInt(i, 0); Notification notification = getNotificationMgr().clear(id); if (notification != null) { fireEvent("clear", notification); ...
void function(JSONArray ids){ for (int i = 0; i < ids.length(); i++) { int id = ids.optInt(i, 0); Notification notification = getNotificationMgr().clear(id); if (notification != null) { fireEvent("clear", notification); } } }
/** * Clear multiple local notifications without canceling them. * * @param ids * Set of local notification IDs */
Clear multiple local notifications without canceling them
clear
{ "repo_name": "veg512/nWords", "path": "plugins/de.appplant.cordova.plugin.local-notification/src/android/LocalNotification.java", "license": "mit", "size": 19002 }
[ "de.appplant.cordova.plugin.notification.Notification", "org.json.JSONArray" ]
import de.appplant.cordova.plugin.notification.Notification; import org.json.JSONArray;
import de.appplant.cordova.plugin.notification.*; import org.json.*;
[ "de.appplant.cordova", "org.json" ]
de.appplant.cordova; org.json;
1,123,640
public void startEntity(String name) throws SAXException { m_handler.startEntity(name); }
void function(String name) throws SAXException { m_handler.startEntity(name); }
/** * Pass the call on to the underlying handler * @see org.xml.sax.ext.LexicalHandler#startEntity(String) */
Pass the call on to the underlying handler
startEntity
{ "repo_name": "mirkosertic/Bytecoder", "path": "classlib/java.xml/src/main/resources/META-INF/modules/java.xml/classes/com/sun/org/apache/xml/internal/serializer/ToUnknownStream.java", "license": "apache-2.0", "size": 38096 }
[ "org.xml.sax.SAXException" ]
import org.xml.sax.SAXException;
import org.xml.sax.*;
[ "org.xml.sax" ]
org.xml.sax;
584,603
private static void invokeMatlab(File dataMatrixFile, File affMatrixFile, int dimensions, File outputFile) throws IOException { String commandLine = "matlab -nodisplay -nosplash -nojvm"; LOGGER.fine(commandLine); Process matlab = Runtime.ge...
static void function(File dataMatrixFile, File affMatrixFile, int dimensions, File outputFile) throws IOException { String commandLine = STR; LOGGER.fine(commandLine); Process matlab = Runtime.getRuntime().exec(commandLine); String outputStr = STR + outputFile.getAbsolutePath() + STR; String matlabProgram = String.form...
/** * Invokes Matlab to run the LPP script */
Invokes Matlab to run the LPP script
invokeMatlab
{ "repo_name": "fozziethebeat/S-Space", "path": "src/main/java/edu/ucla/sspace/matrix/LocalityPreservingProjection.java", "license": "gpl-2.0", "size": 21832 }
[ "java.io.BufferedReader", "java.io.File", "java.io.IOException", "java.io.InputStreamReader", "java.io.PrintWriter" ]
import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter;
import java.io.*;
[ "java.io" ]
java.io;
2,467,994
protected void attrition(final Corp entity, final Sector sector, final boolean isWinter, boolean willBattle) { final int raisedMps = getMps(entity); // Apply casualties due to attrition to all brigades & battalions final List<Brigade> lstBrigades = BrigadeManager.getInstance().listByCorp(ge...
void function(final Corp entity, final Sector sector, final boolean isWinter, boolean willBattle) { final int raisedMps = getMps(entity); final List<Brigade> lstBrigades = BrigadeManager.getInstance().listByCorp(getParent().getGame(), entity.getCorpId()); for (Brigade thisBrigade : lstBrigades) { for (Battalion movedIt...
/** * Enforce attrition due to movement. * * @param entity the entity that is moving. * @param sector the Sector where it it crossed through. * @param isWinter if it is winter. * @param willBattle if the unit will engage in a battle. */
Enforce attrition due to movement
attrition
{ "repo_name": "EaW1805/engine", "path": "src/main/java/com/eaw1805/orders/movement/CorpForcedMovement.java", "license": "mit", "size": 5906 }
[ "com.eaw1805.data.managers.army.BrigadeManager", "com.eaw1805.data.model.army.Battalion", "com.eaw1805.data.model.army.Brigade", "com.eaw1805.data.model.army.Corp", "com.eaw1805.data.model.map.Sector", "java.util.List" ]
import com.eaw1805.data.managers.army.BrigadeManager; import com.eaw1805.data.model.army.Battalion; import com.eaw1805.data.model.army.Brigade; import com.eaw1805.data.model.army.Corp; import com.eaw1805.data.model.map.Sector; import java.util.List;
import com.eaw1805.data.managers.army.*; import com.eaw1805.data.model.army.*; import com.eaw1805.data.model.map.*; import java.util.*;
[ "com.eaw1805.data", "java.util" ]
com.eaw1805.data; java.util;
2,609,513
public SearchRequestBuilder addHighlightedField(HighlightBuilder.Field field) { highlightBuilder().field(field); return this; }
SearchRequestBuilder function(HighlightBuilder.Field field) { highlightBuilder().field(field); return this; }
/** * Adds a highlighted field. */
Adds a highlighted field
addHighlightedField
{ "repo_name": "18098924759/elasticsearch", "path": "core/src/main/java/org/elasticsearch/action/search/SearchRequestBuilder.java", "license": "apache-2.0", "size": 30936 }
[ "org.elasticsearch.search.highlight.HighlightBuilder" ]
import org.elasticsearch.search.highlight.HighlightBuilder;
import org.elasticsearch.search.highlight.*;
[ "org.elasticsearch.search" ]
org.elasticsearch.search;
894,867
public void expandPath(TreePath path) { renderer.expandPath(path); }
void function(TreePath path) { renderer.expandPath(path); }
/** * Expands the the node at the specified path in the treetable. * * @param path path of the node to expand */
Expands the the node at the specified path in the treetable
expandPath
{ "repo_name": "charlycoste/TreeD", "path": "src/org/jdesktop/swingx/JXTreeTable.java", "license": "gpl-2.0", "size": 64036 }
[ "javax.swing.tree.TreePath" ]
import javax.swing.tree.TreePath;
import javax.swing.tree.*;
[ "javax.swing" ]
javax.swing;
1,403,254
public void connectTo(Peer peer) { if (getConnecting()) { Log.w(TAG, "connectTo() not connecting to " + peer + " -- already connecting to someone"); return; } Log.i(TAG, "connecting to " + peer); // TODO(lerner): Why not just use mPeerManager? PeerManager peerManager =...
void function(Peer peer) { if (getConnecting()) { Log.w(TAG, STR + peer + STR); return; } Log.i(TAG, STR + peer); PeerManager peerManager = PeerManager.getInstance(this); setConnecting(true); Log.i(TAG, STR + peer.toString()); mBluetoothSpeaker.connect(peer, mPeerConnectionCallback); }
/** * Connect to the peer via Bluetooth. Upon success, start an exchange with * the peer. If we're already connecting to someone, this method returns * without doing anything. * * @param peer The peer we want to talk to. */
Connect to the peer via Bluetooth. Upon success, start an exchange with the peer. If we're already connecting to someone, this method returns without doing anything
connectTo
{ "repo_name": "casific/murmur", "path": "benchmark/RangzenService.java", "license": "apache-2.0", "size": 23981 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
2,421,875
public String dateAsText(Date min, Date max, String pattern) throws ChanceException { return dateAsText(min, max, pattern, Locale.getDefault()); }
String function(Date min, Date max, String pattern) throws ChanceException { return dateAsText(min, max, pattern, Locale.getDefault()); }
/** * Generate a random date as text, between min and max using default Locale. * <pre> * chance.date(date1, date2, "dd/MM/yyyy"); * => 17/07/1977 * </pre> * * @param min Minimum value to choose from * @param max Maximum value to choose from * @param pattern Style of the dat...
Generate a random date as text, between min and max using default Locale. <code> chance.date(date1, date2, "dd/MM/yyyy"); => 17/07/1977 </code>
dateAsText
{ "repo_name": "open-fidias/chance4j", "path": "src/main/java/br/com/fidias/chance4j/Chance.java", "license": "gpl-3.0", "size": 58799 }
[ "java.util.Date", "java.util.Locale" ]
import java.util.Date; import java.util.Locale;
import java.util.*;
[ "java.util" ]
java.util;
750,830
@Test void testAggregateRemove5() { final String sql = "select empno, deptno, sum(sal) " + "from sales.emp group by cube(empno, deptno)\n"; sql(sql) .withRule(CoreRules.AGGREGATE_REMOVE, CoreRules.PROJECT_MERGE) .checkUnchanged(); }
@Test void testAggregateRemove5() { final String sql = STR + STR; sql(sql) .withRule(CoreRules.AGGREGATE_REMOVE, CoreRules.PROJECT_MERGE) .checkUnchanged(); }
/** * Negative test case for AggregateRemoveRule, should not * remove non-simple aggregates. */
Negative test case for AggregateRemoveRule, should not remove non-simple aggregates
testAggregateRemove5
{ "repo_name": "datametica/calcite", "path": "core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java", "license": "apache-2.0", "size": 264929 }
[ "org.apache.calcite.rel.rules.CoreRules", "org.junit.jupiter.api.Test" ]
import org.apache.calcite.rel.rules.CoreRules; import org.junit.jupiter.api.Test;
import org.apache.calcite.rel.rules.*; import org.junit.jupiter.api.*;
[ "org.apache.calcite", "org.junit.jupiter" ]
org.apache.calcite; org.junit.jupiter;
166,929
void startBundle( long bundleId ) throws RemoteException, BundleException;
void startBundle( long bundleId ) throws RemoteException, BundleException;
/** * Starts a bundle. * * @param bundleId id of the bundle to be started * * @throws RemoteException - Remote communication related exception (mandatory by RMI) * @throws BundleException - Re-thrown from starting the bundle */
Starts a bundle
startBundle
{ "repo_name": "ops4j/org.ops4j.pax.exam1", "path": "pax-exam-container-rbc/src/main/java/org/ops4j/pax/exam/rbc/internal/RemoteBundleContext.java", "license": "apache-2.0", "size": 5297 }
[ "java.rmi.RemoteException", "org.osgi.framework.BundleException" ]
import java.rmi.RemoteException; import org.osgi.framework.BundleException;
import java.rmi.*; import org.osgi.framework.*;
[ "java.rmi", "org.osgi.framework" ]
java.rmi; org.osgi.framework;
1,196,586
public boolean saveNextUsers(int deliverableID, List<NextUser> nextUsers, User currentUser, String justification);
boolean function(int deliverableID, List<NextUser> nextUsers, User currentUser, String justification);
/** * This method saves a set of next users that belong to a specific Deliverable. * * @param deliverableID - deliverable identifier where the next user belongs. * @param nextUsers - is a set of NextUser objects with the information to be added/updated. * @param user - is the user who is making the chan...
This method saves a set of next users that belong to a specific Deliverable
saveNextUsers
{ "repo_name": "CCAFS/ccafs-ap", "path": "impactPathways/src/main/java/org/cgiar/ccafs/ap/data/manager/NextUserManager.java", "license": "gpl-3.0", "size": 3887 }
[ "java.util.List", "org.cgiar.ccafs.ap.data.model.NextUser", "org.cgiar.ccafs.ap.data.model.User" ]
import java.util.List; import org.cgiar.ccafs.ap.data.model.NextUser; import org.cgiar.ccafs.ap.data.model.User;
import java.util.*; import org.cgiar.ccafs.ap.data.model.*;
[ "java.util", "org.cgiar.ccafs" ]
java.util; org.cgiar.ccafs;
907,921
public ServiceResponse<Void> putBigDouble(double numberBody) throws ErrorException, IOException { Call<ResponseBody> call = service.putBigDouble(numberBody); return putBigDoubleDelegate(call.execute()); }
ServiceResponse<Void> function(double numberBody) throws ErrorException, IOException { Call<ResponseBody> call = service.putBigDouble(numberBody); return putBigDoubleDelegate(call.execute()); }
/** * Put big double value 2.5976931e+101. * * @param numberBody the double value * @throws ErrorException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @return the {@link ServiceResponse} object if successful. */
Put big double value 2.5976931e+101
putBigDouble
{ "repo_name": "John-Hart/autorest", "path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/bodynumber/implementation/NumbersImpl.java", "license": "mit", "size": 59057 }
[ "com.microsoft.rest.ServiceResponse", "java.io.IOException" ]
import com.microsoft.rest.ServiceResponse; import java.io.IOException;
import com.microsoft.rest.*; import java.io.*;
[ "com.microsoft.rest", "java.io" ]
com.microsoft.rest; java.io;
13,707
public Set<String> getNamespaces(Settings settings) { return settings.keySet().stream().filter(this::match).map(key::getNamespace).collect(Collectors.toSet()); }
Set<String> function(Settings settings) { return settings.keySet().stream().filter(this::match).map(key::getNamespace).collect(Collectors.toSet()); }
/** * Returns distinct namespaces for the given settings */
Returns distinct namespaces for the given settings
getNamespaces
{ "repo_name": "qwerty4030/elasticsearch", "path": "server/src/main/java/org/elasticsearch/common/settings/Setting.java", "license": "apache-2.0", "size": 61376 }
[ "java.util.Set", "java.util.stream.Collectors" ]
import java.util.Set; import java.util.stream.Collectors;
import java.util.*; import java.util.stream.*;
[ "java.util" ]
java.util;
911,540
void containsAnyOf(@NullableDecl M first, @NullableDecl M second, @NullableDecl M... rest);
void containsAnyOf(@NullableDecl M first, @NullableDecl M second, @NullableDecl M... rest);
/** * Checks that the subject contains at least one element that corresponds to at least one of the * expected elements. */
Checks that the subject contains at least one element that corresponds to at least one of the expected elements
containsAnyOf
{ "repo_name": "cgruber/truth", "path": "extensions/proto/src/main/java/com/google/common/truth/extensions/proto/IterableOfProtosUsingCorrespondence.java", "license": "apache-2.0", "size": 8280 }
[ "org.checkerframework.checker.nullness.compatqual.NullableDecl" ]
import org.checkerframework.checker.nullness.compatqual.NullableDecl;
import org.checkerframework.checker.nullness.compatqual.*;
[ "org.checkerframework.checker" ]
org.checkerframework.checker;
1,937,927
public static String prettyUptime(int secs) { String[][] PRETTYSECDIVIDERS = { new String[] {"ms", "1000"}, new String[] { "s", "60" }, new String[] { "m", "60" }, new String[] { "h", "24" }, new String[] { "d", null } }; int diversize = PRETTYSECDIVIDERS.length; LinkedList<...
static String function(int secs) { String[][] PRETTYSECDIVIDERS = { new String[] {"ms", "1000"}, new String[] { "s", "60" }, new String[] { "m", "60" }, new String[] { "h", "24" }, new String[] { "d", null } }; int diversize = PRETTYSECDIVIDERS.length; LinkedList<String> tmp = new LinkedList<>(); int div = secs; for (i...
/** * seconds to string like '30m 40s' and '1d 20h 30m 40s' * * @param secs * @return */
seconds to string like '30m 40s' and '1d 20h 30m 40s'
prettyUptime
{ "repo_name": "haoyanjun21/jstorm", "path": "jstorm-utility/performance-test/flink/src/main/java/com/alibaba/flink/utils/Utils.java", "license": "apache-2.0", "size": 3341 }
[ "com.google.common.base.Joiner", "java.util.LinkedList" ]
import com.google.common.base.Joiner; import java.util.LinkedList;
import com.google.common.base.*; import java.util.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
743,986
@Test public void testGetHeadPacket_InPacket_NoConnect() throws Exception { PacketQueue queue = new InPacketQueue(); Response result = Whitebox.invokeMethod(target, "getHeadPacket", queue); assertThat(result.statusCode, is(Response.NO_CONTENT)); }
void function() throws Exception { PacketQueue queue = new InPacketQueue(); Response result = Whitebox.invokeMethod(target, STR, queue); assertThat(result.statusCode, is(Response.NO_CONTENT)); }
/** * Test method for {@link org.o3project.odenos.core.component.network.Network#getHeadPacket(PacketQueue)}. * * @throws Exception throws Exception in targets */
Test method for <code>org.o3project.odenos.core.component.network.Network#getHeadPacket(PacketQueue)</code>
testGetHeadPacket_InPacket_NoConnect
{ "repo_name": "haizawa/odenos", "path": "src/test/java/org/o3project/odenos/core/component/network/NetworkTest.java", "license": "apache-2.0", "size": 112118 }
[ "org.hamcrest.CoreMatchers", "org.junit.Assert", "org.o3project.odenos.core.component.network.packet.InPacketQueue", "org.o3project.odenos.core.component.network.packet.PacketQueue", "org.o3project.odenos.remoteobject.message.Response", "org.powermock.reflect.Whitebox" ]
import org.hamcrest.CoreMatchers; import org.junit.Assert; import org.o3project.odenos.core.component.network.packet.InPacketQueue; import org.o3project.odenos.core.component.network.packet.PacketQueue; import org.o3project.odenos.remoteobject.message.Response; import org.powermock.reflect.Whitebox;
import org.hamcrest.*; import org.junit.*; import org.o3project.odenos.core.component.network.packet.*; import org.o3project.odenos.remoteobject.message.*; import org.powermock.reflect.*;
[ "org.hamcrest", "org.junit", "org.o3project.odenos", "org.powermock.reflect" ]
org.hamcrest; org.junit; org.o3project.odenos; org.powermock.reflect;
990,825
public X509Certificate[] getTrustCertificates() throws GeneralSecurityException, IOException;
X509Certificate[] function() throws GeneralSecurityException, IOException;
/** * Returns the X509 Certificates installed in the currently configured trust store. * If the SslManagerService configuration contains a path to a custom trust store, then the returned certificates * are the ones installed in such store. * Otherwise the default Java VM trust store will be listed. ...
Returns the X509 Certificates installed in the currently configured trust store. If the SslManagerService configuration contains a path to a custom trust store, then the returned certificates are the ones installed in such store. Otherwise the default Java VM trust store will be listed
getTrustCertificates
{ "repo_name": "amitjoy/kura", "path": "kura/org.eclipse.kura.api/src/main/java/org/eclipse/kura/ssl/SslManagerService.java", "license": "epl-1.0", "size": 8748 }
[ "java.io.IOException", "java.security.GeneralSecurityException", "java.security.cert.X509Certificate" ]
import java.io.IOException; import java.security.GeneralSecurityException; import java.security.cert.X509Certificate;
import java.io.*; import java.security.*; import java.security.cert.*;
[ "java.io", "java.security" ]
java.io; java.security;
2,331,255
private File getStorageDirectory() { //Log.d(TAG, "getStorageDirectory(): API level is " + Integer.valueOf(android.os.Build.VERSION.SDK_INT)); String state = null; try { state = Environment.getExternalStorageState(); } catch (RuntimeException e) { Log.e(TAG, ...
File function() { String state = null; try { state = Environment.getExternalStorageState(); } catch (RuntimeException e) { Log.e(TAG, STR, e); showErrorMessage("Error", STR); } if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) { try { return getExternalFilesDir(Environment.MEDIA_MOUNTED); } c...
/** * Finds the proper location on the SD card where we can save files. */
Finds the proper location on the SD card where we can save files
getStorageDirectory
{ "repo_name": "nonamejx/DictionaryX", "path": "DictionaryX/src/main/java/edu/sfsu/cs/orange/ocr/CaptureActivity.java", "license": "apache-2.0", "size": 58768 }
[ "android.os.Environment", "android.util.Log", "java.io.File" ]
import android.os.Environment; import android.util.Log; import java.io.File;
import android.os.*; import android.util.*; import java.io.*;
[ "android.os", "android.util", "java.io" ]
android.os; android.util; java.io;
729,769
public void activateCSS(SamplesContext context) throws IOException { getCSSDir(context).mkdirs(); if (!getThemeCSSFile(context).exists()) { FileUtil.writeStringToFile("#Constants {\n" + " includeNativeBool: true; \n" + "}", getThemeC...
void function(SamplesContext context) throws IOException { getCSSDir(context).mkdirs(); if (!getThemeCSSFile(context).exists()) { FileUtil.writeStringToFile(STR + STR + "}", getThemeCSSFile(context)); } Properties props = loadProperties(getPublicCodenameOneSettingsFile(context)); props.setProperty(STR, "true"); savePro...
/** * Converts a project to CSS * @param context * @throws IOException */
Converts a project to CSS
activateCSS
{ "repo_name": "saeder/CodenameOne", "path": "Samples/src/com/codename1/samples/Sample.java", "license": "gpl-2.0", "size": 26694 }
[ "com.codename1.samples.PropertiesUtil", "java.io.IOException", "java.util.Properties" ]
import com.codename1.samples.PropertiesUtil; import java.io.IOException; import java.util.Properties;
import com.codename1.samples.*; import java.io.*; import java.util.*;
[ "com.codename1.samples", "java.io", "java.util" ]
com.codename1.samples; java.io; java.util;
1,508,991
public IStructuredSelection getSelection() { return selection; }
IStructuredSelection function() { return selection; }
/** * Returns the selection which was passed to <code>init</code>. * * @return the selection */
Returns the selection which was passed to <code>init</code>
getSelection
{ "repo_name": "TeamSPoon/logicmoo_base", "path": "prolog/logicmoo/pdt_server/pdt.editor/src/org/cs3/pdt/editor/internal/wizards/NewModuleCreationWizard.java", "license": "mit", "size": 6908 }
[ "org.eclipse.jface.viewers.IStructuredSelection" ]
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.*;
[ "org.eclipse.jface" ]
org.eclipse.jface;
2,502,639
@Override public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Http2Exception { if (msg instanceof SendGrpcFrameCommand) { sendGrpcFrame(ctx, (SendGrpcFrameCommand) msg, promise); } else if (msg instanceof SendResponseHeadersCommand) { sendResponseHeaders...
void function(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Http2Exception { if (msg instanceof SendGrpcFrameCommand) { sendGrpcFrame(ctx, (SendGrpcFrameCommand) msg, promise); } else if (msg instanceof SendResponseHeadersCommand) { sendResponseHeaders(ctx, (SendResponseHeadersCommand) msg, prom...
/** * Handler for commands sent from the stream. */
Handler for commands sent from the stream
write
{ "repo_name": "mingfly/grpc-java", "path": "netty/src/main/java/io/grpc/netty/NettyServerHandler.java", "license": "bsd-3-clause", "size": 15364 }
[ "io.netty.channel.ChannelHandlerContext", "io.netty.channel.ChannelPromise", "io.netty.handler.codec.http2.Http2Exception", "io.netty.util.ReferenceCountUtil" ]
import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelPromise; import io.netty.handler.codec.http2.Http2Exception; import io.netty.util.ReferenceCountUtil;
import io.netty.channel.*; import io.netty.handler.codec.http2.*; import io.netty.util.*;
[ "io.netty.channel", "io.netty.handler", "io.netty.util" ]
io.netty.channel; io.netty.handler; io.netty.util;
2,816,409
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); try (PrintWriter out = response.getWriter()) { out.println("<!DOCTYPE html>"); ...
void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType(STR); try (PrintWriter out = response.getWriter()) { out.println(STR); out.println(STR); out.println(STR); out.println(STR); out.println(STR); out.println(STR); out.println(STR + reques...
/** * Processes requests for both HTTP <code>GET</code> and <code>POST</code> * methods. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */
Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods
processRequest
{ "repo_name": "Team-1A/travlendar-project-1A", "path": "Java Server Page/Travner_rev2/tomcat-test1/src/java/Controller/DisplayDistanceControl.java", "license": "mit", "size": 4587 }
[ "java.io.IOException", "java.io.PrintWriter", "javax.servlet.ServletException", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse" ]
import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
import java.io.*; import javax.servlet.*; import javax.servlet.http.*;
[ "java.io", "javax.servlet" ]
java.io; javax.servlet;
2,063,515
public Iterator<Map<String,Object>> iterator(Object key);
Iterator<Map<String,Object>> function(Object key);
/** * <p> * Returns an iterator, allowing callers to iterate through all documents that * match the given key in insertion order. * </p> */
Returns an iterator, allowing callers to iterate through all documents that match the given key in insertion order.
iterator
{ "repo_name": "q474818917/solr-5.2.0", "path": "solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DIHCache.java", "license": "apache-2.0", "size": 2813 }
[ "java.util.Iterator", "java.util.Map" ]
import java.util.Iterator; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,630,628