method stringlengths 13 441k | clean_method stringlengths 7 313k | doc stringlengths 17 17.3k | comment stringlengths 3 1.42k | method_name stringlengths 1 273 | extra dict | imports list | imports_info stringlengths 19 34.8k | cluster_imports_info stringlengths 15 3.66k | libraries list | libraries_info stringlengths 6 661 | id int64 0 2.92M |
|---|---|---|---|---|---|---|---|---|---|---|---|
public static boolean convertCommandToBooleanValue(Command command) {
if (command instanceof OnOffType || command instanceof OpenClosedType || command instanceof UpDownType) {
boolean newValue;
if (command.equals(OnOffType.ON) || command.equals(UpDownType.UP) || command.equals(OpenC... | static boolean function(Command command) { if (command instanceof OnOffType command instanceof OpenClosedType command instanceof UpDownType) { boolean newValue; if (command.equals(OnOffType.ON) command.equals(UpDownType.UP) command.equals(OpenClosedType.OPEN)) { newValue = true; } else if (command.equals(OnOffType.OFF)... | /**
* Convert openHAB command to boolean.
*
* @param command
* @return
*/ | Convert openHAB command to boolean | convertCommandToBooleanValue | {
"repo_name": "theoweiss/openhab2",
"path": "bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/DataConverters.java",
"license": "epl-1.0",
"size": 3124
} | [
"org.eclipse.smarthome.core.library.types.OnOffType",
"org.eclipse.smarthome.core.library.types.OpenClosedType",
"org.eclipse.smarthome.core.library.types.UpDownType",
"org.eclipse.smarthome.core.types.Command"
] | import org.eclipse.smarthome.core.library.types.OnOffType; import org.eclipse.smarthome.core.library.types.OpenClosedType; import org.eclipse.smarthome.core.library.types.UpDownType; import org.eclipse.smarthome.core.types.Command; | import org.eclipse.smarthome.core.library.types.*; import org.eclipse.smarthome.core.types.*; | [
"org.eclipse.smarthome"
] | org.eclipse.smarthome; | 1,012,993 |
public void addPrefLabel(Label label) throws ModelException {
checkNotNull(label);
checkPrefLabelDoesntExistInLanguage(label);
addPrefLabelPostCheck(label);
}
| void function(Label label) throws ModelException { checkNotNull(label); checkPrefLabelDoesntExistInLanguage(label); addPrefLabelPostCheck(label); } | /**
* Adds the preferred label - if there is already a preferred label of this language an exception
* is thrown.
*
* @param label
* - the preferred label in the requested language.
* @throws ModelException
* - thrown if there is already a label of this language for the ob... | Adds the preferred label - if there is already a preferred label of this language an exception is thrown | addPrefLabel | {
"repo_name": "Smartlogic-Semaphore-Limited/Java-APIs",
"path": "Semaphore-Model-Manipulation/src/main/java/com/smartlogic/semaphoremodel/Concept.java",
"license": "apache-2.0",
"size": 26583
} | [
"org.apache.jena.ext.com.google.common.base.Preconditions"
] | import org.apache.jena.ext.com.google.common.base.Preconditions; | import org.apache.jena.ext.com.google.common.base.*; | [
"org.apache.jena"
] | org.apache.jena; | 446,599 |
public void createEntryWithContainer(String containerPath, String entryObjectClass, String entryIDField,
String entryIDValue) throws LDAPException {
this.createEntryWithContainer(containerPath, "organizationalUnit", "ou", entryObjectClass, entryIDField,
entryIDValue);
} | void function(String containerPath, String entryObjectClass, String entryIDField, String entryIDValue) throws LDAPException { this.createEntryWithContainer(containerPath, STR, "ou", entryObjectClass, entryIDField, entryIDValue); } | /**
* Creates a new entry at the given destination in the tree. If the
* Container path (parent/superior) of the destination DN does not exist, it
* will be created. The automatically created entries to create a container
* path will be of the ObjectClass "organizationaUnit".
*
* @param containerPath
* ... | Creates a new entry at the given destination in the tree. If the Container path (parent/superior) of the destination DN does not exist, it will be created. The automatically created entries to create a container path will be of the ObjectClass "organizationaUnit" | createEntryWithContainer | {
"repo_name": "ebner/collaborilla",
"path": "src/se/kth/nada/kmr/collaborilla/ldap/LDAPObject.java",
"license": "lgpl-2.1",
"size": 26630
} | [
"com.novell.ldap.LDAPException"
] | import com.novell.ldap.LDAPException; | import com.novell.ldap.*; | [
"com.novell.ldap"
] | com.novell.ldap; | 2,210,184 |
TransportBindingMeter getTransportBindingMeter() {
return transportBindingMeter;
} | TransportBindingMeter getTransportBindingMeter() { return transportBindingMeter; } | /**
* Returns the metering object for this tcpTransport
*
* @return the metering object for this tcpTransport
*/ | Returns the metering object for this tcpTransport | getTransportBindingMeter | {
"repo_name": "johnjianfang/jxse",
"path": "src/main/java/net/jxta/impl/endpoint/tcp/TcpMessenger.java",
"license": "apache-2.0",
"size": 43928
} | [
"net.jxta.impl.endpoint.transportMeter.TransportBindingMeter"
] | import net.jxta.impl.endpoint.transportMeter.TransportBindingMeter; | import net.jxta.impl.endpoint.*; | [
"net.jxta.impl"
] | net.jxta.impl; | 990,213 |
@Override
public void handleMessage(final Exchange exchange) throws HandlerException {
// identify ourselves
exchange.getContext().setProperty(ExchangeCompletionEvent.GATEWAY_NAME, _bindingName, Scope.EXCHANGE)
.addLabels(BehaviorLabel.TRANSIENT.label());
if (getState() !... | void function(final Exchange exchange) throws HandlerException { exchange.getContext().setProperty(ExchangeCompletionEvent.GATEWAY_NAME, _bindingName, Scope.EXCHANGE) .addLabels(BehaviorLabel.TRANSIENT.label()); if (getState() != State.STARTED) { throw HttpMessages.MESSAGES.bindingNotStarted(_referenceName, _bindingNam... | /**
* The handler method that invokes the actual HTTP service when the
* component is used as a HTTP consumer.
* @param exchange the Exchange
* @throws HandlerException handler exception
*/ | The handler method that invokes the actual HTTP service when the component is used as a HTTP consumer | handleMessage | {
"repo_name": "igarashitm/switchyard",
"path": "components/http/src/main/java/org/switchyard/component/http/OutboundHandler.java",
"license": "apache-2.0",
"size": 13243
} | [
"java.util.ArrayList",
"java.util.Iterator",
"java.util.List",
"java.util.Map",
"org.apache.http.Header",
"org.apache.http.HttpEntity",
"org.apache.http.HttpResponse",
"org.apache.http.auth.NTCredentials",
"org.apache.http.auth.params.AuthPNames",
"org.apache.http.client.HttpClient",
"org.apache... | import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; import org.apache.http.Header; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.auth.NTCredentials; import org.apache.http.auth.params.AuthPNames; import org.apache.http.clie... | import java.util.*; import org.apache.http.*; import org.apache.http.auth.*; import org.apache.http.auth.params.*; import org.apache.http.client.*; import org.apache.http.client.methods.*; import org.apache.http.client.params.*; import org.apache.http.client.protocol.*; import org.apache.http.client.utils.*; import org... | [
"java.util",
"org.apache.http",
"org.switchyard",
"org.switchyard.component",
"org.switchyard.label",
"org.switchyard.runtime"
] | java.util; org.apache.http; org.switchyard; org.switchyard.component; org.switchyard.label; org.switchyard.runtime; | 854,859 |
private int getMaxPrefWidth(Component[] components)
{
int maxWidth = 0;
int componentWidth = 0;
Dimension d = null;
for (int i=0; i < components.length; i++)
{
d = components[i].getPreferredSize();
componentWidth = d.width;
if (components[i] instanceof JSeparator)
{
... | int function(Component[] components) { int maxWidth = 0; int componentWidth = 0; Dimension d = null; for (int i=0; i < components.length; i++) { d = components[i].getPreferredSize(); componentWidth = d.width; if (components[i] instanceof JSeparator) { componentWidth = Math.min(d.width, d.height); } maxWidth = Math.max(... | /**
* Returns the largest preferred width of the provided components.
*/ | Returns the largest preferred width of the provided components | getMaxPrefWidth | {
"repo_name": "djovanovic/JADE_PROJECT",
"path": "src/examples/MarketSimulator/StackLayout.java",
"license": "lgpl-2.1",
"size": 16413
} | [
"java.awt.Component",
"java.awt.Dimension",
"javax.swing.JSeparator"
] | import java.awt.Component; import java.awt.Dimension; import javax.swing.JSeparator; | import java.awt.*; import javax.swing.*; | [
"java.awt",
"javax.swing"
] | java.awt; javax.swing; | 2,261,610 |
boolean addAll(CompositeCollection<E> composite,
List<Collection<E>> collections,
Collection<? extends E> coll); | boolean addAll(CompositeCollection<E> composite, List<Collection<E>> collections, Collection<? extends E> coll); | /**
* Called when a collection is to be added to the composite.
*
* @param composite the CompositeCollection being changed
* @param collections all of the Collection instances in this CompositeCollection
* @param coll the collection being added
* @return true if ... | Called when a collection is to be added to the composite | addAll | {
"repo_name": "krivachy/compgs03_mutation_testing",
"path": "src/main/java/org/apache/commons/collections4/collection/CompositeCollection.java",
"license": "apache-2.0",
"size": 17145
} | [
"java.util.Collection",
"java.util.List"
] | import java.util.Collection; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 864,833 |
public static Collection<ICondition> getAllNonParameteriedConditions(IParameterizedQuery paramQuery) {
Map<IExpression, Collection<ICondition>> conditionsMap = getAllSelectedConditions(paramQuery);
Collection<ICondition> nonParamConditions = new ArrayList<ICondition>();
for (Collection<IC... | static Collection<ICondition> function(IParameterizedQuery paramQuery) { Map<IExpression, Collection<ICondition>> conditionsMap = getAllSelectedConditions(paramQuery); Collection<ICondition> nonParamConditions = new ArrayList<ICondition>(); for (Collection<ICondition> conditions : conditionsMap.values()) { nonParamCond... | /**
* This method returns the collection of all non-parameterized conditions form a given query.
*
* @param paramQuery parameterized query
* @return collection of non-parameterized conditions
*/ | This method returns the collection of all non-parameterized conditions form a given query | getAllNonParameteriedConditions | {
"repo_name": "NCIP/cab2b",
"path": "software/dependencies/query/QUERY_26_NOV_08/src/edu/wustl/common/querysuite/utils/QueryUtility.java",
"license": "bsd-3-clause",
"size": 9411
} | [
"edu.wustl.common.querysuite.queryobject.ICondition",
"edu.wustl.common.querysuite.queryobject.IExpression",
"edu.wustl.common.querysuite.queryobject.IParameterizedQuery",
"java.util.ArrayList",
"java.util.Collection",
"java.util.Map"
] | import edu.wustl.common.querysuite.queryobject.ICondition; import edu.wustl.common.querysuite.queryobject.IExpression; import edu.wustl.common.querysuite.queryobject.IParameterizedQuery; import java.util.ArrayList; import java.util.Collection; import java.util.Map; | import edu.wustl.common.querysuite.queryobject.*; import java.util.*; | [
"edu.wustl.common",
"java.util"
] | edu.wustl.common; java.util; | 1,274,443 |
private void promptForCreatableProjectSourceRootDirectory(MWProject project)
{
String description = resourceRepository().getString("PROJECT_SOURCE_ROOT_DIRECTORY_DIALOG_CHOSEN_DIRECTORY_COULD_NOT_BE_CREATED.message",
new Object[] {project.absoluteProjectSourceDirectory()});
promptForDirectory... | void function(MWProject project) { String description = resourceRepository().getString(STR, new Object[] {project.absoluteProjectSourceDirectory()}); promptForDirectory(project, description); } | /**
* used when the chosen directory could not be created (various reasons)
*/ | used when the chosen directory could not be created (various reasons) | promptForCreatableProjectSourceRootDirectory | {
"repo_name": "bfg-repo-cleaner-demos/eclipselink.runtime-bfg-strip-big-blobs",
"path": "utils/eclipselink.utils.workbench/mappingsplugin/source/org/eclipse/persistence/tools/workbench/mappingsplugin/ProjectSourceGenerationCoordinator.java",
"license": "epl-1.0",
"size": 13585
} | [
"org.eclipse.persistence.tools.workbench.mappingsmodel.project.MWProject"
] | import org.eclipse.persistence.tools.workbench.mappingsmodel.project.MWProject; | import org.eclipse.persistence.tools.workbench.mappingsmodel.project.*; | [
"org.eclipse.persistence"
] | org.eclipse.persistence; | 558,886 |
protected void validateHasMethod(CamelContext context, Object bean, Class<?> type, String method) {
if (method == null) {
return;
}
if (bean == null && type == null) {
throw new IllegalArgumentException("Either bean or type should be provided on " + this);
}
... | void function(CamelContext context, Object bean, Class<?> type, String method) { if (method == null) { return; } if (bean == null && type == null) { throw new IllegalArgumentException(STR + this); } if (bean == null && hasDefaultPublicNoArgConstructor(type)) { bean = context.getInjector().newInstance(type); } if (OgnlH... | /**
* Validates the given bean has the method.
* <p/>
* This implementation will skip trying to validate OGNL method name expressions.
*
* @param context camel context
* @param bean the bean instance
* @param type the bean type
* @param method the method, can be <tt>nu... | Validates the given bean has the method. This implementation will skip trying to validate OGNL method name expressions | validateHasMethod | {
"repo_name": "objectiser/camel",
"path": "components/camel-bean/src/main/java/org/apache/camel/language/bean/BeanExpression.java",
"license": "apache-2.0",
"size": 19316
} | [
"org.apache.camel.CamelContext",
"org.apache.camel.ExpressionIllegalSyntaxException",
"org.apache.camel.RuntimeCamelException",
"org.apache.camel.component.bean.BeanInfo",
"org.apache.camel.component.bean.MethodNotFoundException",
"org.apache.camel.util.ObjectHelper",
"org.apache.camel.util.OgnlHelper"
... | import org.apache.camel.CamelContext; import org.apache.camel.ExpressionIllegalSyntaxException; import org.apache.camel.RuntimeCamelException; import org.apache.camel.component.bean.BeanInfo; import org.apache.camel.component.bean.MethodNotFoundException; import org.apache.camel.util.ObjectHelper; import org.apache.cam... | import org.apache.camel.*; import org.apache.camel.component.bean.*; import org.apache.camel.util.*; | [
"org.apache.camel"
] | org.apache.camel; | 2,185,610 |
@SuppressWarnings("unused")
protected void setName(@NotNull final java.lang.String name)
{
immutableSetName(name);
} | @SuppressWarnings(STR) void function(@NotNull final java.lang.String name) { immutableSetName(name); } | /**
* Sets field's name.
* @param name the name of the field.
*/ | Sets field's name | setName | {
"repo_name": "rydnr/java-commons",
"path": "src/main/java/org/acmsl/commons/patterns/dao/ValueObjectField.java",
"license": "gpl-2.0",
"size": 6429
} | [
"org.jetbrains.annotations.NotNull"
] | import org.jetbrains.annotations.NotNull; | import org.jetbrains.annotations.*; | [
"org.jetbrains.annotations"
] | org.jetbrains.annotations; | 351,045 |
public boolean switchBalancer(final boolean b, BalanceSwitchMode mode) throws IOException {
boolean oldValue = this.loadBalancerTracker.isBalancerOn();
boolean newValue = b;
try {
if (this.cpHost != null) {
newValue = this.cpHost.preBalanceSwitch(newValue);
}
try {
if (mo... | boolean function(final boolean b, BalanceSwitchMode mode) throws IOException { boolean oldValue = this.loadBalancerTracker.isBalancerOn(); boolean newValue = b; try { if (this.cpHost != null) { newValue = this.cpHost.preBalanceSwitch(newValue); } try { if (mode == BalanceSwitchMode.SYNC) { synchronized (this.balancer) ... | /**
* Assigns balancer switch according to BalanceSwitchMode
* @param b new balancer switch
* @param mode BalanceSwitchMode
* @return old balancer switch
*/ | Assigns balancer switch according to BalanceSwitchMode | switchBalancer | {
"repo_name": "throughsky/lywebank",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java",
"license": "apache-2.0",
"size": 125853
} | [
"java.io.IOException",
"org.apache.zookeeper.KeeperException"
] | import java.io.IOException; import org.apache.zookeeper.KeeperException; | import java.io.*; import org.apache.zookeeper.*; | [
"java.io",
"org.apache.zookeeper"
] | java.io; org.apache.zookeeper; | 2,894,046 |
private int getPageScrollTop() {
return DOM.getAbsoluteTop(DOM.getParent(RootPanel.getBodyElement()));
} | int function() { return DOM.getAbsoluteTop(DOM.getParent(RootPanel.getBodyElement())); } | /**
* Get the offset for the vertical scroll
*
* @return The offset
*/ | Get the offset for the vertical scroll | getPageScrollTop | {
"repo_name": "MiguelSMendoza/Kunagi",
"path": "WEB-INF/classes/ilarkesto/gwt/client/TooltipPopup.java",
"license": "agpl-3.0",
"size": 4095
} | [
"com.google.gwt.user.client.DOM",
"com.google.gwt.user.client.ui.RootPanel"
] | import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.ui.RootPanel; | import com.google.gwt.user.client.*; import com.google.gwt.user.client.ui.*; | [
"com.google.gwt"
] | com.google.gwt; | 2,773,690 |
private void updateS(Point p)
{
float h = p.x * 1f / imgWidth;
float b = (imgHeight - p.y * 1f) / imgHeight;
internalChange = true;
hSpinner.setValue(new Integer((int) (h * 365)));
internalChange = false;
bSpinner.setValue(new Integer((int) (b * 100)));
revalidate();
... | void function(Point p) { float h = p.x * 1f / imgWidth; float b = (imgHeight - p.y * 1f) / imgHeight; internalChange = true; hSpinner.setValue(new Integer((int) (h * 365))); internalChange = false; bSpinner.setValue(new Integer((int) (b * 100))); revalidate(); } | /**
* This method updates the HB values if Saturation is locked.
*
* @param p The point where the MouseEvent occurred.
*/ | This method updates the HB values if Saturation is locked | updateS | {
"repo_name": "SanDisk-Open-Source/SSD_Dashboard",
"path": "uefi/gcc/gcc-4.6.3/libjava/classpath/javax/swing/colorchooser/DefaultHSBChooserPanel.java",
"license": "gpl-2.0",
"size": 25362
} | [
"java.awt.Point"
] | import java.awt.Point; | import java.awt.*; | [
"java.awt"
] | java.awt; | 791,064 |
protected void addSrsDimensionPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_AbstractGeometryType_srsDimension_feature"),
getString("_UI_Pr... | void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), GmlPackage.eINSTANCE.getAbstractGeometryType_SrsDimension(), true, false, false, ItemPropertyDesc... | /**
* This adds a property descriptor for the Srs Dimension feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This adds a property descriptor for the Srs Dimension feature. | addSrsDimensionPropertyDescriptor | {
"repo_name": "markus1978/citygml4emf",
"path": "de.hub.citygml.emf.ecore.edit/src/net/opengis/gml/provider/AbstractGeometryTypeItemProvider.java",
"license": "apache-2.0",
"size": 9205
} | [
"net.opengis.gml.GmlPackage",
"org.eclipse.emf.edit.provider.ComposeableAdapterFactory",
"org.eclipse.emf.edit.provider.ItemPropertyDescriptor"
] | import net.opengis.gml.GmlPackage; import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; | import net.opengis.gml.*; import org.eclipse.emf.edit.provider.*; | [
"net.opengis.gml",
"org.eclipse.emf"
] | net.opengis.gml; org.eclipse.emf; | 1,248,229 |
private void fetchBuildArtifactDiffData(ArtifactoryRestRequest artifactoryRequest, RestResponse artifactoryResponse, String name, String moduleId, String buildNumber, String comparedBuildNum, String comparedDate, String buildStarted, PagingData pagingData) {
BuildParams buildParams = new BuildParams(moduleI... | void function(ArtifactoryRestRequest artifactoryRequest, RestResponse artifactoryResponse, String name, String moduleId, String buildNumber, String comparedBuildNum, String comparedDate, String buildStarted, PagingData pagingData) { BuildParams buildParams = new BuildParams(moduleId, buildNumber, comparedBuildNum, comp... | /**
* fetch build artifact diff with another build data
*
* @param artifactoryRequest - encapsulate data related to request
* @param artifactoryResponse - encapsulate data require for responsse
* @param name - build name
* @param buildNumber - current build number
... | fetch build artifact diff with another build data | fetchBuildArtifactDiffData | {
"repo_name": "alancnet/artifactory",
"path": "web/rest-ui/src/main/java/org/artifactory/ui/rest/service/builds/buildsinfo/tabs/builddiff/DiffBuildArtifactService.java",
"license": "apache-2.0",
"size": 3995
} | [
"java.util.ArrayList",
"java.util.List",
"org.artifactory.api.build.ModuleArtifact",
"org.artifactory.api.build.diff.BuildParams",
"org.artifactory.rest.common.service.ArtifactoryRestRequest",
"org.artifactory.rest.common.service.PagingData",
"org.artifactory.rest.common.service.RestResponse",
"org.ar... | import java.util.ArrayList; import java.util.List; import org.artifactory.api.build.ModuleArtifact; import org.artifactory.api.build.diff.BuildParams; import org.artifactory.rest.common.service.ArtifactoryRestRequest; import org.artifactory.rest.common.service.PagingData; import org.artifactory.rest.common.service.Rest... | import java.util.*; import org.artifactory.api.build.*; import org.artifactory.api.build.diff.*; import org.artifactory.rest.common.service.*; import org.artifactory.ui.rest.model.artifacts.browse.treebrowser.tabs.permission.*; import org.artifactory.ui.rest.model.builds.*; import org.artifactory.ui.utils.*; | [
"java.util",
"org.artifactory.api",
"org.artifactory.rest",
"org.artifactory.ui"
] | java.util; org.artifactory.api; org.artifactory.rest; org.artifactory.ui; | 414,371 |
public LinkedList<Patch> patch_make(String text1, LinkedList<Diff> diffs) {
if (text1 == null || diffs == null) {
throw new IllegalArgumentException("Null inputs. (patch_make)");
}
LinkedList<Patch> patches = new LinkedList<Patch>();
if (diffs.isEmpty()) {
return patches; // Get rid of t... | LinkedList<Patch> function(String text1, LinkedList<Diff> diffs) { if (text1 == null diffs == null) { throw new IllegalArgumentException(STR); } LinkedList<Patch> patches = new LinkedList<Patch>(); if (diffs.isEmpty()) { return patches; } Patch patch = new Patch(); int char_count1 = 0; int char_count2 = 0; String prepa... | /**
* Compute a list of patches to turn text1 into text2.
* text2 is not provided, diffs are the delta between text1 and text2.
* @param text1 Old text.
* @param diffs Array of Diff objects for text1 to text2.
* @return LinkedList of Patch objects.
*/ | Compute a list of patches to turn text1 into text2. text2 is not provided, diffs are the delta between text1 and text2 | patch_make | {
"repo_name": "nla/flint",
"path": "flint-toolwrappers/src/main/java/name/fraser/neil/plaintext/diff_match_patch.java",
"license": "apache-2.0",
"size": 89050
} | [
"java.util.LinkedList"
] | import java.util.LinkedList; | import java.util.*; | [
"java.util"
] | java.util; | 2,689,387 |
private NanoHTTPD.Response getDeviceAcceleration() {
return NanoHTTPD.newFixedLengthResponse(
NanoHTTPD.Response.Status.OK, MIME_PLAINTEXT, (-deviceAccelX) + " " + (-deviceAccelY) + " " + (-deviceAccelZ));
} | NanoHTTPD.Response function() { return NanoHTTPD.newFixedLengthResponse( NanoHTTPD.Response.Status.OK, MIME_PLAINTEXT, (-deviceAccelX) + " " + (-deviceAccelY) + " " + (-deviceAccelZ)); } | /**
* Gets the device's acceleration
*
* @return Each axis' acceleration separated by spaces
*/ | Gets the device's acceleration | getDeviceAcceleration | {
"repo_name": "BirdBrainTechnologies/BirdBlox-Android-Support",
"path": "app/src/main/java/com/birdbraintechnologies/birdblox/httpservice/RequestHandlers/HostDeviceHandler.java",
"license": "mit",
"size": 22483
} | [
"fi.iki.elonen.NanoHTTPD"
] | import fi.iki.elonen.NanoHTTPD; | import fi.iki.elonen.*; | [
"fi.iki.elonen"
] | fi.iki.elonen; | 516,023 |
public static void merge(List<InputStream> inputs, OutputStream output) throws IOException, DocumentException {
Document document = new Document();
try {
PdfSmartCopy copy = new PdfSmartCopy(document, output);
document.open();
for (InputStream is : inputs) {
... | static void function(List<InputStream> inputs, OutputStream output) throws IOException, DocumentException { Document document = new Document(); try { PdfSmartCopy copy = new PdfSmartCopy(document, output); document.open(); for (InputStream is : inputs) { PdfReader reader = new PdfReader(is); for (int i = 1; i <= reader... | /**
* Merge several PDFs into a new one
*/ | Merge several PDFs into a new one | merge | {
"repo_name": "codelibs/n2dms",
"path": "src/main/java/com/openkm/util/PDFUtils.java",
"license": "gpl-2.0",
"size": 10737
} | [
"com.lowagie.text.Document",
"com.lowagie.text.DocumentException",
"com.lowagie.text.pdf.PdfReader",
"com.lowagie.text.pdf.PdfSmartCopy",
"java.io.IOException",
"java.io.InputStream",
"java.io.OutputStream",
"java.util.List",
"org.apache.commons.io.IOUtils"
] | import com.lowagie.text.Document; import com.lowagie.text.DocumentException; import com.lowagie.text.pdf.PdfReader; import com.lowagie.text.pdf.PdfSmartCopy; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.List; import org.apache.commons.io.IOUtils; | import com.lowagie.text.*; import com.lowagie.text.pdf.*; import java.io.*; import java.util.*; import org.apache.commons.io.*; | [
"com.lowagie.text",
"java.io",
"java.util",
"org.apache.commons"
] | com.lowagie.text; java.io; java.util; org.apache.commons; | 1,184,022 |
public RegDataContainer getValue(String key, String value) throws NativeLibException
{
return (getRegistry().getValue(key, value));
} | RegDataContainer function(String key, String value) throws NativeLibException { return (getRegistry().getValue(key, value)); } | /**
* Returns the contents of the key/value pair if value exist, else an exception is raised.
*
* @param key the registry key which should be used
* @param value the registry value from which the contents should be requested
* @return requested value if exist, else an exception
* @throws... | Returns the contents of the key/value pair if value exist, else an exception is raised | getValue | {
"repo_name": "Murdock01/izpack",
"path": "izpack-installer/src/main/java/com/izforge/izpack/util/os/Win_RegistryHandler.java",
"license": "apache-2.0",
"size": 12697
} | [
"com.coi.tools.os.win.RegDataContainer",
"com.izforge.izpack.api.exception.NativeLibException"
] | import com.coi.tools.os.win.RegDataContainer; import com.izforge.izpack.api.exception.NativeLibException; | import com.coi.tools.os.win.*; import com.izforge.izpack.api.exception.*; | [
"com.coi.tools",
"com.izforge.izpack"
] | com.coi.tools; com.izforge.izpack; | 1,455,674 |
@Nullable
CommitId findCommitId(@NotNull Condition<CommitId> condition); | CommitId findCommitId(@NotNull Condition<CommitId> condition); | /**
* Iterates over known commit ids to find the first one which satisfies given condition.
*
* @return matching commit or null if no commit matches the given condition
*/ | Iterates over known commit ids to find the first one which satisfies given condition | findCommitId | {
"repo_name": "asedunov/intellij-community",
"path": "platform/vcs-log/impl/src/com/intellij/vcs/log/data/VcsLogStorage.java",
"license": "apache-2.0",
"size": 2578
} | [
"com.intellij.openapi.util.Condition",
"com.intellij.vcs.log.CommitId",
"org.jetbrains.annotations.NotNull"
] | import com.intellij.openapi.util.Condition; import com.intellij.vcs.log.CommitId; import org.jetbrains.annotations.NotNull; | import com.intellij.openapi.util.*; import com.intellij.vcs.log.*; import org.jetbrains.annotations.*; | [
"com.intellij.openapi",
"com.intellij.vcs",
"org.jetbrains.annotations"
] | com.intellij.openapi; com.intellij.vcs; org.jetbrains.annotations; | 2,747,472 |
@Test
public void testAfterUsePreparedStatement() throws Exception {
TJDBCInputProperties fixture = new TJDBCInputProperties("input");
fixture.init();
fixture.usePreparedStatement.setValue(true);
fixture.afterUsePreparedStatement();
Form advance = fixture.getForm(Fo... | void function() throws Exception { TJDBCInputProperties fixture = new TJDBCInputProperties("input"); fixture.init(); fixture.usePreparedStatement.setValue(true); fixture.afterUsePreparedStatement(); Form advance = fixture.getForm(Form.ADVANCED); Assert.assertFalse(!advance.getWidget(fixture.preparedStatementTable.getNa... | /**
* Run the void afterUsePreparedStatement() method test.
*
* @throws Exception
*
* @generatedBy CodePro at 17-6-20 PM3:13
*/ | Run the void afterUsePreparedStatement() method test | testAfterUsePreparedStatement | {
"repo_name": "Talend/components",
"path": "components/components-jdbc/components-jdbc-definition/src/test/java/org/talend/components/jdbc/tjdbcinput/TJDBCInputPropertiesTest.java",
"license": "apache-2.0",
"size": 11537
} | [
"org.junit.Assert",
"org.talend.daikon.properties.presentation.Form"
] | import org.junit.Assert; import org.talend.daikon.properties.presentation.Form; | import org.junit.*; import org.talend.daikon.properties.presentation.*; | [
"org.junit",
"org.talend.daikon"
] | org.junit; org.talend.daikon; | 24,275 |
switch (initializationState) {
case INITIALIZING:
throw new CyclicBlockSpecDependencyException(blockSpecification);
case ERROR:
return null;
case UNINITIALIZED:
initialize();
return blockSpecification;
case INITIALIZED:
return blockSpecification;
default:
throw new IllegalStateExcepti... | switch (initializationState) { case INITIALIZING: throw new CyclicBlockSpecDependencyException(blockSpecification); case ERROR: return null; case UNINITIALIZED: initialize(); return blockSpecification; case INITIALIZED: return blockSpecification; default: throw new IllegalStateException(STR); } } | /**
* Returns the wrapped block specification and makes sure that it is
* initialized before. If the initialization has failed before,
* <code>null</code> is returned.
*/ | Returns the wrapped block specification and makes sure that it is initialized before. If the initialization has failed before, <code>null</code> is returned | accessBlockSpecification | {
"repo_name": "vimaier/conqat",
"path": "org.conqat.engine.core/src/org/conqat/engine/core/driver/specification/BlockSpecificationInitializer.java",
"license": "apache-2.0",
"size": 3559
} | [
"org.conqat.engine.core.driver.error.CyclicBlockSpecDependencyException"
] | import org.conqat.engine.core.driver.error.CyclicBlockSpecDependencyException; | import org.conqat.engine.core.driver.error.*; | [
"org.conqat.engine"
] | org.conqat.engine; | 1,113,525 |
public void setPublic() {
m_declaration.modifiers().add(m_ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
} | void function() { m_declaration.modifiers().add(m_ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD)); } | /**
* Set the public access flag.
*/ | Set the public access flag | setPublic | {
"repo_name": "vkorbut/jibx",
"path": "jibx/build/src/org/jibx/schema/codegen/BodyBuilderBase.java",
"license": "bsd-3-clause",
"size": 4860
} | [
"org.eclipse.jdt.core.dom.Modifier"
] | import org.eclipse.jdt.core.dom.Modifier; | import org.eclipse.jdt.core.dom.*; | [
"org.eclipse.jdt"
] | org.eclipse.jdt; | 1,753,783 |
protected void process(Object bean, String beanName, Class<? extends Annotation> annotation) {
if (Objects.isNull(annotation) || PROXIED_SET.contains(beanName)) {
return;
}
ReflectionUtils.doWithFields(bean.getClass(), field -> {
Annotation reference = field.getAnnot... | void function(Object bean, String beanName, Class<? extends Annotation> annotation) { if (Objects.isNull(annotation) PROXIED_SET.contains(beanName)) { return; } ReflectionUtils.doWithFields(bean.getClass(), field -> { Annotation reference = field.getAnnotation(annotation); if (reference == null) { return; } addTccAdvis... | /**
* Process annotation
*
* @param bean the bean
* @param beanName the bean name
* @param annotation the annotation
*/ | Process annotation | process | {
"repo_name": "seata/seata",
"path": "spring/src/main/java/io/seata/spring/tcc/TccAnnotationProcessor.java",
"license": "apache-2.0",
"size": 4717
} | [
"java.lang.annotation.Annotation",
"java.lang.reflect.Modifier",
"java.util.Objects",
"org.springframework.util.ReflectionUtils"
] | import java.lang.annotation.Annotation; import java.lang.reflect.Modifier; import java.util.Objects; import org.springframework.util.ReflectionUtils; | import java.lang.annotation.*; import java.lang.reflect.*; import java.util.*; import org.springframework.util.*; | [
"java.lang",
"java.util",
"org.springframework.util"
] | java.lang; java.util; org.springframework.util; | 584,301 |
public void afterPropertiesSet()
{
PropertyCheck.mandatory(this, "policyComponent", policyComponent);
PropertyCheck.mandatory(this, "auditComponent", auditComponent);
policyComponent.bindClassBehaviour(BeforeDeleteNodePolicy.QNAME, this, new JavaBehaviour(this,
"befo... | void function() { PropertyCheck.mandatory(this, STR, policyComponent); PropertyCheck.mandatory(this, STR, auditComponent); policyComponent.bindClassBehaviour(BeforeDeleteNodePolicy.QNAME, this, new JavaBehaviour(this, STR)); } | /**
* Checks that all necessary properties have been set and binds with the policy component.
*/ | Checks that all necessary properties have been set and binds with the policy component | afterPropertiesSet | {
"repo_name": "nguyentienlong/community-edition",
"path": "projects/repository/source/java/org/alfresco/repo/node/NodeAuditor.java",
"license": "lgpl-3.0",
"size": 4031
} | [
"org.alfresco.repo.node.NodeServicePolicies",
"org.alfresco.repo.policy.JavaBehaviour",
"org.alfresco.util.PropertyCheck"
] | import org.alfresco.repo.node.NodeServicePolicies; import org.alfresco.repo.policy.JavaBehaviour; import org.alfresco.util.PropertyCheck; | import org.alfresco.repo.node.*; import org.alfresco.repo.policy.*; import org.alfresco.util.*; | [
"org.alfresco.repo",
"org.alfresco.util"
] | org.alfresco.repo; org.alfresco.util; | 497,628 |
public Map<Label, T> getEntries() {
return map;
} | Map<Label, T> function() { return map; } | /**
* Returns the selector's (configurability pattern --gt; matching values) map.
*
* <p>Entries in this map retain the order of the entries in the map provided to the {@link
* #Selector} constructor.
*/ | Returns the selector's (configurability pattern --gt; matching values) map. Entries in this map retain the order of the entries in the map provided to the <code>#Selector</code> constructor | getEntries | {
"repo_name": "juhalindfors/bazel-patches",
"path": "src/main/java/com/google/devtools/build/lib/packages/BuildType.java",
"license": "apache-2.0",
"size": 23915
} | [
"com.google.devtools.build.lib.cmdline.Label",
"java.util.Map"
] | import com.google.devtools.build.lib.cmdline.Label; import java.util.Map; | import com.google.devtools.build.lib.cmdline.*; import java.util.*; | [
"com.google.devtools",
"java.util"
] | com.google.devtools; java.util; | 2,302,211 |
public void getRegionFromCache(String region) throws Exception {
try {
Region subr = this.currRegion.getSubregion(region);
if (subr == null) {
mkrgn(region);
currRegion = this.currRegion.getSubregion(region);
} else {
currRegion = subr;
}
} catch (Exception e)... | void function(String region) throws Exception { try { Region subr = this.currRegion.getSubregion(region); if (subr == null) { mkrgn(region); currRegion = this.currRegion.getSubregion(region); } else { currRegion = subr; } } catch (Exception e) { System.out.println(STR + e); e.printStackTrace(); throw new Exception(STR)... | /**
* Checks whether a region passed in the param exists in the curr region or not. If doesnt exist
* then calls mkrgn() to create it. Finally makes data member currRegion point to that region.
*/ | Checks whether a region passed in the param exists in the curr region or not. If doesnt exist then calls mkrgn() to create it. Finally makes data member currRegion point to that region | getRegionFromCache | {
"repo_name": "deepakddixit/incubator-geode",
"path": "geode-junit/src/main/java/org/apache/geode/internal/jta/JTAUtils.java",
"license": "apache-2.0",
"size": 10137
} | [
"org.apache.geode.cache.Region"
] | import org.apache.geode.cache.Region; | import org.apache.geode.cache.*; | [
"org.apache.geode"
] | org.apache.geode; | 2,857,721 |
private void setupDevPod(final Map<String, String> envVariables,
final Map<String, String> flowParam) {
if (flowParam != null && !flowParam.isEmpty() && flowParam
.containsKey(FlowParameters.FLOW_PARAM_ENABLE_DEV_POD)) {
envVariables.put(ContainerizedDispatchManagerProperties.ENV_ENABLE_DEV_PO... | void function(final Map<String, String> envVariables, final Map<String, String> flowParam) { if (flowParam != null && !flowParam.isEmpty() && flowParam .containsKey(FlowParameters.FLOW_PARAM_ENABLE_DEV_POD)) { envVariables.put(ContainerizedDispatchManagerProperties.ENV_ENABLE_DEV_POD, flowParam.get(FlowParameters.FLOW_... | /**
* This method is used to setup environment variable to enable pod as dev pod which can be helpful
* for testing. Based on this environment variable, you can decide to start the flow container or
* not.
*
* @param envVariables
* @param flowParam
*/ | This method is used to setup environment variable to enable pod as dev pod which can be helpful for testing. Based on this environment variable, you can decide to start the flow container or not | setupDevPod | {
"repo_name": "azkaban/azkaban",
"path": "azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java",
"license": "apache-2.0",
"size": 56420
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,776,782 |
@Test
public void testNotConnectedLoad_RepByRef() throws Exception {
JobEntryJob jej = spy( new JobEntryJob( JOB_ENTRY_JOB_NAME ) );
jej.setSpecificationMethod( ObjectLocationSpecificationMethod.REPOSITORY_BY_REFERENCE );
jej.setJobObjectId( JOB_ENTRY_JOB_OBJECT_ID );
jej.loadXML( getNode( jej ), da... | void function() throws Exception { JobEntryJob jej = spy( new JobEntryJob( JOB_ENTRY_JOB_NAME ) ); jej.setSpecificationMethod( ObjectLocationSpecificationMethod.REPOSITORY_BY_REFERENCE ); jej.setJobObjectId( JOB_ENTRY_JOB_OBJECT_ID ); jej.loadXML( getNode( jej ), databases, servers, null, store ); jej.getJobMeta( null,... | /**
* When disconnected from the repository and {@link JobEntryJob} references a child job by {@link ObjectId},
* this reference will be invalid to run such job.
* Default to {@link ObjectLocationSpecificationMethod}.{@code FILENAME} with a {@code null} file path.
*/ | When disconnected from the repository and <code>JobEntryJob</code> references a child job by <code>ObjectId</code>, this reference will be invalid to run such job. Default to <code>ObjectLocationSpecificationMethod</code>.FILENAME with a null file path | testNotConnectedLoad_RepByRef | {
"repo_name": "emartin-pentaho/pentaho-kettle",
"path": "engine/src/test/java/org/pentaho/di/job/entries/job/JobEntryJobTest.java",
"license": "apache-2.0",
"size": 27102
} | [
"org.junit.Assert",
"org.mockito.Mockito",
"org.pentaho.di.core.ObjectLocationSpecificationMethod",
"org.pentaho.di.job.JobMeta",
"org.powermock.api.mockito.PowerMockito"
] | import org.junit.Assert; import org.mockito.Mockito; import org.pentaho.di.core.ObjectLocationSpecificationMethod; import org.pentaho.di.job.JobMeta; import org.powermock.api.mockito.PowerMockito; | import org.junit.*; import org.mockito.*; import org.pentaho.di.core.*; import org.pentaho.di.job.*; import org.powermock.api.mockito.*; | [
"org.junit",
"org.mockito",
"org.pentaho.di",
"org.powermock.api"
] | org.junit; org.mockito; org.pentaho.di; org.powermock.api; | 2,463,503 |
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<PagedResponse<PrivateCloudInner>> listSinglePageAsync(Context context) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter ... | @ServiceMethod(returns = ReturnType.SINGLE) Mono<PagedResponse<PrivateCloudInner>> function(Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( STR)); } fin... | /**
* List private clouds in a subscription.
*
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException a... | List private clouds in a subscription | listSinglePageAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsClientImpl.java",
"license": "mit",
"size": 106842
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.PagedResponse",
"com.azure.core.http.rest.PagedResponseBase",
"com.azure.core.util.Context",
"com.azure.resourcemanager.avs.fluent.models.PrivateCloudInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.util.Context; import com.azure.resourcemanager.avs.fluent.models.PrivateCloudInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.avs.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 1,926,055 |
private void killErrorButtonActionPerformed(ActionEvent evt) {
updateReadPointSelector();
AntennaReadPoint selectedReadPoint = (AntennaReadPoint) ((ReadPointItem) (readPointSelector
.getSelectedItem())).getReadPoint();
selectedReadPoint.killFailureOccurred();
}
| void function(ActionEvent evt) { updateReadPointSelector(); AntennaReadPoint selectedReadPoint = (AntennaReadPoint) ((ReadPointItem) (readPointSelector .getSelectedItem())).getReadPoint(); selectedReadPoint.killFailureOccurred(); } | /**
* Called on an action event on the <code>killErrorButton</code>.
*
* @param evt
* The action event
*/ | Called on an action event on the <code>killErrorButton</code> | killErrorButtonActionPerformed | {
"repo_name": "tavlima/fosstrak-reader",
"path": "reader-rprm-core/src/main/java/org/fosstrak/reader/rprm/core/mgmt/simulator/MgmtSimulator.java",
"license": "lgpl-2.1",
"size": 21576
} | [
"java.awt.event.ActionEvent",
"org.fosstrak.reader.rprm.core.AntennaReadPoint"
] | import java.awt.event.ActionEvent; import org.fosstrak.reader.rprm.core.AntennaReadPoint; | import java.awt.event.*; import org.fosstrak.reader.rprm.core.*; | [
"java.awt",
"org.fosstrak.reader"
] | java.awt; org.fosstrak.reader; | 2,700,351 |
@Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLLiteralImplDouble instance) throws SerializationException {
deserialize(streamReader, instance);
} | void function(SerializationStreamReader streamReader, OWLLiteralImplDouble instance) throws SerializationException { deserialize(streamReader, instance); } | /**
* Deserializes the content of the object from the
* {@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
* @param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
* object's content from
* @param instance the object instance to deser... | Deserializes the content of the object from the <code>com.google.gwt.user.client.rpc.SerializationStreamReader</code> | deserializeInstance | {
"repo_name": "matthewhorridge/owlapi-gwt",
"path": "owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLLiteralImplDouble_CustomFieldSerializer.java",
"license": "lgpl-3.0",
"size": 4114
} | [
"com.google.gwt.user.client.rpc.SerializationException",
"com.google.gwt.user.client.rpc.SerializationStreamReader"
] | import com.google.gwt.user.client.rpc.SerializationException; import com.google.gwt.user.client.rpc.SerializationStreamReader; | import com.google.gwt.user.client.rpc.*; | [
"com.google.gwt"
] | com.google.gwt; | 118,836 |
public void stopRecord(){
if(recording){
recording = false;
//time at current point
recordJumpLand();
endTime();
switch(direction){
case 1:
endRightMoveRecord();
break;
case -1:
endLeftMoveRecord();
break;
}
if(levelScene.mario.running){
endRu... | void function(){ if(recording){ recording = false; recordJumpLand(); endTime(); switch(direction){ case 1: endRightMoveRecord(); break; case -1: endLeftMoveRecord(); break; } if(levelScene.mario.running){ endRunningRecord(); } if(levelScene.mario.ducking){ endDuckRecord(); } if(Mario.large && !Mario.fire){ endLargeReco... | /**
* Closes all of the recording, this should commit the data?
*/ | Closes all of the recording, this should commit the data | stopRecord | {
"repo_name": "takeoutweight/evolution-of-fun",
"path": "src/java/dk/itu/mario/engine/DataRecorder.java",
"license": "mit",
"size": 23444
} | [
"dk.itu.mario.engine.sprites.Mario"
] | import dk.itu.mario.engine.sprites.Mario; | import dk.itu.mario.engine.sprites.*; | [
"dk.itu.mario"
] | dk.itu.mario; | 817,276 |
@VisibleForTesting
static void configureColumnInfoList(Configuration conf, List<ColumnInfo> columnInfoList) {
conf.set(COLUMN_INFO_CONFKEY, Joiner.on("|").useForNull("").join(columnInfoList));
} | static void configureColumnInfoList(Configuration conf, List<ColumnInfo> columnInfoList) { conf.set(COLUMN_INFO_CONFKEY, Joiner.on(" ").useForNull("").join(columnInfoList)); } | /**
* Write the list of to-import columns to a job configuration.
*
* @param conf configuration to be written to
* @param columnInfoList list of ColumnInfo objects to be configured for import
*/ | Write the list of to-import columns to a job configuration | configureColumnInfoList | {
"repo_name": "AyolaJayamaha/phoenix",
"path": "phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToBytesWritableMapper.java",
"license": "apache-2.0",
"size": 16514
} | [
"com.google.common.base.Joiner",
"java.util.List",
"org.apache.hadoop.conf.Configuration",
"org.apache.phoenix.util.ColumnInfo"
] | import com.google.common.base.Joiner; import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.phoenix.util.ColumnInfo; | import com.google.common.base.*; import java.util.*; import org.apache.hadoop.conf.*; import org.apache.phoenix.util.*; | [
"com.google.common",
"java.util",
"org.apache.hadoop",
"org.apache.phoenix"
] | com.google.common; java.util; org.apache.hadoop; org.apache.phoenix; | 367,750 |
public void createGroup(GroupForm groupForm, JsonEntityBean parent, IPerson creator) {
if (!canCreateMemberGroup(creator, parent.getId())) {
throw new RuntimeAuthorizationException(creator, IPermission.CREATE_GROUP_ACTIVITY, groupForm.getKey());
}
if (log.isDebugEnabled()) {
log.d... | void function(GroupForm groupForm, JsonEntityBean parent, IPerson creator) { if (!canCreateMemberGroup(creator, parent.getId())) { throw new RuntimeAuthorizationException(creator, IPermission.CREATE_GROUP_ACTIVITY, groupForm.getKey()); } if (log.isDebugEnabled()) { log.debug(STR + groupForm.toString() + STR + parent.to... | /**
* Create a new group under the specified parent. The new group will
* automatically be added to the parent group.
*
* @param groupForm form object representing the new group
* @param parent parent group for this new group
* @param creator the uPortal user creating t... | Create a new group under the specified parent. The new group will automatically be added to the parent group | createGroup | {
"repo_name": "ASU-Capstone/uPortal",
"path": "uportal-war/src/main/java/org/jasig/portal/portlets/groupadmin/GroupAdministrationHelper.java",
"license": "apache-2.0",
"size": 10535
} | [
"org.jasig.portal.groups.IEntityGroup",
"org.jasig.portal.groups.IGroupMember",
"org.jasig.portal.layout.dlm.remoting.JsonEntityBean",
"org.jasig.portal.portlets.groupselector.EntityEnum",
"org.jasig.portal.security.IPermission",
"org.jasig.portal.security.IPerson",
"org.jasig.portal.security.RuntimeAut... | import org.jasig.portal.groups.IEntityGroup; import org.jasig.portal.groups.IGroupMember; import org.jasig.portal.layout.dlm.remoting.JsonEntityBean; import org.jasig.portal.portlets.groupselector.EntityEnum; import org.jasig.portal.security.IPermission; import org.jasig.portal.security.IPerson; import org.jasig.portal... | import org.jasig.portal.groups.*; import org.jasig.portal.layout.dlm.remoting.*; import org.jasig.portal.portlets.groupselector.*; import org.jasig.portal.security.*; import org.jasig.portal.services.*; | [
"org.jasig.portal"
] | org.jasig.portal; | 465,218 |
public void removeResourceFromUsersPubList(CmsRequestContext context, Collection<CmsUUID> structureIds)
throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
m_driverManager.removeResourceFromUsersPubList(dbc, context.getCurrentUser().getId(), stru... | void function(CmsRequestContext context, Collection<CmsUUID> structureIds) throws CmsException { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); try { m_driverManager.removeResourceFromUsersPubList(dbc, context.getCurrentUser().getId(), structureIds); } catch (Exception e) { dbc.report( null, Messages.get(... | /**
* Removes the given resource to the given user's publish list.<p>
*
* @param context the request context
* @param structureIds the collection of structure IDs to remove
*
* @throws CmsException if something goes wrong
*/ | Removes the given resource to the given user's publish list | removeResourceFromUsersPubList | {
"repo_name": "sbonoc/opencms-core",
"path": "src/org/opencms/db/CmsSecurityManager.java",
"license": "lgpl-2.1",
"size": 287876
} | [
"java.util.Collection",
"org.opencms.file.CmsRequestContext",
"org.opencms.main.CmsException",
"org.opencms.security.CmsRole",
"org.opencms.security.CmsRoleViolationException",
"org.opencms.util.CmsUUID"
] | import java.util.Collection; import org.opencms.file.CmsRequestContext; import org.opencms.main.CmsException; import org.opencms.security.CmsRole; import org.opencms.security.CmsRoleViolationException; import org.opencms.util.CmsUUID; | import java.util.*; import org.opencms.file.*; import org.opencms.main.*; import org.opencms.security.*; import org.opencms.util.*; | [
"java.util",
"org.opencms.file",
"org.opencms.main",
"org.opencms.security",
"org.opencms.util"
] | java.util; org.opencms.file; org.opencms.main; org.opencms.security; org.opencms.util; | 2,580,150 |
public boolean onBlockEventReceived(World worldIn, BlockPos pos, IBlockState state, int eventID, int eventParam)
{
return false;
} | boolean function(World worldIn, BlockPos pos, IBlockState state, int eventID, int eventParam) { return false; } | /**
* Called on both Client and Server when World#addBlockEvent is called
*/ | Called on both Client and Server when World#addBlockEvent is called | onBlockEventReceived | {
"repo_name": "aebert1/BigTransport",
"path": "build/tmp/recompileMc/sources/net/minecraft/block/Block.java",
"license": "gpl-3.0",
"size": 115325
} | [
"net.minecraft.block.state.IBlockState",
"net.minecraft.util.math.BlockPos",
"net.minecraft.world.World"
] | import net.minecraft.block.state.IBlockState; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; | import net.minecraft.block.state.*; import net.minecraft.util.math.*; import net.minecraft.world.*; | [
"net.minecraft.block",
"net.minecraft.util",
"net.minecraft.world"
] | net.minecraft.block; net.minecraft.util; net.minecraft.world; | 1,530,829 |
public void deleteSite(long siteId)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException; | void function(long siteId) throws com.liferay.portal.kernel.exception.PortalException, com.liferay.portal.kernel.exception.SystemException; | /**
* Deletes the site with the primary key from the database. Also notifies the appropriate model listeners.
*
* @param siteId the primary key of the site to delete
* @throws PortalException if a site with the primary key could not be found
* @throws SystemException if a system exception occurred
*/ | Deletes the site with the primary key from the database. Also notifies the appropriate model listeners | deleteSite | {
"repo_name": "RamkumarChandran/My-Courses-Portlet",
"path": "docroot/WEB-INF/service/org/gnenc/internet/mycourses/service/SiteLocalService.java",
"license": "gpl-3.0",
"size": 10129
} | [
"com.liferay.portal.kernel.exception.PortalException",
"com.liferay.portal.kernel.exception.SystemException"
] | import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.SystemException; | import com.liferay.portal.kernel.exception.*; | [
"com.liferay.portal"
] | com.liferay.portal; | 210,856 |
public static void deleteDirectoryContents(File directory) {
File[] files = directory.listFiles();
for (int i = 0; i < files.length; i++) {
File file = files[i];
if (file.isDirectory()) {
deleteDirectory(file); // recurse through subdirectories
... | static void function(File directory) { File[] files = directory.listFiles(); for (int i = 0; i < files.length; i++) { File file = files[i]; if (file.isDirectory()) { deleteDirectory(file); } else { if ( ! file.delete()) { throw new RuntimeException(STR + file.getAbsolutePath()); } } } } | /**
* Delete the contents of the specified directory
* (but not the directory itself).
* <em>USE WITH CARE.</em>
* File#deleteFiles()
*/ | Delete the contents of the specified directory (but not the directory itself). USE WITH CARE. File#deleteFiles() | deleteDirectoryContents | {
"repo_name": "RallySoftware/eclipselink.runtime",
"path": "utils/eclipselink.utils.workbench/utility/source/org/eclipse/persistence/tools/workbench/utility/io/FileTools.java",
"license": "epl-1.0",
"size": 35877
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 1,491,921 |
public T getData(Form form) throws ParseException {
log.warn("trying to read data from form {}, but getData(Form form) is not overwritten by {}", form, this
.getClass().getName());
return null;
} | T function(Form form) throws ParseException { log.warn(STR, form, this .getClass().getName()); return null; } | /**
* This method will be called by the skysail framework to create the actual
* resource from its form representation.
*
* @param form
* the representation of the resource as a form
* @return the resource of type T
* @throws ParseException
* parse exceptio... | This method will be called by the skysail framework to create the actual resource from its form representation | getData | {
"repo_name": "evandor/skysail",
"path": "skysail.server/src/io/skysail/server/restlet/resources/EntityServerResource.java",
"license": "apache-2.0",
"size": 7247
} | [
"java.text.ParseException",
"org.restlet.data.Form"
] | import java.text.ParseException; import org.restlet.data.Form; | import java.text.*; import org.restlet.data.*; | [
"java.text",
"org.restlet.data"
] | java.text; org.restlet.data; | 550,238 |
public Polynomial multiply(final Polynomial p) {
return new Polynomial(NumArrays.conv(_coefs, p._coefs));
}
| Polynomial function(final Polynomial p) { return new Polynomial(NumArrays.conv(_coefs, p._coefs)); } | /***
* Multiply two polynomials
*
* @param p
* Another polynomial
* @return Pnew(x) = P(x) * poly
*/ | Multiply two polynomials | multiply | {
"repo_name": "mlopz/ETK4J",
"path": "src/com/wildbitsfoundry/etk4j/math/polynomials/Polynomial.java",
"license": "apache-2.0",
"size": 14739
} | [
"com.wildbitsfoundry.etk4j.util.NumArrays"
] | import com.wildbitsfoundry.etk4j.util.NumArrays; | import com.wildbitsfoundry.etk4j.util.*; | [
"com.wildbitsfoundry.etk4j"
] | com.wildbitsfoundry.etk4j; | 1,867,130 |
public Object value(InternalContextAdapter context)
{
if (interpolate)
{
try
{
Writer writer = new StringBuilderWriter();
nodeTree.render(context, writer);
return writer.toString();
... | Object function(InternalContextAdapter context) { if (interpolate) { try { Writer writer = new StringBuilderWriter(); nodeTree.render(context, writer); return writer.toString(); } catch (RuntimeException e) { throw e; } catch (IOException e) { String msg = STR; log.error(msg, e); throw new VelocityException(msg, e, rsv... | /**
* renders the value of the string literal If the properties allow, and the
* string literal contains a $ or a # the literal is rendered against the
* context Otherwise, the stringlit is returned.
*
* @param context
* @return result of the rendering.
*/ | renders the value of the string literal If the properties allow, and the string literal contains a $ or a # the literal is rendered against the context Otherwise, the stringlit is returned | value | {
"repo_name": "apache/velocity-engine",
"path": "velocity-engine-core/src/main/java/org/apache/velocity/runtime/parser/node/ASTStringLiteral.java",
"license": "apache-2.0",
"size": 11213
} | [
"java.io.IOException",
"java.io.Writer",
"org.apache.velocity.context.InternalContextAdapter",
"org.apache.velocity.exception.VelocityException",
"org.apache.velocity.util.StringBuilderWriter"
] | import java.io.IOException; import java.io.Writer; import org.apache.velocity.context.InternalContextAdapter; import org.apache.velocity.exception.VelocityException; import org.apache.velocity.util.StringBuilderWriter; | import java.io.*; import org.apache.velocity.context.*; import org.apache.velocity.exception.*; import org.apache.velocity.util.*; | [
"java.io",
"org.apache.velocity"
] | java.io; org.apache.velocity; | 343,390 |
public final boolean isForUpdate()
{
if (theResults instanceof NoPutResultSet)
return ((NoPutResultSet) theResults).isForUpdate();
return false;
} | final boolean function() { if (theResults instanceof NoPutResultSet) return ((NoPutResultSet) theResults).isForUpdate(); return false; } | /**
* * Is this result set from a select for update statement?
*/ | Is this result set from a select for update statement | isForUpdate | {
"repo_name": "viaper/DBPlus",
"path": "DerbyHodgepodge/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java",
"license": "apache-2.0",
"size": 178663
} | [
"org.apache.derby.iapi.sql.execute.NoPutResultSet"
] | import org.apache.derby.iapi.sql.execute.NoPutResultSet; | import org.apache.derby.iapi.sql.execute.*; | [
"org.apache.derby"
] | org.apache.derby; | 348,583 |
public static PairGraph createZeroEdgePairGraph(int numBindings,
boolean sequentialActivityIds) {
return new PairGraph(createBindingGroup(numBindings,
sequentialActivityIds), alwaysZeroHeuristic);
}
/**
* Creates a {@link BindingGroup} with the given number of {@link Binding} | static PairGraph function(int numBindings, boolean sequentialActivityIds) { return new PairGraph(createBindingGroup(numBindings, sequentialActivityIds), alwaysZeroHeuristic); } /** * Creates a {@link BindingGroup} with the given number of {@link Binding} | /**
* Creates a {@link PairGraph} such that no edges are created between
* {@link Binding} objects. Observation IDs are numbered incrementally from
* 1-n where n is the number of {@link Binding} nodes.
*
* @param numBindings
* Number of {@link Binding} objects to use
* @return PairGraph object... | Creates a <code>PairGraph</code> such that no edges are created between <code>Binding</code> objects. Observation IDs are numbered incrementally from 1-n where n is the number of <code>Binding</code> nodes | createZeroEdgePairGraph | {
"repo_name": "plamenbbn/XDATA",
"path": "pint/process-alignment/test/com/bbn/c2s2/pint/testdata/PairGraphFactory.java",
"license": "apache-2.0",
"size": 6371
} | [
"com.bbn.c2s2.pint.Binding",
"com.bbn.c2s2.pint.BindingGroup",
"com.bbn.c2s2.pint.pf.PairGraph"
] | import com.bbn.c2s2.pint.Binding; import com.bbn.c2s2.pint.BindingGroup; import com.bbn.c2s2.pint.pf.PairGraph; | import com.bbn.c2s2.pint.*; import com.bbn.c2s2.pint.pf.*; | [
"com.bbn.c2s2"
] | com.bbn.c2s2; | 1,894,659 |
public int removeChannels(String sessionKey, List<Number> serverIds,
List<String> configChannelLabels) {
User loggedInUser = getLoggedInUser(sessionKey);
XmlRpcSystemHelper helper = XmlRpcSystemHelper.getInstance();
List<Server> servers = helper.lookupServers(loggedInUser, server... | int function(String sessionKey, List<Number> serverIds, List<String> configChannelLabels) { User loggedInUser = getLoggedInUser(sessionKey); XmlRpcSystemHelper helper = XmlRpcSystemHelper.getInstance(); List<Server> servers = helper.lookupServers(loggedInUser, serverIds); XmlRpcConfigChannelHelper configHelper = XmlRpc... | /**
* removes selected channels from list of config channels provided
* for a given list of servers.
* @param sessionKey the sessionkey needed for authentication
* @param serverIds the list of server ids.
* @param configChannelLabels sets channels labels
* @return 1 on success 0 on failure... | removes selected channels from list of config channels provided for a given list of servers | removeChannels | {
"repo_name": "dmacvicar/spacewalk",
"path": "java/code/src/com/redhat/rhn/frontend/xmlrpc/system/config/ServerConfigHandler.java",
"license": "gpl-2.0",
"size": 26415
} | [
"com.redhat.rhn.domain.config.ConfigChannel",
"com.redhat.rhn.domain.config.ConfigChannelListProcessor",
"com.redhat.rhn.domain.server.Server",
"com.redhat.rhn.domain.user.User",
"com.redhat.rhn.frontend.xmlrpc.configchannel.XmlRpcConfigChannelHelper",
"com.redhat.rhn.frontend.xmlrpc.system.XmlRpcSystemHe... | import com.redhat.rhn.domain.config.ConfigChannel; import com.redhat.rhn.domain.config.ConfigChannelListProcessor; import com.redhat.rhn.domain.server.Server; import com.redhat.rhn.domain.user.User; import com.redhat.rhn.frontend.xmlrpc.configchannel.XmlRpcConfigChannelHelper; import com.redhat.rhn.frontend.xmlrpc.syst... | import com.redhat.rhn.domain.config.*; import com.redhat.rhn.domain.server.*; import com.redhat.rhn.domain.user.*; import com.redhat.rhn.frontend.xmlrpc.configchannel.*; import com.redhat.rhn.frontend.xmlrpc.system.*; import java.util.*; | [
"com.redhat.rhn",
"java.util"
] | com.redhat.rhn; java.util; | 827,980 |
@Override // NameNodeMXBean
public String getVersion() {
return VersionInfo.getVersion() + ", r" + VersionInfo.getRevision();
} | @Override String function() { return VersionInfo.getVersion() + STR + VersionInfo.getRevision(); } | /**
* Class representing Namenode information for JMX interfaces
*/ | Class representing Namenode information for JMX interfaces | getVersion | {
"repo_name": "songweijia/fffs",
"path": "sources/hadoop-2.4.1-src/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java",
"license": "apache-2.0",
"size": 292274
} | [
"org.apache.hadoop.util.VersionInfo"
] | import org.apache.hadoop.util.VersionInfo; | import org.apache.hadoop.util.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 2,724,497 |
public SizeValue getAsSize(String setting, SizeValue defaultValue) throws SettingsException {
return parseSizeValue(get(setting), defaultValue);
} | SizeValue function(String setting, SizeValue defaultValue) throws SettingsException { return parseSizeValue(get(setting), defaultValue); } | /**
* Returns the setting value (as size) associated with the setting key. If it does not exists,
* returns the default value provided.
*/ | Returns the setting value (as size) associated with the setting key. If it does not exists, returns the default value provided | getAsSize | {
"repo_name": "fred84/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/common/settings/Settings.java",
"license": "apache-2.0",
"size": 58320
} | [
"org.elasticsearch.common.unit.SizeValue"
] | import org.elasticsearch.common.unit.SizeValue; | import org.elasticsearch.common.unit.*; | [
"org.elasticsearch.common"
] | org.elasticsearch.common; | 1,011,999 |
public TiglPoint wingGetChordNormal(final int wingIndex, final int segmentIndex, final double eta, final double xsi) throws TiglException {
TiglPoint point = new TiglPoint();
checkTiglConfiguration();
DoubleByReference pointX = new DoubleByReference();
DoubleByReference pointY = ne... | TiglPoint function(final int wingIndex, final int segmentIndex, final double eta, final double xsi) throws TiglException { TiglPoint point = new TiglPoint(); checkTiglConfiguration(); DoubleByReference pointX = new DoubleByReference(); DoubleByReference pointY = new DoubleByReference(); DoubleByReference pointZ = new D... | /**
* Returns the normal direction of the wing chord surface for a given eta, xsi coordinate
*
* @param wingIndex - The index number of the wing.
* @param segmentIndex- the segment index where the relative coordinates belong to.
* @param eta - the eta coordinate, going from 0 - 1
* @param... | Returns the normal direction of the wing chord surface for a given eta, xsi coordinate | wingGetChordNormal | {
"repo_name": "DLR-SC/tigl",
"path": "bindings/java/src/de/dlr/sc/tigl3/CpacsConfiguration.java",
"license": "apache-2.0",
"size": 96943
} | [
"com.sun.jna.ptr.DoubleByReference"
] | import com.sun.jna.ptr.DoubleByReference; | import com.sun.jna.ptr.*; | [
"com.sun.jna"
] | com.sun.jna; | 1,715,833 |
public void endElement(String namespaceURI, String localName, String name)
throws org.xml.sax.SAXException
{
if (m_inEntityRef)
return;
// namespaces declared at the current depth are no longer valid
// so get rid of them
m_prefixMap.popNamespaces(m_elemCont... | void function(String namespaceURI, String localName, String name) throws org.xml.sax.SAXException { if (m_inEntityRef) return; m_prefixMap.popNamespaces(m_elemContext.m_currentElemDepth, null); try { final java.io.Writer writer = m_writer; if (m_elemContext.m_startTagOpen) { if (m_tracer != null) super.fireStartElem(m_... | /**
* Receive notification of the end of an element.
*
*
* @param namespaceURI The Namespace URI, or the empty string if the
* element has no Namespace URI or if Namespace
* processing is not being performed.
* @param localName The local name (without prefix), or the
... | Receive notification of the end of an element | endElement | {
"repo_name": "karianna/jdk8_tl",
"path": "jaxp/src/com/sun/org/apache/xml/internal/serializer/ToStream.java",
"license": "gpl-2.0",
"size": 110211
} | [
"java.io.IOException",
"java.io.Writer",
"org.xml.sax.SAXException"
] | import java.io.IOException; import java.io.Writer; import org.xml.sax.SAXException; | import java.io.*; import org.xml.sax.*; | [
"java.io",
"org.xml.sax"
] | java.io; org.xml.sax; | 2,719,831 |
private TextInput getSingleInput (final String paramId,
final int maxLength, boolean notEmpty, IWContext iwc) {
TextInput textInput = (TextInput) getStyledInterface
(new TextInput(paramId));
textInput.setMaxlength(maxLength);
if (notEmpty) {
... | TextInput function (final String paramId, final int maxLength, boolean notEmpty, IWContext iwc) { TextInput textInput = (TextInput) getStyledInterface (new TextInput(paramId)); textInput.setMaxlength(maxLength); if (notEmpty) { final String fieldCanNotBeEmpty = localize (ERROR_FIELD_CAN_NOT_BE_EMPTY_KEY, ERROR_FIELD_CA... | /**
* Gets input field for the social security number.
* @param iwc
* @param paramID
* @param maxLength
* @param notEmpty
* @return the input field
*/ | Gets input field for the social security number | getSingleInput | {
"repo_name": "idega/platform2",
"path": "src/se/idega/idegaweb/commune/account/citizen/presentation/CitizenAccountForgottenPassword.java",
"license": "gpl-3.0",
"size": 17732
} | [
"com.idega.presentation.IWContext",
"com.idega.presentation.ui.TextInput"
] | import com.idega.presentation.IWContext; import com.idega.presentation.ui.TextInput; | import com.idega.presentation.*; import com.idega.presentation.ui.*; | [
"com.idega.presentation"
] | com.idega.presentation; | 926,674 |
@Override
public void clearSlotStorage() throws AndesException {
try {
wrappedAndesContextStoreInstance.clearSlotStorage();
} catch (AndesStoreUnavailableException exception) {
notifyFailures(exception);
throw exception;
}
}
/**
* {@inher... | void function() throws AndesException { try { wrappedAndesContextStoreInstance.clearSlotStorage(); } catch (AndesStoreUnavailableException exception) { notifyFailures(exception); throw exception; } } /** * {@inheritDoc} | /**
* Clear and reset slot storage
*
* @throws AndesException
*/ | Clear and reset slot storage | clearSlotStorage | {
"repo_name": "pumudu88/andes",
"path": "modules/andes-core/broker/src/main/java/org/wso2/andes/store/FailureObservingAndesContextStore.java",
"license": "apache-2.0",
"size": 35769
} | [
"org.wso2.andes.kernel.AndesException"
] | import org.wso2.andes.kernel.AndesException; | import org.wso2.andes.kernel.*; | [
"org.wso2.andes"
] | org.wso2.andes; | 824,550 |
private Object getColumnValue(ResultSetMetaData metaData,
Class<?>[] expectedColumnTypes, ResultSet result, int i, Calendar cal)
throws SQLException, IOException {
Object o = null;
Class<?> expectedColumnType = expectedColumnTypes[i - 1];
try {
if (expectedColumnType.equals(String.class... | Object function(ResultSetMetaData metaData, Class<?>[] expectedColumnTypes, ResultSet result, int i, Calendar cal) throws SQLException, IOException { Object o = null; Class<?> expectedColumnType = expectedColumnTypes[i - 1]; try { if (expectedColumnType.equals(String.class)) { switch (metaData.getColumnType(i)) { case ... | /**
* Helper function to get the value of a column as an object. We know which
* types we want to get.
*
* @param metaData
* The select meta data
* @param expectedColumnTypes
* An array of classes for the column types expected.
* @param result
* the result set
*... | Helper function to get the value of a column as an object. We know which types we want to get | getColumnValue | {
"repo_name": "elminsterjimmy/java",
"path": "EasyDaoFramework/src/main/java/com/elminster/easydao/db/query/Query.java",
"license": "apache-2.0",
"size": 51492
} | [
"java.io.IOException",
"java.math.BigDecimal",
"java.sql.ResultSet",
"java.sql.ResultSetMetaData",
"java.sql.SQLException",
"java.sql.Timestamp",
"java.sql.Types",
"java.util.Calendar"
] | import java.io.IOException; import java.math.BigDecimal; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Timestamp; import java.sql.Types; import java.util.Calendar; | import java.io.*; import java.math.*; import java.sql.*; import java.util.*; | [
"java.io",
"java.math",
"java.sql",
"java.util"
] | java.io; java.math; java.sql; java.util; | 2,050,530 |
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public int getCountriesCount(); | @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) int function(); | /**
* Returns the number of countries.
*
* @return the number of countries
*/ | Returns the number of countries | getCountriesCount | {
"repo_name": "gamerson/liferay-blade-samples",
"path": "maven/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/service/CountryLocalService.java",
"license": "apache-2.0",
"size": 10333
} | [
"com.liferay.portal.kernel.transaction.Propagation",
"com.liferay.portal.kernel.transaction.Transactional"
] | import com.liferay.portal.kernel.transaction.Propagation; import com.liferay.portal.kernel.transaction.Transactional; | import com.liferay.portal.kernel.transaction.*; | [
"com.liferay.portal"
] | com.liferay.portal; | 1,660,268 |
public IITWindow getItem(int lastParam) {
return new IITWindow(Dispatch.call(this, "Item", new Variant(lastParam)).toDispatch());
} | IITWindow function(int lastParam) { return new IITWindow(Dispatch.call(this, "Item", new Variant(lastParam)).toDispatch()); } | /**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
*
* @param lastParam an input-parameter of type int
* @return the result is of type IITWindow
*/ | Wrapper for calling the ActiveX-Method with input-parameter(s) | getItem | {
"repo_name": "cpesch/MetaMusic",
"path": "itunes-com-library/src/main/java/slash/metamusic/itunes/com/binding/IITWindowCollection.java",
"license": "gpl-2.0",
"size": 2104
} | [
"com.jacob.com.Dispatch",
"com.jacob.com.Variant"
] | import com.jacob.com.Dispatch; import com.jacob.com.Variant; | import com.jacob.com.*; | [
"com.jacob.com"
] | com.jacob.com; | 603,504 |
public Color getColor() {
return color;
}
| Color function() { return color; } | /**
* Retorna el color de fondo del MuComponente
*
* @return Color de fondo del MuComponente
*/ | Retorna el color de fondo del MuComponente | getColor | {
"repo_name": "Mujuanp/Mu",
"path": "src/MU/IGU/contenedores/MuComponente.java",
"license": "gpl-3.0",
"size": 1664
} | [
"java.awt.Color"
] | import java.awt.Color; | import java.awt.*; | [
"java.awt"
] | java.awt; | 1,456,535 |
public static IEditorPart openModuleEditor(IFile diagramFile) {
if (diagramFile == null) {
return null;
}
IWorkbenchPage workbenchPage = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage();
IEditorDescriptor desc = PlatformUI.getWorkbench().getEditorRegistry()
.getDefaultE... | static IEditorPart function(IFile diagramFile) { if (diagramFile == null) { return null; } IWorkbenchPage workbenchPage = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getActivePage(); IEditorDescriptor desc = PlatformUI.getWorkbench().getEditorRegistry() .getDefaultEditor(diagramFile.getName()); if (desc != nu... | /**
* Opens the module diagram.
*
* @param diagramFile the diagram file.
* @return the opened module editor.
*/ | Opens the module diagram | openModuleEditor | {
"repo_name": "kuriking/testdc2",
"path": "net.dependableos.dcase.diagram/src/net/dependableos/dcase/diagram/part/PatternUtil.java",
"license": "epl-1.0",
"size": 34627
} | [
"org.eclipse.core.resources.IFile",
"org.eclipse.ui.IEditorDescriptor",
"org.eclipse.ui.IEditorPart",
"org.eclipse.ui.IWorkbenchPage",
"org.eclipse.ui.PlatformUI",
"org.eclipse.ui.part.FileEditorInput"
] | import org.eclipse.core.resources.IFile; import org.eclipse.ui.IEditorDescriptor; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.part.FileEditorInput; | import org.eclipse.core.resources.*; import org.eclipse.ui.*; import org.eclipse.ui.part.*; | [
"org.eclipse.core",
"org.eclipse.ui"
] | org.eclipse.core; org.eclipse.ui; | 1,141,080 |
@Override public Table clone()
{
int i, j;
SubTable tab = new SubTable();
tab.m = m;
tab.n = n;
tab.t = new int [m][v.length];
tab.v = new int [v.length];
tab.s = new int [s.length];
for (i = 0; i < m; i++)
{
for (j = 0; j < v.length; j++)
{
tab.t[i][j] = t[i][j];
}
}
for... | @Override Table function() { int i, j; SubTable tab = new SubTable(); tab.m = m; tab.n = n; tab.t = new int [m][v.length]; tab.v = new int [v.length]; tab.s = new int [s.length]; for (i = 0; i < m; i++) { for (j = 0; j < v.length; j++) { tab.t[i][j] = t[i][j]; } } for (i = 0; i < v.length; i++) { tab.v[i] = v[i]; } for... | /**
* Clones whole table - that is returns new object Table, containing separated copy of the table array, the attributes description array, and the attributes subset array.
* @return Clone of the object.
*/ | Clones whole table - that is returns new object Table, containing separated copy of the table array, the attributes description array, and the attributes subset array | clone | {
"repo_name": "mateka/dmexl",
"path": "bn/src/main/java/pl/edu/mimuw/bn/SubTable.java",
"license": "bsd-3-clause",
"size": 10078
} | [
"java.util.HashMap"
] | import java.util.HashMap; | import java.util.*; | [
"java.util"
] | java.util; | 1,986,227 |
@Nullable public <T> T removeMeta(int key); | @Nullable <T> T function(int key); | /**
* Removes metadata by key.
*
* @param key Key of the metadata to remove.
* @param <T> Type of the value.
* @return Value of removed metadata or {@code null}.
*/ | Removes metadata by key | removeMeta | {
"repo_name": "ryanzz/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteInternalTx.java",
"license": "apache-2.0",
"size": 20204
} | [
"org.jetbrains.annotations.Nullable"
] | import org.jetbrains.annotations.Nullable; | import org.jetbrains.annotations.*; | [
"org.jetbrains.annotations"
] | org.jetbrains.annotations; | 445,110 |
Observable<ServiceResponse<byte[]>> getBase64UrlEncodedWithServiceResponseAsync(); | Observable<ServiceResponse<byte[]>> getBase64UrlEncodedWithServiceResponseAsync(); | /**
* Get value that is base64url encoded.
*
* @return the observable to the byte[] object
*/ | Get value that is base64url encoded | getBase64UrlEncodedWithServiceResponseAsync | {
"repo_name": "anudeepsharma/autorest",
"path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/bodystring/Strings.java",
"license": "mit",
"size": 17112
} | [
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.rest.ServiceResponse; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 475,569 |
public Frame decorrelateRel(Values rel) {
// There are no inputs, so rel does not need to be changed.
return null;
} | Frame function(Values rel) { return null; } | /**
* Rewrites a {@link Values}.
*
* @param rel Values to be rewritten
*/ | Rewrites a <code>Values</code> | decorrelateRel | {
"repo_name": "apache/flink",
"path": "flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/rules/logical/SubQueryDecorrelator.java",
"license": "apache-2.0",
"size": 64938
} | [
"org.apache.calcite.rel.core.Values"
] | import org.apache.calcite.rel.core.Values; | import org.apache.calcite.rel.core.*; | [
"org.apache.calcite"
] | org.apache.calcite; | 2,025,385 |
@Test
public void wrappedXhtmlWithSingleElem()
throws DocumentException, XmlParseException {
logInfo("Source TEXT:\n%1$s", wrappedXhtmlSingleElem);
ByteArrayInputStream bais = new ByteArrayInputStream(wrappedXhtmlSingleElem.getBytes());
Element legacyElem = parseXMLusingDom4j(bais, E... | void function() throws DocumentException, XmlParseException { logInfo(STR, wrappedXhtmlSingleElem); ByteArrayInputStream bais = new ByteArrayInputStream(wrappedXhtmlSingleElem.getBytes()); Element legacyElem = parseXMLusingDom4j(bais, Element.XMLElement.mFactory); bais.reset(); Element elem = Element.parseXML(bais); lo... | /**
* input text contains xhtml which only has one sub-element - i.e. it isn't mixed text
*/ | input text contains xhtml which only has one sub-element - i.e. it isn't mixed text | wrappedXhtmlWithSingleElem | {
"repo_name": "nico01f/z-pec",
"path": "ZimbraCommon/src/java-test/com/zimbra/common/soap/ElementTest.java",
"license": "mit",
"size": 23419
} | [
"com.zimbra.common.soap.Element",
"java.io.ByteArrayInputStream",
"org.dom4j.DocumentException",
"org.junit.Assert"
] | import com.zimbra.common.soap.Element; import java.io.ByteArrayInputStream; import org.dom4j.DocumentException; import org.junit.Assert; | import com.zimbra.common.soap.*; import java.io.*; import org.dom4j.*; import org.junit.*; | [
"com.zimbra.common",
"java.io",
"org.dom4j",
"org.junit"
] | com.zimbra.common; java.io; org.dom4j; org.junit; | 1,431,423 |
private void initConnection() throws IOException {
users = new CopyOnWriteArrayList<>();
socket = new Socket();
connected = false;
socket.connect(new InetSocketAddress(host, port));
reader = new Scanner(socket.getInputStream());
writer = new PrintWriter(socket.getOu... | void function() throws IOException { users = new CopyOnWriteArrayList<>(); socket = new Socket(); connected = false; socket.connect(new InetSocketAddress(host, port)); reader = new Scanner(socket.getInputStream()); writer = new PrintWriter(socket.getOutputStream(), true); writer.println(STR + username); String temp = r... | /**
* Sets up the initial connection and begins receiving messages immediately
*/ | Sets up the initial connection and begins receiving messages immediately | initConnection | {
"repo_name": "NikiSkaarup/CA1ClientLib",
"path": "src/main/java/io/skaarup/Client.java",
"license": "mit",
"size": 5474
} | [
"java.io.IOException",
"java.io.PrintWriter",
"java.net.InetSocketAddress",
"java.net.Socket",
"java.util.Arrays",
"java.util.Scanner",
"java.util.concurrent.CopyOnWriteArrayList"
] | import java.io.IOException; import java.io.PrintWriter; import java.net.InetSocketAddress; import java.net.Socket; import java.util.Arrays; import java.util.Scanner; import java.util.concurrent.CopyOnWriteArrayList; | import java.io.*; import java.net.*; import java.util.*; import java.util.concurrent.*; | [
"java.io",
"java.net",
"java.util"
] | java.io; java.net; java.util; | 899,973 |
private void writeShortTagPayload(final ShortTag tag) throws IOException {
os.writeShort(tag.getValue());
}
| void function(final ShortTag tag) throws IOException { os.writeShort(tag.getValue()); } | /**
* Writes a <code>TAG_Short</code> tag.
*
* @param tag
* The tag.
* @throws IOException
* if an I/O error occurs.
*/ | Writes a <code>TAG_Short</code> tag | writeShortTagPayload | {
"repo_name": "CodingBadgers/Perks",
"path": "bTransported/src/uk/jnbt/NBTOutputStream.java",
"license": "gpl-2.0",
"size": 9126
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 742,388 |
public static KeyPair generateKeyPair(String algorithm, int keySize)
throws KeyczarException {
try {
KeyPairGenerator kpg = KeyPairGenerator.getInstance(algorithm);
kpg.initialize(keySize);
KeyPair pair = kpg.generateKeyPair();
return pair;
} catch (GeneralSecurityException e) {
... | static KeyPair function(String algorithm, int keySize) throws KeyczarException { try { KeyPairGenerator kpg = KeyPairGenerator.getInstance(algorithm); kpg.initialize(keySize); KeyPair pair = kpg.generateKeyPair(); return pair; } catch (GeneralSecurityException e) { throw new KeyczarException(e); } } | /**
* Generate a public/private key pair with the specified algorithm and key size.
*/ | Generate a public/private key pair with the specified algorithm and key size | generateKeyPair | {
"repo_name": "frewsxcv/keyczar",
"path": "java/code/src/org/keyczar/util/Util.java",
"license": "apache-2.0",
"size": 14671
} | [
"java.security.GeneralSecurityException",
"java.security.KeyPair",
"java.security.KeyPairGenerator",
"org.keyczar.exceptions.KeyczarException"
] | import java.security.GeneralSecurityException; import java.security.KeyPair; import java.security.KeyPairGenerator; import org.keyczar.exceptions.KeyczarException; | import java.security.*; import org.keyczar.exceptions.*; | [
"java.security",
"org.keyczar.exceptions"
] | java.security; org.keyczar.exceptions; | 1,153,723 |
private void addStaticField(ClassGenerator classGen, String type,
String name)
{
final FieldGen fgen = new FieldGen(ACC_PROTECTED|ACC_STATIC,
Util.getJCRefType(type),
name,
... | void function(ClassGenerator classGen, String type, String name) { final FieldGen fgen = new FieldGen(ACC_PROTECTED ACC_STATIC, Util.getJCRefType(type), name, classGen.getConstantPool()); classGen.addField(fgen.getField()); } | /**
* Add a static field
*/ | Add a static field | addStaticField | {
"repo_name": "srnsw/xena",
"path": "xena/ext/src/xalan-j_2_7_1/src/org/apache/xalan/xsltc/compiler/Stylesheet.java",
"license": "gpl-3.0",
"size": 53829
} | [
"org.apache.bcel.generic.FieldGen",
"org.apache.xalan.xsltc.compiler.util.ClassGenerator",
"org.apache.xalan.xsltc.compiler.util.Util"
] | import org.apache.bcel.generic.FieldGen; import org.apache.xalan.xsltc.compiler.util.ClassGenerator; import org.apache.xalan.xsltc.compiler.util.Util; | import org.apache.bcel.generic.*; import org.apache.xalan.xsltc.compiler.util.*; | [
"org.apache.bcel",
"org.apache.xalan"
] | org.apache.bcel; org.apache.xalan; | 1,368,847 |
Attributes getAttributes(); | Attributes getAttributes(); | /**
* Attributes describing stream. This is inherited from the transport attributes, and used
* as the basis of {@link io.grpc.ServerCall#getAttributes}.
*
* @return Attributes container
*/ | Attributes describing stream. This is inherited from the transport attributes, and used as the basis of <code>io.grpc.ServerCall#getAttributes</code> | getAttributes | {
"repo_name": "elandau/grpc-java",
"path": "core/src/main/java/io/grpc/internal/ServerStream.java",
"license": "apache-2.0",
"size": 2919
} | [
"io.grpc.Attributes"
] | import io.grpc.Attributes; | import io.grpc.*; | [
"io.grpc"
] | io.grpc; | 880,014 |
CompilationSupport registerCompileAndArchiveActions(ObjcCommon common)
throws RuleErrorException, InterruptedException {
return registerCompileAndArchiveActions(
common, ExtraCompileArgs.NONE, ImmutableList.<PathFragment>of());
} | CompilationSupport registerCompileAndArchiveActions(ObjcCommon common) throws RuleErrorException, InterruptedException { return registerCompileAndArchiveActions( common, ExtraCompileArgs.NONE, ImmutableList.<PathFragment>of()); } | /**
* Registers all actions necessary to compile this rule's sources and archive them.
*
* @param common common information about this rule and its dependencies
* @return this compilation support
* @throws RuleErrorException for invalid crosstool files
*/ | Registers all actions necessary to compile this rule's sources and archive them | registerCompileAndArchiveActions | {
"repo_name": "hermione521/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java",
"license": "apache-2.0",
"size": 47018
} | [
"com.google.common.collect.ImmutableList",
"com.google.devtools.build.lib.packages.RuleClass",
"com.google.devtools.build.lib.vfs.PathFragment"
] | import com.google.common.collect.ImmutableList; import com.google.devtools.build.lib.packages.RuleClass; import com.google.devtools.build.lib.vfs.PathFragment; | import com.google.common.collect.*; import com.google.devtools.build.lib.packages.*; import com.google.devtools.build.lib.vfs.*; | [
"com.google.common",
"com.google.devtools"
] | com.google.common; com.google.devtools; | 226,056 |
public CellFactorySPI getSelectedCellFactory() {
return selectedCellFactory;
}
private class CellListRenderer extends JLabel implements ListCellRenderer {
/**
* {@inheritDoc} | CellFactorySPI function() { return selectedCellFactory; } private class CellListRenderer extends JLabel implements ListCellRenderer { /** * {@inheritDoc} | /**
* Returns the selected Cell Factory SPI.
*
* @return A CellFactorySPI
*/ | Returns the selected Cell Factory SPI | getSelectedCellFactory | {
"repo_name": "AsherBond/MondocosmOS",
"path": "wonderland/modules/world/cell-selection/src/classes/org/jdesktop/wonderland/modules/cellselection/client/CellSelectionJDialog.java",
"license": "agpl-3.0",
"size": 9912
} | [
"javax.swing.JLabel",
"javax.swing.ListCellRenderer",
"org.jdesktop.wonderland.client.cell.registry.spi.CellFactorySPI"
] | import javax.swing.JLabel; import javax.swing.ListCellRenderer; import org.jdesktop.wonderland.client.cell.registry.spi.CellFactorySPI; | import javax.swing.*; import org.jdesktop.wonderland.client.cell.registry.spi.*; | [
"javax.swing",
"org.jdesktop.wonderland"
] | javax.swing; org.jdesktop.wonderland; | 777,853 |
public static Writer getWriter(OutputStream os, Charset charset) throws IOException {
if(charset==null) charset=SystemUtil.getCharset();
return new BufferedWriter(new OutputStreamWriter(os,charset));
} | static Writer function(OutputStream os, Charset charset) throws IOException { if(charset==null) charset=SystemUtil.getCharset(); return new BufferedWriter(new OutputStreamWriter(os,charset)); } | /**
* returns a Reader for the given InputStream
* @param is
* @param charset
* @return Reader
* @throws IOException
*/ | returns a Reader for the given InputStream | getWriter | {
"repo_name": "JordanReiter/railo",
"path": "railo-java/railo-core/src/railo/commons/io/IOUtil.java",
"license": "lgpl-2.1",
"size": 29860
} | [
"java.io.BufferedWriter",
"java.io.IOException",
"java.io.OutputStream",
"java.io.OutputStreamWriter",
"java.io.Writer",
"java.nio.charset.Charset"
] | import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.Writer; import java.nio.charset.Charset; | import java.io.*; import java.nio.charset.*; | [
"java.io",
"java.nio"
] | java.io; java.nio; | 1,886,608 |
return RDataFactory.createEvaluatedPromise(state, constantExpression, constantValue);
} | return RDataFactory.createEvaluatedPromise(state, constantExpression, constantValue); } | /**
* Creates a new {@link RPromise} every time.
*/ | Creates a new <code>RPromise</code> every time | execute | {
"repo_name": "akunft/fastr",
"path": "com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/opt/OptConstantPromiseNode.java",
"license": "gpl-2.0",
"size": 2455
} | [
"com.oracle.truffle.r.runtime.data.RDataFactory"
] | import com.oracle.truffle.r.runtime.data.RDataFactory; | import com.oracle.truffle.r.runtime.data.*; | [
"com.oracle.truffle"
] | com.oracle.truffle; | 2,790,454 |
public AccumuloVertexHandler getVertexHandler() {
return vertexHandler;
} | AccumuloVertexHandler function() { return vertexHandler; } | /**
* Get vertex handler
*
* @return vertex handler
*/ | Get vertex handler | getVertexHandler | {
"repo_name": "niklasteichmann/gradoop",
"path": "gradoop-store/gradoop-accumulo/src/main/java/org/gradoop/storage/config/GradoopAccumuloConfig.java",
"license": "apache-2.0",
"size": 6187
} | [
"org.gradoop.storage.impl.accumulo.handler.AccumuloVertexHandler"
] | import org.gradoop.storage.impl.accumulo.handler.AccumuloVertexHandler; | import org.gradoop.storage.impl.accumulo.handler.*; | [
"org.gradoop.storage"
] | org.gradoop.storage; | 942,779 |
public SkyframeAnalysisResult analyzeAndExecuteTargets(
ExtendedEventHandler eventHandler,
List<ConfiguredTargetKey> ctKeys,
ImmutableList<TopLevelAspectsKey> topLevelAspectsKey,
TopLevelArtifactContext topLevelArtifactContextForConflictPruning,
boolean keepGoing,
int numThreads,
... | SkyframeAnalysisResult function( ExtendedEventHandler eventHandler, List<ConfiguredTargetKey> ctKeys, ImmutableList<TopLevelAspectsKey> topLevelAspectsKey, TopLevelArtifactContext topLevelArtifactContextForConflictPruning, boolean keepGoing, int numThreads, int cpuHeavySkyKeysThreadPoolSize, int mergedPhasesExecutionJo... | /**
* Performs analysis & execution of the CTs and aspects with Skyframe.
*
* @return the configured targets that should be built along with a WalkableGraph of the analysis.
* TODO(b/199053098) Have a more appropriate return type.
*/ | Performs analysis & execution of the CTs and aspects with Skyframe | analyzeAndExecuteTargets | {
"repo_name": "perezd/bazel",
"path": "src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java",
"license": "apache-2.0",
"size": 56411
} | [
"com.google.common.collect.ImmutableList",
"com.google.common.collect.ImmutableMap",
"com.google.common.collect.Lists",
"com.google.common.collect.Maps",
"com.google.devtools.build.lib.analysis.AspectValue",
"com.google.devtools.build.lib.analysis.ConfiguredAspect",
"com.google.devtools.build.lib.analys... | import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.devtools.build.lib.analysis.AspectValue; import com.google.devtools.build.lib.analysis.ConfiguredAspect; import com.google.devto... | import com.google.common.collect.*; import com.google.devtools.build.lib.analysis.*; import com.google.devtools.build.lib.events.*; import com.google.devtools.build.lib.profiler.*; import com.google.devtools.build.lib.skyframe.*; import com.google.devtools.build.skyframe.*; import java.util.*; import java.util.stream.*... | [
"com.google.common",
"com.google.devtools",
"java.util"
] | com.google.common; com.google.devtools; java.util; | 1,068,606 |
@Test (timeout=60000)
public void testListCacheDirectives() throws Exception {
final int poolCount = 7;
HashSet<String> poolNames = new HashSet<String>(poolCount);
Path path = new Path("/p");
for (int i=0; i<poolCount; i++) {
String poolName = "testListCacheDirectives-" + i;
CacheDirecti... | @Test (timeout=60000) void function() throws Exception { final int poolCount = 7; HashSet<String> poolNames = new HashSet<String>(poolCount); Path path = new Path("/p"); for (int i=0; i<poolCount; i++) { String poolName = STR + i; CacheDirectiveInfo directiveInfo = new CacheDirectiveInfo.Builder().setPool(poolName).set... | /**
* Add a list of cache directives, list cache directives,
* switch active NN, and list cache directives again.
*/ | Add a list of cache directives, list cache directives, switch active NN, and list cache directives again | testListCacheDirectives | {
"repo_name": "NJUJYB/disYarn",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestRetryCacheWithHA.java",
"license": "apache-2.0",
"size": 45234
} | [
"java.util.EnumSet",
"java.util.HashSet",
"org.apache.hadoop.fs.CacheFlag",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.hdfs.protocol.CacheDirectiveInfo",
"org.apache.hadoop.hdfs.protocol.CachePoolInfo",
"org.junit.Test"
] | import java.util.EnumSet; import java.util.HashSet; import org.apache.hadoop.fs.CacheFlag; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hdfs.protocol.CacheDirectiveInfo; import org.apache.hadoop.hdfs.protocol.CachePoolInfo; import org.junit.Test; | import java.util.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hdfs.protocol.*; import org.junit.*; | [
"java.util",
"org.apache.hadoop",
"org.junit"
] | java.util; org.apache.hadoop; org.junit; | 2,737,385 |
protected void setNewAssignmentParameters(RunData data, boolean validify)
{
// read the form inputs
SessionState state = ((JetspeedRunData) data).getPortletSessionState(((JetspeedRunData) data).getJs_peid());
ParameterParser params = data.getParameters();
String assignmentRef = params.getString("assignme... | void function(RunData data, boolean validify) { SessionState state = ((JetspeedRunData) data).getPortletSessionState(((JetspeedRunData) data).getJs_peid()); ParameterParser params = data.getParameters(); String assignmentRef = params.getString(STR); String title = params.getString(NEW_ASSIGNMENT_TITLE); state.setAttrib... | /**
* Action is to save the input infos for assignment fields
*
* @param validify
* Need to validify the inputs or not
*/ | Action is to save the input infos for assignment fields | setNewAssignmentParameters | {
"repo_name": "harfalm/Sakai-10.1",
"path": "assignment/assignment-tool/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java",
"license": "apache-2.0",
"size": 605178
} | [
"java.util.GregorianCalendar",
"org.sakaiproject.cheftool.JetspeedRunData",
"org.sakaiproject.cheftool.RunData",
"org.sakaiproject.component.cover.ServerConfigurationService",
"org.sakaiproject.event.api.SessionState",
"org.sakaiproject.time.api.Time",
"org.sakaiproject.time.cover.TimeService",
"org.s... | import java.util.GregorianCalendar; import org.sakaiproject.cheftool.JetspeedRunData; import org.sakaiproject.cheftool.RunData; import org.sakaiproject.component.cover.ServerConfigurationService; import org.sakaiproject.event.api.SessionState; import org.sakaiproject.time.api.Time; import org.sakaiproject.time.cover.Ti... | import java.util.*; import org.sakaiproject.cheftool.*; import org.sakaiproject.component.cover.*; import org.sakaiproject.event.api.*; import org.sakaiproject.time.api.*; import org.sakaiproject.time.cover.*; import org.sakaiproject.util.*; | [
"java.util",
"org.sakaiproject.cheftool",
"org.sakaiproject.component",
"org.sakaiproject.event",
"org.sakaiproject.time",
"org.sakaiproject.util"
] | java.util; org.sakaiproject.cheftool; org.sakaiproject.component; org.sakaiproject.event; org.sakaiproject.time; org.sakaiproject.util; | 1,498,548 |
protected boolean isReserved(String word) {
SqlAbstractParserImpl.Metadata metadata = fixture().parser().getMetadata();
return metadata.isReservedWord(word.toUpperCase(Locale.ROOT));
} | boolean function(String word) { SqlAbstractParserImpl.Metadata metadata = fixture().parser().getMetadata(); return metadata.isReservedWord(word.toUpperCase(Locale.ROOT)); } | /** Returns whether a word is reserved in this parser. This method can be
* used to disable tests that behave differently with different collections
* of reserved words. */ | Returns whether a word is reserved in this parser. This method can be used to disable tests that behave differently with different collections | isReserved | {
"repo_name": "apache/calcite",
"path": "testkit/src/main/java/org/apache/calcite/sql/parser/SqlParserTest.java",
"license": "apache-2.0",
"size": 391214
} | [
"java.util.Locale"
] | import java.util.Locale; | import java.util.*; | [
"java.util"
] | java.util; | 2,227,233 |
public GeoBoundingBoxFilterBuilder geohash(String geohash) {
topLeft = new GeoPoint();
bottomRight = new GeoPoint();
GeoHashUtils.decodeCell(geohash, topLeft, bottomRight);
return this;
} | GeoBoundingBoxFilterBuilder function(String geohash) { topLeft = new GeoPoint(); bottomRight = new GeoPoint(); GeoHashUtils.decodeCell(geohash, topLeft, bottomRight); return this; } | /**
* Adds top left and bottom right by geohash cell.
*
* @param geohash the geohash of the cell definign the boundingbox
*/ | Adds top left and bottom right by geohash cell | geohash | {
"repo_name": "exercitussolus/yolo",
"path": "src/main/java/org/elasticsearch/index/query/GeoBoundingBoxFilterBuilder.java",
"license": "agpl-3.0",
"size": 4861
} | [
"org.elasticsearch.common.geo.GeoHashUtils",
"org.elasticsearch.common.geo.GeoPoint"
] | import org.elasticsearch.common.geo.GeoHashUtils; import org.elasticsearch.common.geo.GeoPoint; | import org.elasticsearch.common.geo.*; | [
"org.elasticsearch.common"
] | org.elasticsearch.common; | 2,229,818 |
public static void display(String page) {
try {
File f = File.createTempFile("temp", ".html");
FileUtils.write(f, page);
display(f);
// f.deleteOnExit(); bad idea
} catch (IOException e) {
throw new WrappedException(e);
}
} | static void function(String page) { try { File f = File.createTempFile("temp", ".html"); FileUtils.write(f, page); display(f); } catch (IOException e) { throw new WrappedException(e); } } | /**
* Open an html page in a web browser.
*
* @param page
* This is an HTML page. It is not a url!
*/ | Open an html page in a web browser | display | {
"repo_name": "sodash/open-code",
"path": "winterwell.utils/src/com/winterwell/utils/web/WebUtils.java",
"license": "mit",
"size": 57030
} | [
"com.winterwell.utils.WrappedException",
"com.winterwell.utils.io.FileUtils",
"java.io.File",
"java.io.IOException"
] | import com.winterwell.utils.WrappedException; import com.winterwell.utils.io.FileUtils; import java.io.File; import java.io.IOException; | import com.winterwell.utils.*; import com.winterwell.utils.io.*; import java.io.*; | [
"com.winterwell.utils",
"java.io"
] | com.winterwell.utils; java.io; | 2,871,310 |
protected static void setTableStateToDisabled(final MasterProcedureEnv env,
final TableName tableName) throws IOException {
// Flip the table to disabled
env.getMasterServices().getTableStateManager().setTableState(tableName,
TableState.State.DISABLED);
LOG.info("Set {} to state={}", tableName... | static void function(final MasterProcedureEnv env, final TableName tableName) throws IOException { env.getMasterServices().getTableStateManager().setTableState(tableName, TableState.State.DISABLED); LOG.info(STR, tableName, TableState.State.DISABLED); } | /**
* Mark table state to Disabled
* @param env MasterProcedureEnv
*/ | Mark table state to Disabled | setTableStateToDisabled | {
"repo_name": "ChinmaySKulkarni/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/DisableTableProcedure.java",
"license": "apache-2.0",
"size": 13255
} | [
"java.io.IOException",
"org.apache.hadoop.hbase.TableName",
"org.apache.hadoop.hbase.client.TableState"
] | import java.io.IOException; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.TableState; | import java.io.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.client.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 2,299,884 |
@Override
public int read(byte buffer[]) throws IOException
{
return read(buffer, 0, buffer.length);
} | int function(byte buffer[]) throws IOException { return read(buffer, 0, buffer.length); } | /***
* Reads the next number of bytes from the stream into an array and
* returns the number of bytes read. Returns -1 if the end of the
* stream has been reached.
* <p>
* @param buffer The byte array in which to store the data.
* @return The number of bytes read. Returns -1 if the
... | Reads the next number of bytes from the stream into an array and returns the number of bytes read. Returns -1 if the end of the stream has been reached. | read | {
"repo_name": "rwinston/netling",
"path": "src/main/java/org/netling/io/FromNetASCIIInputStream.java",
"license": "apache-2.0",
"size": 7448
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,566,272 |
public boolean wasAnalyzed(HashId hashId) throws FileStoreException; | boolean function(HashId hashId) throws FileStoreException; | /**
* Checks whether a code with a given id was analyzed or not.
*
* @param hashId
* is the id of the file for which the analysis availability is
* to be checked.
* @return <code>true</code> is returned in case the file was analyzed
* already. <code>fals... | Checks whether a code with a given id was analyzed or not | wasAnalyzed | {
"repo_name": "PureSolTechnologies/Purifinity",
"path": "analysis/server/server/core.api/src/main/java/com/puresoltechnologies/purifinity/server/core/api/analysis/store/CommonFileStore.java",
"license": "agpl-3.0",
"size": 4964
} | [
"com.puresoltechnologies.commons.misc.hash.HashId"
] | import com.puresoltechnologies.commons.misc.hash.HashId; | import com.puresoltechnologies.commons.misc.hash.*; | [
"com.puresoltechnologies.commons"
] | com.puresoltechnologies.commons; | 1,627,003 |
IBindingSetEditpart getBindingSet(); | IBindingSetEditpart getBindingSet(); | /**
* Returns the bindingSet that is responsible to handle bindings.
*
* @return
*/ | Returns the bindingSet that is responsible to handle bindings | getBindingSet | {
"repo_name": "lunifera/lunifera-ecview",
"path": "org.lunifera.ecview.core.common/src/org/lunifera/ecview/core/common/editpart/IViewEditpart.java",
"license": "epl-1.0",
"size": 5321
} | [
"org.lunifera.ecview.core.common.editpart.binding.IBindingSetEditpart"
] | import org.lunifera.ecview.core.common.editpart.binding.IBindingSetEditpart; | import org.lunifera.ecview.core.common.editpart.binding.*; | [
"org.lunifera.ecview"
] | org.lunifera.ecview; | 1,446,886 |
static Deck shuffleDeck(Deck origDeck){
Deck sDeck = origDeck;
Random randm = new Random(System.nanoTime());
int randInt = 0;
Card temp = new Card();
for (int sIndex = DECK_SIZE; sIndex > CARD_INIT; ){
--sIndex;
randInt = randm.nextInt(sIndex);
if(randInt == ZERO){
randInt = CARD_... | static Deck shuffleDeck(Deck origDeck){ Deck sDeck = origDeck; Random randm = new Random(System.nanoTime()); int randInt = 0; Card temp = new Card(); for (int sIndex = DECK_SIZE; sIndex > CARD_INIT; ){ --sIndex; randInt = randm.nextInt(sIndex); if(randInt == ZERO){ randInt = CARD_INIT; } temp = sDeck.deck[randInt]; sDe... | /** shuffleDeck
* Randomizes a deck of cards according to the Fisher-Yates algorithm. See
* https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm
* for more details. Starting with card ID# 52, it swaps places with a
* random card from the deck, and repe... | shuffleDeck Randomizes a deck of cards according to the Fisher-Yates algorithm. See HREF for more details. Starting with card ID# 52, it swaps places with a random card from the deck, and repeats while counting downward | shuffleDeck | {
"repo_name": "dementia13/jPoker",
"path": "poker.java",
"license": "bsd-2-clause",
"size": 24086
} | [
"java.util.Random"
] | import java.util.Random; | import java.util.*; | [
"java.util"
] | java.util; | 2,560,211 |
public int setBaseUrl(String baseUrl)
{
String url = getContextBaseUrl() + "/configuration/strongbox/baseUrl/" + baseUrl;
WebTarget resource = getClientInstance().target(url);
setupAuthentication(resource);
Response response = resource.request(MediaType.TEXT_PLAIN).put(Entity.e... | int function(String baseUrl) { String url = getContextBaseUrl() + STR + baseUrl; WebTarget resource = getClientInstance().target(url); setupAuthentication(resource); Response response = resource.request(MediaType.TEXT_PLAIN).put(Entity.entity(baseUrl, MediaType.TEXT_PLAIN)); return response.getStatus(); } | /**
* Sets the base URL of the server.
*
* @param baseUrl The base URL.
* @return The response code.
*/ | Sets the base URL of the server | setBaseUrl | {
"repo_name": "ivanursul/strongbox",
"path": "strongbox-rest-client/src/main/java/org/carlspring/strongbox/client/RestClient.java",
"license": "apache-2.0",
"size": 18274
} | [
"javax.ws.rs.client.Entity",
"javax.ws.rs.client.WebTarget",
"javax.ws.rs.core.MediaType",
"javax.ws.rs.core.Response"
] | import javax.ws.rs.client.Entity; import javax.ws.rs.client.WebTarget; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; | import javax.ws.rs.client.*; import javax.ws.rs.core.*; | [
"javax.ws"
] | javax.ws; | 721,338 |
@Test
public void testHBaseBinaryConverter() throws IOException {
prepareTable(TESTTABLE_1, true, DataFormat.HBaseBinary);
scanTable1(pig, DataFormat.HBaseBinary);
Iterator<Tuple> it = pig.openIterator("a");
int index = 0;
LOG.info("testHBaseBinaryConverter Starting");
... | void function() throws IOException { prepareTable(TESTTABLE_1, true, DataFormat.HBaseBinary); scanTable1(pig, DataFormat.HBaseBinary); Iterator<Tuple> it = pig.openIterator("a"); int index = 0; LOG.info(STR); while (it.hasNext()) { Tuple t = it.next(); String rowKey = (String) t.get(0); int col_a = (Integer) t.get(1); ... | /**
* Test Load from hbase using HBaseBinaryConverter
*/ | Test Load from hbase using HBaseBinaryConverter | testHBaseBinaryConverter | {
"repo_name": "kellyzly/pig",
"path": "test/org/apache/pig/test/TestHBaseStorage.java",
"license": "apache-2.0",
"size": 67470
} | [
"java.io.IOException",
"java.util.Iterator",
"org.apache.pig.data.Tuple",
"org.junit.Assert"
] | import java.io.IOException; import java.util.Iterator; import org.apache.pig.data.Tuple; import org.junit.Assert; | import java.io.*; import java.util.*; import org.apache.pig.data.*; import org.junit.*; | [
"java.io",
"java.util",
"org.apache.pig",
"org.junit"
] | java.io; java.util; org.apache.pig; org.junit; | 2,905,245 |
@Test
public void testUnbind() throws Exception {
envContext.bind("sub31", null);
gemfireContext.bind("env/ejb/sub32", new String("UnbindObject"));
// Unbind
initialContext.unbind("java:gf/env/sub31");
dataSourceContext.unbind("sub32");
try {
envContext.lookup("sub31");
fail();
... | void function() throws Exception { envContext.bind("sub31", null); gemfireContext.bind(STR, new String(STR)); initialContext.unbind(STR); dataSourceContext.unbind("sub32"); try { envContext.lookup("sub31"); fail(); } catch (NameNotFoundException expected) { } try { initialContext.lookup(STR); fail(); } catch (NameNotFo... | /**
* Tests ability to unbind names.
*/ | Tests ability to unbind names | testUnbind | {
"repo_name": "smgoller/geode",
"path": "geode-core/src/test/java/org/apache/geode/internal/jndi/ContextJUnitTest.java",
"license": "apache-2.0",
"size": 11271
} | [
"javax.naming.NameNotFoundException",
"org.junit.Assert"
] | import javax.naming.NameNotFoundException; import org.junit.Assert; | import javax.naming.*; import org.junit.*; | [
"javax.naming",
"org.junit"
] | javax.naming; org.junit; | 212,717 |
public void testTheObjectType() throws Exception {
// implicit prototype
assertTypeEquals(OBJECT_PROTOTYPE, OBJECT_TYPE.getImplicitPrototype());
// isXxx
assertFalse(OBJECT_TYPE.isNoObjectType());
assertFalse(OBJECT_TYPE.isNoType());
assertFalse(OBJECT_TYPE.isArrayType());
assertFalse(OBJ... | void function() throws Exception { assertTypeEquals(OBJECT_PROTOTYPE, OBJECT_TYPE.getImplicitPrototype()); assertFalse(OBJECT_TYPE.isNoObjectType()); assertFalse(OBJECT_TYPE.isNoType()); assertFalse(OBJECT_TYPE.isArrayType()); assertFalse(OBJECT_TYPE.isBooleanValueType()); assertFalse(OBJECT_TYPE.isDateType()); assertF... | /**
* Tests the behavior of the Object type (the object
* at the top of the JavaScript hierarchy).
*/ | Tests the behavior of the Object type (the object at the top of the JavaScript hierarchy) | testTheObjectType | {
"repo_name": "tdelmas/closure-compiler",
"path": "test/com/google/javascript/rhino/jstype/JSTypeTest.java",
"license": "apache-2.0",
"size": 265769
} | [
"com.google.javascript.rhino.testing.Asserts"
] | import com.google.javascript.rhino.testing.Asserts; | import com.google.javascript.rhino.testing.*; | [
"com.google.javascript"
] | com.google.javascript; | 1,297,859 |
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException {
stream.defaultReadObject();
if (jdate == null) {
jdate = jcal.newCalendarDate(getZone());
cachedFixedDate = Long.MIN_VALUE;
}
} | void function(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); if (jdate == null) { jdate = jcal.newCalendarDate(getZone()); cachedFixedDate = Long.MIN_VALUE; } } | /**
* Updates internal state.
*/ | Updates internal state | readObject | {
"repo_name": "evanman/Java-Source",
"path": "util/JapaneseImperialCalendar.java",
"license": "lgpl-2.1",
"size": 99847
} | [
"java.io.IOException",
"java.io.ObjectInputStream"
] | import java.io.IOException; import java.io.ObjectInputStream; | import java.io.*; | [
"java.io"
] | java.io; | 2,324,717 |
EReference getDocumentRoot_XSISchemaLocation(); | EReference getDocumentRoot_XSISchemaLocation(); | /**
* Returns the meta object for the map '{@link org.omg.spec.bpmn.non.normative.color.DocumentRoot#getXSISchemaLocation <em>XSI Schema Location</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the map '<em>XSI Schema Location</em>'.
* @see org.omg.spec.bpmn.non.normati... | Returns the meta object for the map '<code>org.omg.spec.bpmn.non.normative.color.DocumentRoot#getXSISchemaLocation XSI Schema Location</code>'. | getDocumentRoot_XSISchemaLocation | {
"repo_name": "romartin/kie-wb-common",
"path": "kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/omg/spec/bpmn/non/normative/color/ColorPackage.java",
"license": "apache-2.0",
"size": 9754
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,246,309 |
protected boolean doProcess(PDFGenerator generator, adams.data.spreadsheet.SpreadSheet sheet) throws Exception {
boolean result;
Row row;
Cell cell;
int i;
PdfPTable table;
PdfPCell pdfCell;
String pattern;
DecimalFormat format;
Paragraph para;
Paragraph paraComment... | boolean function(PDFGenerator generator, adams.data.spreadsheet.SpreadSheet sheet) throws Exception { boolean result; Row row; Cell cell; int i; PdfPTable table; PdfPCell pdfCell; String pattern; DecimalFormat format; Paragraph para; Paragraph paraComments; ColumnText ct; pattern = "#0"; for (i = 0; i < m_NumDecimals; ... | /**
* The actual processing of the document.
*
* @param generator the context
* @param sheet the spreadsheet to add
* @return true if successfully added
* @throws Exception if something goes wrong
*/ | The actual processing of the document | doProcess | {
"repo_name": "waikato-datamining/adams-base",
"path": "adams-pdf/src/main/java/adams/flow/transformer/pdfproclet/SpreadSheet.java",
"license": "gpl-3.0",
"size": 24104
} | [
"com.itextpdf.text.Element",
"com.itextpdf.text.Paragraph",
"com.itextpdf.text.pdf.ColumnText",
"com.itextpdf.text.pdf.PdfPCell",
"com.itextpdf.text.pdf.PdfPTable",
"java.text.DecimalFormat"
] | import com.itextpdf.text.Element; import com.itextpdf.text.Paragraph; import com.itextpdf.text.pdf.ColumnText; import com.itextpdf.text.pdf.PdfPCell; import com.itextpdf.text.pdf.PdfPTable; import java.text.DecimalFormat; | import com.itextpdf.text.*; import com.itextpdf.text.pdf.*; import java.text.*; | [
"com.itextpdf.text",
"java.text"
] | com.itextpdf.text; java.text; | 2,699,442 |
@Override
public void initGui()
{
super.initGui();
buttonList.clear();
Keyboard.enableRepeatEvents(true);
this.buttonList.add(GuiVC.buttonMM1);
this.buttonList.add(GuiVC.buttonMM2);
this.buttonList.add(GuiVC.buttonMM3);
this.buttonList.add(GuiVC.buttonMM4);
this.bu... | void function() { super.initGui(); buttonList.clear(); Keyboard.enableRepeatEvents(true); this.buttonList.add(GuiVC.buttonMM1); this.buttonList.add(GuiVC.buttonMM2); this.buttonList.add(GuiVC.buttonMM3); this.buttonList.add(GuiVC.buttonMM4); this.buttonList.add(GuiVC.buttonMM5); this.buttonList.add(GuiVC.button501); th... | /**
* Adds the buttons (and other controls) to the screen in question.
*/ | Adds the buttons (and other controls) to the screen in question | initGui | {
"repo_name": "Weisses/Ebonheart-Mods",
"path": "ViesCraft/1.12.2 - 2655/src/main/java/com/viesis/viescraft/client/gui/airship/customize/core/sub/GuiCustomizeMenuCoreModelEnginePg1.java",
"license": "mit",
"size": 4640
} | [
"com.viesis.viescraft.api.GuiVC",
"org.lwjgl.input.Keyboard"
] | import com.viesis.viescraft.api.GuiVC; import org.lwjgl.input.Keyboard; | import com.viesis.viescraft.api.*; import org.lwjgl.input.*; | [
"com.viesis.viescraft",
"org.lwjgl.input"
] | com.viesis.viescraft; org.lwjgl.input; | 2,464,916 |
public RedeliveryPolicy retryAttemptedLogLevel(LoggingLevel retryAttemptedLogLevel) {
setRetryAttemptedLogLevel(retryAttemptedLogLevel);
return this;
} | RedeliveryPolicy function(LoggingLevel retryAttemptedLogLevel) { setRetryAttemptedLogLevel(retryAttemptedLogLevel); return this; } | /**
* Sets the logging level to use for log messages when retries are attempted.
*/ | Sets the logging level to use for log messages when retries are attempted | retryAttemptedLogLevel | {
"repo_name": "logzio/camel",
"path": "camel-core/src/main/java/org/apache/camel/processor/RedeliveryPolicy.java",
"license": "apache-2.0",
"size": 24812
} | [
"org.apache.camel.LoggingLevel"
] | import org.apache.camel.LoggingLevel; | import org.apache.camel.*; | [
"org.apache.camel"
] | org.apache.camel; | 647,487 |
final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
// DocumentProvider
if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) {
// ExternalStorageProvider
if (isExternalStorageDocument(uri)) {
final String docId = Docume... | final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT; if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) { if (isExternalStorageDocument(uri)) { final String docId = DocumentsContract.getDocumentId(uri); final String[] split = docId.split(":"); final String type = split[0]; if (STR.e... | /**
* Get a file path from a Uri. This will get the the path for Storage Access
* Framework Documents, as well as the _data field for the MediaStore and
* other file-based ContentProviders.
*
* @param context The context.
* @param uri The Uri to query.
* @author paulburke
*/ | Get a file path from a Uri. This will get the the path for Storage Access Framework Documents, as well as the _data field for the MediaStore and other file-based ContentProviders | getPath | {
"repo_name": "KnRex/Video_Stitching_android_ffmpeg",
"path": "app/src/main/java/com/genie/videostitchingexample/Utils.java",
"license": "mit",
"size": 5504
} | [
"android.content.ContentUris",
"android.net.Uri",
"android.os.Build",
"android.os.Environment",
"android.provider.DocumentsContract"
] | import android.content.ContentUris; import android.net.Uri; import android.os.Build; import android.os.Environment; import android.provider.DocumentsContract; | import android.content.*; import android.net.*; import android.os.*; import android.provider.*; | [
"android.content",
"android.net",
"android.os",
"android.provider"
] | android.content; android.net; android.os; android.provider; | 1,492,162 |
public Builder<TYPE> mandatoryProvidersList(
Iterable<? extends Iterable<StarlarkProviderIdentifier>> providersList) {
Preconditions.checkState(type.getLabelClass() == LabelClass.DEPENDENCY,
"must be a label-valued type");
for (Iterable<StarlarkProviderIdentifier> providers : providers... | Builder<TYPE> function( Iterable<? extends Iterable<StarlarkProviderIdentifier>> providersList) { Preconditions.checkState(type.getLabelClass() == LabelClass.DEPENDENCY, STR); for (Iterable<StarlarkProviderIdentifier> providers : providersList) { this.requiredProvidersBuilder.addStarlarkSet(ImmutableSet.copyOf(provider... | /**
* Sets a list of sets of mandatory Starlark providers. Every configured target occurring in
* this label type attribute has to provide all the providers from one of those sets, or be one
* of {@link #allowedRuleClasses}, otherwise an error is produced during the analysis phase.
*/ | Sets a list of sets of mandatory Starlark providers. Every configured target occurring in this label type attribute has to provide all the providers from one of those sets, or be one of <code>#allowedRuleClasses</code>, otherwise an error is produced during the analysis phase | mandatoryProvidersList | {
"repo_name": "twitter-forks/bazel",
"path": "src/main/java/com/google/devtools/build/lib/packages/Attribute.java",
"license": "apache-2.0",
"size": 98336
} | [
"com.google.common.base.Preconditions",
"com.google.common.collect.ImmutableSet",
"com.google.devtools.build.lib.packages.Type"
] | import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableSet; import com.google.devtools.build.lib.packages.Type; | import com.google.common.base.*; import com.google.common.collect.*; import com.google.devtools.build.lib.packages.*; | [
"com.google.common",
"com.google.devtools"
] | com.google.common; com.google.devtools; | 2,774,471 |
public static byte[] stringToBytes(String str) {
try {
return str.getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
throw new Error("UTF-8 Not Supported", e);
}
} | static byte[] function(String str) { try { return str.getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { throw new Error(STR, e); } } | /**
* Convert String to byte[] (with UTF-8 encoding)
* @param str String
* @return Byte array (byte[])
*/ | Convert String to byte[] (with UTF-8 encoding) | stringToBytes | {
"repo_name": "Phazyck/nullpominai",
"path": "src/mu/nu/nullpo/game/net/NetUtil.java",
"license": "mit",
"size": 8903
} | [
"java.io.UnsupportedEncodingException"
] | import java.io.UnsupportedEncodingException; | import java.io.*; | [
"java.io"
] | java.io; | 2,128,052 |
public StringValue appendTo(StringValue builder)
throws IOException
{
if (_is != null)
return builder.append(_is);
else
return builder;
} | StringValue function(StringValue builder) throws IOException { if (_is != null) return builder.append(_is); else return builder; } | /**
* Appends to a string builder.
*/ | Appends to a string builder | appendTo | {
"repo_name": "dwango/quercus",
"path": "src/main/java/com/caucho/quercus/lib/file/HttpInputOutput.java",
"license": "gpl-2.0",
"size": 9829
} | [
"com.caucho.quercus.env.StringValue",
"java.io.IOException"
] | import com.caucho.quercus.env.StringValue; import java.io.IOException; | import com.caucho.quercus.env.*; import java.io.*; | [
"com.caucho.quercus",
"java.io"
] | com.caucho.quercus; java.io; | 1,788,750 |
public TypeUse build( XSSimpleType type ) {
XSSimpleType oldi = initiatingType;
this.initiatingType = type;
TypeUse e = checkRefererCustomization(type);
if(e==null)
e = compose(type);
initiatingType = oldi;
return e;
} | TypeUse function( XSSimpleType type ) { XSSimpleType oldi = initiatingType; this.initiatingType = type; TypeUse e = checkRefererCustomization(type); if(e==null) e = compose(type); initiatingType = oldi; return e; } | /**
* Entry point from outside. Builds a BGM type expression
* from a simple type schema component.
*
* @param type
* the simple type to be bound.
*/ | Entry point from outside. Builds a BGM type expression from a simple type schema component | build | {
"repo_name": "FauxFaux/jdk9-jaxws",
"path": "src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/SimpleTypeBuilder.java",
"license": "gpl-2.0",
"size": 36489
} | [
"com.sun.tools.internal.xjc.model.TypeUse",
"com.sun.xml.internal.xsom.XSSimpleType"
] | import com.sun.tools.internal.xjc.model.TypeUse; import com.sun.xml.internal.xsom.XSSimpleType; | import com.sun.tools.internal.xjc.model.*; import com.sun.xml.internal.xsom.*; | [
"com.sun.tools",
"com.sun.xml"
] | com.sun.tools; com.sun.xml; | 140,064 |
public static String getAt(GString text, int index) {
return (String) getAt(text.toString(), index);
} | static String function(GString text, int index) { return (String) getAt(text.toString(), index); } | /**
* Support the subscript operator for GString.
*
* @param text a GString
* @param index the index of the Character to get
* @return the Character at the given index
* @since 2.3.7
*/ | Support the subscript operator for GString | getAt | {
"repo_name": "pledbrook/incubator-groovy",
"path": "src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java",
"license": "apache-2.0",
"size": 142054
} | [
"groovy.lang.GString"
] | import groovy.lang.GString; | import groovy.lang.*; | [
"groovy.lang"
] | groovy.lang; | 1,893,610 |
protected Control createNameControl(Composite composite) {
return fNameGroup.createControl(composite);
} | Control function(Composite composite) { return fNameGroup.createControl(composite); } | /**
* Creates the controls for the name field.
*
* @param composite the parent composite
* @return the created control
*/ | Creates the controls for the name field | createNameControl | {
"repo_name": "kumattau/JDTPatch",
"path": "org.eclipse.jdt.ui/src/org/eclipse/jdt/ui/wizards/NewJavaProjectWizardPageOne.java",
"license": "epl-1.0",
"size": 49557
} | [
"org.eclipse.swt.widgets.Composite",
"org.eclipse.swt.widgets.Control"
] | import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; | import org.eclipse.swt.widgets.*; | [
"org.eclipse.swt"
] | org.eclipse.swt; | 2,823,400 |
@GET
@Path("mappers")
@Produces(MediaType.APPLICATION_JSON)
@NoCache
public List<IdentityProviderMapperRepresentation> getMappers() {
this.auth.realm().requireViewIdentityProviders();
if (identityProviderModel == null) {
throw new javax.ws.rs.NotFoundException();
... | @Path(STR) @Produces(MediaType.APPLICATION_JSON) List<IdentityProviderMapperRepresentation> function() { this.auth.realm().requireViewIdentityProviders(); if (identityProviderModel == null) { throw new javax.ws.rs.NotFoundException(); } List<IdentityProviderMapperRepresentation> mappers = new LinkedList<>(); for (Ident... | /**
* Get mappers for identity provider
*/ | Get mappers for identity provider | getMappers | {
"repo_name": "mhajas/keycloak",
"path": "services/src/main/java/org/keycloak/services/resources/admin/IdentityProviderResource.java",
"license": "apache-2.0",
"size": 19477
} | [
"java.util.LinkedList",
"java.util.List",
"javax.ws.rs.NotFoundException",
"javax.ws.rs.Path",
"javax.ws.rs.Produces",
"javax.ws.rs.core.MediaType",
"org.keycloak.models.IdentityProviderMapperModel",
"org.keycloak.models.utils.ModelToRepresentation",
"org.keycloak.representations.idm.IdentityProvide... | import java.util.LinkedList; import java.util.List; import javax.ws.rs.NotFoundException; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import org.keycloak.models.IdentityProviderMapperModel; import org.keycloak.models.utils.ModelToRepresentation; import org.keycloak.represent... | import java.util.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import org.keycloak.models.*; import org.keycloak.models.utils.*; import org.keycloak.representations.idm.*; | [
"java.util",
"javax.ws",
"org.keycloak.models",
"org.keycloak.representations"
] | java.util; javax.ws; org.keycloak.models; org.keycloak.representations; | 2,512,156 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.