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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
UserToken findByTokenSourceAndPrincipal(String tokenSource, String principal); | UserToken findByTokenSourceAndPrincipal(String tokenSource, String principal); | /**
* Find by natural key.
*
* @param tokenSource
* @param principal
*/ | Find by natural key | findByTokenSourceAndPrincipal | {
"repo_name": "eldevanjr/helianto",
"path": "helianto-core/src/main/java/org/helianto/user/repository/UserTokenRepository.java",
"license": "apache-2.0",
"size": 594
} | [
"org.helianto.user.domain.UserToken"
] | import org.helianto.user.domain.UserToken; | import org.helianto.user.domain.*; | [
"org.helianto.user"
] | org.helianto.user; | 2,278,874 |
private static String readFileFromRessourceAsString(final String file) throws java.io.IOException {
Log4JQuickConfig.configure4LumbermillOnLocalhost();
final StringBuffer fileData = new StringBuffer(1000);
final URL url = WFSFormGemeindenSearch.class.getResource(file);
final Buffered... | static String function(final String file) throws java.io.IOException { Log4JQuickConfig.configure4LumbermillOnLocalhost(); final StringBuffer fileData = new StringBuffer(1000); final URL url = WFSFormGemeindenSearch.class.getResource(file); final BufferedReader reader = new BufferedReader(new InputStreamReader(url.open... | /**
* DOCUMENT ME!
*
* @param file DOCUMENT ME!
*
* @return DOCUMENT ME!
*
* @throws java.io.IOException DOCUMENT ME!
*/ | DOCUMENT ME | readFileFromRessourceAsString | {
"repo_name": "cismet/cids-custom-wrrl-db-mv",
"path": "src/main/java/de/cismet/cismap/custom/wfsforms/WFSFormGemeindenSearch.java",
"license": "lgpl-3.0",
"size": 26681
} | [
"de.cismet.tools.gui.log4jquickconfig.Log4JQuickConfig",
"java.io.BufferedReader",
"java.io.InputStreamReader"
] | import de.cismet.tools.gui.log4jquickconfig.Log4JQuickConfig; import java.io.BufferedReader; import java.io.InputStreamReader; | import de.cismet.tools.gui.log4jquickconfig.*; import java.io.*; | [
"de.cismet.tools",
"java.io"
] | de.cismet.tools; java.io; | 809,939 |
public PolicyType policyType() {
return this.policyType;
} | PolicyType function() { return this.policyType; } | /**
* Get the policyType property: The type of policy definition. Possible values are NotSpecified, BuiltIn, and
* Custom.
*
* @return the policyType value.
*/ | Get the policyType property: The type of policy definition. Possible values are NotSpecified, BuiltIn, and Custom | policyType | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionProperties.java",
"license": "mit",
"size": 5937
} | [
"com.azure.resourcemanager.resources.models.PolicyType"
] | import com.azure.resourcemanager.resources.models.PolicyType; | import com.azure.resourcemanager.resources.models.*; | [
"com.azure.resourcemanager"
] | com.azure.resourcemanager; | 135,055 |
public Iterator getIterator(boolean group) {
if (group)
return table.values().iterator();
else {
// flatten the enumeration into a vector, then
// enumerate that
Vector v = new Vector(table.size());
for (Iterator iter = table.values().itera... | Iterator function(boolean group) { if (group) return table.values().iterator(); else { Vector v = new Vector(table.size()); for (Iterator iter = table.values().iterator(); iter.hasNext(); ) { Object o = iter.next(); if (o instanceof Entry) v.addElement(o); else { Entry[] entries = (Entry[])o; for (int i = 0; i < entrie... | /**
* Iterate over the contents of the table.
* @param group if <code>true</code>, entries for the same relative
* URL are grouped together, and if more than one, returned in an
* array; if <code>false</code>, the iterator always returns
* separate entries.
* @see Entry
* @return an i... | Iterate over the contents of the table | getIterator | {
"repo_name": "Distrotech/icedtea7-2.3",
"path": "test/jtreg/com/sun/javatest/ExcludeList.java",
"license": "gpl-2.0",
"size": 43636
} | [
"java.util.Iterator",
"java.util.Vector"
] | import java.util.Iterator; import java.util.Vector; | import java.util.*; | [
"java.util"
] | java.util; | 1,936,647 |
public void run() {
// Process requests until we receive a shutdown signal
while (running) {
// Wait for the next socket to be assigned
long socket = await();
if (socket == 0)
continue;
// Process the ... | void function() { while (running) { long socket = await(); if (socket == 0) continue; if ((status != null) && (handler.event(socket, status) == Handler.SocketState.CLOSED)) { Socket.destroy(socket); socket = 0; } else if ((status == null) && ((options && !setSocketOptions(socket)) handler.process(socket) == Handler.Soc... | /**
* The background thread that listens for incoming TCP/IP connections and
* hands them off to an appropriate processor.
*/ | The background thread that listens for incoming TCP/IP connections and hands them off to an appropriate processor | run | {
"repo_name": "plumer/codana",
"path": "tomcat_files/6.0.0/AprEndpoint.java",
"license": "mit",
"size": 64522
} | [
"org.apache.tomcat.jni.Socket"
] | import org.apache.tomcat.jni.Socket; | import org.apache.tomcat.jni.*; | [
"org.apache.tomcat"
] | org.apache.tomcat; | 2,565,595 |
static ThreadPoolBulkheadRegistry ofDefaults() {
return ofDefaults(HashMap.empty());
} | static ThreadPoolBulkheadRegistry ofDefaults() { return ofDefaults(HashMap.empty()); } | /**
* Creates a ThreadPoolBulkheadRegistry with a default ThreadPoolBulkhead configuration
*
* @return a ThreadPoolBulkheadRegistry instance backed by a default ThreadPoolBulkhead
* configuration
*/ | Creates a ThreadPoolBulkheadRegistry with a default ThreadPoolBulkhead configuration | ofDefaults | {
"repo_name": "drmaas/resilience4j",
"path": "resilience4j-bulkhead/src/main/java/io/github/resilience4j/bulkhead/ThreadPoolBulkheadRegistry.java",
"license": "apache-2.0",
"size": 13374
} | [
"io.vavr.collection.HashMap"
] | import io.vavr.collection.HashMap; | import io.vavr.collection.*; | [
"io.vavr.collection"
] | io.vavr.collection; | 1,995,085 |
public PutMappingRequest source(String mappingSource, XContentType xContentType) {
return source(new BytesArray(mappingSource), xContentType);
} | PutMappingRequest function(String mappingSource, XContentType xContentType) { return source(new BytesArray(mappingSource), xContentType); } | /**
* The mapping source definition.
*/ | The mapping source definition | source | {
"repo_name": "qwerty4030/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingRequest.java",
"license": "apache-2.0",
"size": 12239
} | [
"org.elasticsearch.common.bytes.BytesArray",
"org.elasticsearch.common.xcontent.XContentType"
] | import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.xcontent.XContentType; | import org.elasticsearch.common.bytes.*; import org.elasticsearch.common.xcontent.*; | [
"org.elasticsearch.common"
] | org.elasticsearch.common; | 1,452,533 |
private void writeDeletion(CatalogType prevType, CatalogType newlyChildlessParent, String mapName, String name)
{
// Don't write deletions if the field can be ignored
if (checkDeleteIgnoreList(prevType, newlyChildlessParent, mapName, name)) {
return;
}
// verify this... | void function(CatalogType prevType, CatalogType newlyChildlessParent, String mapName, String name) { if (checkDeleteIgnoreList(prevType, newlyChildlessParent, mapName, name)) { return; } String errorMessage = checkAddDropWhitelist(prevType, ChangeType.DELETION); if (errorMessage != null) { String[] response = checkAddD... | /**
* Add a deletion
*/ | Add a deletion | writeDeletion | {
"repo_name": "kumarrus/voltdb",
"path": "src/catgen/in/javasrc/CatalogDiffEngine.java",
"license": "agpl-3.0",
"size": 63735
} | [
"java.util.Arrays",
"java.util.List"
] | import java.util.Arrays; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,777,474 |
public void remove(LocalNodeMasterListener listener) {
localNodeMasterListeners.remove(listener);
}
/**
* Adds a cluster state listener that will timeout after the provided timeout,
* and is executed after the clusterstate has been successfully applied ie. is
* in state {@link Cluste... | void function(LocalNodeMasterListener listener) { localNodeMasterListeners.remove(listener); } /** * Adds a cluster state listener that will timeout after the provided timeout, * and is executed after the clusterstate has been successfully applied ie. is * in state {@link ClusterStateStatus#APPLIED} | /**
* Remove the given listener for on/off local master events
*/ | Remove the given listener for on/off local master events | remove | {
"repo_name": "JervyShi/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/cluster/service/ClusterService.java",
"license": "apache-2.0",
"size": 52057
} | [
"org.elasticsearch.cluster.LocalNodeMasterListener"
] | import org.elasticsearch.cluster.LocalNodeMasterListener; | import org.elasticsearch.cluster.*; | [
"org.elasticsearch.cluster"
] | org.elasticsearch.cluster; | 1,379,348 |
public java.util.List<fr.lip6.move.pnml.hlpn.cyclicEnumerations.hlapi.SuccessorHLAPI> getSubterm_cyclicEnumerations_SuccessorHLAPI(){
java.util.List<fr.lip6.move.pnml.hlpn.cyclicEnumerations.hlapi.SuccessorHLAPI> retour = new ArrayList<fr.lip6.move.pnml.hlpn.cyclicEnumerations.hlapi.SuccessorHLAPI>();
for (T... | java.util.List<fr.lip6.move.pnml.hlpn.cyclicEnumerations.hlapi.SuccessorHLAPI> function(){ java.util.List<fr.lip6.move.pnml.hlpn.cyclicEnumerations.hlapi.SuccessorHLAPI> retour = new ArrayList<fr.lip6.move.pnml.hlpn.cyclicEnumerations.hlapi.SuccessorHLAPI>(); for (Term elemnt : getSubterm()) { if(elemnt.getClass().equa... | /**
* This accessor return a list of encapsulated subelement, only of SuccessorHLAPI kind.
* WARNING : this method can creates a lot of new object in memory.
*/ | This accessor return a list of encapsulated subelement, only of SuccessorHLAPI kind. WARNING : this method can creates a lot of new object in memory | getSubterm_cyclicEnumerations_SuccessorHLAPI | {
"repo_name": "lhillah/pnmlframework",
"path": "pnmlFw-HLPN/src/fr/lip6/move/pnml/hlpn/lists/hlapi/SublistHLAPI.java",
"license": "epl-1.0",
"size": 111755
} | [
"fr.lip6.move.pnml.hlpn.terms.Term",
"java.util.ArrayList",
"java.util.List"
] | import fr.lip6.move.pnml.hlpn.terms.Term; import java.util.ArrayList; import java.util.List; | import fr.lip6.move.pnml.hlpn.terms.*; import java.util.*; | [
"fr.lip6.move",
"java.util"
] | fr.lip6.move; java.util; | 283,783 |
public interface CustomActionProvider {
void onCustomAction(String action, Bundle extras); | interface CustomActionProvider { void function(String action, Bundle extras); | /**
* Called when a custom action provided by this provider is sent to the media session.
*
* @param action The name of the action which was sent by a media controller.
* @param extras Optional extras sent by a media controller.
*/ | Called when a custom action provided by this provider is sent to the media session | onCustomAction | {
"repo_name": "antoniodiraff/ExoPlayer_Library_0.1",
"path": "extensions/mediasession/src/main/java/com/google/android/exoplayer2/ext/mediasession/MediaSessionConnector.java",
"license": "apache-2.0",
"size": 32308
} | [
"android.os.Bundle"
] | import android.os.Bundle; | import android.os.*; | [
"android.os"
] | android.os; | 2,627,713 |
Builder block(BlockState block); | Builder block(BlockState block); | /**
* Sets the {@link BlockState} to place down.
*
* @param block The new block to place
* @return This builder, for chaining
*/ | Sets the <code>BlockState</code> to place down | block | {
"repo_name": "AlphaModder/SpongeAPI",
"path": "src/main/java/org/spongepowered/api/world/gen/populator/SeaFloor.java",
"license": "mit",
"size": 7337
} | [
"org.spongepowered.api.block.BlockState"
] | import org.spongepowered.api.block.BlockState; | import org.spongepowered.api.block.*; | [
"org.spongepowered.api"
] | org.spongepowered.api; | 1,081,124 |
@Test
public void testBadOverrideFromOtherJ5Compatible() throws Exception {
final DefaultConfiguration checkConfig = createModuleConfig(MissingOverrideCheck.class);
checkConfig.addAttribute("javaFiveCompatibility", "true");
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
... | void function() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(MissingOverrideCheck.class); checkConfig.addAttribute(STR, "true"); final String[] expected = CommonUtils.EMPTY_STRING_ARRAY; verify(checkConfig, getPath(STR), expected); } | /**
* This tests classes that are extending things explicitly will NOT be flagged while in
* Java 5 compatibility mode.
*/ | This tests classes that are extending things explicitly will NOT be flagged while in Java 5 compatibility mode | testBadOverrideFromOtherJ5Compatible | {
"repo_name": "jochenvdv/checkstyle",
"path": "src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingOverrideCheckTest.java",
"license": "lgpl-2.1",
"size": 10788
} | [
"com.puppycrawl.tools.checkstyle.DefaultConfiguration",
"com.puppycrawl.tools.checkstyle.utils.CommonUtils"
] | import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.utils.CommonUtils; | import com.puppycrawl.tools.checkstyle.*; import com.puppycrawl.tools.checkstyle.utils.*; | [
"com.puppycrawl.tools"
] | com.puppycrawl.tools; | 966,045 |
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
synchronized (mLock) {
if ((mPreviewWidth != 0) && (mPreviewHeight != 0)) {
mWidthScaleFactor = (float) canvas.getWidth() / (float) mPreviewWidth;
mHeightScaleFactor = (float) canv... | void function(Canvas canvas) { super.onDraw(canvas); synchronized (mLock) { if ((mPreviewWidth != 0) && (mPreviewHeight != 0)) { mWidthScaleFactor = (float) canvas.getWidth() / (float) mPreviewWidth; mHeightScaleFactor = (float) canvas.getHeight() / (float) mPreviewHeight; } for (Graphic graphic : mGraphics) { graphic.... | /**
* Draws the overlay with its associated graphic objects.
*/ | Draws the overlay with its associated graphic objects | onDraw | {
"repo_name": "dreampany/framework",
"path": "frame/src/main/java/com/dreampany/vision/ui/camera/GraphicOverlay.java",
"license": "apache-2.0",
"size": 7351
} | [
"android.graphics.Canvas"
] | import android.graphics.Canvas; | import android.graphics.*; | [
"android.graphics"
] | android.graphics; | 1,965,844 |
private void addUserRoleFilter(int tenantId, SolrQuery query) throws SolrException {
try {
UserRegistry registry = Utils.getRegistryService().getRegistry(CarbonConstants.REGISTRY_SYSTEM_USERNAME, tenantId);
UserRealm realm = registry.getUserRealm();
String[] userRoles = r... | void function(int tenantId, SolrQuery query) throws SolrException { try { UserRegistry registry = Utils.getRegistryService().getRegistry(CarbonConstants.REGISTRY_SYSTEM_USERNAME, tenantId); UserRealm realm = registry.getUserRealm(); String[] userRoles = realm.getUserStoreManager().getRoleListOfUser(getLoggedInUserName(... | /**
* Method build the filter query to filter the results by the user role
* @param tenantId tenantID of the logged user
* @param query search query
*/ | Method build the filter query to filter the results by the user role | addUserRoleFilter | {
"repo_name": "daneshk/carbon-registry",
"path": "components/registry/org.wso2.carbon.registry.indexing/src/main/java/org/wso2/carbon/registry/indexing/solr/SolrClient.java",
"license": "apache-2.0",
"size": 69901
} | [
"org.apache.solr.client.solrj.SolrQuery",
"org.apache.solr.client.solrj.util.ClientUtils",
"org.apache.solr.common.SolrException",
"org.wso2.carbon.CarbonConstants",
"org.wso2.carbon.registry.core.exceptions.RegistryException",
"org.wso2.carbon.registry.core.session.UserRegistry",
"org.wso2.carbon.regis... | import org.apache.solr.client.solrj.SolrQuery; import org.apache.solr.client.solrj.util.ClientUtils; import org.apache.solr.common.SolrException; import org.wso2.carbon.CarbonConstants; import org.wso2.carbon.registry.core.exceptions.RegistryException; import org.wso2.carbon.registry.core.session.UserRegistry; import o... | import org.apache.solr.client.solrj.*; import org.apache.solr.client.solrj.util.*; import org.apache.solr.common.*; import org.wso2.carbon.*; import org.wso2.carbon.registry.core.exceptions.*; import org.wso2.carbon.registry.core.session.*; import org.wso2.carbon.registry.indexing.*; import org.wso2.carbon.user.api.*; | [
"org.apache.solr",
"org.wso2.carbon"
] | org.apache.solr; org.wso2.carbon; | 1,806,807 |
public static void showHeaderHint(Context context, View view, String string) {
int[] location = new int[2];
view.getLocationOnScreen(location);
Toast toast = Toast.makeText(view.getContext(), string, Toast.LENGTH_SHORT);
toast.setGravity(Gravity.TOP | Gravity.START, view.getRight... | static void function(Context context, View view, String string) { int[] location = new int[2]; view.getLocationOnScreen(location); Toast toast = Toast.makeText(view.getContext(), string, Toast.LENGTH_SHORT); toast.setGravity(Gravity.TOP Gravity.START, view.getRight() + context.getResources().getDimensionPixelOffset( R.... | /**
* Shows a toast message as hint, closer to the supplied view to
* mimic action bar hint method. To show hint below the view.
*
* @param context to retrieve resources.
* @param view for which hint to be shown.
* @param string Text to be shown as hint.
*/ | Shows a toast message as hint, closer to the supplied view to mimic action bar hint method. To show hint below the view | showHeaderHint | {
"repo_name": "pranavpandey/small-app-support",
"path": "eclipse/library/src/com/pranavpandey/smallapp/SmallUtils.java",
"license": "apache-2.0",
"size": 16230
} | [
"android.content.Context",
"android.view.Gravity",
"android.view.View",
"android.widget.Toast"
] | import android.content.Context; import android.view.Gravity; import android.view.View; import android.widget.Toast; | import android.content.*; import android.view.*; import android.widget.*; | [
"android.content",
"android.view",
"android.widget"
] | android.content; android.view; android.widget; | 146,518 |
protected MapConfiguration createTmsMap(Profile profile, int nrOfZoomLevels) {
MapConfiguration mapConfiguration = null;
switch (profile) {
case GLOBAL_GEODETIC:
mapConfiguration = createTmsMap("EPSG:4326", CrsType.DEGREES, new Bbox(-180, -90, 360, 180), 256,
nrOfZoomLevels);
break;
case GLOB... | MapConfiguration function(Profile profile, int nrOfZoomLevels) { MapConfiguration mapConfiguration = null; switch (profile) { case GLOBAL_GEODETIC: mapConfiguration = createTmsMap(STR, CrsType.DEGREES, new Bbox(-180, -90, 360, 180), 256, nrOfZoomLevels); break; case GLOBAL_MERCATOR: mapConfiguration = createTmsMap(STR,... | /**
* Create a map with one of the default profiles and a specific number of zoom levels (default = 21).
*
* @param profile
* @param nrOfZoomLevels
* @return
*/ | Create a map with one of the default profiles and a specific number of zoom levels (default = 21) | createTmsMap | {
"repo_name": "geomajas/geomajas-project-client-gwt2",
"path": "plugin/tms/tms/src/main/java/org/geomajas/gwt2/plugin/tms/client/TmsClient.java",
"license": "agpl-3.0",
"size": 10767
} | [
"org.geomajas.geometry.Bbox",
"org.geomajas.gwt2.client.map.MapConfiguration"
] | import org.geomajas.geometry.Bbox; import org.geomajas.gwt2.client.map.MapConfiguration; | import org.geomajas.geometry.*; import org.geomajas.gwt2.client.map.*; | [
"org.geomajas.geometry",
"org.geomajas.gwt2"
] | org.geomajas.geometry; org.geomajas.gwt2; | 41,920 |
List<? extends DocTree> getBody(); | List<? extends DocTree> getBody(); | /**
* Returns the description explaining why an item is deprecated.
* @return the description
*/ | Returns the description explaining why an item is deprecated | getBody | {
"repo_name": "google/error-prone-javac",
"path": "src/jdk.compiler/share/classes/com/sun/source/doctree/DeprecatedTree.java",
"license": "gpl-2.0",
"size": 1600
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,232,577 |
public static Optional<MessageType> forMessageNumber(final byte number) {
for (final MessageType candidate : values()) {
if (candidate.messageNumber == number) {
return Optional.of(candidate);
}
}
return Optional.empty();
} | static Optional<MessageType> function(final byte number) { for (final MessageType candidate : values()) { if (candidate.messageNumber == number) { return Optional.of(candidate); } } return Optional.empty(); } | /**
* Returns the message type that has the given number.
*
* @param number
* The number of the message type to return.
* @return The {@link MessageType} if the number is assigned to any known {@link MessageType} or an empty
* {@link Optional} if not.
*/ | Returns the message type that has the given number | forMessageNumber | {
"repo_name": "rbi/trading4j",
"path": "server/src/main/java/de/voidnode/trading4j/server/protocol/messages/MessageType.java",
"license": "gpl-3.0",
"size": 4595
} | [
"java.util.Optional"
] | import java.util.Optional; | import java.util.*; | [
"java.util"
] | java.util; | 1,647,524 |
private GroupsPanel getGroupsPanel() {
if (groupsPanel == null) {
groupsPanel = new GroupsPanel(this.csmApp, getProgress());
}
return groupsPanel;
} | GroupsPanel function() { if (groupsPanel == null) { groupsPanel = new GroupsPanel(this.csmApp, getProgress()); } return groupsPanel; } | /**
* This method initializes groupsPanel
*
* @return javax.swing.JPanel
*/ | This method initializes groupsPanel | getGroupsPanel | {
"repo_name": "NCIP/cagrid-grid-incubation",
"path": "grid-incubation/incubator/projects/csm/projects/csm-ui/src/java/org/cagrid/gaards/ui/csm/applications/ApplicationEditor.java",
"license": "bsd-3-clause",
"size": 6801
} | [
"org.cagrid.gaards.ui.csm.groups.GroupsPanel"
] | import org.cagrid.gaards.ui.csm.groups.GroupsPanel; | import org.cagrid.gaards.ui.csm.groups.*; | [
"org.cagrid.gaards"
] | org.cagrid.gaards; | 2,170,202 |
CR convert(Collection<T> components, String scrollId, String searchAfter, int limit, int total); | CR convert(Collection<T> components, String scrollId, String searchAfter, int limit, int total); | /**
* Convert multiple internal index based entities to resource based representations.
*
* @param components
* @param scrollId
* @param searchAfter
* @param limit
* @param total
* @return
*/ | Convert multiple internal index based entities to resource based representations | convert | {
"repo_name": "IHTSDO/snow-owl",
"path": "core/com.b2international.snowowl.datastore/src/com/b2international/snowowl/datastore/converter/ResourceConverter.java",
"license": "apache-2.0",
"size": 1355
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 1,209,942 |
public ShortSortedSet keySet() {
if ( keys == null ) keys = new KeySet();
return keys;
}
private final class ValueIterator extends TreeIterator implements FloatListIterator {
public float nextFloat() { return nextEntry().value; } | ShortSortedSet function() { if ( keys == null ) keys = new KeySet(); return keys; } private final class ValueIterator extends TreeIterator implements FloatListIterator { public float nextFloat() { return nextEntry().value; } | /** Returns a type-specific sorted set view of the keys contained in this map.
*
* <P>In addition to the semantics of {@link java.util.Map#keySet()}, you can
* safely cast the set returned by this call to a type-specific sorted
* set interface.
*
* @return a type-specific sorted set view of the keys contain... | Returns a type-specific sorted set view of the keys contained in this map. In addition to the semantics of <code>java.util.Map#keySet()</code>, you can safely cast the set returned by this call to a type-specific sorted set interface | keySet | {
"repo_name": "karussell/fastutil",
"path": "src/it/unimi/dsi/fastutil/shorts/Short2FloatRBTreeMap.java",
"license": "apache-2.0",
"size": 54345
} | [
"it.unimi.dsi.fastutil.floats.FloatListIterator"
] | import it.unimi.dsi.fastutil.floats.FloatListIterator; | import it.unimi.dsi.fastutil.floats.*; | [
"it.unimi.dsi"
] | it.unimi.dsi; | 913,387 |
public static List<Path> getMatchingFiles(final Path rootPath, String globPattern, boolean recursive)
throws IOException {
final List<Path> result = new ArrayList<>();
if (!recursive) {
DirectoryStream<Path> dirStream = getMatchingFiles(rootPath, globPattern);
for (Path path : dirStream) {
... | static List<Path> function(final Path rootPath, String globPattern, boolean recursive) throws IOException { final List<Path> result = new ArrayList<>(); if (!recursive) { DirectoryStream<Path> dirStream = getMatchingFiles(rootPath, globPattern); for (Path path : dirStream) { result.add(path); } | /**
* Returns a list of all files matching the given pattern. If {@code recursive} is true
* will recurse into all directories below {@code rootPath}.
*/ | Returns a list of all files matching the given pattern. If recursive is true will recurse into all directories below rootPath | getMatchingFiles | {
"repo_name": "Squarespace/less-compiler",
"path": "src/main/java/com/squarespace/less/core/LessUtils.java",
"license": "apache-2.0",
"size": 8178
} | [
"java.io.IOException",
"java.nio.file.DirectoryStream",
"java.nio.file.Path",
"java.util.ArrayList",
"java.util.List"
] | import java.io.IOException; import java.nio.file.DirectoryStream; import java.nio.file.Path; import java.util.ArrayList; import java.util.List; | import java.io.*; import java.nio.file.*; import java.util.*; | [
"java.io",
"java.nio",
"java.util"
] | java.io; java.nio; java.util; | 166,737 |
@ServiceMethod(returns = ReturnType.SINGLE)
public void initiateScan(
String resourceGroupName,
String managedInstanceName,
String databaseName,
VulnerabilityAssessmentName vulnerabilityAssessmentName,
String scanId) {
initiateScanAsync(resourceGroupName, managedI... | @ServiceMethod(returns = ReturnType.SINGLE) void function( String resourceGroupName, String managedInstanceName, String databaseName, VulnerabilityAssessmentName vulnerabilityAssessmentName, String scanId) { initiateScanAsync(resourceGroupName, managedInstanceName, databaseName, vulnerabilityAssessmentName, scanId) .bl... | /**
* Executes a Vulnerability Assessment database scan.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param managedInstanceName The name of the managed instance.
... | Executes a Vulnerability Assessment database scan | initiateScan | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-sql/src/main/java/com/azure/resourcemanager/sql/implementation/ManagedDatabaseVulnerabilityAssessmentScansClientImpl.java",
"license": "mit",
"size": 63912
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.resourcemanager.sql.models.VulnerabilityAssessmentName"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.sql.models.VulnerabilityAssessmentName; | import com.azure.core.annotation.*; import com.azure.resourcemanager.sql.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 2,261,078 |
List<ServiceRef_handlerChain> getHandlerChains();
ServiceRef_handlerChain addHandlerChain(); | List<ServiceRef_handlerChain> getHandlerChains(); ServiceRef_handlerChain addHandlerChain(); | /**
* Adds new child to the list of handler-chain children.
* @return created child
*/ | Adds new child to the list of handler-chain children | addHandlerChain | {
"repo_name": "consulo/consulo-javaee",
"path": "javaee-api/src/main/java/com/intellij/javaee/model/xml/ServiceRef_handlerChains.java",
"license": "apache-2.0",
"size": 1580
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,981,496 |
public static String getLabel(final ModifierKeyword keyword) {
Assert.isTrue(isVisibilityKeyword(keyword));
if (keyword == null)
return RefactoringCoreMessages.MemberVisibilityAdjustor_change_visibility_default;
else if (ModifierKeyword.PUBLIC_KEYWORD.equals(keyword))
return RefactoringCoreMessages.Membe... | static String function(final ModifierKeyword keyword) { Assert.isTrue(isVisibilityKeyword(keyword)); if (keyword == null) return RefactoringCoreMessages.MemberVisibilityAdjustor_change_visibility_default; else if (ModifierKeyword.PUBLIC_KEYWORD.equals(keyword)) return RefactoringCoreMessages.MemberVisibilityAdjustor_ch... | /**
* Returns the label for the specified visibility keyword.
*
* @param keyword the keyword to get the label for, or <code>null</code> for default visibility
* @return the label for the keyword
*/ | Returns the label for the specified visibility keyword | getLabel | {
"repo_name": "alexVengrovsk/che",
"path": "plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/corext/refactoring/structure/MemberVisibilityAdjustor.java",
"license": "epl-1.0",
"size": 57915
} | [
"org.eclipse.core.runtime.Assert",
"org.eclipse.jdt.core.dom.Modifier",
"org.eclipse.jdt.internal.corext.refactoring.RefactoringCoreMessages"
] | import org.eclipse.core.runtime.Assert; import org.eclipse.jdt.core.dom.Modifier; import org.eclipse.jdt.internal.corext.refactoring.RefactoringCoreMessages; | import org.eclipse.core.runtime.*; import org.eclipse.jdt.core.dom.*; import org.eclipse.jdt.internal.corext.refactoring.*; | [
"org.eclipse.core",
"org.eclipse.jdt"
] | org.eclipse.core; org.eclipse.jdt; | 955,362 |
void insert(Widget w, int beforeIndex); | void insert(Widget w, int beforeIndex); | /**
* Inserts a child widget before the specified index.
* If the widget is already a child of this panel, it will be moved to the specified index.<p>
*
* @param w the new child
* @param beforeIndex the before index
*/ | Inserts a child widget before the specified index. If the widget is already a child of this panel, it will be moved to the specified index | insert | {
"repo_name": "serrapos/opencms-core",
"path": "src-gwt/org/opencms/ade/containerpage/client/ui/I_CmsDropContainer.java",
"license": "lgpl-2.1",
"size": 3847
} | [
"com.google.gwt.user.client.ui.Widget"
] | import com.google.gwt.user.client.ui.Widget; | import com.google.gwt.user.client.ui.*; | [
"com.google.gwt"
] | com.google.gwt; | 193,031 |
private static void loadNativeLibraryFromJar() {
String libname = System.mapLibraryName("jnidispatch");
String arch = System.getProperty("os.arch");
String name = System.getProperty("os.name");
String resourceName = getNativeLibraryResourcePath(Platform.getOSType(), arch, name) + "/"... | static void function() { String libname = System.mapLibraryName(STR); String arch = System.getProperty(STR); String name = System.getProperty(STR); String resourceName = getNativeLibraryResourcePath(Platform.getOSType(), arch, name) + "/" + libname; URL url = Native.class.getResource(resourceName); if (url == null && P... | /**
* Attempts to load the native library resource from the filesystem,
* extracting the JNA stub library from jna.jar if not already available.
*/ | Attempts to load the native library resource from the filesystem, extracting the JNA stub library from jna.jar if not already available | loadNativeLibraryFromJar | {
"repo_name": "HGitMaster/jna-osgi",
"path": "src/com/sun/jna/Native.java",
"license": "lgpl-2.1",
"size": 61078
} | [
"java.io.File",
"java.io.FileOutputStream",
"java.io.IOException",
"java.io.InputStream",
"java.net.URISyntaxException"
] | import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.URISyntaxException; | import java.io.*; import java.net.*; | [
"java.io",
"java.net"
] | java.io; java.net; | 2,463,192 |
public void endObject() {
writeByte(objType.getId());
writeInt(obj.getId());
try {
bitField.write(baos);
} catch (IOException ex) {
// ByteArrayOutputStream doesn't actually throw IOException; it
// just inherits the declaration from the OutputStream class. Since
// it won't ever actually happen... | void function() { writeByte(objType.getId()); writeInt(obj.getId()); try { bitField.write(baos); } catch (IOException ex) { throw new RuntimeException(ex); } writeBytes(baosObj.toByteArray()); obj = null; objType = null; bitField = null; baosObj = null; } | /**
* Flushes the current object's bytes to the packet, but not to the wrapped
* OutputStream. This prepares the packet for writing another byte. You must
* invoke startObject() before calling this method. When this method
* returns, you will have to call startObject() again before you can write
* another obj... | Flushes the current object's bytes to the packet, but not to the wrapped OutputStream. This prepares the packet for writing another byte. You must invoke startObject() before calling this method. When this method returns, you will have to call startObject() again before you can write another object | endObject | {
"repo_name": "JordanLongstaff/Artemis-Messenger",
"path": "src/com/walkertribe/ian/iface/PacketWriter.java",
"license": "mit",
"size": 16045
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,161,932 |
public byte[] sign(byte[] hash) {
ECDSASigner signer = new ECDSASigner(new HMacDSAKCalculator(new SHA256Digest()));
signer.init(true, new ECPrivateKeyParameters(priv, domain));
BigInteger[] signature = signer.generateSignature(hash);
ByteArrayOutputStream baos = new ByteArrayOutputSt... | byte[] function(byte[] hash) { ECDSASigner signer = new ECDSASigner(new HMacDSAKCalculator(new SHA256Digest())); signer.init(true, new ECPrivateKeyParameters(priv, domain)); BigInteger[] signature = signer.generateSignature(hash); ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { DERSequenceGenerator seq ... | /**
* Sign a digest with this key.
*
* @param hash arbitrary data
* @return signature
*/ | Sign a digest with this key | sign | {
"repo_name": "DigitalAssetCom/hlp-candidate",
"path": "client/api/src/main/java/org/hyperledger/common/PrivateKey.java",
"license": "apache-2.0",
"size": 10516
} | [
"java.io.ByteArrayOutputStream",
"java.io.IOException",
"java.math.BigInteger",
"org.bouncycastle.asn1.ASN1Integer",
"org.bouncycastle.asn1.DERSequenceGenerator",
"org.bouncycastle.crypto.digests.SHA256Digest",
"org.bouncycastle.crypto.params.ECPrivateKeyParameters",
"org.bouncycastle.crypto.signers.E... | import java.io.ByteArrayOutputStream; import java.io.IOException; import java.math.BigInteger; import org.bouncycastle.asn1.ASN1Integer; import org.bouncycastle.asn1.DERSequenceGenerator; import org.bouncycastle.crypto.digests.SHA256Digest; import org.bouncycastle.crypto.params.ECPrivateKeyParameters; import org.bouncy... | import java.io.*; import java.math.*; import org.bouncycastle.asn1.*; import org.bouncycastle.crypto.digests.*; import org.bouncycastle.crypto.params.*; import org.bouncycastle.crypto.signers.*; | [
"java.io",
"java.math",
"org.bouncycastle.asn1",
"org.bouncycastle.crypto"
] | java.io; java.math; org.bouncycastle.asn1; org.bouncycastle.crypto; | 2,048,466 |
public void initialize()
{
if (!this.seedInitialized)
{
System.err.println("Seed " + this.maxHeight + " not initialized");
return;
}
this.heightOfNodes = new Vector();
this.tailLength = 0;
this.firstNode = null;
this.firstNodeHeigh... | void function() { if (!this.seedInitialized) { System.err.println(STR + this.maxHeight + STR); return; } this.heightOfNodes = new Vector(); this.tailLength = 0; this.firstNode = null; this.firstNodeHeight = -1; this.isInitialized = true; System.arraycopy(this.seedNext, 0, this.seedActive, 0, messDigestTree .getDigestSi... | /**
* initializes the treehash instance. The seeds must already have been
* initialized to work correctly.
*/ | initializes the treehash instance. The seeds must already have been initialized to work correctly | initialize | {
"repo_name": "xdv/ripple-lib-java",
"path": "ripple-bouncycastle/src/main/java/org/ripple/bouncycastle/pqc/crypto/gmss/Treehash.java",
"license": "isc",
"size": 14684
} | [
"java.util.Vector"
] | import java.util.Vector; | import java.util.*; | [
"java.util"
] | java.util; | 2,009,143 |
static String convertScanToString(Scan scan) throws IOException {
ClientProtos.Scan proto = ProtobufUtil.toScan(scan);
return Base64.encodeBytes(proto.toByteArray());
} | static String convertScanToString(Scan scan) throws IOException { ClientProtos.Scan proto = ProtobufUtil.toScan(scan); return Base64.encodeBytes(proto.toByteArray()); } | /**
* Writes the given scan into a Base64 encoded string.
*
* @param scan The scan to write out.
* @return The scan saved in a Base64 encoded string.
* @throws IOException When writing the scan fails.
*/ | Writes the given scan into a Base64 encoded string | convertScanToString | {
"repo_name": "mapr/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java",
"license": "apache-2.0",
"size": 39750
} | [
"java.io.IOException",
"org.apache.hadoop.hbase.client.Scan",
"org.apache.hadoop.hbase.protobuf.ProtobufUtil",
"org.apache.hadoop.hbase.protobuf.generated.ClientProtos",
"org.apache.hadoop.hbase.util.Base64"
] | import java.io.IOException; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.ClientProtos; import org.apache.hadoop.hbase.util.Base64; | import java.io.*; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.protobuf.*; import org.apache.hadoop.hbase.protobuf.generated.*; import org.apache.hadoop.hbase.util.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 1,023,258 |
public IBlockState withMirror(IBlockState state, Mirror mirrorIn)
{
return state.withRotation(mirrorIn.toRotation((EnumFacing)state.getValue(FACING)));
}
| IBlockState function(IBlockState state, Mirror mirrorIn) { return state.withRotation(mirrorIn.toRotation((EnumFacing)state.getValue(FACING))); } | /**
* Returns the blockstate with the given mirror of the passed blockstate. If inapplicable, returns the passed
* blockstate.
*/ | Returns the blockstate with the given mirror of the passed blockstate. If inapplicable, returns the passed blockstate | withMirror | {
"repo_name": "InverMN/MinecraftForgeReference",
"path": "MinecraftBlocks2/BlockPistonBase.java",
"license": "unlicense",
"size": 20102
} | [
"net.minecraft.block.state.IBlockState",
"net.minecraft.util.EnumFacing",
"net.minecraft.util.Mirror"
] | import net.minecraft.block.state.IBlockState; import net.minecraft.util.EnumFacing; import net.minecraft.util.Mirror; | import net.minecraft.block.state.*; import net.minecraft.util.*; | [
"net.minecraft.block",
"net.minecraft.util"
] | net.minecraft.block; net.minecraft.util; | 1,249,932 |
public Date getDay( int day )
{
DateTime dataTime = DateTime.now();
dataTime = dataTime.withTimeAtStartOfDay();
dataTime = dataTime.withDayOfYear( day );
return dataTime.toDate();
}
| Date function( int day ) { DateTime dataTime = DateTime.now(); dataTime = dataTime.withTimeAtStartOfDay(); dataTime = dataTime.withDayOfYear( day ); return dataTime.toDate(); } | /**
* Creates a date.
*
* @param day the day of the year.
* @return a date.
*/ | Creates a date | getDay | {
"repo_name": "vmluan/dhis2-core",
"path": "dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java",
"license": "bsd-3-clause",
"size": 76838
} | [
"java.util.Date",
"org.joda.time.DateTime"
] | import java.util.Date; import org.joda.time.DateTime; | import java.util.*; import org.joda.time.*; | [
"java.util",
"org.joda.time"
] | java.util; org.joda.time; | 2,730,169 |
public int pickMax(List<Integer> legal) {
int max = 0;
for (Integer c : legal) {
if (c % 8 >= max % 8) {
max = c;
}
}
return (max);
}
| int function(List<Integer> legal) { int max = 0; for (Integer c : legal) { if (c % 8 >= max % 8) { max = c; } } return (max); } | /**
* Select maximum card.
*
* @param legal
* ...
*
* @return Max card selected.
*
* @author Vencislav Medarov
* @email venci932@gmail.com
* @date 19 Jul 2013
*/ | Select maximum card | pickMax | {
"repo_name": "TodorBalabanov/open-marias-for-android",
"path": "src/eu/veldsoft/marias/SmartPlayer.java",
"license": "gpl-3.0",
"size": 9399
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,189,578 |
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("clusters")
public Response getClusters() {
TopologyService service = get(TopologyService.class);
Topology topology = service.currentTopology();
Iterable<TopologyCluster> clusters = service.getClusters(topology);
ObjectNode... | @Produces(MediaType.APPLICATION_JSON) @Path(STR) Response function() { TopologyService service = get(TopologyService.class); Topology topology = service.currentTopology(); Iterable<TopologyCluster> clusters = service.getClusters(topology); ObjectNode root = encodeArray(TopologyCluster.class, STR, clusters); return ok(r... | /**
* Gets overview of topology SCCs.
*
* @return 200 OK with topology clusters overview
* @onos.rsModel TopologyClusters
*/ | Gets overview of topology SCCs | getClusters | {
"repo_name": "gkatsikas/onos",
"path": "web/api/src/main/java/org/onosproject/rest/resources/TopologyWebResource.java",
"license": "apache-2.0",
"size": 8710
} | [
"com.fasterxml.jackson.databind.node.ObjectNode",
"javax.ws.rs.Path",
"javax.ws.rs.Produces",
"javax.ws.rs.core.MediaType",
"javax.ws.rs.core.Response",
"org.onosproject.net.topology.Topology",
"org.onosproject.net.topology.TopologyCluster",
"org.onosproject.net.topology.TopologyService"
] | import com.fasterxml.jackson.databind.node.ObjectNode; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import org.onosproject.net.topology.Topology; import org.onosproject.net.topology.TopologyCluster; import org.onosproject.net.topology.Topolog... | import com.fasterxml.jackson.databind.node.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import org.onosproject.net.topology.*; | [
"com.fasterxml.jackson",
"javax.ws",
"org.onosproject.net"
] | com.fasterxml.jackson; javax.ws; org.onosproject.net; | 2,431,426 |
// #GWT-IGNORE-START
public static <T> Observable<T> ofType(@Nonnull Observable<?> source,
@Nonnull Class<T> clazz) {
return new Where.OfType<T>(source, clazz);
}
// #GWT-IGNORE-END | static <T> Observable<T> function(@Nonnull Observable<?> source, @Nonnull Class<T> clazz) { return new Where.OfType<T>(source, clazz); } | /**
* Filters the elements of the source sequence which
* is assignable to the provided type.
* @param <T> the target element type
* @param source the source sequence
* @param clazz the class token
* @return the filtering obserable
* since 0.97
*/ | Filters the elements of the source sequence which is assignable to the provided type | ofType | {
"repo_name": "akarnokd/reactive4java",
"path": "src/main/java/hu/akarnokd/reactive4java/reactive/Reactive.java",
"license": "apache-2.0",
"size": 367224
} | [
"hu.akarnokd.reactive4java.base.Observable",
"javax.annotation.Nonnull"
] | import hu.akarnokd.reactive4java.base.Observable; import javax.annotation.Nonnull; | import hu.akarnokd.reactive4java.base.*; import javax.annotation.*; | [
"hu.akarnokd.reactive4java",
"javax.annotation"
] | hu.akarnokd.reactive4java; javax.annotation; | 1,803,419 |
private void writeAndTick(int integer, Keep keep) throws JSONException {
int width = keep.bitsize();
keep.tick(integer);
if (probe) {
log("\"" + keep.value(integer) + "\"");
}
write(integer, width);
} | void function(int integer, Keep keep) throws JSONException { int width = keep.bitsize(); keep.tick(integer); if (probe) { log("\"STR\""); } write(integer, width); } | /**
* Write an integer, using the number of bits necessary to hold the number
* as determined by its keep, and increment its usage count in the keep.
*
* @param integer The value to be encoded.
* @param keep The Keep that the integer is one of.
* @throws JSONException
*/ | Write an integer, using the number of bits necessary to hold the number as determined by its keep, and increment its usage count in the keep | writeAndTick | {
"repo_name": "reo7sp/BoardPP",
"path": "src/main/java/org/json/zip/Compressor.java",
"license": "apache-2.0",
"size": 13578
} | [
"org.json.JSONException"
] | import org.json.JSONException; | import org.json.*; | [
"org.json"
] | org.json; | 1,783,359 |
public List<String> ipAddresses() {
return this.ipAddresses;
} | List<String> function() { return this.ipAddresses; } | /**
* Get the ipAddresses property: A list of private ip addresses of the private endpoint.
*
* @return the ipAddresses value.
*/ | Get the ipAddresses property: A list of private ip addresses of the private endpoint | ipAddresses | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/CustomDnsConfigPropertiesFormat.java",
"license": "mit",
"size": 2280
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 235,388 |
public JComponent getJPanel() {
// This is way too complicated, it's equivalent to a BorderLayout.CENTER
// But BorderLayout.CENTER doesn't seem to work... And setLayout(null) doesn't center vertically
Box box = Box.createVerticalBox();
box.add(Box.createGlue());
Box insidebo... | JComponent function() { Box box = Box.createVerticalBox(); box.add(Box.createGlue()); Box insidebox = Box.createHorizontalBox(); insidebox.add(Box.createGlue()); insidebox.add(this); insidebox.add(Box.createGlue()); box.add(insidebox); box.add(Box.createGlue()); return box; } | /**
* Convenience method, makes a panel surrounding the (centered) ArrowButton.
* @return a variable size JPanel which contains the Fixed size button
*/ | Convenience method, makes a panel surrounding the (centered) ArrowButton | getJPanel | {
"repo_name": "moliva/proactive",
"path": "src/Examples/org/objectweb/proactive/examples/c3d/gui/ArrowButton.java",
"license": "agpl-3.0",
"size": 4401
} | [
"javax.swing.Box",
"javax.swing.JComponent"
] | import javax.swing.Box; import javax.swing.JComponent; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 1,681,436 |
private static boolean haveSameYear(OffsetDateTime actual, OffsetDateTime other) {
return actual.getYear() == other.getYear();
} | static boolean function(OffsetDateTime actual, OffsetDateTime other) { return actual.getYear() == other.getYear(); } | /**
* Returns true if both OffsetDateTime are in the same year, false otherwise.
*
* @param actual the actual OffsetDateTime. expected not be null
* @param other the other OffsetDateTime. expected not be null
* @return true if both OffsetDateTime are in the same year, false otherwise
*/ | Returns true if both OffsetDateTime are in the same year, false otherwise | haveSameYear | {
"repo_name": "bric3/assertj-core",
"path": "src/main/java/org/assertj/core/api/AbstractOffsetDateTimeAssert.java",
"license": "apache-2.0",
"size": 33264
} | [
"java.time.OffsetDateTime"
] | import java.time.OffsetDateTime; | import java.time.*; | [
"java.time"
] | java.time; | 1,226,120 |
public Builder<TYPE> skipAnalysisTimeFileTypeCheck() {
Preconditions.checkState((type == BuildType.LABEL) || (type == BuildType.LABEL_LIST),
"must be a label-valued type");
return setPropertyFlag(PropertyFlag.SKIP_ANALYSIS_TIME_FILETYPE_CHECK,
"skip_analysis_time_filetype_check");
... | Builder<TYPE> function() { Preconditions.checkState((type == BuildType.LABEL) (type == BuildType.LABEL_LIST), STR); return setPropertyFlag(PropertyFlag.SKIP_ANALYSIS_TIME_FILETYPE_CHECK, STR); } | /**
* Skip analysis time filetype check. Don't use it if avoidable.
*/ | Skip analysis time filetype check. Don't use it if avoidable | skipAnalysisTimeFileTypeCheck | {
"repo_name": "UrbanCompass/bazel",
"path": "src/main/java/com/google/devtools/build/lib/packages/Attribute.java",
"license": "apache-2.0",
"size": 64772
} | [
"com.google.devtools.build.lib.util.Preconditions"
] | import com.google.devtools.build.lib.util.Preconditions; | import com.google.devtools.build.lib.util.*; | [
"com.google.devtools"
] | com.google.devtools; | 1,176,770 |
List<ExpressionOccurrence> findExpressions(String text); | List<ExpressionOccurrence> findExpressions(String text); | /**
* Recognises expressions in a text.
*
* @param text the text to find expressions in
* @return all occurrences of expressions in the given text
*/ | Recognises expressions in a text | findExpressions | {
"repo_name": "levi-h/aluminumproject",
"path": "core/src/main/java/com/googlecode/aluminumproject/expressions/ExpressionFactory.java",
"license": "apache-2.0",
"size": 1831
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 751,969 |
public Map<String, String> getSortableXMLFormFields() {
return sortableXMLFormFields;
} | Map<String, String> function() { return sortableXMLFormFields; } | /**
* gets the list of Sortable fields if the content is a form XML
*
* @return the sortableXMLFormFields
*/ | gets the list of Sortable fields if the content is a form XML | getSortableXMLFormFields | {
"repo_name": "ebonnet/Silverpeas-Core",
"path": "core-library/src/main/java/org/silverpeas/core/index/search/model/MatchingIndexEntry.java",
"license": "agpl-3.0",
"size": 5092
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,078,505 |
public static void setLocale(Locale l) {
localizableSupport.setLocale(l);
} | static void function(Locale l) { localizableSupport.setLocale(l); } | /**
* Implements {@link org.apache.batik.i18n.Localizable#setLocale(Locale)}.
*/ | Implements <code>org.apache.batik.i18n.Localizable#setLocale(Locale)</code> | setLocale | {
"repo_name": "sflyphotobooks/crp-batik",
"path": "test-sources/org/apache/batik/transcoder/image/Messages.java",
"license": "apache-2.0",
"size": 2309
} | [
"java.util.Locale"
] | import java.util.Locale; | import java.util.*; | [
"java.util"
] | java.util; | 2,124,575 |
public static int getMaxFetchNotifNumber(Map<String, ?> env) {
return (int) getIntegerAttribute(env, MAX_FETCH_NOTIFS, 1000, 1,
Integer.MAX_VALUE);
}
public static final String FETCH_TIMEOUT =
"jmx.remote.x.notification.fetch.timeout"; | static int function(Map<String, ?> env) { return (int) getIntegerAttribute(env, MAX_FETCH_NOTIFS, 1000, 1, Integer.MAX_VALUE); } public static final String FETCH_TIMEOUT = STR; | /**
* Returns the maximum notification number which a client will
* fetch every time.
*/ | Returns the maximum notification number which a client will fetch every time | getMaxFetchNotifNumber | {
"repo_name": "wangsongpeng/jdk-src",
"path": "src/main/java/com/sun/jmx/remote/util/EnvHelp.java",
"license": "apache-2.0",
"size": 28411
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,910,859 |
public void testSetAttachmentsSequentially() throws CouchbaseLiteException, IOException {
try {
//Create rev1 of document with just properties
Document doc = database.createDocument();
String id = doc.getId();
Map<String, Object> docProperties = new HashMap<S... | void function() throws CouchbaseLiteException, IOException { try { Document doc = database.createDocument(); String id = doc.getId(); Map<String, Object> docProperties = new HashMap<String, Object>(); docProperties.put(STR, 0); doc.putProperties(docProperties); UnsavedRevision rev = null; InputStream attachmentStream1 ... | /**
* attempt to reproduce https://github.com/couchbase/couchbase-lite-android/issues/328 &
* https://github.com/couchbase/couchbase-lite-android/issues/325
*/ | attempt to reproduce HREF & HREF | testSetAttachmentsSequentially | {
"repo_name": "gotmyjobs/couchbase-lite-android",
"path": "src/androidTest/java/com/couchbase/lite/DatabaseAttachmentTest.java",
"license": "apache-2.0",
"size": 43806
} | [
"com.couchbase.lite.util.Log",
"java.io.IOException",
"java.io.InputStream",
"java.util.HashMap",
"java.util.Map"
] | import com.couchbase.lite.util.Log; import java.io.IOException; import java.io.InputStream; import java.util.HashMap; import java.util.Map; | import com.couchbase.lite.util.*; import java.io.*; import java.util.*; | [
"com.couchbase.lite",
"java.io",
"java.util"
] | com.couchbase.lite; java.io; java.util; | 967,617 |
public void testVerifySetup() throws Exception {
assertSetEquals(getBaseLinks("/system/base"), links("/system/base", "/system/base"));
String additional = "XML_WEAK:/system/multibase/D4.html:/system/multibase/D4.html";
Set<String> expected = getMultiBaseLinks("/system/multibase");
... | void function() throws Exception { assertSetEquals(getBaseLinks(STR), links(STR, STR)); String additional = STR; Set<String> expected = getMultiBaseLinks(STR); expected.add(additional); assertSetEquals(expected, links(STR, STR)); } | /**
* Test to verify that the files under /system/base have been created correctly by the test setup (not really necessary,
* just to make sure that e.g. a faulty manifest.xml is not the cause of other test failures).
*
* @throws Exception
*/ | Test to verify that the files under /system/base have been created correctly by the test setup (not really necessary, just to make sure that e.g. a faulty manifest.xml is not the cause of other test failures) | testVerifySetup | {
"repo_name": "sbonoc/opencms-core",
"path": "test/org/opencms/file/TestLinkRewriter.java",
"license": "lgpl-2.1",
"size": 19165
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 1,651,347 |
public TextBuilder color(TextColor color) {
this.color = checkNotNull(color, "color");
return this;
} | TextBuilder function(TextColor color) { this.color = checkNotNull(color, "color"); return this; } | /**
* Sets the {@link TextColor} of this text.
*
* @param color The new text color for this text
* @return This text builder
* @see Text#getColor()
*/ | Sets the <code>TextColor</code> of this text | color | {
"repo_name": "nailed/nailed-api",
"path": "src/main/java/jk_5/nailed/api/text/TextBuilder.java",
"license": "mit",
"size": 33840
} | [
"com.google.common.base.Preconditions"
] | import com.google.common.base.Preconditions; | import com.google.common.base.*; | [
"com.google.common"
] | com.google.common; | 1,522,376 |
public Object[] getRelevantErrata(User loggedInUser, Integer sid) {
Server server = lookupServer(loggedInUser, sid);
DataResult<ErrataOverview> dr = SystemManager.relevantErrata(
loggedInUser, server.getId());
return dr.toArray();
} | Object[] function(User loggedInUser, Integer sid) { Server server = lookupServer(loggedInUser, sid); DataResult<ErrataOverview> dr = SystemManager.relevantErrata( loggedInUser, server.getId()); return dr.toArray(); } | /**
* Returns a list of all errata that are relevant to the system.
*
* @param loggedInUser The current user
* @param sid The id of the system in question
* @return Returns an array of maps representing the errata that can be applied
* @throws FaultException A FaultException is thrown if t... | Returns a list of all errata that are relevant to the system | getRelevantErrata | {
"repo_name": "jhutar/spacewalk",
"path": "java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java",
"license": "gpl-2.0",
"size": 241022
} | [
"com.redhat.rhn.common.db.datasource.DataResult",
"com.redhat.rhn.domain.server.Server",
"com.redhat.rhn.domain.user.User",
"com.redhat.rhn.frontend.dto.ErrataOverview",
"com.redhat.rhn.manager.system.SystemManager"
] | import com.redhat.rhn.common.db.datasource.DataResult; import com.redhat.rhn.domain.server.Server; import com.redhat.rhn.domain.user.User; import com.redhat.rhn.frontend.dto.ErrataOverview; import com.redhat.rhn.manager.system.SystemManager; | import com.redhat.rhn.common.db.datasource.*; import com.redhat.rhn.domain.server.*; import com.redhat.rhn.domain.user.*; import com.redhat.rhn.frontend.dto.*; import com.redhat.rhn.manager.system.*; | [
"com.redhat.rhn"
] | com.redhat.rhn; | 182,497 |
boolean addAllByteString(Collection<? extends ByteString> c); | boolean addAllByteString(Collection<? extends ByteString> c); | /**
* Appends all elements in the specified ByteString collection to the end of
* this list.
*
* @param c collection whose elements are to be added to this list
* @return true if this list changed as a result of the call
* @throws UnsupportedOperationException if the <tt>addAllByteString</tt>
* ... | Appends all elements in the specified ByteString collection to the end of this list | addAllByteString | {
"repo_name": "CPB9/mcc",
"path": "thirdparty/protobuf/java/src/main/java/com/google/protobuf/LazyStringList.java",
"license": "mpl-2.0",
"size": 6726
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 319,148 |
protected void findleaks(boolean statusLine, PrintWriter writer,
StringManager smClient) {
if (!(host instanceof StandardHost)) {
writer.println(smClient.getString("managerServlet.findleaksFail"));
return;
}
String[] results =
((StandardHost)... | void function(boolean statusLine, PrintWriter writer, StringManager smClient) { if (!(host instanceof StandardHost)) { writer.println(smClient.getString(STR)); return; } String[] results = ((StandardHost) host).findReloadedContextMemoryLeaks(); if (results.length > 0) { if (statusLine) { writer.println( smClient.getStr... | /**
* Find potential memory leaks caused by web application reload.
*/ | Find potential memory leaks caused by web application reload | findleaks | {
"repo_name": "plumer/codana",
"path": "tomcat_files/8.0.22/ManagerServlet.java",
"license": "mit",
"size": 61543
} | [
"java.io.PrintWriter",
"org.apache.catalina.core.StandardHost",
"org.apache.tomcat.util.res.StringManager"
] | import java.io.PrintWriter; import org.apache.catalina.core.StandardHost; import org.apache.tomcat.util.res.StringManager; | import java.io.*; import org.apache.catalina.core.*; import org.apache.tomcat.util.res.*; | [
"java.io",
"org.apache.catalina",
"org.apache.tomcat"
] | java.io; org.apache.catalina; org.apache.tomcat; | 120,200 |
@Test
public void testCreatedBuilderIsSpringProtototype() {
ModelVariablesBuilder builder = modelVariablesBuilderFactory.getObject();
ModelVariablesBuilder builder2 = modelVariablesBuilderFactory.getObject();
assertFalse(builder.hashCode() == builder2.hashCode());
}
| void function() { ModelVariablesBuilder builder = modelVariablesBuilderFactory.getObject(); ModelVariablesBuilder builder2 = modelVariablesBuilderFactory.getObject(); assertFalse(builder.hashCode() == builder2.hashCode()); } | /**
* Test that each created builder is a Spring prototype.
*/ | Test that each created builder is a Spring prototype | testCreatedBuilderIsSpringProtototype | {
"repo_name": "athrane/pineapple",
"path": "modules/pineapple-core/src/test/java/com/alpha/pineapple/substitution/variables/ModelVariablesBuilderFactoryIntegrationTest.java",
"license": "gpl-3.0",
"size": 2945
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 2,019,210 |
public static void showErrorInForm(String title, String message) {
showInForm(FacesMessage.SEVERITY_ERROR, title, message);
} | static void function(String title, String message) { showInForm(FacesMessage.SEVERITY_ERROR, title, message); } | /**
* Shows a message for the user in form
*
* @param title
* @param message
*/ | Shows a message for the user in form | showErrorInForm | {
"repo_name": "machadolucas/watchout",
"path": "src/main/java/com/riskvis/util/MessageUtils.java",
"license": "apache-2.0",
"size": 5442
} | [
"javax.faces.application.FacesMessage"
] | import javax.faces.application.FacesMessage; | import javax.faces.application.*; | [
"javax.faces"
] | javax.faces; | 200,158 |
protected BlockletIndex getBlockletIndexForDataFileFooter(List<BlockletIndex> blockletIndexList) {
BlockletIndex blockletIndex = new BlockletIndex();
BlockletBTreeIndex blockletBTreeIndex = new BlockletBTreeIndex();
blockletBTreeIndex.setStartKey(blockletIndexList.get(0).getBtreeIndex().getStartKey());
... | BlockletIndex function(List<BlockletIndex> blockletIndexList) { BlockletIndex blockletIndex = new BlockletIndex(); BlockletBTreeIndex blockletBTreeIndex = new BlockletBTreeIndex(); blockletBTreeIndex.setStartKey(blockletIndexList.get(0).getBtreeIndex().getStartKey()); blockletBTreeIndex .setEndKey(blockletIndexList.get... | /**
* Below method will be used to get blocklet index for data file meta
*
* @param blockletIndexList
* @return blocklet index
*/ | Below method will be used to get blocklet index for data file meta | getBlockletIndexForDataFileFooter | {
"repo_name": "HuaweiBigData/carbondata",
"path": "core/src/main/java/org/apache/carbondata/core/util/AbstractDataFileFooterConverter.java",
"license": "apache-2.0",
"size": 20053
} | [
"java.util.List",
"org.apache.carbondata.core.metadata.blocklet.index.BlockletBTreeIndex",
"org.apache.carbondata.core.metadata.blocklet.index.BlockletIndex",
"org.apache.carbondata.core.metadata.blocklet.index.BlockletMinMaxIndex"
] | import java.util.List; import org.apache.carbondata.core.metadata.blocklet.index.BlockletBTreeIndex; import org.apache.carbondata.core.metadata.blocklet.index.BlockletIndex; import org.apache.carbondata.core.metadata.blocklet.index.BlockletMinMaxIndex; | import java.util.*; import org.apache.carbondata.core.metadata.blocklet.index.*; | [
"java.util",
"org.apache.carbondata"
] | java.util; org.apache.carbondata; | 97,184 |
public void close()
{
myheader = null;
Iterator ii = directoryHashtable.keySet().iterator();
while( ii.hasNext() )
{
Storage s = (Storage) directoryHashtable.get( ii.next() );
s.close();
}
directoryHashtable = new Hashtable( 100, 0.9f );
for( Object aDirectoryVector : directoryVector )
{
... | void function() { myheader = null; Iterator ii = directoryHashtable.keySet().iterator(); while( ii.hasNext() ) { Storage s = (Storage) directoryHashtable.get( ii.next() ); s.close(); } directoryHashtable = new Hashtable( 100, 0.9f ); for( Object aDirectoryVector : directoryVector ) { Storage s = (Storage) aDirectoryVec... | /**
* clear out object references in prep for closing workbook
*/ | clear out object references in prep for closing workbook | close | {
"repo_name": "Maxels88/openxls",
"path": "src/main/java/org/openxls/formats/LEO/StorageTable.java",
"license": "gpl-3.0",
"size": 20752
} | [
"java.util.Hashtable",
"java.util.Iterator"
] | import java.util.Hashtable; import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 1,013,664 |
try (FileSystemManager fileSystemManager = new StandardFileSystemManager()) {
VFS.setManager(fileSystemManager);
VFS.setManager(null);
}
Assert.assertNotNull(VFS.getManager());
Assert.assertFalse(VFS.getManager().resolveFile(Paths.get("DoesNotExist.not").toUri()).exists()... | try (FileSystemManager fileSystemManager = new StandardFileSystemManager()) { VFS.setManager(fileSystemManager); VFS.setManager(null); } Assert.assertNotNull(VFS.getManager()); Assert.assertFalse(VFS.getManager().resolveFile(Paths.get(STR).toUri()).exists()); } | /**
* Tests {@link StandardFileSystemManager#close()}.
*
* @throws FileSystemException
*/ | Tests <code>StandardFileSystemManager#close()</code> | test_close | {
"repo_name": "ecki/commons-vfs",
"path": "commons-vfs2/src/test/java/org/apache/commons/vfs2/impl/StandardFileSystemManagerTest.java",
"license": "apache-2.0",
"size": 1698
} | [
"java.nio.file.Paths",
"org.apache.commons.vfs2.FileSystemManager",
"org.apache.commons.vfs2.VFS",
"org.junit.Assert"
] | import java.nio.file.Paths; import org.apache.commons.vfs2.FileSystemManager; import org.apache.commons.vfs2.VFS; import org.junit.Assert; | import java.nio.file.*; import org.apache.commons.vfs2.*; import org.junit.*; | [
"java.nio",
"org.apache.commons",
"org.junit"
] | java.nio; org.apache.commons; org.junit; | 2,444,969 |
boolean assign(final ServerName destination, final List<HRegionInfo> regions) {
long startTime = EnvironmentEdgeManager.currentTimeMillis();
try {
int regionCount = regions.size();
if (regionCount == 0) {
return true;
}
LOG.debug("Assigning " + regionCount + " region(s) to " + ... | boolean assign(final ServerName destination, final List<HRegionInfo> regions) { long startTime = EnvironmentEdgeManager.currentTimeMillis(); try { int regionCount = regions.size(); if (regionCount == 0) { return true; } LOG.debug(STR + regionCount + STR + destination.toString()); Set<String> encodedNames = new HashSet<... | /**
* Bulk assign regions to <code>destination</code>.
* @param destination
* @param regions Regions to assign.
* @return true if successful
*/ | Bulk assign regions to <code>destination</code> | assign | {
"repo_name": "Jackygq1982/hbase_src",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java",
"license": "apache-2.0",
"size": 167470
} | [
"java.io.IOException",
"java.util.ArrayList",
"java.util.HashMap",
"java.util.HashSet",
"java.util.List",
"java.util.Map",
"java.util.Set",
"java.util.concurrent.ConcurrentHashMap",
"java.util.concurrent.atomic.AtomicInteger",
"java.util.concurrent.locks.Lock",
"org.apache.hadoop.hbase.HRegionIn... | import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.locks.Lock; import o... | import java.io.*; import java.util.*; import java.util.concurrent.*; import java.util.concurrent.atomic.*; import java.util.concurrent.locks.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.ipc.*; import org.apache.hadoop.hbase.master.*; import org.apache.hadoop.hbase.master.balancer.*; import org.ap... | [
"java.io",
"java.util",
"org.apache.hadoop"
] | java.io; java.util; org.apache.hadoop; | 1,284,949 |
public static void surroundWithPois(double lat, double lon, ArpiGlController controller) {
controller.setCameraPosition(lat, lon);
double[] angles = {0d, Math.PI / 8, Math.PI / 4, 3 * Math.PI / 8, Math.PI / 2, 5 * Math.PI / 8, 3 * Math.PI / 4, 7* Math.PI / 8, Math.PI};
for (double angle :... | static void function(double lat, double lon, ArpiGlController controller) { controller.setCameraPosition(lat, lon); double[] angles = {0d, Math.PI / 8, Math.PI / 4, 3 * Math.PI / 8, Math.PI / 2, 5 * Math.PI / 8, 3 * Math.PI / 4, 7* Math.PI / 8, Math.PI}; for (double angle : angles) { createPoiForAngle(controller, lat, ... | /**
* Draw POIs around the current position.
* @param controller the ArpiGlController instance
*/ | Draw POIs around the current position | surroundWithPois | {
"repo_name": "e-biz/arpi-gl",
"path": "android/app/src/main/java/mobi/designmyapp/arpigl/demo/util/PoiUtils.java",
"license": "gpl-3.0",
"size": 3297
} | [
"mobi.designmyapp.arpigl.engine.ArpiGlController"
] | import mobi.designmyapp.arpigl.engine.ArpiGlController; | import mobi.designmyapp.arpigl.engine.*; | [
"mobi.designmyapp.arpigl"
] | mobi.designmyapp.arpigl; | 1,346,534 |
public void mapDatasetToAxis(int index, int axisIndex) {
List<Integer> axisIndices = new ArrayList<>(1);
axisIndices.add(axisIndex);
mapDatasetToAxes(index, axisIndices);
} | void function(int index, int axisIndex) { List<Integer> axisIndices = new ArrayList<>(1); axisIndices.add(axisIndex); mapDatasetToAxes(index, axisIndices); } | /**
* Maps a dataset to a particular axis. All data will be plotted
* against axis zero by default, no mapping is required for this case.
*
* @param index the dataset index (zero-based).
* @param axisIndex the axis index.
*/ | Maps a dataset to a particular axis. All data will be plotted against axis zero by default, no mapping is required for this case | mapDatasetToAxis | {
"repo_name": "jfree/jfreechart",
"path": "src/main/java/org/jfree/chart/plot/PolarPlot.java",
"license": "lgpl-2.1",
"size": 65051
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,817,801 |
void checkAttributesExists(PerunSession sess, List<? extends AttributeDefinition> attributes) throws InternalErrorException, AttributeNotExistsException; | void checkAttributesExists(PerunSession sess, List<? extends AttributeDefinition> attributes) throws InternalErrorException, AttributeNotExistsException; | /**
* Batch version of checkAttributeExists
*/ | Batch version of checkAttributeExists | checkAttributesExists | {
"repo_name": "Natrezim/perun",
"path": "perun-core/src/main/java/cz/metacentrum/perun/core/implApi/AttributesManagerImplApi.java",
"license": "bsd-2-clause",
"size": 104335
} | [
"cz.metacentrum.perun.core.api.AttributeDefinition",
"cz.metacentrum.perun.core.api.PerunSession",
"cz.metacentrum.perun.core.api.exceptions.AttributeNotExistsException",
"cz.metacentrum.perun.core.api.exceptions.InternalErrorException",
"java.util.List"
] | import cz.metacentrum.perun.core.api.AttributeDefinition; import cz.metacentrum.perun.core.api.PerunSession; import cz.metacentrum.perun.core.api.exceptions.AttributeNotExistsException; import cz.metacentrum.perun.core.api.exceptions.InternalErrorException; import java.util.List; | import cz.metacentrum.perun.core.api.*; import cz.metacentrum.perun.core.api.exceptions.*; import java.util.*; | [
"cz.metacentrum.perun",
"java.util"
] | cz.metacentrum.perun; java.util; | 961,783 |
private void loadDeployedRegions() throws IOException, InterruptedException {
// From the master, get a list of all known live region servers
Collection<ServerName> regionServers = status.getServers();
errors.print("Number of live region servers: " + regionServers.size());
if (details) {
for (Se... | void function() throws IOException, InterruptedException { Collection<ServerName> regionServers = status.getServers(); errors.print(STR + regionServers.size()); if (details) { for (ServerName rsinfo: regionServers) { errors.print(" " + rsinfo.getServerName()); } } Collection<ServerName> deadRegionServers = status.getDe... | /**
* Get deployed regions according to the region servers.
*/ | Get deployed regions according to the region servers | loadDeployedRegions | {
"repo_name": "zqxjjj/NobidaBase",
"path": "target/hbase-0.94.9/hbase-0.94.9/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java",
"license": "apache-2.0",
"size": 137112
} | [
"java.io.IOException",
"java.util.Collection",
"org.apache.hadoop.hbase.ServerName"
] | import java.io.IOException; import java.util.Collection; import org.apache.hadoop.hbase.ServerName; | import java.io.*; import java.util.*; import org.apache.hadoop.hbase.*; | [
"java.io",
"java.util",
"org.apache.hadoop"
] | java.io; java.util; org.apache.hadoop; | 2,609,017 |
public void setAccessControlAllowMethods(List<HttpMethod> allowedMethods) {
set(ACCESS_CONTROL_ALLOW_METHODS, StringUtils.collectionToCommaDelimitedString(allowedMethods));
} | void function(List<HttpMethod> allowedMethods) { set(ACCESS_CONTROL_ALLOW_METHODS, StringUtils.collectionToCommaDelimitedString(allowedMethods)); } | /**
* Set the (new) value of the {@code Access-Control-Allow-Methods} response header.
*/ | Set the (new) value of the Access-Control-Allow-Methods response header | setAccessControlAllowMethods | {
"repo_name": "lamsfoundation/lams",
"path": "3rdParty_sources/spring/org/springframework/http/HttpHeaders.java",
"license": "gpl-2.0",
"size": 44645
} | [
"java.util.List",
"org.springframework.util.StringUtils"
] | import java.util.List; import org.springframework.util.StringUtils; | import java.util.*; import org.springframework.util.*; | [
"java.util",
"org.springframework.util"
] | java.util; org.springframework.util; | 2,225,834 |
public static void remeasureLabels(LabelData[] labels, UIFontMetrics fm, int textAngle) {
float angle = 0;
int lineHeight = (int) Math.ceil(fm.getHeight());
UIDimension size = new UIDimension();
if (textAngle < 0) {
textAngle = 360 + textAngle;
}
boolean has90D... | static void function(LabelData[] labels, UIFontMetrics fm, int textAngle) { float angle = 0; int lineHeight = (int) Math.ceil(fm.getHeight()); UIDimension size = new UIDimension(); if (textAngle < 0) { textAngle = 360 + textAngle; } boolean has90Degree = (textAngle == 90) (textAngle == -90) (textAngle == 270); boolean ... | /**
* Re-measures the specified labels
*
* @param labels
* the labels to measure
* @param fm
* the font metrics to use toe measure them
* @param textAngle
* the text angle
*/ | Re-measures the specified labels | remeasureLabels | {
"repo_name": "appnativa/rare",
"path": "source/rare/core-charts/com/appnativa/rare/ui/chart/aChartHandler.java",
"license": "gpl-3.0",
"size": 67598
} | [
"com.appnativa.rare.ui.UIDimension",
"com.appnativa.rare.ui.UIFontMetrics"
] | import com.appnativa.rare.ui.UIDimension; import com.appnativa.rare.ui.UIFontMetrics; | import com.appnativa.rare.ui.*; | [
"com.appnativa.rare"
] | com.appnativa.rare; | 437,238 |
public void printItemsets(int nbObject) {
System.out.println(" ------- " + name + " -------");
int patternCount = 0;
int levelCount = 0;
// for each level (a level is a set of itemsets having the same number of items)
for (List<Itemset> level : levels) {
// print how many items are contained in this lev... | void function(int nbObject) { System.out.println(STR + name + STR); int patternCount = 0; int levelCount = 0; for (List<Itemset> level : levels) { System.out.println(STR + levelCount + " "); for (Itemset itemset : level) { System.out.print(STR + patternCount + STR); itemset.print(); System.out.print(STR + itemset.get(n... | /**
* Print all itemsets to System.out, ordered by their size.
* @param nbObject The number of transaction/sequence in the database where
* there itemsets were found.
*/ | Print all itemsets to System.out, ordered by their size | printItemsets | {
"repo_name": "YinYanfei/CadalWorkspace",
"path": "CadalRec/src/cn/cadal/rec/dm/patterns/itemset_list_integers_with_count/Itemsets.java",
"license": "gpl-3.0",
"size": 3278
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,142,209 |
@Generated
@Selector("stackedLayoutAppearance")
public native UITabBarItemAppearance stackedLayoutAppearance(); | @Selector(STR) native UITabBarItemAppearance function(); | /**
* The appearance for the stacked tab bar item layout
*/ | The appearance for the stacked tab bar item layout | stackedLayoutAppearance | {
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/uikit/UITabBarAppearance.java",
"license": "apache-2.0",
"size": 9371
} | [
"org.moe.natj.objc.ann.Selector"
] | import org.moe.natj.objc.ann.Selector; | import org.moe.natj.objc.ann.*; | [
"org.moe.natj"
] | org.moe.natj; | 1,456,903 |
protected Variable[] getVariables(VerificationFormula vf) {
if (vf==null) return new Variable[2];
Variable[] variables = new Variable[2];
variables[0] = getVariableForAssertion(vf.getPreAssertion(TextStyle.SHORT));
variables[1] = getVariableForAssertion(vf.getPostAssertion(TextStyle.SHORT));
return v... | Variable[] function(VerificationFormula vf) { if (vf==null) return new Variable[2]; Variable[] variables = new Variable[2]; variables[0] = getVariableForAssertion(vf.getPreAssertion(TextStyle.SHORT)); variables[1] = getVariableForAssertion(vf.getPostAssertion(TextStyle.SHORT)); return variables; } | /**
* Returns the two variables belonging to the specified <code>VerifictaionFormula</code>.
* @param vf the <code>VerificationFormula</code>
* @return an array variables with variables[0] being the variable of the pre assertion and variables[1] being the variable of the post assertion of the specified <code>Veri... | Returns the two variables belonging to the specified <code>VerifictaionFormula</code> | getVariables | {
"repo_name": "jurkov/j-algo-mod",
"path": "src/org/jalgo/module/hoare/view/View.java",
"license": "gpl-2.0",
"size": 32171
} | [
"org.jalgo.module.hoare.constants.TextStyle",
"org.jalgo.module.hoare.model.Variable",
"org.jalgo.module.hoare.model.VerificationFormula"
] | import org.jalgo.module.hoare.constants.TextStyle; import org.jalgo.module.hoare.model.Variable; import org.jalgo.module.hoare.model.VerificationFormula; | import org.jalgo.module.hoare.constants.*; import org.jalgo.module.hoare.model.*; | [
"org.jalgo.module"
] | org.jalgo.module; | 1,245,105 |
protected Object readResolve() throws ObjectStreamException {
return prj.executorService();
} | Object function() throws ObjectStreamException { return prj.executorService(); } | /**
* Reconstructs object on unmarshalling.
*
* @return Reconstructed object.
* @throws ObjectStreamException Thrown in case of unmarshalling error.
*/ | Reconstructs object on unmarshalling | readResolve | {
"repo_name": "irudyak/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/executor/GridExecutorService.java",
"license": "apache-2.0",
"size": 23673
} | [
"java.io.ObjectStreamException"
] | import java.io.ObjectStreamException; | import java.io.*; | [
"java.io"
] | java.io; | 651,157 |
public Operator getContainerOperator(){
return item.getContainerOperator();
}
| Operator function(){ return item.getContainerOperator(); } | /**
* Return the encapsulate Low Level API object.
*/ | Return the encapsulate Low Level API object | getContainerOperator | {
"repo_name": "lhillah/pnmlframework",
"path": "pnmlFw-SNNet/src/fr/lip6/move/pnml/symmetricnet/integers/hlapi/AdditionHLAPI.java",
"license": "epl-1.0",
"size": 89787
} | [
"fr.lip6.move.pnml.symmetricnet.terms.Operator"
] | import fr.lip6.move.pnml.symmetricnet.terms.Operator; | import fr.lip6.move.pnml.symmetricnet.terms.*; | [
"fr.lip6.move"
] | fr.lip6.move; | 1,691,062 |
public void close() throws IOException {
// unregister from observations
try {
this.support.getSession().getWorkspace().getObservationManager().removeEventListener(this);
} catch (RepositoryException e) {
logger.warn("Unable to remove session listener: " + this, e);
... | void function() throws IOException { try { this.support.getSession().getWorkspace().getObservationManager().removeEventListener(this); } catch (RepositoryException e) { logger.warn(STR + this, e); } this.osgiEventQueue.clear(); this.osgiEventQueue.offer(TERMINATE_PROCESSING); this.support.dispose(); } | /**
* Dispose this listener.
*/ | Dispose this listener | close | {
"repo_name": "MRivas-XumaK/slingBuild",
"path": "bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceListener.java",
"license": "apache-2.0",
"size": 16708
} | [
"java.io.IOException",
"javax.jcr.RepositoryException"
] | import java.io.IOException; import javax.jcr.RepositoryException; | import java.io.*; import javax.jcr.*; | [
"java.io",
"javax.jcr"
] | java.io; javax.jcr; | 1,860,235 |
public Iterator getIncludeEventHandlers()
{
return includeHandlers.iterator();
}
| Iterator function() { return includeHandlers.iterator(); } | /**
* Iterate through all the stored IncludeEventHandlers objects
*
* @return iterator of handler objects
*/ | Iterate through all the stored IncludeEventHandlers objects | getIncludeEventHandlers | {
"repo_name": "VISTALL/apache.velocity-engine",
"path": "velocity-engine-core/src/main/java/org/apache/velocity/app/event/EventCartridge.java",
"license": "apache-2.0",
"size": 10509
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 599,732 |
MultipleFailureResult.of(Arrays.asList(FAILURE_1));
} | MultipleFailureResult.of(Arrays.asList(FAILURE_1)); } | /**
* Tests that multiple failures are required.
*/ | Tests that multiple failures are required | testMultiple | {
"repo_name": "McLeodMoores/starling",
"path": "projects/util/src/test/java/com/opengamma/util/result/MultipleFailureResultTest.java",
"license": "apache-2.0",
"size": 2881
} | [
"java.util.Arrays"
] | import java.util.Arrays; | import java.util.*; | [
"java.util"
] | java.util; | 2,596,554 |
public void setBlankBeam( final boolean mode ) throws ConnectionException, PutException {
final Channel blankBeamChannel = getAndConnectChannel( BLANK_BEAM_HANDLE );
if ( blankBeamChannel != null ) {
blankBeamChannel.putVal( mode ? 1 : 0 );
}
else {
throw new ... | void function( final boolean mode ) throws ConnectionException, PutException { final Channel blankBeamChannel = getAndConnectChannel( BLANK_BEAM_HANDLE ); if ( blankBeamChannel != null ) { blankBeamChannel.putVal( mode ? 1 : 0 ); } else { throw new RuntimeException( STR + getId() + STR ); } } public Collection<RfGap> g... | /**
* Blank the beam
* @param mode true to blank the beam and false for continuous on
*/ | Blank the beam | setBlankBeam | {
"repo_name": "EuropeanSpallationSource/openxal",
"path": "core/src/main/java/xal/smf/impl/RfCavity.java",
"license": "bsd-3-clause",
"size": 19068
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 2,730,123 |
public boolean isCanDelete() {
return OpenCms.getWorkplaceManager().getDefaultUserSettings().isAllowBrokenRelations()
|| OpenCms.getRoleManager().hasRole(getCms(), CmsRole.VFS_MANAGER);
} | boolean function() { return OpenCms.getWorkplaceManager().getDefaultUserSettings().isAllowBrokenRelations() OpenCms.getRoleManager().hasRole(getCms(), CmsRole.VFS_MANAGER); } | /**
* Returns <code>true</code> if the current user is allowed
* to delete the selected resources.<p>
*
* @return <code>true</code> if the current user is allowed
* to delete the selected resources
*/ | Returns <code>true</code> if the current user is allowed to delete the selected resources | isCanDelete | {
"repo_name": "ggiudetti/opencms-core",
"path": "src-modules/org/opencms/workplace/commons/CmsDelete.java",
"license": "lgpl-2.1",
"size": 15384
} | [
"org.opencms.main.OpenCms",
"org.opencms.security.CmsRole"
] | import org.opencms.main.OpenCms; import org.opencms.security.CmsRole; | import org.opencms.main.*; import org.opencms.security.*; | [
"org.opencms.main",
"org.opencms.security"
] | org.opencms.main; org.opencms.security; | 1,305,413 |
public static void unwatch(Thread thread, Runnable task) {
schedule(ObjectUtil.checkNotNull(thread, "thread"),
ObjectUtil.checkNotNull(task, "task"),
false);
} | static void function(Thread thread, Runnable task) { schedule(ObjectUtil.checkNotNull(thread, STR), ObjectUtil.checkNotNull(task, "task"), false); } | /**
* Cancels the task scheduled via {@link #watch(Thread, Runnable)}.
*/ | Cancels the task scheduled via <code>#watch(Thread, Runnable)</code> | unwatch | {
"repo_name": "fenik17/netty",
"path": "common/src/main/java/io/netty/util/ThreadDeathWatcher.java",
"license": "apache-2.0",
"size": 10067
} | [
"io.netty.util.internal.ObjectUtil"
] | import io.netty.util.internal.ObjectUtil; | import io.netty.util.internal.*; | [
"io.netty.util"
] | io.netty.util; | 1,430,260 |
@Override
protected final void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
| final void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } | /**
* Delegate POST requests to {@link #processRequest}.
* @see #doService
*/ | Delegate POST requests to <code>#processRequest</code> | doPost | {
"repo_name": "bbossgroups/bbossgroups-3.5",
"path": "bboss-mvc/src/org/frameworkset/web/servlet/BaseServlet.java",
"license": "apache-2.0",
"size": 15276
} | [
"java.io.IOException",
"javax.servlet.ServletException",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse"
] | import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; | import java.io.*; import javax.servlet.*; import javax.servlet.http.*; | [
"java.io",
"javax.servlet"
] | java.io; javax.servlet; | 2,365,260 |
@WebMethod(operationName = "GetCustomerProfileIds", action = "https://api.authorize.net/soap/v1/GetCustomerProfileIds")
@WebResult(name = "GetCustomerProfileIdsResult", targetNamespace = "https://api.authorize.net/soap/v1/")
@RequestWrapper(localName = "GetCustomerProfileIds", targetNamespace = "https://a... | @WebMethod(operationName = STR, action = STRGetCustomerProfileIdsResultSTRhttps: @RequestWrapper(localName = STR, targetNamespace = STRGetCustomerProfileIdsResponseSTRhttps: GetCustomerProfileIdsResponseType function( @WebParam(name = "merchantAuthenticationSTRhttps: MerchantAuthenticationType merchantAuthentication); | /**
* This method is used to retrieve a list of profile identifiers. The merchant must be signed up for the CIM service to use it.
*
* @param merchantAuthentication
* @return
* returns net.authorize.GetCustomerProfileIdsResponseType
*/ | This method is used to retrieve a list of profile identifiers. The merchant must be signed up for the CIM service to use it | getCustomerProfileIds | {
"repo_name": "setrar/scalaWSDL",
"path": "src/main/java/net/authorize/ServiceSoap.java",
"license": "apache-2.0",
"size": 42168
} | [
"javax.jws.WebMethod",
"javax.jws.WebParam",
"javax.xml.ws.RequestWrapper"
] | import javax.jws.WebMethod; import javax.jws.WebParam; import javax.xml.ws.RequestWrapper; | import javax.jws.*; import javax.xml.ws.*; | [
"javax.jws",
"javax.xml"
] | javax.jws; javax.xml; | 2,139,185 |
public Inventory getInventory() {
List<TagMetadata.Tag> themes =
mTagMetadata.getTagsInCategory(Config.Tags.CATEGORY_THEME);
Inventory inventory = new Inventory();
InventoryGroup themeGroup = new InventoryGroup(GROUP_TOPIC_TYPE_OR_THEME)
... | Inventory function() { List<TagMetadata.Tag> themes = mTagMetadata.getTagsInCategory(Config.Tags.CATEGORY_THEME); Inventory inventory = new Inventory(); InventoryGroup themeGroup = new InventoryGroup(GROUP_TOPIC_TYPE_OR_THEME) .setDisplayCols(1) .setDataIndexStart(0) .setShowHeader(false); if (themes != null && themes.... | /**
* Returns a new instance of {@link Inventory}. It always contains three
* {@link InventoryGroup} groups.
* <ul>
* <li>Themes group containing themes such as Develop, Distribute etc.</li>
* <li>Types group containing tags for all types of sessions, codelabs etc.</... | Returns a new instance of <code>Inventory</code>. It always contains three <code>InventoryGroup</code> groups. Themes group containing themes such as Develop, Distribute etc. Types group containing tags for all types of sessions, codelabs etc. Topics group containing tags for specific topics such as Android, Cloud etc. | getInventory | {
"repo_name": "ben-upsilon/iosched",
"path": "android/src/main/java/com/google/samples/apps/iosched/explore/ExploreSessionsActivity.java",
"license": "apache-2.0",
"size": 20865
} | [
"com.google.samples.apps.iosched.Config",
"com.google.samples.apps.iosched.model.TagMetadata",
"com.google.samples.apps.iosched.ui.widget.CollectionView",
"java.util.List"
] | import com.google.samples.apps.iosched.Config; import com.google.samples.apps.iosched.model.TagMetadata; import com.google.samples.apps.iosched.ui.widget.CollectionView; import java.util.List; | import com.google.samples.apps.iosched.*; import com.google.samples.apps.iosched.model.*; import com.google.samples.apps.iosched.ui.widget.*; import java.util.*; | [
"com.google.samples",
"java.util"
] | com.google.samples; java.util; | 2,548,650 |
public boolean matches(Issue issue); | boolean function(Issue issue); | /**
* Matches this property matcher against the given issue.
*
* @param issue
* the issue to match against
* @return <code>true</code> if this property matcher matches the given issue and <code>false</code> otherwise
*/ | Matches this property matcher against the given issue | matches | {
"repo_name": "lbeurerkellner/n4js",
"path": "testhelpers/org.eclipse.n4js.tests.helper/src/org/eclipse/n4js/tests/issues/IssuePropertyMatcher.java",
"license": "epl-1.0",
"size": 1238
} | [
"org.eclipse.xtext.validation.Issue"
] | import org.eclipse.xtext.validation.Issue; | import org.eclipse.xtext.validation.*; | [
"org.eclipse.xtext"
] | org.eclipse.xtext; | 1,608,578 |
public List<SummarySignalDefinition> selectAllByPriority(String dataBaseName)
throws SQLException
{
List<SummarySignalDefinition> result = new ArrayList<SummarySignalDefinition>();
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
String... | List<SummarySignalDefinition> function(String dataBaseName) throws SQLException { List<SummarySignalDefinition> result = new ArrayList<SummarySignalDefinition>(); Connection conn = null; Statement stmt = null; ResultSet rs = null; String summarySignal; try { conn = getConnection(dataBaseName, false); stmt = conn.create... | /**
* Get the SummarySignalDefinition List by ordering the priority.<br/>
*
* @param dataBaseName データベース名
* @return SummarySignalDefinitionのリスト
* @throws SQLException SQL 実行時に例外が発生した場合
*/ | Get the SummarySignalDefinition List by ordering the priority | selectAllByPriority | {
"repo_name": "ryokato/ENdoSnipe",
"path": "ENdoSnipeDataAccessor/src/main/java/jp/co/acroquest/endosnipe/data/dao/SummarySignalDefinitionDao.java",
"license": "mit",
"size": 17082
} | [
"java.sql.Connection",
"java.sql.ResultSet",
"java.sql.SQLException",
"java.sql.Statement",
"java.util.ArrayList",
"java.util.List",
"jp.co.acroquest.endosnipe.common.util.SQLUtil",
"jp.co.acroquest.endosnipe.data.entity.SummarySignalDefinition"
] | import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import java.util.List; import jp.co.acroquest.endosnipe.common.util.SQLUtil; import jp.co.acroquest.endosnipe.data.entity.SummarySignalDefinition; | import java.sql.*; import java.util.*; import jp.co.acroquest.endosnipe.common.util.*; import jp.co.acroquest.endosnipe.data.entity.*; | [
"java.sql",
"java.util",
"jp.co.acroquest"
] | java.sql; java.util; jp.co.acroquest; | 2,808,636 |
public void setEnabled(boolean b) {
super.setEnabled(b);
super.setFocusable(b);
statusLog.logIt(ScrollingLogPane.SHOW_TRACE, "Button " + getText()
+ " setting enabled to " + b);
Color foreground = (Color) UIManager.get("Button.foreground");
if (b) {
setForeground(foreground);
} else {
... | void function(boolean b) { super.setEnabled(b); super.setFocusable(b); statusLog.logIt(ScrollingLogPane.SHOW_TRACE, STR + getText() + STR + b); Color foreground = (Color) UIManager.get(STR); if (b) { setForeground(foreground); } else { setForeground(Colors.getInverse(foreground)); } } | /**
* Enables (or disables) the button.
*
* @param b
* true to enable the button, otherwise false
*/ | Enables (or disables) the button | setEnabled | {
"repo_name": "avatar42/MyMonitor",
"path": "src/main/java/dea/monitor/gui/CheckButton.java",
"license": "apache-2.0",
"size": 22173
} | [
"java.awt.Color",
"javax.swing.UIManager"
] | import java.awt.Color; import javax.swing.UIManager; | import java.awt.*; import javax.swing.*; | [
"java.awt",
"javax.swing"
] | java.awt; javax.swing; | 141,761 |
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<CsmOperationDescriptionInner> listOperations(); | @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable<CsmOperationDescriptionInner> listOperations(); | /**
* Description for Implements Csm operations Api to exposes the list of available Csm Apis under the resource
* provider.
*
* @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is
* rejected by server.
* @throws RuntimeExcept... | Description for Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider | listOperations | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/CertificateRegistrationProvidersClient.java",
"license": "mit",
"size": 2661
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.PagedIterable",
"com.azure.resourcemanager.appservice.fluent.models.CsmOperationDescriptionInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.resourcemanager.appservice.fluent.models.CsmOperationDescriptionInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.resourcemanager.appservice.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 2,692,145 |
@Test
public void canPushFrameDebugTargetConnnected() {
final DebugTarget target = DebugPackage.eINSTANCE.getDebugFactory().createDebugTarget();
target.setContext(DebugPackage.eINSTANCE.getDebugFactory().createVariable());
target.setName("target");
target.setState(DebugTargetState.CONNECTED);
createThread... | void function() { final DebugTarget target = DebugPackage.eINSTANCE.getDebugFactory().createDebugTarget(); target.setContext(DebugPackage.eINSTANCE.getDebugFactory().createVariable()); target.setName(STR); target.setState(DebugTargetState.CONNECTED); createThreads(target); assertEquals(false, ThreadUtils.canPushFrame(t... | /**
* Tests {@link ThreadUtils#canPushFrame(Thread)} in {@link DebugTargetState#CONNECTED}.
*/ | Tests <code>ThreadUtils#canPushFrame(Thread)</code> in <code>DebugTargetState#CONNECTED</code> | canPushFrameDebugTargetConnnected | {
"repo_name": "SiriusLab/SiriusAnimator",
"path": "simulationmodelanimation/tests/org.eclipse.gemoc.dsl.debug.tests/src/org/eclipse/gemoc/dsl/debug/tests/ThreadUtilsTests.java",
"license": "epl-1.0",
"size": 179513
} | [
"org.eclipse.gemoc.dsl.debug.DebugPackage",
"org.eclipse.gemoc.dsl.debug.DebugTarget",
"org.eclipse.gemoc.dsl.debug.DebugTargetState",
"org.eclipse.gemoc.dsl.debug.ThreadUtils",
"org.junit.Assert"
] | import org.eclipse.gemoc.dsl.debug.DebugPackage; import org.eclipse.gemoc.dsl.debug.DebugTarget; import org.eclipse.gemoc.dsl.debug.DebugTargetState; import org.eclipse.gemoc.dsl.debug.ThreadUtils; import org.junit.Assert; | import org.eclipse.gemoc.dsl.debug.*; import org.junit.*; | [
"org.eclipse.gemoc",
"org.junit"
] | org.eclipse.gemoc; org.junit; | 1,920,688 |
public int hashCode() {
int total = 0;
Iterator it = createEntrySetIterator();
while (it.hasNext()) {
total += it.next().hashCode();
}
return total;
} | int function() { int total = 0; Iterator it = createEntrySetIterator(); while (it.hasNext()) { total += it.next().hashCode(); } return total; } | /**
* Gets the standard Map hashCode.
*
* @return the hash code defined in the Map interface
*/ | Gets the standard Map hashCode | hashCode | {
"repo_name": "samuelhehe/androidpn_enhanced_client",
"path": "asmack/org/jivesoftware/smack/util/collections/AbstractHashedMap.java",
"license": "apache-2.0",
"size": 44000
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 2,847,777 |
public Element toXml(Document doc, Stack stack)
{
Element resource = doc.createElement("resource");
if (stack.isEmpty())
{
doc.appendChild(resource);
}
else
{
((Element) stack.peek()).appendChild(resource);
}
stack.push(resource);
resource.setAttribute("id", m_id);
resour... | Element function(Document doc, Stack stack) { Element resource = doc.createElement(STR); if (stack.isEmpty()) { doc.appendChild(resource); } else { ((Element) stack.peek()).appendChild(resource); } stack.push(resource); resource.setAttribute("id", m_id); resource.setAttribute(STR, m_contentType); resource.setAttribute(... | /**
* Serialize the resource into XML, adding an element to the doc under the top of the stack element.
*
* @param doc
* The DOM doc to contain the XML (or null for a string return).
* @param stack
* The DOM elements, the top of which is the containing element of the new "resource" elem... | Serialize the resource into XML, adding an element to the doc under the top of the stack element | toXml | {
"repo_name": "marktriggs/nyu-sakai-10.4",
"path": "kernel/kernel-impl/src/main/java/org/sakaiproject/content/impl/BaseContentService.java",
"license": "apache-2.0",
"size": 426240
} | [
"java.io.UnsupportedEncodingException",
"java.util.Iterator",
"java.util.Stack",
"org.apache.commons.codec.binary.Base64",
"org.sakaiproject.content.api.GroupAwareEntity",
"org.w3c.dom.Document",
"org.w3c.dom.Element"
] | import java.io.UnsupportedEncodingException; import java.util.Iterator; import java.util.Stack; import org.apache.commons.codec.binary.Base64; import org.sakaiproject.content.api.GroupAwareEntity; import org.w3c.dom.Document; import org.w3c.dom.Element; | import java.io.*; import java.util.*; import org.apache.commons.codec.binary.*; import org.sakaiproject.content.api.*; import org.w3c.dom.*; | [
"java.io",
"java.util",
"org.apache.commons",
"org.sakaiproject.content",
"org.w3c.dom"
] | java.io; java.util; org.apache.commons; org.sakaiproject.content; org.w3c.dom; | 2,109,341 |
private void createTestDatabase() throws Exception {
String dialect = defaultDatabase.getSupportedDatabaseDialect();
if ("hsqldb".equals(dialect)) {
createTestDatabaseHsqlDb();
} else if ("mysql".equals(dialect)) {
createTestDatabaseMySql();
} else if ("... | void function() throws Exception { String dialect = defaultDatabase.getSupportedDatabaseDialect(); if (STR.equals(dialect)) { createTestDatabaseHsqlDb(); } else if ("mysql".equals(dialect)) { createTestDatabaseMySql(); } else if (STR.equals(dialect)) { createTestDatabaseOracle(); } else if (STR.equals(dialect)) { creat... | /**
* Creates all test database structures (view, tables...)
*/ | Creates all test database structures (view, tables...) | createTestDatabase | {
"repo_name": "intouchfollowup/dbmaintain",
"path": "dbmaintain/src/test/java/org/dbmaintain/structure/SequenceUpdaterTest.java",
"license": "apache-2.0",
"size": 14056
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 132,129 |
PredicateDecisionNode<Integer> pdn1 = new PredicateDecisionNode<>(null, pred1);
Assert.assertEquals(String.format("< %s", TestData.split1), pdn1.toString());
PredicateDecisionNode<String> pdn2 = new PredicateDecisionNode<>(null, pred2);
Assert.assertEquals(String.format(">= %s", TestData.split2)... | PredicateDecisionNode<Integer> pdn1 = new PredicateDecisionNode<>(null, pred1); Assert.assertEquals(String.format(STR, TestData.split1), pdn1.toString()); PredicateDecisionNode<String> pdn2 = new PredicateDecisionNode<>(null, pred2); Assert.assertEquals(String.format(STR, TestData.split2), pdn2.toString()); } | /**
* Test of toString method, of class PredicateDecisionNode.
*/ | Test of toString method, of class PredicateDecisionNode | testToString | {
"repo_name": "KommuSoft/jahmm",
"path": "jahmm/test/jahmm/jadetree/PredicateDecisionNodeTest.java",
"license": "bsd-3-clause",
"size": 3011
} | [
"junit.framework.Assert"
] | import junit.framework.Assert; | import junit.framework.*; | [
"junit.framework"
] | junit.framework; | 629,721 |
public static <TSource, TKey> Enumerable<Grouping<TKey, TSource>> groupBy(
final Enumerable<TSource> enumerable,
final Function1<TSource, TKey> keySelector) {
return enumerable.toLookup(keySelector);
} | static <TSource, TKey> Enumerable<Grouping<TKey, TSource>> function( final Enumerable<TSource> enumerable, final Function1<TSource, TKey> keySelector) { return enumerable.toLookup(keySelector); } | /**
* Groups the elements of a sequence according to a
* specified key selector function.
*/ | Groups the elements of a sequence according to a specified key selector function | groupBy | {
"repo_name": "vlsi/calcite",
"path": "linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableDefaults.java",
"license": "apache-2.0",
"size": 156877
} | [
"org.apache.calcite.linq4j.function.Function1"
] | import org.apache.calcite.linq4j.function.Function1; | import org.apache.calcite.linq4j.function.*; | [
"org.apache.calcite"
] | org.apache.calcite; | 2,853,218 |
public void setAssignedSiteUserCollection(Collection<User> assignedSiteUserCollection){
this.assignedSiteUserCollection = assignedSiteUserCollection;
}
| void function(Collection<User> assignedSiteUserCollection){ this.assignedSiteUserCollection = assignedSiteUserCollection; } | /**
* Sets the value of assignedSiteUserCollection attribute
**/ | Sets the value of assignedSiteUserCollection attribute | setAssignedSiteUserCollection | {
"repo_name": "NCIP/catissue-core",
"path": "software/caTissue/modules/core/src/main/java/edu/wustl/catissuecore/domain/Site.java",
"license": "bsd-3-clause",
"size": 7975
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 1,135,539 |
void getBytes(int index, ByteBuffer dstBuffer, int length); | void getBytes(int index, ByteBuffer dstBuffer, int length); | /**
* Get from the underlying buffer into a supplied {@link ByteBuffer} current {@link ByteBuffer#position()}.
* <p>
* The destination buffer will have its {@link ByteBuffer#position()} advanced as a result.
*
* @param index in the underlying buffer to start from.
* @param dstBuffer in... | Get from the underlying buffer into a supplied <code>ByteBuffer</code> current <code>ByteBuffer#position()</code>. The destination buffer will have its <code>ByteBuffer#position()</code> advanced as a result | getBytes | {
"repo_name": "tbrooks8/Agrona",
"path": "agrona/src/main/java/org/agrona/DirectBuffer.java",
"license": "apache-2.0",
"size": 14061
} | [
"java.nio.ByteBuffer"
] | import java.nio.ByteBuffer; | import java.nio.*; | [
"java.nio"
] | java.nio; | 627,233 |
public Serializable getStylesheetCacheKey(Resource stylesheet)
throws TransformerConfigurationException, IOException; | Serializable function(Resource stylesheet) throws TransformerConfigurationException, IOException; | /**
* Gets an appropriate cache key for the specified stylesheet resource. The key should be valid
* for both {@link Transformer}s and {@link Templates} based on this stylesheet.
*/ | Gets an appropriate cache key for the specified stylesheet resource. The key should be valid for both <code>Transformer</code>s and <code>Templates</code> based on this stylesheet | getStylesheetCacheKey | {
"repo_name": "jl1955/uPortal5",
"path": "uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/xml/XmlUtilities.java",
"license": "apache-2.0",
"size": 3601
} | [
"java.io.IOException",
"java.io.Serializable",
"javax.xml.transform.TransformerConfigurationException",
"org.springframework.core.io.Resource"
] | import java.io.IOException; import java.io.Serializable; import javax.xml.transform.TransformerConfigurationException; import org.springframework.core.io.Resource; | import java.io.*; import javax.xml.transform.*; import org.springframework.core.io.*; | [
"java.io",
"javax.xml",
"org.springframework.core"
] | java.io; javax.xml; org.springframework.core; | 2,343,008 |
public MultipartRequest addImage(String name, Bitmap bitmap, CompressFormat compressFormat, int quality, String cacheFileName) {
if (bitmap != null) {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
bitmap.compress(compressFormat, quality, bos);
byte[] imagedata = bos.toByte... | MultipartRequest function(String name, Bitmap bitmap, CompressFormat compressFormat, int quality, String cacheFileName) { if (bitmap != null) { ByteArrayOutputStream bos = new ByteArrayOutputStream(); bitmap.compress(compressFormat, quality, bos); byte[] imagedata = bos.toByteArray(); builder.addBinaryBody(name, imaged... | /**
* Add Bitmap to request as compressed image.
*
* @param name
* @param bitmap
* @param compressFormat
* @param quality
* @param cacheFileName
* @return
*/ | Add Bitmap to request as compressed image | addImage | {
"repo_name": "0359xiaodong/android-tao-rest-data-processor",
"path": "src/ua/at/tsvetkov/data_processor/requests/MultipartRequest.java",
"license": "bsd-3-clause",
"size": 11214
} | [
"android.graphics.Bitmap",
"java.io.ByteArrayOutputStream",
"org.apache.http.entity.ContentType"
] | import android.graphics.Bitmap; import java.io.ByteArrayOutputStream; import org.apache.http.entity.ContentType; | import android.graphics.*; import java.io.*; import org.apache.http.entity.*; | [
"android.graphics",
"java.io",
"org.apache.http"
] | android.graphics; java.io; org.apache.http; | 2,072,361 |
public void dump ()
{
if (CLogMgt.isLevelFinest())
{
log.finer(get_WhereClause (true));
for (int i = 0; i < get_ColumnCount (); i++)
dump (i);
}
} // dump | void function () { if (CLogMgt.isLevelFinest()) { log.finer(get_WhereClause (true)); for (int i = 0; i < get_ColumnCount (); i++) dump (i); } } | /**************************************************************************
* Dump Record
*/ | Dump Record | dump | {
"repo_name": "erpcya/adempierePOS",
"path": "base/src/org/compiere/model/PO.java",
"license": "gpl-2.0",
"size": 109913
} | [
"org.compiere.util.CLogMgt"
] | import org.compiere.util.CLogMgt; | import org.compiere.util.*; | [
"org.compiere.util"
] | org.compiere.util; | 1,298,744 |
private String getConcatSql(List<String> values) {
if (values.size() == 1) {
return values.get(0);
} else {
return START_CONCAT + values.get(0) + SEP_CONCAT + getConcatSql(values.subList(1, values.size())) + END_CONCAT;
}
} | String function(List<String> values) { if (values.size() == 1) { return values.get(0); } else { return START_CONCAT + values.get(0) + SEP_CONCAT + getConcatSql(values.subList(1, values.size())) + END_CONCAT; } } | /**
* Recursive way of building CONCAT instruction
*
* @param values a non null List of String
* @return a String containing the CONCAT instruction with all elements, or only a value if there is only one element in the list
*/ | Recursive way of building CONCAT instruction | getConcatSql | {
"repo_name": "dyk/liquibase",
"path": "liquibase-core/src/main/java/liquibase/database/core/HsqlDatabase.java",
"license": "apache-2.0",
"size": 13790
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,237,689 |
@Test
public void testValidateEmrClusterDefinitionConfigurationMasterSpotPriceAndMaxSearchPriceSpecified()
{
EmrClusterDefinition emrClusterDefinition = createValidEmrClusterDefinition();
emrClusterDefinition.getInstanceDefinitions().getMasterInstances().setInstanceSpotPrice(BigDecimal.ONE);... | void function() { EmrClusterDefinition emrClusterDefinition = createValidEmrClusterDefinition(); emrClusterDefinition.getInstanceDefinitions().getMasterInstances().setInstanceSpotPrice(BigDecimal.ONE); emrClusterDefinition.getInstanceDefinitions().getMasterInstances().setInstanceMaxSearchPrice(BigDecimal.ONE); try { he... | /**
* Tests case where validation is run against the definition generated by createValidEmrClusterDefinition() The master instance spot price and max search
* price is specified. The definition is not valid. The two parameters are exclusive.
*/ | Tests case where validation is run against the definition generated by createValidEmrClusterDefinition() The master instance spot price and max search price is specified. The definition is not valid. The two parameters are exclusive | testValidateEmrClusterDefinitionConfigurationMasterSpotPriceAndMaxSearchPriceSpecified | {
"repo_name": "seoj/herd",
"path": "herd-code/herd-service/src/test/java/org/finra/herd/service/helper/HerdHelperTest.java",
"license": "apache-2.0",
"size": 34251
} | [
"java.math.BigDecimal",
"org.finra.herd.model.api.xml.EmrClusterDefinition",
"org.junit.Assert"
] | import java.math.BigDecimal; import org.finra.herd.model.api.xml.EmrClusterDefinition; import org.junit.Assert; | import java.math.*; import org.finra.herd.model.api.xml.*; import org.junit.*; | [
"java.math",
"org.finra.herd",
"org.junit"
] | java.math; org.finra.herd; org.junit; | 2,713,640 |
public void setNodeService(NodeService nodeService)
{
this.nodeService = nodeService;
} | void function(NodeService nodeService) { this.nodeService = nodeService; } | /**
* Sets the node service
*
* @param nodeService the node service
*/ | Sets the node service | setNodeService | {
"repo_name": "Alfresco/alfresco-repository",
"path": "src/main/java/org/alfresco/repo/importer/ImporterBootstrap.java",
"license": "lgpl-3.0",
"size": 24087
} | [
"org.alfresco.service.cmr.repository.NodeService"
] | import org.alfresco.service.cmr.repository.NodeService; | import org.alfresco.service.cmr.repository.*; | [
"org.alfresco.service"
] | org.alfresco.service; | 1,816,673 |
public PDepIsomer getMaxLeakIsomer(SystemSnapshot ss) throws PDepException {
if (nonincludedReactionList.size() == 0) {
if (pathReactionList.size() == 1 && isomerList.size() == 2) {
PDepIsomer isomer1 = isomerList.get(0);
PDepIsomer isomer2 = isomerList.get(1);
if (isomer1.isUnimolecular() &&... | PDepIsomer function(SystemSnapshot ss) throws PDepException { if (nonincludedReactionList.size() == 0) { if (pathReactionList.size() == 1 && isomerList.size() == 2) { PDepIsomer isomer1 = isomerList.get(0); PDepIsomer isomer2 = isomerList.get(1); if (isomer1.isUnimolecular() && !isomer1.getIncluded()) return isomer1; e... | /**
* Calculates the isomer with the largest leak flux for this network. The
* reaction with the maximum flux is used to select the isomer. This isomer
* is the candidate for elevating to included status.
* @param ss A system snapshot (T, P, concentrations, etc.) to use to calculate the flux.
* @return T... | Calculates the isomer with the largest leak flux for this network. The reaction with the maximum flux is used to select the isomer. This isomer is the candidate for elevating to included status | getMaxLeakIsomer | {
"repo_name": "faribas/RMG-Java",
"path": "source/RMG/jing/rxn/PDepNetwork.java",
"license": "mit",
"size": 34407
} | [
"java.util.ListIterator"
] | import java.util.ListIterator; | import java.util.*; | [
"java.util"
] | java.util; | 986,712 |
Set<TimestampToken> getProcessedTimestamps();
/**
* Returns a list of all {@code CertificateSource}s used during the validation process.
* It is represented by sources extracted from the provided document (e.g. signatures, timestamps)
* as well as the sources obtained during the validation process (e.g. AIA,... | Set<TimestampToken> getProcessedTimestamps(); /** * Returns a list of all {@code CertificateSource}s used during the validation process. * It is represented by sources extracted from the provided document (e.g. signatures, timestamps) * as well as the sources obtained during the validation process (e.g. AIA, OCSP). * *... | /**
* Returns a read only list of all timestamps processed during the validation of all signatures from the given
* document.
*
* @return The list of TimestampTokens(s)
*/ | Returns a read only list of all timestamps processed during the validation of all signatures from the given document | getProcessedTimestamps | {
"repo_name": "esig/dss",
"path": "dss-document/src/main/java/eu/europa/esig/dss/validation/ValidationContext.java",
"license": "lgpl-2.1",
"size": 9743
} | [
"eu.europa.esig.dss.spi.x509.CertificateSource",
"eu.europa.esig.dss.spi.x509.ListCertificateSource",
"eu.europa.esig.dss.validation.timestamp.TimestampToken",
"java.util.Set"
] | import eu.europa.esig.dss.spi.x509.CertificateSource; import eu.europa.esig.dss.spi.x509.ListCertificateSource; import eu.europa.esig.dss.validation.timestamp.TimestampToken; import java.util.Set; | import eu.europa.esig.dss.spi.x509.*; import eu.europa.esig.dss.validation.timestamp.*; import java.util.*; | [
"eu.europa.esig",
"java.util"
] | eu.europa.esig; java.util; | 1,249,874 |
public static boolean isNumericType(ColumnType columnType){
ValidateArgument.required(columnType, "columnType");
switch(columnType){
case INTEGER:
case DOUBLE:
case DATE:
case FILEHANDLEID:
case USERID:
case SUBMISSIONID:
case EVALUATIONID:
return true;
default:
return false;
... | static boolean function(ColumnType columnType){ ValidateArgument.required(columnType, STR); switch(columnType){ case INTEGER: case DOUBLE: case DATE: case FILEHANDLEID: case USERID: case SUBMISSIONID: case EVALUATIONID: return true; default: return false; } } | /**
* Is the given ColumnType numeric?
* @param columnType
* @return
*/ | Is the given ColumnType numeric | isNumericType | {
"repo_name": "xschildw/Synapse-Repository-Services",
"path": "lib/lib-table-cluster/src/main/java/org/sagebionetworks/table/cluster/SQLTranslatorUtils.java",
"license": "apache-2.0",
"size": 34764
} | [
"org.sagebionetworks.repo.model.table.ColumnType",
"org.sagebionetworks.util.ValidateArgument"
] | import org.sagebionetworks.repo.model.table.ColumnType; import org.sagebionetworks.util.ValidateArgument; | import org.sagebionetworks.repo.model.table.*; import org.sagebionetworks.util.*; | [
"org.sagebionetworks.repo",
"org.sagebionetworks.util"
] | org.sagebionetworks.repo; org.sagebionetworks.util; | 459,315 |
@Test
public void testSnapFilesGreaterThanToRetain() throws Exception {
int nRecentCount = 4;
int fileAboveRecentCount = 4;
int fileToPurgeCount = 2;
AtomicInteger offset = new AtomicInteger(0);
File version2 = new File(tmpDir.toString(), "version-2");
assertTrue(... | void function() throws Exception { int nRecentCount = 4; int fileAboveRecentCount = 4; int fileToPurgeCount = 2; AtomicInteger offset = new AtomicInteger(0); File version2 = new File(tmpDir.toString(), STR); assertTrue(version2.mkdir(), STR + version2.toString()); List<File> snapsToPurge = new ArrayList<File>(); List<F... | /**
* Tests purge where the data directory contains old snapshots and data
* logs, newest snapshots and data logs, (newest + n) snapshots and data
* logs
*/ | Tests purge where the data directory contains old snapshots and data logs, newest snapshots and data logs, (newest + n) snapshots and data logs | testSnapFilesGreaterThanToRetain | {
"repo_name": "maoling/zookeeper",
"path": "zookeeper-server/src/test/java/org/apache/zookeeper/server/PurgeTxnTest.java",
"license": "apache-2.0",
"size": 27801
} | [
"java.io.File",
"java.util.ArrayList",
"java.util.List",
"java.util.concurrent.atomic.AtomicInteger",
"org.apache.zookeeper.server.persistence.FileTxnSnapLog",
"org.junit.jupiter.api.Assertions"
] | import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; import org.apache.zookeeper.server.persistence.FileTxnSnapLog; import org.junit.jupiter.api.Assertions; | import java.io.*; import java.util.*; import java.util.concurrent.atomic.*; import org.apache.zookeeper.server.persistence.*; import org.junit.jupiter.api.*; | [
"java.io",
"java.util",
"org.apache.zookeeper",
"org.junit.jupiter"
] | java.io; java.util; org.apache.zookeeper; org.junit.jupiter; | 2,760,993 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.