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 void write(byte[] from, File to) throws IOException { asByteSink(to).write(from); }
static void function(byte[] from, File to) throws IOException { asByteSink(to).write(from); }
/** * Overwrites a file with the contents of a byte array. * * <p><b>{@link java.nio.file.Path} equivalent:</b> {@link * java.nio.file.Files#write(java.nio.file.Path, byte[], java.nio.file.OpenOption...)}. * * @param from the bytes to write * @param to the destination file * @throws IOException if an I/O error occurs */
Overwrites a file with the contents of a byte array. <code>java.nio.file.Path</code> equivalent: <code>java.nio.file.Files#write(java.nio.file.Path, byte[], java.nio.file.OpenOption...)</code>
write
{ "repo_name": "rgoldberg/guava", "path": "guava/src/com/google/common/io/Files.java", "license": "apache-2.0", "size": 32812 }
[ "java.io.File", "java.io.IOException" ]
import java.io.File; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
886,928
public void setMarkerInformation(IMarkerInformation markerInformation) { this.markerInformation = markerInformation; }
void function(IMarkerInformation markerInformation) { this.markerInformation = markerInformation; }
/** * Sets marker information * @param markerInformation */
Sets marker information
setMarkerInformation
{ "repo_name": "Kogoro/VariantSync", "path": "de.tubs.variantsync.core/src/de/tubs/variantsync/core/data/CodeMapping.java", "license": "lgpl-3.0", "size": 974 }
[ "de.tubs.variantsync.core.patch.interfaces.IMarkerInformation" ]
import de.tubs.variantsync.core.patch.interfaces.IMarkerInformation;
import de.tubs.variantsync.core.patch.interfaces.*;
[ "de.tubs.variantsync" ]
de.tubs.variantsync;
578,595
public HashMap<String, String> asMap() { return Maps.newHashMap(this.map); } private DefaultAnnotations(Map<String, String> map) { this.map = map; }
HashMap<String, String> function() { return Maps.newHashMap(this.map); } private DefaultAnnotations(Map<String, String> map) { this.map = map; }
/** * Returns the annotations as a map. * * @return a copy of the contents of the annotations as a map. */
Returns the annotations as a map
asMap
{ "repo_name": "packet-tracker/onos", "path": "core/api/src/main/java/org/onosproject/net/DefaultAnnotations.java", "license": "apache-2.0", "size": 8342 }
[ "com.google.common.collect.Maps", "java.util.HashMap", "java.util.Map" ]
import com.google.common.collect.Maps; import java.util.HashMap; import java.util.Map;
import com.google.common.collect.*; import java.util.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
191,991
@ServiceMethod(returns = ReturnType.SINGLE) PrivateLinkResourceDescriptionInner get(String resourceGroupName, String resourceName, String groupName);
@ServiceMethod(returns = ReturnType.SINGLE) PrivateLinkResourceDescriptionInner get(String resourceGroupName, String resourceName, String groupName);
/** * Gets a private link resource that need to be created for a service. * * @param resourceGroupName The name of the resource group that contains the service instance. * @param resourceName The name of the service instance. * @param groupName The name of the private link resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a private link resource that need to be created for a service. */
Gets a private link resource that need to be created for a service
get
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/PrivateLinkResourcesClient.java", "license": "mit", "size": 4318 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.healthcareapis.fluent.models.PrivateLinkResourceDescriptionInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.healthcareapis.fluent.models.PrivateLinkResourceDescriptionInner;
import com.azure.core.annotation.*; import com.azure.resourcemanager.healthcareapis.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,846,483
boolean processPick(GVRScene scene, GVRCursorController controller) { if (scene != null && !sensors.isEmpty()) { boolean markActiveNodes = false; if (controller.getActiveState() == ActiveState.ACTIVE_PRESSED) { // active is true, trigger a search for active sensors markActiveNodes = true; } else if (controller .getActiveState() == ActiveState.ACTIVE_RELEASED) { for (GVRBaseSensor sensor : sensors.keySet()) { sensor.setActive(controller, false); } } if(isValidRay(controller.getRay())) { for (GVRSceneObject object : scene.getSceneObjects()) { recurseSceneObject(controller, object, null, markActiveNodes); } } boolean eventHandled = false; for (GVRBaseSensor sensor : sensors.keySet()) { eventHandled = sensor.processList(controller); } return eventHandled; } return false; }
boolean processPick(GVRScene scene, GVRCursorController controller) { if (scene != null && !sensors.isEmpty()) { boolean markActiveNodes = false; if (controller.getActiveState() == ActiveState.ACTIVE_PRESSED) { markActiveNodes = true; } else if (controller .getActiveState() == ActiveState.ACTIVE_RELEASED) { for (GVRBaseSensor sensor : sensors.keySet()) { sensor.setActive(controller, false); } } if(isValidRay(controller.getRay())) { for (GVRSceneObject object : scene.getSceneObjects()) { recurseSceneObject(controller, object, null, markActiveNodes); } } boolean eventHandled = false; for (GVRBaseSensor sensor : sensors.keySet()) { eventHandled = sensor.processList(controller); } return eventHandled; } return false; }
/** * Uses the GVR Picker for now .. but would need help from the renderer * later for efficiency. * * We could possibly push this functionality to the native layer. But for * now we keep it here. */
Uses the GVR Picker for now .. but would need help from the renderer later for efficiency. We could possibly push this functionality to the native layer. But for now we keep it here
processPick
{ "repo_name": "roshanch/GearVRf", "path": "GVRf/Framework/framework/src/main/java/org/gearvrf/SensorManager.java", "license": "apache-2.0", "size": 6490 }
[ "org.gearvrf.GVRCursorController" ]
import org.gearvrf.GVRCursorController;
import org.gearvrf.*;
[ "org.gearvrf" ]
org.gearvrf;
1,549,870
public List<FacetSpec> getFacetSpecs() { return state.getFacetSpecs(); }
List<FacetSpec> function() { return state.getFacetSpecs(); }
/** * Return the list of facet specifications, ordered by name */
Return the list of facet specifications, ordered by name
getFacetSpecs
{ "repo_name": "epimorphics/serverbase", "path": "src/main/java/com/epimorphics/server/webapi/facets/FacetResult.java", "license": "apache-2.0", "size": 7972 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,702,055
public ResourceCreateHandler<O> getCreateHandler() { return createHandler; }
ResourceCreateHandler<O> function() { return createHandler; }
/** * Return this object create handler * * @return */
Return this object create handler
getCreateHandler
{ "repo_name": "marfer/ec2wrapper", "path": "src/main/java/com/amazonaws/wrapper/model/Ec2Resource.java", "license": "apache-2.0", "size": 15071 }
[ "com.amazonaws.wrapper.events.ResourceCreateHandler" ]
import com.amazonaws.wrapper.events.ResourceCreateHandler;
import com.amazonaws.wrapper.events.*;
[ "com.amazonaws.wrapper" ]
com.amazonaws.wrapper;
56,019
private void logComponentInfo(String msg, ServiceComponentHostRequest request, State oldState, State newDesiredState) { LOG.debug("{}, clusterName={}, serviceName={}, componentName={}, hostname={}, currentState={}, newDesiredState={}", msg, request.getClusterName(), request.getServiceName(), request.getComponentName(), request.getHostname(), oldState == null ? "null" : oldState, newDesiredState == null ? "null" : newDesiredState); }
void function(String msg, ServiceComponentHostRequest request, State oldState, State newDesiredState) { LOG.debug(STR, msg, request.getClusterName(), request.getServiceName(), request.getComponentName(), request.getHostname(), oldState == null ? "null" : oldState, newDesiredState == null ? "null" : newDesiredState); }
/** * Logs component info. * * @param msg base log msg * @param request the request to log * @param oldState current state * @param newDesiredState new desired state */
Logs component info
logComponentInfo
{ "repo_name": "zouzhberk/ambaridemo", "path": "demo-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java", "license": "apache-2.0", "size": 44721 }
[ "org.apache.ambari.server.controller.ServiceComponentHostRequest", "org.apache.ambari.server.state.State" ]
import org.apache.ambari.server.controller.ServiceComponentHostRequest; import org.apache.ambari.server.state.State;
import org.apache.ambari.server.controller.*; import org.apache.ambari.server.state.*;
[ "org.apache.ambari" ]
org.apache.ambari;
2,240,902
byte[] compile(String name, String source, CompilerSettings settings, Printer debugStream) { ScriptClassInfo scriptClassInfo = new ScriptClassInfo(painlessLookup, scriptClass); SClass root = Walker.buildPainlessTree(scriptClassInfo, name, source, settings, painlessLookup, debugStream); root.extractVariables(new HashSet<>()); root.storeSettings(settings); root.analyze(painlessLookup); root.write(); return root.getBytes(); }
byte[] compile(String name, String source, CompilerSettings settings, Printer debugStream) { ScriptClassInfo scriptClassInfo = new ScriptClassInfo(painlessLookup, scriptClass); SClass root = Walker.buildPainlessTree(scriptClassInfo, name, source, settings, painlessLookup, debugStream); root.extractVariables(new HashSet<>()); root.storeSettings(settings); root.analyze(painlessLookup); root.write(); return root.getBytes(); }
/** * Runs the two-pass compiler to generate a Painless script. (Used by the debugger.) * @param source The source code for the script. * @param settings The CompilerSettings to be used during the compilation. * @return The bytes for compilation. */
Runs the two-pass compiler to generate a Painless script. (Used by the debugger.)
compile
{ "repo_name": "coding0011/elasticsearch", "path": "modules/lang-painless/src/main/java/org/elasticsearch/painless/Compiler.java", "license": "apache-2.0", "size": 10056 }
[ "java.util.HashSet", "org.elasticsearch.painless.antlr.Walker", "org.elasticsearch.painless.node.SClass", "org.objectweb.asm.util.Printer" ]
import java.util.HashSet; import org.elasticsearch.painless.antlr.Walker; import org.elasticsearch.painless.node.SClass; import org.objectweb.asm.util.Printer;
import java.util.*; import org.elasticsearch.painless.antlr.*; import org.elasticsearch.painless.node.*; import org.objectweb.asm.util.*;
[ "java.util", "org.elasticsearch.painless", "org.objectweb.asm" ]
java.util; org.elasticsearch.painless; org.objectweb.asm;
1,555,398
public Constructor<?> getEnclosingConstructor() { if (classNameImpliesTopLevel()) { return null; } AccessibleObject result = AnnotationAccess.getEnclosingMethodOrConstructor(this); return result instanceof Constructor ? (Constructor<?>) result : null; }
Constructor<?> function() { if (classNameImpliesTopLevel()) { return null; } AccessibleObject result = AnnotationAccess.getEnclosingMethodOrConstructor(this); return result instanceof Constructor ? (Constructor<?>) result : null; }
/** * Returns the enclosing {@code Constructor} of this {@code Class}, if it is an * anonymous or local/automatic class; otherwise {@code null}. */
Returns the enclosing Constructor of this Class, if it is an anonymous or local/automatic class; otherwise null
getEnclosingConstructor
{ "repo_name": "syslover33/ctank", "path": "java/android-sdk-linux_r24.4.1_src/sources/android-23/java/lang/Class.java", "license": "gpl-3.0", "size": 60639 }
[ "java.lang.reflect.AccessibleObject", "java.lang.reflect.Constructor" ]
import java.lang.reflect.AccessibleObject; import java.lang.reflect.Constructor;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
626,216
public static <C extends Collection<E>, E> C find(E[] array, C collection, Predicate<E> predicate) { final Function<Iterator<E>, C> consumer = new ConsumeIntoCollection<>(new ConstantSupplier<C>(collection)); final FilteringIterator<E> filtered = new FilteringIterator<E>(new ArrayIterator<E>(array), predicate); final C found = consumer.apply(filtered); dbc.precondition(!found.isEmpty(), "no element matched"); return found; }
static <C extends Collection<E>, E> C function(E[] array, C collection, Predicate<E> predicate) { final Function<Iterator<E>, C> consumer = new ConsumeIntoCollection<>(new ConstantSupplier<C>(collection)); final FilteringIterator<E> filtered = new FilteringIterator<E>(new ArrayIterator<E>(array), predicate); final C found = consumer.apply(filtered); dbc.precondition(!found.isEmpty(), STR); return found; }
/** * Searches the array, adding every value matching the predicate to the * passed collection. An IllegalStateException is thrown if no element * matches. * * @param <C> the collection type * @param <E> the element type * @param array the array to be searched * @param collection the collection to be filled with matching elements * @param predicate the predicate to be applied to each element * @throws IllegalArgumentException if no element matches * @return the passed collection, filled with matching elements */
Searches the array, adding every value matching the predicate to the passed collection. An IllegalStateException is thrown if no element matches
find
{ "repo_name": "emaze/emaze-dysfunctional", "path": "src/main/java/net/emaze/dysfunctional/Searches.java", "license": "bsd-3-clause", "size": 29146 }
[ "java.util.Collection", "java.util.Iterator", "java.util.function.Function", "java.util.function.Predicate", "net.emaze.dysfunctional.consumers.ConsumeIntoCollection", "net.emaze.dysfunctional.dispatching.delegates.ConstantSupplier", "net.emaze.dysfunctional.filtering.FilteringIterator", "net.emaze.dysfunctional.iterations.ArrayIterator" ]
import java.util.Collection; import java.util.Iterator; import java.util.function.Function; import java.util.function.Predicate; import net.emaze.dysfunctional.consumers.ConsumeIntoCollection; import net.emaze.dysfunctional.dispatching.delegates.ConstantSupplier; import net.emaze.dysfunctional.filtering.FilteringIterator; import net.emaze.dysfunctional.iterations.ArrayIterator;
import java.util.*; import java.util.function.*; import net.emaze.dysfunctional.consumers.*; import net.emaze.dysfunctional.dispatching.delegates.*; import net.emaze.dysfunctional.filtering.*; import net.emaze.dysfunctional.iterations.*;
[ "java.util", "net.emaze.dysfunctional" ]
java.util; net.emaze.dysfunctional;
1,986,706
private boolean internalDelete(File target, String pathToDelete, MultiStatus status, IProgressMonitor monitor) { //first try to delete - this should succeed for files and symbolic links to directories if (monitor.isCanceled()) { throw new OperationCanceledException(); } if (target.delete() || !target.exists()) return true; if (target.isDirectory()) { monitor.subTask(NLS.bind(Messages.deleting, target)); String[] list = target.list(); if (list == null) list = EMPTY_STRING_ARRAY; int parentLength = pathToDelete.length(); boolean failedRecursive = false; for (int i = 0, imax = list.length; i < imax; i++) { if (monitor.isCanceled()) { throw new OperationCanceledException(); } //optimized creation of child path object StringBuffer childBuffer = new StringBuffer(parentLength + list[i].length() + 1); childBuffer.append(pathToDelete); childBuffer.append(File.separatorChar); childBuffer.append(list[i]); String childName = childBuffer.toString(); // try best effort on all children so put logical OR at end failedRecursive = !internalDelete(new File(childName), childName, status, monitor) || failedRecursive; monitor.worked(1); } try { // don't try to delete the root if one of the children failed if (!failedRecursive && target.delete()) return true; } catch (Exception e) { // we caught a runtime exception so log it String message = NLS.bind(Messages.couldnotDelete, target.getAbsolutePath()); status.add(new Status(IStatus.ERROR, Policy.PI_FILE_SYSTEM, EFS.ERROR_DELETE, message, e)); return false; } } //if we got this far, we failed String message = null; if (fetchInfo().getAttribute(EFS.ATTRIBUTE_READ_ONLY)) message = NLS.bind(Messages.couldnotDeleteReadOnly, target.getAbsolutePath()); else message = NLS.bind(Messages.couldnotDelete, target.getAbsolutePath()); status.add(new Status(IStatus.ERROR, Policy.PI_FILE_SYSTEM, EFS.ERROR_DELETE, message, null)); return false; }
boolean function(File target, String pathToDelete, MultiStatus status, IProgressMonitor monitor) { if (monitor.isCanceled()) { throw new OperationCanceledException(); } if (target.delete() !target.exists()) return true; if (target.isDirectory()) { monitor.subTask(NLS.bind(Messages.deleting, target)); String[] list = target.list(); if (list == null) list = EMPTY_STRING_ARRAY; int parentLength = pathToDelete.length(); boolean failedRecursive = false; for (int i = 0, imax = list.length; i < imax; i++) { if (monitor.isCanceled()) { throw new OperationCanceledException(); } StringBuffer childBuffer = new StringBuffer(parentLength + list[i].length() + 1); childBuffer.append(pathToDelete); childBuffer.append(File.separatorChar); childBuffer.append(list[i]); String childName = childBuffer.toString(); failedRecursive = !internalDelete(new File(childName), childName, status, monitor) failedRecursive; monitor.worked(1); } try { if (!failedRecursive && target.delete()) return true; } catch (Exception e) { String message = NLS.bind(Messages.couldnotDelete, target.getAbsolutePath()); status.add(new Status(IStatus.ERROR, Policy.PI_FILE_SYSTEM, EFS.ERROR_DELETE, message, e)); return false; } } String message = null; if (fetchInfo().getAttribute(EFS.ATTRIBUTE_READ_ONLY)) message = NLS.bind(Messages.couldnotDeleteReadOnly, target.getAbsolutePath()); else message = NLS.bind(Messages.couldnotDelete, target.getAbsolutePath()); status.add(new Status(IStatus.ERROR, Policy.PI_FILE_SYSTEM, EFS.ERROR_DELETE, message, null)); return false; }
/** * Deletes the given file recursively, adding failure info to * the provided status object. The filePath is passed as a parameter * to optimize java.io.File object creation. */
Deletes the given file recursively, adding failure info to the provided status object. The filePath is passed as a parameter to optimize java.io.File object creation
internalDelete
{ "repo_name": "evidolob/che", "path": "plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-filesystem/src/main/java/org/eclipse/core/internal/filesystem/LocalFile.java", "license": "epl-1.0", "size": 16527 }
[ "java.io.File", "org.eclipse.core.runtime.IProgressMonitor", "org.eclipse.core.runtime.IStatus", "org.eclipse.core.runtime.MultiStatus", "org.eclipse.core.runtime.OperationCanceledException", "org.eclipse.core.runtime.Status", "org.eclipse.osgi.util.NLS" ]
import java.io.File; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.MultiStatus; import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.core.runtime.Status; import org.eclipse.osgi.util.NLS;
import java.io.*; import org.eclipse.core.runtime.*; import org.eclipse.osgi.util.*;
[ "java.io", "org.eclipse.core", "org.eclipse.osgi" ]
java.io; org.eclipse.core; org.eclipse.osgi;
2,892,949
static String getFirstLineOfCommand(String... commands) throws IOException { Process p = null; BufferedReader reader = null; try { p = Runtime.getRuntime().exec(commands); reader = new BufferedReader(new InputStreamReader( p.getInputStream()), 128); return reader.readLine(); } finally { if (p != null) { close(reader, p.getErrorStream(), p.getOutputStream()); p.destroy(); } } } static class HardwareAddressLookup {
static String getFirstLineOfCommand(String... commands) throws IOException { Process p = null; BufferedReader reader = null; try { p = Runtime.getRuntime().exec(commands); reader = new BufferedReader(new InputStreamReader( p.getInputStream()), 128); return reader.readLine(); } finally { if (p != null) { close(reader, p.getErrorStream(), p.getOutputStream()); p.destroy(); } } } static class HardwareAddressLookup {
/** * Returns the first line of the shell command. * * @param commands the commands to run * @return the first line of the command * @throws IOException */
Returns the first line of the shell command
getFirstLineOfCommand
{ "repo_name": "pombredanne/eaio-uuid", "path": "src/main/java/com/eaio/uuid/UUIDGen.java", "license": "mit", "size": 10786 }
[ "com.eaio.util.Resource", "java.io.BufferedReader", "java.io.IOException", "java.io.InputStreamReader" ]
import com.eaio.util.Resource; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader;
import com.eaio.util.*; import java.io.*;
[ "com.eaio.util", "java.io" ]
com.eaio.util; java.io;
1,298,670
@Test void cantGetDirectoryWithoutValidDirectory() { Mockito.when(this.directory.isDirectory()).thenReturn(false); Assertions .assertThatIllegalArgumentException() .isThrownBy(() -> this.writer.getDirectory(this.directory, UUID.randomUUID().toString(), false)); }
void cantGetDirectoryWithoutValidDirectory() { Mockito.when(this.directory.isDirectory()).thenReturn(false); Assertions .assertThatIllegalArgumentException() .isThrownBy(() -> this.writer.getDirectory(this.directory, UUID.randomUUID().toString(), false)); }
/** * Make sure if the argument passed in isn't a directory an exception is thrown. */
Make sure if the argument passed in isn't a directory an exception is thrown
cantGetDirectoryWithoutValidDirectory
{ "repo_name": "Netflix/genie", "path": "genie-web/src/test/java/com/netflix/genie/web/resources/writers/DefaultDirectoryWriterTest.java", "license": "apache-2.0", "size": 12130 }
[ "java.util.UUID", "org.assertj.core.api.Assertions", "org.mockito.Mockito" ]
import java.util.UUID; import org.assertj.core.api.Assertions; import org.mockito.Mockito;
import java.util.*; import org.assertj.core.api.*; import org.mockito.*;
[ "java.util", "org.assertj.core", "org.mockito" ]
java.util; org.assertj.core; org.mockito;
1,534,916
public static void onBannerClick(String publisher) { Map<String, String> params = new HashMap<String, String>(); if (publisher != null) { params.put("publisher", publisher); } Event bannerEvent = new Event("BannerClick", params, null); DistimoSDK.sendEvent(bannerEvent); } //-- USER PROPERTIES --//
static void function(String publisher) { Map<String, String> params = new HashMap<String, String>(); if (publisher != null) { params.put(STR, publisher); } Event bannerEvent = new Event(STR, params, null); DistimoSDK.sendEvent(bannerEvent); }
/** * Log a banner click * * @param publisher The publisher of the banner (optional) **/
Log a banner click
onBannerClick
{ "repo_name": "platogo/DistimoSDK-PhoneGap-Plugin", "path": "src/android/DistimoSDK.java", "license": "apache-2.0", "size": 14078 }
[ "com.distimo.sdk.EventManager", "java.util.HashMap", "java.util.Map" ]
import com.distimo.sdk.EventManager; import java.util.HashMap; import java.util.Map;
import com.distimo.sdk.*; import java.util.*;
[ "com.distimo.sdk", "java.util" ]
com.distimo.sdk; java.util;
1,788,397
@Override public String getText(Object object) { String location = ((ValidateResource)object).getLocation(); return String.format("Resource (%s)", location); }
String function(Object object) { String location = ((ValidateResource)object).getLocation(); return String.format(STR, location); }
/** * This returns the label text for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> */
This returns the label text for the adapted class.
getText
{ "repo_name": "chanakaudaya/developer-studio", "path": "esb/org.wso2.developerstudio.eclipse.esb.edit/src/org/wso2/developerstudio/eclipse/esb/mediators/provider/ValidateResourceItemProvider.java", "license": "apache-2.0", "size": 4275 }
[ "org.wso2.developerstudio.eclipse.esb.mediators.ValidateResource" ]
import org.wso2.developerstudio.eclipse.esb.mediators.ValidateResource;
import org.wso2.developerstudio.eclipse.esb.mediators.*;
[ "org.wso2.developerstudio" ]
org.wso2.developerstudio;
1,060,023
public void setProcessNameValue(YangString processNameValue) throws JNCException { setLeafValue(Epc.NAMESPACE, "process-name", processNameValue, childrenNames()); }
void function(YangString processNameValue) throws JNCException { setLeafValue(Epc.NAMESPACE, STR, processNameValue, childrenNames()); }
/** * Sets the value for child leaf "process-name", * using instance of generated typedef class. * @param processNameValue The value to set. * @param processNameValue used during instantiation. */
Sets the value for child leaf "process-name", using instance of generated typedef class
setProcessNameValue
{ "repo_name": "jnpr-shinma/yangfile", "path": "hitel/src/hctaEpc/mmeSgsn/interface_/diameter/PeerOper.java", "license": "apache-2.0", "size": 18404 }
[ "com.tailf.jnc.YangString" ]
import com.tailf.jnc.YangString;
import com.tailf.jnc.*;
[ "com.tailf.jnc" ]
com.tailf.jnc;
2,905,362
public Predicate toPredicate() throws InvalidQueryException;
Predicate function() throws InvalidQueryException;
/** * Get the predicate representation of the expression. * @return a predicate instance for the expression */
Get the predicate representation of the expression
toPredicate
{ "repo_name": "zouzhberk/ambaridemo", "path": "demo-server/src/main/java/org/apache/ambari/server/api/predicate/expressions/Expression.java", "license": "apache-2.0", "size": 2775 }
[ "org.apache.ambari.server.api.predicate.InvalidQueryException", "org.apache.ambari.server.controller.spi.Predicate" ]
import org.apache.ambari.server.api.predicate.InvalidQueryException; import org.apache.ambari.server.controller.spi.Predicate;
import org.apache.ambari.server.api.predicate.*; import org.apache.ambari.server.controller.spi.*;
[ "org.apache.ambari" ]
org.apache.ambari;
2,190,921
public void testCycle() { final FudgeSerializer serializer = new FudgeSerializer(OpenGammaFudgeContext.getInstance()); final FudgeDeserializer deserializer = new FudgeDeserializer(OpenGammaFudgeContext.getInstance()); final Heartbeat response = new Heartbeat(SPECS); final Heartbeat cycled = deserializer.fudgeMsgToObject(Heartbeat.class, serializer.objectToFudgeMsg(response)); assertEquals(response.getLiveDataSpecifications(), cycled.getLiveDataSpecifications()); }
void function() { final FudgeSerializer serializer = new FudgeSerializer(OpenGammaFudgeContext.getInstance()); final FudgeDeserializer deserializer = new FudgeDeserializer(OpenGammaFudgeContext.getInstance()); final Heartbeat response = new Heartbeat(SPECS); final Heartbeat cycled = deserializer.fudgeMsgToObject(Heartbeat.class, serializer.objectToFudgeMsg(response)); assertEquals(response.getLiveDataSpecifications(), cycled.getLiveDataSpecifications()); }
/** * Tests a cycle. */
Tests a cycle
testCycle
{ "repo_name": "McLeodMoores/starling", "path": "projects/live-data/src/test/java/com/opengamma/livedata/msg/HeartbeatTest.java", "license": "apache-2.0", "size": 5661 }
[ "com.opengamma.util.fudgemsg.OpenGammaFudgeContext", "org.fudgemsg.mapping.FudgeDeserializer", "org.fudgemsg.mapping.FudgeSerializer", "org.testng.Assert" ]
import com.opengamma.util.fudgemsg.OpenGammaFudgeContext; import org.fudgemsg.mapping.FudgeDeserializer; import org.fudgemsg.mapping.FudgeSerializer; import org.testng.Assert;
import com.opengamma.util.fudgemsg.*; import org.fudgemsg.mapping.*; import org.testng.*;
[ "com.opengamma.util", "org.fudgemsg.mapping", "org.testng" ]
com.opengamma.util; org.fudgemsg.mapping; org.testng;
2,785,724
@com.alexrnl.commons.utils.object.Field public boolean isRequired () { return required; }
@com.alexrnl.commons.utils.object.Field boolean function () { return required; }
/** * Return the attribute required. * @return the attribute required. */
Return the attribute required
isRequired
{ "repo_name": "AlexRNL/Commons", "path": "src/main/java/com/alexrnl/commons/arguments/Parameter.java", "license": "bsd-3-clause", "size": 4578 }
[ "java.lang.reflect.Field" ]
import java.lang.reflect.Field;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
1,793,006
public static ContentHandler getContentHandler(EventModel model) { return new Handler(model); } private static class Handler extends DefaultHandler { private EventModel model; private Stack objectStack = new Stack(); public Handler(EventModel model) { this.model = model; }
static ContentHandler function(EventModel model) { return new Handler(model); } private static class Handler extends DefaultHandler { private EventModel model; private Stack objectStack = new Stack(); public Handler(EventModel model) { this.model = model; }
/** * Creates a new ContentHandler instance that you can send the event model XML to. The parsed * content is accumulated in the model structure. * @param model the EventModel * @return the ContentHandler instance to receive the SAX stream from the XML file */
Creates a new ContentHandler instance that you can send the event model XML to. The parsed content is accumulated in the model structure
getContentHandler
{ "repo_name": "pellcorp/fop", "path": "src/java/org/apache/fop/events/model/EventModelParser.java", "license": "apache-2.0", "size": 5661 }
[ "java.util.Stack", "org.xml.sax.ContentHandler", "org.xml.sax.helpers.DefaultHandler" ]
import java.util.Stack; import org.xml.sax.ContentHandler; import org.xml.sax.helpers.DefaultHandler;
import java.util.*; import org.xml.sax.*; import org.xml.sax.helpers.*;
[ "java.util", "org.xml.sax" ]
java.util; org.xml.sax;
494,364
public QueryService getQueryService();
QueryService function();
/** * Return the QueryService for this region service. For a region service in a client the returned * QueryService will execute queries on the server. For a region service not in a client the * returned QueryService will execute queries on the local and peer regions. */
Return the QueryService for this region service. For a region service in a client the returned QueryService will execute queries on the server. For a region service not in a client the returned QueryService will execute queries on the local and peer regions
getQueryService
{ "repo_name": "prasi-in/geode", "path": "geode-core/src/main/java/org/apache/geode/cache/RegionService.java", "license": "apache-2.0", "size": 6083 }
[ "org.apache.geode.cache.query.QueryService" ]
import org.apache.geode.cache.query.QueryService;
import org.apache.geode.cache.query.*;
[ "org.apache.geode" ]
org.apache.geode;
1,376,084
public File getFile() { return arcFile; }
File function() { return arcFile; }
/** Getter for arcFile. * @return The ARC file that this entry can be found in */
Getter for arcFile
getFile
{ "repo_name": "netarchivesuite/netarchivesuite-svngit-migration", "path": "src/dk/netarkivet/common/utils/arc/ARCKey.java", "license": "lgpl-2.1", "size": 2995 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
2,030,574
public RetrieveDocumentSetResponseType retrieveDocumentSet(RetrieveDocumentSetRequestType request, AssertionType assertion) { log.debug("Entering AdapterDocRetrieveProxyJavaImpl.retrieveDocumentSet"); AdapterDocRetrieveOrchImpl oOrchestrator = new AdapterDocRetrieveOrchImpl(); RetrieveDocumentSetResponseType oResponse = oOrchestrator.respondingGatewayCrossGatewayRetrieve(request, assertion); log.debug("Leaving AdapterDocRetrieveProxyJavaImpl.retrieveDocumentSet"); return oResponse; }
RetrieveDocumentSetResponseType function(RetrieveDocumentSetRequestType request, AssertionType assertion) { log.debug(STR); AdapterDocRetrieveOrchImpl oOrchestrator = new AdapterDocRetrieveOrchImpl(); RetrieveDocumentSetResponseType oResponse = oOrchestrator.respondingGatewayCrossGatewayRetrieve(request, assertion); log.debug(STR); return oResponse; }
/** * Retrieve the specified document. * * @param request The identifier(s) if the document(s) to be retrieved. * @param assertion The assertion information. * @return The retrieved documents. */
Retrieve the specified document
retrieveDocumentSet
{ "repo_name": "alameluchidambaram/CONNECT", "path": "Product/Production/Services/DocumentRetrieveCore/src/main/java/gov/hhs/fha/nhinc/docretrieve/adapter/proxy/AdapterDocRetrieveProxyJavaImpl.java", "license": "bsd-3-clause", "size": 3451 }
[ "gov.hhs.fha.nhinc.common.nhinccommon.AssertionType", "gov.hhs.fha.nhinc.docretrieve.adapter.AdapterDocRetrieveOrchImpl" ]
import gov.hhs.fha.nhinc.common.nhinccommon.AssertionType; import gov.hhs.fha.nhinc.docretrieve.adapter.AdapterDocRetrieveOrchImpl;
import gov.hhs.fha.nhinc.common.nhinccommon.*; import gov.hhs.fha.nhinc.docretrieve.adapter.*;
[ "gov.hhs.fha" ]
gov.hhs.fha;
678,675
public static Splitter on(final String separator) { checkArgument(separator.length() != 0, "The separator may not be the empty string.");
static Splitter function(final String separator) { checkArgument(separator.length() != 0, STR);
/** * Returns a splitter that uses the given fixed string as a separator. For * example, {@code Splitter.on(", ").split("foo, bar, baz,qux")} returns an * iterable containing {@code ["foo", "bar", "baz,qux"]}. * * @param separator the literal, nonempty string to recognize as a separator * @return a splitter, with default settings, that recognizes that separator */
Returns a splitter that uses the given fixed string as a separator. For example, Splitter.on(", ").split("foo, bar, baz,qux") returns an iterable containing ["foo", "bar", "baz,qux"]
on
{ "repo_name": "lshain-android-source/external-guava", "path": "guava-gwt/src-super/com/google/common/base/super/com/google/common/base/Splitter.java", "license": "apache-2.0", "size": 17785 }
[ "com.google.common.base.Preconditions" ]
import com.google.common.base.Preconditions;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
1,107,273
Iterator elementIterator(String name);
Iterator elementIterator(String name);
/** * Returns an iterator over the elements contained in this element which * match the given local name and any namespace. * * @param name * DOCUMENT ME! * * @return an iterator over the contained elements matching the given local * name */
Returns an iterator over the elements contained in this element which match the given local name and any namespace
elementIterator
{ "repo_name": "raedle/univis", "path": "lib/dom4j-1.6.1/src/org/dom4j/Element.java", "license": "lgpl-2.1", "size": 28249 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
2,115,243
public List<ResourceRequest> getAllResourceRequests() { List<ResourceRequest> ret = new ArrayList<>(); try { this.readLock.lock(); for (SchedulingPlacementSet ps : schedulerKeyToPlacementSets.values()) { ret.addAll(ps.getResourceRequests().values()); } } finally { this.readLock.unlock(); } return ret; }
List<ResourceRequest> function() { List<ResourceRequest> ret = new ArrayList<>(); try { this.readLock.lock(); for (SchedulingPlacementSet ps : schedulerKeyToPlacementSets.values()) { ret.addAll(ps.getResourceRequests().values()); } } finally { this.readLock.unlock(); } return ret; }
/** * Used by REST API to fetch ResourceRequest * @return All pending ResourceRequests. */
Used by REST API to fetch ResourceRequest
getAllResourceRequests
{ "repo_name": "legend-hua/hadoop", "path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/AppSchedulingInfo.java", "license": "apache-2.0", "size": 21439 }
[ "java.util.ArrayList", "java.util.List", "org.apache.hadoop.yarn.api.records.ResourceRequest", "org.apache.hadoop.yarn.server.resourcemanager.scheduler.placement.SchedulingPlacementSet" ]
import java.util.ArrayList; import java.util.List; import org.apache.hadoop.yarn.api.records.ResourceRequest; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.placement.SchedulingPlacementSet;
import java.util.*; import org.apache.hadoop.yarn.api.records.*; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.placement.*;
[ "java.util", "org.apache.hadoop" ]
java.util; org.apache.hadoop;
17,907
private synchronized PrintStream findOutStream() { PrintStream stream = out; if (stream == null) { stream = System.err; if (!noOutWarned) { noOutWarned = true; stream.println("#> "); stream.println("#> WARNING: switching log stream to stderr,"); stream.println("#> because no output stream is assigned"); stream.println("#> "); }; }; stream.flush(); return stream; }
synchronized PrintStream function() { PrintStream stream = out; if (stream == null) { stream = System.err; if (!noOutWarned) { noOutWarned = true; stream.println(STR); stream.println(STR); stream.println(STR); stream.println(STR); }; }; stream.flush(); return stream; }
/** * Return <code>out</code> stream if defined or <code>Sytem.err<code> otherwise; * print a warning message when <code>System.err</code> is used first time. */
Return <code>out</code> stream if defined or <code>Sytem.err<code> otherwise; print a warning message when <code>System.err</code> is used first time
findOutStream
{ "repo_name": "md-5/jdk10", "path": "test/hotspot/jtreg/vmTestbase/nsk/share/Log.java", "license": "gpl-2.0", "size": 24117 }
[ "java.io.PrintStream" ]
import java.io.PrintStream;
import java.io.*;
[ "java.io" ]
java.io;
968,867
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { sitesScrollPane = new javax.swing.JScrollPane(); sitesTable = new javax.swing.JTable(); selectButton = new javax.swing.JButton(); updateButton = new javax.swing.JButton(); updateAllButton = new javax.swing.JButton(); cancelButton = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Select site"); sitesTable.setAutoCreateRowSorter(true); sitesTable.setModel(new SiteTableModel()); sitesTable.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); sitesScrollPane.setViewportView(sitesTable);
@SuppressWarnings(STR) void function() { sitesScrollPane = new javax.swing.JScrollPane(); sitesTable = new javax.swing.JTable(); selectButton = new javax.swing.JButton(); updateButton = new javax.swing.JButton(); updateAllButton = new javax.swing.JButton(); cancelButton = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle(STR); sitesTable.setAutoCreateRowSorter(true); sitesTable.setModel(new SiteTableModel()); sitesTable.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); sitesScrollPane.setViewportView(sitesTable);
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */
This method is called from within the constructor to initialize the form. regenerated by the Form Editor
initComponents
{ "repo_name": "hurik/MangaDownloader", "path": "src/main/java/de/andreasgiemza/mangadownloader/gui/dialogs/SelectSite.java", "license": "mit", "size": 12622 }
[ "de.andreasgiemza.mangadownloader.gui.site.SiteTableModel", "javax.swing.JTable" ]
import de.andreasgiemza.mangadownloader.gui.site.SiteTableModel; import javax.swing.JTable;
import de.andreasgiemza.mangadownloader.gui.site.*; import javax.swing.*;
[ "de.andreasgiemza.mangadownloader", "javax.swing" ]
de.andreasgiemza.mangadownloader; javax.swing;
931,035
public void throwPendingException() throws AbruptExitException { AbruptExitException exception = getPendingException(); if (exception != null) { if (Thread.currentThread() == commandThread) { // Throwing this exception counts as the requested interruption. Clear the interrupted bit. Thread.interrupted(); } throw exception; } }
void function() throws AbruptExitException { AbruptExitException exception = getPendingException(); if (exception != null) { if (Thread.currentThread() == commandThread) { Thread.interrupted(); } throw exception; } }
/** * Throws the exception currently queued by a Blaze module. * * <p>This should be called as often as is practical so that errors are reported as soon as * possible. Ideally, we'd not need this, but the event bus swallows exceptions so we raise * the exception this way. */
Throws the exception currently queued by a Blaze module. This should be called as often as is practical so that errors are reported as soon as possible. Ideally, we'd not need this, but the event bus swallows exceptions so we raise the exception this way
throwPendingException
{ "repo_name": "damienmg/bazel", "path": "src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java", "license": "apache-2.0", "size": 23247 }
[ "com.google.devtools.build.lib.util.AbruptExitException" ]
import com.google.devtools.build.lib.util.AbruptExitException;
import com.google.devtools.build.lib.util.*;
[ "com.google.devtools" ]
com.google.devtools;
1,268,054
public boolean isPendingPositionSalaryChange(){ List<PendingBudgetConstructionAppointmentFunding> activeAppointmentFundings = this.getActiveFundingLines(); for (PendingBudgetConstructionAppointmentFunding appointmentFunding : activeAppointmentFundings){ if (!appointmentFunding.isDisplayOnlyMode()){ if (appointmentFunding.isPositionChangeIndicator()){ return true; } } } return false; }
boolean function(){ List<PendingBudgetConstructionAppointmentFunding> activeAppointmentFundings = this.getActiveFundingLines(); for (PendingBudgetConstructionAppointmentFunding appointmentFunding : activeAppointmentFundings){ if (!appointmentFunding.isDisplayOnlyMode()){ if (appointmentFunding.isPositionChangeIndicator()){ return true; } } } return false; }
/** * checks if at least one active edit-able appointment funding line has a sync flag set * * @return true or false */
checks if at least one active edit-able appointment funding line has a sync flag set
isPendingPositionSalaryChange
{ "repo_name": "ua-eas/kfs-devops-automation-fork", "path": "kfs-bc/src/main/java/org/kuali/kfs/module/bc/document/web/struts/PositionSalarySettingForm.java", "license": "agpl-3.0", "size": 5483 }
[ "java.util.List", "org.kuali.kfs.module.bc.businessobject.PendingBudgetConstructionAppointmentFunding" ]
import java.util.List; import org.kuali.kfs.module.bc.businessobject.PendingBudgetConstructionAppointmentFunding;
import java.util.*; import org.kuali.kfs.module.bc.businessobject.*;
[ "java.util", "org.kuali.kfs" ]
java.util; org.kuali.kfs;
418,233
public WritableSession create(String key, String secret, AuthProviderData data);
WritableSession function(String key, String secret, AuthProviderData data);
/** * Creates a new session. * @param key The socialize consumer key. * @param secret The socialize consumer secret. * @param data Data pertaining to the auth provider used when creating the session. * @return A new writable session object. */
Creates a new session
create
{ "repo_name": "dylanmaryk/InsanityRadio-Android", "path": "socialize/src/com/socialize/api/SocializeSessionFactory.java", "license": "mit", "size": 2437 }
[ "com.socialize.auth.AuthProviderData" ]
import com.socialize.auth.AuthProviderData;
import com.socialize.auth.*;
[ "com.socialize.auth" ]
com.socialize.auth;
20,080
private void expandEpsilon(Step<E> step, List<Step<E>> steps) { // loop over edges for (final Epsilon<E> edge : step.state.epsilons) {
void function(Step<E> step, List<Step<E>> steps) { for (final Epsilon<E> edge : step.state.epsilons) {
/** * Expand all epsilon transitions for the specified step. That is, * add all states avaiable via an epsilon transition from step.state. * @param step * @param steps */
Expand all epsilon transitions for the specified step. That is, add all states avaiable via an epsilon transition from step.state
expandEpsilon
{ "repo_name": "knowitall/openregex", "path": "src/main/java/edu/washington/cs/knowitall/regex/FiniteAutomaton.java", "license": "lgpl-3.0", "size": 15853 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,529,524
@Override public void addBuilderCustomizers(UndertowBuilderCustomizer... customizers) { Assert.notNull(customizers, "Customizers must not be null"); this.builderCustomizers.addAll(Arrays.asList(customizers)); } private static final class AccessLogHandlerConfiguration { private final AccessLogHandler accessLogHandler; private final Closeable closeable; private AccessLogHandlerConfiguration(AccessLogHandler accessLogHandler, Closeable closeable) { this.accessLogHandler = accessLogHandler; this.closeable = closeable; } }
void function(UndertowBuilderCustomizer... customizers) { Assert.notNull(customizers, STR); this.builderCustomizers.addAll(Arrays.asList(customizers)); } private static final class AccessLogHandlerConfiguration { private final AccessLogHandler accessLogHandler; private final Closeable closeable; private AccessLogHandlerConfiguration(AccessLogHandler accessLogHandler, Closeable closeable) { this.accessLogHandler = accessLogHandler; this.closeable = closeable; } }
/** * Add {@link UndertowBuilderCustomizer}s that should be used to customize the * Undertow {@link io.undertow.Undertow.Builder Builder}. * @param customizers the customizers to add */
Add <code>UndertowBuilderCustomizer</code>s that should be used to customize the Undertow <code>io.undertow.Undertow.Builder Builder</code>
addBuilderCustomizers
{ "repo_name": "joshiste/spring-boot", "path": "spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowReactiveWebServerFactory.java", "license": "apache-2.0", "size": 9929 }
[ "io.undertow.server.handlers.accesslog.AccessLogHandler", "java.io.Closeable", "java.util.Arrays", "org.springframework.util.Assert" ]
import io.undertow.server.handlers.accesslog.AccessLogHandler; import java.io.Closeable; import java.util.Arrays; import org.springframework.util.Assert;
import io.undertow.server.handlers.accesslog.*; import java.io.*; import java.util.*; import org.springframework.util.*;
[ "io.undertow.server", "java.io", "java.util", "org.springframework.util" ]
io.undertow.server; java.io; java.util; org.springframework.util;
2,043,666
private void createCustomDevice () { List<Device.Property> list = new ArrayList<>(); for(String customProperty : customDeviceTypeProperties) { Device.Property property = new Device.Property(); property.setName(customProperty); property.setValue(customProperty); list.add(property); } customDevice = new Device(customDeviceType, customDeviceType, customDeviceType, customDeviceType, null, null, list); }
void function () { List<Device.Property> list = new ArrayList<>(); for(String customProperty : customDeviceTypeProperties) { Device.Property property = new Device.Property(); property.setName(customProperty); property.setValue(customProperty); list.add(property); } customDevice = new Device(customDeviceType, customDeviceType, customDeviceType, customDeviceType, null, null, list); }
/** * To create a sample custom device. */
To create a sample custom device
createCustomDevice
{ "repo_name": "charithag/carbon-device-mgt", "path": "components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/test/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypeManagerTest.java", "license": "apache-2.0", "size": 19082 }
[ "java.util.ArrayList", "java.util.List", "org.wso2.carbon.device.mgt.common.Device" ]
import java.util.ArrayList; import java.util.List; import org.wso2.carbon.device.mgt.common.Device;
import java.util.*; import org.wso2.carbon.device.mgt.common.*;
[ "java.util", "org.wso2.carbon" ]
java.util; org.wso2.carbon;
1,235,462
private static void invokeOperatorUnregisteredListener(OperatorDescription description) { List<WeakReference<OperatorServiceListener>> listenersCopy = new LinkedList<>(listeners); for (WeakReference<OperatorServiceListener> listenerRef : listenersCopy) { OperatorServiceListener operatorServiceListener = listenerRef.get(); if (operatorServiceListener != null) { operatorServiceListener.operatorUnregistered(description); } } Iterator<WeakReference<OperatorServiceListener>> iterator = listenersCopy.iterator(); while (iterator.hasNext()) { OperatorServiceListener operatorServiceListener = iterator.next().get(); if (operatorServiceListener == null) { iterator.remove(); } } }
static void function(OperatorDescription description) { List<WeakReference<OperatorServiceListener>> listenersCopy = new LinkedList<>(listeners); for (WeakReference<OperatorServiceListener> listenerRef : listenersCopy) { OperatorServiceListener operatorServiceListener = listenerRef.get(); if (operatorServiceListener != null) { operatorServiceListener.operatorUnregistered(description); } } Iterator<WeakReference<OperatorServiceListener>> iterator = listenersCopy.iterator(); while (iterator.hasNext()) { OperatorServiceListener operatorServiceListener = iterator.next().get(); if (operatorServiceListener == null) { iterator.remove(); } } }
/** * This method will inform all listeners of a change in the available operators. */
This method will inform all listeners of a change in the available operators
invokeOperatorUnregisteredListener
{ "repo_name": "rapidminer/rapidminer-studio", "path": "src/main/java/com/rapidminer/tools/OperatorService.java", "license": "agpl-3.0", "size": 37059 }
[ "com.rapidminer.operator.OperatorDescription", "java.lang.ref.WeakReference", "java.util.Iterator", "java.util.LinkedList", "java.util.List" ]
import com.rapidminer.operator.OperatorDescription; import java.lang.ref.WeakReference; import java.util.Iterator; import java.util.LinkedList; import java.util.List;
import com.rapidminer.operator.*; import java.lang.ref.*; import java.util.*;
[ "com.rapidminer.operator", "java.lang", "java.util" ]
com.rapidminer.operator; java.lang; java.util;
2,865,127
public static PropertyDescriptor[] getPropertiesAssignableToType(Class<?> clazz, Class<?> propertySuperType) { if (clazz == null || propertySuperType == null) return new PropertyDescriptor[0]; Set<PropertyDescriptor> properties = new HashSet<>(); try { PropertyDescriptor[] descriptors = getPropertyDescriptors(clazz); for (PropertyDescriptor descriptor : descriptors) { if (propertySuperType.isAssignableFrom(descriptor.getPropertyType())) { properties.add(descriptor); } } } catch (Exception e) { return new PropertyDescriptor[0]; } return properties.toArray(new PropertyDescriptor[properties.size()]); }
static PropertyDescriptor[] function(Class<?> clazz, Class<?> propertySuperType) { if (clazz == null propertySuperType == null) return new PropertyDescriptor[0]; Set<PropertyDescriptor> properties = new HashSet<>(); try { PropertyDescriptor[] descriptors = getPropertyDescriptors(clazz); for (PropertyDescriptor descriptor : descriptors) { if (propertySuperType.isAssignableFrom(descriptor.getPropertyType())) { properties.add(descriptor); } } } catch (Exception e) { return new PropertyDescriptor[0]; } return properties.toArray(new PropertyDescriptor[properties.size()]); }
/** * Retrieves all the properties of the given class which are assignable to the given type * * @param clazz The class to retrieve the properties from * @param propertySuperType The type of the properties you wish to retrieve * @return An array of PropertyDescriptor instances */
Retrieves all the properties of the given class which are assignable to the given type
getPropertiesAssignableToType
{ "repo_name": "levymoreira/griffon", "path": "subprojects/griffon-core/src/main/java/griffon/util/GriffonClassUtils.java", "license": "apache-2.0", "size": 129659 }
[ "java.beans.PropertyDescriptor", "java.util.HashSet", "java.util.Set" ]
import java.beans.PropertyDescriptor; import java.util.HashSet; import java.util.Set;
import java.beans.*; import java.util.*;
[ "java.beans", "java.util" ]
java.beans; java.util;
235,178
public void testDeadlockUnblockedOnTimeout() throws Exception { deadlockUnblockedOnTimeout(ignite(0), ignite(1)); deadlockUnblockedOnTimeout(ignite(0), ignite(0)); Ignite client = startClient(); deadlockUnblockedOnTimeout(ignite(0), client); deadlockUnblockedOnTimeout(client, ignite(0)); }
void function() throws Exception { deadlockUnblockedOnTimeout(ignite(0), ignite(1)); deadlockUnblockedOnTimeout(ignite(0), ignite(0)); Ignite client = startClient(); deadlockUnblockedOnTimeout(ignite(0), client); deadlockUnblockedOnTimeout(client, ignite(0)); }
/** * Tests if deadlock is resolved on timeout with correct message. * * @throws Exception If failed. */
Tests if deadlock is resolved on timeout with correct message
testDeadlockUnblockedOnTimeout
{ "repo_name": "endian675/ignite", "path": "modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackOnTimeoutTest.java", "license": "apache-2.0", "size": 30679 }
[ "org.apache.ignite.Ignite" ]
import org.apache.ignite.Ignite;
import org.apache.ignite.*;
[ "org.apache.ignite" ]
org.apache.ignite;
1,005,484
switch (identifier.getTypeName()) { case IfmapStrings.ACCESS_REQUEST_EL_NAME: return createTextForAccessRequest(identifier); case IfmapStrings.DEVICE_EL_NAME: return createTextForDevice(identifier); case IfmapStrings.IDENTITY_EL_NAME: if (ExtendedIdentifierHelper.isExtendedIdentifier(identifier)) { return createTextForExtendedIdentifier(identifier); } else { return createTextForIdentity(identifier); } case IfmapStrings.MAC_ADDRESS_EL_NAME: return createTextForMacAddress(identifier); case IfmapStrings.IP_ADDRESS_EL_NAME: return createTextForIPAddress(identifier); default: throw new IllegalArgumentException("Unsupported identifier type: " + identifier.getTypeName()); } } /** * Returns a {@link String} representation of a IF-MAP <i>access-request</i> {@link Identifier}. * * @param identifier * {@link IdentifierWrapper} instance (encapsulating a {@link Identifier}) * @return {@link String} representing the <i>access-request</i> {@link Identifier}
switch (identifier.getTypeName()) { case IfmapStrings.ACCESS_REQUEST_EL_NAME: return createTextForAccessRequest(identifier); case IfmapStrings.DEVICE_EL_NAME: return createTextForDevice(identifier); case IfmapStrings.IDENTITY_EL_NAME: if (ExtendedIdentifierHelper.isExtendedIdentifier(identifier)) { return createTextForExtendedIdentifier(identifier); } else { return createTextForIdentity(identifier); } case IfmapStrings.MAC_ADDRESS_EL_NAME: return createTextForMacAddress(identifier); case IfmapStrings.IP_ADDRESS_EL_NAME: return createTextForIPAddress(identifier); default: throw new IllegalArgumentException(STR + identifier.getTypeName()); } } /** * Returns a {@link String} representation of a IF-MAP <i>access-request</i> {@link Identifier}. * * @param identifier * {@link IdentifierWrapper} instance (encapsulating a {@link Identifier}) * @return {@link String} representing the <i>access-request</i> {@link Identifier}
/** * Creates the text written into a {@link Identifier}-node, * based on the type and the information of the identifier itself. * * Uses abstract methods for each {@link Identifier}-type, e.g. device or * mac-address. * * @param identifier * the {@link Identifier} for creating the text * @return a {@link String} containing the specific information for the given {@link Identifier} */
Creates the text written into a <code>Identifier</code>-node, based on the type and the information of the identifier itself. Uses abstract methods for each <code>Identifier</code>-type, e.g. device or mac-address
getText
{ "repo_name": "trustathsh/visitmeta", "path": "visualization/src/main/java/de/hshannover/f4/trust/visitmeta/graphDrawer/nodeinformation/identifier/IdentifierInformationStrategy.java", "license": "apache-2.0", "size": 5371 }
[ "de.hshannover.f4.trust.ifmapj.binding.IfmapStrings", "de.hshannover.f4.trust.visitmeta.interfaces.Identifier", "de.hshannover.f4.trust.visitmeta.util.ExtendedIdentifierHelper", "de.hshannover.f4.trust.visitmeta.util.IdentifierWrapper" ]
import de.hshannover.f4.trust.ifmapj.binding.IfmapStrings; import de.hshannover.f4.trust.visitmeta.interfaces.Identifier; import de.hshannover.f4.trust.visitmeta.util.ExtendedIdentifierHelper; import de.hshannover.f4.trust.visitmeta.util.IdentifierWrapper;
import de.hshannover.f4.trust.ifmapj.binding.*; import de.hshannover.f4.trust.visitmeta.interfaces.*; import de.hshannover.f4.trust.visitmeta.util.*;
[ "de.hshannover.f4" ]
de.hshannover.f4;
2,543,666
public void checkExecute(Connection con, DatabaseObject obj) throws SQLException, PLSecurityException { if (principal == null) { throw new PLSecurityException(EXECUTE_PERMISSION, INVALID_MANAGER, obj); } checkPermission(con, principal, obj, EXECUTE_PERMISSION, true); }
void function(Connection con, DatabaseObject obj) throws SQLException, PLSecurityException { if (principal == null) { throw new PLSecurityException(EXECUTE_PERMISSION, INVALID_MANAGER, obj); } checkPermission(con, principal, obj, EXECUTE_PERMISSION, true); }
/** * Throws an exception if the current Principal user is not * allowed to execute the given object. Useful last-minute * security checks in the business model. * * @param con An open connection to the database that the current * user and the given object are a part of. * @param obj The object you want to check permissions on. * @throws PLSecurityException if the current user does not have * execute permission on <code>obj</code>. */
Throws an exception if the current Principal user is not allowed to execute the given object. Useful last-minute security checks in the business model
checkExecute
{ "repo_name": "malikoski/sqlpower-library", "path": "src/main/java/ca/sqlpower/security/PLSecurityManager.java", "license": "gpl-3.0", "size": 41504 }
[ "ca.sqlpower.sql.DatabaseObject", "java.sql.Connection", "java.sql.SQLException" ]
import ca.sqlpower.sql.DatabaseObject; import java.sql.Connection; import java.sql.SQLException;
import ca.sqlpower.sql.*; import java.sql.*;
[ "ca.sqlpower.sql", "java.sql" ]
ca.sqlpower.sql; java.sql;
242,572
void setCurrentFile(File currentFile) { this.currentFile = currentFile; }
void setCurrentFile(File currentFile) { this.currentFile = currentFile; }
/** * Establece el archivo actual. * * @param currentFile el archivo actual */
Establece el archivo actual
setCurrentFile
{ "repo_name": "camilozuluaga/softGYM", "path": "src/textpademo/TPEditor.java", "license": "gpl-3.0", "size": 35451 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
1,193,213
public static String getDataDirPath() { String dataDirectory = null; Properties systemProp = System.getProperties(); // In case JBoss is used if (systemProp.containsKey("jboss.server.data.dir")) { dataDirectory = systemProp.getProperty("jboss.server.data.dir"); if (!dataDirectory.endsWith(SEPARATOR)) { dataDirectory += SEPARATOR; } } // Otherwise use a temp directory else { dataDirectory = System.getProperty("java.io.tmpdir"); if (!dataDirectory.endsWith(SEPARATOR)) { dataDirectory += SEPARATOR; } } return dataDirectory; }
static String function() { String dataDirectory = null; Properties systemProp = System.getProperties(); if (systemProp.containsKey(STR)) { dataDirectory = systemProp.getProperty(STR); if (!dataDirectory.endsWith(SEPARATOR)) { dataDirectory += SEPARATOR; } } else { dataDirectory = System.getProperty(STR); if (!dataDirectory.endsWith(SEPARATOR)) { dataDirectory += SEPARATOR; } } return dataDirectory; }
/** * Get the data dir to be used; in case JBoss is used, use its data dir, * otherwise the user temp. * @return */
Get the data dir to be used; in case JBoss is used, use its data dir, otherwise the user temp
getDataDirPath
{ "repo_name": "schlotze/u-qasar.platform", "path": "src/main/java/eu/uqasar/util/UQasarUtil.java", "license": "apache-2.0", "size": 44740 }
[ "java.util.Properties" ]
import java.util.Properties;
import java.util.*;
[ "java.util" ]
java.util;
358,630
public ProjectRequestFactory updateProject(final Project project) throws CreateRequestException { this.verifyNotNull(project); return (this.updateProject(project.getCompanyId(), project)); }
ProjectRequestFactory function(final Project project) throws CreateRequestException { this.verifyNotNull(project); return (this.updateProject(project.getCompanyId(), project)); }
/** * Create a {@code PUT} request for a {@link Project}. * * @param project * The {@link Project} to update. Should not be {@code null} and has a valid id. * @return The {@link ProjectRequestFactory} that represent a {@code PUT} request. * @throws CreateRequestException * If a parameter doesn't not respect its precondition, an exception is thrown. * @see ProjectRequestFactory#updateProject(int, Project) */
Create a PUT request for a <code>Project</code>
updateProject
{ "repo_name": "VisianTeam/VIPJavaSDK", "path": "src/fr/visian/vip/client/sdk/request/factory/ProjectRequestFactory.java", "license": "apache-2.0", "size": 10998 }
[ "fr.visian.vip.client.sdk.exception.CreateRequestException", "fr.visian.vip.client.sdk.model.Project" ]
import fr.visian.vip.client.sdk.exception.CreateRequestException; import fr.visian.vip.client.sdk.model.Project;
import fr.visian.vip.client.sdk.exception.*; import fr.visian.vip.client.sdk.model.*;
[ "fr.visian.vip" ]
fr.visian.vip;
153,487
public void releaseTAE(TextAnalysisEngine aTAE) { releaseAnalysisEngine(aTAE); }
void function(TextAnalysisEngine aTAE) { releaseAnalysisEngine(aTAE); }
/** * Checks in a TAE to the pool. Also notifies other Threads that may be waiting for a connection. * * @param aTAE * the resource to release */
Checks in a TAE to the pool. Also notifies other Threads that may be waiting for a connection
releaseTAE
{ "repo_name": "apache/uima-uimaj", "path": "uimaj-core/src/main/java/org/apache/uima/internal/util/TextAnalysisEnginePool.java", "license": "apache-2.0", "size": 4429 }
[ "org.apache.uima.analysis_engine.TextAnalysisEngine" ]
import org.apache.uima.analysis_engine.TextAnalysisEngine;
import org.apache.uima.analysis_engine.*;
[ "org.apache.uima" ]
org.apache.uima;
1,267,774
public Command addCommand(String name, String bean);
Command function(String name, String bean);
/** * Create and add a command response element. * * @param name The element name * @param bean The bean name */
Create and add a command response element
addCommand
{ "repo_name": "iritgo/iritgo-aktera", "path": "aktera-core/src/main/java/de/iritgo/aktera/ui/UIResponse.java", "license": "apache-2.0", "size": 7547 }
[ "de.iritgo.aktera.model.Command" ]
import de.iritgo.aktera.model.Command;
import de.iritgo.aktera.model.*;
[ "de.iritgo.aktera" ]
de.iritgo.aktera;
255,389
public Gradient getHoverBackgroundColorAsGradient() { // checks if the property is not a gradient (therefore a color or pattern) if (hasGradients(Dataset.CanvasObjectProperty.HOVER_BACKGROUND_COLOR)) { List<Gradient> gradients = getGradientsContainer().getObjects(Dataset.CanvasObjectProperty.HOVER_BACKGROUND_COLOR); // returns color as gradient return gradients.get(0); } // if here, the property is not a object // or the property is missing or a color // returns null return null; }
Gradient function() { if (hasGradients(Dataset.CanvasObjectProperty.HOVER_BACKGROUND_COLOR)) { List<Gradient> gradients = getGradientsContainer().getObjects(Dataset.CanvasObjectProperty.HOVER_BACKGROUND_COLOR); return gradients.get(0); } return null; }
/** * Returns the fill gradients of elements when hovered. If property is missing or not a gradient, returns <code>null</code>. * * @return the fill gradients of elements when hovered. If property is missing or not a gradient, returns <code>null</code> */
Returns the fill gradients of elements when hovered. If property is missing or not a gradient, returns <code>null</code>
getHoverBackgroundColorAsGradient
{ "repo_name": "pepstock-org/Charba", "path": "src/org/pepstock/charba/client/data/LiningDataset.java", "license": "apache-2.0", "size": 98572 }
[ "java.util.List", "org.pepstock.charba.client.colors.Gradient" ]
import java.util.List; import org.pepstock.charba.client.colors.Gradient;
import java.util.*; import org.pepstock.charba.client.colors.*;
[ "java.util", "org.pepstock.charba" ]
java.util; org.pepstock.charba;
1,511,920
private void openNewEditor() { // Set up the input used to create an editor with an ICEResourcePage. Form form = new Form(); resources = new ResourceComponent(); form.addComponent(resources); // Open the editor and get the ICEResourcePage. editorRef = openICEFormEditor(form); ICEFormEditor editor = (ICEFormEditor) editorRef.getPart(false); page = editor.getResourcePage(); }
void function() { Form form = new Form(); resources = new ResourceComponent(); form.addComponent(resources); editorRef = openICEFormEditor(form); ICEFormEditor editor = (ICEFormEditor) editorRef.getPart(false); page = editor.getResourcePage(); }
/** * Opens the {@link #page} in a new {@code ICEFormEditor}. After returning, * the following instance variables will be set: * <ul> * <li>{@link #page}</li> * <li>{@link #resources}</li> * <li>{@link #editorRef}</li> * </ul> */
Opens the <code>#page</code> in a new ICEFormEditor. After returning, the following instance variables will be set: <code>#page</code> <code>#resources</code> <code>#editorRef</code>
openNewEditor
{ "repo_name": "eclipse/ice", "path": "org.eclipse.ice.tests.client.widgets/src/org/eclipse/ice/tests/client/widgets/ICEResourcePageTester.java", "license": "epl-1.0", "size": 12097 }
[ "org.eclipse.ice.client.widgets.ICEFormEditor", "org.eclipse.ice.datastructures.form.Form", "org.eclipse.ice.datastructures.form.ResourceComponent" ]
import org.eclipse.ice.client.widgets.ICEFormEditor; import org.eclipse.ice.datastructures.form.Form; import org.eclipse.ice.datastructures.form.ResourceComponent;
import org.eclipse.ice.client.widgets.*; import org.eclipse.ice.datastructures.form.*;
[ "org.eclipse.ice" ]
org.eclipse.ice;
2,609,657
EAttribute getWherePart_Name();
EAttribute getWherePart_Name();
/** * Returns the meta object for the attribute '{@link com.euclideanspace.spad.editor.WherePart#getName <em>Name</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Name</em>'. * @see com.euclideanspace.spad.editor.WherePart#getName() * @see #getWherePart() * @generated */
Returns the meta object for the attribute '<code>com.euclideanspace.spad.editor.WherePart#getName Name</code>'.
getWherePart_Name
{ "repo_name": "martinbaker/euclideanspace", "path": "com.euclideanspace.spad/src-gen/com/euclideanspace/spad/editor/EditorPackage.java", "license": "agpl-3.0", "size": 593321 }
[ "org.eclipse.emf.ecore.EAttribute" ]
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,228,533
EClass getIdentifiedObject();
EClass getIdentifiedObject();
/** * Returns the meta object for class '{@link CIM.IEC61970.Core.IdentifiedObject <em>Identified Object</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Identified Object</em>'. * @see CIM.IEC61970.Core.IdentifiedObject * @generated */
Returns the meta object for class '<code>CIM.IEC61970.Core.IdentifiedObject Identified Object</code>'.
getIdentifiedObject
{ "repo_name": "georghinkel/ttc2017smartGrids", "path": "solutions/ModelJoin/src/main/java/CIM/IEC61970/Core/CorePackage.java", "license": "mit", "size": 253784 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,481,199
public void assertNotEmpty(AssertionInfo info, short[] actual) { arrays.assertNotEmpty(info, failures, actual); }
void function(AssertionInfo info, short[] actual) { arrays.assertNotEmpty(info, failures, actual); }
/** * Asserts that the given array is not empty. * @param info contains information about the assertion. * @param actual the given array. * @throws AssertionError if the given array is {@code null}. * @throws AssertionError if the given array is empty. */
Asserts that the given array is not empty
assertNotEmpty
{ "repo_name": "nicstrong/fest-assertions-android", "path": "fest-assert-android/src/main/java/org/fest/assertions/internal/ShortArrays.java", "license": "apache-2.0", "size": 10126 }
[ "org.fest.assertions.core.AssertionInfo" ]
import org.fest.assertions.core.AssertionInfo;
import org.fest.assertions.core.*;
[ "org.fest.assertions" ]
org.fest.assertions;
1,221,571
@Override protected void logd(String s) { Rlog.d(getName(), s); }
void function(String s) { Rlog.d(getName(), s); }
/** * Log with debug attribute * * @param s is string log */
Log with debug attribute
logd
{ "repo_name": "s20121035/rk3288_android5.1_repo", "path": "frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java", "license": "gpl-3.0", "size": 90991 }
[ "android.telephony.Rlog" ]
import android.telephony.Rlog;
import android.telephony.*;
[ "android.telephony" ]
android.telephony;
1,262,095
public void setAffinityGroups(final ArrayList<AffinityGroupListResponse.AffinityGroup> affinityGroupsValue) { this.affinityGroups = affinityGroupsValue; } public AffinityGroupListResponse() { super(); this.setAffinityGroups(new LazyArrayList<AffinityGroupListResponse.AffinityGroup>()); }
void function(final ArrayList<AffinityGroupListResponse.AffinityGroup> affinityGroupsValue) { this.affinityGroups = affinityGroupsValue; } public AffinityGroupListResponse() { super(); this.setAffinityGroups(new LazyArrayList<AffinityGroupListResponse.AffinityGroup>()); }
/** * Optional. The affinity groups associated with the specified subscription. * @param affinityGroupsValue The AffinityGroups value. */
Optional. The affinity groups associated with the specified subscription
setAffinityGroups
{ "repo_name": "southworkscom/azure-sdk-for-java", "path": "service-management/azure-svc-mgmt/src/main/java/com/microsoft/windowsazure/management/models/AffinityGroupListResponse.java", "license": "apache-2.0", "size": 7156 }
[ "com.microsoft.windowsazure.core.LazyArrayList", "java.util.ArrayList" ]
import com.microsoft.windowsazure.core.LazyArrayList; import java.util.ArrayList;
import com.microsoft.windowsazure.core.*; import java.util.*;
[ "com.microsoft.windowsazure", "java.util" ]
com.microsoft.windowsazure; java.util;
2,348,311
protected void removeCurrentListener(HttpServletRequest request) { AbstractUploadListener listener = getCurrentListener(request); if (listener != null) { listener.remove(); } } /** * Override this to provide a session key which allow to differentiate between * multiple instances of uploaders in an application with the same session but * who do not wish to share the uploaded files. * Example: * protected String getSessionFilesKey(HttpServletRequest request) { * return getSessionFilesKey(request.getParameter("randomNumber")); * } * * public static String getSessionFilesKey(String parameter) { * return "SESSION_FILES_" + parameter; * }
void function(HttpServletRequest request) { AbstractUploadListener listener = getCurrentListener(request); if (listener != null) { listener.remove(); } } /** * Override this to provide a session key which allow to differentiate between * multiple instances of uploaders in an application with the same session but * who do not wish to share the uploaded files. * Example: * protected String getSessionFilesKey(HttpServletRequest request) { * return getSessionFilesKey(request.getParameter(STR)); * } * * public static String getSessionFilesKey(String parameter) { * return STR + parameter; * }
/** * Remove the listener active in this session. * * @param request */
Remove the listener active in this session
removeCurrentListener
{ "repo_name": "jijo-paulose/gwtupload", "path": "core/src/main/java/gwtupload/server/UploadServlet.java", "license": "apache-2.0", "size": 38870 }
[ "javax.servlet.http.HttpServletRequest" ]
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.*;
[ "javax.servlet" ]
javax.servlet;
899,681
@Implementation public Iterator<String> schemesIterator() { return schemes.isEmpty() ? null : schemes.iterator(); }
Iterator<String> function() { return schemes.isEmpty() ? null : schemes.iterator(); }
/** * Provides an iterator over all defined schemes. Returns {@code null} if none were * specified. */
Provides an iterator over all defined schemes. Returns null if none were specified
schemesIterator
{ "repo_name": "StudienprojektUniTrier/Client", "path": "library/javatests/org/robolectric/shadows/ShadowIntentFilterFixed.java", "license": "apache-2.0", "size": 1865 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
1,216,354
public static String writeToString(Blob blob) throws IOException { return new String(writeToByteArray(blob), StandardCharsets.UTF_8); }
static String function(Blob blob) throws IOException { return new String(writeToByteArray(blob), StandardCharsets.UTF_8); }
/** * Writes the BLOB to a string with UTF-8 decoding. * * @param blob the BLOB to write * @return the BLOB contents as a string * @throws IOException if writing out the BLOB contents fails */
Writes the BLOB to a string with UTF-8 decoding
writeToString
{ "repo_name": "GoogleContainerTools/jib", "path": "jib-core/src/main/java/com/google/cloud/tools/jib/blob/Blobs.java", "license": "apache-2.0", "size": 2456 }
[ "java.io.IOException", "java.nio.charset.StandardCharsets" ]
import java.io.IOException; import java.nio.charset.StandardCharsets;
import java.io.*; import java.nio.charset.*;
[ "java.io", "java.nio" ]
java.io; java.nio;
1,280,796
static Reader createReaderFromStream(Path path, FSDataInputStream fsdis, long size, CacheConfig cacheConf, Configuration conf) throws IOException { FSDataInputStreamWrapper wrapper = new FSDataInputStreamWrapper(fsdis); return pickReaderVersion(path, wrapper, size, cacheConf, null, conf); }
static Reader createReaderFromStream(Path path, FSDataInputStream fsdis, long size, CacheConfig cacheConf, Configuration conf) throws IOException { FSDataInputStreamWrapper wrapper = new FSDataInputStreamWrapper(fsdis); return pickReaderVersion(path, wrapper, size, cacheConf, null, conf); }
/** * This factory method is used only by unit tests */
This factory method is used only by unit tests
createReaderFromStream
{ "repo_name": "ibmsoe/hbase", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java", "license": "apache-2.0", "size": 32325 }
[ "java.io.IOException", "org.apache.hadoop.conf.Configuration", "org.apache.hadoop.fs.FSDataInputStream", "org.apache.hadoop.fs.Path", "org.apache.hadoop.hbase.io.FSDataInputStreamWrapper" ]
import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.io.FSDataInputStreamWrapper;
import java.io.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hbase.io.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
967,381
@Override public void writeBundleDataOnZooKeeper() { updateBundleData(); // Write the bundle data to ZooKeeper. for (Map.Entry<String, BundleData> entry : loadData.getBundleData().entrySet()) { final String bundle = entry.getKey(); final BundleData data = entry.getValue(); try { final String zooKeeperPath = getBundleDataZooKeeperPath(bundle); createZPathIfNotExists(zkClient, zooKeeperPath); zkClient.setData(zooKeeperPath, data.getJsonBytes(), -1); } catch (Exception e) { log.warn("Error when writing data for bundle {} to ZooKeeper: {}", bundle, e); } } // Write the time average broker data to ZooKeeper. for (Map.Entry<String, BrokerData> entry : loadData.getBrokerData().entrySet()) { final String broker = entry.getKey(); final TimeAverageBrokerData data = entry.getValue().getTimeAverageData(); try { final String zooKeeperPath = TIME_AVERAGE_BROKER_ZPATH + "/" + broker; createZPathIfNotExists(zkClient, zooKeeperPath); zkClient.setData(zooKeeperPath, data.getJsonBytes(), -1); if (log.isDebugEnabled()) { log.debug("Writing zookeeper report {}", data); } } catch (Exception e) { log.warn("Error when writing time average broker data for {} to ZooKeeper: {}", broker, e); } } }
void function() { updateBundleData(); for (Map.Entry<String, BundleData> entry : loadData.getBundleData().entrySet()) { final String bundle = entry.getKey(); final BundleData data = entry.getValue(); try { final String zooKeeperPath = getBundleDataZooKeeperPath(bundle); createZPathIfNotExists(zkClient, zooKeeperPath); zkClient.setData(zooKeeperPath, data.getJsonBytes(), -1); } catch (Exception e) { log.warn(STR, bundle, e); } } for (Map.Entry<String, BrokerData> entry : loadData.getBrokerData().entrySet()) { final String broker = entry.getKey(); final TimeAverageBrokerData data = entry.getValue().getTimeAverageData(); try { final String zooKeeperPath = TIME_AVERAGE_BROKER_ZPATH + "/" + broker; createZPathIfNotExists(zkClient, zooKeeperPath); zkClient.setData(zooKeeperPath, data.getJsonBytes(), -1); if (log.isDebugEnabled()) { log.debug(STR, data); } } catch (Exception e) { log.warn(STR, broker, e); } } }
/** * As the leader broker, write bundle data aggregated from all brokers to ZooKeeper. */
As the leader broker, write bundle data aggregated from all brokers to ZooKeeper
writeBundleDataOnZooKeeper
{ "repo_name": "saandrews/pulsar", "path": "pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/ModularLoadManagerImpl.java", "license": "apache-2.0", "size": 46594 }
[ "java.util.Map", "org.apache.pulsar.broker.BrokerData", "org.apache.pulsar.broker.BundleData", "org.apache.pulsar.broker.TimeAverageBrokerData" ]
import java.util.Map; import org.apache.pulsar.broker.BrokerData; import org.apache.pulsar.broker.BundleData; import org.apache.pulsar.broker.TimeAverageBrokerData;
import java.util.*; import org.apache.pulsar.broker.*;
[ "java.util", "org.apache.pulsar" ]
java.util; org.apache.pulsar;
1,557,521
CmsGalleryDialog getGalleryDialog();
CmsGalleryDialog getGalleryDialog();
/** * Gets the gallery dialog in which this preview is displayed.<p> * * @return the gallery dialog */
Gets the gallery dialog in which this preview is displayed
getGalleryDialog
{ "repo_name": "it-tavis/opencms-core", "path": "src-gwt/org/opencms/ade/galleries/client/preview/I_CmsResourcePreview.java", "license": "lgpl-2.1", "size": 4885 }
[ "org.opencms.ade.galleries.client.ui.CmsGalleryDialog" ]
import org.opencms.ade.galleries.client.ui.CmsGalleryDialog;
import org.opencms.ade.galleries.client.ui.*;
[ "org.opencms.ade" ]
org.opencms.ade;
2,723,422
public void test(TestHarness harness) { this.harness = harness; harness.checkPoint("compareTo"); compare(Boolean.TRUE, Boolean.TRUE, EQUAL); compare(Boolean.TRUE, Boolean.FALSE, GREATER); compare(Boolean.FALSE, Boolean.TRUE, LESS); compare(Boolean.FALSE, Boolean.FALSE, EQUAL); }
void function(TestHarness harness) { this.harness = harness; harness.checkPoint(STR); compare(Boolean.TRUE, Boolean.TRUE, EQUAL); compare(Boolean.TRUE, Boolean.FALSE, GREATER); compare(Boolean.FALSE, Boolean.TRUE, LESS); compare(Boolean.FALSE, Boolean.FALSE, EQUAL); }
/** * Entry point to this test. */
Entry point to this test
test
{ "repo_name": "niloc132/mauve-gwt", "path": "src/main/java/gnu/testlet/java/lang/Boolean/compareToBoolean.java", "license": "gpl-2.0", "size": 1987 }
[ "gnu.testlet.TestHarness" ]
import gnu.testlet.TestHarness;
import gnu.testlet.*;
[ "gnu.testlet" ]
gnu.testlet;
347,704
@Test ( expected = Exception.class ) public void test6c () { final MetaKey key1 = new MetaKey ( "mock", "6c1" ); this.mgr.registerModel ( 1, key1, new MockStorageProvider ( key1.getKey (), "foo" ) ); this.mgr.accessRun ( key1, MockStorageModel.class, m1 -> { m1.setValue ( "bar" ); } ); }
@Test ( expected = Exception.class ) void function () { final MetaKey key1 = new MetaKey ( "mock", "6c1" ); this.mgr.registerModel ( 1, key1, new MockStorageProvider ( key1.getKey (), "foo" ) ); this.mgr.accessRun ( key1, MockStorageModel.class, m1 -> { m1.setValue ( "bar" ); } ); }
/** * Request the write model in read mode. Expect failure! */
Request the write model in read mode. Expect failure
test6c
{ "repo_name": "ctron/package-drone", "path": "bundles/org.eclipse.packagedrone.storage.apm.tests/src/org/eclipse/packagedrone/storage/apm/BaseTest.java", "license": "epl-1.0", "size": 22200 }
[ "org.eclipse.packagedrone.repo.MetaKey", "org.junit.Test" ]
import org.eclipse.packagedrone.repo.MetaKey; import org.junit.Test;
import org.eclipse.packagedrone.repo.*; import org.junit.*;
[ "org.eclipse.packagedrone", "org.junit" ]
org.eclipse.packagedrone; org.junit;
2,180,054
private byte readByte() throws IOException { try { if(currentByteBuffer().hasRemaining()) { synchronized(sizeLock) { size --; } return currentByteBuffer().get(); } else { return readByte(); } } catch(Exception e) { throw new IOException(e.getMessage()); } }
byte function() throws IOException { try { if(currentByteBuffer().hasRemaining()) { synchronized(sizeLock) { size --; } return currentByteBuffer().get(); } else { return readByte(); } } catch(Exception e) { throw new IOException(e.getMessage()); } }
/** * Extracts bytes from the buffers one by one or throw an exception. * Blocks if there is nothing . * @return * @throws IOException */
Extracts bytes from the buffers one by one or throw an exception. Blocks if there is nothing
readByte
{ "repo_name": "yongs2/mts-project", "path": "mts/src/main/java/com/devoteam/srit/xmlloader/core/hybridnio/HybridInputStream.java", "license": "gpl-3.0", "size": 5991 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,108,103
public void processTouchEvent(MotionEvent ev) { final int action = MotionEventCompat.getActionMasked(ev); final int actionIndex = MotionEventCompat.getActionIndex(ev); if (action == MotionEvent.ACTION_DOWN) { // Reset things for a new event stream, just in case we didn't get // the whole previous stream. cancel(); } if (mVelocityTracker == null) { mVelocityTracker = VelocityTracker.obtain(); } mVelocityTracker.addMovement(ev); switch (action) { case MotionEvent.ACTION_DOWN: { final float x = ev.getX(); final float y = ev.getY(); final int pointerId = MotionEventCompat.getPointerId(ev, 0); final View toCapture = findTopChildUnder((int) x, (int) y); saveInitialMotion(x, y, pointerId); // Since the parent is already directly processing this touch // event, // there is no reason to delay for a slop before dragging. // Start immediately if possible. tryCaptureViewForDrag(toCapture, pointerId); final int edgesTouched = mInitialEdgesTouched[pointerId]; if ((edgesTouched & mTrackingEdges) != 0) { mCallback.onEdgeTouched(edgesTouched & mTrackingEdges, pointerId); } break; } case MotionEventCompat.ACTION_POINTER_DOWN: { final int pointerId = MotionEventCompat.getPointerId(ev, actionIndex); final float x = MotionEventCompat.getX(ev, actionIndex); final float y = MotionEventCompat.getY(ev, actionIndex); saveInitialMotion(x, y, pointerId); // A ViewDragHelper can only manipulate one view at a time. if (mDragState == STATE_IDLE) { // If we're idle we can do anything! Treat it like a normal // down event. final View toCapture = findTopChildUnder((int) x, (int) y); tryCaptureViewForDrag(toCapture, pointerId); final int edgesTouched = mInitialEdgesTouched[pointerId]; if ((edgesTouched & mTrackingEdges) != 0) { mCallback.onEdgeTouched(edgesTouched & mTrackingEdges, pointerId); } } else if (isCapturedViewUnder((int) x, (int) y)) { // We're still tracking a captured view. If the same view is // under this // point, we'll swap to controlling it with this pointer // instead. // (This will still work if we're "catching" a settling // view.) tryCaptureViewForDrag(mCapturedView, pointerId); } break; } case MotionEvent.ACTION_MOVE: { if (mDragState == STATE_DRAGGING) { final int index = MotionEventCompat.findPointerIndex(ev, mActivePointerId); final float x = MotionEventCompat.getX(ev, index); final float y = MotionEventCompat.getY(ev, index); final int idx = (int) (x - mLastMotionX[mActivePointerId]); final int idy = (int) (y - mLastMotionY[mActivePointerId]); dragTo(mCapturedView.getLeft() + idx, mCapturedView.getTop() + idy, idx, idy); saveLastMotion(ev); } else { // Check to see if any pointer is now over a draggable view. final int pointerCount = MotionEventCompat.getPointerCount(ev); for (int i = 0; i < pointerCount; i++) { final int pointerId = MotionEventCompat.getPointerId(ev, i); final float x = MotionEventCompat.getX(ev, i); final float y = MotionEventCompat.getY(ev, i); final float dx = x - mInitialMotionX[pointerId]; final float dy = y - mInitialMotionY[pointerId]; reportNewEdgeDrags(dx, dy, pointerId); if (mDragState == STATE_DRAGGING) { // Callback might have started an edge drag. break; } final View toCapture = findTopChildUnder((int) x, (int) y); if (checkTouchSlop(toCapture, dx, dy) && tryCaptureViewForDrag(toCapture, pointerId)) { break; } } saveLastMotion(ev); } break; } case MotionEventCompat.ACTION_POINTER_UP: { final int pointerId = MotionEventCompat.getPointerId(ev, actionIndex); if (mDragState == STATE_DRAGGING && pointerId == mActivePointerId) { // Try to find another pointer that's still holding on to // the captured view. int newActivePointer = INVALID_POINTER; final int pointerCount = MotionEventCompat.getPointerCount(ev); for (int i = 0; i < pointerCount; i++) { final int id = MotionEventCompat.getPointerId(ev, i); if (id == mActivePointerId) { // This one's going away, skip. continue; } final float x = MotionEventCompat.getX(ev, i); final float y = MotionEventCompat.getY(ev, i); if (findTopChildUnder((int) x, (int) y) == mCapturedView && tryCaptureViewForDrag(mCapturedView, id)) { newActivePointer = mActivePointerId; break; } } if (newActivePointer == INVALID_POINTER) { // We didn't find another pointer still touching the // view, release it. releaseViewForPointerUp(); } } clearMotionHistory(pointerId); break; } case MotionEvent.ACTION_UP: { if (mDragState == STATE_DRAGGING) { releaseViewForPointerUp(); } cancel(); break; } case MotionEvent.ACTION_CANCEL: { if (mDragState == STATE_DRAGGING) { dispatchViewReleased(0, 0); } cancel(); break; } } }
void function(MotionEvent ev) { final int action = MotionEventCompat.getActionMasked(ev); final int actionIndex = MotionEventCompat.getActionIndex(ev); if (action == MotionEvent.ACTION_DOWN) { cancel(); } if (mVelocityTracker == null) { mVelocityTracker = VelocityTracker.obtain(); } mVelocityTracker.addMovement(ev); switch (action) { case MotionEvent.ACTION_DOWN: { final float x = ev.getX(); final float y = ev.getY(); final int pointerId = MotionEventCompat.getPointerId(ev, 0); final View toCapture = findTopChildUnder((int) x, (int) y); saveInitialMotion(x, y, pointerId); tryCaptureViewForDrag(toCapture, pointerId); final int edgesTouched = mInitialEdgesTouched[pointerId]; if ((edgesTouched & mTrackingEdges) != 0) { mCallback.onEdgeTouched(edgesTouched & mTrackingEdges, pointerId); } break; } case MotionEventCompat.ACTION_POINTER_DOWN: { final int pointerId = MotionEventCompat.getPointerId(ev, actionIndex); final float x = MotionEventCompat.getX(ev, actionIndex); final float y = MotionEventCompat.getY(ev, actionIndex); saveInitialMotion(x, y, pointerId); if (mDragState == STATE_IDLE) { final View toCapture = findTopChildUnder((int) x, (int) y); tryCaptureViewForDrag(toCapture, pointerId); final int edgesTouched = mInitialEdgesTouched[pointerId]; if ((edgesTouched & mTrackingEdges) != 0) { mCallback.onEdgeTouched(edgesTouched & mTrackingEdges, pointerId); } } else if (isCapturedViewUnder((int) x, (int) y)) { tryCaptureViewForDrag(mCapturedView, pointerId); } break; } case MotionEvent.ACTION_MOVE: { if (mDragState == STATE_DRAGGING) { final int index = MotionEventCompat.findPointerIndex(ev, mActivePointerId); final float x = MotionEventCompat.getX(ev, index); final float y = MotionEventCompat.getY(ev, index); final int idx = (int) (x - mLastMotionX[mActivePointerId]); final int idy = (int) (y - mLastMotionY[mActivePointerId]); dragTo(mCapturedView.getLeft() + idx, mCapturedView.getTop() + idy, idx, idy); saveLastMotion(ev); } else { final int pointerCount = MotionEventCompat.getPointerCount(ev); for (int i = 0; i < pointerCount; i++) { final int pointerId = MotionEventCompat.getPointerId(ev, i); final float x = MotionEventCompat.getX(ev, i); final float y = MotionEventCompat.getY(ev, i); final float dx = x - mInitialMotionX[pointerId]; final float dy = y - mInitialMotionY[pointerId]; reportNewEdgeDrags(dx, dy, pointerId); if (mDragState == STATE_DRAGGING) { break; } final View toCapture = findTopChildUnder((int) x, (int) y); if (checkTouchSlop(toCapture, dx, dy) && tryCaptureViewForDrag(toCapture, pointerId)) { break; } } saveLastMotion(ev); } break; } case MotionEventCompat.ACTION_POINTER_UP: { final int pointerId = MotionEventCompat.getPointerId(ev, actionIndex); if (mDragState == STATE_DRAGGING && pointerId == mActivePointerId) { int newActivePointer = INVALID_POINTER; final int pointerCount = MotionEventCompat.getPointerCount(ev); for (int i = 0; i < pointerCount; i++) { final int id = MotionEventCompat.getPointerId(ev, i); if (id == mActivePointerId) { continue; } final float x = MotionEventCompat.getX(ev, i); final float y = MotionEventCompat.getY(ev, i); if (findTopChildUnder((int) x, (int) y) == mCapturedView && tryCaptureViewForDrag(mCapturedView, id)) { newActivePointer = mActivePointerId; break; } } if (newActivePointer == INVALID_POINTER) { releaseViewForPointerUp(); } } clearMotionHistory(pointerId); break; } case MotionEvent.ACTION_UP: { if (mDragState == STATE_DRAGGING) { releaseViewForPointerUp(); } cancel(); break; } case MotionEvent.ACTION_CANCEL: { if (mDragState == STATE_DRAGGING) { dispatchViewReleased(0, 0); } cancel(); break; } } }
/** * Process a touch event received by the parent view. This method will * dispatch callback events as needed before returning. The parent view's * onTouchEvent implementation should call this. * * @param ev * The touch event received by the parent view */
Process a touch event received by the parent view. This method will dispatch callback events as needed before returning. The parent view's onTouchEvent implementation should call this
processTouchEvent
{ "repo_name": "lgtianxiawudi/StudyDemo", "path": "Commonlibrary/src/main/java/com/example/ligang/commonlibrary/swipeback/ViewDragHelper.java", "license": "apache-2.0", "size": 53222 }
[ "android.support.v4.view.MotionEventCompat", "android.view.MotionEvent", "android.view.VelocityTracker", "android.view.View" ]
import android.support.v4.view.MotionEventCompat; import android.view.MotionEvent; import android.view.VelocityTracker; import android.view.View;
import android.support.v4.view.*; import android.view.*;
[ "android.support", "android.view" ]
android.support; android.view;
1,035,543
public static final SourceModel.Expr filter(SourceModel.Expr p, SourceModel.Expr s) { return SourceModel.Expr.Application.make( new SourceModel.Expr[] {SourceModel.Expr.Var.make(Functions.filter), p, s}); } public static final QualifiedName filter = QualifiedName.make(CAL_Set.MODULE_NAME, "filter");
static final SourceModel.Expr function(SourceModel.Expr p, SourceModel.Expr s) { return SourceModel.Expr.Application.make( new SourceModel.Expr[] {SourceModel.Expr.Var.make(Functions.filter), p, s}); } static final QualifiedName function = QualifiedName.make(CAL_Set.MODULE_NAME, STR);
/** * Filters all elements that satisfy the predicate. * <p> * Complexity: O(n) * * @param p (CAL type: <code>a -> Cal.Core.Prelude.Boolean</code>) * the predicate for testing the elements. * @param s (CAL type: <code>Cal.Collections.Set.Set a</code>) * the set. * @return (CAL type: <code>Cal.Collections.Set.Set a</code>) * the set containing only those elements that satisfy the predicate. */
Filters all elements that satisfy the predicate. Complexity: O(n)
filter
{ "repo_name": "levans/Open-Quark", "path": "src/CAL_Platform/src/org/openquark/cal/module/Cal/Collections/CAL_Set.java", "license": "bsd-3-clause", "size": 39863 }
[ "org.openquark.cal.compiler.QualifiedName", "org.openquark.cal.compiler.SourceModel" ]
import org.openquark.cal.compiler.QualifiedName; import org.openquark.cal.compiler.SourceModel;
import org.openquark.cal.compiler.*;
[ "org.openquark.cal" ]
org.openquark.cal;
246,483
public void addRangeNotifier(@NonNull RangeNotifier notifier) { //noinspection ConstantConditions if (notifier != null) { rangeNotifiers.add(notifier); } }
void function(@NonNull RangeNotifier notifier) { if (notifier != null) { rangeNotifiers.add(notifier); } }
/** * Specifies a class that should be called each time the <code>BeaconService</code> gets ranging * data, which is nominally once per second when beacons are detected. * <p/> * Permits to register several <code>RangeNotifier</code> objects. * <p/> * The notifier must be unregistered using (@link #removeRangeNotifier) * * @param notifier The {@link RangeNotifier} to register. * @see RangeNotifier */
Specifies a class that should be called each time the <code>BeaconService</code> gets ranging data, which is nominally once per second when beacons are detected. Permits to register several <code>RangeNotifier</code> objects. The notifier must be unregistered using (@link #removeRangeNotifier)
addRangeNotifier
{ "repo_name": "paulpv/android-beacon-library", "path": "lib/src/main/java/org/altbeacon/beacon/BeaconManager.java", "license": "apache-2.0", "size": 56939 }
[ "androidx.annotation.NonNull" ]
import androidx.annotation.NonNull;
import androidx.annotation.*;
[ "androidx.annotation" ]
androidx.annotation;
2,669,128
public DirContext getResources() { return this.dirContext; }
DirContext function() { return this.dirContext; }
/** * Get the resources DirContext object with which this Container is * associated. * * @param resources The new associated DirContext */
Get the resources DirContext object with which this Container is associated
getResources
{ "repo_name": "devjin24/howtomcatworks", "path": "bookrefer/jakarta-tomcat-5.0.18-src/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardDefaultContext.java", "license": "apache-2.0", "size": 54037 }
[ "javax.naming.directory.DirContext" ]
import javax.naming.directory.DirContext;
import javax.naming.directory.*;
[ "javax.naming" ]
javax.naming;
1,270,295
private void deepCopy(final Node objectRef, final ObjectDatabase from, final ObjectDatabase to, Set<ObjectId> metadataIds) { if (objectRef.getMetadataId().isPresent()) { metadataIds.add(objectRef.getMetadataId().get()); } final ObjectId objectId = objectRef.getObjectId(); if (TYPE.TREE.equals(objectRef.getType())) { copyTree(objectId, from, to, metadataIds); } else { copyObject(objectId, from, to); } }
void function(final Node objectRef, final ObjectDatabase from, final ObjectDatabase to, Set<ObjectId> metadataIds) { if (objectRef.getMetadataId().isPresent()) { metadataIds.add(objectRef.getMetadataId().get()); } final ObjectId objectId = objectRef.getObjectId(); if (TYPE.TREE.equals(objectRef.getType())) { copyTree(objectId, from, to, metadataIds); } else { copyObject(objectId, from, to); } }
/** * Transfers the object referenced by {@code objectRef} from the given object database to the * given objectInserter as well as any child object if {@code objectRef} references a tree. */
Transfers the object referenced by objectRef from the given object database to the given objectInserter as well as any child object if objectRef references a tree
deepCopy
{ "repo_name": "smesdaghi/geogig", "path": "src/core/src/main/java/org/locationtech/geogig/api/plumbing/DeepCopy.java", "license": "bsd-3-clause", "size": 9283 }
[ "java.util.Set", "org.locationtech.geogig.api.Node", "org.locationtech.geogig.api.ObjectId", "org.locationtech.geogig.storage.ObjectDatabase" ]
import java.util.Set; import org.locationtech.geogig.api.Node; import org.locationtech.geogig.api.ObjectId; import org.locationtech.geogig.storage.ObjectDatabase;
import java.util.*; import org.locationtech.geogig.api.*; import org.locationtech.geogig.storage.*;
[ "java.util", "org.locationtech.geogig" ]
java.util; org.locationtech.geogig;
1,548,362
protected int getAngleFromUser(Point p){ int degs = 0; switch(mode){ case CTRL_ANGULAR: degs = Math.round(PApplet.degrees(calcRealAngleFromXY(p, winApp.mouseX, winApp.mouseY))); break; case CTRL_HORIZONTAL: degs = (int) (sensitivity * (winApp.mouseX - p.x - startMouseX)); break; case CTRL_VERTICAL: degs = (int) (sensitivity * (winApp.mouseY - p.y - startMouseY)); break; } return degs; }
int function(Point p){ int degs = 0; switch(mode){ case CTRL_ANGULAR: degs = Math.round(PApplet.degrees(calcRealAngleFromXY(p, winApp.mouseX, winApp.mouseY))); break; case CTRL_HORIZONTAL: degs = (int) (sensitivity * (winApp.mouseX - p.x - startMouseX)); break; case CTRL_VERTICAL: degs = (int) (sensitivity * (winApp.mouseY - p.y - startMouseY)); break; } return degs; }
/** * Calculates the 'angle' from the current mouse position based on the type * of 'controller' set. * @param p the absolute pixel position for the control centre * @return the unconstrained angle */
Calculates the 'angle' from the current mouse position based on the type of 'controller' set
getAngleFromUser
{ "repo_name": "dearmash/Processing", "path": "libraries/guicomponents/src/guicomponents/GRoundControl.java", "license": "mit", "size": 14992 }
[ "java.awt.Point" ]
import java.awt.Point;
import java.awt.*;
[ "java.awt" ]
java.awt;
11,546
@ServiceMethod(returns = ReturnType.SINGLE) Mono<AzureMonitorPrivateLinkScopeInner> getByResourceGroupAsync(String resourceGroupName, String scopeName);
@ServiceMethod(returns = ReturnType.SINGLE) Mono<AzureMonitorPrivateLinkScopeInner> getByResourceGroupAsync(String resourceGroupName, String scopeName);
/** * Returns a Azure Monitor PrivateLinkScope. * * @param resourceGroupName The name of the resource group. * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Azure Monitor PrivateLinkScope definition. */
Returns a Azure Monitor PrivateLinkScope
getByResourceGroupAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateLinkScopesClient.java", "license": "mit", "size": 22062 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.monitor.fluent.models.AzureMonitorPrivateLinkScopeInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.monitor.fluent.models.AzureMonitorPrivateLinkScopeInner;
import com.azure.core.annotation.*; import com.azure.resourcemanager.monitor.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,922,981
public ByteBuffer get(int index, ByteBuffer buffer) { buffer.putFloat(index, x); buffer.putFloat(index + 4, y); return buffer; }
ByteBuffer function(int index, ByteBuffer buffer) { buffer.putFloat(index, x); buffer.putFloat(index + 4, y); return buffer; }
/** * Store this vector into the supplied {@link ByteBuffer} starting at the specified * absolute buffer position/index. * <p> * This method will not increment the position of the given ByteBuffer. * * @param index * the absolute position into the ByteBuffer * @param buffer * will receive the values of this vector in <tt>x, y</tt> order * @return the passed in buffer */
Store this vector into the supplied <code>ByteBuffer</code> starting at the specified absolute buffer position/index. This method will not increment the position of the given ByteBuffer
get
{ "repo_name": "HunterFP/MineWorld", "path": "src/org/joml/Vector2f.java", "license": "gpl-2.0", "size": 21853 }
[ "java.nio.ByteBuffer" ]
import java.nio.ByteBuffer;
import java.nio.*;
[ "java.nio" ]
java.nio;
858,584
public static QuickFinder getQuickFinder(Registry ctx, DataObject refObject) { if (singleton.registry == null) singleton.registry = ctx; return (QuickFinder) singleton.createQuickFinder(refObject); } public static Registry getRegistry() { return singleton.registry; }
static QuickFinder function(Registry ctx, DataObject refObject) { if (singleton.registry == null) singleton.registry = ctx; return (QuickFinder) singleton.createQuickFinder(refObject); } public static Registry getRegistry() { return singleton.registry; }
/** * Creates or recycles an advanced search. * * @param ctx Reference to the registry. Mustn't be <code>null</code>. * @param refObject Object of reference. The search is limited to that * object. * @return See above. */
Creates or recycles an advanced search
getQuickFinder
{ "repo_name": "joshmoore/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/util/finder/FinderFactory.java", "license": "gpl-2.0", "size": 4899 }
[ "org.openmicroscopy.shoola.env.config.Registry" ]
import org.openmicroscopy.shoola.env.config.Registry;
import org.openmicroscopy.shoola.env.config.*;
[ "org.openmicroscopy.shoola" ]
org.openmicroscopy.shoola;
804,531
public ServiceFuture<SqlDatabaseGetResultsInner> createUpdateSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters, final ServiceCallback<SqlDatabaseGetResultsInner> serviceCallback) { return ServiceFuture.fromResponse(createUpdateSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateSqlDatabaseParameters), serviceCallback); }
ServiceFuture<SqlDatabaseGetResultsInner> function(String resourceGroupName, String accountName, String databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters, final ServiceCallback<SqlDatabaseGetResultsInner> serviceCallback) { return ServiceFuture.fromResponse(createUpdateSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateSqlDatabaseParameters), serviceCallback); }
/** * Create or update an Azure Cosmos DB SQL database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */
Create or update an Azure Cosmos DB SQL database
createUpdateSqlDatabaseAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/SqlResourcesInner.java", "license": "mit", "size": 310922 }
[ "com.microsoft.azure.management.cosmosdb.v2020_04_01.SqlDatabaseCreateUpdateParameters", "com.microsoft.rest.ServiceCallback", "com.microsoft.rest.ServiceFuture" ]
import com.microsoft.azure.management.cosmosdb.v2020_04_01.SqlDatabaseCreateUpdateParameters; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture;
import com.microsoft.azure.management.cosmosdb.v2020_04_01.*; import com.microsoft.rest.*;
[ "com.microsoft.azure", "com.microsoft.rest" ]
com.microsoft.azure; com.microsoft.rest;
1,449,178
public static SpatialReference create(String wktext) { return SpatialReferenceImpl.createImpl(wktext); }
static SpatialReference function(String wktext) { return SpatialReferenceImpl.createImpl(wktext); }
/** * Creates an instance of the spatial reference based on the provided well * known text representation for the horizontal coordinate system. * * @param wktext * The well-known text string representation of spatial * reference. * @return SpatialReference The spatial reference. */
Creates an instance of the spatial reference based on the provided well known text representation for the horizontal coordinate system
create
{ "repo_name": "panchenko/geometry-api-java", "path": "src/main/java/com/esri/core/geometry/SpatialReference.java", "license": "apache-2.0", "size": 7413 }
[ "com.esri.core.geometry.SpatialReference" ]
import com.esri.core.geometry.SpatialReference;
import com.esri.core.geometry.*;
[ "com.esri.core" ]
com.esri.core;
618,592
public static Collection<TypeQualifierAnnotation> getApplicableApplications(AnnotatedObject o) { return getApplicableScopedApplications(o, o.getElementType()); }
static Collection<TypeQualifierAnnotation> function(AnnotatedObject o) { return getApplicableScopedApplications(o, o.getElementType()); }
/** * Get the Collection of resolved TypeQualifierAnnotations representing * directly applied and default (outer scope) type qualifier annotations for * given AnnotatedObject. * * <p> * NOTE: does not properly account for inherited annotations on instance * methods. It is ok to call this method to find out generally-relevant * TypeQualifierAnnotations, but not to find the effective * TypeQualifierAnnotation. * </p> * * @param o * an AnnotatedObject * @return Collection of TypeQualifierAnnotations applicable to the * AnnotatedObject */
Get the Collection of resolved TypeQualifierAnnotations representing directly applied and default (outer scope) type qualifier annotations for given AnnotatedObject. methods. It is ok to call this method to find out generally-relevant TypeQualifierAnnotations, but not to find the effective TypeQualifierAnnotation.
getApplicableApplications
{ "repo_name": "OpenNTF/FindBug-for-Domino-Designer", "path": "findBugsEclipsePlugin/src/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierApplications.java", "license": "lgpl-3.0", "size": 44560 }
[ "edu.umd.cs.findbugs.classfile.analysis.AnnotatedObject", "java.util.Collection" ]
import edu.umd.cs.findbugs.classfile.analysis.AnnotatedObject; import java.util.Collection;
import edu.umd.cs.findbugs.classfile.analysis.*; import java.util.*;
[ "edu.umd.cs", "java.util" ]
edu.umd.cs; java.util;
2,289,761
public void testAttributeAndeEventNameConflict() { DefDescriptor<T> dd = addSourceAutoCleanup(getDefClass(), String.format(baseTag, "", "<aura:registerEvent name='dupeAttrEvent' type='test:parentEvent'/>" + "<aura:attribute name='dupeAttrEvent' type='String'/>")); DefType defType = DefType.getDefType(this.getDefClass()); try { definitionService.getDefinition(dd); fail(defType + " should not be able to have attribute and event with same name"); } catch (QuickFixException e) { checkExceptionFull(e, InvalidDefinitionException.class, "Cannot define an attribute and register an event with the same name: dupeAttrEvent", dd.getQualifiedName()); } }
void function() { DefDescriptor<T> dd = addSourceAutoCleanup(getDefClass(), String.format(baseTag, STR<aura:registerEvent name='dupeAttrEvent' type='test:parentEvent'/>STR<aura:attribute name='dupeAttrEvent' type='String'/>STR should not be able to have attribute and event with same nameSTRCannot define an attribute and register an event with the same name: dupeAttrEvent", dd.getQualifiedName()); } }
/** * Verify a component cannot have an attribute and event with the same name. */
Verify a component cannot have an attribute and event with the same name
testAttributeAndeEventNameConflict
{ "repo_name": "badlogicmanpreet/aura", "path": "aura-impl/src/test/java/org/auraframework/impl/root/component/BaseComponentDefTest.java", "license": "apache-2.0", "size": 99025 }
[ "org.auraframework.def.DefDescriptor" ]
import org.auraframework.def.DefDescriptor;
import org.auraframework.def.*;
[ "org.auraframework.def" ]
org.auraframework.def;
1,618,648
private static String getWebContentBaseDirectory( EclipseWriterConfig config ) throws MojoExecutionException { // getting true location of web source dir from config File warSourceDirectory = new File( IdeUtils.getPluginSetting( config.getProject(), JeeUtils.ARTIFACT_MAVEN_WAR_PLUGIN, "warSourceDirectory", "src/main/webapp" ) ); // getting real and correct path to the web source dir String webContentDir = IdeUtils.toRelativeAndFixSeparator( config.getEclipseProjectDirectory(), warSourceDirectory, false ); // getting the path to meta-inf base dir String result = config.getProject().getBasedir().getAbsolutePath() + File.separatorChar + webContentDir; return result; }
static String function( EclipseWriterConfig config ) throws MojoExecutionException { File warSourceDirectory = new File( IdeUtils.getPluginSetting( config.getProject(), JeeUtils.ARTIFACT_MAVEN_WAR_PLUGIN, STR, STR ) ); String webContentDir = IdeUtils.toRelativeAndFixSeparator( config.getEclipseProjectDirectory(), warSourceDirectory, false ); String result = config.getProject().getBasedir().getAbsolutePath() + File.separatorChar + webContentDir; return result; }
/** * Returns absolute path to the web content directory based on configuration of the war plugin or default one * otherwise. * * @param project * @return absolute directory path as String * @throws MojoExecutionException */
Returns absolute path to the web content directory based on configuration of the war plugin or default one otherwise
getWebContentBaseDirectory
{ "repo_name": "wcm-io-devops/maven-eclipse-plugin", "path": "src/main/java/org/apache/maven/plugin/eclipse/RadPlugin.java", "license": "apache-2.0", "size": 14554 }
[ "java.io.File", "org.apache.maven.plugin.MojoExecutionException", "org.apache.maven.plugin.eclipse.writers.EclipseWriterConfig", "org.apache.maven.plugin.ide.IdeUtils", "org.apache.maven.plugin.ide.JeeUtils" ]
import java.io.File; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.eclipse.writers.EclipseWriterConfig; import org.apache.maven.plugin.ide.IdeUtils; import org.apache.maven.plugin.ide.JeeUtils;
import java.io.*; import org.apache.maven.plugin.*; import org.apache.maven.plugin.eclipse.writers.*; import org.apache.maven.plugin.ide.*;
[ "java.io", "org.apache.maven" ]
java.io; org.apache.maven;
2,102,819
@Override public boolean removeAll(Collection<?> collection) { throw new UnsupportedOperationException(); }
boolean function(Collection<?> collection) { throw new UnsupportedOperationException(); }
/** * Throws an exception. * @exception UnsupportedOperationException always because it's not supported. */
Throws an exception
removeAll
{ "repo_name": "Axellience/emfgwt", "path": "emf-common/src/main/java/org/eclipse/emf/common/util/BasicEList.java", "license": "epl-1.0", "size": 28913 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
813,924
public static LocalCall<Map<String, List<Xor<String, Info>>>> listPkgs( List<String> attributes) { LinkedHashMap<String, Object> args = new LinkedHashMap<>(); args.put("attr", attributes); return new LocalCall<>("pkg.list_pkgs", Optional.empty(), Optional.of(args), new TypeToken<Map<String, List<Xor<String, Info>>>>(){}); }
static LocalCall<Map<String, List<Xor<String, Info>>>> function( List<String> attributes) { LinkedHashMap<String, Object> args = new LinkedHashMap<>(); args.put("attr", attributes); return new LocalCall<>(STR, Optional.empty(), Optional.of(args), new TypeToken<Map<String, List<Xor<String, Info>>>>(){}); }
/** * Call 'pkg.list_pkgs' * @param attributes list of attributes that should be included in the result * @return the call. For each package, the map can contain a String (only the version) * or an Info object containing specified attributes depending on Salt version and * minion support */
Call 'pkg.list_pkgs'
listPkgs
{ "repo_name": "SUSE/salt-netapi-client", "path": "src/main/java/com/suse/salt/netapi/calls/modules/Pkg.java", "license": "mit", "size": 16711 }
[ "com.google.gson.reflect.TypeToken", "com.suse.salt.netapi.calls.LocalCall", "com.suse.salt.netapi.utils.Xor", "java.util.LinkedHashMap", "java.util.List", "java.util.Map", "java.util.Optional" ]
import com.google.gson.reflect.TypeToken; import com.suse.salt.netapi.calls.LocalCall; import com.suse.salt.netapi.utils.Xor; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Optional;
import com.google.gson.reflect.*; import com.suse.salt.netapi.calls.*; import com.suse.salt.netapi.utils.*; import java.util.*;
[ "com.google.gson", "com.suse.salt", "java.util" ]
com.google.gson; com.suse.salt; java.util;
17,724
public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); } // return values from auxiliary UI delegates are ignored while (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); ui.contains(c, x, y); } return result; }
boolean function(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); } while (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); ui.contains(c, x, y); } return result; }
/** * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all * the UI delegates managed by this <code>MultiButtonUI</code>, * returning the result for the UI delegate from the primary look and * feel. * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the * primary look and feel, and <code>false</code> otherwise. */
Calls the <code>ComponentUI#contains(JComponent, int, int)</code> method for all the UI delegates managed by this <code>MultiButtonUI</code>, returning the result for the UI delegate from the primary look and feel
contains
{ "repo_name": "SanDisk-Open-Source/SSD_Dashboard", "path": "uefi/gcc/gcc-4.6.3/libjava/classpath/javax/swing/plaf/multi/MultiButtonUI.java", "license": "gpl-2.0", "size": 11073 }
[ "java.util.Iterator", "javax.swing.JComponent", "javax.swing.plaf.ComponentUI" ]
import java.util.Iterator; import javax.swing.JComponent; import javax.swing.plaf.ComponentUI;
import java.util.*; import javax.swing.*; import javax.swing.plaf.*;
[ "java.util", "javax.swing" ]
java.util; javax.swing;
1,681,662
EReference getConstraint_Type();
EReference getConstraint_Type();
/** * Returns the meta object for the containment reference '{@link no.hib.dpf.text.tdpf.Constraint#getType <em>Type</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the containment reference '<em>Type</em>'. * @see no.hib.dpf.text.tdpf.Constraint#getType() * @see #getConstraint() * @generated */
Returns the meta object for the containment reference '<code>no.hib.dpf.text.tdpf.Constraint#getType Type</code>'.
getConstraint_Type
{ "repo_name": "fmantz/DPF_Text", "path": "no.hib.dpf.text/src-gen/no/hib/dpf/text/tdpf/TdpfPackage.java", "license": "epl-1.0", "size": 84409 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
397,827
public void setIpv4(List<String> ipv4) { this.ipv4 = ipv4; }
void function(List<String> ipv4) { this.ipv4 = ipv4; }
/** * Sets ipv 4. * * @param ipv4 the ipv 4 */
Sets ipv 4
setIpv4
{ "repo_name": "tenable/Tenable.io-SDK-for-Java", "path": "src/main/java/com/tenable/io/api/assetImport/models/AssetImport.java", "license": "mit", "size": 9399 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
705,893
protected void addMaxConcurrentAccessCountPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_ThrottleMediator_maxConcurrentAccessCount_feature"), getString("_UI_PropertyDescriptor_description", "_UI_ThrottleMediator_maxConcurrentAccessCount_feature", "_UI_ThrottleMediator_type"), EsbPackage.Literals.THROTTLE_MEDIATOR__MAX_CONCURRENT_ACCESS_COUNT, true, false, false, ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null)); }
void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), EsbPackage.Literals.THROTTLE_MEDIATOR__MAX_CONCURRENT_ACCESS_COUNT, true, false, false, ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null)); }
/** * This adds a property descriptor for the Max Concurrent Access Count feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated NOT */
This adds a property descriptor for the Max Concurrent Access Count feature.
addMaxConcurrentAccessCountPropertyDescriptor
{ "repo_name": "rajeevanv89/developer-studio", "path": "esb/org.wso2.developerstudio.eclipse.gmf.esb.edit/src/org/wso2/developerstudio/eclipse/gmf/esb/provider/ThrottleMediatorItemProvider.java", "license": "apache-2.0", "size": 17730 }
[ "org.eclipse.emf.edit.provider.ComposeableAdapterFactory", "org.eclipse.emf.edit.provider.ItemPropertyDescriptor", "org.wso2.developerstudio.eclipse.gmf.esb.EsbPackage" ]
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.wso2.developerstudio.eclipse.gmf.esb.EsbPackage;
import org.eclipse.emf.edit.provider.*; import org.wso2.developerstudio.eclipse.gmf.esb.*;
[ "org.eclipse.emf", "org.wso2.developerstudio" ]
org.eclipse.emf; org.wso2.developerstudio;
2,895,946
protected boolean restoreFeasibility(ResourceEvent event) { LinkedList<VRPScenario> removedScenarios = new LinkedList<VRPScenario>(); for (VRPScenario scenario : getParentMSAProxy().getScenarioPool()) { VRPScenarioRoute firstRoute = scenario.getRoute(0); // 0. Force load recalculation firstRoute.calculateLoad(true); // 1. Check route feasibility double cap = getParentMSAProxy().getInstance().getFleet() .getVehicle(event.getResourceId()).getCapacity(); if (firstRoute.getLoad() > cap) { // 2. Find the failure double load = 0; int failure = 0; Iterator<VRPRequest> it = firstRoute.iterator(); while (it.hasNext() && load <= cap) { failure++; load += it.next().getDemand(); } // 3. Try to reinsert subsequent nodes if (!reinsertRequests(scenario, 0, failure, firstRoute.length() - 2)) { // 3.a Failed: remove the scenario removedScenarios.add(scenario); } } } getParentMSAProxy().getScenarioPool().removeScenarios(removedScenarios); return true; }
boolean function(ResourceEvent event) { LinkedList<VRPScenario> removedScenarios = new LinkedList<VRPScenario>(); for (VRPScenario scenario : getParentMSAProxy().getScenarioPool()) { VRPScenarioRoute firstRoute = scenario.getRoute(0); firstRoute.calculateLoad(true); double cap = getParentMSAProxy().getInstance().getFleet() .getVehicle(event.getResourceId()).getCapacity(); if (firstRoute.getLoad() > cap) { double load = 0; int failure = 0; Iterator<VRPRequest> it = firstRoute.iterator(); while (it.hasNext() && load <= cap) { failure++; load += it.next().getDemand(); } if (!reinsertRequests(scenario, 0, failure, firstRoute.length() - 2)) { removedScenarios.add(scenario); } } } getParentMSAProxy().getScenarioPool().removeScenarios(removedScenarios); return true; }
/** * Check and intent to restore capacity feasibility of the first route of each scenario * * @param event * @return <code>true</code> */
Check and intent to restore capacity feasibility of the first route of each scenario
restoreFeasibility
{ "repo_name": "vpillac/vroom", "path": "jMSA/src/vroom/optimization/online/jmsa/vrp/vrpsd/VRPSDResourceHandler.java", "license": "gpl-3.0", "size": 14959 }
[ "java.util.Iterator", "java.util.LinkedList" ]
import java.util.Iterator; import java.util.LinkedList;
import java.util.*;
[ "java.util" ]
java.util;
1,526,725
private void updateQueue(String dataSourceName, DataSourceCompactionConfig config) { final CompactibleTimelineObjectHolderCursor compactibleTimelineObjectHolderCursor = timelineIterators.get( dataSourceName ); if (compactibleTimelineObjectHolderCursor == null) { log.warn("Cannot find timeline for dataSource[%s]. Skip this dataSource", dataSourceName); return; } final SegmentsToCompact segmentsToCompact = findSegmentsToCompact( compactibleTimelineObjectHolderCursor, config ); if (segmentsToCompact.getNumSegments() > 1) { queue.add(new QueueEntry(segmentsToCompact.segments)); } } private static class CompactibleTimelineObjectHolderCursor implements Iterator<List<DataSegment>> { private final List<TimelineObjectHolder<String, DataSegment>> holders; CompactibleTimelineObjectHolderCursor( VersionedIntervalTimeline<String, DataSegment> timeline, List<Interval> totalIntervalsToSearch ) { this.holders = totalIntervalsToSearch .stream() .flatMap(interval -> timeline .lookup(interval) .stream() .filter(holder -> { final List<PartitionChunk<DataSegment>> chunks = Lists.newArrayList(holder.getObject().iterator()); final long partitionBytes = chunks.stream().mapToLong(chunk -> chunk.getObject().getSize()).sum(); return chunks.size() > 1 && partitionBytes > 0 && interval.contains(chunks.get(0).getObject().getInterval()); }) ) .collect(Collectors.toList()); }
void function(String dataSourceName, DataSourceCompactionConfig config) { final CompactibleTimelineObjectHolderCursor compactibleTimelineObjectHolderCursor = timelineIterators.get( dataSourceName ); if (compactibleTimelineObjectHolderCursor == null) { log.warn(STR, dataSourceName); return; } final SegmentsToCompact segmentsToCompact = findSegmentsToCompact( compactibleTimelineObjectHolderCursor, config ); if (segmentsToCompact.getNumSegments() > 1) { queue.add(new QueueEntry(segmentsToCompact.segments)); } } private static class CompactibleTimelineObjectHolderCursor implements Iterator<List<DataSegment>> { private final List<TimelineObjectHolder<String, DataSegment>> holders; CompactibleTimelineObjectHolderCursor( VersionedIntervalTimeline<String, DataSegment> timeline, List<Interval> totalIntervalsToSearch ) { this.holders = totalIntervalsToSearch .stream() .flatMap(interval -> timeline .lookup(interval) .stream() .filter(holder -> { final List<PartitionChunk<DataSegment>> chunks = Lists.newArrayList(holder.getObject().iterator()); final long partitionBytes = chunks.stream().mapToLong(chunk -> chunk.getObject().getSize()).sum(); return chunks.size() > 1 && partitionBytes > 0 && interval.contains(chunks.get(0).getObject().getInterval()); }) ) .collect(Collectors.toList()); }
/** * Find the next segments to compact for the given dataSource and add them to the queue. * {@link #timelineIterators} is updated according to the found segments. That is, the found segments are removed from * the timeline of the given dataSource. */
Find the next segments to compact for the given dataSource and add them to the queue. <code>#timelineIterators</code> is updated according to the found segments. That is, the found segments are removed from the timeline of the given dataSource
updateQueue
{ "repo_name": "michaelschiff/druid", "path": "server/src/main/java/org/apache/druid/server/coordinator/helper/NewestSegmentFirstIterator.java", "license": "apache-2.0", "size": 18618 }
[ "com.google.common.collect.Lists", "java.util.Iterator", "java.util.List", "java.util.stream.Collectors", "org.apache.druid.server.coordinator.DataSourceCompactionConfig", "org.apache.druid.timeline.DataSegment", "org.apache.druid.timeline.TimelineObjectHolder", "org.apache.druid.timeline.VersionedIntervalTimeline", "org.apache.druid.timeline.partition.PartitionChunk", "org.joda.time.Interval" ]
import com.google.common.collect.Lists; import java.util.Iterator; import java.util.List; import java.util.stream.Collectors; import org.apache.druid.server.coordinator.DataSourceCompactionConfig; import org.apache.druid.timeline.DataSegment; import org.apache.druid.timeline.TimelineObjectHolder; import org.apache.druid.timeline.VersionedIntervalTimeline; import org.apache.druid.timeline.partition.PartitionChunk; import org.joda.time.Interval;
import com.google.common.collect.*; import java.util.*; import java.util.stream.*; import org.apache.druid.server.coordinator.*; import org.apache.druid.timeline.*; import org.apache.druid.timeline.partition.*; import org.joda.time.*;
[ "com.google.common", "java.util", "org.apache.druid", "org.joda.time" ]
com.google.common; java.util; org.apache.druid; org.joda.time;
2,086,648
protected int launchMoveCentroids(Instances[] clusters) { int emptyClusterCount = 0; List<Future<double[]>> results = new ArrayList<Future<double[]>>(); for (int i = 0; i < m_NumClusters; i++) { if (clusters[i].numInstances() == 0) { emptyClusterCount++; } else { Future<double[]> futureCentroid = m_executorPool.submit(new KMeansComputeCentroidTask(i, clusters[i])); results.add(futureCentroid); } } try { for (Future<double[]> d : results) { m_ClusterCentroids.add(new DenseInstance(1.0, d.get())); } } catch (Exception ex) { ex.printStackTrace(); } return emptyClusterCount; } private class KMeansClusterTask implements Callable<Boolean> { protected int m_start; protected int m_end; protected Instances m_inst; protected int[] m_clusterAssignments; public KMeansClusterTask(Instances inst, int start, int end, int[] clusterAssignments) { m_start = start; m_end = end; m_inst = inst; m_clusterAssignments = clusterAssignments; }
int function(Instances[] clusters) { int emptyClusterCount = 0; List<Future<double[]>> results = new ArrayList<Future<double[]>>(); for (int i = 0; i < m_NumClusters; i++) { if (clusters[i].numInstances() == 0) { emptyClusterCount++; } else { Future<double[]> futureCentroid = m_executorPool.submit(new KMeansComputeCentroidTask(i, clusters[i])); results.add(futureCentroid); } } try { for (Future<double[]> d : results) { m_ClusterCentroids.add(new DenseInstance(1.0, d.get())); } } catch (Exception ex) { ex.printStackTrace(); } return emptyClusterCount; } private class KMeansClusterTask implements Callable<Boolean> { protected int m_start; protected int m_end; protected Instances m_inst; protected int[] m_clusterAssignments; public KMeansClusterTask(Instances inst, int start, int end, int[] clusterAssignments) { m_start = start; m_end = end; m_inst = inst; m_clusterAssignments = clusterAssignments; }
/** * Launch the move centroids tasks * * @param clusters the cluster centroids * @return the number of empty clusters */
Launch the move centroids tasks
launchMoveCentroids
{ "repo_name": "mydzigear/weka.kmeanspp.silhouette_score", "path": "src/weka/clusterers/SimpleKMeans.java", "license": "gpl-3.0", "size": 76053 }
[ "java.util.ArrayList", "java.util.List", "java.util.concurrent.Callable", "java.util.concurrent.Future" ]
import java.util.ArrayList; import java.util.List; import java.util.concurrent.Callable; import java.util.concurrent.Future;
import java.util.*; import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,560,624
public void testFetchAndPurge() { // Make user2 unavailable getConnection(1).sendPacket(new Presence(Presence.Type.unavailable)); try { Thread.sleep(500); // User1 sends some messages to User2 which is not available at the moment Chat chat = getConnection(0).getChatManager().createChat(getBareJID(1), null); chat.sendMessage("Test 1"); chat.sendMessage("Test 2"); Thread.sleep(500); // User2 checks the number of offline messages OfflineMessageManager offlineManager = new OfflineMessageManager(getConnection(1)); assertEquals("Wrong number of offline messages", 2, offlineManager.getMessageCount()); // Get all offline messages Iterator<Message> messages = offlineManager.getMessages(); assertTrue("No message was found", messages.hasNext()); List<String> stamps = new ArrayList<String>(); while (messages.hasNext()) { Message message = messages.next(); OfflineMessageInfo info = (OfflineMessageInfo) message.getExtension("offline", "http://jabber.org/protocol/offline"); assertNotNull("No offline information was included in the offline message", info); assertNotNull("No stamp was found in the message header", info.getNode()); stamps.add(info.getNode()); } assertEquals("Wrong number of messages", 2, stamps.size()); // Check that the offline messages have not been deleted assertEquals("Wrong number of offline messages", 2, offlineManager.getMessageCount()); // User2 becomes available again PacketCollector collector = getConnection(1).createPacketCollector( new MessageTypeFilter(Message.Type.chat)); getConnection(1).sendPacket(new Presence(Presence.Type.available)); // Check that no offline messages was sent to the user Message message = (Message) collector.nextResult(2500); assertNull("An offline message was sent from the server", message); // Delete all offline messages offlineManager.deleteMessages(); // Check that there are no offline message for this user assertEquals("Wrong number of offline messages", 0, offlineManager.getMessageCount()); } catch (Exception e) { e.printStackTrace(); fail(e.getMessage()); } }
void function() { getConnection(1).sendPacket(new Presence(Presence.Type.unavailable)); try { Thread.sleep(500); Chat chat = getConnection(0).getChatManager().createChat(getBareJID(1), null); chat.sendMessage(STR); chat.sendMessage(STR); Thread.sleep(500); OfflineMessageManager offlineManager = new OfflineMessageManager(getConnection(1)); assertEquals(STR, 2, offlineManager.getMessageCount()); Iterator<Message> messages = offlineManager.getMessages(); assertTrue(STR, messages.hasNext()); List<String> stamps = new ArrayList<String>(); while (messages.hasNext()) { Message message = messages.next(); OfflineMessageInfo info = (OfflineMessageInfo) message.getExtension(STR, STRNo offline information was included in the offline messageSTRNo stamp was found in the message headerSTRWrong number of messages", 2, stamps.size()); assertEquals(STR, 2, offlineManager.getMessageCount()); PacketCollector collector = getConnection(1).createPacketCollector( new MessageTypeFilter(Message.Type.chat)); getConnection(1).sendPacket(new Presence(Presence.Type.available)); Message message = (Message) collector.nextResult(2500); assertNull("An offline message was sent from the server", message); offlineManager.deleteMessages(); assertEquals(STR, 0, offlineManager.getMessageCount()); } catch (Exception e) { e.printStackTrace(); fail(e.getMessage()); } }
/** * While user2 is connected but unavailable, user1 sends 2 messages to user1. User2 then * performs some "Flexible Offline Message Retrieval" by fetching all the offline messages * and then removing all the offline messages. */
While user2 is connected but unavailable, user1 sends 2 messages to user1. User2 then performs some "Flexible Offline Message Retrieval" by fetching all the offline messages and then removing all the offline messages
testFetchAndPurge
{ "repo_name": "UzxMx/java-bells", "path": "lib-src/smack_src_3_3_0/test/org/jivesoftware/smackx/OfflineMessageManagerTest.java", "license": "bsd-3-clause", "size": 8311 }
[ "java.util.ArrayList", "java.util.Iterator", "java.util.List", "org.jivesoftware.smack.Chat", "org.jivesoftware.smack.PacketCollector", "org.jivesoftware.smack.filter.MessageTypeFilter", "org.jivesoftware.smack.packet.Message", "org.jivesoftware.smack.packet.Presence", "org.jivesoftware.smackx.packet.OfflineMessageInfo" ]
import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.jivesoftware.smack.Chat; import org.jivesoftware.smack.PacketCollector; import org.jivesoftware.smack.filter.MessageTypeFilter; import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smack.packet.Presence; import org.jivesoftware.smackx.packet.OfflineMessageInfo;
import java.util.*; import org.jivesoftware.smack.*; import org.jivesoftware.smack.filter.*; import org.jivesoftware.smack.packet.*; import org.jivesoftware.smackx.packet.*;
[ "java.util", "org.jivesoftware.smack", "org.jivesoftware.smackx" ]
java.util; org.jivesoftware.smack; org.jivesoftware.smackx;
38,723
private static final Logger LOG = Logger.getLogger(ConductorUpdate.class.getName()); private static final DateFormat df = new SimpleDateFormat("dd/MM/yyyy"); protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { String nombre = request.getParameter("nombre"); String cedula = request.getParameter("cedula"); String $fecha_nac = request.getParameter("fecha_nac"); String telefono = request.getParameter("telefono"); String direccion = request.getParameter("direccion"); Date fecha_nac = df.parse($fecha_nac); Conductor conductor = new Conductor(); conductor.setNombre(nombre); conductor.setCedula(cedula); conductor.setFechaNac(fecha_nac); conductor.setTelefono(telefono); conductor.setDireccion(direccion); conductor.setEstado("Libre"); conductorFacade.create(conductor); response.sendRedirect(request.getContextPath() + "/Conductores"); } catch (ParseException ex) { Logger.getLogger(ConductorStore.class.getName()).log(Level.SEVERE, null, ex); } }
static final Logger LOG = Logger.getLogger(ConductorUpdate.class.getName()); private static final DateFormat df = new SimpleDateFormat(STR); protected void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { String nombre = request.getParameter(STR); String cedula = request.getParameter(STR); String $fecha_nac = request.getParameter(STR); String telefono = request.getParameter(STR); String direccion = request.getParameter(STR); Date fecha_nac = df.parse($fecha_nac); Conductor conductor = new Conductor(); conductor.setNombre(nombre); conductor.setCedula(cedula); conductor.setFechaNac(fecha_nac); conductor.setTelefono(telefono); conductor.setDireccion(direccion); conductor.setEstado("Libre"); conductorFacade.create(conductor); response.sendRedirect(request.getContextPath() + STR); } catch (ParseException ex) { Logger.getLogger(ConductorStore.class.getName()).log(Level.SEVERE, null, ex); } }
/** * Processes requests for both HTTP <code>GET</code> and <code>POST</code> * methods. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */
Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods
processRequest
{ "repo_name": "YojhanLR/ProyectoSTPI-JavaEE", "path": "src/java/com/stpi/controller/ConductorStore.java", "license": "apache-2.0", "size": 3856 }
[ "com.stpi.model.Conductor", "java.io.IOException", "java.text.DateFormat", "java.text.ParseException", "java.text.SimpleDateFormat", "java.util.Date", "java.util.logging.Level", "java.util.logging.Logger", "javax.servlet.ServletException", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse" ]
import com.stpi.model.Conductor; import java.io.IOException; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.logging.Level; import java.util.logging.Logger; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
import com.stpi.model.*; import java.io.*; import java.text.*; import java.util.*; import java.util.logging.*; import javax.servlet.*; import javax.servlet.http.*;
[ "com.stpi.model", "java.io", "java.text", "java.util", "javax.servlet" ]
com.stpi.model; java.io; java.text; java.util; javax.servlet;
124,299
default void onPlayerHurt(LivingHurtEvent event, EntityPlayer victim, @Nonnull ItemStack armorStack, EntityEquipmentSlot slot) {}
default void onPlayerHurt(LivingHurtEvent event, EntityPlayer victim, @Nonnull ItemStack armorStack, EntityEquipmentSlot slot) {}
/** * Called when the player attacks another entity while wearing an exosuit with this installed. * @param event The event. * @param attacker The player who is attacking and is wearing the suit. * @param armorStack The ItemStack containing the armor piece that this is installed in. * @param slot The EntityEquipmentSlot that the armorStack is contained in. */
Called when the player attacks another entity while wearing an exosuit with this installed
onPlayerAttacksOther
{ "repo_name": "Esteemed-Innovation/Flaxbeards-Steam-Power", "path": "old/api/java/eiteam/esteemedinnovation/api/exosuit/ExosuitEventHandler.java", "license": "lgpl-3.0", "size": 9347 }
[ "javax.annotation.Nonnull", "net.minecraft.entity.player.EntityPlayer", "net.minecraft.inventory.EntityEquipmentSlot", "net.minecraft.item.ItemStack", "net.minecraftforge.event.entity.living.LivingHurtEvent" ]
import javax.annotation.Nonnull; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemStack; import net.minecraftforge.event.entity.living.LivingHurtEvent;
import javax.annotation.*; import net.minecraft.entity.player.*; import net.minecraft.inventory.*; import net.minecraft.item.*; import net.minecraftforge.event.entity.living.*;
[ "javax.annotation", "net.minecraft.entity", "net.minecraft.inventory", "net.minecraft.item", "net.minecraftforge.event" ]
javax.annotation; net.minecraft.entity; net.minecraft.inventory; net.minecraft.item; net.minecraftforge.event;
1,198,986
protected PathQuery getQuery(HttpServletRequest request) { String xml = new QueryRequestParser(im.getQueryStore(), request).getQueryXml(); if (StringUtils.isEmpty(xml)) { throw new BadRequestException("query is blank"); } PathQueryBuilder builder = getQueryBuilder(xml); PathQuery pq = builder.getQuery(); if (pq.getView().size() != 1) { throw new BadRequestException( "Queries to the query-to-list service can only have one output column"); } if (!pq.getView().get(0).endsWith(".id")) { throw new BadRequestException( "Queries to the query-to-list service must have ids in their view"); } return pq; }
PathQuery function(HttpServletRequest request) { String xml = new QueryRequestParser(im.getQueryStore(), request).getQueryXml(); if (StringUtils.isEmpty(xml)) { throw new BadRequestException(STR); } PathQueryBuilder builder = getQueryBuilder(xml); PathQuery pq = builder.getQuery(); if (pq.getView().size() != 1) { throw new BadRequestException( STR); } if (!pq.getView().get(0).endsWith(".id")) { throw new BadRequestException( STR); } return pq; }
/** * Get the pathquery to use for this request. * @param request The http request. * @return A pathquery */
Get the pathquery to use for this request
getQuery
{ "repo_name": "elsiklab/intermine", "path": "intermine/web/main/src/org/intermine/webservice/server/query/QueryToListService.java", "license": "lgpl-2.1", "size": 7793 }
[ "javax.servlet.http.HttpServletRequest", "org.apache.commons.lang.StringUtils", "org.intermine.pathquery.PathQuery", "org.intermine.webservice.server.exceptions.BadRequestException", "org.intermine.webservice.server.query.result.PathQueryBuilder" ]
import javax.servlet.http.HttpServletRequest; import org.apache.commons.lang.StringUtils; import org.intermine.pathquery.PathQuery; import org.intermine.webservice.server.exceptions.BadRequestException; import org.intermine.webservice.server.query.result.PathQueryBuilder;
import javax.servlet.http.*; import org.apache.commons.lang.*; import org.intermine.pathquery.*; import org.intermine.webservice.server.exceptions.*; import org.intermine.webservice.server.query.result.*;
[ "javax.servlet", "org.apache.commons", "org.intermine.pathquery", "org.intermine.webservice" ]
javax.servlet; org.apache.commons; org.intermine.pathquery; org.intermine.webservice;
229,483
public com.datastax.driver.core.UserType getUDType(String dataType) { KeyspaceMetadata ksm = Schema.instance.getKeyspaceMetadata(insert.keyspace()); UserType userType = ksm.types.getNullable(ByteBufferUtil.bytes(dataType)); return (com.datastax.driver.core.UserType) UDHelper.driverType(userType); }
com.datastax.driver.core.UserType function(String dataType) { KeyspaceMetadata ksm = Schema.instance.getKeyspaceMetadata(insert.keyspace()); UserType userType = ksm.types.getNullable(ByteBufferUtil.bytes(dataType)); return (com.datastax.driver.core.UserType) UDHelper.driverType(userType); }
/** * Returns the User Defined type, used in this SSTable Writer, that can * be used to create UDTValue instances. * * @param dataType name of the User Defined type * @return user defined type */
Returns the User Defined type, used in this SSTable Writer, that can be used to create UDTValue instances
getUDType
{ "repo_name": "mkjellman/cassandra", "path": "src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java", "license": "apache-2.0", "size": 25318 }
[ "org.apache.cassandra.cql3.functions.UDHelper", "org.apache.cassandra.db.marshal.UserType", "org.apache.cassandra.schema.KeyspaceMetadata", "org.apache.cassandra.schema.Schema", "org.apache.cassandra.utils.ByteBufferUtil" ]
import org.apache.cassandra.cql3.functions.UDHelper; import org.apache.cassandra.db.marshal.UserType; import org.apache.cassandra.schema.KeyspaceMetadata; import org.apache.cassandra.schema.Schema; import org.apache.cassandra.utils.ByteBufferUtil;
import org.apache.cassandra.cql3.functions.*; import org.apache.cassandra.db.marshal.*; import org.apache.cassandra.schema.*; import org.apache.cassandra.utils.*;
[ "org.apache.cassandra" ]
org.apache.cassandra;
1,060,103
public void setDirectory(Directory directory) { this.directory = directory; }
void function(Directory directory) { this.directory = directory; }
/** * set lucene directory * @param directory * directory */
set lucene directory
setDirectory
{ "repo_name": "julie-sullivan/phytomine", "path": "intermine/api/main/src/org/intermine/api/lucene/LuceneIndexContainer.java", "license": "lgpl-2.1", "size": 2718 }
[ "org.apache.lucene.store.Directory" ]
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.*;
[ "org.apache.lucene" ]
org.apache.lucene;
2,081,071
public Collection<Parameter> getParameters() { return parameters; }
Collection<Parameter> function() { return parameters; }
/** * Gets the parameters. * * @return the parameters */
Gets the parameters
getParameters
{ "repo_name": "techblue/jasperserver-restclient", "path": "src/main/java/uk/co/techblue/jasperclient/response/ErrorResponse.java", "license": "apache-2.0", "size": 2332 }
[ "java.util.Collection", "uk.co.techblue.jasperclient.dto.Parameter" ]
import java.util.Collection; import uk.co.techblue.jasperclient.dto.Parameter;
import java.util.*; import uk.co.techblue.jasperclient.dto.*;
[ "java.util", "uk.co.techblue" ]
java.util; uk.co.techblue;
2,426,361
public Object call(Object object, String method, Object[] args) throws BSFException { return InvokerHelper.invokeMethod(object, method, args); }
Object function(Object object, String method, Object[] args) throws BSFException { return InvokerHelper.invokeMethod(object, method, args); }
/** * Call the named method of the given object. */
Call the named method of the given object
call
{ "repo_name": "paulk-asert/groovy", "path": "subprojects/groovy-bsf/src/main/java/org/codehaus/groovy/bsf/GroovyEngine.java", "license": "apache-2.0", "size": 5316 }
[ "org.apache.bsf.BSFException", "org.codehaus.groovy.runtime.InvokerHelper" ]
import org.apache.bsf.BSFException; import org.codehaus.groovy.runtime.InvokerHelper;
import org.apache.bsf.*; import org.codehaus.groovy.runtime.*;
[ "org.apache.bsf", "org.codehaus.groovy" ]
org.apache.bsf; org.codehaus.groovy;
217,175
private void awaitLockServiceMXBeanIsNull(final String lockServiceName) { SystemManagementService service = this.managementTestRule.getSystemManagementService(); await().untilAsserted( () -> assertThat(service.getLocalLockServiceMBean(lockServiceName)).isNull()); }
void function(final String lockServiceName) { SystemManagementService service = this.managementTestRule.getSystemManagementService(); await().untilAsserted( () -> assertThat(service.getLocalLockServiceMBean(lockServiceName)).isNull()); }
/** * Await destruction of local LockServiceMXBean for specified lockServiceName. */
Await destruction of local LockServiceMXBean for specified lockServiceName
awaitLockServiceMXBeanIsNull
{ "repo_name": "deepakddixit/incubator-geode", "path": "geode-core/src/distributedTest/java/org/apache/geode/management/DLockManagementDUnitTest.java", "license": "apache-2.0", "size": 12178 }
[ "org.apache.geode.management.internal.SystemManagementService", "org.assertj.core.api.Assertions" ]
import org.apache.geode.management.internal.SystemManagementService; import org.assertj.core.api.Assertions;
import org.apache.geode.management.internal.*; import org.assertj.core.api.*;
[ "org.apache.geode", "org.assertj.core" ]
org.apache.geode; org.assertj.core;
1,792,388
List<String> getChildrenPaths(String path) throws ZookeeperClientFailedException, InterruptedException { List<String> children = getChildren(path); ArrayList<String> paths = new ArrayList(children.size()); for (String child : children) paths.add(path + "/" + child); return paths; }
List<String> getChildrenPaths(String path) throws ZookeeperClientFailedException, InterruptedException { List<String> children = getChildren(path); ArrayList<String> paths = new ArrayList(children.size()); for (String child : children) paths.add(path + "/" + child); return paths; }
/** * Get children paths. * * @param path Path. * @return Children paths. * @throws ZookeeperClientFailedException If connection to zk was lost. * @throws InterruptedException If interrupted. */
Get children paths
getChildrenPaths
{ "repo_name": "ascherbakoff/ignite", "path": "modules/zookeeper/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperClient.java", "license": "apache-2.0", "size": 39151 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
429,677
public static String keyStorePath() throws PropertyException { return mProperties.getString(KEYSTORE_PATH); }
static String function() throws PropertyException { return mProperties.getString(KEYSTORE_PATH); }
/** * Getter for the keyStorePath property. * * @return property string * @throws PropertyException * what the name says */
Getter for the keyStorePath property
keyStorePath
{ "repo_name": "trustathsh/ironnmap", "path": "src/main/java/de/hshannover/f4/trust/ironnmap/Configuration.java", "license": "apache-2.0", "size": 8865 }
[ "de.hshannover.f4.trust.ironcommon.properties.PropertyException" ]
import de.hshannover.f4.trust.ironcommon.properties.PropertyException;
import de.hshannover.f4.trust.ironcommon.properties.*;
[ "de.hshannover.f4" ]
de.hshannover.f4;
2,476,279
public StepMeta findNextStep(StepMeta stepMeta, int nr) { int count = 0; int i; for (i = 0; i < nrTransHops(); i++) // Look at all the hops; { TransHopMeta hi = getTransHop(i); if (hi.isEnabled() && hi.getFromStep().equals(stepMeta)) { if (count == nr) { return hi.getToStep(); } count++; } } return null; }
StepMeta function(StepMeta stepMeta, int nr) { int count = 0; int i; for (i = 0; i < nrTransHops(); i++) { TransHopMeta hi = getTransHop(i); if (hi.isEnabled() && hi.getFromStep().equals(stepMeta)) { if (count == nr) { return hi.getToStep(); } count++; } } return null; }
/** * Find the succeeding step at a location for an originating step. * * @param stepMeta The originating step * @param nr The location * @return The step found. * @deprecated just get the next steps as an array */
Find the succeeding step at a location for an originating step
findNextStep
{ "repo_name": "icholy/geokettle-2.0", "path": "src/org/pentaho/di/trans/TransMeta.java", "license": "lgpl-2.1", "size": 230572 }
[ "org.pentaho.di.trans.step.StepMeta" ]
import org.pentaho.di.trans.step.StepMeta;
import org.pentaho.di.trans.step.*;
[ "org.pentaho.di" ]
org.pentaho.di;
1,554,587
long getDone() throws RemoteException;
long getDone() throws RemoteException;
/** * Number of done computation instances. */
Number of done computation instances
getDone
{ "repo_name": "VojtechBruza/parasim", "path": "extensions/computation-lifecycle-api/src/main/java/org/sybila/parasim/computation/lifecycle/api/RemoteMutableStatus.java", "license": "gpl-3.0", "size": 1888 }
[ "java.rmi.RemoteException" ]
import java.rmi.RemoteException;
import java.rmi.*;
[ "java.rmi" ]
java.rmi;
1,290,441
public Write withTableId(String tableId) { return withTableId(ValueProvider.StaticValueProvider.of(tableId)); }
Write function(String tableId) { return withTableId(ValueProvider.StaticValueProvider.of(tableId)); }
/** * Returns a new {@link BigtableIO.Write} that will write to the specified table. * * <p>Does not modify this object. */
Returns a new <code>BigtableIO.Write</code> that will write to the specified table. Does not modify this object
withTableId
{ "repo_name": "RyanSkraba/beam", "path": "sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIO.java", "license": "apache-2.0", "size": 52197 }
[ "org.apache.beam.sdk.options.ValueProvider" ]
import org.apache.beam.sdk.options.ValueProvider;
import org.apache.beam.sdk.options.*;
[ "org.apache.beam" ]
org.apache.beam;
189,475
@Override public Map<String, Object> getAllPaginatedLightWeightAPIsByStatus(String tenantDomain, int start, int end, final String[] apiStatus, boolean returnAPITags) throws APIManagementException { Map<String, Object> result = new HashMap<String, Object>(); SortedSet<API> apiSortedSet = new TreeSet<API>(new APINameComparator()); SortedSet<API> apiVersionsSortedSet = new TreeSet<API>(new APIVersionComparator()); int totalLength = 0; boolean isMore = false; String criteria = "lcState="; try { Registry userRegistry; boolean isTenantMode = (tenantDomain != null); if ((isTenantMode && this.tenantDomain == null) || (isTenantMode && isTenantDomainNotMatching(tenantDomain))) { //Tenant store anonymous mode int tenantId = getTenantId(tenantDomain); // explicitly load the tenant's registry APIUtil.loadTenantRegistry(tenantId); userRegistry = ServiceReferenceHolder.getInstance().getRegistryService(). getGovernanceUserRegistry(CarbonConstants.REGISTRY_ANONNYMOUS_USERNAME, tenantId); setUsernameToThreadLocalCarbonContext(CarbonConstants.REGISTRY_ANONNYMOUS_USERNAME); } else { userRegistry = registry; setUsernameToThreadLocalCarbonContext(this.username); } this.isTenantModeStoreView = isTenantMode; this.requestedTenant = tenantDomain; Map<String, API> latestPublishedAPIs = new HashMap<String, API>(); List<API> multiVersionedAPIs = new ArrayList<API>(); Comparator<API> versionComparator = new APIVersionComparator(); Boolean displayMultipleVersions = APIUtil.isAllowDisplayMultipleVersions(); String paginationLimit = ServiceReferenceHolder.getInstance().getAPIManagerConfigurationService() .getAPIManagerConfiguration().getFirstProperty(APIConstants.API_STORE_APIS_PER_PAGE); // If the Config exists use it to set the pagination limit final int maxPaginationLimit; if (paginationLimit != null) { // The additional 1 added to the maxPaginationLimit is to help us determine if more // APIs may exist so that we know that we are unable to determine the actual total // API count. We will subtract this 1 later on so that it does not interfere with // the logic of the rest of the application int pagination = Integer.parseInt(paginationLimit); // Because the store jaggery pagination logic is 10 results per a page we need to set pagination // limit to at least 11 or the pagination done at this level will conflict with the store pagination // leading to some of the APIs not being displayed if (pagination < 11) { pagination = 11; log.warn("Value of '" + APIConstants.API_STORE_APIS_PER_PAGE + "' is too low, defaulting to 11"); } maxPaginationLimit = start + pagination + 1; } // Else if the config is not specified we go with default functionality and load all else { maxPaginationLimit = Integer.MAX_VALUE; } PaginationContext.init(start, end, "ASC", APIConstants.API_OVERVIEW_NAME, maxPaginationLimit); criteria = criteria + APIUtil.getORBasedSearchCriteria(apiStatus); GenericArtifactManager artifactManager = APIUtil.getArtifactManager(userRegistry, APIConstants.API_KEY); if (artifactManager != null) { if (apiStatus != null && apiStatus.length > 0) { List<GovernanceArtifact> genericArtifacts = GovernanceUtils.findGovernanceArtifacts (getSearchQuery(criteria), userRegistry, APIConstants.API_RXT_MEDIA_TYPE); totalLength = PaginationContext.getInstance().getLength(); if (genericArtifacts == null || genericArtifacts.size() == 0) { result.put("apis", apiSortedSet); result.put("totalLength", totalLength); result.put("isMore", isMore); return result; } // Check to see if we can speculate that there are more APIs to be loaded if (maxPaginationLimit == totalLength) { isMore = true; // More APIs exist so we cannot determine the total API count without // incurring a performance hit --totalLength; // Remove the additional 1 we added earlier when setting max pagination limit } int tempLength = 0; for (GovernanceArtifact artifact : genericArtifacts) { API api = null; try { api = APIUtil.getLightWeightAPI(artifact); } catch (APIManagementException e) { //log and continue since we want to load the rest of the APIs. log.error("Error while loading API " + artifact.getAttribute( APIConstants.API_OVERVIEW_NAME), e); } if (api != null) { if (returnAPITags) { String artifactPath = GovernanceUtils.getArtifactPath(registry, artifact.getId()); Set<String> tags = new HashSet<String>(); org.wso2.carbon.registry.core.Tag[] tag = registry.getTags(artifactPath); for (org.wso2.carbon.registry.core.Tag tag1 : tag) { tags.add(tag1.getTagName()); } api.addTags(tags); } String key; //Check the configuration to allow showing multiple versions of an API true/false if (!displayMultipleVersions) { //If allow only showing the latest version of an API key = api.getId().getProviderName() + COLON_CHAR + api.getId().getApiName(); API existingAPI = latestPublishedAPIs.get(key); if (existingAPI != null) { // If we have already seen an API with the same name, make sure // this one has a higher version number if (versionComparator.compare(api, existingAPI) > 0) { latestPublishedAPIs.put(key, api); } } else { // We haven't seen this API before latestPublishedAPIs.put(key, api); } } else { //If allow showing multiple versions of an API multiVersionedAPIs.add(api); } } tempLength++; if (tempLength >= totalLength) { break; } } if (!displayMultipleVersions) { apiSortedSet.addAll(latestPublishedAPIs.values()); result.put("apis", apiSortedSet); result.put("totalLength", totalLength); result.put("isMore", isMore); return result; } else { apiVersionsSortedSet.addAll(multiVersionedAPIs); result.put("apis", apiVersionsSortedSet); result.put("totalLength", totalLength); result.put("isMore", isMore); return result; } } } else { String errorMessage = "Artifact manager is null for tenant domain " + tenantDomain + " when retrieving all paginated APIs by status."; log.error(errorMessage); } } catch (RegistryException e) { handleException("Failed to get all published APIs", e); } catch (UserStoreException e) { handleException("Failed to get all published APIs", e); } finally { PaginationContext.destroy(); } result.put("apis", apiSortedSet); result.put("totalLength", totalLength); result.put("isMore", isMore); return result; }
Map<String, Object> function(String tenantDomain, int start, int end, final String[] apiStatus, boolean returnAPITags) throws APIManagementException { Map<String, Object> result = new HashMap<String, Object>(); SortedSet<API> apiSortedSet = new TreeSet<API>(new APINameComparator()); SortedSet<API> apiVersionsSortedSet = new TreeSet<API>(new APIVersionComparator()); int totalLength = 0; boolean isMore = false; String criteria = STR; try { Registry userRegistry; boolean isTenantMode = (tenantDomain != null); if ((isTenantMode && this.tenantDomain == null) (isTenantMode && isTenantDomainNotMatching(tenantDomain))) { int tenantId = getTenantId(tenantDomain); APIUtil.loadTenantRegistry(tenantId); userRegistry = ServiceReferenceHolder.getInstance().getRegistryService(). getGovernanceUserRegistry(CarbonConstants.REGISTRY_ANONNYMOUS_USERNAME, tenantId); setUsernameToThreadLocalCarbonContext(CarbonConstants.REGISTRY_ANONNYMOUS_USERNAME); } else { userRegistry = registry; setUsernameToThreadLocalCarbonContext(this.username); } this.isTenantModeStoreView = isTenantMode; this.requestedTenant = tenantDomain; Map<String, API> latestPublishedAPIs = new HashMap<String, API>(); List<API> multiVersionedAPIs = new ArrayList<API>(); Comparator<API> versionComparator = new APIVersionComparator(); Boolean displayMultipleVersions = APIUtil.isAllowDisplayMultipleVersions(); String paginationLimit = ServiceReferenceHolder.getInstance().getAPIManagerConfigurationService() .getAPIManagerConfiguration().getFirstProperty(APIConstants.API_STORE_APIS_PER_PAGE); final int maxPaginationLimit; if (paginationLimit != null) { int pagination = Integer.parseInt(paginationLimit); if (pagination < 11) { pagination = 11; log.warn(STR + APIConstants.API_STORE_APIS_PER_PAGE + STR); } maxPaginationLimit = start + pagination + 1; } else { maxPaginationLimit = Integer.MAX_VALUE; } PaginationContext.init(start, end, "ASC", APIConstants.API_OVERVIEW_NAME, maxPaginationLimit); criteria = criteria + APIUtil.getORBasedSearchCriteria(apiStatus); GenericArtifactManager artifactManager = APIUtil.getArtifactManager(userRegistry, APIConstants.API_KEY); if (artifactManager != null) { if (apiStatus != null && apiStatus.length > 0) { List<GovernanceArtifact> genericArtifacts = GovernanceUtils.findGovernanceArtifacts (getSearchQuery(criteria), userRegistry, APIConstants.API_RXT_MEDIA_TYPE); totalLength = PaginationContext.getInstance().getLength(); if (genericArtifacts == null genericArtifacts.size() == 0) { result.put("apis", apiSortedSet); result.put(STR, totalLength); result.put(STR, isMore); return result; } if (maxPaginationLimit == totalLength) { isMore = true; --totalLength; } int tempLength = 0; for (GovernanceArtifact artifact : genericArtifacts) { API api = null; try { api = APIUtil.getLightWeightAPI(artifact); } catch (APIManagementException e) { log.error(STR + artifact.getAttribute( APIConstants.API_OVERVIEW_NAME), e); } if (api != null) { if (returnAPITags) { String artifactPath = GovernanceUtils.getArtifactPath(registry, artifact.getId()); Set<String> tags = new HashSet<String>(); org.wso2.carbon.registry.core.Tag[] tag = registry.getTags(artifactPath); for (org.wso2.carbon.registry.core.Tag tag1 : tag) { tags.add(tag1.getTagName()); } api.addTags(tags); } String key; if (!displayMultipleVersions) { key = api.getId().getProviderName() + COLON_CHAR + api.getId().getApiName(); API existingAPI = latestPublishedAPIs.get(key); if (existingAPI != null) { if (versionComparator.compare(api, existingAPI) > 0) { latestPublishedAPIs.put(key, api); } } else { latestPublishedAPIs.put(key, api); } } else { multiVersionedAPIs.add(api); } } tempLength++; if (tempLength >= totalLength) { break; } } if (!displayMultipleVersions) { apiSortedSet.addAll(latestPublishedAPIs.values()); result.put("apis", apiSortedSet); result.put(STR, totalLength); result.put(STR, isMore); return result; } else { apiVersionsSortedSet.addAll(multiVersionedAPIs); result.put("apis", apiVersionsSortedSet); result.put(STR, totalLength); result.put(STR, isMore); return result; } } } else { String errorMessage = STR + tenantDomain + STR; log.error(errorMessage); } } catch (RegistryException e) { handleException(STR, e); } catch (UserStoreException e) { handleException(STR, e); } finally { PaginationContext.destroy(); } result.put("apis", apiSortedSet); result.put(STR, totalLength); result.put(STR, isMore); return result; }
/** * The method to get APIs in any of the given LC status array * * @return Map<String, Object> API result set with pagination information * @throws APIManagementException */
The method to get APIs in any of the given LC status array
getAllPaginatedLightWeightAPIsByStatus
{ "repo_name": "tharikaGitHub/carbon-apimgt", "path": "components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIConsumerImpl.java", "license": "apache-2.0", "size": 322225 }
[ "java.util.ArrayList", "java.util.Comparator", "java.util.HashMap", "java.util.HashSet", "java.util.List", "java.util.Map", "java.util.Set", "java.util.SortedSet", "java.util.TreeSet", "org.wso2.carbon.CarbonConstants", "org.wso2.carbon.apimgt.api.APIManagementException", "org.wso2.carbon.apimgt.api.model.Tag", "org.wso2.carbon.apimgt.impl.internal.ServiceReferenceHolder", "org.wso2.carbon.apimgt.impl.utils.APINameComparator", "org.wso2.carbon.apimgt.impl.utils.APIUtil", "org.wso2.carbon.apimgt.impl.utils.APIVersionComparator", "org.wso2.carbon.governance.api.common.dataobjects.GovernanceArtifact", "org.wso2.carbon.governance.api.generic.GenericArtifactManager", "org.wso2.carbon.governance.api.util.GovernanceUtils", "org.wso2.carbon.registry.core.Registry", "org.wso2.carbon.registry.core.exceptions.RegistryException", "org.wso2.carbon.registry.core.pagination.PaginationContext", "org.wso2.carbon.user.api.UserStoreException" ]
import java.util.ArrayList; import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; import org.wso2.carbon.CarbonConstants; import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.api.model.Tag; import org.wso2.carbon.apimgt.impl.internal.ServiceReferenceHolder; import org.wso2.carbon.apimgt.impl.utils.APINameComparator; import org.wso2.carbon.apimgt.impl.utils.APIUtil; import org.wso2.carbon.apimgt.impl.utils.APIVersionComparator; import org.wso2.carbon.governance.api.common.dataobjects.GovernanceArtifact; import org.wso2.carbon.governance.api.generic.GenericArtifactManager; import org.wso2.carbon.governance.api.util.GovernanceUtils; import org.wso2.carbon.registry.core.Registry; import org.wso2.carbon.registry.core.exceptions.RegistryException; import org.wso2.carbon.registry.core.pagination.PaginationContext; import org.wso2.carbon.user.api.UserStoreException;
import java.util.*; import org.wso2.carbon.*; import org.wso2.carbon.apimgt.api.*; import org.wso2.carbon.apimgt.api.model.*; import org.wso2.carbon.apimgt.impl.internal.*; import org.wso2.carbon.apimgt.impl.utils.*; import org.wso2.carbon.governance.api.common.dataobjects.*; import org.wso2.carbon.governance.api.generic.*; import org.wso2.carbon.governance.api.util.*; import org.wso2.carbon.registry.core.*; import org.wso2.carbon.registry.core.exceptions.*; import org.wso2.carbon.registry.core.pagination.*; import org.wso2.carbon.user.api.*;
[ "java.util", "org.wso2.carbon" ]
java.util; org.wso2.carbon;
1,763,715
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) public File getTabStateFile(int tabId, boolean encrypted) { return TabStateFileManager.getTabStateFile(getStateDirectory(), tabId, encrypted); }
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) File function(int tabId, boolean encrypted) { return TabStateFileManager.getTabStateFile(getStateDirectory(), tabId, encrypted); }
/** * Returns a file pointing at the TabState corresponding to the given Tab. * @param tabId ID of the TabState to locate. * @param encrypted Whether or not the tab is encrypted. * @return File pointing at the TabState for the Tab. */
Returns a file pointing at the TabState corresponding to the given Tab
getTabStateFile
{ "repo_name": "chromium/chromium", "path": "chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java", "license": "bsd-3-clause", "size": 86250 }
[ "androidx.annotation.VisibleForTesting", "java.io.File", "org.chromium.chrome.browser.tabpersistence.TabStateFileManager" ]
import androidx.annotation.VisibleForTesting; import java.io.File; import org.chromium.chrome.browser.tabpersistence.TabStateFileManager;
import androidx.annotation.*; import java.io.*; import org.chromium.chrome.browser.tabpersistence.*;
[ "androidx.annotation", "java.io", "org.chromium.chrome" ]
androidx.annotation; java.io; org.chromium.chrome;
1,681,371