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
protected Component newContentLabel(final String id, final IModel<String> model) { return ComponentFactory.newMultiLineLabel(id, model); }
Component function(final String id, final IModel<String> model) { return ComponentFactory.newMultiLineLabel(id, model); }
/** * Factory method for create a new {@link MultiLineLabel}. This method is invoked in the * constructor from the derived classes and can be overridden so users can provide their own * version of a new {@link MultiLineLabel}. * * @param id * the id * @param model * the {@link IMod...
Factory method for create a new <code>MultiLineLabel</code>. This method is invoked in the constructor from the derived classes and can be overridden so users can provide their own version of a new <code>MultiLineLabel</code>
newContentLabel
{ "repo_name": "astrapi69/jaulp.wicket", "path": "jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/i18n/content/ContentPanel.java", "license": "apache-2.0", "size": 5604 }
[ "de.alpharogroup.wicket.components.factory.ComponentFactory", "org.apache.wicket.Component", "org.apache.wicket.model.IModel" ]
import de.alpharogroup.wicket.components.factory.ComponentFactory; import org.apache.wicket.Component; import org.apache.wicket.model.IModel;
import de.alpharogroup.wicket.components.factory.*; import org.apache.wicket.*; import org.apache.wicket.model.*;
[ "de.alpharogroup.wicket", "org.apache.wicket" ]
de.alpharogroup.wicket; org.apache.wicket;
1,430,855
public static Color getColor(RGB rgb) { Color color = m_colorMap.get(rgb); if (color == null) { Display display = Display.getCurrent(); color = new Color(display, rgb); m_colorMap.put(rgb, color); } return color; }
static Color function(RGB rgb) { Color color = m_colorMap.get(rgb); if (color == null) { Display display = Display.getCurrent(); color = new Color(display, rgb); m_colorMap.put(rgb, color); } return color; }
/** * Returns a {@link Color} given its RGB value. * * @param rgb * the {@link RGB} value of the color * @return the {@link Color} matching the RGB value */
Returns a <code>Color</code> given its RGB value
getColor
{ "repo_name": "boniatillo-com/PhaserEditor", "path": "source/phasereditor/phasereditor.project.ui/src/org/eclipse/wb/swt/SWTResourceManager.java", "license": "epl-1.0", "size": 15882 }
[ "org.eclipse.swt.graphics.Color", "org.eclipse.swt.widgets.Display" ]
import org.eclipse.swt.graphics.Color; import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.graphics.*; import org.eclipse.swt.widgets.*;
[ "org.eclipse.swt" ]
org.eclipse.swt;
1,371,762
protected void startLocationUpdates() { // The final argument to {@code requestLocationUpdates()} is a LocationListener // (http://developer.android.com/reference/com/google/android/gms/location/LocationListener.html). LocationServices.FusedLocationApi.requestLocationUpdates( ...
void function() { LocationServices.FusedLocationApi.requestLocationUpdates( mGoogleApiClient, mLocationRequest, this); }
/** * Requests location updates from the FusedLocationApi. */
Requests location updates from the FusedLocationApi
startLocationUpdates
{ "repo_name": "mseshachalam/android-play-location", "path": "LocationUpdates/app/src/main/java/com/google/android/gms/location/sample/locationupdates/MainActivity.java", "license": "apache-2.0", "size": 15325 }
[ "com.google.android.gms.location.LocationServices" ]
import com.google.android.gms.location.LocationServices;
import com.google.android.gms.location.*;
[ "com.google.android" ]
com.google.android;
248,302
public void addPersistenceLoggingPlugin(IPersistenceLoggingPlugin persistenceLoggingPlugin) throws ApplicationExceptions, FrameworkException;
void function(IPersistenceLoggingPlugin persistenceLoggingPlugin) throws ApplicationExceptions, FrameworkException;
/** Adds a PersistenceLoggingPlugin. * The initialize method will be invoked on the input. * @param persistenceLoggingPlugin the persistenceLoggingPlugin. * @throws ApplicationExceptions if any application error occurs. * @throws FrameworkException if any framework error occurs. */
Adds a PersistenceLoggingPlugin. The initialize method will be invoked on the input
addPersistenceLoggingPlugin
{ "repo_name": "jaffa-projects/jaffa-framework", "path": "jaffa-core/source/java/org/jaffa/persistence/engines/IPersistenceEngine.java", "license": "gpl-3.0", "size": 10908 }
[ "org.jaffa.exceptions.ApplicationExceptions", "org.jaffa.exceptions.FrameworkException", "org.jaffa.persistence.logging.IPersistenceLoggingPlugin" ]
import org.jaffa.exceptions.ApplicationExceptions; import org.jaffa.exceptions.FrameworkException; import org.jaffa.persistence.logging.IPersistenceLoggingPlugin;
import org.jaffa.exceptions.*; import org.jaffa.persistence.logging.*;
[ "org.jaffa.exceptions", "org.jaffa.persistence" ]
org.jaffa.exceptions; org.jaffa.persistence;
140,497
@NotNull @Contract(pure = true) public static Collection<Booster> getBoosters(@NotNull Player player) { return BOOSTERS.stream().filter(booster -> player.equals(booster.getPlayer()) || booster.getPlayer() == null) .collect(Collectors.toSet()); }
@Contract(pure = true) static Collection<Booster> function(@NotNull Player player) { return BOOSTERS.stream().filter(booster -> player.equals(booster.getPlayer()) booster.getPlayer() == null) .collect(Collectors.toSet()); }
/** * Returns a set of boosters applicable for the specified player * * @param player the player * @return the boosters */
Returns a set of boosters applicable for the specified player
getBoosters
{ "repo_name": "stefvanschie/buildinggame", "path": "buildinggame/src/main/java/com/gmail/stefvanschiedev/buildinggame/utils/Booster.java", "license": "unlicense", "size": 4212 }
[ "java.util.Collection", "java.util.stream.Collectors", "org.bukkit.entity.Player", "org.jetbrains.annotations.Contract", "org.jetbrains.annotations.NotNull" ]
import java.util.Collection; import java.util.stream.Collectors; import org.bukkit.entity.Player; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull;
import java.util.*; import java.util.stream.*; import org.bukkit.entity.*; import org.jetbrains.annotations.*;
[ "java.util", "org.bukkit.entity", "org.jetbrains.annotations" ]
java.util; org.bukkit.entity; org.jetbrains.annotations;
1,729,761
public ResourceScopeType resourceScope() { return this.innerProperties() == null ? null : this.innerProperties().resourceScope(); }
ResourceScopeType function() { return this.innerProperties() == null ? null : this.innerProperties().resourceScope(); }
/** * Get the resourceScope property: Name of a resource type this recommendation applies, e.g. Subscription, * ServerFarm, Site. * * @return the resourceScope value. */
Get the resourceScope property: Name of a resource type this recommendation applies, e.g. Subscription, ServerFarm, Site
resourceScope
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/RecommendationInner.java", "license": "mit", "size": 20063 }
[ "com.azure.resourcemanager.appservice.models.ResourceScopeType" ]
import com.azure.resourcemanager.appservice.models.ResourceScopeType;
import com.azure.resourcemanager.appservice.models.*;
[ "com.azure.resourcemanager" ]
com.azure.resourcemanager;
1,516,962
@FIXVersion(introduced="4.2") @TagNumRef(tagNum=TagNum.NoQuoteEntries, required=true) public Integer getNoQuoteEntries() { throw new UnsupportedOperationException(getUnsupportedTagMessage()); }
@FIXVersion(introduced="4.2") @TagNumRef(tagNum=TagNum.NoQuoteEntries, required=true) Integer function() { throw new UnsupportedOperationException(getUnsupportedTagMessage()); }
/** * Message field getter. * @return field value */
Message field getter
getNoQuoteEntries
{ "repo_name": "marvisan/HadesFIX", "path": "Model/src/main/java/net/hades/fix/message/group/QuoteSetGroup.java", "license": "gpl-3.0", "size": 37469 }
[ "net.hades.fix.message.anno.FIXVersion", "net.hades.fix.message.anno.TagNumRef", "net.hades.fix.message.type.TagNum" ]
import net.hades.fix.message.anno.FIXVersion; import net.hades.fix.message.anno.TagNumRef; import net.hades.fix.message.type.TagNum;
import net.hades.fix.message.anno.*; import net.hades.fix.message.type.*;
[ "net.hades.fix" ]
net.hades.fix;
1,620,336
public String readFileAsString(String filePath) { return readFileAsString(new File(filePath)); }
String function(String filePath) { return readFileAsString(new File(filePath)); }
/** * Read the file and return a string of the contents * * @param filePath The absolute path to the file on the local filesystem * * @return String of file contents */
Read the file and return a string of the contents
readFileAsString
{ "repo_name": "3sidedcube/Android-LightningUtil", "path": "library/src/main/java/com/cube/storm/util/lib/manager/FileManager.java", "license": "apache-2.0", "size": 8496 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
2,163,133
public DataModel<?> getData() { return aTable.getData(); }
DataModel<?> function() { return aTable.getData(); }
/*************************************** * Returns the table's data model. Will be NULL if no data model has been * set yet through the method {@link #setData(DataModel)}. * * @return The data model of this table */
Returns the table's data model. Will be NULL if no data model has been set yet through the method <code>#setData(DataModel)</code>
getData
{ "repo_name": "esoco/gewt", "path": "src/main/java/de/esoco/ewt/component/TableControl.java", "license": "apache-2.0", "size": 10285 }
[ "de.esoco.lib.model.DataModel" ]
import de.esoco.lib.model.DataModel;
import de.esoco.lib.model.*;
[ "de.esoco.lib" ]
de.esoco.lib;
95,449
protected boolean componentRequiresGrid(JComponent component) { return componentsNeedingGrid.contains(component); }
boolean function(JComponent component) { return componentsNeedingGrid.contains(component); }
/** Returns <code>true</code> if the given component requires the grid * to have been set in order to be enabled; <code>false</code> otherwise. **/
Returns <code>true</code> if the given component requires the grid to have been set in order to be enabled; <code>false</code> otherwise
componentRequiresGrid
{ "repo_name": "AlyceBrady/GridPackage", "path": "edu/kzoo/grid/gui/GridAppFrame.java", "license": "gpl-3.0", "size": 34161 }
[ "javax.swing.JComponent" ]
import javax.swing.JComponent;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
1,367,653
public static void apiManagementUpdateOpenIdConnectProvider( com.azure.resourcemanager.apimanagement.ApiManagementManager manager) { OpenidConnectProviderContract resource = manager .openIdConnectProviders() .getWithResponse("rg1", "apimService1", "te...
static void function( com.azure.resourcemanager.apimanagement.ApiManagementManager manager) { OpenidConnectProviderContract resource = manager .openIdConnectProviders() .getWithResponse("rg1", STR, STR, Context.NONE) .getValue(); resource.update().withClientSecret(STR).withIfMatch("*").apply(); }
/** * Sample code: ApiManagementUpdateOpenIdConnectProvider. * * @param manager Entry point to ApiManagementManager. */
Sample code: ApiManagementUpdateOpenIdConnectProvider
apiManagementUpdateOpenIdConnectProvider
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/apimanagement/azure-resourcemanager-apimanagement/src/samples/java/com/azure/resourcemanager/apimanagement/OpenIdConnectProviderUpdateSamples.java", "license": "mit", "size": 1211 }
[ "com.azure.core.util.Context", "com.azure.resourcemanager.apimanagement.models.OpenidConnectProviderContract" ]
import com.azure.core.util.Context; import com.azure.resourcemanager.apimanagement.models.OpenidConnectProviderContract;
import com.azure.core.util.*; import com.azure.resourcemanager.apimanagement.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,238,033
private void startAboutActivity() { Intent aboutActivityIntent = new Intent(this.getActivity(), AboutActivity.class); this.getActivity().startActivity(aboutActivityIntent); } }
void function() { Intent aboutActivityIntent = new Intent(this.getActivity(), AboutActivity.class); this.getActivity().startActivity(aboutActivityIntent); } }
/** * Start the {@link AboutActivity}. */
Start the <code>AboutActivity</code>
startAboutActivity
{ "repo_name": "hgdev-ch/toposuite-android", "path": "app/src/main/java/ch/hgdev/toposuite/settings/SettingsActivity.java", "license": "gpl-2.0", "size": 6673 }
[ "android.content.Intent" ]
import android.content.Intent;
import android.content.*;
[ "android.content" ]
android.content;
2,005,697
public String getOntLabel(String ontologyURI) { ParameterizedSparqlString labelQuery = new ParameterizedSparqlString(); labelQuery.setCommandText("PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>" + "SELECT ?label\n" + "WHERE {\n" + " GRAPH ?graph...
String function(String ontologyURI) { ParameterizedSparqlString labelQuery = new ParameterizedSparqlString(); labelQuery.setCommandText(STRSELECT ?label\nSTRWHERE {\nSTR GRAPH ?graphName {\nSTR ?ont rdfs:label ?label\nSTR }\nSTR}\nSTRontSTRgraphNameSTRontologiesSTRlabel").toString(); } return null; }
/** * Get the label for an ontology URL * TODO: can be merged with getLabelAndDoc when common-workflow-language/cwltool#427 is resolved * @param ontologyURI The format URI for the ontology * @return Result set with label and doc strings */
Get the label for an ontology URL
getOntLabel
{ "repo_name": "common-workflow-language/cwlviewer", "path": "src/main/java/org/commonwl/view/cwl/RDFService.java", "license": "apache-2.0", "size": 18880 }
[ "org.apache.jena.query.ParameterizedSparqlString" ]
import org.apache.jena.query.ParameterizedSparqlString;
import org.apache.jena.query.*;
[ "org.apache.jena" ]
org.apache.jena;
26,610
private void clearViaQuery(String query) { throw new InternalGemFireError("not yet supported"); }
void function(String query) { throw new InternalGemFireError(STR); }
/** * Do a localDestroy of all matching keys */
Do a localDestroy of all matching keys
clearViaQuery
{ "repo_name": "smgoller/geode", "path": "geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java", "license": "apache-2.0", "size": 395944 }
[ "org.apache.geode.InternalGemFireError" ]
import org.apache.geode.InternalGemFireError;
import org.apache.geode.*;
[ "org.apache.geode" ]
org.apache.geode;
970,363
@UiThreadTest public void testPauseResumeWithoutDelay() { GLSurfaceView view = mActivity.getView(); for (int i = 0; i < NUM_PAUSE_RESUME_ITERATIONS_WITHOUT_DELAY; i++) { if (LOG_PAUSE_RESUME) { Log.w(TAG, "Pause/Resume (no delay) step " + i + " - pause"); ...
void function() { GLSurfaceView view = mActivity.getView(); for (int i = 0; i < NUM_PAUSE_RESUME_ITERATIONS_WITHOUT_DELAY; i++) { if (LOG_PAUSE_RESUME) { Log.w(TAG, STR + i + STR); } view.onPause(); if (LOG_PAUSE_RESUME) { Log.w(TAG, STR + i + STR); } view.onResume(); } }
/** * Test repeated pausing and resuming of a GLSurfaceView. * <p> * This test simply verifies that the system is able to perform multiple * pause/resume sequences without crashing. No delay is used so that a * larger number of iterations can be done in a short amount of time. * </p> ...
Test repeated pausing and resuming of a GLSurfaceView. This test simply verifies that the system is able to perform multiple pause/resume sequences without crashing. No delay is used so that a larger number of iterations can be done in a short amount of time.
testPauseResumeWithoutDelay
{ "repo_name": "s20121035/rk3288_android5.1_repo", "path": "cts/tests/tests/graphics/src/android/opengl/cts/GLSurfaceViewTest.java", "license": "gpl-3.0", "size": 3484 }
[ "android.opengl.GLSurfaceView", "android.util.Log" ]
import android.opengl.GLSurfaceView; import android.util.Log;
import android.opengl.*; import android.util.*;
[ "android.opengl", "android.util" ]
android.opengl; android.util;
2,317,154
private void responseTimeout() { logger.debug("[{}] Miniserver response timeout", debugId); disconnect(LxErrorCode.COMMUNICATION_ERROR, "Miniserver response timeout occured"); }
void function() { logger.debug(STR, debugId); disconnect(LxErrorCode.COMMUNICATION_ERROR, STR); }
/** * Called when response timeout occurred. */
Called when response timeout occurred
responseTimeout
{ "repo_name": "theoweiss/openhab2", "path": "bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxWebSocket.java", "license": "epl-1.0", "size": 26289 }
[ "org.openhab.binding.loxone.internal.types.LxErrorCode" ]
import org.openhab.binding.loxone.internal.types.LxErrorCode;
import org.openhab.binding.loxone.internal.types.*;
[ "org.openhab.binding" ]
org.openhab.binding;
2,267,750
public Date getStopDate() { return stopDate; }
Date function() { return stopDate; }
/** * Gets the stop date. * @return stopDate The stop date. */
Gets the stop date
getStopDate
{ "repo_name": "Spectingular/spectingular.spock", "path": "src/main/java/org/spectingular/spock/dto/ModuleDto.java", "license": "mit", "size": 1859 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
712,847
public static void refineSearch(String query) { List<Apps> tempList=new ArrayList<>(); if(query.equals("")){closeSearch();return;} else for(int i=0;i<SplashActivity.appList.size();i++) { if(SplashActivity.appList.get(i).Name.toLowerCase().contains(query.toLowerCase()))...
static void function(String query) { List<Apps> tempList=new ArrayList<>(); if(query.equals("")){closeSearch();return;} else for(int i=0;i<SplashActivity.appList.size();i++) { if(SplashActivity.appList.get(i).Name.toLowerCase().contains(query.toLowerCase()))tempList.add(SplashActivity.appList.get(i)); } if(tempList.siz...
/** * This method is called from the Navigation Activity, which controls all the search view. * @param query A string with search query. */
This method is called from the Navigation Activity, which controls all the search view
refineSearch
{ "repo_name": "BuildmLearn/BuildmLearn-Store", "path": "Android/source-code/AppStore/app/src/main/java/org/buildmlearn/appstore/activities/AppsActivity.java", "license": "bsd-3-clause", "size": 3967 }
[ "android.view.View", "java.util.ArrayList", "java.util.List", "org.buildmlearn.appstore.adapters.CardViewAdapter", "org.buildmlearn.appstore.models.Apps" ]
import android.view.View; import java.util.ArrayList; import java.util.List; import org.buildmlearn.appstore.adapters.CardViewAdapter; import org.buildmlearn.appstore.models.Apps;
import android.view.*; import java.util.*; import org.buildmlearn.appstore.adapters.*; import org.buildmlearn.appstore.models.*;
[ "android.view", "java.util", "org.buildmlearn.appstore" ]
android.view; java.util; org.buildmlearn.appstore;
1,616,854
public void testConstructorBytesPositive2() { byte aBytes[] = {12, 56, 100}; byte rBytes[] = {12, 56, 100}; BigInteger aNumber = new BigInteger(aBytes); byte resBytes[] = new byte[rBytes.length]; resBytes = aNumber.toByteArray(); for(int i = 0; i < resBytes.leng...
void function() { byte aBytes[] = {12, 56, 100}; byte rBytes[] = {12, 56, 100}; BigInteger aNumber = new BigInteger(aBytes); byte resBytes[] = new byte[rBytes.length]; resBytes = aNumber.toByteArray(); for(int i = 0; i < resBytes.length; i++) { assertTrue(resBytes[i] == rBytes[i]); } assertEquals(STR, 1, aNumber.signum...
/** * Create a positive number from an array of bytes. * The number fits in an integer. */
Create a positive number from an array of bytes. The number fits in an integer
testConstructorBytesPositive2
{ "repo_name": "skyHALud/codenameone", "path": "Ports/iOSPort/xmlvm/apache-harmony-6.0-src-r991881/classlib/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerConstructorsTest.java", "license": "gpl-2.0", "size": 29253 }
[ "java.math.BigInteger" ]
import java.math.BigInteger;
import java.math.*;
[ "java.math" ]
java.math;
2,610,932
public void onPrepared(MediaPlayer mp) { currentPositionPercent = 0; if (AudioTimeline.getPlaylist().size() <= 0) { return; } prepared = true; sendCallback(PRAPARED_CALLBACK); AudioTimeline.getCurrentTrack().setDuration(mp.getDuration()); hasDataSo...
void function(MediaPlayer mp) { currentPositionPercent = 0; if (AudioTimeline.getPlaylist().size() <= 0) { return; } prepared = true; sendCallback(PRAPARED_CALLBACK); AudioTimeline.getCurrentTrack().setDuration(mp.getDuration()); hasDataSource = true; scrobbled = false; if (Utils.isOnline()) { if (!AudioTimeline.getCur...
/** * Calls when player prepared asynchronously */
Calls when player prepared asynchronously
onPrepared
{ "repo_name": "PavelKorolev/LiquidBearAndroid", "path": "src/com/pillowapps/liqear/audio/MusicPlaybackService.java", "license": "gpl-2.0", "size": 58877 }
[ "android.media.AudioManager", "android.media.MediaPlayer", "android.os.Build", "com.pillowapps.liqear.helpers.AuthorizationInfoManager", "com.pillowapps.liqear.helpers.CompatIcs", "com.pillowapps.liqear.helpers.Utils" ]
import android.media.AudioManager; import android.media.MediaPlayer; import android.os.Build; import com.pillowapps.liqear.helpers.AuthorizationInfoManager; import com.pillowapps.liqear.helpers.CompatIcs; import com.pillowapps.liqear.helpers.Utils;
import android.media.*; import android.os.*; import com.pillowapps.liqear.helpers.*;
[ "android.media", "android.os", "com.pillowapps.liqear" ]
android.media; android.os; com.pillowapps.liqear;
1,406,280
private void initialiseRecyclerViewAdapter() { Bundle args = getArguments(); ArrayList<String> cityNames = args.getStringArrayList(CITY_NAME_LIST); adapter = new CityNameAdapter(cityNames); }
void function() { Bundle args = getArguments(); ArrayList<String> cityNames = args.getStringArrayList(CITY_NAME_LIST); adapter = new CityNameAdapter(cityNames); }
/** * Creates a new adapter to map city names to the list rows. */
Creates a new adapter to map city names to the list rows
initialiseRecyclerViewAdapter
{ "repo_name": "Kestutis-Z/World-Weather", "path": "WorldWeather/app/src/main/java/com/haringeymobile/ukweather/CitySearchResultsDialog.java", "license": "apache-2.0", "size": 7195 }
[ "android.os.Bundle", "java.util.ArrayList" ]
import android.os.Bundle; import java.util.ArrayList;
import android.os.*; import java.util.*;
[ "android.os", "java.util" ]
android.os; java.util;
1,855,696
public DataFlavor[] getCurrentDataFlavors() { return getDropTargetContext().getCurrentDataFlavors(); }
DataFlavor[] function() { return getDropTargetContext().getCurrentDataFlavors(); }
/** * This method returns the current DataFlavors. * <P> * @return current DataFlavors */
This method returns the current DataFlavors.
getCurrentDataFlavors
{ "repo_name": "rokn/Count_Words_2015", "path": "testing/openjdk/jdk/src/share/classes/java/awt/dnd/DropTargetDropEvent.java", "license": "mit", "size": 10343 }
[ "java.awt.datatransfer.DataFlavor" ]
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.*;
[ "java.awt" ]
java.awt;
2,906,885
private BlockReaderPeer nextDomainPeer() { if (remainingCacheTries > 0) { Peer peer = clientContext.getPeerCache().get(datanode, true); if (peer != null) { if (LOG.isTraceEnabled()) { LOG.trace("nextDomainPeer: reusing existing peer " + peer); } return new BlockReader...
BlockReaderPeer function() { if (remainingCacheTries > 0) { Peer peer = clientContext.getPeerCache().get(datanode, true); if (peer != null) { if (LOG.isTraceEnabled()) { LOG.trace(STR + peer); } return new BlockReaderPeer(peer, true); } } DomainSocket sock = clientContext.getDomainSocketFactory(). createSocket(pathInfo...
/** * Get the next DomainPeer-- either from the cache or by creating it. * * @return the next DomainPeer, or null if we could not construct one. */
Get the next DomainPeer-- either from the cache or by creating it
nextDomainPeer
{ "repo_name": "wankunde/cloudera_hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/BlockReaderFactory.java", "license": "apache-2.0", "size": 32455 }
[ "org.apache.hadoop.hdfs.net.DomainPeer", "org.apache.hadoop.hdfs.net.Peer", "org.apache.hadoop.net.unix.DomainSocket" ]
import org.apache.hadoop.hdfs.net.DomainPeer; import org.apache.hadoop.hdfs.net.Peer; import org.apache.hadoop.net.unix.DomainSocket;
import org.apache.hadoop.hdfs.net.*; import org.apache.hadoop.net.unix.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
676,266
public void setPaymentDate(LocalDate paymentDate) { this.paymentDate = paymentDate; }
void function(LocalDate paymentDate) { this.paymentDate = paymentDate; }
/** * Payment date of the pay run * * @param paymentDate LocalDate */
Payment date of the pay run
setPaymentDate
{ "repo_name": "XeroAPI/Xero-Java", "path": "src/main/java/com/xero/models/payrollnz/PayRun.java", "license": "mit", "size": 14789 }
[ "org.threeten.bp.LocalDate" ]
import org.threeten.bp.LocalDate;
import org.threeten.bp.*;
[ "org.threeten.bp" ]
org.threeten.bp;
1,528,558
private Collection<CacheEntry<K, V>> interceptGetEntries( @Nullable Collection<? extends K> keys, Map<K, EntryGetResult> map) { if (F.isEmpty(keys)) { assert map.isEmpty(); return Collections.emptySet(); } Map<K, CacheEntry<K, V>> res = U.newHashMap(keys.siz...
Collection<CacheEntry<K, V>> function( @Nullable Collection<? extends K> keys, Map<K, EntryGetResult> map) { if (F.isEmpty(keys)) { assert map.isEmpty(); return Collections.emptySet(); } Map<K, CacheEntry<K, V>> res = U.newHashMap(keys.size()); CacheInterceptor<K, V> interceptor = cacheCfg.getInterceptor(); assert inte...
/** * Applies cache interceptor on result of 'getEntries' operation. * * @param keys All requested keys. * @param map Result map. * @return Map with values returned by cache interceptor.. */
Applies cache interceptor on result of 'getEntries' operation
interceptGetEntries
{ "repo_name": "ptupitsyn/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java", "license": "apache-2.0", "size": 228325 }
[ "java.util.Collection", "java.util.Collections", "java.util.Map", "org.apache.ignite.cache.CacheEntry", "org.apache.ignite.cache.CacheInterceptor", "org.apache.ignite.internal.util.typedef.F", "org.apache.ignite.internal.util.typedef.internal.U", "org.jetbrains.annotations.Nullable" ]
import java.util.Collection; import java.util.Collections; import java.util.Map; import org.apache.ignite.cache.CacheEntry; import org.apache.ignite.cache.CacheInterceptor; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.internal.U; import org.jetbrains.annotations.Nulla...
import java.util.*; import org.apache.ignite.cache.*; import org.apache.ignite.internal.util.typedef.*; import org.apache.ignite.internal.util.typedef.internal.*; import org.jetbrains.annotations.*;
[ "java.util", "org.apache.ignite", "org.jetbrains.annotations" ]
java.util; org.apache.ignite; org.jetbrains.annotations;
2,146,035
public static JSONObject readJSONFile(File f) throws IOException, JSONException { BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(f))); try { StringBuilder stringBuilder = new StringBuilder(); String readStr; while ((readStr = ...
static JSONObject function(File f) throws IOException, JSONException { BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(f))); try { StringBuilder stringBuilder = new StringBuilder(); String readStr; while ((readStr = reader.readLine()) != null) { stringBuilder.append(readStr); } retu...
/** * Reads the contents of this page from storage. * @return Page object with the contents of the page. * @throws IOException * @throws JSONException */
Reads the contents of this page from storage
readJSONFile
{ "repo_name": "parvez3019/apps-android-wikipedia", "path": "app/src/main/java/org/wikipedia/Utils.java", "license": "apache-2.0", "size": 22084 }
[ "java.io.BufferedReader", "java.io.File", "java.io.FileInputStream", "java.io.IOException", "java.io.InputStreamReader", "org.json.JSONException", "org.json.JSONObject" ]
import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import org.json.JSONException; import org.json.JSONObject;
import java.io.*; import org.json.*;
[ "java.io", "org.json" ]
java.io; org.json;
148,851
private synchronized Symbol createSymbolFromEvent(StraceEvent straceEvent, SymbolStructureStrace symbolStructure, HashMap<String, Matcher> paramMatchers) { if (straceEvent.getNameSystemCall().equals(symbolStructure.getNameSystemCall())) { //Find parameters TreeMap<String, String> p...
synchronized Symbol function(StraceEvent straceEvent, SymbolStructureStrace symbolStructure, HashMap<String, Matcher> paramMatchers) { if (straceEvent.getNameSystemCall().equals(symbolStructure.getNameSystemCall())) { TreeMap<String, String> parameterValues = new TreeMap<>(); for (Map.Entry<String, Pattern> pDescriptio...
/** * Try to create a symbol from a straceEvent. The method compared with the structured symbolStructure. * Match the event with a structure using the app, name, return value and the parameters of system call. * Reuse the match to avoid create a new one. * * @param straceEvent to "transform...
Try to create a symbol from a straceEvent. The method compared with the structured symbolStructure. Match the event with a structure using the app, name, return value and the parameters of system call. Reuse the match to avoid create a new one
createSymbolFromEvent
{ "repo_name": "alexissilva/behaviordroid", "path": "app/src/main/java/behaviordroid/listener/Inspector.java", "license": "apache-2.0", "size": 9605 }
[ "java.util.HashMap", "java.util.Map", "java.util.TreeMap", "java.util.regex.Matcher", "java.util.regex.Pattern" ]
import java.util.HashMap; import java.util.Map; import java.util.TreeMap; import java.util.regex.Matcher; import java.util.regex.Pattern;
import java.util.*; import java.util.regex.*;
[ "java.util" ]
java.util;
1,512,169
public void test(TestHarness harness) { // create instance of a class Double Object o = new IllegalArgumentException("IllegalArgumentException"); // get a runtime class of an object "o" Class c = o.getClass(); harness.check(!c.isSynthetic()); }
void function(TestHarness harness) { Object o = new IllegalArgumentException(STR); Class c = o.getClass(); harness.check(!c.isSynthetic()); }
/** * Runs the test using the specified harness. * * @param harness the test harness (<code>null</code> not permitted). */
Runs the test using the specified harness
test
{ "repo_name": "niloc132/mauve-gwt", "path": "src/main/java/gnu/testlet/java/lang/IllegalArgumentException/classInfo/isSynthetic.java", "license": "gpl-2.0", "size": 1641 }
[ "gnu.testlet.TestHarness", "java.lang.IllegalArgumentException" ]
import gnu.testlet.TestHarness; import java.lang.IllegalArgumentException;
import gnu.testlet.*; import java.lang.*;
[ "gnu.testlet", "java.lang" ]
gnu.testlet; java.lang;
686,976
@Cacheable(value= DailyOvertimeRule.CACHE_NAME, key="'groupKeyCode=' + #p0" + "+ '|' + 'paytype=' + #p1" + "+ '|' + 'dept=' + #p2" + "+ '|' + 'workArea=' + #p3" + "+ '|' + 'asOfDate=' + #p4") public DailyOvertimeRule getD...
@Cacheable(value= DailyOvertimeRule.CACHE_NAME, key=STR + STR + STR + STR + STR) DailyOvertimeRule function(String groupKeyCode, String paytype, String dept, Long workArea, LocalDate asOfDate); void processDailyOvertimeRules(TimesheetDocument timesheetDocument, TkTimeBlockAggregate aggregate); @Cacheable(value= DailyOv...
/** * Fetch Daily overtime rule by id * @param tkDailyOvertimeRuleId * @return */
Fetch Daily overtime rule by id
getDailyOvertimeRule
{ "repo_name": "kuali/kpme", "path": "tk-lm/impl/src/main/java/org/kuali/kpme/tklm/time/rules/overtime/daily/service/DailyOvertimeRuleService.java", "license": "apache-2.0", "size": 2759 }
[ "org.joda.time.LocalDate", "org.kuali.kpme.tklm.time.rules.overtime.daily.DailyOvertimeRule", "org.kuali.kpme.tklm.time.timesheet.TimesheetDocument", "org.kuali.kpme.tklm.time.util.TkTimeBlockAggregate", "org.springframework.cache.annotation.Cacheable" ]
import org.joda.time.LocalDate; import org.kuali.kpme.tklm.time.rules.overtime.daily.DailyOvertimeRule; import org.kuali.kpme.tklm.time.timesheet.TimesheetDocument; import org.kuali.kpme.tklm.time.util.TkTimeBlockAggregate; import org.springframework.cache.annotation.Cacheable;
import org.joda.time.*; import org.kuali.kpme.tklm.time.rules.overtime.daily.*; import org.kuali.kpme.tklm.time.timesheet.*; import org.kuali.kpme.tklm.time.util.*; import org.springframework.cache.annotation.*;
[ "org.joda.time", "org.kuali.kpme", "org.springframework.cache" ]
org.joda.time; org.kuali.kpme; org.springframework.cache;
1,271,680
@Override public void close() throws IOException { try { closeWriter(); } finally { if (input != null) input.delete(); if (sorted != null) sorted.delete(); } } class ByteSequenceIterator implements BytesRefIterator { private final ByteSequencesReader reader; private B...
void function() throws IOException { try { closeWriter(); } finally { if (input != null) input.delete(); if (sorted != null) sorted.delete(); } } class ByteSequenceIterator implements BytesRefIterator { private final ByteSequencesReader reader; private BytesRef scratch = new BytesRef(); private final Comparator<BytesRe...
/** * Removes any written temporary files. */
Removes any written temporary files
close
{ "repo_name": "smartan/lucene", "path": "src/main/java/org/apache/lucene/search/suggest/fst/ExternalRefSorter.java", "license": "apache-2.0", "size": 4066 }
[ "java.io.IOException", "java.util.Comparator", "org.apache.lucene.util.BytesRef", "org.apache.lucene.util.BytesRefIterator", "org.apache.lucene.util.OfflineSorter" ]
import java.io.IOException; import java.util.Comparator; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRefIterator; import org.apache.lucene.util.OfflineSorter;
import java.io.*; import java.util.*; import org.apache.lucene.util.*;
[ "java.io", "java.util", "org.apache.lucene" ]
java.io; java.util; org.apache.lucene;
1,660,769
public Element getElement() { return SVGOMElement.this; }
Element function() { return SVGOMElement.this; }
/** * Returns the element. */
Returns the element
getElement
{ "repo_name": "srnsw/xena", "path": "plugins/image/ext/src/batik-1.7/sources/org/apache/batik/dom/svg/SVGOMElement.java", "license": "gpl-3.0", "size": 31547 }
[ "org.w3c.dom.Element" ]
import org.w3c.dom.Element;
import org.w3c.dom.*;
[ "org.w3c.dom" ]
org.w3c.dom;
2,740,398
void deleteTableSnapshots(Pattern tableNamePattern, Pattern snapshotNamePattern) throws IOException;
void deleteTableSnapshots(Pattern tableNamePattern, Pattern snapshotNamePattern) throws IOException;
/** * Delete all existing snapshots matching the given table name regular expression and snapshot * name regular expression. * @param tableNamePattern The compiled table name regular expression to match against * @param snapshotNamePattern The compiled snapshot name regular expression to match against * ...
Delete all existing snapshots matching the given table name regular expression and snapshot name regular expression
deleteTableSnapshots
{ "repo_name": "ultratendency/hbase", "path": "hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java", "license": "apache-2.0", "size": 97030 }
[ "java.io.IOException", "java.util.regex.Pattern" ]
import java.io.IOException; import java.util.regex.Pattern;
import java.io.*; import java.util.regex.*;
[ "java.io", "java.util" ]
java.io; java.util;
822,823
@Test @SmallTest @Feature({"AndroidWebView"}) public void testHeartbeatMetrics() throws Throwable { final String data = "<html><head></head><body><p>Hello World</p></body></html>"; final String url = mWebServer.setResponse(MAIN_FRAME_FILE, data, null); int navigationToFirstPaint ...
@Feature({STR}) void function() throws Throwable { final String data = STR; final String url = mWebServer.setResponse(MAIN_FRAME_FILE, data, null); int navigationToFirstPaint = RecordHistogram.getHistogramTotalCountForTesting( STR); int navigationToFirstContentfulPaint = RecordHistogram.getHistogramTotalCountForTesting...
/** * This test covers WebView heartbeat metrics from CorePageLoadMetrics. */
This test covers WebView heartbeat metrics from CorePageLoadMetrics
testHeartbeatMetrics
{ "repo_name": "endlessm/chromium-browser", "path": "android_webview/javatests/src/org/chromium/android_webview/test/AwPageLoadMetricsTest.java", "license": "bsd-3-clause", "size": 7607 }
[ "org.chromium.base.metrics.RecordHistogram", "org.chromium.base.test.util.Feature" ]
import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.test.util.Feature;
import org.chromium.base.metrics.*; import org.chromium.base.test.util.*;
[ "org.chromium.base" ]
org.chromium.base;
1,131,084
default Function4<T11, T12, T13, T14, R> curry(Tuple10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> args) { return (v11, v12, v13, v14) -> apply(args.v1, args.v2, args.v3, args.v4, args.v5, args.v6, args.v7, args.v8, args.v9, args.v10, v11, v12, v13, v14); }
default Function4<T11, T12, T13, T14, R> curry(Tuple10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> args) { return (v11, v12, v13, v14) -> apply(args.v1, args.v2, args.v3, args.v4, args.v5, args.v6, args.v7, args.v8, args.v9, args.v10, v11, v12, v13, v14); }
/** * Partially apply this function to the arguments. */
Partially apply this function to the arguments
curry
{ "repo_name": "colinger/jOOL", "path": "src/main/java/org/jooq/lambda/function/Function14.java", "license": "apache-2.0", "size": 11076 }
[ "org.jooq.lambda.tuple.Tuple10" ]
import org.jooq.lambda.tuple.Tuple10;
import org.jooq.lambda.tuple.*;
[ "org.jooq.lambda" ]
org.jooq.lambda;
1,826,466
public static void initDefaultComparator() { if (_inited) { return; } _initing = true; try { registerComparator(Object.class, new DefaultComparator()); registerComparator(Boolean.class, new BooleanComparator()); registerComparator(Cal...
static void function() { if (_inited) { return; } _initing = true; try { registerComparator(Object.class, new DefaultComparator()); registerComparator(Boolean.class, new BooleanComparator()); registerComparator(Calendar.class, new CalendarComparator()); registerComparator(Date.class, new DateComparator()); NumberCompar...
/** * Initialize default comparator. Please make sure you call this method before you use any comparator related * classes such as SortableTableModel. */
Initialize default comparator. Please make sure you call this method before you use any comparator related classes such as SortableTableModel
initDefaultComparator
{ "repo_name": "clementvillanueva/SimpleHDR", "path": "src/com/jidesoft/comparator/ObjectComparatorManager.java", "license": "gpl-3.0", "size": 15391 }
[ "java.text.Collator", "java.util.Calendar", "java.util.Date" ]
import java.text.Collator; import java.util.Calendar; import java.util.Date;
import java.text.*; import java.util.*;
[ "java.text", "java.util" ]
java.text; java.util;
1,456,398
Type checkNonCyclic(int pos, Type t) { Symbol c = t.tsym; if ((c.flags_field & LOCKED) != 0) { log.error(pos, "cyclic.inheritance", c.toJava()); t = new ErrorType((ClassSymbol) c); } else if ((c.flags_field & ACYCLIC) != 0) { return t; } else if (!c.type.isErroneous()) { try { c.flags_field |...
Type checkNonCyclic(int pos, Type t) { Symbol c = t.tsym; if ((c.flags_field & LOCKED) != 0) { log.error(pos, STR, c.toJava()); t = new ErrorType((ClassSymbol) c); } else if ((c.flags_field & ACYCLIC) != 0) { return t; } else if (!c.type.isErroneous()) { try { c.flags_field = LOCKED; for (List l = c.type.interfaces(); ...
/** * Check for cyclic references. Issue an error if the symbol of the type * referred to has a LOCKED flag set. * * @param pos * Position to be used for error reporting. * @param t * The type referred to. */
Check for cyclic references. Issue an error if the symbol of the type referred to has a LOCKED flag set
checkNonCyclic
{ "repo_name": "nileshpatelksy/hello-pod-cast", "path": "archive/FILE/Compiler/java_GJC1.42_src/src/com/sun/tools/javac/v8/comp/Check.java", "license": "apache-2.0", "size": 33653 }
[ "com.sun.tools.javac.v8.code.Symbol", "com.sun.tools.javac.v8.code.Type", "com.sun.tools.javac.v8.util.List" ]
import com.sun.tools.javac.v8.code.Symbol; import com.sun.tools.javac.v8.code.Type; import com.sun.tools.javac.v8.util.List;
import com.sun.tools.javac.v8.code.*; import com.sun.tools.javac.v8.util.*;
[ "com.sun.tools" ]
com.sun.tools;
373,760
public byte read() { Iterator<ByteBuffer> iterator = this.cache.iterator(); ByteBuffer buffer = iterator.next(); byte b = buffer.get(); if (buffer.remaining() == 0) { iterator.remove(); } this.size--; this.sourceOffset++; return b; }
byte function() { Iterator<ByteBuffer> iterator = this.cache.iterator(); ByteBuffer buffer = iterator.next(); byte b = buffer.get(); if (buffer.remaining() == 0) { iterator.remove(); } this.size--; this.sourceOffset++; return b; }
/** * Consumes a single byte from the state's internal cache of buffers. * Meant for use by AvroSchema objects (specifically ones that represent primitive types, since complex types * are just a combination of primitive types) * * @return The byte requested. */
Consumes a single byte from the state's internal cache of buffers. Meant for use by AvroSchema objects (specifically ones that represent primitive types, since complex types are just a combination of primitive types)
read
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/storage/azure-storage-internal-avro/src/main/java/com/azure/storage/internal/avro/implementation/AvroParserState.java", "license": "mit", "size": 4849 }
[ "java.nio.ByteBuffer", "java.util.Iterator" ]
import java.nio.ByteBuffer; import java.util.Iterator;
import java.nio.*; import java.util.*;
[ "java.nio", "java.util" ]
java.nio; java.util;
1,340,024
@Test public void whenStartThreadWithTimerThenHeIsDeathAfterTimeout() { long timeout = 10L; Thread timer = new Thread(new Time(endlessThread, timeout)); endlessThread.start(); timer.start(); try { Thread.sleep(timeout + timeout); } catch (Interrupted...
void function() { long timeout = 10L; Thread timer = new Thread(new Time(endlessThread, timeout)); endlessThread.start(); timer.start(); try { Thread.sleep(timeout + timeout); } catch (InterruptedException e) { e.printStackTrace(); } Assert.assertThat(endlessThread.isAlive(), is(false)); }
/** * Starts the endless thread and the Time thread stops him. */
Starts the endless thread and the Time thread stops him
whenStartThreadWithTimerThenHeIsDeathAfterTimeout
{ "repo_name": "dinar92/java_training", "path": "chapter_007/src/test/java/ru/job4j/multithread/TimeTest.java", "license": "apache-2.0", "size": 2344 }
[ "org.hamcrest.core.Is", "org.junit.Assert" ]
import org.hamcrest.core.Is; import org.junit.Assert;
import org.hamcrest.core.*; import org.junit.*;
[ "org.hamcrest.core", "org.junit" ]
org.hamcrest.core; org.junit;
110,558
public Raster[] scheduleTiles(OpImage owner, Point tileIndices[]) { if (owner == null || tileIndices == null) { throw new IllegalArgumentException("Null owner or TileIndices"); } return (Raster[])scheduleJob(owner, tileIndices, true, false, null)...
Raster[] function(OpImage owner, Point tileIndices[]) { if (owner == null tileIndices == null) { throw new IllegalArgumentException(STR); } return (Raster[])scheduleJob(owner, tileIndices, true, false, null); }
/** * Schedules multiple tiles of an image for computation. * * @param owner The image the tiles belong to. * @param tileIndices An array of tile X and Y indices. * * @return An array of computed tiles. */
Schedules multiple tiles of an image for computation
scheduleTiles
{ "repo_name": "AntonKast/LightZone", "path": "lightcrafts/src/com/lightcrafts/jai/utils/LCTileScheduler.java", "license": "bsd-3-clause", "size": 62924 }
[ "com.lightcrafts.mediax.jai.OpImage", "java.awt.Point", "java.awt.image.Raster" ]
import com.lightcrafts.mediax.jai.OpImage; import java.awt.Point; import java.awt.image.Raster;
import com.lightcrafts.mediax.jai.*; import java.awt.*; import java.awt.image.*;
[ "com.lightcrafts.mediax", "java.awt" ]
com.lightcrafts.mediax; java.awt;
616,237
private void getManageLanguageService() { if (manageLanguageService == null) { manageLanguageService = ServiceAccess.getServiceAcccessFor( JSFUtils.getRequest().getSession()).getService( ManageLanguageService.class); } }
void function() { if (manageLanguageService == null) { manageLanguageService = ServiceAccess.getServiceAcccessFor( JSFUtils.getRequest().getSession()).getService( ManageLanguageService.class); } }
/** * Initialize the {@link ManageLanguageService} if not already done. */
Initialize the <code>ManageLanguageService</code> if not already done
getManageLanguageService
{ "repo_name": "opetrovski/development", "path": "oscm-portal/javasrc/org/oscm/ui/beans/ApplicationBean.java", "license": "apache-2.0", "size": 28434 }
[ "org.oscm.internal.operatorservice.ManageLanguageService", "org.oscm.ui.common.JSFUtils", "org.oscm.ui.common.ServiceAccess" ]
import org.oscm.internal.operatorservice.ManageLanguageService; import org.oscm.ui.common.JSFUtils; import org.oscm.ui.common.ServiceAccess;
import org.oscm.internal.operatorservice.*; import org.oscm.ui.common.*;
[ "org.oscm.internal", "org.oscm.ui" ]
org.oscm.internal; org.oscm.ui;
1,488,577
private static WebElement findElement(By by, WebDriver driver) { try { return driver.findElements(by).stream().findFirst().orElseThrow( () -> new NoSuchElementException("Cannot locate an element using " + by)); } catch (NoSuchElementException e) { throw e; } catch (WebDriverException...
static WebElement function(By by, WebDriver driver) { try { return driver.findElements(by).stream().findFirst().orElseThrow( () -> new NoSuchElementException(STR + by)); } catch (NoSuchElementException e) { throw e; } catch (WebDriverException e) { log.log(Level.WARNING, String.format(STR, by), e); throw e; } }
/** * Looks up an element. Logs and re-throws WebDriverException if thrown. <p/> Method exists to * gather data for http://code.google.com/p/selenium/issues/detail?id=1800 * * @param driver WebDriver * @param by locator * @return WebElement found */
Looks up an element. Logs and re-throws WebDriverException if thrown. Method exists to gather data for HREF
findElement
{ "repo_name": "xmhubj/selenium", "path": "java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java", "license": "apache-2.0", "size": 50692 }
[ "java.util.logging.Level", "org.openqa.selenium.By", "org.openqa.selenium.NoSuchElementException", "org.openqa.selenium.WebDriver", "org.openqa.selenium.WebDriverException", "org.openqa.selenium.WebElement" ]
import java.util.logging.Level; import org.openqa.selenium.By; import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriverException; import org.openqa.selenium.WebElement;
import java.util.logging.*; import org.openqa.selenium.*;
[ "java.util", "org.openqa.selenium" ]
java.util; org.openqa.selenium;
1,260,873
public void setInitialState(@Nullable JobManagerTaskRestore taskRestore) { this.taskRestore = taskRestore; }
void function(@Nullable JobManagerTaskRestore taskRestore) { this.taskRestore = taskRestore; }
/** * Sets the initial state for the execution. The serialized state is then shipped via the {@link * TaskDeploymentDescriptor} to the TaskManagers. * * @param taskRestore information to restore the state */
Sets the initial state for the execution. The serialized state is then shipped via the <code>TaskDeploymentDescriptor</code> to the TaskManagers
setInitialState
{ "repo_name": "aljoscha/flink", "path": "flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java", "license": "apache-2.0", "size": 69038 }
[ "javax.annotation.Nullable", "org.apache.flink.runtime.checkpoint.JobManagerTaskRestore" ]
import javax.annotation.Nullable; import org.apache.flink.runtime.checkpoint.JobManagerTaskRestore;
import javax.annotation.*; import org.apache.flink.runtime.checkpoint.*;
[ "javax.annotation", "org.apache.flink" ]
javax.annotation; org.apache.flink;
2,490,279
protected TMotd copyInto(TMotd copyObj, boolean deepcopy) throws TorqueException { copyObj.setObjectID(objectID); copyObj.setTheLocale(theLocale); copyObj.setTheMessage(theMessage); copyObj.setTeaserText(teaserText); copyObj.setUuid(uuid); copyObj.setObjectID((In...
TMotd function(TMotd copyObj, boolean deepcopy) throws TorqueException { copyObj.setObjectID(objectID); copyObj.setTheLocale(theLocale); copyObj.setTheMessage(theMessage); copyObj.setTeaserText(teaserText); copyObj.setUuid(uuid); copyObj.setObjectID((Integer)null); if (deepcopy) { } return copyObj; }
/** * Fills the copyObj with the contents of this object. * If deepcopy is true, The associated objects are also copied * and treated as new objects. * * @param copyObj the object to fill. * @param deepcopy whether the associated objects should be copied. */
Fills the copyObj with the contents of this object. If deepcopy is true, The associated objects are also copied and treated as new objects
copyInto
{ "repo_name": "trackplus/Genji", "path": "src/main/java/com/aurel/track/persist/BaseTMotd.java", "license": "gpl-3.0", "size": 22995 }
[ "org.apache.torque.TorqueException" ]
import org.apache.torque.TorqueException;
import org.apache.torque.*;
[ "org.apache.torque" ]
org.apache.torque;
405,319
public synchronized void interfaceUp(long nodeid, InetAddress ip, long t) { for (RTCNode rtcN : (List<RTCNode>) m_map.getRTCNodes(nodeid, ip)) { rtcN.nodeRegainedService(t); } }
synchronized void function(long nodeid, InetAddress ip, long t) { for (RTCNode rtcN : (List<RTCNode>) m_map.getRTCNodes(nodeid, ip)) { rtcN.nodeRegainedService(t); } }
/** * Add a regained service entry to the right nodes. * * @param nodeid * the node id * @param ip * the IP address * @param t * the time at which service was regained */
Add a regained service entry to the right nodes
interfaceUp
{ "repo_name": "tharindum/opennms_dashboard", "path": "opennms-services/src/main/java/org/opennms/netmgt/rtc/DataManager.java", "license": "gpl-2.0", "size": 30335 }
[ "java.net.InetAddress", "java.util.List", "org.opennms.netmgt.rtc.datablock.RTCNode" ]
import java.net.InetAddress; import java.util.List; import org.opennms.netmgt.rtc.datablock.RTCNode;
import java.net.*; import java.util.*; import org.opennms.netmgt.rtc.datablock.*;
[ "java.net", "java.util", "org.opennms.netmgt" ]
java.net; java.util; org.opennms.netmgt;
691,380
public MavenBuildAssert doesNotHaveBom(String groupId, String artifactId) { this.pom.nodesAtPath("/project/dependencyManagement/dependencies/dependency").noneMatch((candidate) -> { BillOfMaterials actual = toBom(candidate); return groupId.equals(actual.getGroupId()) && artifactId.equals(actual.getArtifactId(...
MavenBuildAssert function(String groupId, String artifactId) { this.pom.nodesAtPath(STR).noneMatch((candidate) -> { BillOfMaterials actual = toBom(candidate); return groupId.equals(actual.getGroupId()) && artifactId.equals(actual.getArtifactId()); }); return this; }
/** * Assert that {@code pom.xml} does not define the specified bom. * @param groupId the groupId of the bom * @param artifactId the artifactId of the bom * @return {@code this} assertion object */
Assert that pom.xml does not define the specified bom
doesNotHaveBom
{ "repo_name": "spring-io/initializr", "path": "initializr-generator-test/src/main/java/io/spring/initializr/generator/test/buildsystem/maven/MavenBuildAssert.java", "license": "apache-2.0", "size": 15972 }
[ "io.spring.initializr.metadata.BillOfMaterials" ]
import io.spring.initializr.metadata.BillOfMaterials;
import io.spring.initializr.metadata.*;
[ "io.spring.initializr" ]
io.spring.initializr;
2,798,058
TestResult result = null; try { // Create a test folder name for this iteration String testFolderName = TestFolderName + "_" + threadId + "_" + iteration; String newFolderName = TestFolderNew + "_" + threadId + "_" + iteration; // DEBUG testLog( log, "RenameFolder Test"); ...
TestResult result = null; try { String testFolderName = TestFolderName + "_" + threadId + "_" + iteration; String newFolderName = TestFolderNew + "_" + threadId + "_" + iteration; testLog( log, STR); if ( sess.FileExists( testFolderName)) { testLog( log, STR + testFolderName + STR); result = new BooleanTestResult( fals...
/** * Run the rename folder test * * @param threadId int * @param iteration int * @param sess DiskSession * @param log StringWriter * @return TestResult */
Run the rename folder test
runTest
{ "repo_name": "loftuxab/community-edition-old", "path": "projects/alfresco-jlan/source/test-java/org/alfresco/jlan/test/cluster/RenameFolderTest.java", "license": "lgpl-3.0", "size": 3726 }
[ "org.alfresco.jlan.debug.Debug" ]
import org.alfresco.jlan.debug.Debug;
import org.alfresco.jlan.debug.*;
[ "org.alfresco.jlan" ]
org.alfresco.jlan;
1,738,792
public WebserviceResponse makeRundeckRequest(final String urlPath, final Map queryParams, final Map<String, ? extends Object> formData) throws CoreException, MalformedURLException { return makeRundeckRe...
WebserviceResponse function(final String urlPath, final Map queryParams, final Map<String, ? extends Object> formData) throws CoreException, MalformedURLException { return makeRundeckRequest(urlPath, queryParams, null, null, null, formData, null); }
/** * Make the request to the ItNav workbench. * * @param urlPath the path for the request * @param queryParams any query parameters * @param formData form data * * @return parsed XML document, or null * * @throws com.dtolabs.rundeck.core.CoreException * ...
Make the request to the ItNav workbench
makeRundeckRequest
{ "repo_name": "tjordanchat/rundeck", "path": "core/src/main/java/com/dtolabs/client/services/ServerService.java", "license": "apache-2.0", "size": 9609 }
[ "com.dtolabs.client.utils.WebserviceResponse", "com.dtolabs.rundeck.core.CoreException", "java.net.MalformedURLException", "java.util.Map" ]
import com.dtolabs.client.utils.WebserviceResponse; import com.dtolabs.rundeck.core.CoreException; import java.net.MalformedURLException; import java.util.Map;
import com.dtolabs.client.utils.*; import com.dtolabs.rundeck.core.*; import java.net.*; import java.util.*;
[ "com.dtolabs.client", "com.dtolabs.rundeck", "java.net", "java.util" ]
com.dtolabs.client; com.dtolabs.rundeck; java.net; java.util;
681,462
private OMElement generateSelectOrderByNumberElement(int id) { OMElement selectOrderByNumberOpEl = fac.createOMElement("select_order_by_number_operation", omNs); OMElement orderNumberEl = fac.createOMElement("orderNumber", omNs); orderNumberEl.setText("" + id); selectOrderByNumberOp...
OMElement function(int id) { OMElement selectOrderByNumberOpEl = fac.createOMElement(STR, omNs); OMElement orderNumberEl = fac.createOMElement(STR, omNs); orderNumberEl.setText("" + id); selectOrderByNumberOpEl.addChild(orderNumberEl); return selectOrderByNumberOpEl; }
/** * Helper method to generate SelectOrderByNumber operation Request OME element. * * @param id * @return */
Helper method to generate SelectOrderByNumber operation Request OME element
generateSelectOrderByNumberElement
{ "repo_name": "madhawa-gunasekara/product-ei", "path": "integration/dataservice-hosting-tests/tests-integration/tests/src/test/java/org/wso2/ei/dataservice/integration/test/requestBox/RequestBoxTenantUserTestCase.java", "license": "apache-2.0", "size": 17043 }
[ "org.apache.axiom.om.OMElement" ]
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.*;
[ "org.apache.axiom" ]
org.apache.axiom;
897,057
private boolean isCopyOnItself(String src, String dest) { // This weird test is to determine if we are copying or moving a directory into itself. // Copy /sdcard/myDir to /sdcard/myDir-backup is okay but // Copy /sdcard/myDir to /sdcard/myDir/backup should throw an INVALID_MODIFICATION_ERR ...
boolean function(String src, String dest) { return dest.equals(src) dest.startsWith(src + File.separator); }
/** * Check to see if the user attempted to copy an entry into its parent without changing its name, * or attempted to copy a directory into a directory that it contains directly or indirectly. * * @param srcDir * @param destinationDir * @return */
Check to see if the user attempted to copy an entry into its parent without changing its name, or attempted to copy a directory into a directory that it contains directly or indirectly
isCopyOnItself
{ "repo_name": "Dev4X/MVP-Launcher", "path": "www/plugins/org.apache.cordova.file/src/android/LocalFilesystem.java", "license": "apache-2.0", "size": 23161 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
1,100,090
@Override public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { super.onNeighborBlockChange(world, x, y, z, block); }
void function(World world, int x, int y, int z, Block block) { super.onNeighborBlockChange(world, x, y, z, block); }
/** * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are * their own) Args: x, y, z, neighbor blockID */
Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are their own) Args: x, y, z, neighbor blockID
onNeighborBlockChange
{ "repo_name": "McZapkie/TerraFirmaProgressivePack", "path": "TFCPPHMod/src/main/java/wahazar/tfcpphelper/blocks/BlockNeutralLiquid.java", "license": "gpl-3.0", "size": 3479 }
[ "net.minecraft.block.Block", "net.minecraft.world.World" ]
import net.minecraft.block.Block; import net.minecraft.world.World;
import net.minecraft.block.*; import net.minecraft.world.*;
[ "net.minecraft.block", "net.minecraft.world" ]
net.minecraft.block; net.minecraft.world;
1,488,932
public B durationFrom(ReadablePeriod p, DateTime dt) { return duration(p.toPeriod().toDurationFrom(dt)); }
B function(ReadablePeriod p, DateTime dt) { return duration(p.toPeriod().toDurationFrom(dt)); }
/** * Set the duration as a given period of time from the given reference * @param p ReadablePeriod * @param dt DateTime * @return B */
Set the duration as a given period of time from the given reference
durationFrom
{ "repo_name": "worldline-messaging/activitystreams", "path": "core/src/main/java/com/ibm/common/activitystreams/ASObject.java", "license": "apache-2.0", "size": 65559 }
[ "com.ibm.common.activitystreams.util.Converters", "org.joda.time.DateTime", "org.joda.time.ReadablePeriod" ]
import com.ibm.common.activitystreams.util.Converters; import org.joda.time.DateTime; import org.joda.time.ReadablePeriod;
import com.ibm.common.activitystreams.util.*; import org.joda.time.*;
[ "com.ibm.common", "org.joda.time" ]
com.ibm.common; org.joda.time;
2,266,749
protected boolean startTx() { EntityManager em = entityManagerService.getEntityManager(); if (!em.getTransaction().isActive()) { em.getTransaction().begin(); LOG.debug("started new transaction"); return true; } return false; }
boolean function() { EntityManager em = entityManagerService.getEntityManager(); if (!em.getTransaction().isActive()) { em.getTransaction().begin(); LOG.debug(STR); return true; } return false; }
/** * Starts the transaction if it isn't existing * * @return */
Starts the transaction if it isn't existing
startTx
{ "repo_name": "exo-addons/portal-rdbms", "path": "lib/src/main/java/org/exoplatform/portal/jdbc/migration/AbstractMigrationService.java", "license": "lgpl-3.0", "size": 4793 }
[ "javax.persistence.EntityManager" ]
import javax.persistence.EntityManager;
import javax.persistence.*;
[ "javax.persistence" ]
javax.persistence;
1,561,828
return new HashMap<K, V>(); } /** * Creates an {@code IdentityHashMap} instance. * * @return a new, empty {@code IdentityHashMap}
return new HashMap<K, V>(); } /** * Creates an {@code IdentityHashMap} instance. * * @return a new, empty {@code IdentityHashMap}
/** * Creates a <i>mutable</i>, empty {@code HashMap} instance. * * @return a new, empty {@code HashMap} */
Creates a mutable, empty HashMap instance
newHashMap
{ "repo_name": "ppamorim/fresco", "path": "fbcore/src/main/java/com/facebook/common/internal/Maps.java", "license": "bsd-3-clause", "size": 1446 }
[ "java.util.HashMap", "java.util.IdentityHashMap" ]
import java.util.HashMap; import java.util.IdentityHashMap;
import java.util.*;
[ "java.util" ]
java.util;
1,546,510
@SuppressWarnings("nls") private void migrateTagsToMetadata() { Context context = ContextManager.getContext(); if(!checkIfDatabaseExists(context, tagsTable) || !checkIfDatabaseExists(context, tagTaskTable)) return; SQLiteDatabase tagsDb = new Astrid2UpgradeH...
@SuppressWarnings("nls") void function() { Context context = ContextManager.getContext(); if(!checkIfDatabaseExists(context, tagsTable) !checkIfDatabaseExists(context, tagTaskTable)) return; SQLiteDatabase tagsDb = new Astrid2UpgradeHelper(context, tagsTable, null, 1).getReadableDatabase(); SQLiteDatabase tagTaskDb = n...
/** * Move data from tags tables into metadata table. We do this by looping * through both the tags and tagTaskMap databases, reading data from * both and adding to the Metadata table. This way, we are able to * do everything in one pass without loading too much into memory */
Move data from tags tables into metadata table. We do this by looping through both the tags and tagTaskMap databases, reading data from both and adding to the Metadata table. This way, we are able to do everything in one pass without loading too much into memory
migrateTagsToMetadata
{ "repo_name": "memswiler/astrid", "path": "astrid/src/com/todoroo/astrid/service/Astrid2To3UpgradeHelper.java", "license": "gpl-3.0", "size": 17963 }
[ "android.content.Context", "android.database.Cursor", "android.database.sqlite.SQLiteDatabase", "com.todoroo.andlib.service.ContextManager", "com.todoroo.astrid.data.Metadata", "com.todoroo.astrid.tags.TaskToTagMetadata" ]
import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import com.todoroo.andlib.service.ContextManager; import com.todoroo.astrid.data.Metadata; import com.todoroo.astrid.tags.TaskToTagMetadata;
import android.content.*; import android.database.*; import android.database.sqlite.*; import com.todoroo.andlib.service.*; import com.todoroo.astrid.data.*; import com.todoroo.astrid.tags.*;
[ "android.content", "android.database", "com.todoroo.andlib", "com.todoroo.astrid" ]
android.content; android.database; com.todoroo.andlib; com.todoroo.astrid;
1,898,435
public void registerScaleCallBack(String callBackName, Runnable callBack) { Objects.requireNonNull(callBackName, "callBackName cannot be null"); Objects.requireNonNull(callBack, "callBack cannot be null"); if (callBacks.containsKey(callBackName)) { throw new IllegalArgumentException("The callBackNa...
void function(String callBackName, Runnable callBack) { Objects.requireNonNull(callBackName, STR); Objects.requireNonNull(callBack, STR); if (callBacks.containsKey(callBackName)) { throw new IllegalArgumentException(STR + callBackName + STR); } else { callBacks.put(callBackName, callBack); } }
/** * Register callback and deduplicate it if any. * @param callBackName the name of callback. It should be identical. * @param callBack the callback passed in from upper layer, such as Hive. */
Register callback and deduplicate it if any
registerScaleCallBack
{ "repo_name": "laurentgo/parquet-mr", "path": "parquet-hadoop/src/main/java/org/apache/parquet/hadoop/MemoryManager.java", "license": "apache-2.0", "size": 7027 }
[ "java.util.Objects" ]
import java.util.Objects;
import java.util.*;
[ "java.util" ]
java.util;
2,222,355
public Map<WellBigInteger, BigDecimal> set(WellSetBigInteger set, double p, MathContext mc) { Preconditions.checkNotNull(set, "The set cannot be null."); Map<WellBigInteger, BigDecimal> result = new TreeMap<WellBigInteger, BigDecimal>(); for (WellBigInteger well : set) { ...
Map<WellBigInteger, BigDecimal> function(WellSetBigInteger set, double p, MathContext mc) { Preconditions.checkNotNull(set, STR); Map<WellBigInteger, BigDecimal> result = new TreeMap<WellBigInteger, BigDecimal>(); for (WellBigInteger well : set) { WellBigInteger clone = new WellBigInteger(well); result.put(clone, well(...
/** * Returns the statistic for each well in the well set. * @param WellSetBigInteger the well set * @param double the double value * @param MathContext the math context * @return map of wells and results */
Returns the statistic for each well in the well set
set
{ "repo_name": "jessemull/MicroFlex", "path": "src/main/java/com/github/jessemull/microflex/bigintegerflex/stat/QuantileStatisticBigIntegerRationalContext.java", "license": "apache-2.0", "size": 24861 }
[ "com.github.jessemull.microflex.bigintegerflex.plate.WellBigInteger", "com.github.jessemull.microflex.bigintegerflex.plate.WellSetBigInteger", "com.google.common.base.Preconditions", "java.math.BigDecimal", "java.math.MathContext", "java.util.Map", "java.util.TreeMap" ]
import com.github.jessemull.microflex.bigintegerflex.plate.WellBigInteger; import com.github.jessemull.microflex.bigintegerflex.plate.WellSetBigInteger; import com.google.common.base.Preconditions; import java.math.BigDecimal; import java.math.MathContext; import java.util.Map; import java.util.TreeMap;
import com.github.jessemull.microflex.bigintegerflex.plate.*; import com.google.common.base.*; import java.math.*; import java.util.*;
[ "com.github.jessemull", "com.google.common", "java.math", "java.util" ]
com.github.jessemull; com.google.common; java.math; java.util;
401,450
@Deprecated public synchronized ZooKeeperWatcher getZooKeeperWatcher() throws ZooKeeperConnectionException { if(zooKeeper == null) { try { if (this.closed) { throw new IOException(toString() + " closed"); }//创建zookeeper watcher (实例化zookeeper connection和watch...
synchronized ZooKeeperWatcher function() throws ZooKeeperConnectionException { if(zooKeeper == null) { try { if (this.closed) { throw new IOException(toString() + STR); } this.zooKeeper = new ZooKeeperWatcher(conf, STR, this); } catch(ZooKeeperConnectionException zce) { throw zce; } catch (IOException e) { throw new Zo...
/** * Get the ZooKeeper instance for this TableServers instance. * * If ZK has not been initialized yet, this will connect to ZK. * @returns zookeeper reference * @throws ZooKeeperConnectionException if there's a problem connecting to zk */
Get the ZooKeeper instance for this TableServers instance. If ZK has not been initialized yet, this will connect to ZK
getZooKeeperWatcher
{ "repo_name": "JichengSong/hbase", "path": "src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java", "license": "apache-2.0", "size": 79603 }
[ "java.io.IOException", "org.apache.hadoop.hbase.ZooKeeperConnectionException", "org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher" ]
import java.io.IOException; import org.apache.hadoop.hbase.ZooKeeperConnectionException; import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
import java.io.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.zookeeper.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
1,214,336
public void load(File file) throws IOException, PropertiesException { load(file, DEFAULT_SEPARATOR); }
void function(File file) throws IOException, PropertiesException { load(file, DEFAULT_SEPARATOR); }
/** * Loads the properties from an input file. * * @param file * the input file. * @throws IOException * @throws PropertiesException */
Loads the properties from an input file
load
{ "repo_name": "dihedron/dihedron-commons", "path": "src/main/java/org/dihedron/core/properties/Properties.java", "license": "lgpl-3.0", "size": 8206 }
[ "java.io.File", "java.io.IOException" ]
import java.io.File; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,771,325
@Test() public void testGetLDAPStatisticsMonitorEntries() throws Exception { if (! isDirectoryInstanceAvailable()) { return; } LDAPConnection conn = getAdminConnection(); List<LDAPStatisticsMonitorEntry> monitorEntries = MonitorManager.getLDAPStatisticsMonitorEntries(...
@Test() void function() throws Exception { if (! isDirectoryInstanceAvailable()) { return; } LDAPConnection conn = getAdminConnection(); List<LDAPStatisticsMonitorEntry> monitorEntries = MonitorManager.getLDAPStatisticsMonitorEntries(conn); assertNotNull(monitorEntries); assertFalse(monitorEntries.isEmpty()); for (LDAP...
/** * Tests the {@code getLDAPStatisticsMonitorEntries} method. * <BR><BR> * Access to a Directory Server instance is required for complete processing. * * @throws Exception If an unexpected problem occurs. */
Tests the getLDAPStatisticsMonitorEntries method. Access to a Directory Server instance is required for complete processing
testGetLDAPStatisticsMonitorEntries
{ "repo_name": "UnboundID/ldapsdk", "path": "tests/unit/src/com/unboundid/ldap/sdk/unboundidds/monitors/MonitorManagerTestCase.java", "license": "gpl-2.0", "size": 39343 }
[ "com.unboundid.ldap.sdk.LDAPConnection", "java.util.List", "org.testng.annotations.Test" ]
import com.unboundid.ldap.sdk.LDAPConnection; import java.util.List; import org.testng.annotations.Test;
import com.unboundid.ldap.sdk.*; import java.util.*; import org.testng.annotations.*;
[ "com.unboundid.ldap", "java.util", "org.testng.annotations" ]
com.unboundid.ldap; java.util; org.testng.annotations;
2,829,059
public static void initNBT(ItemStack stack) { if(!detectNBT(stack)) injectNBT(stack, new NBTTagCompound()); }
static void function(ItemStack stack) { if(!detectNBT(stack)) injectNBT(stack, new NBTTagCompound()); }
/** Tries to initialize an NBT Tag Compound in an ItemStack, * this will not do anything if the stack already has a tag * compound **/
Tries to initialize an NBT Tag Compound in an ItemStack, this will not do anything if the stack already has a tag
initNBT
{ "repo_name": "tayjay/Augments", "path": "src/main/java/com/tayjay/augments/util/ItemNBTHelper.java", "license": "gpl-3.0", "size": 5382 }
[ "net.minecraft.item.ItemStack", "net.minecraft.nbt.NBTTagCompound" ]
import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.item.*; import net.minecraft.nbt.*;
[ "net.minecraft.item", "net.minecraft.nbt" ]
net.minecraft.item; net.minecraft.nbt;
2,705,811
public static ims.nursing.assessmenttools.domain.objects.MiniNutritionalAssessmentDetails extractMiniNutritionalAssessmentDetails(ims.domain.ILightweightDomainFactory domainFactory, ims.nursing.vo.MiniNutritionalAssessmentDetails valueObject) { return extractMiniNutritionalAssessmentDetails(domainFactory, val...
static ims.nursing.assessmenttools.domain.objects.MiniNutritionalAssessmentDetails function(ims.domain.ILightweightDomainFactory domainFactory, ims.nursing.vo.MiniNutritionalAssessmentDetails valueObject) { return extractMiniNutritionalAssessmentDetails(domainFactory, valueObject, new HashMap()); }
/** * Create the domain object from the value object. * @param domainFactory - used to create existing (persistent) domain objects. * @param valueObject - extract the domain object fields from this. */
Create the domain object from the value object
extractMiniNutritionalAssessmentDetails
{ "repo_name": "FreudianNM/openMAXIMS", "path": "Source Library/openmaxims_workspace/ValueObjects/src/ims/nursing/vo/domain/MiniNutritionalAssessmentDetailsAssembler.java", "license": "agpl-3.0", "size": 18336 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
2,201,941
@Factory public static <T> Matcher<Annotation> hasParamValue(String param, Matcher<T> matcher) { return new AnnotationParamMatcher<T>(param, matcher); }
static <T> Matcher<Annotation> function(String param, Matcher<T> matcher) { return new AnnotationParamMatcher<T>(param, matcher); }
/** * Creates a matcher of {@link Annotation} that matches any object containing * the named <code>param</code> with a value is matched by the corresponding * matcher from the specified <code>matcher</code>. * <p> * For example: * <pre>assertThat(myAnnotation, hasParamValue("value", end...
Creates a matcher of <code>Annotation</code> that matches any object containing the named <code>param</code> with a value is matched by the corresponding matcher from the specified <code>matcher</code>. For example: <code>assertThat(myAnnotation, hasParamValue("value", endsWith("b))(</code>
hasParamValue
{ "repo_name": "zaradai/matchers", "path": "src/main/java/com/zaradai/matchers/AnnotationParamMatcher.java", "license": "apache-2.0", "size": 4683 }
[ "java.lang.annotation.Annotation", "org.hamcrest.Matcher" ]
import java.lang.annotation.Annotation; import org.hamcrest.Matcher;
import java.lang.annotation.*; import org.hamcrest.*;
[ "java.lang", "org.hamcrest" ]
java.lang; org.hamcrest;
1,056,932
public List<AbstractProcess> getDataSourceDescriptionHistory(double startTime, double endTime);
List<AbstractProcess> function(double startTime, double endTime);
/** * Retrieves history of data source description for the given time period * @param startTime lower bound of the time period * @param endTime upper bound of the time period * @return list of SensorML process descriptions (with disjoint time validity periods) */
Retrieves history of data source description for the given time period
getDataSourceDescriptionHistory
{ "repo_name": "Shimejing/sensorhub", "path": "sensorhub-core/src/main/java/org/sensorhub/api/persistence/IBasicStorage.java", "license": "mpl-2.0", "size": 7241 }
[ "java.util.List", "net.opengis.sensorml.v20.AbstractProcess" ]
import java.util.List; import net.opengis.sensorml.v20.AbstractProcess;
import java.util.*; import net.opengis.sensorml.v20.*;
[ "java.util", "net.opengis.sensorml" ]
java.util; net.opengis.sensorml;
174,283
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.select_album); albumButtons = findViewById(R.id.menu_album); refreshAlbumListView = findViewById(R.id.select_album_entries_refresh); albumListView = findViewById(R.id.select_album_ent...
void function(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.select_album); albumButtons = findViewById(R.id.menu_album); refreshAlbumListView = findViewById(R.id.select_album_entries_refresh); albumListView = findViewById(R.id.select_album_entries_list);
/** * Called when the activity is first created. */
Called when the activity is first created
onCreate
{ "repo_name": "Tapchicoma/ultrasonic", "path": "ultrasonic/src/main/java/org/moire/ultrasonic/activity/BookmarkActivity.java", "license": "gpl-3.0", "size": 12834 }
[ "android.os.Bundle" ]
import android.os.Bundle;
import android.os.*;
[ "android.os" ]
android.os;
948,659
public List< PreprocessorTag > getScopeDirectives() { List< PreprocessorTag > tagList = new ArrayList< PreprocessorTag >(); Object input = _preprocessorTableViewer.getInput(); if( input instanceof PreprocessorTag[] ) { PreprocessorTag[] tags = (PreprocessorTag[]) input; ...
List< PreprocessorTag > function() { List< PreprocessorTag > tagList = new ArrayList< PreprocessorTag >(); Object input = _preprocessorTableViewer.getInput(); if( input instanceof PreprocessorTag[] ) { PreprocessorTag[] tags = (PreprocessorTag[]) input; for( int i = 0; i < tags.length; i++ ) { if( tags[ i ].getScopeID(...
/** * Gets the preprocess directives of the scope of this UI. * * @return */
Gets the preprocess directives of the scope of this UI
getScopeDirectives
{ "repo_name": "blackberry/Eclipse-JDE", "path": "net.rim.ejde/src/net/rim/ejde/internal/ui/preferences/PreprocessDirectiveUI.java", "license": "epl-1.0", "size": 27646 }
[ "java.util.ArrayList", "java.util.List", "net.rim.ejde.internal.model.BasicBlackBerryProperties" ]
import java.util.ArrayList; import java.util.List; import net.rim.ejde.internal.model.BasicBlackBerryProperties;
import java.util.*; import net.rim.ejde.internal.model.*;
[ "java.util", "net.rim.ejde" ]
java.util; net.rim.ejde;
59,656
public static List<Object> invokeMethods (final Object target, final List<Method> methods) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { final List<Object> results = new ArrayList<>(methods.size()); for (final Method method : methods) { results.add(method.invoke(ta...
static List<Object> function (final Object target, final List<Method> methods) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { final List<Object> results = new ArrayList<>(methods.size()); for (final Method method : methods) { results.add(method.invoke(target, (Object[]) null)); } r...
/** * Invoke the following list of methods (with no parameter) and return the result in a * {@link List}. * @param target * the target object. * @param methods * the methods to invoke. * @return the result of the method call. * @throws InvocationTargetException * if one of the un...
Invoke the following list of methods (with no parameter) and return the result in a <code>List</code>
invokeMethods
{ "repo_name": "AlexRNL/Commons", "path": "src/main/java/com/alexrnl/commons/utils/object/ReflectUtils.java", "license": "bsd-3-clause", "size": 5902 }
[ "java.lang.reflect.InvocationTargetException", "java.lang.reflect.Method", "java.util.ArrayList", "java.util.List" ]
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List;
import java.lang.reflect.*; import java.util.*;
[ "java.lang", "java.util" ]
java.lang; java.util;
2,890,199
List<IoTSecurityDeviceAlert> mostPrevalentDeviceAlerts();
List<IoTSecurityDeviceAlert> mostPrevalentDeviceAlerts();
/** * Gets the mostPrevalentDeviceAlerts property: List of the 3 most prevalent device alerts. * * @return the mostPrevalentDeviceAlerts value. */
Gets the mostPrevalentDeviceAlerts property: List of the 3 most prevalent device alerts
mostPrevalentDeviceAlerts
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecuritySolutionAnalyticsModel.java", "license": "mit", "size": 2466 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,663,777
public String toString() { StringBuilder format = new StringBuilder (PIPE).append(REG) .append(PIPE).append(TextUtil.timeToString(DT_INV, "ddMMyyyy")) .append(PIPE).append(TextUtil.checkSize(TextUtil.toNumeric(VL_INV), 255)) .append(PIPE).append(MOT_INV) .appe...
String function() { StringBuilder format = new StringBuilder (PIPE).append(REG) .append(PIPE).append(TextUtil.timeToString(DT_INV, STR)) .append(PIPE).append(TextUtil.checkSize(TextUtil.toNumeric(VL_INV), 255)) .append(PIPE).append(MOT_INV) .append(PIPE).append(EOL); return format.toString(); }
/** * Formata o Bloco H Registro 005 * * @return */
Formata o Bloco H Registro 005
toString
{ "repo_name": "mgrigioni/oseb", "path": "sped/src/org/adempierelbr/sped/efd/beans/RH005.java", "license": "gpl-2.0", "size": 2092 }
[ "org.adempierelbr.util.TextUtil" ]
import org.adempierelbr.util.TextUtil;
import org.adempierelbr.util.*;
[ "org.adempierelbr.util" ]
org.adempierelbr.util;
2,173,691
public SVGDocument parseSvg(String filedescr){ Document doc; try { String parser = XMLResourceDescriptor.getXMLParserClassName(); SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser); File file = new File(filedescr); if (file.exists(...
SVGDocument function(String filedescr){ Document doc; try { String parser = XMLResourceDescriptor.getXMLParserClassName(); SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser); File file = new File(filedescr); if (file.exists()){ URI localFileAsUri = file.toURI(); String uri = localFileAsUri.toASCIIString(); doc...
/** * Uses the batik parser to genererate an svg document from an svg file. * To create the components in that svg document, call <code>getCreatedSvgComponents(SVGDocument doc)</code> * * @param filedescr the filedescr * * @return the SVG document */
Uses the batik parser to genererate an svg document from an svg file. To create the components in that svg document, call <code>getCreatedSvgComponents(SVGDocument doc)</code>
parseSvg
{ "repo_name": "Max90/MT4j_Breakout", "path": "src/org/mt4j/util/xml/svg/SVGLoader.java", "license": "gpl-2.0", "size": 104155 }
[ "java.io.File", "java.io.InputStream", "org.apache.batik.bridge.BridgeContext", "org.apache.batik.bridge.DocumentLoader", "org.apache.batik.bridge.GVTBuilder", "org.apache.batik.bridge.UserAgentAdapter", "org.apache.batik.dom.svg.SAXSVGDocumentFactory", "org.apache.batik.util.XMLResourceDescriptor", ...
import java.io.File; import java.io.InputStream; import org.apache.batik.bridge.BridgeContext; import org.apache.batik.bridge.DocumentLoader; import org.apache.batik.bridge.GVTBuilder; import org.apache.batik.bridge.UserAgentAdapter; import org.apache.batik.dom.svg.SAXSVGDocumentFactory; import org.apache.batik.util.XM...
import java.io.*; import org.apache.batik.bridge.*; import org.apache.batik.dom.svg.*; import org.apache.batik.util.*; import org.w3c.dom.*; import org.w3c.dom.svg.*;
[ "java.io", "org.apache.batik", "org.w3c.dom" ]
java.io; org.apache.batik; org.w3c.dom;
873,274
public PlatformTargetProxy projection() throws IgniteCheckedException;
PlatformTargetProxy function() throws IgniteCheckedException;
/** * Get projection. * * @return Projection. * @throws IgniteCheckedException If failed. */
Get projection
projection
{ "repo_name": "pperalta/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformProcessor.java", "license": "apache-2.0", "size": 8308 }
[ "org.apache.ignite.IgniteCheckedException" ]
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.*;
[ "org.apache.ignite" ]
org.apache.ignite;
2,124,629
void addEffects(Iterable<FireworkEffect> effects) throws IllegalArgumentException;
void addEffects(Iterable<FireworkEffect> effects) throws IllegalArgumentException;
/** * Add several firework effects to this firework. * * @param effects An iterable object whose iterator yields the desired firework effects * @throws IllegalArgumentException If effects is null * @throws IllegalArgumentException If any effect is null (may be thrown after changes have occurred...
Add several firework effects to this firework
addEffects
{ "repo_name": "XKnucklesX/Offit", "path": "src/org/Offit/inventory/meta/FireworkMeta.java", "license": "gpl-2.0", "size": 2612 }
[ "org.bukkit.FireworkEffect" ]
import org.bukkit.FireworkEffect;
import org.bukkit.*;
[ "org.bukkit" ]
org.bukkit;
2,654,809
@RequestMapping(value = "/rent/{userId}", method = RequestMethod.GET) public List<Rent> getRentByUserIdOrderFalse(@PathVariable("userId") String userId){ return rentService.getRentByUserIdOrderFalse(userId); }
@RequestMapping(value = STR, method = RequestMethod.GET) List<Rent> function(@PathVariable(STR) String userId){ return rentService.getRentByUserIdOrderFalse(userId); }
/** * Method viewing rents by userId */
Method viewing rents by userId
getRentByUserIdOrderFalse
{ "repo_name": "MarcinU2K/media-rental-microservices", "path": "rent-service/src/main/java/com/rental/rent/controller/RentController.java", "license": "apache-2.0", "size": 1724 }
[ "com.rental.rent.domain.Rent", "java.util.List", "org.springframework.web.bind.annotation.PathVariable", "org.springframework.web.bind.annotation.RequestMapping", "org.springframework.web.bind.annotation.RequestMethod" ]
import com.rental.rent.domain.Rent; import java.util.List; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod;
import com.rental.rent.domain.*; import java.util.*; import org.springframework.web.bind.annotation.*;
[ "com.rental.rent", "java.util", "org.springframework.web" ]
com.rental.rent; java.util; org.springframework.web;
1,890,306
public static Map<String, Set<Path>> findYamlSuites(FileSystem fileSystem, String optionalPathPrefix, final String... paths) throws IOException { Map<String, Set<Path>> yamlSuites = new HashMap<>(); for (String path : paths) { collectFiles(resolveFile(fileSystem, optionalPath...
static Map<String, Set<Path>> function(FileSystem fileSystem, String optionalPathPrefix, final String... paths) throws IOException { Map<String, Set<Path>> yamlSuites = new HashMap<>(); for (String path : paths) { collectFiles(resolveFile(fileSystem, optionalPathPrefix, path, YAML_SUFFIX), YAML_SUFFIX, yamlSuites); } r...
/** * Returns the yaml files found within the paths provided. * Each input path can either be a single file (the .yaml suffix is optional) or a directory. * Each path is looked up in the classpath, or optionally from {@code fileSystem} if its not null. */
Returns the yaml files found within the paths provided. Each input path can either be a single file (the .yaml suffix is optional) or a directory. Each path is looked up in the classpath, or optionally from fileSystem if its not null
findYamlSuites
{ "repo_name": "spiegela/elasticsearch", "path": "test/framework/src/main/java/org/elasticsearch/test/rest/yaml/FileUtils.java", "license": "apache-2.0", "size": 6887 }
[ "java.io.IOException", "java.nio.file.FileSystem", "java.nio.file.Path", "java.util.HashMap", "java.util.Map", "java.util.Set" ]
import java.io.IOException; import java.nio.file.FileSystem; import java.nio.file.Path; import java.util.HashMap; import java.util.Map; import java.util.Set;
import java.io.*; import java.nio.file.*; import java.util.*;
[ "java.io", "java.nio", "java.util" ]
java.io; java.nio; java.util;
222,562
@Override protected boolean updateSelection(IStructuredSelection selection) { if (!super.updateSelection(selection)) { return false; } if (getSelectedNonResources().size() > 0) { return false; } List<? extends IResource> selectedResources = getSe...
boolean function(IStructuredSelection selection) { if (!super.updateSelection(selection)) { return false; } if (getSelectedNonResources().size() > 0) { return false; } List<? extends IResource> selectedResources = getSelectedResources(); if (selectedResources.size() == 0) { return false; } boolean projSelected = select...
/** * The <code>CopyAction</code> implementation of this * <code>SelectionListenerAction</code> method enables this action if * one or more resources of compatible types are selected. */
The <code>CopyAction</code> implementation of this <code>SelectionListenerAction</code> method enables this action if one or more resources of compatible types are selected
updateSelection
{ "repo_name": "bobwalker99/Pydev", "path": "plugins/org.python.pydev/src_navigator/org/python/pydev/navigator/actions/copied/CopyAction.java", "license": "epl-1.0", "size": 7458 }
[ "java.util.Iterator", "java.util.List", "org.eclipse.core.resources.IContainer", "org.eclipse.core.resources.IResource", "org.eclipse.jface.viewers.IStructuredSelection" ]
import java.util.Iterator; import java.util.List; import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IResource; import org.eclipse.jface.viewers.IStructuredSelection;
import java.util.*; import org.eclipse.core.resources.*; import org.eclipse.jface.viewers.*;
[ "java.util", "org.eclipse.core", "org.eclipse.jface" ]
java.util; org.eclipse.core; org.eclipse.jface;
1,527,790
public Set<EventBean> lookup(EventBean theEvent, Cursor cursor, ExprEvaluatorContext exprEvaluatorContext);
Set<EventBean> function(EventBean theEvent, Cursor cursor, ExprEvaluatorContext exprEvaluatorContext);
/** * Returns matched events for a event to look up for. Never returns an empty result set, * always returns null to indicate no results. * @param theEvent to look up * @param cursor the path in the query that the lookup took * @param exprEvaluatorContext expression evaluation context ...
Returns matched events for a event to look up for. Never returns an empty result set, always returns null to indicate no results
lookup
{ "repo_name": "mobile-event-processing/Asper", "path": "source/src/com/espertech/esper/epl/join/exec/base/JoinExecTableLookupStrategy.java", "license": "gpl-2.0", "size": 1679 }
[ "com.espertech.esper.client.EventBean", "com.espertech.esper.epl.expression.ExprEvaluatorContext", "com.espertech.esper.epl.join.rep.Cursor", "java.util.Set" ]
import com.espertech.esper.client.EventBean; import com.espertech.esper.epl.expression.ExprEvaluatorContext; import com.espertech.esper.epl.join.rep.Cursor; import java.util.Set;
import com.espertech.esper.client.*; import com.espertech.esper.epl.expression.*; import com.espertech.esper.epl.join.rep.*; import java.util.*;
[ "com.espertech.esper", "java.util" ]
com.espertech.esper; java.util;
1,521,472
private List<EliminationTarget> findTargetContinents(GameState gameState, Map<Country, AttackTarget> targets, boolean attack, boolean filterNoAttacks) { Continent[] c = game.getContinents(); int targetContinents = Math.max(1, c.length - gameState.orderedPlayers.size()); //step 1 examine continents List<D...
List<EliminationTarget> function(GameState gameState, Map<Country, AttackTarget> targets, boolean attack, boolean filterNoAttacks) { Continent[] c = game.getContinents(); int targetContinents = Math.max(1, c.length - gameState.orderedPlayers.size()); List<Double> vals = new ArrayList<Double>(); List<EliminationTarget> ...
/** * Find the continents that we're interested in competing for. * This is based upon how much we control the continent and weighted for its value. */
Find the continents that we're interested in competing for. This is based upon how much we control the continent and weighted for its value
findTargetContinents
{ "repo_name": "hernol/ConuWar", "path": "Game/src/net/yura/domination/engine/ai/logic/AIDomination.java", "license": "gpl-3.0", "size": 90745 }
[ "java.util.ArrayList", "java.util.Collections", "java.util.HashSet", "java.util.List", "java.util.Map", "net.yura.domination.engine.core.Continent", "net.yura.domination.engine.core.Country" ]
import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Map; import net.yura.domination.engine.core.Continent; import net.yura.domination.engine.core.Country;
import java.util.*; import net.yura.domination.engine.core.*;
[ "java.util", "net.yura.domination" ]
java.util; net.yura.domination;
1,358,311
if (geomStr.length() == 0) { throw new IllegalArgumentException("0-length geometry string"); } char c = geomStr.charAt(0); if (c == '[' || c == '{') { return parseRectangeSolrException(geomStr, ctx); } //TODO parse a raw point? try { return ctx.readShapeFromWkt(geomStr); } ...
if (geomStr.length() == 0) { throw new IllegalArgumentException(STR); } char c = geomStr.charAt(0); if (c == '[' c == '{') { return parseRectangeSolrException(geomStr, ctx); } try { return ctx.readShapeFromWkt(geomStr); } catch (ParseException e) { throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, STR + e, e...
/** * Parses a 'geom' parameter (might also be used to parse shapes for indexing). {@code geomStr} can either be WKT or * a rectangle-range syntax (see {@link #parseRectangle(String, com.spatial4j.core.context.SpatialContext)}. */
Parses a 'geom' parameter (might also be used to parse shapes for indexing). geomStr can either be WKT or a rectangle-range syntax (see <code>#parseRectangle(String, com.spatial4j.core.context.SpatialContext)</code>
parseGeomSolrException
{ "repo_name": "q474818917/solr-5.2.0", "path": "solr/core/src/java/org/apache/solr/util/SpatialUtils.java", "license": "apache-2.0", "size": 7039 }
[ "java.text.ParseException", "org.apache.solr.common.SolrException" ]
import java.text.ParseException; import org.apache.solr.common.SolrException;
import java.text.*; import org.apache.solr.common.*;
[ "java.text", "org.apache.solr" ]
java.text; org.apache.solr;
750,186
private Time getTimeFromState(SessionState state, String monthString, String dayString, String yearString, String hourString, String minString) { if (state.getAttribute(monthString) != null || state.getAttribute(dayString) != null || state.getAttribute(yearString) != null || state.getAttribute(hourString...
Time function(SessionState state, String monthString, String dayString, String yearString, String hourString, String minString) { if (state.getAttribute(monthString) != null state.getAttribute(dayString) != null state.getAttribute(yearString) != null state.getAttribute(hourString) != null state.getAttribute(minString) ...
/** * construct time object based on various state variables * @param state * @param monthString * @param dayString * @param yearString * @param hourString * @param minString * @return */
construct time object based on various state variables
getTimeFromState
{ "repo_name": "udayg/sakai", "path": "assignment/assignment-tool/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java", "license": "apache-2.0", "size": 672322 }
[ "org.sakaiproject.event.api.SessionState", "org.sakaiproject.time.api.Time", "org.sakaiproject.time.cover.TimeService" ]
import org.sakaiproject.event.api.SessionState; import org.sakaiproject.time.api.Time; import org.sakaiproject.time.cover.TimeService;
import org.sakaiproject.event.api.*; import org.sakaiproject.time.api.*; import org.sakaiproject.time.cover.*;
[ "org.sakaiproject.event", "org.sakaiproject.time" ]
org.sakaiproject.event; org.sakaiproject.time;
1,838,674
public PositionalCondition createPositionalCondition(int position, boolean typeNode, boolean type) throws CSSException { throw new CSSException("Not implemented in CSS2"); }
PositionalCondition function(int position, boolean typeNode, boolean type) throws CSSException { throw new CSSException(STR); }
/** * <b>SAC</b>: Implements {@link * ConditionFactory#createPositionalCondition(int,boolean,boolean)}. */
SAC: Implements <code>ConditionFactory#createPositionalCondition(int,boolean,boolean)</code>
createPositionalCondition
{ "repo_name": "bdaum/zoraPD", "path": "com.bdaum.zoom.css/src/org/akrogen/tkui/css/core/impl/sac/CSSConditionFactoryImpl.java", "license": "gpl-2.0", "size": 5806 }
[ "org.w3c.css.sac.CSSException", "org.w3c.css.sac.PositionalCondition" ]
import org.w3c.css.sac.CSSException; import org.w3c.css.sac.PositionalCondition;
import org.w3c.css.sac.*;
[ "org.w3c.css" ]
org.w3c.css;
2,657,352
public void addTransformer(ClassFileTransformer transformer) { Assert.notNull(transformer, "Transformer must not be null"); this.classFileTransformers.add(transformer); }
void function(ClassFileTransformer transformer) { Assert.notNull(transformer, STR); this.classFileTransformers.add(transformer); }
/** * Add the given ClassFileTransformer to the list of transformers that this * ClassLoader will apply. * @param transformer the ClassFileTransformer */
Add the given ClassFileTransformer to the list of transformers that this ClassLoader will apply
addTransformer
{ "repo_name": "spring-projects/spring-framework", "path": "spring-context/src/main/java/org/springframework/instrument/classloading/ShadowingClassLoader.java", "license": "apache-2.0", "size": 6689 }
[ "java.lang.instrument.ClassFileTransformer", "org.springframework.util.Assert" ]
import java.lang.instrument.ClassFileTransformer; import org.springframework.util.Assert;
import java.lang.instrument.*; import org.springframework.util.*;
[ "java.lang", "org.springframework.util" ]
java.lang; org.springframework.util;
1,432,551
public DataTypeDescriptor getType() { return columnType; }
DataTypeDescriptor function() { return columnType; }
/** * Get the TypeDescriptor of the column's datatype. * * @return The TypeDescriptor of the column's datatype. */
Get the TypeDescriptor of the column's datatype
getType
{ "repo_name": "kavin256/Derby", "path": "java/engine/org/apache/derby/iapi/sql/dictionary/ColumnDescriptor.java", "license": "apache-2.0", "size": 14052 }
[ "org.apache.derby.iapi.types.DataTypeDescriptor" ]
import org.apache.derby.iapi.types.DataTypeDescriptor;
import org.apache.derby.iapi.types.*;
[ "org.apache.derby" ]
org.apache.derby;
2,475,821
private void configLog4J() { final Properties p = new Properties(); p.put("log4j.appender.Remote", "org.apache.log4j.net.SocketAppender"); // NOI18N p.put("log4j.appender.Remote.remoteHost", "localhost"); // NOI18N p.put("log4j.appender.Remote.port", "4445"); ...
void function() { final Properties p = new Properties(); p.put(STR, STR); p.put(STR, STR); p.put(STR, "4445"); p.put(STR, "true"); if (cbxDebug.isSelected()) { p.put(STR, STR); } else if (cbxError.isSelected()) { p.put(STR, STR); } else { p.put(STR, STR); p.put(STR, STR); } org.apache.log4j.PropertyConfigurator.configu...
/** * DOCUMENT ME! */
DOCUMENT ME
configLog4J
{ "repo_name": "cismet/cismet-gui-commons", "path": "src/main/java/de/cismet/tools/gui/NewJFrame.java", "license": "lgpl-3.0", "size": 8173 }
[ "java.util.Properties" ]
import java.util.Properties;
import java.util.*;
[ "java.util" ]
java.util;
1,200,091
public String signToken(String domain, long expiry) throws TokenException { try { return DatatypeConverter.printHexBinary(generateToken(domain, expiry)); } catch (InvalidKeyException | NoSuchAlgorithmException e) { throw new TokenException(); } }
String function(String domain, long expiry) throws TokenException { try { return DatatypeConverter.printHexBinary(generateToken(domain, expiry)); } catch (InvalidKeyException NoSuchAlgorithmException e) { throw new TokenException(); } }
/** * Generates a new token from a given username.. be careful.. * * @param domain the token should be signed with. * @param expiry indicates when the token expires. * @return a signed token as a base64 string. */
Generates a new token from a given username.. be careful.
signToken
{ "repo_name": "chilimannen/evote-admin-panel", "path": "src/main/java/Model/TokenFactory.java", "license": "mit", "size": 2851 }
[ "java.security.InvalidKeyException", "java.security.NoSuchAlgorithmException", "javax.xml.bind.DatatypeConverter" ]
import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import javax.xml.bind.DatatypeConverter;
import java.security.*; import javax.xml.bind.*;
[ "java.security", "javax.xml" ]
java.security; javax.xml;
625,897
public void println(char c) throws IOException { print(c); println(); }
void function(char c) throws IOException { print(c); println(); }
/** * Writes a character to the client, followed by a carriage return-line feed * (CRLF). * * @param c * the character to write to the client * @exception IOException * if an input or output exception occurred */
Writes a character to the client, followed by a carriage return-line feed (CRLF)
println
{ "repo_name": "WhiteBearSolutions/WBSAirback", "path": "packages/wbsairback-tomcat/wbsairback-tomcat-7.0.22/java/javax/servlet/ServletOutputStream.java", "license": "apache-2.0", "size": 8682 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,197,247
@ServiceMethod(returns = ReturnType.SINGLE) JitNetworkAccessPolicyInner createOrUpdate( String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName, JitNetworkAccessPolicyInner body);
@ServiceMethod(returns = ReturnType.SINGLE) JitNetworkAccessPolicyInner createOrUpdate( String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName, JitNetworkAccessPolicyInner body);
/** * Create a policy for protecting resources using Just-in-Time access control. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can ...
Create a policy for protecting resources using Just-in-Time access control
createOrUpdate
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/JitNetworkAccessPoliciesClient.java", "license": "mit", "size": 15517 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.security.fluent.models.JitNetworkAccessPolicyInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessPolicyInner;
import com.azure.core.annotation.*; import com.azure.resourcemanager.security.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
987,389
public static void addLink(final Configuration conf, final String src, final URI target) { addLink(conf, getDefaultMountTableName(conf), src, target); }
static void function(final Configuration conf, final String src, final URI target) { addLink(conf, getDefaultMountTableName(conf), src, target); }
/** * Add a link to the config for the default mount table * @param conf - add the link to this conf * @param src - the src path name * @param target - the target URI link */
Add a link to the config for the default mount table
addLink
{ "repo_name": "apurtell/hadoop", "path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ConfigUtil.java", "license": "apache-2.0", "size": 8792 }
[ "org.apache.hadoop.conf.Configuration" ]
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,406,131
public void testInvalidEnum() { String example = "PudCAsT"; try { MediaType temp = MediaType.valueForString(example); assertNull("Result of valueForString should be null.", temp); } catch (IllegalArgumentException exception) { fail("Invalid enum throws Ill...
void function() { String example = STR; try { MediaType temp = MediaType.valueForString(example); assertNull(STR, temp); } catch (IllegalArgumentException exception) { fail(STR); } }
/** * Verifies that an invalid assignment is null. */
Verifies that an invalid assignment is null
testInvalidEnum
{ "repo_name": "smartdevicelink/sdl_android", "path": "android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MediaTypeTests.java", "license": "bsd-3-clause", "size": 2607 }
[ "com.smartdevicelink.proxy.rpc.enums.MediaType" ]
import com.smartdevicelink.proxy.rpc.enums.MediaType;
import com.smartdevicelink.proxy.rpc.enums.*;
[ "com.smartdevicelink.proxy" ]
com.smartdevicelink.proxy;
2,562,527
public String postRequest(int max, int numDice, String subjectMessage, String gameID, String gameUUID) throws IOException;
String function(int max, int numDice, String subjectMessage, String gameID, String gameUUID) throws IOException;
/** * Post a request to the dice server, and return the resulting html page as a string */
Post a request to the dice server, and return the resulting html page as a string
postRequest
{ "repo_name": "tea-dragon/triplea", "path": "src/main/java/games/strategy/engine/random/IRemoteDiceServer.java", "license": "gpl-2.0", "size": 2014 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,230,855
@Override protected TableCellRenderer createDefaultRenderer() { return new SortableTableHeaderCellRenderer(); }
TableCellRenderer function() { return new SortableTableHeaderCellRenderer(); }
/** * Over-ridden to provide a renderer that will indicate which columns are * currently selected for sorting. */
Over-ridden to provide a renderer that will indicate which columns are currently selected for sorting
createDefaultRenderer
{ "repo_name": "dwdyer/ipdframework", "path": "src/java/main/au/edu/uwa/csse/dyerd01/swing/sortabletable/SortableTableHeader.java", "license": "apache-2.0", "size": 3260 }
[ "javax.swing.table.TableCellRenderer" ]
import javax.swing.table.TableCellRenderer;
import javax.swing.table.*;
[ "javax.swing" ]
javax.swing;
537,445
private static List<String> readRequest(InputStream input) throws IOException { byte[] inputBytes = ByteStreams.toByteArray(input); if (inputBytes.length == 0) { return null; } String s = new String(inputBytes, Charset.defaultCharset()); return ImmutableList.copyOf(NULLTERMINATOR_SPLITTER.sp...
static List<String> function(InputStream input) throws IOException { byte[] inputBytes = ByteStreams.toByteArray(input); if (inputBytes.length == 0) { return null; } String s = new String(inputBytes, Charset.defaultCharset()); return ImmutableList.copyOf(NULLTERMINATOR_SPLITTER.split(s)); }
/** * Read a string in platform default encoding and split it into a list of * NUL-separated words. * * <p>Blaze consistently uses the platform default encoding (defined in * blaze.cc) to interface with Unix APIs. */
Read a string in platform default encoding and split it into a list of NUL-separated words. Blaze consistently uses the platform default encoding (defined in blaze.cc) to interface with Unix APIs
readRequest
{ "repo_name": "rohitsaboo/bazel", "path": "src/main/java/com/google/devtools/build/lib/server/RPCServer.java", "license": "apache-2.0", "size": 21300 }
[ "com.google.common.collect.ImmutableList", "com.google.common.io.ByteStreams", "java.io.IOException", "java.io.InputStream", "java.nio.charset.Charset", "java.util.List" ]
import com.google.common.collect.ImmutableList; import com.google.common.io.ByteStreams; import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; import java.util.List;
import com.google.common.collect.*; import com.google.common.io.*; import java.io.*; import java.nio.charset.*; import java.util.*;
[ "com.google.common", "java.io", "java.nio", "java.util" ]
com.google.common; java.io; java.nio; java.util;
2,208,493
public static Intent getMainActivityIntent(Context context) { return instance.getMainActivityIntent(context); }
static Intent function(Context context) { return instance.getMainActivityIntent(context); }
/** * Gets the main activity intent - the same intent as the one used to launch the app from launcher. * @param context Context * @return Main launch intent */
Gets the main activity intent - the same intent as the one used to launch the app from launcher
getMainActivityIntent
{ "repo_name": "Iterable/iterable-android-sdk", "path": "iterableapi/src/main/java/com/iterable/iterableapi/IterableNotificationHelper.java", "license": "mit", "size": 20433 }
[ "android.content.Context", "android.content.Intent" ]
import android.content.Context; import android.content.Intent;
import android.content.*;
[ "android.content" ]
android.content;
681,929
public Status isExistSomeErrors() { Status result = null; if (this.errorClassesNames.isEmpty()) { result = new Status(Boolean.TRUE); } else { result = new Status(Boolean.FALSE); } return result; }
Status function() { Status result = null; if (this.errorClassesNames.isEmpty()) { result = new Status(Boolean.TRUE); } else { result = new Status(Boolean.FALSE); } return result; }
/** * Get if exist some errors. * * @return The status result. */
Get if exist some errors
isExistSomeErrors
{ "repo_name": "GIP-RECIA/esco-grouper-ui", "path": "metier/esco-web/src/main/java/org/esco/grouperui/web/controllers/utils/AbstractMembershipsController.java", "license": "apache-2.0", "size": 13010 }
[ "org.esco.grouperui.web.beans.Status" ]
import org.esco.grouperui.web.beans.Status;
import org.esco.grouperui.web.beans.*;
[ "org.esco.grouperui" ]
org.esco.grouperui;
370,656
private Bitmap getFromCache(String fileName) { Bitmap bitmap = null; if (this.cache != null) { bitmap = this.cache.get(fileName); } return bitmap; }
Bitmap function(String fileName) { Bitmap bitmap = null; if (this.cache != null) { bitmap = this.cache.get(fileName); } return bitmap; }
/** * Get a {@link android.graphics.Bitmap} from the internal cache or null if it does not exist. * * @param fileName The name of the file to look for in the cache. * @return A valid cached bitmap, otherwise null. */
Get a <code>android.graphics.Bitmap</code> from the internal cache or null if it does not exist
getFromCache
{ "repo_name": "binhbt/cattle-manager-android", "path": "presentation/src/main/java/com/leo/cattle/presentation/view/component/AutoLoadImageView.java", "license": "apache-2.0", "size": 10737 }
[ "android.graphics.Bitmap" ]
import android.graphics.Bitmap;
import android.graphics.*;
[ "android.graphics" ]
android.graphics;
919,786
public static HashCode hash(File file, HashFunction hashFunction) throws IOException { return asByteSource(file).hash(hashFunction); } /** * Fully maps a file read-only in to memory as per * {@link FileChannel#map(java.nio.channels.FileChannel.MapMode, long, long)}. * * <p>Files are mapped ...
static HashCode function(File file, HashFunction hashFunction) throws IOException { return asByteSource(file).hash(hashFunction); } /** * Fully maps a file read-only in to memory as per * {@link FileChannel#map(java.nio.channels.FileChannel.MapMode, long, long)}. * * <p>Files are mapped from offset 0 to its length. * *...
/** * Computes the hash code of the {@code file} using {@code hashFunction}. * * @param file the file to read * @param hashFunction the hash function to use to hash the data * @return the {@link HashCode} of all of the bytes in the file * @throws IOException if an I/O error occurs * @since 12.0 ...
Computes the hash code of the file using hashFunction
hash
{ "repo_name": "wolffcm/voltdb", "path": "third_party/java/src/com/google_voltpatches/common/io/Files.java", "license": "agpl-3.0", "size": 28754 }
[ "com.google_voltpatches.common.hash.HashCode", "com.google_voltpatches.common.hash.HashFunction", "java.io.File", "java.io.IOException", "java.nio.channels.FileChannel" ]
import com.google_voltpatches.common.hash.HashCode; import com.google_voltpatches.common.hash.HashFunction; import java.io.File; import java.io.IOException; import java.nio.channels.FileChannel;
import com.google_voltpatches.common.hash.*; import java.io.*; import java.nio.channels.*;
[ "com.google_voltpatches.common", "java.io", "java.nio" ]
com.google_voltpatches.common; java.io; java.nio;
621,095
public static String executeCommand(final String command, String... args) { if (StringUtils.isNotEmpty(command)) { // create string output for executor ProcessStringOutput processOutput = new ProcessStringOutput(PROCESS_OUTPUT_LEVEL); // create external process Executor executor = createExecutor...
static String function(final String command, String... args) { if (StringUtils.isNotEmpty(command)) { ProcessStringOutput processOutput = new ProcessStringOutput(PROCESS_OUTPUT_LEVEL); Executor executor = createExecutor(processOutput); final CommandLine commandLine = new CommandLine(command); if (ArrayUtils.isNotEmpty(...
/** * Execute given system command with arguments. * * @param command * to execute * @param args * as command arguments * @return command output as String, null otherwise */
Execute given system command with arguments
executeCommand
{ "repo_name": "pawlidim/aletheia", "path": "src/main/java/de/pawlidi/openaletheia/utils/exec/ProcessExecutor.java", "license": "apache-2.0", "size": 3407 }
[ "java.io.IOException", "org.apache.commons.exec.CommandLine", "org.apache.commons.exec.Executor", "org.apache.commons.lang.ArrayUtils", "org.apache.commons.lang.StringUtils" ]
import java.io.IOException; import org.apache.commons.exec.CommandLine; import org.apache.commons.exec.Executor; import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.StringUtils;
import java.io.*; import org.apache.commons.exec.*; import org.apache.commons.lang.*;
[ "java.io", "org.apache.commons" ]
java.io; org.apache.commons;
1,536,196
public LegendItem getLegendItem(int datasetIndex, int series) { CategoryPlot cp = getPlot(); if (cp == null) { return null; } if (isSeriesVisible(series) && isSeriesVisibleInLegend(series)) { CategoryDataset dataset = cp.getDataset(datasetIndex); ...
LegendItem function(int datasetIndex, int series) { CategoryPlot cp = getPlot(); if (cp == null) { return null; } if (isSeriesVisible(series) && isSeriesVisibleInLegend(series)) { CategoryDataset dataset = cp.getDataset(datasetIndex); String label = getLegendItemLabelGenerator().generateLabel( dataset, series); String ...
/** * Returns a legend item for a series. * * @param datasetIndex the dataset index (zero-based). * @param series the series index (zero-based). * * @return The legend item. */
Returns a legend item for a series
getLegendItem
{ "repo_name": "beetri/jfreechart-code", "path": "source/org/jfree/chart/renderer/category/ScatterRenderer.java", "license": "lgpl-2.1", "size": 19708 }
[ "java.awt.Paint", "java.awt.Shape", "java.awt.Stroke", "java.awt.geom.Line2D", "org.jfree.chart.LegendItem", "org.jfree.chart.plot.CategoryPlot", "org.jfree.data.category.CategoryDataset" ]
import java.awt.Paint; import java.awt.Shape; import java.awt.Stroke; import java.awt.geom.Line2D; import org.jfree.chart.LegendItem; import org.jfree.chart.plot.CategoryPlot; import org.jfree.data.category.CategoryDataset;
import java.awt.*; import java.awt.geom.*; import org.jfree.chart.*; import org.jfree.chart.plot.*; import org.jfree.data.category.*;
[ "java.awt", "org.jfree.chart", "org.jfree.data" ]
java.awt; org.jfree.chart; org.jfree.data;
997,550
public void setRequestCache(RequestCache cache) { requestCache = cache; } /** * {@inheritDoc}
void function(RequestCache cache) { requestCache = cache; } /** * {@inheritDoc}
/** * Dependency injection for the request cache. * @param cache the cache */
Dependency injection for the request cache
setRequestCache
{ "repo_name": "pixare40/gymapp", "path": "target/work/plugins/spring-security-core-2.0-RC4/src/java/grails/plugin/springsecurity/web/access/AjaxAwareAccessDeniedHandler.java", "license": "gpl-2.0", "size": 6136 }
[ "org.springframework.security.web.savedrequest.RequestCache" ]
import org.springframework.security.web.savedrequest.RequestCache;
import org.springframework.security.web.savedrequest.*;
[ "org.springframework.security" ]
org.springframework.security;
1,213,261
public static QueryResultsOption pageSize(long pageSize) { checkArgument(pageSize >= 0); return new QueryResultsOption(BigQueryRpc.Option.MAX_RESULTS, pageSize); }
static QueryResultsOption function(long pageSize) { checkArgument(pageSize >= 0); return new QueryResultsOption(BigQueryRpc.Option.MAX_RESULTS, pageSize); }
/** * Returns an option to specify the maximum number of rows returned per page. */
Returns an option to specify the maximum number of rows returned per page
pageSize
{ "repo_name": "rborer/google-cloud-java", "path": "google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java", "license": "apache-2.0", "size": 35938 }
[ "com.google.cloud.bigquery.spi.v2.BigQueryRpc", "com.google.common.base.Preconditions" ]
import com.google.cloud.bigquery.spi.v2.BigQueryRpc; import com.google.common.base.Preconditions;
import com.google.cloud.bigquery.spi.v2.*; import com.google.common.base.*;
[ "com.google.cloud", "com.google.common" ]
com.google.cloud; com.google.common;
891,162
public void setUserPropertyUsageContexts(Map<String,UserPropertyUsageContext> userPropertyUsageContexts) { this.userPropertyUsageContexts = userPropertyUsageContexts; }
void function(Map<String,UserPropertyUsageContext> userPropertyUsageContexts) { this.userPropertyUsageContexts = userPropertyUsageContexts; }
/** * Spring setter * @param userPropertyUsageContexts */
Spring setter
setUserPropertyUsageContexts
{ "repo_name": "stevenhva/InfoLearn_OpenOLAT", "path": "src/main/java/org/olat/user/propertyhandlers/UserPropertiesConfigImpl.java", "license": "apache-2.0", "size": 7497 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,632,024
server = new Server(); server.setStopAtShutdown(true); http_config = new HttpConfiguration(); http_config.setSecureScheme("https"); SslContextFactory sslContextFactory = new SslContextFactory(); sslContextFactory.setKeyStorePath(getResourcePath("2waytest/basic_mutual_auth/servi...
server = new Server(); server.setStopAtShutdown(true); http_config = new HttpConfiguration(); http_config.setSecureScheme("https"); SslContextFactory sslContextFactory = new SslContextFactory(); sslContextFactory.setKeyStorePath(getResourcePath(STR)); sslContextFactory.setKeyStorePassword(STR); sslContextFactory.setKey...
/** * With thanks to assistance of http://stackoverflow.com/b/20056601/2766538 * @throws Exception any exception */
With thanks to assistance of HREF
setupJetty
{ "repo_name": "EricWittmann/apiman", "path": "gateway/platforms/servlet/src/test/java/io/apiman/gateway/platforms/servlet/auth/tls/BasicMutualAuthTest.java", "license": "apache-2.0", "size": 19278 }
[ "org.eclipse.jetty.server.HttpConfiguration", "org.eclipse.jetty.server.HttpConnectionFactory", "org.eclipse.jetty.server.SecureRequestCustomizer", "org.eclipse.jetty.server.Server", "org.eclipse.jetty.server.ServerConnector", "org.eclipse.jetty.server.SslConnectionFactory", "org.eclipse.jetty.server.ha...
import org.eclipse.jetty.server.HttpConfiguration; import org.eclipse.jetty.server.HttpConnectionFactory; import org.eclipse.jetty.server.SecureRequestCustomizer; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.server.SslConnectionFactory; import org.ecl...
import org.eclipse.jetty.server.*; import org.eclipse.jetty.server.handler.*; import org.eclipse.jetty.util.ssl.*;
[ "org.eclipse.jetty" ]
org.eclipse.jetty;
729,594