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 void testTransientBlobCleanup(@Nullable final JobID jobId)
throws IOException, InterruptedException, ExecutionException {
// 1s should be a safe-enough buffer to still check for existence after a BLOB's last access
long cleanupInterval = 1L; // in seconds
final int numberConcurrentGetOperations = 3;
final List<CompletableFuture<Void>> getOperations =
new ArrayList<>(numberConcurrentGetOperations);
byte[] data = createRandomData();
byte[] data2 = createRandomData();
long cleanupLowerBound;
try (BlobServer server =
createTestInstance(temporaryFolder.getAbsolutePath(), cleanupInterval)) {
ConcurrentMap<Tuple2<JobID, TransientBlobKey>, Long> transientBlobExpiryTimes =
server.getBlobExpiryTimes();
server.start();
// after put(), files are cached for the given TTL
cleanupLowerBound = System.currentTimeMillis() + cleanupInterval;
final TransientBlobKey key1 =
(TransientBlobKey) put(server, jobId, data, TRANSIENT_BLOB);
final Long key1ExpiryAfterPut = transientBlobExpiryTimes.get(Tuple2.of(jobId, key1));
assertThat(key1ExpiryAfterPut).isGreaterThanOrEqualTo(cleanupLowerBound);
cleanupLowerBound = System.currentTimeMillis() + cleanupInterval;
final TransientBlobKey key2 =
(TransientBlobKey) put(server, jobId, data2, TRANSIENT_BLOB);
final Long key2ExpiryAfterPut = transientBlobExpiryTimes.get(Tuple2.of(jobId, key2));
assertThat(key2ExpiryAfterPut).isGreaterThanOrEqualTo(cleanupLowerBound);
// check that HA contents are not cleaned up
final JobID jobIdHA = (jobId == null) ? new JobID() : jobId;
final BlobKey keyHA = put(server, jobIdHA, data, PERMANENT_BLOB);
// access key1, verify expiry times (delay at least 1ms to also verify key2 expiry is
// unchanged)
Thread.sleep(1);
cleanupLowerBound = System.currentTimeMillis() + cleanupInterval;
verifyContents(server, jobId, key1, data);
final Long key1ExpiryAfterGet = transientBlobExpiryTimes.get(Tuple2.of(jobId, key1));
assertThat(key1ExpiryAfterGet).isGreaterThan(key1ExpiryAfterPut);
assertThat(key1ExpiryAfterGet).isGreaterThanOrEqualTo(cleanupLowerBound);
assertThat(key2ExpiryAfterPut)
.isEqualTo(transientBlobExpiryTimes.get(Tuple2.of(jobId, key2)));
// access key2, verify expiry times (delay at least 1ms to also verify key1 expiry is
// unchanged)
Thread.sleep(1);
cleanupLowerBound = System.currentTimeMillis() + cleanupInterval;
verifyContents(server, jobId, key2, data2);
assertThat(key1ExpiryAfterGet)
.isEqualTo(transientBlobExpiryTimes.get(Tuple2.of(jobId, key1)));
assertThat(transientBlobExpiryTimes.get(Tuple2.of(jobId, key2)))
.isGreaterThan(key2ExpiryAfterPut);
assertThat(transientBlobExpiryTimes.get(Tuple2.of(jobId, key2)))
.isGreaterThanOrEqualTo(cleanupLowerBound);
// cleanup task is run every cleanupInterval seconds
// => unaccessed file should remain at most 2*cleanupInterval seconds
// (use 3*cleanupInterval to check that we can still access it)
final long finishTime = System.currentTimeMillis() + 3 * cleanupInterval;
final ExecutorService executor =
Executors.newFixedThreadPool(numberConcurrentGetOperations);
for (int i = 0; i < numberConcurrentGetOperations; i++) {
CompletableFuture<Void> getOperation =
CompletableFuture.supplyAsync(
() -> {
try {
// constantly access key1 so this should not get deleted
while (System.currentTimeMillis() < finishTime) {
get(server, jobId, key1);
}
return null;
} catch (IOException e) {
throw new CompletionException(
new FlinkException("Could not retrieve blob.", e));
}
},
executor);
getOperations.add(getOperation);
}
FutureUtils.ConjunctFuture<Collection<Void>> filesFuture =
FutureUtils.combineAll(getOperations);
filesFuture.get();
verifyDeletedEventually(server, jobId, key1, key2);
// HA content should be unaffected
verifyContents(server, jobIdHA, keyHA, data);
}
}
|
void function(@Nullable final JobID jobId) throws IOException, InterruptedException, ExecutionException { long cleanupInterval = 1L; final int numberConcurrentGetOperations = 3; final List<CompletableFuture<Void>> getOperations = new ArrayList<>(numberConcurrentGetOperations); byte[] data = createRandomData(); byte[] data2 = createRandomData(); long cleanupLowerBound; try (BlobServer server = createTestInstance(temporaryFolder.getAbsolutePath(), cleanupInterval)) { ConcurrentMap<Tuple2<JobID, TransientBlobKey>, Long> transientBlobExpiryTimes = server.getBlobExpiryTimes(); server.start(); cleanupLowerBound = System.currentTimeMillis() + cleanupInterval; final TransientBlobKey key1 = (TransientBlobKey) put(server, jobId, data, TRANSIENT_BLOB); final Long key1ExpiryAfterPut = transientBlobExpiryTimes.get(Tuple2.of(jobId, key1)); assertThat(key1ExpiryAfterPut).isGreaterThanOrEqualTo(cleanupLowerBound); cleanupLowerBound = System.currentTimeMillis() + cleanupInterval; final TransientBlobKey key2 = (TransientBlobKey) put(server, jobId, data2, TRANSIENT_BLOB); final Long key2ExpiryAfterPut = transientBlobExpiryTimes.get(Tuple2.of(jobId, key2)); assertThat(key2ExpiryAfterPut).isGreaterThanOrEqualTo(cleanupLowerBound); final JobID jobIdHA = (jobId == null) ? new JobID() : jobId; final BlobKey keyHA = put(server, jobIdHA, data, PERMANENT_BLOB); Thread.sleep(1); cleanupLowerBound = System.currentTimeMillis() + cleanupInterval; verifyContents(server, jobId, key1, data); final Long key1ExpiryAfterGet = transientBlobExpiryTimes.get(Tuple2.of(jobId, key1)); assertThat(key1ExpiryAfterGet).isGreaterThan(key1ExpiryAfterPut); assertThat(key1ExpiryAfterGet).isGreaterThanOrEqualTo(cleanupLowerBound); assertThat(key2ExpiryAfterPut) .isEqualTo(transientBlobExpiryTimes.get(Tuple2.of(jobId, key2))); Thread.sleep(1); cleanupLowerBound = System.currentTimeMillis() + cleanupInterval; verifyContents(server, jobId, key2, data2); assertThat(key1ExpiryAfterGet) .isEqualTo(transientBlobExpiryTimes.get(Tuple2.of(jobId, key1))); assertThat(transientBlobExpiryTimes.get(Tuple2.of(jobId, key2))) .isGreaterThan(key2ExpiryAfterPut); assertThat(transientBlobExpiryTimes.get(Tuple2.of(jobId, key2))) .isGreaterThanOrEqualTo(cleanupLowerBound); final long finishTime = System.currentTimeMillis() + 3 * cleanupInterval; final ExecutorService executor = Executors.newFixedThreadPool(numberConcurrentGetOperations); for (int i = 0; i < numberConcurrentGetOperations; i++) { CompletableFuture<Void> getOperation = CompletableFuture.supplyAsync( () -> { try { while (System.currentTimeMillis() < finishTime) { get(server, jobId, key1); } return null; } catch (IOException e) { throw new CompletionException( new FlinkException(STR, e)); } }, executor); getOperations.add(getOperation); } FutureUtils.ConjunctFuture<Collection<Void>> filesFuture = FutureUtils.combineAll(getOperations); filesFuture.get(); verifyDeletedEventually(server, jobId, key1, key2); verifyContents(server, jobIdHA, keyHA, data); } }
|
/**
* Tests that {@link TransientBlobCache} cleans up after a default TTL and keeps files which are
* constantly accessed.
*/
|
Tests that <code>TransientBlobCache</code> cleans up after a default TTL and keeps files which are constantly accessed
|
testTransientBlobCleanup
|
{
"repo_name": "apache/flink",
"path": "flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerCleanupTest.java",
"license": "apache-2.0",
"size": 21479
}
|
[
"java.io.IOException",
"java.util.ArrayList",
"java.util.Collection",
"java.util.List",
"java.util.concurrent.CompletableFuture",
"java.util.concurrent.CompletionException",
"java.util.concurrent.ConcurrentMap",
"java.util.concurrent.ExecutionException",
"java.util.concurrent.ExecutorService",
"java.util.concurrent.Executors",
"javax.annotation.Nullable",
"org.apache.flink.api.common.JobID",
"org.apache.flink.api.java.tuple.Tuple2",
"org.apache.flink.runtime.blob.BlobCachePutTest",
"org.apache.flink.runtime.blob.BlobServerGetTest",
"org.apache.flink.runtime.blob.BlobServerPutTest",
"org.apache.flink.util.FlinkException",
"org.apache.flink.util.concurrent.FutureUtils",
"org.assertj.core.api.Assertions"
] |
import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import javax.annotation.Nullable; import org.apache.flink.api.common.JobID; import org.apache.flink.api.java.tuple.Tuple2; import org.apache.flink.runtime.blob.BlobCachePutTest; import org.apache.flink.runtime.blob.BlobServerGetTest; import org.apache.flink.runtime.blob.BlobServerPutTest; import org.apache.flink.util.FlinkException; import org.apache.flink.util.concurrent.FutureUtils; import org.assertj.core.api.Assertions;
|
import java.io.*; import java.util.*; import java.util.concurrent.*; import javax.annotation.*; import org.apache.flink.api.common.*; import org.apache.flink.api.java.tuple.*; import org.apache.flink.runtime.blob.*; import org.apache.flink.util.*; import org.apache.flink.util.concurrent.*; import org.assertj.core.api.*;
|
[
"java.io",
"java.util",
"javax.annotation",
"org.apache.flink",
"org.assertj.core"
] |
java.io; java.util; javax.annotation; org.apache.flink; org.assertj.core;
| 1,258,916 |
public void actionPerformed(ActionEvent e) {
String cmd = e.getActionCommand();
if (cmd.equals("eval")) {
// Clear the text area...
this.textarea.setText("");
// If user clicked "validate" button
if(checkNewForm())
this.validateFile();
}else if(cmd.equals("test")) {
// Clear the text area...
this.textarea.setText("");
if(!checkParams()) {
this.addToTextArea("ERROR: Please fix parameters on the settings screen!");
return;
}
// Run validation
if(!validateFile()) {
this.addToTextArea("\n\nERROR: cannot launch emulator until file validates!");
return;
}
// We have good params, so save them
this.writeProperties();
// Now run!
this.testBtn.setEnabled(false);
tryForm();
this.testBtn.setEnabled(true);
} else if(cmd.equals("summary")) {
// Clear the text area...
this.textarea.setText("");
// Run validation
if(!validateFile()) {
this.addToTextArea("\n\nERROR: cannot launch emulator until file validates!");
return;
}
summarize();
} else if(cmd.equals("deploy")) {
// Clear the text area...
this.textarea.setText("");
if(!checkDeployJar() || !checkNewForm()) {
this.addToTextArea("ERROR: Please fix parameters on the settings screen!");
return;
}
// Run validation
if(!validateFile()) {
this.addToTextArea("\n\nERROR: cannot deploy form to new jar unless it validates!");
return;
}
// We have good params, so save them
this.writeProperties();
// Now run!
deploy();
} else if(cmd.equals("jarfile")) {
// Create a file dialog box to prompt for a new file to display
FileDialog f = new FileDialog(this, "Choose Jar", FileDialog.LOAD);
String dir = this.jarTF.getText();
dir = dir.substring(0,dir.lastIndexOf("\\"));
System.out.println("default dir: " + dir);
f.setDirectory(dir);
// Display the dialog and wait for the user's response
f.setVisible(true);
if( f.getFile() == null)
return;
if( !f.getFile().equals(this.JAR_NAME) ) {
reportError("Error! Jar must be named: " + this.JAR_NAME);
return;
}
this.origJarDir = f.getDirectory();
this.jarTF.setText(f.getDirectory() + f.getFile());
f.dispose(); // Get rid of the dialog box
if(checkParams() )
updateStatus("All settings ok.");
} else if (cmd.equals("selectdeployjar")) {
// Create a file dialog box to prompt for a new file to display
FileDialog f = new FileDialog(this, "Choose Jar", FileDialog.LOAD);
String dir = this.deployJarTF.getText();
if(dir.lastIndexOf("\\") != -1) {
dir = dir.substring(0,dir.lastIndexOf("\\"));
}
System.out.println("default dir: " + dir);
f.setDirectory(dir);
// Display the dialog and wait for the user's response
f.setVisible(true);
if( f.getFile() == null)
return;
this.deployJarTF.setText(f.getDirectory() + f.getFile());
f.dispose(); // Get rid of the dialog box
if(checkParams() )
updateStatus("All settings ok.");
} else if(cmd.equals("form")){
// Create a file dialog box to prompt for a new file to display
FileDialog f = new FileDialog(this, "Open XForm", FileDialog.LOAD);
String dir = this.formTF.getText();
dir = dir.substring(0,dir.lastIndexOf("\\"));
System.out.println("default dir: " + dir);
f.setDirectory(dir);
// Display the dialog and wait for the user's response
f.setVisible(true);
if( f.getFile() == null)
return;
this.formName.setText(f.getFile());
this.newForm = f.getDirectory() + f.getFile();
this.formTF.setText(this.newForm);
f.dispose(); // Get rid of the dialog box
checkParams();
} else if(cmd.equals("viewerexe")) {
// Create a file dialog box to prompt for a new file to display
FileDialog f = new FileDialog(this, "Choose viewer EXE", FileDialog.LOAD);
|
void function(ActionEvent e) { String cmd = e.getActionCommand(); if (cmd.equals("eval")) { this.textarea.setText(STRtestSTRSTRERROR: Please fix parameters on the settings screen!STR\n\nERROR: cannot launch emulator until file validates!STRsummarySTRSTR\n\nERROR: cannot launch emulator until file validates!STRdeploySTRSTRERROR: Please fix parameters on the settings screen!STR\n\nERROR: cannot deploy form to new jar unless it validates!STRjarfileSTRChoose JarSTR\\STRdefault dir: STRError! Jar must be named: STRAll settings ok.STRselectdeployjarSTRChoose JarSTR\\STR\\STRdefault dir: STRAll settings ok.STRformSTROpen XFormSTR\\STRdefault dir: STRviewerexeSTRChoose viewer EXE", FileDialog.LOAD);
|
/**
* Handle button clicks
*/
|
Handle button clicks
|
actionPerformed
|
{
"repo_name": "wpride/javarosa",
"path": "util/validator/org.javarosa.xform.validator/src/org/javarosa/xform/validator/gui/XFormValidatorGUI.java",
"license": "apache-2.0",
"size": 41545
}
|
[
"java.awt.FileDialog",
"java.awt.event.ActionEvent"
] |
import java.awt.FileDialog; import java.awt.event.ActionEvent;
|
import java.awt.*; import java.awt.event.*;
|
[
"java.awt"
] |
java.awt;
| 1,810,784 |
public static Class type(Field field) {
return field.getType();
}
|
static Class function(Field field) { return field.getType(); }
|
/**
* Returns the type of the Field object.
*
* @param field Field for which type is returned
* @return type of the given field
*/
|
Returns the type of the Field object
|
type
|
{
"repo_name": "haitaoyao/btrace",
"path": "src/share/classes/com/sun/btrace/BTraceUtils.java",
"license": "gpl-2.0",
"size": 234341
}
|
[
"java.lang.reflect.Field"
] |
import java.lang.reflect.Field;
|
import java.lang.reflect.*;
|
[
"java.lang"
] |
java.lang;
| 1,734,001 |
public ApplicationGatewayRewriteRule withConditions(List<ApplicationGatewayRewriteRuleCondition> conditions) {
this.conditions = conditions;
return this;
}
|
ApplicationGatewayRewriteRule function(List<ApplicationGatewayRewriteRuleCondition> conditions) { this.conditions = conditions; return this; }
|
/**
* Set conditions based on which the action set execution will be evaluated.
*
* @param conditions the conditions value to set
* @return the ApplicationGatewayRewriteRule object itself.
*/
|
Set conditions based on which the action set execution will be evaluated
|
withConditions
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2019_11_01/src/main/java/com/microsoft/azure/management/network/v2019_11_01/ApplicationGatewayRewriteRule.java",
"license": "mit",
"size": 3691
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,485,394 |
Ignition.start("examples/config/filesystem/example-igfs.xml");
}
|
Ignition.start(STR); }
|
/**
* Start up an empty node with specified cache configuration.
*
* @param args Command line arguments, none required.
* @throws IgniteException If example execution failed.
*/
|
Start up an empty node with specified cache configuration
|
main
|
{
"repo_name": "irudyak/ignite",
"path": "examples/src/main/java/org/apache/ignite/examples/igfs/IgfsNodeStartup.java",
"license": "apache-2.0",
"size": 1720
}
|
[
"org.apache.ignite.Ignition"
] |
import org.apache.ignite.Ignition;
|
import org.apache.ignite.*;
|
[
"org.apache.ignite"
] |
org.apache.ignite;
| 2,331,590 |
void processPubRec(String clientID, int messageID) {
//once received a PUBREC reply with a PUBREL(messageID)
if (log.isDebugEnabled()) {
log.debug("ProcessPubRec invoked for " + clientID + " ad messageID " + messageID);
}
//The broker will respond to the client to release the message
PubRelMessage pubRelMessage = new PubRelMessage();
pubRelMessage.setMessageID(messageID);
pubRelMessage.setQos(AbstractMessage.QOSType.LEAST_ONE);
// m_clientIDs.get(clientID).getSession().write(pubRelMessage);
disruptorPublish(new OutputMessagingEvent(m_clientIDs.get(clientID).getSession(), pubRelMessage));
}
|
void processPubRec(String clientID, int messageID) { if (log.isDebugEnabled()) { log.debug(STR + clientID + STR + messageID); } PubRelMessage pubRelMessage = new PubRelMessage(); pubRelMessage.setMessageID(messageID); pubRelMessage.setQos(AbstractMessage.QOSType.LEAST_ONE); disruptorPublish(new OutputMessagingEvent(m_clientIDs.get(clientID).getSession(), pubRelMessage)); }
|
/**
* Sent by the subscriber to the broker, on receiving of a QoS 2 message
* @param clientID the id of the client
* @param messageID the id of the message
*/
|
Sent by the subscriber to the broker, on receiving of a QoS 2 message
|
processPubRec
|
{
"repo_name": "hastef88/andes",
"path": "modules/andes-core/broker/src/main/java/org/dna/mqtt/moquette/messaging/spi/impl/ProtocolProcessor.java",
"license": "apache-2.0",
"size": 44212
}
|
[
"org.dna.mqtt.moquette.messaging.spi.impl.events.OutputMessagingEvent",
"org.dna.mqtt.moquette.proto.messages.AbstractMessage",
"org.dna.mqtt.moquette.proto.messages.PubRelMessage"
] |
import org.dna.mqtt.moquette.messaging.spi.impl.events.OutputMessagingEvent; import org.dna.mqtt.moquette.proto.messages.AbstractMessage; import org.dna.mqtt.moquette.proto.messages.PubRelMessage;
|
import org.dna.mqtt.moquette.messaging.spi.impl.events.*; import org.dna.mqtt.moquette.proto.messages.*;
|
[
"org.dna.mqtt"
] |
org.dna.mqtt;
| 2,655,004 |
@Override
public Object draw(Graphics2D g2, Rectangle2D area, Object params) {
// check if we need to collect chart entities from the container
EntityBlockParams ebp;
StandardEntityCollection sec = null;
if (params instanceof EntityBlockParams) {
ebp = (EntityBlockParams) params;
if (ebp.getGenerateEntities()) {
sec = new StandardEntityCollection();
}
}
Rectangle2D contentArea = (Rectangle2D) area.clone();
contentArea = trimMargin(contentArea);
drawBorder(g2, contentArea);
contentArea = trimBorder(contentArea);
contentArea = trimPadding(contentArea);
for (Block block : this.blocks) {
Rectangle2D bounds = block.getBounds();
Rectangle2D drawArea = new Rectangle2D.Double(bounds.getX()
+ area.getX(), bounds.getY() + area.getY(),
bounds.getWidth(), bounds.getHeight());
Object r = block.draw(g2, drawArea, params);
if (sec != null) {
if (r instanceof EntityBlockResult) {
EntityBlockResult ebr = (EntityBlockResult) r;
EntityCollection ec = ebr.getEntityCollection();
sec.addAll(ec);
}
}
}
BlockResult result = null;
if (sec != null) {
result = new BlockResult();
result.setEntityCollection(sec);
}
return result;
}
|
Object function(Graphics2D g2, Rectangle2D area, Object params) { EntityBlockParams ebp; StandardEntityCollection sec = null; if (params instanceof EntityBlockParams) { ebp = (EntityBlockParams) params; if (ebp.getGenerateEntities()) { sec = new StandardEntityCollection(); } } Rectangle2D contentArea = (Rectangle2D) area.clone(); contentArea = trimMargin(contentArea); drawBorder(g2, contentArea); contentArea = trimBorder(contentArea); contentArea = trimPadding(contentArea); for (Block block : this.blocks) { Rectangle2D bounds = block.getBounds(); Rectangle2D drawArea = new Rectangle2D.Double(bounds.getX() + area.getX(), bounds.getY() + area.getY(), bounds.getWidth(), bounds.getHeight()); Object r = block.draw(g2, drawArea, params); if (sec != null) { if (r instanceof EntityBlockResult) { EntityBlockResult ebr = (EntityBlockResult) r; EntityCollection ec = ebr.getEntityCollection(); sec.addAll(ec); } } } BlockResult result = null; if (sec != null) { result = new BlockResult(); result.setEntityCollection(sec); } return result; }
|
/**
* Draws the block within the specified area.
*
* @param g2 the graphics device.
* @param area the area.
* @param params passed on to blocks within the container
* ({@code null} permitted).
*
* @return An instance of {@link EntityBlockResult}, or {@code null}.
*/
|
Draws the block within the specified area
|
draw
|
{
"repo_name": "jfree/jfreechart",
"path": "src/main/java/org/jfree/chart/block/BlockContainer.java",
"license": "lgpl-2.1",
"size": 8517
}
|
[
"java.awt.Graphics2D",
"java.awt.geom.Rectangle2D",
"org.jfree.chart.entity.EntityCollection",
"org.jfree.chart.entity.StandardEntityCollection"
] |
import java.awt.Graphics2D; import java.awt.geom.Rectangle2D; import org.jfree.chart.entity.EntityCollection; import org.jfree.chart.entity.StandardEntityCollection;
|
import java.awt.*; import java.awt.geom.*; import org.jfree.chart.entity.*;
|
[
"java.awt",
"org.jfree.chart"
] |
java.awt; org.jfree.chart;
| 2,366,813 |
@JsonProperty("server")
public void setServerFactory(ServerFactory factory) {
this.server = factory;
}
|
@JsonProperty(STR) void function(ServerFactory factory) { this.server = factory; }
|
/**
* Sets the HTTP-specific section of the configuration file.
*/
|
Sets the HTTP-specific section of the configuration file
|
setServerFactory
|
{
"repo_name": "flipsterkeshav/dropwizard",
"path": "dropwizard-core/src/main/java/io/dropwizard/Configuration.java",
"license": "apache-2.0",
"size": 3339
}
|
[
"com.fasterxml.jackson.annotation.JsonProperty",
"io.dropwizard.server.ServerFactory"
] |
import com.fasterxml.jackson.annotation.JsonProperty; import io.dropwizard.server.ServerFactory;
|
import com.fasterxml.jackson.annotation.*; import io.dropwizard.server.*;
|
[
"com.fasterxml.jackson",
"io.dropwizard.server"
] |
com.fasterxml.jackson; io.dropwizard.server;
| 156,649 |
public void testURIInfoFieldMemberInjection() throws HttpException, IOException {
ClientResponse response = client.resource(getBaseURI() + "/context/uriinfo/field").get();
assertEquals(204, response.getStatusCode());
}
|
void function() throws HttpException, IOException { ClientResponse response = client.resource(getBaseURI() + STR).get(); assertEquals(204, response.getStatusCode()); }
|
/**
* Tests that a URIInfo object is injected via a field member.
*
* @throws IOException
* @throws HttpException
*/
|
Tests that a URIInfo object is injected via a field member
|
testURIInfoFieldMemberInjection
|
{
"repo_name": "os890/wink_patches",
"path": "wink-itests/wink-itest/wink-itest-context/src/test/java/org/apache/wink/itest/uriinfo/WinkURIInfoInjectionTest.java",
"license": "apache-2.0",
"size": 3515
}
|
[
"java.io.IOException",
"org.apache.commons.httpclient.HttpException",
"org.apache.wink.client.ClientResponse"
] |
import java.io.IOException; import org.apache.commons.httpclient.HttpException; import org.apache.wink.client.ClientResponse;
|
import java.io.*; import org.apache.commons.httpclient.*; import org.apache.wink.client.*;
|
[
"java.io",
"org.apache.commons",
"org.apache.wink"
] |
java.io; org.apache.commons; org.apache.wink;
| 2,603,999 |
@Bean
@Conditional(InsightsSAMLBeanInitializationCondition.class)
public SAMLLogoutFilter samlLogoutFilter() {
LOG.debug(" Inside samlLogoutFilter ==== ");
return new SAMLLogoutFilter(successLogoutHandler(), new LogoutHandler[] { logoutHandler() },
new LogoutHandler[] { logoutHandler() });
}
|
@Conditional(InsightsSAMLBeanInitializationCondition.class) SAMLLogoutFilter function() { LOG.debug(STR); return new SAMLLogoutFilter(successLogoutHandler(), new LogoutHandler[] { logoutHandler() }, new LogoutHandler[] { logoutHandler() }); }
|
/**
* used to initialize logout Handler
*
* @return
*/
|
used to initialize logout Handler
|
samlLogoutFilter
|
{
"repo_name": "CognizantOneDevOps/Insights",
"path": "PlatformService/src/main/java/com/cognizant/devops/platformservice/security/config/saml/InsightsSecurityConfigurationAdapterSAML.java",
"license": "apache-2.0",
"size": 26210
}
|
[
"org.springframework.context.annotation.Conditional",
"org.springframework.security.saml.SAMLLogoutFilter",
"org.springframework.security.web.authentication.logout.LogoutHandler"
] |
import org.springframework.context.annotation.Conditional; import org.springframework.security.saml.SAMLLogoutFilter; import org.springframework.security.web.authentication.logout.LogoutHandler;
|
import org.springframework.context.annotation.*; import org.springframework.security.saml.*; import org.springframework.security.web.authentication.logout.*;
|
[
"org.springframework.context",
"org.springframework.security"
] |
org.springframework.context; org.springframework.security;
| 2,607,882 |
public final Element getElement() {
return this.constructionElement;
}
|
final Element function() { return this.constructionElement; }
|
/**
* Returns the Element which was constructed by the Object.
*
* @return the Element which was constructed by the Object.
*/
|
Returns the Element which was constructed by the Object
|
getElement
|
{
"repo_name": "mbshopM/openconcerto",
"path": "Modules/Module EBICS/src/org/apache/xml/security/utils/ElementProxy.java",
"license": "gpl-3.0",
"size": 16627
}
|
[
"org.w3c.dom.Element"
] |
import org.w3c.dom.Element;
|
import org.w3c.dom.*;
|
[
"org.w3c.dom"
] |
org.w3c.dom;
| 954,729 |
public Project getProject(String name) {
try {
return projects().withName(name).get();
} catch (KubernetesClientException e) {
return null;
}
}
|
Project function(String name) { try { return projects().withName(name).get(); } catch (KubernetesClientException e) { return null; } }
|
/**
* Tries to retrieve project with name 'name'. Swallows KubernetesClientException
* if project doesn't exist or isn't accessible for user.
*
* @param name name of requested project.
* @return Project instance if accessible otherwise null.
*/
|
Tries to retrieve project with name 'name'. Swallows KubernetesClientException if project doesn't exist or isn't accessible for user
|
getProject
|
{
"repo_name": "xtf-cz/xtf",
"path": "core/src/main/java/cz/xtf/core/openshift/OpenShift.java",
"license": "mit",
"size": 50678
}
|
[
"io.fabric8.kubernetes.client.KubernetesClientException",
"io.fabric8.openshift.api.model.Project"
] |
import io.fabric8.kubernetes.client.KubernetesClientException; import io.fabric8.openshift.api.model.Project;
|
import io.fabric8.kubernetes.client.*; import io.fabric8.openshift.api.model.*;
|
[
"io.fabric8.kubernetes",
"io.fabric8.openshift"
] |
io.fabric8.kubernetes; io.fabric8.openshift;
| 1,848,545 |
//-------------------------------------------------------------------------
public static SabrParametersIborCapletFloorletVolatilities of(
IborCapletFloorletVolatilitiesName name,
IborIndex index,
ZonedDateTime valuationDateTime,
SabrParameters parameters) {
return new SabrParametersIborCapletFloorletVolatilities(name, index, valuationDateTime, parameters, null, null, null, null);
}
|
static SabrParametersIborCapletFloorletVolatilities function( IborCapletFloorletVolatilitiesName name, IborIndex index, ZonedDateTime valuationDateTime, SabrParameters parameters) { return new SabrParametersIborCapletFloorletVolatilities(name, index, valuationDateTime, parameters, null, null, null, null); }
|
/**
* Obtains an instance from the SABR model parameters and the date-time for which it is valid.
*
* @param name the name
* @param index the Ibor index for which the data is valid
* @param valuationDateTime the valuation date-time
* @param parameters the SABR model parameters
* @return the volatilities
*/
|
Obtains an instance from the SABR model parameters and the date-time for which it is valid
|
of
|
{
"repo_name": "OpenGamma/Strata",
"path": "modules/pricer/src/main/java/com/opengamma/strata/pricer/capfloor/SabrParametersIborCapletFloorletVolatilities.java",
"license": "apache-2.0",
"size": 38416
}
|
[
"com.opengamma.strata.basics.index.IborIndex",
"com.opengamma.strata.pricer.model.SabrParameters",
"java.time.ZonedDateTime"
] |
import com.opengamma.strata.basics.index.IborIndex; import com.opengamma.strata.pricer.model.SabrParameters; import java.time.ZonedDateTime;
|
import com.opengamma.strata.basics.index.*; import com.opengamma.strata.pricer.model.*; import java.time.*;
|
[
"com.opengamma.strata",
"java.time"
] |
com.opengamma.strata; java.time;
| 2,808,165 |
protected void addExtraButton(String property, String source, String altText) {
ExtraButton newButton = new ExtraButton();
newButton.setExtraButtonProperty(property);
newButton.setExtraButtonSource(source);
newButton.setExtraButtonAltText(altText);
extraButtons.add(newButton);
}
|
void function(String property, String source, String altText) { ExtraButton newButton = new ExtraButton(); newButton.setExtraButtonProperty(property); newButton.setExtraButtonSource(source); newButton.setExtraButtonAltText(altText); extraButtons.add(newButton); }
|
/**
* Adds a new button to the extra buttons collection.
*
* @param property - property for button
* @param source - location of image
* @param altText - alternate text for button if images don't appear
*
* KRAD Conversion: Performs customization of an extra button.
*
*/
|
Adds a new button to the extra buttons collection
|
addExtraButton
|
{
"repo_name": "bhutchinson/kfs",
"path": "kfs-purap/src/main/java/org/kuali/kfs/module/purap/document/web/struts/ElectronicInvoiceRejectForm.java",
"license": "agpl-3.0",
"size": 6096
}
|
[
"org.kuali.rice.kns.web.ui.ExtraButton"
] |
import org.kuali.rice.kns.web.ui.ExtraButton;
|
import org.kuali.rice.kns.web.ui.*;
|
[
"org.kuali.rice"
] |
org.kuali.rice;
| 1,932,575 |
@Override
protected void doSetValue(final Object value)
{
this.value = (FontData) value;
}
|
void function(final Object value) { this.value = (FontData) value; }
|
/** Called by the framework to initialize the RGB value.
* @param value Should be an RGB.
*/
|
Called by the framework to initialize the RGB value
|
doSetValue
|
{
"repo_name": "kasemir/org.csstudio.display.builder",
"path": "databrowser3/databrowser-plugins/org.csstudio.trends.databrowser3/src/org/csstudio/trends/databrowser3/propsheet/FontCellEditor.java",
"license": "epl-1.0",
"size": 2201
}
|
[
"org.eclipse.swt.graphics.FontData"
] |
import org.eclipse.swt.graphics.FontData;
|
import org.eclipse.swt.graphics.*;
|
[
"org.eclipse.swt"
] |
org.eclipse.swt;
| 700,672 |
public void addOp(String par1Str)
{
this.ops.add(par1Str.toLowerCase());
// CraftBukkit start
Player player = mcServer.server.getPlayer(par1Str);
if (player != null)
{
player.recalculatePermissions();
}
// CraftBukkit end
}
|
void function(String par1Str) { this.ops.add(par1Str.toLowerCase()); Player player = mcServer.server.getPlayer(par1Str); if (player != null) { player.recalculatePermissions(); } }
|
/**
* This adds a username to the ops list, then saves the op list
*/
|
This adds a username to the ops list, then saves the op list
|
addOp
|
{
"repo_name": "wildex999/stjerncraft_mcpc",
"path": "src/minecraft/net/minecraft/server/management/ServerConfigurationManager.java",
"license": "gpl-3.0",
"size": 65878
}
|
[
"org.bukkit.entity.Player"
] |
import org.bukkit.entity.Player;
|
import org.bukkit.entity.*;
|
[
"org.bukkit.entity"
] |
org.bukkit.entity;
| 463,701 |
public static byte[] gzip(String input) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
GZIPOutputStream gzos = null;
try {
gzos = new GZIPOutputStream(baos);
gzos.write(input.getBytes("UTF-8"));
} catch (IOException e) {
e.printStackTrace();
} finally {
if (gzos != null) try {
gzos.close();
} catch (IOException ignore) {
}
}
return baos.toByteArray();
}
|
static byte[] function(String input) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); GZIPOutputStream gzos = null; try { gzos = new GZIPOutputStream(baos); gzos.write(input.getBytes("UTF-8")); } catch (IOException e) { e.printStackTrace(); } finally { if (gzos != null) try { gzos.close(); } catch (IOException ignore) { } } return baos.toByteArray(); }
|
/**
* GZip compress a string of bytes
*
* @param input
* @return
*/
|
GZip compress a string of bytes
|
gzip
|
{
"repo_name": "tastybento/bluebook",
"path": "BlueBook/src/com/wasteofplastic/bluebook/MetricsLite.java",
"license": "gpl-3.0",
"size": 17969
}
|
[
"java.io.ByteArrayOutputStream",
"java.io.IOException",
"java.util.zip.GZIPOutputStream"
] |
import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.zip.GZIPOutputStream;
|
import java.io.*; import java.util.zip.*;
|
[
"java.io",
"java.util"
] |
java.io; java.util;
| 1,853,301 |
protected Shape parseIfSupported(String str, WKTReader reader) throws ParseException {
try {
Geometry geom = reader.read(str);
//Normalizes & verifies coordinates
checkCoordinates(geom);
if (geom instanceof com.vividsolutions.jts.geom.Point) {
com.vividsolutions.jts.geom.Point ptGeom = (com.vividsolutions.jts.geom.Point) geom;
if (ctx.useJtsPoint())
return new JtsPoint(ptGeom, ctx);
else
return ctx.makePoint(ptGeom.getX(), ptGeom.getY());
} else if (geom.isRectangle()) {
return super.makeRectFromPoly(geom);
} else {
return super.makeShapeFromGeometry(geom);
}
} catch (InvalidShapeException e) {
throw e;
} catch (Exception e) {
throw new InvalidShapeException("error reading WKT: "+e.toString(), e);
}
}
|
Shape function(String str, WKTReader reader) throws ParseException { try { Geometry geom = reader.read(str); checkCoordinates(geom); if (geom instanceof com.vividsolutions.jts.geom.Point) { com.vividsolutions.jts.geom.Point ptGeom = (com.vividsolutions.jts.geom.Point) geom; if (ctx.useJtsPoint()) return new JtsPoint(ptGeom, ctx); else return ctx.makePoint(ptGeom.getX(), ptGeom.getY()); } else if (geom.isRectangle()) { return super.makeRectFromPoly(geom); } else { return super.makeShapeFromGeometry(geom); } } catch (InvalidShapeException e) { throw e; } catch (Exception e) { throw new InvalidShapeException(STR+e.toString(), e); } }
|
/**
* Reads WKT from the {@code str} via JTS's {@link com.vividsolutions.jts.io.WKTReader}.
* @param str
* @param reader <pre>new WKTReader(ctx.getGeometryFactory()))</pre>
* @return Non-Null
*/
|
Reads WKT from the str via JTS's <code>com.vividsolutions.jts.io.WKTReader</code>
|
parseIfSupported
|
{
"repo_name": "SKPCandy/spatial4j",
"path": "src/main/java/com/spatial4j/core/io/jts/JtsWKTReaderShapeParser.java",
"license": "apache-2.0",
"size": 4623
}
|
[
"com.spatial4j.core.exception.InvalidShapeException",
"com.spatial4j.core.shape.Shape",
"com.spatial4j.core.shape.jts.JtsPoint",
"com.vividsolutions.jts.geom.Geometry",
"com.vividsolutions.jts.io.WKTReader",
"java.text.ParseException"
] |
import com.spatial4j.core.exception.InvalidShapeException; import com.spatial4j.core.shape.Shape; import com.spatial4j.core.shape.jts.JtsPoint; import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.io.WKTReader; import java.text.ParseException;
|
import com.spatial4j.core.exception.*; import com.spatial4j.core.shape.*; import com.spatial4j.core.shape.jts.*; import com.vividsolutions.jts.geom.*; import com.vividsolutions.jts.io.*; import java.text.*;
|
[
"com.spatial4j.core",
"com.vividsolutions.jts",
"java.text"
] |
com.spatial4j.core; com.vividsolutions.jts; java.text;
| 2,779,910 |
public int getElementDeclIndex(QName elementDeclQName) {
return getElementDeclIndex(elementDeclQName.rawname);
} // getElementDeclIndex(QName):int
|
int function(QName elementDeclQName) { return getElementDeclIndex(elementDeclQName.rawname); }
|
/** Returns the element decl index.
* @param elementDeclQName qualilfied name of the element
*/
|
Returns the element decl index
|
getElementDeclIndex
|
{
"repo_name": "JetBrains/jdk8u_jaxp",
"path": "src/com/sun/xml/internal/stream/dtd/nonvalidating/DTDGrammar.java",
"license": "gpl-2.0",
"size": 32798
}
|
[
"com.sun.org.apache.xerces.internal.xni.QName"
] |
import com.sun.org.apache.xerces.internal.xni.QName;
|
import com.sun.org.apache.xerces.internal.xni.*;
|
[
"com.sun.org"
] |
com.sun.org;
| 1,909,831 |
public void setIconSize(int size) {
if (size > Math.min(width, height)) size = Math.min(width, height);
iconRect.set(0, 0, size, size);
Gravity.apply(gravity, iconRect.width(), iconRect.height(), getBounds(), iconRect);
float ratio = size / BASE_ICON_SIZE;
barWidth = BASE_BAR_WIDTH * ratio;
barHeight = BASE_BAR_HEIGHT * ratio;
barSpacing = BASE_BAR_SPACING * ratio;
barShrinkage = BASE_BAR_SHRINKAGE * ratio;
invalidateSelf();
}
|
void function(int size) { if (size > Math.min(width, height)) size = Math.min(width, height); iconRect.set(0, 0, size, size); Gravity.apply(gravity, iconRect.width(), iconRect.height(), getBounds(), iconRect); float ratio = size / BASE_ICON_SIZE; barWidth = BASE_BAR_WIDTH * ratio; barHeight = BASE_BAR_HEIGHT * ratio; barSpacing = BASE_BAR_SPACING * ratio; barShrinkage = BASE_BAR_SHRINKAGE * ratio; invalidateSelf(); }
|
/**
* set the size of the icon; this size should be smaller than the size of this drawable itself to fully show the transformation!
*
* @param size the size of the icon in pixel
*/
|
set the size of the icon; this size should be smaller than the size of this drawable itself to fully show the transformation
|
setIconSize
|
{
"repo_name": "kibotu/common.android.utils",
"path": "common-android-utils/src/main/java/com/common/android/utils/ui/DrawerIconDrawable.java",
"license": "apache-2.0",
"size": 12216
}
|
[
"android.view.Gravity"
] |
import android.view.Gravity;
|
import android.view.*;
|
[
"android.view"
] |
android.view;
| 2,226,370 |
public ExecutableQuery<E> includeDeleted() {
return this.where().includeDeleted();
}
|
ExecutableQuery<E> function() { return this.where().includeDeleted(); }
|
/**
* Include a the soft deleted items on records returned.
*
* @return ExecutableQuery
*/
|
Include a the soft deleted items on records returned
|
includeDeleted
|
{
"repo_name": "Azure/azure-mobile-apps-android-client",
"path": "sdk/src/sdk/src/main/java/com/microsoft/windowsazure/mobileservices/table/MobileServiceTable.java",
"license": "apache-2.0",
"size": 32228
}
|
[
"com.microsoft.windowsazure.mobileservices.table.query.ExecutableQuery"
] |
import com.microsoft.windowsazure.mobileservices.table.query.ExecutableQuery;
|
import com.microsoft.windowsazure.mobileservices.table.query.*;
|
[
"com.microsoft.windowsazure"
] |
com.microsoft.windowsazure;
| 1,174,707 |
public DatasetData isDatasetCreated(long projectID, DatasetData dataset)
{
List<DatasetData> datasets = projectDatasetMap.get(projectID);
if (CollectionUtils.isEmpty(datasets)) return null;
Iterator<DatasetData> i = datasets.iterator();
DatasetData data;
String name = dataset.getName();
while (i.hasNext()) {
data = i.next();
if (data.getName().equals(name))
return data;
}
return null;
}
|
DatasetData function(long projectID, DatasetData dataset) { List<DatasetData> datasets = projectDatasetMap.get(projectID); if (CollectionUtils.isEmpty(datasets)) return null; Iterator<DatasetData> i = datasets.iterator(); DatasetData data; String name = dataset.getName(); while (i.hasNext()) { data = i.next(); if (data.getName().equals(name)) return data; } return null; }
|
/**
* Returns the dataset if already created.
*
* @param projectID The id of the project.
* @param dataset The dataset to register.
* @return See above.s
*/
|
Returns the dataset if already created
|
isDatasetCreated
|
{
"repo_name": "stelfrich/openmicroscopy",
"path": "components/blitz/src/omero/gateway/model/ImportableObject.java",
"license": "gpl-2.0",
"size": 18859
}
|
[
"java.util.Iterator",
"java.util.List",
"org.apache.commons.collections.CollectionUtils"
] |
import java.util.Iterator; import java.util.List; import org.apache.commons.collections.CollectionUtils;
|
import java.util.*; import org.apache.commons.collections.*;
|
[
"java.util",
"org.apache.commons"
] |
java.util; org.apache.commons;
| 902,921 |
private JPanel getImagePanel() {
JPanel imagePanel = new JPanel(new BorderLayout());
// JLabel imageLabel = new JLabel(new ImageIcon(getClass().getResource("/org/apache/tools/ant/gui/resources/About.gif")));
JLabel imageLabel = new JLabel(new ImageIcon(getClass().getResource("/org/apache/tools/ant/gui/resources/SalsaSplash.gif")));
imagePanel.add(imageLabel, BorderLayout.CENTER);
if (_context != null) {
JLabel messageLabel = new JLabel(_context.getResources().getMessage(getClass(), "message", new Object[] {}));
messageLabel.setBorder(BorderFactory.createEmptyBorder(0, 4, 3, 4));
imagePanel.add(messageLabel, BorderLayout.SOUTH);
}
return imagePanel;
}
|
JPanel function() { JPanel imagePanel = new JPanel(new BorderLayout()); JLabel imageLabel = new JLabel(new ImageIcon(getClass().getResource(STR))); imagePanel.add(imageLabel, BorderLayout.CENTER); if (_context != null) { JLabel messageLabel = new JLabel(_context.getResources().getMessage(getClass(), STR, new Object[] {})); messageLabel.setBorder(BorderFactory.createEmptyBorder(0, 4, 3, 4)); imagePanel.add(messageLabel, BorderLayout.SOUTH); } return imagePanel; }
|
/**
* Builds the nice About panel.
*
* @return the About panel
*/
|
Builds the nice About panel
|
getImagePanel
|
{
"repo_name": "deepakalur/acre",
"path": "external/ant-antidote/src/java/org/apache/tools/ant/gui/About.java",
"license": "apache-2.0",
"size": 11695
}
|
[
"java.awt.BorderLayout",
"javax.swing.BorderFactory",
"javax.swing.ImageIcon",
"javax.swing.JLabel",
"javax.swing.JPanel"
] |
import java.awt.BorderLayout; import javax.swing.BorderFactory; import javax.swing.ImageIcon; import javax.swing.JLabel; import javax.swing.JPanel;
|
import java.awt.*; import javax.swing.*;
|
[
"java.awt",
"javax.swing"
] |
java.awt; javax.swing;
| 2,893,850 |
@Override
public INDArray create(int rows, int columns, int[] stride, int offset) {
if (dtype == DataBuffer.Type.DOUBLE)
return create(new double[rows * columns], new int[]{rows, columns}, stride, offset);
if (dtype == DataBuffer.Type.FLOAT)
return create(new float[rows * columns], new int[]{rows, columns}, stride, offset);
if (dtype == DataBuffer.Type.INT)
return create(new int[rows * columns], new int[]{rows, columns}, stride, offset);
throw new IllegalStateException("Illegal data type " + dtype);
}
|
INDArray function(int rows, int columns, int[] stride, int offset) { if (dtype == DataBuffer.Type.DOUBLE) return create(new double[rows * columns], new int[]{rows, columns}, stride, offset); if (dtype == DataBuffer.Type.FLOAT) return create(new float[rows * columns], new int[]{rows, columns}, stride, offset); if (dtype == DataBuffer.Type.INT) return create(new int[rows * columns], new int[]{rows, columns}, stride, offset); throw new IllegalStateException(STR + dtype); }
|
/**
* Creates an ndarray with the specified shape
*
* @param rows the rows of the ndarray
* @param columns the columns of the ndarray
* @param stride the stride for the ndarray
* @param offset the offset of the ndarray
* @return the instance
*/
|
Creates an ndarray with the specified shape
|
create
|
{
"repo_name": "rahulpalamuttam/nd4j",
"path": "nd4j-api/src/main/java/org/nd4j/linalg/factory/BaseNDArrayFactory.java",
"license": "apache-2.0",
"size": 59439
}
|
[
"org.nd4j.linalg.api.buffer.DataBuffer",
"org.nd4j.linalg.api.ndarray.INDArray"
] |
import org.nd4j.linalg.api.buffer.DataBuffer; import org.nd4j.linalg.api.ndarray.INDArray;
|
import org.nd4j.linalg.api.buffer.*; import org.nd4j.linalg.api.ndarray.*;
|
[
"org.nd4j.linalg"
] |
org.nd4j.linalg;
| 841,531 |
public static IAST Greater(final IExpr x, final IExpr y) {
return new B2.Greater(x, y);
}
|
static IAST function(final IExpr x, final IExpr y) { return new B2.Greater(x, y); }
|
/**
* Yields {@link S#True} if <code>x</code> is known to be greater than <code>y</code>.
*
* <p>
* See: <a href=
* "https://raw.githubusercontent.com/axkr/symja_android_library/master/symja_android_library/doc/functions/Greater.md">Greater</a>
*
* @param x
* @param y
* @return
*/
|
Yields <code>S#True</code> if <code>x</code> is known to be greater than <code>y</code>. See: Greater
|
Greater
|
{
"repo_name": "axkr/symja_android_library",
"path": "symja_android_library/matheclipse-core/src/main/java/org/matheclipse/core/expression/F.java",
"license": "gpl-3.0",
"size": 283472
}
|
[
"org.matheclipse.core.interfaces.IExpr"
] |
import org.matheclipse.core.interfaces.IExpr;
|
import org.matheclipse.core.interfaces.*;
|
[
"org.matheclipse.core"
] |
org.matheclipse.core;
| 140,793 |
boolean isDir(@NonNull final T path);
|
boolean isDir(@NonNull final T path);
|
/**
* Return true if the path is a directory and not a file.
*
* @param path
*/
|
Return true if the path is a directory and not a file
|
isDir
|
{
"repo_name": "stari4ek/NoNonsense-FilePicker",
"path": "library/src/main/java/com/nononsenseapps/filepicker/LogicHandler.java",
"license": "mpl-2.0",
"size": 2849
}
|
[
"android.support.annotation.NonNull"
] |
import android.support.annotation.NonNull;
|
import android.support.annotation.*;
|
[
"android.support"
] |
android.support;
| 1,920,762 |
EReference getClassifierMap_Function();
|
EReference getClassifierMap_Function();
|
/**
* Returns the meta object for the containment reference '{@link orgomg.cwm.analysis.transformation.ClassifierMap#getFunction <em>Function</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference '<em>Function</em>'.
* @see orgomg.cwm.analysis.transformation.ClassifierMap#getFunction()
* @see #getClassifierMap()
* @generated
*/
|
Returns the meta object for the containment reference '<code>orgomg.cwm.analysis.transformation.ClassifierMap#getFunction Function</code>'.
|
getClassifierMap_Function
|
{
"repo_name": "dresden-ocl/dresdenocl",
"path": "plugins/org.dresdenocl.tools.CWM/src/orgomg/cwm/analysis/transformation/TransformationPackage.java",
"license": "lgpl-3.0",
"size": 142768
}
|
[
"org.eclipse.emf.ecore.EReference"
] |
import org.eclipse.emf.ecore.EReference;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 1,496,509 |
AliasedField.withImmutableBuildersDisabled(() -> {
Criterion criterion = and(isNull(literal(1)), isNull(literal(2)));
criterion.getCriteria().add(isNull(literal(3)));
assertThat(criterion.getCriteria(), hasSize(3));
Criterion deepCopy = criterion.deepCopy();
deepCopy.getCriteria().add(mock(Criterion.class));
assertThat(deepCopy.getCriteria(), hasSize(4));
});
}
|
AliasedField.withImmutableBuildersDisabled(() -> { Criterion criterion = and(isNull(literal(1)), isNull(literal(2))); criterion.getCriteria().add(isNull(literal(3))); assertThat(criterion.getCriteria(), hasSize(3)); Criterion deepCopy = criterion.deepCopy(); deepCopy.getCriteria().add(mock(Criterion.class)); assertThat(deepCopy.getCriteria(), hasSize(4)); }); }
|
/**
* We should be able to add criteria if mutability is enabled.
*/
|
We should be able to add criteria if mutability is enabled
|
testCanMutateCriteriaWhenMutable
|
{
"repo_name": "badgerwithagun/morf",
"path": "morf-core/src/test/java/org/alfasoftware/morf/sql/element/TestCriterionDetail.java",
"license": "apache-2.0",
"size": 2129
}
|
[
"org.alfasoftware.morf.sql.element.Criterion",
"org.hamcrest.Matchers",
"org.junit.Assert"
] |
import org.alfasoftware.morf.sql.element.Criterion; import org.hamcrest.Matchers; import org.junit.Assert;
|
import org.alfasoftware.morf.sql.element.*; import org.hamcrest.*; import org.junit.*;
|
[
"org.alfasoftware.morf",
"org.hamcrest",
"org.junit"
] |
org.alfasoftware.morf; org.hamcrest; org.junit;
| 2,148,873 |
protected void writeSubHeader(PdfPTable table, String subHeading, String reportOption) {
table.addCell("\t\t".concat(subHeading));
if (reportOption.equalsIgnoreCase(EndowConstants.EndowmentReport.DETAIL)) {
table.addCell("");
table.addCell("");
}
table.addCell("");
}
|
void function(PdfPTable table, String subHeading, String reportOption) { table.addCell("\t\t".concat(subHeading)); if (reportOption.equalsIgnoreCase(EndowConstants.EndowmentReport.DETAIL)) { table.addCell(STRSTR"); }
|
/**
* helper method to write out a sub-heading into the report.
*/
|
helper method to write out a sub-heading into the report
|
writeSubHeader
|
{
"repo_name": "Ariah-Group/Finance",
"path": "af_webapp/src/main/java/org/kuali/kfs/module/endow/report/util/TransactionSummaryReportPrint.java",
"license": "apache-2.0",
"size": 46430
}
|
[
"com.lowagie.text.pdf.PdfPTable",
"org.kuali.kfs.module.endow.EndowConstants"
] |
import com.lowagie.text.pdf.PdfPTable; import org.kuali.kfs.module.endow.EndowConstants;
|
import com.lowagie.text.pdf.*; import org.kuali.kfs.module.endow.*;
|
[
"com.lowagie.text",
"org.kuali.kfs"
] |
com.lowagie.text; org.kuali.kfs;
| 124,959 |
while (injector != null) {
for (Key<?> key : injector.getBindings().keySet()) {
Type type = key.getTypeLiteral().getType();
if (type instanceof Class) {
Class<?> c = (Class) type;
if (isProviderClass(c)) {
logger.info("Registering {} as a provider class", c.getName());
environment.register(c);
} else if (isRootResourceClass(c)) {
// Jersey rejects resources that it doesn't think are acceptable
// Including abstract classes and interfaces, even if there is a valid Guice binding.
if(Resource.isAcceptable(c)) {
logger.info("Registering {} as a root resource class", c.getName());
environment.register(c);
} else {
logger.warn("Class {} was not registered as a resource. Bind a concrete implementation instead.", c.getName());
}
}
}
}
injector = injector.getParent();
}
}
|
while (injector != null) { for (Key<?> key : injector.getBindings().keySet()) { Type type = key.getTypeLiteral().getType(); if (type instanceof Class) { Class<?> c = (Class) type; if (isProviderClass(c)) { logger.info(STR, c.getName()); environment.register(c); } else if (isRootResourceClass(c)) { if(Resource.isAcceptable(c)) { logger.info(STR, c.getName()); environment.register(c); } else { logger.warn(STR, c.getName()); } } } } injector = injector.getParent(); } }
|
/**
* Registers any Guice-bound providers or root resources.
*/
|
Registers any Guice-bound providers or root resources
|
registerGuiceBound
|
{
"repo_name": "mwei1us/dropwizard-guice",
"path": "src/main/java/com/hubspot/dropwizard/guice/JerseyUtil.java",
"license": "apache-2.0",
"size": 2464
}
|
[
"com.google.inject.Key",
"java.lang.reflect.Type",
"org.glassfish.jersey.server.model.Resource"
] |
import com.google.inject.Key; import java.lang.reflect.Type; import org.glassfish.jersey.server.model.Resource;
|
import com.google.inject.*; import java.lang.reflect.*; import org.glassfish.jersey.server.model.*;
|
[
"com.google.inject",
"java.lang",
"org.glassfish.jersey"
] |
com.google.inject; java.lang; org.glassfish.jersey;
| 826,113 |
public boolean validate(Message query, Object context);
|
boolean function(Message query, Object context);
|
/**
* Validates the state of the given deserialized message.
* @param query The deserialized message.
* @param context Any contextual information required to properly validate the given message.
* @return True if the state of the deserialized message is valid.
*/
|
Validates the state of the given deserialized message
|
validate
|
{
"repo_name": "chinmaykolhatkar/incubator-apex-malhar",
"path": "library/src/main/java/com/datatorrent/lib/appdata/query/serde/CustomMessageValidator.java",
"license": "apache-2.0",
"size": 1489
}
|
[
"com.datatorrent.lib.appdata.schemas.Message"
] |
import com.datatorrent.lib.appdata.schemas.Message;
|
import com.datatorrent.lib.appdata.schemas.*;
|
[
"com.datatorrent.lib"
] |
com.datatorrent.lib;
| 1,848,491 |
public Cursor fetchAllGenres(String bookshelf) {
// Null 'order' to suppress ordering
String baseSql = fetchAllBooksInnerSql(null, bookshelf, "", "", "", "", "");
String sql = "SELECT DISTINCT "
+ " Case When (b." + KEY_GENRE + " = '' or b." + KEY_GENRE + " is NULL) Then '" + META_EMPTY_GENRE + "'"
+ " Else b." + KEY_GENRE + " End as " + KEY_ROWID + baseSql +
" ORDER BY Upper(b." + KEY_GENRE + ") " + COLLATION;
return mDb.rawQuery(sql, new String[]{});
}
|
Cursor function(String bookshelf) { String baseSql = fetchAllBooksInnerSql(null, bookshelf, STR", STRSTRSTRSELECT DISTINCT STR Case When (b.STR = '' or b.STR is NULL) Then 'STR'STR Else b.STR End as STR ORDER BY Upper(b.STR) " + COLLATION; return mDb.rawQuery(sql, new String[]{}); }
|
/**
* This will return a list of all genres within the given bookshelf
*
* @param bookshelf The bookshelf to search within. Can be the string "All Books"
* @return Cursor over all series
*/
|
This will return a list of all genres within the given bookshelf
|
fetchAllGenres
|
{
"repo_name": "gvmelle/Book-Catalogue",
"path": "src/com/eleybourn/bookcatalogue/CatalogueDBAdapter.java",
"license": "gpl-3.0",
"size": 238306
}
|
[
"android.database.Cursor"
] |
import android.database.Cursor;
|
import android.database.*;
|
[
"android.database"
] |
android.database;
| 2,429,873 |
@Test
public void test_findUri() {
final String uri = StyleManager.findUri("plain");
assertTrue(uri.startsWith("file:/"));
assertTrue(uri.endsWith("css/slide/plain.css"));
}
|
void function() { final String uri = StyleManager.findUri("plain"); assertTrue(uri.startsWith(STR)); assertTrue(uri.endsWith(STR)); }
|
/**
* Test of {@link StyleManager#findUri(String)}.
*/
|
Test of <code>StyleManager#findUri(String)</code>
|
test_findUri
|
{
"repo_name": "toastkidjp/slide_show",
"path": "src/test/java/jp/toastkid/slideshow/style/StyleManagerTest.java",
"license": "epl-1.0",
"size": 1024
}
|
[
"org.junit.Assert"
] |
import org.junit.Assert;
|
import org.junit.*;
|
[
"org.junit"
] |
org.junit;
| 2,831,504 |
if (slice == null) {
final RandomAccessReader randomAccessReader = parentLogicalZipFile.slice.randomAccessReader();
// Check header magic
if (randomAccessReader.readInt(locHeaderPos) != 0x04034b50) {
throw new IOException("Zip entry has bad LOC header: " + entryName);
}
final long dataStartPos = locHeaderPos + 30 + randomAccessReader.readShort(locHeaderPos + 26)
+ randomAccessReader.readShort(locHeaderPos + 28);
if (dataStartPos > parentLogicalZipFile.slice.sliceLength) {
throw new IOException("Unexpected EOF when trying to read zip entry data: " + entryName);
}
// Create a new Slice that wraps just the data of the zip entry, and mark whether it is deflated
slice = parentLogicalZipFile.slice.slice(dataStartPos, compressedSize, isDeflated, uncompressedSize);
}
return slice;
}
// -------------------------------------------------------------------------------------------------------------
|
if (slice == null) { final RandomAccessReader randomAccessReader = parentLogicalZipFile.slice.randomAccessReader(); if (randomAccessReader.readInt(locHeaderPos) != 0x04034b50) { throw new IOException(STR + entryName); } final long dataStartPos = locHeaderPos + 30 + randomAccessReader.readShort(locHeaderPos + 26) + randomAccessReader.readShort(locHeaderPos + 28); if (dataStartPos > parentLogicalZipFile.slice.sliceLength) { throw new IOException(STR + entryName); } slice = parentLogicalZipFile.slice.slice(dataStartPos, compressedSize, isDeflated, uncompressedSize); } return slice; }
|
/**
* Lazily get zip entry slice -- this is deferred until zip entry data needs to be read, in order to avoid
* randomly seeking within zipfile for every entry as the central directory is read.
*
* @return the offset within the physical zip file of the entry's start offset.
* @throws IOException
* If an I/O exception occurs.
*/
|
Lazily get zip entry slice -- this is deferred until zip entry data needs to be read, in order to avoid randomly seeking within zipfile for every entry as the central directory is read
|
getSlice
|
{
"repo_name": "lukehutch/fast-classpath-scanner",
"path": "src/main/java/nonapi/io/github/classgraph/fastzipfilereader/FastZipEntry.java",
"license": "mit",
"size": 13768
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,294,480 |
ClassPathResource resource = new ClassPathResource("starbucks.csv");
Scanner scanner = new Scanner(resource.getInputStream());
String line = scanner.nextLine();
scanner.close();
FlatFileItemReader<Store> itemReader = new FlatFileItemReader<Store>();
itemReader.setResource(resource);
// DelimitedLineTokenizer defaults to comma as its delimiter
DelimitedLineTokenizer tokenizer = new DelimitedLineTokenizer();
tokenizer.setNames(line.split(","));
tokenizer.setStrict(false);
DefaultLineMapper<Store> lineMapper = new DefaultLineMapper<Store>();
lineMapper.setFieldSetMapper(fields -> {
Point location = new Point(fields.readDouble("Longitude"), fields.readDouble("Latitude"));
Address address = new Address(fields.readString("Street Address"), fields.readString("City"),
fields.readString("Zip"), location);
return new Store(fields.readString("Name"), address);
});
lineMapper.setLineTokenizer(tokenizer);
itemReader.setLineMapper(lineMapper);
itemReader.setRecordSeparatorPolicy(new DefaultRecordSeparatorPolicy());
itemReader.setLinesToSkip(1);
itemReader.open(new ExecutionContext());
List<Store> stores = new ArrayList<>();
Store store = null;
do {
store = itemReader.read();
if (store != null) {
stores.add(store);
}
} while (store != null);
return stores;
}
|
ClassPathResource resource = new ClassPathResource(STR); Scanner scanner = new Scanner(resource.getInputStream()); String line = scanner.nextLine(); scanner.close(); FlatFileItemReader<Store> itemReader = new FlatFileItemReader<Store>(); itemReader.setResource(resource); DelimitedLineTokenizer tokenizer = new DelimitedLineTokenizer(); tokenizer.setNames(line.split(",")); tokenizer.setStrict(false); DefaultLineMapper<Store> lineMapper = new DefaultLineMapper<Store>(); lineMapper.setFieldSetMapper(fields -> { Point location = new Point(fields.readDouble(STR), fields.readDouble(STR)); Address address = new Address(fields.readString(STR), fields.readString("City"), fields.readString("Zip"), location); return new Store(fields.readString("Name"), address); }); lineMapper.setLineTokenizer(tokenizer); itemReader.setLineMapper(lineMapper); itemReader.setRecordSeparatorPolicy(new DefaultRecordSeparatorPolicy()); itemReader.setLinesToSkip(1); itemReader.open(new ExecutionContext()); List<Store> stores = new ArrayList<>(); Store store = null; do { store = itemReader.read(); if (store != null) { stores.add(store); } } while (store != null); return stores; }
|
/**
* Reads a file {@code starbucks.csv} from the class path and parses it into {@link Store} instances about to
* persisted.
*
* @return
* @throws Exception
*/
|
Reads a file starbucks.csv from the class path and parses it into <code>Store</code> instances about to persisted
|
readStores
|
{
"repo_name": "sis-direct/spring-data-examples",
"path": "rest/starbucks/src/main/java/example/springdata/rest/stores/StoreInitializer.java",
"license": "apache-2.0",
"size": 3601
}
|
[
"java.util.ArrayList",
"java.util.List",
"java.util.Scanner",
"org.springframework.batch.item.ExecutionContext",
"org.springframework.batch.item.file.FlatFileItemReader",
"org.springframework.batch.item.file.mapping.DefaultLineMapper",
"org.springframework.batch.item.file.separator.DefaultRecordSeparatorPolicy",
"org.springframework.batch.item.file.transform.DelimitedLineTokenizer",
"org.springframework.core.io.ClassPathResource",
"org.springframework.data.geo.Point"
] |
import java.util.ArrayList; import java.util.List; import java.util.Scanner; import org.springframework.batch.item.ExecutionContext; import org.springframework.batch.item.file.FlatFileItemReader; import org.springframework.batch.item.file.mapping.DefaultLineMapper; import org.springframework.batch.item.file.separator.DefaultRecordSeparatorPolicy; import org.springframework.batch.item.file.transform.DelimitedLineTokenizer; import org.springframework.core.io.ClassPathResource; import org.springframework.data.geo.Point;
|
import java.util.*; import org.springframework.batch.item.*; import org.springframework.batch.item.file.*; import org.springframework.batch.item.file.mapping.*; import org.springframework.batch.item.file.separator.*; import org.springframework.batch.item.file.transform.*; import org.springframework.core.io.*; import org.springframework.data.geo.*;
|
[
"java.util",
"org.springframework.batch",
"org.springframework.core",
"org.springframework.data"
] |
java.util; org.springframework.batch; org.springframework.core; org.springframework.data;
| 1,049,037 |
public Color[] getFillColors() {
return null;
}
|
Color[] function() { return null; }
|
/**
* Fill colors for columns are not specified. Client should assign colors.
* Implementation of Data interface.
*/
|
Fill colors for columns are not specified. Client should assign colors. Implementation of Data interface
|
getFillColors
|
{
"repo_name": "OpenSourcePhysics/osp",
"path": "src/org/opensourcephysics/display/DataAdapter.java",
"license": "gpl-3.0",
"size": 3527
}
|
[
"java.awt.Color"
] |
import java.awt.Color;
|
import java.awt.*;
|
[
"java.awt"
] |
java.awt;
| 2,760,540 |
@Override
public void run() {
try {
process();
} catch (Exception e) {
Log.e(getClass().getName(), "process: ", e);
} finally {
leaveQueue();
recycle();
}
}
|
void function() { try { process(); } catch (Exception e) { Log.e(getClass().getName(), STR, e); } finally { leaveQueue(); recycle(); } }
|
/**
* Handle the event and recycle it.
*/
|
Handle the event and recycle it
|
run
|
{
"repo_name": "nikita36078/J2ME-Loader",
"path": "app/src/main/java/javax/microedition/lcdui/event/Event.java",
"license": "apache-2.0",
"size": 1866
}
|
[
"android.util.Log"
] |
import android.util.Log;
|
import android.util.*;
|
[
"android.util"
] |
android.util;
| 926,049 |
@Test
public void testParseVersion4SegmentsUpdate5() {
VersionIdentifier version = parseVersion("1.2.3.4u5");
assertNotNull(version);
assertEquals(4, version.getVersionSegmentCount());
assertEquals(1, version.getVersionMajorSegment());
assertEquals(2, version.getVersionMinorSegment());
assertEquals(3, version.getVersionMilliSegment());
assertEquals(4, version.getVersionMicroSegment());
assertEquals(0, version.getVersionSegment(42));
assertEquals(DevelopmentPhase.UPDATE, version.getPhase());
assertEquals("u", version.getPhaseAlias());
assertEquals(Integer.valueOf(5), version.getPhaseNumber());
assertFalse(version.isSnapshot());
assertNull(version.getLabel());
assertNull(version.getRevision());
assertNull(version.getTimestamp());
}
|
void function() { VersionIdentifier version = parseVersion(STR); assertNotNull(version); assertEquals(4, version.getVersionSegmentCount()); assertEquals(1, version.getVersionMajorSegment()); assertEquals(2, version.getVersionMinorSegment()); assertEquals(3, version.getVersionMilliSegment()); assertEquals(4, version.getVersionMicroSegment()); assertEquals(0, version.getVersionSegment(42)); assertEquals(DevelopmentPhase.UPDATE, version.getPhase()); assertEquals("u", version.getPhaseAlias()); assertEquals(Integer.valueOf(5), version.getPhaseNumber()); assertFalse(version.isSnapshot()); assertNull(version.getLabel()); assertNull(version.getRevision()); assertNull(version.getTimestamp()); }
|
/**
* This method tests the {@link VersionUtil#createVersionIdentifier(String) parsing} of {@link VersionIdentifier} with
* 4 version segments and phase update number 5.
*/
|
This method tests the <code>VersionUtil#createVersionIdentifier(String) parsing</code> of <code>VersionIdentifier</code> with 4 version segments and phase update number 5
|
testParseVersion4SegmentsUpdate5
|
{
"repo_name": "m-m-m/util",
"path": "version/src/test/java/net/sf/mmm/util/version/impl/VersionUtilTest.java",
"license": "apache-2.0",
"size": 8510
}
|
[
"net.sf.mmm.util.version.api.DevelopmentPhase",
"net.sf.mmm.util.version.api.VersionIdentifier"
] |
import net.sf.mmm.util.version.api.DevelopmentPhase; import net.sf.mmm.util.version.api.VersionIdentifier;
|
import net.sf.mmm.util.version.api.*;
|
[
"net.sf.mmm"
] |
net.sf.mmm;
| 1,737,056 |
private JComboBox getNamespaceReplacementPolicyComboBox() {
if (namespaceReplacementPolicyComboBox == null) {
namespaceReplacementPolicyComboBox = new JComboBox();
namespaceReplacementPolicyComboBox.addItem(getIntroducePortalConfiguration().getNamespaceReplacementPolicy().ERROR);
namespaceReplacementPolicyComboBox.addItem(getIntroducePortalConfiguration().getNamespaceReplacementPolicy().IGNORE);
namespaceReplacementPolicyComboBox.addItem(getIntroducePortalConfiguration().getNamespaceReplacementPolicy().REPLACE);
namespaceReplacementPolicyComboBox.setSelectedItem(getIntroducePortalConfiguration().getNamespaceReplacementPolicy());
namespaceReplacementPolicyComboBox.addActionListener(new ActionListener() {
|
JComboBox function() { if (namespaceReplacementPolicyComboBox == null) { namespaceReplacementPolicyComboBox = new JComboBox(); namespaceReplacementPolicyComboBox.addItem(getIntroducePortalConfiguration().getNamespaceReplacementPolicy().ERROR); namespaceReplacementPolicyComboBox.addItem(getIntroducePortalConfiguration().getNamespaceReplacementPolicy().IGNORE); namespaceReplacementPolicyComboBox.addItem(getIntroducePortalConfiguration().getNamespaceReplacementPolicy().REPLACE); namespaceReplacementPolicyComboBox.setSelectedItem(getIntroducePortalConfiguration().getNamespaceReplacementPolicy()); namespaceReplacementPolicyComboBox.addActionListener(new ActionListener() {
|
/**
* This method initializes namespaceReplacementPolicyComboBox
*
* @return javax.swing.JComboBox
*/
|
This method initializes namespaceReplacementPolicyComboBox
|
getNamespaceReplacementPolicyComboBox
|
{
"repo_name": "NCIP/cagrid-core",
"path": "caGrid/projects/introduce/src/java/Portal/gov/nih/nci/cagrid/introduce/portal/configuration/IntroducePortalConfigurationPanel.java",
"license": "bsd-3-clause",
"size": 11686
}
|
[
"java.awt.event.ActionListener",
"javax.swing.JComboBox"
] |
import java.awt.event.ActionListener; import javax.swing.JComboBox;
|
import java.awt.event.*; import javax.swing.*;
|
[
"java.awt",
"javax.swing"
] |
java.awt; javax.swing;
| 70,441 |
public static RepositoryName create(String name) throws TargetParsingException {
try {
return repositoryNameCache.get(name);
} catch (ExecutionException e) {
Throwables.propagateIfInstanceOf(e.getCause(), TargetParsingException.class);
throw new IllegalStateException("Failed to create RepositoryName from " + name, e);
}
}
private final String name;
private RepositoryName(String name) {
this.name = name;
}
|
static RepositoryName function(String name) throws TargetParsingException { try { return repositoryNameCache.get(name); } catch (ExecutionException e) { Throwables.propagateIfInstanceOf(e.getCause(), TargetParsingException.class); throw new IllegalStateException(STR + name, e); } } private final String name; private RepositoryName(String name) { this.name = name; }
|
/**
* Makes sure that name is a valid repository name and creates a new RepositoryName using it.
* @throws TargetParsingException if the name is invalid.
*/
|
Makes sure that name is a valid repository name and creates a new RepositoryName using it
|
create
|
{
"repo_name": "wakashige/bazel",
"path": "src/main/java/com/google/devtools/build/lib/cmdline/PackageIdentifier.java",
"license": "apache-2.0",
"size": 11400
}
|
[
"com.google.common.base.Throwables",
"java.util.concurrent.ExecutionException"
] |
import com.google.common.base.Throwables; import java.util.concurrent.ExecutionException;
|
import com.google.common.base.*; import java.util.concurrent.*;
|
[
"com.google.common",
"java.util"
] |
com.google.common; java.util;
| 2,075,445 |
public void setStep( int i, StepMeta stepMeta ) {
StepMetaInterface iface = stepMeta.getStepMetaInterface();
if ( iface instanceof StepMetaChangeListenerInterface ) {
addStepChangeListener( i, (StepMetaChangeListenerInterface) stepMeta.getStepMetaInterface() );
}
steps.set( i, stepMeta );
stepMeta.setParentTransMeta( this );
clearCaches();
}
|
void function( int i, StepMeta stepMeta ) { StepMetaInterface iface = stepMeta.getStepMetaInterface(); if ( iface instanceof StepMetaChangeListenerInterface ) { addStepChangeListener( i, (StepMetaChangeListenerInterface) stepMeta.getStepMetaInterface() ); } steps.set( i, stepMeta ); stepMeta.setParentTransMeta( this ); clearCaches(); }
|
/**
* Changes the content of a step on a certain position. This is accomplished by setting the step's metadata at the
* specified index to the specified meta-data object. The new step's parent transformation is updated to be this
* transformation.
*
* @param i
* The index into the steps list
* @param stepMeta
* The step meta-data to set
*/
|
Changes the content of a step on a certain position. This is accomplished by setting the step's metadata at the specified index to the specified meta-data object. The new step's parent transformation is updated to be this transformation
|
setStep
|
{
"repo_name": "Advent51/pentaho-kettle",
"path": "engine/src/main/java/org/pentaho/di/trans/TransMeta.java",
"license": "apache-2.0",
"size": 225587
}
|
[
"org.pentaho.di.trans.step.StepMeta",
"org.pentaho.di.trans.step.StepMetaChangeListenerInterface",
"org.pentaho.di.trans.step.StepMetaInterface"
] |
import org.pentaho.di.trans.step.StepMeta; import org.pentaho.di.trans.step.StepMetaChangeListenerInterface; import org.pentaho.di.trans.step.StepMetaInterface;
|
import org.pentaho.di.trans.step.*;
|
[
"org.pentaho.di"
] |
org.pentaho.di;
| 2,712,946 |
@Transient
public List<MatrixElement> getElementsReadOnly() {
return Collections.unmodifiableList(getElements());
}
|
List<MatrixElement> function() { return Collections.unmodifiableList(getElements()); }
|
/**
* Return a read only set of matrix elements.
*
* @return
*/
|
Return a read only set of matrix elements
|
getElementsReadOnly
|
{
"repo_name": "TreeBASE/treebasetest",
"path": "treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixRow.java",
"license": "bsd-3-clause",
"size": 11378
}
|
[
"java.util.Collections",
"java.util.List"
] |
import java.util.Collections; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,241,867 |
public static MetadataColumn metadata(
String name, DataType type, @Nullable String metadataAlias, boolean isVirtual) {
Preconditions.checkNotNull(name, "Column name can not be null.");
Preconditions.checkNotNull(type, "Column type can not be null.");
return new MetadataColumn(name, type, metadataAlias, isVirtual);
}
|
static MetadataColumn function( String name, DataType type, @Nullable String metadataAlias, boolean isVirtual) { Preconditions.checkNotNull(name, STR); Preconditions.checkNotNull(type, STR); return new MetadataColumn(name, type, metadataAlias, isVirtual); }
|
/**
* Creates a metadata column from metadata of the given column name or from metadata of the
* given alias (if not null).
*
* <p>Allows to specify whether the column is virtual or not.
*/
|
Creates a metadata column from metadata of the given column name or from metadata of the given alias (if not null). Allows to specify whether the column is virtual or not
|
metadata
|
{
"repo_name": "tillrohrmann/flink",
"path": "flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/TableColumn.java",
"license": "apache-2.0",
"size": 10196
}
|
[
"javax.annotation.Nullable",
"org.apache.flink.table.types.DataType",
"org.apache.flink.util.Preconditions"
] |
import javax.annotation.Nullable; import org.apache.flink.table.types.DataType; import org.apache.flink.util.Preconditions;
|
import javax.annotation.*; import org.apache.flink.table.types.*; import org.apache.flink.util.*;
|
[
"javax.annotation",
"org.apache.flink"
] |
javax.annotation; org.apache.flink;
| 13,242 |
@Override
protected Void visit(Expression node, ExpressionVisitor mv) {
assert result != null : "array-comprehension generator not initialised";
expressionBoxedValue(node, mv);
mv.load(result);
mv.swap();
mv.invoke(Methods.ArrayList_add);
mv.pop();
return null;
}
|
Void function(Expression node, ExpressionVisitor mv) { assert result != null : STR; expressionBoxedValue(node, mv); mv.load(result); mv.swap(); mv.invoke(Methods.ArrayList_add); mv.pop(); return null; }
|
/**
* 12.1.4.2.3 Runtime Semantics: ComprehensionEvaluation
* <p>
* ComprehensionTail : AssignmentExpression
*/
|
12.1.4.2.3 Runtime Semantics: ComprehensionEvaluation ComprehensionTail : AssignmentExpression
|
visit
|
{
"repo_name": "rwaldron/es6draft",
"path": "src/main/java/com/github/anba/es6draft/compiler/ArrayComprehensionGenerator.java",
"license": "mit",
"size": 2930
}
|
[
"com.github.anba.es6draft.ast.Expression",
"java.util.ArrayList"
] |
import com.github.anba.es6draft.ast.Expression; import java.util.ArrayList;
|
import com.github.anba.es6draft.ast.*; import java.util.*;
|
[
"com.github.anba",
"java.util"
] |
com.github.anba; java.util;
| 1,599,091 |
public synchronized boolean compareLeftAndSet(L expectLeft, L newLeft, R newRight) {
if ((null == expectLeft) != (null == this.left)) {
return false;
}
// Current and expected values are either both null, or both non-null
if ((null == this.left) || Objects.equals(this.left, expectLeft)) {
this.left = newLeft;
this.right = newRight;
return true;
}
return false;
}
|
synchronized boolean function(L expectLeft, L newLeft, R newRight) { if ((null == expectLeft) != (null == this.left)) { return false; } if ((null == this.left) Objects.equals(this.left, expectLeft)) { this.left = newLeft; this.right = newRight; return true; } return false; }
|
/**
* Compare left and set.
*
* @param expectLeft the expect left
* @param newLeft the new left
* @param newRight the new right
* @return the boolean
*/
|
Compare left and set
|
compareLeftAndSet
|
{
"repo_name": "bbobcik/auderis-tools",
"path": "core/src/main/java/cz/auderis/tools/collection/tuple/AtomicPair.java",
"license": "apache-2.0",
"size": 6737
}
|
[
"java.util.Objects"
] |
import java.util.Objects;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 829,782 |
public void testSumThenReset() {
DoubleAdder ai = new DoubleAdder();
ai.add(2.0);
assertEquals(2.0, ai.sum());
assertEquals(2.0, ai.sumThenReset());
assertEquals(0.0, ai.sum());
}
|
void function() { DoubleAdder ai = new DoubleAdder(); ai.add(2.0); assertEquals(2.0, ai.sum()); assertEquals(2.0, ai.sumThenReset()); assertEquals(0.0, ai.sum()); }
|
/**
* sumThenReset() returns sum; subsequent sum() returns zero
*/
|
sumThenReset() returns sum; subsequent sum() returns zero
|
testSumThenReset
|
{
"repo_name": "debian-pkg-android-tools/android-platform-libcore",
"path": "jsr166-tests/src/test/java/jsr166/DoubleAdderTest.java",
"license": "gpl-2.0",
"size": 4934
}
|
[
"java.util.concurrent.atomic.DoubleAdder"
] |
import java.util.concurrent.atomic.DoubleAdder;
|
import java.util.concurrent.atomic.*;
|
[
"java.util"
] |
java.util;
| 2,218,133 |
public void release(@Nullable ReleaseCallback callback) {
if (currentTask != null) {
currentTask.cancel(true);
}
if (callback != null) {
downloadExecutorService.execute(new ReleaseTask(callback));
}
downloadExecutorService.shutdown();
}
// LoaderErrorThrower implementation.
|
void function(@Nullable ReleaseCallback callback) { if (currentTask != null) { currentTask.cancel(true); } if (callback != null) { downloadExecutorService.execute(new ReleaseTask(callback)); } downloadExecutorService.shutdown(); }
|
/**
* Releases the {@link Loader}. This method should be called when the {@link Loader} is no longer
* required.
*
* @param callback An optional callback to be called on the loading thread once the loader has
* been released.
*/
|
Releases the <code>Loader</code>. This method should be called when the <code>Loader</code> is no longer required
|
release
|
{
"repo_name": "MaTriXy/ExoPlayer",
"path": "library/core/src/main/java/com/google/android/exoplayer2/upstream/Loader.java",
"license": "apache-2.0",
"size": 14358
}
|
[
"android.support.annotation.Nullable"
] |
import android.support.annotation.Nullable;
|
import android.support.annotation.*;
|
[
"android.support"
] |
android.support;
| 1,676,385 |
public void authorize(final String acsUrl, final String creq, final String md, final String paReq, final String threeDSSessionData, final String postbackUrl) {
postbackHandled.set(false);
if (authorizationListener != null) {
authorizationListener.onAuthorizationStarted(this);
}
if (!TextUtils.isEmpty(postbackUrl)) {
this.postbackUrl = postbackUrl;
}
String postParams;
try {
if (creq != null) {
// 3-D Secure v2
is3dsV2 = true;
postParams = String.format(Locale.US, "creq=%1$s&threeDSSessionData=%2$s", URLEncoder.encode(creq, "UTF-8"), URLEncoder.encode(threeDSSessionData, "UTF-8"));
} else {
// 3-D Secure v1
postParams = String.format(Locale.US, "MD=%1$s&TermUrl=%2$s&PaReq=%3$s", URLEncoder.encode(md, "UTF-8"), URLEncoder.encode(this.postbackUrl, "UTF-8"), URLEncoder.encode(paReq, "UTF-8"));
}
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
postUrl(acsUrl, postParams.getBytes());
}
class D3SJSInterface {
D3SJSInterface() {
}
|
void function(final String acsUrl, final String creq, final String md, final String paReq, final String threeDSSessionData, final String postbackUrl) { postbackHandled.set(false); if (authorizationListener != null) { authorizationListener.onAuthorizationStarted(this); } if (!TextUtils.isEmpty(postbackUrl)) { this.postbackUrl = postbackUrl; } String postParams; try { if (creq != null) { is3dsV2 = true; postParams = String.format(Locale.US, STR, URLEncoder.encode(creq, "UTF-8"), URLEncoder.encode(threeDSSessionData, "UTF-8")); } else { postParams = String.format(Locale.US, STR, URLEncoder.encode(md, "UTF-8"), URLEncoder.encode(this.postbackUrl, "UTF-8"), URLEncoder.encode(paReq, "UTF-8")); } } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } postUrl(acsUrl, postParams.getBytes()); } class D3SJSInterface { D3SJSInterface() { }
|
/**
* Starts 3DS authorization
*
* @param acsUrl ACS server url, returned by the credit card processing gateway
* @param creq CReq parameter (replaces MD and PaReq).
* @param md MD parameter, returned by the credit card processing gateway
* @param paReq PaReq parameter, returned by the credit card processing gateway
* @param postbackUrl custom postback url for intercepting ACS server result posting. You may use any url you like
* here, if you need, even non existing ones.
*/
|
Starts 3DS authorization
|
authorize
|
{
"repo_name": "LivotovLabs/3DSView",
"path": "3DSView/src/main/java/eu/livotov/labs/android/d3s/D3SView.java",
"license": "apache-2.0",
"size": 11134
}
|
[
"android.text.TextUtils",
"java.io.UnsupportedEncodingException",
"java.net.URLEncoder",
"java.util.Locale"
] |
import android.text.TextUtils; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.Locale;
|
import android.text.*; import java.io.*; import java.net.*; import java.util.*;
|
[
"android.text",
"java.io",
"java.net",
"java.util"
] |
android.text; java.io; java.net; java.util;
| 586,113 |
public static String getNextASiCEManifestName(final String expectedManifestName, final List<DSSDocument> existingManifests) {
List<String> manifestNames = getDSSDocumentNames(existingManifests);
String manifestName = null;
for (int i = 0; i < existingManifests.size() + 1; i++) {
String suffix = i == 0 ? Utils.EMPTY_STRING : String.valueOf(i);
manifestName = META_INF_FOLDER + expectedManifestName + suffix + XML_EXTENSION;
if (isValidName(manifestName, manifestNames)) {
break;
}
}
return manifestName;
}
|
static String function(final String expectedManifestName, final List<DSSDocument> existingManifests) { List<String> manifestNames = getDSSDocumentNames(existingManifests); String manifestName = null; for (int i = 0; i < existingManifests.size() + 1; i++) { String suffix = i == 0 ? Utils.EMPTY_STRING : String.valueOf(i); manifestName = META_INF_FOLDER + expectedManifestName + suffix + XML_EXTENSION; if (isValidName(manifestName, manifestNames)) { break; } } return manifestName; }
|
/**
* Generates an unique name for a new ASiC-E Manifest file, avoiding any name collision
* @param expectedManifestName {@link String} defines the expected name of the file without extension (e.g. "ASiCmanifest")
* @param existingManifests list of existing {@link DSSDocument} manifests of the type present in the container
* @return {@link String} new manifest name
*/
|
Generates an unique name for a new ASiC-E Manifest file, avoiding any name collision
|
getNextASiCEManifestName
|
{
"repo_name": "openlimit-signcubes/dss",
"path": "dss-asic-common/src/main/java/eu/europa/esig/dss/asic/common/ASiCUtils.java",
"license": "lgpl-2.1",
"size": 17035
}
|
[
"eu.europa.esig.dss.model.DSSDocument",
"eu.europa.esig.dss.utils.Utils",
"java.util.List"
] |
import eu.europa.esig.dss.model.DSSDocument; import eu.europa.esig.dss.utils.Utils; import java.util.List;
|
import eu.europa.esig.dss.model.*; import eu.europa.esig.dss.utils.*; import java.util.*;
|
[
"eu.europa.esig",
"java.util"
] |
eu.europa.esig; java.util;
| 2,740,589 |
@Override
public void onReceive(Object message) throws IOException {
if (message instanceof String && ((String)message).equals(AppMsgFeeder.MSG_FEED_NOW)) {
Map<String, Object> newFeed = super.getMsgFeeder().apply();
if (super.getClient().getClientID()!=null)
newFeed.put(MsgTranslator.MSG_APPLICATION_ID, super.getClient().getClientID());
Message[] newFeedMsgs = ((MsgTranslator)super.getTranslator()).encode(newFeed);
for (Message newFeedMsg : newFeedMsgs) {
newFeedMsg.setSubject(subject);
connection.publish(newFeedMsg);
}
} else
unhandled(message);
}
|
void function(Object message) throws IOException { if (message instanceof String && ((String)message).equals(AppMsgFeeder.MSG_FEED_NOW)) { Map<String, Object> newFeed = super.getMsgFeeder().apply(); if (super.getClient().getClientID()!=null) newFeed.put(MsgTranslator.MSG_APPLICATION_ID, super.getClient().getClientID()); Message[] newFeedMsgs = ((MsgTranslator)super.getTranslator()).encode(newFeed); for (Message newFeedMsg : newFeedMsgs) { newFeedMsg.setSubject(subject); connection.publish(newFeedMsg); } } else unhandled(message); }
|
/**
* {@link akka.actor.UntypedActor#onReceive(Object)} implementation.
* if message is {@link net.echinopsii.ariane.community.messaging.api.AppMsgFeeder#MSG_FEED_NOW} then request new message from feeder
* and publish it on this MsgFeederActor subject.
* else unhandled
*
* @param message the akka message received by actor
* @throws IOException if problem encountered while publishing message
*/
|
<code>akka.actor.UntypedActor#onReceive(Object)</code> implementation. if message is <code>net.echinopsii.ariane.community.messaging.api.AppMsgFeeder#MSG_FEED_NOW</code> then request new message from feeder and publish it on this MsgFeederActor subject. else unhandled
|
onReceive
|
{
"repo_name": "echinopsii/net.echinopsii.ariane.community.messaging",
"path": "nats/src/main/java/net/echinopsii/ariane/community/messaging/nats/MsgFeederActor.java",
"license": "agpl-3.0",
"size": 4608
}
|
[
"io.nats.client.Message",
"java.io.IOException",
"java.util.Map",
"net.echinopsii.ariane.community.messaging.api.AppMsgFeeder"
] |
import io.nats.client.Message; import java.io.IOException; import java.util.Map; import net.echinopsii.ariane.community.messaging.api.AppMsgFeeder;
|
import io.nats.client.*; import java.io.*; import java.util.*; import net.echinopsii.ariane.community.messaging.api.*;
|
[
"io.nats.client",
"java.io",
"java.util",
"net.echinopsii.ariane"
] |
io.nats.client; java.io; java.util; net.echinopsii.ariane;
| 190,568 |
@Override
public void parseChain(String basePath) {
InputStream is;
File file = null;
String simpleName = include;
try {
// first look on the classpath.
is = ClassLoader.getSystemResourceAsStream(include);
if (is != null) {
PPG.DEBUG("found " + include + " as a resource");
}
else {
// nothing was found on the class path. Try the basePath...
String fullPath =
((basePath == "") ? "" : basePath
+ System.getProperty("file.separator"))
+ include;
PPG.DEBUG("looking for " + fullPath + " as a file");
file = new File(fullPath);
is = new FileInputStream(file);
simpleName = file.getName();
}
try (InputStreamReader reader = new InputStreamReader(is)) {
Lexer lex = new Lexer(reader, simpleName);
Parser parser = new Parser(simpleName, lex);
PPG.DEBUG("parsing " + simpleName);
parser.parse();
}
parent = (Spec) Parser.getProgramNode();
is.close();
}
catch (FileNotFoundException e) {
System.err.println(PPG.HEADER + simpleName + " not found.");
System.exit(1);
}
catch (Exception e) {
System.err.println(PPG.HEADER + "Exception: " + e.getMessage());
System.exit(1);
}
parent.setChild(this);
String parentDir = null;
if (file != null) {
parentDir = file.getParent();
}
parent.parseChain(parentDir == null ? "" : parentDir);
}
|
void function(String basePath) { InputStream is; File file = null; String simpleName = include; try { is = ClassLoader.getSystemResourceAsStream(include); if (is != null) { PPG.DEBUG(STR + include + STR); } else { String fullPath = ((basePath == STRSTRfile.separatorSTRlooking for STR as a fileSTRparsing STR not found.STRException: STR" : parentDir); }
|
/**
* Parse the chain of inheritance via include files
*/
|
Parse the chain of inheritance via include files
|
parseChain
|
{
"repo_name": "liujed/polyglot-eclipse",
"path": "tools/ppg/src/ppg/spec/PPGSpec.java",
"license": "lgpl-2.1",
"size": 16352
}
|
[
"java.io.File",
"java.io.InputStream"
] |
import java.io.File; import java.io.InputStream;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 662,653 |
EAttribute getSketch_DoubleVar5();
|
EAttribute getSketch_DoubleVar5();
|
/**
* Returns the meta object for the attribute '{@link com.specmate.migration.test.baseline.testmodel.artefact.Sketch#getDoubleVar5 <em>Double Var5</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Double Var5</em>'.
* @see com.specmate.migration.test.baseline.testmodel.artefact.Sketch#getDoubleVar5()
* @see #getSketch()
* @generated
*/
|
Returns the meta object for the attribute '<code>com.specmate.migration.test.baseline.testmodel.artefact.Sketch#getDoubleVar5 Double Var5</code>'.
|
getSketch_DoubleVar5
|
{
"repo_name": "junkerm/specmate",
"path": "bundles/specmate-migration-test/src/com/specmate/migration/test/baseline/testmodel/artefact/ArtefactPackage.java",
"license": "apache-2.0",
"size": 47870
}
|
[
"org.eclipse.emf.ecore.EAttribute"
] |
import org.eclipse.emf.ecore.EAttribute;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 2,603,221 |
static void writeHBaseBool(final ChannelBuffer buf, final boolean b) {
buf.writeByte(1); // Code for Boolean.class in HbaseObjectWritable
buf.writeByte(b ? 0x01 : 0x00);
}
|
static void writeHBaseBool(final ChannelBuffer buf, final boolean b) { buf.writeByte(1); buf.writeByte(b ? 0x01 : 0x00); }
|
/**
* Writes a {@link Boolean boolean} as an HBase RPC parameter.
* @param buf The buffer to serialize the string to.
* @param b The boolean value to serialize.
*/
|
Writes a <code>Boolean boolean</code> as an HBase RPC parameter
|
writeHBaseBool
|
{
"repo_name": "SteamShon/asynchbase",
"path": "src/HBaseRpc.java",
"license": "bsd-3-clause",
"size": 52440
}
|
[
"org.jboss.netty.buffer.ChannelBuffer"
] |
import org.jboss.netty.buffer.ChannelBuffer;
|
import org.jboss.netty.buffer.*;
|
[
"org.jboss.netty"
] |
org.jboss.netty;
| 1,595,966 |
public int getCreationTime(ImageType image) {
List<Object> objList = image.getAdaptorsOrOperatingSystemOrSoftware();
if (objList != null) {
// Loop for adaptors tag
for (Object obj : objList) {
if (obj instanceof Integer) { // Creation time
return ((Integer) obj);
}
}
}
return -1;
}
|
int function(ImageType image) { List<Object> objList = image.getAdaptorsOrOperatingSystemOrSoftware(); if (objList != null) { for (Object obj : objList) { if (obj instanceof Integer) { return ((Integer) obj); } } } return -1; }
|
/**
* Returns the image creation time associated to a given image.
*
* @param image Image description
* @return
*/
|
Returns the image creation time associated to a given image
|
getCreationTime
|
{
"repo_name": "mF2C/COMPSs",
"path": "compss/runtime/config/xml/resources/src/main/java/es/bsc/compss/types/resources/ResourcesFile.java",
"license": "apache-2.0",
"size": 130588
}
|
[
"es.bsc.compss.types.resources.jaxb.ImageType",
"java.util.List"
] |
import es.bsc.compss.types.resources.jaxb.ImageType; import java.util.List;
|
import es.bsc.compss.types.resources.jaxb.*; import java.util.*;
|
[
"es.bsc.compss",
"java.util"
] |
es.bsc.compss; java.util;
| 56,442 |
public static Thread startDaemon(Thread self, String name, Closure closure) {
return createThread(name, true, closure);
}
|
static Thread function(Thread self, String name, Closure closure) { return createThread(name, true, closure); }
|
/**
* Start a daemon Thread with a given name and the given closure as
* a Runnable instance.
*
* @param self placeholder variable used by Groovy categories; ignored for default static methods
* @param name the name to give the thread
* @param closure the Runnable closure
* @return the started thread
* @since 1.6
*/
|
Start a daemon Thread with a given name and the given closure as a Runnable instance
|
startDaemon
|
{
"repo_name": "paulk-asert/groovy",
"path": "src/main/java/org/codehaus/groovy/runtime/DefaultGroovyStaticMethods.java",
"license": "apache-2.0",
"size": 11197
}
|
[
"groovy.lang.Closure"
] |
import groovy.lang.Closure;
|
import groovy.lang.*;
|
[
"groovy.lang"
] |
groovy.lang;
| 1,690,660 |
LifetimeButtonLink link = new LifetimeButtonLink(caption, null, FontAwesome.ARROW_LEFT);
addComponent(link);
}
|
LifetimeButtonLink link = new LifetimeButtonLink(caption, null, FontAwesome.ARROW_LEFT); addComponent(link); }
|
/**
* Adds a new link
* @param caption The visible link
* @param target The view we should travel to
*/
|
Adds a new link
|
addLink
|
{
"repo_name": "zuacaldeira/lifetime",
"path": "lifetime-ui/src/main/java/lifetime/component/VerticalLinksLayout.java",
"license": "unlicense",
"size": 1376
}
|
[
"com.vaadin.server.FontAwesome"
] |
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.*;
|
[
"com.vaadin.server"
] |
com.vaadin.server;
| 2,916,581 |
public void addParam(String labelName, Token token, String type) {
type = StringUtils.defaultIfBlank(type, "param");
if (type.equals("exception")) {
// if defined in the current function
String previouslyDefinedLabelType = funct.labeltype(labelName, false, false, false);
if (StringUtils.isNotEmpty(previouslyDefinedLabelType) && !previouslyDefinedLabelType.equals("exception")) {
// and has not been used yet in the current function scope
if (!state.getOption().test("node")) {
warning("W002", state.nextToken(), labelName);
}
}
if (state.isStrict() && (labelName.equals("arguments") || labelName.equals("eval"))) {
warning("E008", token);
}
}
// The variable was declared in the current scope
if (current.getLabels().containsKey(labelName)) {
current.getLabels().get(labelName).setDuplicated(true);
}
// The variable was declared in an outer scope
else {
// if this scope has the variable defined, it's a re-definition error
checkOuterShadow(labelName, token);
current.getLabels().put(labelName, new Label(type, token, false, null, true, false));
current.getParams().add(labelName);
}
if (current.getUsages().containsKey(labelName)) {
Usage usage = current.getUsages().get(labelName);
// if its in a sub function it is not necessarily an error, just latedef
if (usage.isOnlyUsedSubFunction()) {
latedefWarning(type, labelName, token);
} else {
// this is a clear illegal usage for block scoped variables
warning("E056", token, labelName, type);
}
}
}
|
void function(String labelName, Token token, String type) { type = StringUtils.defaultIfBlank(type, "param"); if (type.equals(STR)) { String previouslyDefinedLabelType = funct.labeltype(labelName, false, false, false); if (StringUtils.isNotEmpty(previouslyDefinedLabelType) && !previouslyDefinedLabelType.equals(STR)) { if (!state.getOption().test("node")) { warning("W002", state.nextToken(), labelName); } } if (state.isStrict() && (labelName.equals(STR) labelName.equals("eval"))) { warning("E008", token); } } if (current.getLabels().containsKey(labelName)) { current.getLabels().get(labelName).setDuplicated(true); } else { checkOuterShadow(labelName, token); current.getLabels().put(labelName, new Label(type, token, false, null, true, false)); current.getParams().add(labelName); } if (current.getUsages().containsKey(labelName)) { Usage usage = current.getUsages().get(labelName); if (usage.isOnlyUsedSubFunction()) { latedefWarning(type, labelName, token); } else { warning("E056", token, labelName, type); } } }
|
/**
* Add a function parameter to the current scope.
*
* @param labelName - the value of the identifier
* @param token - indetifier token
* @param type - JSHint label type; defaults to "param"
*/
|
Add a function parameter to the current scope
|
addParam
|
{
"repo_name": "jshaptic/jshint-javaport",
"path": "src/main/java/org/jshint/ScopeManager.java",
"license": "mit",
"size": 41018
}
|
[
"org.apache.commons.lang3.StringUtils"
] |
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.*;
|
[
"org.apache.commons"
] |
org.apache.commons;
| 203,679 |
public void testUpvoteQuestion() {
Question q = new Question(title, body, author, null);
int oldVotes = q.getUpvotes();
q.addUpvote();
int newVotes = q.getUpvotes();
assertEquals(oldVotes + 1, newVotes);
}
|
void function() { Question q = new Question(title, body, author, null); int oldVotes = q.getUpvotes(); q.addUpvote(); int newVotes = q.getUpvotes(); assertEquals(oldVotes + 1, newVotes); }
|
/**
* UC9 TC9.1- Upvote a Question
*/
|
UC9 TC9.1- Upvote a Question
|
testUpvoteQuestion
|
{
"repo_name": "CMPUT301F14T14/android-question-answer-app",
"path": "QuestionAppTests/src/ca/ualberta/cs/cmput301f14t14/questionapp/test/QuestionTest.java",
"license": "apache-2.0",
"size": 4264
}
|
[
"ca.ualberta.cs.cmput301f14t14.questionapp.model.Question"
] |
import ca.ualberta.cs.cmput301f14t14.questionapp.model.Question;
|
import ca.ualberta.cs.cmput301f14t14.questionapp.model.*;
|
[
"ca.ualberta.cs"
] |
ca.ualberta.cs;
| 1,236,735 |
List<Object> getCountList();
|
List<Object> getCountList();
|
/**
* Returns the value of the '<em><b>Count List</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* A space-separated list of integers or nulls.
* <!-- end-model-doc -->
* @return the value of the '<em>Count List</em>' attribute.
* @see #setCountList(List)
* @see net.opengis.gml311.Gml311Package#getDocumentRoot_CountList()
* @model unique="false" dataType="net.opengis.gml311.IntegerOrNullList" upper="-2" transient="true" volatile="true" derived="true"
* extendedMetaData="kind='element' name='CountList' namespace='##targetNamespace'"
* @generated
*/
|
Returns the value of the 'Count List' attribute. A space-separated list of integers or nulls.
|
getCountList
|
{
"repo_name": "geotools/geotools",
"path": "modules/ogc/net.opengis.wmts/src/net/opengis/gml311/DocumentRoot.java",
"license": "lgpl-2.1",
"size": 620429
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 960,261 |
static public Automaton concatenate(List<Automaton> l) {
if (l.isEmpty()) return BasicAutomata.makeEmptyString();
boolean all_singleton = true;
for (Automaton a : l)
if (!a.isSingleton()) {
all_singleton = false;
break;
}
if (all_singleton) {
StringBuilder b = new StringBuilder();
for (Automaton a : l)
b.append(a.singleton);
return BasicAutomata.makeString(b.toString());
} else {
for (Automaton a : l)
if (BasicOperations.isEmpty(a)) return BasicAutomata.makeEmpty();
Set<Integer> ids = new HashSet<Integer>();
for (Automaton a : l)
ids.add(System.identityHashCode(a));
boolean has_aliases = ids.size() != l.size();
Automaton b = l.get(0);
if (has_aliases) b = b.cloneExpanded();
else b = b.cloneExpandedIfRequired();
Set<State> ac = b.getAcceptStates();
boolean first = true;
for (Automaton a : l)
if (first) first = false;
else {
if (a.isEmptyString()) continue;
Automaton aa = a;
if (has_aliases) aa = aa.cloneExpanded();
else aa = aa.cloneExpandedIfRequired();
Set<State> ns = aa.getAcceptStates();
for (State s : ac) {
s.accept = false;
s.addEpsilon(aa.initial);
if (s.accept) ns.add(s);
}
ac = ns;
}
b.deterministic = false;
//b.clearHashCode();
b.clearNumberedStates();
b.checkMinimizeAlways();
return b;
}
}
|
static Automaton function(List<Automaton> l) { if (l.isEmpty()) return BasicAutomata.makeEmptyString(); boolean all_singleton = true; for (Automaton a : l) if (!a.isSingleton()) { all_singleton = false; break; } if (all_singleton) { StringBuilder b = new StringBuilder(); for (Automaton a : l) b.append(a.singleton); return BasicAutomata.makeString(b.toString()); } else { for (Automaton a : l) if (BasicOperations.isEmpty(a)) return BasicAutomata.makeEmpty(); Set<Integer> ids = new HashSet<Integer>(); for (Automaton a : l) ids.add(System.identityHashCode(a)); boolean has_aliases = ids.size() != l.size(); Automaton b = l.get(0); if (has_aliases) b = b.cloneExpanded(); else b = b.cloneExpandedIfRequired(); Set<State> ac = b.getAcceptStates(); boolean first = true; for (Automaton a : l) if (first) first = false; else { if (a.isEmptyString()) continue; Automaton aa = a; if (has_aliases) aa = aa.cloneExpanded(); else aa = aa.cloneExpandedIfRequired(); Set<State> ns = aa.getAcceptStates(); for (State s : ac) { s.accept = false; s.addEpsilon(aa.initial); if (s.accept) ns.add(s); } ac = ns; } b.deterministic = false; b.clearNumberedStates(); b.checkMinimizeAlways(); return b; } }
|
/**
* Returns an automaton that accepts the concatenation of the languages of the
* given automata.
* <p>
* Complexity: linear in total number of states.
*/
|
Returns an automaton that accepts the concatenation of the languages of the given automata. Complexity: linear in total number of states
|
concatenate
|
{
"repo_name": "terrancesnyder/solr-analytics",
"path": "lucene/core/src/java/org/apache/lucene/util/automaton/BasicOperations.java",
"license": "apache-2.0",
"size": 28444
}
|
[
"java.util.HashSet",
"java.util.List",
"java.util.Set"
] |
import java.util.HashSet; import java.util.List; import java.util.Set;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 771,432 |
public static OffsetDateTime toLogical(Schema schema, byte[] value) {
return OffsetDateTime.parse(new String(value, CHARSET), FORMATTER);
}
|
static OffsetDateTime function(Schema schema, byte[] value) { return OffsetDateTime.parse(new String(value, CHARSET), FORMATTER); }
|
/**
* Convert a value from its encoded format into its logical format ({@link OffsetDateTime}).
*
* @param schema the schema
* @param value the encoded value
* @return the logical value
*/
|
Convert a value from its encoded format into its logical format (<code>OffsetDateTime</code>)
|
toLogical
|
{
"repo_name": "rhauch/debezium",
"path": "debezium-core/src/main/java/io/debezium/data/IsoTimestamp.java",
"license": "apache-2.0",
"size": 3019
}
|
[
"java.time.OffsetDateTime",
"org.apache.kafka.connect.data.Schema"
] |
import java.time.OffsetDateTime; import org.apache.kafka.connect.data.Schema;
|
import java.time.*; import org.apache.kafka.connect.data.*;
|
[
"java.time",
"org.apache.kafka"
] |
java.time; org.apache.kafka;
| 455,039 |
public XmlPathConfig jaxbObjectMapperFactory(JAXBObjectMapperFactory jaxbObjectMapperFactory) {
return new XmlPathConfig(jaxbObjectMapperFactory, defaultParserType, defaultDeserializer, charset, features, declaredNamespaces,
properties, validating, namespaceAware, allowDocTypeDeclaration);
}
|
XmlPathConfig function(JAXBObjectMapperFactory jaxbObjectMapperFactory) { return new XmlPathConfig(jaxbObjectMapperFactory, defaultParserType, defaultDeserializer, charset, features, declaredNamespaces, properties, validating, namespaceAware, allowDocTypeDeclaration); }
|
/**
* Specify a custom Gson object mapper factory.
*
* @param jaxbObjectMapperFactory The object mapper factory
*/
|
Specify a custom Gson object mapper factory
|
jaxbObjectMapperFactory
|
{
"repo_name": "BenSeverson/rest-assured",
"path": "xml-path/src/main/java/io/restassured/path/xml/config/XmlPathConfig.java",
"license": "apache-2.0",
"size": 17126
}
|
[
"io.restassured.mapper.factory.JAXBObjectMapperFactory"
] |
import io.restassured.mapper.factory.JAXBObjectMapperFactory;
|
import io.restassured.mapper.factory.*;
|
[
"io.restassured.mapper"
] |
io.restassured.mapper;
| 1,464,273 |
List<ISessionHandlingAction> getSessionHandlingActions();
|
List<ISessionHandlingAction> getSessionHandlingActions();
|
/**
* This method is used to retrieve the session handling actions that are
* registered by the extension.
*
* @return A list of session handling actions that are currently registered
* by this extension.
*/
|
This method is used to retrieve the session handling actions that are registered by the extension
|
getSessionHandlingActions
|
{
"repo_name": "tomsteele/burpbuddy",
"path": "src/main/java/burp/IBurpExtenderCallbacks.java",
"license": "mit",
"size": 41643
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 869,452 |
final void replaceWith(Node parent, Node node, List<Node> replacements) {
Preconditions.checkNotNull(replacements, "\"replacements\" is null.");
int size = replacements.size();
if ((size == 1) && node.isEquivalentTo(replacements.get(0))) {
// trees are equal... don't replace
return;
}
int parentType = parent.getType();
Preconditions.checkState(size == 1 ||
parentType == Token.BLOCK ||
parentType == Token.SCRIPT ||
parentType == Token.LABEL);
if (parentType == Token.LABEL && size != 1) {
Node block = IR.block();
for (Node newChild : replacements) {
newChild.useSourceInfoIfMissingFrom(node);
block.addChildToBack(newChild);
}
parent.replaceChild(node, block);
} else {
for (Node newChild : replacements) {
newChild.useSourceInfoIfMissingFrom(node);
parent.addChildBefore(newChild, node);
}
parent.removeChild(node);
}
notifyOfRemoval(node);
}
|
final void replaceWith(Node parent, Node node, List<Node> replacements) { Preconditions.checkNotNull(replacements, "\"replacements\STR); int size = replacements.size(); if ((size == 1) && node.isEquivalentTo(replacements.get(0))) { return; } int parentType = parent.getType(); Preconditions.checkState(size == 1 parentType == Token.BLOCK parentType == Token.SCRIPT parentType == Token.LABEL); if (parentType == Token.LABEL && size != 1) { Node block = IR.block(); for (Node newChild : replacements) { newChild.useSourceInfoIfMissingFrom(node); block.addChildToBack(newChild); } parent.replaceChild(node, block); } else { for (Node newChild : replacements) { newChild.useSourceInfoIfMissingFrom(node); parent.addChildBefore(newChild, node); } parent.removeChild(node); } notifyOfRemoval(node); }
|
/**
* Replaces a node with the provided list.
*/
|
Replaces a node with the provided list
|
replaceWith
|
{
"repo_name": "mbrukman/closure-compiler",
"path": "src/com/google/javascript/jscomp/AstChangeProxy.java",
"license": "apache-2.0",
"size": 3324
}
|
[
"com.google.common.base.Preconditions",
"com.google.javascript.rhino.IR",
"com.google.javascript.rhino.Node",
"com.google.javascript.rhino.Token",
"java.util.List"
] |
import com.google.common.base.Preconditions; import com.google.javascript.rhino.IR; import com.google.javascript.rhino.Node; import com.google.javascript.rhino.Token; import java.util.List;
|
import com.google.common.base.*; import com.google.javascript.rhino.*; import java.util.*;
|
[
"com.google.common",
"com.google.javascript",
"java.util"
] |
com.google.common; com.google.javascript; java.util;
| 1,855,039 |
Set<Characteristic> findSubCharacteristicsByRootKey(String rootCharacteristicKey);
|
Set<Characteristic> findSubCharacteristicsByRootKey(String rootCharacteristicKey);
|
/**
* Return the collection of sub characteristics from a root characteristic key
*
* @throws IllegalStateException if the holder is empty
*/
|
Return the collection of sub characteristics from a root characteristic key
|
findSubCharacteristicsByRootKey
|
{
"repo_name": "jblievremont/sonarqube",
"path": "server/sonar-server/src/main/java/org/sonar/server/computation/debt/DebtModelHolder.java",
"license": "lgpl-3.0",
"size": 1620
}
|
[
"java.util.Set"
] |
import java.util.Set;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,306,505 |
public JCheckBox getOpacityCheck() {
if (cbOpacidad == null) {
cbOpacidad = new JCheckBox();
cbOpacidad.setText(PluginServices.getText(this, "activar"));
cbOpacidad.addActionListener(this);
cbOpacidad.addFocusListener(this);
}
return cbOpacidad;
}
|
JCheckBox function() { if (cbOpacidad == null) { cbOpacidad = new JCheckBox(); cbOpacidad.setText(PluginServices.getText(this, STR)); cbOpacidad.addActionListener(this); cbOpacidad.addFocusListener(this); } return cbOpacidad; }
|
/**
* This method initializes jCheckBox1
* @return javax.swing.JCheckBox
*/
|
This method initializes jCheckBox1
|
getOpacityCheck
|
{
"repo_name": "iCarto/siga",
"path": "extRasterTools-SE/src/org/gvsig/rastertools/properties/panels/TranspOpacitySliderPanel.java",
"license": "gpl-3.0",
"size": 6871
}
|
[
"com.iver.andami.PluginServices",
"javax.swing.JCheckBox"
] |
import com.iver.andami.PluginServices; import javax.swing.JCheckBox;
|
import com.iver.andami.*; import javax.swing.*;
|
[
"com.iver.andami",
"javax.swing"
] |
com.iver.andami; javax.swing;
| 1,153,143 |
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<PrivateEndpointConnectionDescriptionInner>> getWithResponseAsync(
String resourceGroupName, String resourceName, String privateEndpointConnectionName) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
}
if (privateEndpointConnectionName == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter privateEndpointConnectionName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.get(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
resourceName,
this.client.getApiVersion(),
privateEndpointConnectionName,
accept,
context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
|
@ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<PrivateEndpointConnectionDescriptionInner>> function( String resourceGroupName, String resourceName, String privateEndpointConnectionName) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (resourceName == null) { return Mono.error(new IllegalArgumentException(STR)); } if (privateEndpointConnectionName == null) { return Mono .error( new IllegalArgumentException( STR)); } final String accept = STR; return FluxUtil .withContext( context -> service .get( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, resourceName, this.client.getApiVersion(), privateEndpointConnectionName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); }
|
/**
* Gets the specified private endpoint connection associated with the service.
*
* @param resourceGroupName The name of the resource group that contains the service instance.
* @param resourceName The name of the service instance.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
* resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the specified private endpoint connection associated with the service.
*/
|
Gets the specified private endpoint connection associated with the service
|
getWithResponseAsync
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/PrivateEndpointConnectionsClientImpl.java",
"license": "mit",
"size": 56737
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.core.util.FluxUtil",
"com.azure.resourcemanager.healthcareapis.fluent.models.PrivateEndpointConnectionDescriptionInner"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.healthcareapis.fluent.models.PrivateEndpointConnectionDescriptionInner;
|
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.healthcareapis.fluent.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 653,677 |
@Override
public boolean isSplitable (JobContext job, Path file) {
return true;
}
}
static class ReconstructionMapper
extends Mapper<LongWritable, Text, Text, Text> {
protected static final Log LOG =
LogFactory.getLog(ReconstructionMapper.class);
public static final String RECONSTRUCTOR_CLASS_TAG =
"hdfs.blockintegrity.reconstructor";
private BlockReconstructor reconstructor;
public RaidProtocol raidnode;
private UnixUserGroupInformation ugi;
RaidProtocol rpcRaidnode;
private long detectTimeInput;
private String taskId;
|
boolean function (JobContext job, Path file) { return true; } } static class ReconstructionMapper extends Mapper<LongWritable, Text, Text, Text> { protected static final Log LOG = LogFactory.getLog(ReconstructionMapper.class); public static final String RECONSTRUCTOR_CLASS_TAG = STR; private BlockReconstructor reconstructor; public RaidProtocol raidnode; private UnixUserGroupInformation ugi; RaidProtocol rpcRaidnode; private long detectTimeInput; private String taskId;
|
/**
* indicates that input file can be split
*/
|
indicates that input file can be split
|
isSplitable
|
{
"repo_name": "shakamunyi/hadoop-20",
"path": "src/contrib/raid/src/java/org/apache/hadoop/raid/DistBlockIntegrityMonitor.java",
"license": "apache-2.0",
"size": 82474
}
|
[
"org.apache.commons.logging.Log",
"org.apache.commons.logging.LogFactory",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.io.LongWritable",
"org.apache.hadoop.io.Text",
"org.apache.hadoop.mapreduce.JobContext",
"org.apache.hadoop.mapreduce.Mapper",
"org.apache.hadoop.raid.protocol.RaidProtocol",
"org.apache.hadoop.security.UnixUserGroupInformation"
] |
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.JobContext; import org.apache.hadoop.mapreduce.Mapper; import org.apache.hadoop.raid.protocol.RaidProtocol; import org.apache.hadoop.security.UnixUserGroupInformation;
|
import org.apache.commons.logging.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.io.*; import org.apache.hadoop.mapreduce.*; import org.apache.hadoop.raid.protocol.*; import org.apache.hadoop.security.*;
|
[
"org.apache.commons",
"org.apache.hadoop"
] |
org.apache.commons; org.apache.hadoop;
| 1,635,177 |
private JSONObject moveFile(File srcFile, File destFile) throws IOException, JSONException, InvalidModificationException {
// Renaming a file to an existing directory should fail
if (destFile.exists() && destFile.isDirectory()) {
throw new InvalidModificationException("Can't rename a file to a directory");
}
// Try to rename the file
if (!srcFile.renameTo(destFile)) {
// Trying to rename the file failed. Possibly because we moved across file system on the device.
// Now we have to do things the hard way
// 1) Copy all the old file
// 2) delete the src file
copyAction(srcFile, destFile);
if (destFile.exists()) {
srcFile.delete();
} else {
throw new IOException("moved failed");
}
}
return makeEntryForFile(destFile);
}
|
JSONObject function(File srcFile, File destFile) throws IOException, JSONException, InvalidModificationException { if (destFile.exists() && destFile.isDirectory()) { throw new InvalidModificationException(STR); } if (!srcFile.renameTo(destFile)) { copyAction(srcFile, destFile); if (destFile.exists()) { srcFile.delete(); } else { throw new IOException(STR); } } return makeEntryForFile(destFile); }
|
/**
* Move a file
*
* @param srcFile file to be copied
* @param destFile destination to be copied to
* @return a FileEntry object
* @throws IOException
* @throws InvalidModificationException
* @throws JSONException
*/
|
Move a file
|
moveFile
|
{
"repo_name": "frangucc/gamify",
"path": "www/sandbox/pals/plugins/org.apache.cordova.file/src/android/LocalFilesystem.java",
"license": "mit",
"size": 22360
}
|
[
"java.io.File",
"java.io.IOException",
"org.json.JSONException",
"org.json.JSONObject"
] |
import java.io.File; import java.io.IOException; import org.json.JSONException; import org.json.JSONObject;
|
import java.io.*; import org.json.*;
|
[
"java.io",
"org.json"
] |
java.io; org.json;
| 997,697 |
public static void writeLines(final Collection<?> lines, final String lineEnding,
final OutputStream output, final String encoding) throws IOException {
writeLines(lines, lineEnding, output, Charsets.toCharset(encoding));
}
|
static void function(final Collection<?> lines, final String lineEnding, final OutputStream output, final String encoding) throws IOException { writeLines(lines, lineEnding, output, Charsets.toCharset(encoding)); }
|
/**
* Writes the <code>toString()</code> value of each item in a collection to
* an <code>OutputStream</code> line by line, using the specified character
* encoding and the specified line ending.
* <p/>
* Character encoding names can be found at
* <a href="http://www.iana.org/assignments/character-sets">IANA</a>.
*
* @param lines the lines to write, null entries produce blank lines
* @param lineEnding the line separator to use, null is system default
* @param output the <code>OutputStream</code> to write to, not null, not closed
* @param encoding the encoding to use, null means platform default
* @throws NullPointerException if the output is null
* @throws IOException if an I/O error occurs
* @throws java.nio.charset.UnsupportedCharsetException thrown instead of {@link java.io
* .UnsupportedEncodingException} in version 2.2 if the
* encoding is not supported.
* @since 1.1
*/
|
Writes the <code>toString()</code> value of each item in a collection to an <code>OutputStream</code> line by line, using the specified character encoding and the specified line ending. Character encoding names can be found at IANA
|
writeLines
|
{
"repo_name": "8enet/apkeditor",
"path": "src/main/java/com/zzzmode/apkeditor/utils/IOUtils.java",
"license": "gpl-3.0",
"size": 110244
}
|
[
"java.io.IOException",
"java.io.OutputStream",
"java.util.Collection"
] |
import java.io.IOException; import java.io.OutputStream; import java.util.Collection;
|
import java.io.*; import java.util.*;
|
[
"java.io",
"java.util"
] |
java.io; java.util;
| 23,688 |
private ArrayList<Integer> getListOfCols(ArrayList<GridPos> list) {
ArrayList<Integer> result = new ArrayList<Integer>();
for (GridPos pos : list) {
result.add(pos.getCol());
}
return result;
}
|
ArrayList<Integer> function(ArrayList<GridPos> list) { ArrayList<Integer> result = new ArrayList<Integer>(); for (GridPos pos : list) { result.add(pos.getCol()); } return result; }
|
/**
* Gets a list of every column index for every GridPos in a list
* @param list the list to extract the row indices from
* @return an ArrayList of Integers with every column index in the original list
*/
|
Gets a list of every column index for every GridPos in a list
|
getListOfCols
|
{
"repo_name": "stutonk/shinro",
"path": "shinro/ShinroSolver.java",
"license": "mit",
"size": 29837
}
|
[
"java.util.ArrayList"
] |
import java.util.ArrayList;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,173,791 |
@Test
public void reportMessageTest9() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x44,
0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object //LSP Object
0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
(byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
(byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
0x07, 0x10, 0x00, 0x14, //ERO Object
0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00};
byte[] testReportMsg = {0};
ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
buffer.writeBytes(reportMsg);
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
message = reader.readFrom(buffer);
assertThat(message, instanceOf(PcepReportMsg.class));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
int readLen = buf.writerIndex();
testReportMsg = new byte[readLen];
buf.readBytes(testReportMsg, 0, readLen);
assertThat(testReportMsg, is(reportMsg));
}
|
void function() throws PcepParseException, PcepOutOfBoundMessageException { byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x44, 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, 0x00, 0x12, 0x00, 0x10, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00, 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00}; byte[] testReportMsg = {0}; ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); buffer.writeBytes(reportMsg); PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); PcepMessage message = null; message = reader.readFrom(buffer); assertThat(message, instanceOf(PcepReportMsg.class)); ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); message.writeTo(buf); int readLen = buf.writerIndex(); testReportMsg = new byte[readLen]; buf.readBytes(testReportMsg, 0, readLen); assertThat(testReportMsg, is(reportMsg)); }
|
/**
* This test case checks for LSP Object(Symbolic path tlv, StatefulIPv4LspIdentidiersTlv,
* StatefulLspErrorCodeTlv ),ERO Object
* in PcRpt message.
*/
|
This test case checks for LSP Object(Symbolic path tlv, StatefulIPv4LspIdentidiersTlv, StatefulLspErrorCodeTlv ),ERO Object in PcRpt message
|
reportMessageTest9
|
{
"repo_name": "donNewtonAlpha/onos",
"path": "protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepReportMsgTest.java",
"license": "apache-2.0",
"size": 76875
}
|
[
"org.hamcrest.MatcherAssert",
"org.hamcrest.Matchers",
"org.hamcrest.core.Is",
"org.jboss.netty.buffer.ChannelBuffer",
"org.jboss.netty.buffer.ChannelBuffers",
"org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException",
"org.onosproject.pcepio.exceptions.PcepParseException"
] |
import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.hamcrest.core.Is; import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException; import org.onosproject.pcepio.exceptions.PcepParseException;
|
import org.hamcrest.*; import org.hamcrest.core.*; import org.jboss.netty.buffer.*; import org.onosproject.pcepio.exceptions.*;
|
[
"org.hamcrest",
"org.hamcrest.core",
"org.jboss.netty",
"org.onosproject.pcepio"
] |
org.hamcrest; org.hamcrest.core; org.jboss.netty; org.onosproject.pcepio;
| 506,276 |
public void freeRemoteSession() throws RemoteException
{
try {
if (m_database.getTableCount() == 0)
m_database.free(); // Free if this is my private database, or there are no tables left
} catch (Exception ex) {
ex.printStackTrace();
}
super.freeRemoteSession();
}
|
void function() throws RemoteException { try { if (m_database.getTableCount() == 0) m_database.free(); } catch (Exception ex) { ex.printStackTrace(); } super.freeRemoteSession(); }
|
/**
* Free the objects.
* This method is called from the remote client, and frees this session.
*/
|
Free the objects. This method is called from the remote client, and frees this session
|
freeRemoteSession
|
{
"repo_name": "jbundle/jbundle",
"path": "base/remote/src/main/java/org/jbundle/base/remote/db/DatabaseSession.java",
"license": "gpl-3.0",
"size": 4718
}
|
[
"org.jbundle.model.RemoteException"
] |
import org.jbundle.model.RemoteException;
|
import org.jbundle.model.*;
|
[
"org.jbundle.model"
] |
org.jbundle.model;
| 1,174,240 |
private void addLangSection(Composite parent) {
Label descr = new Label(parent, SWT.LEFT | SWT.WRAP);
descr.setLayoutData(new GridData());
descr.setText(TexlipsePlugin.getResourceString("propertiesLanguageDescription"));
Composite composite = createDefaultComposite(parent, 2);
Label label = new Label(composite, SWT.LEFT);
label.setLayoutData(new GridData());
label.setText(TexlipsePlugin.getResourceString("propertiesLanguage"));
languageField = new Text(composite, SWT.SINGLE | SWT.BORDER);
languageField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
languageField.setTextLimit(2);
new AutoCompleteField(languageField, new TextContentAdapter(), Locale.getISOLanguages());
}
|
void function(Composite parent) { Label descr = new Label(parent, SWT.LEFT SWT.WRAP); descr.setLayoutData(new GridData()); descr.setText(TexlipsePlugin.getResourceString(STR)); Composite composite = createDefaultComposite(parent, 2); Label label = new Label(composite, SWT.LEFT); label.setLayoutData(new GridData()); label.setText(TexlipsePlugin.getResourceString(STR)); languageField = new Text(composite, SWT.SINGLE SWT.BORDER); languageField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); languageField.setTextLimit(2); new AutoCompleteField(languageField, new TextContentAdapter(), Locale.getISOLanguages()); }
|
/**
* Create a text field for language setting.
* @param parent parent component
*/
|
Create a text field for language setting
|
addLangSection
|
{
"repo_name": "rondiplomatico/texlipse",
"path": "source/net/sourceforge/texlipse/properties/TexlipseProjectPropertyPage.java",
"license": "epl-1.0",
"size": 24533
}
|
[
"java.util.Locale",
"net.sourceforge.texlipse.TexlipsePlugin",
"org.eclipse.jface.fieldassist.AutoCompleteField",
"org.eclipse.jface.fieldassist.TextContentAdapter",
"org.eclipse.swt.layout.GridData",
"org.eclipse.swt.widgets.Composite",
"org.eclipse.swt.widgets.Label",
"org.eclipse.swt.widgets.Text"
] |
import java.util.Locale; import net.sourceforge.texlipse.TexlipsePlugin; import org.eclipse.jface.fieldassist.AutoCompleteField; import org.eclipse.jface.fieldassist.TextContentAdapter; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text;
|
import java.util.*; import net.sourceforge.texlipse.*; import org.eclipse.jface.fieldassist.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*;
|
[
"java.util",
"net.sourceforge.texlipse",
"org.eclipse.jface",
"org.eclipse.swt"
] |
java.util; net.sourceforge.texlipse; org.eclipse.jface; org.eclipse.swt;
| 1,729,237 |
public synchronized void setImage(java.awt.image.BufferedImage image) {
this.panel_image = image;
//force image repainting
if (user_defined_scale) {
image_needs_repaint = true;
} //Reset the scale to force repaint, only if the sacle is not user defined
else {
resize_factor = -1;
}
if (image != null) {
this.setPreferredSize(new java.awt.Dimension((int) (panel_image.getWidth() * resize_factor), (int) (panel_image.getHeight() * resize_factor)));
}
}
|
synchronized void function(java.awt.image.BufferedImage image) { this.panel_image = image; if (user_defined_scale) { image_needs_repaint = true; } else { resize_factor = -1; } if (image != null) { this.setPreferredSize(new java.awt.Dimension((int) (panel_image.getWidth() * resize_factor), (int) (panel_image.getHeight() * resize_factor))); } }
|
/**Sets the panel picture to be displayed. Note that after this for display the panel needs repaiting.
*@param image panel to display in the panel.
*/
|
Sets the panel picture to be displayed. Note that after this for display the panel needs repaiting
|
setImage
|
{
"repo_name": "rti-capture/rti-chi",
"path": "components/RTIbuilder/GUIcomponents/src/guicomponents/PreviewPanel.java",
"license": "gpl-3.0",
"size": 5896
}
|
[
"java.awt.image.BufferedImage"
] |
import java.awt.image.BufferedImage;
|
import java.awt.image.*;
|
[
"java.awt"
] |
java.awt;
| 628,656 |
public void testGetRaSpan()
{
assertNull(this.getFixture().getRaSpan());
RAText raText= relANNISFactory.eINSTANCE.createRAText();
raText.setRaText("This is a sample text");
RADocumentGraph raDocGraph= relANNISFactory.eINSTANCE.createRADocumentGraph();
raDocGraph.addSNode(raText);
this.getFixture().setRaText(raText);
this.getFixture().setRaLeft(0l);
this.getFixture().setRaRight(4l);
raDocGraph.addSNode(this.getFixture());
assertEquals("This", this.getFixture().getRaSpan());
// assertNull(this.getFixture().getRaSpan());
// String span = "The text which is overlapped by this node.";
// this.getFixture().setRaSpan(span);
// assertEquals(span, this.getFixture().getRaSpan());
}
|
void function() { assertNull(this.getFixture().getRaSpan()); RAText raText= relANNISFactory.eINSTANCE.createRAText(); raText.setRaText(STR); RADocumentGraph raDocGraph= relANNISFactory.eINSTANCE.createRADocumentGraph(); raDocGraph.addSNode(raText); this.getFixture().setRaText(raText); this.getFixture().setRaLeft(0l); this.getFixture().setRaRight(4l); raDocGraph.addSNode(this.getFixture()); assertEquals("This", this.getFixture().getRaSpan()); }
|
/**
* Tests the '{@link de.hub.corpling.relANNIS.RANode#getRaSpan() <em>Ra Span</em>}' feature getter.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see de.hub.corpling.relANNIS.RANode#getRaSpan()
*/
|
Tests the '<code>de.hub.corpling.relANNIS.RANode#getRaSpan() Ra Span</code>' feature getter.
|
testGetRaSpan
|
{
"repo_name": "korpling/pepperModules-RelANNISModules",
"path": "src/test/java/de/hu_berlin/german/korpling/saltnpepper/misc/relANNIS/tests/RANodeTest.java",
"license": "apache-2.0",
"size": 15474
}
|
[
"de.hu_berlin.german.korpling.saltnpepper.misc.relANNIS.RADocumentGraph",
"de.hu_berlin.german.korpling.saltnpepper.misc.relANNIS.RAText"
] |
import de.hu_berlin.german.korpling.saltnpepper.misc.relANNIS.RADocumentGraph; import de.hu_berlin.german.korpling.saltnpepper.misc.relANNIS.RAText;
|
import de.hu_berlin.german.korpling.saltnpepper.misc.*;
|
[
"de.hu_berlin.german"
] |
de.hu_berlin.german;
| 1,696,604 |
public static IVariableBinding findFieldInType(ITypeBinding type, String fieldName) {
if (type.isPrimitive())
return null;
IVariableBinding[] fields= type.getDeclaredFields();
for (int i= 0; i < fields.length; i++) {
IVariableBinding field= fields[i];
if (field.getName().equals(fieldName))
return field;
}
return null;
}
|
static IVariableBinding function(ITypeBinding type, String fieldName) { if (type.isPrimitive()) return null; IVariableBinding[] fields= type.getDeclaredFields(); for (int i= 0; i < fields.length; i++) { IVariableBinding field= fields[i]; if (field.getName().equals(fieldName)) return field; } return null; }
|
/**
* Finds the field specified by <code>fieldName</code> in
* the given <code>type</code>. Returns <code>null</code> if no such field exits.
* @param type the type to search the field in
* @param fieldName the field name
* @return the binding representing the field or <code>null</code>
*/
|
Finds the field specified by <code>fieldName</code> in the given <code>type</code>. Returns <code>null</code> if no such field exits
|
findFieldInType
|
{
"repo_name": "eclipse/flux",
"path": "org.eclipse.flux.jdt.service/jdt ui/org/eclipse/jdt/internal/corext/dom/Bindings.java",
"license": "bsd-3-clause",
"size": 58046
}
|
[
"org.eclipse.jdt.core.dom.ITypeBinding",
"org.eclipse.jdt.core.dom.IVariableBinding"
] |
import org.eclipse.jdt.core.dom.ITypeBinding; import org.eclipse.jdt.core.dom.IVariableBinding;
|
import org.eclipse.jdt.core.dom.*;
|
[
"org.eclipse.jdt"
] |
org.eclipse.jdt;
| 2,880,166 |
MapBuilder<K, V> keyMapper( UnaryOperator<K> keyMapper );
|
MapBuilder<K, V> keyMapper( UnaryOperator<K> keyMapper );
|
/**
* Make the map apply a mapping function on it's keys when performing lookup's, puts etc
*
* @param keyMapper key mapper
*
* @return
*/
|
Make the map apply a mapping function on it's keys when performing lookup's, puts etc
|
keyMapper
|
{
"repo_name": "peter-mount/opendata-common",
"path": "core/src/main/java/uk/trainwatch/util/MapBuilder.java",
"license": "apache-2.0",
"size": 25469
}
|
[
"java.util.function.UnaryOperator"
] |
import java.util.function.UnaryOperator;
|
import java.util.function.*;
|
[
"java.util"
] |
java.util;
| 599,837 |
private MXSession logAccountAndSync(final Context context,
final String userName,
final String password,
final SessionTestParams sessionTestParams) throws InterruptedException {
final HomeServerConnectionConfig hs = createHomeServerConfig(null);
LoginRestClient loginRestClient = new LoginRestClient(hs);
final Map<String, Object> params = new HashMap<>();
CountDownLatch lock = new CountDownLatch(1);
|
MXSession function(final Context context, final String userName, final String password, final SessionTestParams sessionTestParams) throws InterruptedException { final HomeServerConnectionConfig hs = createHomeServerConfig(null); LoginRestClient loginRestClient = new LoginRestClient(hs); final Map<String, Object> params = new HashMap<>(); CountDownLatch lock = new CountDownLatch(1);
|
/**
* Start an account login
*
* @param context the context
* @param userName the account username
* @param password the password
* @param sessionTestParams session test params
*/
|
Start an account login
|
logAccountAndSync
|
{
"repo_name": "matrix-org/matrix-android-sdk",
"path": "matrix-sdk/src/androidTest/java/org/matrix/androidsdk/common/CommonTestHelper.java",
"license": "apache-2.0",
"size": 16448
}
|
[
"android.content.Context",
"java.util.HashMap",
"java.util.Map",
"java.util.concurrent.CountDownLatch",
"org.matrix.androidsdk.HomeServerConnectionConfig",
"org.matrix.androidsdk.MXSession",
"org.matrix.androidsdk.rest.client.LoginRestClient"
] |
import android.content.Context; import java.util.HashMap; import java.util.Map; import java.util.concurrent.CountDownLatch; import org.matrix.androidsdk.HomeServerConnectionConfig; import org.matrix.androidsdk.MXSession; import org.matrix.androidsdk.rest.client.LoginRestClient;
|
import android.content.*; import java.util.*; import java.util.concurrent.*; import org.matrix.androidsdk.*; import org.matrix.androidsdk.rest.client.*;
|
[
"android.content",
"java.util",
"org.matrix.androidsdk"
] |
android.content; java.util; org.matrix.androidsdk;
| 2,402,820 |
public void unloadCore(String coreName) throws RollbackedException {
solrAdminRequest("UNLOAD", coreName, produceHttpClient());
}
|
void function(String coreName) throws RollbackedException { solrAdminRequest(STR, coreName, produceHttpClient()); }
|
/**
* Unload the solr core.
*
* @param coreName
* name of the core
* @throws RollbackedException
* when producing the http client
*/
|
Unload the solr core
|
unloadCore
|
{
"repo_name": "SirmaITT/conservation-space-1.7.0",
"path": "docker/sirma-platform/platform/seip-parent/platform/tenant/tenant-audit-integration/src/main/java/com/sirma/itt/seip/tenant/audit/AuditSolrProvisioning.java",
"license": "lgpl-3.0",
"size": 15946
}
|
[
"com.sirma.itt.seip.exception.RollbackedException"
] |
import com.sirma.itt.seip.exception.RollbackedException;
|
import com.sirma.itt.seip.exception.*;
|
[
"com.sirma.itt"
] |
com.sirma.itt;
| 1,978,655 |
public void taskFinished(BuildEvent event) {
// Not significant for the class loader.
}
|
void function(BuildEvent event) { }
|
/**
* Empty implementation to satisfy the BuildListener interface.
*
* @param event the taskFinished event
*/
|
Empty implementation to satisfy the BuildListener interface
|
taskFinished
|
{
"repo_name": "bkmeneguello/jenkins",
"path": "core/src/main/java/jenkins/util/AntClassLoader.java",
"license": "mit",
"size": 58552
}
|
[
"org.apache.tools.ant.BuildEvent"
] |
import org.apache.tools.ant.BuildEvent;
|
import org.apache.tools.ant.*;
|
[
"org.apache.tools"
] |
org.apache.tools;
| 2,658,730 |
public void createItems() {
mDrawerAdapter.clearDrawerItems();
if (mAccountHeader != null) {
IProfile profile = mAccountHeader.getActiveProfile();
if (profile instanceof ProfileDrawerItem) {
mDrawerAdapter.addDrawerItem(new MiniProfileDrawerItem((ProfileDrawerItem) profile));
}
}
if (mDrawer != null) {
if (mDrawer.getDrawerItems() != null) {
ArrayList<IDrawerItem> drawerItems = mDrawer.getDrawerItems();
if (mDrawer.switchedDrawerContent()) {
drawerItems = mDrawer.getOriginalDrawerItems();
}
//migrate to miniDrawerItems
for (IDrawerItem drawerItem : drawerItems) {
if (drawerItem instanceof PrimaryDrawerItem) {
mDrawerAdapter.addDrawerItem(new MiniDrawerItem((PrimaryDrawerItem) drawerItem));
}
}
}
}
|
void function() { mDrawerAdapter.clearDrawerItems(); if (mAccountHeader != null) { IProfile profile = mAccountHeader.getActiveProfile(); if (profile instanceof ProfileDrawerItem) { mDrawerAdapter.addDrawerItem(new MiniProfileDrawerItem((ProfileDrawerItem) profile)); } } if (mDrawer != null) { if (mDrawer.getDrawerItems() != null) { ArrayList<IDrawerItem> drawerItems = mDrawer.getDrawerItems(); if (mDrawer.switchedDrawerContent()) { drawerItems = mDrawer.getOriginalDrawerItems(); } for (IDrawerItem drawerItem : drawerItems) { if (drawerItem instanceof PrimaryDrawerItem) { mDrawerAdapter.addDrawerItem(new MiniDrawerItem((PrimaryDrawerItem) drawerItem)); } } } }
|
/**
* creates the items for the MiniDrawer
*/
|
creates the items for the MiniDrawer
|
createItems
|
{
"repo_name": "hanhailong/MaterialDrawer",
"path": "library/src/main/java/com/mikepenz/materialdrawer/MiniDrawer.java",
"license": "apache-2.0",
"size": 8855
}
|
[
"com.mikepenz.materialdrawer.model.MiniDrawerItem",
"com.mikepenz.materialdrawer.model.MiniProfileDrawerItem",
"com.mikepenz.materialdrawer.model.PrimaryDrawerItem",
"com.mikepenz.materialdrawer.model.ProfileDrawerItem",
"com.mikepenz.materialdrawer.model.interfaces.IDrawerItem",
"com.mikepenz.materialdrawer.model.interfaces.IProfile",
"java.util.ArrayList"
] |
import com.mikepenz.materialdrawer.model.MiniDrawerItem; import com.mikepenz.materialdrawer.model.MiniProfileDrawerItem; import com.mikepenz.materialdrawer.model.PrimaryDrawerItem; import com.mikepenz.materialdrawer.model.ProfileDrawerItem; import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem; import com.mikepenz.materialdrawer.model.interfaces.IProfile; import java.util.ArrayList;
|
import com.mikepenz.materialdrawer.model.*; import com.mikepenz.materialdrawer.model.interfaces.*; import java.util.*;
|
[
"com.mikepenz.materialdrawer",
"java.util"
] |
com.mikepenz.materialdrawer; java.util;
| 2,375,621 |
@Test
public void testMigrationStrategyForDifferentRegistrationOrder() throws Exception {
ExecutionConfig executionConfig = new ExecutionConfig();
executionConfig.registerKryoType(TestClassA.class);
executionConfig.registerKryoType(TestClassB.class);
KryoSerializer<TestClass> kryoSerializer = new KryoSerializer<>(TestClass.class, executionConfig);
// get original registration ids
int testClassId = kryoSerializer.getKryo().getRegistration(TestClass.class).getId();
int testClassAId = kryoSerializer.getKryo().getRegistration(TestClassA.class).getId();
int testClassBId = kryoSerializer.getKryo().getRegistration(TestClassB.class).getId();
// snapshot configuration and serialize to bytes
TypeSerializerConfigSnapshot kryoSerializerConfigSnapshot = kryoSerializer.snapshotConfiguration();
byte[] serializedConfig;
try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
TypeSerializerSerializationUtil.writeSerializerConfigSnapshot(new DataOutputViewStreamWrapper(out), kryoSerializerConfigSnapshot);
serializedConfig = out.toByteArray();
}
// use new config and instantiate new KryoSerializer
executionConfig = new ExecutionConfig();
executionConfig.registerKryoType(TestClassB.class); // test with B registered before A
executionConfig.registerKryoType(TestClassA.class);
kryoSerializer = new KryoSerializer<>(TestClass.class, executionConfig);
// read configuration from bytes
try (ByteArrayInputStream in = new ByteArrayInputStream(serializedConfig)) {
kryoSerializerConfigSnapshot = TypeSerializerSerializationUtil.readSerializerConfigSnapshot(
new DataInputViewStreamWrapper(in), Thread.currentThread().getContextClassLoader());
}
// reconfigure - check reconfiguration result and that registration id remains the same
CompatibilityResult<TestClass> compatResult = kryoSerializer.ensureCompatibility(kryoSerializerConfigSnapshot);
assertFalse(compatResult.isRequiresMigration());
assertEquals(testClassId, kryoSerializer.getKryo().getRegistration(TestClass.class).getId());
assertEquals(testClassAId, kryoSerializer.getKryo().getRegistration(TestClassA.class).getId());
assertEquals(testClassBId, kryoSerializer.getKryo().getRegistration(TestClassB.class).getId());
}
private static class TestClass {}
private static class TestClassA {}
private static class TestClassB {}
|
void function() throws Exception { ExecutionConfig executionConfig = new ExecutionConfig(); executionConfig.registerKryoType(TestClassA.class); executionConfig.registerKryoType(TestClassB.class); KryoSerializer<TestClass> kryoSerializer = new KryoSerializer<>(TestClass.class, executionConfig); int testClassId = kryoSerializer.getKryo().getRegistration(TestClass.class).getId(); int testClassAId = kryoSerializer.getKryo().getRegistration(TestClassA.class).getId(); int testClassBId = kryoSerializer.getKryo().getRegistration(TestClassB.class).getId(); TypeSerializerConfigSnapshot kryoSerializerConfigSnapshot = kryoSerializer.snapshotConfiguration(); byte[] serializedConfig; try (ByteArrayOutputStream out = new ByteArrayOutputStream()) { TypeSerializerSerializationUtil.writeSerializerConfigSnapshot(new DataOutputViewStreamWrapper(out), kryoSerializerConfigSnapshot); serializedConfig = out.toByteArray(); } executionConfig = new ExecutionConfig(); executionConfig.registerKryoType(TestClassB.class); executionConfig.registerKryoType(TestClassA.class); kryoSerializer = new KryoSerializer<>(TestClass.class, executionConfig); try (ByteArrayInputStream in = new ByteArrayInputStream(serializedConfig)) { kryoSerializerConfigSnapshot = TypeSerializerSerializationUtil.readSerializerConfigSnapshot( new DataInputViewStreamWrapper(in), Thread.currentThread().getContextClassLoader()); } CompatibilityResult<TestClass> compatResult = kryoSerializer.ensureCompatibility(kryoSerializerConfigSnapshot); assertFalse(compatResult.isRequiresMigration()); assertEquals(testClassId, kryoSerializer.getKryo().getRegistration(TestClass.class).getId()); assertEquals(testClassAId, kryoSerializer.getKryo().getRegistration(TestClassA.class).getId()); assertEquals(testClassBId, kryoSerializer.getKryo().getRegistration(TestClassB.class).getId()); } private static class TestClass {} private static class TestClassA {} private static class TestClassB {}
|
/**
* Tests that after reconfiguration, registration ids are reconfigured to
* remain the same as the preceding KryoSerializer.
*/
|
Tests that after reconfiguration, registration ids are reconfigured to remain the same as the preceding KryoSerializer
|
testMigrationStrategyForDifferentRegistrationOrder
|
{
"repo_name": "zimmermatt/flink",
"path": "flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoSerializerCompatibilityTest.java",
"license": "apache-2.0",
"size": 11182
}
|
[
"java.io.ByteArrayInputStream",
"java.io.ByteArrayOutputStream",
"org.apache.flink.api.common.ExecutionConfig",
"org.apache.flink.api.common.typeutils.CompatibilityResult",
"org.apache.flink.api.common.typeutils.TypeSerializerConfigSnapshot",
"org.apache.flink.api.common.typeutils.TypeSerializerSerializationUtil",
"org.apache.flink.core.memory.DataInputViewStreamWrapper",
"org.apache.flink.core.memory.DataOutputViewStreamWrapper",
"org.junit.Assert"
] |
import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import org.apache.flink.api.common.ExecutionConfig; import org.apache.flink.api.common.typeutils.CompatibilityResult; import org.apache.flink.api.common.typeutils.TypeSerializerConfigSnapshot; import org.apache.flink.api.common.typeutils.TypeSerializerSerializationUtil; import org.apache.flink.core.memory.DataInputViewStreamWrapper; import org.apache.flink.core.memory.DataOutputViewStreamWrapper; import org.junit.Assert;
|
import java.io.*; import org.apache.flink.api.common.*; import org.apache.flink.api.common.typeutils.*; import org.apache.flink.core.memory.*; import org.junit.*;
|
[
"java.io",
"org.apache.flink",
"org.junit"
] |
java.io; org.apache.flink; org.junit;
| 40,811 |
private void compileConstructor(ClassGenerator classGen) {
MethodGenerator cons;
final InstructionList il = new InstructionList();
final ConstantPoolGen cpg = classGen.getConstantPool();
cons = new MethodGenerator(ACC_PUBLIC,
org.apache.bcel.generic.Type.VOID,
new org.apache.bcel.generic.Type[] {
Util.getJCRefType(TRANSLET_INTF_SIG),
Util.getJCRefType(DOM_INTF_SIG),
Util.getJCRefType(NODE_ITERATOR_SIG)
},
new String[] {
"dom",
"translet",
"iterator"
},
"<init>", _className, il, cpg);
il.append(ALOAD_0); // this
il.append(ALOAD_1); // translet
il.append(ALOAD_2); // DOM
il.append(new ALOAD(3));// iterator
int index = cpg.addMethodref(ClassNames[_level],
"<init>",
"(" + TRANSLET_INTF_SIG
+ DOM_INTF_SIG
+ NODE_ITERATOR_SIG
+ ")V");
il.append(new INVOKESPECIAL(index));
il.append(RETURN);
classGen.addMethod(cons);
}
|
void function(ClassGenerator classGen) { MethodGenerator cons; final InstructionList il = new InstructionList(); final ConstantPoolGen cpg = classGen.getConstantPool(); cons = new MethodGenerator(ACC_PUBLIC, org.apache.bcel.generic.Type.VOID, new org.apache.bcel.generic.Type[] { Util.getJCRefType(TRANSLET_INTF_SIG), Util.getJCRefType(DOM_INTF_SIG), Util.getJCRefType(NODE_ITERATOR_SIG) }, new String[] { "dom", STR, STR }, STR, _className, il, cpg); il.append(ALOAD_0); il.append(ALOAD_1); il.append(ALOAD_2); il.append(new ALOAD(3)); int index = cpg.addMethodref(ClassNames[_level], STR, "(" + TRANSLET_INTF_SIG + DOM_INTF_SIG + NODE_ITERATOR_SIG + ")V"); il.append(new INVOKESPECIAL(index)); il.append(RETURN); classGen.addMethod(cons); }
|
/**
* Compiles a constructor for the class <tt>_className</tt> that
* inherits from {Any,Single,Multiple}NodeCounter. This constructor
* simply calls the same constructor in the super class.
*/
|
Compiles a constructor for the class _className that inherits from {Any,Single,Multiple}NodeCounter. This constructor simply calls the same constructor in the super class
|
compileConstructor
|
{
"repo_name": "srnsw/xena",
"path": "xena/ext/src/xalan-j_2_7_1/src/org/apache/xalan/xsltc/compiler/Number.java",
"license": "gpl-3.0",
"size": 18371
}
|
[
"org.apache.bcel.generic.ConstantPoolGen",
"org.apache.bcel.generic.InstructionList",
"org.apache.xalan.xsltc.compiler.util.ClassGenerator",
"org.apache.xalan.xsltc.compiler.util.MethodGenerator",
"org.apache.xalan.xsltc.compiler.util.Type",
"org.apache.xalan.xsltc.compiler.util.Util"
] |
import org.apache.bcel.generic.ConstantPoolGen; import org.apache.bcel.generic.InstructionList; import org.apache.xalan.xsltc.compiler.util.ClassGenerator; import org.apache.xalan.xsltc.compiler.util.MethodGenerator; import org.apache.xalan.xsltc.compiler.util.Type; import org.apache.xalan.xsltc.compiler.util.Util;
|
import org.apache.bcel.generic.*; import org.apache.xalan.xsltc.compiler.util.*;
|
[
"org.apache.bcel",
"org.apache.xalan"
] |
org.apache.bcel; org.apache.xalan;
| 616,558 |
public BigDecimal getBidPrice() {
return bidPrice;
}
|
BigDecimal function() { return bidPrice; }
|
/**
* Returns the bid price
* @return bid price
*/
|
Returns the bid price
|
getBidPrice
|
{
"repo_name": "rcuprak/actionbazaar",
"path": "chapter14/src/main/java/com/actionbazaar/model/Bid.java",
"license": "apache-2.0",
"size": 3684
}
|
[
"java.math.BigDecimal"
] |
import java.math.BigDecimal;
|
import java.math.*;
|
[
"java.math"
] |
java.math;
| 2,206,943 |
@Nonnull
public java.util.concurrent.CompletableFuture<TargetedManagedAppConfiguration> deleteAsync() {
return sendAsync(HttpMethod.DELETE, null);
}
|
java.util.concurrent.CompletableFuture<TargetedManagedAppConfiguration> function() { return sendAsync(HttpMethod.DELETE, null); }
|
/**
* Delete this item from the service
*
* @return a future with the deletion result
*/
|
Delete this item from the service
|
deleteAsync
|
{
"repo_name": "microsoftgraph/msgraph-sdk-java",
"path": "src/main/java/com/microsoft/graph/requests/TargetedManagedAppConfigurationRequest.java",
"license": "mit",
"size": 7417
}
|
[
"com.microsoft.graph.http.HttpMethod",
"com.microsoft.graph.models.TargetedManagedAppConfiguration"
] |
import com.microsoft.graph.http.HttpMethod; import com.microsoft.graph.models.TargetedManagedAppConfiguration;
|
import com.microsoft.graph.http.*; import com.microsoft.graph.models.*;
|
[
"com.microsoft.graph"
] |
com.microsoft.graph;
| 946,386 |
public static MozuClient<com.mozu.api.contracts.reference.AddressSchemaCollection> getAddressSchemasClient() throws Exception
{
return getAddressSchemasClient( null);
}
|
static MozuClient<com.mozu.api.contracts.reference.AddressSchemaCollection> function() throws Exception { return getAddressSchemasClient( null); }
|
/**
* Retrieves the entire list of address schemas that the system supports.
* <p><pre><code>
* MozuClient<com.mozu.api.contracts.reference.AddressSchemaCollection> mozuClient=GetAddressSchemasClient();
* client.setBaseAddress(url);
* client.executeRequest();
* AddressSchemaCollection addressSchemaCollection = client.Result();
* </code></pre></p>
* @return Mozu.Api.MozuClient <com.mozu.api.contracts.reference.AddressSchemaCollection>
* @see com.mozu.api.contracts.reference.AddressSchemaCollection
*/
|
Retrieves the entire list of address schemas that the system supports. <code><code> MozuClient mozuClient=GetAddressSchemasClient(); client.setBaseAddress(url); client.executeRequest(); AddressSchemaCollection addressSchemaCollection = client.Result(); </code></code>
|
getAddressSchemasClient
|
{
"repo_name": "sanjaymandadi/mozu-java",
"path": "mozu-javaasync-core/src/main/java/com/mozu/api/clients/platform/ReferenceDataClient.java",
"license": "mit",
"size": 27111
}
|
[
"com.mozu.api.MozuClient"
] |
import com.mozu.api.MozuClient;
|
import com.mozu.api.*;
|
[
"com.mozu.api"
] |
com.mozu.api;
| 1,805,638 |
public List<LtSubject> findSubjectByName(String lastName, String firstName, String lsid) throws BusinessException;
|
List<LtSubject> function(String lastName, String firstName, String lsid) throws BusinessException;
|
/**
* Find Subject by last name and first name
*
* @param lastName
* @param firstName
* @throws BusinessException
*/
|
Find Subject by last name and first name
|
findSubjectByName
|
{
"repo_name": "mikheladun/mvn-ejb3-jpa",
"path": "business/src/main/java/co/adun/mvnejb3jpa/business/service/SubjectService.java",
"license": "apache-2.0",
"size": 1857
}
|
[
"co.adun.mvnejb3jpa.business.exception.BusinessException",
"co.adun.mvnejb3jpa.persistence.entity.LtSubject",
"java.util.List"
] |
import co.adun.mvnejb3jpa.business.exception.BusinessException; import co.adun.mvnejb3jpa.persistence.entity.LtSubject; import java.util.List;
|
import co.adun.mvnejb3jpa.business.exception.*; import co.adun.mvnejb3jpa.persistence.entity.*; import java.util.*;
|
[
"co.adun.mvnejb3jpa",
"java.util"
] |
co.adun.mvnejb3jpa; java.util;
| 1,236,526 |
public void endFakeDrag() {
if (!mFakeDragging) {
throw new IllegalStateException("No fake drag in progress. Call beginFakeDrag first.");
}
final VelocityTracker velocityTracker = mVelocityTracker;
velocityTracker.computeCurrentVelocity(1000, mMaximumVelocity);
int initialVelocity = (int) VelocityTrackerCompat.getXVelocity(
velocityTracker, mActivePointerId);
mPopulatePending = true;
final int width = getClientWidth();
final int scrollX = getScrollX();
final ItemInfo ii = infoForCurrentScrollPosition();
final int currentPage = ii.position;
final float pageOffset = (((float) scrollX / width) - ii.offset) / ii.widthFactor;
final int totalDelta = (int) (mLastMotionX - mInitialMotionX);
int nextPage = determineTargetPage(currentPage, pageOffset, initialVelocity,
totalDelta);
setCurrentItemInternal(nextPage, true, true, initialVelocity);
endDrag();
mFakeDragging = false;
}
|
void function() { if (!mFakeDragging) { throw new IllegalStateException(STR); } final VelocityTracker velocityTracker = mVelocityTracker; velocityTracker.computeCurrentVelocity(1000, mMaximumVelocity); int initialVelocity = (int) VelocityTrackerCompat.getXVelocity( velocityTracker, mActivePointerId); mPopulatePending = true; final int width = getClientWidth(); final int scrollX = getScrollX(); final ItemInfo ii = infoForCurrentScrollPosition(); final int currentPage = ii.position; final float pageOffset = (((float) scrollX / width) - ii.offset) / ii.widthFactor; final int totalDelta = (int) (mLastMotionX - mInitialMotionX); int nextPage = determineTargetPage(currentPage, pageOffset, initialVelocity, totalDelta); setCurrentItemInternal(nextPage, true, true, initialVelocity); endDrag(); mFakeDragging = false; }
|
/**
* End a fake drag of the pager.
*
* @see #beginFakeDrag()
* @see #fakeDragBy(float)
*/
|
End a fake drag of the pager
|
endFakeDrag
|
{
"repo_name": "mrprona92/BrawlStarsNew",
"path": "appbase/src/main/java/com/mrprona/brawlassistant/base/view/TransformableViewPager.java",
"license": "apache-2.0",
"size": 113862
}
|
[
"android.support.v4.view.VelocityTrackerCompat",
"android.view.VelocityTracker"
] |
import android.support.v4.view.VelocityTrackerCompat; import android.view.VelocityTracker;
|
import android.support.v4.view.*; import android.view.*;
|
[
"android.support",
"android.view"
] |
android.support; android.view;
| 1,002,659 |
@ServiceMethod(returns = ReturnType.SINGLE)
void restoreFiles(
String resourceGroupName,
String accountName,
String poolName,
String volumeName,
String snapshotName,
SnapshotRestoreFiles body,
Context context);
|
@ServiceMethod(returns = ReturnType.SINGLE) void restoreFiles( String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, SnapshotRestoreFiles body, Context context);
|
/**
* Restore the specified files from the specified snapshot to the active filesystem.
*
* @param resourceGroupName The name of the resource group.
* @param accountName The name of the NetApp account.
* @param poolName The name of the capacity pool.
* @param volumeName The name of the volume.
* @param snapshotName The name of the snapshot.
* @param body Restore payload supplied in the body of the operation.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
|
Restore the specified files from the specified snapshot to the active filesystem
|
restoreFiles
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/SnapshotsClient.java",
"license": "mit",
"size": 21515
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.util.Context",
"com.azure.resourcemanager.netapp.models.SnapshotRestoreFiles"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.util.Context; import com.azure.resourcemanager.netapp.models.SnapshotRestoreFiles;
|
import com.azure.core.annotation.*; import com.azure.core.util.*; import com.azure.resourcemanager.netapp.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 2,073,390 |
Map<String, ?> getRecordFields(RecordTypeT record);
|
Map<String, ?> getRecordFields(RecordTypeT record);
|
/**
* Convert a record type into a map.
*
* @param record The record.
*
* @return The map of fields destined for Elasticsearch.
*/
|
Convert a record type into a map
|
getRecordFields
|
{
"repo_name": "Miovision/awsbillingtools",
"path": "elasticsearch/src/main/java/com/miovision/oss/awsbillingtools/elasticsearch/ElasticsearchBillingRecordConverter.java",
"license": "mit",
"size": 2062
}
|
[
"java.util.Map"
] |
import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,249,203 |
private void isOverlapping(DateTime start, DateTime stop, String chargeBoxId) {
try {
int count = DSL.using(config)
.selectOne()
.from(RESERVATION)
.where(RESERVATION.EXPIRYDATETIME.greaterOrEqual(start))
.and(RESERVATION.STARTDATETIME.lessOrEqual(stop))
.and(RESERVATION.CHARGEBOXID.equal(chargeBoxId))
.execute();
if (count != 1) {
throw new SteveException("The desired reservation overlaps with another reservation");
}
} catch (DataAccessException e) {
log.error("Exception occurred", e);
}
}
|
void function(DateTime start, DateTime stop, String chargeBoxId) { try { int count = DSL.using(config) .selectOne() .from(RESERVATION) .where(RESERVATION.EXPIRYDATETIME.greaterOrEqual(start)) .and(RESERVATION.STARTDATETIME.lessOrEqual(stop)) .and(RESERVATION.CHARGEBOXID.equal(chargeBoxId)) .execute(); if (count != 1) { throw new SteveException(STR); } } catch (DataAccessException e) { log.error(STR, e); } }
|
/**
* Throws exception, if there are rows whose date/time ranges overlap with the input
*/
|
Throws exception, if there are rows whose date/time ranges overlap with the input
|
isOverlapping
|
{
"repo_name": "dtag-dev-sec/emobility",
"path": "dist/src/centralsystem/src/main/java/de/rwth/idsg/steve/repository/ReservationRepositoryImpl.java",
"license": "gpl-3.0",
"size": 7648
}
|
[
"de.rwth.idsg.steve.SteveException",
"org.joda.time.DateTime",
"org.jooq.exception.DataAccessException",
"org.jooq.impl.DSL"
] |
import de.rwth.idsg.steve.SteveException; import org.joda.time.DateTime; import org.jooq.exception.DataAccessException; import org.jooq.impl.DSL;
|
import de.rwth.idsg.steve.*; import org.joda.time.*; import org.jooq.exception.*; import org.jooq.impl.*;
|
[
"de.rwth.idsg",
"org.joda.time",
"org.jooq.exception",
"org.jooq.impl"
] |
de.rwth.idsg; org.joda.time; org.jooq.exception; org.jooq.impl;
| 1,844,426 |
public boolean hasDataElement( DataElement dataElement )
{
for ( DataSet dataSet : dataSets )
{
if ( dataSet.getDataElements().contains( dataElement ) )
{
return true;
}
}
return false;
}
|
boolean function( DataElement dataElement ) { for ( DataSet dataSet : dataSets ) { if ( dataSet.getDataElements().contains( dataElement ) ) { return true; } } return false; }
|
/**
* Indicates whether this organisation unit is associated with the given
* data element through its data set associations.
*/
|
Indicates whether this organisation unit is associated with the given data element through its data set associations
|
hasDataElement
|
{
"repo_name": "hispindia/dhis2-Core",
"path": "dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java",
"license": "bsd-3-clause",
"size": 34645
}
|
[
"org.hisp.dhis.dataelement.DataElement",
"org.hisp.dhis.dataset.DataSet"
] |
import org.hisp.dhis.dataelement.DataElement; import org.hisp.dhis.dataset.DataSet;
|
import org.hisp.dhis.dataelement.*; import org.hisp.dhis.dataset.*;
|
[
"org.hisp.dhis"
] |
org.hisp.dhis;
| 875,700 |
//details container
WebMarkupContainer messageDetailsContainer = new WebMarkupContainer("messageDetailsContainer");
messageDetailsContainer.setOutputMarkupId(true);
//thread subject
Label threadSubjectLabel = new Label("threadSubject", new Model<String>(threadSubject));
messageDetailsContainer.add(threadSubjectLabel);
add(messageDetailsContainer);
//list container
messageListContainer = new WebMarkupContainer("messageListContainer");
messageListContainer.setOutputMarkupId(true);
//get our list of messages
final MessagesDataProvider provider = new MessagesDataProvider(threadId);
messageList = new DataView<Message>("messageList", provider) {
private static final long serialVersionUID = 1L;
|
WebMarkupContainer messageDetailsContainer = new WebMarkupContainer(STR); messageDetailsContainer.setOutputMarkupId(true); Label threadSubjectLabel = new Label(STR, new Model<String>(threadSubject)); messageDetailsContainer.add(threadSubjectLabel); add(messageDetailsContainer); messageListContainer = new WebMarkupContainer(STR); messageListContainer.setOutputMarkupId(true); final MessagesDataProvider provider = new MessagesDataProvider(threadId); messageList = new DataView<Message>(STR, provider) { private static final long serialVersionUID = 1L;
|
/**
* Does the actual rendering of the page
* @param currentUserUuid
* @param threadId
* @param threadSubject
*/
|
Does the actual rendering of the page
|
renderMyMessagesView
|
{
"repo_name": "marktriggs/nyu-sakai-10.4",
"path": "profile2/tool/src/java/org/sakaiproject/profile2/tool/pages/panels/MessageView.java",
"license": "apache-2.0",
"size": 13431
}
|
[
"org.apache.wicket.markup.html.WebMarkupContainer",
"org.apache.wicket.markup.html.basic.Label",
"org.apache.wicket.markup.repeater.data.DataView",
"org.apache.wicket.model.Model",
"org.sakaiproject.profile2.model.Message",
"org.sakaiproject.profile2.tool.dataproviders.MessagesDataProvider"
] |
import org.apache.wicket.markup.html.WebMarkupContainer; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.repeater.data.DataView; import org.apache.wicket.model.Model; import org.sakaiproject.profile2.model.Message; import org.sakaiproject.profile2.tool.dataproviders.MessagesDataProvider;
|
import org.apache.wicket.markup.html.*; import org.apache.wicket.markup.html.basic.*; import org.apache.wicket.markup.repeater.data.*; import org.apache.wicket.model.*; import org.sakaiproject.profile2.model.*; import org.sakaiproject.profile2.tool.dataproviders.*;
|
[
"org.apache.wicket",
"org.sakaiproject.profile2"
] |
org.apache.wicket; org.sakaiproject.profile2;
| 346,640 |
public void setTaskExecutor(TaskExecutor taskExecutor) {
this.taskExecutor = taskExecutor;
}
|
void function(TaskExecutor taskExecutor) { this.taskExecutor = taskExecutor; }
|
/**
* Allows you to specify a custom task executor for consuming messages.
*/
|
Allows you to specify a custom task executor for consuming messages
|
setTaskExecutor
|
{
"repo_name": "curso007/camel",
"path": "components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java",
"license": "apache-2.0",
"size": 111332
}
|
[
"org.springframework.core.task.TaskExecutor"
] |
import org.springframework.core.task.TaskExecutor;
|
import org.springframework.core.task.*;
|
[
"org.springframework.core"
] |
org.springframework.core;
| 2,425,172 |
private static void validatePortNumbers(Set<String> errors, GenericKafkaListener listener) {
int port = listener.getPort();
if (FORBIDDEN_PORTS.contains(port)
|| port < LOWEST_ALLOWED_PORT_NUMBER) {
errors.add("port " + port + " is forbidden and cannot be used");
}
}
|
static void function(Set<String> errors, GenericKafkaListener listener) { int port = listener.getPort(); if (FORBIDDEN_PORTS.contains(port) port < LOWEST_ALLOWED_PORT_NUMBER) { errors.add(STR + port + STR); } }
|
/**
* Validates that the listener has an allowed port number
*
* @param errors List where any found errors will be added
* @param listener Listener which needs to be validated
*/
|
Validates that the listener has an allowed port number
|
validatePortNumbers
|
{
"repo_name": "ppatierno/kaas",
"path": "cluster-operator/src/main/java/io/strimzi/operator/cluster/model/ListenersValidator.java",
"license": "apache-2.0",
"size": 29986
}
|
[
"io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListener",
"java.util.Set"
] |
import io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListener; import java.util.Set;
|
import io.strimzi.api.kafka.model.listener.arraylistener.*; import java.util.*;
|
[
"io.strimzi.api",
"java.util"
] |
io.strimzi.api; java.util;
| 820,984 |
protected void addSessionInfo(CmsSessionInfo sessionInfo) {
if (getUserSessionMode() == UserSessionMode.standard) {
m_sessionStorageProvider.put(sessionInfo);
} else if (getUserSessionMode() == UserSessionMode.single) {
CmsUUID userId = sessionInfo.getUserId();
List<CmsSessionInfo> infos = getSessionInfos(userId);
if (infos.isEmpty()
|| ((infos.size() == 1) && infos.get(0).getSessionId().equals(sessionInfo.getSessionId()))) {
m_sessionStorageProvider.put(sessionInfo);
} else {
throw new RuntimeException("Can't create another session for the same user.");
}
}
}
|
void function(CmsSessionInfo sessionInfo) { if (getUserSessionMode() == UserSessionMode.standard) { m_sessionStorageProvider.put(sessionInfo); } else if (getUserSessionMode() == UserSessionMode.single) { CmsUUID userId = sessionInfo.getUserId(); List<CmsSessionInfo> infos = getSessionInfos(userId); if (infos.isEmpty() ((infos.size() == 1) && infos.get(0).getSessionId().equals(sessionInfo.getSessionId()))) { m_sessionStorageProvider.put(sessionInfo); } else { throw new RuntimeException(STR); } } }
|
/**
* Adds a new session info into the session storage.<p>
*
* @param sessionInfo the session info to store for the id
*/
|
Adds a new session info into the session storage
|
addSessionInfo
|
{
"repo_name": "ggiudetti/opencms-core",
"path": "src/org/opencms/main/CmsSessionManager.java",
"license": "lgpl-2.1",
"size": 30199
}
|
[
"java.util.List",
"org.opencms.configuration.CmsSystemConfiguration",
"org.opencms.util.CmsUUID"
] |
import java.util.List; import org.opencms.configuration.CmsSystemConfiguration; import org.opencms.util.CmsUUID;
|
import java.util.*; import org.opencms.configuration.*; import org.opencms.util.*;
|
[
"java.util",
"org.opencms.configuration",
"org.opencms.util"
] |
java.util; org.opencms.configuration; org.opencms.util;
| 973,105 |
protected ArrayList<HashMap<String, String>> getMessageResults(final String indexName) {
ArrayList<HashMap<String, String>> results = new ArrayList<HashMap<String, String>>();
HashMap<String, String> notification = new HashMap<String, String>();
notification.put(IConstants.CONTENTS, "No index defined for name : " + indexName);
notification.put(IConstants.FRAGMENT, "Or exception thrown during search : " + indexName);
results.add(notification);
return results;
}
|
ArrayList<HashMap<String, String>> function(final String indexName) { ArrayList<HashMap<String, String>> results = new ArrayList<HashMap<String, String>>(); HashMap<String, String> notification = new HashMap<String, String>(); notification.put(IConstants.CONTENTS, STR + indexName); notification.put(IConstants.FRAGMENT, STR + indexName); results.add(notification); return results; }
|
/**
* This method returns the default message if there is no searcher defined for the index context, or the index is not generated or
* opened.
*
* @param indexName the name of the index
* @return the message/map that will be sent to the client
*/
|
This method returns the default message if there is no searcher defined for the index context, or the index is not generated or opened
|
getMessageResults
|
{
"repo_name": "michaelcouck/ikube",
"path": "code/site/src/main/resources/discarded/SearcherWebService.java",
"license": "apache-2.0",
"size": 13835
}
|
[
"java.util.ArrayList",
"java.util.HashMap"
] |
import java.util.ArrayList; import java.util.HashMap;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,318,906 |
Call<ResponseBody> getNullAsync(final ServiceCallback<Integer> serviceCallback);
|
Call<ResponseBody> getNullAsync(final ServiceCallback<Integer> serviceCallback);
|
/**
* Get null Int value.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link Call} object
*/
|
Get null Int value
|
getNullAsync
|
{
"repo_name": "vulcansteel/autorest",
"path": "AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/bodyinteger/IntOperations.java",
"license": "mit",
"size": 9148
}
|
[
"com.microsoft.rest.ServiceCallback",
"com.squareup.okhttp.ResponseBody"
] |
import com.microsoft.rest.ServiceCallback; import com.squareup.okhttp.ResponseBody;
|
import com.microsoft.rest.*; import com.squareup.okhttp.*;
|
[
"com.microsoft.rest",
"com.squareup.okhttp"
] |
com.microsoft.rest; com.squareup.okhttp;
| 1,737,994 |
private void agentRemove() {
for (int i = 0; i < jListStartList.getSelectedValuesList().size(); i++) {
AgentClassElement4SimStart ac4s = jListStartList.getSelectedValuesList().get(i);
jListModelAgents2Start.removeElement(ac4s);
}
this.agentRenumberList();
this.save();
agentSelected = null;
agentSelectedLast = null;
jTextFieldStartAs.setText(null);
OntologyInstanceViewer oiv = new OntologyInstanceViewer(currProject.getOntologyVisualisationHelper());
this.setOntologyInstView(oiv);
}
|
void function() { for (int i = 0; i < jListStartList.getSelectedValuesList().size(); i++) { AgentClassElement4SimStart ac4s = jListStartList.getSelectedValuesList().get(i); jListModelAgents2Start.removeElement(ac4s); } this.agentRenumberList(); this.save(); agentSelected = null; agentSelectedLast = null; jTextFieldStartAs.setText(null); OntologyInstanceViewer oiv = new OntologyInstanceViewer(currProject.getOntologyVisualisationHelper()); this.setOntologyInstView(oiv); }
|
/**
* This method removes all selected Agents from the StarterList
*/
|
This method removes all selected Agents from the StarterList
|
agentRemove
|
{
"repo_name": "EnFlexIT/AgentWorkbench",
"path": "eclipseProjects/org.agentgui/bundles/org.agentgui.core/src/agentgui/core/gui/projectwindow/simsetup/StartSetup.java",
"license": "lgpl-2.1",
"size": 31693
}
|
[
"de.enflexit.common.ontology.gui.OntologyInstanceViewer"
] |
import de.enflexit.common.ontology.gui.OntologyInstanceViewer;
|
import de.enflexit.common.ontology.gui.*;
|
[
"de.enflexit.common"
] |
de.enflexit.common;
| 1,334,800 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.