method stringlengths 13 441k | clean_method stringlengths 7 313k | doc stringlengths 17 17.3k | comment stringlengths 3 1.42k | method_name stringlengths 1 273 | extra dict | imports list | imports_info stringlengths 19 34.8k | cluster_imports_info stringlengths 15 3.66k | libraries list | libraries_info stringlengths 6 661 | id int64 0 2.92M |
|---|---|---|---|---|---|---|---|---|---|---|---|
public KeyNamePair getKeyNamePair()
{
return new KeyNamePair(get_ID(), getName());
} | KeyNamePair function() { return new KeyNamePair(get_ID(), getName()); } | /** Get Record ID/ColumnName
@return ID/ColumnName pair
*/ | Get Record ID/ColumnName | getKeyNamePair | {
"repo_name": "arthurmelo88/palmetalADP",
"path": "adempiere_360/base/src/org/compiere/model/X_C_Bank.java",
"license": "gpl-2.0",
"size": 5688
} | [
"org.compiere.util.KeyNamePair"
] | import org.compiere.util.KeyNamePair; | import org.compiere.util.*; | [
"org.compiere.util"
] | org.compiere.util; | 815,025 |
@Message(id = 232, value = "Alternative parameter '%s' for required parameter '%s' was used. Please use one or the other. %s")
IllegalArgumentException validationFailedRequiredParameterPresentAsWellAsAlternative(String alternative, String paramName, String operation); | @Message(id = 232, value = STR) IllegalArgumentException validationFailedRequiredParameterPresentAsWellAsAlternative(String alternative, String paramName, String operation); | /**
* Creates an exception indicating that the operation contains both an alternative and a required parameter
*
* @param alternative the name of the alternative parameter
* @param paramName the name of the required parameter
* @param operation the operation as a string. May be empty
*/ | Creates an exception indicating that the operation contains both an alternative and a required parameter | validationFailedRequiredParameterPresentAsWellAsAlternative | {
"repo_name": "aloubyansky/wildfly-core",
"path": "controller/src/main/java/org/jboss/as/controller/logging/ControllerLogger.java",
"license": "lgpl-2.1",
"size": 164970
} | [
"org.jboss.logging.annotations.Message"
] | import org.jboss.logging.annotations.Message; | import org.jboss.logging.annotations.*; | [
"org.jboss.logging"
] | org.jboss.logging; | 79,205 |
public void setObjectReference(String name, Object object) {
if (objectRefs == null) {
objectRefs = new HashMap<String, Object>();
}
objectRefs.put(name, object);
} | void function(String name, Object object) { if (objectRefs == null) { objectRefs = new HashMap<String, Object>(); } objectRefs.put(name, object); } | /**
* Saves object reference.
*/ | Saves object reference | setObjectReference | {
"repo_name": "javachengwc/jodd",
"path": "jodd-db/src/main/java/jodd/db/oom/sqlgen/TemplateData.java",
"license": "bsd-2-clause",
"size": 9174
} | [
"java.util.HashMap"
] | import java.util.HashMap; | import java.util.*; | [
"java.util"
] | java.util; | 1,199,536 |
static BlocksMapUpdateInfo deleteInternal(
FSNamesystem fsn, String src, INodesInPath iip, boolean logRetryCache)
throws IOException {
assert fsn.hasWriteLock();
if (NameNode.stateChangeLog.isDebugEnabled()) {
NameNode.stateChangeLog.debug("DIR* NameSystem.delete: " + src);
}
FSDirectory fsd = fsn.getFSDirectory();
BlocksMapUpdateInfo collectedBlocks = new BlocksMapUpdateInfo();
List<INode> removedINodes = new ChunkedArrayList<>();
long mtime = now();
// Unlink the target directory from directory tree
long filesRemoved = delete(
fsd, iip, collectedBlocks, removedINodes, mtime);
if (filesRemoved < 0) {
return null;
}
fsd.getEditLog().logDelete(src, mtime, logRetryCache);
incrDeletedFileCount(filesRemoved);
fsn.removeLeasesAndINodes(src, removedINodes, true);
fsd.getEditLog().logSync();
if (NameNode.stateChangeLog.isDebugEnabled()) {
NameNode.stateChangeLog.debug("DIR* Namesystem.delete: "
+ src +" is removed");
}
return collectedBlocks;
} | static BlocksMapUpdateInfo deleteInternal( FSNamesystem fsn, String src, INodesInPath iip, boolean logRetryCache) throws IOException { assert fsn.hasWriteLock(); if (NameNode.stateChangeLog.isDebugEnabled()) { NameNode.stateChangeLog.debug(STR + src); } FSDirectory fsd = fsn.getFSDirectory(); BlocksMapUpdateInfo collectedBlocks = new BlocksMapUpdateInfo(); List<INode> removedINodes = new ChunkedArrayList<>(); long mtime = now(); long filesRemoved = delete( fsd, iip, collectedBlocks, removedINodes, mtime); if (filesRemoved < 0) { return null; } fsd.getEditLog().logDelete(src, mtime, logRetryCache); incrDeletedFileCount(filesRemoved); fsn.removeLeasesAndINodes(src, removedINodes, true); fsd.getEditLog().logSync(); if (NameNode.stateChangeLog.isDebugEnabled()) { NameNode.stateChangeLog.debug(STR + src +STR); } return collectedBlocks; } | /**
* Remove a file/directory from the namespace.
* <p>
* For large directories, deletion is incremental. The blocks under
* the directory are collected and deleted a small number at a time holding
* the {@link org.apache.hadoop.hdfs.server.namenode.FSNamesystem} lock.
* <p>
* For small directory or file the deletion is done in one shot.
*/ | Remove a file/directory from the namespace. For large directories, deletion is incremental. The blocks under the directory are collected and deleted a small number at a time holding the <code>org.apache.hadoop.hdfs.server.namenode.FSNamesystem</code> lock. For small directory or file the deletion is done in one shot | deleteInternal | {
"repo_name": "bysslord/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirDeleteOp.java",
"license": "apache-2.0",
"size": 9227
} | [
"java.io.IOException",
"java.util.List",
"org.apache.hadoop.hdfs.server.namenode.INode",
"org.apache.hadoop.util.ChunkedArrayList",
"org.apache.hadoop.util.Time"
] | import java.io.IOException; import java.util.List; import org.apache.hadoop.hdfs.server.namenode.INode; import org.apache.hadoop.util.ChunkedArrayList; import org.apache.hadoop.util.Time; | import java.io.*; import java.util.*; import org.apache.hadoop.hdfs.server.namenode.*; import org.apache.hadoop.util.*; | [
"java.io",
"java.util",
"org.apache.hadoop"
] | java.io; java.util; org.apache.hadoop; | 980,214 |
public Optional<Component> getComponent() {
return Optional.ofNullable(component);
} | Optional<Component> function() { return Optional.ofNullable(component); } | /**
* Returns an {@code Optional} for the {@code Component} related to value
* conversion.
*
* @return the optional of component
*/ | Returns an Optional for the Component related to value conversion | getComponent | {
"repo_name": "peterl1084/framework",
"path": "server/src/main/java/com/vaadin/data/ValueContext.java",
"license": "apache-2.0",
"size": 2779
} | [
"com.vaadin.ui.Component",
"java.util.Optional"
] | import com.vaadin.ui.Component; import java.util.Optional; | import com.vaadin.ui.*; import java.util.*; | [
"com.vaadin.ui",
"java.util"
] | com.vaadin.ui; java.util; | 2,884,432 |
public void displayItems(List<Object> items)
{
// Handle the 'empty list' case
if ((items == null) || items.isEmpty())
{
this.setIcon(null);
this.setText("Nothing");
return;
}
// Handle the 'single item' case
if (items.size() == 1)
{
this.displayItem(items.get(0));
return;
}
// Determine the common type of the items
ItemType type = null;
for (Object item : items)
{
ItemType myType = this._getItemType(item);
if (myType != type)
{
if (type != null) { type = ItemType.MIXED; break; }
type = myType;
}
}
ImageIcon icon = null;
String text = "???";
switch (type)
{
case NONE: icon = null; text = "Nothing"; break;
case GROUP: icon = this._groupIcon; text = items.size()+" groups"; break;
case IDENTITY: icon = this._identityIcon; text = items.size()+" identities"; break;
case CONTACT: icon = this._contactIcon; text = items.size()+" contacts"; break;
case ACCOUNT: icon = this._accountIcon; text = items.size()+" accounts"; break;
case UNDEFINED: icon = null; text = items.size()+" items"; break;
}
// Commit values
this.setIcon(icon);
this.setText(text);
}
| void function(List<Object> items) { if ((items == null) items.isEmpty()) { this.setIcon(null); this.setText(STR); return; } if (items.size() == 1) { this.displayItem(items.get(0)); return; } ItemType type = null; for (Object item : items) { ItemType myType = this._getItemType(item); if (myType != type) { if (type != null) { type = ItemType.MIXED; break; } type = myType; } } ImageIcon icon = null; String text = "???"; switch (type) { case NONE: icon = null; text = STR; break; case GROUP: icon = this._groupIcon; text = items.size()+STR; break; case IDENTITY: icon = this._identityIcon; text = items.size()+STR; break; case CONTACT: icon = this._contactIcon; text = items.size()+STR; break; case ACCOUNT: icon = this._accountIcon; text = items.size()+STR; break; case UNDEFINED: icon = null; text = items.size()+STR; break; } this.setIcon(icon); this.setText(text); } | /**
* Formats this field so as to show a representation
* of a given list of archive items.
*
* @param items A list of items
*/ | Formats this field so as to show a representation of a given list of archive items | displayItems | {
"repo_name": "goc9000/UniArchive",
"path": "src/uniarchive/widgets/ArchiveItemDisplay.java",
"license": "gpl-3.0",
"size": 3910
} | [
"java.util.List",
"javax.swing.ImageIcon"
] | import java.util.List; import javax.swing.ImageIcon; | import java.util.*; import javax.swing.*; | [
"java.util",
"javax.swing"
] | java.util; javax.swing; | 1,262,077 |
public static boolean isSameVariable(ASTNode node1, ASTNode node2) {
node1= getUnparenthesedExpression(node1);
node2= getUnparenthesedExpression(node2);
if (node1 == null || node2 == null) {
return false;
}
switch (node1.getNodeType()) {
case ASTNode.THIS_EXPRESSION:
return node2.getNodeType() == ASTNode.THIS_EXPRESSION;
case ASTNode.SIMPLE_NAME:
SimpleName sn= (SimpleName) node1;
switch (node2.getNodeType()) {
case ASTNode.QUALIFIED_NAME:
return isSameVariable(sn, (QualifiedName) node2);
case ASTNode.FIELD_ACCESS:
return isSameVariable(sn, (FieldAccess) node2);
}
break;
case ASTNode.QUALIFIED_NAME:
QualifiedName qn= (QualifiedName) node1;
switch (node2.getNodeType()) {
case ASTNode.SIMPLE_NAME:
return isSameVariable((SimpleName) node2, qn);
case ASTNode.QUALIFIED_NAME:
return isSameVariable(qn, (QualifiedName) node2);
case ASTNode.FIELD_ACCESS:
return isSameVariable(qn, (FieldAccess) node2);
}
break;
case ASTNode.FIELD_ACCESS:
FieldAccess fa= (FieldAccess) node1;
switch (node2.getNodeType()) {
case ASTNode.SIMPLE_NAME:
return isSameVariable((SimpleName) node2, fa);
case ASTNode.QUALIFIED_NAME:
return isSameVariable((QualifiedName) node2, fa);
case ASTNode.FIELD_ACCESS:
return isSameVariable(fa, (FieldAccess) node2);
}
}
return areVariableBindingsEqual(node1, node2);
}
| static boolean function(ASTNode node1, ASTNode node2) { node1= getUnparenthesedExpression(node1); node2= getUnparenthesedExpression(node2); if (node1 == null node2 == null) { return false; } switch (node1.getNodeType()) { case ASTNode.THIS_EXPRESSION: return node2.getNodeType() == ASTNode.THIS_EXPRESSION; case ASTNode.SIMPLE_NAME: SimpleName sn= (SimpleName) node1; switch (node2.getNodeType()) { case ASTNode.QUALIFIED_NAME: return isSameVariable(sn, (QualifiedName) node2); case ASTNode.FIELD_ACCESS: return isSameVariable(sn, (FieldAccess) node2); } break; case ASTNode.QUALIFIED_NAME: QualifiedName qn= (QualifiedName) node1; switch (node2.getNodeType()) { case ASTNode.SIMPLE_NAME: return isSameVariable((SimpleName) node2, qn); case ASTNode.QUALIFIED_NAME: return isSameVariable(qn, (QualifiedName) node2); case ASTNode.FIELD_ACCESS: return isSameVariable(qn, (FieldAccess) node2); } break; case ASTNode.FIELD_ACCESS: FieldAccess fa= (FieldAccess) node1; switch (node2.getNodeType()) { case ASTNode.SIMPLE_NAME: return isSameVariable((SimpleName) node2, fa); case ASTNode.QUALIFIED_NAME: return isSameVariable((QualifiedName) node2, fa); case ASTNode.FIELD_ACCESS: return isSameVariable(fa, (FieldAccess) node2); } } return areVariableBindingsEqual(node1, node2); } | /**
* Returns whether the two provided nodes represent the same variable.
*
* @param node1 the first node to compare
* @param node2 the second node to compare
* @return true if the two provided nodes represent the same variable, false
* otherwise
*/ | Returns whether the two provided nodes represent the same variable | isSameVariable | {
"repo_name": "rpau/AutoRefactor",
"path": "plugin/src/main/java/org/autorefactor/jdt/internal/corext/dom/ASTNodes.java",
"license": "epl-1.0",
"size": 104241
} | [
"org.eclipse.jdt.core.dom.ASTNode",
"org.eclipse.jdt.core.dom.FieldAccess",
"org.eclipse.jdt.core.dom.QualifiedName",
"org.eclipse.jdt.core.dom.SimpleName"
] | import org.eclipse.jdt.core.dom.ASTNode; import org.eclipse.jdt.core.dom.FieldAccess; import org.eclipse.jdt.core.dom.QualifiedName; import org.eclipse.jdt.core.dom.SimpleName; | import org.eclipse.jdt.core.dom.*; | [
"org.eclipse.jdt"
] | org.eclipse.jdt; | 2,516,358 |
public static List<Path> getJarsInDirectory(String path, boolean useLocal) {
List<Path> paths = new ArrayList<>();
try {
// add the wildcard if it is not provided
if (!path.endsWith("*")) {
path += File.separator + "*";
}
Path globPath = new Path(path).suffix("{.jar,.JAR}");
FileContext context = useLocal ?
FileContext.getLocalFSFileContext() :
FileContext.getFileContext(globPath.toUri());
FileStatus[] files = context.util().globStatus(globPath);
if (files != null) {
for (FileStatus file: files) {
paths.add(file.getPath());
}
}
} catch (IOException ignore) {} // return the empty list
return paths;
} | static List<Path> function(String path, boolean useLocal) { List<Path> paths = new ArrayList<>(); try { if (!path.endsWith("*")) { path += File.separator + "*"; } Path globPath = new Path(path).suffix(STR); FileContext context = useLocal ? FileContext.getLocalFSFileContext() : FileContext.getFileContext(globPath.toUri()); FileStatus[] files = context.util().globStatus(globPath); if (files != null) { for (FileStatus file: files) { paths.add(file.getPath()); } } } catch (IOException ignore) {} return paths; } | /**
* Returns all jars that are in the directory. It is useful in expanding a
* wildcard path to return all jars from the directory to use in a classpath.
*
* @param path the path to the directory. The path may include the wildcard.
* @return the list of jars as URLs, or an empty list if there are no jars, or
* the directory does not exist
*/ | Returns all jars that are in the directory. It is useful in expanding a wildcard path to return all jars from the directory to use in a classpath | getJarsInDirectory | {
"repo_name": "jaypatil/hadoop",
"path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java",
"license": "gpl-3.0",
"size": 48661
} | [
"java.io.File",
"java.io.IOException",
"java.util.ArrayList",
"java.util.List"
] | import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 1,943,883 |
public Observable<ServiceResponse<TopicSharedAccessKeysInner>> listSharedAccessKeysWithServiceResponseAsync(String resourceGroupName, String topicName) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (topicName == null) {
throw new IllegalArgumentException("Parameter topicName is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
} | Observable<ServiceResponse<TopicSharedAccessKeysInner>> function(String resourceGroupName, String topicName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); } if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (topicName == null) { throw new IllegalArgumentException(STR); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException(STR); } | /**
* List keys for a topic.
* List the two keys used to publish to a topic.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param topicName Name of the topic
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the TopicSharedAccessKeysInner object
*/ | List keys for a topic. List the two keys used to publish to a topic | listSharedAccessKeysWithServiceResponseAsync | {
"repo_name": "navalev/azure-sdk-for-java",
"path": "sdk/eventgrid/mgmt-v2018_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2018_01_01/implementation/TopicsInner.java",
"license": "mit",
"size": 76346
} | [
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.rest.ServiceResponse; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 1,354,674 |
private void processSelectedKeys(Set<SelectionKey> keys) throws ClosedByInterruptException {
if (log.isTraceEnabled())
log.trace("Processing keys in client worker: " + keys.size());
if (keys.isEmpty())
return;
for (Iterator<SelectionKey> iter = keys.iterator(); iter.hasNext(); ) {
SelectionKey key = iter.next();
iter.remove();
// Was key closed?
if (!key.isValid())
continue;
GridNioKeyAttachment attach = (GridNioKeyAttachment)key.attachment();
assert attach != null;
try {
if (!attach.hasSession() && key.isConnectable()) {
processConnect(key);
continue;
}
if (key.isReadable())
processRead(key);
if (key.isValid() && key.isWritable())
processWrite(key);
}
catch (ClosedByInterruptException e) {
// This exception will be handled in bodyInternal() method.
throw e;
}
catch (Exception | Error e) { // TODO IGNITE-2659.
try {
U.sleep(1000);
}
catch (IgniteInterruptedCheckedException ignore) {
// No-op.
}
GridSelectorNioSessionImpl ses = attach.session();
if (!closed)
U.error(log, "Failed to process selector key [ses=" + ses + ']', e);
else if (log.isDebugEnabled())
log.debug("Failed to process selector key [ses=" + ses + ", err=" + e + ']');
}
}
} | void function(Set<SelectionKey> keys) throws ClosedByInterruptException { if (log.isTraceEnabled()) log.trace(STR + keys.size()); if (keys.isEmpty()) return; for (Iterator<SelectionKey> iter = keys.iterator(); iter.hasNext(); ) { SelectionKey key = iter.next(); iter.remove(); if (!key.isValid()) continue; GridNioKeyAttachment attach = (GridNioKeyAttachment)key.attachment(); assert attach != null; try { if (!attach.hasSession() && key.isConnectable()) { processConnect(key); continue; } if (key.isReadable()) processRead(key); if (key.isValid() && key.isWritable()) processWrite(key); } catch (ClosedByInterruptException e) { throw e; } catch (Exception Error e) { try { U.sleep(1000); } catch (IgniteInterruptedCheckedException ignore) { } GridSelectorNioSessionImpl ses = attach.session(); if (!closed) U.error(log, STR + ses + ']', e); else if (log.isDebugEnabled()) log.debug(STR + ses + STR + e + ']'); } } } | /**
* Processes keys selected by a selector.
*
* @param keys Selected keys.
* @throws ClosedByInterruptException If this thread was interrupted while reading data.
*/ | Processes keys selected by a selector | processSelectedKeys | {
"repo_name": "samaitra/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java",
"license": "apache-2.0",
"size": 144624
} | [
"java.nio.channels.ClosedByInterruptException",
"java.nio.channels.SelectionKey",
"java.util.Iterator",
"java.util.Set",
"org.apache.ignite.internal.IgniteInterruptedCheckedException",
"org.apache.ignite.internal.util.typedef.internal.U"
] | import java.nio.channels.ClosedByInterruptException; import java.nio.channels.SelectionKey; import java.util.Iterator; import java.util.Set; import org.apache.ignite.internal.IgniteInterruptedCheckedException; import org.apache.ignite.internal.util.typedef.internal.U; | import java.nio.channels.*; import java.util.*; import org.apache.ignite.internal.*; import org.apache.ignite.internal.util.typedef.internal.*; | [
"java.nio",
"java.util",
"org.apache.ignite"
] | java.nio; java.util; org.apache.ignite; | 1,543,978 |
public FileDescriptor getFileDescriptor() throws IOException {
if (mFd == null) {
throw new IOException("socket not created");
}
return mFd;
} | FileDescriptor function() throws IOException { if (mFd == null) { throw new IOException(STR); } return mFd; } | /**
* Returns the {@link java.io.FileDescriptor FileDescriptor} of the socket.
*
* @return the FileDescriptor
* @throws IOException
* when the socket has not been {@link #create() created}.
*/ | Returns the <code>java.io.FileDescriptor FileDescriptor</code> of the socket | getFileDescriptor | {
"repo_name": "esmasui/backport-android-bluetooth",
"path": "backport-android-bluetooth/resources/android/bluetooth/RfcommSocket.java",
"license": "apache-2.0",
"size": 23431
} | [
"java.io.FileDescriptor",
"java.io.IOException"
] | import java.io.FileDescriptor; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,691,005 |
@Override
public boolean isSQLRecoveryLog() {
if (tc.isDebugEnabled())
Tr.debug(tc, "isSQLRecoveryLog " + _isSQLRecoveryLog);
return _isSQLRecoveryLog;
} | boolean function() { if (tc.isDebugEnabled()) Tr.debug(tc, STR + _isSQLRecoveryLog); return _isSQLRecoveryLog; } | /**
* Is the Transaction Log hosted in a database?
*
* @return true if it is
*/ | Is the Transaction Log hosted in a database | isSQLRecoveryLog | {
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.transaction/src/com/ibm/ws/transaction/services/JTMConfigurationProvider.java",
"license": "epl-1.0",
"size": 29135
} | [
"com.ibm.websphere.ras.Tr"
] | import com.ibm.websphere.ras.Tr; | import com.ibm.websphere.ras.*; | [
"com.ibm.websphere"
] | com.ibm.websphere; | 2,028,191 |
@Override
protected SortedSet<Broker> brokersToBalance(ClusterModel clusterModel) {
return clusterModel.brokers();
} | SortedSet<Broker> function(ClusterModel clusterModel) { return clusterModel.brokers(); } | /**
* This is a hard goal; hence, the proposals are not limited to dead broker replicas in case of self-healing.
* Get brokers that the rebalance process will go over to apply balancing actions to replicas they contain.
*
* @param clusterModel The state of the cluster.
* @return A collection of brokers that the rebalance process will go over to apply balancing actions to replicas
* they contain.
*/ | This is a hard goal; hence, the proposals are not limited to dead broker replicas in case of self-healing. Get brokers that the rebalance process will go over to apply balancing actions to replicas they contain | brokersToBalance | {
"repo_name": "GergoHong/cruise-control",
"path": "cruise-control/src/main/java/com/linkedin/kafka/cruisecontrol/analyzer/goals/RackAwareGoal.java",
"license": "bsd-2-clause",
"size": 12545
} | [
"com.linkedin.kafka.cruisecontrol.model.Broker",
"com.linkedin.kafka.cruisecontrol.model.ClusterModel",
"java.util.SortedSet"
] | import com.linkedin.kafka.cruisecontrol.model.Broker; import com.linkedin.kafka.cruisecontrol.model.ClusterModel; import java.util.SortedSet; | import com.linkedin.kafka.cruisecontrol.model.*; import java.util.*; | [
"com.linkedin.kafka",
"java.util"
] | com.linkedin.kafka; java.util; | 1,035,916 |
public static Test suite() {
return new TestSuite(EdgeHistogramTest.class);
} | static Test function() { return new TestSuite(EdgeHistogramTest.class); } | /**
* Returns the test suite.
*
* @return the suite
*/ | Returns the test suite | suite | {
"repo_name": "waikato-datamining/adams-base",
"path": "adams-imaging/src/test/java/adams/data/lire/features/EdgeHistogramTest.java",
"license": "gpl-3.0",
"size": 2424
} | [
"junit.framework.Test",
"junit.framework.TestSuite"
] | import junit.framework.Test; import junit.framework.TestSuite; | import junit.framework.*; | [
"junit.framework"
] | junit.framework; | 1,580,600 |
public String getColor() {
// Turn the color into an RGB value in hex.
Color bg = colorIcon.getColor();
// Lop off the alpha portion.
int rgb = bg.getRGB() & 0x00FFFFFF;
String hex = Integer.toHexString(rgb);
// Pad with zeros.
if (hex.length() < 6) {
hex = zeros[5 - hex.length()].concat(hex);
}
return "0x" + hex;
} // getColor
} // ColorButton
protected static class ColorIcon implements Icon {
private Color ourColor;
public ColorIcon() {
ourColor = Color.black;
} // ColorIcon | String function() { Color bg = colorIcon.getColor(); int rgb = bg.getRGB() & 0x00FFFFFF; String hex = Integer.toHexString(rgb); if (hex.length() < 6) { hex = zeros[5 - hex.length()].concat(hex); } return "0x" + hex; } } protected static class ColorIcon implements Icon { private Color ourColor; public ColorIcon() { ourColor = Color.black; } | /**
* Returns the color this button represents, in the form of a
* hexadecimal RGB value.
*
* @return RGB value in hexadecimal.
*/ | Returns the color this button represents, in the form of a hexadecimal RGB value | getColor | {
"repo_name": "mbertacca/JSwat2",
"path": "classes/com/bluemarsh/jswat/action/PreferencesAction.java",
"license": "gpl-2.0",
"size": 47228
} | [
"java.awt.Color",
"javax.swing.Icon"
] | import java.awt.Color; import javax.swing.Icon; | import java.awt.*; import javax.swing.*; | [
"java.awt",
"javax.swing"
] | java.awt; javax.swing; | 578,324 |
public Time getTime(String parameterName, Calendar cal)
throws SQLException
{
throw Util.notImplemented();
} | Time function(String parameterName, Calendar cal) throws SQLException { throw Util.notImplemented(); } | /**
* JDBC 3.0
*
* Retrieves the value of a JDBC TIME parameter as a java.sql.Time object,
* using the given Calendar object to construct the time object.
*
* @param parameterName - the name of the parameter
* @param cal - the Calendar object the driver will use to construct the time
* @return the parameter value. If the value is SQL NULL, the result is null.
* @exception SQLException Feature not implemented for now.
*/ | JDBC 3.0 Retrieves the value of a JDBC TIME parameter as a java.sql.Time object, using the given Calendar object to construct the time object | getTime | {
"repo_name": "splicemachine/spliceengine",
"path": "db-engine/src/main/java/com/splicemachine/db/impl/jdbc/EmbedCallableStatement20.java",
"license": "agpl-3.0",
"size": 37363
} | [
"java.sql.SQLException",
"java.sql.Time",
"java.util.Calendar"
] | import java.sql.SQLException; import java.sql.Time; import java.util.Calendar; | import java.sql.*; import java.util.*; | [
"java.sql",
"java.util"
] | java.sql; java.util; | 1,799,007 |
@Override()
@NotNull()
public String toString()
{
final StringBuilder buffer = new StringBuilder();
buffer.append("LDAPSearchConstraints(constraints=");
buffer.append(super.toString());
buffer.append(", batchSize=");
buffer.append(batchSize);
buffer.append(", derefPolicy=");
buffer.append(derefPolicy);
buffer.append(", maxResults=");
buffer.append(sizeLimit);
buffer.append(", serverTimeLimit=");
buffer.append(timeLimit);
buffer.append(')');
return buffer.toString();
} | @Override() @NotNull() String function() { final StringBuilder buffer = new StringBuilder(); buffer.append(STR); buffer.append(super.toString()); buffer.append(STR); buffer.append(batchSize); buffer.append(STR); buffer.append(derefPolicy); buffer.append(STR); buffer.append(sizeLimit); buffer.append(STR); buffer.append(timeLimit); buffer.append(')'); return buffer.toString(); } | /**
* Retrieves a string representation of this search constraints object.
*
* @return A string representation of this search constraints object.
*/ | Retrieves a string representation of this search constraints object | toString | {
"repo_name": "UnboundID/ldapsdk",
"path": "src/com/unboundid/ldap/sdk/migrate/ldapjdk/LDAPSearchConstraints.java",
"license": "gpl-2.0",
"size": 11531
} | [
"com.unboundid.util.NotNull"
] | import com.unboundid.util.NotNull; | import com.unboundid.util.*; | [
"com.unboundid.util"
] | com.unboundid.util; | 1,787,560 |
@SuppressWarnings("unchecked")
private <T> Optional<T> getValue(Object object, Supplier<Object> method, Class<T> cls) {
T source = null;
if (cls.isInstance(method.get())) {
source = (T) method.get();
} else {
if (CoreParameters.DEVELOPER_MODE.get()) {
throw new CoreRuntimeException("Cannot cast object " + method.get() + " to " + cls.toGenericString());
}
}
return Optional.ofNullable(source);
} | @SuppressWarnings(STR) <T> Optional<T> function(Object object, Supplier<Object> method, Class<T> cls) { T source = null; if (cls.isInstance(method.get())) { source = (T) method.get(); } else { if (CoreParameters.DEVELOPER_MODE.get()) { throw new CoreRuntimeException(STR + method.get() + STR + cls.toGenericString()); } } return Optional.ofNullable(source); } | /**
* Gets the value.
*
* @param object the object
* @param method the method
* @param cls the cls
*
* @param <T> the generic type
*
* @return the value
*/ | Gets the value | getValue | {
"repo_name": "JRebirth/JRebirth",
"path": "org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/ui/AbstractController.java",
"license": "apache-2.0",
"size": 14581
} | [
"java.util.Optional",
"java.util.function.Supplier",
"org.jrebirth.af.api.exception.CoreRuntimeException",
"org.jrebirth.af.core.resource.provided.parameter.CoreParameters"
] | import java.util.Optional; import java.util.function.Supplier; import org.jrebirth.af.api.exception.CoreRuntimeException; import org.jrebirth.af.core.resource.provided.parameter.CoreParameters; | import java.util.*; import java.util.function.*; import org.jrebirth.af.api.exception.*; import org.jrebirth.af.core.resource.provided.parameter.*; | [
"java.util",
"org.jrebirth.af"
] | java.util; org.jrebirth.af; | 2,367,607 |
public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player)
{
if (player.capabilities.isCreativeMode)
{
BlockPos blockpos = pos.offset(((EnumFacing)state.getValue(FACING)).getOpposite());
Block block = worldIn.getBlockState(blockpos).getBlock();
if (block == Blocks.PISTON || block == Blocks.STICKY_PISTON)
{
worldIn.setBlockToAir(blockpos);
}
}
super.onBlockHarvested(worldIn, pos, state, player);
} | void function(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player) { if (player.capabilities.isCreativeMode) { BlockPos blockpos = pos.offset(((EnumFacing)state.getValue(FACING)).getOpposite()); Block block = worldIn.getBlockState(blockpos).getBlock(); if (block == Blocks.PISTON block == Blocks.STICKY_PISTON) { worldIn.setBlockToAir(blockpos); } } super.onBlockHarvested(worldIn, pos, state, player); } | /**
* Called before the Block is set to air in the world. Called regardless of if the player's tool can actually
* collect this block
*/ | Called before the Block is set to air in the world. Called regardless of if the player's tool can actually collect this block | onBlockHarvested | {
"repo_name": "TheGreatAndPowerfulWeegee/wipunknown",
"path": "build/tmp/recompileMc/sources/net/minecraft/block/BlockPistonExtension.java",
"license": "gpl-3.0",
"size": 11977
} | [
"net.minecraft.block.state.IBlockState",
"net.minecraft.entity.player.EntityPlayer",
"net.minecraft.init.Blocks",
"net.minecraft.util.EnumFacing",
"net.minecraft.util.math.BlockPos",
"net.minecraft.world.World"
] | import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; | import net.minecraft.block.state.*; import net.minecraft.entity.player.*; import net.minecraft.init.*; import net.minecraft.util.*; import net.minecraft.util.math.*; import net.minecraft.world.*; | [
"net.minecraft.block",
"net.minecraft.entity",
"net.minecraft.init",
"net.minecraft.util",
"net.minecraft.world"
] | net.minecraft.block; net.minecraft.entity; net.minecraft.init; net.minecraft.util; net.minecraft.world; | 280,666 |
@PublicEvolving
public WithWindow<T1, T2, KEY, W> evictor(Evictor<? super TaggedUnion<T1, T2>, ? super W> newEvictor) {
return new WithWindow<>(input1, input2, keySelector1, keySelector2, keyType,
windowAssigner, trigger, newEvictor, allowedLateness);
} | WithWindow<T1, T2, KEY, W> function(Evictor<? super TaggedUnion<T1, T2>, ? super W> newEvictor) { return new WithWindow<>(input1, input2, keySelector1, keySelector2, keyType, windowAssigner, trigger, newEvictor, allowedLateness); } | /**
* Sets the {@code Evictor} that should be used to evict elements from a window before
* emission.
*
* <p>Note: When using an evictor window performance will degrade significantly, since
* pre-aggregation of window results cannot be used.
*/ | Sets the Evictor that should be used to evict elements from a window before emission. Note: When using an evictor window performance will degrade significantly, since pre-aggregation of window results cannot be used | evictor | {
"repo_name": "xiaokuangkuang/kuangjingxiangmu",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/CoGroupedStreams.java",
"license": "apache-2.0",
"size": 25398
} | [
"org.apache.flink.streaming.api.windowing.evictors.Evictor"
] | import org.apache.flink.streaming.api.windowing.evictors.Evictor; | import org.apache.flink.streaming.api.windowing.evictors.*; | [
"org.apache.flink"
] | org.apache.flink; | 2,622,844 |
public MetaProperty<String> label() {
return label;
} | MetaProperty<String> function() { return label; } | /**
* The meta-property for the {@code label} property.
* @return the meta-property, not null
*/ | The meta-property for the label property | label | {
"repo_name": "OpenGamma/Strata",
"path": "modules/market/src/main/java/com/opengamma/strata/market/curve/node/CdsIndexIsdaCreditCurveNode.java",
"license": "apache-2.0",
"size": 30915
} | [
"org.joda.beans.MetaProperty"
] | import org.joda.beans.MetaProperty; | import org.joda.beans.*; | [
"org.joda.beans"
] | org.joda.beans; | 936,022 |
private void handleUpdateFeature(HashMap<String, Object> payload, Subscriber<Object> subscriber) {
String featureString = null;
try {
featureString = SCObjectMapper.getMapper().writeValueAsString(JsonUtilities.getHashMap(payload, "feature"));
} catch (JsonProcessingException e) {
e.printStackTrace();
}
SubscriberWrapper wrapper = new SubscriberWrapper(subscriber);
SCSpatialFeature feature = new SCGeometryFactory().getSpatialFeatureFromFeatureJson(featureString);
try {
SCKeyTuple decodedTuple = new SCKeyTuple(feature.getId());
// update feature with decoded values
feature.setStoreId(decodedTuple.getStoreId());
feature.setLayerId(decodedTuple.getLayerId());
feature.setId(decodedTuple.getFeatureId());
} catch (UnsupportedEncodingException e) {
wrapper.onError(e);
}
SCDataStore store = mSpatialConnect.getDataService().getStoreByIdentifier(feature.getKey().getStoreId());
((ISCSpatialStore) store).update(feature).subscribeOn(Schedulers.io()).subscribe(wrapper);
} | void function(HashMap<String, Object> payload, Subscriber<Object> subscriber) { String featureString = null; try { featureString = SCObjectMapper.getMapper().writeValueAsString(JsonUtilities.getHashMap(payload, STR)); } catch (JsonProcessingException e) { e.printStackTrace(); } SubscriberWrapper wrapper = new SubscriberWrapper(subscriber); SCSpatialFeature feature = new SCGeometryFactory().getSpatialFeatureFromFeatureJson(featureString); try { SCKeyTuple decodedTuple = new SCKeyTuple(feature.getId()); feature.setStoreId(decodedTuple.getStoreId()); feature.setLayerId(decodedTuple.getLayerId()); feature.setId(decodedTuple.getFeatureId()); } catch (UnsupportedEncodingException e) { wrapper.onError(e); } SCDataStore store = mSpatialConnect.getDataService().getStoreByIdentifier(feature.getKey().getStoreId()); ((ISCSpatialStore) store).update(feature).subscribeOn(Schedulers.io()).subscribe(wrapper); } | /**
* Handles the {@link Actions#DATASERVICE_UPDATEFEATURE} command.
*/ | Handles the <code>Actions#DATASERVICE_UPDATEFEATURE</code> command | handleUpdateFeature | {
"repo_name": "marcusthebrown/spatialconnect-android-sdk",
"path": "spatialconnect/src/main/java/com/boundlessgeo/spatialconnect/jsbridge/SCJavascriptBridgeAPI.java",
"license": "apache-2.0",
"size": 23805
} | [
"com.boundlessgeo.spatialconnect.geometries.SCGeometryFactory",
"com.boundlessgeo.spatialconnect.geometries.SCSpatialFeature",
"com.boundlessgeo.spatialconnect.scutilities.Json",
"com.boundlessgeo.spatialconnect.stores.ISCSpatialStore",
"com.boundlessgeo.spatialconnect.stores.SCDataStore",
"com.boundlessg... | import com.boundlessgeo.spatialconnect.geometries.SCGeometryFactory; import com.boundlessgeo.spatialconnect.geometries.SCSpatialFeature; import com.boundlessgeo.spatialconnect.scutilities.Json; import com.boundlessgeo.spatialconnect.stores.ISCSpatialStore; import com.boundlessgeo.spatialconnect.stores.SCDataStore; import com.boundlessgeo.spatialconnect.stores.SCKeyTuple; import com.fasterxml.jackson.core.JsonProcessingException; import java.io.UnsupportedEncodingException; import java.util.HashMap; | import com.boundlessgeo.spatialconnect.geometries.*; import com.boundlessgeo.spatialconnect.scutilities.*; import com.boundlessgeo.spatialconnect.stores.*; import com.fasterxml.jackson.core.*; import java.io.*; import java.util.*; | [
"com.boundlessgeo.spatialconnect",
"com.fasterxml.jackson",
"java.io",
"java.util"
] | com.boundlessgeo.spatialconnect; com.fasterxml.jackson; java.io; java.util; | 1,666,631 |
public void setIsOnline(boolean isOnline) {
Log.d(LOG_TAG, "setIsOnline to " + isOnline);
mIsOnline = isOnline;
} | void function(boolean isOnline) { Log.d(LOG_TAG, STR + isOnline); mIsOnline = isOnline; } | /**
* Update the online status
*
* @param isOnline true if the client must be seen as online
*/ | Update the online status | setIsOnline | {
"repo_name": "matrix-org/matrix-android-sdk",
"path": "matrix-sdk/src/main/java/org/matrix/androidsdk/sync/EventsThread.java",
"license": "apache-2.0",
"size": 27337
} | [
"org.matrix.androidsdk.core.Log"
] | import org.matrix.androidsdk.core.Log; | import org.matrix.androidsdk.core.*; | [
"org.matrix.androidsdk"
] | org.matrix.androidsdk; | 784,514 |
public NodeList getDescendents(NodeFilter filter, boolean nestIntoMatchingNodes) {
final ArrayList<Node> al = new ArrayList<>();
synchronized (this.treeLock) {
extractDescendentsArrayImpl(filter, al, nestIntoMatchingNodes);
}
return new NodeListImpl(al);
} | NodeList function(NodeFilter filter, boolean nestIntoMatchingNodes) { final ArrayList<Node> al = new ArrayList<>(); synchronized (this.treeLock) { extractDescendentsArrayImpl(filter, al, nestIntoMatchingNodes); } return new NodeListImpl(al); } | /**
* Creates an NodeList of descendent nodes that the given filter
* condition.
*
* @param filter a {@link org.loboevolution.html.dom.NodeFilter} object.
* @param nestIntoMatchingNodes a boolean.
* @return a {@link org.w3c.dom.NodeList} object.
*/ | Creates an NodeList of descendent nodes that the given filter condition | getDescendents | {
"repo_name": "oswetto/LoboEvolution",
"path": "LoboHtml/src/main/java/org/loboevolution/html/dom/nodeimpl/NodeImpl.java",
"license": "gpl-3.0",
"size": 36603
} | [
"java.util.ArrayList",
"org.loboevolution.html.dom.NodeFilter",
"org.loboevolution.html.node.Node",
"org.loboevolution.html.node.NodeList"
] | import java.util.ArrayList; import org.loboevolution.html.dom.NodeFilter; import org.loboevolution.html.node.Node; import org.loboevolution.html.node.NodeList; | import java.util.*; import org.loboevolution.html.dom.*; import org.loboevolution.html.node.*; | [
"java.util",
"org.loboevolution.html"
] | java.util; org.loboevolution.html; | 2,588,940 |
private static void saveImage(ByteBuffer currentDirName,
INodeDirectory current,
DataOutputStream out,
long inodesTotal) throws IOException {
saveImage(currentDirName, current, out, inodesTotal, 0);
} | static void function(ByteBuffer currentDirName, INodeDirectory current, DataOutputStream out, long inodesTotal) throws IOException { saveImage(currentDirName, current, out, inodesTotal, 0); } | /**
* Save file tree image starting from the given root.
* This is a recursive procedure, which first saves all children of
* a current directory and then moves inside the sub-directories.
*/ | Save file tree image starting from the given root. This is a recursive procedure, which first saves all children of a current directory and then moves inside the sub-directories | saveImage | {
"repo_name": "rvadali/fb-raid-refactoring",
"path": "src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSImage.java",
"license": "apache-2.0",
"size": 83874
} | [
"java.io.DataOutputStream",
"java.io.IOException",
"java.nio.ByteBuffer"
] | import java.io.DataOutputStream; import java.io.IOException; import java.nio.ByteBuffer; | import java.io.*; import java.nio.*; | [
"java.io",
"java.nio"
] | java.io; java.nio; | 2,442,067 |
protected AssetGlpeSourceDetail createAssetGlpePostable(AssetTransferDocument document, Account plantAccount, AssetPayment assetPayment, boolean isSource, AmountCategory amountCategory) {
if (LOG.isDebugEnabled()) {
LOG.debug("Start - createAssetGlpePostable (" + document.getDocumentNumber() + "-" + plantAccount.getAccountNumber() + ")");
}
AssetGlpeSourceDetail postable = new AssetGlpeSourceDetail();
postable.setSource(isSource);
postable.setAccount(plantAccount);
postable.setAccountNumber(plantAccount.getAccountNumber());
postable.setBalanceTypeCode(CamsConstants.Postable.GL_BALANCE_TYPE_CODE_AC);
String organizationOwnerChartOfAccountsCode = null;
if (isSource) {
organizationOwnerChartOfAccountsCode = document.getAsset().getOrganizationOwnerChartOfAccountsCode();
postable.setSubAccountNumber(assetPayment.getSubAccountNumber());
}
else {
organizationOwnerChartOfAccountsCode = document.getOrganizationOwnerChartOfAccountsCode();
postable.setSubAccountNumber(null);
}
ObjectCodeService objectCodeService = SpringContext.getBean(ObjectCodeService.class);
ObjectCode objectCode = objectCodeService.getByPrimaryIdForCurrentYear(assetPayment.getChartOfAccountsCode(), assetPayment.getFinancialObjectCode());
String plantChartOfAccountsCode = plantAccount.getChartOfAccountsCode();
postable.setChartOfAccountsCode(plantChartOfAccountsCode);
postable.setDocumentNumber(document.getDocumentNumber());
postable.setFinancialSubObjectCode(assetPayment.getFinancialSubObjectCode());
postable.setPostingYear(getUniversityDateService().getCurrentUniversityDate().getUniversityFiscalYear());
postable.setProjectCode(assetPayment.getProjectCode());
postable.setOrganizationReferenceId(assetPayment.getOrganizationReferenceId());
AssetObjectCode assetObjectCode = getAssetObjectCodeService().findAssetObjectCode(organizationOwnerChartOfAccountsCode, objectCode.getFinancialObjectSubTypeCode());
OffsetDefinition offsetDefinition = SpringContext.getBean(OffsetDefinitionService.class).getByPrimaryId(getUniversityDateService().getCurrentFiscalYear(), organizationOwnerChartOfAccountsCode, CamsConstants.AssetTransfer.DOCUMENT_TYPE_CODE, CamsConstants.Postable.GL_BALANCE_TYPE_CODE_AC);
amountCategory.setParams(postable, assetPayment, assetObjectCode, isSource, offsetDefinition);
if (LOG.isDebugEnabled()) {
LOG.debug("End - createAssetGlpePostable(" + document.getDocumentNumber() + "-" + plantAccount.getAccountNumber() + "-" + ")");
}
return postable;
} | AssetGlpeSourceDetail function(AssetTransferDocument document, Account plantAccount, AssetPayment assetPayment, boolean isSource, AmountCategory amountCategory) { if (LOG.isDebugEnabled()) { LOG.debug(STR + document.getDocumentNumber() + "-" + plantAccount.getAccountNumber() + ")"); } AssetGlpeSourceDetail postable = new AssetGlpeSourceDetail(); postable.setSource(isSource); postable.setAccount(plantAccount); postable.setAccountNumber(plantAccount.getAccountNumber()); postable.setBalanceTypeCode(CamsConstants.Postable.GL_BALANCE_TYPE_CODE_AC); String organizationOwnerChartOfAccountsCode = null; if (isSource) { organizationOwnerChartOfAccountsCode = document.getAsset().getOrganizationOwnerChartOfAccountsCode(); postable.setSubAccountNumber(assetPayment.getSubAccountNumber()); } else { organizationOwnerChartOfAccountsCode = document.getOrganizationOwnerChartOfAccountsCode(); postable.setSubAccountNumber(null); } ObjectCodeService objectCodeService = SpringContext.getBean(ObjectCodeService.class); ObjectCode objectCode = objectCodeService.getByPrimaryIdForCurrentYear(assetPayment.getChartOfAccountsCode(), assetPayment.getFinancialObjectCode()); String plantChartOfAccountsCode = plantAccount.getChartOfAccountsCode(); postable.setChartOfAccountsCode(plantChartOfAccountsCode); postable.setDocumentNumber(document.getDocumentNumber()); postable.setFinancialSubObjectCode(assetPayment.getFinancialSubObjectCode()); postable.setPostingYear(getUniversityDateService().getCurrentUniversityDate().getUniversityFiscalYear()); postable.setProjectCode(assetPayment.getProjectCode()); postable.setOrganizationReferenceId(assetPayment.getOrganizationReferenceId()); AssetObjectCode assetObjectCode = getAssetObjectCodeService().findAssetObjectCode(organizationOwnerChartOfAccountsCode, objectCode.getFinancialObjectSubTypeCode()); OffsetDefinition offsetDefinition = SpringContext.getBean(OffsetDefinitionService.class).getByPrimaryId(getUniversityDateService().getCurrentFiscalYear(), organizationOwnerChartOfAccountsCode, CamsConstants.AssetTransfer.DOCUMENT_TYPE_CODE, CamsConstants.Postable.GL_BALANCE_TYPE_CODE_AC); amountCategory.setParams(postable, assetPayment, assetObjectCode, isSource, offsetDefinition); if (LOG.isDebugEnabled()) { LOG.debug(STR + document.getDocumentNumber() + "-" + plantAccount.getAccountNumber() + "-" + ")"); } return postable; } | /**
* Creates an instance of AssetGlpeSourceDetail depending on the source flag
*
* @param universityDateService University Date Service
* @param plantAccount Plant account for the organization
* @param assetPayment Payment record for which postable is created
* @param isSource Indicates if postable is for source organization
* @return GL Postable source detail
*/ | Creates an instance of AssetGlpeSourceDetail depending on the source flag | createAssetGlpePostable | {
"repo_name": "bhutchinson/kfs",
"path": "kfs-cam/src/main/java/org/kuali/kfs/module/cam/document/service/impl/AssetTransferServiceImpl.java",
"license": "agpl-3.0",
"size": 30285
} | [
"org.kuali.kfs.coa.businessobject.Account",
"org.kuali.kfs.coa.businessobject.ObjectCode",
"org.kuali.kfs.coa.businessobject.OffsetDefinition",
"org.kuali.kfs.coa.service.ObjectCodeService",
"org.kuali.kfs.coa.service.OffsetDefinitionService",
"org.kuali.kfs.module.cam.CamsConstants",
"org.kuali.kfs.mod... | import org.kuali.kfs.coa.businessobject.Account; import org.kuali.kfs.coa.businessobject.ObjectCode; import org.kuali.kfs.coa.businessobject.OffsetDefinition; import org.kuali.kfs.coa.service.ObjectCodeService; import org.kuali.kfs.coa.service.OffsetDefinitionService; import org.kuali.kfs.module.cam.CamsConstants; import org.kuali.kfs.module.cam.businessobject.AssetGlpeSourceDetail; import org.kuali.kfs.module.cam.businessobject.AssetObjectCode; import org.kuali.kfs.module.cam.businessobject.AssetPayment; import org.kuali.kfs.module.cam.document.AssetTransferDocument; import org.kuali.kfs.sys.context.SpringContext; | import org.kuali.kfs.coa.businessobject.*; import org.kuali.kfs.coa.service.*; import org.kuali.kfs.module.cam.*; import org.kuali.kfs.module.cam.businessobject.*; import org.kuali.kfs.module.cam.document.*; import org.kuali.kfs.sys.context.*; | [
"org.kuali.kfs"
] | org.kuali.kfs; | 2,888,811 |
private Locale checkLocale( final Locale inLocale) {
final Set<Locale> alreadyUsed = Sets.newHashSet();
Locale localeToTry = inLocale;
synchronized (_locale_locker) {
while (true) {
if (localeDataHash.getIfPresent(localeToTry) != null) {
return localeToTry;
}
else
{
try {
cacheBundleLocaleIfNecessary(localeToTry);
return localeToTry;
}
catch (final MissingResourceException mre) {
alreadyUsed.add(localeToTry);
if ( localeToTry.getVariant() != null && !localeToTry.getVariant().isEmpty()) {
localeToTry = new Locale( localeToTry.getLanguage(), localeToTry.getCountry());
if (alreadyUsed.contains(localeToTry)) {
continue;
}
}
else if ( localeToTry.getCountry() != null && !localeToTry.getCountry().isEmpty()) {
localeToTry = new Locale( localeToTry.getLanguage() );
if (alreadyUsed.contains(localeToTry)) {
continue;
}
}
else if (!localeToTry.equals(defaultLocale)) {
localeToTry = defaultLocale;
if (alreadyUsed.contains(localeToTry)) {
return null;
}
}
else {
return null;
}
}
}
}
}
} | Locale function( final Locale inLocale) { final Set<Locale> alreadyUsed = Sets.newHashSet(); Locale localeToTry = inLocale; synchronized (_locale_locker) { while (true) { if (localeDataHash.getIfPresent(localeToTry) != null) { return localeToTry; } else { try { cacheBundleLocaleIfNecessary(localeToTry); return localeToTry; } catch (final MissingResourceException mre) { alreadyUsed.add(localeToTry); if ( localeToTry.getVariant() != null && !localeToTry.getVariant().isEmpty()) { localeToTry = new Locale( localeToTry.getLanguage(), localeToTry.getCountry()); if (alreadyUsed.contains(localeToTry)) { continue; } } else if ( localeToTry.getCountry() != null && !localeToTry.getCountry().isEmpty()) { localeToTry = new Locale( localeToTry.getLanguage() ); if (alreadyUsed.contains(localeToTry)) { continue; } } else if (!localeToTry.equals(defaultLocale)) { localeToTry = defaultLocale; if (alreadyUsed.contains(localeToTry)) { return null; } } else { return null; } } } } } } | /**
* Check to see if the PropertyResourceBundle for this Locale has been loaded.
* @param inLocale
* @return
*/ | Check to see if the PropertyResourceBundle for this Locale has been loaded | checkLocale | {
"repo_name": "poblish/resourceBundleStore",
"path": "src/main/java/com/hiatus/rez/ResourceBundleStore.java",
"license": "apache-2.0",
"size": 7430
} | [
"com.google.common.collect.Sets",
"java.util.Locale",
"java.util.MissingResourceException",
"java.util.Set"
] | import com.google.common.collect.Sets; import java.util.Locale; import java.util.MissingResourceException; import java.util.Set; | import com.google.common.collect.*; import java.util.*; | [
"com.google.common",
"java.util"
] | com.google.common; java.util; | 2,466,736 |
@Override
public ResultSubpartitionView createSubpartitionView(int index, BufferAvailabilityListener availabilityListener) throws IOException {
checkElementIndex(index, subpartitions.length, "Subpartition not found.");
checkState(!isReleased.get(), "Partition released.");
ResultSubpartitionView readView = subpartitions[index].createReadView(availabilityListener);
LOG.debug("Created {}", readView);
return readView;
} | ResultSubpartitionView function(int index, BufferAvailabilityListener availabilityListener) throws IOException { checkElementIndex(index, subpartitions.length, STR); checkState(!isReleased.get(), STR); ResultSubpartitionView readView = subpartitions[index].createReadView(availabilityListener); LOG.debug(STR, readView); return readView; } | /**
* Returns the requested subpartition.
*/ | Returns the requested subpartition | createSubpartitionView | {
"repo_name": "darionyaphet/flink",
"path": "flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/ResultPartition.java",
"license": "apache-2.0",
"size": 11505
} | [
"java.io.IOException",
"org.apache.flink.util.Preconditions"
] | import java.io.IOException; import org.apache.flink.util.Preconditions; | import java.io.*; import org.apache.flink.util.*; | [
"java.io",
"org.apache.flink"
] | java.io; org.apache.flink; | 2,739,230 |
@Test
public void payProgramProgressUserPayProgramTest() throws Exception {
PayProgram payProgram = payProgramService.findByPayProgramIds(program.getId(), feeProgram.getId());
// Assert no pay
assertTrue(payProgram.getState().equals(states.NO_PAY));
mockMvc.perform(post("/userPayments/payProgram/" + payProgram.getId()).locale(Locale.ENGLISH).session(defaultSession)
.sessionAttr("_csrf", "csrf").param("payer_email", "email").param("payer_id", "id").param("payment_date", "10:10:10 Jun 10, 2015")
.param("payment_status", "Progress").param("txn_id", "txn")).andExpect(view().name("redirect:/userPayments"));
// Assert Pay
assertTrue(payProgram.getState().equals(states.MANAGEMENT));
assertEquals(payProgram, payProgramService.findByIdTxn("txn"));
} | void function() throws Exception { PayProgram payProgram = payProgramService.findByPayProgramIds(program.getId(), feeProgram.getId()); assertTrue(payProgram.getState().equals(states.NO_PAY)); mockMvc.perform(post(STR + payProgram.getId()).locale(Locale.ENGLISH).session(defaultSession) .sessionAttr("_csrf", "csrf").param(STR, "email").param(STR, "id").param(STR, STR) .param(STR, STR).param(STR, "txn")).andExpect(view().name(STR)); assertTrue(payProgram.getState().equals(states.MANAGEMENT)); assertEquals(payProgram, payProgramService.findByIdTxn("txn")); } | /**
* Pay user pay inscription test.
*
* @throws Exception the exception
*/ | Pay user pay inscription test | payProgramProgressUserPayProgramTest | {
"repo_name": "pablogrela/members_cuacfm",
"path": "src/test/java/org/cuacfm/members/test/web/userpayments/UserPaymentsTest.java",
"license": "apache-2.0",
"size": 23169
} | [
"java.util.Locale",
"org.cuacfm.members.model.payprogram.PayProgram",
"org.junit.Assert"
] | import java.util.Locale; import org.cuacfm.members.model.payprogram.PayProgram; import org.junit.Assert; | import java.util.*; import org.cuacfm.members.model.payprogram.*; import org.junit.*; | [
"java.util",
"org.cuacfm.members",
"org.junit"
] | java.util; org.cuacfm.members; org.junit; | 421,723 |
public LiveEventInput input() {
return this.input;
} | LiveEventInput function() { return this.input; } | /**
* Get the Live Event input.
*
* @return the input value
*/ | Get the Live Event input | input | {
"repo_name": "hovsepm/azure-sdk-for-java",
"path": "mediaservices/resource-manager/v2018_30_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_30_30_preview/implementation/LiveEventInner.java",
"license": "mit",
"size": 7396
} | [
"com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEventInput"
] | import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.LiveEventInput; | import com.microsoft.azure.management.mediaservices.v2018_30_30_preview.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 1,723,994 |
private IgniteConfiguration configuration(int idx) throws Exception {
CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
ccfg.setName(CACHE_NAME);
ccfg.setCacheMode(cacheMode());
ccfg.setAtomicityMode(atomicityMode());
ccfg.setRebalanceMode(SYNC);
ccfg.setWriteSynchronizationMode(FULL_SYNC);
ccfg.setEvictionPolicy(null);
if (cacheMode() == PARTITIONED)
ccfg.setBackups(backups());
if (atomicityMode() != ATOMIC && cacheMode() == PARTITIONED) {
ccfg.setNearConfiguration(new NearCacheConfiguration());
}
IgniteConfiguration cfg = getConfiguration(nodeName(idx));
cfg.setLocalHost("127.0.0.1");
cfg.setCacheConfiguration(ccfg);
cfg.setConnectorConfiguration(null);
return cfg;
} | IgniteConfiguration function(int idx) throws Exception { CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME); ccfg.setName(CACHE_NAME); ccfg.setCacheMode(cacheMode()); ccfg.setAtomicityMode(atomicityMode()); ccfg.setRebalanceMode(SYNC); ccfg.setWriteSynchronizationMode(FULL_SYNC); ccfg.setEvictionPolicy(null); if (cacheMode() == PARTITIONED) ccfg.setBackups(backups()); if (atomicityMode() != ATOMIC && cacheMode() == PARTITIONED) { ccfg.setNearConfiguration(new NearCacheConfiguration()); } IgniteConfiguration cfg = getConfiguration(nodeName(idx)); cfg.setLocalHost(STR); cfg.setCacheConfiguration(ccfg); cfg.setConnectorConfiguration(null); return cfg; } | /**
* Node configuration.
*
* @param idx Node index.
* @return Node configuration.
* @throws Exception If failed.
*/ | Node configuration | configuration | {
"repo_name": "nizhikov/ignite",
"path": "modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheMultithreadedFailoverAbstractTest.java",
"license": "apache-2.0",
"size": 18679
} | [
"org.apache.ignite.configuration.CacheConfiguration",
"org.apache.ignite.configuration.IgniteConfiguration",
"org.apache.ignite.configuration.NearCacheConfiguration"
] | import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.configuration.NearCacheConfiguration; | import org.apache.ignite.configuration.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 376,387 |
IdentifierWrapper wrapper = IdentifierHelper.identifier(identifier);
String type = wrapper.getValueForXpathExpressionOrElse("@"
+ IfmapStrings.IDENTITY_ATTR_TYPE, "type"); // type
if (type.equals("other")) {
return true;
} else {
return false;
}
} | IdentifierWrapper wrapper = IdentifierHelper.identifier(identifier); String type = wrapper.getValueForXpathExpressionOrElse("@" + IfmapStrings.IDENTITY_ATTR_TYPE, "type"); if (type.equals("other")) { return true; } else { return false; } } | /**
* Checks whether a given {@link Identifier} is an extended identifier or not.
* Searches for the <i>type</i> attribute and checks if it is <i>other</i> or not.
*
* @param identifier
* the {@link Identifier} oject
* @return true if the {@link Identifier} object is an extended identifier
*/ | Checks whether a given <code>Identifier</code> is an extended identifier or not. Searches for the type attribute and checks if it is other or not | isExtendedIdentifier | {
"repo_name": "trustathsh/visitmeta",
"path": "visualization/src/main/java/de/hshannover/f4/trust/visitmeta/util/ExtendedIdentifierHelper.java",
"license": "apache-2.0",
"size": 3974
} | [
"de.hshannover.f4.trust.visitmeta.IfmapStrings"
] | import de.hshannover.f4.trust.visitmeta.IfmapStrings; | import de.hshannover.f4.trust.visitmeta.*; | [
"de.hshannover.f4"
] | de.hshannover.f4; | 1,021,230 |
public void filterByFullText(List<String> terms);
| void function(List<String> terms); | /**
* Filters the nodes by name and description.
*
* @param terms The collection of terms to handle.
*/ | Filters the nodes by name and description | filterByFullText | {
"repo_name": "chris-allan/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/agents/dataBrowser/view/DataBrowser.java",
"license": "gpl-2.0",
"size": 24081
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 950,917 |
EAttribute getClassBinding_To(); | EAttribute getClassBinding_To(); | /**
* Returns the meta object for the attribute '{@link fr.inria.diverse.melange.metamodel.melange.ClassBinding#getTo <em>To</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>To</em>'.
* @see fr.inria.diverse.melange.metamodel.melange.ClassBinding#getTo()
* @see #getClassBinding()
* @generated
*/ | Returns the meta object for the attribute '<code>fr.inria.diverse.melange.metamodel.melange.ClassBinding#getTo To</code>'. | getClassBinding_To | {
"repo_name": "diverse-project/melange",
"path": "plugins/fr.inria.diverse.melange.metamodel/src/main/java/fr/inria/diverse/melange/metamodel/melange/MelangePackage.java",
"license": "epl-1.0",
"size": 113615
} | [
"org.eclipse.emf.ecore.EAttribute"
] | import org.eclipse.emf.ecore.EAttribute; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 359,557 |
public static CapFloorInflationYearOnYearMonthlyDefinition from(final ZonedDateTime accrualStartDate, final ZonedDateTime paymentDate, final double notional,
final IndexPrice priceIndex, final int conventionalMonthLag, final int monthLag, final ZonedDateTime lastKnownFixingDate, final double strike, final boolean isCap) {
final ZonedDateTime referenceStartDate = accrualStartDate.minusMonths(monthLag).with(TemporalAdjusters.lastDayOfMonth());
final ZonedDateTime referenceEndDate = paymentDate.minusMonths(monthLag).with(TemporalAdjusters.lastDayOfMonth());
return new CapFloorInflationYearOnYearMonthlyDefinition(priceIndex.getCurrency(), paymentDate, accrualStartDate, paymentDate, 1.0, notional, priceIndex, lastKnownFixingDate, conventionalMonthLag,
monthLag, referenceStartDate, referenceEndDate, strike, isCap);
} | static CapFloorInflationYearOnYearMonthlyDefinition function(final ZonedDateTime accrualStartDate, final ZonedDateTime paymentDate, final double notional, final IndexPrice priceIndex, final int conventionalMonthLag, final int monthLag, final ZonedDateTime lastKnownFixingDate, final double strike, final boolean isCap) { final ZonedDateTime referenceStartDate = accrualStartDate.minusMonths(monthLag).with(TemporalAdjusters.lastDayOfMonth()); final ZonedDateTime referenceEndDate = paymentDate.minusMonths(monthLag).with(TemporalAdjusters.lastDayOfMonth()); return new CapFloorInflationYearOnYearMonthlyDefinition(priceIndex.getCurrency(), paymentDate, accrualStartDate, paymentDate, 1.0, notional, priceIndex, lastKnownFixingDate, conventionalMonthLag, monthLag, referenceStartDate, referenceEndDate, strike, isCap); } | /**
* Builder for inflation Year on Yearn based on an inflation lag and index publication. The fixing date is the publication lag after the last reference month.
* @param accrualStartDate Start date of the accrual period.
* @param paymentDate The payment date.
* @param notional Coupon notional.
* @param priceIndex The price index associated to the coupon.
* @param conventionalMonthLag The lag in month between the index validity and the coupon dates for the standard product.
* @param monthLag The lag in month between the index validity and the coupon dates for the actual product..
* @param lastKnownFixingDate The fixing date (always the first of a month) of the last known fixing.
* @param strike The strike
* @param isCap The cap/floor flag.
* @return The inflation zero-coupon cap/floor.
*/ | Builder for inflation Year on Yearn based on an inflation lag and index publication. The fixing date is the publication lag after the last reference month | from | {
"repo_name": "jeorme/OG-Platform",
"path": "projects/OG-Analytics/src/main/java/com/opengamma/analytics/financial/instrument/inflation/CapFloorInflationYearOnYearMonthlyDefinition.java",
"license": "apache-2.0",
"size": 16874
} | [
"com.opengamma.analytics.financial.instrument.index.IndexPrice",
"org.threeten.bp.ZonedDateTime",
"org.threeten.bp.temporal.TemporalAdjusters"
] | import com.opengamma.analytics.financial.instrument.index.IndexPrice; import org.threeten.bp.ZonedDateTime; import org.threeten.bp.temporal.TemporalAdjusters; | import com.opengamma.analytics.financial.instrument.index.*; import org.threeten.bp.*; import org.threeten.bp.temporal.*; | [
"com.opengamma.analytics",
"org.threeten.bp"
] | com.opengamma.analytics; org.threeten.bp; | 1,667,540 |
@Message(id = 30, value = "Interrupted waiting for result from host %s")
String interruptedAwaitingResultFromHost(String name);
// Disabled as part of WFCORE-378
// @Message(id = 31, value = "Exception getting result from host %s: %s")
// String exceptionAwaitingResultFromHost(String name, String message); | @Message(id = 30, value = STR) String interruptedAwaitingResultFromHost(String name); | /**
* A message indicating an interruption waiting for the result from host.
*
* @param name the name of the host.
*
* @return the message.
*/ | A message indicating an interruption waiting for the result from host | interruptedAwaitingResultFromHost | {
"repo_name": "jamezp/wildfly-core",
"path": "host-controller/src/main/java/org/jboss/as/domain/controller/logging/DomainControllerLogger.java",
"license": "lgpl-2.1",
"size": 34982
} | [
"org.jboss.logging.annotations.Message"
] | import org.jboss.logging.annotations.Message; | import org.jboss.logging.annotations.*; | [
"org.jboss.logging"
] | org.jboss.logging; | 468,274 |
OffsetDateTime endTime(); | OffsetDateTime endTime(); | /**
* Gets the endTime property: Observation end time.
*
* @return the endTime value.
*/ | Gets the endTime property: Observation end time | endTime | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/models/QueryStatistic.java",
"license": "mit",
"size": 2612
} | [
"java.time.OffsetDateTime"
] | import java.time.OffsetDateTime; | import java.time.*; | [
"java.time"
] | java.time; | 247,667 |
@Test
public void testApproximateNumericLiteral()
{
try
{
receiver = receiverSession.createReceiver(receiverQueue, "average = +6.2");
receiver = receiverSession.createReceiver(receiverQueue, "average = -95.7");
receiver = receiverSession.createReceiver(receiverQueue, "average = 7.");
}
catch (JMSException e)
{
fail(e);
}
} | void function() { try { receiver = receiverSession.createReceiver(receiverQueue, STR); receiver = receiverSession.createReceiver(receiverQueue, STR); receiver = receiverSession.createReceiver(receiverQueue, STR); } catch (JMSException e) { fail(e); } } | /**
* Test diffent syntax for approximate numeric literal (+6.2, -95.7, 7.)
*/ | Test diffent syntax for approximate numeric literal (+6.2, -95.7, 7.) | testApproximateNumericLiteral | {
"repo_name": "jbertram/activemq-artemis-old",
"path": "tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/selector/SelectorSyntaxTest.java",
"license": "apache-2.0",
"size": 11466
} | [
"javax.jms.JMSException"
] | import javax.jms.JMSException; | import javax.jms.*; | [
"javax.jms"
] | javax.jms; | 153,107 |
private void createSampledDomainOrder(ListOf<SampledVolume> losv){
int numDom = (int) losv.size();
List<Double> sampleList = new ArrayList<Double>();
for(int i = 0; i < numDom ; i++){
sampleList.add(losv.get(i).getSampledValue());
}
Collections.sort(sampleList);
for(int i = 0; i < numDom ; i++){
for(int j = 0 ; j < numDom ; j++){
SampledVolume sv = losv.get(j);
if(sampleList.get(i) == sv.getSampledValue()){
orderedList.add(sv.getDomainType());
}
}
}
}
| void function(ListOf<SampledVolume> losv){ int numDom = (int) losv.size(); List<Double> sampleList = new ArrayList<Double>(); for(int i = 0; i < numDom ; i++){ sampleList.add(losv.get(i).getSampledValue()); } Collections.sort(sampleList); for(int i = 0; i < numDom ; i++){ for(int j = 0 ; j < numDom ; j++){ SampledVolume sv = losv.get(j); if(sampleList.get(i) == sv.getSampledValue()){ orderedList.add(sv.getDomainType()); } } } } | /**
* Creates the sampled domain order.
*
* @param losv the list of SampledVolume
*/ | Creates the sampled domain order | createSampledDomainOrder | {
"repo_name": "spatialsimulator/XitoSBML",
"path": "src/main/java/jp/ac/keio/bio/fun/xitosbml/visual/DomainStruct.java",
"license": "apache-2.0",
"size": 6677
} | [
"java.util.ArrayList",
"java.util.Collections",
"java.util.List",
"org.sbml.jsbml.ListOf",
"org.sbml.jsbml.ext.spatial.SampledVolume"
] | import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.sbml.jsbml.ListOf; import org.sbml.jsbml.ext.spatial.SampledVolume; | import java.util.*; import org.sbml.jsbml.*; import org.sbml.jsbml.ext.spatial.*; | [
"java.util",
"org.sbml.jsbml"
] | java.util; org.sbml.jsbml; | 574,833 |
Console.getConsole().sendMessage("§c" + message);
} | Console.getConsole().sendMessage("§c" + message); } | /**
* Prints the message in the console
*/ | Prints the message in the console | print | {
"repo_name": "iAmGio/jrfl",
"path": "src/eu/iamgio/jrfl/exceptions/JrflException.java",
"license": "apache-2.0",
"size": 502
} | [
"eu.iamgio.jrfl.Console"
] | import eu.iamgio.jrfl.Console; | import eu.iamgio.jrfl.*; | [
"eu.iamgio.jrfl"
] | eu.iamgio.jrfl; | 1,393,140 |
@FIXVersion(introduced="4.2")
@TagNumRef(tagNum=TagNum.SolicitedFlag)
public void setSolicitedFlag(Boolean solicitedFlag) {
this.solicitedFlag = solicitedFlag;
} | @FIXVersion(introduced="4.2") @TagNumRef(tagNum=TagNum.SolicitedFlag) void function(Boolean solicitedFlag) { this.solicitedFlag = solicitedFlag; } | /**
* Message field setter.
* @param solicitedFlag field value
*/ | Message field setter | setSolicitedFlag | {
"repo_name": "marvisan/HadesFIX",
"path": "Model/src/main/java/net/hades/fix/message/OrderModificationRequestMsg.java",
"license": "gpl-3.0",
"size": 149491
} | [
"net.hades.fix.message.anno.FIXVersion",
"net.hades.fix.message.anno.TagNumRef",
"net.hades.fix.message.type.TagNum"
] | import net.hades.fix.message.anno.FIXVersion; import net.hades.fix.message.anno.TagNumRef; import net.hades.fix.message.type.TagNum; | import net.hades.fix.message.anno.*; import net.hades.fix.message.type.*; | [
"net.hades.fix"
] | net.hades.fix; | 1,390,245 |
private void checkClientReconnect(final boolean restartCache) throws Exception {
// Start complex topology.
final Ignite srv = ignitionStart(serverConfiguration(1));
ignitionStart(serverConfiguration(2));
ignitionStart(serverConfiguration(3, true));
final Ignite cli = ignitionStart(clientConfiguration(4));
createSqlCache(cli); | void function(final boolean restartCache) throws Exception { final Ignite srv = ignitionStart(serverConfiguration(1)); ignitionStart(serverConfiguration(2)); ignitionStart(serverConfiguration(3, true)); final Ignite cli = ignitionStart(clientConfiguration(4)); createSqlCache(cli); | /**
* Make sure that client receives schema changes made while it was disconnected, optionally with cache restart
* in the interim.
*
* @param restartCache Whether cache needs to be recreated during client's absence.
* @throws Exception If failed.
*/ | Make sure that client receives schema changes made while it was disconnected, optionally with cache restart in the interim | checkClientReconnect | {
"repo_name": "WilliamDo/ignite",
"path": "modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractConcurrentSelfTest.java",
"license": "apache-2.0",
"size": 37150
} | [
"org.apache.ignite.Ignite"
] | import org.apache.ignite.Ignite; | import org.apache.ignite.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 1,815,488 |
protected void launchTasks(List<LaunchableTask> tasks) {
// Group the tasks by offer
Map<Protos.Offer, List<LaunchableTask>> tasksGroupByOffer = new HashMap<>();
for (LaunchableTask task : tasks) {
List<LaunchableTask> subTasks = tasksGroupByOffer.get(task.offer);
if (subTasks == null) {
subTasks = new LinkedList<>();
}
subTasks.add(task);
tasksGroupByOffer.put(task.offer, subTasks);
}
// Construct the Mesos TaskInfo to launch
for (Map.Entry<Protos.Offer, List<LaunchableTask>> kv : tasksGroupByOffer.entrySet()) {
// We would launch taks for the same offer at one shot
Protos.Offer offer = kv.getKey();
List<LaunchableTask> subTasks = kv.getValue();
List<Protos.TaskInfo> mesosTasks = new LinkedList<>();
for (LaunchableTask task : subTasks) {
Protos.TaskInfo pTask = task.constructMesosTaskInfo(heronConfig, heronRuntime);
mesosTasks.add(pTask);
}
LOG.info("Launching tasks from offer: " + offer + " with tasks: " + mesosTasks);
// Launch the tasks for the same offer
Protos.Status status =
driver.launchTasks(Arrays.asList(new Protos.OfferID[]{offer.getId()}),
mesosTasks);
if (status == Protos.Status.DRIVER_RUNNING) {
LOG.info(String.format("Tasks launched, status: '%s'", status));
} else {
LOG.severe("Other status returned: " + status);
// Handled failed tasks
for (LaunchableTask task : tasks) {
handleMesosFailure(task.taskId);
// No need to decline the offers; mesos master already reclaim them
}
}
}
} | void function(List<LaunchableTask> tasks) { Map<Protos.Offer, List<LaunchableTask>> tasksGroupByOffer = new HashMap<>(); for (LaunchableTask task : tasks) { List<LaunchableTask> subTasks = tasksGroupByOffer.get(task.offer); if (subTasks == null) { subTasks = new LinkedList<>(); } subTasks.add(task); tasksGroupByOffer.put(task.offer, subTasks); } for (Map.Entry<Protos.Offer, List<LaunchableTask>> kv : tasksGroupByOffer.entrySet()) { Protos.Offer offer = kv.getKey(); List<LaunchableTask> subTasks = kv.getValue(); List<Protos.TaskInfo> mesosTasks = new LinkedList<>(); for (LaunchableTask task : subTasks) { Protos.TaskInfo pTask = task.constructMesosTaskInfo(heronConfig, heronRuntime); mesosTasks.add(pTask); } LOG.info(STR + offer + STR + mesosTasks); Protos.Status status = driver.launchTasks(Arrays.asList(new Protos.OfferID[]{offer.getId()}), mesosTasks); if (status == Protos.Status.DRIVER_RUNNING) { LOG.info(String.format(STR, status)); } else { LOG.severe(STR + status); for (LaunchableTask task : tasks) { handleMesosFailure(task.taskId); } } } } | /**
* Launch tasks
*
* @param tasks list of LaunchableTask
*/ | Launch tasks | launchTasks | {
"repo_name": "mycFelix/heron",
"path": "heron/schedulers/src/java/org/apache/heron/scheduler/mesos/framework/MesosFramework.java",
"license": "apache-2.0",
"size": 18295
} | [
"java.util.Arrays",
"java.util.HashMap",
"java.util.LinkedList",
"java.util.List",
"java.util.Map",
"org.apache.mesos.Protos"
] | import java.util.Arrays; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import org.apache.mesos.Protos; | import java.util.*; import org.apache.mesos.*; | [
"java.util",
"org.apache.mesos"
] | java.util; org.apache.mesos; | 2,515,596 |
@Test
public void shouldThrownAccessExceptionWhenInnerMethodCallThrowsIt()
throws Exception {
// p4ic4idea: use a public, non-abstract class with default constructor
expectedThrowsExceptions(AccessException.AccessExceptionForTests.class, AccessException.class);
} | void function() throws Exception { expectedThrowsExceptions(AccessException.AccessExceptionForTests.class, AccessException.class); } | /**
* Expected throws <code>ConnectioAccessExceptionnException</code> when inner method call throws it
*
* @throws Exception
*/ | Expected throws <code>ConnectioAccessExceptionnException</code> when inner method call throws it | shouldThrownAccessExceptionWhenInnerMethodCallThrowsIt | {
"repo_name": "groboclown/p4ic4idea",
"path": "p4java/src/test/java/com/perforce/p4java/impl/mapbased/server/cmd/ReviewsDelegatorTest.java",
"license": "apache-2.0",
"size": 10887
} | [
"com.perforce.p4java.exception.AccessException"
] | import com.perforce.p4java.exception.AccessException; | import com.perforce.p4java.exception.*; | [
"com.perforce.p4java"
] | com.perforce.p4java; | 1,760,447 |
public static MozuClient<List<String>> getAvailablePaymentActionsForReturnClient(String returnId, String paymentId) throws Exception
{
MozuUrl url = com.mozu.api.urls.commerce.ReturnUrl.getAvailablePaymentActionsForReturnUrl(paymentId, returnId);
String verb = "GET";
Class<?> clz = new ArrayList<String>(){}.getClass();
MozuClient<List<String>> mozuClient = (MozuClient<List<String>>) MozuClientFactory.getInstance(clz);
mozuClient.setVerb(verb);
mozuClient.setResourceUrl(url);
return mozuClient;
} | static MozuClient<List<String>> function(String returnId, String paymentId) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.ReturnUrl.getAvailablePaymentActionsForReturnUrl(paymentId, returnId); String verb = "GET"; Class<?> clz = new ArrayList<String>(){}.getClass(); MozuClient<List<String>> mozuClient = (MozuClient<List<String>>) MozuClientFactory.getInstance(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); return mozuClient; } | /**
* Retrieves a list of the payment actions available to perform for the specified return when a return results in a refund to the customer.
* <p><pre><code>
* MozuClient<List<String>> mozuClient=GetAvailablePaymentActionsForReturnClient( returnId, paymentId);
* client.setBaseAddress(url);
* client.executeRequest();
* string string = client.Result();
* </code></pre></p>
* @param paymentId Unique identifier of the payment for which to perform the action.
* @param returnId Unique identifier of the return whose items you want to get.
* @return Mozu.Api.MozuClient <List<string>>
* @see string
*/ | Retrieves a list of the payment actions available to perform for the specified return when a return results in a refund to the customer. <code><code> MozuClient> mozuClient=GetAvailablePaymentActionsForReturnClient( returnId, paymentId); client.setBaseAddress(url); client.executeRequest(); string string = client.Result(); </code></code> | getAvailablePaymentActionsForReturnClient | {
"repo_name": "lakshmi-nair/mozu-java",
"path": "mozu-javaasync-core/src/main/java/com/mozu/api/clients/commerce/ReturnClient.java",
"license": "mit",
"size": 38313
} | [
"com.mozu.api.MozuClient",
"com.mozu.api.MozuClientFactory",
"com.mozu.api.MozuUrl",
"java.util.ArrayList",
"java.util.List"
] | import com.mozu.api.MozuClient; import com.mozu.api.MozuClientFactory; import com.mozu.api.MozuUrl; import java.util.ArrayList; import java.util.List; | import com.mozu.api.*; import java.util.*; | [
"com.mozu.api",
"java.util"
] | com.mozu.api; java.util; | 715,250 |
private RadioGroup createDefaultRadioGroup() {
RadioGroup radioGroup = new RadioGroup(mContext);
RadioGroup.LayoutParams params = new RadioGroup.LayoutParams(
RadioGroup.LayoutParams.WRAP_CONTENT, RadioGroup.LayoutParams.WRAP_CONTENT);
RadioButton choice0 = new RadioButton(mContext);
choice0.setText("choice0");
choice0.setId(BUTTON_ID_0);
radioGroup.addView(choice0, params);
RadioButton choice1 = new RadioButton(mContext);
choice1.setText("choice1");
choice1.setId(BUTTON_ID_1);
radioGroup.addView(choice1, params);
RadioButton choice2 = new RadioButton(mContext);
choice2.setText("choice2");
choice2.setId(BUTTON_ID_2);
radioGroup.addView(choice2, params);
RadioButton choice3 = new RadioButton(mContext);
choice3.setText("choice3");
choice3.setId(BUTTON_ID_3);
radioGroup.addView(choice3, params);
return radioGroup;
} | RadioGroup function() { RadioGroup radioGroup = new RadioGroup(mContext); RadioGroup.LayoutParams params = new RadioGroup.LayoutParams( RadioGroup.LayoutParams.WRAP_CONTENT, RadioGroup.LayoutParams.WRAP_CONTENT); RadioButton choice0 = new RadioButton(mContext); choice0.setText(STR); choice0.setId(BUTTON_ID_0); radioGroup.addView(choice0, params); RadioButton choice1 = new RadioButton(mContext); choice1.setText(STR); choice1.setId(BUTTON_ID_1); radioGroup.addView(choice1, params); RadioButton choice2 = new RadioButton(mContext); choice2.setText(STR); choice2.setId(BUTTON_ID_2); radioGroup.addView(choice2, params); RadioButton choice3 = new RadioButton(mContext); choice3.setText(STR); choice3.setId(BUTTON_ID_3); radioGroup.addView(choice3, params); return radioGroup; } | /**
* Initialises the group with 4 RadioButtons which IDs are
* BUTTON_ID_0, BUTTON_ID_1, BUTTON_ID_2, BUTTON_ID_3.
*/ | Initialises the group with 4 RadioButtons which IDs are BUTTON_ID_0, BUTTON_ID_1, BUTTON_ID_2, BUTTON_ID_3 | createDefaultRadioGroup | {
"repo_name": "wiki2014/Learning-Summary",
"path": "alps/cts/tests/tests/widget/src/android/widget/cts/RadioGroupTest.java",
"license": "gpl-3.0",
"size": 22084
} | [
"android.widget.RadioButton",
"android.widget.RadioGroup"
] | import android.widget.RadioButton; import android.widget.RadioGroup; | import android.widget.*; | [
"android.widget"
] | android.widget; | 2,874,190 |
private ScheduledFuture schedulePeriodical(Runnable runnable,
ScheduledExecutorService service) {
return service.scheduleWithFixedDelay(
runnable, getDelay().getValue(), getPeriod().getValue(),
TimeUnit.MILLISECONDS);
} | ScheduledFuture function(Runnable runnable, ScheduledExecutorService service) { return service.scheduleWithFixedDelay( runnable, getDelay().getValue(), getPeriod().getValue(), TimeUnit.MILLISECONDS); } | /**
* Schedules periodical task.
* @param runnable runnable to schedule
* @param service service used to schedule
* @return scheduled future
*/ | Schedules periodical task | schedulePeriodical | {
"repo_name": "GeoinformationSystems/GeoprocessingAppstore",
"path": "src/com/esri/gpt/framework/scheduler/ThreadDefinition.java",
"license": "apache-2.0",
"size": 7682
} | [
"java.util.concurrent.ScheduledExecutorService",
"java.util.concurrent.ScheduledFuture",
"java.util.concurrent.TimeUnit"
] | import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 991,223 |
public void createModel() {
URI resourceURI = EditUIUtil.getURI(getEditorInput(), editingDomain.getResourceSet().getURIConverter());
Exception exception = null;
Resource resource = null;
try {
// Load the resource through the editing domain.
//
resource = editingDomain.getResourceSet().getResource(resourceURI, true);
}
catch (Exception e) {
exception = e;
resource = editingDomain.getResourceSet().getResource(resourceURI, false);
}
Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
if (diagnostic.getSeverity() != Diagnostic.OK) {
resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
}
editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
}
| void function() { URI resourceURI = EditUIUtil.getURI(getEditorInput(), editingDomain.getResourceSet().getURIConverter()); Exception exception = null; Resource resource = null; try { resource = editingDomain.getResourceSet().getResource(resourceURI, true); } catch (Exception e) { exception = e; resource = editingDomain.getResourceSet().getResource(resourceURI, false); } Diagnostic diagnostic = analyzeResourceProblems(resource, exception); if (diagnostic.getSeverity() != Diagnostic.OK) { resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); } editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter); } | /**
* This is the method called to load a resource into the editing domain's resource set based on the editor's input.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This is the method called to load a resource into the editing domain's resource set based on the editor's input. | createModel | {
"repo_name": "nsantos2014/mongopadplusplus",
"path": "org.github.mongopadplusplus.editor/src/main/java/org/github/mongopadplusplus/presentation/MongoPadPPEditor.java",
"license": "apache-2.0",
"size": 52004
} | [
"org.eclipse.emf.common.util.Diagnostic",
"org.eclipse.emf.ecore.resource.Resource",
"org.eclipse.emf.edit.ui.util.EditUIUtil"
] | import org.eclipse.emf.common.util.Diagnostic; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.edit.ui.util.EditUIUtil; | import org.eclipse.emf.common.util.*; import org.eclipse.emf.ecore.resource.*; import org.eclipse.emf.edit.ui.util.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 967,274 |
public DateHolder setBeginOfWeek()
{
calendar.set(Calendar.DAY_OF_WEEK, getFirstDayOfWeek());
setBeginOfDay();
return this;
} | DateHolder function() { calendar.set(Calendar.DAY_OF_WEEK, getFirstDayOfWeek()); setBeginOfDay(); return this; } | /**
* Sets the date to the beginning of the week (first day of week) and calls setBeginOfDay.
* @see #setBeginOfDay()
*/ | Sets the date to the beginning of the week (first day of week) and calls setBeginOfDay | setBeginOfWeek | {
"repo_name": "micromata/projectforge-webapp",
"path": "src/main/java/org/projectforge/common/DateHolder.java",
"license": "gpl-3.0",
"size": 21653
} | [
"java.util.Calendar"
] | import java.util.Calendar; | import java.util.*; | [
"java.util"
] | java.util; | 655,288 |
public void increaseLevel(int nodeId, int endpoint) {
ZWaveNode node = this.getNode(nodeId);
SerialMessage serialMessage = null;
ZWaveMultiLevelSwitchCommandClass zwaveCommandClass = (ZWaveMultiLevelSwitchCommandClass)node.resolveCommandClass(CommandClass.SWITCH_MULTILEVEL, endpoint);
if (zwaveCommandClass == null) {
logger.error("No Command Class found on node {}, instance/endpoint {} to request level.", nodeId, endpoint);
return;
}
serialMessage = node.encapsulate(zwaveCommandClass.increaseLevelMessage(), zwaveCommandClass, endpoint);
if (serialMessage != null)
{
this.sendData(serialMessage);
ZWaveEvent zEvent = new ZWaveEvent(ZWaveEventType.DIMMER_EVENT, nodeId, endpoint, zwaveCommandClass.getLevel());
this.notifyEventListeners(zEvent);
}
} | void function(int nodeId, int endpoint) { ZWaveNode node = this.getNode(nodeId); SerialMessage serialMessage = null; ZWaveMultiLevelSwitchCommandClass zwaveCommandClass = (ZWaveMultiLevelSwitchCommandClass)node.resolveCommandClass(CommandClass.SWITCH_MULTILEVEL, endpoint); if (zwaveCommandClass == null) { logger.error(STR, nodeId, endpoint); return; } serialMessage = node.encapsulate(zwaveCommandClass.increaseLevelMessage(), zwaveCommandClass, endpoint); if (serialMessage != null) { this.sendData(serialMessage); ZWaveEvent zEvent = new ZWaveEvent(ZWaveEventType.DIMMER_EVENT, nodeId, endpoint, zwaveCommandClass.getLevel()); this.notifyEventListeners(zEvent); } } | /**
* increase level on the node / endpoint. The level is
* increased. Only dimmers support this.
* @param nodeId the node id to increase the level for.
* @param endpoint the endpoint to increase the level for.
*/ | increase level on the node / endpoint. The level is increased. Only dimmers support this | increaseLevel | {
"repo_name": "noushadali/openhab",
"path": "bundles/binding/org.openhab.binding.zwave/src/main/java/org/openhab/binding/zwave/internal/protocol/ZWaveController.java",
"license": "gpl-3.0",
"size": 53107
} | [
"org.openhab.binding.zwave.internal.commandclass.ZWaveCommandClass",
"org.openhab.binding.zwave.internal.commandclass.ZWaveMultiLevelSwitchCommandClass",
"org.openhab.binding.zwave.internal.protocol.ZWaveEvent"
] | import org.openhab.binding.zwave.internal.commandclass.ZWaveCommandClass; import org.openhab.binding.zwave.internal.commandclass.ZWaveMultiLevelSwitchCommandClass; import org.openhab.binding.zwave.internal.protocol.ZWaveEvent; | import org.openhab.binding.zwave.internal.commandclass.*; import org.openhab.binding.zwave.internal.protocol.*; | [
"org.openhab.binding"
] | org.openhab.binding; | 82,611 |
RestBindingJaxbDataFormatFactory getRestBindingJaxbDataFormatFactory(); | RestBindingJaxbDataFormatFactory getRestBindingJaxbDataFormatFactory(); | /**
* Gets the {@link RestBindingJaxbDataFormatFactory} to be used.
*/ | Gets the <code>RestBindingJaxbDataFormatFactory</code> to be used | getRestBindingJaxbDataFormatFactory | {
"repo_name": "nikhilvibhav/camel",
"path": "core/camel-api/src/main/java/org/apache/camel/ExtendedCamelContext.java",
"license": "apache-2.0",
"size": 27051
} | [
"org.apache.camel.spi.RestBindingJaxbDataFormatFactory"
] | import org.apache.camel.spi.RestBindingJaxbDataFormatFactory; | import org.apache.camel.spi.*; | [
"org.apache.camel"
] | org.apache.camel; | 1,354,586 |
public ConstantAction getCreateSequenceConstantAction
(
TableName sequenceName,
DataTypeDescriptor dataType,
long initialValue,
long stepValue,
long maxValue,
long minValue,
boolean cycle
)
{
return new CreateSequenceConstantAction(sequenceName.getSchemaName(),
sequenceName.getTableName(),
dataType,
initialValue,
stepValue,
maxValue,
minValue,
cycle);
} | ConstantAction function ( TableName sequenceName, DataTypeDescriptor dataType, long initialValue, long stepValue, long maxValue, long minValue, boolean cycle ) { return new CreateSequenceConstantAction(sequenceName.getSchemaName(), sequenceName.getTableName(), dataType, initialValue, stepValue, maxValue, minValue, cycle); } | /**
* Make the ConstantAction for a CREATE SEQUENCE statement.
*
* @param sequenceName Name of sequence.
* @param dataType
* @param initialValue
* @param stepValue
* @param maxValue
* @param minValue
* @param cycle
*/ | Make the ConstantAction for a CREATE SEQUENCE statement | getCreateSequenceConstantAction | {
"repo_name": "scnakandala/derby",
"path": "java/engine/org/apache/derby/impl/sql/execute/GenericConstantActionFactory.java",
"license": "apache-2.0",
"size": 40467
} | [
"org.apache.derby.iapi.sql.execute.ConstantAction",
"org.apache.derby.iapi.types.DataTypeDescriptor",
"org.apache.derby.impl.sql.compile.TableName"
] | import org.apache.derby.iapi.sql.execute.ConstantAction; import org.apache.derby.iapi.types.DataTypeDescriptor; import org.apache.derby.impl.sql.compile.TableName; | import org.apache.derby.iapi.sql.execute.*; import org.apache.derby.iapi.types.*; import org.apache.derby.impl.sql.compile.*; | [
"org.apache.derby"
] | org.apache.derby; | 1,935,354 |
public ManagedCustomer getMcc(Long customerId) throws RemoteException {
ManagedCustomer mcc = getManagedCustomer(customerId);
if (mcc.getCanManageClients()) {
return mcc;
} else {
throw new UtilityLibraryException("Error: result empty for getMcc(Long customerId)");
}
} | ManagedCustomer function(Long customerId) throws RemoteException { ManagedCustomer mcc = getManagedCustomer(customerId); if (mcc.getCanManageClients()) { return mcc; } else { throw new UtilityLibraryException(STR); } } | /**
* Gets the (sub)MCCs for the ExtendedMcc for a list of customerIds.
*
* @param customerId the id of the MCC to retrieve
* @return a (sub) MCCs for the ExtendedMcc for the customerId
* @throws UtilityLibraryException if there is an error in the reflection call
* @throws RemoteException for communication-related exceptions
*/ | Gets the (sub)MCCs for the ExtendedMcc for a list of customerIds | getMcc | {
"repo_name": "stoksey69/googleads-java-lib",
"path": "modules/adwords_axis_utility_extension/src/main/java/com/google/api/ads/adwords/axis/utility/extension/ExtendedMcc.java",
"license": "apache-2.0",
"size": 17408
} | [
"com.google.api.ads.adwords.axis.utility.extension.exception.UtilityLibraryException",
"com.google.api.ads.adwords.axis.v201506.mcm.ManagedCustomer",
"java.rmi.RemoteException"
] | import com.google.api.ads.adwords.axis.utility.extension.exception.UtilityLibraryException; import com.google.api.ads.adwords.axis.v201506.mcm.ManagedCustomer; import java.rmi.RemoteException; | import com.google.api.ads.adwords.axis.utility.extension.exception.*; import com.google.api.ads.adwords.axis.v201506.mcm.*; import java.rmi.*; | [
"com.google.api",
"java.rmi"
] | com.google.api; java.rmi; | 1,658,111 |
void setTransactionMode(TransactionMode transactionMode) throws SQLException; | void setTransactionMode(TransactionMode transactionMode) throws SQLException; | /**
* Sets the transaction mode to use for current transaction. This method may only be called when
* in a transaction, and before the transaction is actually started, i.e. before any statements
* have been executed in the transaction.
*
* @param transactionMode The transaction mode to use for the current transaction.
* <ul>
* <li>{@link TransactionMode#READ_ONLY_TRANSACTION} will create a read-only transaction and
* prevent any changes to written to the database through this transaction. The read
* timestamp to be used will be determined based on the current readOnlyStaleness
* setting of this connection. It is recommended to use {@link
* TransactionMode#READ_ONLY_TRANSACTION} instead of {@link
* TransactionMode#READ_WRITE_TRANSACTION} when possible, as read-only transactions do
* not acquire locks on Cloud Spanner, and read-only transactions never abort.
* <li>{@link TransactionMode#READ_WRITE_TRANSACTION} this value is only allowed when the
* connection is not in read-only mode and will create a read-write transaction. If
* {@link CloudSpannerJdbcConnection#isRetryAbortsInternally()} is <code>true</code>,
* each read/write transaction will keep track of a running SHA256 checksum for each
* {@link ResultSet} that is returned in order to be able to retry the transaction in
* case the transaction is aborted by Spanner.
* </ul>
*/ | Sets the transaction mode to use for current transaction. This method may only be called when in a transaction, and before the transaction is actually started, i.e. before any statements have been executed in the transaction | setTransactionMode | {
"repo_name": "googleapis/java-spanner-jdbc",
"path": "src/main/java/com/google/cloud/spanner/jdbc/CloudSpannerJdbcConnection.java",
"license": "apache-2.0",
"size": 18317
} | [
"com.google.cloud.spanner.connection.TransactionMode",
"java.sql.SQLException"
] | import com.google.cloud.spanner.connection.TransactionMode; import java.sql.SQLException; | import com.google.cloud.spanner.connection.*; import java.sql.*; | [
"com.google.cloud",
"java.sql"
] | com.google.cloud; java.sql; | 833,897 |
@Override
public void attachToVLAN(String providerVpnId, String providerVlanId) throws CloudException, InternalException {
// TODO Auto-generated method stub
}
| void function(String providerVpnId, String providerVlanId) throws CloudException, InternalException { } | /**
* Vlan was created when the VPN created
*/ | Vlan was created when the VPN created | attachToVLAN | {
"repo_name": "jeffrey-yan/dasein-cloud-azure",
"path": "src/main/java/org/dasein/cloud/azure/network/AzureVPNSupport.java",
"license": "apache-2.0",
"size": 21778
} | [
"org.dasein.cloud.CloudException",
"org.dasein.cloud.InternalException"
] | import org.dasein.cloud.CloudException; import org.dasein.cloud.InternalException; | import org.dasein.cloud.*; | [
"org.dasein.cloud"
] | org.dasein.cloud; | 187,698 |
boolean deleteDir(Path dir) throws IOException {
IOException lastIOE = null;
int i = 0;
do {
try {
return fs.delete(dir, true);
} catch (IOException ioe) {
lastIOE = ioe;
if (!fs.exists(dir)) return true;
// dir is there, retry deleting after some time.
try {
sleepBeforeRetry("Delete Directory", i+1);
} catch (InterruptedException e) {
throw (InterruptedIOException)new InterruptedIOException().initCause(e);
}
}
} while (++i <= hdfsClientRetriesNumber);
throw new IOException("Exception in DeleteDir", lastIOE);
} | boolean deleteDir(Path dir) throws IOException { IOException lastIOE = null; int i = 0; do { try { return fs.delete(dir, true); } catch (IOException ioe) { lastIOE = ioe; if (!fs.exists(dir)) return true; try { sleepBeforeRetry(STR, i+1); } catch (InterruptedException e) { throw (InterruptedIOException)new InterruptedIOException().initCause(e); } } } while (++i <= hdfsClientRetriesNumber); throw new IOException(STR, lastIOE); } | /**
* Deletes a directory. Assumes the user has already checked for this directory existence.
* @param dir
* @return true if the directory is deleted.
* @throws IOException
*/ | Deletes a directory. Assumes the user has already checked for this directory existence | deleteDir | {
"repo_name": "HubSpot/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java",
"license": "apache-2.0",
"size": 49337
} | [
"java.io.IOException",
"java.io.InterruptedIOException",
"org.apache.hadoop.fs.Path"
] | import java.io.IOException; import java.io.InterruptedIOException; import org.apache.hadoop.fs.Path; | import java.io.*; import org.apache.hadoop.fs.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 1,207,400 |
static synchronized void schedule(
final ConnectionPool.Evictor task, final long delay, final long period) {
if (null == executor) {
executor = new ScheduledThreadPoolExecutor(1, new EvictorThreadFactory());
executor.setRemoveOnCancelPolicy(true);
}
final ScheduledFuture<?> scheduledFuture =
executor.scheduleWithFixedDelay(task, delay, period, TimeUnit.MILLISECONDS);
task.setScheduledFuture(scheduledFuture);
} | static synchronized void schedule( final ConnectionPool.Evictor task, final long delay, final long period) { if (null == executor) { executor = new ScheduledThreadPoolExecutor(1, new EvictorThreadFactory()); executor.setRemoveOnCancelPolicy(true); } final ScheduledFuture<?> scheduledFuture = executor.scheduleWithFixedDelay(task, delay, period, TimeUnit.MILLISECONDS); task.setScheduledFuture(scheduledFuture); } | /**
* Adds the specified eviction task to the timer. Tasks that are added with a
* call to this method *must* call {@link #cancel()} to cancel the
* task to prevent memory and/or thread leaks in application server
* environments.
*
* @param task Task to be scheduled.
* @param delay Delay in milliseconds before task is executed.
* @param period Time in milliseconds between executions.
*/ | Adds the specified eviction task to the timer. Tasks that are added with a call to this method *must* call <code>#cancel()</code> to cancel the task to prevent memory and/or thread leaks in application server environments | schedule | {
"repo_name": "actiontech/dble",
"path": "src/main/java/com/actiontech/dble/backend/pool/EvictionTimer.java",
"license": "gpl-2.0",
"size": 3618
} | [
"java.util.concurrent.ScheduledFuture",
"java.util.concurrent.ScheduledThreadPoolExecutor",
"java.util.concurrent.TimeUnit"
] | import java.util.concurrent.ScheduledFuture; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.TimeUnit; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 453,994 |
@Override
public TextObject append(CharSequence text) {
if (maxTextLength>0 && stringBuilder.length()>=maxTextLength) return this;
text = textFilter.filter(text);
//unfortunately this code can't be put into a TextFilter because:
//1) the limit could not be detected early, a lot of work would be done to waste time and memory
//2) the last character of the existing string builder could not be seen. if it is a space, we don't want
// to add yet another space.
char pre = stringBuilder.length()==0 ? 0 : stringBuilder.charAt(stringBuilder.length()-1);
for (int i=0; i<text.length() && (maxTextLength==0 || stringBuilder.length()<maxTextLength); i++) {
char c = CharNormalizer.normalize(text.charAt(i));
if (c != ' ' || pre != ' ') {
stringBuilder.append(c);
}
pre = c;
}
return this;
} | TextObject function(CharSequence text) { if (maxTextLength>0 && stringBuilder.length()>=maxTextLength) return this; text = textFilter.filter(text); char pre = stringBuilder.length()==0 ? 0 : stringBuilder.charAt(stringBuilder.length()-1); for (int i=0; i<text.length() && (maxTextLength==0 stringBuilder.length()<maxTextLength); i++) { char c = CharNormalizer.normalize(text.charAt(i)); if (c != ' ' pre != ' ') { stringBuilder.append(c); } pre = c; } return this; } | /**
* Append the target text for language detection.
* If the total size of target text exceeds the limit size ,
* the rest is cut down.
*
* @param text the target text to append
*/ | Append the target text for language detection. If the total size of target text exceeds the limit size , the rest is cut down | append | {
"repo_name": "dignwei/language-detector",
"path": "src/main/java/com/optimaize/langdetect/text/TextObject.java",
"license": "apache-2.0",
"size": 4267
} | [
"com.cybozu.labs.langdetect.util.CharNormalizer"
] | import com.cybozu.labs.langdetect.util.CharNormalizer; | import com.cybozu.labs.langdetect.util.*; | [
"com.cybozu.labs"
] | com.cybozu.labs; | 1,019,901 |
@InterfaceAudience.Private
public static void setJobToken(Token<? extends TokenIdentifier> t,
Credentials credentials) {
credentials.addToken(JOB_TOKEN, t);
} | @InterfaceAudience.Private static void function(Token<? extends TokenIdentifier> t, Credentials credentials) { credentials.addToken(JOB_TOKEN, t); } | /**
* store job token
* @param t
*/ | store job token | setJobToken | {
"repo_name": "Bizyroth/hadoop",
"path": "hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/security/TokenCache.java",
"license": "apache-2.0",
"size": 8295
} | [
"org.apache.hadoop.classification.InterfaceAudience",
"org.apache.hadoop.security.Credentials",
"org.apache.hadoop.security.token.Token",
"org.apache.hadoop.security.token.TokenIdentifier"
] | import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.security.Credentials; import org.apache.hadoop.security.token.Token; import org.apache.hadoop.security.token.TokenIdentifier; | import org.apache.hadoop.classification.*; import org.apache.hadoop.security.*; import org.apache.hadoop.security.token.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 882,871 |
// Satellite position
// ********************
CircularOrbit circ =
new CircularOrbit(7178000.0, 0.5e-4, -0.5e-4, FastMath.toRadians(50.), FastMath.toRadians(270.),
FastMath.toRadians(5.300), PositionAngle.MEAN,
FramesFactory.getEME2000(), date, mu);
// Attitude laws
// ***************
// Elliptic earth shape
OneAxisEllipsoid earthShape = new OneAxisEllipsoid(6378136.460, 1 / 298.257222101, itrf);
// Target definition as a geodetic point AND as a position/velocity vector
GeodeticPoint geoTargetITRF2005C = new GeodeticPoint(FastMath.toRadians(43.36), FastMath.toRadians(1.26), 600.);
Vector3D pTargetITRF2005C = earthShape.transform(geoTargetITRF2005C);
// Attitude law definition from geodetic point target
TargetPointing geoTargetAttitudeLaw = new TargetPointing(geoTargetITRF2005C, earthShape);
// Attitude law definition from position/velocity target
TargetPointing pvTargetAttitudeLaw = new TargetPointing(itrf, pTargetITRF2005C);
// Check that both attitude are the same
// Get satellite rotation for target pointing law
Rotation rotPv = pvTargetAttitudeLaw.getAttitude(circ, date, circ.getFrame()).getRotation();
// Get satellite rotation for nadir pointing law
Rotation rotGeo = geoTargetAttitudeLaw.getAttitude(circ, date, circ.getFrame()).getRotation();
// Rotations composition
Rotation rotCompo = rotGeo.applyInverseTo(rotPv);
double angle = rotCompo.getAngle();
Assert.assertEquals(angle, 0.0, Utils.epsilonAngle);
} | CircularOrbit circ = new CircularOrbit(7178000.0, 0.5e-4, -0.5e-4, FastMath.toRadians(50.), FastMath.toRadians(270.), FastMath.toRadians(5.300), PositionAngle.MEAN, FramesFactory.getEME2000(), date, mu); OneAxisEllipsoid earthShape = new OneAxisEllipsoid(6378136.460, 1 / 298.257222101, itrf); GeodeticPoint geoTargetITRF2005C = new GeodeticPoint(FastMath.toRadians(43.36), FastMath.toRadians(1.26), 600.); Vector3D pTargetITRF2005C = earthShape.transform(geoTargetITRF2005C); TargetPointing geoTargetAttitudeLaw = new TargetPointing(geoTargetITRF2005C, earthShape); TargetPointing pvTargetAttitudeLaw = new TargetPointing(itrf, pTargetITRF2005C); Rotation rotPv = pvTargetAttitudeLaw.getAttitude(circ, date, circ.getFrame()).getRotation(); Rotation rotGeo = geoTargetAttitudeLaw.getAttitude(circ, date, circ.getFrame()).getRotation(); Rotation rotCompo = rotGeo.applyInverseTo(rotPv); double angle = rotCompo.getAngle(); Assert.assertEquals(angle, 0.0, Utils.epsilonAngle); } | /** Test if both constructors are equivalent
*/ | Test if both constructors are equivalent | testConstructors | {
"repo_name": "treeform/orekit",
"path": "src/test/java/org/orekit/attitudes/TargetPointingTest.java",
"license": "apache-2.0",
"size": 17819
} | [
"org.apache.commons.math3.geometry.euclidean.threed.Rotation",
"org.apache.commons.math3.geometry.euclidean.threed.Vector3D",
"org.apache.commons.math3.util.FastMath",
"org.junit.Assert",
"org.orekit.Utils",
"org.orekit.bodies.GeodeticPoint",
"org.orekit.bodies.OneAxisEllipsoid",
"org.orekit.frames.Fr... | import org.apache.commons.math3.geometry.euclidean.threed.Rotation; import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; import org.apache.commons.math3.util.FastMath; import org.junit.Assert; import org.orekit.Utils; import org.orekit.bodies.GeodeticPoint; import org.orekit.bodies.OneAxisEllipsoid; import org.orekit.frames.FramesFactory; import org.orekit.orbits.CircularOrbit; import org.orekit.orbits.PositionAngle; | import org.apache.commons.math3.geometry.euclidean.threed.*; import org.apache.commons.math3.util.*; import org.junit.*; import org.orekit.*; import org.orekit.bodies.*; import org.orekit.frames.*; import org.orekit.orbits.*; | [
"org.apache.commons",
"org.junit",
"org.orekit",
"org.orekit.bodies",
"org.orekit.frames",
"org.orekit.orbits"
] | org.apache.commons; org.junit; org.orekit; org.orekit.bodies; org.orekit.frames; org.orekit.orbits; | 1,878,987 |
private boolean checkServiceActivation(Class<?> serviceClass) {
ActivityManager manager = (ActivityManager) this.getSystemService(Context
.ACTIVITY_SERVICE);
assert manager != null;
for (ActivityManager.RunningServiceInfo service :
manager.getRunningServices(Integer.MAX_VALUE)) {
if (serviceClass.getName().equals(service.service.getClassName())) {
return true;
}
}
return false;
} | boolean function(Class<?> serviceClass) { ActivityManager manager = (ActivityManager) this.getSystemService(Context .ACTIVITY_SERVICE); assert manager != null; for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) { if (serviceClass.getName().equals(service.service.getClassName())) { return true; } } return false; } | /**
* Check whether the {@link #startBinderService(Class)} has been loaded before
*
* @param serviceClass Specific class to check whether activated
* @return True, the specified class is active
*/ | Check whether the <code>#startBinderService(Class)</code> has been loaded before | checkServiceActivation | {
"repo_name": "nicholaschum/substratum",
"path": "app/src/main/java/projekt/substratum/Substratum.java",
"license": "gpl-3.0",
"size": 16465
} | [
"android.app.ActivityManager",
"android.content.Context"
] | import android.app.ActivityManager; import android.content.Context; | import android.app.*; import android.content.*; | [
"android.app",
"android.content"
] | android.app; android.content; | 1,071,161 |
public long getTxnAbortId() {
return ((TxnAbort) targetLogEntry.getMainItem()).getId();
} | long function() { return ((TxnAbort) targetLogEntry.getMainItem()).getId(); } | /**
* Get the last txn abort id seen by the reader.
*/ | Get the last txn abort id seen by the reader | getTxnAbortId | {
"repo_name": "nologic/nabs",
"path": "client/trunk/shared/libraries/je-3.2.74/src/com/sleepycat/je/log/LNFileReader.java",
"license": "gpl-2.0",
"size": 6202
} | [
"com.sleepycat.je.txn.TxnAbort"
] | import com.sleepycat.je.txn.TxnAbort; | import com.sleepycat.je.txn.*; | [
"com.sleepycat.je"
] | com.sleepycat.je; | 2,383,046 |
// @Test
public void storeAllExtensionsPronom() throws FfmaClientException {
log.info("retrieve preservation LOD preservation rich data from LOD repositories and store it in database.");
String report = preservationRiskmanagementLodAnalysis
.storeAllExtensions(
"Pronom", true,
true);
log.info("report: " + report);
assertNotNull("Retrieved LOD data analysis report must not be null", report);
}
| log.info(STR); String report = preservationRiskmanagementLodAnalysis .storeAllExtensions( STR, true, true); log.info(STR + report); assertNotNull(STR, report); } | /**
* In this test Pronom repository is tested with overwriting collections in database.
* @throws FfmaClientException
*/ | In this test Pronom repository is tested with overwriting collections in database | storeAllExtensionsPronom | {
"repo_name": "ait-ngcms/ffma",
"path": "services/preservation-riskmanagement-client/src/test/java/ait/ffma/preservation/riskmanagement/client/TestLODAnalysis.java",
"license": "apache-2.0",
"size": 15760
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 1,809,481 |
public static final XMLErrorResources loadResourceBundle(String className)
throws MissingResourceException
{
Locale locale = Locale.getDefault();
String suffix = getResourceSuffix(locale);
try
{
// first try with the given locale
return (XMLErrorResources) ResourceBundle.getBundle(className
+ suffix, locale);
}
catch (MissingResourceException e)
{
try // try to fall back to en_US if we can't load
{
// Since we can't find the localized property file,
// fall back to en_US.
return (XMLErrorResources) ResourceBundle.getBundle(className,
new Locale("en", "US"));
}
catch (MissingResourceException e2)
{
// Now we are really in trouble.
// very bad, definitely very bad...not going to get very far
throw new MissingResourceException(
"Could not load any resource bundles.", className, "");
}
}
} | static final XMLErrorResources function(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try { return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { throw new MissingResourceException( STR, className, ""); } } } | /**
* Return a named ResourceBundle for a particular locale. This method mimics the behavior
* of ResourceBundle.getBundle().
*
* @param className the name of the class that implements the resource bundle.
* @return the ResourceBundle
* @throws MissingResourceException
*/ | Return a named ResourceBundle for a particular locale. This method mimics the behavior of ResourceBundle.getBundle() | loadResourceBundle | {
"repo_name": "openjdk-mirror/jdk7u-jaxp",
"path": "src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_TW.java",
"license": "gpl-2.0",
"size": 22357
} | [
"java.util.Locale",
"java.util.MissingResourceException",
"java.util.ResourceBundle"
] | import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; | import java.util.*; | [
"java.util"
] | java.util; | 1,005,646 |
private static void appendDate(StringBuilder message)
{
final String date = DATE_TIME_FORMAT.format(Calendar.getInstance().getTime());
message.append(date);
message.append(Constant.SPACE);
}
| static void function(StringBuilder message) { final String date = DATE_TIME_FORMAT.format(Calendar.getInstance().getTime()); message.append(date); message.append(Constant.SPACE); } | /**
* Append date.
*
* @param message The message builder.
*/ | Append date | appendDate | {
"repo_name": "b3dgs/lionengine",
"path": "lionengine-core/src/main/java/com/b3dgs/lionengine/VerboseFormatter.java",
"license": "gpl-3.0",
"size": 3811
} | [
"java.util.Calendar"
] | import java.util.Calendar; | import java.util.*; | [
"java.util"
] | java.util; | 1,046,853 |
default AdvancedFileEndpointConsumerBuilder onCompletionExceptionHandler(
ExceptionHandler onCompletionExceptionHandler) {
doSetProperty("onCompletionExceptionHandler", onCompletionExceptionHandler);
return this;
} | default AdvancedFileEndpointConsumerBuilder onCompletionExceptionHandler( ExceptionHandler onCompletionExceptionHandler) { doSetProperty(STR, onCompletionExceptionHandler); return this; } | /**
* To use a custom org.apache.camel.spi.ExceptionHandler to handle any
* thrown exceptions that happens during the file on completion process
* where the consumer does either a commit or rollback. The default
* implementation will log any exception at WARN level and ignore.
*
* The option is a: <code>org.apache.camel.spi.ExceptionHandler</code>
* type.
*
* Group: consumer (advanced)
*/ | To use a custom org.apache.camel.spi.ExceptionHandler to handle any thrown exceptions that happens during the file on completion process where the consumer does either a commit or rollback. The default implementation will log any exception at WARN level and ignore. The option is a: <code>org.apache.camel.spi.ExceptionHandler</code> type. Group: consumer (advanced) | onCompletionExceptionHandler | {
"repo_name": "adessaigne/camel",
"path": "core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/FileEndpointBuilderFactory.java",
"license": "apache-2.0",
"size": 150030
} | [
"org.apache.camel.spi.ExceptionHandler"
] | import org.apache.camel.spi.ExceptionHandler; | import org.apache.camel.spi.*; | [
"org.apache.camel"
] | org.apache.camel; | 1,598,576 |
@Override
public void initializeTopology() {
initTopology();
if (eosEnabled) {
try {
this.producer.beginTransaction();
} catch (final ProducerFencedException fatal) {
throw new TaskMigratedException(this, fatal);
}
transactionInFlight = true;
}
processorContext.initialized();
taskInitialized = true;
} | void function() { initTopology(); if (eosEnabled) { try { this.producer.beginTransaction(); } catch (final ProducerFencedException fatal) { throw new TaskMigratedException(this, fatal); } transactionInFlight = true; } processorContext.initialized(); taskInitialized = true; } | /**
* <pre>
* - (re-)initialize the topology of the task
* </pre>
*
* @throws TaskMigratedException if the task producer got fenced (EOS only)
*/ | <code> - (re-)initialize the topology of the task </code> | initializeTopology | {
"repo_name": "Esquive/kafka",
"path": "streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamTask.java",
"license": "apache-2.0",
"size": 32806
} | [
"org.apache.kafka.common.errors.ProducerFencedException",
"org.apache.kafka.streams.errors.TaskMigratedException"
] | import org.apache.kafka.common.errors.ProducerFencedException; import org.apache.kafka.streams.errors.TaskMigratedException; | import org.apache.kafka.common.errors.*; import org.apache.kafka.streams.errors.*; | [
"org.apache.kafka"
] | org.apache.kafka; | 2,412,518 |
public Key delMin() {
if (isEmpty()) throw new NoSuchElementException("Priority queue underflow");
Key min = pq[1];
exch(1, n--);
sink(1);
pq[n+1] = null; // to avoid loitering and help with garbage collection
if ((n > 0) && (n == (pq.length - 1) / 4)) resize(pq.length / 2);
assert isMinHeap();
return min;
} | Key function() { if (isEmpty()) throw new NoSuchElementException(STR); Key min = pq[1]; exch(1, n--); sink(1); pq[n+1] = null; if ((n > 0) && (n == (pq.length - 1) / 4)) resize(pq.length / 2); assert isMinHeap(); return min; } | /**
* Removes and returns a smallest key on this priority queue.
*
* @return a smallest key on this priority queue
* @throws NoSuchElementException if this priority queue is empty
*/ | Removes and returns a smallest key on this priority queue | delMin | {
"repo_name": "anevsky/algorithms",
"path": "princeton/src/main/java/edu/princeton/cs/algs4/MinPQ.java",
"license": "gpl-3.0",
"size": 10575
} | [
"java.util.NoSuchElementException"
] | import java.util.NoSuchElementException; | import java.util.*; | [
"java.util"
] | java.util; | 1,978,524 |
private double matrixGet(int a, int b) {
// Remote get from the primary node (where given row or column is stored locally).
return ignite().compute(groupForKey(CACHE_NAME, getBlockId(a, b))).call(() -> {
IgniteCache<BlockMatrixKey, BlockEntry> cache = Ignition.localIgnite().getOrCreateCache(CACHE_NAME);
BlockMatrixKey key = getCacheKey(getBlockId(a, b));
// Local get.
BlockEntry block = cache.localPeek(key, CachePeekMode.PRIMARY);
if (block == null)
block = cache.get(key);
return block == null ? 0.0 : block.get(a % block.rowSize(), b % block.columnSize());
});
} | double function(int a, int b) { return ignite().compute(groupForKey(CACHE_NAME, getBlockId(a, b))).call(() -> { IgniteCache<BlockMatrixKey, BlockEntry> cache = Ignition.localIgnite().getOrCreateCache(CACHE_NAME); BlockMatrixKey key = getCacheKey(getBlockId(a, b)); BlockEntry block = cache.localPeek(key, CachePeekMode.PRIMARY); if (block == null) block = cache.get(key); return block == null ? 0.0 : block.get(a % block.rowSize(), b % block.columnSize()); }); } | /**
* Distributed matrix get.
*
* @param a Row or column index.
* @param b Row or column index.
* @return Matrix value at (a, b) index.
*/ | Distributed matrix get | matrixGet | {
"repo_name": "ntikhonov/ignite",
"path": "modules/ml/src/main/java/org/apache/ignite/ml/math/impls/storage/matrix/BlockMatrixStorage.java",
"license": "apache-2.0",
"size": 12683
} | [
"org.apache.ignite.IgniteCache",
"org.apache.ignite.Ignition",
"org.apache.ignite.cache.CachePeekMode",
"org.apache.ignite.ml.math.distributed.keys.impl.BlockMatrixKey",
"org.apache.ignite.ml.math.impls.matrix.BlockEntry"
] | import org.apache.ignite.IgniteCache; import org.apache.ignite.Ignition; import org.apache.ignite.cache.CachePeekMode; import org.apache.ignite.ml.math.distributed.keys.impl.BlockMatrixKey; import org.apache.ignite.ml.math.impls.matrix.BlockEntry; | import org.apache.ignite.*; import org.apache.ignite.cache.*; import org.apache.ignite.ml.math.distributed.keys.impl.*; import org.apache.ignite.ml.math.impls.matrix.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 204,666 |
protected Statement findIfStatementAlreadyDeclared(Statement declarationStatement,
boolean sameClass, List<Statement> statements)
{
Statement foundStatement = null;
if (statements != null)
{
for (Statement statement : statements)
{
if ((!sameClass && declarationStatement.toString().equals(statement.toString()))
|| (sameClass && statement.getClass().equals(
declarationStatement.getClass())))
{
foundStatement = statement;
break;
}
}
}
return foundStatement;
}
| Statement function(Statement declarationStatement, boolean sameClass, List<Statement> statements) { Statement foundStatement = null; if (statements != null) { for (Statement statement : statements) { if ((!sameClass && declarationStatement.toString().equals(statement.toString())) (sameClass && statement.getClass().equals( declarationStatement.getClass()))) { foundStatement = statement; break; } } } return foundStatement; } | /**
* Finds a statement if already declared
* @param declarationStatement
* @param sameClass true, it will compare if there is the same statement class in the body of the methodDeclaration (but the content may be different), false it will ignore the class and it will compare if the content is the same (given by toString.equals())
* @param alreadyDeclared
* @param statements
* @return null if not found, the reference to the statement if it is found
*/ | Finds a statement if already declared | findIfStatementAlreadyDeclared | {
"repo_name": "rex-xxx/mt6572_x201",
"path": "tools/motodev/src/plugins/android.codeutils/src/com/motorola/studio/android/generatecode/AbstractCodeGenerator.java",
"license": "gpl-2.0",
"size": 26405
} | [
"java.util.List",
"org.eclipse.jdt.core.dom.Statement"
] | import java.util.List; import org.eclipse.jdt.core.dom.Statement; | import java.util.*; import org.eclipse.jdt.core.dom.*; | [
"java.util",
"org.eclipse.jdt"
] | java.util; org.eclipse.jdt; | 1,407,592 |
public Class<? extends Partition> getPartitionClass() {
return PARTITION_CLASS.get(this);
} | Class<? extends Partition> function() { return PARTITION_CLASS.get(this); } | /**
* Get Partition class used
* @return Partition class
*/ | Get Partition class used | getPartitionClass | {
"repo_name": "pmPartch/giraph",
"path": "giraph-core/src/main/java/org/apache/giraph/conf/GiraphConfiguration.java",
"license": "apache-2.0",
"size": 27425
} | [
"org.apache.giraph.partition.Partition"
] | import org.apache.giraph.partition.Partition; | import org.apache.giraph.partition.*; | [
"org.apache.giraph"
] | org.apache.giraph; | 2,828,258 |
int invalidateAfter(int position) {
if (mData == null) {
return RecyclerView.NO_POSITION;
}
if (position >= mData.length) {
return RecyclerView.NO_POSITION;
}
int endPosition = invalidateFullSpansAfter(position);
if (endPosition == RecyclerView.NO_POSITION) {
Arrays.fill(mData, position, mData.length, LayoutParams.INVALID_SPAN_ID);
return mData.length;
} else {
// just invalidate items in between
Arrays.fill(mData, position, endPosition + 1, LayoutParams.INVALID_SPAN_ID);
return endPosition + 1;
}
} | int invalidateAfter(int position) { if (mData == null) { return RecyclerView.NO_POSITION; } if (position >= mData.length) { return RecyclerView.NO_POSITION; } int endPosition = invalidateFullSpansAfter(position); if (endPosition == RecyclerView.NO_POSITION) { Arrays.fill(mData, position, mData.length, LayoutParams.INVALID_SPAN_ID); return mData.length; } else { Arrays.fill(mData, position, endPosition + 1, LayoutParams.INVALID_SPAN_ID); return endPosition + 1; } } | /**
* returns end position for invalidation.
*/ | returns end position for invalidation | invalidateAfter | {
"repo_name": "AylaGene/testRepo_Public",
"path": "TMessagesProj/src/main/java/org/telegram/messenger/support/widget/StaggeredGridLayoutManager.java",
"license": "gpl-2.0",
"size": 117836
} | [
"java.util.Arrays"
] | import java.util.Arrays; | import java.util.*; | [
"java.util"
] | java.util; | 1,066,962 |
private static int getReservedQualifier(byte[] bytes) {
checkArgument(bytes.length == 4);
int number = FOUR_BYTE_QUALIFIERS.decode(bytes);
if (!isReservedColumnQualifier(number)) {
throw new InvalidQualifierBytesException(4, bytes.length);
}
return number;
} | static int function(byte[] bytes) { checkArgument(bytes.length == 4); int number = FOUR_BYTE_QUALIFIERS.decode(bytes); if (!isReservedColumnQualifier(number)) { throw new InvalidQualifierBytesException(4, bytes.length); } return number; } | /**
* We generate our column qualifiers in the reserved range 0-10 using the FOUR_BYTE_QUALIFIERS
* encoding. When adding Cells corresponding to the reserved qualifiers to the
* EncodedColumnQualifierCells list, we need to make sure that we use the FOUR_BYTE_QUALIFIERS
* scheme to decode the correct int value.
*/ | We generate our column qualifiers in the reserved range 0-10 using the FOUR_BYTE_QUALIFIERS encoding. When adding Cells corresponding to the reserved qualifiers to the EncodedColumnQualifierCells list, we need to make sure that we use the FOUR_BYTE_QUALIFIERS scheme to decode the correct int value | getReservedQualifier | {
"repo_name": "ankitsinghal/phoenix",
"path": "phoenix-core/src/main/java/org/apache/phoenix/schema/PTable.java",
"license": "apache-2.0",
"size": 33322
} | [
"org.apache.phoenix.thirdparty.com.google.common.base.Preconditions"
] | import org.apache.phoenix.thirdparty.com.google.common.base.Preconditions; | import org.apache.phoenix.thirdparty.com.google.common.base.*; | [
"org.apache.phoenix"
] | org.apache.phoenix; | 1,845,063 |
@Messages({"# {0} - database name", "HashDbManager.noDbPath.message=Couldn't get valid database path for: {0}"})
private void configureSettings(HashLookupSettings settings) {
allDatabasesLoadedCorrectly = true;
List<HashDbInfo> hashDbInfoList = settings.getHashDbInfo();
for (HashDbInfo hashDb : hashDbInfoList) {
try {
String dbPath = this.getValidFilePath(hashDb.getHashSetName(), hashDb.getPath());
if (dbPath != null) {
addHashDatabase(SleuthkitJNI.openHashDatabase(dbPath), hashDb.getHashSetName(), hashDb.getSearchDuringIngest(), hashDb.getSendIngestMessages(), hashDb.getKnownFilesType());
} else {
logger.log(Level.WARNING, Bundle.HashDbManager_noDbPath_message(hashDb.getHashSetName()));
allDatabasesLoadedCorrectly = false;
}
} catch (TskCoreException ex) {
Logger.getLogger(HashDbManager.class.getName()).log(Level.SEVERE, "Error opening hash database", ex); //NON-NLS
JOptionPane.showMessageDialog(null,
NbBundle.getMessage(this.getClass(),
"HashDbManager.unableToOpenHashDbMsg", hashDb.getHashSetName()),
NbBundle.getMessage(this.getClass(), "HashDbManager.openHashDbErr"),
JOptionPane.ERROR_MESSAGE);
allDatabasesLoadedCorrectly = false;
}
}
if (!allDatabasesLoadedCorrectly && RuntimeProperties.runningWithGUI()) {
try {
HashLookupSettings.writeSettings(new HashLookupSettings(this.knownHashSets, this.knownBadHashSets));
allDatabasesLoadedCorrectly = true;
} catch (HashLookupSettings.HashLookupSettingsException ex) {
allDatabasesLoadedCorrectly = false;
logger.log(Level.SEVERE, "Could not overwrite hash database settings.", ex);
}
}
} | @Messages({STR, STR}) void function(HashLookupSettings settings) { allDatabasesLoadedCorrectly = true; List<HashDbInfo> hashDbInfoList = settings.getHashDbInfo(); for (HashDbInfo hashDb : hashDbInfoList) { try { String dbPath = this.getValidFilePath(hashDb.getHashSetName(), hashDb.getPath()); if (dbPath != null) { addHashDatabase(SleuthkitJNI.openHashDatabase(dbPath), hashDb.getHashSetName(), hashDb.getSearchDuringIngest(), hashDb.getSendIngestMessages(), hashDb.getKnownFilesType()); } else { logger.log(Level.WARNING, Bundle.HashDbManager_noDbPath_message(hashDb.getHashSetName())); allDatabasesLoadedCorrectly = false; } } catch (TskCoreException ex) { Logger.getLogger(HashDbManager.class.getName()).log(Level.SEVERE, STR, ex); JOptionPane.showMessageDialog(null, NbBundle.getMessage(this.getClass(), STR, hashDb.getHashSetName()), NbBundle.getMessage(this.getClass(), STR), JOptionPane.ERROR_MESSAGE); allDatabasesLoadedCorrectly = false; } } if (!allDatabasesLoadedCorrectly && RuntimeProperties.runningWithGUI()) { try { HashLookupSettings.writeSettings(new HashLookupSettings(this.knownHashSets, this.knownBadHashSets)); allDatabasesLoadedCorrectly = true; } catch (HashLookupSettings.HashLookupSettingsException ex) { allDatabasesLoadedCorrectly = false; logger.log(Level.SEVERE, STR, ex); } } } | /**
* Configures the given settings object by adding all contained hash db to
* the system.
*
* @param settings The settings to configure.
*/ | Configures the given settings object by adding all contained hash db to the system | configureSettings | {
"repo_name": "narfindustries/autopsy",
"path": "Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbManager.java",
"license": "apache-2.0",
"size": 36096
} | [
"java.util.List",
"java.util.logging.Level",
"javax.swing.JOptionPane",
"org.openide.util.NbBundle",
"org.sleuthkit.autopsy.core.RuntimeProperties",
"org.sleuthkit.autopsy.coreutils.Logger",
"org.sleuthkit.autopsy.modules.hashdatabase.HashLookupSettings",
"org.sleuthkit.datamodel.SleuthkitJNI",
"org... | import java.util.List; import java.util.logging.Level; import javax.swing.JOptionPane; import org.openide.util.NbBundle; import org.sleuthkit.autopsy.core.RuntimeProperties; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.modules.hashdatabase.HashLookupSettings; import org.sleuthkit.datamodel.SleuthkitJNI; import org.sleuthkit.datamodel.TskCoreException; | import java.util.*; import java.util.logging.*; import javax.swing.*; import org.openide.util.*; import org.sleuthkit.autopsy.core.*; import org.sleuthkit.autopsy.coreutils.*; import org.sleuthkit.autopsy.modules.hashdatabase.*; import org.sleuthkit.datamodel.*; | [
"java.util",
"javax.swing",
"org.openide.util",
"org.sleuthkit.autopsy",
"org.sleuthkit.datamodel"
] | java.util; javax.swing; org.openide.util; org.sleuthkit.autopsy; org.sleuthkit.datamodel; | 2,803,987 |
private JLabel getLblLogin2() {
if (lblLogin2 == null) {
lblLogin2 = new JLabel("Login");
lblLogin2.setFont(new Font("Tahoma", Font.PLAIN, 13));
}
return lblLogin2;
} | JLabel function() { if (lblLogin2 == null) { lblLogin2 = new JLabel("Login"); lblLogin2.setFont(new Font(STR, Font.PLAIN, 13)); } return lblLogin2; } | /**
* Devuelve el valor de lblLogin2
*
* @return lblLogin2
*/ | Devuelve el valor de lblLogin2 | getLblLogin2 | {
"repo_name": "Arquisoft/Trivial5a",
"path": "game/src/main/java/es/uniovi/asw/gui/ConfigurarPartida.java",
"license": "gpl-2.0",
"size": 26710
} | [
"java.awt.Font",
"javax.swing.JLabel"
] | import java.awt.Font; import javax.swing.JLabel; | import java.awt.*; import javax.swing.*; | [
"java.awt",
"javax.swing"
] | java.awt; javax.swing; | 1,310,842 |
public JsonPrimitive asJsonPrimitive(JsonElement source) {
return asJsonPrimitive(source, null);
} | JsonPrimitive function(JsonElement source) { return asJsonPrimitive(source, null); } | /**
* Returns the source json as a json primitive if possible. Else returns null
*
* @param source the source json element
* @return the source json as a json primitive
*/ | Returns the source json as a json primitive if possible. Else returns null | asJsonPrimitive | {
"repo_name": "balajeetm/json-mystique",
"path": "json-mystique-utils/gson-utils/src/main/java/com/balajeetm/mystique/util/gson/lever/JsonLever.java",
"license": "apache-2.0",
"size": 77289
} | [
"com.google.gson.JsonElement",
"com.google.gson.JsonPrimitive"
] | import com.google.gson.JsonElement; import com.google.gson.JsonPrimitive; | import com.google.gson.*; | [
"com.google.gson"
] | com.google.gson; | 2,740,964 |
@Deprecated
void preGet(final ObserverContext<RegionCoprocessorEnvironment> c, final Get get,
final List<KeyValue> result)
throws IOException; | void preGet(final ObserverContext<RegionCoprocessorEnvironment> c, final Get get, final List<KeyValue> result) throws IOException; | /**
* WARNING: please override preGetOp instead of this method. This is to maintain some
* compatibility and to ease the transition from 0.94 -> 0.96.
*/ | compatibility and to ease the transition from 0.94 -> 0.96 | preGet | {
"repo_name": "lilonglai/hbase-0.96.2",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java",
"license": "apache-2.0",
"size": 43529
} | [
"java.io.IOException",
"java.util.List",
"org.apache.hadoop.hbase.KeyValue",
"org.apache.hadoop.hbase.client.Get"
] | import java.io.IOException; import java.util.List; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.client.Get; | import java.io.*; import java.util.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.client.*; | [
"java.io",
"java.util",
"org.apache.hadoop"
] | java.io; java.util; org.apache.hadoop; | 2,580,837 |
public Identity getIdentity() throws TimeoutException, NotConnectedException {
ByteBuffer bb = ipcon.createRequestPacket((byte)8, FUNCTION_GET_IDENTITY, this);
byte[] response = sendRequest(bb.array());
bb = ByteBuffer.wrap(response, 8, response.length - 8);
bb.order(ByteOrder.LITTLE_ENDIAN);
Identity obj = new Identity();
obj.uid = IPConnection.string(bb, 8);
obj.connectedUid = IPConnection.string(bb, 8);
obj.position = (char)(bb.get());
for(int i = 0; i < 3; i++) {
obj.hardwareVersion[i] = IPConnection.unsignedByte(bb.get());
}
for(int i = 0; i < 3; i++) {
obj.firmwareVersion[i] = IPConnection.unsignedByte(bb.get());
}
obj.deviceIdentifier = IPConnection.unsignedShort(bb.getShort());
return obj;
} | Identity function() throws TimeoutException, NotConnectedException { ByteBuffer bb = ipcon.createRequestPacket((byte)8, FUNCTION_GET_IDENTITY, this); byte[] response = sendRequest(bb.array()); bb = ByteBuffer.wrap(response, 8, response.length - 8); bb.order(ByteOrder.LITTLE_ENDIAN); Identity obj = new Identity(); obj.uid = IPConnection.string(bb, 8); obj.connectedUid = IPConnection.string(bb, 8); obj.position = (char)(bb.get()); for(int i = 0; i < 3; i++) { obj.hardwareVersion[i] = IPConnection.unsignedByte(bb.get()); } for(int i = 0; i < 3; i++) { obj.firmwareVersion[i] = IPConnection.unsignedByte(bb.get()); } obj.deviceIdentifier = IPConnection.unsignedShort(bb.getShort()); return obj; } | /**
* Returns the UID, the UID where the Bricklet is connected to,
* the position, the hardware and firmware version as well as the
* device identifier.
*
* The position can be 'a', 'b', 'c' or 'd'.
*
* The device identifiers can be found :ref:`here <device_identifier>`.
*
* .. versionadded:: 2.0.0~(Plugin)
*/ | Returns the UID, the UID where the Bricklet is connected to, the position, the hardware and firmware version as well as the device identifier. The position can be 'a', 'b', 'c' or 'd'. The device identifiers can be found :ref:`here `. .. versionadded:: 2.0.0~(Plugin) | getIdentity | {
"repo_name": "jaggr2/ch.bfh.fbi.mobiComp.17herz",
"path": "com.tinkerforge/src/com/tinkerforge/BrickletIO4.java",
"license": "apache-2.0",
"size": 19927
} | [
"java.nio.ByteBuffer",
"java.nio.ByteOrder"
] | import java.nio.ByteBuffer; import java.nio.ByteOrder; | import java.nio.*; | [
"java.nio"
] | java.nio; | 1,347,856 |
static String[] splitOnTokens(String text) {
// used by wildcardMatch
// package level so a unit test may run on this
if (text.indexOf('?') == -1 && text.indexOf('*') == -1) {
return new String[] { text };
}
char[] array = text.toCharArray();
ArrayList<String> list = new ArrayList<String>();
StringBuilder buffer = new StringBuilder();
for (int i = 0; i < array.length; i++) {
if (array[i] == '?' || array[i] == '*') {
if (buffer.length() != 0) {
list.add(buffer.toString());
buffer.setLength(0);
}
if (array[i] == '?') {
list.add("?");
} else if (list.isEmpty() ||
i > 0 && list.get(list.size() - 1).equals("*") == false) {
list.add("*");
}
} else {
buffer.append(array[i]);
}
}
if (buffer.length() != 0) {
list.add(buffer.toString());
}
return list.toArray( new String[ list.size() ] );
} | static String[] splitOnTokens(String text) { if (text.indexOf('?') == -1 && text.indexOf('*') == -1) { return new String[] { text }; } char[] array = text.toCharArray(); ArrayList<String> list = new ArrayList<String>(); StringBuilder buffer = new StringBuilder(); for (int i = 0; i < array.length; i++) { if (array[i] == '?' array[i] == '*') { if (buffer.length() != 0) { list.add(buffer.toString()); buffer.setLength(0); } if (array[i] == '?') { list.add("?"); } else if (list.isEmpty() i > 0 && list.get(list.size() - 1).equals("*") == false) { list.add("*"); } } else { buffer.append(array[i]); } } if (buffer.length() != 0) { list.add(buffer.toString()); } return list.toArray( new String[ list.size() ] ); } | /**
* Splits a string into a number of tokens.
* The text is split by '?' and '*'.
* Where multiple '*' occur consecutively they are collapsed into a single '*'.
*
* @param text the text to split
* @return the array of tokens, never null
*/ | Splits a string into a number of tokens. The text is split by '?' and '*'. Where multiple '*' occur consecutively they are collapsed into a single '*' | splitOnTokens | {
"repo_name": "BeeShield/AndroidPicker",
"path": "library/src/main/java/cn/finalteam/rxgalleryfinal/utils/FilenameUtils.java",
"license": "apache-2.0",
"size": 39183
} | [
"java.util.ArrayList"
] | import java.util.ArrayList; | import java.util.*; | [
"java.util"
] | java.util; | 179,853 |
public CountDownLatch getProfilesAsync(String responseFields, AsyncCallback<com.mozu.api.contracts.shippingadmin.profile.ShippingProfileCollection> callback) throws Exception
{
MozuClient<com.mozu.api.contracts.shippingadmin.profile.ShippingProfileCollection> client = com.mozu.api.clients.commerce.shipping.admin.ShippingProfileClient.getProfilesClient( responseFields);
client.setContext(_apiContext);
return client.executeRequest(callback);
} | CountDownLatch function(String responseFields, AsyncCallback<com.mozu.api.contracts.shippingadmin.profile.ShippingProfileCollection> callback) throws Exception { MozuClient<com.mozu.api.contracts.shippingadmin.profile.ShippingProfileCollection> client = com.mozu.api.clients.commerce.shipping.admin.ShippingProfileClient.getProfilesClient( responseFields); client.setContext(_apiContext); return client.executeRequest(callback); } | /**
* Get Shipping Profiles for the Tenant/Master Catalog
* <p><pre><code>
* ShippingProfile shippingprofile = new ShippingProfile();
* CountDownLatch latch = shippingprofile.getProfiles( responseFields, callback );
* latch.await() * </code></pre></p>
* @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
* @param callback callback handler for asynchronous operations
* @param dataViewMode DataViewMode
* @return com.mozu.api.contracts.shippingadmin.profile.ShippingProfileCollection
* @see com.mozu.api.contracts.shippingadmin.profile.ShippingProfileCollection
*/ | Get Shipping Profiles for the Tenant/Master Catalog <code><code> ShippingProfile shippingprofile = new ShippingProfile(); CountDownLatch latch = shippingprofile.getProfiles( responseFields, callback ); latch.await() * </code></code> | getProfilesAsync | {
"repo_name": "lakshmi-nair/mozu-java",
"path": "mozu-javaasync-core/src/main/java/com/mozu/api/resources/commerce/shipping/admin/ShippingProfileResource.java",
"license": "mit",
"size": 4703
} | [
"com.mozu.api.AsyncCallback",
"com.mozu.api.MozuClient",
"java.util.concurrent.CountDownLatch"
] | import com.mozu.api.AsyncCallback; import com.mozu.api.MozuClient; import java.util.concurrent.CountDownLatch; | import com.mozu.api.*; import java.util.concurrent.*; | [
"com.mozu.api",
"java.util"
] | com.mozu.api; java.util; | 2,073,326 |
protected double norm(double score, Stats stats) {
if (norm) {
return (score - stats.getMean()) / stats.getStandardDeviation();
} else {
return score;
}
} | double function(double score, Stats stats) { if (norm) { return (score - stats.getMean()) / stats.getStandardDeviation(); } else { return score; } } | /**
* Returns the normalized value of a relevance or novelty score.
*
* @param score the relevance or novelty score
* @param stats the relevance or novelty statistics
* @return the normalized score
*/ | Returns the normalized value of a relevance or novelty score | norm | {
"repo_name": "OlafLee/RankSys",
"path": "RankSys-novdiv/src/main/java/es/uam/eps/ir/ranksys/novdiv/itemnovelty/reranking/ItemNoveltyReranker.java",
"license": "gpl-3.0",
"size": 4775
} | [
"es.uam.eps.ir.ranksys.core.util.Stats"
] | import es.uam.eps.ir.ranksys.core.util.Stats; | import es.uam.eps.ir.ranksys.core.util.*; | [
"es.uam.eps"
] | es.uam.eps; | 2,014,846 |
EList<Annotation> getAnnotations(); | EList<Annotation> getAnnotations(); | /**
* Returns the value of the '<em><b>Annotations</b></em>' containment reference list.
* The list contents are of type {@link org.eclipse.n4js.n4JS.Annotation}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Annotations</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Annotations</em>' containment reference list.
* @see org.eclipse.n4js.n4JS.N4JSPackage#getVariableDeclaration_Annotations()
* @model containment="true"
* @generated
*/ | Returns the value of the 'Annotations' containment reference list. The list contents are of type <code>org.eclipse.n4js.n4JS.Annotation</code>. If the meaning of the 'Annotations' containment reference list isn't clear, there really should be more of a description here... | getAnnotations | {
"repo_name": "lbeurerkellner/n4js",
"path": "plugins/org.eclipse.n4js.model/emf-gen/org/eclipse/n4js/n4JS/VariableDeclaration.java",
"license": "epl-1.0",
"size": 3403
} | [
"org.eclipse.emf.common.util.EList"
] | import org.eclipse.emf.common.util.EList; | import org.eclipse.emf.common.util.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 835,607 |
public final void setMarkup(final IMarkupFragment markup)
{
this.markup = markup;
}
/**
* Called once per request on components before they are about to be rendered. This method
* should be used to configure such things as visibility and enabled flags.
* <p>
* Overrides must call {@code super.onConfigure()}, usually before any other code
* <p>
* NOTE: Component hierarchy should not be modified inside this method, instead it should be
* done in {@link #onBeforeRender()} | final void function(final IMarkupFragment markup) { this.markup = markup; } /** * Called once per request on components before they are about to be rendered. This method * should be used to configure such things as visibility and enabled flags. * <p> * Overrides must call {@code super.onConfigure()}, usually before any other code * <p> * NOTE: Component hierarchy should not be modified inside this method, instead it should be * done in {@link #onBeforeRender()} | /**
* Set the markup for the component. Note that the component's markup variable is transient and
* thus must only be used for one render cycle. E.g. auto-component are using it. You may also
* it if you subclassed getMarkup().
*
* @param markup
*/ | Set the markup for the component. Note that the component's markup variable is transient and thus must only be used for one render cycle. E.g. auto-component are using it. You may also it if you subclassed getMarkup() | setMarkup | {
"repo_name": "zwsong/wicket",
"path": "wicket-core/src/main/java/org/apache/wicket/Component.java",
"license": "apache-2.0",
"size": 131241
} | [
"org.apache.wicket.markup.IMarkupFragment"
] | import org.apache.wicket.markup.IMarkupFragment; | import org.apache.wicket.markup.*; | [
"org.apache.wicket"
] | org.apache.wicket; | 2,033,655 |
public ItemStack getCraftingResult(InventoryCrafting par1InventoryCrafting)
{
return this.recipeOutput.copy();
} | ItemStack function(InventoryCrafting par1InventoryCrafting) { return this.recipeOutput.copy(); } | /**
* Returns an Item that is the result of this recipe
*/ | Returns an Item that is the result of this recipe | getCraftingResult | {
"repo_name": "savageboy74/ProjectArcane",
"path": "src/main/java/com/woody104/projectarcane/crafting/ArcaneTableShapelessRecipes.java",
"license": "gpl-3.0",
"size": 2538
} | [
"net.minecraft.inventory.InventoryCrafting",
"net.minecraft.item.ItemStack"
] | import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; | import net.minecraft.inventory.*; import net.minecraft.item.*; | [
"net.minecraft.inventory",
"net.minecraft.item"
] | net.minecraft.inventory; net.minecraft.item; | 2,455,031 |
if (! coverages.containsKey((hyp.getCoverage())))
coverages.put(hyp.getCoverage(), new ArrayList<Hypothesis>());
coverages.get(hyp.getCoverage()).add(hyp);
return super.add(hyp);
} | if (! coverages.containsKey((hyp.getCoverage()))) coverages.put(hyp.getCoverage(), new ArrayList<Hypothesis>()); coverages.get(hyp.getCoverage()).add(hyp); return super.add(hyp); } | /**
* A Stack is an ArrayList; here, we intercept the add so we can maintain a list of the items
* stored under each distinct coverage vector
*/ | A Stack is an ArrayList; here, we intercept the add so we can maintain a list of the items stored under each distinct coverage vector | add | {
"repo_name": "lukeorland/joshua",
"path": "src/joshua/decoder/phrase/Stack.java",
"license": "lgpl-2.1",
"size": 7607
} | [
"java.util.ArrayList"
] | import java.util.ArrayList; | import java.util.*; | [
"java.util"
] | java.util; | 776,390 |
public void openMarketplace() {
try {
if ( marketplaceMethod != null ) {
marketplaceMethod.invoke( marketplaceMethod.getDeclaringClass().newInstance() );
}
} catch ( Exception ex ) {
new ErrorDialog(
shell, BaseMessages.getString( PKG, "Spoon.ErrorShowingMarketplaceDialog.Title" ), BaseMessages
.getString( PKG, "Spoon.ErrorShowingMarketplaceDialog.Message" ), ex );
}
} | void function() { try { if ( marketplaceMethod != null ) { marketplaceMethod.invoke( marketplaceMethod.getDeclaringClass().newInstance() ); } } catch ( Exception ex ) { new ErrorDialog( shell, BaseMessages.getString( PKG, STR ), BaseMessages .getString( PKG, STR ), ex ); } } | /**
* If available, this method will open the marketplace.
*/ | If available, this method will open the marketplace | openMarketplace | {
"repo_name": "jbrant/pentaho-kettle",
"path": "ui/src/org/pentaho/di/ui/spoon/Spoon.java",
"license": "apache-2.0",
"size": 339273
} | [
"org.pentaho.di.i18n.BaseMessages",
"org.pentaho.di.ui.core.dialog.ErrorDialog"
] | import org.pentaho.di.i18n.BaseMessages; import org.pentaho.di.ui.core.dialog.ErrorDialog; | import org.pentaho.di.i18n.*; import org.pentaho.di.ui.core.dialog.*; | [
"org.pentaho.di"
] | org.pentaho.di; | 1,923,456 |
public void setCatalogs(List<Catalog> catalogs); | void function(List<Catalog> catalogs); | /**
* Set the list of product, category and offer groupings that
* this site has access to
*
* @param catalogs a list of catalog groupings
*/ | Set the list of product, category and offer groupings that this site has access to | setCatalogs | {
"repo_name": "akdasari/SparkCommon",
"path": "src/main/java/org/sparkcommerce/common/site/domain/Site.java",
"license": "apache-2.0",
"size": 3138
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,508,364 |
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<PagedResponse<RoleAssignmentInner>> listByResourceGroupSinglePageAsync(
String resourceGroupName, String filter, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listByResourceGroup(
this.client.getEndpoint(),
resourceGroupName,
filter,
this.client.getApiVersion(),
this.client.getSubscriptionId(),
accept,
context)
.map(
res ->
new PagedResponseBase<>(
res.getRequest(),
res.getStatusCode(),
res.getHeaders(),
res.getValue().value(),
res.getValue().nextLink(),
null));
} | @ServiceMethod(returns = ReturnType.SINGLE) Mono<PagedResponse<RoleAssignmentInner>> function( String resourceGroupName, String filter, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( STR)); } final String accept = STR; context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, filter, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) .map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } | /**
* Gets role assignments for a resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or
* above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope
* for the specified principal.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return role assignments for a resource group.
*/ | Gets role assignments for a resource group | listByResourceGroupSinglePageAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/RoleAssignmentsClientImpl.java",
"license": "mit",
"size": 111188
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.PagedResponse",
"com.azure.core.http.rest.PagedResponseBase",
"com.azure.core.util.Context",
"com.azure.resourcemanager.authorization.fluent.models.RoleAssignmentInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.util.Context; import com.azure.resourcemanager.authorization.fluent.models.RoleAssignmentInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.authorization.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 1,787,200 |
public static Closure doWhileClosure(Closure closure, Predicate predicate) {
return WhileClosure.getInstance(predicate, closure, true);
}
| static Closure function(Closure closure, Predicate predicate) { return WhileClosure.getInstance(predicate, closure, true); } | /**
* Creates a Closure that will call the closure once and then repeatedly
* until the predicate returns false.
*
* @see com.usemon.lib.org.apache.commons.collections.functors.WhileClosure
*
* @param closure the closure to call repeatedly, not null
* @param predicate the predicate to use as an end of loop test, not null
* @return the <code>do-while</code> closure
* @throws IllegalArgumentException if either argument is null
*/ | Creates a Closure that will call the closure once and then repeatedly until the predicate returns false | doWhileClosure | {
"repo_name": "ProfilingLabs/Usemon2",
"path": "usemon-agent-commons-java/src/main/java/com/usemon/lib/org/apache/commons/collections/ClosureUtils.java",
"license": "mpl-2.0",
"size": 15935
} | [
"com.usemon.lib.org.apache.commons.collections.functors.WhileClosure"
] | import com.usemon.lib.org.apache.commons.collections.functors.WhileClosure; | import com.usemon.lib.org.apache.commons.collections.functors.*; | [
"com.usemon.lib"
] | com.usemon.lib; | 2,867,192 |
void init() throws Exception {
log.info("Shutdown manager registered...");
ShutdownManager sdm = new ShutdownManager();
Runtime.getRuntime().addShutdownHook(sdm);
log.info("Config Manager Starting...");
getConfig();
log.info("Config Manager Started...");
}
| void init() throws Exception { log.info(STR); ShutdownManager sdm = new ShutdownManager(); Runtime.getRuntime().addShutdownHook(sdm); log.info(STR); getConfig(); log.info(STR); } | /**
* Initialize the ConfigManager
*
* <li> 1. Create DeviceProfiles, and Assign Readers 2. Create
* Interrogator, and assign a ReaderComponet 3. DeviceManagerRemote will get
* SensorEvents </li>
*
*
* @throws Exception
*
*/ | Initialize the ConfigManager 1. Create DeviceProfiles, and Assign Readers 2. Create Interrogator, and assign a ReaderComponet 3. DeviceManagerRemote will get SensorEvents | init | {
"repo_name": "tomrose/singularity",
"path": "library/devicemgr/src/org/firstopen/singularity/devicemgr/config/ConfigManagerAbstractImpl.java",
"license": "apache-2.0",
"size": 5802
} | [
"org.firstopen.singularity.system.ShutdownManager"
] | import org.firstopen.singularity.system.ShutdownManager; | import org.firstopen.singularity.system.*; | [
"org.firstopen.singularity"
] | org.firstopen.singularity; | 410,145 |
public boolean isViewUnder(View view, int x, int y) {
if (view == null) {
return false;
}
return x >= view.getLeft() && x < view.getRight() && y >= view.getTop()
&& y < view.getBottom();
}
/**
* Find the topmost child under the given point within the parent view's
* coordinate system. The child order is determined using
* {@link ViewDragHelper.Callback#getOrderedChildIndex(int)} | boolean function(View view, int x, int y) { if (view == null) { return false; } return x >= view.getLeft() && x < view.getRight() && y >= view.getTop() && y < view.getBottom(); } /** * Find the topmost child under the given point within the parent view's * coordinate system. The child order is determined using * {@link ViewDragHelper.Callback#getOrderedChildIndex(int)} | /**
* Determine if the supplied view is under the given point in the parent
* view's coordinate system.
*
* @param view Child view of the parent to hit test
* @param x X position to test in the parent's coordinate system
* @param y Y position to test in the parent's coordinate system
* @return true if the supplied view is under the given point, false
* otherwise
*/ | Determine if the supplied view is under the given point in the parent view's coordinate system | isViewUnder | {
"repo_name": "lanhuaguizha/Christian",
"path": "parallaxbacklayout/src/main/java/com/github/anzewei/parallaxbacklayout/ViewDragHelper.java",
"license": "gpl-3.0",
"size": 62138
} | [
"android.view.View"
] | import android.view.View; | import android.view.*; | [
"android.view"
] | android.view; | 1,079,635 |
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
if (LOG_ATTACH_DETACH) {
Log.d(TAG, "onAttachedToWindow reattach =" + mDetached);
}
if (mDetached && mRenderer != null) {
int renderMode = RENDERMODE_CONTINUOUSLY;
if (mGLThread != null) {
renderMode = mGLThread.getRenderMode();
}
mGLThread = new GLThread(mRenderer);
if (renderMode != RENDERMODE_CONTINUOUSLY) {
mGLThread.setRenderMode(renderMode);
}
mGLThread.start();
}
mDetached = false;
}
| void function() { super.onAttachedToWindow(); if (LOG_ATTACH_DETACH) { Log.d(TAG, STR + mDetached); } if (mDetached && mRenderer != null) { int renderMode = RENDERMODE_CONTINUOUSLY; if (mGLThread != null) { renderMode = mGLThread.getRenderMode(); } mGLThread = new GLThread(mRenderer); if (renderMode != RENDERMODE_CONTINUOUSLY) { mGLThread.setRenderMode(renderMode); } mGLThread.start(); } mDetached = false; } | /**
* This method is used as part of the View class and is not normally called
* or subclassed by clients of GLSurfaceView.
*/ | This method is used as part of the View class and is not normally called or subclassed by clients of GLSurfaceView | onAttachedToWindow | {
"repo_name": "thecocce/TERRA-Engine",
"path": "Engine/OS/Android/GLSurfaceView.java",
"license": "apache-2.0",
"size": 102008
} | [
"android.util.Log"
] | import android.util.Log; | import android.util.*; | [
"android.util"
] | android.util; | 2,723,491 |
private void loadTags() {
try {
bundle = ResourceBundle.getBundle(PROPERTIES_CPATH);
Enumeration<String> en = bundle.getKeys();
String key = null;
setTagList(new ArrayList<String>());
for (; en.hasMoreElements(); ) {
key = en.nextElement();
// We don't load the module name property
if (key!=null && !key.equals(NB_MODULE_NAME_KEY)){
getTagList().add(bundle.getString(key).trim());
}
}
}
catch(Exception ex){
Exceptions.attachMessage(ex, "Unable to load tag list for code completion");
ex.printStackTrace();
}
} | void function() { try { bundle = ResourceBundle.getBundle(PROPERTIES_CPATH); Enumeration<String> en = bundle.getKeys(); String key = null; setTagList(new ArrayList<String>()); for (; en.hasMoreElements(); ) { key = en.nextElement(); if (key!=null && !key.equals(NB_MODULE_NAME_KEY)){ getTagList().add(bundle.getString(key).trim()); } } } catch(Exception ex){ Exceptions.attachMessage(ex, STR); ex.printStackTrace(); } } | /**
* Loads the hAtom keyword list from the module's property file.<br>
*/ | Loads the hAtom keyword list from the module's property file | loadTags | {
"repo_name": "andreacastello/netbeans-hatom-plugin",
"path": "src/it/pronetics/madstore/hatom/netbeans/syntax/TagCache.java",
"license": "apache-2.0",
"size": 3356
} | [
"java.util.ArrayList",
"java.util.Enumeration",
"java.util.ResourceBundle",
"org.openide.util.Exceptions"
] | import java.util.ArrayList; import java.util.Enumeration; import java.util.ResourceBundle; import org.openide.util.Exceptions; | import java.util.*; import org.openide.util.*; | [
"java.util",
"org.openide.util"
] | java.util; org.openide.util; | 782,259 |
private void visit(PipelineVisitor visitor, Set<PValue> visitedValues) {
if (!finishedSpecifying) {
finishSpecifying();
}
if (!isRootNode()) {
// Visit inputs.
for (PValue inputValue : inputs.values()) {
if (visitedValues.add(inputValue)) {
visitor.visitValue(inputValue, getProducer(inputValue));
}
}
}
if (isCompositeNode()) {
PipelineVisitor.CompositeBehavior recurse = visitor.enterCompositeTransform(this);
if (recurse.equals(CompositeBehavior.ENTER_TRANSFORM)) {
for (Node child : parts) {
child.visit(visitor, visitedValues);
}
}
visitor.leaveCompositeTransform(this);
} else {
visitor.visitPrimitiveTransform(this);
}
if (!isRootNode()) {
checkNotNull(outputs, "Outputs for non-root node %s are null", getFullName());
// Visit outputs.
for (PValue pValue : outputs.values()) {
if (visitedValues.add(pValue)) {
visitor.visitValue(pValue, this);
}
}
}
} | void function(PipelineVisitor visitor, Set<PValue> visitedValues) { if (!finishedSpecifying) { finishSpecifying(); } if (!isRootNode()) { for (PValue inputValue : inputs.values()) { if (visitedValues.add(inputValue)) { visitor.visitValue(inputValue, getProducer(inputValue)); } } } if (isCompositeNode()) { PipelineVisitor.CompositeBehavior recurse = visitor.enterCompositeTransform(this); if (recurse.equals(CompositeBehavior.ENTER_TRANSFORM)) { for (Node child : parts) { child.visit(visitor, visitedValues); } } visitor.leaveCompositeTransform(this); } else { visitor.visitPrimitiveTransform(this); } if (!isRootNode()) { checkNotNull(outputs, STR, getFullName()); for (PValue pValue : outputs.values()) { if (visitedValues.add(pValue)) { visitor.visitValue(pValue, this); } } } } | /**
* Visit the transform node.
*
* <p>Provides an ordered visit of the input values, the primitive transform (or child nodes for
* composite transforms), then the output values.
*/ | Visit the transform node. Provides an ordered visit of the input values, the primitive transform (or child nodes for composite transforms), then the output values | visit | {
"repo_name": "dhalperi/beam",
"path": "sdks/java/core/src/main/java/org/apache/beam/sdk/runners/TransformHierarchy.java",
"license": "apache-2.0",
"size": 19765
} | [
"com.google.common.base.Preconditions",
"java.util.Set",
"org.apache.beam.sdk.Pipeline",
"org.apache.beam.sdk.values.PValue"
] | import com.google.common.base.Preconditions; import java.util.Set; import org.apache.beam.sdk.Pipeline; import org.apache.beam.sdk.values.PValue; | import com.google.common.base.*; import java.util.*; import org.apache.beam.sdk.*; import org.apache.beam.sdk.values.*; | [
"com.google.common",
"java.util",
"org.apache.beam"
] | com.google.common; java.util; org.apache.beam; | 531,281 |
double output = neuron.getOutput();
for(Connection connection : neuron.getInputConnections()) {
double input = connection.getInput();
double netInput = neuron.getNetInput();
double deltaWeight = (input - netInput) * output * this.learningRate; // is it right to use netInput here?
connection.getWeight().inc(deltaWeight);
}
} | double output = neuron.getOutput(); for(Connection connection : neuron.getInputConnections()) { double input = connection.getInput(); double netInput = neuron.getNetInput(); double deltaWeight = (input - netInput) * output * this.learningRate; connection.getWeight().inc(deltaWeight); } } | /**
* This method implements weights update procedure for the single neuron
*
* @param neuron
* neuron to update weights
*/ | This method implements weights update procedure for the single neuron | updateNeuronWeights | {
"repo_name": "fiidau/Y-Haplogroup-Predictor",
"path": "src/org/neuroph/nnet/learning/GeneralizedHebbianLearning.java",
"license": "mit",
"size": 1641
} | [
"org.neuroph.core.Connection"
] | import org.neuroph.core.Connection; | import org.neuroph.core.*; | [
"org.neuroph.core"
] | org.neuroph.core; | 434,036 |
@Test
public void testPipelineWithOnpremiseUrl() throws Exception {
WorkflowJob pipelineJob = j.jenkins.createProject(WorkflowJob.class, "test-pipeline");
pipelineJob.setConcurrentBuild(false);
String testProjectPath = new File(
getClass().getClassLoader().getResource("pipelinetestproject").toURI()
).getAbsolutePath();
String script = "" +
"pipeline {\n" +
" agent any\n" +
" stages {\n" +
" stage('Copy testproject assets') {\n" +
" steps {\n" +
" sh 'cd \"" + testProjectPath + "\" && cp -r * \"$WORKSPACE\"'\n" +
" }\n" +
" }\n" +
" }\n" +
" post {\n" +
" always {\n" +
" junit '**/surefire-reports/*.xml'\n" +
" melioraTestlab(\n" +
" projectKey: 'TLABDEMO',\n" +
" rulesetSettings: [\n" +
" testRunTitle: 'pipelined integration tests'\n" +
" ],\n" +
" advancedSettings: [" +
// " companyId: 'testcompany'," +
" apiKey: hudson.util.Secret.fromString('reallysecretapikey')," +
" usingonpremise: [" +
" onpremiseurl: 'http://testcompany:8080/'" +
" ]" +
" ]" +
" )\n" +
" }\n" +
" }\n" +
"}";
if(!SANDBOX) {
ScriptApproval.get().preapprove(script, GroovyLanguage.get());
}
pipelineJob.setDefinition(new CpsFlowDefinition(script, SANDBOX));
WorkflowRun run = pipelineJob.scheduleBuild2(0).get();
String log = FileUtils.readFileToString(run.getLogFile());
l(log);
j.assertBuildStatus(Result.UNSTABLE, run);
assertContains(log, "Publishing test results to Testlab project: TLABDEMO");
} | void function() throws Exception { WorkflowJob pipelineJob = j.jenkins.createProject(WorkflowJob.class, STR); pipelineJob.setConcurrentBuild(false); String testProjectPath = new File( getClass().getClassLoader().getResource(STR).toURI() ).getAbsolutePath(); String script = STRpipeline {\nSTR agent any\nSTR stages {\nSTR stage('Copy testproject assets') {\nSTR steps {\nSTR sh 'cd \STR\STR$WORKSPACE\"'\nSTR }\nSTR }\nSTR }\nSTR post {\nSTR always {\nSTR junit '**/surefire-reports/*.xml'\nSTR melioraTestlab(\nSTR projectKey: 'TLABDEMO',\nSTR rulesetSettings: [\nSTR testRunTitle: 'pipelined integration tests'\nSTR ],\nSTR advancedSettings: [STR apiKey: hudson.util.Secret.fromString('reallysecretapikey'),STR usingonpremise: [STR onpremiseurl: 'http: " ]STR ]STR )\nSTR }\nSTR }\nSTR}STRPublishing test results to Testlab project: TLABDEMO"); } | /**
* Tests that step succeeds without companyId if onpremise url address is set.
*/ | Tests that step succeeds without companyId if onpremise url address is set | testPipelineWithOnpremiseUrl | {
"repo_name": "jenkinsci/meliora-testlab-plugin",
"path": "src/test/java/fi/meliora/testlab/ext/jenkins/test/PipelineTest.java",
"license": "lgpl-3.0",
"size": 15777
} | [
"java.io.File",
"org.jenkinsci.plugins.workflow.job.WorkflowJob"
] | import java.io.File; import org.jenkinsci.plugins.workflow.job.WorkflowJob; | import java.io.*; import org.jenkinsci.plugins.workflow.job.*; | [
"java.io",
"org.jenkinsci.plugins"
] | java.io; org.jenkinsci.plugins; | 2,404,682 |
@Generated(hash = 713229351)
public void update() {
if (myDao == null) {
throw new DaoException("Entity is detached from DAO context");
}
myDao.update(this);
} | @Generated(hash = 713229351) void function() { if (myDao == null) { throw new DaoException(STR); } myDao.update(this); } | /**
* Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
* Entity must attached to an entity context.
*/ | Convenient call for <code>org.greenrobot.greendao.AbstractDao#update(Object)</code>. Entity must attached to an entity context | update | {
"repo_name": "steve-goldman/volksempfaenger",
"path": "app/src/main/java/net/x4a42/volksempfaenger/data/entity/playlistitem/PlaylistItem.java",
"license": "isc",
"size": 4494
} | [
"org.greenrobot.greendao.DaoException",
"org.greenrobot.greendao.annotation.Generated"
] | import org.greenrobot.greendao.DaoException; import org.greenrobot.greendao.annotation.Generated; | import org.greenrobot.greendao.*; import org.greenrobot.greendao.annotation.*; | [
"org.greenrobot.greendao"
] | org.greenrobot.greendao; | 1,628,636 |
private List<FeedbackResponseAttributes> filterResponsesForStatistics(
List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question,
String studentEmail, FeedbackSessionResultsBundle bundle, String view) {
boolean isViewedByStudent = "student".equals(view);
if (!isViewedByStudent) {
return responses;
}
FeedbackParticipantType recipientType = question.getRecipientType();
boolean isFilteringSkipped = recipientType.equals(FeedbackParticipantType.INSTRUCTORS)
|| recipientType.equals(FeedbackParticipantType.NONE)
|| recipientType.equals(FeedbackParticipantType.SELF);
if (isFilteringSkipped) {
return responses;
}
boolean isFilteringByTeams = recipientType.equals(FeedbackParticipantType.OWN_TEAM)
|| recipientType.equals(FeedbackParticipantType.TEAMS);
List<FeedbackResponseAttributes> receivedResponses = new ArrayList<>();
String recipientString = isFilteringByTeams ? bundle.getTeamNameForEmail(studentEmail) : studentEmail;
for (FeedbackResponseAttributes response : responses) {
boolean isReceivedResponse = response.recipient.equals(recipientString);
if (isReceivedResponse) {
receivedResponses.add(response);
}
}
return receivedResponses;
} | List<FeedbackResponseAttributes> function( List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question, String studentEmail, FeedbackSessionResultsBundle bundle, String view) { boolean isViewedByStudent = STR.equals(view); if (!isViewedByStudent) { return responses; } FeedbackParticipantType recipientType = question.getRecipientType(); boolean isFilteringSkipped = recipientType.equals(FeedbackParticipantType.INSTRUCTORS) recipientType.equals(FeedbackParticipantType.NONE) recipientType.equals(FeedbackParticipantType.SELF); if (isFilteringSkipped) { return responses; } boolean isFilteringByTeams = recipientType.equals(FeedbackParticipantType.OWN_TEAM) recipientType.equals(FeedbackParticipantType.TEAMS); List<FeedbackResponseAttributes> receivedResponses = new ArrayList<>(); String recipientString = isFilteringByTeams ? bundle.getTeamNameForEmail(studentEmail) : studentEmail; for (FeedbackResponseAttributes response : responses) { boolean isReceivedResponse = response.recipient.equals(recipientString); if (isReceivedResponse) { receivedResponses.add(response); } } return receivedResponses; } | /**
* Returns a list of FeedbackResponseAttributes filtered according to view, question recipient type
* for the Statistics Table.
*/ | Returns a list of FeedbackResponseAttributes filtered according to view, question recipient type for the Statistics Table | filterResponsesForStatistics | {
"repo_name": "LiHaoTan/teammates",
"path": "src/main/java/teammates/common/datatransfer/questions/FeedbackRubricQuestionDetails.java",
"license": "gpl-2.0",
"size": 65557
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 900,276 |
private void navigateBackward() {
if (currentTarget == 0) {
throw new IllegalStateException(
"NavigateBackward is not allowed "
+ "since the targetpointer is pointing at "
+ "the lower boundary "
+ "of the history");
}
navigateBackward = true;
// If nothing selected, go to last selected target
if (targets.size() == 0) {
setTarget(((WeakReference) history.get(currentTarget)).get());
} else {
setTarget(((WeakReference) history.get(--currentTarget)).get());
}
navigateBackward = false;
} | void function() { if (currentTarget == 0) { throw new IllegalStateException( STR + STR + STR + STR); } navigateBackward = true; if (targets.size() == 0) { setTarget(((WeakReference) history.get(currentTarget)).get()); } else { setTarget(((WeakReference) history.get(--currentTarget)).get()); } navigateBackward = false; } | /**
* Navigate one step back in history. Throws an illegalstateexception if
* not possible.
*
*/ | Navigate one step back in history. Throws an illegalstateexception if not possible | navigateBackward | {
"repo_name": "carvalhomb/tsmells",
"path": "sample/argouml/argouml/org/argouml/ui/targetmanager/TargetManager.java",
"license": "gpl-2.0",
"size": 34904
} | [
"java.lang.ref.WeakReference"
] | import java.lang.ref.WeakReference; | import java.lang.ref.*; | [
"java.lang"
] | java.lang; | 2,388,200 |
public AttachedFile createAttachedFile(String filename,
ReagentAttachedFileType fileType,
LocalDate fileDate,
String fileContents) throws IOException
{
return createAttachedFile(filename, fileType, fileDate, new ByteArrayInputStream(fileContents.getBytes()));
} | AttachedFile function(String filename, ReagentAttachedFileType fileType, LocalDate fileDate, String fileContents) throws IOException { return createAttachedFile(filename, fileType, fileDate, new ByteArrayInputStream(fileContents.getBytes())); } | /**
* Create and return a new attached file for the screen.
*
* @param filename the filename
* @param fileType the file type
* @param fileContents the file contents
* @throws IOException
*/ | Create and return a new attached file for the screen | createAttachedFile | {
"repo_name": "hmsiccbl/screensaver",
"path": "core/src/main/java/edu/harvard/med/screensaver/model/libraries/Reagent.java",
"license": "gpl-2.0",
"size": 13512
} | [
"edu.harvard.med.screensaver.model.AttachedFile",
"java.io.ByteArrayInputStream",
"java.io.IOException",
"org.joda.time.LocalDate"
] | import edu.harvard.med.screensaver.model.AttachedFile; import java.io.ByteArrayInputStream; import java.io.IOException; import org.joda.time.LocalDate; | import edu.harvard.med.screensaver.model.*; import java.io.*; import org.joda.time.*; | [
"edu.harvard.med",
"java.io",
"org.joda.time"
] | edu.harvard.med; java.io; org.joda.time; | 969,529 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.