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
@Nonnull public DriveItemRequestBuilder special(@Nonnull final String id) { return new DriveItemRequestBuilder(getRequestUrlWithAdditionalSegment("special") + "/" + id, getClient(), null); }
DriveItemRequestBuilder function(@Nonnull final String id) { return new DriveItemRequestBuilder(getRequestUrlWithAdditionalSegment(STR) + "/" + id, getClient(), null); }
/** * Gets a request builder for the DriveItem item * * @return the request builder * @param id the item identifier */
Gets a request builder for the DriveItem item
special
{ "repo_name": "microsoftgraph/msgraph-sdk-java", "path": "src/main/java/com/microsoft/graph/requests/DriveRequestBuilder.java", "license": "mit", "size": 7631 }
[ "com.microsoft.graph.requests.DriveItemRequestBuilder", "javax.annotation.Nonnull" ]
import com.microsoft.graph.requests.DriveItemRequestBuilder; import javax.annotation.Nonnull;
import com.microsoft.graph.requests.*; import javax.annotation.*;
[ "com.microsoft.graph", "javax.annotation" ]
com.microsoft.graph; javax.annotation;
1,784,824
public static boolean isCharacterTokenStream(TokenStream tokenStream) { try { tokenStream.addAttribute(CharTermAttribute.class); return true; } catch (IllegalArgumentException e) { return false; } }
static boolean function(TokenStream tokenStream) { try { tokenStream.addAttribute(CharTermAttribute.class); return true; } catch (IllegalArgumentException e) { return false; } }
/** * Check whether the provided token stream is able to provide character * terms. * <p>Although most analyzers generate character terms (CharTermAttribute), * some token only contain binary terms (BinaryTermAttribute, * CharTermAttribute being a special type of BinaryTermAttribute), such as ...
Check whether the provided token stream is able to provide character terms. Although most analyzers generate character terms (CharTermAttribute), some token only contain binary terms (BinaryTermAttribute, CharTermAttribute being a special type of BinaryTermAttribute), such as <code>NumericTokenStream</code> and unsuita...
isCharacterTokenStream
{ "repo_name": "strapdata/elassandra-test", "path": "core/src/main/java/org/elasticsearch/index/analysis/Analysis.java", "license": "apache-2.0", "size": 14421 }
[ "org.apache.lucene.analysis.TokenStream", "org.apache.lucene.analysis.tokenattributes.CharTermAttribute" ]
import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
import org.apache.lucene.analysis.*; import org.apache.lucene.analysis.tokenattributes.*;
[ "org.apache.lucene" ]
org.apache.lucene;
642,314
CreateOptions options = CreateOptions.defaults(); assertFalse(options.getCreateParent()); assertFalse(options.isEnsureAtomic()); assertEquals("", options.getOwner()); assertEquals("", options.getGroup()); assertEquals(Mode.defaults().applyFileUMask(), options.getMode()); }
CreateOptions options = CreateOptions.defaults(); assertFalse(options.getCreateParent()); assertFalse(options.isEnsureAtomic()); assertEquals(STR", options.getGroup()); assertEquals(Mode.defaults().applyFileUMask(), options.getMode()); }
/** * Tests for default {@link CreateOptions}. */
Tests for default <code>CreateOptions</code>
defaults
{ "repo_name": "riversand963/alluxio", "path": "core/common/src/test/java/alluxio/underfs/options/CreateOptionsTest.java", "license": "apache-2.0", "size": 3283 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
1,056,664
public static void assertEqualsGeneric(Object expected, Object actual, Supplier<String> message) { if ((expected != null) && (actual != null) && (expected.getClass().isArray())) { if (actual.getClass().isArray()) { assertContains((Object[]) expected, (Object[]) actual, message); } else { assertContai...
static void function(Object expected, Object actual, Supplier<String> message) { if ((expected != null) && (actual != null) && (expected.getClass().isArray())) { if (actual.getClass().isArray()) { assertContains((Object[]) expected, (Object[]) actual, message); } else { assertContains((Object[]) expected, actual, messa...
/** Asserts that the actual object is equal to one of the expected objects. If not * an AssertionFailedError is thrown. * This assertion function tests the types of its parameters to call the best * {@code assertEquals} function. * * @param message is the error message to put inside the assertion. * @param ...
Asserts that the actual object is equal to one of the expected objects. If not an AssertionFailedError is thrown. This assertion function tests the types of its parameters to call the best assertEquals function
assertEqualsGeneric
{ "repo_name": "gallandarakhneorg/afc", "path": "core/testtools/src/main/java/org/arakhne/afc/testtools/AbstractTestCase.java", "license": "apache-2.0", "size": 63962 }
[ "java.util.function.Supplier", "org.junit.jupiter.api.Assertions" ]
import java.util.function.Supplier; import org.junit.jupiter.api.Assertions;
import java.util.function.*; import org.junit.jupiter.api.*;
[ "java.util", "org.junit.jupiter" ]
java.util; org.junit.jupiter;
1,255,290
private static boolean isCodecUsableDecoder(android.media.MediaCodecInfo info, String name, boolean secureDecodersExplicit) { if (info.isEncoder() || (!secureDecodersExplicit && name.endsWith(".secure"))) { return false; } // Work around broken audio decoders. if (Util.SDK_INT < 21 ...
static boolean function(android.media.MediaCodecInfo info, String name, boolean secureDecodersExplicit) { if (info.isEncoder() (!secureDecodersExplicit && name.endsWith(STR))) { return false; } if (Util.SDK_INT < 21 && (STR.equals(name) STR.equals(name) STR.equals(name) STR.equals(name) STR.equals(name) STR.equals(name...
/** * Returns whether the specified codec is usable for decoding on the current device. */
Returns whether the specified codec is usable for decoding on the current device
isCodecUsableDecoder
{ "repo_name": "filipefilardi/Telegram", "path": "TMessagesProj/src/main/java/org/telegram/messenger/exoplayer2/mediacodec/MediaCodecUtil.java", "license": "gpl-2.0", "size": 28049 }
[ "org.telegram.messenger.exoplayer2.util.Util" ]
import org.telegram.messenger.exoplayer2.util.Util;
import org.telegram.messenger.exoplayer2.util.*;
[ "org.telegram.messenger" ]
org.telegram.messenger;
695,054
private void info(String msg, IgniteLogger... loggers) { for (IgniteLogger logger : loggers) if (logger != null && logger.isInfoEnabled()) logger.info(msg); }
void function(String msg, IgniteLogger... loggers) { for (IgniteLogger logger : loggers) if (logger != null && logger.isInfoEnabled()) logger.info(msg); }
/** * Log info message to loggers. * * @param msg Message text. * @param loggers Loggers. */
Log info message to loggers
info
{ "repo_name": "psadusumilli/ignite", "path": "modules/ssh/src/main/java/org/apache/ignite/internal/util/nodestart/StartNodeCallableImpl.java", "license": "apache-2.0", "size": 17413 }
[ "org.apache.ignite.IgniteLogger" ]
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.*;
[ "org.apache.ignite" ]
org.apache.ignite;
2,495,375
public Builder operationTimeoutCheckInterval(Duration operationTimeoutCheckInterval) { this.operationTimeoutCheckInterval = operationTimeoutCheckInterval; return this; }
Builder function(Duration operationTimeoutCheckInterval) { this.operationTimeoutCheckInterval = operationTimeoutCheckInterval; return this; }
/** * Sets the amount of time that timeouts are checked in the system (by default, 1 second). * * @param operationTimeoutCheckInterval the amount of time that timeouts are checked in the system. * @return the builder reference */
Sets the amount of time that timeouts are checked in the system (by default, 1 second)
operationTimeoutCheckInterval
{ "repo_name": "msemys/esjc", "path": "src/main/java/com/github/msemys/esjc/Settings.java", "license": "mit", "size": 24559 }
[ "java.time.Duration" ]
import java.time.Duration;
import java.time.*;
[ "java.time" ]
java.time;
2,217,379
public void handleTopologyEvent(final TopologyEvent event) { if (event.getType() == Type.PROPERTIES_CHANGED) { this.currentView = event.getNewView(); Set<InstanceDescription> newInstances = event.getNewView() .getInstances(); StringBuilder sb = new St...
void function(final TopologyEvent event) { if (event.getType() == Type.PROPERTIES_CHANGED) { this.currentView = event.getNewView(); Set<InstanceDescription> newInstances = event.getNewView() .getInstances(); StringBuilder sb = new StringBuilder(); for (Iterator<InstanceDescription> it = newInstances.iterator(); it .has...
/** * keep a truncated history of the log events for information purpose (to be shown in the webconsole) */
keep a truncated history of the log events for information purpose (to be shown in the webconsole)
handleTopologyEvent
{ "repo_name": "MRivas-XumaK/slingBuild", "path": "bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/TopologyWebConsolePlugin.java", "license": "apache-2.0", "size": 40360 }
[ "java.util.Iterator", "java.util.Map", "java.util.Set", "org.apache.sling.discovery.InstanceDescription", "org.apache.sling.discovery.TopologyEvent" ]
import java.util.Iterator; import java.util.Map; import java.util.Set; import org.apache.sling.discovery.InstanceDescription; import org.apache.sling.discovery.TopologyEvent;
import java.util.*; import org.apache.sling.discovery.*;
[ "java.util", "org.apache.sling" ]
java.util; org.apache.sling;
2,847,396
public void pollEvents() { VRCompositor.VRCompositor_WaitGetPoses(trackedDevicePoses, trackedDeviceGamePoses); if (!initialDevicesReported) { for (int index = 0; index < devices.length; index++) { if (VRSystem.VRSystem_IsTrackedDeviceConnected(index)) { createDevice(index); for (...
void function() { VRCompositor.VRCompositor_WaitGetPoses(trackedDevicePoses, trackedDeviceGamePoses); if (!initialDevicesReported) { for (int index = 0; index < devices.length; index++) { if (VRSystem.VRSystem_IsTrackedDeviceConnected(index)) { createDevice(index); for (VRDeviceListener l: listeners) { l.connected(devi...
/** * Get the latest tracking data and send events to {@link VRDeviceListener} instance registered with the context. * * Must be called before begin! */
Get the latest tracking data and send events to <code>VRDeviceListener</code> instance registered with the context. Must be called before begin
pollEvents
{ "repo_name": "justinmarentette11/Tower-Defense-Galaxy", "path": "desktop/src/com/badlogic/gdx/vr/VRContext.java", "license": "mit", "size": 38332 }
[ "org.lwjgl.openvr.TrackedDevicePose", "org.lwjgl.openvr.VRCompositor", "org.lwjgl.openvr.VREvent", "org.lwjgl.openvr.VRSystem" ]
import org.lwjgl.openvr.TrackedDevicePose; import org.lwjgl.openvr.VRCompositor; import org.lwjgl.openvr.VREvent; import org.lwjgl.openvr.VRSystem;
import org.lwjgl.openvr.*;
[ "org.lwjgl.openvr" ]
org.lwjgl.openvr;
2,129,056
private void fireListeners(List<Tuple<Translog.Location, Consumer<Boolean>>> listenersToFire) { if (listenersToFire != null) { listenerExecutor.execute(() -> { for (Tuple<Translog.Location, Consumer<Boolean>> listener : listenersToFire) { try { ...
void function(List<Tuple<Translog.Location, Consumer<Boolean>>> listenersToFire) { if (listenersToFire != null) { listenerExecutor.execute(() -> { for (Tuple<Translog.Location, Consumer<Boolean>> listener : listenersToFire) { try { listener.v2().accept(false); } catch (Exception e) { logger.warn(STR, e); } } }); } }
/** * Fire some listeners. Does nothing if the list of listeners is null. */
Fire some listeners. Does nothing if the list of listeners is null
fireListeners
{ "repo_name": "EvilMcJerkface/crate", "path": "server/src/main/java/org/elasticsearch/index/shard/RefreshListeners.java", "license": "apache-2.0", "size": 12924 }
[ "io.crate.common.collections.Tuple", "java.util.List", "java.util.function.Consumer", "org.elasticsearch.index.translog.Translog" ]
import io.crate.common.collections.Tuple; import java.util.List; import java.util.function.Consumer; import org.elasticsearch.index.translog.Translog;
import io.crate.common.collections.*; import java.util.*; import java.util.function.*; import org.elasticsearch.index.translog.*;
[ "io.crate.common", "java.util", "org.elasticsearch.index" ]
io.crate.common; java.util; org.elasticsearch.index;
1,045,721
private InputStream getServletInputStream(String filePath) throws FalconCLIException { if (filePath == null) { return null; } InputStream stream; try { stream = new FileInputStream(filePath); } catch (FileNotFoundException e) { thr...
InputStream function(String filePath) throws FalconCLIException { if (filePath == null) { return null; } InputStream stream; try { stream = new FileInputStream(filePath); } catch (FileNotFoundException e) { throw new FalconCLIException(STR, e); } return stream; }
/** * Converts a InputStream into ServletInputStream. * * @param filePath - Path of file to stream * @return ServletInputStream * @throws FalconCLIException */
Converts a InputStream into ServletInputStream
getServletInputStream
{ "repo_name": "peeyushb/falcon", "path": "client/src/main/java/org/apache/falcon/client/FalconClient.java", "license": "apache-2.0", "size": 60520 }
[ "java.io.FileInputStream", "java.io.FileNotFoundException", "java.io.InputStream" ]
import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
1,578,788
Map<String, Object> action(Map<String, Object> moreInfo) throws Exception;
Map<String, Object> action(Map<String, Object> moreInfo) throws Exception;
/** * The core action of what actually needs to be done by the hook. This can do a number of things * such as transform the POM, return custom Maven arguments, etc. * * <p>Certain implementations could throw exceptions. */
The core action of what actually needs to be done by the hook. This can do a number of things such as transform the POM, return custom Maven arguments, etc. Certain implementations could throw exceptions
action
{ "repo_name": "jenkinsci/plugin-compat-tester", "path": "plugins-compat-tester-model/src/main/java/org/jenkins/tools/test/model/hook/PluginCompatTesterHook.java", "license": "mit", "size": 1764 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,177,571
public static String unescapeJava(String str) { if (str == null) { return null; } try { StringWriter writer = new StringWriter(str.length()); unescapeJava(writer, str); return writer.toString(); } catch (IOException ioe) { ...
static String function(String str) { if (str == null) { return null; } try { StringWriter writer = new StringWriter(str.length()); unescapeJava(writer, str); return writer.toString(); } catch (IOException ioe) { ioe.printStackTrace(); return null; } }
/** * <p>Unescapes any Java literals found in the <code>String</code>. * For example, it will turn a sequence of <code>'\'</code> and * <code>'n'</code> into a newline character, unless the <code>'\'</code> * is preceded by another <code>'\'</code>.</p> * * @param str the <code>Str...
Unescapes any Java literals found in the <code>String</code>. For example, it will turn a sequence of <code>'\'</code> and <code>'n'</code> into a newline character, unless the <code>'\'</code> is preceded by another <code>'\'</code>
unescapeJava
{ "repo_name": "MyJojoX/MyJojoXUtils", "path": "MyJojoXUtils/src/de/johmat/myjojox/utils/data/StringEscapeUtils.java", "license": "mit", "size": 27160 }
[ "java.io.IOException", "java.io.StringWriter" ]
import java.io.IOException; import java.io.StringWriter;
import java.io.*;
[ "java.io" ]
java.io;
308,811
@Test public void testMultiRowMutationMultiThreads() throws IOException { LOG.info("Starting test testMultiRowMutationMultiThreads"); initHRegion(tableName, name.getMethodName(), fam1); // create 10 threads, each will alternate between adding and // removing a column int numThreads = 10; i...
void function() throws IOException { LOG.info(STR); initHRegion(tableName, name.getMethodName(), fam1); int numThreads = 10; int opsPerThread = 500; AtomicOperation[] all = new AtomicOperation[numThreads];
/** * Test multi-threaded region mutations. */
Test multi-threaded region mutations
testMultiRowMutationMultiThreads
{ "repo_name": "ibmsoe/hbase", "path": "hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestAtomicOperation.java", "license": "apache-2.0", "size": 23312 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,397,727
@ServiceMethod(returns = ReturnType.SINGLE) Mono<PrivateEndpointConnectionInner> getAsync( String resourceGroupName, String accountName, String privateEndpointConnectionName);
@ServiceMethod(returns = ReturnType.SINGLE) Mono<PrivateEndpointConnectionInner> getAsync( String resourceGroupName, String accountName, String privateEndpointConnectionName);
/** * Gets the specified private endpoint connection associated with the storage account. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case * insensitive. * @param accountName The name of the storage account within the specified res...
Gets the specified private endpoint connection associated with the storage account
getAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/PrivateEndpointConnectionsClient.java", "license": "mit", "size": 18577 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.storage.fluent.models.PrivateEndpointConnectionInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.storage.fluent.models.PrivateEndpointConnectionInner;
import com.azure.core.annotation.*; import com.azure.resourcemanager.storage.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,032,178
FunctionTypeBuilder inferReturnType(@Nullable JSDocInfo info) { if (info != null && info.hasReturnType()) { returnType = info.getReturnType().evaluate(scope, typeRegistry); returnTypeInferred = false; } if (templateTypeName != null && returnType != null && returnType.restrictB...
FunctionTypeBuilder inferReturnType(@Nullable JSDocInfo info) { if (info != null && info.hasReturnType()) { returnType = info.getReturnType().evaluate(scope, typeRegistry); returnTypeInferred = false; } if (templateTypeName != null && returnType != null && returnType.restrictByNotNullOrUndefined().isTemplateType()) { r...
/** * Infer the return type from JSDocInfo. */
Infer the return type from JSDocInfo
inferReturnType
{ "repo_name": "110035/kissy", "path": "tools/module-compiler/src/com/google/javascript/jscomp/FunctionTypeBuilder.java", "license": "mit", "size": 26446 }
[ "com.google.javascript.rhino.JSDocInfo", "javax.annotation.Nullable" ]
import com.google.javascript.rhino.JSDocInfo; import javax.annotation.Nullable;
import com.google.javascript.rhino.*; import javax.annotation.*;
[ "com.google.javascript", "javax.annotation" ]
com.google.javascript; javax.annotation;
1,194,609
@Inject @Optional private void subscribeEnableGeoSearch(@UIEventTopic(TrackExplorerEventConstants.ENABLE_GEO_SEARCH) final Object data) { // data should be null, only there to comply with syntax browser.execute("showGeoSearchRectangle();"); }
void function(@UIEventTopic(TrackExplorerEventConstants.ENABLE_GEO_SEARCH) final Object data) { browser.execute(STR); }
/** * Invoked whenever the user enables the geo search functionality. * It calls a JavaScript function which displays a rectangular area on the map. * This rectangle indicates the area which shall be used in a geo search. */
Invoked whenever the user enables the geo search functionality. It calls a JavaScript function which displays a rectangular area on the map. This rectangle indicates the area which shall be used in a geo search
subscribeEnableGeoSearch
{ "repo_name": "HenrichN/trackexplorer", "path": "org.trackexplorer/src/org/trackexplorer/parts/TrackViewerPart.java", "license": "mit", "size": 8122 }
[ "org.eclipse.e4.ui.di.UIEventTopic", "org.trackexplorer.events.TrackExplorerEventConstants" ]
import org.eclipse.e4.ui.di.UIEventTopic; import org.trackexplorer.events.TrackExplorerEventConstants;
import org.eclipse.e4.ui.di.*; import org.trackexplorer.events.*;
[ "org.eclipse.e4", "org.trackexplorer.events" ]
org.eclipse.e4; org.trackexplorer.events;
1,117,052
public void componentHandleWebDataRequest(@NonNull final RequestContextImpl ctx, @NonNull String action) throws Exception { action = "webData" + action; IWebActionHandler handler = ctx.getApplication().getWebActionRegistry().findActionHandler(getClass(), action); if(null != handler) { handler.handleWebActi...
void function(@NonNull final RequestContextImpl ctx, @NonNull String action) throws Exception { action = STR + action; IWebActionHandler handler = ctx.getApplication().getWebActionRegistry().findActionHandler(getClass(), action); if(null != handler) { handler.handleWebAction(this, ctx, true); return; } throw new Illega...
/** * Out-of-bound data request for a component. This is not allowed to change the state of the tree as no delta * response will be returned. The action itself must decide on a response. */
Out-of-bound data request for a component. This is not allowed to change the state of the tree as no delta response will be returned. The action itself must decide on a response
componentHandleWebDataRequest
{ "repo_name": "fjalvingh/domui", "path": "to.etc.domui/src/main/java/to/etc/domui/dom/html/NodeBase.java", "license": "lgpl-2.1", "size": 75752 }
[ "org.eclipse.jdt.annotation.NonNull", "to.etc.domui.dom.webaction.IWebActionHandler", "to.etc.domui.server.RequestContextImpl" ]
import org.eclipse.jdt.annotation.NonNull; import to.etc.domui.dom.webaction.IWebActionHandler; import to.etc.domui.server.RequestContextImpl;
import org.eclipse.jdt.annotation.*; import to.etc.domui.dom.webaction.*; import to.etc.domui.server.*;
[ "org.eclipse.jdt", "to.etc.domui" ]
org.eclipse.jdt; to.etc.domui;
195,454
public void setLastAA(String nslastaa) throws ProcessException { if (nslastaa == null) { throw new ProcessException("ERROR: INVALID LASTAA"); } else if (!nslastaa.equals(this.nslastaa)) { this.nslastaa = nslastaa; this.lastQuery = System.currentTimeMillis(); ...
void function(String nslastaa) throws ProcessException { if (nslastaa == null) { throw new ProcessException(STR); } else if (!nslastaa.equals(this.nslastaa)) { this.nslastaa = nslastaa; this.lastQuery = System.currentTimeMillis(); NS_CHANGED = true; } }
/** * Altera o nslastaa do registro. * @param nslastaa o novo nslastaa do registro. * @throws ProcessException se houver falha no processamento. */
Altera o nslastaa do registro
setLastAA
{ "repo_name": "leonamp/SPFBL", "path": "src/net/spfbl/whois/NameServer.java", "license": "gpl-3.0", "size": 8025 }
[ "net.spfbl.core.ProcessException" ]
import net.spfbl.core.ProcessException;
import net.spfbl.core.*;
[ "net.spfbl.core" ]
net.spfbl.core;
125,144
@Test(expected = IllegalArgumentException.class) public void testRemovePrefix_InputStringDoesNotHaveSuffix() { StringUtil.removePrefixRegex("File.txt.zip", ".gz"); }
@Test(expected = IllegalArgumentException.class) void function() { StringUtil.removePrefixRegex(STR, ".gz"); }
/** * Checks for proper exception if the input string does not end with the Prefix requested to be * removed when calling StringUtil.removePrefix() */
Checks for proper exception if the input string does not end with the Prefix requested to be removed when calling StringUtil.removePrefix()
testRemovePrefix_InputStringDoesNotHaveSuffix
{ "repo_name": "UCDenver-ccp/common", "path": "src/test/java/edu/ucdenver/ccp/common/string/StringUtilTest.java", "license": "bsd-3-clause", "size": 27372 }
[ "org.junit.Test" ]
import org.junit.Test;
import org.junit.*;
[ "org.junit" ]
org.junit;
2,514,830
XResource addResource(XResource resource) throws RepositoryStorageException;
XResource addResource(XResource resource) throws RepositoryStorageException;
/** * Add the given resource to storage * * @param resource The resource to add * @return The resource being added, which may be a modified copy of the give resource * @throws RepositoryStorageException If there is a problem storing the resource */
Add the given resource to storage
addResource
{ "repo_name": "jbosgi/jbosgi-repository", "path": "core/src/main/java/org/jboss/osgi/repository/RepositoryStorage.java", "license": "apache-2.0", "size": 2690 }
[ "org.jboss.osgi.resolver.XResource" ]
import org.jboss.osgi.resolver.XResource;
import org.jboss.osgi.resolver.*;
[ "org.jboss.osgi" ]
org.jboss.osgi;
1,657,111
@Override public Collection<T> makeConfirmedCollection() { return new ArrayList<T>(); }
Collection<T> function() { return new ArrayList<T>(); }
/** * Returns an empty List for use in modification testing. * * @return a confirmed empty collection */
Returns an empty List for use in modification testing
makeConfirmedCollection
{ "repo_name": "MuShiiii/commons-collections", "path": "src/test/java/org/apache/commons/collections4/bag/CollectionBagTest.java", "license": "apache-2.0", "size": 4231 }
[ "java.util.ArrayList", "java.util.Collection" ]
import java.util.ArrayList; import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
397,335
List<Double> getPointsAsCoordinates();
List<Double> getPointsAsCoordinates();
/** * Return a list of coordinates following the pattern : x1 y1 z1 x2 y2 z2... * @return The list of coordinates. */
Return a list of coordinates following the pattern : x1 y1 z1 x2 y2 z2..
getPointsAsCoordinates
{ "repo_name": "DanielLefevre/Nantes-1900-Maven", "path": "src/main/java/fr/nantes1900/utils/IPointsAsCoordinates.java", "license": "gpl-3.0", "size": 402 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,615,937
@Override public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(Res_Alloc.class)) { case ActivityPackage.RES_ALLOC__DURATION: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); retu...
void function(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(Res_Alloc.class)) { case ActivityPackage.RES_ALLOC__DURATION: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; case ActivityPackage.RES_ALLOC__RES_TYPE: fir...
/** * This handles model notifications by calling {@link #updateChildren} to update any cached * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This handles model notifications by calling <code>#updateChildren</code> to update any cached children and by creating a viewer notification, which it passes to <code>#fireNotifyChanged</code>.
notifyChanged
{ "repo_name": "JeanHany/farmingdsl2", "path": "fr.esir.lsi.langage.edit/src/activity/provider/Res_AllocItemProvider.java", "license": "mit", "size": 6208 }
[ "org.eclipse.emf.common.notify.Notification", "org.eclipse.emf.edit.provider.ViewerNotification" ]
import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.edit.provider.ViewerNotification;
import org.eclipse.emf.common.notify.*; import org.eclipse.emf.edit.provider.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
789,009
protected Resource[] locateBundles(String[] bundles) { if (bundles == null) bundles = new String[0]; Resource[] res = new Resource[bundles.length]; for (int i = 0; i < bundles.length; i++) { res[i] = locateBundle(bundles[i]); } return res; } // Set log4j property to avoid TCCL problems...
Resource[] function(String[] bundles) { if (bundles == null) bundles = new String[0]; Resource[] res = new Resource[bundles.length]; for (int i = 0; i < bundles.length; i++) { res[i] = locateBundle(bundles[i]); } return res; } /** * {@inheritDoc}
/** * Locates the given bundle identifiers. Will delegate to * {@link #locateBundle(String)}. * * @param bundles bundle identifiers * @return an array of Spring resources for the given bundle indentifiers */
Locates the given bundle identifiers. Will delegate to <code>#locateBundle(String)</code>
locateBundles
{ "repo_name": "glyn/Gemini-Blueprint", "path": "test-support/src/main/java/org/eclipse/gemini/blueprint/test/AbstractDependencyManagerTests.java", "license": "apache-2.0", "size": 11268 }
[ "org.springframework.core.io.Resource" ]
import org.springframework.core.io.Resource;
import org.springframework.core.io.*;
[ "org.springframework.core" ]
org.springframework.core;
1,807,374
public static List< IProject > getSelectedProjects( StructuredSelection selection ) { Object[] items = selection.toArray(); List< IProject > projects = new ArrayList< IProject >(); IProject iproject; for( int i = 0; i < items.length; i++ ) { iproject = null; ...
static List< IProject > function( StructuredSelection selection ) { Object[] items = selection.toArray(); List< IProject > projects = new ArrayList< IProject >(); IProject iproject; for( int i = 0; i < items.length; i++ ) { iproject = null; if( items[ i ] instanceof IAdaptable ) { Object ires = ( (IAdaptable) items[ i ...
/** * Get list of <code>IProject</code> from the selection. * * @param selection * @return The list of <code>IProject</code> */
Get list of <code>IProject</code> from the selection
getSelectedProjects
{ "repo_name": "blackberry/Eclipse-JDE", "path": "net.rim.ejde/src/net/rim/ejde/internal/ui/launchers/LaunchUtils.java", "license": "epl-1.0", "size": 19677 }
[ "java.util.ArrayList", "java.util.List", "net.rim.ejde.internal.util.NatureUtils", "org.eclipse.core.resources.IProject", "org.eclipse.core.resources.IResource", "org.eclipse.core.runtime.IAdaptable", "org.eclipse.jface.viewers.StructuredSelection" ]
import java.util.ArrayList; import java.util.List; import net.rim.ejde.internal.util.NatureUtils; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.jface.viewers.StructuredSelection;
import java.util.*; import net.rim.ejde.internal.util.*; import org.eclipse.core.resources.*; import org.eclipse.core.runtime.*; import org.eclipse.jface.viewers.*;
[ "java.util", "net.rim.ejde", "org.eclipse.core", "org.eclipse.jface" ]
java.util; net.rim.ejde; org.eclipse.core; org.eclipse.jface;
1,631,258
public static float getFloatFromStringPref( SharedPreferences prefs, Resources res, int keyResId, int defaultResId) { final String strPref = prefs.getString( res.getString(keyResId), res.getString(defaultResId)); return Float.parseFloat(strPref); }
static float function( SharedPreferences prefs, Resources res, int keyResId, int defaultResId) { final String strPref = prefs.getString( res.getString(keyResId), res.getString(defaultResId)); return Float.parseFloat(strPref); }
/** * Returns the value of a floating point preference stored as a string. This * is necessary when using a {@link android.preference.ListPreference} to * manage a floating point preference, since the entries must be * {@link String} values. * * @param prefs Shared preferences from which t...
Returns the value of a floating point preference stored as a string. This is necessary when using a <code>android.preference.ListPreference</code> to manage a floating point preference, since the entries must be <code>String</code> values
getFloatFromStringPref
{ "repo_name": "google/brailleback", "path": "braille/libraries/utils/src/com/googlecode/eyesfree/utils/SharedPreferencesUtils.java", "license": "apache-2.0", "size": 7632 }
[ "android.content.SharedPreferences", "android.content.res.Resources" ]
import android.content.SharedPreferences; import android.content.res.Resources;
import android.content.*; import android.content.res.*;
[ "android.content" ]
android.content;
218,586
protected void enumerate() throws IOException { init(); try { Iterator<String> iter = hashtable.keys(); while (iter.hasNext() ) { String key = iter.next(); String val = hashtable.find( key ); System.out.pr...
void function() throws IOException { init(); try { Iterator<String> iter = hashtable.keys(); while (iter.hasNext() ) { String key = iter.next(); String val = hashtable.find( key ); System.out.println( STR + key + STR + val ); } } finally { recman.close(); } }
/** * Enumerate keys and objects found in HTree */
Enumerate keys and objects found in HTree
enumerate
{ "repo_name": "cdemoustier/jdbm2", "path": "src/tests/jdbm/HashtableTest.java", "license": "apache-2.0", "size": 5402 }
[ "java.io.IOException", "java.util.Iterator" ]
import java.io.IOException; import java.util.Iterator;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
746,240
EAttribute getCDOResource_URI();
EAttribute getCDOResource_URI();
/** * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.eresource.CDOResource#getURI <em>URI</em>}'. * <!-- begin-user-doc --> <!-- end-user-doc --> * * @return the meta object for the attribute '<em>URI</em>'. * @see org.eclipse.emf.cdo.eresource.CDOResource#getURI() * @see #getC...
Returns the meta object for the attribute '<code>org.eclipse.emf.cdo.eresource.CDOResource#getURI URI</code>'.
getCDOResource_URI
{ "repo_name": "IHTSDO/snow-owl", "path": "dependencies/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/EresourcePackage.java", "license": "apache-2.0", "size": 34776 }
[ "org.eclipse.emf.ecore.EAttribute" ]
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
332,449
void init() { this.xL.set(0.); this.r1 = this.b.copy(); this.y = this.m == null ? this.b.copy() : this.m.operate(this.r1); if ((this.m != null) && this.check) { checkSymmetry(this.m, this.r1, this.y, this.m.operate(this.y)); ...
void init() { this.xL.set(0.); this.r1 = this.b.copy(); this.y = this.m == null ? this.b.copy() : this.m.operate(this.r1); if ((this.m != null) && this.check) { checkSymmetry(this.m, this.r1, this.y, this.m.operate(this.y)); } this.beta1 = this.r1.dotProduct(this.y); if (this.beta1 < 0.) { throwNPDLOException(this.m, t...
/** * Performs the initial phase of the SYMMLQ algorithm. On return, the * value of the state variables of {@code this} object correspond to k = * 1. */
Performs the initial phase of the SYMMLQ algorithm. On return, the value of the state variables of this object correspond to k = 1
init
{ "repo_name": "virtualdataset/metagen-java", "path": "virtdata-lib-curves4/src/main/java/org/apache/commons/math4/linear/SymmLQ.java", "license": "apache-2.0", "size": 52661 }
[ "org.apache.commons.math4.util.FastMath" ]
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.*;
[ "org.apache.commons" ]
org.apache.commons;
888,339
@Generated @Selector("sampleBufferAttachments") public native MTLBlitPassSampleBufferAttachmentDescriptorArray sampleBufferAttachments();
@Selector(STR) native MTLBlitPassSampleBufferAttachmentDescriptorArray function();
/** * [@property] sampleBufferAttachments * <p> * An array of sample buffers and associated sample indices. */
[@property] sampleBufferAttachments An array of sample buffers and associated sample indices
sampleBufferAttachments
{ "repo_name": "multi-os-engine/moe-core", "path": "moe.apple/moe.platform.ios/src/main/java/apple/metal/MTLBlitPassDescriptor.java", "license": "apache-2.0", "size": 5178 }
[ "org.moe.natj.objc.ann.Selector" ]
import org.moe.natj.objc.ann.Selector;
import org.moe.natj.objc.ann.*;
[ "org.moe.natj" ]
org.moe.natj;
193,370
private void removeHomeFromDatabase(final PlayerHome home) { BukkitDatabase db = bFundamentals.getBukkitDatabase(); String query = "DELETE FROM `perks_homes` " + "WHERE hash=" + "'" + home.getHash() + "';"; db.query(query, true); }
void function(final PlayerHome home) { BukkitDatabase db = bFundamentals.getBukkitDatabase(); String query = STR + STR + "'" + home.getHash() + "';"; db.query(query, true); }
/** * Remove a home from the database * @param home The home to remove */
Remove a home from the database
removeHomeFromDatabase
{ "repo_name": "CodingBadgers/Perks", "path": "bTransported/src/uk/codingbadgers/btransported/commands/home/CommandHome.java", "license": "gpl-2.0", "size": 18977 }
[ "uk.thecodingbadgers.bDatabaseManager.Database" ]
import uk.thecodingbadgers.bDatabaseManager.Database;
import uk.thecodingbadgers.*;
[ "uk.thecodingbadgers" ]
uk.thecodingbadgers;
783,932
public MeteoDataInfo openASCIIGridData(String fileName) { MeteoDataInfo aDataInfo = new MeteoDataInfo(); aDataInfo.openASCIIGridData(fileName); addMeteoData(aDataInfo); return aDataInfo; }
MeteoDataInfo function(String fileName) { MeteoDataInfo aDataInfo = new MeteoDataInfo(); aDataInfo.openASCIIGridData(fileName); addMeteoData(aDataInfo); return aDataInfo; }
/** * Open ASCII grid data file * * @param fileName ASCII grid data file name * @return MeteoDataInfo */
Open ASCII grid data file
openASCIIGridData
{ "repo_name": "meteoinfo/meteoinfomap", "path": "src/org/meteoinfo/desktop/forms/FrmMeteoData.java", "license": "lgpl-3.0", "size": 146140 }
[ "org.meteoinfo.data.meteodata.MeteoDataInfo" ]
import org.meteoinfo.data.meteodata.MeteoDataInfo;
import org.meteoinfo.data.meteodata.*;
[ "org.meteoinfo.data" ]
org.meteoinfo.data;
2,815,813
public void addPublication( TairObjectPublication publication ) { if ( publications == null ) { publications = new TairObjectPublicationCollection(); } publications.add( publication ); }
void function( TairObjectPublication publication ) { if ( publications == null ) { publications = new TairObjectPublicationCollection(); } publications.add( publication ); }
/** * Adds a publication to be associated to germplasm * * @param publication Publication to associate to germplasm */
Adds a publication to be associated to germplasm
addPublication
{ "repo_name": "tair/tairwebapp", "path": "src/org/tair/processor/microarray/data/LoadableGermplasm.java", "license": "gpl-3.0", "size": 16055 }
[ "org.tair.processor.genesymbol.TairObjectPublication", "org.tair.processor.genesymbol.TairObjectPublicationCollection" ]
import org.tair.processor.genesymbol.TairObjectPublication; import org.tair.processor.genesymbol.TairObjectPublicationCollection;
import org.tair.processor.genesymbol.*;
[ "org.tair.processor" ]
org.tair.processor;
173,003
public static boolean isQueuedTorrentToAddAMagnetUrl(String torrentUri) { return torrentUri != null && torrentUri.startsWith(HttpHelper.SCHEME_MAGNET); }
static boolean function(String torrentUri) { return torrentUri != null && torrentUri.startsWith(HttpHelper.SCHEME_MAGNET); }
/** * Indicates whether this torrent uri points to a magnet url * @param torrentUri The raw torrent uri string * @return True it it seems like a magnet link (starting with magnet); true otherwise */
Indicates whether this torrent uri points to a magnet url
isQueuedTorrentToAddAMagnetUrl
{ "repo_name": "austgl/transdroid", "path": "android/src/org/transdroid/preferences/Preferences.java", "license": "gpl-3.0", "size": 55006 }
[ "org.transdroid.daemon.util.HttpHelper" ]
import org.transdroid.daemon.util.HttpHelper;
import org.transdroid.daemon.util.*;
[ "org.transdroid.daemon" ]
org.transdroid.daemon;
493,319
public void addListener(final CancellationListener cancellationListener, final Executor executor) { checkNotNull(cancellationListener, "cancellationListener"); checkNotNull(executor, "executor"); if (canBeCancelled) { ExecutableListener executableListener = new Ex...
void function(final CancellationListener cancellationListener, final Executor executor) { checkNotNull(cancellationListener, STR); checkNotNull(executor, STR); if (canBeCancelled) { ExecutableListener executableListener = new ExecutableListener(executor, cancellationListener); synchronized (this) { if (isCancelled()) {...
/** * Add a listener that will be notified when the context becomes cancelled. */
Add a listener that will be notified when the context becomes cancelled
addListener
{ "repo_name": "anuraaga/grpc-java", "path": "context/src/main/java/io/grpc/Context.java", "license": "bsd-3-clause", "size": 30248 }
[ "java.util.ArrayList", "java.util.concurrent.Executor" ]
import java.util.ArrayList; import java.util.concurrent.Executor;
import java.util.*; import java.util.concurrent.*;
[ "java.util" ]
java.util;
2,283,394
protected List<Plot<?>> getPlots() { return plots; }
List<Plot<?>> function() { return plots; }
/** * Returns the plots * @return */
Returns the plots
getPlots
{ "repo_name": "eicherj/subframe", "path": "src/main/de/linearbits/subframe/render/PlotGroup.java", "license": "gpl-3.0", "size": 2515 }
[ "de.linearbits.subframe.graph.Plot", "java.util.List" ]
import de.linearbits.subframe.graph.Plot; import java.util.List;
import de.linearbits.subframe.graph.*; import java.util.*;
[ "de.linearbits.subframe", "java.util" ]
de.linearbits.subframe; java.util;
920,405
private void printDebug(ArrayList<Observation>[] positions, String str) { if(positions != null){ System.out.print(str + ":" + positions.length + "("); for (int i = 0; i < positions.length; i++) { System.out.print(positions[i].size() + ","); } ...
void function(ArrayList<Observation>[] positions, String str) { if(positions != null){ System.out.print(str + ":" + positions.length + "("); for (int i = 0; i < positions.length; i++) { System.out.print(positions[i].size() + ","); } System.out.print(STR); }else System.out.print(str + STR); }
/** * Prints the number of different types of sprites available in the "positions" array. * Between brackets, the number of observations of each type. * @param positions array with observations. * @param str identifier to print */
Prints the number of different types of sprites available in the "positions" array. Between brackets, the number of observations of each type
printDebug
{ "repo_name": "tohahn/UE_ML", "path": "UE06/gvgai/src/controllers/singlePlayer/sampleRandom/Agent.java", "license": "gpl-3.0", "size": 4886 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
2,021,807
public static boolean isMetaValid(ItemMeta meta) { final IMetaChecker metaChecker = MetaCheckerHelper.getMetaChecker(); //Localize the reference (tsafety) return metaChecker == null ? true : metaChecker.isValidItemMeta(meta); } // ----- "Wrapper Factory" / MetaChecker setter /** * Tries t...
static boolean function(ItemMeta meta) { final IMetaChecker metaChecker = MetaCheckerHelper.getMetaChecker(); return metaChecker == null ? true : metaChecker.isValidItemMeta(meta); } /** * Tries to set the {@link IMetaChecker} instance, either directly or by creating a wrapper with reflection. * </p>If {@link IMetaChec...
/** * Wraps the call to {@link IMetaChecker#isValidItemMeta(ItemMeta)} or to a reflected equivalent. * @param meta * @return (<code>true</code> if no metaChecker available) */
Wraps the call to <code>IMetaChecker#isValidItemMeta(ItemMeta)</code> or to a reflected equivalent
isMetaValid
{ "repo_name": "AnorZaken/aztb", "path": "src/nu/mine/obsidian/aztb/bukkit/recipes/v1_0/RecipeHelper.java", "license": "lgpl-3.0", "size": 38399 }
[ "org.bukkit.inventory.meta.ItemMeta" ]
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.*;
[ "org.bukkit.inventory" ]
org.bukkit.inventory;
1,488,041
default void removePropertyChangeListener(@NotNull PropertyChangeListener listener) { }
default void removePropertyChangeListener(@NotNull PropertyChangeListener listener) { }
/** * Removes a listener for receiving notifications about changes in the properties of the document * (for example, its read-only state). * * @param listener the listener instance. */
Removes a listener for receiving notifications about changes in the properties of the document (for example, its read-only state)
removePropertyChangeListener
{ "repo_name": "goodwinnk/intellij-community", "path": "platform/core-api/src/com/intellij/openapi/editor/Document.java", "license": "apache-2.0", "size": 13277 }
[ "java.beans.PropertyChangeListener", "org.jetbrains.annotations.NotNull" ]
import java.beans.PropertyChangeListener; import org.jetbrains.annotations.NotNull;
import java.beans.*; import org.jetbrains.annotations.*;
[ "java.beans", "org.jetbrains.annotations" ]
java.beans; org.jetbrains.annotations;
106,622
private HashMap uploadZipAttachments(SessionState state, HashMap submissionTable, InputStream zin, ZipEntry entry, String entryName, String userEid, String submissionOrFeedback) { // upload all the files as instructor attachments to the submission for grading purpose String fName = entryName.substring(entryName....
HashMap function(SessionState state, HashMap submissionTable, InputStream zin, ZipEntry entry, String entryName, String userEid, String submissionOrFeedback) { String fName = entryName.substring(entryName.lastIndexOf("/") + 1, entryName.length()); ContentTypeImageService iService = (ContentTypeImageService) state.getAt...
/** * This is to get the submission or feedback attachment from the upload zip file into the submission object * @param state * @param submissionTable * @param zin * @param entry * @param entryName * @param userEid * @param submissionOrFeedback */
This is to get the submission or feedback attachment from the upload zip file into the submission object
uploadZipAttachments
{ "repo_name": "harfalm/Sakai-10.1", "path": "assignment/assignment-tool/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java", "license": "apache-2.0", "size": 605178 }
[ "java.io.InputStream", "java.util.HashMap", "org.apache.tools.zip.ZipEntry", "org.sakaiproject.content.api.ContentTypeImageService", "org.sakaiproject.event.api.SessionState" ]
import java.io.InputStream; import java.util.HashMap; import org.apache.tools.zip.ZipEntry; import org.sakaiproject.content.api.ContentTypeImageService; import org.sakaiproject.event.api.SessionState;
import java.io.*; import java.util.*; import org.apache.tools.zip.*; import org.sakaiproject.content.api.*; import org.sakaiproject.event.api.*;
[ "java.io", "java.util", "org.apache.tools", "org.sakaiproject.content", "org.sakaiproject.event" ]
java.io; java.util; org.apache.tools; org.sakaiproject.content; org.sakaiproject.event;
1,498,651
public String toString(FeatureCollection features) throws IOException { StringWriter w = new StringWriter(); writeFeatureCollection(features, w); return w.toString(); }
String function(FeatureCollection features) throws IOException { StringWriter w = new StringWriter(); writeFeatureCollection(features, w); return w.toString(); }
/** * Writes a feature collection as GeoJSON returning the result as a string. * * @param features The feature collection. * * @return The feature collection encoded as GeoJSON */
Writes a feature collection as GeoJSON returning the result as a string
toString
{ "repo_name": "pgiraud/georchestra", "path": "mapfishapp/src/main/java/org/georchestra/mapfishapp/ws/upload/FeatureJSON2.java", "license": "gpl-3.0", "size": 23287 }
[ "java.io.IOException", "java.io.StringWriter", "org.geotools.feature.FeatureCollection" ]
import java.io.IOException; import java.io.StringWriter; import org.geotools.feature.FeatureCollection;
import java.io.*; import org.geotools.feature.*;
[ "java.io", "org.geotools.feature" ]
java.io; org.geotools.feature;
665,960
public RecoveryResponse recoverToTarget() throws IOException { try (Translog.View translogView = shard.acquireTranslogView()) { logger.trace("captured translog id [{}] for recovery", translogView.minTranslogGeneration()); final IndexCommit phase1Snapshot; try { ...
RecoveryResponse function() throws IOException { try (Translog.View translogView = shard.acquireTranslogView()) { logger.trace(STR, translogView.minTranslogGeneration()); final IndexCommit phase1Snapshot; try { phase1Snapshot = shard.snapshotIndex(false); } catch (Exception e) { IOUtils.closeWhileHandlingException(tran...
/** * performs the recovery from the local engine to the target */
performs the recovery from the local engine to the target
recoverToTarget
{ "repo_name": "avikurapati/elasticsearch", "path": "core/src/main/java/org/elasticsearch/indices/recovery/RecoverySourceHandler.java", "license": "apache-2.0", "size": 28250 }
[ "java.io.IOException", "org.apache.lucene.index.IndexCommit", "org.apache.lucene.util.IOUtils", "org.elasticsearch.index.engine.RecoveryEngineException", "org.elasticsearch.index.translog.Translog" ]
import java.io.IOException; import org.apache.lucene.index.IndexCommit; import org.apache.lucene.util.IOUtils; import org.elasticsearch.index.engine.RecoveryEngineException; import org.elasticsearch.index.translog.Translog;
import java.io.*; import org.apache.lucene.index.*; import org.apache.lucene.util.*; import org.elasticsearch.index.engine.*; import org.elasticsearch.index.translog.*;
[ "java.io", "org.apache.lucene", "org.elasticsearch.index" ]
java.io; org.apache.lucene; org.elasticsearch.index;
2,224,581
private void modifySysTableNullability(TransactionController tc, int catalogNum) throws StandardException { TabInfoImpl ti = bootingDictionary.getNonCoreTIByNumber(catalogNum); CatalogRowFactory rowFactory = ti.getCatalogRowFactory(); if (catalogNum == DataDictionaryImpl.SYSSTATEMENTS_CATALOG_NUM) { ...
void function(TransactionController tc, int catalogNum) throws StandardException { TabInfoImpl ti = bootingDictionary.getNonCoreTIByNumber(catalogNum); CatalogRowFactory rowFactory = ti.getCatalogRowFactory(); if (catalogNum == DataDictionaryImpl.SYSSTATEMENTS_CATALOG_NUM) { bootingDictionary.upgradeFixSystemColumnDefi...
/** * * Modifies the nullability of the system table corresponding * to the received catalog number. * * @param tc TransactionController. * @param catalogNum The catalog number corresponding * to the table for which we will modify the nullability. * * OLD Cloudscape 5.1 upgrade code * If th...
Modifies the nullability of the system table corresponding to the received catalog number
modifySysTableNullability
{ "repo_name": "papicella/snappy-store", "path": "gemfirexd/core/src/main/java/com/pivotal/gemfirexd/internal/impl/sql/catalog/DD_Version.java", "license": "apache-2.0", "size": 29656 }
[ "com.pivotal.gemfirexd.internal.iapi.error.StandardException", "com.pivotal.gemfirexd.internal.iapi.sql.dictionary.CatalogRowFactory", "com.pivotal.gemfirexd.internal.iapi.store.access.TransactionController" ]
import com.pivotal.gemfirexd.internal.iapi.error.StandardException; import com.pivotal.gemfirexd.internal.iapi.sql.dictionary.CatalogRowFactory; import com.pivotal.gemfirexd.internal.iapi.store.access.TransactionController;
import com.pivotal.gemfirexd.internal.iapi.error.*; import com.pivotal.gemfirexd.internal.iapi.sql.dictionary.*; import com.pivotal.gemfirexd.internal.iapi.store.access.*;
[ "com.pivotal.gemfirexd" ]
com.pivotal.gemfirexd;
873,636
public static BigDecimal toBigDecimal(byte[] bytes, int offset, final int length) { if (bytes == null || length < SIZEOF_INT + 1 || (offset + length > bytes.length)) { return null; } int scale = toInt(bytes, offset); byte[] tcBytes = new byte[length - SIZEOF_INT]; System.arraycopy(byt...
static BigDecimal function(byte[] bytes, int offset, final int length) { if (bytes == null length < SIZEOF_INT + 1 (offset + length > bytes.length)) { return null; } int scale = toInt(bytes, offset); byte[] tcBytes = new byte[length - SIZEOF_INT]; System.arraycopy(bytes, offset + SIZEOF_INT, tcBytes, 0, length - SIZEOF...
/** * Converts a byte array to a BigDecimal value * * @param bytes * @param offset * @param length * @return the char value */
Converts a byte array to a BigDecimal value
toBigDecimal
{ "repo_name": "lifeng5042/RStore", "path": "src/org/apache/hadoop/hbase/util/Bytes.java", "license": "gpl-2.0", "size": 48115 }
[ "java.math.BigDecimal", "java.math.BigInteger" ]
import java.math.BigDecimal; import java.math.BigInteger;
import java.math.*;
[ "java.math" ]
java.math;
469,818
Rect getLastChildRect() { return mLastChildRect; }
Rect getLastChildRect() { return mLastChildRect; }
/** * Get the last known position rect for this child view. * Note: do not mutate the result of this call. */
Get the last known position rect for this child view. Note: do not mutate the result of this call
getLastChildRect
{ "repo_name": "mobvoi/ticdesign", "path": "ticDesign/src/main/java/ticwear/design/widget/CoordinatorLayout.java", "license": "apache-2.0", "size": 129547 }
[ "android.graphics.Rect" ]
import android.graphics.Rect;
import android.graphics.*;
[ "android.graphics" ]
android.graphics;
1,121,811
private Approval toApproval(final MongoApproval mongoApproval) { return new Approval(mongoApproval.getUserId(), mongoApproval.getClientId(), mongoApproval.getScope(), mongoApproval.getExpiresAt(), mongoApproval.getStatus(), mongoApproval.getLastUpdatedAt()); }
Approval function(final MongoApproval mongoApproval) { return new Approval(mongoApproval.getUserId(), mongoApproval.getClientId(), mongoApproval.getScope(), mongoApproval.getExpiresAt(), mongoApproval.getStatus(), mongoApproval.getLastUpdatedAt()); }
/** * Copy properties from MongoApproval to Approval. * * @param mongoApproval The MongoApproval * @return Approval */
Copy properties from MongoApproval to Approval
toApproval
{ "repo_name": "marcosbarbero/spring-security-oauth", "path": "spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/approval/mongo/MongoApprovalStore.java", "license": "apache-2.0", "size": 7155 }
[ "org.springframework.security.oauth2.provider.approval.Approval" ]
import org.springframework.security.oauth2.provider.approval.Approval;
import org.springframework.security.oauth2.provider.approval.*;
[ "org.springframework.security" ]
org.springframework.security;
1,262,700
public ArrayList<Integer> getAntecedent() { return this.antecedent; }
ArrayList<Integer> function() { return this.antecedent; }
/** * <p> * It retrieves the antecedent part of an association rule * </p> * @return An array of numbers representing antecedent attributes */
It retrieves the antecedent part of an association rule
getAntecedent
{ "repo_name": "SCI2SUGR/KEEL", "path": "src/keel/Algorithms/UnsupervisedLearning/AssociationRules/IntervalRuleLearning/Apriori/AssociationRule.java", "license": "gpl-3.0", "size": 7537 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
2,909,695
@RequestMapping(value = "/authenticate", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @Timed public String isAuthenticated(HttpServletRequest request) { log.debug("REST request to check if the current user is authenticated"); return request.getRemo...
@RequestMapping(value = STR, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) String function(HttpServletRequest request) { log.debug(STR); return request.getRemoteUser(); }
/** * GET /authenticate : check if the user is authenticated, and return its login. * * @param request the HTTP request * @return the login if the user is authenticated */
GET /authenticate : check if the user is authenticated, and return its login
isAuthenticated
{ "repo_name": "jero-rodriguez/dmtools", "path": "src/main/java/com/dmtools/webapp/controller/rest/AccountResource.java", "license": "gpl-3.0", "size": 10249 }
[ "javax.servlet.http.HttpServletRequest", "org.springframework.http.MediaType", "org.springframework.web.bind.annotation.RequestMapping", "org.springframework.web.bind.annotation.RequestMethod" ]
import javax.servlet.http.HttpServletRequest; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod;
import javax.servlet.http.*; import org.springframework.http.*; import org.springframework.web.bind.annotation.*;
[ "javax.servlet", "org.springframework.http", "org.springframework.web" ]
javax.servlet; org.springframework.http; org.springframework.web;
2,001,055
void info(String title, Throwable throwable, Map<String, String> attrs);
void info(String title, Throwable throwable, Map<String, String> attrs);
/** * Write an exception log in info level with some extra attributes. * * @param title log title * @param throwable a Throwable instance to log * @param attrs kv pairs */
Write an exception log in info level with some extra attributes
info
{ "repo_name": "AdoHe/Bottlenose", "path": "bn-common/src/main/java/com/xqbase/bn/common/logging/Logger.java", "license": "apache-2.0", "size": 8380 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,234,561
public Parameter getParameter(String id) { return modelService.getModel().getParameter(id); }
Parameter function(String id) { return modelService.getModel().getParameter(id); }
/** * Gets the parameter with the given id from the current dao. * * @param id * @return */
Gets the parameter with the given id from the current dao
getParameter
{ "repo_name": "preipke/petrisim", "path": "GraphEditor/src/main/java/edu/unibi/agbi/editor/business/service/ParameterService.java", "license": "mit", "size": 16659 }
[ "edu.unibi.agbi.petrinet.model.Parameter" ]
import edu.unibi.agbi.petrinet.model.Parameter;
import edu.unibi.agbi.petrinet.model.*;
[ "edu.unibi.agbi" ]
edu.unibi.agbi;
1,032,203
@Test public void whenLoadAllWithListenerIsUsed_thenNearCacheIsInvalidated_onNearCacheAdapter() { whenEntryIsLoaded_thenNearCacheShouldBeInvalidated(false, DataStructureMethods.LOAD_ALL_WITH_LISTENER); }
void function() { whenEntryIsLoaded_thenNearCacheShouldBeInvalidated(false, DataStructureMethods.LOAD_ALL_WITH_LISTENER); }
/** * Checks that the Near Cache is eventually invalidated when {@link DataStructureMethods#LOAD_ALL_WITH_LISTENER} is used. */
Checks that the Near Cache is eventually invalidated when <code>DataStructureMethods#LOAD_ALL_WITH_LISTENER</code> is used
whenLoadAllWithListenerIsUsed_thenNearCacheIsInvalidated_onNearCacheAdapter
{ "repo_name": "tkountis/hazelcast", "path": "hazelcast/src/test/java/com/hazelcast/internal/nearcache/AbstractNearCacheBasicTest.java", "license": "apache-2.0", "size": 79879 }
[ "com.hazelcast.internal.adapter.DataStructureAdapter" ]
import com.hazelcast.internal.adapter.DataStructureAdapter;
import com.hazelcast.internal.adapter.*;
[ "com.hazelcast.internal" ]
com.hazelcast.internal;
1,755,123
EReference getFossilFuel_FuelAllocationSchedules();
EReference getFossilFuel_FuelAllocationSchedules();
/** * Returns the meta object for the reference list '{@link CIM.IEC61970.Generation.Production.FossilFuel#getFuelAllocationSchedules <em>Fuel Allocation Schedules</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the reference list '<em>Fuel Allocation Schedules</em>'. *...
Returns the meta object for the reference list '<code>CIM.IEC61970.Generation.Production.FossilFuel#getFuelAllocationSchedules Fuel Allocation Schedules</code>'.
getFossilFuel_FuelAllocationSchedules
{ "repo_name": "georghinkel/ttc2017smartGrids", "path": "solutions/ModelJoin/src/main/java/CIM/IEC61970/Generation/Production/ProductionPackage.java", "license": "mit", "size": 499866 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
806,714
public void setDateTimeStart(Timestamp value) { set(8, value); }
void function(Timestamp value) { set(8, value); }
/** * Setter for <code>sugarcrm_4_12.schedulers.date_time_start</code>. */
Setter for <code>sugarcrm_4_12.schedulers.date_time_start</code>
setDateTimeStart
{ "repo_name": "SmartMedicalServices/SpringJOOQ", "path": "src/main/java/com/sms/sis/db/tables/records/SchedulersRecord.java", "license": "gpl-3.0", "size": 15656 }
[ "java.sql.Timestamp" ]
import java.sql.Timestamp;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,590,623
private Intent getTakePhotoIntent(Uri outputUri) { final Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE, null); ContactPhotoUtils.addPhotoPickerExtras(intent, outputUri); return intent; }
Intent function(Uri outputUri) { final Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE, null); ContactPhotoUtils.addPhotoPickerExtras(intent, outputUri); return intent; }
/** * Constructs an intent for capturing a photo and storing it in a temporary file. */
Constructs an intent for capturing a photo and storing it in a temporary file
getTakePhotoIntent
{ "repo_name": "miswenwen/My_bird_work", "path": "Bird_work/我的项目/Contacts/Contacts_liuqipeng/src/com/yunos/alicontacts/detail/PhotoSelectionHandler.java", "license": "apache-2.0", "size": 35635 }
[ "android.content.Intent", "android.net.Uri", "android.provider.MediaStore", "com.yunos.alicontacts.util.ContactPhotoUtils" ]
import android.content.Intent; import android.net.Uri; import android.provider.MediaStore; import com.yunos.alicontacts.util.ContactPhotoUtils;
import android.content.*; import android.net.*; import android.provider.*; import com.yunos.alicontacts.util.*;
[ "android.content", "android.net", "android.provider", "com.yunos.alicontacts" ]
android.content; android.net; android.provider; com.yunos.alicontacts;
1,320,817
private Set<String> getLocalAvailableResources(Type resourceType) { Set<String> resources = ImmutableSet.of(); if (RESOURCE_TYPE_SET.contains(resourceType)) { if (Type.CONTROL_MESSAGE.equals(resourceType)) { resources = ImmutableSet.copyOf(availableDeviceIdSet.stream() ...
Set<String> function(Type resourceType) { Set<String> resources = ImmutableSet.of(); if (RESOURCE_TYPE_SET.contains(resourceType)) { if (Type.CONTROL_MESSAGE.equals(resourceType)) { resources = ImmutableSet.copyOf(availableDeviceIdSet.stream() .map(DeviceId::toString).collect(Collectors.toSet())); } else { Set<String> ...
/** * Obtains the available resource list from local node. * * @param resourceType control resource type * @return a set of available control resource */
Obtains the available resource list from local node
getLocalAvailableResources
{ "repo_name": "gkatsikas/onos", "path": "apps/cpman/app/src/main/java/org/onosproject/cpman/impl/ControlPlaneMonitor.java", "license": "apache-2.0", "size": 24583 }
[ "com.google.common.collect.ImmutableSet", "java.util.Set", "java.util.stream.Collectors", "org.onosproject.cpman.ControlResource", "org.onosproject.net.DeviceId" ]
import com.google.common.collect.ImmutableSet; import java.util.Set; import java.util.stream.Collectors; import org.onosproject.cpman.ControlResource; import org.onosproject.net.DeviceId;
import com.google.common.collect.*; import java.util.*; import java.util.stream.*; import org.onosproject.cpman.*; import org.onosproject.net.*;
[ "com.google.common", "java.util", "org.onosproject.cpman", "org.onosproject.net" ]
com.google.common; java.util; org.onosproject.cpman; org.onosproject.net;
973,566
public void elementDecl(String name, String contentModel, Augmentations augs) throws XNIException { } // elementDecl(String,String)
void function(String name, String contentModel, Augmentations augs) throws XNIException { }
/** * An element declaration. * * @param name The name of the element. * @param contentModel The element content model. * @param augs Additional information that may include infoset * augmentations. * * @throws XNIException Thrown by handler to signa...
An element declaration
elementDecl
{ "repo_name": "BIORIMP/biorimp", "path": "BIO-RIMP/test_data/code/xerces/src/org/apache/xerces/parsers/AbstractXMLDocumentParser.java", "license": "gpl-2.0", "size": 30995 }
[ "org.apache.xerces.xni.Augmentations", "org.apache.xerces.xni.XNIException" ]
import org.apache.xerces.xni.Augmentations; import org.apache.xerces.xni.XNIException;
import org.apache.xerces.xni.*;
[ "org.apache.xerces" ]
org.apache.xerces;
288,192
public String getLoadBalancerClassName() { return conf.get(HConstants.HBASE_MASTER_LOADBALANCER_CLASS, LoadBalancerFactory .getDefaultLoadBalancerClass().getName()); }
String function() { return conf.get(HConstants.HBASE_MASTER_LOADBALANCER_CLASS, LoadBalancerFactory .getDefaultLoadBalancerClass().getName()); }
/** * Fetch the configured {@link LoadBalancer} class name. If none is set, a default is returned. * * @return The name of the {@link LoadBalancer} in use. */
Fetch the configured <code>LoadBalancer</code> class name. If none is set, a default is returned
getLoadBalancerClassName
{ "repo_name": "ibmsoe/hbase", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java", "license": "apache-2.0", "size": 100923 }
[ "org.apache.hadoop.hbase.HConstants", "org.apache.hadoop.hbase.master.balancer.LoadBalancerFactory" ]
import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.master.balancer.LoadBalancerFactory;
import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.master.balancer.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,827,650
RecordHandle insert( Object[] row, FormatableBitSet validColumns, byte insertFlag, int overflowThreshold) throws StandardException;
RecordHandle insert( Object[] row, FormatableBitSet validColumns, byte insertFlag, int overflowThreshold) throws StandardException;
/** * Insert a record anywhere on the page. * <P> * * <B>Locking Policy</B> * <BR> * Calls the lockRecordForWrite() method of the LockingPolicy object * passed to the openContainer() call before the record is inserted. * <BR> * MT - latched * * @param row ...
Insert a record anywhere on the page. Locking Policy Calls the lockRecordForWrite() method of the LockingPolicy object passed to the openContainer() call before the record is inserted. MT - latched
insert
{ "repo_name": "lpxz/grail-derby104", "path": "java/engine/org/apache/derby/iapi/store/raw/Page.java", "license": "apache-2.0", "size": 43513 }
[ "org.apache.derby.iapi.error.StandardException", "org.apache.derby.iapi.services.io.FormatableBitSet" ]
import org.apache.derby.iapi.error.StandardException; import org.apache.derby.iapi.services.io.FormatableBitSet;
import org.apache.derby.iapi.error.*; import org.apache.derby.iapi.services.io.*;
[ "org.apache.derby" ]
org.apache.derby;
54,574
void topologyChanged(GraphDescription graphDescription, List<Event> reasons);
void topologyChanged(GraphDescription graphDescription, List<Event> reasons);
/** * Signals the core that some aspect of the topology has changed. * * @param graphDescription information about the network graph * @param reasons events that triggered topology change */
Signals the core that some aspect of the topology has changed
topologyChanged
{ "repo_name": "gkatsikas/onos", "path": "core/api/src/main/java/org/onosproject/net/topology/TopologyProviderService.java", "license": "apache-2.0", "size": 1263 }
[ "java.util.List", "org.onosproject.event.Event" ]
import java.util.List; import org.onosproject.event.Event;
import java.util.*; import org.onosproject.event.*;
[ "java.util", "org.onosproject.event" ]
java.util; org.onosproject.event;
1,989,296
@Test public void testTransformationEvaluatorNode() { Ip ip1 = Ip.parse("1.1.1.1"); Ip ip2 = Ip.parse("2.2.2.2"); Ip ip3 = Ip.parse("3.3.3.3"); NetworkFactory nf = new NetworkFactory(); Configuration.Builder cb = nf.configurationBuilder().setConfigurationFormat(ConfigurationFormat.CISCO...
void function() { Ip ip1 = Ip.parse(STR); Ip ip2 = Ip.parse(STR); Ip ip3 = Ip.parse(STR); NetworkFactory nf = new NetworkFactory(); Configuration.Builder cb = nf.configurationBuilder().setConfigurationFormat(ConfigurationFormat.CISCO_IOS); Configuration c1 = cb.build(); c1.setIpSpaces(ImmutableSortedMap.of("ips", ip1.t...
/** * Test that {@link FlowTracer#eval(Transformation transformation)} evaluates the transformation * using the {@link IpSpace IpSpaces} defined on the current node. */
Test that <code>FlowTracer#eval(Transformation transformation)</code> evaluates the transformation using the <code>IpSpace IpSpaces</code> defined on the current node
testTransformationEvaluatorNode
{ "repo_name": "dhalperi/batfish", "path": "projects/batfish/src/test/java/org/batfish/dataplane/traceroute/FlowTracerTest.java", "license": "apache-2.0", "size": 86014 }
[ "com.google.common.collect.ImmutableMap", "com.google.common.collect.ImmutableSet", "com.google.common.collect.ImmutableSortedMap", "java.util.ArrayList", "org.batfish.datamodel.Configuration", "org.batfish.datamodel.ConfigurationFormat", "org.batfish.datamodel.Flow", "org.batfish.datamodel.Ip", "or...
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSortedMap; import java.util.ArrayList; import org.batfish.datamodel.Configuration; import org.batfish.datamodel.ConfigurationFormat; import org.batfish.datamodel.Flow; import org.batfi...
import com.google.common.collect.*; import java.util.*; import org.batfish.datamodel.*; import org.batfish.datamodel.transformation.*; import org.batfish.dataplane.traceroute.*; import org.hamcrest.*;
[ "com.google.common", "java.util", "org.batfish.datamodel", "org.batfish.dataplane", "org.hamcrest" ]
com.google.common; java.util; org.batfish.datamodel; org.batfish.dataplane; org.hamcrest;
699,669
@VisibleForTesting protected void validateHttpRpcPluginPath(final String path) { Preconditions.checkArgument(!Strings.isNullOrEmpty(path), "Invalid HttpRpcPlugin path. Path is null or empty."); final String testPath = path.trim(); Preconditions.checkArgument(!HAS_PLUGIN_BASE_WEBPATH.matcher(path...
void function(final String path) { Preconditions.checkArgument(!Strings.isNullOrEmpty(path), STR); final String testPath = path.trim(); Preconditions.checkArgument(!HAS_PLUGIN_BASE_WEBPATH.matcher(path).matches(), STR, testPath); URI uri = URI.create(testPath); Preconditions.checkArgument(!Strings.isNullOrEmpty(uri.get...
/** * Ensure that the given path for an {@link HttpRpcPlugin} is valid. This * method simply returns for valid inputs; throws and exception otherwise. * @param path a request path, no query parameters, etc. * @throws IllegalArgumentException on invalid paths. */
Ensure that the given path for an <code>HttpRpcPlugin</code> is valid. This method simply returns for valid inputs; throws and exception otherwise
validateHttpRpcPluginPath
{ "repo_name": "johann8384/opentsdb", "path": "src/tsd/RpcManager.java", "license": "lgpl-2.1", "size": 29017 }
[ "com.google.common.base.Preconditions", "com.google.common.base.Strings", "java.net.URI" ]
import com.google.common.base.Preconditions; import com.google.common.base.Strings; import java.net.URI;
import com.google.common.base.*; import java.net.*;
[ "com.google.common", "java.net" ]
com.google.common; java.net;
53,443
public static String getApplicationVersionFromJar(Class<?> _class, String _default) { try { Enumeration<URL> resources = _class.getClassLoader().getResources("META-INF/MANIFEST.MF"); while (resources.hasMoreElements()) { Manifest manifest = new Manifest(resources.nex...
static String function(Class<?> _class, String _default) { try { Enumeration<URL> resources = _class.getClassLoader().getResources(STR); while (resources.hasMoreElements()) { Manifest manifest = new Manifest(resources.nextElement().openStream()); Attributes attribs = manifest.getMainAttributes(); String ver = attribs.g...
/** * Read the JARs manifest and try to get the current program version from it. * @param _class class to use as entry point * @param _default default string to use if version could not be found * @return version or null */
Read the JARs manifest and try to get the current program version from it
getApplicationVersionFromJar
{ "repo_name": "hypfvieh/java-utils", "path": "src/main/java/com/github/hypfvieh/util/SystemUtil.java", "license": "mit", "size": 18115 }
[ "java.io.IOException", "java.util.Enumeration", "java.util.jar.Attributes", "java.util.jar.Manifest" ]
import java.io.IOException; import java.util.Enumeration; import java.util.jar.Attributes; import java.util.jar.Manifest;
import java.io.*; import java.util.*; import java.util.jar.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,395,042
public void setDateLastAlert (Timestamp DateLastAlert) { set_Value (COLUMNNAME_DateLastAlert, DateLastAlert); }
void function (Timestamp DateLastAlert) { set_Value (COLUMNNAME_DateLastAlert, DateLastAlert); }
/** Set Last Alert. @param DateLastAlert Date when last alert were sent */
Set Last Alert
setDateLastAlert
{ "repo_name": "arthurmelo88/palmetalADP", "path": "adempiere_360/base/src/org/compiere/model/X_AD_WF_Activity.java", "license": "gpl-2.0", "size": 12975 }
[ "java.sql.Timestamp" ]
import java.sql.Timestamp;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,841,400
@Nonnull INamedNode name (@Nonnull String name);
INamedNode name (@Nonnull String name);
/** * Sets the node name. * * @param name The name. * @return The node. */
Sets the node name
name
{ "repo_name": "Torchmind/Candle", "path": "api/src/main/java/com/torchmind/candle/api/INamedNode.java", "license": "apache-2.0", "size": 1208 }
[ "javax.annotation.Nonnull" ]
import javax.annotation.Nonnull;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
1,135,461
@Test(expectedExceptions = OpenGammaRuntimeException.class) public void testWrongUnderlyingSecurityTypeForOnCompoundedRollDateLeg() { final InMemoryConventionSource conventionSource = new InMemoryConventionSource(); // note that the convention refers to the security final ONCompoundedLegRollDateConventi...
@Test(expectedExceptions = OpenGammaRuntimeException.class) void function() { final InMemoryConventionSource conventionSource = new InMemoryConventionSource(); final ONCompoundedLegRollDateConvention onCompoundedLegConvention = new ONCompoundedLegRollDateConvention(STR, ON_COMPOUNDED_LEG_CONVENTION_ID.toBundle(), OVERN...
/** * Tests the behaviour if the convention does not reference an overnight index in an overnight compounded leg convention. */
Tests the behaviour if the convention does not reference an overnight index in an overnight compounded leg convention
testWrongUnderlyingSecurityTypeForOnCompoundedRollDateLeg
{ "repo_name": "McLeodMoores/starling", "path": "projects/financial/src/test/java/com/opengamma/financial/analytics/curve/SwapNodeCurrencyVisitorTest.java", "license": "apache-2.0", "size": 27347 }
[ "com.opengamma.OpenGammaRuntimeException", "com.opengamma.engine.InMemoryConventionSource", "com.opengamma.engine.InMemorySecuritySource", "com.opengamma.financial.analytics.ircurve.strips.SwapNode", "com.opengamma.financial.convention.ONCompoundedLegRollDateConvention", "com.opengamma.financial.conventio...
import com.opengamma.OpenGammaRuntimeException; import com.opengamma.engine.InMemoryConventionSource; import com.opengamma.engine.InMemorySecuritySource; import com.opengamma.financial.analytics.ircurve.strips.SwapNode; import com.opengamma.financial.convention.ONCompoundedLegRollDateConvention; import com.opengamma.fi...
import com.opengamma.*; import com.opengamma.engine.*; import com.opengamma.financial.analytics.ircurve.strips.*; import com.opengamma.financial.convention.*; import com.opengamma.financial.security.index.*; import com.opengamma.util.time.*; import org.testng.annotations.*;
[ "com.opengamma", "com.opengamma.engine", "com.opengamma.financial", "com.opengamma.util", "org.testng.annotations" ]
com.opengamma; com.opengamma.engine; com.opengamma.financial; com.opengamma.util; org.testng.annotations;
1,724,912
private static void publishDeleteMetaData(Identifier identifier1, Identifier identifier2, Document metadata) { String nsPrefix = metadata.getChildNodes().item(0).getPrefix(); String nsUri = metadata.getChildNodes().item(0).getNamespaceURI(); String elementname = metadata.getChildNodes().item(0).getLocalName()...
static void function(Identifier identifier1, Identifier identifier2, Document metadata) { String nsPrefix = metadata.getChildNodes().item(0).getPrefix(); String nsUri = metadata.getChildNodes().item(0).getNamespaceURI(); String elementname = metadata.getChildNodes().item(0).getLocalName(); try { SSRC ssrc = createSSRC(...
/** * * helper Method to publish/delete the metadata * * @param identifier1 * the identifier1 * @param identifier2 * the optional identifier2 must be null if not exist * @param metadata * the metadata xml document * */
helper Method to publish/delete the metadata
publishDeleteMetaData
{ "repo_name": "trustathsh/ifmapcli", "path": "ex-meta/src/main/java/de/hshannover/f4/trust/ifmapcli/ExMeta.java", "license": "apache-2.0", "size": 10446 }
[ "de.hshannover.f4.trust.ifmapj.identifier.Identifier", "de.hshannover.f4.trust.ifmapj.messages.MetadataLifetime", "de.hshannover.f4.trust.ifmapj.messages.PublishDelete", "de.hshannover.f4.trust.ifmapj.messages.PublishRequest", "de.hshannover.f4.trust.ifmapj.messages.PublishUpdate", "de.hshannover.f4.trust...
import de.hshannover.f4.trust.ifmapj.identifier.Identifier; import de.hshannover.f4.trust.ifmapj.messages.MetadataLifetime; import de.hshannover.f4.trust.ifmapj.messages.PublishDelete; import de.hshannover.f4.trust.ifmapj.messages.PublishRequest; import de.hshannover.f4.trust.ifmapj.messages.PublishUpdate; import de.hs...
import de.hshannover.f4.trust.ifmapj.identifier.*; import de.hshannover.f4.trust.ifmapj.messages.*; import org.w3c.dom.*;
[ "de.hshannover.f4", "org.w3c.dom" ]
de.hshannover.f4; org.w3c.dom;
1,549,289
public void setSocket(Socket s) { this.socket = s; this.port = s.getPort(); if (type == ComputerType.client) { this.ipAddress = s.getInetAddress().getHostAddress(); } } public enum ComputerType { client, server } public Computer(ComputerT...
void function(Socket s) { this.socket = s; this.port = s.getPort(); if (type == ComputerType.client) { this.ipAddress = s.getInetAddress().getHostAddress(); } } public enum ComputerType { client, server } public Computer(ComputerType type) { id = Information.getNextComputerId(); this.type = type; }
/** * Gives the connection-check socket to the computer. IP-Address and Port * will be set to 'Computer' automatically. * * @param s The socket to overgive */
Gives the connection-check socket to the computer. IP-Address and Port will be set to 'Computer' automatically
setSocket
{ "repo_name": "Kilian98/UltimateRender", "path": "src/Server/Computer.java", "license": "gpl-3.0", "size": 4086 }
[ "java.net.Socket" ]
import java.net.Socket;
import java.net.*;
[ "java.net" ]
java.net;
480,432
public void onSocialLoginSuccess(String accessToken, String backend, Task task) { //we should handle UI update here. but right now we do nothing in UI }
void function(String accessToken, String backend, Task task) { }
/** * after login by Facebook or Google, the workflow is different from login page. * we need to adjust the register view * 1. first we try to login, * 2. if login return 200, redirect to course screen. * 3. otherwise, go through the normal registration flow. * * @param accessToken ...
after login by Facebook or Google, the workflow is different from login page. we need to adjust the register view 1. first we try to login, 2. if login return 200, redirect to course screen. 3. otherwise, go through the normal registration flow
onSocialLoginSuccess
{ "repo_name": "ahmedaljazzar/edx-app-android", "path": "OpenEdXMobile/src/main/java/org/edx/mobile/view/RegisterActivity.java", "license": "apache-2.0", "size": 23556 }
[ "org.edx.mobile.task.Task" ]
import org.edx.mobile.task.Task;
import org.edx.mobile.task.*;
[ "org.edx.mobile" ]
org.edx.mobile;
131,631
public GroupData getGroupToHandle() { if (groupsOwner == null || groupsOwner.size() == 0) return null; Set<GroupData> groups = groupsOwner.keySet(); Iterator<GroupData> i = groups.iterator(); while (i.hasNext()) { return i.next(); } return null; }
GroupData function() { if (groupsOwner == null groupsOwner.size() == 0) return null; Set<GroupData> groups = groupsOwner.keySet(); Iterator<GroupData> i = groups.iterator(); while (i.hasNext()) { return i.next(); } return null; }
/** * Returns the first group to handle or <code>null</code>. * * @return See above. */
Returns the first group to handle or <code>null</code>
getGroupToHandle
{ "repo_name": "stelfrich/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/env/data/login/UserCredentials.java", "license": "gpl-2.0", "size": 10836 }
[ "java.util.Iterator", "java.util.Set" ]
import java.util.Iterator; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
2,211,963
public boolean areBiomesViable(int x, int z, int radius, List<Biome> allowed) { return allowed.contains(this.biome); }
boolean function(int x, int z, int radius, List<Biome> allowed) { return allowed.contains(this.biome); }
/** * checks given Chunk's Biomes against List of allowed ones */
checks given Chunk's Biomes against List of allowed ones
areBiomesViable
{ "repo_name": "boredherobrine13/morefuelsmod-1.10", "path": "build/tmp/recompileMc/sources/net/minecraft/world/biome/BiomeProviderSingle.java", "license": "lgpl-2.1", "size": 2192 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,083,161
private final void writeObject(final ObjectOutputStream out) throws IOException { throw new IOException("Object cannot be serialized"); }
final void function(final ObjectOutputStream out) throws IOException { throw new IOException(STR); }
/** * We override the <code>writeObject</code> method here to prevent * serialization of our class for security reasons. * * @param out * java.io.ObjectOutputStream * @throws IOException * thrown if a problem occurs */
We override the <code>writeObject</code> method here to prevent serialization of our class for security reasons
writeObject
{ "repo_name": "opennms-forge/poc-nms-core", "path": "core/lib/src/main/java/org/opennms/core/utils/StreamGobbler.java", "license": "gpl-2.0", "size": 6783 }
[ "java.io.IOException", "java.io.ObjectOutputStream" ]
import java.io.IOException; import java.io.ObjectOutputStream;
import java.io.*;
[ "java.io" ]
java.io;
345,260
public void tokenizeAndExpandMakeVars(List<String> tokens, String attributeName, String value) { tokenizeAndExpandMakeVars(tokens, attributeName, value, null); }
void function(List<String> tokens, String attributeName, String value) { tokenizeAndExpandMakeVars(tokens, attributeName, value, null); }
/** * Expands make variables in value and tokenizes the result into tokens. * * <p>This methods should be called only during initialization. */
Expands make variables in value and tokenizes the result into tokens. This methods should be called only during initialization
tokenizeAndExpandMakeVars
{ "repo_name": "wakashige/bazel", "path": "src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java", "license": "apache-2.0", "size": 64410 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,387,748
public void assertMemoryNotLow() { if(config.commandLogging){ Log.d(config.commandLoggingTag, "assertMemoryNotLow()"); } asserter.assertMemoryNotLow(); }
void function() { if(config.commandLogging){ Log.d(config.commandLoggingTag, STR); } asserter.assertMemoryNotLow(); }
/** * Asserts that the available memory is not considered low by the system. */
Asserts that the available memory is not considered low by the system
assertMemoryNotLow
{ "repo_name": "darker50/robotium", "path": "robotium-solo/src/main/java/com/robotium/solo/Solo.java", "license": "apache-2.0", "size": 124742 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
1,972,439
public void init( RuntimeServices rs, InternalContextAdapter context, Node node) throws TemplateInitException { rsvc = rs; String property = getScopeName()+'.'+RuntimeConstants.PROVIDE_SCOPE_CONTROL; this.provideScope = rsvc.getBoolean(property, prov...
void function( RuntimeServices rs, InternalContextAdapter context, Node node) throws TemplateInitException { rsvc = rs; String property = getScopeName()+'.'+RuntimeConstants.PROVIDE_SCOPE_CONTROL; this.provideScope = rsvc.getBoolean(property, provideScope); }
/** * How this directive is to be initialized. * @param rs * @param context * @param node * @throws TemplateInitException */
How this directive is to be initialized
init
{ "repo_name": "1CharlesStern/Web-XMLVerifier", "path": "src/main/java/org/apache/velocity/runtime/directive/Directive.java", "license": "apache-2.0", "size": 6727 }
[ "org.apache.velocity.context.InternalContextAdapter", "org.apache.velocity.exception.TemplateInitException", "org.apache.velocity.runtime.RuntimeConstants", "org.apache.velocity.runtime.RuntimeServices", "org.apache.velocity.runtime.parser.node.Node" ]
import org.apache.velocity.context.InternalContextAdapter; import org.apache.velocity.exception.TemplateInitException; import org.apache.velocity.runtime.RuntimeConstants; import org.apache.velocity.runtime.RuntimeServices; import org.apache.velocity.runtime.parser.node.Node;
import org.apache.velocity.context.*; import org.apache.velocity.exception.*; import org.apache.velocity.runtime.*; import org.apache.velocity.runtime.parser.node.*;
[ "org.apache.velocity" ]
org.apache.velocity;
2,725,184
private String getPigScriptDataType(FieldDescriptor fieldDescriptor) { switch (fieldDescriptor.getType()) { case INT32: case UINT32: case SINT32: case FIXED32: case SFIXED32: case BOOL: // We convert booleans to ints for pig output. return "int"; case INT64: ...
String function(FieldDescriptor fieldDescriptor) { switch (fieldDescriptor.getType()) { case INT32: case UINT32: case SINT32: case FIXED32: case SFIXED32: case BOOL: return "int"; case INT64: case UINT64: case SINT64: case FIXED64: case SFIXED64: return "long"; case FLOAT: return "float"; case DOUBLE: return STR; case ...
/** * Translate between protobuf's datatype representation and Pig's datatype representation. * @param fieldDescriptor the descriptor object for the given field. * @return the byte representing the pig datatype for the given field type. */
Translate between protobuf's datatype representation and Pig's datatype representation
getPigScriptDataType
{ "repo_name": "ketralnis/elephant-bird", "path": "src/java/com/twitter/elephantbird/pig/util/ProtobufToPig.java", "license": "apache-2.0", "size": 22800 }
[ "com.google.protobuf.Descriptors" ]
import com.google.protobuf.Descriptors;
import com.google.protobuf.*;
[ "com.google.protobuf" ]
com.google.protobuf;
1,538,213
protected ProgressMonitorPart getPageProgressMonitor() { ProgressPage installPage = getInstallWizard().getProgressPage(); return installPage.getProgressMonitorPart(); }
ProgressMonitorPart function() { ProgressPage installPage = getInstallWizard().getProgressPage(); return installPage.getProgressMonitorPart(); }
/** * Returns the page progress monitor part to * use for long operations. * * @return Progress monitor part */
Returns the page progress monitor part to use for long operations
getPageProgressMonitor
{ "repo_name": "MentorEmbedded/p2-installer", "path": "plugins/com.codesourcery.installer/src/com/codesourcery/internal/installer/ui/InstallWizardDialog.java", "license": "epl-1.0", "size": 6890 }
[ "com.codesourcery.internal.installer.ui.pages.ProgressPage", "org.eclipse.jface.wizard.ProgressMonitorPart" ]
import com.codesourcery.internal.installer.ui.pages.ProgressPage; import org.eclipse.jface.wizard.ProgressMonitorPart;
import com.codesourcery.internal.installer.ui.pages.*; import org.eclipse.jface.wizard.*;
[ "com.codesourcery.internal", "org.eclipse.jface" ]
com.codesourcery.internal; org.eclipse.jface;
2,549,949
public void addDhtKey( KeyCacheObject key, boolean invalidateEntry, GridCacheContext ctx ) throws IgniteCheckedException { invalidateEntries.set(idx, invalidateEntry); addKeyBytes(key, false, ctx); }
void function( KeyCacheObject key, boolean invalidateEntry, GridCacheContext ctx ) throws IgniteCheckedException { invalidateEntries.set(idx, invalidateEntry); addKeyBytes(key, false, ctx); }
/** * Adds a DHT key. * * @param key Key. * @param invalidateEntry Flag indicating whether node should attempt to invalidate reader. * @param ctx Context. * @throws IgniteCheckedException If failed. */
Adds a DHT key
addDhtKey
{ "repo_name": "pperalta/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java", "license": "apache-2.0", "size": 15454 }
[ "org.apache.ignite.IgniteCheckedException", "org.apache.ignite.internal.processors.cache.GridCacheContext", "org.apache.ignite.internal.processors.cache.KeyCacheObject" ]
import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.internal.processors.cache.GridCacheContext; import org.apache.ignite.internal.processors.cache.KeyCacheObject;
import org.apache.ignite.*; import org.apache.ignite.internal.processors.cache.*;
[ "org.apache.ignite" ]
org.apache.ignite;
2,286,370
public void updateProcessingRate(long currentTime) { double bestMapRate = processingRates.getRate(Phase.MAP); double bestShuffleRate = processingRates.getRate(Phase.SHUFFLE); double bestSortRate = processingRates.getRate(Phase.SORT); double bestReduceRate = processingRates.getRate(Phase.REDUCE); ...
void function(long currentTime) { double bestMapRate = processingRates.getRate(Phase.MAP); double bestShuffleRate = processingRates.getRate(Phase.SHUFFLE); double bestSortRate = processingRates.getRate(Phase.SORT); double bestReduceRate = processingRates.getRate(Phase.REDUCE); for (TaskStatus ts : taskStatuses.values()...
/** * Update the processing rate for this task. (e.g. bytes/ms in reduce phase) * @param currentTime */
Update the processing rate for this task. (e.g. bytes/ms in reduce phase)
updateProcessingRate
{ "repo_name": "rvadali/fb-raid-refactoring", "path": "src/mapred/org/apache/hadoop/mapred/TaskInProgress.java", "license": "apache-2.0", "size": 52366 }
[ "org.apache.hadoop.mapred.TaskStatus" ]
import org.apache.hadoop.mapred.TaskStatus;
import org.apache.hadoop.mapred.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,372,959
public String getRuleResults() { StringBuffer sb = new StringBuffer(); if (GlobalVariables.getUserSession().retrieveObject(getSessionContextKey() + "-rulereferenced") != null) { Map<String, Boolean> ruleResults = (Map<String, Boolean>) GlobalVariables.getUserSession().retrieveObject( ...
String function() { StringBuffer sb = new StringBuffer(); if (GlobalVariables.getUserSession().retrieveObject(getSessionContextKey() + STR) != null) { Map<String, Boolean> ruleResults = (Map<String, Boolean>) GlobalVariables.getUserSession().retrieveObject( getSessionContextKey() + STR); for (String key : ruleResults.k...
/** * * This method is to concate the rule evaluation results (which are referenced by the questionnaire/question * The format is "ruleId:Y", and separate by "," for each rule. This string will be set as hidden field * in page as id = "ruleReferenced" * This method will be called by questionn...
This method is to concate the rule evaluation results (which are referenced by the questionnaire/question The format is "ruleId:Y", and separate by "," for each rule. This string will be set as hidden field in page as id = "ruleReferenced" This method will be called by questionnairehelper
getRuleResults
{ "repo_name": "mukadder/kc", "path": "coeus-impl/src/main/java/org/kuali/coeus/common/questionnaire/framework/answer/ModuleQuestionnaireBean.java", "license": "agpl-3.0", "size": 5851 }
[ "java.util.Map", "org.apache.commons.lang3.StringUtils", "org.kuali.rice.krad.util.GlobalVariables" ]
import java.util.Map; import org.apache.commons.lang3.StringUtils; import org.kuali.rice.krad.util.GlobalVariables;
import java.util.*; import org.apache.commons.lang3.*; import org.kuali.rice.krad.util.*;
[ "java.util", "org.apache.commons", "org.kuali.rice" ]
java.util; org.apache.commons; org.kuali.rice;
1,975,137
public View getZoomControls() { return mControls; }
View function() { return mControls; }
/** * Gets the view for the zoom controls. * * @return The zoom controls view. */
Gets the view for the zoom controls
getZoomControls
{ "repo_name": "mateor/PDroidHistory", "path": "frameworks/base/core/java/android/widget/ZoomButtonsController.java", "license": "gpl-3.0", "size": 25978 }
[ "android.view.View" ]
import android.view.View;
import android.view.*;
[ "android.view" ]
android.view;
914,556
private long getFirstEventId(final File logFile) { final String name = logFile.getName(); final int dotIndex = name.indexOf("."); return Long.parseLong(name.substring(0, dotIndex)); }
long function(final File logFile) { final String name = logFile.getName(); final int dotIndex = name.indexOf("."); return Long.parseLong(name.substring(0, dotIndex)); }
/** * Returns the Event ID of the first event in the given Provenance Event Log * File. * * @param logFile the log file from which to obtain the first Event ID * @return the ID of the first event in the given log file */
Returns the Event ID of the first event in the given Provenance Event Log File
getFirstEventId
{ "repo_name": "Xsixteen/nifi", "path": "nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/PersistentProvenanceRepository.java", "license": "apache-2.0", "size": 126035 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
769,652
private void extractToElementsList(Elements elementList, Elements elementsToExtract) { for (Element element : elementsToExtract) { extractToElementList(elementList, element); } }
void function(Elements elementList, Elements elementsToExtract) { for (Element element : elementsToExtract) { extractToElementList(elementList, element); } }
/** * Removes given elements from body and adds them to the given elements object. * * @param elementList Elements object to add removed elements to * @param elementsToExtract Elements to be removed and added to the elements object */
Removes given elements from body and adds them to the given elements object
extractToElementsList
{ "repo_name": "ihkawiss/JobAnnotations", "path": "library/src/main/java/ch/fhnw/jobannotations/domain/JobOffer.java", "license": "mit", "size": 6443 }
[ "org.jsoup.nodes.Element", "org.jsoup.select.Elements" ]
import org.jsoup.nodes.Element; import org.jsoup.select.Elements;
import org.jsoup.nodes.*; import org.jsoup.select.*;
[ "org.jsoup.nodes", "org.jsoup.select" ]
org.jsoup.nodes; org.jsoup.select;
2,080,329
public HashMap<String, String> generateParameterBindings(String[] actualParameters, GenericDatabase<?,?> db) throws ProbCogException { HashMap<String, String> bindings = new HashMap<String, String>(); // add known bindings from main node for(int i = 0; i < mainNode.params.length; i++) bindings.put(main...
HashMap<String, String> function(String[] actualParameters, GenericDatabase<?,?> db) throws ProbCogException { HashMap<String, String> bindings = new HashMap<String, String>(); for(int i = 0; i < mainNode.params.length; i++) bindings.put(mainNode.params[i], actualParameters[i]); for(FunctionalLookup fl : this.functiona...
/** * generates, for a particular binding of the main node's parameters, the complete binding of all relevant variables (which includes all variables/parameters of parents) using the functional lookups that were determined at construction time * @param actualParameters * @param db * @return * @throws Pr...
generates, for a particular binding of the main node's parameters, the complete binding of all relevant variables (which includes all variables/parameters of parents) using the functional lookups that were determined at construction time
generateParameterBindings
{ "repo_name": "opcode81/ProbCog", "path": "src/main/java/probcog/srl/directed/ParentGrounder.java", "license": "gpl-3.0", "size": 14166 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
2,575,110
public static byte[] toByteArray(Reader input, String encoding) throws IOException { return toByteArray(input, Charsets.toCharset(encoding)); } /** * Get the contents of a <code>String</code> as a <code>byte[]</code> * using the default character encoding of the platform. * <p> ...
static byte[] function(Reader input, String encoding) throws IOException { return toByteArray(input, Charsets.toCharset(encoding)); } /** * Get the contents of a <code>String</code> as a <code>byte[]</code> * using the default character encoding of the platform. * <p> * This is the same as {@link String#getBytes()}. * ...
/** * Get the contents of a <code>Reader</code> as a <code>byte[]</code> * using the specified character encoding. * <p> * Character encoding names can be found at * <a href="http://www.iana.org/assignments/character-sets">IANA</a>. * <p> * This method buffers the input internally, so...
Get the contents of a <code>Reader</code> as a <code>byte[]</code> using the specified character encoding. Character encoding names can be found at IANA. This method buffers the input internally, so there is no need to use a <code>BufferedReader</code>
toByteArray
{ "repo_name": "wspeirs/sop4j-base", "path": "src/main/java/com/sop4j/base/apache/io/IOUtils.java", "license": "apache-2.0", "size": 97933 }
[ "java.io.IOException", "java.io.Reader" ]
import java.io.IOException; import java.io.Reader;
import java.io.*;
[ "java.io" ]
java.io;
186,587
public void workflowNewException(final PlatformException e) { } // // Other methods //
void function(final PlatformException e) { } //
/** * Throws an execption to a listener. * @param e Exception to throw. */
Throws an execption to a listener
workflowNewException
{ "repo_name": "GenomicParisCentre/doelan", "path": "src/main/java/fr/ens/transcriptome/doelan/gui/QualityTestSuiteTableModel.java", "license": "gpl-2.0", "size": 8230 }
[ "fr.ens.transcriptome.nividic.platform.PlatformException" ]
import fr.ens.transcriptome.nividic.platform.PlatformException;
import fr.ens.transcriptome.nividic.platform.*;
[ "fr.ens.transcriptome" ]
fr.ens.transcriptome;
2,189,414
public static double getHighestSamplePercentage (MapWork work) { double highestSamplePercentage = 0; for (String alias : work.getAliasToWork().keySet()) { if (work.getNameToSplitSample().containsKey(alias)) { Double rate = work.getNameToSplitSample().get(alias).getPercent(); if (rate != ...
static double function (MapWork work) { double highestSamplePercentage = 0; for (String alias : work.getAliasToWork().keySet()) { if (work.getNameToSplitSample().containsKey(alias)) { Double rate = work.getNameToSplitSample().get(alias).getPercent(); if (rate != null && rate > highestSamplePercentage) { highestSamplePe...
/** * Returns the highest sample percentage of any alias in the given MapWork */
Returns the highest sample percentage of any alias in the given MapWork
getHighestSamplePercentage
{ "repo_name": "wisgood/hive", "path": "ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java", "license": "apache-2.0", "size": 136381 }
[ "org.apache.hadoop.hive.ql.plan.MapWork" ]
import org.apache.hadoop.hive.ql.plan.MapWork;
import org.apache.hadoop.hive.ql.plan.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
257,466
public static void logPrincipalVariation(Move move) { ArrayList<Move> principalVariation = brain.getPrincipalVariation(board, move); ArrayList<String> movesAlgebraic = new ArrayList<String>(); for (Move pvMove : principalVariation) { movesAlgebraic.add(AlgebraicNotation.moveToAlgebraic(board, pvMove...
static void function(Move move) { ArrayList<Move> principalVariation = brain.getPrincipalVariation(board, move); ArrayList<String> movesAlgebraic = new ArrayList<String>(); for (Move pvMove : principalVariation) { movesAlgebraic.add(AlgebraicNotation.moveToAlgebraic(board, pvMove)); board.move(pvMove); } log(STR + move...
/** * Logs the principal variation of a given move. * * @param move the move from where the principal variation begins */
Logs the principal variation of a given move
logPrincipalVariation
{ "repo_name": "philleski/chess-engine", "path": "src/tactician/Tactician.java", "license": "mit", "size": 4883 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
632,036
public void setAccountingPeriodService(AccountingPeriodService accountingPeriodService) { this.accountingPeriodService = accountingPeriodService; }
void function(AccountingPeriodService accountingPeriodService) { this.accountingPeriodService = accountingPeriodService; }
/** * Sets the accountingPeriodService attribute value. * * @param accountingPeriodService The accountingPeriodService to set. */
Sets the accountingPeriodService attribute value
setAccountingPeriodService
{ "repo_name": "quikkian-ua-devops/will-financials", "path": "kfs-core/src/main/java/org/kuali/kfs/fp/document/validation/impl/AuxiliaryVoucherAccountingPeriodOpenValidation.java", "license": "agpl-3.0", "size": 3769 }
[ "org.kuali.kfs.coa.service.AccountingPeriodService" ]
import org.kuali.kfs.coa.service.AccountingPeriodService;
import org.kuali.kfs.coa.service.*;
[ "org.kuali.kfs" ]
org.kuali.kfs;
76,771
public static IntValuedEnum<RTresult> rtContextGetExceptionProgram(RTcontext context, int entry_point_index, Pointer<RTprogram> program) { return FlagSet.fromValue(rtContextGetExceptionProgram(Pointer.getPeer(context), entry_point_index, Pointer.getPeer(program)), RTresult.class); }
static IntValuedEnum<RTresult> function(RTcontext context, int entry_point_index, Pointer<RTprogram> program) { return FlagSet.fromValue(rtContextGetExceptionProgram(Pointer.getPeer(context), entry_point_index, Pointer.getPeer(program)), RTresult.class); }
/** * Original signature : <code>RTresult rtContextGetExceptionProgram(RTcontext, unsigned int, RTprogram*)</code><br> * <i>native declaration : include\optix_host.h:1855</i> */
Original signature : <code>RTresult rtContextGetExceptionProgram(RTcontext, unsigned int, RTprogram*)</code> native declaration : include\optix_host.h:1855
rtContextGetExceptionProgram
{ "repo_name": "fetox74/optix-wrapper", "path": "src/main/java/com/fetoxdevelopments/optix/api/RT.java", "license": "mit", "size": 162970 }
[ "com.fetoxdevelopments.optix.api.enumeration.RTresult", "com.fetoxdevelopments.optix.api.struct.RTcontext", "com.fetoxdevelopments.optix.api.struct.RTprogram", "org.bridj.FlagSet", "org.bridj.IntValuedEnum", "org.bridj.Pointer" ]
import com.fetoxdevelopments.optix.api.enumeration.RTresult; import com.fetoxdevelopments.optix.api.struct.RTcontext; import com.fetoxdevelopments.optix.api.struct.RTprogram; import org.bridj.FlagSet; import org.bridj.IntValuedEnum; import org.bridj.Pointer;
import com.fetoxdevelopments.optix.api.enumeration.*; import com.fetoxdevelopments.optix.api.struct.*; import org.bridj.*;
[ "com.fetoxdevelopments.optix", "org.bridj" ]
com.fetoxdevelopments.optix; org.bridj;
861,106
public void addTags(Connection c, String value) throws BadServerResponse, XenAPIException, XmlRpcException { String method_call = "VDI.add_tags"; String session = c.getSessionReference(); Object[] method_params = { Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value...
void function(Connection c, String value) throws BadServerResponse, XenAPIException, XmlRpcException { String method_call = STR; String session = c.getSessionReference(); Object[] method_params = { Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value) }; Map response = c.dispatch(me...
/** * Add the given value to the tags field of the given VDI. If the value is * already in that Set, then do nothing. * * @param value * New value to add */
Add the given value to the tags field of the given VDI. If the value is already in that Set, then do nothing
addTags
{ "repo_name": "Hearen/OnceServer", "path": "pool_management/bn-xend-core/src/main/java/com/beyondsphere/xenapi/VDI.java", "license": "mit", "size": 85046 }
[ "com.beyondsphere.xenapi.Types", "java.util.Map", "org.apache.xmlrpc.XmlRpcException" ]
import com.beyondsphere.xenapi.Types; import java.util.Map; import org.apache.xmlrpc.XmlRpcException;
import com.beyondsphere.xenapi.*; import java.util.*; import org.apache.xmlrpc.*;
[ "com.beyondsphere.xenapi", "java.util", "org.apache.xmlrpc" ]
com.beyondsphere.xenapi; java.util; org.apache.xmlrpc;
945,460
public void findPossibleIntersections(final List<Body> output, final Body body, final float dt) { final BoundingBox box = computeBounds(body, dt); final Intersection i = computeTableIntersection(box); if (i.isValid) { for (int y = i.y0; y <= i.y1; y++) { ...
void function(final List<Body> output, final Body body, final float dt) { final BoundingBox box = computeBounds(body, dt); final Intersection i = computeTableIntersection(box); if (i.isValid) { for (int y = i.y0; y <= i.y1; y++) { for (int x = i.x0; x <= i.x1; x++) { final ArrayList<Body> currentBucket = getBucketAt(x,...
/** * Finds possible intersections for a body from the table. * @param output list to add the candidates to * @param body body to test * @param dt change in time */
Finds possible intersections for a body from the table
findPossibleIntersections
{ "repo_name": "caniblossom/PolyBounce", "path": "PolyBounce/src/main/java/com/github/caniblossom/polybounce/physics/SpatialTable.java", "license": "bsd-3-clause", "size": 8762 }
[ "com.github.caniblossom.polybounce.math.BoundingBox", "com.github.caniblossom.polybounce.physics.body.Body", "java.util.ArrayList", "java.util.List" ]
import com.github.caniblossom.polybounce.math.BoundingBox; import com.github.caniblossom.polybounce.physics.body.Body; import java.util.ArrayList; import java.util.List;
import com.github.caniblossom.polybounce.math.*; import com.github.caniblossom.polybounce.physics.body.*; import java.util.*;
[ "com.github.caniblossom", "java.util" ]
com.github.caniblossom; java.util;
2,594,648
private boolean testPhpInjection(String paramName) { for (String phpPayload : PHP_PAYLOADS) { HttpMessage msg = getNewMsg(); setParameter(msg, paramName, phpPayload); if (log.isDebugEnabled()) { log.debug("Testing [" + paramName + "] = [" + phpPayload + "...
boolean function(String paramName) { for (String phpPayload : PHP_PAYLOADS) { HttpMessage msg = getNewMsg(); setParameter(msg, paramName, phpPayload); if (log.isDebugEnabled()) { log.debug(STR + paramName + STR + phpPayload + "]"); } try { try { sendAndReceive(msg, false); } catch (SocketException ex) { if (log.isDebug...
/** * Tests for injection vulnerabilities in PHP code. * * @param paramName the name of the parameter will be used for testing for injection * @return {@code true} if the vulnerability was found, {@code false} otherwise. * @see #PHP_PAYLOADS */
Tests for injection vulnerabilities in PHP code
testPhpInjection
{ "repo_name": "pedroo21/ZAP-Multi-Scan-Rules", "path": "CodeInjectionPlugin.java", "license": "mit", "size": 12915 }
[ "java.io.IOException", "java.net.SocketException", "org.parosproxy.paros.Constant", "org.parosproxy.paros.core.scanner.Alert", "org.parosproxy.paros.network.HttpMessage" ]
import java.io.IOException; import java.net.SocketException; import org.parosproxy.paros.Constant; import org.parosproxy.paros.core.scanner.Alert; import org.parosproxy.paros.network.HttpMessage;
import java.io.*; import java.net.*; import org.parosproxy.paros.*; import org.parosproxy.paros.core.scanner.*; import org.parosproxy.paros.network.*;
[ "java.io", "java.net", "org.parosproxy.paros" ]
java.io; java.net; org.parosproxy.paros;
778,378
@Test(expected = IllegalArgumentException.class) public void test_update_accountNull() throws Exception { instance.update(null); }
@Test(expected = IllegalArgumentException.class) void function() throws Exception { instance.update(null); }
/** * <p> * Failure test for the method <code>update(Account account)</code> with account is null.<br> * <code>IllegalArgumentException</code> is expected. * </p> * * @throws Exception * to JUnit. */
Failure test for the method <code>update(Account account)</code> with account is null. <code>IllegalArgumentException</code> is expected.
test_update_accountNull
{ "repo_name": "NASA-Tournament-Lab/CoECI-OPM-Service-Credit-Redeposit-Deposit-Application", "path": "Code/Data_Migration/src/java/tests/gov/opm/scrd/services/impl/AccountServiceImplUnitTests.java", "license": "apache-2.0", "size": 64228 }
[ "org.junit.Test" ]
import org.junit.Test;
import org.junit.*;
[ "org.junit" ]
org.junit;
1,463,446
public List<? extends IPAddress> getDnsServers();
List<? extends IPAddress> function();
/** * Returns the DNS servers associated with this DhcpServerConfig that will be passed to DHCP clients * * @return a {@link List } of IPAddresses that represent the DNS servers */
Returns the DNS servers associated with this DhcpServerConfig that will be passed to DHCP clients
getDnsServers
{ "repo_name": "ctron/kura", "path": "kura/org.eclipse.kura.api/src/main/java/org/eclipse/kura/net/dhcp/DhcpServerConfig.java", "license": "epl-1.0", "size": 3668 }
[ "java.util.List", "org.eclipse.kura.net.IPAddress" ]
import java.util.List; import org.eclipse.kura.net.IPAddress;
import java.util.*; import org.eclipse.kura.net.*;
[ "java.util", "org.eclipse.kura" ]
java.util; org.eclipse.kura;
2,760,812
public final ColorModel getColorModel( final int visibleBand, final int numBands, final int type) { return ColorModelFactory.getColorModel(categories, type, visibleBand, numBands); }
final ColorModel function( final int visibleBand, final int numBands, final int type) { return ColorModelFactory.getColorModel(categories, type, visibleBand, numBands); }
/** * Returns a color model for this category list. This method builds up the color model from each * category's colors (as returned by {@link Category#getColors}). * * @param visibleBand The band to be made visible (usually 0). All other bands, if any will be * ignored. * @param numBa...
Returns a color model for this category list. This method builds up the color model from each category's colors (as returned by <code>Category#getColors</code>)
getColorModel
{ "repo_name": "geotools/geotools", "path": "modules/library/coverage/src/main/java/org/geotools/coverage/CategoryList.java", "license": "lgpl-2.1", "size": 32378 }
[ "java.awt.image.ColorModel" ]
import java.awt.image.ColorModel;
import java.awt.image.*;
[ "java.awt" ]
java.awt;
2,600,617
@Test public void linearSolve2() { NumericExpression x3 = universe.power(x, 3); NumericExpression y7 = universe.power(y, 7); BooleanExpression assumption = universe.and( universe.equals(universe.add(x3, y7), three), universe.equals(universe.subtract(x3, y7), two)); SymbolicExpression newAssumption =...
void function() { NumericExpression x3 = universe.power(x, 3); NumericExpression y7 = universe.power(y, 7); BooleanExpression assumption = universe.and( universe.equals(universe.add(x3, y7), three), universe.equals(universe.subtract(x3, y7), two)); SymbolicExpression newAssumption = universe.and( universe.equals(x3, un...
/** * X^3+Y^7=3 && X^3-Y^7=2 : X^3->5/2, Y^7->1/2 * * This requires linearizePolynomials to be true. */
X^3+Y^7=3 && X^3-Y^7=2 : X^3->5/2, Y^7->1/2 This requires linearizePolynomials to be true
linearSolve2
{ "repo_name": "byu-vv-lab/sarl", "path": "test/edu/udel/cis/vsl/sarl/universe/IdealSimplifyTest.java", "license": "gpl-3.0", "size": 9446 }
[ "edu.udel.cis.vsl.sarl.IF", "org.junit.Assert" ]
import edu.udel.cis.vsl.sarl.IF; import org.junit.Assert;
import edu.udel.cis.vsl.sarl.*; import org.junit.*;
[ "edu.udel.cis", "org.junit" ]
edu.udel.cis; org.junit;
771,186
public Attachment() {} } ArrayList<Attachment> attachments=null; public ArrayList<Attachment> getAttachments() { return this.attachments; }
public Attachment() {} } ArrayList<Attachment> attachments=null; public ArrayList<Attachment> getAttachments() { return this.attachments; }
/** * set the file data of the attachment. This is called internally to set the contents according to of the MIME response. * @param attachmentData */
set the file data of the attachment. This is called internally to set the contents according to of the MIME response
setAttachmentData
{ "repo_name": "OneAPI/GSMA-OneAPI", "path": "oneapi/src/org/gsm/oneapi/responsebean/mms/RetrieveMMSMessageResponse.java", "license": "lgpl-3.0", "size": 5955 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
1,041,402
public ConcurrentMap<String, Object> getGlobals() { return GlobalScope.getInstance().getAttributes(); }
ConcurrentMap<String, Object> function() { return GlobalScope.getInstance().getAttributes(); }
/** * A map of all values global to the current VM. * * @return The globals */
A map of all values global to the current VM
getGlobals
{ "repo_name": "tliron/scripturian", "path": "components/scripturian/source/com/threecrickets/scripturian/service/ExecutableService.java", "license": "lgpl-3.0", "size": 3841 }
[ "com.threecrickets.scripturian.GlobalScope", "java.util.concurrent.ConcurrentMap" ]
import com.threecrickets.scripturian.GlobalScope; import java.util.concurrent.ConcurrentMap;
import com.threecrickets.scripturian.*; import java.util.concurrent.*;
[ "com.threecrickets.scripturian", "java.util" ]
com.threecrickets.scripturian; java.util;
651,883
@Test public void testSubsetSynchronized() { final AbstractConfiguration subset = (AbstractConfiguration) config.subset("configuration"); sync.verify(); assertEquals("Wrong synchronizer for subset", NoOpSynchronizer.INSTANCE, subset.getSynchronizer()); }
void function() { final AbstractConfiguration subset = (AbstractConfiguration) config.subset(STR); sync.verify(); assertEquals(STR, NoOpSynchronizer.INSTANCE, subset.getSynchronizer()); }
/** * Tests synchronization of subset(). */
Tests synchronization of subset()
testSubsetSynchronized
{ "repo_name": "apache/commons-configuration", "path": "src/test/java/org/apache/commons/configuration2/TestAbstractConfigurationSynchronization.java", "license": "apache-2.0", "size": 7556 }
[ "org.apache.commons.configuration2.sync.NoOpSynchronizer", "org.junit.Assert" ]
import org.apache.commons.configuration2.sync.NoOpSynchronizer; import org.junit.Assert;
import org.apache.commons.configuration2.sync.*; import org.junit.*;
[ "org.apache.commons", "org.junit" ]
org.apache.commons; org.junit;
2,910,890