method
stringlengths 13
441k
| clean_method
stringlengths 7
313k
| doc
stringlengths 17
17.3k
| comment
stringlengths 3
1.42k
| method_name
stringlengths 1
273
| extra
dict | imports
list | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
list | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
|---|---|---|---|---|---|---|---|---|---|---|---|
public static int[] scriptsOf(CharSequence cs) {
Set s = new HashSet();
for (int i = 0, n = cs.length(); i < n; i++) {
s.add(Integer.valueOf(scriptOf(cs.charAt(i))));
}
int[] sa = new int [ s.size() ];
int ns = 0;
for (Iterator it = s.iterator(); it.hasNext();) {
sa [ ns++ ] = ((Integer) it.next()) .intValue();
}
Arrays.sort(sa);
return sa;
}
|
static int[] function(CharSequence cs) { Set s = new HashSet(); for (int i = 0, n = cs.length(); i < n; i++) { s.add(Integer.valueOf(scriptOf(cs.charAt(i)))); } int[] sa = new int [ s.size() ]; int ns = 0; for (Iterator it = s.iterator(); it.hasNext();) { sa [ ns++ ] = ((Integer) it.next()) .intValue(); } Arrays.sort(sa); return sa; }
|
/**
* Obtain the script codes of each character in a character sequence. If script
* is not or cannot be determined for some character, then the script code 998
* ('zyyy') is returned.
* @param cs the character sequence
* @return a (possibly empty) array of script codes
*/
|
Obtain the script codes of each character in a character sequence. If script is not or cannot be determined for some character, then the script code 998 ('zyyy') is returned
|
scriptsOf
|
{
"repo_name": "StrategyObject/fop",
"path": "src/java/org/apache/fop/complexscripts/util/CharScript.java",
"license": "apache-2.0",
"size": 35578
}
|
[
"java.util.Arrays",
"java.util.HashSet",
"java.util.Iterator",
"java.util.Set"
] |
import java.util.Arrays; import java.util.HashSet; import java.util.Iterator; import java.util.Set;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 282,440
|
public static void writePretty( Document bson,
Writer writer ) throws IOException {
getPrettyWriter().write(bson, writer);
}
|
static void function( Document bson, Writer writer ) throws IOException { getPrettyWriter().write(bson, writer); }
|
/**
* Write to the supplied writer the modified JSON representation of the supplied in-memory {@link Document}. The resulting
* JSON will be indented for each name/value pair and each array value.
* <p>
* This format is very readable by people and software, but is less compact due to the extra whitespace.
* </p>
*
* @param bson the BSON object or BSON value; may not be null
* @param writer the writer; may not be null
* @throws IOException if there was a problem reading from the stream
*/
|
Write to the supplied writer the modified JSON representation of the supplied in-memory <code>Document</code>. The resulting JSON will be indented for each name/value pair and each array value. This format is very readable by people and software, but is less compact due to the extra whitespace.
|
writePretty
|
{
"repo_name": "weebl2000/modeshape",
"path": "modeshape-schematic/src/main/java/org/modeshape/schematic/document/Json.java",
"license": "apache-2.0",
"size": 16660
}
|
[
"java.io.IOException",
"java.io.Writer"
] |
import java.io.IOException; import java.io.Writer;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 677,331
|
@SuppressWarnings("unchecked")
private int errorCode(IgniteCheckedException e, boolean checkIo) {
if (X.hasCause(e, IgfsPathNotFoundException.class))
return ERR_FILE_NOT_FOUND;
else if (e.hasCause(IgfsPathAlreadyExistsException.class))
return ERR_PATH_ALREADY_EXISTS;
else if (e.hasCause(IgfsDirectoryNotEmptyException.class))
return ERR_DIRECTORY_NOT_EMPTY;
else if (e.hasCause(IgfsParentNotDirectoryException.class))
return ERR_PARENT_NOT_DIRECTORY;
else if (e.hasCause(IgfsInvalidHdfsVersionException.class))
return ERR_INVALID_HDFS_VERSION;
else if (e.hasCause(IgfsCorruptedFileException.class))
return ERR_CORRUPTED_FILE;
// This check should be the last.
else if (e.hasCause(IgfsException.class))
return ERR_IGFS_GENERIC;
return ERR_GENERIC;
}
|
@SuppressWarnings(STR) int function(IgniteCheckedException e, boolean checkIo) { if (X.hasCause(e, IgfsPathNotFoundException.class)) return ERR_FILE_NOT_FOUND; else if (e.hasCause(IgfsPathAlreadyExistsException.class)) return ERR_PATH_ALREADY_EXISTS; else if (e.hasCause(IgfsDirectoryNotEmptyException.class)) return ERR_DIRECTORY_NOT_EMPTY; else if (e.hasCause(IgfsParentNotDirectoryException.class)) return ERR_PARENT_NOT_DIRECTORY; else if (e.hasCause(IgfsInvalidHdfsVersionException.class)) return ERR_INVALID_HDFS_VERSION; else if (e.hasCause(IgfsCorruptedFileException.class)) return ERR_CORRUPTED_FILE; else if (e.hasCause(IgfsException.class)) return ERR_IGFS_GENERIC; return ERR_GENERIC; }
|
/**
* Gets error code based on exception class.
*
* @param e Exception to analyze.
* @param checkIo Whether to check for IO exception.
* @return Error code.
*/
|
Gets error code based on exception class
|
errorCode
|
{
"repo_name": "nivanov/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/igfs/common/IgfsControlResponse.java",
"license": "apache-2.0",
"size": 17385
}
|
[
"org.apache.ignite.IgniteCheckedException",
"org.apache.ignite.igfs.IgfsCorruptedFileException",
"org.apache.ignite.igfs.IgfsDirectoryNotEmptyException",
"org.apache.ignite.igfs.IgfsException",
"org.apache.ignite.igfs.IgfsInvalidHdfsVersionException",
"org.apache.ignite.igfs.IgfsParentNotDirectoryException",
"org.apache.ignite.igfs.IgfsPathAlreadyExistsException",
"org.apache.ignite.igfs.IgfsPathNotFoundException",
"org.apache.ignite.internal.util.typedef.X"
] |
import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.igfs.IgfsCorruptedFileException; import org.apache.ignite.igfs.IgfsDirectoryNotEmptyException; import org.apache.ignite.igfs.IgfsException; import org.apache.ignite.igfs.IgfsInvalidHdfsVersionException; import org.apache.ignite.igfs.IgfsParentNotDirectoryException; import org.apache.ignite.igfs.IgfsPathAlreadyExistsException; import org.apache.ignite.igfs.IgfsPathNotFoundException; import org.apache.ignite.internal.util.typedef.X;
|
import org.apache.ignite.*; import org.apache.ignite.igfs.*; import org.apache.ignite.internal.util.typedef.*;
|
[
"org.apache.ignite"
] |
org.apache.ignite;
| 1,471,894
|
public void generate(Chunk c) {
throw new NotImplementedException();
}
|
void function(Chunk c) { throw new NotImplementedException(); }
|
/**
* Apply the generation process to the given chunk.
*
* @param c The chunk to generate/populate
*/
|
Apply the generation process to the given chunk
|
generate
|
{
"repo_name": "rapodaca/Terasology",
"path": "src/org/terasology/logic/generators/ChunkGenerator.java",
"license": "apache-2.0",
"size": 2422
}
|
[
"org.terasology.logic.world.Chunk"
] |
import org.terasology.logic.world.Chunk;
|
import org.terasology.logic.world.*;
|
[
"org.terasology.logic"
] |
org.terasology.logic;
| 1,459
|
@ApiModelProperty(example = "null", value = "published boolean")
public Boolean getPublished() {
return published;
}
|
@ApiModelProperty(example = "null", value = STR) Boolean function() { return published; }
|
/**
* published boolean
*
* @return published
**/
|
published boolean
|
getPublished
|
{
"repo_name": "GoldenGnu/eve-esi",
"path": "src/main/java/net/troja/eve/esi/model/DogmaAttributeResponse.java",
"license": "apache-2.0",
"size": 8478
}
|
[
"io.swagger.annotations.ApiModelProperty"
] |
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.*;
|
[
"io.swagger.annotations"
] |
io.swagger.annotations;
| 503,053
|
protected void doLog(Logger logger, Exception e) {
if (logLevel == null) {
logger.debug(e.getMessage(), e);
return;
}
if ("trace".equalsIgnoreCase(logLevel)) {
logger.trace(e.getMessage(), e);
} else if ("debug".equalsIgnoreCase(logLevel)) {
logger.debug(e.getMessage(), e);
} else if ("info".equalsIgnoreCase(logLevel)) {
logger.info(e.getMessage(), e);
} else if ("warn".equalsIgnoreCase(logLevel)) {
logger.warn(e.getMessage(), e);
} else if ("error".equalsIgnoreCase(logLevel)) {
logger.error(e.getMessage(), e);
} else if ("fatal".equalsIgnoreCase(logLevel)) {
logger.fatal(e.getMessage(), e);
} else {
throw new IllegalArgumentException("LogLevel [" + logLevel + "] is not supported");
}
}
|
void function(Logger logger, Exception e) { if (logLevel == null) { logger.debug(e.getMessage(), e); return; } if ("trace".equalsIgnoreCase(logLevel)) { logger.trace(e.getMessage(), e); } else if ("debug".equalsIgnoreCase(logLevel)) { logger.debug(e.getMessage(), e); } else if ("info".equalsIgnoreCase(logLevel)) { logger.info(e.getMessage(), e); } else if ("warn".equalsIgnoreCase(logLevel)) { logger.warn(e.getMessage(), e); } else if ("error".equalsIgnoreCase(logLevel)) { logger.error(e.getMessage(), e); } else if ("fatal".equalsIgnoreCase(logLevel)) { logger.fatal(e.getMessage(), e); } else { throw new IllegalArgumentException(STR + logLevel + STR); } }
|
/**
* Performs the actual logging.
*
* @param logger the provided logger to use.
* @param e the exception to log.
*/
|
Performs the actual logging
|
doLog
|
{
"repo_name": "Ile2/struts2-showcase-demo",
"path": "src/core/src/main/java/com/opensymphony/xwork2/interceptor/ExceptionMappingInterceptor.java",
"license": "apache-2.0",
"size": 12278
}
|
[
"org.apache.logging.log4j.Logger"
] |
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.*;
|
[
"org.apache.logging"
] |
org.apache.logging;
| 1,567,678
|
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<
PollResult<ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner>,
ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner>
beginListRoutesTableSummary(
String resourceGroupName,
String crossConnectionName,
String peeringName,
String devicePath,
Context context);
|
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller< PollResult<ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner>, ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner> beginListRoutesTableSummary( String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context);
|
/**
* Gets the route table summary associated with the express route cross connection in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of the route table summary associated with the express route cross
* connection in a resource group.
*/
|
Gets the route table summary associated with the express route cross connection in a resource group
|
beginListRoutesTableSummary
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ExpressRouteCrossConnectionsClient.java",
"license": "mit",
"size": 44449
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.management.polling.PollResult",
"com.azure.core.util.Context",
"com.azure.core.util.polling.SyncPoller",
"com.azure.resourcemanager.network.fluent.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.network.fluent.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner;
|
import com.azure.core.annotation.*; import com.azure.core.management.polling.*; import com.azure.core.util.*; import com.azure.core.util.polling.*; import com.azure.resourcemanager.network.fluent.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 1,994,185
|
public void updateMasters(List<Long> masters, Map<Integer, Long> partitionMasters)
{
m_initiatorHSIds.clear();
m_initiatorHSIds.addAll(masters);
((MpTransactionState)getTransactionState()).updateMasters(masters, partitionMasters);
}
|
void function(List<Long> masters, Map<Integer, Long> partitionMasters) { m_initiatorHSIds.clear(); m_initiatorHSIds.addAll(masters); ((MpTransactionState)getTransactionState()).updateMasters(masters, partitionMasters); }
|
/**
* Update the list of partition masters in the event of a failure/promotion.
* Currently only thread-"safe" by virtue of only calling this on
* MpProcedureTasks which are not at the head of the MPI's TransactionTaskQueue.
*/
|
Update the list of partition masters in the event of a failure/promotion. Currently only thread-"safe" by virtue of only calling this on MpProcedureTasks which are not at the head of the MPI's TransactionTaskQueue
|
updateMasters
|
{
"repo_name": "creative-quant/voltdb",
"path": "src/frontend/org/voltdb/iv2/MpProcedureTask.java",
"license": "agpl-3.0",
"size": 10974
}
|
[
"java.util.List",
"java.util.Map"
] |
import java.util.List; import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,348,108
|
private void addDisappearingView(View v) {
ArrayList<View> disappearingChildren = mDisappearingChildren;
if (disappearingChildren == null) {
disappearingChildren = mDisappearingChildren = new ArrayList<View>();
}
disappearingChildren.add(v);
}
|
void function(View v) { ArrayList<View> disappearingChildren = mDisappearingChildren; if (disappearingChildren == null) { disappearingChildren = mDisappearingChildren = new ArrayList<View>(); } disappearingChildren.add(v); }
|
/**
* Add a view which is removed from mChildren but still needs animation
*
* @param v View to add
*/
|
Add a view which is removed from mChildren but still needs animation
|
addDisappearingView
|
{
"repo_name": "s20121035/rk3288_android5.1_repo",
"path": "frameworks/base/core/java/android/view/ViewGroup.java",
"license": "gpl-3.0",
"size": 275692
}
|
[
"java.util.ArrayList"
] |
import java.util.ArrayList;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 729,377
|
public ItemStack getCrushingResult(ItemStack itemstack)
{
Iterator iterator = this.smeltingList.entrySet().iterator();
Entry entry;
do
{
if (!iterator.hasNext())
{
return null;
}
entry = (Entry)iterator.next();
}
while (!this.areItemStacksEqual(itemstack, (ItemStack)entry.getKey()));
return (ItemStack)entry.getValue();
}
|
ItemStack function(ItemStack itemstack) { Iterator iterator = this.smeltingList.entrySet().iterator(); Entry entry; do { if (!iterator.hasNext()) { return null; } entry = (Entry)iterator.next(); } while (!this.areItemStacksEqual(itemstack, (ItemStack)entry.getKey())); return (ItemStack)entry.getValue(); }
|
/**
* Returns the smelting result of an item.
*/
|
Returns the smelting result of an item
|
getCrushingResult
|
{
"repo_name": "Raspen0/Materia",
"path": "src/main/java/nl/raspen0/Materia/recipes/CrusherRecipes.java",
"license": "gpl-3.0",
"size": 4098
}
|
[
"java.util.Iterator",
"java.util.Map",
"net.minecraft.item.ItemStack"
] |
import java.util.Iterator; import java.util.Map; import net.minecraft.item.ItemStack;
|
import java.util.*; import net.minecraft.item.*;
|
[
"java.util",
"net.minecraft.item"
] |
java.util; net.minecraft.item;
| 2,869,428
|
protected void createContextMenuFor(StructuredViewer viewer) {
MenuManager contextMenu = new MenuManager("#PopUp");
contextMenu.add(new Separator("additions"));
contextMenu.setRemoveAllWhenShown(true);
contextMenu.addMenuListener(this);
Menu menu= contextMenu.createContextMenu(viewer.getControl());
viewer.getControl().setMenu(menu);
getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer));
int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance() };
viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
}
|
void function(StructuredViewer viewer) { MenuManager contextMenu = new MenuManager(STR); contextMenu.add(new Separator(STR)); contextMenu.setRemoveAllWhenShown(true); contextMenu.addMenuListener(this); Menu menu= contextMenu.createContextMenu(viewer.getControl()); viewer.getControl().setMenu(menu); getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer)); int dndOperations = DND.DROP_COPY DND.DROP_MOVE DND.DROP_LINK; Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance() }; viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer)); viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer)); }
|
/**
* This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
|
This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
|
createContextMenuFor
|
{
"repo_name": "markus1978/citygml4emf",
"path": "de.hub.citygml.emf.ecore.editor/src/net/opengis/citygml/waterbody/presentation/WaterbodyEditor.java",
"license": "apache-2.0",
"size": 56468
}
|
[
"org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter",
"org.eclipse.emf.edit.ui.dnd.LocalTransfer",
"org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter",
"org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider",
"org.eclipse.jface.action.MenuManager",
"org.eclipse.jface.action.Separator",
"org.eclipse.jface.viewers.StructuredViewer",
"org.eclipse.swt.dnd.Transfer",
"org.eclipse.swt.widgets.Menu"
] |
import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter; import org.eclipse.emf.edit.ui.dnd.LocalTransfer; import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter; import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider; import org.eclipse.jface.action.MenuManager; import org.eclipse.jface.action.Separator; import org.eclipse.jface.viewers.StructuredViewer; import org.eclipse.swt.dnd.Transfer; import org.eclipse.swt.widgets.Menu;
|
import org.eclipse.emf.edit.ui.dnd.*; import org.eclipse.emf.edit.ui.provider.*; import org.eclipse.jface.action.*; import org.eclipse.jface.viewers.*; import org.eclipse.swt.dnd.*; import org.eclipse.swt.widgets.*;
|
[
"org.eclipse.emf",
"org.eclipse.jface",
"org.eclipse.swt"
] |
org.eclipse.emf; org.eclipse.jface; org.eclipse.swt;
| 716,327
|
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String workspaceName) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (workspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.delete(
this.client.getEndpoint(),
resourceGroupName,
workspaceName,
this.client.getApiVersion(),
this.client.getSubscriptionId(),
accept,
context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
|
@ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<Flux<ByteBuffer>>> function(String resourceGroupName, String workspaceName) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (workspaceName == null) { return Mono.error(new IllegalArgumentException(STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( STR)); } final String accept = STR; return FluxUtil .withContext( context -> service .delete( this.client.getEndpoint(), resourceGroupName, workspaceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); }
|
/**
* Deletes a Workspace.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the completion.
*/
|
Deletes a Workspace
|
deleteWithResponseAsync
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/batchai/azure-resourcemanager-batchai/src/main/java/com/azure/resourcemanager/batchai/implementation/WorkspacesClientImpl.java",
"license": "mit",
"size": 77030
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.core.util.FluxUtil",
"java.nio.ByteBuffer"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.FluxUtil; import java.nio.ByteBuffer;
|
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import java.nio.*;
|
[
"com.azure.core",
"java.nio"
] |
com.azure.core; java.nio;
| 1,404,201
|
public void set(int index, String value) throws IOException {
Writer writer = null;
try {
writer = new OutputStreamWriter(newOutputStream(index), UTF_8);
writer.write(value);
} finally {
closeQuietly(writer);
}
}
|
void function(int index, String value) throws IOException { Writer writer = null; try { writer = new OutputStreamWriter(newOutputStream(index), UTF_8); writer.write(value); } finally { closeQuietly(writer); } }
|
/**
* Sets the value at {@code index} to {@code value}.
*/
|
Sets the value at index to value
|
set
|
{
"repo_name": "richardchien/fusion-cache-android",
"path": "library/src/main/java/im/r_c/android/fusioncache/DiskLruCache.java",
"license": "mit",
"size": 34085
}
|
[
"java.io.IOException",
"java.io.OutputStreamWriter",
"java.io.Writer"
] |
import java.io.IOException; import java.io.OutputStreamWriter; import java.io.Writer;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 703,573
|
return Arrays.asList(safeSplitString(VM_OPTIONS));
}
|
return Arrays.asList(safeSplitString(VM_OPTIONS)); }
|
/**
* Returns the list of VM options.
*
* @return List of VM options
*/
|
Returns the list of VM options
|
getVmOptions
|
{
"repo_name": "koutheir/incinerator-hotspot",
"path": "jdk/test/lib/testlibrary/jdk/testlibrary/Utils.java",
"license": "gpl-2.0",
"size": 9037
}
|
[
"java.util.Arrays"
] |
import java.util.Arrays;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 675,464
|
public final void populateViewportLocked(DisplayViewport viewport) {
viewport.orientation = mCurrentOrientation;
if (mCurrentLayerStackRect != null) {
viewport.logicalFrame.set(mCurrentLayerStackRect);
} else {
viewport.logicalFrame.setEmpty();
}
if (mCurrentDisplayRect != null) {
viewport.physicalFrame.set(mCurrentDisplayRect);
} else {
viewport.physicalFrame.setEmpty();
}
boolean isRotated = (mCurrentOrientation == Surface.ROTATION_90
|| mCurrentOrientation == Surface.ROTATION_270);
DisplayDeviceInfo info = getDisplayDeviceInfoLocked();
viewport.deviceWidth = isRotated ? info.height : info.width;
viewport.deviceHeight = isRotated ? info.width : info.height;
}
|
final void function(DisplayViewport viewport) { viewport.orientation = mCurrentOrientation; if (mCurrentLayerStackRect != null) { viewport.logicalFrame.set(mCurrentLayerStackRect); } else { viewport.logicalFrame.setEmpty(); } if (mCurrentDisplayRect != null) { viewport.physicalFrame.set(mCurrentDisplayRect); } else { viewport.physicalFrame.setEmpty(); } boolean isRotated = (mCurrentOrientation == Surface.ROTATION_90 mCurrentOrientation == Surface.ROTATION_270); DisplayDeviceInfo info = getDisplayDeviceInfoLocked(); viewport.deviceWidth = isRotated ? info.height : info.width; viewport.deviceHeight = isRotated ? info.width : info.height; }
|
/**
* Populates the specified viewport object with orientation,
* physical and logical rects based on the display's current projection.
*/
|
Populates the specified viewport object with orientation, physical and logical rects based on the display's current projection
|
populateViewportLocked
|
{
"repo_name": "syslover33/ctank",
"path": "java/android-sdk-linux_r24.4.1_src/sources/android-23/com/android/server/display/DisplayDevice.java",
"license": "gpl-3.0",
"size": 8336
}
|
[
"android.hardware.display.DisplayViewport",
"android.view.Surface"
] |
import android.hardware.display.DisplayViewport; import android.view.Surface;
|
import android.hardware.display.*; import android.view.*;
|
[
"android.hardware",
"android.view"
] |
android.hardware; android.view;
| 523,087
|
@Override
public Iterator<T> iterator() {
return (flux != null)
? flux.toIterable(DEFAULT_BATCH_SIZE).iterator()
: iterable.iterator();
}
|
Iterator<T> function() { return (flux != null) ? flux.toIterable(DEFAULT_BATCH_SIZE).iterator() : iterable.iterator(); }
|
/**
* Utility function to provide {@link Iterator} of value {@code T}.
*
* @return {@link Iterator} of value {@code T}.
*/
|
Utility function to provide <code>Iterator</code> of value T
|
iterator
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/core/azure-core/src/main/java/com/azure/core/util/IterableStream.java",
"license": "mit",
"size": 5417
}
|
[
"java.util.Iterator"
] |
import java.util.Iterator;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 752,755
|
private void goTo(Uri dir) {
new LoadingDialog<Uri, String, Bundle>(getActivity(), false) {
String errMsg = null;
|
void function(Uri dir) { new LoadingDialog<Uri, String, Bundle>(getActivity(), false) { String errMsg = null;
|
/**
* Goes to a specified location.
*
* @param dir
* a directory, of course.
* @since v4.3 beta
*/
|
Goes to a specified location
|
goTo
|
{
"repo_name": "red13dotnet/keepass2android",
"path": "src/java/android-filechooser/code/src/group/pals/android/lib/ui/filechooser/FragmentFiles.java",
"license": "gpl-3.0",
"size": 90560
}
|
[
"android.net.Uri",
"android.os.Bundle",
"group.pals.android.lib.ui.filechooser.utils.ui.LoadingDialog"
] |
import android.net.Uri; import android.os.Bundle; import group.pals.android.lib.ui.filechooser.utils.ui.LoadingDialog;
|
import android.net.*; import android.os.*; import group.pals.android.lib.ui.filechooser.utils.ui.*;
|
[
"android.net",
"android.os",
"group.pals.android"
] |
android.net; android.os; group.pals.android;
| 701,776
|
@SuppressWarnings("deprecation")
@Nullable private ClientConnectorConfiguration prepareConfiguration(IgniteConfiguration cfg)
throws IgniteCheckedException {
OdbcConfiguration odbcCfg = cfg.getOdbcConfiguration();
SqlConnectorConfiguration sqlConnCfg = cfg.getSqlConnectorConfiguration();
ClientConnectorConfiguration cliConnCfg = cfg.getClientConnectorConfiguration();
if (cliConnCfg == null && sqlConnCfg == null && odbcCfg == null)
return null;
if (isNotDefault(cliConnCfg)) {
// User set configuration explicitly. User it, but print a warning about ignored SQL/ODBC configs.
if (odbcCfg != null) {
U.warn(log, "Deprecated " + OdbcConfiguration.class.getSimpleName() + " will be ignored because " +
ClientConnectorConfiguration.class.getSimpleName() + " is set.");
}
if (sqlConnCfg != null) {
U.warn(log, "Deprecated " + SqlConnectorConfiguration.class.getSimpleName() + " will be ignored " +
"because " + ClientConnectorConfiguration.class.getSimpleName() + " is set.");
}
}
else {
cliConnCfg = new ClientConnectorConfiguration();
if (sqlConnCfg != null) {
// Migrate from SQL configuration.
cliConnCfg.setHost(sqlConnCfg.getHost());
cliConnCfg.setMaxOpenCursorsPerConnection(sqlConnCfg.getMaxOpenCursorsPerConnection());
cliConnCfg.setPort(sqlConnCfg.getPort());
cliConnCfg.setPortRange(sqlConnCfg.getPortRange());
cliConnCfg.setSocketSendBufferSize(sqlConnCfg.getSocketSendBufferSize());
cliConnCfg.setSocketReceiveBufferSize(sqlConnCfg.getSocketReceiveBufferSize());
cliConnCfg.setTcpNoDelay(sqlConnCfg.isTcpNoDelay());
cliConnCfg.setThreadPoolSize(sqlConnCfg.getThreadPoolSize());
U.warn(log, "Automatically converted deprecated " + SqlConnectorConfiguration.class.getSimpleName() +
" to " + ClientConnectorConfiguration.class.getSimpleName() + ".");
if (odbcCfg != null) {
U.warn(log, "Deprecated " + OdbcConfiguration.class.getSimpleName() + " will be ignored because " +
SqlConnectorConfiguration.class.getSimpleName() + " is set.");
}
}
else if (odbcCfg != null) {
// Migrate from ODBC configuration.
HostAndPortRange hostAndPort = parseOdbcEndpoint(odbcCfg);
cliConnCfg.setHost(hostAndPort.host());
cliConnCfg.setPort(hostAndPort.portFrom());
cliConnCfg.setPortRange(hostAndPort.portTo() - hostAndPort.portFrom());
cliConnCfg.setThreadPoolSize(odbcCfg.getThreadPoolSize());
cliConnCfg.setSocketSendBufferSize(odbcCfg.getSocketSendBufferSize());
cliConnCfg.setSocketReceiveBufferSize(odbcCfg.getSocketReceiveBufferSize());
cliConnCfg.setMaxOpenCursorsPerConnection(odbcCfg.getMaxOpenCursors());
U.warn(log, "Automatically converted deprecated " + OdbcConfiguration.class.getSimpleName() +
" to " + ClientConnectorConfiguration.class.getSimpleName() + ".");
}
}
return cliConnCfg;
}
|
@SuppressWarnings(STR) @Nullable ClientConnectorConfiguration function(IgniteConfiguration cfg) throws IgniteCheckedException { OdbcConfiguration odbcCfg = cfg.getOdbcConfiguration(); SqlConnectorConfiguration sqlConnCfg = cfg.getSqlConnectorConfiguration(); ClientConnectorConfiguration cliConnCfg = cfg.getClientConnectorConfiguration(); if (cliConnCfg == null && sqlConnCfg == null && odbcCfg == null) return null; if (isNotDefault(cliConnCfg)) { if (odbcCfg != null) { U.warn(log, STR + OdbcConfiguration.class.getSimpleName() + STR + ClientConnectorConfiguration.class.getSimpleName() + STR); } if (sqlConnCfg != null) { U.warn(log, STR + SqlConnectorConfiguration.class.getSimpleName() + STR + STR + ClientConnectorConfiguration.class.getSimpleName() + STR); } } else { cliConnCfg = new ClientConnectorConfiguration(); if (sqlConnCfg != null) { cliConnCfg.setHost(sqlConnCfg.getHost()); cliConnCfg.setMaxOpenCursorsPerConnection(sqlConnCfg.getMaxOpenCursorsPerConnection()); cliConnCfg.setPort(sqlConnCfg.getPort()); cliConnCfg.setPortRange(sqlConnCfg.getPortRange()); cliConnCfg.setSocketSendBufferSize(sqlConnCfg.getSocketSendBufferSize()); cliConnCfg.setSocketReceiveBufferSize(sqlConnCfg.getSocketReceiveBufferSize()); cliConnCfg.setTcpNoDelay(sqlConnCfg.isTcpNoDelay()); cliConnCfg.setThreadPoolSize(sqlConnCfg.getThreadPoolSize()); U.warn(log, STR + SqlConnectorConfiguration.class.getSimpleName() + STR + ClientConnectorConfiguration.class.getSimpleName() + "."); if (odbcCfg != null) { U.warn(log, STR + OdbcConfiguration.class.getSimpleName() + STR + SqlConnectorConfiguration.class.getSimpleName() + STR); } } else if (odbcCfg != null) { HostAndPortRange hostAndPort = parseOdbcEndpoint(odbcCfg); cliConnCfg.setHost(hostAndPort.host()); cliConnCfg.setPort(hostAndPort.portFrom()); cliConnCfg.setPortRange(hostAndPort.portTo() - hostAndPort.portFrom()); cliConnCfg.setThreadPoolSize(odbcCfg.getThreadPoolSize()); cliConnCfg.setSocketSendBufferSize(odbcCfg.getSocketSendBufferSize()); cliConnCfg.setSocketReceiveBufferSize(odbcCfg.getSocketReceiveBufferSize()); cliConnCfg.setMaxOpenCursorsPerConnection(odbcCfg.getMaxOpenCursors()); U.warn(log, STR + OdbcConfiguration.class.getSimpleName() + STR + ClientConnectorConfiguration.class.getSimpleName() + "."); } } return cliConnCfg; }
|
/**
* Prepare connector configuration.
*
* @param cfg Ignite configuration.
* @return Connector configuration.
* @throws IgniteCheckedException If failed.
*/
|
Prepare connector configuration
|
prepareConfiguration
|
{
"repo_name": "ptupitsyn/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/ClientListenerProcessor.java",
"license": "apache-2.0",
"size": 22980
}
|
[
"org.apache.ignite.IgniteCheckedException",
"org.apache.ignite.configuration.ClientConnectorConfiguration",
"org.apache.ignite.configuration.IgniteConfiguration",
"org.apache.ignite.configuration.OdbcConfiguration",
"org.apache.ignite.configuration.SqlConnectorConfiguration",
"org.apache.ignite.internal.util.HostAndPortRange",
"org.apache.ignite.internal.util.typedef.internal.U",
"org.jetbrains.annotations.Nullable"
] |
import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.configuration.ClientConnectorConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.configuration.OdbcConfiguration; import org.apache.ignite.configuration.SqlConnectorConfiguration; import org.apache.ignite.internal.util.HostAndPortRange; import org.apache.ignite.internal.util.typedef.internal.U; import org.jetbrains.annotations.Nullable;
|
import org.apache.ignite.*; import org.apache.ignite.configuration.*; import org.apache.ignite.internal.util.*; import org.apache.ignite.internal.util.typedef.internal.*; import org.jetbrains.annotations.*;
|
[
"org.apache.ignite",
"org.jetbrains.annotations"
] |
org.apache.ignite; org.jetbrains.annotations;
| 995,170
|
@JsonProperty("html")
public void setHTMLPaths(Collection<String> htmlPatchPaths) {
this.htmlPaths = htmlPatchPaths;
}
|
@JsonProperty("html") void function(Collection<String> htmlPatchPaths) { this.htmlPaths = htmlPatchPaths; }
|
/**
* Sets the paths to all HTML patch resources within the extension. These
* paths are defined within the manifest by the "html" property as an array
* of strings, where each string is a path relative to the root of the
* extension .jar.
*
* @param htmlPatchPaths
* A collection of paths to all HTML patch resources within the
* extension.
*/
|
Sets the paths to all HTML patch resources within the extension. These paths are defined within the manifest by the "html" property as an array of strings, where each string is a path relative to the root of the extension .jar
|
setHTMLPaths
|
{
"repo_name": "glyptodon/guacamole-client",
"path": "guacamole/src/main/java/org/apache/guacamole/extension/ExtensionManifest.java",
"license": "apache-2.0",
"size": 14512
}
|
[
"com.fasterxml.jackson.annotation.JsonProperty",
"java.util.Collection"
] |
import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Collection;
|
import com.fasterxml.jackson.annotation.*; import java.util.*;
|
[
"com.fasterxml.jackson",
"java.util"
] |
com.fasterxml.jackson; java.util;
| 593,390
|
protected Message[] receiveMessages(BigInteger numMessages, BigInteger visibilityTimeout, List<String> attributes)
throws SQSException {
Map<String, String> params = new HashMap<String, String>();
if (numMessages != null) {
params.put("MaxNumberOfMessages", numMessages.toString());
}
if (visibilityTimeout != null) {
params.put("VisibilityTimeout", visibilityTimeout.toString());
}
if (attributes != null) {
int i=1;
for (String attr : attributes) {
params.put("AttributeName."+i, attr);
i++;
}
}
HttpGet method = new HttpGet();
ReceiveMessageResponse response =
makeRequestInt(method, "ReceiveMessage", params, ReceiveMessageResponse.class);
if (response.getReceiveMessageResult().getMessages() == null) {
return new Message[0];
}
else {
ArrayList<Message> msgs = new ArrayList();
for (com.xerox.amazonws.typica.sqs2.jaxb.Message msg : response.getReceiveMessageResult().getMessages()) {
String decodedMsg = enableEncoding?
new String(Base64.decodeBase64(msg.getBody().getBytes())):
msg.getBody();
Message newMsg = new Message(msg.getMessageId(), msg.getReceiptHandle(), decodedMsg, msg.getMD5OfBody());
for (Attribute attr : msg.getAttributes()) {
newMsg.setAttribute(attr.getName(), attr.getValue());
}
msgs.add(newMsg);
}
return msgs.toArray(new Message [msgs.size()]);
}
}
|
Message[] function(BigInteger numMessages, BigInteger visibilityTimeout, List<String> attributes) throws SQSException { Map<String, String> params = new HashMap<String, String>(); if (numMessages != null) { params.put(STR, numMessages.toString()); } if (visibilityTimeout != null) { params.put(STR, visibilityTimeout.toString()); } if (attributes != null) { int i=1; for (String attr : attributes) { params.put(STR+i, attr); i++; } } HttpGet method = new HttpGet(); ReceiveMessageResponse response = makeRequestInt(method, STR, params, ReceiveMessageResponse.class); if (response.getReceiveMessageResult().getMessages() == null) { return new Message[0]; } else { ArrayList<Message> msgs = new ArrayList(); for (com.xerox.amazonws.typica.sqs2.jaxb.Message msg : response.getReceiveMessageResult().getMessages()) { String decodedMsg = enableEncoding? new String(Base64.decodeBase64(msg.getBody().getBytes())): msg.getBody(); Message newMsg = new Message(msg.getMessageId(), msg.getReceiptHandle(), decodedMsg, msg.getMD5OfBody()); for (Attribute attr : msg.getAttributes()) { newMsg.setAttribute(attr.getName(), attr.getValue()); } msgs.add(newMsg); } return msgs.toArray(new Message [msgs.size()]); } }
|
/**
* Internal implementation of receiveMessages.
*
* @param numMessages the maximum number of messages to return
* @param visibilityTimeout the duration (in seconds) the retrieved message is hidden from
* subsequent calls to retrieve.
* @param attributes the attributes you'd like to get (SenderId, SentTimestamp)
* @return an array of message objects
* @throws SQSException wraps checked exceptions
*/
|
Internal implementation of receiveMessages
|
receiveMessages
|
{
"repo_name": "jonnyzzz/maragogype",
"path": "tags/v1.7/java/com/xerox/amazonws/sqs2/MessageQueue.java",
"license": "apache-2.0",
"size": 18519
}
|
[
"com.xerox.amazonws.typica.sqs2.jaxb.Attribute",
"com.xerox.amazonws.typica.sqs2.jaxb.ReceiveMessageResponse",
"java.math.BigInteger",
"java.util.ArrayList",
"java.util.HashMap",
"java.util.List",
"java.util.Map",
"org.apache.commons.codec.binary.Base64",
"org.apache.http.client.methods.HttpGet"
] |
import com.xerox.amazonws.typica.sqs2.jaxb.Attribute; import com.xerox.amazonws.typica.sqs2.jaxb.ReceiveMessageResponse; import java.math.BigInteger; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.commons.codec.binary.Base64; import org.apache.http.client.methods.HttpGet;
|
import com.xerox.amazonws.typica.sqs2.jaxb.*; import java.math.*; import java.util.*; import org.apache.commons.codec.binary.*; import org.apache.http.client.methods.*;
|
[
"com.xerox.amazonws",
"java.math",
"java.util",
"org.apache.commons",
"org.apache.http"
] |
com.xerox.amazonws; java.math; java.util; org.apache.commons; org.apache.http;
| 2,610,275
|
public final void close(String closeReason) {
Objects.requireNonNull(closeReason);
SessionCloseListener[] listeners;
synchronized (this) {
if (this.closeReason != null)
return; // nothing to do -- already closed
this.closeReason = closeReason;
listeners = this.listeners.toArray(new SessionCloseListener[this.listeners.size()]);
}
try {
closeImpl(closeReason);
} catch (Throwable t) {
Logging.getLogging(getClass()).error("Unexpected error in closeImpl()", t);
}
for (SessionCloseListener listener : listeners)
try {
listener.close(this, closeReason);
} catch (Throwable t) {
Logging.getLogging(getClass()).error("Failed to notify session listener", t);
}
}
protected void closeImpl(String closeReason) {}
|
final void function(String closeReason) { Objects.requireNonNull(closeReason); SessionCloseListener[] listeners; synchronized (this) { if (this.closeReason != null) return; this.closeReason = closeReason; listeners = this.listeners.toArray(new SessionCloseListener[this.listeners.size()]); } try { closeImpl(closeReason); } catch (Throwable t) { Logging.getLogging(getClass()).error(STR, t); } for (SessionCloseListener listener : listeners) try { listener.close(this, closeReason); } catch (Throwable t) { Logging.getLogging(getClass()).error(STR, t); } } void functionImpl(String closeReason) {}
|
/**
* Close this session for this closeReason.
* @param closeReason the closing reason.
*/
|
Close this session for this closeReason
|
close
|
{
"repo_name": "Devexperts/QD",
"path": "auth/src/main/java/com/devexperts/auth/AuthSession.java",
"license": "mpl-2.0",
"size": 3588
}
|
[
"com.devexperts.logging.Logging",
"java.util.Objects"
] |
import com.devexperts.logging.Logging; import java.util.Objects;
|
import com.devexperts.logging.*; import java.util.*;
|
[
"com.devexperts.logging",
"java.util"
] |
com.devexperts.logging; java.util;
| 466,757
|
public static Registry createRegistryOnEphemeralPort() throws RemoteException {
return LocateRegistry.createRegistry(0);
}
|
static Registry function() throws RemoteException { return LocateRegistry.createRegistry(0); }
|
/**
* Creates an RMI {@link Registry} on an ephemeral port.
*
* @returns an RMI Registry
* @throws RemoteException if there was a problem creating a Registry.
*/
|
Creates an RMI <code>Registry</code> on an ephemeral port
|
createRegistryOnEphemeralPort
|
{
"repo_name": "FauxFaux/jdk9-jdk",
"path": "test/java/rmi/testlibrary/TestLibrary.java",
"license": "gpl-2.0",
"size": 20319
}
|
[
"java.rmi.RemoteException",
"java.rmi.registry.LocateRegistry",
"java.rmi.registry.Registry"
] |
import java.rmi.RemoteException; import java.rmi.registry.LocateRegistry; import java.rmi.registry.Registry;
|
import java.rmi.*; import java.rmi.registry.*;
|
[
"java.rmi"
] |
java.rmi;
| 359,205
|
public boolean relateContent(Contentlet contentlet, Relationship rel,List<Contentlet> related, User user, boolean respectFrontendRoles);
|
boolean function(Contentlet contentlet, Relationship rel,List<Contentlet> related, User user, boolean respectFrontendRoles);
|
/**
* Associates the given list of contentlets using the relationship this
* methods removes old associated content and reset the relatioships based
* on the list of content passed as parameter
* @param contentlet
* @param rel
* @param related
* @param user
* @param respectFrontendRoles
*/
|
Associates the given list of contentlets using the relationship this methods removes old associated content and reset the relatioships based on the list of content passed as parameter
|
relateContent
|
{
"repo_name": "dotCMS/core-2.x",
"path": "src/com/dotmarketing/portlets/contentlet/business/ContentletAPIPreHook.java",
"license": "gpl-3.0",
"size": 46499
}
|
[
"com.dotmarketing.portlets.contentlet.model.Contentlet",
"com.dotmarketing.portlets.structure.model.Relationship",
"com.liferay.portal.model.User",
"java.util.List"
] |
import com.dotmarketing.portlets.contentlet.model.Contentlet; import com.dotmarketing.portlets.structure.model.Relationship; import com.liferay.portal.model.User; import java.util.List;
|
import com.dotmarketing.portlets.contentlet.model.*; import com.dotmarketing.portlets.structure.model.*; import com.liferay.portal.model.*; import java.util.*;
|
[
"com.dotmarketing.portlets",
"com.liferay.portal",
"java.util"
] |
com.dotmarketing.portlets; com.liferay.portal; java.util;
| 956,883
|
public RegisterSpecList subset(BitSet exclusionSet) {
int newSize = size() - exclusionSet.cardinality();
if (newSize == 0) {
return EMPTY;
}
RegisterSpecList result = new RegisterSpecList(newSize);
int newIndex = 0;
for (int oldIndex = 0; oldIndex < size(); oldIndex++) {
if (!exclusionSet.get(oldIndex)) {
result.set0(newIndex, get0(oldIndex));
newIndex++;
}
}
if (isImmutable()) {
result.setImmutable();
}
return result;
}
|
RegisterSpecList function(BitSet exclusionSet) { int newSize = size() - exclusionSet.cardinality(); if (newSize == 0) { return EMPTY; } RegisterSpecList result = new RegisterSpecList(newSize); int newIndex = 0; for (int oldIndex = 0; oldIndex < size(); oldIndex++) { if (!exclusionSet.get(oldIndex)) { result.set0(newIndex, get0(oldIndex)); newIndex++; } } if (isImmutable()) { result.setImmutable(); } return result; }
|
/**
* Returns a new instance, which contains a subset of the elements
* specified by the given BitSet. Indexes in the BitSet with a zero
* are included, while indexes with a one are excluded. Mutability
* of the result is inherited from the original.
*
* @param exclusionSet {@code non-null;} set of registers to exclude
* @return {@code non-null;} an appropriately-constructed instance
*/
|
Returns a new instance, which contains a subset of the elements specified by the given BitSet. Indexes in the BitSet with a zero are included, while indexes with a one are excluded. Mutability of the result is inherited from the original
|
subset
|
{
"repo_name": "saleeh93/buck-cutom",
"path": "third-party/java/dx-from-kitkat/src/com/android/dx/rop/code/RegisterSpecList.java",
"license": "apache-2.0",
"size": 12209
}
|
[
"java.util.BitSet"
] |
import java.util.BitSet;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 135,020
|
@Schema(description = "")
public Uifs getUifs() {
return uifs;
}
|
@Schema(description = "") Uifs function() { return uifs; }
|
/**
* Get uifs
* @return uifs
**/
|
Get uifs
|
getUifs
|
{
"repo_name": "iterate-ch/cyberduck",
"path": "eue/src/main/java/ch/cyberduck/core/eue/io/swagger/client/model/ResourceCreationResponseEntryEntityConflicting.java",
"license": "gpl-3.0",
"size": 2175
}
|
[
"ch.cyberduck.core.eue.io.swagger.client.model.Uifs",
"io.swagger.v3.oas.annotations.media.Schema"
] |
import ch.cyberduck.core.eue.io.swagger.client.model.Uifs; import io.swagger.v3.oas.annotations.media.Schema;
|
import ch.cyberduck.core.eue.io.swagger.client.model.*; import io.swagger.v3.oas.annotations.media.*;
|
[
"ch.cyberduck.core",
"io.swagger.v3"
] |
ch.cyberduck.core; io.swagger.v3;
| 2,807,708
|
private void loadMethods() {
if (!mBoMethodsLoaded) {
try {
mOnPauseMethod = WebView.class.getMethod("onPause");
mOnResumeMethod = WebView.class.getMethod("onResume");
} catch (SecurityException e) {
Log.e("CustomWebView", "loadMethods(): " + e.getMessage());
mOnPauseMethod = null;
mOnResumeMethod = null;
} catch (NoSuchMethodException e) {
Log.e("CustomWebView", "loadMethods(): " + e.getMessage());
mOnPauseMethod = null;
mOnResumeMethod = null;
}
try {
mSetFindIsUp = WebView.class.getMethod("setFindIsUp", Boolean.TYPE);
mNotifyFindDialogDismissed = WebView.class.getMethod("notifyFindDialogDismissed");
} catch (SecurityException e) {
Log.e("CustomWebView", "loadMethods(): " + e.getMessage());
mSetFindIsUp = null;
mNotifyFindDialogDismissed = null;
} catch (NoSuchMethodException e) {
Log.e("CustomWebView", "loadMethods(): " + e.getMessage());
mSetFindIsUp = null;
mNotifyFindDialogDismissed = null;
}
mBoMethodsLoaded = true;
}
}
|
void function() { if (!mBoMethodsLoaded) { try { mOnPauseMethod = WebView.class.getMethod(STR); mOnResumeMethod = WebView.class.getMethod(STR); } catch (SecurityException e) { Log.e(STR, STR + e.getMessage()); mOnPauseMethod = null; mOnResumeMethod = null; } catch (NoSuchMethodException e) { Log.e(STR, STR + e.getMessage()); mOnPauseMethod = null; mOnResumeMethod = null; } try { mSetFindIsUp = WebView.class.getMethod(STR, Boolean.TYPE); mNotifyFindDialogDismissed = WebView.class.getMethod(STR); } catch (SecurityException e) { Log.e(STR, STR + e.getMessage()); mSetFindIsUp = null; mNotifyFindDialogDismissed = null; } catch (NoSuchMethodException e) { Log.e(STR, STR + e.getMessage()); mSetFindIsUp = null; mNotifyFindDialogDismissed = null; } mBoMethodsLoaded = true; } }
|
/**
* Load static reflected methods.
*/
|
Load static reflected methods
|
loadMethods
|
{
"repo_name": "patdzzjc/zirco-browser",
"path": "src/org/zirco/ui/components/CustomWebView.java",
"license": "gpl-3.0",
"size": 10525
}
|
[
"android.util.Log",
"android.webkit.WebView"
] |
import android.util.Log; import android.webkit.WebView;
|
import android.util.*; import android.webkit.*;
|
[
"android.util",
"android.webkit"
] |
android.util; android.webkit;
| 336,277
|
public static String join(Iterator iterator, String separator) {
// handle null, zero and one elements before building a buffer
if (iterator == null) {
return null;
}
if (!iterator.hasNext()) {
return EMPTY;
}
Object first = iterator.next();
if (!iterator.hasNext()) {
return ObjectUtils.toString(first);
}
// two or more elements
StringBuffer buf = new StringBuffer(256); // Java default is 16,
// probably too small
if (first != null) {
buf.append(first);
}
while (iterator.hasNext()) {
if (separator != null) {
buf.append(separator);
}
Object obj = iterator.next();
if (obj != null) {
buf.append(obj);
}
}
return buf.toString();
}
|
static String function(Iterator iterator, String separator) { if (iterator == null) { return null; } if (!iterator.hasNext()) { return EMPTY; } Object first = iterator.next(); if (!iterator.hasNext()) { return ObjectUtils.toString(first); } StringBuffer buf = new StringBuffer(256); if (first != null) { buf.append(first); } while (iterator.hasNext()) { if (separator != null) { buf.append(separator); } Object obj = iterator.next(); if (obj != null) { buf.append(obj); } } return buf.toString(); }
|
/**
* <p>
* Joins the elements of the provided <code>Iterator</code> into a single
* String containing the provided elements.
* </p>
*
* <p>
* No delimiter is added before or after the list. A <code>null</code>
* separator is the same as an empty String ("").
* </p>
*
* <p>
* See the examples here: {@link #join(Object[],String)}.
* </p>
*
* @param iterator
* the <code>Iterator</code> of values to join together, may be
* null
* @param separator
* the separator character to use, null treated as ""
* @return the joined String, <code>null</code> if null iterator input
*/
|
Joins the elements of the provided <code>Iterator</code> into a single String containing the provided elements. No delimiter is added before or after the list. A <code>null</code> separator is the same as an empty String (""). See the examples here: <code>#join(Object[],String)</code>.
|
join
|
{
"repo_name": "mjoyner-vbservices-net/CherokeeDictionary",
"path": "src/main/java/commons/lang3/StringUtils.java",
"license": "lgpl-2.1",
"size": 238495
}
|
[
"java.util.Iterator"
] |
import java.util.Iterator;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 571,576
|
public void testStringSort() throws IOException, ParseException {
r = newRandom();
ScoreDoc[] result = null;
IndexSearcher searcher = getFullStrings();
sort.setSort(new SortField[] {
new SortField("string", SortField.STRING),
new SortField("string2", SortField.STRING, true),
SortField.FIELD_DOC });
result = searcher.search(new MatchAllDocsQuery(), null, 500, sort).scoreDocs;
StringBuffer buff = new StringBuffer();
int n = result.length;
String last = null;
String lastSub = null;
int lastDocId = 0;
boolean fail = false;
for (int x = 0; x < n; ++x) {
Document doc2 = searcher.doc(result[x].doc);
String[] v = doc2.getValues("tracer");
String[] v2 = doc2.getValues("tracer2");
for (int j = 0; j < v.length; ++j) {
if (last != null) {
int cmp = v[j].compareTo(last);
if (!(cmp >= 0)) { // ensure first field is in order
fail = true;
System.out.println("fail:" + v[j] + " < " + last);
}
if (cmp == 0) { // ensure second field is in reverse order
cmp = v2[j].compareTo(lastSub);
if (cmp > 0) {
fail = true;
System.out.println("rev field fail:" + v2[j] + " > " + lastSub);
} else if(cmp == 0) { // ensure docid is in order
if (result[x].doc < lastDocId) {
fail = true;
System.out.println("doc fail:" + result[x].doc + " > " + lastDocId);
}
}
}
}
last = v[j];
lastSub = v2[j];
lastDocId = result[x].doc;
buff.append(v[j] + "(" + v2[j] + ")(" + result[x].doc+") ");
}
}
if(fail) {
System.out.println("topn field1(field2)(docID):" + buff);
}
assertFalse("Found sort results out of order", fail);
}
|
void function() throws IOException, ParseException { r = newRandom(); ScoreDoc[] result = null; IndexSearcher searcher = getFullStrings(); sort.setSort(new SortField[] { new SortField(STR, SortField.STRING), new SortField(STR, SortField.STRING, true), SortField.FIELD_DOC }); result = searcher.search(new MatchAllDocsQuery(), null, 500, sort).scoreDocs; StringBuffer buff = new StringBuffer(); int n = result.length; String last = null; String lastSub = null; int lastDocId = 0; boolean fail = false; for (int x = 0; x < n; ++x) { Document doc2 = searcher.doc(result[x].doc); String[] v = doc2.getValues(STR); String[] v2 = doc2.getValues(STR); for (int j = 0; j < v.length; ++j) { if (last != null) { int cmp = v[j].compareTo(last); if (!(cmp >= 0)) { fail = true; System.out.println("fail:" + v[j] + STR + last); } if (cmp == 0) { cmp = v2[j].compareTo(lastSub); if (cmp > 0) { fail = true; System.out.println(STR + v2[j] + STR + lastSub); } else if(cmp == 0) { if (result[x].doc < lastDocId) { fail = true; System.out.println(STR + result[x].doc + STR + lastDocId); } } } } last = v[j]; lastSub = v2[j]; lastDocId = result[x].doc; buff.append(v[j] + "(" + v2[j] + ")(" + result[x].doc+STR); } } if(fail) { System.out.println(STR + buff); } assertFalse(STR, fail); }
|
/**
* Test String sorting: small queue to many matches, multi field sort, reverse sort
*/
|
Test String sorting: small queue to many matches, multi field sort, reverse sort
|
testStringSort
|
{
"repo_name": "Overruler/retired-apache-sources",
"path": "lucene-2.9.4/src/test/org/apache/lucene/search/TestSort.java",
"license": "apache-2.0",
"size": 45226
}
|
[
"java.io.IOException",
"org.apache.lucene.document.Document",
"org.apache.lucene.queryParser.ParseException"
] |
import java.io.IOException; import org.apache.lucene.document.Document; import org.apache.lucene.queryParser.ParseException;
|
import java.io.*; import org.apache.lucene.*; import org.apache.lucene.document.*;
|
[
"java.io",
"org.apache.lucene"
] |
java.io; org.apache.lucene;
| 1,509,567
|
@Test
public void traceExceptionAndFormattedStringWithTwoInts() {
RuntimeException exception = new RuntimeException();
logger.tracef(exception, "%d + %d", 1, 2);
if (traceEnabled) {
verify(provider).log(eq(2), isNull(), eq(Level.TRACE), same(exception), any(PrintfStyleFormatter.class), eq("%d + %d"), eq(1),
eq(2));
} else {
verify(provider, never()).log(anyInt(), anyString(), any(), any(), any(), any(), any());
}
}
|
void function() { RuntimeException exception = new RuntimeException(); logger.tracef(exception, STR, 1, 2); if (traceEnabled) { verify(provider).log(eq(2), isNull(), eq(Level.TRACE), same(exception), any(PrintfStyleFormatter.class), eq(STR), eq(1), eq(2)); } else { verify(provider, never()).log(anyInt(), anyString(), any(), any(), any(), any(), any()); } }
|
/**
* Verifies that an exception and a formatted string with two integer arguments will be logged correctly at
* {@link Level#TRACE TRACE} level.
*/
|
Verifies that an exception and a formatted string with two integer arguments will be logged correctly at <code>Level#TRACE TRACE</code> level
|
traceExceptionAndFormattedStringWithTwoInts
|
{
"repo_name": "pmwmedia/tinylog",
"path": "jboss-tinylog/src/test/java/org/tinylog/jboss/TinylogLoggerTest.java",
"license": "apache-2.0",
"size": 189291
}
|
[
"org.mockito.ArgumentMatchers",
"org.mockito.Mockito",
"org.tinylog.Level",
"org.tinylog.format.PrintfStyleFormatter"
] |
import org.mockito.ArgumentMatchers; import org.mockito.Mockito; import org.tinylog.Level; import org.tinylog.format.PrintfStyleFormatter;
|
import org.mockito.*; import org.tinylog.*; import org.tinylog.format.*;
|
[
"org.mockito",
"org.tinylog",
"org.tinylog.format"
] |
org.mockito; org.tinylog; org.tinylog.format;
| 1,061,094
|
public byte[] getPayload() {
return Utilities.copyOf(payload);
}
|
byte[] function() { return Utilities.copyOf(payload); }
|
/**
* Returns the binary representation of the payload.
*
*/
|
Returns the binary representation of the payload
|
getPayload
|
{
"repo_name": "borellaster/java-apns",
"path": "src/main/java/com/notnoop/apns/SimpleApnsNotification.java",
"license": "bsd-3-clause",
"size": 5795
}
|
[
"com.notnoop.apns.internal.Utilities"
] |
import com.notnoop.apns.internal.Utilities;
|
import com.notnoop.apns.internal.*;
|
[
"com.notnoop.apns"
] |
com.notnoop.apns;
| 2,073,040
|
public MulticastDefinition onPrepare(Processor onPrepare) {
setOnPrepare(onPrepare);
return this;
}
/**
* Uses the {@link Processor} when preparing the {@link org.apache.camel.Exchange} to be send.
* This can be used to deep-clone messages that should be send, or any custom logic needed before
* the exchange is send.
*
* @param onPrepareRef reference to the processor to lookup in the {@link org.apache.camel.spi.Registry}
|
MulticastDefinition function(Processor onPrepare) { setOnPrepare(onPrepare); return this; } /** * Uses the {@link Processor} when preparing the {@link org.apache.camel.Exchange} to be send. * This can be used to deep-clone messages that should be send, or any custom logic needed before * the exchange is send. * * @param onPrepareRef reference to the processor to lookup in the {@link org.apache.camel.spi.Registry}
|
/**
* Uses the {@link Processor} when preparing the {@link org.apache.camel.Exchange} to be send.
* This can be used to deep-clone messages that should be send, or any custom logic needed before
* the exchange is send.
*
* @param onPrepare the processor
* @return the builder
*/
|
Uses the <code>Processor</code> when preparing the <code>org.apache.camel.Exchange</code> to be send. This can be used to deep-clone messages that should be send, or any custom logic needed before the exchange is send
|
onPrepare
|
{
"repo_name": "mnki/camel",
"path": "camel-core/src/main/java/org/apache/camel/model/MulticastDefinition.java",
"license": "apache-2.0",
"size": 17850
}
|
[
"org.apache.camel.Processor"
] |
import org.apache.camel.Processor;
|
import org.apache.camel.*;
|
[
"org.apache.camel"
] |
org.apache.camel;
| 1,419,032
|
public DataOutputStream openDataOutputStream() throws IOException {
throw new IllegalArgumentException("Not supported");
}
|
DataOutputStream function() throws IOException { throw new IllegalArgumentException(STR); }
|
/**
* Open and return a data output stream for a connection.
* This method always throw
* <code>IllegalArgumentException</code>.
*
* @return An output stream.
* @exception IOException if an I/O error occurs.
* @exception IllegalArgumentException is thrown for all requests.
*/
|
Open and return a data output stream for a connection. This method always throw <code>IllegalArgumentException</code>
|
openDataOutputStream
|
{
"repo_name": "tommythorn/yari",
"path": "shared/cacao-related/phoneme_feature/jsr120/src/protocol/cbs/classes/com/sun/midp/io/j2me/cbs/Protocol.java",
"license": "gpl-2.0",
"size": 24679
}
|
[
"java.io.DataOutputStream",
"java.io.IOException"
] |
import java.io.DataOutputStream; import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 359,701
|
@Override
public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
return null;
}
|
Iterator<FeatureDescriptor> function(ELContext context, Object base) { return null; }
|
/**
* Always returns null, since there is no reason to iterate through set set of all integers.
*
* @param context
* The context of this evaluation.
* @param base
* The list to analyze. Only bases of type List are handled by this resolver.
* @return null.
*/
|
Always returns null, since there is no reason to iterate through set set of all integers
|
getFeatureDescriptors
|
{
"repo_name": "beckchr/juel",
"path": "modules/api/src/main/java/javax/el/ListELResolver.java",
"license": "apache-2.0",
"size": 14276
}
|
[
"java.beans.FeatureDescriptor",
"java.util.Iterator"
] |
import java.beans.FeatureDescriptor; import java.util.Iterator;
|
import java.beans.*; import java.util.*;
|
[
"java.beans",
"java.util"
] |
java.beans; java.util;
| 1,338,056
|
static <T extends Response> CircuitBreakerRuleWithContentBuilder<T> builder(
BiPredicate<? super ClientRequestContext, ? super RequestHeaders> requestHeadersFilter) {
requireNonNull(requestHeadersFilter, "requestHeadersFilter");
return new CircuitBreakerRuleWithContentBuilder<>(requestHeadersFilter);
}
|
static <T extends Response> CircuitBreakerRuleWithContentBuilder<T> builder( BiPredicate<? super ClientRequestContext, ? super RequestHeaders> requestHeadersFilter) { requireNonNull(requestHeadersFilter, STR); return new CircuitBreakerRuleWithContentBuilder<>(requestHeadersFilter); }
|
/**
* Returns a newly created {@link CircuitBreakerRuleWithContentBuilder} with the specified
* {@code requestHeadersFilter}.
*/
|
Returns a newly created <code>CircuitBreakerRuleWithContentBuilder</code> with the specified requestHeadersFilter
|
builder
|
{
"repo_name": "minwoox/armeria",
"path": "core/src/main/java/com/linecorp/armeria/client/circuitbreaker/CircuitBreakerRuleWithContent.java",
"license": "apache-2.0",
"size": 8484
}
|
[
"com.linecorp.armeria.client.ClientRequestContext",
"com.linecorp.armeria.common.RequestHeaders",
"com.linecorp.armeria.common.Response",
"java.util.Objects",
"java.util.function.BiPredicate"
] |
import com.linecorp.armeria.client.ClientRequestContext; import com.linecorp.armeria.common.RequestHeaders; import com.linecorp.armeria.common.Response; import java.util.Objects; import java.util.function.BiPredicate;
|
import com.linecorp.armeria.client.*; import com.linecorp.armeria.common.*; import java.util.*; import java.util.function.*;
|
[
"com.linecorp.armeria",
"java.util"
] |
com.linecorp.armeria; java.util;
| 223,586
|
public MetaProperty<Failure> failure() {
return failure;
}
|
MetaProperty<Failure> function() { return failure; }
|
/**
* The meta-property for the {@code failure} property.
* @return the meta-property, not null
*/
|
The meta-property for the failure property
|
failure
|
{
"repo_name": "OpenGamma/Strata",
"path": "modules/collect/src/main/java/com/opengamma/strata/collect/result/Result.java",
"license": "apache-2.0",
"size": 43278
}
|
[
"org.joda.beans.MetaProperty"
] |
import org.joda.beans.MetaProperty;
|
import org.joda.beans.*;
|
[
"org.joda.beans"
] |
org.joda.beans;
| 716,496
|
public Set<SequencerRun> getSequencerRuns() {
return sequencerRuns;
}
|
Set<SequencerRun> function() { return sequencerRuns; }
|
/**
* <p>
* Getter for the field <code>sequencerRuns</code>.
* </p>
*
* @return a {@link java.util.Set} object.
*/
|
Getter for the field <code>sequencerRuns</code>.
|
getSequencerRuns
|
{
"repo_name": "joansmith/seqware",
"path": "seqware-common/src/main/java/net/sourceforge/seqware/common/model/Processing.java",
"license": "gpl-3.0",
"size": 40793
}
|
[
"java.util.Set"
] |
import java.util.Set;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,913,087
|
LispAfiAddress getEidPrefixAfi();
|
LispAfiAddress getEidPrefixAfi();
|
/**
* Obtains EID prefix.
*
* @return EID prefix
*/
|
Obtains EID prefix
|
getEidPrefixAfi
|
{
"repo_name": "donNewtonAlpha/onos",
"path": "protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispRecord.java",
"license": "apache-2.0",
"size": 3210
}
|
[
"org.onosproject.lisp.msg.types.LispAfiAddress"
] |
import org.onosproject.lisp.msg.types.LispAfiAddress;
|
import org.onosproject.lisp.msg.types.*;
|
[
"org.onosproject.lisp"
] |
org.onosproject.lisp;
| 292,090
|
Map<String, VariableInstance> getVariableInstances(String taskId);
|
Map<String, VariableInstance> getVariableInstances(String taskId);
|
/**
* All variables visible from the given task scope (including parent scopes).
*
* @param taskId
* id of task, cannot be null.
* @return the variable instances or an empty map if no such variables are found.
* @throws ActivitiObjectNotFoundException
* when no task is found for the given taskId.
*/
|
All variables visible from the given task scope (including parent scopes)
|
getVariableInstances
|
{
"repo_name": "roberthafner/flowable-engine",
"path": "modules/flowable-engine/src/main/java/org/activiti/engine/TaskService.java",
"license": "apache-2.0",
"size": 31097
}
|
[
"java.util.Map",
"org.activiti.engine.impl.persistence.entity.VariableInstance"
] |
import java.util.Map; import org.activiti.engine.impl.persistence.entity.VariableInstance;
|
import java.util.*; import org.activiti.engine.impl.persistence.entity.*;
|
[
"java.util",
"org.activiti.engine"
] |
java.util; org.activiti.engine;
| 117,759
|
private static void startJackrabbit(final File repoDirectory) throws Exception {
boolean quiet = false;
if (!DEBUG) {
Logger.getLogger("org.apache.jackrabbit").setLevel(Level.WARN);
Logger.getLogger("org.apache.commons.httpclient").setLevel(Level.ERROR);
Logger.getLogger("org.apache.commons.vfs2").setLevel(Level.WARN);
Logger.getLogger("org.mortbay").setLevel(Level.WARN);
quiet = true;
}
JrMain = new JackrabbitMain(new String[] { "--port", Integer.toString(SocketPort), "--repo",
repoDirectory.toString(), quiet ? "--quiet" : "" });
JrMain.run();
}
|
static void function(final File repoDirectory) throws Exception { boolean quiet = false; if (!DEBUG) { Logger.getLogger(STR).setLevel(Level.WARN); Logger.getLogger(STR).setLevel(Level.ERROR); Logger.getLogger(STR).setLevel(Level.WARN); Logger.getLogger(STR).setLevel(Level.WARN); quiet = true; } JrMain = new JackrabbitMain(new String[] { STR, Integer.toString(SocketPort), STR, repoDirectory.toString(), quiet ? STR : "" }); JrMain.run(); }
|
/**
* Starts an embedded Apache Jackrabbit server.
*
* @param repoDirectory
* @throws Exception
*/
|
Starts an embedded Apache Jackrabbit server
|
startJackrabbit
|
{
"repo_name": "seeburger-ag/commons-vfs",
"path": "commons-vfs2-jackrabbit1/src/test/java/org/apache/commons/vfs2/provider/webdav/test/WebdavProviderTestCase.java",
"license": "apache-2.0",
"size": 11595
}
|
[
"java.io.File",
"org.apache.log4j.Level",
"org.apache.log4j.Logger"
] |
import java.io.File; import org.apache.log4j.Level; import org.apache.log4j.Logger;
|
import java.io.*; import org.apache.log4j.*;
|
[
"java.io",
"org.apache.log4j"
] |
java.io; org.apache.log4j;
| 186,535
|
public TKVJsonObject getEntry(String topic, String key) {
return table.get(key, topic);
}
|
TKVJsonObject function(String topic, String key) { return table.get(key, topic); }
|
/**
* Get a specific entry
* @param topic
* @param key
* @return
*/
|
Get a specific entry
|
getEntry
|
{
"repo_name": "AGES-Initiatives/alwb-utils-gui",
"path": "alwb.utils/src/main/java/net/ages/alwb/utils/core/datastores/json/manager/JsonObjectStoreManager.java",
"license": "epl-1.0",
"size": 13745
}
|
[
"net.ages.alwb.utils.core.datastores.json.models.TKVJsonObject"
] |
import net.ages.alwb.utils.core.datastores.json.models.TKVJsonObject;
|
import net.ages.alwb.utils.core.datastores.json.models.*;
|
[
"net.ages.alwb"
] |
net.ages.alwb;
| 978,560
|
ResourceDetail resultSetToResourceDetail(ResultSet rs) throws SQLException {
boolean book = false;
int id = rs.getInt("id");
String instanceId = rs.getString("instanceId");
String categoryId = rs.getString("categoryid");
String name = rs.getString("name");
Date creationDate = new Date(Long.parseLong(rs.getString("creationDate")));
Date updateDate = new Date(Long.parseLong(rs.getString("updateDate")));
int bookable = rs.getInt("bookable");
if (bookable == 1) {
book = true;
}
int responsibleId = rs.getInt("responsibleId");
int createrId = rs.getInt("createrId");
int updaterId = rs.getInt("updaterId");
String description = rs.getString("description");
ResourceDetail resource = new ResourceDetail(Integer.toString(id),
categoryId, name, creationDate, updateDate, description, Integer.toString(responsibleId),
Integer.toString(createrId), Integer.toString(updaterId), instanceId, book);
return resource;
}
|
ResourceDetail resultSetToResourceDetail(ResultSet rs) throws SQLException { boolean book = false; int id = rs.getInt("id"); String instanceId = rs.getString(STR); String categoryId = rs.getString(STR); String name = rs.getString("name"); Date creationDate = new Date(Long.parseLong(rs.getString(STR))); Date updateDate = new Date(Long.parseLong(rs.getString(STR))); int bookable = rs.getInt(STR); if (bookable == 1) { book = true; } int responsibleId = rs.getInt(STR); int createrId = rs.getInt(STR); int updaterId = rs.getInt(STR); String description = rs.getString(STR); ResourceDetail resource = new ResourceDetail(Integer.toString(id), categoryId, name, creationDate, updateDate, description, Integer.toString(responsibleId), Integer.toString(createrId), Integer.toString(updaterId), instanceId, book); return resource; }
|
/**
* * Gestion des Ressources **
*/
|
Gestion des Ressources
|
resultSetToResourceDetail
|
{
"repo_name": "stephaneperry/Silverpeas-Components",
"path": "resources-manager/resources-manager-ejb/src/main/java/com/silverpeas/resourcesmanager/model/ResourceDao.java",
"license": "agpl-3.0",
"size": 12906
}
|
[
"java.sql.ResultSet",
"java.sql.SQLException",
"java.util.Date"
] |
import java.sql.ResultSet; import java.sql.SQLException; import java.util.Date;
|
import java.sql.*; import java.util.*;
|
[
"java.sql",
"java.util"
] |
java.sql; java.util;
| 1,358,403
|
public OffsetDateTime getExpires() {
if (this.expires == null) {
return null;
}
return OffsetDateTime.ofInstant(Instant.ofEpochMilli(this.expires * 1000L), ZoneOffset.UTC);
}
|
OffsetDateTime function() { if (this.expires == null) { return null; } return OffsetDateTime.ofInstant(Instant.ofEpochMilli(this.expires * 1000L), ZoneOffset.UTC); }
|
/**
* Get the expires value.
*
* @return the expires value
*/
|
Get the expires value
|
getExpires
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/KeyRequestAttributes.java",
"license": "mit",
"size": 4979
}
|
[
"java.time.Instant",
"java.time.OffsetDateTime",
"java.time.ZoneOffset"
] |
import java.time.Instant; import java.time.OffsetDateTime; import java.time.ZoneOffset;
|
import java.time.*;
|
[
"java.time"
] |
java.time;
| 1,450,445
|
User u = new User();
String username = "fbristow";
u.setId(1L);
u.setUsername(username);
return u;
}
|
User u = new User(); String username = STR; u.setId(1L); u.setUsername(username); return u; }
|
/**
* Construct a simple {@link ca.corefacility.bioinformatics.irida.model.User}.
*
* @return a {@link ca.corefacility.bioinformatics.irida.model.User} with identifier.
*/
|
Construct a simple <code>ca.corefacility.bioinformatics.irida.model.User</code>
|
constructUser
|
{
"repo_name": "phac-nml/irida",
"path": "src/test/java/ca/corefacility/bioinformatics/irida/web/controller/test/unit/TestDataFactory.java",
"license": "apache-2.0",
"size": 3528
}
|
[
"ca.corefacility.bioinformatics.irida.model.user.User"
] |
import ca.corefacility.bioinformatics.irida.model.user.User;
|
import ca.corefacility.bioinformatics.irida.model.user.*;
|
[
"ca.corefacility.bioinformatics"
] |
ca.corefacility.bioinformatics;
| 2,194,363
|
private void doSaveData() {
// No XSS checks, are done in the HTML editor - users can upload illegal
// stuff, JS needs to be enabled for users
String content = htmlElement.getRawValue();
// If preface was null -> append own head and save it in utf-8. Preface
// is the header that was in the file when we opened the file
StringBuilder fileContent = new StringBuilder();
if (preface == null) {
fileContent.append(DOCTYPE).append(OPEN_HTML).append(OPEN_HEAD);
fileContent.append(GENERATOR_META).append(UTF8CHARSET);
// In new documents, create empty title to be W3C conform. Title
// is mandatory element in meta element.
fileContent.append(EMTPY_TITLE);
fileContent.append(CLOSE_HEAD_OPEN_BODY);
fileContent.append(content);
fileContent.append(CLOSE_BODY_HTML);
charSet = UTF_8; // use utf-8 by default for new files
} else {
// existing preface, just reinsert so we don't lose stuff the user put
// in there
fileContent.append(preface).append(content).append(CLOSE_BODY_HTML);
}
// save the file
if(versions && fileLeaf instanceof Versionable && ((Versionable)fileLeaf).getVersions().isVersioned()) {
InputStream inStream = FileUtils.getInputStream(fileContent.toString(), charSet);
((Versionable)fileLeaf).getVersions().addVersion(getIdentity(), "", inStream);
} else {
FileUtils.save(fileLeaf.getOutputStream(false), fileContent.toString(), charSet);
}
// Update last modified date in view
long lm = fileLeaf.getLastModified();
metadataVC.contextPut("lastModified", Formatter.getInstance(getLocale()).formatDateAndTime(new Date(lm)));
// Set new content as default value in element
htmlElement.setNewOriginalValue(content);
}
|
void function() { String content = htmlElement.getRawValue(); StringBuilder fileContent = new StringBuilder(); if (preface == null) { fileContent.append(DOCTYPE).append(OPEN_HTML).append(OPEN_HEAD); fileContent.append(GENERATOR_META).append(UTF8CHARSET); fileContent.append(EMTPY_TITLE); fileContent.append(CLOSE_HEAD_OPEN_BODY); fileContent.append(content); fileContent.append(CLOSE_BODY_HTML); charSet = UTF_8; } else { fileContent.append(preface).append(content).append(CLOSE_BODY_HTML); } if(versions && fileLeaf instanceof Versionable && ((Versionable)fileLeaf).getVersions().isVersioned()) { InputStream inStream = FileUtils.getInputStream(fileContent.toString(), charSet); ((Versionable)fileLeaf).getVersions().addVersion(getIdentity(), STRlastModified", Formatter.getInstance(getLocale()).formatDateAndTime(new Date(lm))); htmlElement.setNewOriginalValue(content); }
|
/**
* Event implementation for savedata
*
* @param ureq
*/
|
Event implementation for savedata
|
doSaveData
|
{
"repo_name": "stevenhva/InfoLearn_OpenOLAT",
"path": "src/main/java/org/olat/core/commons/editor/htmleditor/HTMLEditorController.java",
"license": "apache-2.0",
"size": 18001
}
|
[
"java.io.InputStream",
"java.util.Date",
"org.olat.core.util.FileUtils",
"org.olat.core.util.Formatter",
"org.olat.core.util.vfs.version.Versionable"
] |
import java.io.InputStream; import java.util.Date; import org.olat.core.util.FileUtils; import org.olat.core.util.Formatter; import org.olat.core.util.vfs.version.Versionable;
|
import java.io.*; import java.util.*; import org.olat.core.util.*; import org.olat.core.util.vfs.version.*;
|
[
"java.io",
"java.util",
"org.olat.core"
] |
java.io; java.util; org.olat.core;
| 1,567,673
|
DefaultTableModel table = (DefaultTableModel)tblLog.getModel();
if(chkWriteLog.isSelected()){
String[] nxtRow = new String[3];
nxtRow[0] = "W";
nxtRow[1] = Integer.toHexString(instraddr);
nxtRow[2] = Integer.toHexString(device.getMemSilent(trapaddr));
table.addRow(nxtRow);
}
}
|
DefaultTableModel table = (DefaultTableModel)tblLog.getModel(); if(chkWriteLog.isSelected()){ String[] nxtRow = new String[3]; nxtRow[0] = "W"; nxtRow[1] = Integer.toHexString(instraddr); nxtRow[2] = Integer.toHexString(device.getMemSilent(trapaddr)); table.addRow(nxtRow); } }
|
/** We have been notified that a write trap has been hit.
*@param trapaddr The address that was trapped
*@param instaddr The address of the instruction that fell into our trap.
**/
|
We have been notified that a write trap has been hit
|
writeTrap
|
{
"repo_name": "Sappharad/Java-68HC11-Emulator",
"path": "HC11Emulator/src/hc11emulator/debug_ramlogFrame.java",
"license": "mit",
"size": 7190
}
|
[
"javax.swing.table.DefaultTableModel"
] |
import javax.swing.table.DefaultTableModel;
|
import javax.swing.table.*;
|
[
"javax.swing"
] |
javax.swing;
| 887,520
|
public MZTolerance getMzTolerance() {
return mzTolerance;
}
|
MZTolerance function() { return mzTolerance; }
|
/**
* the mz tolerance that was used to find identity
*
* @return
*/
|
the mz tolerance that was used to find identity
|
getMzTolerance
|
{
"repo_name": "du-lab/mzmine2",
"path": "src/main/java/net/sf/mzmine/datamodel/identities/ms2/interf/AbstractMSMSIdentity.java",
"license": "gpl-2.0",
"size": 1593
}
|
[
"net.sf.mzmine.parameters.parametertypes.tolerances.MZTolerance"
] |
import net.sf.mzmine.parameters.parametertypes.tolerances.MZTolerance;
|
import net.sf.mzmine.parameters.parametertypes.tolerances.*;
|
[
"net.sf.mzmine"
] |
net.sf.mzmine;
| 1,678,430
|
public ConnectionSource getConnectionSource() throws SQLException;
|
ConnectionSource function() throws SQLException;
|
/**
* Get a connection from the pool.
*
* @return a database connection
* @throws SQLException
* if there is an error getting a connection
*/
|
Get a connection from the pool
|
getConnectionSource
|
{
"repo_name": "dozedoff/commonj",
"path": "src/main/java/com/github/dozedoff/commonj/io/ConnectionPool.java",
"license": "mit",
"size": 1302
}
|
[
"com.j256.ormlite.support.ConnectionSource",
"java.sql.SQLException"
] |
import com.j256.ormlite.support.ConnectionSource; import java.sql.SQLException;
|
import com.j256.ormlite.support.*; import java.sql.*;
|
[
"com.j256.ormlite",
"java.sql"
] |
com.j256.ormlite; java.sql;
| 2,204,995
|
public List<Locale> getAcceptableLanguages();
|
List<Locale> function();
|
/**
* Get a list of languages that are acceptable for the response.
* <p/>
* If no acceptable languages are specified, a read-only list containing
* a single wildcard {@link java.util.Locale} instance (with language field
* set to "{@code *}") is returned.
*
* @return a read-only list of acceptable languages sorted according
* to their q-value, with highest preference first.
* @throws java.lang.IllegalStateException
* if called outside the scope of a request.
*/
|
Get a list of languages that are acceptable for the response. If no acceptable languages are specified, a read-only list containing a single wildcard <code>java.util.Locale</code> instance (with language field set to "*") is returned
|
getAcceptableLanguages
|
{
"repo_name": "raphaelning/resteasy-client-android",
"path": "jaxrs/jaxrs-api/src/main/java/javax/ws/rs/core/HttpHeaders.java",
"license": "apache-2.0",
"size": 12633
}
|
[
"java.util.List",
"java.util.Locale"
] |
import java.util.List; import java.util.Locale;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 803,414
|
@Test
public void testCtorMax() throws RemoteException {
DynamicFPSetManager dynamicFPSetManager = new DynamicFPSetManager(Integer.MAX_VALUE);
long mask = dynamicFPSetManager.getMask();
assertEquals((Integer.MAX_VALUE), mask);
}
|
void function() throws RemoteException { DynamicFPSetManager dynamicFPSetManager = new DynamicFPSetManager(Integer.MAX_VALUE); long mask = dynamicFPSetManager.getMask(); assertEquals((Integer.MAX_VALUE), mask); }
|
/**
* Test that the ctor correctly calculates its mask used to index fpset
* servers for valid values.
*/
|
Test that the ctor correctly calculates its mask used to index fpset servers for valid values
|
testCtorMax
|
{
"repo_name": "tlaplus/tlaplus",
"path": "tlatools/org.lamport.tlatools/test/tlc2/tool/distributed/fp/DynamicFPSetManagerTest.java",
"license": "mit",
"size": 15924
}
|
[
"java.rmi.RemoteException",
"org.junit.Assert"
] |
import java.rmi.RemoteException; import org.junit.Assert;
|
import java.rmi.*; import org.junit.*;
|
[
"java.rmi",
"org.junit"
] |
java.rmi; org.junit;
| 2,816,464
|
@DoesServiceRequest
public final void uploadProperties(final AccessCondition accessCondition, FileRequestOptions options,
OperationContext opContext) throws StorageException {
if (opContext == null) {
opContext = new OperationContext();
}
opContext.initialize();
options = FileRequestOptions.applyDefaults(options, this.fileServiceClient);
ExecutionEngine.executeWithRetry(this.fileServiceClient, this,
this.uploadPropertiesImpl(accessCondition, options), options.getRetryPolicyFactory(), opContext);
}
|
final void function(final AccessCondition accessCondition, FileRequestOptions options, OperationContext opContext) throws StorageException { if (opContext == null) { opContext = new OperationContext(); } opContext.initialize(); options = FileRequestOptions.applyDefaults(options, this.fileServiceClient); ExecutionEngine.executeWithRetry(this.fileServiceClient, this, this.uploadPropertiesImpl(accessCondition, options), options.getRetryPolicyFactory(), opContext); }
|
/**
* Updates the file's properties using the access condition, request options, and operation context.
* <p>
* Use {@link CloudFile#downloadAttributes} to retrieve the latest values for the file's properties and metadata
* from the Microsoft Azure storage service.
*
* @param accessCondition
* An {@link AccessCondition} object that represents the access conditions for the file.
* @param options
* A {@link FileRequestOptions} object that specifies any additional options for the request. Specifying
* <code>null</code> will use the default request options from the associated service client (
* {@link CloudFileClient}).
* @param opContext
* An {@link OperationContext} object that represents the context for the current operation. This object
* is used to track requests to the storage service, and to provide additional runtime information about
* the operation.
*
* @throws StorageException
* If a storage service error occurred.
*/
|
Updates the file's properties using the access condition, request options, and operation context. Use <code>CloudFile#downloadAttributes</code> to retrieve the latest values for the file's properties and metadata from the Microsoft Azure storage service
|
uploadProperties
|
{
"repo_name": "peterhoeltschi/AzureStorage",
"path": "microsoft-azure-storage/src/com/microsoft/azure/storage/file/CloudFile.java",
"license": "apache-2.0",
"size": 119971
}
|
[
"com.microsoft.azure.storage.AccessCondition",
"com.microsoft.azure.storage.OperationContext",
"com.microsoft.azure.storage.StorageException",
"com.microsoft.azure.storage.core.ExecutionEngine"
] |
import com.microsoft.azure.storage.AccessCondition; import com.microsoft.azure.storage.OperationContext; import com.microsoft.azure.storage.StorageException; import com.microsoft.azure.storage.core.ExecutionEngine;
|
import com.microsoft.azure.storage.*; import com.microsoft.azure.storage.core.*;
|
[
"com.microsoft.azure"
] |
com.microsoft.azure;
| 2,774,554
|
public List<RSSItem> getAllItems() {
return itemList;
}
|
List<RSSItem> function() { return itemList; }
|
/**
* Return all items
* @return
*/
|
Return all items
|
getAllItems
|
{
"repo_name": "ccjeng/News",
"path": "app/src/main/java/com/ccjeng/news/controler/rss/RSSFeed.java",
"license": "mit",
"size": 891
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,000,759
|
FieldReader getReader();
|
FieldReader getReader();
|
/**
* Returns a {@link org.apache.arrow.vector.complex.reader.FieldReader field reader} that supports reading values
* from this vector.
*/
|
Returns a <code>org.apache.arrow.vector.complex.reader.FieldReader field reader</code> that supports reading values from this vector
|
getReader
|
{
"repo_name": "StevenMPhillips/arrow",
"path": "java/vector/src/main/java/org/apache/arrow/vector/ValueVector.java",
"license": "apache-2.0",
"size": 7397
}
|
[
"org.apache.arrow.vector.complex.reader.FieldReader"
] |
import org.apache.arrow.vector.complex.reader.FieldReader;
|
import org.apache.arrow.vector.complex.reader.*;
|
[
"org.apache.arrow"
] |
org.apache.arrow;
| 2,654,521
|
public void setUsers(List<UserEntity> users) {
this.users = users;
}
|
void function(List<UserEntity> users) { this.users = users; }
|
/**
* Sets the users.
*
* @param users
* the new users
*/
|
Sets the users
|
setUsers
|
{
"repo_name": "Gugli/Openfire",
"path": "src/plugins/userservice/src/java/org/jivesoftware/openfire/entity/UserEntities.java",
"license": "apache-2.0",
"size": 957
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,772,063
|
@Test
public void TestUndefinedVariable() {
String rule = "$initial } a <> \u1161;";
try {
Transliterator.createFromRules("<ID>", rule,Transliterator.FORWARD);
} catch (IllegalArgumentException e) {
logln("OK: Got exception for " + rule + ", as expected: " +
e.getMessage());
return;
}
errln("Fail: bogus rule " + rule + " compiled without error");
}
|
void function() { String rule = STR; try { Transliterator.createFromRules("<ID>", rule,Transliterator.FORWARD); } catch (IllegalArgumentException e) { logln(STR + rule + STR + e.getMessage()); return; } errln(STR + rule + STR); }
|
/**
* Test undefined variable.
*/
|
Test undefined variable
|
TestUndefinedVariable
|
{
"repo_name": "life-beam/j2objc",
"path": "jre_emul/android/platform/external/icu/android_icu4j/src/main/tests/android/icu/dev/test/translit/TransliteratorTest.java",
"license": "apache-2.0",
"size": 165585
}
|
[
"android.icu.text.Transliterator"
] |
import android.icu.text.Transliterator;
|
import android.icu.text.*;
|
[
"android.icu"
] |
android.icu;
| 291,689
|
SessionImplementor sessionImpl;
if (!(session instanceof SessionImplementor)) {
sessionImpl = (SessionImplementor) session.getSessionFactory().getCurrentSession();
} else {
sessionImpl = (SessionImplementor) session;
}
// todo : I wonder if there is a better means to do this via "named lookup" based on the session factory name/uuid
final EventListenerRegistry listenerRegistry = sessionImpl
.getFactory()
.getServiceRegistry()
.getService( EventListenerRegistry.class );
for ( PostInsertEventListener listener : listenerRegistry.getEventListenerGroup( EventType.POST_INSERT ).listeners() ) {
if ( listener instanceof EnversListener ) {
// todo : slightly different from original code in that I am not checking the other listener groups...
return new AuditReaderImpl(
( (EnversListener) listener ).getAuditConfiguration(),
session,
sessionImpl
);
}
}
throw new AuditException( "Envers listeners were not properly registered" );
}
|
SessionImplementor sessionImpl; if (!(session instanceof SessionImplementor)) { sessionImpl = (SessionImplementor) session.getSessionFactory().getCurrentSession(); } else { sessionImpl = (SessionImplementor) session; } final EventListenerRegistry listenerRegistry = sessionImpl .getFactory() .getServiceRegistry() .getService( EventListenerRegistry.class ); for ( PostInsertEventListener listener : listenerRegistry.getEventListenerGroup( EventType.POST_INSERT ).listeners() ) { if ( listener instanceof EnversListener ) { return new AuditReaderImpl( ( (EnversListener) listener ).getAuditConfiguration(), session, sessionImpl ); } } throw new AuditException( STR ); }
|
/**
* Create an audit reader associated with an open session.
* @param session An open session.
* @return An audit reader associated with the given sesison. It shouldn't be used
* after the session is closed.
* @throws AuditException When the given required listeners aren't installed.
*/
|
Create an audit reader associated with an open session
|
get
|
{
"repo_name": "HerrB92/obp",
"path": "OpenBeaconPackage/libraries/hibernate-release-4.2.7.SP1/project/hibernate-envers/src/main/java/org/hibernate/envers/AuditReaderFactory.java",
"license": "mit",
"size": 3936
}
|
[
"org.hibernate.engine.spi.SessionImplementor",
"org.hibernate.envers.event.EnversListener",
"org.hibernate.envers.exception.AuditException",
"org.hibernate.envers.reader.AuditReaderImpl",
"org.hibernate.event.service.spi.EventListenerRegistry",
"org.hibernate.event.spi.EventType",
"org.hibernate.event.spi.PostInsertEventListener"
] |
import org.hibernate.engine.spi.SessionImplementor; import org.hibernate.envers.event.EnversListener; import org.hibernate.envers.exception.AuditException; import org.hibernate.envers.reader.AuditReaderImpl; import org.hibernate.event.service.spi.EventListenerRegistry; import org.hibernate.event.spi.EventType; import org.hibernate.event.spi.PostInsertEventListener;
|
import org.hibernate.engine.spi.*; import org.hibernate.envers.event.*; import org.hibernate.envers.exception.*; import org.hibernate.envers.reader.*; import org.hibernate.event.service.spi.*; import org.hibernate.event.spi.*;
|
[
"org.hibernate.engine",
"org.hibernate.envers",
"org.hibernate.event"
] |
org.hibernate.engine; org.hibernate.envers; org.hibernate.event;
| 800,129
|
public void addUrls(Collection<URL> urls) {
Assert.notNull(urls, "Urls must not be null");
this.urls.addAll(ChangeableUrls.fromUrls(urls).toList());
}
|
void function(Collection<URL> urls) { Assert.notNull(urls, STR); this.urls.addAll(ChangeableUrls.fromUrls(urls).toList()); }
|
/**
* Add additional URLs to be includes in the next restart.
* @param urls the urls to add
*/
|
Add additional URLs to be includes in the next restart
|
addUrls
|
{
"repo_name": "jforge/spring-boot",
"path": "spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java",
"license": "apache-2.0",
"size": 19072
}
|
[
"java.util.Collection",
"org.springframework.util.Assert"
] |
import java.util.Collection; import org.springframework.util.Assert;
|
import java.util.*; import org.springframework.util.*;
|
[
"java.util",
"org.springframework.util"
] |
java.util; org.springframework.util;
| 2,126,818
|
public static boolean isCallable(@Nullable final PackageManager pm, @Nullable final Intent intent) {
// Check for possible null values
if (pm == null || intent == null) {
return false;
}
// Thank you to Google Keep for ruining the show: java.lang.SecurityException: Permission Denial: starting Intent [...] not exported from uid
final List<ResolveInfo> resolveInfos = pm.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
for (final ResolveInfo resolveInfo : resolveInfos) {
// Check if exported
if (!resolveInfo.activityInfo.exported) {
continue;
}
if (resolveInfo.activityInfo.permission == null
|| pm.checkPermission(resolveInfo.activityInfo.permission, BuildConfig.APPLICATION_ID) == PackageManager.PERMISSION_GRANTED) {
return true;
}
}
return false;
}
|
static boolean function(@Nullable final PackageManager pm, @Nullable final Intent intent) { if (pm == null intent == null) { return false; } final List<ResolveInfo> resolveInfos = pm.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); for (final ResolveInfo resolveInfo : resolveInfos) { if (!resolveInfo.activityInfo.exported) { continue; } if (resolveInfo.activityInfo.permission == null pm.checkPermission(resolveInfo.activityInfo.permission, BuildConfig.APPLICATION_ID) == PackageManager.PERMISSION_GRANTED) { return true; } } return false; }
|
/**
* Check if an intent is callable.
* @param intent the intent
* @param pm the package manager to check against
* @return if it is callable.
*/
|
Check if an intent is callable
|
isCallable
|
{
"repo_name": "clemensbartz/essential-launcher",
"path": "launcher/src/main/java/de/clemensbartz/android/launcher/util/IntentUtil.java",
"license": "gpl-3.0",
"size": 5772
}
|
[
"android.content.Intent",
"android.content.pm.PackageManager",
"android.content.pm.ResolveInfo",
"androidx.annotation.Nullable",
"de.clemensbartz.android.launcher.BuildConfig",
"java.util.List"
] |
import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import androidx.annotation.Nullable; import de.clemensbartz.android.launcher.BuildConfig; import java.util.List;
|
import android.content.*; import android.content.pm.*; import androidx.annotation.*; import de.clemensbartz.android.launcher.*; import java.util.*;
|
[
"android.content",
"androidx.annotation",
"de.clemensbartz.android",
"java.util"
] |
android.content; androidx.annotation; de.clemensbartz.android; java.util;
| 2,487,384
|
// User Preferences
UserPreferencesMVCView getUserPreferencesMVCView() throws DatastoreException;
void reloadUserPreferences();
boolean testUserPreferencesChanges();
void applyUserPreferencesChanges();
|
UserPreferencesMVCView getUserPreferencesMVCView() throws DatastoreException; void reloadUserPreferences(); boolean testUserPreferencesChanges(); void applyUserPreferencesChanges();
|
/**
* <p>Persist the updated user preferences to disk and switch the current audio
* system over to the chosen preferences.</p>
*/
|
Persist the updated user preferences to disk and switch the current audio system over to the chosen preferences
|
applyUserPreferencesChanges
|
{
"repo_name": "danielhams/mad-java",
"path": "1PROJECTS/COMPONENTDESIGNER/component-designer-services/src/uk/co/modularaudio/componentdesigner/controller/front/ComponentDesignerFrontController.java",
"license": "gpl-3.0",
"size": 12195
}
|
[
"uk.co.modularaudio.service.gui.UserPreferencesMVCView",
"uk.co.modularaudio.util.exception.DatastoreException"
] |
import uk.co.modularaudio.service.gui.UserPreferencesMVCView; import uk.co.modularaudio.util.exception.DatastoreException;
|
import uk.co.modularaudio.service.gui.*; import uk.co.modularaudio.util.exception.*;
|
[
"uk.co.modularaudio"
] |
uk.co.modularaudio;
| 9,805
|
protected static WebElement waitForElement(final By locator) {
FluentWait<WebDriver> wait = new FluentWait<WebDriver>(getWebDriver()).withTimeout(120, TimeUnit.SECONDS)
.pollingEvery(500, TimeUnit.MILLISECONDS)
.ignoring(NoSuchElementException.class)
.ignoring(ElementNotVisibleException.class)
.ignoring(StaleElementReferenceException.class)
.ignoring(ElementNotFoundException.class);
|
static WebElement function(final By locator) { FluentWait<WebDriver> wait = new FluentWait<WebDriver>(getWebDriver()).withTimeout(120, TimeUnit.SECONDS) .pollingEvery(500, TimeUnit.MILLISECONDS) .ignoring(NoSuchElementException.class) .ignoring(ElementNotVisibleException.class) .ignoring(StaleElementReferenceException.class) .ignoring(ElementNotFoundException.class);
|
/**
* Wait for element.
*
* @param locator
* the locator
* @return the web element
*/
|
Wait for element
|
waitForElement
|
{
"repo_name": "confluxtoo/finflux_automation_test",
"path": "FinfluxTestAutomation/src/test/java/com/mifos/pages/MifosWebPage.java",
"license": "mpl-2.0",
"size": 63024
}
|
[
"com.gargoylesoftware.htmlunit.ElementNotFoundException",
"java.util.concurrent.TimeUnit",
"org.openqa.selenium.By",
"org.openqa.selenium.ElementNotVisibleException",
"org.openqa.selenium.NoSuchElementException",
"org.openqa.selenium.StaleElementReferenceException",
"org.openqa.selenium.WebDriver",
"org.openqa.selenium.WebElement",
"org.openqa.selenium.support.ui.FluentWait"
] |
import com.gargoylesoftware.htmlunit.ElementNotFoundException; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.ElementNotVisibleException; import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.StaleElementReferenceException; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.FluentWait;
|
import com.gargoylesoftware.htmlunit.*; import java.util.concurrent.*; import org.openqa.selenium.*; import org.openqa.selenium.support.ui.*;
|
[
"com.gargoylesoftware.htmlunit",
"java.util",
"org.openqa.selenium"
] |
com.gargoylesoftware.htmlunit; java.util; org.openqa.selenium;
| 1,876,055
|
public static void initTableMapperJob(byte[] table, Scan scan,
Class<? extends TableMapper> mapper,
Class<?> outputKeyClass,
Class<?> outputValueClass, Job job,
boolean addDependencyJars)
throws IOException {
initTableMapperJob(Bytes.toString(table), scan, mapper, outputKeyClass, outputValueClass, job,
addDependencyJars, getConfiguredInputFormat(job));
}
|
static void function(byte[] table, Scan scan, Class<? extends TableMapper> mapper, Class<?> outputKeyClass, Class<?> outputValueClass, Job job, boolean addDependencyJars) throws IOException { initTableMapperJob(Bytes.toString(table), scan, mapper, outputKeyClass, outputValueClass, job, addDependencyJars, getConfiguredInputFormat(job)); }
|
/**
* Use this before submitting a TableMap job. It will appropriately set up
* the job.
*
* @param table Binary representation of the table name to read from.
* @param scan The scan instance with the columns, time range etc.
* @param mapper The mapper class to use.
* @param outputKeyClass The class of the output key.
* @param outputValueClass The class of the output value.
* @param job The current job to adjust. Make sure the passed job is
* carrying all necessary HBase configuration.
* @param addDependencyJars upload HBase jars and jars for any of the configured
* job classes via the distributed cache (tmpjars).
* @throws IOException When setting up the details fails.
*/
|
Use this before submitting a TableMap job. It will appropriately set up the job
|
initTableMapperJob
|
{
"repo_name": "mahak/hbase",
"path": "hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java",
"license": "apache-2.0",
"size": 46796
}
|
[
"java.io.IOException",
"org.apache.hadoop.hbase.client.Scan",
"org.apache.hadoop.hbase.util.Bytes",
"org.apache.hadoop.mapreduce.Job"
] |
import java.io.IOException; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.mapreduce.Job;
|
import java.io.*; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.util.*; import org.apache.hadoop.mapreduce.*;
|
[
"java.io",
"org.apache.hadoop"
] |
java.io; org.apache.hadoop;
| 394,908
|
Block getBlock(int x, int y, int z);
|
Block getBlock(int x, int y, int z);
|
/**
* Gets a block from this chunk
*
* @param x 0-15
* @param y 0-127
* @param z 0-15
* @return the Block
*/
|
Gets a block from this chunk
|
getBlock
|
{
"repo_name": "PipeMC/Pipe",
"path": "src/main/java/org/bukkit/Chunk.java",
"license": "gpl-3.0",
"size": 3222
}
|
[
"org.bukkit.block.Block"
] |
import org.bukkit.block.Block;
|
import org.bukkit.block.*;
|
[
"org.bukkit.block"
] |
org.bukkit.block;
| 1,696,116
|
public void setStyle(Style style) {
if (style == null) {
throw new NullPointerException("Style is required");
}
this.style = style;
fireMapLayerListenerLayerChanged(MapLayerEvent.STYLE_CHANGED);
}
|
void function(Style style) { if (style == null) { throw new NullPointerException(STR); } this.style = style; fireMapLayerListenerLayerChanged(MapLayerEvent.STYLE_CHANGED); }
|
/**
* Sets the style for this layer.
*
* @param style The new style
*/
|
Sets the style for this layer
|
setStyle
|
{
"repo_name": "geotools/geotools",
"path": "modules/library/render/src/main/java/org/geotools/map/StyleLayer.java",
"license": "lgpl-2.1",
"size": 2357
}
|
[
"org.geotools.styling.Style"
] |
import org.geotools.styling.Style;
|
import org.geotools.styling.*;
|
[
"org.geotools.styling"
] |
org.geotools.styling;
| 746,999
|
public BigInteger optBigInteger(String key, BigInteger defaultValue) {
Object val = this.opt(key);
return objectToBigInteger(val, defaultValue);
}
|
BigInteger function(String key, BigInteger defaultValue) { Object val = this.opt(key); return objectToBigInteger(val, defaultValue); }
|
/**
* Get an optional BigInteger associated with a key, or the defaultValue if
* there is no such key or if its value is not a number. If the value is a
* string, an attempt will be made to evaluate it as a number.
*
* @param key
* A key string.
* @param defaultValue
* The default.
* @return An object which is the value.
*/
|
Get an optional BigInteger associated with a key, or the defaultValue if there is no such key or if its value is not a number. If the value is a string, an attempt will be made to evaluate it as a number
|
optBigInteger
|
{
"repo_name": "xushaomin/appleframework",
"path": "apple-commons/src/main/java/com/appleframework/tools/json/JSONObject.java",
"license": "apache-2.0",
"size": 93667
}
|
[
"java.math.BigInteger"
] |
import java.math.BigInteger;
|
import java.math.*;
|
[
"java.math"
] |
java.math;
| 2,067,035
|
Preconditions.checkArgument(!Strings.isNullOrEmpty(bucket));
Preconditions.checkArgument(!Strings.isNullOrEmpty(pattern));
deleteFromBucketRequest(bucket, pattern).execute();
}
|
Preconditions.checkArgument(!Strings.isNullOrEmpty(bucket)); Preconditions.checkArgument(!Strings.isNullOrEmpty(pattern)); deleteFromBucketRequest(bucket, pattern).execute(); }
|
/**
* Delete object matching pattern from Google Cloud Storage bucket of name bucket.
*
* @param bucket GCS bucket to delete from.
* @param pattern Pattern to match object name to delete from bucket.
* @throws IOException If there was an issue calling the GCS API.
*/
|
Delete object matching pattern from Google Cloud Storage bucket of name bucket
|
deleteFromBucket
|
{
"repo_name": "jenkinsci/google-storage-plugin",
"path": "src/main/java/com/google/jenkins/plugins/storage/client/StorageClient.java",
"license": "apache-2.0",
"size": 4896
}
|
[
"com.google.common.base.Preconditions",
"com.google.common.base.Strings"
] |
import com.google.common.base.Preconditions; import com.google.common.base.Strings;
|
import com.google.common.base.*;
|
[
"com.google.common"
] |
com.google.common;
| 2,861,041
|
@Override
public RequestMessage buildMessage(final RequestMessage.Builder builder) {
builder.processor("session");
builder.addArg(Tokens.ARGS_SESSION, sessionId);
return builder.create();
}
|
RequestMessage function(final RequestMessage.Builder builder) { builder.processor(STR); builder.addArg(Tokens.ARGS_SESSION, sessionId); return builder.create(); }
|
/**
* Adds the {@link Tokens#ARGS_SESSION} value to every {@link RequestMessage}.
*/
|
Adds the <code>Tokens#ARGS_SESSION</code> value to every <code>RequestMessage</code>
|
buildMessage
|
{
"repo_name": "rmagen/incubator-tinkerpop",
"path": "gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Client.java",
"license": "apache-2.0",
"size": 19652
}
|
[
"org.apache.tinkerpop.gremlin.driver.message.RequestMessage"
] |
import org.apache.tinkerpop.gremlin.driver.message.RequestMessage;
|
import org.apache.tinkerpop.gremlin.driver.message.*;
|
[
"org.apache.tinkerpop"
] |
org.apache.tinkerpop;
| 1,945,282
|
public static long getOffsetUnsafe(DataBuffer shapeInformation, int dim0, int dim1, int dim2) {
long offset = 0;
int size_0 = sizeUnsafe(shapeInformation, 0);
int size_1 = sizeUnsafe(shapeInformation, 1);
int size_2 = sizeUnsafe(shapeInformation, 2);
if (dim0 >= size_0 || dim1 >= size_1 || dim2 >= size_2)
throw new IllegalArgumentException("Invalid indices: cannot get [" + dim0 + "," + dim1 + "," + dim2
+ "] from a " + Arrays.toString(shape(shapeInformation)) + " NDArray");
if (size_0 != 1)
offset += dim0 * strideUnsafe(shapeInformation, 0, 3);
if (size_1 != 1)
offset += dim1 * strideUnsafe(shapeInformation, 1, 3);
if (size_2 != 1)
offset += dim2 * strideUnsafe(shapeInformation, 2, 3);
return offset;
}
|
static long function(DataBuffer shapeInformation, int dim0, int dim1, int dim2) { long offset = 0; int size_0 = sizeUnsafe(shapeInformation, 0); int size_1 = sizeUnsafe(shapeInformation, 1); int size_2 = sizeUnsafe(shapeInformation, 2); if (dim0 >= size_0 dim1 >= size_1 dim2 >= size_2) throw new IllegalArgumentException(STR + dim0 + "," + dim1 + "," + dim2 + STR + Arrays.toString(shape(shapeInformation)) + STR); if (size_0 != 1) offset += dim0 * strideUnsafe(shapeInformation, 0, 3); if (size_1 != 1) offset += dim1 * strideUnsafe(shapeInformation, 1, 3); if (size_2 != 1) offset += dim2 * strideUnsafe(shapeInformation, 2, 3); return offset; }
|
/**
* Identical to {@link Shape#getOffset(DataBuffer, int, int, int)} but without input validation on array rank
*/
|
Identical to <code>Shape#getOffset(DataBuffer, int, int, int)</code> but without input validation on array rank
|
getOffsetUnsafe
|
{
"repo_name": "huitseeker/nd4j",
"path": "nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/shape/Shape.java",
"license": "apache-2.0",
"size": 76141
}
|
[
"java.util.Arrays",
"org.nd4j.linalg.api.buffer.DataBuffer"
] |
import java.util.Arrays; import org.nd4j.linalg.api.buffer.DataBuffer;
|
import java.util.*; import org.nd4j.linalg.api.buffer.*;
|
[
"java.util",
"org.nd4j.linalg"
] |
java.util; org.nd4j.linalg;
| 1,722,785
|
public static void writeDouble(JsonWriter writer, String jsonProperty, Double dblValue, boolean writeEmpty) throws IOException, JsonException {
writeDouble(writer, jsonProperty, dblValue, writeEmpty ? JSONEmptyValueStrategy.NULL : JSONEmptyValueStrategy.NOPROPERTY);
}
|
static void function(JsonWriter writer, String jsonProperty, Double dblValue, boolean writeEmpty) throws IOException, JsonException { writeDouble(writer, jsonProperty, dblValue, writeEmpty ? JSONEmptyValueStrategy.NULL : JSONEmptyValueStrategy.NOPROPERTY); }
|
/**
* Writes a Double value for a given property
*
* @param writer
* @param jsonProperty
* @param dblValue
* @param writeEmpty
* @throws IOException
* @throws JsonException
*/
|
Writes a Double value for a given property
|
writeDouble
|
{
"repo_name": "OpenNTF/XPagesToolkit",
"path": "org.openntf.xpt.core/src/org/openntf/xpt/core/utils/JSONSupport.java",
"license": "apache-2.0",
"size": 6895
}
|
[
"com.ibm.commons.util.io.json.JsonException",
"com.ibm.domino.services.util.JsonWriter",
"java.io.IOException",
"org.openntf.xpt.core.json.JSONEmptyValueStrategy"
] |
import com.ibm.commons.util.io.json.JsonException; import com.ibm.domino.services.util.JsonWriter; import java.io.IOException; import org.openntf.xpt.core.json.JSONEmptyValueStrategy;
|
import com.ibm.commons.util.io.json.*; import com.ibm.domino.services.util.*; import java.io.*; import org.openntf.xpt.core.json.*;
|
[
"com.ibm.commons",
"com.ibm.domino",
"java.io",
"org.openntf.xpt"
] |
com.ibm.commons; com.ibm.domino; java.io; org.openntf.xpt;
| 485,515
|
FieldRef getCurrentCalleeField() {
FieldRef local = currentCalleeField;
if (local == null) {
local =
currentCalleeField =
FieldRef.createField(owner, CURRENT_CALLEE_FIELD, CompiledTemplate.class);
}
return local;
}
|
FieldRef getCurrentCalleeField() { FieldRef local = currentCalleeField; if (local == null) { local = currentCalleeField = FieldRef.createField(owner, CURRENT_CALLEE_FIELD, CompiledTemplate.class); } return local; }
|
/**
* Returns the field that holds the current callee template.
*
* <p>Unlike normal variables the VariableSet doesn't maintain responsibility for saving and
* restoring the current callee to a local.
*/
|
Returns the field that holds the current callee template. Unlike normal variables the VariableSet doesn't maintain responsibility for saving and restoring the current callee to a local
|
getCurrentCalleeField
|
{
"repo_name": "Medium/closure-templates",
"path": "java/src/com/google/template/soy/jbcsrc/TemplateVariableManager.java",
"license": "apache-2.0",
"size": 24360
}
|
[
"com.google.template.soy.jbcsrc.restricted.FieldRef",
"com.google.template.soy.jbcsrc.shared.CompiledTemplate"
] |
import com.google.template.soy.jbcsrc.restricted.FieldRef; import com.google.template.soy.jbcsrc.shared.CompiledTemplate;
|
import com.google.template.soy.jbcsrc.restricted.*; import com.google.template.soy.jbcsrc.shared.*;
|
[
"com.google.template"
] |
com.google.template;
| 498,743
|
@JsonProperty( "aws_ap_northeast_1" )
public void setAwsApNortheast1( String awsApNortheast1 ) {
this.awsApNortheast1 = awsApNortheast1;
}
|
@JsonProperty( STR ) void function( String awsApNortheast1 ) { this.awsApNortheast1 = awsApNortheast1; }
|
/**
* Sets aws ap northeast 1.
*
* @param awsApNortheast1 the aws ap northeast 1
*/
|
Sets aws ap northeast 1
|
setAwsApNortheast1
|
{
"repo_name": "tenable/Tenable.io-SDK-for-Java",
"path": "src/main/java/com/tenable/io/api/policies/models/PolicySettings.java",
"license": "mit",
"size": 90382
}
|
[
"com.fasterxml.jackson.annotation.JsonProperty"
] |
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.*;
|
[
"com.fasterxml.jackson"
] |
com.fasterxml.jackson;
| 1,164,761
|
public void measureLayoutRelativeToParent(
int tag,
Callback errorCallback,
Callback successCallback) {
try {
measureLayoutRelativeToParent(tag, mMeasureBuffer);
float relativeX = PixelUtil.toDIPFromPixel(mMeasureBuffer[0]);
float relativeY = PixelUtil.toDIPFromPixel(mMeasureBuffer[1]);
float width = PixelUtil.toDIPFromPixel(mMeasureBuffer[2]);
float height = PixelUtil.toDIPFromPixel(mMeasureBuffer[3]);
successCallback.invoke(relativeX, relativeY, width, height);
} catch (IllegalViewOperationException e) {
errorCallback.invoke(e.getMessage());
}
}
|
void function( int tag, Callback errorCallback, Callback successCallback) { try { measureLayoutRelativeToParent(tag, mMeasureBuffer); float relativeX = PixelUtil.toDIPFromPixel(mMeasureBuffer[0]); float relativeY = PixelUtil.toDIPFromPixel(mMeasureBuffer[1]); float width = PixelUtil.toDIPFromPixel(mMeasureBuffer[2]); float height = PixelUtil.toDIPFromPixel(mMeasureBuffer[3]); successCallback.invoke(relativeX, relativeY, width, height); } catch (IllegalViewOperationException e) { errorCallback.invoke(e.getMessage()); } }
|
/**
* Like {@link #measure} and {@link #measureLayout} but measures relative to the immediate parent.
*/
|
Like <code>#measure</code> and <code>#measureLayout</code> but measures relative to the immediate parent
|
measureLayoutRelativeToParent
|
{
"repo_name": "aksharora/ReactNativeDemoBasic",
"path": "node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java",
"license": "apache-2.0",
"size": 31553
}
|
[
"com.facebook.react.bridge.Callback"
] |
import com.facebook.react.bridge.Callback;
|
import com.facebook.react.bridge.*;
|
[
"com.facebook.react"
] |
com.facebook.react;
| 2,293,519
|
try {
TypesFactory theTypesFactory = (TypesFactory)EPackage.Registry.INSTANCE.getEFactory(TypesPackage.eNS_URI);
if (theTypesFactory != null) {
return theTypesFactory;
}
}
catch (Exception exception) {
EcorePlugin.INSTANCE.log(exception);
}
return new TypesFactoryImpl();
}
public TypesFactoryImpl() {
super();
}
|
try { TypesFactory theTypesFactory = (TypesFactory)EPackage.Registry.INSTANCE.getEFactory(TypesPackage.eNS_URI); if (theTypesFactory != null) { return theTypesFactory; } } catch (Exception exception) { EcorePlugin.INSTANCE.log(exception); } return new TypesFactoryImpl(); } public TypesFactoryImpl() { super(); }
|
/**
* Creates the default factory implementation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
|
Creates the default factory implementation.
|
init
|
{
"repo_name": "uppaal-emf/uppaal",
"path": "metamodel/org.muml.uppaal/src/org/muml/uppaal/types/impl/TypesFactoryImpl.java",
"license": "epl-1.0",
"size": 6474
}
|
[
"org.eclipse.emf.ecore.EPackage",
"org.eclipse.emf.ecore.plugin.EcorePlugin",
"org.muml.uppaal.types.TypesFactory",
"org.muml.uppaal.types.TypesPackage"
] |
import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.plugin.EcorePlugin; import org.muml.uppaal.types.TypesFactory; import org.muml.uppaal.types.TypesPackage;
|
import org.eclipse.emf.ecore.*; import org.eclipse.emf.ecore.plugin.*; import org.muml.uppaal.types.*;
|
[
"org.eclipse.emf",
"org.muml.uppaal"
] |
org.eclipse.emf; org.muml.uppaal;
| 104,485
|
private void checkLayoutString(final String expected) throws ConfigurationException {
assertEquals("Wrong layout file content", expected, getLayoutString());
}
|
void function(final String expected) throws ConfigurationException { assertEquals(STR, expected, getLayoutString()); }
|
/**
* Checks if the layout's output is correct.
*
* @param expected the expected result
* @throws ConfigurationException if an error occurs
*/
|
Checks if the layout's output is correct
|
checkLayoutString
|
{
"repo_name": "apache/commons-configuration",
"path": "src/test/java/org/apache/commons/configuration2/TestPropertiesConfigurationLayout.java",
"license": "apache-2.0",
"size": 29381
}
|
[
"org.apache.commons.configuration2.ex.ConfigurationException",
"org.junit.Assert"
] |
import org.apache.commons.configuration2.ex.ConfigurationException; import org.junit.Assert;
|
import org.apache.commons.configuration2.ex.*; import org.junit.*;
|
[
"org.apache.commons",
"org.junit"
] |
org.apache.commons; org.junit;
| 2,004,713
|
public String nextToken() {
if (!stateOK()) {
throw new NoSuchElementException(
"StringDelimiter.nextToken(): null or empty string.");
}
int i = string.indexOf(delimiter, cursor);
if (i == -1) {
if (cursor < string.length()) {
String token = string.substring(cursor);
cursor = string.length();
return token;
}
else {
throw new NoSuchElementException(
"StringDelimiter.nextToken(): no more tokens.");
}
}
else {
String token = string.substring(cursor, i);
cursor = i + delimiterLen;
return token;
}
}
|
String function() { if (!stateOK()) { throw new NoSuchElementException( STR); } int i = string.indexOf(delimiter, cursor); if (i == -1) { if (cursor < string.length()) { String token = string.substring(cursor); cursor = string.length(); return token; } else { throw new NoSuchElementException( STR); } } else { String token = string.substring(cursor, i); cursor = i + delimiterLen; return token; } }
|
/**
* <p>The next token, given the current parsing cursor, and the
* configured (initialized) delimiter.</p>
* @return The next token.
* @throws NoSuchElementException The string is null or empty.
*/
|
The next token, given the current parsing cursor, and the configured (initialized) delimiter
|
nextToken
|
{
"repo_name": "jsmithabq/yaak",
"path": "src/yaak/util/StringDelimiter.java",
"license": "lgpl-3.0",
"size": 6281
}
|
[
"java.util.NoSuchElementException"
] |
import java.util.NoSuchElementException;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,750,782
|
static public Test suite() {
// the suite made here will all be using the tests from this class
MultiConfigSuiteBuilder builder = new MultiConfigSuiteBuilder(TestFailuresSuite.class);
// build up a project builder for the workload
VoltProjectBuilder project = new VoltProjectBuilder();
project.addSchema(DivideByZero.class.getResource("failures-ddl.sql"));
project.addPartitionInfo("NEW_ORDER", "NO_W_ID");
project.addPartitionInfo("FIVEK_STRING", "P");
project.addPartitionInfo("FIVEK_STRING_WITH_INDEX", "ID");
project.addPartitionInfo("WIDE", "P");
//project.addPartitionInfo("BAD_COMPARES", "ID");
project.addProcedures(PROCEDURES);
project.addStmtProcedure("InsertNewOrder", "INSERT INTO NEW_ORDER VALUES (?, ?, ?);", "NEW_ORDER.NO_W_ID: 2");
/////////////////////////////////////////////////////////////
// CONFIG #1: 2 Local Site/Partitions running on JNI backend
/////////////////////////////////////////////////////////////
// get a server config for the native backend with two sites/partitions
VoltServerConfig config = new LocalCluster("failures-twosites.jar", 2, 1, 0, BackendTarget.NATIVE_EE_JNI);
// build the jarfile (note the reuse of the TPCC project)
if (!config.compile(project)) fail();
// add this config to the set of tests to run
builder.addServerConfig(config);
/////////////////////////////////////////////////////////////
// CONFIG #2: 1 Local Site/Partition running on HSQL backend
/////////////////////////////////////////////////////////////
// get a server config that similar, but doesn't use the same backend
config = new LocalCluster("failures-hsql.jar", 1, 1, 0, BackendTarget.HSQLDB_BACKEND);
// build the jarfile (note the reuse of the TPCC project)
if (!config.compile(project)) fail();
// add this config to the set of tests to run
builder.addServerConfig(config);
/////////////////////////////////////////////////////////////
// CONFIG #3: N=2 K=1 Cluster
/////////////////////////////////////////////////////////////
config = new LocalCluster("failures-cluster.jar", 2, 2, 1, BackendTarget.NATIVE_EE_JNI);
if (!config.compile(project)) fail();
builder.addServerConfig(config);
return builder;
}
|
static Test function() { MultiConfigSuiteBuilder builder = new MultiConfigSuiteBuilder(TestFailuresSuite.class); VoltProjectBuilder project = new VoltProjectBuilder(); project.addSchema(DivideByZero.class.getResource(STR)); project.addPartitionInfo(STR, STR); project.addPartitionInfo(STR, "P"); project.addPartitionInfo(STR, "ID"); project.addPartitionInfo("WIDE", "P"); project.addProcedures(PROCEDURES); project.addStmtProcedure(STR, STR, STR); VoltServerConfig config = new LocalCluster(STR, 2, 1, 0, BackendTarget.NATIVE_EE_JNI); if (!config.compile(project)) fail(); builder.addServerConfig(config); config = new LocalCluster(STR, 1, 1, 0, BackendTarget.HSQLDB_BACKEND); if (!config.compile(project)) fail(); builder.addServerConfig(config); config = new LocalCluster(STR, 2, 2, 1, BackendTarget.NATIVE_EE_JNI); if (!config.compile(project)) fail(); builder.addServerConfig(config); return builder; }
|
/**
* Build a list of the tests that will be run when TestFailuresSuite gets run by JUnit.
* Use helper classes that are part of the RegressionSuite framework.
*
* @return The TestSuite containing all the tests to be run.
*/
|
Build a list of the tests that will be run when TestFailuresSuite gets run by JUnit. Use helper classes that are part of the RegressionSuite framework
|
suite
|
{
"repo_name": "kobronson/cs-voltdb",
"path": "tests/frontend/org/voltdb/regressionsuites/TestFailuresSuite.java",
"license": "agpl-3.0",
"size": 20869
}
|
[
"junit.framework.Test",
"org.voltdb.BackendTarget",
"org.voltdb.compiler.VoltProjectBuilder",
"org.voltdb_testprocs.regressionsuites.failureprocs.DivideByZero"
] |
import junit.framework.Test; import org.voltdb.BackendTarget; import org.voltdb.compiler.VoltProjectBuilder; import org.voltdb_testprocs.regressionsuites.failureprocs.DivideByZero;
|
import junit.framework.*; import org.voltdb.*; import org.voltdb.compiler.*; import org.voltdb_testprocs.regressionsuites.failureprocs.*;
|
[
"junit.framework",
"org.voltdb",
"org.voltdb.compiler",
"org.voltdb_testprocs.regressionsuites"
] |
junit.framework; org.voltdb; org.voltdb.compiler; org.voltdb_testprocs.regressionsuites;
| 2,351,729
|
private void verifyUpdate(RemoteProcessGroup remoteProcessGroup, RemoteProcessGroupDTO remoteProcessGroupDto) {
// see if the remote process group can start/stop transmitting
if (isNotNull(remoteProcessGroupDto.isTransmitting())) {
if (!remoteProcessGroup.isTransmitting() && remoteProcessGroupDto.isTransmitting()) {
remoteProcessGroup.verifyCanStartTransmitting();
} else if (remoteProcessGroup.isTransmitting() && !remoteProcessGroupDto.isTransmitting()) {
remoteProcessGroup.verifyCanStopTransmitting();
}
}
// validate the proposed configuration
validateProposedRemoteProcessGroupConfiguration(remoteProcessGroupDto);
// if any remote group properties are changing, verify update
if (isAnyNotNull(remoteProcessGroupDto.getYieldDuration(), remoteProcessGroupDto.getCommunicationsTimeout())) {
remoteProcessGroup.verifyCanUpdate();
}
}
|
void function(RemoteProcessGroup remoteProcessGroup, RemoteProcessGroupDTO remoteProcessGroupDto) { if (isNotNull(remoteProcessGroupDto.isTransmitting())) { if (!remoteProcessGroup.isTransmitting() && remoteProcessGroupDto.isTransmitting()) { remoteProcessGroup.verifyCanStartTransmitting(); } else if (remoteProcessGroup.isTransmitting() && !remoteProcessGroupDto.isTransmitting()) { remoteProcessGroup.verifyCanStopTransmitting(); } } validateProposedRemoteProcessGroupConfiguration(remoteProcessGroupDto); if (isAnyNotNull(remoteProcessGroupDto.getYieldDuration(), remoteProcessGroupDto.getCommunicationsTimeout())) { remoteProcessGroup.verifyCanUpdate(); } }
|
/**
* Verifies the specified remote group can be updated, if necessary.
*
* @param remoteProcessGroup
* @param remoteProcessGroupDto
*/
|
Verifies the specified remote group can be updated, if necessary
|
verifyUpdate
|
{
"repo_name": "rdblue/incubator-nifi",
"path": "nar-bundles/framework-bundle/framework/web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardRemoteProcessGroupDAO.java",
"license": "apache-2.0",
"size": 17421
}
|
[
"org.apache.nifi.groups.RemoteProcessGroup",
"org.apache.nifi.web.api.dto.RemoteProcessGroupDTO"
] |
import org.apache.nifi.groups.RemoteProcessGroup; import org.apache.nifi.web.api.dto.RemoteProcessGroupDTO;
|
import org.apache.nifi.groups.*; import org.apache.nifi.web.api.dto.*;
|
[
"org.apache.nifi"
] |
org.apache.nifi;
| 2,150,147
|
Map<String, List<String>> getParameterValuesMap();
|
Map<String, List<String>> getParameterValuesMap();
|
/**
* Get all parameters as a map of key => values, supports more than one pr key (so values is a collection)
*/
|
Get all parameters as a map of key => values, supports more than one pr key (so values is a collection)
|
getParameterValuesMap
|
{
"repo_name": "minagri-rwanda/DHIS2-Agriculture",
"path": "dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/service/ContextService.java",
"license": "bsd-3-clause",
"size": 2929
}
|
[
"java.util.List",
"java.util.Map"
] |
import java.util.List; import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 853,853
|
public void removeLastReplyDate(org.ontoware.rdf2go.model.node.Node value) {
Base.remove(this.model, this.getResource(), LASTREPLYDATE, value);
}
|
void function(org.ontoware.rdf2go.model.node.Node value) { Base.remove(this.model, this.getResource(), LASTREPLYDATE, value); }
|
/**
* Removes a value of property LastReplyDate as an RDF2Go node
*
* @param value
* the value to be removed
*
* [Generated from RDFReactor template rule #remove1dynamic]
*/
|
Removes a value of property LastReplyDate as an RDF2Go node
|
removeLastReplyDate
|
{
"repo_name": "m0ep/master-thesis",
"path": "source/apis/rdf2go/rdf2go-sioc/src/main/java/org/rdfs/sioc/Thing.java",
"license": "mit",
"size": 317844
}
|
[
"org.ontoware.rdfreactor.runtime.Base"
] |
import org.ontoware.rdfreactor.runtime.Base;
|
import org.ontoware.rdfreactor.runtime.*;
|
[
"org.ontoware.rdfreactor"
] |
org.ontoware.rdfreactor;
| 1,083,777
|
EReference getDocumentRoot_CorrelationPropertyBinding();
|
EReference getDocumentRoot_CorrelationPropertyBinding();
|
/**
* Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getCorrelationPropertyBinding <em>Correlation Property Binding</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference '<em>Correlation Property Binding</em>'.
* @see org.eclipse.bpmn2.DocumentRoot#getCorrelationPropertyBinding()
* @see #getDocumentRoot()
* @generated
*/
|
Returns the meta object for the containment reference '<code>org.eclipse.bpmn2.DocumentRoot#getCorrelationPropertyBinding Correlation Property Binding</code>'.
|
getDocumentRoot_CorrelationPropertyBinding
|
{
"repo_name": "lqjack/fixflow",
"path": "modules/fixflow-core/src/main/java/org/eclipse/bpmn2/Bpmn2Package.java",
"license": "apache-2.0",
"size": 1014933
}
|
[
"org.eclipse.emf.ecore.EReference"
] |
import org.eclipse.emf.ecore.EReference;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 1,407,829
|
@Override
public void testEmpty() throws IOException
{
testExec(this.progName, 1, "",
"^encodesavegame: ERROR! Unable to read XML document: .*");
}
|
void function() throws IOException { testExec(this.progName, 1, STR^encodesavegame: ERROR! Unable to read XML document: .*"); }
|
/**
* Tests empty call
*
* @throws IOException When file operation fails.
*/
|
Tests empty call
|
testEmpty
|
{
"repo_name": "kayahr/wlandsuite",
"path": "src/test/java/de/ailis/wlandsuite/EncodeSavegameTest.java",
"license": "mit",
"size": 2589
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 141,917
|
ServiceResponse<Void> putBool(BooleanWrapper complexBody) throws ErrorException, IOException, IllegalArgumentException;
|
ServiceResponse<Void> putBool(BooleanWrapper complexBody) throws ErrorException, IOException, IllegalArgumentException;
|
/**
* Put complex types with bool properties.
*
* @param complexBody Please put true and false
* @throws ErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @throws IllegalArgumentException exception thrown from invalid parameters
* @return the {@link ServiceResponse} object if successful.
*/
|
Put complex types with bool properties
|
putBool
|
{
"repo_name": "haocs/autorest",
"path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/bodycomplex/Primitives.java",
"license": "mit",
"size": 25059
}
|
[
"com.microsoft.rest.ServiceResponse",
"java.io.IOException"
] |
import com.microsoft.rest.ServiceResponse; import java.io.IOException;
|
import com.microsoft.rest.*; import java.io.*;
|
[
"com.microsoft.rest",
"java.io"
] |
com.microsoft.rest; java.io;
| 502,090
|
public static NBTTagCompound getNBT(ItemStack stack) {
initNBT(stack);
return stack.getTagCompound();
}
// SETTERS ///////////////////////////////////////////////////////////////////
|
static NBTTagCompound function(ItemStack stack) { initNBT(stack); return stack.getTagCompound(); }
|
/**
* Gets the NBTTagCompound in an ItemStack. Tries to init it
* previously in case there isn't one present *
*/
|
Gets the NBTTagCompound in an ItemStack. Tries to init it previously in case there isn't one present
|
getNBT
|
{
"repo_name": "pixlepix/CompositeReactors",
"path": "src/main/java/pixlepix/reactors/lexicon/common/core/helper/ItemNBTHelper.java",
"license": "mit",
"size": 4958
}
|
[
"net.minecraft.item.ItemStack",
"net.minecraft.nbt.NBTTagCompound"
] |
import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.item.*; import net.minecraft.nbt.*;
|
[
"net.minecraft.item",
"net.minecraft.nbt"
] |
net.minecraft.item; net.minecraft.nbt;
| 2,341,998
|
void suspendProcessDefinitionByKey(String processDefinitionKey, boolean suspendProcessInstances, Date suspensionDate);
|
void suspendProcessDefinitionByKey(String processDefinitionKey, boolean suspendProcessInstances, Date suspensionDate);
|
/**
* Suspends the <strong>all<strong> process definitions with the given key (= id in the bpmn20.xml file).
*
* If a process definition is in state suspended, it will not be possible to start new process instances
* based on the process definition.
*
* @param suspendProcessInstances If true, all the process instances of the provided process definition
* will be suspended too.
* @param suspensionDate The date on which the process definition will be suspended. If null, the
* process definition is suspended immediately.
* Note: The job executor needs to be active to use this!
* @throws ActivitiObjectNotFoundException if no such processDefinition can be found
* @throws ActivitiException if the process definition is already in state suspended.
*/
|
Suspends the all process definitions with the given key (= id in the bpmn20.xml file). If a process definition is in state suspended, it will not be possible to start new process instances based on the process definition
|
suspendProcessDefinitionByKey
|
{
"repo_name": "springvelocity/xbpm5",
"path": "activiti-engine/src/main/java/org/activiti/engine/RepositoryService.java",
"license": "apache-2.0",
"size": 15429
}
|
[
"java.util.Date"
] |
import java.util.Date;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 471,457
|
public float getFloat(String key, float defaultValue) {
if(context!=null){
return context.getSharedPreferences(prefName, Context.MODE_PRIVATE)
.getFloat(key, defaultValue);
}
return defaultValue;
}
|
float function(String key, float defaultValue) { if(context!=null){ return context.getSharedPreferences(prefName, Context.MODE_PRIVATE) .getFloat(key, defaultValue); } return defaultValue; }
|
/**
* Returns float value for the given key, defaultValue if no value is found.
* @param key
* @param defaultValue
* @return float
*/
|
Returns float value for the given key, defaultValue if no value is found
|
getFloat
|
{
"repo_name": "FDoubleman/wd-edx-android",
"path": "VideoLocker/src/main/java/org/edx/mobile/module/prefs/PrefManager.java",
"license": "apache-2.0",
"size": 13285
}
|
[
"android.content.Context"
] |
import android.content.Context;
|
import android.content.*;
|
[
"android.content"
] |
android.content;
| 1,762,858
|
public static <T> T unwrapExceptions(CheckedSupplier<T> supplier) {
try {
return supplier.get();
} catch (ExecutionException e) {
sneakyThrow(e.getCause());
return null;
} catch (FailsafeException e) {
sneakyThrow(e.getCause() == null ? e : e.getCause());
return null;
} catch (RuntimeException | Error e) {
throw e;
} catch (Throwable t) {
throw new RuntimeException(t);
}
}
|
static <T> T function(CheckedSupplier<T> supplier) { try { return supplier.get(); } catch (ExecutionException e) { sneakyThrow(e.getCause()); return null; } catch (FailsafeException e) { sneakyThrow(e.getCause() == null ? e : e.getCause()); return null; } catch (RuntimeException Error e) { throw e; } catch (Throwable t) { throw new RuntimeException(t); } }
|
/**
* Unwraps and throws ExecutionException and FailsafeException causes.
*/
|
Unwraps and throws ExecutionException and FailsafeException causes
|
unwrapExceptions
|
{
"repo_name": "jhalterman/recurrent",
"path": "src/test/java/net/jodah/failsafe/Testing.java",
"license": "apache-2.0",
"size": 5335
}
|
[
"java.util.concurrent.ExecutionException",
"net.jodah.failsafe.function.CheckedSupplier"
] |
import java.util.concurrent.ExecutionException; import net.jodah.failsafe.function.CheckedSupplier;
|
import java.util.concurrent.*; import net.jodah.failsafe.function.*;
|
[
"java.util",
"net.jodah.failsafe"
] |
java.util; net.jodah.failsafe;
| 1,963,666
|
public boolean hasChangeSetComputed() {
File changelogFile = new File(getRootDir(), "changelog.xml");
return changelogFile.exists();
}
|
boolean function() { File changelogFile = new File(getRootDir(), STR); return changelogFile.exists(); }
|
/**
* Returns true if the changelog is already computed.
*/
|
Returns true if the changelog is already computed
|
hasChangeSetComputed
|
{
"repo_name": "sumitk1/jenkins",
"path": "core/src/main/java/hudson/model/AbstractBuild.java",
"license": "mit",
"size": 45066
}
|
[
"java.io.File"
] |
import java.io.File;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,039,649
|
Promise<Void> stopProcess(@NotNull String workspaceId,
@NotNull String machineId,
int processId);
|
Promise<Void> stopProcess(@NotNull String workspaceId, @NotNull String machineId, int processId);
|
/**
* Stop process in machine.
*
* @param workspaceId
* ID of workspace
* @param machineId
* ID of the machine where process should be stopped
* @param processId
* ID of the process to stop
* @return a promise that will resolve when the process has been stopped, or rejects with an error
*/
|
Stop process in machine
|
stopProcess
|
{
"repo_name": "slemeur/che",
"path": "ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/machine/MachineServiceClient.java",
"license": "epl-1.0",
"size": 3895
}
|
[
"javax.validation.constraints.NotNull",
"org.eclipse.che.api.promises.client.Promise"
] |
import javax.validation.constraints.NotNull; import org.eclipse.che.api.promises.client.Promise;
|
import javax.validation.constraints.*; import org.eclipse.che.api.promises.client.*;
|
[
"javax.validation",
"org.eclipse.che"
] |
javax.validation; org.eclipse.che;
| 804,502
|
@ServiceMethod(returns = ReturnType.SINGLE)
void updateExtensions(String deviceId, String extensionId, MicrosoftGraphExtensionInner body);
|
@ServiceMethod(returns = ReturnType.SINGLE) void updateExtensions(String deviceId, String extensionId, MicrosoftGraphExtensionInner body);
|
/**
* Update the navigation property extensions in devices.
*
* @param deviceId key: id of device.
* @param extensionId key: id of extension.
* @param body New navigation property values.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is
* rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
|
Update the navigation property extensions in devices
|
updateExtensions
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/DevicesClient.java",
"license": "mit",
"size": 81714
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.resourcemanager.authorization.fluent.models.MicrosoftGraphExtensionInner"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.authorization.fluent.models.MicrosoftGraphExtensionInner;
|
import com.azure.core.annotation.*; import com.azure.resourcemanager.authorization.fluent.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 448,618
|
@Test(expected = IllegalArgumentException.class)
public void test_saveBillings_accountIdZero() throws Exception {
instance.saveBillings(0, Arrays.asList(new Billing()));
}
|
@Test(expected = IllegalArgumentException.class) void function() throws Exception { instance.saveBillings(0, Arrays.asList(new Billing())); }
|
/**
* <p>
* Failure test for the method <code>saveBillings(long accountId, List<Billing> billings)</code> with
* accountId is zero.<br>
* <code>IllegalArgumentException</code> is expected.
* </p>
*
* @throws Exception
* to JUnit.
*/
|
Failure test for the method <code>saveBillings(long accountId, List<Billing> billings)</code> with accountId is zero. <code>IllegalArgumentException</code> is expected.
|
test_saveBillings_accountIdZero
|
{
"repo_name": "NASA-Tournament-Lab/CoECI-OPM-Service-Credit-Redeposit-Deposit-Application",
"path": "Code/Batch_Processing/src/java/tests/gov/opm/scrd/services/impl/AccountServiceImplUnitTests.java",
"license": "apache-2.0",
"size": 61048
}
|
[
"gov.opm.scrd.entities.application.Billing",
"java.util.Arrays",
"org.junit.Test"
] |
import gov.opm.scrd.entities.application.Billing; import java.util.Arrays; import org.junit.Test;
|
import gov.opm.scrd.entities.application.*; import java.util.*; import org.junit.*;
|
[
"gov.opm.scrd",
"java.util",
"org.junit"
] |
gov.opm.scrd; java.util; org.junit;
| 1,749,153
|
public void onBlockClicked(World p_149699_1_, int p_149699_2_, int p_149699_3_, int p_149699_4_, EntityPlayer p_149699_5_)
{
this.func_150036_b(p_149699_1_, p_149699_2_, p_149699_3_, p_149699_4_, p_149699_5_);
}
|
void function(World p_149699_1_, int p_149699_2_, int p_149699_3_, int p_149699_4_, EntityPlayer p_149699_5_) { this.func_150036_b(p_149699_1_, p_149699_2_, p_149699_3_, p_149699_4_, p_149699_5_); }
|
/**
* Called when a player hits the block. Args: world, x, y, z, player
*/
|
Called when a player hits the block. Args: world, x, y, z, player
|
onBlockClicked
|
{
"repo_name": "TheHecticByte/BananaJ1.7.10Beta",
"path": "src/net/minecraft/Server1_7_10/block/BlockCake.java",
"license": "gpl-3.0",
"size": 4805
}
|
[
"net.minecraft.Server1_7_10"
] |
import net.minecraft.Server1_7_10;
|
import net.minecraft.*;
|
[
"net.minecraft"
] |
net.minecraft;
| 1,167,586
|
public IRandGen createRandGen() {
return randGenFactory.createRandGen();
}
/////////////////////////////////////////////////////////////////
// ---------------------------- Implementing IConfigure interface
/////////////////////////////////////////////////////////////////
|
IRandGen function() { return randGenFactory.createRandGen(); }
|
/**
* <p>
* Factory method.
*
* @return A new instance of a random generator
* </p>
*/
|
Factory method
|
createRandGen
|
{
"repo_name": "SCI2SUGR/KEEL",
"path": "src/keel/Algorithms/Neural_Networks/NNEP_Common/algorithm/NeuralNetAlgorithm.java",
"license": "gpl-3.0",
"size": 33299
}
|
[
"net.sf.jclec.util.random.IRandGen"
] |
import net.sf.jclec.util.random.IRandGen;
|
import net.sf.jclec.util.random.*;
|
[
"net.sf.jclec"
] |
net.sf.jclec;
| 1,531,899
|
public static void fetchHandBookArticleAfterUpdate(final Context context){
ParseQuery<ParseObject> query = ParseQuery.getQuery("Article");
if (lastUpdate != null) {
query.whereGreaterThan("updatedAt", lastUpdate);
}
query.findInBackground(new FindCallback<ParseObject>() {
|
static void function(final Context context){ ParseQuery<ParseObject> query = ParseQuery.getQuery(STR); if (lastUpdate != null) { query.whereGreaterThan(STR, lastUpdate); } query.findInBackground(new FindCallback<ParseObject>() {
|
/**
* Fetches {@link CasePatient} from Parse, after lastUpdate, and tries to
* put them in to the local database, using {@link HandbookDAO}.
*/
|
Fetches <code>CasePatient</code> from Parse, after lastUpdate, and tries to put them in to the local database, using <code>HandbookDAO</code>
|
fetchHandBookArticleAfterUpdate
|
{
"repo_name": "espehel/UbiLearn",
"path": "UbiLearnProject/src/no/ntnu/stud/ubilearn/parse/SyncContent.java",
"license": "apache-2.0",
"size": 18983
}
|
[
"android.content.Context",
"com.parse.FindCallback",
"com.parse.ParseObject",
"com.parse.ParseQuery"
] |
import android.content.Context; import com.parse.FindCallback; import com.parse.ParseObject; import com.parse.ParseQuery;
|
import android.content.*; import com.parse.*;
|
[
"android.content",
"com.parse"
] |
android.content; com.parse;
| 2,617,589
|
public void writePacketData(PacketBuffer p_148840_1_) throws IOException
{
p_148840_1_.writeInt(this.field_149133_a);
p_148840_1_.writeInt(this.field_149131_b);
p_148840_1_.writeInt(this.field_149132_c);
}
|
void function(PacketBuffer p_148840_1_) throws IOException { p_148840_1_.writeInt(this.field_149133_a); p_148840_1_.writeInt(this.field_149131_b); p_148840_1_.writeInt(this.field_149132_c); }
|
/**
* Writes the raw packet data to the data stream.
*/
|
Writes the raw packet data to the data stream
|
writePacketData
|
{
"repo_name": "mviitanen/marsmod",
"path": "mcp/src/minecraft_server/net/minecraft/network/play/server/S36PacketSignEditorOpen.java",
"license": "gpl-2.0",
"size": 1620
}
|
[
"java.io.IOException",
"net.minecraft.network.PacketBuffer"
] |
import java.io.IOException; import net.minecraft.network.PacketBuffer;
|
import java.io.*; import net.minecraft.network.*;
|
[
"java.io",
"net.minecraft.network"
] |
java.io; net.minecraft.network;
| 1,378,894
|
protected static String[] parseStrings(String text, String delimiter) {
Collection<String> tokens = new ArrayList<String>();
if(text!=null) {
// get the first token
String next = text;
int i = text.indexOf(delimiter);
if(i==-1) { // no delimiter
tokens.add(stripQuotes(next));
text = null;
} else {
next = text.substring(0, i);
text = text.substring(i+1);
}
// iterate thru the tokens and add to token list
while(text!=null) {
tokens.add(stripQuotes(next));
i = text.indexOf(delimiter);
if(i==-1) { // no delimiter
next = text;
tokens.add(stripQuotes(next));
text = null;
} else {
next = text.substring(0, i).trim();
text = text.substring(i+1);
}
}
}
return tokens.toArray(new String[0]);
}
|
static String[] function(String text, String delimiter) { Collection<String> tokens = new ArrayList<String>(); if(text!=null) { String next = text; int i = text.indexOf(delimiter); if(i==-1) { tokens.add(stripQuotes(next)); text = null; } else { next = text.substring(0, i); text = text.substring(i+1); } while(text!=null) { tokens.add(stripQuotes(next)); i = text.indexOf(delimiter); if(i==-1) { next = text; tokens.add(stripQuotes(next)); text = null; } else { next = text.substring(0, i).trim(); text = text.substring(i+1); } } } return tokens.toArray(new String[0]); }
|
/**
* Parses a String into tokens separated by a specified delimiter. A token
* may be "".
*
* @param text the text to parse
* @param delimiter the delimiter
* @return an array of String tokens
*/
|
Parses a String into tokens separated by a specified delimiter. A token may be ""
|
parseStrings
|
{
"repo_name": "dobrown/tracker-mvn",
"path": "src/main/java/org/opensourcephysics/display/DataFile.java",
"license": "gpl-3.0",
"size": 14131
}
|
[
"java.util.ArrayList",
"java.util.Collection"
] |
import java.util.ArrayList; import java.util.Collection;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,494,015
|
public Complex parse(String source) throws ParseException {
ParsePosition parsePosition = new ParsePosition(0);
Complex result = parse(source, parsePosition);
if (parsePosition.getIndex() == 0) {
throw MathRuntimeException.createParseException(
parsePosition.getErrorIndex(),
LocalizedFormats.UNPARSEABLE_COMPLEX_NUMBER, source);
}
return result;
}
|
Complex function(String source) throws ParseException { ParsePosition parsePosition = new ParsePosition(0); Complex result = parse(source, parsePosition); if (parsePosition.getIndex() == 0) { throw MathRuntimeException.createParseException( parsePosition.getErrorIndex(), LocalizedFormats.UNPARSEABLE_COMPLEX_NUMBER, source); } return result; }
|
/**
* Parses a string to produce a {@link Complex} object.
*
* @param source the string to parse
* @return the parsed {@link Complex} object.
* @exception ParseException if the beginning of the specified string
* cannot be parsed.
*/
|
Parses a string to produce a <code>Complex</code> object
|
parse
|
{
"repo_name": "SpoonLabs/astor",
"path": "examples/math_63/src/main/java/org/apache/commons/math/complex/ComplexFormat.java",
"license": "gpl-2.0",
"size": 13342
}
|
[
"java.text.ParseException",
"java.text.ParsePosition",
"org.apache.commons.math.MathRuntimeException",
"org.apache.commons.math.exception.util.LocalizedFormats"
] |
import java.text.ParseException; import java.text.ParsePosition; import org.apache.commons.math.MathRuntimeException; import org.apache.commons.math.exception.util.LocalizedFormats;
|
import java.text.*; import org.apache.commons.math.*; import org.apache.commons.math.exception.util.*;
|
[
"java.text",
"org.apache.commons"
] |
java.text; org.apache.commons;
| 754,248
|
Observable<ServiceResponseWithHeaders<Void, LROsCustomHeaderPost202Retry200Headers>> beginPost202Retry200Async(Product product);
|
Observable<ServiceResponseWithHeaders<Void, LROsCustomHeaderPost202Retry200Headers>> beginPost202Retry200Async(Product product);
|
/**
* x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success.
*
* @param product Product to put
* @return the {@link ServiceResponseWithHeaders} object if successful.
*/
|
x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success
|
beginPost202Retry200Async
|
{
"repo_name": "haocs/autorest",
"path": "src/generator/AutoRest.Java.Azure.Tests/src/main/java/fixtures/lro/LROsCustomHeaders.java",
"license": "mit",
"size": 28319
}
|
[
"com.microsoft.rest.ServiceResponseWithHeaders"
] |
import com.microsoft.rest.ServiceResponseWithHeaders;
|
import com.microsoft.rest.*;
|
[
"com.microsoft.rest"
] |
com.microsoft.rest;
| 2,721,717
|
public SelectQuery toSelectQuery(
final DataSource dataSource,
final RowSignature sourceRowSignature
)
{
if (grouping != null) {
return null;
}
final Filtration filtration = Filtration.create(filter).optimize(sourceRowSignature);
final boolean descending;
if (limitSpec != null) {
// Safe to assume limitSpec has zero or one entry; DruidSelectSortRule wouldn't push in anything else.
if (limitSpec.getColumns().size() > 0) {
final OrderByColumnSpec orderBy = Iterables.getOnlyElement(limitSpec.getColumns());
if (!orderBy.getDimension().equals(Column.TIME_COLUMN_NAME)) {
throw new ISE("WTF?! Got select with non-time orderBy[%s]", orderBy);
}
descending = orderBy.getDirection() == OrderByColumnSpec.Direction.DESCENDING;
} else {
descending = false;
}
} else {
descending = false;
}
return new SelectQuery(
dataSource,
filtration.getQuerySegmentSpec(),
descending,
filtration.getDimFilter(),
QueryGranularities.ALL,
selectProjection != null ? selectProjection.getDimensions() : ImmutableList.<DimensionSpec>of(),
selectProjection != null ? selectProjection.getMetrics() : ImmutableList.<String>of(),
null,
new PagingSpec(null, 0) ,
null
);
}
|
SelectQuery function( final DataSource dataSource, final RowSignature sourceRowSignature ) { if (grouping != null) { return null; } final Filtration filtration = Filtration.create(filter).optimize(sourceRowSignature); final boolean descending; if (limitSpec != null) { if (limitSpec.getColumns().size() > 0) { final OrderByColumnSpec orderBy = Iterables.getOnlyElement(limitSpec.getColumns()); if (!orderBy.getDimension().equals(Column.TIME_COLUMN_NAME)) { throw new ISE(STR, orderBy); } descending = orderBy.getDirection() == OrderByColumnSpec.Direction.DESCENDING; } else { descending = false; } } else { descending = false; } return new SelectQuery( dataSource, filtration.getQuerySegmentSpec(), descending, filtration.getDimFilter(), QueryGranularities.ALL, selectProjection != null ? selectProjection.getDimensions() : ImmutableList.<DimensionSpec>of(), selectProjection != null ? selectProjection.getMetrics() : ImmutableList.<String>of(), null, new PagingSpec(null, 0) , null ); }
|
/**
* Return this query as a Select query, or null if this query is not compatible with Select.
*
* @param dataSource data source to query
* @param sourceRowSignature row signature of the dataSource
*
* @return query or null
*/
|
Return this query as a Select query, or null if this query is not compatible with Select
|
toSelectQuery
|
{
"repo_name": "potto007/druid-avro",
"path": "sql/src/main/java/io/druid/sql/calcite/rel/DruidQueryBuilder.java",
"license": "apache-2.0",
"size": 19803
}
|
[
"com.google.common.collect.ImmutableList",
"com.google.common.collect.Iterables",
"io.druid.granularity.QueryGranularities",
"io.druid.query.DataSource",
"io.druid.query.dimension.DimensionSpec",
"io.druid.query.groupby.orderby.OrderByColumnSpec",
"io.druid.query.select.PagingSpec",
"io.druid.query.select.SelectQuery",
"io.druid.segment.column.Column",
"io.druid.sql.calcite.filtration.Filtration",
"io.druid.sql.calcite.table.RowSignature"
] |
import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; import io.druid.granularity.QueryGranularities; import io.druid.query.DataSource; import io.druid.query.dimension.DimensionSpec; import io.druid.query.groupby.orderby.OrderByColumnSpec; import io.druid.query.select.PagingSpec; import io.druid.query.select.SelectQuery; import io.druid.segment.column.Column; import io.druid.sql.calcite.filtration.Filtration; import io.druid.sql.calcite.table.RowSignature;
|
import com.google.common.collect.*; import io.druid.granularity.*; import io.druid.query.*; import io.druid.query.dimension.*; import io.druid.query.groupby.orderby.*; import io.druid.query.select.*; import io.druid.segment.column.*; import io.druid.sql.calcite.filtration.*; import io.druid.sql.calcite.table.*;
|
[
"com.google.common",
"io.druid.granularity",
"io.druid.query",
"io.druid.segment",
"io.druid.sql"
] |
com.google.common; io.druid.granularity; io.druid.query; io.druid.segment; io.druid.sql;
| 380,299
|
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof DialPlot)) {
return false;
}
DialPlot that = (DialPlot) obj;
if (!ObjectUtilities.equal(this.background, that.background)) {
return false;
}
if (!ObjectUtilities.equal(this.cap, that.cap)) {
return false;
}
if (!this.dialFrame.equals(that.dialFrame)) {
return false;
}
if (this.viewX != that.viewX) {
return false;
}
if (this.viewY != that.viewY) {
return false;
}
if (this.viewW != that.viewW) {
return false;
}
if (this.viewH != that.viewH) {
return false;
}
if (!this.layers.equals(that.layers)) {
return false;
}
if (!this.pointers.equals(that.pointers)) {
return false;
}
return super.equals(obj);
}
|
boolean function(Object obj) { if (obj == this) { return true; } if (!(obj instanceof DialPlot)) { return false; } DialPlot that = (DialPlot) obj; if (!ObjectUtilities.equal(this.background, that.background)) { return false; } if (!ObjectUtilities.equal(this.cap, that.cap)) { return false; } if (!this.dialFrame.equals(that.dialFrame)) { return false; } if (this.viewX != that.viewX) { return false; } if (this.viewY != that.viewY) { return false; } if (this.viewW != that.viewW) { return false; } if (this.viewH != that.viewH) { return false; } if (!this.layers.equals(that.layers)) { return false; } if (!this.pointers.equals(that.pointers)) { return false; } return super.equals(obj); }
|
/**
* Tests this <code>DialPlot</code> instance for equality with an
* arbitrary object. The plot's dataset(s) is (are) not included in
* the test.
*
* @param obj the object (<code>null</code> permitted).
*
* @return A boolean.
*/
|
Tests this <code>DialPlot</code> instance for equality with an arbitrary object. The plot's dataset(s) is (are) not included in the test
|
equals
|
{
"repo_name": "JSansalone/JFreeChart",
"path": "source/org/jfree/chart/plot/dial/DialPlot.java",
"license": "lgpl-2.1",
"size": 25005
}
|
[
"org.jfree.util.ObjectUtilities"
] |
import org.jfree.util.ObjectUtilities;
|
import org.jfree.util.*;
|
[
"org.jfree.util"
] |
org.jfree.util;
| 2,554,182
|
public void setCondition(Condition condition)
{
this.condition = condition;
}
|
void function(Condition condition) { this.condition = condition; }
|
/**
* set condition.
*/
|
set condition
|
setCondition
|
{
"repo_name": "ilganeli/incubator-apex-malhar",
"path": "library/src/main/java/com/datatorrent/lib/streamquery/UpdateOperator.java",
"license": "apache-2.0",
"size": 3444
}
|
[
"com.datatorrent.lib.streamquery.condition.Condition"
] |
import com.datatorrent.lib.streamquery.condition.Condition;
|
import com.datatorrent.lib.streamquery.condition.*;
|
[
"com.datatorrent.lib"
] |
com.datatorrent.lib;
| 1,399,340
|
public void validate() {
if (createOption() == null) {
throw LOGGER
.logExceptionAsError(
new IllegalArgumentException(
"Missing required property createOption in model VirtualMachineScaleSetOSDisk"));
}
if (diffDiskSettings() != null) {
diffDiskSettings().validate();
}
if (image() != null) {
image().validate();
}
if (managedDisk() != null) {
managedDisk().validate();
}
}
private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineScaleSetOSDisk.class);
|
void function() { if (createOption() == null) { throw LOGGER .logExceptionAsError( new IllegalArgumentException( STR)); } if (diffDiskSettings() != null) { diffDiskSettings().validate(); } if (image() != null) { image().validate(); } if (managedDisk() != null) { managedDisk().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineScaleSetOSDisk.class);
|
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
|
Validates the instance
|
validate
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetOSDisk.java",
"license": "mit",
"size": 12243
}
|
[
"com.azure.core.util.logging.ClientLogger"
] |
import com.azure.core.util.logging.ClientLogger;
|
import com.azure.core.util.logging.*;
|
[
"com.azure.core"
] |
com.azure.core;
| 2,272,696
|
public boolean setConcept(Concept concept) {
this.concept = concept;
return false;
}
|
boolean function(Concept concept) { this.concept = concept; return false; }
|
/**
* Sets the concept only if the specified concept matches this TagApp's concept ID,
* and the concept was not previously set. Returns whether or not the concept was set.
* @param concept
* @return true only if the concept was not previously set and the input concept is valid
*/
|
Sets the concept only if the specified concept matches this TagApp's concept ID, and the concept was not previously set. Returns whether or not the concept was set
|
setConcept
|
{
"repo_name": "shilad/sem-tag",
"path": "semtag-core/src/main/java/org/semtag/model/TagApp.java",
"license": "apache-2.0",
"size": 4543
}
|
[
"org.semtag.model.concept.Concept"
] |
import org.semtag.model.concept.Concept;
|
import org.semtag.model.concept.*;
|
[
"org.semtag.model"
] |
org.semtag.model;
| 552,271
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.