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
|
|---|---|---|---|---|---|---|---|---|---|---|---|
private static boolean isZoomLevelValid(final MrsImagePyramidMetadata metadata,
final int zoomLevel) throws IOException
{
return (metadata.getName(zoomLevel) != null);
}
|
static boolean function(final MrsImagePyramidMetadata metadata, final int zoomLevel) throws IOException { return (metadata.getName(zoomLevel) != null); }
|
/**
* Determines if a requested zoom level is valid for the requested data. This is a workaround to
* support non-pyramid data requests against the MrsImagePyramid interface. *This is not a long
* term solution.*
*
* @param metadata
* source pyramid metadata
* @param zoomLevel
* requested zoom level
* @return true if the source data contains an image at the requested zoom level; false otherwise
* @throws IOException
* @todo poorly implemented method, I think...but enough to get by for now; rewrite so no
* exception is thrown in case where image doesn't exist OR this more likely this won't be
* needed at all once we rework MrsImagePyramid/MrsImage for non-pyramid data
*/
|
Determines if a requested zoom level is valid for the requested data. This is a workaround to support non-pyramid data requests against the MrsImagePyramid interface. *This is not a long term solution
|
isZoomLevelValid
|
{
"repo_name": "tjkrell/MrGEO",
"path": "mrgeo-services/mrgeo-services-core/src/main/java/org/mrgeo/services/mrspyramid/rendering/ImageRendererAbstract.java",
"license": "apache-2.0",
"size": 26654
}
|
[
"java.io.IOException",
"org.mrgeo.image.MrsImagePyramidMetadata"
] |
import java.io.IOException; import org.mrgeo.image.MrsImagePyramidMetadata;
|
import java.io.*; import org.mrgeo.image.*;
|
[
"java.io",
"org.mrgeo.image"
] |
java.io; org.mrgeo.image;
| 1,278,215
|
public void receiveEmptyMessage(Exchange exchange, EmptyMessage message);
|
void function(Exchange exchange, EmptyMessage message);
|
/**
* Receive empty message.
*
* @param exchange the exchange
* @param message the message
*/
|
Receive empty message
|
receiveEmptyMessage
|
{
"repo_name": "mkovatsc/Californium",
"path": "californium/src/main/java/ch/ethz/inf/vs/californium/network/stack/Layer.java",
"license": "bsd-3-clause",
"size": 5153
}
|
[
"ch.ethz.inf.vs.californium.coap.EmptyMessage",
"ch.ethz.inf.vs.californium.network.Exchange"
] |
import ch.ethz.inf.vs.californium.coap.EmptyMessage; import ch.ethz.inf.vs.californium.network.Exchange;
|
import ch.ethz.inf.vs.californium.coap.*; import ch.ethz.inf.vs.californium.network.*;
|
[
"ch.ethz.inf"
] |
ch.ethz.inf;
| 1,847,973
|
private JTextArea getReferenceArea() {
if (referenceArea == null) {
referenceArea = new JTextArea();
referenceArea.setEditable(false);
}
return referenceArea;
}
|
JTextArea function() { if (referenceArea == null) { referenceArea = new JTextArea(); referenceArea.setEditable(false); } return referenceArea; }
|
/**
* This method initializes referenceArea
*
* @return javax.swing.JTextArea
*/
|
This method initializes referenceArea
|
getReferenceArea
|
{
"repo_name": "hohonuuli/vars",
"path": "vars-knowledgebase/src/main/java/vars/knowledgebase/ui/ConceptPanel.java",
"license": "lgpl-2.1",
"size": 10870
}
|
[
"javax.swing.JTextArea"
] |
import javax.swing.JTextArea;
|
import javax.swing.*;
|
[
"javax.swing"
] |
javax.swing;
| 2,015,959
|
String sub_val = substitute(val);
param_val.put(key, sub_val);
} */
public void processShellCmd(String key, String val, Boolean overwrite) throws ParameterSubstitutionException, FrontendException {
if (pigContext != null) {
BlackAndWhitelistFilter filter = new BlackAndWhitelistFilter(pigContext);
filter.validate(PigCommandFilter.Command.SH);
}
if (param_val.containsKey(key)) {
if (param_source.get(key).equals(val) || !overwrite) {
return;
} else {
log.warn("Warning : Multiple values found for " + key
+ ". Using value " + val);
}
}
param_source.put(key, val);
val = val.substring(1, val.length()-1); //to remove the backticks
String sub_val = substitute(val);
sub_val = executeShellCommand(sub_val);
param_val.put(key, sub_val);
}
|
String sub_val = substitute(val); param_val.put(key, sub_val); } */ void function(String key, String val, Boolean overwrite) throws ParameterSubstitutionException, FrontendException { if (pigContext != null) { BlackAndWhitelistFilter filter = new BlackAndWhitelistFilter(pigContext); filter.validate(PigCommandFilter.Command.SH); } if (param_val.containsKey(key)) { if (param_source.get(key).equals(val) !overwrite) { return; } else { log.warn(STR + key + STR + val); } } param_source.put(key, val); val = val.substring(1, val.length()-1); String sub_val = substitute(val); sub_val = executeShellCommand(sub_val); param_val.put(key, sub_val); }
|
/**
* This method generates parameter value by running specified command
*
* @param key - parameter name
* @param val - string containing command to be executed
*/
|
This method generates parameter value by running specified command
|
processShellCmd
|
{
"repo_name": "netxillon/pig",
"path": "src/org/apache/pig/tools/parameters/PreprocessorContext.java",
"license": "apache-2.0",
"size": 13387
}
|
[
"org.apache.pig.impl.logicalLayer.FrontendException",
"org.apache.pig.validator.BlackAndWhitelistFilter",
"org.apache.pig.validator.PigCommandFilter"
] |
import org.apache.pig.impl.logicalLayer.FrontendException; import org.apache.pig.validator.BlackAndWhitelistFilter; import org.apache.pig.validator.PigCommandFilter;
|
import org.apache.pig.impl.*; import org.apache.pig.validator.*;
|
[
"org.apache.pig"
] |
org.apache.pig;
| 1,145,153
|
public void setDataset(int index, ValueDataset dataset) {
ValueDataset existing = (ValueDataset) this.datasets.get(index);
if (existing != null) {
existing.removeChangeListener(this);
}
this.datasets.set(index, dataset);
if (dataset != null) {
dataset.addChangeListener(this);
}
// send a dataset change event to self...
DatasetChangeEvent event = new DatasetChangeEvent(this, dataset);
datasetChanged(event);
}
|
void function(int index, ValueDataset dataset) { ValueDataset existing = (ValueDataset) this.datasets.get(index); if (existing != null) { existing.removeChangeListener(this); } this.datasets.set(index, dataset); if (dataset != null) { dataset.addChangeListener(this); } DatasetChangeEvent event = new DatasetChangeEvent(this, dataset); datasetChanged(event); }
|
/**
* Sets a dataset for the plot.
*
* @param index the dataset index.
* @param dataset the dataset (<code>null</code> permitted).
*/
|
Sets a dataset for the plot
|
setDataset
|
{
"repo_name": "akardapolov/ASH-Viewer",
"path": "jfreechart-fse/src/main/java/org/jfree/chart/plot/dial/DialPlot.java",
"license": "gpl-3.0",
"size": 24790
}
|
[
"org.jfree.data.general.DatasetChangeEvent",
"org.jfree.data.general.ValueDataset"
] |
import org.jfree.data.general.DatasetChangeEvent; import org.jfree.data.general.ValueDataset;
|
import org.jfree.data.general.*;
|
[
"org.jfree.data"
] |
org.jfree.data;
| 910,235
|
Media container();
|
Media container();
|
/**
* Fetches the parent container.
*
* @return Said parent container.
*/
|
Fetches the parent container
|
container
|
{
"repo_name": "IvyBits/JAVI",
"path": "src/main/java/tk/ivybits/javi/media/stream/Stream.java",
"license": "lgpl-3.0",
"size": 2160
}
|
[
"tk.ivybits.javi.media.Media"
] |
import tk.ivybits.javi.media.Media;
|
import tk.ivybits.javi.media.*;
|
[
"tk.ivybits.javi"
] |
tk.ivybits.javi;
| 416,886
|
void updatePipeline(String clientName, Block oldBlock,
Block newBlock, List<DatanodeID> newNodes) throws IOException {
LOG.info("updatePipeline(block=" + oldBlock
+ ", newGenerationStamp=" + newBlock.getGenerationStamp()
+ ", newLength=" + newBlock.getNumBytes()
+ ", newNodes=" + newNodes
+ ")");
writeLock();
try {
// check the vadility of the block and lease holder name
final INodeFileUnderConstruction pendingFile =
checkUCBlock(oldBlock, clientName);
final Block oldBlockInfo = pendingFile.getLastBlock();
// check new GS & length: this is not expected
if (newBlock.getGenerationStamp() == oldBlockInfo.getGenerationStamp()) {
// we will do nothing if the GS is the same, to make this method
// idempotent, this should come from the avatar failover retry.
String msg = "Update " + oldBlock + " (len = " +
oldBlockInfo.getNumBytes() + ") to a same generation stamp: "
+ newBlock + " (len = " + newBlock.getNumBytes() + ")";
LOG.warn(msg);
return;
}
if (newBlock.getGenerationStamp() < oldBlockInfo.getGenerationStamp() ||
newBlock.getNumBytes() < oldBlockInfo.getNumBytes()) {
String msg = "Update " + oldBlock + " (len = " +
oldBlockInfo.getNumBytes() + ") to an older state: " + newBlock +
" (len = " + newBlock.getNumBytes() + ")";
LOG.warn(msg);
throw new IOException(msg);
}
// Remove old block from blocks map. This alawys have to be done
// because the generation stamp of this block is changing.
blocksMap.removeBlock(oldBlockInfo);
// update Last block, add it to the blocks map
BlockInfo newBlockInfo =
blocksMap.addINode(newBlock, pendingFile, pendingFile.getReplication());
// find the Datanode Descriptor objects
DatanodeDescriptor[] descriptors = null;
if (!newNodes.isEmpty()) {
descriptors = new DatanodeDescriptor[newNodes.size()];
for (int i = 0; i < newNodes.size(); i++) {
descriptors[i] = getDatanode(newNodes.get(i));
}
}
// add locations into the the INodeUnderConstruction
pendingFile.setLastBlock(newBlockInfo, descriptors);
// persist blocks only if append is supported
String src = leaseManager.findPath(pendingFile);
if (supportAppends) {
dir.persistBlocks(src, pendingFile);
}
} finally {
writeUnlock();
}
if (supportAppends) {
getEditLog().logSync();
}
LOG.info("updatePipeline(" + oldBlock + ") successfully to " + newBlock);
}
|
void updatePipeline(String clientName, Block oldBlock, Block newBlock, List<DatanodeID> newNodes) throws IOException { LOG.info(STR + oldBlock + STR + newBlock.getGenerationStamp() + STR + newBlock.getNumBytes() + STR + newNodes + ")"); writeLock(); try { final INodeFileUnderConstruction pendingFile = checkUCBlock(oldBlock, clientName); final Block oldBlockInfo = pendingFile.getLastBlock(); if (newBlock.getGenerationStamp() == oldBlockInfo.getGenerationStamp()) { String msg = STR + oldBlock + STR + oldBlockInfo.getNumBytes() + STR + newBlock + STR + newBlock.getNumBytes() + ")"; LOG.warn(msg); return; } if (newBlock.getGenerationStamp() < oldBlockInfo.getGenerationStamp() newBlock.getNumBytes() < oldBlockInfo.getNumBytes()) { String msg = STR + oldBlock + STR + oldBlockInfo.getNumBytes() + STR + newBlock + STR + newBlock.getNumBytes() + ")"; LOG.warn(msg); throw new IOException(msg); } blocksMap.removeBlock(oldBlockInfo); BlockInfo newBlockInfo = blocksMap.addINode(newBlock, pendingFile, pendingFile.getReplication()); DatanodeDescriptor[] descriptors = null; if (!newNodes.isEmpty()) { descriptors = new DatanodeDescriptor[newNodes.size()]; for (int i = 0; i < newNodes.size(); i++) { descriptors[i] = getDatanode(newNodes.get(i)); } } pendingFile.setLastBlock(newBlockInfo, descriptors); String src = leaseManager.findPath(pendingFile); if (supportAppends) { dir.persistBlocks(src, pendingFile); } } finally { writeUnlock(); } if (supportAppends) { getEditLog().logSync(); } LOG.info(STR + oldBlock + STR + newBlock); }
|
/**
* Update a pipeline for a block under construction
*
* @param clientName the name of the client
* @param oldBlock an old block
* @param newBlock a new block with a new generation stamp and length
* @param newNodes if any error occurs
* @throws IOException
*/
|
Update a pipeline for a block under construction
|
updatePipeline
|
{
"repo_name": "nvoron23/hadoop-20",
"path": "src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java",
"license": "apache-2.0",
"size": 358914
}
|
[
"java.io.IOException",
"java.util.List",
"org.apache.hadoop.hdfs.protocol.Block",
"org.apache.hadoop.hdfs.protocol.DatanodeID",
"org.apache.hadoop.hdfs.server.namenode.BlocksMap"
] |
import java.io.IOException; import java.util.List; import org.apache.hadoop.hdfs.protocol.Block; import org.apache.hadoop.hdfs.protocol.DatanodeID; import org.apache.hadoop.hdfs.server.namenode.BlocksMap;
|
import java.io.*; import java.util.*; import org.apache.hadoop.hdfs.protocol.*; import org.apache.hadoop.hdfs.server.namenode.*;
|
[
"java.io",
"java.util",
"org.apache.hadoop"
] |
java.io; java.util; org.apache.hadoop;
| 2,537,986
|
public void noMoreAppend() throws IOException;
}
public final static class DiskNewFlow<T> implements NewFlowReceiver<T> {
private final ByteSerializerDeserializer<T> serializer;
private final String baseName;
private long size;
private long appendSize;
private DataInputStream input;
private int inputIndex;
private DataOutputStream output;
private int outputIndex;
private boolean closed;
public DiskNewFlow(final ByteSerializerDeserializer<T> serializer) throws IOException {
this.serializer = serializer;
baseName = File.createTempFile(DiskNewFlow.class.getSimpleName(), "-tmp").toString();
inputIndex = -1;
outputIndex = 0;
size = 0;
}
|
void function() throws IOException; } public final static class DiskNewFlow<T> implements NewFlowReceiver<T> { private final ByteSerializerDeserializer<T> serializer; private final String baseName; private long size; private long appendSize; private DataInputStream input; private int inputIndex; private DataOutputStream output; private int outputIndex; private boolean closed; public DiskNewFlow(final ByteSerializerDeserializer<T> serializer) throws IOException { this.serializer = serializer; baseName = File.createTempFile(DiskNewFlow.class.getSimpleName(), "-tmp").toString(); inputIndex = -1; outputIndex = 0; size = 0; }
|
/** There will be no more new flows (because the sieve that is calling
* this method was closed).
*
* @throws IOException
*/
|
There will be no more new flows (because the sieve that is calling this method was closed)
|
noMoreAppend
|
{
"repo_name": "LAW-Unimi/BUbiNG",
"path": "src/it/unimi/di/law/bubing/sieve/AbstractSieve.java",
"license": "apache-2.0",
"size": 14522
}
|
[
"java.io.DataInputStream",
"java.io.DataOutputStream",
"java.io.File",
"java.io.IOException"
] |
import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.File; import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 798,290
|
public void open() {
Display display = Display.getDefault();
new KeyHandler(display);
Resources.init(display);
createContents();
shell.open();
// shell.setBackgroundImage(Images.CARBON_BACKROUND.getImage());
// shell.setBackgroundMode(SWT.INHERIT_FORCE);
shell.layout();
shell.setFullScreen(true);
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
}
|
void function() { Display display = Display.getDefault(); new KeyHandler(display); Resources.init(display); createContents(); shell.open(); shell.layout(); shell.setFullScreen(true); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } }
|
/**
* Open the window.
*/
|
Open the window
|
open
|
{
"repo_name": "WTIGER001/tingy",
"path": "TinyGui/src/org/bauer/tinyg/ui/Application.java",
"license": "epl-1.0",
"size": 1797
}
|
[
"org.eclipse.swt.widgets.Display"
] |
import org.eclipse.swt.widgets.Display;
|
import org.eclipse.swt.widgets.*;
|
[
"org.eclipse.swt"
] |
org.eclipse.swt;
| 1,740,731
|
if (getProjectOfExecutionEvent(event) != null) {
executeCommand("eu.scasefp7.eclipse.reqeditor.commands.exportAllToOntology");
executeCommand("eu.scasefp7.eclipse.umlrec.ui.commands.exportUseCaseDiagramsToOntology");
return null;
} else {
throw new ExecutionException("No project selected");
}
}
|
if (getProjectOfExecutionEvent(event) != null) { executeCommand(STR); executeCommand(STR); return null; } else { throw new ExecutionException(STR); } }
|
/**
* This function is called when the user selects the menu item. It populates the static ontology.
*
* @param event the event containing the information about which file was selected.
* @return the result of the execution which must be {@code null}.
*/
|
This function is called when the user selects the menu item. It populates the static ontology
|
execute
|
{
"repo_name": "s-case/s-case-core",
"path": "eu.scasefp7.eclipse.core/src/eu/scasefp7/eclipse/core/handlers/CompileStaticRequirementsHandler.java",
"license": "apache-2.0",
"size": 1052
}
|
[
"org.eclipse.core.commands.ExecutionException"
] |
import org.eclipse.core.commands.ExecutionException;
|
import org.eclipse.core.commands.*;
|
[
"org.eclipse.core"
] |
org.eclipse.core;
| 282,118
|
@Test
public void testHeaderUndefinedEscape() throws Exception {
conn.connect(defUser, defPass);
ClientStompFrame frame = conn.createFrame("SEND");
String body = "Hello World 1!";
String cLen = String.valueOf(body.getBytes(StandardCharsets.UTF_8).length);
frame.addHeader("destination", getQueuePrefix() + getQueueName());
frame.addHeader("content-type", "text/plain");
frame.addHeader("content-length", cLen);
String hKey = "undefined-escape";
String hVal = "is\\ttab";
frame.addHeader(hKey, hVal);
System.out.println("key: |" + hKey + "| val: |" + hVal + "|");
frame.setBody(body);
conn.sendFrame(frame);
ClientStompFrame error = conn.receiveFrame();
System.out.println("received " + error);
String desc = "Should have received an ERROR for undefined escape sequence";
Assert.assertNotNull(desc, error);
Assert.assertEquals(desc, "ERROR", error.getCommand());
waitDisconnect(conn);
Assert.assertFalse("Should be disconnected in STOMP 1.2 after ERROR", conn.isConnected());
}
|
void function() throws Exception { conn.connect(defUser, defPass); ClientStompFrame frame = conn.createFrame("SEND"); String body = STR; String cLen = String.valueOf(body.getBytes(StandardCharsets.UTF_8).length); frame.addHeader(STR, getQueuePrefix() + getQueueName()); frame.addHeader(STR, STR); frame.addHeader(STR, cLen); String hKey = STR; String hVal = STR; frame.addHeader(hKey, hVal); System.out.println(STR + hKey + STR + hVal + " "); frame.setBody(body); conn.sendFrame(frame); ClientStompFrame error = conn.receiveFrame(); System.out.println(STR + error); String desc = STR; Assert.assertNotNull(desc, error); Assert.assertEquals(desc, "ERROR", error.getCommand()); waitDisconnect(conn); Assert.assertFalse(STR, conn.isConnected()); }
|
/**
* In 1.2, undefined escapes must cause a fatal protocol error.
*/
|
In 1.2, undefined escapes must cause a fatal protocol error
|
testHeaderUndefinedEscape
|
{
"repo_name": "gaohoward/activemq-artemis",
"path": "tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java",
"license": "apache-2.0",
"size": 82494
}
|
[
"java.nio.charset.StandardCharsets",
"org.apache.activemq.artemis.tests.integration.stomp.util.ClientStompFrame",
"org.junit.Assert"
] |
import java.nio.charset.StandardCharsets; import org.apache.activemq.artemis.tests.integration.stomp.util.ClientStompFrame; import org.junit.Assert;
|
import java.nio.charset.*; import org.apache.activemq.artemis.tests.integration.stomp.util.*; import org.junit.*;
|
[
"java.nio",
"org.apache.activemq",
"org.junit"
] |
java.nio; org.apache.activemq; org.junit;
| 1,197,122
|
public static void rm(File[] files) {
if(files != null)
for(File f: files)
rm(f);
}
|
static void function(File[] files) { if(files != null) for(File f: files) rm(f); }
|
/**
* Delete an array of files
*
* @param files Files to delete
*/
|
Delete an array of files
|
rm
|
{
"repo_name": "cshaxu/voldemort",
"path": "src/java/voldemort/utils/Utils.java",
"license": "apache-2.0",
"size": 27990
}
|
[
"java.io.File"
] |
import java.io.File;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 283,413
|
public static <R> Result<R> error(String message) {
Objects.requireNonNull(message, "message cannot be null");
return new SimpleResult<>(null, message);
}
|
static <R> Result<R> function(String message) { Objects.requireNonNull(message, STR); return new SimpleResult<>(null, message); }
|
/**
* Returns a failure result wrapping the given error message.
*
* @param <R>
* the result value type
* @param message
* the error message
* @return a failure result
*/
|
Returns a failure result wrapping the given error message
|
error
|
{
"repo_name": "Legioth/vaadin",
"path": "server/src/main/java/com/vaadin/data/Result.java",
"license": "apache-2.0",
"size": 6251
}
|
[
"java.util.Objects"
] |
import java.util.Objects;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,286,841
|
public static final Race randomRace(){return c().races.elementAt((int)Math.round(Math.floor(Math.random()*(c().races.size()))));}
|
public static final Race randomRace(){return c().races.elementAt((int)Math.round(Math.floor(Math.random()*(c().races.size()))));}
|
/**
* An enumeration of all the stored webmacros in this classloader for this thread
* @return an enumeration of all the stored webmacros in this classloader for this thread
*/
|
An enumeration of all the stored webmacros in this classloader for this thread
|
webmacros
|
{
"repo_name": "ConsecroMUD/ConsecroMUD",
"path": "com/suscipio_solutions/consecro_mud/core/CMClass.java",
"license": "apache-2.0",
"size": 105821
}
|
[
"com.suscipio_solutions.consecro_mud.Races"
] |
import com.suscipio_solutions.consecro_mud.Races;
|
import com.suscipio_solutions.consecro_mud.*;
|
[
"com.suscipio_solutions.consecro_mud"
] |
com.suscipio_solutions.consecro_mud;
| 250,903
|
public ClosableIterator<org.ontoware.rdfreactor.schema.owl.OwlThing> getAllThemes() {
return Base.getAll(this.model, this.getResource(), THEME,
org.ontoware.rdfreactor.schema.owl.OwlThing.class);
}
|
ClosableIterator<org.ontoware.rdfreactor.schema.owl.OwlThing> function() { return Base.getAll(this.model, this.getResource(), THEME, org.ontoware.rdfreactor.schema.owl.OwlThing.class); }
|
/**
* Get all values of property Theme * @return a ClosableIterator of $type
* [Generated from RDFReactor template rule #get12dynamic]
*/
|
Get all values of property Theme [Generated from RDFReactor template rule #get12dynamic]
|
getAllThemes
|
{
"repo_name": "m0ep/master-thesis",
"path": "source/apis/rdf2go/rdf2go-foaf/src/main/java/com/xmlns/foaf/Thing.java",
"license": "mit",
"size": 274766
}
|
[
"org.ontoware.aifbcommons.collection.ClosableIterator",
"org.ontoware.rdfreactor.runtime.Base"
] |
import org.ontoware.aifbcommons.collection.ClosableIterator; import org.ontoware.rdfreactor.runtime.Base;
|
import org.ontoware.aifbcommons.collection.*; import org.ontoware.rdfreactor.runtime.*;
|
[
"org.ontoware.aifbcommons",
"org.ontoware.rdfreactor"
] |
org.ontoware.aifbcommons; org.ontoware.rdfreactor;
| 2,810,098
|
public boolean isIgnoreClientDisconnect()
{
// server/183c
WebApp webApp = getWebApp();
if (webApp != null)
return webApp.isIgnoreClientDisconnect();
else
return true;
}
|
boolean function() { WebApp webApp = getWebApp(); if (webApp != null) return webApp.isIgnoreClientDisconnect(); else return true; }
|
/**
* Returns true if client disconnects should be ignored.
*/
|
Returns true if client disconnects should be ignored
|
isIgnoreClientDisconnect
|
{
"repo_name": "dlitz/resin",
"path": "modules/resin/src/com/caucho/server/http/AbstractHttpRequest.java",
"license": "gpl-2.0",
"size": 40926
}
|
[
"com.caucho.server.webapp.WebApp"
] |
import com.caucho.server.webapp.WebApp;
|
import com.caucho.server.webapp.*;
|
[
"com.caucho.server"
] |
com.caucho.server;
| 1,060,504
|
private static int findOriginalLine(@NotNull String afterContent,
@NotNull LineOffsets afterLineOffsets,
@NotNull String originalLine,
@NotNull List<LineFragment> fragments) {
for (LineFragment fragment : fragments) {
for (int i = fragment.getStartLine2(); i < fragment.getEndLine2(); i++) {
String line = getLine(afterContent, afterLineOffsets, i);
if (StringUtil.equalsIgnoreWhitespaces(line, originalLine)) return i;
}
}
return -1; // line not found
}
|
static int function(@NotNull String afterContent, @NotNull LineOffsets afterLineOffsets, @NotNull String originalLine, @NotNull List<LineFragment> fragments) { for (LineFragment fragment : fragments) { for (int i = fragment.getStartLine2(); i < fragment.getEndLine2(); i++) { String line = getLine(afterContent, afterLineOffsets, i); if (StringUtil.equalsIgnoreWhitespaces(line, originalLine)) return i; } } return -1; }
|
/**
* Search for affected line in content after the commit.
*
* @see DiffNavigationContext
*/
|
Search for affected line in content after the commit
|
findOriginalLine
|
{
"repo_name": "jwren/intellij-community",
"path": "platform/vcs-impl/src/com/intellij/openapi/vcs/annotate/DefaultLineModificationDetailsProvider.java",
"license": "apache-2.0",
"size": 11561
}
|
[
"com.intellij.diff.fragments.LineFragment",
"com.intellij.diff.tools.util.text.LineOffsets",
"com.intellij.openapi.util.text.StringUtil",
"java.util.List",
"org.jetbrains.annotations.NotNull"
] |
import com.intellij.diff.fragments.LineFragment; import com.intellij.diff.tools.util.text.LineOffsets; import com.intellij.openapi.util.text.StringUtil; import java.util.List; import org.jetbrains.annotations.NotNull;
|
import com.intellij.diff.fragments.*; import com.intellij.diff.tools.util.text.*; import com.intellij.openapi.util.text.*; import java.util.*; import org.jetbrains.annotations.*;
|
[
"com.intellij.diff",
"com.intellij.openapi",
"java.util",
"org.jetbrains.annotations"
] |
com.intellij.diff; com.intellij.openapi; java.util; org.jetbrains.annotations;
| 2,725,480
|
public void copyTo(OutputStream out) throws IOException
{
InputStream in = url.openStream();
try {
ByteStreams.copy(in, out);
} finally {
IO.close(in);
}
}
|
void function(OutputStream out) throws IOException { InputStream in = url.openStream(); try { ByteStreams.copy(in, out); } finally { IO.close(in); } }
|
/**
* Copies the content of this resource to the specified stream.
*
* @param out the stream to copy to.
*
* @throws NullPointerException if {@code out} is {@code null}.
* @throws IOException if an I/O error occurs during the process.
*/
|
Copies the content of this resource to the specified stream
|
copyTo
|
{
"repo_name": "kocakosm/pitaya",
"path": "src/org/kocakosm/pitaya/io/Resource.java",
"license": "lgpl-3.0",
"size": 6264
}
|
[
"java.io.IOException",
"java.io.InputStream",
"java.io.OutputStream"
] |
import java.io.IOException; import java.io.InputStream; import java.io.OutputStream;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 463,878
|
@Override
public void addInput(Input i) {
super.addInput(i);
}
|
void function(Input i) { super.addInput(i); }
|
/**
* Adds an input pipe
*/
|
Adds an input pipe
|
addInput
|
{
"repo_name": "mxpxgx/InCense",
"path": "src/edu/incense/android/datatask/filter/DataFilter.java",
"license": "mit",
"size": 2102
}
|
[
"edu.incense.android.datatask.Input"
] |
import edu.incense.android.datatask.Input;
|
import edu.incense.android.datatask.*;
|
[
"edu.incense.android"
] |
edu.incense.android;
| 782,322
|
Map<T, U> getCoordinatesMap();
|
Map<T, U> getCoordinatesMap();
|
/**
* Gets the train stations and track switches coordinates. These coordinates
* are stored in a hash map as {@link java.awt.Point} with the name of the
* location as a key. These coordinates represents the <code>x</code> and
* <code>y</code> position on the graphic context where railway will be
* rendered.
*
* @return a map of the train stations and track switches coordinates.
*/
|
Gets the train stations and track switches coordinates. These coordinates are stored in a hash map as <code>java.awt.Point</code> with the name of the location as a key. These coordinates represents the <code>x</code> and <code>y</code> position on the graphic context where railway will be rendered
|
getCoordinatesMap
|
{
"repo_name": "fioan89/railsimulator",
"path": "src/main/java/org/faur/railsim/railmonitor/RailMapLoader.java",
"license": "lgpl-3.0",
"size": 2587
}
|
[
"java.util.Map"
] |
import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,240,645
|
public boolean isOrgConfigManagedByOrgAdmin(User loggedInUser, Integer orgId) {
verifyManagesOrgConfig(loggedInUser, orgId);
Org org = verifyOrgExists(orgId);
return org.getOrgAdminMgmt().isEnabled();
}
|
boolean function(User loggedInUser, Integer orgId) { verifyManagesOrgConfig(loggedInUser, orgId); Org org = verifyOrgExists(orgId); return org.getOrgAdminMgmt().isEnabled(); }
|
/**
* Returns whether Organization Administrator is able to manage his organization
* configuration. This organization configuration may have a high impact on the whole
* Spacewalk/Satellite performance
*
* @param loggedInUser The current user
* @param orgId affected organization
* @return Returns the status org admin management setting
*
* @xmlrpc.doc Returns whether Organization Administrator is able to manage his
* organization configuration. This organization configuration may have a high impact
* on the whole Spacewalk/Satellite performance
*
* @xmlrpc.param #param("string", "sessionKey")
* @xmlrpc.param #param("int", "orgId")
* @xmlrpc.returntype boolean - Returns the status org admin management setting
*/
|
Returns whether Organization Administrator is able to manage his organization configuration. This organization configuration may have a high impact on the whole Spacewalk/Satellite performance
|
isOrgConfigManagedByOrgAdmin
|
{
"repo_name": "mcalmer/spacewalk",
"path": "java/code/src/com/redhat/rhn/frontend/xmlrpc/org/OrgHandler.java",
"license": "gpl-2.0",
"size": 34554
}
|
[
"com.redhat.rhn.domain.org.Org",
"com.redhat.rhn.domain.user.User"
] |
import com.redhat.rhn.domain.org.Org; import com.redhat.rhn.domain.user.User;
|
import com.redhat.rhn.domain.org.*; import com.redhat.rhn.domain.user.*;
|
[
"com.redhat.rhn"
] |
com.redhat.rhn;
| 76,080
|
public boolean getIsCyclic(OWLObject c) {
OWLAnnotationProperty lap = getAnnotationProperty(OboFormatTag.TAG_IS_CYCLIC.getTag());
String val = getAnnotationValue(c, lap);
return val == null ? false: Boolean.valueOf(val);
}
|
boolean function(OWLObject c) { OWLAnnotationProperty lap = getAnnotationProperty(OboFormatTag.TAG_IS_CYCLIC.getTag()); String val = getAnnotationValue(c, lap); return val == null ? false: Boolean.valueOf(val); }
|
/**
* It returns the value of the is_cyclic tag
*
* @param c
* @return boolean
*/
|
It returns the value of the is_cyclic tag
|
getIsCyclic
|
{
"repo_name": "owlcollab/owltools",
"path": "OWLTools-Core/src/main/java/owltools/graph/OWLGraphWrapperExtended.java",
"license": "bsd-3-clause",
"size": 46577
}
|
[
"org.obolibrary.oboformat.parser.OBOFormatConstants",
"org.semanticweb.owlapi.model.OWLAnnotationProperty",
"org.semanticweb.owlapi.model.OWLObject"
] |
import org.obolibrary.oboformat.parser.OBOFormatConstants; import org.semanticweb.owlapi.model.OWLAnnotationProperty; import org.semanticweb.owlapi.model.OWLObject;
|
import org.obolibrary.oboformat.parser.*; import org.semanticweb.owlapi.model.*;
|
[
"org.obolibrary.oboformat",
"org.semanticweb.owlapi"
] |
org.obolibrary.oboformat; org.semanticweb.owlapi;
| 2,522,129
|
public Builder add(URL inputFileUrl, String filePath) {
return addWithKind(inputFileUrl, SoyFileKind.SRC, filePath);
}
|
Builder function(URL inputFileUrl, String filePath) { return addWithKind(inputFileUrl, SoyFileKind.SRC, filePath); }
|
/**
* Adds an input Soy file, given a resource {@code URL}, as well as the desired file path for
* messages.
*
* @param inputFileUrl The Soy file.
* @param filePath The path to the Soy file (used for messages only).
* @return This builder.
*/
|
Adds an input Soy file, given a resource URL, as well as the desired file path for messages
|
add
|
{
"repo_name": "SerkanSipahi/closure-templates",
"path": "java/src/com/google/template/soy/SoyFileSet.java",
"license": "apache-2.0",
"size": 50703
}
|
[
"com.google.template.soy.base.internal.SoyFileKind"
] |
import com.google.template.soy.base.internal.SoyFileKind;
|
import com.google.template.soy.base.internal.*;
|
[
"com.google.template"
] |
com.google.template;
| 2,839,020
|
public TCardFieldBean getBean(IdentityMap createdBeans)
{
TCardFieldBean result = (TCardFieldBean) createdBeans.get(this);
if (result != null ) {
// we have already created a bean for this object, return it
return result;
}
// no bean exists for this object; create a new one
result = new TCardFieldBean();
createdBeans.put(this, result);
result.setObjectID(getObjectID());
result.setName(getName());
result.setColIndex(getColIndex());
result.setRowIndex(getRowIndex());
result.setColSpan(getColSpan());
result.setRowSpan(getRowSpan());
result.setLabelHAlign(getLabelHAlign());
result.setLabelVAlign(getLabelVAlign());
result.setValueHAlign(getValueHAlign());
result.setValueVAlign(getValueVAlign());
result.setCardPanel(getCardPanel());
result.setField(getField());
result.setHideLabel(getHideLabel());
result.setIconRendering(getIconRendering());
result.setUuid(getUuid());
if (aTCardPanel != null)
{
TCardPanelBean relatedBean = aTCardPanel.getBean(createdBeans);
result.setTCardPanelBean(relatedBean);
}
result.setModified(isModified());
result.setNew(isNew());
return result;
}
|
TCardFieldBean function(IdentityMap createdBeans) { TCardFieldBean result = (TCardFieldBean) createdBeans.get(this); if (result != null ) { return result; } result = new TCardFieldBean(); createdBeans.put(this, result); result.setObjectID(getObjectID()); result.setName(getName()); result.setColIndex(getColIndex()); result.setRowIndex(getRowIndex()); result.setColSpan(getColSpan()); result.setRowSpan(getRowSpan()); result.setLabelHAlign(getLabelHAlign()); result.setLabelVAlign(getLabelVAlign()); result.setValueHAlign(getValueHAlign()); result.setValueVAlign(getValueVAlign()); result.setCardPanel(getCardPanel()); result.setField(getField()); result.setHideLabel(getHideLabel()); result.setIconRendering(getIconRendering()); result.setUuid(getUuid()); if (aTCardPanel != null) { TCardPanelBean relatedBean = aTCardPanel.getBean(createdBeans); result.setTCardPanelBean(relatedBean); } result.setModified(isModified()); result.setNew(isNew()); return result; }
|
/**
* Creates a TCardFieldBean with the contents of this object
* intended for internal use only
* @param createdBeans a IdentityMap which maps objects
* to already created beans
* @return a TCardFieldBean with the contents of this object
*/
|
Creates a TCardFieldBean with the contents of this object intended for internal use only
|
getBean
|
{
"repo_name": "trackplus/Genji",
"path": "src/main/java/com/aurel/track/persist/BaseTCardField.java",
"license": "gpl-3.0",
"size": 42774
}
|
[
"com.aurel.track.beans.TCardFieldBean",
"com.aurel.track.beans.TCardPanelBean",
"org.apache.commons.collections.map.IdentityMap"
] |
import com.aurel.track.beans.TCardFieldBean; import com.aurel.track.beans.TCardPanelBean; import org.apache.commons.collections.map.IdentityMap;
|
import com.aurel.track.beans.*; import org.apache.commons.collections.map.*;
|
[
"com.aurel.track",
"org.apache.commons"
] |
com.aurel.track; org.apache.commons;
| 992,040
|
private void writeStreams() {
OkHttpClientStream[] streams = getActiveStreams();
int connectionWindow = connectionState.window();
for (int numStreams = streams.length; numStreams > 0 && connectionWindow > 0;) {
int nextNumStreams = 0;
int windowSlice = (int) ceil(connectionWindow / (float) numStreams);
for (int index = 0; index < numStreams && connectionWindow > 0; ++index) {
OkHttpClientStream stream = streams[index];
OutboundFlowState state = state(stream);
int bytesForStream = min(connectionWindow, min(state.unallocatedBytes(), windowSlice));
if (bytesForStream > 0) {
state.allocateBytes(bytesForStream);
connectionWindow -= bytesForStream;
}
if (state.unallocatedBytes() > 0) {
// There is more data to process for this stream. Add it to the next
// pass.
streams[nextNumStreams++] = stream;
}
}
numStreams = nextNumStreams;
}
// Now take one last pass through all of the streams and write any allocated bytes.
WriteStatus writeStatus = new WriteStatus();
for (OkHttpClientStream stream : getActiveStreams()) {
OutboundFlowState state = state(stream);
state.writeBytes(state.allocatedBytes(), writeStatus);
state.clearAllocatedBytes();
}
if (writeStatus.hasWritten()) {
flush();
}
}
private final class WriteStatus {
int numWrites;
|
void function() { OkHttpClientStream[] streams = getActiveStreams(); int connectionWindow = connectionState.window(); for (int numStreams = streams.length; numStreams > 0 && connectionWindow > 0;) { int nextNumStreams = 0; int windowSlice = (int) ceil(connectionWindow / (float) numStreams); for (int index = 0; index < numStreams && connectionWindow > 0; ++index) { OkHttpClientStream stream = streams[index]; OutboundFlowState state = state(stream); int bytesForStream = min(connectionWindow, min(state.unallocatedBytes(), windowSlice)); if (bytesForStream > 0) { state.allocateBytes(bytesForStream); connectionWindow -= bytesForStream; } if (state.unallocatedBytes() > 0) { streams[nextNumStreams++] = stream; } } numStreams = nextNumStreams; } WriteStatus writeStatus = new WriteStatus(); for (OkHttpClientStream stream : getActiveStreams()) { OutboundFlowState state = state(stream); state.writeBytes(state.allocatedBytes(), writeStatus); state.clearAllocatedBytes(); } if (writeStatus.hasWritten()) { flush(); } } private final class WriteStatus { int numWrites;
|
/**
* Writes as much data for all the streams as possible given the current flow control windows.
*/
|
Writes as much data for all the streams as possible given the current flow control windows
|
writeStreams
|
{
"repo_name": "meghana0507/grpc-java-poll",
"path": "okhttp/src/main/java/io/grpc/transport/okhttp/OutboundFlowController.java",
"license": "bsd-3-clause",
"size": 14496
}
|
[
"java.lang.Math"
] |
import java.lang.Math;
|
import java.lang.*;
|
[
"java.lang"
] |
java.lang;
| 1,804,320
|
@Test
public void testProxy() throws IgniteCheckedException {
OptimizedMarshaller marsh = marshaller();
marsh.setRequireSerializable(false);
SomeItf inItf = (SomeItf)Proxy.newProxyInstance(
OptimizedMarshallerTest.class.getClassLoader(), new Class[] {SomeItf.class},
new InvocationHandler() {
private NonSerializable obj = new NonSerializable(null);
|
void function() throws IgniteCheckedException { OptimizedMarshaller marsh = marshaller(); marsh.setRequireSerializable(false); SomeItf inItf = (SomeItf)Proxy.newProxyInstance( OptimizedMarshallerTest.class.getClassLoader(), new Class[] {SomeItf.class}, new InvocationHandler() { private NonSerializable obj = new NonSerializable(null);
|
/**
* Tests {@link Proxy}.
*
* @throws IgniteCheckedException If marshalling failed.
*/
|
Tests <code>Proxy</code>
|
testProxy
|
{
"repo_name": "ptupitsyn/ignite",
"path": "modules/core/src/test/java/org/apache/ignite/internal/marshaller/optimized/OptimizedMarshallerTest.java",
"license": "apache-2.0",
"size": 24971
}
|
[
"java.lang.reflect.InvocationHandler",
"java.lang.reflect.Proxy",
"org.apache.ignite.IgniteCheckedException"
] |
import java.lang.reflect.InvocationHandler; import java.lang.reflect.Proxy; import org.apache.ignite.IgniteCheckedException;
|
import java.lang.reflect.*; import org.apache.ignite.*;
|
[
"java.lang",
"org.apache.ignite"
] |
java.lang; org.apache.ignite;
| 2,199,839
|
public void setJobEntryLogTable( JobEntryLogTable jobEntryLogTable ) {
this.jobEntryLogTable = jobEntryLogTable;
}
|
void function( JobEntryLogTable jobEntryLogTable ) { this.jobEntryLogTable = jobEntryLogTable; }
|
/**
* Sets the job entry log table.
*
* @param jobEntryLogTable
* the jobEntryLogTable to set
*/
|
Sets the job entry log table
|
setJobEntryLogTable
|
{
"repo_name": "GauravAshara/pentaho-kettle",
"path": "engine/src/org/pentaho/di/job/JobMeta.java",
"license": "apache-2.0",
"size": 88838
}
|
[
"org.pentaho.di.core.logging.JobEntryLogTable"
] |
import org.pentaho.di.core.logging.JobEntryLogTable;
|
import org.pentaho.di.core.logging.*;
|
[
"org.pentaho.di"
] |
org.pentaho.di;
| 1,144,918
|
private IhcBindingProvider findFirstMatchingBindingProvider(String itemName, Command type) {
IhcBindingProvider firstMatchingProvider = null;
for (IhcBindingProvider provider : this.providers) {
if (provider.getResourceId(itemName, type) > 0 || provider.getResourceId(itemName, null) > 0) {
firstMatchingProvider = provider;
break;
}
}
return firstMatchingProvider;
}
|
IhcBindingProvider function(String itemName, Command type) { IhcBindingProvider firstMatchingProvider = null; for (IhcBindingProvider provider : this.providers) { if (provider.getResourceId(itemName, type) > 0 provider.getResourceId(itemName, null) > 0) { firstMatchingProvider = provider; break; } } return firstMatchingProvider; }
|
/**
* Find the first matching {@link IhcBindingProvider} according to
* <code>itemName</code> and <code>command</code>.
*
* @param itemName
*
* @return the matching binding provider or <code>null</code> if no binding
* provider could be found
*/
|
Find the first matching <code>IhcBindingProvider</code> according to <code>itemName</code> and <code>command</code>
|
findFirstMatchingBindingProvider
|
{
"repo_name": "paolodenti/openhab",
"path": "bundles/binding/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/IhcBinding.java",
"license": "epl-1.0",
"size": 21510
}
|
[
"org.openhab.binding.ihc.IhcBindingProvider",
"org.openhab.core.types.Command"
] |
import org.openhab.binding.ihc.IhcBindingProvider; import org.openhab.core.types.Command;
|
import org.openhab.binding.ihc.*; import org.openhab.core.types.*;
|
[
"org.openhab.binding",
"org.openhab.core"
] |
org.openhab.binding; org.openhab.core;
| 681,703
|
@SuppressWarnings("unused")
@Test
public void testShortMapsToEnumOutOfOrdinalRange() {
LOG.error("WithExceptionsLoggedTest; 'MappingException: Cannot convert [3] to enum of type class org.dozer.vo.enumtest.SrcTypeWithOverride'");
testShortMapsToEnumOutOfOrdinalRangeEE.expect(MappingException.class);
testShortMapsToEnumOutOfOrdinalRangeEE.expectMessage("Cannot convert [3] to enum of type class org.dozer.vo.enumtest.SrcTypeWithOverride");
mapper = getMapper(new String[] {"enumMapping.xml"});
MyBeanPrimeShort src = new MyBeanPrimeShort();
src.setFirst((short)0);
src.setSecond((short)3);
MyBean dest = mapper.map(src, MyBean.class);
}
|
@SuppressWarnings(STR) void function() { LOG.error(STR); testShortMapsToEnumOutOfOrdinalRangeEE.expect(MappingException.class); testShortMapsToEnumOutOfOrdinalRangeEE.expectMessage(STR); mapper = getMapper(new String[] {STR}); MyBeanPrimeShort src = new MyBeanPrimeShort(); src.setFirst((short)0); src.setSecond((short)3); MyBean dest = mapper.map(src, MyBean.class); }
|
/**
* Test on a mapping from short types to enum.
*/
|
Test on a mapping from short types to enum
|
testShortMapsToEnumOutOfOrdinalRange
|
{
"repo_name": "STRiDGE/dozer",
"path": "core/src/test/java/org/dozer/functional_tests/EnumMapping_WithExceptionsLoggedTest.java",
"license": "apache-2.0",
"size": 6745
}
|
[
"org.dozer.MappingException",
"org.dozer.vo.enumtest.MyBean",
"org.dozer.vo.enumtest.MyBeanPrimeShort"
] |
import org.dozer.MappingException; import org.dozer.vo.enumtest.MyBean; import org.dozer.vo.enumtest.MyBeanPrimeShort;
|
import org.dozer.*; import org.dozer.vo.enumtest.*;
|
[
"org.dozer",
"org.dozer.vo"
] |
org.dozer; org.dozer.vo;
| 1,379,199
|
public HttpRequest headers(final Map<String, String> headers) {
if (!headers.isEmpty())
for (Entry<String, String> header : headers.entrySet())
header(header);
return this;
}
|
HttpRequest function(final Map<String, String> headers) { if (!headers.isEmpty()) for (Entry<String, String> header : headers.entrySet()) header(header); return this; }
|
/**
* Set all headers found in given map where the keys are the header names and
* the values are the header values
*
* @param headers
* @return this request
*/
|
Set all headers found in given map where the keys are the header names and the values are the header values
|
headers
|
{
"repo_name": "JKY/apnsd",
"path": "sdks/client/android/lib/apnsd/src/main/java/com/apns/util/HttpRequest.java",
"license": "gpl-3.0",
"size": 88476
}
|
[
"java.util.Map"
] |
import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,064,360
|
List<ContentTransformer> selectTransformers(String sourceMimetype, long sourceSize,
String targetMimetype, TransformationOptions options);
|
List<ContentTransformer> selectTransformers(String sourceMimetype, long sourceSize, String targetMimetype, TransformationOptions options);
|
/**
* Returns a sorted list of transformers that identifies the order in which transformers
* should be tried.
* @param sourceMimetype
* @param sourceSize
* @param targetMimetype
* @param options transformation options
* @return a sorted list of transformers, with the best one first.
*/
|
Returns a sorted list of transformers that identifies the order in which transformers should be tried
|
selectTransformers
|
{
"repo_name": "nguyentienlong/community-edition",
"path": "projects/repository/source/java/org/alfresco/repo/content/transform/TransformerSelector.java",
"license": "lgpl-3.0",
"size": 1680
}
|
[
"java.util.List",
"org.alfresco.service.cmr.repository.TransformationOptions"
] |
import java.util.List; import org.alfresco.service.cmr.repository.TransformationOptions;
|
import java.util.*; import org.alfresco.service.cmr.repository.*;
|
[
"java.util",
"org.alfresco.service"
] |
java.util; org.alfresco.service;
| 247,317
|
public boolean insertaProducto(ProductosParamEntity entidad){
return conexionWSNewProd().getPortNewProductos().insertarProdParametrizado(entidad);
}
|
boolean function(ProductosParamEntity entidad){ return conexionWSNewProd().getPortNewProductos().insertarProdParametrizado(entidad); }
|
/**
* metodo que inserta un producto para paraametrizar
* @param entidad
* @return
*/
|
metodo que inserta un producto para paraametrizar
|
insertaProducto
|
{
"repo_name": "codesoftware/NSIGEMCO",
"path": "src/main/java/co/com/codesoftware/logica/productos/ProductoParamLogica.java",
"license": "apache-2.0",
"size": 1242
}
|
[
"co.com.codesoftware.servicio.producto.ProductosParamEntity"
] |
import co.com.codesoftware.servicio.producto.ProductosParamEntity;
|
import co.com.codesoftware.servicio.producto.*;
|
[
"co.com.codesoftware"
] |
co.com.codesoftware;
| 177,604
|
public static String decodeLocation(final byte[] data, final int start) {
try {
int charIndex = start;
while(charIndex < start+13){
if(data[charIndex] == '\0'){
break;
}
charIndex++;
}
return new String(data, start, charIndex-start, "UTF-8");
} catch (final UnsupportedEncodingException e) {
Log.e(TAG, "Unable to convert the complete local name to UTF-8", e);
return null;
} catch (final IndexOutOfBoundsException e) {
Log.e(TAG, "Error when reading complete local name", e);
return null;
}
}
|
static String function(final byte[] data, final int start) { try { int charIndex = start; while(charIndex < start+13){ if(data[charIndex] == '\0'){ break; } charIndex++; } return new String(data, start, charIndex-start, "UTF-8"); } catch (final UnsupportedEncodingException e) { Log.e(TAG, STR, e); return null; } catch (final IndexOutOfBoundsException e) { Log.e(TAG, STR, e); return null; } }
|
/**
* Decodes the local name
*/
|
Decodes the local name
|
decodeLocation
|
{
"repo_name": "EnergyFutures/ITUBleService",
"path": "ITUBLETOOL/src/dk/itu/energyfutures/ble/helpers/BluetoothHelper.java",
"license": "gpl-2.0",
"size": 6283
}
|
[
"android.util.Log",
"java.io.UnsupportedEncodingException"
] |
import android.util.Log; import java.io.UnsupportedEncodingException;
|
import android.util.*; import java.io.*;
|
[
"android.util",
"java.io"
] |
android.util; java.io;
| 2,810,557
|
protected void setFromItems(ArrayList<FromItem> fromItems)
{
_fromItems = new FromItem [fromItems.size()];
fromItems.toArray(_fromItems);
}
|
void function(ArrayList<FromItem> fromItems) { _fromItems = new FromItem [fromItems.size()]; fromItems.toArray(_fromItems); }
|
/**
* Sets from items.
*/
|
Sets from items
|
setFromItems
|
{
"repo_name": "WelcomeHUME/svn-caucho-com-resin",
"path": "modules/resin/src/com/caucho/db/sql/Query.java",
"license": "gpl-2.0",
"size": 24095
}
|
[
"java.util.ArrayList"
] |
import java.util.ArrayList;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,910,697
|
public CmsWaitHandle getWaitHandleForUpdateTask() {
CmsWaitHandle handle = new CmsWaitHandle(true);
m_workQueue.add(handle);
return handle;
}
|
CmsWaitHandle function() { CmsWaitHandle handle = new CmsWaitHandle(true); m_workQueue.add(handle); return handle; }
|
/**
* Gets the wait handle which can be used to wait until the update task has run.<p>
*
* @return the wait handle
*/
|
Gets the wait handle which can be used to wait until the update task has run
|
getWaitHandleForUpdateTask
|
{
"repo_name": "alkacon/opencms-core",
"path": "src/org/opencms/ade/configuration/CmsConfigurationCache.java",
"license": "lgpl-2.1",
"size": 31365
}
|
[
"org.opencms.util.CmsWaitHandle"
] |
import org.opencms.util.CmsWaitHandle;
|
import org.opencms.util.*;
|
[
"org.opencms.util"
] |
org.opencms.util;
| 2,411,900
|
public T find(FilterItem<T> filter) {
T result = null;
if (filter != null) {
List<T> items = dataProvider.getList();
if (items != null && !items.isEmpty()) {
Iterator<T> iter = items.iterator();
while (result == null && iter.hasNext()) {
result = filter.isItem(iter.next());
}
}
}
return result;
}
|
T function(FilterItem<T> filter) { T result = null; if (filter != null) { List<T> items = dataProvider.getList(); if (items != null && !items.isEmpty()) { Iterator<T> iter = items.iterator(); while (result == null && iter.hasNext()) { result = filter.isItem(iter.next()); } } } return result; }
|
/**
* Finds the first item by the filter.
*
* @param filter the filter.
* @return the first item corresponding to the filter.
*/
|
Finds the first item by the filter
|
find
|
{
"repo_name": "lorislab/smonitor",
"path": "smonitor-web/src/main/java/org/lorislab/smonitor/gwt/uc/table/EntityDataGrid.java",
"license": "apache-2.0",
"size": 13052
}
|
[
"java.util.Iterator",
"java.util.List"
] |
import java.util.Iterator; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,389,053
|
@FIXVersion(introduced="4.0", retired="4.3")
@TagNumRef(tagNum=TagNum.ClientID)
public void setClientID(String clientID) {
this.clientID = clientID;
}
|
@FIXVersion(introduced="4.0", retired="4.3") @TagNumRef(tagNum=TagNum.ClientID) void function(String clientID) { this.clientID = clientID; }
|
/**
* Message field setter.
* @param clientID field value
*/
|
Message field setter
|
setClientID
|
{
"repo_name": "marvisan/HadesFIX",
"path": "Model/src/main/java/net/hades/fix/message/OrderModificationRequestMsg.java",
"license": "gpl-3.0",
"size": 149491
}
|
[
"net.hades.fix.message.anno.FIXVersion",
"net.hades.fix.message.anno.TagNumRef",
"net.hades.fix.message.type.TagNum"
] |
import net.hades.fix.message.anno.FIXVersion; import net.hades.fix.message.anno.TagNumRef; import net.hades.fix.message.type.TagNum;
|
import net.hades.fix.message.anno.*; import net.hades.fix.message.type.*;
|
[
"net.hades.fix"
] |
net.hades.fix;
| 1,390,070
|
private Team getOutcomeTeam(Instant currentInstant) {
Team outcomeTeam = null;
if (currentInstant.outcome instanceof Success) {
outcomeTeam = matchReport.getCurrentState().getTeam();
} else if (currentInstant.outcome instanceof Opponent) {
outcomeTeam = toggleTeam(matchReport.getCurrentState().getTeam());
} else if (currentInstant.outcome instanceof Challenge) {
outcomeTeam = ((Challenge) currentInstant.outcome).endTeam == Constants.OWN_TEAM ?
matchReport.getCurrentState().getTeam():
toggleTeam(matchReport.getCurrentState().getTeam());
}
return outcomeTeam;
}
|
Team function(Instant currentInstant) { Team outcomeTeam = null; if (currentInstant.outcome instanceof Success) { outcomeTeam = matchReport.getCurrentState().getTeam(); } else if (currentInstant.outcome instanceof Opponent) { outcomeTeam = toggleTeam(matchReport.getCurrentState().getTeam()); } else if (currentInstant.outcome instanceof Challenge) { outcomeTeam = ((Challenge) currentInstant.outcome).endTeam == Constants.OWN_TEAM ? matchReport.getCurrentState().getTeam(): toggleTeam(matchReport.getCurrentState().getTeam()); } return outcomeTeam; }
|
/**
* Utility function to nominate the 'outcome team' based on current instant
* @param currentInstant The current instant
* @return The team having the ball possession in the instant's outcome
*/
|
Utility function to nominate the 'outcome team' based on current instant
|
getOutcomeTeam
|
{
"repo_name": "lukecampbell99/OpenSoccer",
"path": "src/com/lukeyboy1/core/Match.java",
"license": "gpl-3.0",
"size": 187362
}
|
[
"com.lukeyboy1.representation.Challenge",
"com.lukeyboy1.representation.Instant",
"com.lukeyboy1.representation.Opponent",
"com.lukeyboy1.representation.Success"
] |
import com.lukeyboy1.representation.Challenge; import com.lukeyboy1.representation.Instant; import com.lukeyboy1.representation.Opponent; import com.lukeyboy1.representation.Success;
|
import com.lukeyboy1.representation.*;
|
[
"com.lukeyboy1.representation"
] |
com.lukeyboy1.representation;
| 1,769,540
|
@Test
void responseWithNotFoundPageWhenWrongParameter() {
Mockito.when(this.request.getParameter(CommandsTest.COMMAND)).thenReturn("invalid command");
final String path = this.commands.path(this.request);
Assertions.assertEquals(NotFound.NOT_FOUND_PAGE, path, "Should be not found page.");
}
|
void responseWithNotFoundPageWhenWrongParameter() { Mockito.when(this.request.getParameter(CommandsTest.COMMAND)).thenReturn(STR); final String path = this.commands.path(this.request); Assertions.assertEquals(NotFound.NOT_FOUND_PAGE, path, STR); }
|
/**
* Commands can return "Not found" page at wrong input.
*/
|
Commands can return "Not found" page at wrong input
|
responseWithNotFoundPageWhenWrongParameter
|
{
"repo_name": "Vovas11/courses",
"path": "src/test/java/com/devproserv/courses/command/CommandsTest.java",
"license": "mit",
"size": 3143
}
|
[
"org.junit.jupiter.api.Assertions",
"org.mockito.Mockito"
] |
import org.junit.jupiter.api.Assertions; import org.mockito.Mockito;
|
import org.junit.jupiter.api.*; import org.mockito.*;
|
[
"org.junit.jupiter",
"org.mockito"
] |
org.junit.jupiter; org.mockito;
| 2,370,689
|
public Map<String, Object> getData() {
return data;
}
|
Map<String, Object> function() { return data; }
|
/**
* Returns case file associated with the case
*/
|
Returns case file associated with the case
|
getData
|
{
"repo_name": "livthomas/jbpm",
"path": "jbpm-case-mgmt/jbpm-case-mgmt-api/src/main/java/org/jbpm/casemgmt/api/event/CaseReopenEvent.java",
"license": "apache-2.0",
"size": 2371
}
|
[
"java.util.Map"
] |
import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,733,056
|
public static Enumerable<Object[]> enumerable(final ScannableTable table,
final DataContext root) {
return table.scan(root);
}
|
static Enumerable<Object[]> function(final ScannableTable table, final DataContext root) { return table.scan(root); }
|
/** Returns an {@link org.apache.calcite.linq4j.Enumerable} over the rows of
* a given table, representing each row as an object array. */
|
Returns an <code>org.apache.calcite.linq4j.Enumerable</code> over the rows of
|
enumerable
|
{
"repo_name": "xhoong/incubator-calcite",
"path": "core/src/main/java/org/apache/calcite/schema/Schemas.java",
"license": "apache-2.0",
"size": 22020
}
|
[
"org.apache.calcite.DataContext",
"org.apache.calcite.linq4j.Enumerable"
] |
import org.apache.calcite.DataContext; import org.apache.calcite.linq4j.Enumerable;
|
import org.apache.calcite.*; import org.apache.calcite.linq4j.*;
|
[
"org.apache.calcite"
] |
org.apache.calcite;
| 412,136
|
interface WithExecute extends TextAnalyticsKeyPhrasesDefinitionStages.WithAllOptions {
KeyPhraseBatchResult execute();
|
interface WithExecute extends TextAnalyticsKeyPhrasesDefinitionStages.WithAllOptions { KeyPhraseBatchResult execute();
|
/**
* Execute the request.
*
* @return the KeyPhraseBatchResult object if successful.
*/
|
Execute the request
|
execute
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/cognitiveservices/ms-azure-cs-textanalytics/src/main/java/com/microsoft/azure/cognitiveservices/language/textanalytics/TextAnalytics.java",
"license": "mit",
"size": 16140
}
|
[
"com.microsoft.azure.cognitiveservices.language.textanalytics.models.KeyPhraseBatchResult"
] |
import com.microsoft.azure.cognitiveservices.language.textanalytics.models.KeyPhraseBatchResult;
|
import com.microsoft.azure.cognitiveservices.language.textanalytics.models.*;
|
[
"com.microsoft.azure"
] |
com.microsoft.azure;
| 2,114,450
|
OperationResult<SchemaChangeResult> addKeyspace(KeyspaceDefinition def) throws ConnectionException;
|
OperationResult<SchemaChangeResult> addKeyspace(KeyspaceDefinition def) throws ConnectionException;
|
/**
* Add a new keyspace to the cluster. The keyspace object may include column
* families as well. Create a KeyspaceDefinition object by calling
* makeKeyspaceDefinition().
*
* @param def
* @return
*/
|
Add a new keyspace to the cluster. The keyspace object may include column families as well. Create a KeyspaceDefinition object by calling makeKeyspaceDefinition()
|
addKeyspace
|
{
"repo_name": "bazaarvoice/astyanax",
"path": "astyanax-cassandra/src/main/java/com/netflix/astyanax/Cluster.java",
"license": "apache-2.0",
"size": 9281
}
|
[
"com.netflix.astyanax.connectionpool.OperationResult",
"com.netflix.astyanax.connectionpool.exceptions.ConnectionException",
"com.netflix.astyanax.ddl.KeyspaceDefinition",
"com.netflix.astyanax.ddl.SchemaChangeResult"
] |
import com.netflix.astyanax.connectionpool.OperationResult; import com.netflix.astyanax.connectionpool.exceptions.ConnectionException; import com.netflix.astyanax.ddl.KeyspaceDefinition; import com.netflix.astyanax.ddl.SchemaChangeResult;
|
import com.netflix.astyanax.connectionpool.*; import com.netflix.astyanax.connectionpool.exceptions.*; import com.netflix.astyanax.ddl.*;
|
[
"com.netflix.astyanax"
] |
com.netflix.astyanax;
| 2,510,374
|
@Override
public List<DrawerItem> loadInBackground() {
try {
Thread.sleep(5000);
} catch (InterruptedException e) {}
return generateDrawerItems(getContext());
}
}
public static class FixedDrawerItemLoader extends AsyncTaskLoader<List<DrawerItem>> {
private List<DrawerItem> items;
public FixedDrawerItemLoader(Context context) {
super(context);
}
|
List<DrawerItem> function() { try { Thread.sleep(5000); } catch (InterruptedException e) {} return generateDrawerItems(getContext()); } } public static class FixedDrawerItemLoader extends AsyncTaskLoader<List<DrawerItem>> { private List<DrawerItem> items; public FixedDrawerItemLoader(Context context) { super(context); }
|
/**
* This is where the bulk of our work is done. This function is called in a background thread and should generate a
* new set of data to be published by the loader.
*/
|
This is where the bulk of our work is done. This function is called in a background thread and should generate a new set of data to be published by the loader
|
loadInBackground
|
{
"repo_name": "gandulf/material-drawer",
"path": "demo/src/main/java/com/heinrichreimersoftware/materialdrawerdemo/MainActivityAsync.java",
"license": "apache-2.0",
"size": 19495
}
|
[
"android.content.Context",
"android.support.v4.content.AsyncTaskLoader",
"com.heinrichreimersoftware.materialdrawer.structure.DrawerItem",
"java.util.List"
] |
import android.content.Context; import android.support.v4.content.AsyncTaskLoader; import com.heinrichreimersoftware.materialdrawer.structure.DrawerItem; import java.util.List;
|
import android.content.*; import android.support.v4.content.*; import com.heinrichreimersoftware.materialdrawer.structure.*; import java.util.*;
|
[
"android.content",
"android.support",
"com.heinrichreimersoftware.materialdrawer",
"java.util"
] |
android.content; android.support; com.heinrichreimersoftware.materialdrawer; java.util;
| 1,047,150
|
public boolean isTableInfoExists(TableName tableName) throws IOException {
return getTableInfoPath(tableName) != null;
}
|
boolean function(TableName tableName) throws IOException { return getTableInfoPath(tableName) != null; }
|
/**
* Checks if a current table info file exists for the given table
*
* @param tableName name of table
* @return true if exists
* @throws IOException
*/
|
Checks if a current table info file exists for the given table
|
isTableInfoExists
|
{
"repo_name": "vincentpoon/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java",
"license": "apache-2.0",
"size": 33068
}
|
[
"java.io.IOException",
"org.apache.hadoop.hbase.TableName"
] |
import java.io.IOException; import org.apache.hadoop.hbase.TableName;
|
import java.io.*; import org.apache.hadoop.hbase.*;
|
[
"java.io",
"org.apache.hadoop"
] |
java.io; org.apache.hadoop;
| 1,386,882
|
public void testAccessPromptedThreeWrongResponses() throws Exception {
String fileName = "ttt.tmp";
String[] args = { "user", "1", "display", "-o", fileName };
ProtectedPoemApp it = new ProtectedPoemApp();
it.setInput(new StringInputStream("bad\nwrong\nbad\nwrong\nbad\nwrong\n_administrator_\nFIXME\n"));
try {
it.run(args);
fail("Should have bombed");
} catch (UnhandledExceptionException e) {
assertEquals("You need the capability _administer_ to write the object tableInfo/0 but your access token _guest_ doesn\'t confer it"
, e.subException.getMessage());
e = null;
}
File fileIn = new File(fileName);
fileIn.delete();
}
|
void function() throws Exception { String fileName = STR; String[] args = { "user", "1", STR, "-o", fileName }; ProtectedPoemApp it = new ProtectedPoemApp(); it.setInput(new StringInputStream(STR)); try { it.run(args); fail(STR); } catch (UnhandledExceptionException e) { assertEquals(STR , e.subException.getMessage()); e = null; } File fileIn = new File(fileName); fileIn.delete(); }
|
/**
* Access exceptions.
*/
|
Access exceptions
|
testAccessPromptedThreeWrongResponses
|
{
"repo_name": "timp21337/melati-old",
"path": "melati/src/test/java/org/melati/app/test/PoemAppTest.java",
"license": "gpl-2.0",
"size": 15268
}
|
[
"java.io.File",
"org.melati.app.UnhandledExceptionException",
"org.melati.util.test.StringInputStream"
] |
import java.io.File; import org.melati.app.UnhandledExceptionException; import org.melati.util.test.StringInputStream;
|
import java.io.*; import org.melati.app.*; import org.melati.util.test.*;
|
[
"java.io",
"org.melati.app",
"org.melati.util"
] |
java.io; org.melati.app; org.melati.util;
| 2,772,799
|
public void initializePackageContents() {
if (isInitialized) return;
isInitialized = true;
// Initialize package
setName(eNAME);
setNsPrefix(eNS_PREFIX);
setNsURI(eNS_URI);
// Obtain other dependent packages
BasePackage theBasePackage = (BasePackage)EPackage.Registry.INSTANCE.getEPackage(BasePackage.eNS_URI);
// Create type parameters
// Set bounds for type parameters
// Add supertypes to classes
caCallableEClass.getESuperTypes().add(theBasePackage.getModelRoot());
// Initialize classes, features, and operations; add parameters
initEClass(caCallableEClass, CaCallable.class, "CaCallable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getCaCallable_Receptions(), theBasePackage.getNamedReference(), "receptions", null, 0, -1, CaCallable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
// Create resource
createResource(eNS_URI);
}
|
void function() { if (isInitialized) return; isInitialized = true; setName(eNAME); setNsPrefix(eNS_PREFIX); setNsURI(eNS_URI); BasePackage theBasePackage = (BasePackage)EPackage.Registry.INSTANCE.getEPackage(BasePackage.eNS_URI); caCallableEClass.getESuperTypes().add(theBasePackage.getModelRoot()); initEClass(caCallableEClass, CaCallable.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getCaCallable_Receptions(), theBasePackage.getNamedReference(), STR, null, 0, -1, CaCallable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); createResource(eNS_URI); }
|
/**
* Complete the initialization of the package and its meta-model. This
* method is guarded to have no affect on any invocation but its first.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
|
Complete the initialization of the package and its meta-model. This method is guarded to have no affect on any invocation but its first.
|
initializePackageContents
|
{
"repo_name": "ELTE-Soft/xUML-RT-Executor",
"path": "plugins/hu.eltesoft.modelexecution.m2m.metamodel/src-gen/hu/eltesoft/modelexecution/m2m/metamodel/callable/impl/CallablePackageImpl.java",
"license": "epl-1.0",
"size": 9077
}
|
[
"hu.eltesoft.modelexecution.m2m.metamodel.base.BasePackage",
"hu.eltesoft.modelexecution.m2m.metamodel.callable.CaCallable",
"org.eclipse.emf.ecore.EPackage"
] |
import hu.eltesoft.modelexecution.m2m.metamodel.base.BasePackage; import hu.eltesoft.modelexecution.m2m.metamodel.callable.CaCallable; import org.eclipse.emf.ecore.EPackage;
|
import hu.eltesoft.modelexecution.m2m.metamodel.base.*; import hu.eltesoft.modelexecution.m2m.metamodel.callable.*; import org.eclipse.emf.ecore.*;
|
[
"hu.eltesoft.modelexecution",
"org.eclipse.emf"
] |
hu.eltesoft.modelexecution; org.eclipse.emf;
| 1,908,052
|
public static void cloneNewestPackageCache(Long fromChannelId, Long toChannelId) {
WriteMode m = ModeFactory.getWriteMode("Channel_queries",
"clone_newest_package");
Map<String, Object> params = new HashMap<String, Object>();
params.put("from_cid", fromChannelId);
params.put("to_cid", toChannelId);
m.executeUpdate(params);
}
|
static void function(Long fromChannelId, Long toChannelId) { WriteMode m = ModeFactory.getWriteMode(STR, STR); Map<String, Object> params = new HashMap<String, Object>(); params.put(STR, fromChannelId); params.put(STR, toChannelId); m.executeUpdate(params); }
|
/**
* Clones the "newest" channel packages according to clone.
*
* @param fromChannelId original channel id
* @param toChannelId cloned channle id
*/
|
Clones the "newest" channel packages according to clone
|
cloneNewestPackageCache
|
{
"repo_name": "jdobes/spacewalk",
"path": "java/code/src/com/redhat/rhn/domain/channel/ChannelFactory.java",
"license": "gpl-2.0",
"size": 42560
}
|
[
"com.redhat.rhn.common.db.datasource.ModeFactory",
"com.redhat.rhn.common.db.datasource.WriteMode",
"java.util.HashMap",
"java.util.Map"
] |
import com.redhat.rhn.common.db.datasource.ModeFactory; import com.redhat.rhn.common.db.datasource.WriteMode; import java.util.HashMap; import java.util.Map;
|
import com.redhat.rhn.common.db.datasource.*; import java.util.*;
|
[
"com.redhat.rhn",
"java.util"
] |
com.redhat.rhn; java.util;
| 881,049
|
@Override
public void validate() {
super.validate();
if (name() == null) {
throw LOGGER
.logExceptionAsError(
new IllegalArgumentException(
"Missing required property name in model ManagedClusterAgentPoolProfile"));
}
}
private static final ClientLogger LOGGER = new ClientLogger(ManagedClusterAgentPoolProfile.class);
|
void function() { super.validate(); if (name() == null) { throw LOGGER .logExceptionAsError( new IllegalArgumentException( STR)); } } private static final ClientLogger LOGGER = new ClientLogger(ManagedClusterAgentPoolProfile.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-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/ManagedClusterAgentPoolProfile.java",
"license": "mit",
"size": 9675
}
|
[
"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;
| 1,451,198
|
public boolean cacheGroupAffinityNode(ClusterNode node, int grpId) {
CacheGroupAffinity aff = registeredCacheGrps.get(grpId);
if (aff == null) {
log.warning("Registered cache group not found for groupId=" + grpId + ". Group was destroyed.");
return false;
}
return CU.affinityNode(node, aff.cacheFilter);
}
|
boolean function(ClusterNode node, int grpId) { CacheGroupAffinity aff = registeredCacheGrps.get(grpId); if (aff == null) { log.warning(STR + grpId + STR); return false; } return CU.affinityNode(node, aff.cacheFilter); }
|
/**
* Checks if node is a data node for the given cache group.
*
* @param node Node to check.
* @param grpId Cache group ID.
* @return {@code True} if node is a cache data node.
*/
|
Checks if node is a data node for the given cache group
|
cacheGroupAffinityNode
|
{
"repo_name": "chandresh-pancholi/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java",
"license": "apache-2.0",
"size": 138014
}
|
[
"org.apache.ignite.cluster.ClusterNode",
"org.apache.ignite.internal.util.typedef.internal.CU"
] |
import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.internal.util.typedef.internal.CU;
|
import org.apache.ignite.cluster.*; import org.apache.ignite.internal.util.typedef.internal.*;
|
[
"org.apache.ignite"
] |
org.apache.ignite;
| 2,203,932
|
public void testUpdateGameSummary () throws Exception {
insertFileIntoDb(TEST_DATA);
assertEquals (5, dbunitConn.getRowCount(TABLE));
// Retrieve game info and change its history
GameSummary paramGameSummary = (GameSummary)iBatis.getObject(IDatabase.ST_SELECT_GAME_SUMMARY, new GameSummary("chess", "dave"));
paramGameSummary.setRating(1215);
iBatis.update (IDatabase.ST_UPDATE_GAME_SUMMARY, paramGameSummary);
// Check to see if user is updated
GameSummary gameSummary = (GameSummary)iBatis.getObject(IDatabase.ST_SELECT_GAME_SUMMARY, new GameSummary("chess", "dave"));
assertEquals (1215, gameSummary.getRating());
}
|
void function () throws Exception { insertFileIntoDb(TEST_DATA); assertEquals (5, dbunitConn.getRowCount(TABLE)); GameSummary paramGameSummary = (GameSummary)iBatis.getObject(IDatabase.ST_SELECT_GAME_SUMMARY, new GameSummary("chess", "dave")); paramGameSummary.setRating(1215); iBatis.update (IDatabase.ST_UPDATE_GAME_SUMMARY, paramGameSummary); GameSummary gameSummary = (GameSummary)iBatis.getObject(IDatabase.ST_SELECT_GAME_SUMMARY, new GameSummary("chess", "dave")); assertEquals (1215, gameSummary.getRating()); }
|
/**
* Test updating a game summary: - IDatabase.ST_UPDATE_GAME_SUMMARY
*/
|
Test updating a game summary: - IDatabase.ST_UPDATE_GAME_SUMMARY
|
testUpdateGameSummary
|
{
"repo_name": "lsilvestre/Jogre",
"path": "server/test/src/org/jogre/server/data/db/GameSummaryTest.java",
"license": "gpl-2.0",
"size": 3962
}
|
[
"org.jogre.server.data.GameSummary"
] |
import org.jogre.server.data.GameSummary;
|
import org.jogre.server.data.*;
|
[
"org.jogre.server"
] |
org.jogre.server;
| 1,708,209
|
private BigDecimal toSeconds() {
return BigDecimal.valueOf(seconds).add(BigDecimal.valueOf(nanos, 9));
}
|
BigDecimal function() { return BigDecimal.valueOf(seconds).add(BigDecimal.valueOf(nanos, 9)); }
|
/**
* Converts this duration to the total length in seconds and
* fractional nanoseconds expressed as a {@code BigDecimal}.
*
* @return the total length of the duration in seconds, with a scale of 9, not null
*/
|
Converts this duration to the total length in seconds and fractional nanoseconds expressed as a BigDecimal
|
toSeconds
|
{
"repo_name": "stain/jdk8u",
"path": "src/share/classes/java/time/Duration.java",
"license": "gpl-2.0",
"size": 57292
}
|
[
"java.math.BigDecimal"
] |
import java.math.BigDecimal;
|
import java.math.*;
|
[
"java.math"
] |
java.math;
| 385,519
|
public static Indicator parseIndicator( Element indicatorElement ) throws TemplateParseException
{
if( !indicatorElement.hasAttribute(Template.A_INDICATORSTARTVALUE)
|| !indicatorElement.hasAttribute(Template.A_INDICATORENDVALUE) || !indicatorElement.hasAttribute(Template.A_COMPARATOR) ) {
throw new TemplateParseException("Missing attributes of Indicator element.");
}
Indicator indicator = new Indicator(indicatorElement.getAttribute(Template.A_INDICATORSTARTVALUE),
indicatorElement.getAttribute(Template.A_INDICATORENDVALUE),indicatorElement.getAttribute(Template.A_COMPARATOR) );
NodeList icompareList = indicatorElement.getElementsByTagName(Template.E_INDICATORCOMPARE);
for( int i=0; i<icompareList.getLength(); i++ ) {
Element icompare = (Element)icompareList.item(i);
indicator.addCompare(ICompare.parseICompare(icompare));
}
return indicator;
}
|
static Indicator function( Element indicatorElement ) throws TemplateParseException { if( !indicatorElement.hasAttribute(Template.A_INDICATORSTARTVALUE) !indicatorElement.hasAttribute(Template.A_INDICATORENDVALUE) !indicatorElement.hasAttribute(Template.A_COMPARATOR) ) { throw new TemplateParseException(STR); } Indicator indicator = new Indicator(indicatorElement.getAttribute(Template.A_INDICATORSTARTVALUE), indicatorElement.getAttribute(Template.A_INDICATORENDVALUE),indicatorElement.getAttribute(Template.A_COMPARATOR) ); NodeList icompareList = indicatorElement.getElementsByTagName(Template.E_INDICATORCOMPARE); for( int i=0; i<icompareList.getLength(); i++ ) { Element icompare = (Element)icompareList.item(i); indicator.addCompare(ICompare.parseICompare(icompare)); } return indicator; }
|
/**
* Given the DOM Indicator-Element, returns the Precondition that fits the XML.
* This class creates a new Indicator, parses all containing Compares and adds them to the Indicator.
*
* @param compareElement - the DOM Element of this Indicator
* @return the Precondition of the Indicator
* @throws TemplateParseException
*/
|
Given the DOM Indicator-Element, returns the Precondition that fits the XML. This class creates a new Indicator, parses all containing Compares and adds them to the Indicator
|
parseIndicator
|
{
"repo_name": "ArticulatedSocialAgentsPlatform/HmiCore",
"path": "HmiFlipper/src/hmi/flipper/behaviourselection/template/preconditions/Indicator.java",
"license": "lgpl-3.0",
"size": 8194
}
|
[
"org.w3c.dom.Element",
"org.w3c.dom.NodeList"
] |
import org.w3c.dom.Element; import org.w3c.dom.NodeList;
|
import org.w3c.dom.*;
|
[
"org.w3c.dom"
] |
org.w3c.dom;
| 1,680,777
|
void sortChildren(@NonNull GroupType group, @Nullable Comparator<ChildType> comparator);
|
void sortChildren(@NonNull GroupType group, @Nullable Comparator<ChildType> comparator);
|
/**
* Sorts the child items of a specific group in an ascending order, by using a comparator.
*
* @param group
* The group, whose child items should be sorted, as an instance of the generic type
* GroupType. The group may not be null. If the group does not belong to the adapter, a
* {@link NoSuchElementException} will be thrown
* @param comparator
* The comparator, which should be used to sort the child items, as an instance of the
* type {@link Comparator} or null, if the natural order should be used
*/
|
Sorts the child items of a specific group in an ascending order, by using a comparator
|
sortChildren
|
{
"repo_name": "michael-rapp/AndroidAdapters",
"path": "library/src/main/java/de/mrapp/android/adapter/expandablelist/sortable/SortableExpandableListAdapter.java",
"license": "apache-2.0",
"size": 36614
}
|
[
"androidx.annotation.NonNull",
"androidx.annotation.Nullable",
"java.util.Comparator"
] |
import androidx.annotation.NonNull; import androidx.annotation.Nullable; import java.util.Comparator;
|
import androidx.annotation.*; import java.util.*;
|
[
"androidx.annotation",
"java.util"
] |
androidx.annotation; java.util;
| 389,128
|
private long getCgroupCpuAcctUsageNanos(final String controlGroup) throws IOException {
return Long.parseLong(readSysFsCgroupCpuAcctCpuAcctUsage(controlGroup));
}
/**
* Returns the line from {@code cpuacct.usage} for the control group to which the Elasticsearch process belongs for the {@code cpuacct}
* subsystem. This line represents the total CPU time in nanoseconds consumed by all tasks in the same control group.
*
* @param controlGroup the control group to which the Elasticsearch process belongs for the {@code cpuacct} subsystem
* @return the line from {@code cpuacct.usage}
|
long function(final String controlGroup) throws IOException { return Long.parseLong(readSysFsCgroupCpuAcctCpuAcctUsage(controlGroup)); } /** * Returns the line from {@code cpuacct.usage} for the control group to which the Elasticsearch process belongs for the {@code cpuacct} * subsystem. This line represents the total CPU time in nanoseconds consumed by all tasks in the same control group. * * @param controlGroup the control group to which the Elasticsearch process belongs for the {@code cpuacct} subsystem * @return the line from {@code cpuacct.usage}
|
/**
* The total CPU time in nanoseconds consumed by all tasks in the cgroup to which the Elasticsearch process belongs for the {@code
* cpuacct} subsystem.
*
* @param controlGroup the control group for the Elasticsearch process for the {@code cpuacct} subsystem
* @return the total CPU time in nanoseconds
* @throws IOException if an I/O exception occurs reading {@code cpuacct.usage} for the control group
*/
|
The total CPU time in nanoseconds consumed by all tasks in the cgroup to which the Elasticsearch process belongs for the cpuacct subsystem
|
getCgroupCpuAcctUsageNanos
|
{
"repo_name": "artnowo/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/monitor/os/OsProbe.java",
"license": "apache-2.0",
"size": 21505
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 681,892
|
public LocalDate getUnderflowDate() {
return getUnderflowDateWithServiceResponseAsync().toBlocking().single().body();
}
|
LocalDate function() { return getUnderflowDateWithServiceResponseAsync().toBlocking().single().body(); }
|
/**
* Get underflow date value.
*
* @return the LocalDate object if successful.
*/
|
Get underflow date value
|
getUnderflowDate
|
{
"repo_name": "anudeepsharma/autorest",
"path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/bodydate/implementation/DatesImpl.java",
"license": "mit",
"size": 23082
}
|
[
"org.joda.time.LocalDate"
] |
import org.joda.time.LocalDate;
|
import org.joda.time.*;
|
[
"org.joda.time"
] |
org.joda.time;
| 1,273,280
|
private JPanel getJContentPane() {
if (jContentPane == null) {
GridBagConstraints gridBagConstraints = new GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
gridBagConstraints.weightx = 1.0D;
gridBagConstraints.gridy = 3;
GridBagConstraints gridBagConstraints11 = new GridBagConstraints();
gridBagConstraints11.gridx = 0;
gridBagConstraints11.insets = new Insets(2, 2, 2, 2);
gridBagConstraints11.fill = GridBagConstraints.HORIZONTAL;
gridBagConstraints11.weightx = 1.0D;
gridBagConstraints11.gridy = 0;
GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
gridBagConstraints1.gridx = 0;
gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints1.weightx = 1.0D;
gridBagConstraints1.weighty = 1.0D;
gridBagConstraints1.insets = new java.awt.Insets(5, 5, 5, 5);
gridBagConstraints1.gridy = 1;
GridBagConstraints gridBagConstraints12 = new GridBagConstraints();
gridBagConstraints12.gridx = 0;
gridBagConstraints12.insets = new java.awt.Insets(2, 2, 2, 2);
gridBagConstraints12.gridy = 2;
jContentPane = new JPanel();
jContentPane.setLayout(new GridBagLayout());
jContentPane.add(getButtonPanel(), gridBagConstraints12);
jContentPane.add(getPermissionPanel(), gridBagConstraints1);
jContentPane.add(getTitlePanel(), gridBagConstraints11);
jContentPane.add(getProgressPanel(), gridBagConstraints);
}
return jContentPane;
}
|
JPanel function() { if (jContentPane == null) { GridBagConstraints gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0D; gridBagConstraints.gridy = 3; GridBagConstraints gridBagConstraints11 = new GridBagConstraints(); gridBagConstraints11.gridx = 0; gridBagConstraints11.insets = new Insets(2, 2, 2, 2); gridBagConstraints11.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints11.weightx = 1.0D; gridBagConstraints11.gridy = 0; GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); gridBagConstraints1.gridx = 0; gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints1.weightx = 1.0D; gridBagConstraints1.weighty = 1.0D; gridBagConstraints1.insets = new java.awt.Insets(5, 5, 5, 5); gridBagConstraints1.gridy = 1; GridBagConstraints gridBagConstraints12 = new GridBagConstraints(); gridBagConstraints12.gridx = 0; gridBagConstraints12.insets = new java.awt.Insets(2, 2, 2, 2); gridBagConstraints12.gridy = 2; jContentPane = new JPanel(); jContentPane.setLayout(new GridBagLayout()); jContentPane.add(getButtonPanel(), gridBagConstraints12); jContentPane.add(getPermissionPanel(), gridBagConstraints1); jContentPane.add(getTitlePanel(), gridBagConstraints11); jContentPane.add(getProgressPanel(), gridBagConstraints); } return jContentPane; }
|
/**
* This method initializes jContentPane
*
* @return javax.swing.JPanel
*/
|
This method initializes jContentPane
|
getJContentPane
|
{
"repo_name": "NCIP/cagrid",
"path": "cagrid/Software/core/caGrid/projects/gaards-ui/src/org/cagrid/gaards/ui/gts/AddPermissionWindow.java",
"license": "bsd-3-clause",
"size": 7054
}
|
[
"java.awt.GridBagConstraints",
"java.awt.GridBagLayout",
"java.awt.Insets",
"javax.swing.JPanel"
] |
import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import javax.swing.JPanel;
|
import java.awt.*; import javax.swing.*;
|
[
"java.awt",
"javax.swing"
] |
java.awt; javax.swing;
| 44,993
|
synchronized (lock) {
Iterator<Tuple<Object, X>> iterator = lst.iterator();
while (iterator.hasNext()) {
Tuple<Object, X> tup = iterator.next();
if (tup.o1.equals(configuration)) {
iterator.remove();
return tup.o2;
}
}
}
return null;
}
|
synchronized (lock) { Iterator<Tuple<Object, X>> iterator = lst.iterator(); while (iterator.hasNext()) { Tuple<Object, X> tup = iterator.next(); if (tup.o1.equals(configuration)) { iterator.remove(); return tup.o2; } } } return null; }
|
/**
* Returns null if there's no object for the given configuration.
*/
|
Returns null if there's no object for the given configuration
|
getObject
|
{
"repo_name": "rajul/Pydev",
"path": "plugins/org.python.pydev.shared_core/src/org/python/pydev/shared_core/threaded_objects_pool/ThreadedObjectsPool.java",
"license": "epl-1.0",
"size": 1830
}
|
[
"java.util.Iterator",
"org.python.pydev.shared_core.structure.Tuple"
] |
import java.util.Iterator; import org.python.pydev.shared_core.structure.Tuple;
|
import java.util.*; import org.python.pydev.shared_core.structure.*;
|
[
"java.util",
"org.python.pydev"
] |
java.util; org.python.pydev;
| 2,365,737
|
@ServiceMethod(returns = ReturnType.SINGLE)
public void create(
String resourceGroupName, String managedInstanceName, TdeCertificate parameters, Context context) {
createAsync(resourceGroupName, managedInstanceName, parameters, context).block();
}
|
@ServiceMethod(returns = ReturnType.SINGLE) void function( String resourceGroupName, String managedInstanceName, TdeCertificate parameters, Context context) { createAsync(resourceGroupName, managedInstanceName, parameters, context).block(); }
|
/**
* Creates a TDE certificate for a given server.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param managedInstanceName The name of the managed instance.
* @param parameters A TDE certificate that can be uploaded into a server.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
|
Creates a TDE certificate for a given server
|
create
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-sql/src/main/java/com/azure/resourcemanager/sql/implementation/ManagedInstanceTdeCertificatesClientImpl.java",
"license": "mit",
"size": 17667
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.util.Context",
"com.azure.resourcemanager.sql.models.TdeCertificate"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.util.Context; import com.azure.resourcemanager.sql.models.TdeCertificate;
|
import com.azure.core.annotation.*; import com.azure.core.util.*; import com.azure.resourcemanager.sql.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 880,604
|
private void init() {
try {
final SwmmInput swmmInput = inputManager.getUR();
final CidsBean swmmProjectBean = swmmInput.fetchSwmmProject();
final List<CidsBean> timeseriesBeans = swmmInput.fetchTimeseries();
final HashMap<String, CidsBean> beansMap = new HashMap<String, CidsBean>(timeseriesBeans.size() + 1);
this.startDateLabel.setText(SwmmInput.UTC_DATE_FORMAT.format(swmmInput.getStartDate()) + " UTC");
this.endDateLabel.setText(SwmmInput.UTC_DATE_FORMAT.format(swmmInput.getEndDate()) + " UTC");
beansMap.put("-1", swmmProjectBean);
for (final CidsBean timeseriesBean : timeseriesBeans) {
beansMap.put(timeseriesBean.getProperty("id").toString(), timeseriesBean);
}
this.swmmInputListener = new SwmmInputListener(beansMap);
swmmProjectLink.setText((String)swmmProjectBean.getProperty("title")); // NOI18N
swmmProjectLink.addActionListener(WeakListeners.create(
ActionListener.class,
swmmInputListener,
swmmProjectLink));
swmmProjectLink.setActionCommand("-1");
final GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 3;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
for (final CidsBean timeseriesBean : timeseriesBeans) {
final JXHyperlink timeseriesLink = new JXHyperlink();
timeseriesLink.setText((String)timeseriesBean.getProperty("name")); // NOI18N
timeseriesLink.setActionCommand(timeseriesBean.getProperty("id").toString());
timeseriesLink.addActionListener(WeakListeners.create(
ActionListener.class,
swmmInputListener,
timeseriesLink));
add(timeseriesLink, gridBagConstraints);
gridBagConstraints.gridy++;
}
} catch (final IOException ex) {
// swmmProjectLink.setText("ERROR: " + ex); // NOI18N
// // NOI18N
LOG.error("cannot initialise swmm input manager ui", ex); // NOI18N
}
}
|
void function() { try { final SwmmInput swmmInput = inputManager.getUR(); final CidsBean swmmProjectBean = swmmInput.fetchSwmmProject(); final List<CidsBean> timeseriesBeans = swmmInput.fetchTimeseries(); final HashMap<String, CidsBean> beansMap = new HashMap<String, CidsBean>(timeseriesBeans.size() + 1); this.startDateLabel.setText(SwmmInput.UTC_DATE_FORMAT.format(swmmInput.getStartDate()) + STR); this.endDateLabel.setText(SwmmInput.UTC_DATE_FORMAT.format(swmmInput.getEndDate()) + STR); beansMap.put("-1", swmmProjectBean); for (final CidsBean timeseriesBean : timeseriesBeans) { beansMap.put(timeseriesBean.getProperty("id").toString(), timeseriesBean); } this.swmmInputListener = new SwmmInputListener(beansMap); swmmProjectLink.setText((String)swmmProjectBean.getProperty("title")); swmmProjectLink.addActionListener(WeakListeners.create( ActionListener.class, swmmInputListener, swmmProjectLink)); swmmProjectLink.setActionCommand("-1"); final GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); for (final CidsBean timeseriesBean : timeseriesBeans) { final JXHyperlink timeseriesLink = new JXHyperlink(); timeseriesLink.setText((String)timeseriesBean.getProperty("name")); timeseriesLink.setActionCommand(timeseriesBean.getProperty("id").toString()); timeseriesLink.addActionListener(WeakListeners.create( ActionListener.class, swmmInputListener, timeseriesLink)); add(timeseriesLink, gridBagConstraints); gridBagConstraints.gridy++; } } catch (final IOException ex) { LOG.error(STR, ex); } }
|
/**
* DOCUMENT ME!
*/
|
DOCUMENT ME
|
init
|
{
"repo_name": "cismet/cids-custom-sudplan-linz",
"path": "src/main/java/de/cismet/cids/custom/sudplan/linz/SwmmInputManagerUI.java",
"license": "lgpl-3.0",
"size": 11383
}
|
[
"de.cismet.cids.dynamics.CidsBean",
"java.awt.GridBagConstraints",
"java.awt.event.ActionListener",
"java.io.IOException",
"java.util.HashMap",
"java.util.List",
"org.jdesktop.swingx.JXHyperlink",
"org.openide.util.WeakListeners"
] |
import de.cismet.cids.dynamics.CidsBean; import java.awt.GridBagConstraints; import java.awt.event.ActionListener; import java.io.IOException; import java.util.HashMap; import java.util.List; import org.jdesktop.swingx.JXHyperlink; import org.openide.util.WeakListeners;
|
import de.cismet.cids.dynamics.*; import java.awt.*; import java.awt.event.*; import java.io.*; import java.util.*; import org.jdesktop.swingx.*; import org.openide.util.*;
|
[
"de.cismet.cids",
"java.awt",
"java.io",
"java.util",
"org.jdesktop.swingx",
"org.openide.util"
] |
de.cismet.cids; java.awt; java.io; java.util; org.jdesktop.swingx; org.openide.util;
| 1,532,094
|
public final void resetDependencyCheckInterval()
{
if (_lifecycle.isDestroyed())
return;
DependencyContainer dependencies = _dependencies;
if (dependencies == null)
return;
dependencies.resetDependencyCheckInterval();
}
|
final void function() { if (_lifecycle.isDestroyed()) return; DependencyContainer dependencies = _dependencies; if (dependencies == null) return; dependencies.resetDependencyCheckInterval(); }
|
/**
* Returns true if any of the classes have been modified.
*/
|
Returns true if any of the classes have been modified
|
resetDependencyCheckInterval
|
{
"repo_name": "bertrama/resin",
"path": "modules/kernel/src/com/caucho/loader/DynamicClassLoader.java",
"license": "gpl-2.0",
"size": 58059
}
|
[
"com.caucho.make.DependencyContainer"
] |
import com.caucho.make.DependencyContainer;
|
import com.caucho.make.*;
|
[
"com.caucho.make"
] |
com.caucho.make;
| 1,515,177
|
public final boolean isMultiDimensional(){
return (this instanceof AbstractMetricMultiDimensional);
}
|
final boolean function(){ return (this instanceof AbstractMetricMultiDimensional); }
|
/**
* Returns true if the metric is multi-dimensional.
*
* @return
*/
|
Returns true if the metric is multi-dimensional
|
isMultiDimensional
|
{
"repo_name": "arx-deidentifier/arx",
"path": "src/main/org/deidentifier/arx/metric/Metric.java",
"license": "apache-2.0",
"size": 74297
}
|
[
"org.deidentifier.arx.metric.v2.AbstractMetricMultiDimensional"
] |
import org.deidentifier.arx.metric.v2.AbstractMetricMultiDimensional;
|
import org.deidentifier.arx.metric.v2.*;
|
[
"org.deidentifier.arx"
] |
org.deidentifier.arx;
| 243,857
|
// this is necessary since the attributes are not exposed as a list by default
Field field = null;
try {
field = KualiQueryCustomizerDefaultImpl.class.getSuperclass().getDeclaredField("m_attributeList");
}
catch (Exception e) {
throw new RuntimeException(e);
}
field.setAccessible(true);
Map<String, String> m_attributeList = null;
try {
m_attributeList = (Map) field.get(this);
}
catch (Exception e) {
throw new RuntimeException(e);
}
return m_attributeList;
}
|
Field field = null; try { field = KualiQueryCustomizerDefaultImpl.class.getSuperclass().getDeclaredField(STR); } catch (Exception e) { throw new RuntimeException(e); } field.setAccessible(true); Map<String, String> m_attributeList = null; try { m_attributeList = (Map) field.get(this); } catch (Exception e) { throw new RuntimeException(e); } return m_attributeList; }
|
/**
* exposes the list of attributes specified in the ojb file. This is necessary since
* the super class does not expose this.
* @return a list of attributes
*/
|
exposes the list of attributes specified in the ojb file. This is necessary since the super class does not expose this
|
getAttributes
|
{
"repo_name": "Ariah-Group/Finance",
"path": "af_webapp/src/main/java/org/kuali/kfs/module/purap/dataaccess/impl/KualiQueryCustomizerDefaultImpl.java",
"license": "apache-2.0",
"size": 1808
}
|
[
"java.lang.reflect.Field",
"java.util.Map"
] |
import java.lang.reflect.Field; import java.util.Map;
|
import java.lang.reflect.*; import java.util.*;
|
[
"java.lang",
"java.util"
] |
java.lang; java.util;
| 316,116
|
public static Icon getFileChooserHomeFolderIcon()
{
if (fileChooserHomeFolderIcon == null)
fileChooserHomeFolderIcon = new FileChooserHomeFolderIcon();
return fileChooserHomeFolderIcon;
}
|
static Icon function() { if (fileChooserHomeFolderIcon == null) fileChooserHomeFolderIcon = new FileChooserHomeFolderIcon(); return fileChooserHomeFolderIcon; }
|
/**
* Returns an icon for use by the {@link JFileChooser} component.
*
* @return An icon.
*/
|
Returns an icon for use by the <code>JFileChooser</code> component
|
getFileChooserHomeFolderIcon
|
{
"repo_name": "taciano-perez/JamVM-PH",
"path": "src/classpath/javax/swing/plaf/metal/MetalIconFactory.java",
"license": "gpl-2.0",
"size": 75247
}
|
[
"javax.swing.Icon"
] |
import javax.swing.Icon;
|
import javax.swing.*;
|
[
"javax.swing"
] |
javax.swing;
| 2,341,864
|
public void update(KerberosIdentityDescriptor updates) {
if (updates != null) {
setName(updates.getName());
setReference(updates.getReference());
setPassword(updates.getPassword());
KerberosPrincipalDescriptor existingPrincipal = getPrincipalDescriptor();
if (existingPrincipal == null) {
setPrincipalDescriptor(updates.getPrincipalDescriptor());
} else {
existingPrincipal.update(updates.getPrincipalDescriptor());
}
KerberosKeytabDescriptor existingKeytabDescriptor = getKeytabDescriptor();
if (existingKeytabDescriptor == null) {
setKeytabDescriptor(updates.getKeytabDescriptor());
} else {
existingKeytabDescriptor.update(updates.getKeytabDescriptor());
}
Predicate updatedWhen = updates.getWhen();
if(updatedWhen != null) {
setWhen(updatedWhen);
}
}
}
/**
* Creates a Map of values that can be used to create a copy of this KerberosIdentityDescriptor
* or generate the JSON structure described in
* {@link org.apache.ambari.server.state.kerberos.KerberosIdentityDescriptor}
|
void function(KerberosIdentityDescriptor updates) { if (updates != null) { setName(updates.getName()); setReference(updates.getReference()); setPassword(updates.getPassword()); KerberosPrincipalDescriptor existingPrincipal = getPrincipalDescriptor(); if (existingPrincipal == null) { setPrincipalDescriptor(updates.getPrincipalDescriptor()); } else { existingPrincipal.update(updates.getPrincipalDescriptor()); } KerberosKeytabDescriptor existingKeytabDescriptor = getKeytabDescriptor(); if (existingKeytabDescriptor == null) { setKeytabDescriptor(updates.getKeytabDescriptor()); } else { existingKeytabDescriptor.update(updates.getKeytabDescriptor()); } Predicate updatedWhen = updates.getWhen(); if(updatedWhen != null) { setWhen(updatedWhen); } } } /** * Creates a Map of values that can be used to create a copy of this KerberosIdentityDescriptor * or generate the JSON structure described in * {@link org.apache.ambari.server.state.kerberos.KerberosIdentityDescriptor}
|
/**
* Updates this KerberosIdentityDescriptor with data from another KerberosIdentityDescriptor
* <p/>
* Properties will be updated if the relevant updated values are not null.
*
* @param updates the KerberosIdentityDescriptor containing the updated values
*/
|
Updates this KerberosIdentityDescriptor with data from another KerberosIdentityDescriptor Properties will be updated if the relevant updated values are not null
|
update
|
{
"repo_name": "alexryndin/ambari",
"path": "ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptor.java",
"license": "apache-2.0",
"size": 14271
}
|
[
"java.util.Map",
"org.apache.ambari.server.collections.Predicate"
] |
import java.util.Map; import org.apache.ambari.server.collections.Predicate;
|
import java.util.*; import org.apache.ambari.server.collections.*;
|
[
"java.util",
"org.apache.ambari"
] |
java.util; org.apache.ambari;
| 1,915,908
|
public static void createMarker(IResource resource, Integer lineNumber, String message) {
createMarker(resource, lineNumber, message, IMarker.SEVERITY_ERROR);
}
|
static void function(IResource resource, Integer lineNumber, String message) { createMarker(resource, lineNumber, message, IMarker.SEVERITY_ERROR); }
|
/**
* Create a marker to the given resource. The marker's severity will be "ERROR".
*
* @param resource the file where the problem occured
* @param message error message
* @param lineNumber line number
*/
|
Create a marker to the given resource. The marker's severity will be "ERROR"
|
createMarker
|
{
"repo_name": "kolovos/texlipse",
"path": "net.sourceforge.texlipse/src/net/sourceforge/texlipse/builder/AbstractProgramRunner.java",
"license": "epl-1.0",
"size": 14351
}
|
[
"org.eclipse.core.resources.IMarker",
"org.eclipse.core.resources.IResource"
] |
import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.*;
|
[
"org.eclipse.core"
] |
org.eclipse.core;
| 2,862,478
|
public Principal[] getEntityNames()
{
if (holder.getEntityName() != null)
{
return getPrincipals(holder.getEntityName());
}
return null;
}
|
Principal[] function() { if (holder.getEntityName() != null) { return getPrincipals(holder.getEntityName()); } return null; }
|
/**
* Return any principal objects inside the attribute certificate holder
* entity names field.
*
* @return an array of Principal objects (usually X500Principal), null if no
* entity names field is set.
*/
|
Return any principal objects inside the attribute certificate holder entity names field
|
getEntityNames
|
{
"repo_name": "sake/bouncycastle-java",
"path": "src/org/bouncycastle/x509/AttributeCertificateHolder.java",
"license": "mit",
"size": 12524
}
|
[
"java.security.Principal"
] |
import java.security.Principal;
|
import java.security.*;
|
[
"java.security"
] |
java.security;
| 2,353,296
|
public Function<? super HttpService, ? extends HttpService> newSamlDecorator() {
return delegate -> new SamlDecorator(this, delegate);
}
|
Function<? super HttpService, ? extends HttpService> function() { return delegate -> new SamlDecorator(this, delegate); }
|
/**
* Creates a decorator which initiates a SAML authentication if a request is not authenticated.
*/
|
Creates a decorator which initiates a SAML authentication if a request is not authenticated
|
newSamlDecorator
|
{
"repo_name": "line/armeria",
"path": "saml/src/main/java/com/linecorp/armeria/server/saml/SamlServiceProvider.java",
"license": "apache-2.0",
"size": 8902
}
|
[
"com.linecorp.armeria.server.HttpService",
"java.util.function.Function"
] |
import com.linecorp.armeria.server.HttpService; import java.util.function.Function;
|
import com.linecorp.armeria.server.*; import java.util.function.*;
|
[
"com.linecorp.armeria",
"java.util"
] |
com.linecorp.armeria; java.util;
| 1,977,654
|
public void updateStateAndSendEvent(long bytesUsed) {
synchronized (this) {
MemoryState oldState = this.mostRecentEvent.getState();
MemoryState newState = this.thresholds.computeNextState(oldState, bytesUsed);
if (oldState != newState) {
this.currentState = newState;
MemoryEvent event = new MemoryEvent(ResourceType.OFFHEAP_MEMORY, oldState, newState, this.cache.getMyId(), bytesUsed, true,
this.thresholds);
this.upcomingEvent.set(event);
processLocalEvent(event);
updateStatsFromEvent(event);
// The state didn't change. However, if the state isn't normal and we've
// been in that state for a while, send another event with the updated
// memory usage.
} else if (!oldState.isNormal() && (System.currentTimeMillis() - this.mostRecentEvent.getEventTime()) > 1000) {
MemoryEvent event = new MemoryEvent(ResourceType.OFFHEAP_MEMORY, oldState, newState, this.cache.getMyId(), bytesUsed, true,
this.thresholds);
this.upcomingEvent.set(event);
processLocalEvent(event);
}
}
}
|
void function(long bytesUsed) { synchronized (this) { MemoryState oldState = this.mostRecentEvent.getState(); MemoryState newState = this.thresholds.computeNextState(oldState, bytesUsed); if (oldState != newState) { this.currentState = newState; MemoryEvent event = new MemoryEvent(ResourceType.OFFHEAP_MEMORY, oldState, newState, this.cache.getMyId(), bytesUsed, true, this.thresholds); this.upcomingEvent.set(event); processLocalEvent(event); updateStatsFromEvent(event); } else if (!oldState.isNormal() && (System.currentTimeMillis() - this.mostRecentEvent.getEventTime()) > 1000) { MemoryEvent event = new MemoryEvent(ResourceType.OFFHEAP_MEMORY, oldState, newState, this.cache.getMyId(), bytesUsed, true, this.thresholds); this.upcomingEvent.set(event); processLocalEvent(event); } } }
|
/**
* Compare the number of bytes used to the thresholds. If necessary, change
* the state and send an event for the state change.
*
* Public for testing.
*
* @param bytesUsed
* Number of bytes of heap memory currently used.
*/
|
Compare the number of bytes used to the thresholds. If necessary, change the state and send an event for the state change. Public for testing
|
updateStateAndSendEvent
|
{
"repo_name": "papicella/snappy-store",
"path": "gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/control/OffHeapMemoryMonitor.java",
"license": "apache-2.0",
"size": 16142
}
|
[
"com.gemstone.gemfire.internal.cache.control.InternalResourceManager",
"com.gemstone.gemfire.internal.cache.control.MemoryThresholds"
] |
import com.gemstone.gemfire.internal.cache.control.InternalResourceManager; import com.gemstone.gemfire.internal.cache.control.MemoryThresholds;
|
import com.gemstone.gemfire.internal.cache.control.*;
|
[
"com.gemstone.gemfire"
] |
com.gemstone.gemfire;
| 1,364,271
|
@Override
public String getExample() {
if (this.myExample != null) {
return myExample;
} else {
cls.getOntModel().enterCriticalSection(Lock.READ);
try {
setExample(webappDaoFactory.getJenaBaseDao().getPropertyStringValue(cls, webappDaoFactory.getJenaBaseDao().EXAMPLE_ANNOT));
return myExample;
} finally {
cls.getOntModel().leaveCriticalSection();
}
}
}
|
String function() { if (this.myExample != null) { return myExample; } else { cls.getOntModel().enterCriticalSection(Lock.READ); try { setExample(webappDaoFactory.getJenaBaseDao().getPropertyStringValue(cls, webappDaoFactory.getJenaBaseDao().EXAMPLE_ANNOT)); return myExample; } finally { cls.getOntModel().leaveCriticalSection(); } } }
|
/**
* An example member of this VClass
*/
|
An example member of this VClass
|
getExample
|
{
"repo_name": "vivo-project/Vitro",
"path": "api/src/main/java/edu/cornell/mannlib/vitro/webapp/dao/jena/VClassJena.java",
"license": "bsd-3-clause",
"size": 15443
}
|
[
"org.apache.jena.shared.Lock"
] |
import org.apache.jena.shared.Lock;
|
import org.apache.jena.shared.*;
|
[
"org.apache.jena"
] |
org.apache.jena;
| 1,886,142
|
public static int frequency(Iterable<?> iterable, @Nullable Object element) {
if ((iterable instanceof Multiset)) {
return ((Multiset<?>) iterable).count(element);
}
if ((iterable instanceof Set)) {
return ((Set<?>) iterable).contains(element) ? 1 : 0;
}
return Iterators.frequency(iterable.iterator(), element);
}
/**
* Returns an iterable whose iterators cycle indefinitely over the elements of
* {@code iterable}.
*
* <p>That iterator supports {@code remove()} if {@code iterable.iterator()}
* does. After {@code remove()} is called, subsequent cycles omit the removed
* element, which is no longer in {@code iterable}. The iterator's
* {@code hasNext()} method returns {@code true} until {@code iterable} is
* empty.
*
* <p><b>Warning:</b> Typical uses of the resulting iterator may produce an
* infinite loop. You should use an explicit {@code break} or be certain that
* you will eventually remove all the elements.
*
* <p>To cycle over the iterable {@code n} times, use the following:
* {@code Iterables.concat(Collections.nCopies(n, iterable))}
|
static int function(Iterable<?> iterable, @Nullable Object element) { if ((iterable instanceof Multiset)) { return ((Multiset<?>) iterable).count(element); } if ((iterable instanceof Set)) { return ((Set<?>) iterable).contains(element) ? 1 : 0; } return Iterators.frequency(iterable.iterator(), element); } /** * Returns an iterable whose iterators cycle indefinitely over the elements of * {@code iterable}. * * <p>That iterator supports {@code remove()} if {@code iterable.iterator()} * does. After {@code remove()} is called, subsequent cycles omit the removed * element, which is no longer in {@code iterable}. The iterator's * {@code hasNext()} method returns {@code true} until {@code iterable} is * empty. * * <p><b>Warning:</b> Typical uses of the resulting iterator may produce an * infinite loop. You should use an explicit {@code break} or be certain that * you will eventually remove all the elements. * * <p>To cycle over the iterable {@code n} times, use the following: * {@code Iterables.concat(Collections.nCopies(n, iterable))}
|
/**
* Returns the number of elements in the specified iterable that equal the
* specified object.
*
* @see Collections#frequency
*/
|
Returns the number of elements in the specified iterable that equal the specified object
|
frequency
|
{
"repo_name": "jgaltidor/VarJ",
"path": "analyzed_libs/guava-libraries-read-only/src/com/google/common/collect/Iterables.java",
"license": "mit",
"size": 34128
}
|
[
"java.util.Collections",
"java.util.Set",
"javax.annotation.Nullable"
] |
import java.util.Collections; import java.util.Set; import javax.annotation.Nullable;
|
import java.util.*; import javax.annotation.*;
|
[
"java.util",
"javax.annotation"
] |
java.util; javax.annotation;
| 316,820
|
@Override
public double getDouble(int columnIndex) throws SQLException {
Object o = get(columnIndex);
if (o != null && !(o instanceof Number)) {
return Double.parseDouble(o.toString());
}
return o == null ? 0 : ((Number) o).doubleValue();
}
|
double function(int columnIndex) throws SQLException { Object o = get(columnIndex); if (o != null && !(o instanceof Number)) { return Double.parseDouble(o.toString()); } return o == null ? 0 : ((Number) o).doubleValue(); }
|
/**
* Returns the value as an double.
*
* @param columnIndex (1,2,...)
* @return the value
*/
|
Returns the value as an double
|
getDouble
|
{
"repo_name": "ferquies/2dam",
"path": "AD/Tema 2/h2/src/main/org/h2/tools/SimpleResultSet.java",
"license": "gpl-3.0",
"size": 53505
}
|
[
"java.sql.SQLException"
] |
import java.sql.SQLException;
|
import java.sql.*;
|
[
"java.sql"
] |
java.sql;
| 407,690
|
synchronized public static TestBedConfiguration getInstance() {
try {
if (instance == null) {
if (configFile == null) {
return null;
} else {
instance = new TestBedConfiguration();
}
}
return instance;
} catch (ConfigurationException e) {
logger.fatal("Cannot load configuration", e);
return null;
}
}
|
synchronized static TestBedConfiguration function() { try { if (instance == null) { if (configFile == null) { return null; } else { instance = new TestBedConfiguration(); } } return instance; } catch (ConfigurationException e) { logger.fatal(STR, e); return null; } }
|
/**
* Get an instance of the TestBedConfiguration.
* setConfFile method can be used to specified another configuration file.
*
* @return The TestBedConfiguration or null if not configuration file has been set.
*/
|
Get an instance of the TestBedConfiguration. setConfFile method can be used to specified another configuration file
|
getInstance
|
{
"repo_name": "qspin/qtaste",
"path": "kernel/src/main/java/com/qspin/qtaste/config/TestBedConfiguration.java",
"license": "lgpl-3.0",
"size": 14363
}
|
[
"org.apache.commons.configuration.ConfigurationException"
] |
import org.apache.commons.configuration.ConfigurationException;
|
import org.apache.commons.configuration.*;
|
[
"org.apache.commons"
] |
org.apache.commons;
| 502,807
|
TextualAnnotationData getLastUserAnnotation()
{
Map<Long, List> m = getTextualAnnotationByOwner();
long userID = MetadataViewerAgent.getUserDetails().getId();
List l = m.get(userID);
if (l == null || l.size() == 0) return null;
return (TextualAnnotationData) l.get(0);
}
|
TextualAnnotationData getLastUserAnnotation() { Map<Long, List> m = getTextualAnnotationByOwner(); long userID = MetadataViewerAgent.getUserDetails().getId(); List l = m.get(userID); if (l == null l.size() == 0) return null; return (TextualAnnotationData) l.get(0); }
|
/**
* Returns the annotation made by the currently selected user.
*
* @return See above.
*/
|
Returns the annotation made by the currently selected user
|
getLastUserAnnotation
|
{
"repo_name": "tp81/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/editor/EditorModel.java",
"license": "gpl-2.0",
"size": 128116
}
|
[
"java.util.List",
"java.util.Map",
"org.openmicroscopy.shoola.agents.metadata.MetadataViewerAgent"
] |
import java.util.List; import java.util.Map; import org.openmicroscopy.shoola.agents.metadata.MetadataViewerAgent;
|
import java.util.*; import org.openmicroscopy.shoola.agents.metadata.*;
|
[
"java.util",
"org.openmicroscopy.shoola"
] |
java.util; org.openmicroscopy.shoola;
| 2,084,767
|
private void refresh() {
try {
// Only get the row with mRowId
String selection = COL_ID + "=" + mRowId;
// First get the names of all the columns in the database
Cursor cursor = getContentResolver().query(mUri, null, selection,
null, null);
String[] columns = cursor.getColumnNames();
cursor.close();
// Then get the columns for this row
String sort = COL_DATE + " DESC";
cursor = getContentResolver().query(mUri, columns, selection, null,
sort);
int indexId = cursor.getColumnIndex(COL_ID);
int indexDate = cursor.getColumnIndex(COL_DATE);
int indexAddress = cursor.getColumnIndex(COL_ADDRESS);
int indexType = cursor.getColumnIndex(COL_TYPE);
int indexBody = cursor.getColumnIndex(COL_BODY);
Log.d(TAG, this.getClass().getSimpleName() + ".refresh: "
+ " mRowId=" + mRowId + " mUri=" + mUri.toString());
// There should only be one row returned, the last will be the most
// recent if more are returned owing to the sort above
boolean found = cursor.moveToFirst();
if (!found) {
mTitleTextView.setText("<Error>");
mSubtitleTextView.setText("");
mBodyTextView.setText("Failed to find message " + mRowId);
} else {
String id = cursor.getString(indexId);
long dateNum = -1L;
if (indexDate > -1) {
dateNum = cursor.getLong(indexDate) * mDateMultiplier;
}
String address = "<Address NA>";
if (indexAddress > -1) {
address = cursor.getString(indexAddress);
}
int type = -1;
if (indexType > -1) {
type = cursor.getInt(indexType);
}
String body = "<Body NA>";
if (indexBody > -1) {
body = cursor.getString(indexBody);
}
String title = id;
// Indicate if more than one found
if (cursor.getCount() > 1) {
title += " [1/" + cursor.getCount() + "]";
}
title += ": " + MessageUtils.formatAddress(address) + "\n"
+ MessageUtils.formatDate(dateNum);
String subTitle = "";
Log.d(TAG, getClass().getSimpleName() + ".refresh" + " id="
+ id + " address=" + address + " dateNum=" + dateNum);
// Add all the fields in the database
subTitle += MessageUtils.getColumnNamesAndValues(cursor);
// Set the TextViews
mTitleTextView.setText(title);
mSubtitleTextView.setText(subTitle);
mBodyTextView.setText(body);
// Set the info view
String info = MessageUtils.formatDate(
MessageUtils.shortFormatter, dateNum)
+ "\n"
+ MessageUtils.formatSmsType(type)
+ MessageUtils.formatAddress(address);
String contactName = MessageUtils.getContactNameFromNumber(
this, address);
if (!contactName.equals("Unknown")) {
info += "\n" + contactName;
}
mInfoTextView.setText(info);
// Debug
// if (id.equals(new Integer(76).toString())) {
// SMSActivity.test(3, this.getClass(), this, cursor, id, mUri);
// SMSActivity.test(4, this.getClass(), this, null, id, mUri);
// }
}
// We are through with the cursor
cursor.close();
} catch (Exception ex) {
String msg = "Error finding SMS message:\n" + ex.getMessage();
Utils.excMsg(this, "Error finding SMS message", ex);
if (mBodyTextView != null) {
mBodyTextView.setTextColor(0xffff0000);
mBodyTextView.setText(msg);
}
if (mTitleTextView != null) {
mTitleTextView.setText("<Error>");
}
if (mSubtitleTextView != null) {
mSubtitleTextView.setText("");
}
}
}
|
void function() { try { String selection = COL_ID + "=" + mRowId; Cursor cursor = getContentResolver().query(mUri, null, selection, null, null); String[] columns = cursor.getColumnNames(); cursor.close(); String sort = COL_DATE + STR; cursor = getContentResolver().query(mUri, columns, selection, null, sort); int indexId = cursor.getColumnIndex(COL_ID); int indexDate = cursor.getColumnIndex(COL_DATE); int indexAddress = cursor.getColumnIndex(COL_ADDRESS); int indexType = cursor.getColumnIndex(COL_TYPE); int indexBody = cursor.getColumnIndex(COL_BODY); Log.d(TAG, this.getClass().getSimpleName() + STR + STR + mRowId + STR + mUri.toString()); boolean found = cursor.moveToFirst(); if (!found) { mTitleTextView.setText(STR); mSubtitleTextView.setText(STRFailed to find message STR<Address NA>STR<Body NA>STR [1/STR]STR: STR\nSTRSTR.refreshSTR id=STR address=STR dateNum=STR\nSTRUnknownSTR\nSTRError finding SMS message:\nSTRError finding SMS message", ex); if (mBodyTextView != null) { mBodyTextView.setTextColor(0xffff0000); mBodyTextView.setText(msg); } if (mTitleTextView != null) { mTitleTextView.setText(STR); } if (mSubtitleTextView != null) { mSubtitleTextView.setText(""); } } }
|
/**
* Gets a new cursor and redraws the view. Closes the cursor after it is
* done with it.
*/
|
Gets a new cursor and redraws the view. Closes the cursor after it is done with it
|
refresh
|
{
"repo_name": "KennethEvans/Misc",
"path": "app/src/main/java/net/kenevans/android/misc/DisplaySMSActivity.java",
"license": "mit",
"size": 25983
}
|
[
"android.database.Cursor",
"android.util.Log"
] |
import android.database.Cursor; import android.util.Log;
|
import android.database.*; import android.util.*;
|
[
"android.database",
"android.util"
] |
android.database; android.util;
| 2,279,743
|
public FeatureCursor queryFeatures(String[] columns,
BoundingBox boundingBox, Projection projection) {
return queryFeatures(false, columns, boundingBox, projection);
}
|
FeatureCursor function(String[] columns, BoundingBox boundingBox, Projection projection) { return queryFeatures(false, columns, boundingBox, projection); }
|
/**
* Query for Features within the bounding box in the provided projection
*
* @param columns columns
* @param boundingBox bounding box
* @param projection projection of the provided bounding box
* @return feature cursor
* @since 3.5.0
*/
|
Query for Features within the bounding box in the provided projection
|
queryFeatures
|
{
"repo_name": "ngageoint/geopackage-android",
"path": "geopackage-sdk/src/main/java/mil/nga/geopackage/extension/nga/index/FeatureTableIndex.java",
"license": "mit",
"size": 276322
}
|
[
"mil.nga.geopackage.BoundingBox",
"mil.nga.geopackage.features.user.FeatureCursor",
"mil.nga.proj.Projection"
] |
import mil.nga.geopackage.BoundingBox; import mil.nga.geopackage.features.user.FeatureCursor; import mil.nga.proj.Projection;
|
import mil.nga.geopackage.*; import mil.nga.geopackage.features.user.*; import mil.nga.proj.*;
|
[
"mil.nga.geopackage",
"mil.nga.proj"
] |
mil.nga.geopackage; mil.nga.proj;
| 347,062
|
private boolean closetask(int num, CloseMode mode, Logging l) {
boolean closed = false;
_log.debug(getPrefix() + "closetask(): looking for task " + num);
for (I2PTunnelTask t : tasks) {
int id = t.getId();
if (_log.shouldLog(Log.DEBUG))
_log.debug(getPrefix() + "closetask(): parsing task " + id + " (" + t.toString() + ")");
if (id == num) {
closed = closetask(t, mode, l);
break;
} else if (id > num) {
break;
}
}
return closed;
}
|
boolean function(int num, CloseMode mode, Logging l) { boolean closed = false; _log.debug(getPrefix() + STR + num); for (I2PTunnelTask t : tasks) { int id = t.getId(); if (_log.shouldLog(Log.DEBUG)) _log.debug(getPrefix() + STR + id + STR + t.toString() + ")"); if (id == num) { closed = closetask(t, mode, l); break; } else if (id > num) { break; } } return closed; }
|
/**
* Helper method to actually close the given task number (optionally forcing
* closure)
*
*/
|
Helper method to actually close the given task number (optionally forcing closure)
|
closetask
|
{
"repo_name": "NoYouShutup/CryptMeme",
"path": "CryptMeme/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnel.java",
"license": "mit",
"size": 82421
}
|
[
"net.i2p.util.Log"
] |
import net.i2p.util.Log;
|
import net.i2p.util.*;
|
[
"net.i2p.util"
] |
net.i2p.util;
| 935,129
|
@DisplayName("test digestFileAs32ByteHex(File file, Charset charset, boolean doesNeedConvertLineEndings, ClientLineEnding clientLineEnding) throw exception")
@Test
public void testDigestFileAs32ByteHexForFileCharsetConvertLineEndingsClientLineEndingNonCharset_throwException() {
File dirAsFile = new File(System.getProperty("java.io.tmpdir"));
String actual = md5Digester.digestFileAs32ByteHex(dirAsFile, Charset.forName("UTF-8"), true,
null);
assertNull(actual);
}
|
@DisplayName(STR) void function() { File dirAsFile = new File(System.getProperty(STR)); String actual = md5Digester.digestFileAs32ByteHex(dirAsFile, Charset.forName("UTF-8"), true, null); assertNull(actual); }
|
/**
* Method: digestFileAs32ByteHex(File file, Charset charset, boolean
* doesNeedConvertLineEndings, ClientLineEnding clientLineEnding)
*/
|
Method: digestFileAs32ByteHex(File file, Charset charset, boolean doesNeedConvertLineEndings, ClientLineEnding clientLineEnding)
|
testDigestFileAs32ByteHexForFileCharsetConvertLineEndingsClientLineEndingNonCharset_throwException
|
{
"repo_name": "groboclown/p4ic4idea",
"path": "p4java/src/test/java/com/perforce/p4java/impl/mapbased/rpc/func/helper/MD5DigesterTest.java",
"license": "apache-2.0",
"size": 28543
}
|
[
"java.io.File",
"java.nio.charset.Charset",
"org.junit.jupiter.api.Assertions",
"org.junit.jupiter.api.DisplayName"
] |
import java.io.File; import java.nio.charset.Charset; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName;
|
import java.io.*; import java.nio.charset.*; import org.junit.jupiter.api.*;
|
[
"java.io",
"java.nio",
"org.junit.jupiter"
] |
java.io; java.nio; org.junit.jupiter;
| 1,495,926
|
public static void writeRequest(PayloadOutputChannel ch, Collection<Integer> cacheIds) {
BinaryOutputStream out = ch.out();
out.writeInt(cacheIds.size());
for (int cacheId : cacheIds)
out.writeInt(cacheId);
}
|
static void function(PayloadOutputChannel ch, Collection<Integer> cacheIds) { BinaryOutputStream out = ch.out(); out.writeInt(cacheIds.size()); for (int cacheId : cacheIds) out.writeInt(cacheId); }
|
/**
* Writes caches affinity request to the output channel.
*
* @param ch Output channel.
* @param cacheIds Cache IDs.
*/
|
Writes caches affinity request to the output channel
|
writeRequest
|
{
"repo_name": "NSAmelchev/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheAffinityMapping.java",
"license": "apache-2.0",
"size": 10210
}
|
[
"java.util.Collection",
"org.apache.ignite.internal.binary.streams.BinaryOutputStream"
] |
import java.util.Collection; import org.apache.ignite.internal.binary.streams.BinaryOutputStream;
|
import java.util.*; import org.apache.ignite.internal.binary.streams.*;
|
[
"java.util",
"org.apache.ignite"
] |
java.util; org.apache.ignite;
| 846,665
|
void addHasTheme(WrappedIndividual newHasTheme);
|
void addHasTheme(WrappedIndividual newHasTheme);
|
/**
* Adds a hasTheme property value.<p>
*
* @param newHasTheme the hasTheme property value to be added
*/
|
Adds a hasTheme property value
|
addHasTheme
|
{
"repo_name": "cybershare/elseweb-v2",
"path": "harvester/src/main/java/edu/utep/cybershare/elseweb/ontology/WFSDataset.java",
"license": "gpl-2.0",
"size": 6742
}
|
[
"org.protege.owl.codegeneration.WrappedIndividual"
] |
import org.protege.owl.codegeneration.WrappedIndividual;
|
import org.protege.owl.codegeneration.*;
|
[
"org.protege.owl"
] |
org.protege.owl;
| 1,211,471
|
@Override
public InjectionBinding<WebServiceRef> createOverrideInjectionBinding(Class<?> instanceClass, Member member,
Resource resource, String jndiName) throws InjectionException {
Class<?> typeClass = resource.type();
if (member != null) {
Class<?> inferredType = InjectionHelper.getTypeFromMember(member);
if (typeClass.getName().equals(Object.class.getName())) { //default
typeClass = inferredType;
// } else {
// if (!inferredType.isAssignableFrom(typeClass)) {
// Tr.error(tc, "error.service.ref.member.level.annotation.type.not.compatible",
// member.getName(), member.getDeclaringClass().getName(), typeClass.getName(), inferredType.getName());
// throw new InjectionException(Tr.formatMessage(tc, "error.service.ref.member.level.annotation.type.not.compatible",
// member.getName(), member.getDeclaringClass().getName(), typeClass.getName(), inferredType.getName()));
// }
}
}
InjectionBinding<WebServiceRef> binding;
//only service type injections are possible with the @Resource annotation
if (Service.class.isAssignableFrom(typeClass)) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "The @Resource annotation found has type=" + typeClass.getName() + " and is refers to a JAX-WS service reference");
}
binding = WebServiceRefBindingBuilder.createWebServiceRefBindingFromResource(resource, ivNameSpaceConfig, typeClass, jndiName);
} else {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "The @Resource annotation found did not refer to a web service reference type.");
}
binding = null;
}
return binding;
}
|
InjectionBinding<WebServiceRef> function(Class<?> instanceClass, Member member, Resource resource, String jndiName) throws InjectionException { Class<?> typeClass = resource.type(); if (member != null) { Class<?> inferredType = InjectionHelper.getTypeFromMember(member); if (typeClass.getName().equals(Object.class.getName())) { typeClass = inferredType; } } InjectionBinding<WebServiceRef> binding; if (Service.class.isAssignableFrom(typeClass)) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, STR + typeClass.getName() + STR); } binding = WebServiceRefBindingBuilder.createWebServiceRefBindingFromResource(resource, ivNameSpaceConfig, typeClass, jndiName); } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, STR); } binding = null; } return binding; }
|
/**
* This method will allow us to create an InjectionBinding instance for @Resource annotations found on a method or field
* that are being used to indicate web service reference types.
*/
|
This method will allow us to create an InjectionBinding instance for @Resource annotations found on a method or field that are being used to indicate web service reference types
|
createOverrideInjectionBinding
|
{
"repo_name": "kgibm/open-liberty",
"path": "dev/com.ibm.ws.jaxws.common/src/com/ibm/ws/jaxws/client/injection/WebServiceRefProcessor.java",
"license": "epl-1.0",
"size": 37288
}
|
[
"com.ibm.websphere.ras.Tr",
"com.ibm.websphere.ras.TraceComponent",
"com.ibm.wsspi.injectionengine.InjectionBinding",
"com.ibm.wsspi.injectionengine.InjectionException",
"java.lang.reflect.Member",
"javax.annotation.Resource",
"javax.xml.ws.Service",
"javax.xml.ws.WebServiceRef"
] |
import com.ibm.websphere.ras.Tr; import com.ibm.websphere.ras.TraceComponent; import com.ibm.wsspi.injectionengine.InjectionBinding; import com.ibm.wsspi.injectionengine.InjectionException; import java.lang.reflect.Member; import javax.annotation.Resource; import javax.xml.ws.Service; import javax.xml.ws.WebServiceRef;
|
import com.ibm.websphere.ras.*; import com.ibm.wsspi.injectionengine.*; import java.lang.reflect.*; import javax.annotation.*; import javax.xml.ws.*;
|
[
"com.ibm.websphere",
"com.ibm.wsspi",
"java.lang",
"javax.annotation",
"javax.xml"
] |
com.ibm.websphere; com.ibm.wsspi; java.lang; javax.annotation; javax.xml;
| 2,321,407
|
void setStartDateTime(Date value);
|
void setStartDateTime(Date value);
|
/**
* Sets the value of the '{@link gluemodel.CIM.IEC61968.PaymentMetering.TimeTariffInterval#getStartDateTime <em>Start Date Time</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Start Date Time</em>' attribute.
* @see #getStartDateTime()
* @generated
*/
|
Sets the value of the '<code>gluemodel.CIM.IEC61968.PaymentMetering.TimeTariffInterval#getStartDateTime Start Date Time</code>' attribute.
|
setStartDateTime
|
{
"repo_name": "georghinkel/ttc2017smartGrids",
"path": "solutions/eMoflon/rgse.ttc17.metamodels.src/src/gluemodel/CIM/IEC61968/PaymentMetering/TimeTariffInterval.java",
"license": "mit",
"size": 7862
}
|
[
"java.util.Date"
] |
import java.util.Date;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,952,808
|
public byte[] getPostRecord()
{
short cce = 0;
// first count # refs (excluding ptgUnion, range, etc )
for( Object aSubexpression : subexpression )
{
Ptg p = (Ptg) aSubexpression;
if( p instanceof PtgRef )
{
cce++;
}
}
// input cce + cce*Ref8U (8 bytes) describing reference
byte[] b = ByteTools.shortToLEBytes( cce );
byte[] recbytes = new byte[(cce * 8) + 2];
recbytes[0] = b[0];
recbytes[1] = b[1];
int pos = 2;
for( int i = 0; (i < subexpression.size()) && ((pos + 7) < recbytes.length); i++ )
{
Ptg p = (Ptg) subexpression.get( i );
if( p instanceof PtgRef )
{
int[] rc = ((PtgRef) p).getRowCol();
System.arraycopy( ByteTools.shortToLEBytes( (short) rc[0] ), 0, recbytes, pos, 2 ); // rw first
System.arraycopy( ByteTools.shortToLEBytes( (short) rc[1] ), 0, recbytes, pos + 4, 2 ); // col first
if( rc.length == 2 )
{ // a single ref; repeat
System.arraycopy( ByteTools.shortToLEBytes( (short) rc[0] ), 0, recbytes, pos + 2, 2 ); // rw last
System.arraycopy( ByteTools.shortToLEBytes( (short) rc[1] ), 0, recbytes, pos + 6, 2 ); // col last
}
else
{ // a range
System.arraycopy( ByteTools.shortToLEBytes( (short) rc[2] ), 0, recbytes, pos + 2, 2 ); // rw last
System.arraycopy( ByteTools.shortToLEBytes( (short) rc[3] ), 0, recbytes, pos + 6, 2 ); // col last
}
pos += 8;
}
}
return recbytes;
}
ArrayList refsheets = new ArrayList();
|
byte[] function() { short cce = 0; for( Object aSubexpression : subexpression ) { Ptg p = (Ptg) aSubexpression; if( p instanceof PtgRef ) { cce++; } } byte[] b = ByteTools.shortToLEBytes( cce ); byte[] recbytes = new byte[(cce * 8) + 2]; recbytes[0] = b[0]; recbytes[1] = b[1]; int pos = 2; for( int i = 0; (i < subexpression.size()) && ((pos + 7) < recbytes.length); i++ ) { Ptg p = (Ptg) subexpression.get( i ); if( p instanceof PtgRef ) { int[] rc = ((PtgRef) p).getRowCol(); System.arraycopy( ByteTools.shortToLEBytes( (short) rc[0] ), 0, recbytes, pos, 2 ); System.arraycopy( ByteTools.shortToLEBytes( (short) rc[1] ), 0, recbytes, pos + 4, 2 ); if( rc.length == 2 ) { System.arraycopy( ByteTools.shortToLEBytes( (short) rc[0] ), 0, recbytes, pos + 2, 2 ); System.arraycopy( ByteTools.shortToLEBytes( (short) rc[1] ), 0, recbytes, pos + 6, 2 ); } else { System.arraycopy( ByteTools.shortToLEBytes( (short) rc[2] ), 0, recbytes, pos + 2, 2 ); System.arraycopy( ByteTools.shortToLEBytes( (short) rc[3] ), 0, recbytes, pos + 6, 2 ); } pos += 8; } } return recbytes; } ArrayList refsheets = new ArrayList();
|
/**
* retrieves the PtgExtraMem structure that is located at the end of the function record
*
* @return
*/
|
retrieves the PtgExtraMem structure that is located at the end of the function record
|
getPostRecord
|
{
"repo_name": "Maxels88/openxls",
"path": "src/main/java/org/openxls/formats/XLS/formulas/PtgMemArea.java",
"license": "gpl-3.0",
"size": 11322
}
|
[
"java.util.ArrayList",
"org.openxls.toolkit.ByteTools"
] |
import java.util.ArrayList; import org.openxls.toolkit.ByteTools;
|
import java.util.*; import org.openxls.toolkit.*;
|
[
"java.util",
"org.openxls.toolkit"
] |
java.util; org.openxls.toolkit;
| 750,856
|
@CheckResult
public Limit<T, S, N> limit(int nrOfRows) {
return new Limit<>(this, Integer.toString(nrOfRows));
}
}
public static final class CompoundSelect<T, S, N> extends SelectNode<T, S, N> {
@NonNull
private final String op;
@NonNull
private final SelectNode<?, S, ?> select;
CompoundSelect(@NonNull SelectNode<T, S, N> parent, @NonNull String op, @NonNull SelectNode<?, S, ?> select) {
super(parent);
this.op = op;
this.select = select;
selectBuilder.args.addAll(select.selectBuilder.args);
}
|
Limit<T, S, N> function(int nrOfRows) { return new Limit<>(this, Integer.toString(nrOfRows)); } } public static final class CompoundSelect<T, S, N> extends SelectNode<T, S, N> { private final String op; private final SelectNode<?, S, ?> select; CompoundSelect(@NonNull SelectNode<T, S, N> parent, @NonNull String op, @NonNull SelectNode<?, S, ?> select) { super(parent); this.op = op; this.select = select; selectBuilder.args.addAll(select.selectBuilder.args); }
|
/**
* Add a LIMIT clause to the query.
*
* @param nrOfRows Upper bound on the number of rows returned by the
* entire SELECT statement
* @return SQL SELECT statement builder
*/
|
Add a LIMIT clause to the query
|
limit
|
{
"repo_name": "SiimKinks/sqlitemagic",
"path": "runtime/src/main/java/com/siimkinks/sqlitemagic/Select.java",
"license": "apache-2.0",
"size": 61233
}
|
[
"androidx.annotation.NonNull"
] |
import androidx.annotation.NonNull;
|
import androidx.annotation.*;
|
[
"androidx.annotation"
] |
androidx.annotation;
| 756,118
|
protected void fromCheckpointJson(JSONObject json) throws JSONException {
uriCount.set(json.getLong("uriCount"));
}
public void finishCheckpoint(Checkpoint checkpointInProgress) {}
|
void function(JSONObject json) throws JSONException { uriCount.set(json.getLong(STR)); } public void finishCheckpoint(Checkpoint checkpointInProgress) {}
|
/**
* Restore internal state from JSONObject stored at earlier
* checkpoint-time.
*
* @param json JSONObject
* @throws JSONException
*/
|
Restore internal state from JSONObject stored at earlier checkpoint-time
|
fromCheckpointJson
|
{
"repo_name": "searchtechnologies/heritrix-connector",
"path": "engine-3.1.1/modules/src/main/java/org/archive/modules/Processor.java",
"license": "apache-2.0",
"size": 10192
}
|
[
"org.archive.checkpointing.Checkpoint",
"org.json.JSONException",
"org.json.JSONObject"
] |
import org.archive.checkpointing.Checkpoint; import org.json.JSONException; import org.json.JSONObject;
|
import org.archive.checkpointing.*; import org.json.*;
|
[
"org.archive.checkpointing",
"org.json"
] |
org.archive.checkpointing; org.json;
| 1,158,320
|
public static Date addDays(Date date, int numDays) {
Calendar c = Calendar.getInstance();
c.setTime(date);
c.add(Calendar.DATE, numDays);
return c.getTime();
}
|
static Date function(Date date, int numDays) { Calendar c = Calendar.getInstance(); c.setTime(date); c.add(Calendar.DATE, numDays); return c.getTime(); }
|
/**
* Add given number of days to one date.
*
* @param date date to modify.
* @param numDays number of days to add.
* @return modified date.
*/
|
Add given number of days to one date
|
addDays
|
{
"repo_name": "davidmigloz/go-bees",
"path": "app/src/main/java/com/davidmiguel/gobees/utils/DateTimeUtils.java",
"license": "gpl-3.0",
"size": 3496
}
|
[
"java.util.Calendar",
"java.util.Date"
] |
import java.util.Calendar; import java.util.Date;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,021,850
|
public String extractSender(Object certificate) throws CertificateException;
|
String function(Object certificate) throws CertificateException;
|
/**
* Extracts the sender id from a certificate.
*
* @param certificate the certificate from which the sender id should be extracted.
*
* @return the extracted sender id.
*
* @throws CertificateException
*/
|
Extracts the sender id from a certificate
|
extractSender
|
{
"repo_name": "skltp-incubator/axel",
"path": "shs/shs-broker/shs-certificate/src/main/java/se/inera/axel/shs/broker/validation/certificate/CertificateExtractor.java",
"license": "lgpl-3.0",
"size": 1324
}
|
[
"java.security.cert.CertificateException"
] |
import java.security.cert.CertificateException;
|
import java.security.cert.*;
|
[
"java.security"
] |
java.security;
| 2,386,081
|
private static Token getNewToken(User user, TypeToken type, String email) {
Token token = new Token();
token.token = UUID.randomUUID().toString();
token.userId = user.id;
token.type = type;
token.email = email;
token.save();
return token;
}
|
static Token function(User user, TypeToken type, String email) { Token token = new Token(); token.token = UUID.randomUUID().toString(); token.userId = user.id; token.type = type; token.email = email; token.save(); return token; }
|
/**
* Return a new Token.
*
* @param user user
* @param type type of token
* @param email email for a token change email
* @return a reset token
*/
|
Return a new Token
|
getNewToken
|
{
"repo_name": "bmjares/self_service",
"path": "app/models/Token.java",
"license": "bsd-3-clause",
"size": 4886
}
|
[
"java.util.UUID"
] |
import java.util.UUID;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,498,468
|
public void startMessageDelivery() {
InboundKernelOpsEvent kernelOpsEvent = new InboundKernelOpsEvent();
kernelOpsEvent.prepareForStartMessageDelivery(messagingEngine);
inboundEventManager.publishStateEvent(kernelOpsEvent);
}
|
void function() { InboundKernelOpsEvent kernelOpsEvent = new InboundKernelOpsEvent(); kernelOpsEvent.prepareForStartMessageDelivery(messagingEngine); inboundEventManager.publishStateEvent(kernelOpsEvent); }
|
/**
* Notify client connection is closed from protocol level
* State related to connection will be updated within Andes
*/
|
Notify client connection is closed from protocol level State related to connection will be updated within Andes
|
startMessageDelivery
|
{
"repo_name": "ThilankaBowala/andes",
"path": "modules/andes-core/broker/src/main/java/org/wso2/andes/kernel/Andes.java",
"license": "apache-2.0",
"size": 27956
}
|
[
"org.wso2.andes.kernel.disruptor.inbound.InboundKernelOpsEvent"
] |
import org.wso2.andes.kernel.disruptor.inbound.InboundKernelOpsEvent;
|
import org.wso2.andes.kernel.disruptor.inbound.*;
|
[
"org.wso2.andes"
] |
org.wso2.andes;
| 1,919,850
|
public PrivateKey engineLookupAndResolvePrivateKey(
Element element, String baseURI, StorageResolver storage
) throws KeyResolverException {
// This method was added later, it has no equivalent
// engineResolvePrivateKey() in the old API.
// We cannot throw UnsupportedOperationException because
// KeyResolverSpi implementations who don't know about
// this method would stop the search too early.
return null;
}
|
PrivateKey function( Element element, String baseURI, StorageResolver storage ) throws KeyResolverException { return null; }
|
/**
* Method engineLookupAndResolvePrivateKey
*
* @param element
* @param baseURI
* @param storage
* @return resolved PrivateKey key from the registered from the elements
*
* @throws KeyResolverException
*/
|
Method engineLookupAndResolvePrivateKey
|
engineLookupAndResolvePrivateKey
|
{
"repo_name": "itgeeker/jdk",
"path": "src/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolverSpi.java",
"license": "apache-2.0",
"size": 7998
}
|
[
"com.sun.org.apache.xml.internal.security.keys.storage.StorageResolver",
"java.security.PrivateKey",
"org.w3c.dom.Element"
] |
import com.sun.org.apache.xml.internal.security.keys.storage.StorageResolver; import java.security.PrivateKey; import org.w3c.dom.Element;
|
import com.sun.org.apache.xml.internal.security.keys.storage.*; import java.security.*; import org.w3c.dom.*;
|
[
"com.sun.org",
"java.security",
"org.w3c.dom"
] |
com.sun.org; java.security; org.w3c.dom;
| 1,216,735
|
@NotNull()
public String getID()
{
return id;
}
|
@NotNull() String function() { return id; }
|
/**
* Retrieves the unique ID for this destination details object.
*
* @return The unique ID for this destination details object.
*/
|
Retrieves the unique ID for this destination details object
|
getID
|
{
"repo_name": "UnboundID/ldapsdk",
"path": "src/com/unboundid/ldap/sdk/unboundidds/extensions/NotificationDestinationDetails.java",
"license": "gpl-2.0",
"size": 6587
}
|
[
"com.unboundid.util.NotNull"
] |
import com.unboundid.util.NotNull;
|
import com.unboundid.util.*;
|
[
"com.unboundid.util"
] |
com.unboundid.util;
| 2,117,768
|
public static boolean isStreamCfgProperty(String pName, Class<?> pCls) {
Field[] dProps = pCls.getFields();
for (Field dProp : dProps) {
dProp.setAccessible(true);
if (dProp.getName().startsWith("PROP_")) { // NON-NLS
try {
String propName = (String) dProp.get(pCls);
if (propName.equalsIgnoreCase(pName)) {
return true;
}
} catch (Exception exc) {
}
}
}
return false;
}
|
static boolean function(String pName, Class<?> pCls) { Field[] dProps = pCls.getFields(); for (Field dProp : dProps) { dProp.setAccessible(true); if (dProp.getName().startsWith("PROP_")) { try { String propName = (String) dProp.get(pCls); if (propName.equalsIgnoreCase(pName)) { return true; } } catch (Exception exc) { } } } return false; }
|
/**
* Checks if property name is defined streams property name.
*
* @param pName
* property name to check
* @param pCls
* class containing streams property names definition
* @return {@code true} if property name is defined streams property name, {@code false} - otherwise
*/
|
Checks if property name is defined streams property name
|
isStreamCfgProperty
|
{
"repo_name": "Nastel/tnt4j-streams",
"path": "tnt4j-streams-core/src/main/java/com/jkoolcloud/tnt4j/streams/utils/StreamsConstants.java",
"license": "apache-2.0",
"size": 5732
}
|
[
"java.lang.reflect.Field"
] |
import java.lang.reflect.Field;
|
import java.lang.reflect.*;
|
[
"java.lang"
] |
java.lang;
| 552,192
|
private String getFormData()
{
Element form = getFormElement();
StringBuilder b = new StringBuilder();
if (form != null)
{
ElementIterator i = new ElementIterator(form);
Element next;
while ((next = i.next()) != null)
{
if (next.isLeaf())
{
AttributeSet atts = next.getAttributes();
String type = (String) atts.getAttribute(HTML.Attribute.TYPE);
if (type != null && type.equals("submit")
&& next != getElement())
{
// Skip this. This is not the actual submit trigger.
}
else if (type == null || ! type.equals("image"))
{
getElementFormData(next, b);
}
}
}
}
return b.toString();
}
|
String function() { Element form = getFormElement(); StringBuilder b = new StringBuilder(); if (form != null) { ElementIterator i = new ElementIterator(form); Element next; while ((next = i.next()) != null) { if (next.isLeaf()) { AttributeSet atts = next.getAttributes(); String type = (String) atts.getAttribute(HTML.Attribute.TYPE); if (type != null && type.equals(STR) && next != getElement()) { } else if (type == null ! type.equals("image")) { getElementFormData(next, b); } } } } return b.toString(); }
|
/**
* Determines the form data that is about to be submitted.
*
* @return the form data
*/
|
Determines the form data that is about to be submitted
|
getFormData
|
{
"repo_name": "ivmai/JCGO",
"path": "goclsp/clsp_fix/javax/swing/text/html/FormView.java",
"license": "gpl-2.0",
"size": 26932
}
|
[
"javax.swing.text.AttributeSet",
"javax.swing.text.Element",
"javax.swing.text.ElementIterator"
] |
import javax.swing.text.AttributeSet; import javax.swing.text.Element; import javax.swing.text.ElementIterator;
|
import javax.swing.text.*;
|
[
"javax.swing"
] |
javax.swing;
| 2,320,579
|
private void firstScan(String input) throws NumberFormatException, IOException {
// Prepareobject to read the file
BufferedReader reader = new BufferedReader(new FileReader(input));
String line;
maxItemId = 0;
tidsCount =0; // variable to count the number of transaction.
// for each line (transaction) until the end of file
while( ((line = reader.readLine())!= null)){
// if the line is a comment, is empty or is a
// kind of metadata
if (line.isEmpty() == true ||
line.charAt(0) == '#' || line.charAt(0) == '%'
|| line.charAt(0) == '@') {
continue;
}
// split the transaction into items
String[] lineSplited = line.split(" ");
// for each item
for(String itemString : lineSplited){
// convert the item from string to integer
Integer item = Integer.parseInt(itemString);
// update the maximum item in the database
if(item > maxItemId){
maxItemId = item;
}
}
tidsCount++; // increase the transaction count
}
// close the file
reader.close();
}
|
void function(String input) throws NumberFormatException, IOException { BufferedReader reader = new BufferedReader(new FileReader(input)); String line; maxItemId = 0; tidsCount =0; while( ((line = reader.readLine())!= null)){ if (line.isEmpty() == true line.charAt(0) == '#' line.charAt(0) == '%' line.charAt(0) == '@') { continue; } String[] lineSplited = line.split(" "); for(String itemString : lineSplited){ Integer item = Integer.parseInt(itemString); if(item > maxItemId){ maxItemId = item; } } tidsCount++; } reader.close(); }
|
/**
* Scan database to know the database size and number of items to
* initialize the bit matrix.
* @param input the input file
* @throws IOException exception if error while reading the file
*/
|
Scan database to know the database size and number of items to initialize the bit matrix
|
firstScan
|
{
"repo_name": "dragonzhou/humor",
"path": "src/ca/pfv/spmf/algorithms/frequentpatterns/dci_closed_optimized/AlgoDCI_Closed_Optimized.java",
"license": "apache-2.0",
"size": 15426
}
|
[
"java.io.BufferedReader",
"java.io.FileReader",
"java.io.IOException"
] |
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 314,486
|
@Override
public String getText(Object object) {
ToString toString = (ToString)object;
return getString("_UI_ToString_type") + " " + toString.isSerialized();
}
|
String function(Object object) { ToString toString = (ToString)object; return getString(STR) + " " + toString.isSerialized(); }
|
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
|
This returns the label text for the adapted class.
|
getText
|
{
"repo_name": "prabushi/devstudio-tooling-esb",
"path": "plugins/org.wso2.developerstudio.visualdatamapper.edit/src/org/wso2/developerstudio/datamapper/provider/ToStringItemProvider.java",
"license": "apache-2.0",
"size": 2536
}
|
[
"org.wso2.developerstudio.datamapper.ToString"
] |
import org.wso2.developerstudio.datamapper.ToString;
|
import org.wso2.developerstudio.datamapper.*;
|
[
"org.wso2.developerstudio"
] |
org.wso2.developerstudio;
| 1,856,843
|
@Test
public void test_hashCode2() {
TennisPlayer c1 = new TennisPlayer(5,"David Ferrer");
TennisPlayer c3 = new TennisPlayer(99,"David Ferrer");
assertTrue(c1.hashCode()!=c3.hashCode());
}
|
void function() { TennisPlayer c1 = new TennisPlayer(5,STR); TennisPlayer c3 = new TennisPlayer(99,STR); assertTrue(c1.hashCode()!=c3.hashCode()); }
|
/** Test case 2 for .hashCode
@see TennisPlayer#hashCode
*/
|
Test case 2 for .hashCode
|
test_hashCode2
|
{
"repo_name": "UCSB-CS56-W14/W14-lab05",
"path": "src/edu/ucsb/cs56/w14/lab05/sumersinha/TennisPlayerTest.java",
"license": "mit",
"size": 2344
}
|
[
"org.junit.Assert"
] |
import org.junit.Assert;
|
import org.junit.*;
|
[
"org.junit"
] |
org.junit;
| 2,411,364
|
public boolean addExtruderRecipe(ItemStack aInput1, ItemStack aShape, ItemStack aOutput1, int aDuration, int aEUt);
|
boolean function(ItemStack aInput1, ItemStack aShape, ItemStack aOutput1, int aDuration, int aEUt);
|
/**
* Adds a Extruder Machine Recipe
* @param aInput1 must be != null
* @param aShape must be != null, Set the stackSize to 0 if you don't want to let it consume this Item.
* @param aOutput1 must be != null
* @param aDuration must be > 0
* @param aEUt should be > 0
*/
|
Adds a Extruder Machine Recipe
|
addExtruderRecipe
|
{
"repo_name": "Albloutant/Galacticraft",
"path": "dependencies/gregtechmod/api/interfaces/IGT_RecipeAdder.java",
"license": "lgpl-3.0",
"size": 9029
}
|
[
"net.minecraft.item.ItemStack"
] |
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.*;
|
[
"net.minecraft.item"
] |
net.minecraft.item;
| 1,345,445
|
public void failed(final NotificationType failed, final MAP map, final ArjunaContext arjunaContext) ;
|
void function(final NotificationType failed, final MAP map, final ArjunaContext arjunaContext) ;
|
/**
* Handle the failed event.
* @param failed The failed notification.
* @param map The addressing context.
* @param arjunaContext The arjuna context.
*/
|
Handle the failed event
|
failed
|
{
"repo_name": "nmcl/scratch",
"path": "graalvm/transactions/fork/narayana/XTS/WS-T/dev/src/com/arjuna/webservices11/wsba/CoordinatorCompletionParticipantInboundEvents.java",
"license": "apache-2.0",
"size": 4351
}
|
[
"com.arjuna.webservices11.wsarj.ArjunaContext",
"org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType"
] |
import com.arjuna.webservices11.wsarj.ArjunaContext; import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
|
import com.arjuna.webservices11.wsarj.*; import org.oasis_open.docs.ws_tx.wsba.*;
|
[
"com.arjuna.webservices11",
"org.oasis_open.docs"
] |
com.arjuna.webservices11; org.oasis_open.docs;
| 1,480,875
|
public void setLocalBreakoutValue(YangEnumeration localBreakoutValue)
throws JNCException {
setLeafValue(Epc.NAMESPACE,
"local-breakout",
localBreakoutValue,
childrenNames());
}
|
void function(YangEnumeration localBreakoutValue) throws JNCException { setLeafValue(Epc.NAMESPACE, STR, localBreakoutValue, childrenNames()); }
|
/**
* Sets the value for child leaf "local-breakout",
* using instance of generated typedef class.
* @param localBreakoutValue The value to set.
* @param localBreakoutValue used during instantiation.
*/
|
Sets the value for child leaf "local-breakout", using instance of generated typedef class
|
setLocalBreakoutValue
|
{
"repo_name": "jnpr-shinma/yangfile",
"path": "hitel/src/hctaEpc/mmeSgsn/subscriber/MmeSubscriberPlmn.java",
"license": "apache-2.0",
"size": 40584
}
|
[
"com.tailf.jnc.YangEnumeration"
] |
import com.tailf.jnc.YangEnumeration;
|
import com.tailf.jnc.*;
|
[
"com.tailf.jnc"
] |
com.tailf.jnc;
| 2,525,662
|
public AxisAlignedBB getBoundingBox()
{
return this.boundingBox;
}
|
AxisAlignedBB function() { return this.boundingBox; }
|
/**
* returns the bounding box for this entity
*/
|
returns the bounding box for this entity
|
getBoundingBox
|
{
"repo_name": "CheeseL0ver/Ore-TTM",
"path": "build/tmp/recompSrc/net/minecraft/entity/item/EntityBoat.java",
"license": "lgpl-2.1",
"size": 19948
}
|
[
"net.minecraft.util.AxisAlignedBB"
] |
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.*;
|
[
"net.minecraft.util"
] |
net.minecraft.util;
| 1,746,573
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.