method
stringlengths 13
441k
| clean_method
stringlengths 7
313k
| doc
stringlengths 17
17.3k
| comment
stringlengths 3
1.42k
| method_name
stringlengths 1
273
| extra
dict | imports
list | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
list | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
|---|---|---|---|---|---|---|---|---|---|---|---|
private void assertion(boolean b, String msg)
{
if (!b)
{
String fMsg = XSLMessages.createXPATHMessage(
XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION,
new Object[]{ msg });
throw new RuntimeException(fMsg);
}
}
|
void function(boolean b, String msg) { if (!b) { String fMsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION, new Object[]{ msg }); throw new RuntimeException(fMsg); } }
|
/**
* Notify the user of an assertion error, and probably throw an
* exception.
*
* @param b If false, a runtime exception will be thrown.
* @param msg The assertion message, which should be informative.
*
* @throws RuntimeException if the b argument is false.
*/
|
Notify the user of an assertion error, and probably throw an exception
|
assertion
|
{
"repo_name": "JetBrains/jdk8u_jaxp",
"path": "src/com/sun/org/apache/xpath/internal/compiler/XPathParser.java",
"license": "gpl-2.0",
"size": 64411
}
|
[
"com.sun.org.apache.xalan.internal.res.XSLMessages",
"com.sun.org.apache.xpath.internal.res.XPATHErrorResources"
] |
import com.sun.org.apache.xalan.internal.res.XSLMessages; import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
|
import com.sun.org.apache.xalan.internal.res.*; import com.sun.org.apache.xpath.internal.res.*;
|
[
"com.sun.org"
] |
com.sun.org;
| 2,237,158
|
private String getFileName() {
String name = getFileContents().getFileName();
name = name.substring(name.lastIndexOf(File.separatorChar) + 1);
name = FILE_EXTENSION_PATTERN.matcher(name).replaceAll("");
return name;
}
|
String function() { String name = getFileContents().getFileName(); name = name.substring(name.lastIndexOf(File.separatorChar) + 1); name = FILE_EXTENSION_PATTERN.matcher(name).replaceAll(""); return name; }
|
/**
* Get source file name.
* @return source file name.
*/
|
Get source file name
|
getFileName
|
{
"repo_name": "jochenvdv/checkstyle",
"path": "src/main/java/com/puppycrawl/tools/checkstyle/checks/OuterTypeFilenameCheck.java",
"license": "lgpl-2.1",
"size": 4116
}
|
[
"java.io.File"
] |
import java.io.File;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 951,258
|
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
}
|
void function(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); }
|
/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
|
This adds <code>org.eclipse.emf.edit.command.CommandParameter</code>s describing the children that can be created under this object.
|
collectNewChildDescriptors
|
{
"repo_name": "diverse-project/kcvl",
"path": "fr.inria.diverse.kcvl.metamodel.edit/src/main/java/org/omg/CVLMetamodelMaster/cvl/provider/ChoiceResolutuionItemProvider.java",
"license": "epl-1.0",
"size": 4661
}
|
[
"java.util.Collection"
] |
import java.util.Collection;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,633,410
|
private Set<TObject> getValues() {
Set<TObject> values = Sets.newHashSet();
for (int i = 0; i < TestData.getScaleCount(); i++) {
TObject value = null;
while (value == null || values.contains(value)) {
value = TestData.getTObject();
}
values.add(value);
}
return values;
}
|
Set<TObject> function() { Set<TObject> values = Sets.newHashSet(); for (int i = 0; i < TestData.getScaleCount(); i++) { TObject value = null; while (value == null values.contains(value)) { value = TestData.getTObject(); } values.add(value); } return values; }
|
/**
* Return a set of TObject values
*
* @return the values
*/
|
Return a set of TObject values
|
getValues
|
{
"repo_name": "dubex/concourse",
"path": "concourse-server/src/test/java/com/cinchapi/concourse/server/storage/StoreTest.java",
"license": "apache-2.0",
"size": 93856
}
|
[
"com.cinchapi.concourse.thrift.TObject",
"com.cinchapi.concourse.util.TestData",
"com.google.common.collect.Sets",
"java.util.Set"
] |
import com.cinchapi.concourse.thrift.TObject; import com.cinchapi.concourse.util.TestData; import com.google.common.collect.Sets; import java.util.Set;
|
import com.cinchapi.concourse.thrift.*; import com.cinchapi.concourse.util.*; import com.google.common.collect.*; import java.util.*;
|
[
"com.cinchapi.concourse",
"com.google.common",
"java.util"
] |
com.cinchapi.concourse; com.google.common; java.util;
| 759,638
|
public void extendAuth(PlayerAuth auth, int id, Connection con) throws SQLException {
// extend for custom behavior
}
|
void function(PlayerAuth auth, int id, Connection con) throws SQLException { }
|
/**
* Writes properties to the given PlayerAuth object that need to be retrieved in a specific manner
* when a PlayerAuth object is read from the table.
*
* @param auth the player auth object to extend
* @param id the database id of the player auth entry
* @param con connection to the sql table
* @throws SQLException .
*/
|
Writes properties to the given PlayerAuth object that need to be retrieved in a specific manner when a PlayerAuth object is read from the table
|
extendAuth
|
{
"repo_name": "Xephi/AuthMeReloaded",
"path": "src/main/java/fr/xephi/authme/datasource/mysqlextensions/MySqlExtension.java",
"license": "gpl-3.0",
"size": 3358
}
|
[
"fr.xephi.authme.data.auth.PlayerAuth",
"java.sql.Connection",
"java.sql.SQLException"
] |
import fr.xephi.authme.data.auth.PlayerAuth; import java.sql.Connection; import java.sql.SQLException;
|
import fr.xephi.authme.data.auth.*; import java.sql.*;
|
[
"fr.xephi.authme",
"java.sql"
] |
fr.xephi.authme; java.sql;
| 2,091,773
|
public Future<Channel> renegotiate() {
ChannelHandlerContext ctx = this.ctx;
if (ctx == null) {
throw new IllegalStateException();
}
return renegotiate(ctx.executor().<Channel>newPromise());
}
|
Future<Channel> function() { ChannelHandlerContext ctx = this.ctx; if (ctx == null) { throw new IllegalStateException(); } return renegotiate(ctx.executor().<Channel>newPromise()); }
|
/**
* Performs TLS renegotiation.
*/
|
Performs TLS renegotiation
|
renegotiate
|
{
"repo_name": "xiongzheng/netty",
"path": "handler/src/main/java/io/netty/handler/ssl/SslHandler.java",
"license": "apache-2.0",
"size": 56579
}
|
[
"io.netty.channel.Channel",
"io.netty.channel.ChannelHandlerContext",
"io.netty.util.concurrent.Future"
] |
import io.netty.channel.Channel; import io.netty.channel.ChannelHandlerContext; import io.netty.util.concurrent.Future;
|
import io.netty.channel.*; import io.netty.util.concurrent.*;
|
[
"io.netty.channel",
"io.netty.util"
] |
io.netty.channel; io.netty.util;
| 728,690
|
public static HRegion openHRegion(final Configuration conf, final FileSystem fs,
final Path rootDir, final HRegionInfo info, final HTableDescriptor htd, final HLog wal)
throws IOException {
return openHRegion(conf, fs, rootDir, info, htd, wal, null, null);
}
|
static HRegion function(final Configuration conf, final FileSystem fs, final Path rootDir, final HRegionInfo info, final HTableDescriptor htd, final HLog wal) throws IOException { return openHRegion(conf, fs, rootDir, info, htd, wal, null, null); }
|
/**
* Open a Region.
* @param conf The Configuration object to use.
* @param fs Filesystem to use
* @param rootDir Root directory for HBase instance
* @param info Info for region to be opened.
* @param htd the table descriptor
* @param wal HLog for region to use. This method will call
* HLog#setSequenceNumber(long) passing the result of the call to
* HRegion#getMinSequenceId() to ensure the log id is properly kept
* up. HRegionStore does this every time it opens a new region.
* @return new HRegion
* @throws IOException
*/
|
Open a Region
|
openHRegion
|
{
"repo_name": "throughsky/lywebank",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java",
"license": "apache-2.0",
"size": 235118
}
|
[
"java.io.IOException",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.hbase.HRegionInfo",
"org.apache.hadoop.hbase.HTableDescriptor",
"org.apache.hadoop.hbase.regionserver.wal.HLog"
] |
import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.regionserver.wal.HLog;
|
import java.io.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.regionserver.wal.*;
|
[
"java.io",
"org.apache.hadoop"
] |
java.io; org.apache.hadoop;
| 1,972,079
|
public void deliver(RHTTPResponse response) throws IOException;
|
void function(RHTTPResponse response) throws IOException;
|
/**
* <p>Sends a response to the gateway server.</p>
*
* @param response the response to send
* @throws IOException if it is not possible to contact the gateway server
*/
|
Sends a response to the gateway server
|
deliver
|
{
"repo_name": "sdw2330976/Research-jetty-9.2.5",
"path": "jetty-rhttp/jetty-rhttp-client/src/main/java/org/eclipse/jetty/rhttp/client/RHTTPClient.java",
"license": "apache-2.0",
"size": 4934
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 437,575
|
public static String maskName(@Nullable String name) {
return name == null ? "default" : name;
}
|
static String function(@Nullable String name) { return name == null ? STR : name; }
|
/**
* Mask component name to make sure that it is not {@code null}.
*
* @param name Component name to mask, possibly {@code null}.
* @return Component name.
*/
|
Mask component name to make sure that it is not null
|
maskName
|
{
"repo_name": "murador/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java",
"license": "apache-2.0",
"size": 294985
}
|
[
"org.jetbrains.annotations.Nullable"
] |
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.*;
|
[
"org.jetbrains.annotations"
] |
org.jetbrains.annotations;
| 1,945,091
|
EAttribute getnUref_Name();
|
EAttribute getnUref_Name();
|
/**
* Returns the meta object for the attribute '{@link sc.ndt.editor.turbsimtbs.nUref#getName <em>Name</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Name</em>'.
* @see sc.ndt.editor.turbsimtbs.nUref#getName()
* @see #getnUref()
* @generated
*/
|
Returns the meta object for the attribute '<code>sc.ndt.editor.turbsimtbs.nUref#getName Name</code>'.
|
getnUref_Name
|
{
"repo_name": "cooked/NDT",
"path": "sc.ndt.editor.turbsim.tbs/src-gen/sc/ndt/editor/turbsimtbs/TurbsimtbsPackage.java",
"license": "gpl-3.0",
"size": 204585
}
|
[
"org.eclipse.emf.ecore.EAttribute"
] |
import org.eclipse.emf.ecore.EAttribute;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 786,200
|
public void setPrivateData(final PrivateData privateData) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
// Create an IQ packet to set the private data.
IQ privateDataSet = new PrivateDataIQ(privateData);
connection().sendIqRequestAndWaitForResponse(privateDataSet);
}
|
void function(final PrivateData privateData) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { IQ privateDataSet = new PrivateDataIQ(privateData); connection().sendIqRequestAndWaitForResponse(privateDataSet); }
|
/**
* Sets a private data value. Each chunk of private data is uniquely identified by an
* element name and namespace pair. If private data has already been set with the
* element name and namespace, then the new private data will overwrite the old value.
*
* @param privateData the private data.
* @throws XMPPErrorException if there was an XMPP error returned.
* @throws NoResponseException if there was no response from the remote entity.
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
|
Sets a private data value. Each chunk of private data is uniquely identified by an element name and namespace pair. If private data has already been set with the element name and namespace, then the new private data will overwrite the old value
|
setPrivateData
|
{
"repo_name": "igniterealtime/Smack",
"path": "smack-extensions/src/main/java/org/jivesoftware/smackx/iqprivate/PrivateDataManager.java",
"license": "apache-2.0",
"size": 12562
}
|
[
"org.jivesoftware.smack.SmackException",
"org.jivesoftware.smack.XMPPException",
"org.jivesoftware.smackx.iqprivate.packet.PrivateData",
"org.jivesoftware.smackx.iqprivate.packet.PrivateDataIQ"
] |
import org.jivesoftware.smack.SmackException; import org.jivesoftware.smack.XMPPException; import org.jivesoftware.smackx.iqprivate.packet.PrivateData; import org.jivesoftware.smackx.iqprivate.packet.PrivateDataIQ;
|
import org.jivesoftware.smack.*; import org.jivesoftware.smackx.iqprivate.packet.*;
|
[
"org.jivesoftware.smack",
"org.jivesoftware.smackx"
] |
org.jivesoftware.smack; org.jivesoftware.smackx;
| 1,974,993
|
private DataQueryParams pruneToDimensionType( DimensionType type )
{
dimensions.removeIf( dimensionalObject -> dimensionalObject.getDimensionType() != type );
filters.removeIf( dimensionalObject -> dimensionalObject.getDimensionType() != type );
return this;
}
|
DataQueryParams function( DimensionType type ) { dimensions.removeIf( dimensionalObject -> dimensionalObject.getDimensionType() != type ); filters.removeIf( dimensionalObject -> dimensionalObject.getDimensionType() != type ); return this; }
|
/**
* Removes all dimensions which are not of the given type from dimensions
* and filters.
*/
|
Removes all dimensions which are not of the given type from dimensions and filters
|
pruneToDimensionType
|
{
"repo_name": "hispindia/dhis2-Core",
"path": "dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java",
"license": "bsd-3-clause",
"size": 105104
}
|
[
"org.hisp.dhis.common.DimensionType"
] |
import org.hisp.dhis.common.DimensionType;
|
import org.hisp.dhis.common.*;
|
[
"org.hisp.dhis"
] |
org.hisp.dhis;
| 775,162
|
void setTabModelSelector(TabModelSelector selector) {
mTabModelSelector = selector;
if (mIncognitoToggleTabLayout != null) {
mIncognitoToggleTabLayout.setTabModelSelector(selector);
}
}
|
void setTabModelSelector(TabModelSelector selector) { mTabModelSelector = selector; if (mIncognitoToggleTabLayout != null) { mIncognitoToggleTabLayout.setTabModelSelector(selector); } }
|
/**
* Sets the current TabModelSelector so the toolbar can pass it into buttons that need access to
* it.
*/
|
Sets the current TabModelSelector so the toolbar can pass it into buttons that need access to it
|
setTabModelSelector
|
{
"repo_name": "endlessm/chromium-browser",
"path": "chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/TabSwitcherModeTTPhone.java",
"license": "bsd-3-clause",
"size": 17039
}
|
[
"org.chromium.chrome.browser.tabmodel.TabModelSelector"
] |
import org.chromium.chrome.browser.tabmodel.TabModelSelector;
|
import org.chromium.chrome.browser.tabmodel.*;
|
[
"org.chromium.chrome"
] |
org.chromium.chrome;
| 1,950,600
|
@Override
public StreamCodec<KeyValPair<K, V>> getStreamCodec()
{
return getKeyValPairStreamCodec();
}
};
@OutputPortFieldAnnotation(optional = true)
public final transient DefaultOutputPort<KeyValPair<K, V>> sum = new DefaultOutputPort<KeyValPair<K, V>>();
@OutputPortFieldAnnotation(optional = true)
public final transient DefaultOutputPort<KeyValPair<K, Double>> sumDouble = new DefaultOutputPort<KeyValPair<K, Double>>();
@OutputPortFieldAnnotation(optional = true)
public final transient DefaultOutputPort<KeyValPair<K, Integer>> sumInteger = new DefaultOutputPort<KeyValPair<K, Integer>>();
@OutputPortFieldAnnotation(optional = true)
public final transient DefaultOutputPort<KeyValPair<K, Long>> sumLong = new DefaultOutputPort<KeyValPair<K, Long>>();
@OutputPortFieldAnnotation(optional = true)
public final transient DefaultOutputPort<KeyValPair<K, Short>> sumShort = new DefaultOutputPort<KeyValPair<K, Short>>();
@OutputPortFieldAnnotation(optional = true)
public final transient DefaultOutputPort<KeyValPair<K, Float>> sumFloat = new DefaultOutputPort<KeyValPair<K, Float>>();
|
StreamCodec<KeyValPair<K, V>> function() { return getKeyValPairStreamCodec(); } }; @OutputPortFieldAnnotation(optional = true) public final transient DefaultOutputPort<KeyValPair<K, V>> sum = new DefaultOutputPort<KeyValPair<K, V>>(); @OutputPortFieldAnnotation(optional = true) public final transient DefaultOutputPort<KeyValPair<K, Double>> sumDouble = new DefaultOutputPort<KeyValPair<K, Double>>(); @OutputPortFieldAnnotation(optional = true) public final transient DefaultOutputPort<KeyValPair<K, Integer>> sumInteger = new DefaultOutputPort<KeyValPair<K, Integer>>(); @OutputPortFieldAnnotation(optional = true) public final transient DefaultOutputPort<KeyValPair<K, Long>> sumLong = new DefaultOutputPort<KeyValPair<K, Long>>(); @OutputPortFieldAnnotation(optional = true) public final transient DefaultOutputPort<KeyValPair<K, Short>> sumShort = new DefaultOutputPort<KeyValPair<K, Short>>(); @OutputPortFieldAnnotation(optional = true) public final transient DefaultOutputPort<KeyValPair<K, Float>> sumFloat = new DefaultOutputPort<KeyValPair<K, Float>>();
|
/**
* Stream codec used for partitioning.
*/
|
Stream codec used for partitioning
|
getStreamCodec
|
{
"repo_name": "ananthc/apex-malhar",
"path": "library/src/main/java/org/apache/apex/malhar/lib/math/SumKeyVal.java",
"license": "apache-2.0",
"size": 6157
}
|
[
"com.datatorrent.api.DefaultOutputPort",
"com.datatorrent.api.StreamCodec",
"com.datatorrent.api.annotation.OutputPortFieldAnnotation",
"org.apache.apex.malhar.lib.util.KeyValPair"
] |
import com.datatorrent.api.DefaultOutputPort; import com.datatorrent.api.StreamCodec; import com.datatorrent.api.annotation.OutputPortFieldAnnotation; import org.apache.apex.malhar.lib.util.KeyValPair;
|
import com.datatorrent.api.*; import com.datatorrent.api.annotation.*; import org.apache.apex.malhar.lib.util.*;
|
[
"com.datatorrent.api",
"org.apache.apex"
] |
com.datatorrent.api; org.apache.apex;
| 991,301
|
public boolean tableIsInList(List<RelationJSQL> tables, String tableGivenName){
for(RelationJSQL table : tables){
if(table.getGivenName().equals(tableGivenName))
return true;
}
return false;
}
|
boolean function(List<RelationJSQL> tables, String tableGivenName){ for(RelationJSQL table : tables){ if(table.getGivenName().equals(tableGivenName)) return true; } return false; }
|
/**
* Used by addReferredTables to check whether a RelationJSQL for the table "given name"
* already exists
*
* @param tables The list of tables
* @param tableGivenName Full table name exactly as provided by user (same casing, and with schema prefix)
* @return True if there is a RelationJSQL with the getGivenName method equals the parameter tableGivenName
*/
|
Used by addReferredTables to check whether a RelationJSQL for the table "given name" already exists
|
tableIsInList
|
{
"repo_name": "clarkparsia/ontop",
"path": "obdalib-core/src/main/java/it/unibz/krdb/sql/ImplicitDBConstraints.java",
"license": "apache-2.0",
"size": 9592
}
|
[
"it.unibz.krdb.sql.api.RelationJSQL",
"java.util.List"
] |
import it.unibz.krdb.sql.api.RelationJSQL; import java.util.List;
|
import it.unibz.krdb.sql.api.*; import java.util.*;
|
[
"it.unibz.krdb",
"java.util"
] |
it.unibz.krdb; java.util;
| 945,319
|
private void attachActiveTrans( TransGraph transGraph, TransMeta newTrans, JobEntryCopy jobEntryCopy ) {
if ( job != null && transGraph != null ) {
Trans trans = spoon.findActiveTrans( job, jobEntryCopy );
transGraph.setTrans( trans );
if ( !transGraph.isExecutionResultsPaneVisible() ) {
transGraph.showExecutionResults();
}
transGraph.setControlStates();
}
}
|
void function( TransGraph transGraph, TransMeta newTrans, JobEntryCopy jobEntryCopy ) { if ( job != null && transGraph != null ) { Trans trans = spoon.findActiveTrans( job, jobEntryCopy ); transGraph.setTrans( trans ); if ( !transGraph.isExecutionResultsPaneVisible() ) { transGraph.showExecutionResults(); } transGraph.setControlStates(); } }
|
/**
* Finds the last active transformation in the running job to the opened transMeta
*
* @param transGraph
* @param jobEntryCopy
*/
|
Finds the last active transformation in the running job to the opened transMeta
|
attachActiveTrans
|
{
"repo_name": "andrei-viaryshka/pentaho-kettle",
"path": "ui/src/org/pentaho/di/ui/spoon/job/JobGraph.java",
"license": "apache-2.0",
"size": 132086
}
|
[
"org.pentaho.di.job.entry.JobEntryCopy",
"org.pentaho.di.trans.Trans",
"org.pentaho.di.trans.TransMeta",
"org.pentaho.di.ui.spoon.trans.TransGraph"
] |
import org.pentaho.di.job.entry.JobEntryCopy; import org.pentaho.di.trans.Trans; import org.pentaho.di.trans.TransMeta; import org.pentaho.di.ui.spoon.trans.TransGraph;
|
import org.pentaho.di.job.entry.*; import org.pentaho.di.trans.*; import org.pentaho.di.ui.spoon.trans.*;
|
[
"org.pentaho.di"
] |
org.pentaho.di;
| 56,149
|
public void drawString(float x, float y, String whatchars) {
drawString(x, y, whatchars, org.newdawn.slick.Color.white);
}
|
void function(float x, float y, String whatchars) { drawString(x, y, whatchars, org.newdawn.slick.Color.white); }
|
/**
* Draw a string
*
* @param x
* The x position to draw the string
* @param y
* The y position to draw the string
* @param whatchars
* The string to draw
*/
|
Draw a string
|
drawString
|
{
"repo_name": "SenshiSentou/SourceFight",
"path": "slick_dev/tags/Slick0.3/src/org/newdawn/slick/TrueTypeFont.java",
"license": "bsd-2-clause",
"size": 11684
}
|
[
"java.awt.Color"
] |
import java.awt.Color;
|
import java.awt.*;
|
[
"java.awt"
] |
java.awt;
| 1,403,159
|
@Override
public ItemStack getStackInSlot(int slot){
return getCoreElevator().inventory[slot];
}
|
ItemStack function(int slot){ return getCoreElevator().inventory[slot]; }
|
/**
* Returns the stack in slot i
*/
|
Returns the stack in slot i
|
getStackInSlot
|
{
"repo_name": "Mazdallier/PneumaticCraft",
"path": "src/pneumaticCraft/common/tileentity/TileEntityElevatorBase.java",
"license": "gpl-3.0",
"size": 30045
}
|
[
"net.minecraft.item.ItemStack"
] |
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.*;
|
[
"net.minecraft.item"
] |
net.minecraft.item;
| 2,726,731
|
public Timestamp getLastRecalculated ()
{
return (Timestamp)get_Value(COLUMNNAME_LastRecalculated);
}
|
Timestamp function () { return (Timestamp)get_Value(COLUMNNAME_LastRecalculated); }
|
/** Get Last Recalculated.
@return The time last recalculated.
*/
|
Get Last Recalculated
|
getLastRecalculated
|
{
"repo_name": "braully/adempiere",
"path": "base/src/org/compiere/model/X_PA_ReportCube.java",
"license": "gpl-2.0",
"size": 15315
}
|
[
"java.sql.Timestamp"
] |
import java.sql.Timestamp;
|
import java.sql.*;
|
[
"java.sql"
] |
java.sql;
| 1,059,987
|
public BusinessObjectService getBusinessObjectService() {
return businessObjectService;
}
|
BusinessObjectService function() { return businessObjectService; }
|
/**
* Gets the businessObjectService attribute.
* @return Returns the businessObjectService.
*/
|
Gets the businessObjectService attribute
|
getBusinessObjectService
|
{
"repo_name": "ua-eas/kfs",
"path": "kfs-core/src/main/java/org/kuali/kfs/fp/batch/service/impl/ProcurementCardCreateDocumentServiceImpl.java",
"license": "agpl-3.0",
"size": 95596
}
|
[
"org.kuali.rice.krad.service.BusinessObjectService"
] |
import org.kuali.rice.krad.service.BusinessObjectService;
|
import org.kuali.rice.krad.service.*;
|
[
"org.kuali.rice"
] |
org.kuali.rice;
| 1,108,654
|
public synchronized Set<String> keySet()
{
return mConfigMap.keySet();
}
public static class ConfigSection
{
public String name; // Section name
private final HashMap<String, ConfigParameter> parameters; // Parameters sorted by name for easy
// lookup
private final LinkedList<ConfigLine> lines; // All the lines in this section, including comments
// Name of the next section, or null if there are no sections left to read in the file:
private String nextName = null;
public ConfigSection( String sectionName )
{
parameters = new HashMap<>();
lines = new LinkedList<>();
if( !TextUtils.isEmpty( sectionName ) && !sectionName.equals( SECTIONLESS_NAME ) )
lines.add( new ConfigLine( ConfigLine.LINE_SECTION, "[" + sectionName + "]\n", null ) );
name = sectionName;
}
public ConfigSection( String sectionName, BufferedReader br )
{
String fullLine, strLine, p, v;
ConfigParameter confParam;
int x, y;
parameters = new HashMap<>();
lines = new LinkedList<>();
if( !TextUtils.isEmpty( sectionName ) && !sectionName.equals( SECTIONLESS_NAME ) )
lines.add( new ConfigLine( ConfigLine.LINE_SECTION, "[" + sectionName + "]\n", null ) );
name = sectionName;
// No file to read from. Quit.
if( br == null )
return;
try
{
while( ( fullLine = br.readLine() ) != null )
{
strLine = fullLine.trim();
if( ( strLine.length() < 1 )
|| ( strLine.startsWith( "#" ) )
|| ( strLine.startsWith( ";" ) )
|| ( ( strLine.length() > 1 ) && ( strLine
.startsWith( "//" ) ) ) )
{ // A comment or blank line.
lines.add( new ConfigLine( ConfigLine.LINE_GARBAGE, fullLine + "\n", null ) );
}
else if( strLine.contains( "=" ) )
{
// This should be a "parameter=value" pair:
x = strLine.indexOf( '=' );
if( x < 1 )
return; // This shouldn't happen (bad syntax). Quit.
if( x < ( strLine.length() - 1 ) )
{
p = strLine.substring( 0, x ).trim();
if( p.length() < 1 )
return; // This shouldn't happen (bad syntax). Quit.
v = strLine.substring( x + 1).trim();
// v = v.replace( "\"", "" ); // I'm doing this later, so I can save
// back without losing them
if( v.length() > 0 )
{
// Save the parameter=value pair
confParam = parameters.get( p );
if( confParam != null )
{
confParam.value = v;
}
else
{
confParam = new ConfigParameter( p, v );
lines.add( new ConfigLine( ConfigLine.LINE_PARAM, fullLine
+ "\n", confParam ) );
parameters.put( p, confParam ); // Save the pair.
}
}
} // It's ok to have an empty assignment (such as "param=")
}
else if( strLine.contains( "[" ) )
{
// This should be the beginning of the next section
if( ( strLine.length() < 3 ) || ( !strLine.contains( "]" ) ) )
return; // This shouldn't happen (bad syntax). Quit.
x = strLine.indexOf( '[' );
y = strLine.indexOf( ']' );
if( ( x == -1 ) || ( y == -1 ) || ( y <= x + 1 ) )
return; // This shouldn't happen (bad syntax). Quit.
p = strLine.substring( x + 1, y ).trim();
// Save the name of the next section.
nextName = p;
// Done reading parameters. Return.
return;
}
else
{
// This shouldn't happen (bad syntax). Quit.
return;
}
}
}
catch( IOException ioe )
{
// (Don't care)
}
}
|
synchronized Set<String> function() { return mConfigMap.keySet(); } public static class ConfigSection { public String name; private final HashMap<String, ConfigParameter> parameters; private final LinkedList<ConfigLine> lines; private String nextName = null; public ConfigSection( String sectionName ) { parameters = new HashMap<>(); lines = new LinkedList<>(); if( !TextUtils.isEmpty( sectionName ) && !sectionName.equals( SECTIONLESS_NAME ) ) lines.add( new ConfigLine( ConfigLine.LINE_SECTION, "[" + sectionName + "]\n", null ) ); name = sectionName; } public ConfigSection( String sectionName, BufferedReader br ) { String fullLine, strLine, p, v; ConfigParameter confParam; int x, y; parameters = new HashMap<>(); lines = new LinkedList<>(); if( !TextUtils.isEmpty( sectionName ) && !sectionName.equals( SECTIONLESS_NAME ) ) lines.add( new ConfigLine( ConfigLine.LINE_SECTION, "[" + sectionName + "]\n", null ) ); name = sectionName; if( br == null ) return; try { while( ( fullLine = br.readLine() ) != null ) { strLine = fullLine.trim(); if( ( strLine.length() < 1 ) ( strLine.startsWith( "#" ) ) ( strLine.startsWith( ";" ) ) ( ( strLine.length() > 1 ) && ( strLine .startsWith( STR\nSTR=STR\nSTR[STR]" ) ) ) return; x = strLine.indexOf( '[' ); y = strLine.indexOf( ']' ); if( ( x == -1 ) ( y == -1 ) ( y <= x + 1 ) ) return; p = strLine.substring( x + 1, y ).trim(); nextName = p; return; } else { return; } } } catch( IOException ioe ) { } }
|
/**
* Returns a handle to the configMap keyset.
*
* @return keyset containing all the config section titles.
*/
|
Returns a handle to the configMap keyset
|
keySet
|
{
"repo_name": "mupen64plus-ae/mupen64plus-ae",
"path": "app/src/main/java/paulscode/android/mupen64plusae/persistent/ConfigFile.java",
"license": "gpl-3.0",
"size": 22006
}
|
[
"android.text.TextUtils",
"java.io.BufferedReader",
"java.io.IOException",
"java.util.HashMap",
"java.util.LinkedList",
"java.util.Set"
] |
import android.text.TextUtils; import java.io.BufferedReader; import java.io.IOException; import java.util.HashMap; import java.util.LinkedList; import java.util.Set;
|
import android.text.*; import java.io.*; import java.util.*;
|
[
"android.text",
"java.io",
"java.util"
] |
android.text; java.io; java.util;
| 405,228
|
@Generated
@Selector("results")
public native NSArray<? extends VNSaliencyImageObservation> results();
|
@Selector(STR) native NSArray<? extends VNSaliencyImageObservation> function();
|
/**
* VNSaliencyImageObservation results.
*/
|
VNSaliencyImageObservation results
|
results
|
{
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/vision/VNGenerateAttentionBasedSaliencyImageRequest.java",
"license": "apache-2.0",
"size": 5556
}
|
[
"org.moe.natj.objc.ann.Selector"
] |
import org.moe.natj.objc.ann.Selector;
|
import org.moe.natj.objc.ann.*;
|
[
"org.moe.natj"
] |
org.moe.natj;
| 2,603,176
|
private void writeResources(List<Resource> resources) throws IOException {
List<String> resourceStrings = new ArrayList<>();
for (Resource resource : resources) {
resourceStrings.add(resource.getId());
}
writeJsonArray(JsonDocumentField.RESOURCE, resourceStrings);
}
|
void function(List<Resource> resources) throws IOException { List<String> resourceStrings = new ArrayList<>(); for (Resource resource : resources) { resourceStrings.add(resource.getId()); } writeJsonArray(JsonDocumentField.RESOURCE, resourceStrings); }
|
/**
* Writes the list of <code>Resource</code>s to the JSONGenerator.
*
* @param resources
* the list of resources to be written.
*/
|
Writes the list of <code>Resource</code>s to the JSONGenerator
|
writeResources
|
{
"repo_name": "aws/aws-sdk-java-v2",
"path": "test/test-utils/src/main/java/software/amazon/awssdk/core/auth/policy/internal/JsonPolicyWriter.java",
"license": "apache-2.0",
"size": 13130
}
|
[
"java.io.IOException",
"java.util.ArrayList",
"java.util.List",
"software.amazon.awssdk.core.auth.policy.Resource"
] |
import java.io.IOException; import java.util.ArrayList; import java.util.List; import software.amazon.awssdk.core.auth.policy.Resource;
|
import java.io.*; import java.util.*; import software.amazon.awssdk.core.auth.policy.*;
|
[
"java.io",
"java.util",
"software.amazon.awssdk"
] |
java.io; java.util; software.amazon.awssdk;
| 480,809
|
public static Table fromMetastoreTable(Db db,
org.apache.hadoop.hive.metastore.api.Table msTbl) {
// Create a table of appropriate type
Table table = null;
if (TableType.valueOf(msTbl.getTableType()) == TableType.VIRTUAL_VIEW) {
table = new View(msTbl, db, msTbl.getTableName(), msTbl.getOwner());
} else if (HBaseTable.isHBaseTable(msTbl)) {
table = new HBaseTable(msTbl, db, msTbl.getTableName(), msTbl.getOwner());
} else if (KuduTable.isKuduTable(msTbl)) {
table = new KuduTable(msTbl, db, msTbl.getTableName(), msTbl.getOwner());
} else if (DataSourceTable.isDataSourceTable(msTbl)) {
// It's important to check if this is a DataSourceTable before HdfsTable because
// DataSourceTables are still represented by HDFS tables in the metastore but
// have a special table property to indicate that Impala should use an external
// data source.
table = new DataSourceTable(msTbl, db, msTbl.getTableName(), msTbl.getOwner());
} else if (HdfsFileFormat.isHdfsInputFormatClass(msTbl.getSd().getInputFormat())) {
table = new HdfsTable(msTbl, db, msTbl.getTableName(), msTbl.getOwner());
}
return table;
}
|
static Table function(Db db, org.apache.hadoop.hive.metastore.api.Table msTbl) { Table table = null; if (TableType.valueOf(msTbl.getTableType()) == TableType.VIRTUAL_VIEW) { table = new View(msTbl, db, msTbl.getTableName(), msTbl.getOwner()); } else if (HBaseTable.isHBaseTable(msTbl)) { table = new HBaseTable(msTbl, db, msTbl.getTableName(), msTbl.getOwner()); } else if (KuduTable.isKuduTable(msTbl)) { table = new KuduTable(msTbl, db, msTbl.getTableName(), msTbl.getOwner()); } else if (DataSourceTable.isDataSourceTable(msTbl)) { table = new DataSourceTable(msTbl, db, msTbl.getTableName(), msTbl.getOwner()); } else if (HdfsFileFormat.isHdfsInputFormatClass(msTbl.getSd().getInputFormat())) { table = new HdfsTable(msTbl, db, msTbl.getTableName(), msTbl.getOwner()); } return table; }
|
/**
* Creates a table of the appropriate type based on the given hive.metastore.api.Table
* object.
*/
|
Creates a table of the appropriate type based on the given hive.metastore.api.Table object
|
fromMetastoreTable
|
{
"repo_name": "924060929/impala-frontend",
"path": "fe/src/main/java/org/apache/impala/catalog/Table.java",
"license": "apache-2.0",
"size": 18885
}
|
[
"org.apache.hadoop.hive.metastore.TableType"
] |
import org.apache.hadoop.hive.metastore.TableType;
|
import org.apache.hadoop.hive.metastore.*;
|
[
"org.apache.hadoop"
] |
org.apache.hadoop;
| 2,720,710
|
public final void mouseDown(MouseEvent event) {
if (event.button != 1) return;
if (dragInProgress) return; // spurious event
super.beginSession();
dragInProgress = true;
points[0].x = event.x;
points[0].y = event.y;
render(points[0]);
prepareRetrigger();
}
|
final void function(MouseEvent event) { if (event.button != 1) return; if (dragInProgress) return; super.beginSession(); dragInProgress = true; points[0].x = event.x; points[0].y = event.y; render(points[0]); prepareRetrigger(); }
|
/**
* Handles a mouseDown event.
*
* @param event the mouse event detail information
*/
|
Handles a mouseDown event
|
mouseDown
|
{
"repo_name": "bdaum/zoraPD",
"path": "com.bdaum.zoom.ui/src/com/bdaum/zoom/ui/paint/ContinuousPaintSession.java",
"license": "gpl-2.0",
"size": 6029
}
|
[
"org.eclipse.swt.events.MouseEvent"
] |
import org.eclipse.swt.events.MouseEvent;
|
import org.eclipse.swt.events.*;
|
[
"org.eclipse.swt"
] |
org.eclipse.swt;
| 1,677,213
|
@Test
public void testDrawWithNullValue() {
try {
DefaultTableXYDataset dataset = new DefaultTableXYDataset();
XYSeries s1 = new XYSeries("Series 1", true, false);
s1.add(5.0, 5.0);
s1.add(10.0, null);
s1.add(15.0, 9.5);
s1.add(20.0, 7.5);
dataset.addSeries(s1);
XYSeries s2 = new XYSeries("Series 2", true, false);
s2.add(5.0, 5.0);
s2.add(10.0, 15.5);
s2.add(15.0, null);
s2.add(20.0, null);
dataset.addSeries(s2);
XYPlot plot = new XYPlot(dataset,
new NumberAxis("X"), new NumberAxis("Y"),
new XYStepRenderer());
JFreeChart chart = new JFreeChart(plot);
chart.createBufferedImage(300, 200,
null);
}
catch (NullPointerException e) {
fail("No exception should be thrown.");
}
}
|
void function() { try { DefaultTableXYDataset dataset = new DefaultTableXYDataset(); XYSeries s1 = new XYSeries(STR, true, false); s1.add(5.0, 5.0); s1.add(10.0, null); s1.add(15.0, 9.5); s1.add(20.0, 7.5); dataset.addSeries(s1); XYSeries s2 = new XYSeries(STR, true, false); s2.add(5.0, 5.0); s2.add(10.0, 15.5); s2.add(15.0, null); s2.add(20.0, null); dataset.addSeries(s2); XYPlot plot = new XYPlot(dataset, new NumberAxis("X"), new NumberAxis("Y"), new XYStepRenderer()); JFreeChart chart = new JFreeChart(plot); chart.createBufferedImage(300, 200, null); } catch (NullPointerException e) { fail(STR); } }
|
/**
* Draws the chart with a <code>null</code> value in the dataset to make
* sure that no exceptions are thrown.
*/
|
Draws the chart with a <code>null</code> value in the dataset to make sure that no exceptions are thrown
|
testDrawWithNullValue
|
{
"repo_name": "raincs13/phd",
"path": "tests/org/jfree/chart/renderer/xy/XYStepRendererTest.java",
"license": "lgpl-2.1",
"size": 6515
}
|
[
"org.jfree.chart.JFreeChart",
"org.jfree.chart.axis.NumberAxis",
"org.jfree.chart.plot.XYPlot",
"org.jfree.data.xy.DefaultTableXYDataset",
"org.jfree.data.xy.XYSeries",
"org.junit.Assert"
] |
import org.jfree.chart.JFreeChart; import org.jfree.chart.axis.NumberAxis; import org.jfree.chart.plot.XYPlot; import org.jfree.data.xy.DefaultTableXYDataset; import org.jfree.data.xy.XYSeries; import org.junit.Assert;
|
import org.jfree.chart.*; import org.jfree.chart.axis.*; import org.jfree.chart.plot.*; import org.jfree.data.xy.*; import org.junit.*;
|
[
"org.jfree.chart",
"org.jfree.data",
"org.junit"
] |
org.jfree.chart; org.jfree.data; org.junit;
| 2,315,222
|
@Test
public void testSpearmanMatrix() {
logger.info("spearmanMatrix");
Configuration configuration = getConfiguration();
Dataframe dataset = generateDataset(configuration);
DataTable2D expResult = new DataTable2D();
expResult.put(0, new AssociativeArray());
expResult.put2d(0, 0, 1.0);
expResult.put2d(0, 1, 0.10229198378533);
expResult.put2d(0, 2, -0.60665935791938);
expResult.put2d(0, 3, -0.56631689758552);
expResult.put2d(1, 0, 0.10229198378533);
expResult.put2d(1, 1, 1.0);
expResult.put2d(1, 2, -0.14688588181833);
expResult.put2d(1, 3, -0.087423415709411);
expResult.put2d(2, 0, -0.60665935791938);
expResult.put2d(2, 1, -0.14688588181833);
expResult.put2d(2, 2, 1.0);
expResult.put2d(2, 3, 0.8472888999181);
expResult.put2d(3, 0, -0.56631689758552);
expResult.put2d(3, 1, -0.087423415709411);
expResult.put2d(3, 2, 0.8472888999181);
expResult.put2d(3, 3, 1.0);
DataTable2D result = Bivariate.spearmanMatrix(dataset);
TestUtils.assertDoubleDataTable2D(expResult, result);
dataset.close();
}
|
void function() { logger.info(STR); Configuration configuration = getConfiguration(); Dataframe dataset = generateDataset(configuration); DataTable2D expResult = new DataTable2D(); expResult.put(0, new AssociativeArray()); expResult.put2d(0, 0, 1.0); expResult.put2d(0, 1, 0.10229198378533); expResult.put2d(0, 2, -0.60665935791938); expResult.put2d(0, 3, -0.56631689758552); expResult.put2d(1, 0, 0.10229198378533); expResult.put2d(1, 1, 1.0); expResult.put2d(1, 2, -0.14688588181833); expResult.put2d(1, 3, -0.087423415709411); expResult.put2d(2, 0, -0.60665935791938); expResult.put2d(2, 1, -0.14688588181833); expResult.put2d(2, 2, 1.0); expResult.put2d(2, 3, 0.8472888999181); expResult.put2d(3, 0, -0.56631689758552); expResult.put2d(3, 1, -0.087423415709411); expResult.put2d(3, 2, 0.8472888999181); expResult.put2d(3, 3, 1.0); DataTable2D result = Bivariate.spearmanMatrix(dataset); TestUtils.assertDoubleDataTable2D(expResult, result); dataset.close(); }
|
/**
* Test of spearmanMatrix method, of class Bivariate.
*/
|
Test of spearmanMatrix method, of class Bivariate
|
testSpearmanMatrix
|
{
"repo_name": "datumbox/datumbox-framework",
"path": "datumbox-framework-core/src/test/java/com/datumbox/framework/core/statistics/descriptivestatistics/BivariateTest.java",
"license": "apache-2.0",
"size": 10036
}
|
[
"com.datumbox.framework.common.Configuration",
"com.datumbox.framework.common.dataobjects.AssociativeArray",
"com.datumbox.framework.common.dataobjects.DataTable2D",
"com.datumbox.framework.core.common.dataobjects.Dataframe",
"com.datumbox.framework.tests.utilities.TestUtils"
] |
import com.datumbox.framework.common.Configuration; import com.datumbox.framework.common.dataobjects.AssociativeArray; import com.datumbox.framework.common.dataobjects.DataTable2D; import com.datumbox.framework.core.common.dataobjects.Dataframe; import com.datumbox.framework.tests.utilities.TestUtils;
|
import com.datumbox.framework.common.*; import com.datumbox.framework.common.dataobjects.*; import com.datumbox.framework.core.common.dataobjects.*; import com.datumbox.framework.tests.utilities.*;
|
[
"com.datumbox.framework"
] |
com.datumbox.framework;
| 953,975
|
@ApiModelProperty(example = "null", required = true, value = "Does the fleet have an active fleet advertisement")
public Boolean getIsRegistered() {
return isRegistered;
}
|
@ApiModelProperty(example = "null", required = true, value = STR) Boolean function() { return isRegistered; }
|
/**
* Does the fleet have an active fleet advertisement
*
* @return isRegistered
**/
|
Does the fleet have an active fleet advertisement
|
getIsRegistered
|
{
"repo_name": "GoldenGnu/eve-esi",
"path": "src/main/java/net/troja/eve/esi/model/FleetResponse.java",
"license": "apache-2.0",
"size": 4480
}
|
[
"io.swagger.annotations.ApiModelProperty"
] |
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.*;
|
[
"io.swagger.annotations"
] |
io.swagger.annotations;
| 485,601
|
public List<DataDiskStorageTypeInfo> dataDiskStorageInfo() {
return this.dataDiskStorageInfo;
}
|
List<DataDiskStorageTypeInfo> function() { return this.dataDiskStorageInfo; }
|
/**
* Get the dataDiskStorageInfo property: Storage information about the data disks present in the custom image.
*
* @return the dataDiskStorageInfo value.
*/
|
Get the dataDiskStorageInfo property: Storage information about the data disks present in the custom image
|
dataDiskStorageInfo
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImageInner.java",
"license": "mit",
"size": 10331
}
|
[
"com.azure.resourcemanager.devtestlabs.models.DataDiskStorageTypeInfo",
"java.util.List"
] |
import com.azure.resourcemanager.devtestlabs.models.DataDiskStorageTypeInfo; import java.util.List;
|
import com.azure.resourcemanager.devtestlabs.models.*; import java.util.*;
|
[
"com.azure.resourcemanager",
"java.util"
] |
com.azure.resourcemanager; java.util;
| 1,073,978
|
private boolean chooseMarbleSource(Space s) {
if(s.hasMarble() && s.getMarble().getOwner() == currPlayer) {
this.setStatus(Game.Status.PROCESSING);
this.selectedSource = s;
s.setFocus(true);
if(allPossDst.get(selectedSource) == null) {
//player cannot move
Log.d("GAME", "Player "+currPlayer+" selected invalid marble at " + selectedSource);
s.setFocus(false);
selectedSource = null;
setStatus(Game.Status.WAITING_FOR_MARBLE_SELECTION);
display.getToolBox().addLogMessage("You cannot move that marble!");
display.refresh();
return false;
} else {
this.setStatus(Game.Status.WAITING_FOR_MOVE_CHOICE);
display.getToolBox().addLogMessage(currPlayer+", Please select a space to move the marble " + roll);
display.refresh();
return true;
}
} else {
return false;
}
}
|
boolean function(Space s) { if(s.hasMarble() && s.getMarble().getOwner() == currPlayer) { this.setStatus(Game.Status.PROCESSING); this.selectedSource = s; s.setFocus(true); if(allPossDst.get(selectedSource) == null) { Log.d("GAME", STR+currPlayer+STR + selectedSource); s.setFocus(false); selectedSource = null; setStatus(Game.Status.WAITING_FOR_MARBLE_SELECTION); display.getToolBox().addLogMessage(STR); display.refresh(); return false; } else { this.setStatus(Game.Status.WAITING_FOR_MOVE_CHOICE); display.getToolBox().addLogMessage(currPlayer+STR + roll); display.refresh(); return true; } } else { return false; } }
|
/**
* Checks to see if the current player can move this marble, then does so if is valid.
* @return
*/
|
Checks to see if the current player can move this marble, then does so if is valid
|
chooseMarbleSource
|
{
"repo_name": "jrdbnntt/aggravation",
"path": "src/com/jrdbnntt/aggravation/game/Game.java",
"license": "mit",
"size": 10947
}
|
[
"com.jrdbnntt.aggravation.Util",
"com.jrdbnntt.aggravation.board.space.Space",
"com.jrdbnntt.aggravation.game.Player"
] |
import com.jrdbnntt.aggravation.Util; import com.jrdbnntt.aggravation.board.space.Space; import com.jrdbnntt.aggravation.game.Player;
|
import com.jrdbnntt.aggravation.*; import com.jrdbnntt.aggravation.board.space.*; import com.jrdbnntt.aggravation.game.*;
|
[
"com.jrdbnntt.aggravation"
] |
com.jrdbnntt.aggravation;
| 1,573,431
|
public void setRecall(DoubleMatrix recall) {
this.recall = recall;}
|
void function(DoubleMatrix recall) { this.recall = recall;}
|
/**
* Set Recall for each category
* @param recall is a DoubleMatrix holding computed recall for each category (in order of categories list)
*/
|
Set Recall for each category
|
setRecall
|
{
"repo_name": "utir/square-2.0",
"path": "SQUARE/src/main/java/org/square/qa/utilities/constructs/Metrics.java",
"license": "mit",
"size": 5453
}
|
[
"org.jblas.DoubleMatrix"
] |
import org.jblas.DoubleMatrix;
|
import org.jblas.*;
|
[
"org.jblas"
] |
org.jblas;
| 355,276
|
public Iterator desktopPaneIdIterator()
{
return desktopPanes.keySet().iterator();
}
|
Iterator function() { return desktopPanes.keySet().iterator(); }
|
/**
* Get an iterator over all desktop pane ids.
*
* @return A desktop pane id iterator.
*/
|
Get an iterator over all desktop pane ids
|
desktopPaneIdIterator
|
{
"repo_name": "iritgo/iritgo-aktario",
"path": "aktario-framework/src/main/java/de/iritgo/aktario/core/gui/SwingDesktopManager.java",
"license": "apache-2.0",
"size": 8903
}
|
[
"java.util.Iterator"
] |
import java.util.Iterator;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,448,948
|
public static Locker getReadableLocker(Environment env,
Database dbHandle,
Locker locker,
boolean retainNonTxnLocks,
boolean readCommittedIsolation)
throws DatabaseException {
DatabaseImpl dbImpl = DbInternal.dbGetDatabaseImpl(dbHandle);
if (!dbImpl.isTransactional() &&
locker != null &&
locker.isTransactional()) {
throw new DatabaseException
("A Transaction cannot be used because the" +
" database was opened" +
" non-transactionally");
}
if (locker != null &&
!locker.isTransactional() &&
!retainNonTxnLocks) {
locker = null;
}
if (locker != null && locker.isReadCommittedIsolation()) {
readCommittedIsolation = true;
}
return getReadableLocker(env, locker, retainNonTxnLocks,
readCommittedIsolation);
}
|
static Locker function(Environment env, Database dbHandle, Locker locker, boolean retainNonTxnLocks, boolean readCommittedIsolation) throws DatabaseException { DatabaseImpl dbImpl = DbInternal.dbGetDatabaseImpl(dbHandle); if (!dbImpl.isTransactional() && locker != null && locker.isTransactional()) { throw new DatabaseException (STR + STR + STR); } if (locker != null && !locker.isTransactional() && !retainNonTxnLocks) { locker = null; } if (locker != null && locker.isReadCommittedIsolation()) { readCommittedIsolation = true; } return getReadableLocker(env, locker, retainNonTxnLocks, readCommittedIsolation); }
|
/**
* Get a locker for this database handle for a read or cursor operation.
* See getWritableLocker for an explanation of retainNonTxnLocks.
*/
|
Get a locker for this database handle for a read or cursor operation. See getWritableLocker for an explanation of retainNonTxnLocks
|
getReadableLocker
|
{
"repo_name": "plast-lab/DelphJ",
"path": "examples/berkeleydb/com/sleepycat/je/txn/LockerFactory.java",
"license": "mit",
"size": 10003
}
|
[
"com.sleepycat.je.Database",
"com.sleepycat.je.DatabaseException",
"com.sleepycat.je.DbInternal",
"com.sleepycat.je.Environment",
"com.sleepycat.je.dbi.DatabaseImpl"
] |
import com.sleepycat.je.Database; import com.sleepycat.je.DatabaseException; import com.sleepycat.je.DbInternal; import com.sleepycat.je.Environment; import com.sleepycat.je.dbi.DatabaseImpl;
|
import com.sleepycat.je.*; import com.sleepycat.je.dbi.*;
|
[
"com.sleepycat.je"
] |
com.sleepycat.je;
| 726,405
|
public void setInput(DataInput dataInput) {
din = dataInput;
in = null;
}
|
void function(DataInput dataInput) { din = dataInput; in = null; }
|
/**
* Set the input stream to the argument stream (or file).
* Note that {@link java.io.RandomAccessFile} implements
* {@link java.io.DataInput}.
* @param dataInput the input stream to read from
*/
|
Set the input stream to the argument stream (or file). Note that <code>java.io.RandomAccessFile</code> implements <code>java.io.DataInput</code>
|
setInput
|
{
"repo_name": "tolweb/tolweb-app",
"path": "TolwebUtils/src/org/tolweb/misc/ImageInfo.java",
"license": "bsd-3-clause",
"size": 36109
}
|
[
"java.io.DataInput"
] |
import java.io.DataInput;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,476,755
|
public static ims.nursing.assessment.domain.objects.SafeEnvironmentComponent extractSafeEnvironmentComponent(ims.domain.ILightweightDomainFactory domainFactory, ims.spinalinjuries.vo.NurAssessmentSafeEnvironmentVo valueObject)
{
return extractSafeEnvironmentComponent(domainFactory, valueObject, new HashMap());
}
|
static ims.nursing.assessment.domain.objects.SafeEnvironmentComponent function(ims.domain.ILightweightDomainFactory domainFactory, ims.spinalinjuries.vo.NurAssessmentSafeEnvironmentVo valueObject) { return extractSafeEnvironmentComponent(domainFactory, valueObject, new HashMap()); }
|
/**
* Create the domain object from the value object.
* @param domainFactory - used to create existing (persistent) domain objects.
* @param valueObject - extract the domain object fields from this.
*/
|
Create the domain object from the value object
|
extractSafeEnvironmentComponent
|
{
"repo_name": "open-health-hub/openMAXIMS",
"path": "openmaxims_workspace/ValueObjects/src/ims/spinalinjuries/vo/domain/NurAssessmentSafeEnvironmentVoAssembler.java",
"license": "agpl-3.0",
"size": 26694
}
|
[
"java.util.HashMap"
] |
import java.util.HashMap;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,403,756
|
@NonNull
public List<String> whereArgs() {
return whereArgs;
}
|
List<String> function() { return whereArgs; }
|
/**
* Gets optional immutable list of arguments for {@link #where()} clause.
*
* @return non-null, immutable list of arguments for {@code WHERE} clause.
*/
|
Gets optional immutable list of arguments for <code>#where()</code> clause
|
whereArgs
|
{
"repo_name": "pushtorefresh/storio",
"path": "storio-content-resolver/src/main/java/com/pushtorefresh/storio3/contentresolver/queries/DeleteQuery.java",
"license": "apache-2.0",
"size": 7440
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,125,246
|
@Nonnull public static UBL23WriterBuilder<StatementType> statement(){return UBL23WriterBuilder.create(StatementType.class);}
|
@Nonnull public static UBL23WriterBuilder<StatementType> statement(){return UBL23WriterBuilder.create(StatementType.class);}
|
/** Create a writer builder for SelfBilledInvoice.
@return The builder and never <code>null</code> */
|
Create a writer builder for SelfBilledInvoice
|
selfBilledInvoice
|
{
"repo_name": "phax/ph-ubl",
"path": "ph-ubl23/src/main/java/com/helger/ubl23/UBL23Writer.java",
"license": "apache-2.0",
"size": 32994
}
|
[
"javax.annotation.Nonnull"
] |
import javax.annotation.Nonnull;
|
import javax.annotation.*;
|
[
"javax.annotation"
] |
javax.annotation;
| 141,828
|
public static native int recvb(long sock, ByteBuffer buf,
int offset, int nbytes);
public static native int recvbb(long sock,
int offset, int nbytes);
public static native int recvbt(long sock, ByteBuffer buf,
int offset, int nbytes, long timeout);
public static native int recvbbt(long sock,
int offset, int nbytes, long timeout);
|
static native int recvb(long sock, ByteBuffer buf, int offset, int nbytes); public static native int recvbb(long sock, int offset, int nbytes); public static native int recvbt(long sock, ByteBuffer buf, int offset, int nbytes, long timeout); public static native int function(long sock, int offset, int nbytes, long timeout);
|
/**
* Read data from a network with timeout using internally set ByteBuffer
*/
|
Read data from a network with timeout using internally set ByteBuffer
|
recvbbt
|
{
"repo_name": "plumer/codana",
"path": "tomcat_files/8.0.22/Socket.java",
"license": "mit",
"size": 23131
}
|
[
"java.nio.ByteBuffer"
] |
import java.nio.ByteBuffer;
|
import java.nio.*;
|
[
"java.nio"
] |
java.nio;
| 165,256
|
@Test
public final void testDistanceMap_TouchingLabels()
{
ByteProcessor image = new ByteProcessor(8, 8);
for (int y = 0; y < 3; y++)
{
for (int x = 0; x < 3; x++)
{
image.set(x+1, y+1, 1);
image.set(x+4, y+1, 2);
image.set(x+1, y+4, 3);
image.set(x+4, y+4, 4);
}
}
DistanceTransform ldt = new DistanceTransform3x3Short(ChamferWeights.CHESSKNIGHT, true);
ImageProcessor distMap = ldt.distanceMap(image);
// value 0 in backgrounf
assertEquals(0, distMap.getf(0, 0), .1);
assertEquals(0, distMap.getf(5, 0), .1);
assertEquals(0, distMap.getf(7, 7), .1);
// value equal to 2 in the middle of the labels
assertEquals(2, distMap.getf(2, 2), .1);
assertEquals(2, distMap.getf(5, 2), .1);
assertEquals(2, distMap.getf(2, 5), .1);
assertEquals(2, distMap.getf(5, 5), .1);
// value equal to 1 on the border of the labels
assertEquals(1, distMap.getf(1, 3), .1);
assertEquals(1, distMap.getf(3, 3), .1);
assertEquals(1, distMap.getf(4, 3), .1);
assertEquals(1, distMap.getf(6, 3), .1);
assertEquals(1, distMap.getf(1, 6), .1);
assertEquals(1, distMap.getf(3, 6), .1);
assertEquals(1, distMap.getf(4, 6), .1);
assertEquals(1, distMap.getf(6, 6), .1);
}
|
final void function() { ByteProcessor image = new ByteProcessor(8, 8); for (int y = 0; y < 3; y++) { for (int x = 0; x < 3; x++) { image.set(x+1, y+1, 1); image.set(x+4, y+1, 2); image.set(x+1, y+4, 3); image.set(x+4, y+4, 4); } } DistanceTransform ldt = new DistanceTransform3x3Short(ChamferWeights.CHESSKNIGHT, true); ImageProcessor distMap = ldt.distanceMap(image); assertEquals(0, distMap.getf(0, 0), .1); assertEquals(0, distMap.getf(5, 0), .1); assertEquals(0, distMap.getf(7, 7), .1); assertEquals(2, distMap.getf(2, 2), .1); assertEquals(2, distMap.getf(5, 2), .1); assertEquals(2, distMap.getf(2, 5), .1); assertEquals(2, distMap.getf(5, 5), .1); assertEquals(1, distMap.getf(1, 3), .1); assertEquals(1, distMap.getf(3, 3), .1); assertEquals(1, distMap.getf(4, 3), .1); assertEquals(1, distMap.getf(6, 3), .1); assertEquals(1, distMap.getf(1, 6), .1); assertEquals(1, distMap.getf(3, 6), .1); assertEquals(1, distMap.getf(4, 6), .1); assertEquals(1, distMap.getf(6, 6), .1); }
|
/**
* Test method for {@link inra.ijpb.label.distmap.LabelDistanceTransform3x3Short#distanceMap(ij.process.ImageProcessor)}.
*/
|
Test method for <code>inra.ijpb.label.distmap.LabelDistanceTransform3x3Short#distanceMap(ij.process.ImageProcessor)</code>
|
testDistanceMap_TouchingLabels
|
{
"repo_name": "ijpb/MorphoLibJ",
"path": "src/test/java/inra/ijpb/binary/distmap/DistanceTransform5x5FloatTest.java",
"license": "lgpl-3.0",
"size": 6966
}
|
[
"org.junit.Assert"
] |
import org.junit.Assert;
|
import org.junit.*;
|
[
"org.junit"
] |
org.junit;
| 112,294
|
public ServiceFuture<FlowLogInformationInner> getFlowLogStatusAsync(String resourceGroupName, String networkWatcherName, String targetResourceId, final ServiceCallback<FlowLogInformationInner> serviceCallback) {
return ServiceFuture.fromResponse(getFlowLogStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback);
}
|
ServiceFuture<FlowLogInformationInner> function(String resourceGroupName, String networkWatcherName, String targetResourceId, final ServiceCallback<FlowLogInformationInner> serviceCallback) { return ServiceFuture.fromResponse(getFlowLogStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); }
|
/**
* Queries status of flow log and traffic analytics (optional) on a specified resource.
*
* @param resourceGroupName The name of the network watcher resource group.
* @param networkWatcherName The name of the network watcher resource.
* @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status.
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
|
Queries status of flow log and traffic analytics (optional) on a specified resource
|
getFlowLogStatusAsync
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/network/v2020_03_01/implementation/NetworkWatchersInner.java",
"license": "mit",
"size": 190989
}
|
[
"com.microsoft.rest.ServiceCallback",
"com.microsoft.rest.ServiceFuture"
] |
import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture;
|
import com.microsoft.rest.*;
|
[
"com.microsoft.rest"
] |
com.microsoft.rest;
| 2,227,888
|
public BitSet getOccupancyGridCopy() {
return (BitSet) occupancySet.clone();
}
|
BitSet function() { return (BitSet) occupancySet.clone(); }
|
/**
* Returns a copy of the internal occupancy grid.
*
* @return
*/
|
Returns a copy of the internal occupancy grid
|
getOccupancyGridCopy
|
{
"repo_name": "korpling/ANNIS",
"path": "src/main/java/org/corpus_tools/annis/gui/widgets/grid/Row.java",
"license": "apache-2.0",
"size": 5200
}
|
[
"java.util.BitSet"
] |
import java.util.BitSet;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 592,726
|
@Path("{name}")
public TimeLimitResource getTimeLimitsResource(
@PathParam("name") String name) {
return new TimeLimitResource(getUriInfo(), entityManagerConfig, name);
}
|
@Path(STR) TimeLimitResource function( @PathParam("name") String name) { return new TimeLimitResource(getUriInfo(), entityManagerConfig, name); }
|
/**
* Returns a time limit sub-resource with guid
*
* @param guid
* String guid of the time limit as last element in the path
*
* @return TimeLimitResource The time limit sub-resource
*/
|
Returns a time limit sub-resource with guid
|
getTimeLimitsResource
|
{
"repo_name": "FinTP/fintp_api",
"path": "src/main/java/ro/allevo/fintpws/resources/TimeLimitsResource.java",
"license": "gpl-3.0",
"size": 8472
}
|
[
"javax.ws.rs.Path",
"javax.ws.rs.PathParam"
] |
import javax.ws.rs.Path; import javax.ws.rs.PathParam;
|
import javax.ws.rs.*;
|
[
"javax.ws"
] |
javax.ws;
| 2,154,318
|
public synchronized String setUpFullReindex() throws ElasticsearchException, DotDataException {
if(indexReady()) {
try {
final String timeStamp=timestampFormatter.format(new Date());
// index names for new index
final String workingIndex=ES_WORKING_INDEX_NAME + "_" + timeStamp;
final String liveIndex=ES_LIVE_INDEX_NAME + "_" + timeStamp;
final IndicesAdminClient iac = new ESClient().getClient().admin().indices();
createContentIndex(workingIndex);
createContentIndex(liveIndex);
IndiciesInfo info=APILocator.getIndiciesAPI().loadIndicies();
IndiciesInfo newinfo=new IndiciesInfo();
newinfo.working=info.working;
newinfo.live=info.live;
newinfo.reindex_working=workingIndex;
newinfo.reindex_live=liveIndex;
APILocator.getIndiciesAPI().point(newinfo);
iapi.moveIndexToLocalNode(workingIndex);
iapi.moveIndexToLocalNode(liveIndex);
return timeStamp;
} catch (Exception e) {
throw new ElasticsearchException(e.getMessage(), e);
}
}
else
return initIndex();
}
|
synchronized String function() throws ElasticsearchException, DotDataException { if(indexReady()) { try { final String timeStamp=timestampFormatter.format(new Date()); final String workingIndex=ES_WORKING_INDEX_NAME + "_" + timeStamp; final String liveIndex=ES_LIVE_INDEX_NAME + "_" + timeStamp; final IndicesAdminClient iac = new ESClient().getClient().admin().indices(); createContentIndex(workingIndex); createContentIndex(liveIndex); IndiciesInfo info=APILocator.getIndiciesAPI().loadIndicies(); IndiciesInfo newinfo=new IndiciesInfo(); newinfo.working=info.working; newinfo.live=info.live; newinfo.reindex_working=workingIndex; newinfo.reindex_live=liveIndex; APILocator.getIndiciesAPI().point(newinfo); iapi.moveIndexToLocalNode(workingIndex); iapi.moveIndexToLocalNode(liveIndex); return timeStamp; } catch (Exception e) { throw new ElasticsearchException(e.getMessage(), e); } } else return initIndex(); }
|
/**
* creates new working and live indexes with reading aliases pointing to old index
* and write aliases pointing to both old and new indexes
* @return the timestamp string used as suffix for indices
* @throws DotDataException
* @throws ElasticsearchException
*/
|
creates new working and live indexes with reading aliases pointing to old index and write aliases pointing to both old and new indexes
|
setUpFullReindex
|
{
"repo_name": "guhb/core",
"path": "src/com/dotcms/content/elasticsearch/business/ESContentletIndexAPI.java",
"license": "gpl-3.0",
"size": 24341
}
|
[
"com.dotcms.content.elasticsearch.business.IndiciesAPI",
"com.dotcms.content.elasticsearch.util.ESClient",
"com.dotcms.repackage.org.elasticsearch.ElasticsearchException",
"com.dotcms.repackage.org.elasticsearch.client.IndicesAdminClient",
"com.dotmarketing.business.APILocator",
"com.dotmarketing.exception.DotDataException",
"java.util.Date"
] |
import com.dotcms.content.elasticsearch.business.IndiciesAPI; import com.dotcms.content.elasticsearch.util.ESClient; import com.dotcms.repackage.org.elasticsearch.ElasticsearchException; import com.dotcms.repackage.org.elasticsearch.client.IndicesAdminClient; import com.dotmarketing.business.APILocator; import com.dotmarketing.exception.DotDataException; import java.util.Date;
|
import com.dotcms.content.elasticsearch.business.*; import com.dotcms.content.elasticsearch.util.*; import com.dotcms.repackage.org.elasticsearch.*; import com.dotcms.repackage.org.elasticsearch.client.*; import com.dotmarketing.business.*; import com.dotmarketing.exception.*; import java.util.*;
|
[
"com.dotcms.content",
"com.dotcms.repackage",
"com.dotmarketing.business",
"com.dotmarketing.exception",
"java.util"
] |
com.dotcms.content; com.dotcms.repackage; com.dotmarketing.business; com.dotmarketing.exception; java.util;
| 92,299
|
public void testPersistenceAware()
{
Object idAlpha = null;
Object idBeta = null;
try
{
PersistenceManager pm = pmf.getPersistenceManager();
Transaction tx = pm.currentTransaction();
try
{
tx.begin();
PublicFields pfAlpha = new PublicFields();
PublicFields pfBeta = new PublicFields();
AccessPublicFields.setStringField(pfAlpha, "alpha");
AccessPublicFields.setIntField(pfAlpha, 1);
AccessPublicFields.setObjectField(pfAlpha, pfBeta);
AccessPublicFields.setStringField(pfBeta, "beta");
AccessPublicFields.setIntField(pfBeta, 2);
pm.makePersistent(pfAlpha);
idAlpha = JDOHelper.getObjectId(pfAlpha);
idBeta = JDOHelper.getObjectId(pfBeta);
tx.commit();
}
finally
{
if (tx.isActive())
{
tx.rollback();
}
pm.close();
}
pm = pmf.getPersistenceManager();
tx = pm.currentTransaction();
try
{
tx.begin();
PublicFields checkAlpha = (PublicFields)pm.getObjectById(idAlpha, true);
PublicFields checkBeta = (PublicFields)pm.getObjectById(idBeta, true);
assertEquals("alpha", AccessPublicFields.getStringField(checkAlpha));
assertEquals(1, AccessPublicFields.getIntField(checkAlpha));
assertTrue(checkBeta.equals(AccessPublicFields.getObjectField(checkAlpha)));
assertEquals("beta", AccessPublicFields.getStringField(checkBeta));
assertEquals(2, AccessPublicFields.getIntField(checkBeta));
tx.commit();
}
finally
{
if (tx.isActive())
{
tx.rollback();
}
pm.close();
}
}
finally
{
// Disconnect the objects
PersistenceManager pm = pmf.getPersistenceManager();
Transaction tx = pm.currentTransaction();
try
{
tx.begin();
PublicFields alpha = (PublicFields)pm.getObjectById(idAlpha);
AccessPublicFields.setObjectField(alpha, null);
tx.commit();
}
finally
{
if (tx.isActive())
{
tx.rollback();
}
}
clean(PublicFields.class);
}
}
|
void function() { Object idAlpha = null; Object idBeta = null; try { PersistenceManager pm = pmf.getPersistenceManager(); Transaction tx = pm.currentTransaction(); try { tx.begin(); PublicFields pfAlpha = new PublicFields(); PublicFields pfBeta = new PublicFields(); AccessPublicFields.setStringField(pfAlpha, "alpha"); AccessPublicFields.setIntField(pfAlpha, 1); AccessPublicFields.setObjectField(pfAlpha, pfBeta); AccessPublicFields.setStringField(pfBeta, "beta"); AccessPublicFields.setIntField(pfBeta, 2); pm.makePersistent(pfAlpha); idAlpha = JDOHelper.getObjectId(pfAlpha); idBeta = JDOHelper.getObjectId(pfBeta); tx.commit(); } finally { if (tx.isActive()) { tx.rollback(); } pm.close(); } pm = pmf.getPersistenceManager(); tx = pm.currentTransaction(); try { tx.begin(); PublicFields checkAlpha = (PublicFields)pm.getObjectById(idAlpha, true); PublicFields checkBeta = (PublicFields)pm.getObjectById(idBeta, true); assertEquals("alpha", AccessPublicFields.getStringField(checkAlpha)); assertEquals(1, AccessPublicFields.getIntField(checkAlpha)); assertTrue(checkBeta.equals(AccessPublicFields.getObjectField(checkAlpha))); assertEquals("beta", AccessPublicFields.getStringField(checkBeta)); assertEquals(2, AccessPublicFields.getIntField(checkBeta)); tx.commit(); } finally { if (tx.isActive()) { tx.rollback(); } pm.close(); } } finally { PersistenceManager pm = pmf.getPersistenceManager(); Transaction tx = pm.currentTransaction(); try { tx.begin(); PublicFields alpha = (PublicFields)pm.getObjectById(idAlpha); AccessPublicFields.setObjectField(alpha, null); tx.commit(); } finally { if (tx.isActive()) { tx.rollback(); } } clean(PublicFields.class); } }
|
/**
* Tests wether persistent public fields accessed from another
* class than the owning class are managed, that is if the
* accessing class is enhanced correctly.
*/
|
Tests wether persistent public fields accessed from another class than the owning class are managed, that is if the accessing class is enhanced correctly
|
testPersistenceAware
|
{
"repo_name": "hopecee/texsts",
"path": "jdo/general/src/test/org/datanucleus/tests/PersistenceAwareTest.java",
"license": "apache-2.0",
"size": 4384
}
|
[
"javax.jdo.JDOHelper",
"javax.jdo.PersistenceManager",
"javax.jdo.Transaction",
"org.datanucleus.samples.persistenceaware.AccessPublicFields",
"org.datanucleus.samples.persistenceaware.PublicFields"
] |
import javax.jdo.JDOHelper; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.datanucleus.samples.persistenceaware.AccessPublicFields; import org.datanucleus.samples.persistenceaware.PublicFields;
|
import javax.jdo.*; import org.datanucleus.samples.persistenceaware.*;
|
[
"javax.jdo",
"org.datanucleus.samples"
] |
javax.jdo; org.datanucleus.samples;
| 905,933
|
Observable<ServiceResponse<Void>> putValidWithServiceResponseAsync(ReadonlyObj complexBody);
|
Observable<ServiceResponse<Void>> putValidWithServiceResponseAsync(ReadonlyObj complexBody);
|
/**
* Put complex types that have readonly properties.
*
* @param complexBody the ReadonlyObj value
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
|
Put complex types that have readonly properties
|
putValidWithServiceResponseAsync
|
{
"repo_name": "sergey-shandar/autorest",
"path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/bodycomplex/Readonlypropertys.java",
"license": "mit",
"size": 3757
}
|
[
"com.microsoft.rest.ServiceResponse"
] |
import com.microsoft.rest.ServiceResponse;
|
import com.microsoft.rest.*;
|
[
"com.microsoft.rest"
] |
com.microsoft.rest;
| 1,273,089
|
public AuthenticationToken removeAuthenticationToken(String host, String realm) {
return this.authenticationTokens.remove(host.concat(realm));
}
|
AuthenticationToken function(String host, String realm) { return this.authenticationTokens.remove(host.concat(realm)); }
|
/**
* Removes the authentication token.
*
* @param host
* @param realm
*
* @return the authentication token or null if did not exist
*/
|
Removes the authentication token
|
removeAuthenticationToken
|
{
"repo_name": "JorgeGarciaIrazabal/ionicWAU",
"path": "platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewClient.java",
"license": "mit",
"size": 14396
}
|
[
"org.apache.cordova.AuthenticationToken"
] |
import org.apache.cordova.AuthenticationToken;
|
import org.apache.cordova.*;
|
[
"org.apache.cordova"
] |
org.apache.cordova;
| 2,450,375
|
@XmlElement(name = "max_total_threads")
public Integer getMaxTotalThreads() {
return maxTotalThreads;
}
|
@XmlElement(name = STR) Integer function() { return maxTotalThreads; }
|
/**
* Maximum Number of threads supported by this virtual pool.
*
*/
|
Maximum Number of threads supported by this virtual pool
|
getMaxTotalThreads
|
{
"repo_name": "emcvipr/controller-client-java",
"path": "models/src/main/java/com/emc/storageos/model/vpool/ComputeVirtualPoolRestRep.java",
"license": "apache-2.0",
"size": 9713
}
|
[
"javax.xml.bind.annotation.XmlElement"
] |
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.*;
|
[
"javax.xml"
] |
javax.xml;
| 2,451,233
|
public Set<InternalDistributedMember> adviseGeneric() {
return adviseFilter(null);
}
|
Set<InternalDistributedMember> function() { return adviseFilter(null); }
|
/**
* Provide recipient information for any other operation.
* Returns the set of members that have remote counterparts.
* @return Set of Serializable members;
* no reference to Set kept by advisor so caller is free to modify it
*/
|
Provide recipient information for any other operation. Returns the set of members that have remote counterparts
|
adviseGeneric
|
{
"repo_name": "ameybarve15/incubator-geode",
"path": "gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/DistributionAdvisor.java",
"license": "apache-2.0",
"size": 58826
}
|
[
"com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember",
"java.util.Set"
] |
import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember; import java.util.Set;
|
import com.gemstone.gemfire.distributed.internal.membership.*; import java.util.*;
|
[
"com.gemstone.gemfire",
"java.util"
] |
com.gemstone.gemfire; java.util;
| 2,676,864
|
public ServiceCall<DateTime> getNullUnixTimeAsync(final ServiceCallback<DateTime> serviceCallback) {
return ServiceCall.fromResponse(getNullUnixTimeWithServiceResponseAsync(), serviceCallback);
}
|
ServiceCall<DateTime> function(final ServiceCallback<DateTime> serviceCallback) { return ServiceCall.fromResponse(getNullUnixTimeWithServiceResponseAsync(), serviceCallback); }
|
/**
* Get null Unix time value.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
|
Get null Unix time value
|
getNullUnixTimeAsync
|
{
"repo_name": "matthchr/autorest",
"path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/bodyinteger/implementation/IntsImpl.java",
"license": "mit",
"size": 39126
}
|
[
"com.microsoft.rest.ServiceCall",
"com.microsoft.rest.ServiceCallback",
"org.joda.time.DateTime"
] |
import com.microsoft.rest.ServiceCall; import com.microsoft.rest.ServiceCallback; import org.joda.time.DateTime;
|
import com.microsoft.rest.*; import org.joda.time.*;
|
[
"com.microsoft.rest",
"org.joda.time"
] |
com.microsoft.rest; org.joda.time;
| 2,351,265
|
private ActionForward delete(ActionMapping mapping, HttpServletRequest request,
ActionChain actionChain) {
String label = actionChain.getLabel();
ActionChainFactory.delete(actionChain);
ActionMessages messages = new ActionMessages();
messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(
"actionchain.jsp.deleted", label));
getStrutsDelegate().saveMessages(request, messages);
return mapping.findForward(TO_LIST_FORWARD);
}
|
ActionForward function(ActionMapping mapping, HttpServletRequest request, ActionChain actionChain) { String label = actionChain.getLabel(); ActionChainFactory.delete(actionChain); ActionMessages messages = new ActionMessages(); messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage( STR, label)); getStrutsDelegate().saveMessages(request, messages); return mapping.findForward(TO_LIST_FORWARD); }
|
/**
* Deletes an Action Chain.
* @param mapping current mapping object
* @param request current request object
* @param actionChain current Action Chain
* @return a forward
*/
|
Deletes an Action Chain
|
delete
|
{
"repo_name": "xkollar/spacewalk",
"path": "java/code/src/com/redhat/rhn/frontend/action/schedule/ActionChainEditAction.java",
"license": "gpl-2.0",
"size": 5712
}
|
[
"com.redhat.rhn.domain.action.ActionChain",
"com.redhat.rhn.domain.action.ActionChainFactory",
"javax.servlet.http.HttpServletRequest",
"org.apache.struts.action.ActionForward",
"org.apache.struts.action.ActionMapping",
"org.apache.struts.action.ActionMessage",
"org.apache.struts.action.ActionMessages"
] |
import com.redhat.rhn.domain.action.ActionChain; import com.redhat.rhn.domain.action.ActionChainFactory; import javax.servlet.http.HttpServletRequest; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionMessage; import org.apache.struts.action.ActionMessages;
|
import com.redhat.rhn.domain.action.*; import javax.servlet.http.*; import org.apache.struts.action.*;
|
[
"com.redhat.rhn",
"javax.servlet",
"org.apache.struts"
] |
com.redhat.rhn; javax.servlet; org.apache.struts;
| 2,197,532
|
void validateResponse(Object payload, Map<String, Object> parameters);
class Support implements FhirTransactionValidator {
|
void validateResponse(Object payload, Map<String, Object> parameters); class Support implements FhirTransactionValidator {
|
/**
* Validates a FHIR response, throwing an appropriate subclass of
* {@link ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException} on
* validation failure
*
* @param payload response payload
* @param parameters response parameters
*/
|
Validates a FHIR response, throwing an appropriate subclass of <code>ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException</code> on validation failure
|
validateResponse
|
{
"repo_name": "oehf/ipf",
"path": "commons/ihe/fhir/core/src/main/java/org/openehealth/ipf/commons/ihe/fhir/FhirTransactionValidator.java",
"license": "apache-2.0",
"size": 2043
}
|
[
"java.util.Map"
] |
import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,010,508
|
EList getSupportedFormat();
|
EList getSupportedFormat();
|
/**
* Returns the value of the '<em><b>Supported Format</b></em>' attribute list.
* The list contents are of type {@link java.lang.String}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* Unordered list of identifiers of all the formats in which GetCoverage operation responses can be encoded for this coverage.
* <!-- end-model-doc -->
* @return the value of the '<em>Supported Format</em>' attribute list.
* @see net.opengis.wcs11.Wcs111Package#getCoverageDescriptionType_SupportedFormat()
* @model unique="false" dataType="net.opengis.ows11.MimeType" required="true"
* extendedMetaData="kind='element' name='SupportedFormat' namespace='##targetNamespace'"
* @generated
*/
|
Returns the value of the 'Supported Format' attribute list. The list contents are of type <code>java.lang.String</code>. Unordered list of identifiers of all the formats in which GetCoverage operation responses can be encoded for this coverage.
|
getSupportedFormat
|
{
"repo_name": "geotools/geotools",
"path": "modules/ogc/net.opengis.wcs/src/net/opengis/wcs11/CoverageDescriptionType.java",
"license": "lgpl-2.1",
"size": 7208
}
|
[
"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;
| 635,824
|
EAttribute getETypedElementConfiguration_Disabled();
|
EAttribute getETypedElementConfiguration_Disabled();
|
/**
* Returns the meta object for the attribute '{@link org.nasdanika.codegen.ecore.web.ui.model.ETypedElementConfiguration#getDisabled <em>Disabled</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Disabled</em>'.
* @see org.nasdanika.codegen.ecore.web.ui.model.ETypedElementConfiguration#getDisabled()
* @see #getETypedElementConfiguration()
* @generated
*/
|
Returns the meta object for the attribute '<code>org.nasdanika.codegen.ecore.web.ui.model.ETypedElementConfiguration#getDisabled Disabled</code>'.
|
getETypedElementConfiguration_Disabled
|
{
"repo_name": "Nasdanika/codegen-ecore-web-ui",
"path": "org.nasdanika.codegen.ecore.web.ui.model/src/org/nasdanika/codegen/ecore/web/ui/model/ModelPackage.java",
"license": "epl-1.0",
"size": 78619
}
|
[
"org.eclipse.emf.ecore.EAttribute"
] |
import org.eclipse.emf.ecore.EAttribute;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 1,169,539
|
public static int compareNatural(Collator collator, String s, String t) {
return compareNatural(s, t, true, collator);
}
|
static int function(Collator collator, String s, String t) { return compareNatural(s, t, true, collator); }
|
/**
* <p>
* Compares two strings using the given collator and comparing contained numbers based on their
* numeric values.
* </p>
*
* @param s first string
* @param t second string
* @return zero iff <code>s</code> and <code>t</code> are equal, a value less than zero iff
* <code>s</code> lexicographically precedes <code>t</code> and a value larger than zero
* iff <code>s</code> lexicographically follows <code>t</code>
*/
|
Compares two strings using the given collator and comparing contained numbers based on their numeric values.
|
compareNatural
|
{
"repo_name": "sintjuri/openmrs-core",
"path": "api/src/main/java/org/openmrs/util/NaturalStrings.java",
"license": "mpl-2.0",
"size": 13587
}
|
[
"java.text.Collator"
] |
import java.text.Collator;
|
import java.text.*;
|
[
"java.text"
] |
java.text;
| 923,318
|
public static ValueBuilder systemProperty(String name, String defaultValue) {
return Builder.systemProperty(name, defaultValue);
}
// Assertions
// -----------------------------------------------------------------------
|
static ValueBuilder function(String name, String defaultValue) { return Builder.systemProperty(name, defaultValue); }
|
/**
* Returns a value builder for the given system property
*/
|
Returns a value builder for the given system property
|
systemProperty
|
{
"repo_name": "curso007/camel",
"path": "components/camel-testng/src/main/java/org/apache/camel/testng/TestSupport.java",
"license": "apache-2.0",
"size": 18937
}
|
[
"org.apache.camel.builder.Builder",
"org.apache.camel.builder.ValueBuilder"
] |
import org.apache.camel.builder.Builder; import org.apache.camel.builder.ValueBuilder;
|
import org.apache.camel.builder.*;
|
[
"org.apache.camel"
] |
org.apache.camel;
| 840,211
|
public void writeIncremental(Instance inst) throws IOException{
int writeMode = getWriteMode();
Instances structure = getInstances();
PrintWriter outW = null;
if(structure != null){
if(structure.classIndex() == -1){
structure.setClassIndex(structure.numAttributes()-1);
System.err.println("No class specified. Last attribute is used as class attribute.");
}
if(structure.attribute(structure.classIndex()).isNumeric())
throw new IOException("To save in C4.5 format the class attribute cannot be numeric.");
}
if(getRetrieval() == BATCH || getRetrieval() == NONE)
throw new IOException("Batch and incremental saving cannot be mixed.");
if(retrieveFile() == null || getWriter() == null){
throw new IOException("C4.5 format requires two files. Therefore no output to standard out can be generated.\nPlease specifiy output files using the -o option.");
}
outW = new PrintWriter(getWriter());
if(writeMode == WAIT){
if(structure == null){
setWriteMode(CANCEL);
if(inst != null)
System.err.println("Structure(Header Information) has to be set in advance");
}
else
setWriteMode(STRUCTURE_READY);
writeMode = getWriteMode();
}
if(writeMode == CANCEL){
if(outW != null)
outW.close();
cancel();
}
if(writeMode == STRUCTURE_READY){
setWriteMode(WRITE);
//write header: here names file
for (int i = 0; i < structure.attribute(structure.classIndex()).numValues(); i++) {
outW.write(structure.attribute(structure.classIndex()).value(i));
if (i < structure.attribute(structure.classIndex()).numValues()-1) {
outW.write(",");
} else {
outW.write(".\n");
}
}
for (int i = 0; i < structure.numAttributes(); i++) {
if (i != structure.classIndex()) {
outW.write(structure.attribute(i).name()+": ");
if (structure.attribute(i).isNumeric() || structure.attribute(i).isDate()) {
outW.write("continuous.\n");
} else {
Attribute temp = structure.attribute(i);
for (int j = 0; j < temp.numValues(); j++) {
outW.write(temp.value(j));
if (j < temp.numValues()-1) {
outW.write(",");
} else {
outW.write(".\n");
}
}
}
}
}
outW.flush();
outW.close();
writeMode = getWriteMode();
String out = retrieveFile().getAbsolutePath();
setFileExtension(".data");
out = out.substring(0, out.lastIndexOf('.')) + getFileExtension();
File namesFile = new File(out);
try{
setFile(namesFile);
setDestination(namesFile);
} catch(Exception ex){
throw new IOException("Cannot create data file, only names file created.");
}
if(retrieveFile() == null || getWriter() == null){
throw new IOException("Cannot create data file, only names file created.");
}
outW = new PrintWriter(getWriter());
}
if(writeMode == WRITE){
if(structure == null)
throw new IOException("No instances information available.");
if(inst != null){
//write instance: here data file
for(int j = 0; j < inst.numAttributes(); j++){
if(j != structure.classIndex()){
if (inst.isMissing(j)) {
outW.write("?,");
} else
if (structure.attribute(j).isNominal() ||
structure.attribute(j).isString()) {
outW.write(structure.attribute(j).value((int)inst.value(j))+",");
} else {
outW.write(""+inst.value(j)+",");
}
}
}
// write the class value
if (inst.isMissing(structure.classIndex())) {
outW.write("?");
}
else {
outW.write(structure.attribute(structure.classIndex()).value((int)inst.value(structure.classIndex())));
}
outW.write("\n");
//flushes every 100 instances
m_incrementalCounter++;
if(m_incrementalCounter > 100){
m_incrementalCounter = 0;
outW.flush();
}
}
else{
//close
if(outW != null){
outW.flush();
outW.close();
}
setFileExtension(".names");
m_incrementalCounter = 0;
resetStructure();
}
}
}
|
void function(Instance inst) throws IOException{ int writeMode = getWriteMode(); Instances structure = getInstances(); PrintWriter outW = null; if(structure != null){ if(structure.classIndex() == -1){ structure.setClassIndex(structure.numAttributes()-1); System.err.println(STR); } if(structure.attribute(structure.classIndex()).isNumeric()) throw new IOException(STR); } if(getRetrieval() == BATCH getRetrieval() == NONE) throw new IOException(STR); if(retrieveFile() == null getWriter() == null){ throw new IOException(STR); } outW = new PrintWriter(getWriter()); if(writeMode == WAIT){ if(structure == null){ setWriteMode(CANCEL); if(inst != null) System.err.println(STR); } else setWriteMode(STRUCTURE_READY); writeMode = getWriteMode(); } if(writeMode == CANCEL){ if(outW != null) outW.close(); cancel(); } if(writeMode == STRUCTURE_READY){ setWriteMode(WRITE); for (int i = 0; i < structure.attribute(structure.classIndex()).numValues(); i++) { outW.write(structure.attribute(structure.classIndex()).value(i)); if (i < structure.attribute(structure.classIndex()).numValues()-1) { outW.write(","); } else { outW.write(".\n"); } } for (int i = 0; i < structure.numAttributes(); i++) { if (i != structure.classIndex()) { outW.write(structure.attribute(i).name()+STR); if (structure.attribute(i).isNumeric() structure.attribute(i).isDate()) { outW.write(STR); } else { Attribute temp = structure.attribute(i); for (int j = 0; j < temp.numValues(); j++) { outW.write(temp.value(j)); if (j < temp.numValues()-1) { outW.write(","); } else { outW.write(".\n"); } } } } } outW.flush(); outW.close(); writeMode = getWriteMode(); String out = retrieveFile().getAbsolutePath(); setFileExtension(".data"); out = out.substring(0, out.lastIndexOf('.')) + getFileExtension(); File namesFile = new File(out); try{ setFile(namesFile); setDestination(namesFile); } catch(Exception ex){ throw new IOException(STR); } if(retrieveFile() == null getWriter() == null){ throw new IOException(STR); } outW = new PrintWriter(getWriter()); } if(writeMode == WRITE){ if(structure == null) throw new IOException(STR); if(inst != null){ for(int j = 0; j < inst.numAttributes(); j++){ if(j != structure.classIndex()){ if (inst.isMissing(j)) { outW.write("?,"); } else if (structure.attribute(j).isNominal() structure.attribute(j).isString()) { outW.write(structure.attribute(j).value((int)inst.value(j))+","); } else { outW.write(STR,STR?STR\nSTR.names"); m_incrementalCounter = 0; resetStructure(); } } }
|
/** Saves an instances incrementally. Structure has to be set by using the
* setStructure() method or setInstances() method.
* @param inst the instance to save
* @throws IOException throws IOEXception if an instance cannot be saved incrementally.
*/
|
Saves an instances incrementally. Structure has to be set by using the setStructure() method or setInstances() method
|
writeIncremental
|
{
"repo_name": "paolopavan/cfr",
"path": "src/weka/core/converters/C45Saver.java",
"license": "gpl-3.0",
"size": 17127
}
|
[
"java.io.File",
"java.io.IOException",
"java.io.PrintWriter"
] |
import java.io.File; import java.io.IOException; import java.io.PrintWriter;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 458,863
|
//-----------------------------------------------------------------------
public static Date setYears(Date date, int amount) {
return set(date, Calendar.YEAR, amount);
}
|
static Date function(Date date, int amount) { return set(date, Calendar.YEAR, amount); }
|
/**
* Sets the years field to a date returning a new object.
* The original date object is unchanged.
*
* @param date the date, not null
* @param amount the amount to set
* @return a new Date object set with the specified value
* @throws IllegalArgumentException if the date is null
* @since 2.4
*/
|
Sets the years field to a date returning a new object. The original date object is unchanged
|
setYears
|
{
"repo_name": "SpoonLabs/astor",
"path": "examples/lang_39/src/java/org/apache/commons/lang3/time/DateUtils.java",
"license": "gpl-2.0",
"size": 73011
}
|
[
"java.util.Calendar",
"java.util.Date"
] |
import java.util.Calendar; import java.util.Date;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 151,553
|
public void setKey(Comparable key) {
ParamChecks.nullNotPermitted(key, "key");
Comparable old = this.key;
try {
// if this series belongs to a dataset, the dataset might veto the
// change if it results in two series within the dataset having the
// same key
this.vetoableChangeSupport.fireVetoableChange("Key", old, key);
this.key = key;
// prior to 1.0.14, we just fired a PropertyChange - so we need to
// keep doing this
this.propertyChangeSupport.firePropertyChange("Key", old, key);
} catch (PropertyVetoException e) {
throw new IllegalArgumentException(e.getMessage());
}
}
|
void function(Comparable key) { ParamChecks.nullNotPermitted(key, "key"); Comparable old = this.key; try { this.vetoableChangeSupport.fireVetoableChange("Key", old, key); this.key = key; this.propertyChangeSupport.firePropertyChange("Key", old, key); } catch (PropertyVetoException e) { throw new IllegalArgumentException(e.getMessage()); } }
|
/**
* Sets the key for the series and sends a <code>VetoableChangeEvent</code>
* (with the property name "Key") to all registered listeners. For
* backwards compatibility, this method also fires a regular
* <code>PropertyChangeEvent</code>. If the key change is vetoed this
* method will throw an IllegalArgumentException.
*
* @param key the key ({@code null} not permitted).
*
* @see #getKey()
*/
|
Sets the key for the series and sends a <code>VetoableChangeEvent</code> (with the property name "Key") to all registered listeners. For backwards compatibility, this method also fires a regular <code>PropertyChangeEvent</code>. If the key change is vetoed this method will throw an IllegalArgumentException
|
setKey
|
{
"repo_name": "simon04/jfreechart",
"path": "src/main/java/org/jfree/data/general/Series.java",
"license": "lgpl-2.1",
"size": 13494
}
|
[
"java.beans.PropertyVetoException",
"org.jfree.chart.util.ParamChecks"
] |
import java.beans.PropertyVetoException; import org.jfree.chart.util.ParamChecks;
|
import java.beans.*; import org.jfree.chart.util.*;
|
[
"java.beans",
"org.jfree.chart"
] |
java.beans; org.jfree.chart;
| 454,399
|
@Value.Default
default int getConnectionPoolSize() {
return 40;
}
|
@Value.Default default int getConnectionPoolSize() { return 40; }
|
/**
* Connection pool size.
*
* Supported: resteasy-apache, jersey
* Unsupported: resteasy
*/
|
Connection pool size. Supported: resteasy-apache, jersey Unsupported: resteasy
|
getConnectionPoolSize
|
{
"repo_name": "opentable/otj-jaxrs",
"path": "client/src/main/java/com/opentable/jaxrs/JaxRsClientConfig.java",
"license": "apache-2.0",
"size": 7783
}
|
[
"org.immutables.value.Value"
] |
import org.immutables.value.Value;
|
import org.immutables.value.*;
|
[
"org.immutables.value"
] |
org.immutables.value;
| 2,573,294
|
public static void mergeDefaults(Map<String, Object> content, Map<String, Object> defaults) {
for (Map.Entry<String, Object> defaultEntry : defaults.entrySet()) {
if (!content.containsKey(defaultEntry.getKey())) {
// copy it over, it does not exists in the content
content.put(defaultEntry.getKey(), defaultEntry.getValue());
} else {
// in the content and in the default, only merge compound ones (maps)
if (content.get(defaultEntry.getKey()) instanceof Map && defaultEntry.getValue() instanceof Map) {
mergeDefaults((Map<String, Object>) content.get(defaultEntry.getKey()), (Map<String, Object>) defaultEntry.getValue());
} else if (content.get(defaultEntry.getKey()) instanceof List && defaultEntry.getValue() instanceof List) {
List defaultList = (List) defaultEntry.getValue();
List contentList = (List) content.get(defaultEntry.getKey());
List mergedList = new ArrayList();
if (allListValuesAreMapsOfOne(defaultList) && allListValuesAreMapsOfOne(contentList)) {
// all are in the form of [ {"key1" : {}}, {"key2" : {}} ], merge based on keys
Map<String, Map<String, Object>> processed = new LinkedHashMap<>();
for (Object o : contentList) {
Map<String, Object> map = (Map<String, Object>) o;
Map.Entry<String, Object> entry = map.entrySet().iterator().next();
processed.put(entry.getKey(), map);
}
for (Object o : defaultList) {
Map<String, Object> map = (Map<String, Object>) o;
Map.Entry<String, Object> entry = map.entrySet().iterator().next();
if (processed.containsKey(entry.getKey())) {
mergeDefaults(processed.get(entry.getKey()), map);
} else {
// put the default entries after the content ones.
processed.put(entry.getKey(), map);
}
}
for (Map<String, Object> map : processed.values()) {
mergedList.add(map);
}
} else {
// if both are lists, simply combine them, first the defaults, then the content
// just make sure not to add the same value twice
mergedList.addAll(defaultList);
for (Object o : contentList) {
if (!mergedList.contains(o)) {
mergedList.add(o);
}
}
}
content.put(defaultEntry.getKey(), mergedList);
}
}
}
}
|
static void function(Map<String, Object> content, Map<String, Object> defaults) { for (Map.Entry<String, Object> defaultEntry : defaults.entrySet()) { if (!content.containsKey(defaultEntry.getKey())) { content.put(defaultEntry.getKey(), defaultEntry.getValue()); } else { if (content.get(defaultEntry.getKey()) instanceof Map && defaultEntry.getValue() instanceof Map) { mergeDefaults((Map<String, Object>) content.get(defaultEntry.getKey()), (Map<String, Object>) defaultEntry.getValue()); } else if (content.get(defaultEntry.getKey()) instanceof List && defaultEntry.getValue() instanceof List) { List defaultList = (List) defaultEntry.getValue(); List contentList = (List) content.get(defaultEntry.getKey()); List mergedList = new ArrayList(); if (allListValuesAreMapsOfOne(defaultList) && allListValuesAreMapsOfOne(contentList)) { Map<String, Map<String, Object>> processed = new LinkedHashMap<>(); for (Object o : contentList) { Map<String, Object> map = (Map<String, Object>) o; Map.Entry<String, Object> entry = map.entrySet().iterator().next(); processed.put(entry.getKey(), map); } for (Object o : defaultList) { Map<String, Object> map = (Map<String, Object>) o; Map.Entry<String, Object> entry = map.entrySet().iterator().next(); if (processed.containsKey(entry.getKey())) { mergeDefaults(processed.get(entry.getKey()), map); } else { processed.put(entry.getKey(), map); } } for (Map<String, Object> map : processed.values()) { mergedList.add(map); } } else { mergedList.addAll(defaultList); for (Object o : contentList) { if (!mergedList.contains(o)) { mergedList.add(o); } } } content.put(defaultEntry.getKey(), mergedList); } } } }
|
/**
* Merges the defaults provided as the second parameter into the content of the first. Only does recursive merge
* for inner maps.
*/
|
Merges the defaults provided as the second parameter into the content of the first. Only does recursive merge for inner maps
|
mergeDefaults
|
{
"repo_name": "gfyoung/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/common/xcontent/XContentHelper.java",
"license": "apache-2.0",
"size": 18398
}
|
[
"java.util.ArrayList",
"java.util.LinkedHashMap",
"java.util.List",
"java.util.Map"
] |
import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,270,916
|
public File GetThumbnailDir(Object file) {
File dir = new File(Phoenix.getInstance().getUserCacheDir(), "videothumb/" + phoenix.media.GetMediaFile(file).getId());
if (!dir.exists()) {
sagex.phoenix.util.FileUtils.mkdirsQuietly(dir);
}
return dir;
}
/**
* Generates a mediafile video thumbnail.
*
* @param inFile Sage MediaFile or {@link IMediaFile}
|
File function(Object file) { File dir = new File(Phoenix.getInstance().getUserCacheDir(), STR + phoenix.media.GetMediaFile(file).getId()); if (!dir.exists()) { sagex.phoenix.util.FileUtils.mkdirsQuietly(dir); } return dir; } /** * Generates a mediafile video thumbnail. * * @param inFile Sage MediaFile or {@link IMediaFile}
|
/**
* Returns the video thumbnail dir for a given media file
*
* @param file
* @return
*/
|
Returns the video thumbnail dir for a given media file
|
GetThumbnailDir
|
{
"repo_name": "stuckless/sagetv-phoenix-core",
"path": "src/main/java/phoenix/impl/VideoThumbAPI.java",
"license": "apache-2.0",
"size": 7997
}
|
[
"java.io.File",
"org.apache.commons.io.FileUtils"
] |
import java.io.File; import org.apache.commons.io.FileUtils;
|
import java.io.*; import org.apache.commons.io.*;
|
[
"java.io",
"org.apache.commons"
] |
java.io; org.apache.commons;
| 1,783,703
|
public void updateEventHandler(EventHandler eventHandler) {
Preconditions.checkNotNull(eventHandler, "Event handler definition cannot be null");
stub.updateEventHandler(
EventServicePb.UpdateEventHandlerRequest.newBuilder()
.setHandler(protoMapper.toProto(eventHandler))
.build());
}
|
void function(EventHandler eventHandler) { Preconditions.checkNotNull(eventHandler, STR); stub.updateEventHandler( EventServicePb.UpdateEventHandlerRequest.newBuilder() .setHandler(protoMapper.toProto(eventHandler)) .build()); }
|
/**
* Updates an existing event handler
*
* @param eventHandler the event handler to be updated
*/
|
Updates an existing event handler
|
updateEventHandler
|
{
"repo_name": "Netflix/conductor",
"path": "grpc-client/src/main/java/com/netflix/conductor/client/grpc/EventClient.java",
"license": "apache-2.0",
"size": 3488
}
|
[
"com.google.common.base.Preconditions",
"com.netflix.conductor.common.metadata.events.EventHandler",
"com.netflix.conductor.grpc.EventServicePb"
] |
import com.google.common.base.Preconditions; import com.netflix.conductor.common.metadata.events.EventHandler; import com.netflix.conductor.grpc.EventServicePb;
|
import com.google.common.base.*; import com.netflix.conductor.common.metadata.events.*; import com.netflix.conductor.grpc.*;
|
[
"com.google.common",
"com.netflix.conductor"
] |
com.google.common; com.netflix.conductor;
| 551,921
|
@Test(expected = IllegalArgumentException.class)
public void booleanLiteralTrue() {
SimpleNameImpl name = new SimpleNameImpl();
name.setToken("true");
}
|
@Test(expected = IllegalArgumentException.class) void function() { SimpleNameImpl name = new SimpleNameImpl(); name.setToken("true"); }
|
/**
* literal - true.
*/
|
literal - true
|
booleanLiteralTrue
|
{
"repo_name": "asakusafw/asakusafw",
"path": "utils-project/java-dom/src/test/java/com/asakusafw/utils/java/internal/model/syntax/SimpleNameImplTest.java",
"license": "apache-2.0",
"size": 2938
}
|
[
"org.junit.Test"
] |
import org.junit.Test;
|
import org.junit.*;
|
[
"org.junit"
] |
org.junit;
| 554,254
|
public boolean cancelPendingPayment(Integer paymentGroupId, Integer paymentDetailId, String note, Person user);
|
boolean function(Integer paymentGroupId, Integer paymentDetailId, String note, Person user);
|
/**
* This method cancels the pending payment of the given payment id if the following rules apply. -
* Payment status must be: "open", "held", or "pending/ACH".
* @param paymentGroupId Primary key of the PaymentGroup that the Payment Detail to be canceled belongs to.
* @param paymentDetailId Primary key of the PaymentDetail that was actually canceled.
* @param note Change note text entered by user.
* @param user The user that cancels the payment
* @return true if cancel payment succesful, false otherwise
*/
|
This method cancels the pending payment of the given payment id if the following rules apply. - Payment status must be: "open", "held", or "pending/ACH"
|
cancelPendingPayment
|
{
"repo_name": "Ariah-Group/Finance",
"path": "af_webapp/src/main/java/org/kuali/kfs/pdp/service/PaymentMaintenanceService.java",
"license": "apache-2.0",
"size": 4491
}
|
[
"org.kuali.rice.kim.api.identity.Person"
] |
import org.kuali.rice.kim.api.identity.Person;
|
import org.kuali.rice.kim.api.identity.*;
|
[
"org.kuali.rice"
] |
org.kuali.rice;
| 2,481,092
|
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object)
{
if (itemPropertyDescriptors == null)
{
super.getPropertyDescriptors(object);
addOnlyNewProjectsPropertyDescriptor(object);
addRefreshPropertyDescriptor(object);
addCleanPropertyDescriptor(object);
addBuildPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
|
List<IItemPropertyDescriptor> function(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); addOnlyNewProjectsPropertyDescriptor(object); addRefreshPropertyDescriptor(object); addCleanPropertyDescriptor(object); addBuildPropertyDescriptor(object); } return itemPropertyDescriptors; }
|
/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
|
This returns the property descriptors for the adapted class.
|
getPropertyDescriptors
|
{
"repo_name": "peterkir/org.eclipse.oomph",
"path": "plugins/org.eclipse.oomph.setup.projects.edit/src/org/eclipse/oomph/setup/projects/provider/ProjectsBuildTaskItemProvider.java",
"license": "epl-1.0",
"size": 10548
}
|
[
"java.util.List",
"org.eclipse.emf.edit.provider.IItemPropertyDescriptor"
] |
import java.util.List; import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
|
import java.util.*; import org.eclipse.emf.edit.provider.*;
|
[
"java.util",
"org.eclipse.emf"
] |
java.util; org.eclipse.emf;
| 89,714
|
public Builder applyToAllUnaryMethods(
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
super.applyToAllUnaryMethods(
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
return this;
}
|
Builder function( ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) { super.applyToAllUnaryMethods( getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; }
|
/**
* Applies the given settings updater function to all of the unary API methods in this service.
*
* <p>Note: This method does not support applying settings to streaming methods.
*/
|
Applies the given settings updater function to all of the unary API methods in this service. Note: This method does not support applying settings to streaming methods
|
applyToAllUnaryMethods
|
{
"repo_name": "googleads/google-ads-java",
"path": "google-ads-stubs-v9/src/main/java/com/google/ads/googleads/v9/services/BiddingDataExclusionServiceSettings.java",
"license": "apache-2.0",
"size": 8394
}
|
[
"com.google.api.core.ApiFunction",
"com.google.api.gax.rpc.UnaryCallSettings"
] |
import com.google.api.core.ApiFunction; import com.google.api.gax.rpc.UnaryCallSettings;
|
import com.google.api.core.*; import com.google.api.gax.rpc.*;
|
[
"com.google.api"
] |
com.google.api;
| 221,380
|
private void doTreeOpenToConcept(String actType, String searchType,
String sCCode, String sCCodeDB, String sCCodeName, String sNodeID)
throws Exception {
HttpSession session = m_classReq.getSession();
String strHTML = "";
String sOpenToTree = (String) m_classReq.getParameter("openToTree");
DataManager.setAttribute(session, "OpenTreeToConcept", "true");
String sOpenTreeToConcept = (String) session
.getAttribute("OpenTreeToConcept");
if (sOpenTreeToConcept == null)
sOpenTreeToConcept = "";
if (sCCode.equals("") && !sCCodeName.equals(""))
sCCode = this.do_getEVSCode(sCCodeName, sCCodeDB);
if (sOpenToTree == null)
sOpenToTree = "";
if (actType.equals("term") || actType.equals(""))
m_classReq.setAttribute("UISearchType", "term");
else if (actType.equals("tree")) {
this.doTreeSearchRequest("", sCCode, "false", sCCodeDB);
m_classReq.setAttribute("UISearchType", "tree");
EVSMasterTree tree = new EVSMasterTree(m_classReq, sCCodeDB,
m_servlet);
Vector vStackVector = new Vector();
Vector vStackVector2 = new Vector();
strHTML = tree.populateTreeRoots(sCCodeDB);
Stack stackSuperConcepts = new Stack();
HashMap<String, String> hSuperImmediate = this.getSuperConceptNamesImmediate(
sCCodeDB, sCCodeName, sCCode);
Vector vSuperImmediate = new Vector();
vSuperImmediate.addAll(hSuperImmediate.values());
DataManager.setAttribute(session, "vSuperImmediate",
vSuperImmediate);
vStackVector2 = tree.buildVectorOfSuperConceptStacks(
stackSuperConcepts, sCCodeDB, sCCode, vStackVector);
if (vStackVector.size() < 1) // must be a root concept
{
Tree RootTree = (Tree) tree.m_treesHash.get(sCCodeDB);
if (RootTree != null)
strHTML = tree.renderHTML(RootTree);
} else {
Stack vStack = new Stack();
for (int j = 0; j < vStackVector.size(); j++) {
vStack = (Stack) vStackVector.elementAt(j);
if (vStack.size() > 0)
strHTML = tree.expandTreeToConcept(vStack, sCCodeDB,
sCCode);
}
}
DataManager.setAttribute(session, "strHTML", strHTML);
DataManager.setAttribute(session, "vSuperImmediate", null);
} else if (actType.equals("parentTree")) {
DataManager.setAttribute(session, "ParentConceptCode", sCCode);
DataManager.setAttribute(session, "ParentConcept", sCCodeName);
this.doTreeSearchRequest(sCCodeName, sCCode, "false", sCCodeDB);
m_classReq.setAttribute("UISearchType", "tree");
EVSMasterTree tree = new EVSMasterTree(m_classReq, sCCodeDB,
m_servlet);
if (!sCCodeDB.equals("NCI Metathesaurus"))
strHTML = tree.populateTreeRoots(sCCodeDB);
strHTML = tree.showParentConceptTree(sCCode, sCCodeDB, sCCodeName);
DataManager.setAttribute(session, "strHTML", strHTML);
}
m_servlet.ForwardJSP(m_classReq, m_classRes,
"/OpenSearchWindowBlocks.jsp");
}
|
void function(String actType, String searchType, String sCCode, String sCCodeDB, String sCCodeName, String sNodeID) throws Exception { HttpSession session = m_classReq.getSession(); String strHTML = STRopenToTreeSTROpenTreeToConceptSTRtrueSTROpenTreeToConceptSTRSTRSTRSTRSTRtermSTRSTRUISearchTypeSTRtermSTRtreeSTRSTRfalseSTRUISearchTypeSTRtreeSTRvSuperImmediateSTRstrHTMLSTRvSuperImmediateSTRparentTreeSTRParentConceptCodeSTRParentConceptSTRfalseSTRUISearchTypeSTRtreeSTRNCI MetathesaurusSTRstrHTMLSTR/OpenSearchWindowBlocks.jsp"); }
|
/**
* Opens teh tree to the selected concept
* @param actType string action type
* @param searchType string search tye of filter a simple or advanced
* @param sCCode string concept identifier
* @param sCCodeDB string concept database
* @param sCCodeName string concept name
* @param sNodeID string current node id
*
* @throws Exception
*/
|
Opens teh tree to the selected concept
|
doTreeOpenToConcept
|
{
"repo_name": "NCIP/cadsr-cdecurate",
"path": "src/gov/nih/nci/cadsr/cdecurate/tool/EVSSearch.java",
"license": "bsd-3-clause",
"size": 284529
}
|
[
"javax.servlet.http.HttpSession"
] |
import javax.servlet.http.HttpSession;
|
import javax.servlet.http.*;
|
[
"javax.servlet"
] |
javax.servlet;
| 2,581,389
|
public void testSetExtendsName( ) throws ExtendsException
{
// not set, but it should be null.
assertNull( element.getExtendsElement( ) );
// tests ExtendsName with null value.
element.getHandle( design ).setExtendsName( null );
assertNull( element.getExtendsElement( ) );
// tests ExtendsName with empty value.
element.getHandle( design ).setExtendsName( " " ); //$NON-NLS-1$
assertNull( element.getExtendsElement( ) );
DesignElement parent = design.findElement( "base" ); //$NON-NLS-1$
element.getHandle( design ).setExtendsName( parent.getName( ) );
assertEquals( "base", //$NON-NLS-1$
element.getHandle( design ).getExtends( ).getName( ) );
CommandStack cs = designHandle.getCommandStack( );
// test undoable and redoable
assertFalse( cs.canRedo( ) );
assertTrue( cs.canUndo( ) );
// make calles from API level with undo/redo.
cs.undo( );
assertNull( element.getExtendsElement( ) );
assertFalse( cs.canUndo( ) );
assertTrue( cs.canRedo( ) );
cs.redo( );
assertFalse( cs.canRedo( ) );
assertEquals( "base", //$NON-NLS-1$
element.getHandle( design ).getExtends( ).getName( ) );
cs.undo( ); // undo again.
assertNull( element.getExtendsElement( ) );
}
|
void function( ) throws ExtendsException { assertNull( element.getExtendsElement( ) ); element.getHandle( design ).setExtendsName( null ); assertNull( element.getExtendsElement( ) ); element.getHandle( design ).setExtendsName( " " ); assertNull( element.getExtendsElement( ) ); DesignElement parent = design.findElement( "base" ); element.getHandle( design ).setExtendsName( parent.getName( ) ); assertEquals( "base", element.getHandle( design ).getExtends( ).getName( ) ); CommandStack cs = designHandle.getCommandStack( ); assertFalse( cs.canRedo( ) ); assertTrue( cs.canUndo( ) ); cs.undo( ); assertNull( element.getExtendsElement( ) ); assertFalse( cs.canUndo( ) ); assertTrue( cs.canRedo( ) ); cs.redo( ); assertFalse( cs.canRedo( ) ); assertEquals( "base", element.getHandle( design ).getExtends( ).getName( ) ); cs.undo( ); assertNull( element.getExtendsElement( ) ); }
|
/**
* Unit test for <code>ExtendsCommand#setExtendsName(String)</code>.
*
* Test case:
* <ul>
* <li>ExtendsName is <code>null</code> <li>ExtendsName is "" <li>Normal
* case with API call and undo/redo.
* </ul>
*
* @throws ExtendsException
*/
|
Unit test for <code>ExtendsCommand#setExtendsName(String)</code>. Test case: ExtendsName is <code>null</code> ExtendsName is "" Normal case with API call and undo/redo.
|
testSetExtendsName
|
{
"repo_name": "sguan-actuate/birt",
"path": "model/org.eclipse.birt.report.model.tests/test/org/eclipse/birt/report/model/command/ExtendsCommandTest.java",
"license": "epl-1.0",
"size": 20463
}
|
[
"org.eclipse.birt.report.model.api.CommandStack",
"org.eclipse.birt.report.model.api.command.ExtendsException",
"org.eclipse.birt.report.model.core.DesignElement"
] |
import org.eclipse.birt.report.model.api.CommandStack; import org.eclipse.birt.report.model.api.command.ExtendsException; import org.eclipse.birt.report.model.core.DesignElement;
|
import org.eclipse.birt.report.model.api.*; import org.eclipse.birt.report.model.api.command.*; import org.eclipse.birt.report.model.core.*;
|
[
"org.eclipse.birt"
] |
org.eclipse.birt;
| 103,538
|
public void centerViewOnTile(Vector2i tilePosition) {
Pane parent = (Pane) (getParent());
double Xdiff = (parent.getWidth() / 2) - (ViewPackage.SPRITES_SIZE.x / 2) - (tilePosition.x * ViewPackage.SPRITES_SIZE.x) - getTranslateX();
double Ydiff = (parent.getHeight() / 2) - (ViewPackage.SPRITES_SIZE.y / 2) - (tilePosition.y * ViewPackage.SPRITES_SIZE.y) - getTranslateY();
this.scale.set(1);
TranslateTransition translateTransition = new TranslateTransition();
translateTransition.setNode(this);
translateTransition.setDuration(new Duration(100));
translateTransition.setFromX(getTranslateX());
translateTransition.setFromY(getTranslateY());
translateTransition.setToX(getTranslateX() + Xdiff);
translateTransition.setToY(getTranslateY() + Ydiff);
translateTransition.setCycleCount(1);
translateTransition.setAutoReverse(false);
translateTransition.play();
//setTranslateX(getTranslateX() + Xdiff);
//setTranslateY(getTranslateY() + Ydiff);
}
|
void function(Vector2i tilePosition) { Pane parent = (Pane) (getParent()); double Xdiff = (parent.getWidth() / 2) - (ViewPackage.SPRITES_SIZE.x / 2) - (tilePosition.x * ViewPackage.SPRITES_SIZE.x) - getTranslateX(); double Ydiff = (parent.getHeight() / 2) - (ViewPackage.SPRITES_SIZE.y / 2) - (tilePosition.y * ViewPackage.SPRITES_SIZE.y) - getTranslateY(); this.scale.set(1); TranslateTransition translateTransition = new TranslateTransition(); translateTransition.setNode(this); translateTransition.setDuration(new Duration(100)); translateTransition.setFromX(getTranslateX()); translateTransition.setFromY(getTranslateY()); translateTransition.setToX(getTranslateX() + Xdiff); translateTransition.setToY(getTranslateY() + Ydiff); translateTransition.setCycleCount(1); translateTransition.setAutoReverse(false); translateTransition.play(); }
|
/**
* Center the view on a tile.
*
* @param tilePosition the tile position
*/
|
Center the view on a tile
|
centerViewOnTile
|
{
"repo_name": "TiWinDeTea/Raoul-the-Game",
"path": "src/main/java/com/github/tiwindetea/raoulthegame/view/TileMap.java",
"license": "mpl-2.0",
"size": 23912
}
|
[
"com.github.tiwindetea.raoulthegame.model.space.Vector2i"
] |
import com.github.tiwindetea.raoulthegame.model.space.Vector2i;
|
import com.github.tiwindetea.raoulthegame.model.space.*;
|
[
"com.github.tiwindetea"
] |
com.github.tiwindetea;
| 260,591
|
@Override
@PostConstruct
public void deployAll() {
if (!workflowDeploy) {
return;
}
ClassPathResource workflowsClassPathResource = new ClassPathResource(WorkFlowConstants.META_INF_DCMA_WORKFLOWS);
File workflowDirectory = null;
File newWorkflowFolder = null;
try {
// Deploy new plugins here
workflowDirectory = workflowsClassPathResource.getFile();
newWorkflowFolder = new File(newWorkflowsBasePath);
String subDirectoryName = WorkFlowConstants.PLUGINS_CONSTANT;
LOGGER.info("Deploying new plugins.");
deployFilesFromWorkflowSubdirectory(newWorkflowFolder, subDirectoryName);
// workflowDirectory.
for (String processDefinition : workflowsDefinitionList) {
NewDeployment deployment = repositoryService.createDeployment();
deployment.addResourceFromUrl(new ClassPathResource(processDefinition).getURL());
deployment.deploy();
}
// Deploy new Modules followed by new workflows here
subDirectoryName = WorkFlowConstants.MODULES_CONSTANT;
LOGGER.info("Deploying new batch class modules.");
deployFilesFromWorkflowSubdirectory(newWorkflowFolder, subDirectoryName);
subDirectoryName = WorkFlowConstants.WORKFLOWS_CONSTANT;
LOGGER.info("Deploying new batch classes.");
deployFilesFromWorkflowSubdirectory(newWorkflowFolder, subDirectoryName);
} catch (IOException e) {
LOGGER.error("IOException occurred: " + ExceptionUtils.getFullStackTrace(e), e);
throw new DCMABusinessException("An error occured while trying to deploy a process definition", e);
}
try {
File propertyFile = new File(workflowDirectory.getAbsolutePath() + File.separator
+ WorkFlowConstants.DCMA_WORKFLOWS_PROPERTIES);
Map<String, String> propertyMap = new HashMap<String, String>();
propertyMap.put(WorkFlowConstants.WORKFLOW_DEPLOY, Boolean.toString(false));
String comments = "Workflow deploy property changed.";
FileUtils.updateProperty(propertyFile, propertyMap, comments);
} catch (IOException e) {
LOGGER.error("IOException occurred: " + ExceptionUtils.getFullStackTrace(e), e);
// Continuing without throwing exception.
}
}
|
void function() { if (!workflowDeploy) { return; } ClassPathResource workflowsClassPathResource = new ClassPathResource(WorkFlowConstants.META_INF_DCMA_WORKFLOWS); File workflowDirectory = null; File newWorkflowFolder = null; try { workflowDirectory = workflowsClassPathResource.getFile(); newWorkflowFolder = new File(newWorkflowsBasePath); String subDirectoryName = WorkFlowConstants.PLUGINS_CONSTANT; LOGGER.info(STR); deployFilesFromWorkflowSubdirectory(newWorkflowFolder, subDirectoryName); for (String processDefinition : workflowsDefinitionList) { NewDeployment deployment = repositoryService.createDeployment(); deployment.addResourceFromUrl(new ClassPathResource(processDefinition).getURL()); deployment.deploy(); } subDirectoryName = WorkFlowConstants.MODULES_CONSTANT; LOGGER.info(STR); deployFilesFromWorkflowSubdirectory(newWorkflowFolder, subDirectoryName); subDirectoryName = WorkFlowConstants.WORKFLOWS_CONSTANT; LOGGER.info(STR); deployFilesFromWorkflowSubdirectory(newWorkflowFolder, subDirectoryName); } catch (IOException e) { LOGGER.error(STR + ExceptionUtils.getFullStackTrace(e), e); throw new DCMABusinessException(STR, e); } try { File propertyFile = new File(workflowDirectory.getAbsolutePath() + File.separator + WorkFlowConstants.DCMA_WORKFLOWS_PROPERTIES); Map<String, String> propertyMap = new HashMap<String, String>(); propertyMap.put(WorkFlowConstants.WORKFLOW_DEPLOY, Boolean.toString(false)); String comments = STR; FileUtils.updateProperty(propertyFile, propertyMap, comments); } catch (IOException e) { LOGGER.error(STR + ExceptionUtils.getFullStackTrace(e), e); } }
|
/**
* This method is used to deploy all batch classes.
*/
|
This method is used to deploy all batch classes
|
deployAll
|
{
"repo_name": "kuzavas/ephesoft",
"path": "dcma-workflows/src/main/java/com/ephesoft/dcma/workflow/service/common/DeploymentServiceImpl.java",
"license": "agpl-3.0",
"size": 23011
}
|
[
"com.ephesoft.dcma.core.common.DCMABusinessException",
"com.ephesoft.dcma.util.FileUtils",
"com.ephesoft.dcma.workflow.constant.WorkFlowConstants",
"java.io.File",
"java.io.IOException",
"java.util.HashMap",
"java.util.Map",
"org.apache.commons.lang.exception.ExceptionUtils",
"org.jbpm.api.NewDeployment",
"org.springframework.core.io.ClassPathResource"
] |
import com.ephesoft.dcma.core.common.DCMABusinessException; import com.ephesoft.dcma.util.FileUtils; import com.ephesoft.dcma.workflow.constant.WorkFlowConstants; import java.io.File; import java.io.IOException; import java.util.HashMap; import java.util.Map; import org.apache.commons.lang.exception.ExceptionUtils; import org.jbpm.api.NewDeployment; import org.springframework.core.io.ClassPathResource;
|
import com.ephesoft.dcma.core.common.*; import com.ephesoft.dcma.util.*; import com.ephesoft.dcma.workflow.constant.*; import java.io.*; import java.util.*; import org.apache.commons.lang.exception.*; import org.jbpm.api.*; import org.springframework.core.io.*;
|
[
"com.ephesoft.dcma",
"java.io",
"java.util",
"org.apache.commons",
"org.jbpm.api",
"org.springframework.core"
] |
com.ephesoft.dcma; java.io; java.util; org.apache.commons; org.jbpm.api; org.springframework.core;
| 2,795,312
|
public ArrayList<PeerNode> getAllConnectedByAddress(FreenetInetAddress a, boolean strict) {
ArrayList<PeerNode> found = null;
PeerNode[] peerList = myPeers();
// Try a match by IP address if we can't match exactly by IP:port.
for(PeerNode pn : peerList) {
if(!pn.isConnected()) continue;
if(!pn.isRoutable()) continue;
if(pn.matchesIP(a, strict)) {
if(found == null) found = new ArrayList<PeerNode>();
found.add(pn);
}
}
return found;
}
|
ArrayList<PeerNode> function(FreenetInetAddress a, boolean strict) { ArrayList<PeerNode> found = null; PeerNode[] peerList = myPeers(); for(PeerNode pn : peerList) { if(!pn.isConnected()) continue; if(!pn.isRoutable()) continue; if(pn.matchesIP(a, strict)) { if(found == null) found = new ArrayList<PeerNode>(); found.add(pn); } } return found; }
|
/**
* Find nodes with a given IP address.
*/
|
Find nodes with a given IP address
|
getAllConnectedByAddress
|
{
"repo_name": "freenet/fred",
"path": "src/freenet/node/PeerManager.java",
"license": "gpl-2.0",
"size": 81134
}
|
[
"java.util.ArrayList"
] |
import java.util.ArrayList;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,780,686
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
ArrowNockEvent event = new ArrowNockEvent(par3EntityPlayer, par1ItemStack);
MinecraftForge.EVENT_BUS.post(event);
if (event.isCanceled())
{
return event.result;
}
if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(Items.arrow))
{
par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack));
}
return par1ItemStack;
}
|
ItemStack function(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ArrowNockEvent event = new ArrowNockEvent(par3EntityPlayer, par1ItemStack); MinecraftForge.EVENT_BUS.post(event); if (event.isCanceled()) { return event.result; } if (par3EntityPlayer.capabilities.isCreativeMode par3EntityPlayer.inventory.hasItem(Items.arrow)) { par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); } return par1ItemStack; }
|
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
|
Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
|
onItemRightClick
|
{
"repo_name": "zoomboy666/Nicholas_Modding",
"path": "src/main/java/tutorial/DMAexample/MyItems/Springfield_Musket.java",
"license": "lgpl-2.1",
"size": 5998
}
|
[
"net.minecraft.entity.player.EntityPlayer",
"net.minecraft.init.Items",
"net.minecraft.item.ItemStack",
"net.minecraft.world.World",
"net.minecraftforge.common.MinecraftForge",
"net.minecraftforge.event.entity.player.ArrowNockEvent"
] |
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.ArrowNockEvent;
|
import net.minecraft.entity.player.*; import net.minecraft.init.*; import net.minecraft.item.*; import net.minecraft.world.*; import net.minecraftforge.common.*; import net.minecraftforge.event.entity.player.*;
|
[
"net.minecraft.entity",
"net.minecraft.init",
"net.minecraft.item",
"net.minecraft.world",
"net.minecraftforge.common",
"net.minecraftforge.event"
] |
net.minecraft.entity; net.minecraft.init; net.minecraft.item; net.minecraft.world; net.minecraftforge.common; net.minecraftforge.event;
| 390,665
|
private void parseContext(Map<String, String> context, String[] lines)
{
// if a context provider is given call it, else parse the current
// context in a subclass
if (contextProvider != null)
{
contextProvider.accept(context, lines);
}
}
}
static class Block
{
private Pattern startsWith;
private Pattern endsWith;
private int maxSize = -1;
private Transaction<?> transaction;
public Block(String startsWith)
{
this(startsWith, null);
}
public Block(String startsWith, String endsWith)
{
this.startsWith = Pattern.compile(startsWith);
if (endsWith != null)
this.endsWith = Pattern.compile(endsWith);
}
|
void function(Map<String, String> context, String[] lines) { if (contextProvider != null) { contextProvider.accept(context, lines); } } } static class Block { private Pattern startsWith; private Pattern endsWith; private int maxSize = -1; private Transaction<?> transaction; public Block(String startsWith) { this(startsWith, null); } public Block(String startsWith, String endsWith) { this.startsWith = Pattern.compile(startsWith); if (endsWith != null) this.endsWith = Pattern.compile(endsWith); }
|
/**
* Parses the current context.
*
* @param context
* context map
* @param lines
* content lines of the file
*/
|
Parses the current context
|
parseContext
|
{
"repo_name": "sebasbaumh/portfolio",
"path": "name.abuchen.portfolio/src/name/abuchen/portfolio/datatransfer/pdf/PDFParser.java",
"license": "epl-1.0",
"size": 15211
}
|
[
"java.util.Map",
"java.util.regex.Pattern"
] |
import java.util.Map; import java.util.regex.Pattern;
|
import java.util.*; import java.util.regex.*;
|
[
"java.util"
] |
java.util;
| 1,723,061
|
public void testFVHManyMatches() throws Exception {
assertAcked(prepareCreate("test").addMapping("type1", type1TermVectorMapping()));
ensureGreen();
// Index one megabyte of "t " over and over and over again
String pattern = "t ";
String value = new String(new char[1024 * 256 / pattern.length()]).replace("\0", pattern);
client().prepareIndex("test", "type1")
.setSource("field1", value).get();
refresh();
logger.info("--> highlighting and searching on field1 with default phrase limit");
SearchSourceBuilder source = searchSource()
.query(termQuery("field1", "t"))
.highlighter(highlight().highlighterType("fvh").field("field1", 20, 1).order("score").preTags("<xxx>").postTags("</xxx>"));
SearchResponse defaultPhraseLimit = client().search(searchRequest("test").source(source)).actionGet();
assertHighlight(defaultPhraseLimit, 0, "field1", 0, 1, containsString("<xxx>t</xxx>"));
logger.info("--> highlighting and searching on field1 with large phrase limit");
source = searchSource()
.query(termQuery("field1", "t"))
.highlighter(highlight().highlighterType("fvh").field("field1", 20, 1).order("score").preTags("<xxx>").postTags("</xxx>")
.phraseLimit(30000));
SearchResponse largePhraseLimit = client().search(searchRequest("test").source(source)).actionGet();
assertHighlight(largePhraseLimit, 0, "field1", 0, 1, containsString("<xxx>t</xxx>"));
assertThat(defaultPhraseLimit.getTookInMillis(), lessThan(largePhraseLimit.getTookInMillis()));
}
|
void function() throws Exception { assertAcked(prepareCreate("test").addMapping("type1", type1TermVectorMapping())); ensureGreen(); String pattern = STR; String value = new String(new char[1024 * 256 / pattern.length()]).replace("\0", pattern); client().prepareIndex("test", "type1") .setSource(STR, value).get(); refresh(); logger.info(STR); SearchSourceBuilder source = searchSource() .query(termQuery(STR, "t")) .highlighter(highlight().highlighterType("fvh").field(STR, 20, 1).order("score").preTags("<xxx>").postTags(STR)); SearchResponse defaultPhraseLimit = client().search(searchRequest("test").source(source)).actionGet(); assertHighlight(defaultPhraseLimit, 0, STR, 0, 1, containsString(STR)); logger.info(STR); source = searchSource() .query(termQuery(STR, "t")) .highlighter(highlight().highlighterType("fvh").field(STR, 20, 1).order("score").preTags("<xxx>").postTags(STR) .phraseLimit(30000)); SearchResponse largePhraseLimit = client().search(searchRequest("test").source(source)).actionGet(); assertHighlight(largePhraseLimit, 0, STR, 0, 1, containsString(STR)); assertThat(defaultPhraseLimit.getTookInMillis(), lessThan(largePhraseLimit.getTookInMillis())); }
|
/**
* The FHV can spend a long time highlighting degenerate documents if
* phraseLimit is not set. Its default is now reasonably low.
*/
|
The FHV can spend a long time highlighting degenerate documents if phraseLimit is not set. Its default is now reasonably low
|
testFVHManyMatches
|
{
"repo_name": "IanvsPoplicola/elasticsearch",
"path": "core/src/test/java/org/elasticsearch/search/fetch/subphase/highlight/HighlighterSearchIT.java",
"license": "apache-2.0",
"size": 174919
}
|
[
"org.elasticsearch.action.search.SearchResponse",
"org.elasticsearch.search.builder.SearchSourceBuilder",
"org.elasticsearch.test.hamcrest.ElasticsearchAssertions",
"org.hamcrest.Matchers"
] |
import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.test.hamcrest.ElasticsearchAssertions; import org.hamcrest.Matchers;
|
import org.elasticsearch.action.search.*; import org.elasticsearch.search.builder.*; import org.elasticsearch.test.hamcrest.*; import org.hamcrest.*;
|
[
"org.elasticsearch.action",
"org.elasticsearch.search",
"org.elasticsearch.test",
"org.hamcrest"
] |
org.elasticsearch.action; org.elasticsearch.search; org.elasticsearch.test; org.hamcrest;
| 1,020,013
|
private void findGroupBys() {
if (filters == null || filters.isEmpty()) {
return;
}
row_key_literals = new ByteMap<byte[][]>();
Collections.sort(filters);
final Iterator<TagVFilter> current_iterator = filters.iterator();
final Iterator<TagVFilter> look_ahead = filters.iterator();
byte[] tagk = null;
TagVFilter next = look_ahead.hasNext() ? look_ahead.next() : null;
int row_key_literals_count = 0;
while (current_iterator.hasNext()) {
next = look_ahead.hasNext() ? look_ahead.next() : null;
int gbs = 0;
// sorted!
final ByteMap<Void> literals = new ByteMap<Void>();
final List<TagVFilter> literal_filters = new ArrayList<TagVFilter>();
TagVFilter current = null;
do { // yeah, I'm breakin out the do!!!
current = current_iterator.next();
if (tagk == null) {
tagk = new byte[TSDB.tagk_width()];
System.arraycopy(current.getTagkBytes(), 0, tagk, 0, TSDB.tagk_width());
}
if (current.isGroupBy()) {
gbs++;
}
if (!current.getTagVUids().isEmpty()) {
for (final byte[] uid : current.getTagVUids()) {
literals.put(uid, null);
}
literal_filters.add(current);
}
if (next != null && Bytes.memcmp(tagk, next.getTagkBytes()) != 0) {
break;
}
next = look_ahead.hasNext() ? look_ahead.next() : null;
} while (current_iterator.hasNext() &&
Bytes.memcmp(tagk, current.getTagkBytes()) == 0);
if (gbs > 0) {
if (group_bys == null) {
group_bys = new ArrayList<byte[]>();
}
group_bys.add(current.getTagkBytes());
}
if (literals.size() > 0) {
if (literals.size() + row_key_literals_count >
tsdb.getConfig().getInt("tsd.query.filter.expansion_limit")) {
LOG.debug("Skipping literals for " + current.getTagk() +
" as it exceedes the limit");
} else {
final byte[][] values = new byte[literals.size()][];
literals.keySet().toArray(values);
row_key_literals.put(current.getTagkBytes(), values);
row_key_literals_count += values.length;
for (final TagVFilter filter : literal_filters) {
filter.setPostScan(false);
}
}
} else {
row_key_literals.put(current.getTagkBytes(), null);
}
}
}
|
void function() { if (filters == null filters.isEmpty()) { return; } row_key_literals = new ByteMap<byte[][]>(); Collections.sort(filters); final Iterator<TagVFilter> current_iterator = filters.iterator(); final Iterator<TagVFilter> look_ahead = filters.iterator(); byte[] tagk = null; TagVFilter next = look_ahead.hasNext() ? look_ahead.next() : null; int row_key_literals_count = 0; while (current_iterator.hasNext()) { next = look_ahead.hasNext() ? look_ahead.next() : null; int gbs = 0; final ByteMap<Void> literals = new ByteMap<Void>(); final List<TagVFilter> literal_filters = new ArrayList<TagVFilter>(); TagVFilter current = null; do { current = current_iterator.next(); if (tagk == null) { tagk = new byte[TSDB.tagk_width()]; System.arraycopy(current.getTagkBytes(), 0, tagk, 0, TSDB.tagk_width()); } if (current.isGroupBy()) { gbs++; } if (!current.getTagVUids().isEmpty()) { for (final byte[] uid : current.getTagVUids()) { literals.put(uid, null); } literal_filters.add(current); } if (next != null && Bytes.memcmp(tagk, next.getTagkBytes()) != 0) { break; } next = look_ahead.hasNext() ? look_ahead.next() : null; } while (current_iterator.hasNext() && Bytes.memcmp(tagk, current.getTagkBytes()) == 0); if (gbs > 0) { if (group_bys == null) { group_bys = new ArrayList<byte[]>(); } group_bys.add(current.getTagkBytes()); } if (literals.size() > 0) { if (literals.size() + row_key_literals_count > tsdb.getConfig().getInt(STR)) { LOG.debug(STR + current.getTagk() + STR); } else { final byte[][] values = new byte[literals.size()][]; literals.keySet().toArray(values); row_key_literals.put(current.getTagkBytes(), values); row_key_literals_count += values.length; for (final TagVFilter filter : literal_filters) { filter.setPostScan(false); } } } else { row_key_literals.put(current.getTagkBytes(), null); } } }
|
/**
* Populates the {@link #group_bys} and {@link #row_key_literals}'s with
* values pulled from the filters.
*/
|
Populates the <code>#group_bys</code> and <code>#row_key_literals</code>'s with values pulled from the filters
|
findGroupBys
|
{
"repo_name": "eswdd/opentsdb",
"path": "src/core/TsdbQuery.java",
"license": "lgpl-2.1",
"size": 48972
}
|
[
"java.util.ArrayList",
"java.util.Collections",
"java.util.Iterator",
"java.util.List",
"net.opentsdb.query.filter.TagVFilter",
"org.hbase.async.Bytes"
] |
import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; import net.opentsdb.query.filter.TagVFilter; import org.hbase.async.Bytes;
|
import java.util.*; import net.opentsdb.query.filter.*; import org.hbase.async.*;
|
[
"java.util",
"net.opentsdb.query",
"org.hbase.async"
] |
java.util; net.opentsdb.query; org.hbase.async;
| 1,979,639
|
public static Database inMemoryWith(String k1, Object v1) {
return inMemory(ImmutableMap.of(k1, v1));
}
|
static Database function(String k1, Object v1) { return inMemory(ImmutableMap.of(k1, v1)); }
|
/**
* Create an in-memory H2 database with name "default" and with extra configuration provided by
* the given entries.
*
* @param k1 an H2 configuration key.
* @param v1 configuration value corresponding to `k1`
* @return a configured in-memory H2 database
*/
|
Create an in-memory H2 database with name "default" and with extra configuration provided by the given entries
|
inMemoryWith
|
{
"repo_name": "benmccann/playframework",
"path": "persistence/play-java-jdbc/src/main/java/play/db/Databases.java",
"license": "apache-2.0",
"size": 6202
}
|
[
"com.google.common.collect.ImmutableMap"
] |
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.*;
|
[
"com.google.common"
] |
com.google.common;
| 2,522,390
|
public static SqlDialect create(DatabaseMetaData databaseMetaData) {
String identifierQuoteString;
try {
identifierQuoteString = databaseMetaData.getIdentifierQuoteString();
} catch (SQLException e) {
throw FakeUtil.newInternal(e, "while quoting identifier");
}
String databaseProductName;
try {
databaseProductName = databaseMetaData.getDatabaseProductName();
} catch (SQLException e) {
throw FakeUtil.newInternal(e, "while detecting database product");
}
final DatabaseProduct databaseProduct =
getProduct(databaseProductName, null);
return new SqlDialect(
databaseProduct, databaseProductName, identifierQuoteString);
}
public SqlDialect(
DatabaseProduct databaseProduct,
String databaseProductName,
String identifierQuoteString) {
assert databaseProduct != null;
assert databaseProductName != null;
this.databaseProduct = databaseProduct;
if (identifierQuoteString != null) {
identifierQuoteString = identifierQuoteString.trim();
if (identifierQuoteString.equals("")) {
identifierQuoteString = null;
}
}
this.identifierQuoteString = identifierQuoteString;
this.identifierEndQuoteString =
identifierQuoteString == null
? null
: identifierQuoteString.equals("[")
? "]"
: identifierQuoteString;
this.identifierEscapedQuote =
identifierQuoteString == null
? null
: this.identifierEndQuoteString + this.identifierEndQuoteString;
}
//~ Methods ----------------------------------------------------------------
|
static SqlDialect function(DatabaseMetaData databaseMetaData) { String identifierQuoteString; try { identifierQuoteString = databaseMetaData.getIdentifierQuoteString(); } catch (SQLException e) { throw FakeUtil.newInternal(e, STR); } String databaseProductName; try { databaseProductName = databaseMetaData.getDatabaseProductName(); } catch (SQLException e) { throw FakeUtil.newInternal(e, STR); } final DatabaseProduct databaseProduct = getProduct(databaseProductName, null); return new SqlDialect( databaseProduct, databaseProductName, identifierQuoteString); } public SqlDialect( DatabaseProduct databaseProduct, String databaseProductName, String identifierQuoteString) { assert databaseProduct != null; assert databaseProductName != null; this.databaseProduct = databaseProduct; if (identifierQuoteString != null) { identifierQuoteString = identifierQuoteString.trim(); if (identifierQuoteString.equals(STR[STR]" : identifierQuoteString; this.identifierEscapedQuote = identifierQuoteString == null ? null : this.identifierEndQuoteString + this.identifierEndQuoteString; }
|
/**
* Creates a <code>SqlDialect</code> from a DatabaseMetaData.
*
* <p>Does not maintain a reference to the DatabaseMetaData -- or, more
* importantly, to its {@link java.sql.Connection} -- after this call has
* returned.
*
* @param databaseMetaData used to determine which dialect of SQL to
* generate
*/
|
Creates a <code>SqlDialect</code> from a DatabaseMetaData. Does not maintain a reference to the DatabaseMetaData -- or, more importantly, to its <code>java.sql.Connection</code> -- after this call has returned
|
create
|
{
"repo_name": "mapr/incubator-calcite",
"path": "core/src/main/java/org/apache/calcite/sql/SqlDialect.java",
"license": "apache-2.0",
"size": 17428
}
|
[
"java.sql.DatabaseMetaData",
"java.sql.SQLException"
] |
import java.sql.DatabaseMetaData; import java.sql.SQLException;
|
import java.sql.*;
|
[
"java.sql"
] |
java.sql;
| 1,073,602
|
@Nullable
public String getPropertyNameById(@NotNull String propertyId) {
return names.get(propertyId);
}
|
String function(@NotNull String propertyId) { return names.get(propertyId); }
|
/**
* Returns property name using special id.
* Note: method can return {@code null} if name not found.
*
* @param propertyId
* id for which name will be returned
* @return name of the property
*/
|
Returns property name using special id. Note: method can return null if name not found
|
getPropertyNameById
|
{
"repo_name": "kaloyan-raev/che",
"path": "ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/editor/preferences/editorproperties/EditorPropertiesManager.java",
"license": "epl-1.0",
"size": 9312
}
|
[
"javax.validation.constraints.NotNull"
] |
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.*;
|
[
"javax.validation"
] |
javax.validation;
| 2,382,391
|
@NotNull
byte[] encode(@NotNull final T message);
|
byte[] encode(@NotNull final T message);
|
/**
* Serialize the given {@code message} into an array of bytes.
*
* @param message the message to serialize
* @return the serialized message
*/
|
Serialize the given message into an array of bytes
|
encode
|
{
"repo_name": "mesosphere/mesos-rxjava",
"path": "mesos-rxjava-util/src/main/java/com/mesosphere/mesos/rx/java/util/MessageCodec.java",
"license": "apache-2.0",
"size": 3004
}
|
[
"org.jetbrains.annotations.NotNull"
] |
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.*;
|
[
"org.jetbrains.annotations"
] |
org.jetbrains.annotations;
| 1,001,170
|
public void flush()
throws IOException {
String record;
synchronized (this) {
super.flush();
record = this.toString();
super.reset();
if (record.length() == 0 || record.equals(lineSeparator)) {
// avoid empty records
return;
}
logger.logp(level, "", "", record);
}
}
|
void function() throws IOException { String record; synchronized (this) { super.flush(); record = this.toString(); super.reset(); if (record.length() == 0 record.equals(lineSeparator)) { return; } logger.logp(level, STR", record); } }
|
/**
* upon flush() write the existing contents of the OutputStream to the logger as a log record.
*
* @throws java.io.IOException
* in case of error
*/
|
upon flush() write the existing contents of the OutputStream to the logger as a log record
|
flush
|
{
"repo_name": "psnc-dl/darceo",
"path": "rmi-fits/src/main/java/pl/psnc/synat/fits/logging/LoggingOutputStream.java",
"license": "gpl-3.0",
"size": 2052
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 37,559
|
@Deprecated
public void setDiskDirsAndSizes(File[] diskDirs, int[] diskSizes) {
if (this.regionAttributes.getDiskStoreName() != null) {
throw new IllegalStateException(
String.format("Deprecated API %s cannot be used with DiskStore %s",
new Object[] {"setDiskDirsAndSizes", this.regionAttributes.getDiskStoreName()}));
}
DiskStoreFactoryImpl.checkIfDirectoriesExist(diskDirs);
this.regionAttributes.diskDirs = diskDirs;
if (diskSizes.length != this.regionAttributes.diskDirs.length) {
throw new IllegalArgumentException(
String.format(
"Number of diskSizes is %s which is not equal to number of disk Dirs which is %s",
new Object[] {Integer.valueOf(diskSizes.length),
Integer.valueOf(diskDirs.length)}));
}
verifyNonNegativeDirSize(diskSizes);
this.regionAttributes.diskSizes = diskSizes;
if (!this.regionAttributes.hasDiskWriteAttributes()
&& !this.regionAttributes.hasDiskSynchronous()) {
// switch to the old default
this.regionAttributes.diskSynchronous = false;
this.regionAttributes.diskWriteAttributes = DiskWriteAttributesImpl.getDefaultAsyncInstance();
}
this.regionAttributes.setHasDiskDirs(true);
}
|
void function(File[] diskDirs, int[] diskSizes) { if (this.regionAttributes.getDiskStoreName() != null) { throw new IllegalStateException( String.format(STR, new Object[] {STR, this.regionAttributes.getDiskStoreName()})); } DiskStoreFactoryImpl.checkIfDirectoriesExist(diskDirs); this.regionAttributes.diskDirs = diskDirs; if (diskSizes.length != this.regionAttributes.diskDirs.length) { throw new IllegalArgumentException( String.format( STR, new Object[] {Integer.valueOf(diskSizes.length), Integer.valueOf(diskDirs.length)})); } verifyNonNegativeDirSize(diskSizes); this.regionAttributes.diskSizes = diskSizes; if (!this.regionAttributes.hasDiskWriteAttributes() && !this.regionAttributes.hasDiskSynchronous()) { this.regionAttributes.diskSynchronous = false; this.regionAttributes.diskWriteAttributes = DiskWriteAttributesImpl.getDefaultAsyncInstance(); } this.regionAttributes.setHasDiskDirs(true); }
|
/**
* Sets the directories to which the region's data is written and also set their sizes in
* megabytes
*
* @throws IllegalArgumentException if a dir does not exist or the length of the size array does
* not match to the length of the dir array or the given length is not a valid positive
* number
*
* @since GemFire 5.1
* @deprecated as of 6.5 use {@link DiskStoreFactory#setDiskDirsAndSizes} instead
*/
|
Sets the directories to which the region's data is written and also set their sizes in megabytes
|
setDiskDirsAndSizes
|
{
"repo_name": "davinash/geode",
"path": "geode-core/src/main/java/org/apache/geode/cache/AttributesFactory.java",
"license": "apache-2.0",
"size": 82871
}
|
[
"java.io.File",
"org.apache.geode.internal.cache.DiskStoreAttributes",
"org.apache.geode.internal.cache.DiskStoreFactoryImpl",
"org.apache.geode.internal.cache.DiskWriteAttributesImpl"
] |
import java.io.File; import org.apache.geode.internal.cache.DiskStoreAttributes; import org.apache.geode.internal.cache.DiskStoreFactoryImpl; import org.apache.geode.internal.cache.DiskWriteAttributesImpl;
|
import java.io.*; import org.apache.geode.internal.cache.*;
|
[
"java.io",
"org.apache.geode"
] |
java.io; org.apache.geode;
| 2,583,108
|
private void setupTreeForNode(SPObject node) {
if (node instanceof SQLTable) {
createFolders((SQLTable) node);
}
if (node instanceof SQLObject) {
for (SQLObject child : ((SQLObject) node).getChildrenWithoutPopulating()) {
setupTreeForNode(child);
}
} else {
for (SPObject child : node.getChildren()) {
setupTreeForNode(child);
}
}
}
|
void function(SPObject node) { if (node instanceof SQLTable) { createFolders((SQLTable) node); } if (node instanceof SQLObject) { for (SQLObject child : ((SQLObject) node).getChildrenWithoutPopulating()) { setupTreeForNode(child); } } else { for (SPObject child : node.getChildren()) { setupTreeForNode(child); } } }
|
/**
* Recursively walks the tree doing any necessary setup for each node.
* At current this just adds folders for {@link SQLTable} objects.
*/
|
Recursively walks the tree doing any necessary setup for each node. At current this just adds folders for <code>SQLTable</code> objects
|
setupTreeForNode
|
{
"repo_name": "amitkr/power-architect",
"path": "src/main/java/ca/sqlpower/architect/swingui/dbtree/DBTreeModel.java",
"license": "gpl-3.0",
"size": 35717
}
|
[
"ca.sqlpower.object.SPObject",
"ca.sqlpower.sqlobject.SQLObject",
"ca.sqlpower.sqlobject.SQLTable"
] |
import ca.sqlpower.object.SPObject; import ca.sqlpower.sqlobject.SQLObject; import ca.sqlpower.sqlobject.SQLTable;
|
import ca.sqlpower.object.*; import ca.sqlpower.sqlobject.*;
|
[
"ca.sqlpower.object",
"ca.sqlpower.sqlobject"
] |
ca.sqlpower.object; ca.sqlpower.sqlobject;
| 1,327,298
|
private KeyStore getPrivPubKeyStore() throws Exception {
KeyStore ks = null;
if (certificate != null) {
ks = KeyStore.getInstance("PKCS12");
ks.load(null);
final Certificate[] chain = new Certificate[1];
chain[0] = certificate;
final String alias = "priv-key";
if (encryptedPK != null) {
// The key is of format EncryptedPrivateKeyInfo
ks.setKeyEntry(alias, encryptedPK.getEncoded(), chain);
} else {
if (nonEncryptedPK != null) {
final KeyFactory keyFactory = KeyFactory.getInstance(certificate.getPublicKey().getAlgorithm());
final Key pk = keyFactory.generatePrivate(nonEncryptedPK);
ks.setKeyEntry(alias, pk, null, chain);
} else {
// no secure configuration, should not be called.
throw new IllegalArgumentException("No data to create certificate");
}
}
}
return ks;
}
|
KeyStore function() throws Exception { KeyStore ks = null; if (certificate != null) { ks = KeyStore.getInstance(STR); ks.load(null); final Certificate[] chain = new Certificate[1]; chain[0] = certificate; final String alias = STR; if (encryptedPK != null) { ks.setKeyEntry(alias, encryptedPK.getEncoded(), chain); } else { if (nonEncryptedPK != null) { final KeyFactory keyFactory = KeyFactory.getInstance(certificate.getPublicKey().getAlgorithm()); final Key pk = keyFactory.generatePrivate(nonEncryptedPK); ks.setKeyEntry(alias, pk, null, chain); } else { throw new IllegalArgumentException(STR); } } } return ks; }
|
/**
* Build with the key and certificate. These are local credentials, not used
* for trust.
*/
|
Build with the key and certificate. These are local credentials, not used for trust
|
getPrivPubKeyStore
|
{
"repo_name": "stefanjauker/avatar-js",
"path": "src/main/java/com/oracle/avatar/js/crypto/SecureContext.java",
"license": "gpl-2.0",
"size": 25915
}
|
[
"java.security.Key",
"java.security.KeyFactory",
"java.security.KeyStore",
"java.security.cert.Certificate"
] |
import java.security.Key; import java.security.KeyFactory; import java.security.KeyStore; import java.security.cert.Certificate;
|
import java.security.*; import java.security.cert.*;
|
[
"java.security"
] |
java.security;
| 2,482,705
|
@Nonnull
public List<FilePath> list() throws IOException, InterruptedException {
return list((FileFilter)null);
}
|
List<FilePath> function() throws IOException, InterruptedException { return list((FileFilter)null); }
|
/**
* List up files and directories in this directory.
*
* <p>
* This method returns direct children of the directory denoted by the 'this' object.
*/
|
List up files and directories in this directory. This method returns direct children of the directory denoted by the 'this' object
|
list
|
{
"repo_name": "recena/jenkins",
"path": "core/src/main/java/hudson/FilePath.java",
"license": "mit",
"size": 134702
}
|
[
"java.io.FileFilter",
"java.io.IOException",
"java.util.List"
] |
import java.io.FileFilter; import java.io.IOException; import java.util.List;
|
import java.io.*; import java.util.*;
|
[
"java.io",
"java.util"
] |
java.io; java.util;
| 556,341
|
protected void addTransportJMSContentTypePropertyPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_InboundEndpoint_transportJMSContentTypeProperty_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_InboundEndpoint_transportJMSContentTypeProperty_feature", "_UI_InboundEndpoint_type"),
EsbPackage.Literals.INBOUND_ENDPOINT__TRANSPORT_JMS_CONTENT_TYPE_PROPERTY,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
"Parameters",
null));
}
|
void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), EsbPackage.Literals.INBOUND_ENDPOINT__TRANSPORT_JMS_CONTENT_TYPE_PROPERTY, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, STR, null)); }
|
/**
* This adds a property descriptor for the Transport JMS Content Type Property feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
|
This adds a property descriptor for the Transport JMS Content Type Property feature.
|
addTransportJMSContentTypePropertyPropertyDescriptor
|
{
"repo_name": "nwnpallewela/developer-studio",
"path": "esb/plugins/org.wso2.developerstudio.eclipse.gmf.esb.edit/src/org/wso2/developerstudio/eclipse/gmf/esb/provider/InboundEndpointItemProvider.java",
"license": "apache-2.0",
"size": 156993
}
|
[
"org.eclipse.emf.edit.provider.ComposeableAdapterFactory",
"org.eclipse.emf.edit.provider.ItemPropertyDescriptor",
"org.wso2.developerstudio.eclipse.gmf.esb.EsbPackage"
] |
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.wso2.developerstudio.eclipse.gmf.esb.EsbPackage;
|
import org.eclipse.emf.edit.provider.*; import org.wso2.developerstudio.eclipse.gmf.esb.*;
|
[
"org.eclipse.emf",
"org.wso2.developerstudio"
] |
org.eclipse.emf; org.wso2.developerstudio;
| 7,293
|
public String getMainfont(int what) {
Element el = settingsFile.getRootElement().getChild(SETTING_MAINFONT);
String retval = "";
if (el != null) {
switch (what) {
case FONTNAME:
retval = el.getText();
break;
case FONTSIZE:
retval = el.getAttributeValue("size");
break;
case FONTCOLOR:
retval = el.getAttributeValue("color");
break;
case FONTSTYLE:
retval = el.getAttributeValue("style");
break;
case FONTWEIGHT:
retval = el.getAttributeValue("weight");
break;
}
}
return retval;
}
|
String function(int what) { Element el = settingsFile.getRootElement().getChild(SETTING_MAINFONT); String retval = STRsizeSTRcolorSTRstyleSTRweight"); break; } } return retval; }
|
/**
* Retrieves settings for the mainfont (the font used for the main-entry-textfield).
*
* @param what (indicates, which font-characteristic we want to have. use following
* constants:<br>
* - FONTNAME<br>
* - FONTSIZE<br>
* - FONTCOLOR<br>
* - FONTSTYLE<br>
* - FONTWEIGHT<br>
* @return the related font-information as string.
*/
|
Retrieves settings for the mainfont (the font used for the main-entry-textfield)
|
getMainfont
|
{
"repo_name": "sjPlot/Zettelkasten",
"path": "src/main/java/de/danielluedecke/zettelkasten/database/Settings.java",
"license": "gpl-3.0",
"size": 218287
}
|
[
"org.jdom2.Element"
] |
import org.jdom2.Element;
|
import org.jdom2.*;
|
[
"org.jdom2"
] |
org.jdom2;
| 1,759,802
|
public Configuration getConfiguration(final String containerId) {
return EvaluatorShimConfiguration
.getConfigurationModule(this.containerRegistryProvider.isValid())
.set(EvaluatorShimConfiguration.DRIVER_REMOTE_IDENTIFIER, this.remoteManager.getMyIdentifier())
.set(EvaluatorShimConfiguration.CONTAINER_IDENTIFIER, containerId)
.setMultiple(EvaluatorShimConfiguration.TCP_PORT_SET, this.tcpPortSet)
.build();
}
|
Configuration function(final String containerId) { return EvaluatorShimConfiguration .getConfigurationModule(this.containerRegistryProvider.isValid()) .set(EvaluatorShimConfiguration.DRIVER_REMOTE_IDENTIFIER, this.remoteManager.getMyIdentifier()) .set(EvaluatorShimConfiguration.CONTAINER_IDENTIFIER, containerId) .setMultiple(EvaluatorShimConfiguration.TCP_PORT_SET, this.tcpPortSet) .build(); }
|
/**
* Constructs a {@link Configuration} object which will be serialized and written to shim.config and
* used to launch the evaluator shim.
*
* @param containerId id of the container for which the shim is being launched.
* @return A {@link Configuration} object needed to launch the evaluator shim.
*/
|
Constructs a <code>Configuration</code> object which will be serialized and written to shim.config and used to launch the evaluator shim
|
getConfiguration
|
{
"repo_name": "apache/reef",
"path": "lang/java/reef-runtime-azbatch/src/main/java/org/apache/reef/runtime/azbatch/driver/AzureBatchEvaluatorShimConfigurationProvider.java",
"license": "apache-2.0",
"size": 2976
}
|
[
"org.apache.reef.runtime.azbatch.evaluator.EvaluatorShimConfiguration",
"org.apache.reef.tang.Configuration"
] |
import org.apache.reef.runtime.azbatch.evaluator.EvaluatorShimConfiguration; import org.apache.reef.tang.Configuration;
|
import org.apache.reef.runtime.azbatch.evaluator.*; import org.apache.reef.tang.*;
|
[
"org.apache.reef"
] |
org.apache.reef;
| 175,057
|
protected void carriageReturn()
{
// the arraylist with lines may not be null
if(lines == null)
{
lines = new ArrayList();
}
// If the current line is not null
if(line != null)
{
// we check if the end of the page is reached (bugfix by Francois Gravel)
if(currentHeight + line.height() + leading < indentTop() - indentBottom())
{
// if so nonempty lines are added and the height is augmented
if(line.size() > 0)
{
currentHeight += line.height();
lines.add(line);
pageEmpty = false;
}
}
// if the end of the line is reached, we start a new page
else
{
newPage();
}
}
if(imageEnd > -1 && currentHeight > imageEnd)
{
imageEnd = -1;
indentation.imageIndentRight = 0;
indentation.imageIndentLeft = 0;
}
// a new current line is constructed
line = new PdfLine(indentLeft(), indentRight(), alignment, leading);
}
|
void function() { if(lines == null) { lines = new ArrayList(); } if(line != null) { if(currentHeight + line.height() + leading < indentTop() - indentBottom()) { if(line.size() > 0) { currentHeight += line.height(); lines.add(line); pageEmpty = false; } } else { newPage(); } } if(imageEnd > -1 && currentHeight > imageEnd) { imageEnd = -1; indentation.imageIndentRight = 0; indentation.imageIndentLeft = 0; } line = new PdfLine(indentLeft(), indentRight(), alignment, leading); }
|
/**
* If the current line is not empty or null, it is added to the arraylist
* of lines and a new empty line is added.
*/
|
If the current line is not empty or null, it is added to the arraylist of lines and a new empty line is added
|
carriageReturn
|
{
"repo_name": "SafetyCulture/DroidText",
"path": "app/src/main/java/com/lowagie/text/pdf/PdfDocument.java",
"license": "lgpl-3.0",
"size": 98178
}
|
[
"java.util.ArrayList"
] |
import java.util.ArrayList;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 434,945
|
protected Node getNextMatchElementInTree(Node startpoint, Node root) {
Node matchedNode = null;
matchedNode = traverseTree(startpoint);
Node currentpoint = startpoint;
while ((matchedNode == null) && (currentpoint != root)) {
Node sibling = currentpoint.getNextSibling();
if ((sibling != null)
&& (sibling.getNodeType() == Node.TEXT_NODE || sibling.getNodeType() == Node.ELEMENT_NODE)
&& (match(sibling))) {
matchedNode = sibling;
break;
}
while ((sibling != null) && (matchedNode == null)) {
if ((sibling.getNodeType() == Node.TEXT_NODE || sibling.getNodeType() == Node.ELEMENT_NODE)) {
matchedNode = traverseTree(sibling);
}
if (matchedNode == null) {
sibling = sibling.getNextSibling();
if (sibling != null && match(sibling)) {
matchedNode = sibling;
break;
}
}
}
currentpoint = currentpoint.getParentNode();
}
return matchedNode;
}
|
Node function(Node startpoint, Node root) { Node matchedNode = null; matchedNode = traverseTree(startpoint); Node currentpoint = startpoint; while ((matchedNode == null) && (currentpoint != root)) { Node sibling = currentpoint.getNextSibling(); if ((sibling != null) && (sibling.getNodeType() == Node.TEXT_NODE sibling.getNodeType() == Node.ELEMENT_NODE) && (match(sibling))) { matchedNode = sibling; break; } while ((sibling != null) && (matchedNode == null)) { if ((sibling.getNodeType() == Node.TEXT_NODE sibling.getNodeType() == Node.ELEMENT_NODE)) { matchedNode = traverseTree(sibling); } if (matchedNode == null) { sibling = sibling.getNextSibling(); if (sibling != null && match(sibling)) { matchedNode = sibling; break; } } } currentpoint = currentpoint.getParentNode(); } return matchedNode; }
|
/**
* Get the next matched element node in a sub tree
*
* @param startpoint
* navigate from the start point
* @param root
* the root of the sub tree
* @return the next matched element
*/
|
Get the next matched element node in a sub tree
|
getNextMatchElementInTree
|
{
"repo_name": "jbjonesjr/geoproponis",
"path": "external/simple-odf-0.8.1-incubating-sources/org/odftoolkit/simple/common/navigation/Navigation.java",
"license": "gpl-2.0",
"size": 4141
}
|
[
"org.w3c.dom.Node"
] |
import org.w3c.dom.Node;
|
import org.w3c.dom.*;
|
[
"org.w3c.dom"
] |
org.w3c.dom;
| 593,222
|
ManagedEntityConfigXmlParser handler = new ManagedEntityConfigXmlParser();
handler.config = config;
try {
SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setValidating(true);
SAXParser parser = factory.newSAXParser();
parser.parse(is, new DefaultHandlerDelegate(handler));
} catch (Exception ex) {
if (ex instanceof AdminXmlException) {
throw (AdminXmlException) ex;
} else if (ex.getCause() instanceof AdminXmlException) {
throw (AdminXmlException) ex.getCause();
} else if (ex instanceof SAXException) {
// Silly JDK 1.4.2 XML parser wraps RunTime exceptions in a
// SAXException. Pshaw!
SAXException sax = (SAXException) ex;
Exception cause = sax.getException();
if (cause instanceof AdminXmlException) {
throw (AdminXmlException) cause;
}
}
throw new AdminXmlException(
"While parsing XML", ex);
}
}
|
ManagedEntityConfigXmlParser handler = new ManagedEntityConfigXmlParser(); handler.config = config; try { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setValidating(true); SAXParser parser = factory.newSAXParser(); parser.parse(is, new DefaultHandlerDelegate(handler)); } catch (Exception ex) { if (ex instanceof AdminXmlException) { throw (AdminXmlException) ex; } else if (ex.getCause() instanceof AdminXmlException) { throw (AdminXmlException) ex.getCause(); } else if (ex instanceof SAXException) { SAXException sax = (SAXException) ex; Exception cause = sax.getException(); if (cause instanceof AdminXmlException) { throw (AdminXmlException) cause; } } throw new AdminXmlException( STR, ex); } }
|
/**
* Parses XML data and from it configures a <code>DistributedSystemConfig</code>.
*
* @throws AdminXmlException If an error is encountered while parsing the XML
*/
|
Parses XML data and from it configures a <code>DistributedSystemConfig</code>
|
parse
|
{
"repo_name": "jdeppe-pivotal/geode",
"path": "geode-core/src/main/java/org/apache/geode/admin/internal/ManagedEntityConfigXmlParser.java",
"license": "apache-2.0",
"size": 16406
}
|
[
"javax.xml.parsers.SAXParser",
"javax.xml.parsers.SAXParserFactory",
"org.apache.geode.admin.AdminXmlException",
"org.xml.sax.SAXException"
] |
import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import org.apache.geode.admin.AdminXmlException; import org.xml.sax.SAXException;
|
import javax.xml.parsers.*; import org.apache.geode.admin.*; import org.xml.sax.*;
|
[
"javax.xml",
"org.apache.geode",
"org.xml.sax"
] |
javax.xml; org.apache.geode; org.xml.sax;
| 327,847
|
Charset sourceCharset();
|
Charset sourceCharset();
|
/**
* Default charset for files of the module. If it's not defined, then
* return the platform default charset. When trying to read an input file it is better to rely on
* {@link InputFile#encoding()} as encoding may be different for each file.
*/
|
Default charset for files of the module. If it's not defined, then return the platform default charset. When trying to read an input file it is better to rely on <code>InputFile#encoding()</code> as encoding may be different for each file
|
sourceCharset
|
{
"repo_name": "joansmith/sonarqube",
"path": "sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/ModuleFileSystem.java",
"license": "lgpl-3.0",
"size": 3150
}
|
[
"java.nio.charset.Charset"
] |
import java.nio.charset.Charset;
|
import java.nio.charset.*;
|
[
"java.nio"
] |
java.nio;
| 2,604,868
|
public CMapId cmapId() {
return this.cmapId;
}
|
CMapId function() { return this.cmapId; }
|
/**
* Gets the cmap id for this cmap.
*
* @return cmap id
*/
|
Gets the cmap id for this cmap
|
cmapId
|
{
"repo_name": "witwall/sfntly-java",
"path": "src/main/java/com/google/typography/font/sfntly/table/core/CMap.java",
"license": "apache-2.0",
"size": 10299
}
|
[
"com.google.typography.font.sfntly.table.core.CMapTable"
] |
import com.google.typography.font.sfntly.table.core.CMapTable;
|
import com.google.typography.font.sfntly.table.core.*;
|
[
"com.google.typography"
] |
com.google.typography;
| 176,071
|
void handleEntityHeadLook(SPacketEntityHeadLook packetIn);
|
void handleEntityHeadLook(SPacketEntityHeadLook packetIn);
|
/**
* Updates the direction in which the specified entity is looking, normally this head rotation is independent of the
* rotation of the entity itself
*/
|
Updates the direction in which the specified entity is looking, normally this head rotation is independent of the rotation of the entity itself
|
handleEntityHeadLook
|
{
"repo_name": "SuperUnitato/UnLonely",
"path": "build/tmp/recompileMc/sources/net/minecraft/network/play/INetHandlerPlayClient.java",
"license": "lgpl-2.1",
"size": 15976
}
|
[
"net.minecraft.network.play.server.SPacketEntityHeadLook"
] |
import net.minecraft.network.play.server.SPacketEntityHeadLook;
|
import net.minecraft.network.play.server.*;
|
[
"net.minecraft.network"
] |
net.minecraft.network;
| 1,867,279
|
public Observable<ServiceResponse<VpnProfileResponseInner>> generateVpnProfileWithServiceResponseAsync(String resourceGroupName, String gatewayName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (gatewayName == null) {
throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2019-07-01";
final AuthenticationMethod authenticationMethod = null;
P2SVpnProfileParameters parameters = new P2SVpnProfileParameters();
parameters.withAuthenticationMethod(null);
Observable<Response<ResponseBody>> observable = service.generateVpnProfile(resourceGroupName, gatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken<VpnProfileResponseInner>() { }.getType());
}
|
Observable<ServiceResponse<VpnProfileResponseInner>> function(String resourceGroupName, String gatewayName) { if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (gatewayName == null) { throw new IllegalArgumentException(STR); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); } final String apiVersion = STR; final AuthenticationMethod authenticationMethod = null; P2SVpnProfileParameters parameters = new P2SVpnProfileParameters(); parameters.withAuthenticationMethod(null); Observable<Response<ResponseBody>> observable = service.generateVpnProfile(resourceGroupName, gatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken<VpnProfileResponseInner>() { }.getType()); }
|
/**
* Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group.
*
* @param resourceGroupName The name of the resource group.
* @param gatewayName The name of the P2SVpnGateway.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
|
Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group
|
generateVpnProfileWithServiceResponseAsync
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/network/v2019_07_01/implementation/P2sVpnGatewaysInner.java",
"license": "mit",
"size": 105321
}
|
[
"com.google.common.reflect.TypeToken",
"com.microsoft.azure.LongRunningFinalState",
"com.microsoft.azure.LongRunningOperationOptions",
"com.microsoft.azure.management.network.v2019_07_01.AuthenticationMethod",
"com.microsoft.azure.management.network.v2019_07_01.P2SVpnProfileParameters",
"com.microsoft.rest.ServiceResponse"
] |
import com.google.common.reflect.TypeToken; import com.microsoft.azure.LongRunningFinalState; import com.microsoft.azure.LongRunningOperationOptions; import com.microsoft.azure.management.network.v2019_07_01.AuthenticationMethod; import com.microsoft.azure.management.network.v2019_07_01.P2SVpnProfileParameters; import com.microsoft.rest.ServiceResponse;
|
import com.google.common.reflect.*; import com.microsoft.azure.*; import com.microsoft.azure.management.network.v2019_07_01.*; import com.microsoft.rest.*;
|
[
"com.google.common",
"com.microsoft.azure",
"com.microsoft.rest"
] |
com.google.common; com.microsoft.azure; com.microsoft.rest;
| 723,265
|
public void loadFile(String fileStr) throws FileNotFoundException {
loadFile(fileStr, FileType.HMU);
}
|
void function(String fileStr) throws FileNotFoundException { loadFile(fileStr, FileType.HMU); }
|
/**
* Load text file into a new address book
*
* @param fileStr the file to load this Address Book from
* @throws FileNotFoundException when the file given cannot be found.
*/
|
Load text file into a new address book
|
loadFile
|
{
"repo_name": "Team-RamrodCS/Address-Book",
"path": "src/cis/ramrodcs/addressbook/AddressBook.java",
"license": "apache-2.0",
"size": 6025
}
|
[
"java.io.FileNotFoundException"
] |
import java.io.FileNotFoundException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,498,293
|
public static byte[] decrypt(byte[] key, byte[] decoded)
throws GeneralSecurityException
{
SecretKeySpec skeySpec = new SecretKeySpec(key, "AES");
Cipher cipher = Cipher.getInstance("AES/ECB/Nopadding");
cipher.init(Cipher.DECRYPT_MODE, skeySpec);
return cipher.doFinal(decoded);
}
|
static byte[] function(byte[] key, byte[] decoded) throws GeneralSecurityException { SecretKeySpec skeySpec = new SecretKeySpec(key, "AES"); Cipher cipher = Cipher.getInstance(STR); cipher.init(Cipher.DECRYPT_MODE, skeySpec); return cipher.doFinal(decoded); }
|
/**
* <p>
* Does AES encryption of a YubiKey OTP byte sequence.
* </p>
* @param key AES key.
* @param decoded YubiKey OTP byte sequence,
* {@link Modhex#decode(String)} is the typical producer of
* this.
* @return Decrypted.
* @throws GeneralSecurityException If decryption fails.
*/
|
Does AES encryption of a YubiKey OTP byte sequence.
|
decrypt
|
{
"repo_name": "biobankcloud/CauthRealm",
"path": "src/main/java/com/yubico/base/Pof.java",
"license": "apache-2.0",
"size": 3312
}
|
[
"java.security.GeneralSecurityException",
"javax.crypto.Cipher",
"javax.crypto.spec.SecretKeySpec"
] |
import java.security.GeneralSecurityException; import javax.crypto.Cipher; import javax.crypto.spec.SecretKeySpec;
|
import java.security.*; import javax.crypto.*; import javax.crypto.spec.*;
|
[
"java.security",
"javax.crypto"
] |
java.security; javax.crypto;
| 1,349,908
|
@WebMethod
@WebResult(name = "rval", targetNamespace = "https://www.google.com/apis/ads/publisher/v201306")
@RequestWrapper(localName = "performUserTeamAssociationAction", targetNamespace = "https://www.google.com/apis/ads/publisher/v201306", className = "com.google.api.ads.dfp.jaxws.v201306.UserTeamAssociationServiceInterfaceperformUserTeamAssociationAction")
@ResponseWrapper(localName = "performUserTeamAssociationActionResponse", targetNamespace = "https://www.google.com/apis/ads/publisher/v201306", className = "com.google.api.ads.dfp.jaxws.v201306.UserTeamAssociationServiceInterfaceperformUserTeamAssociationActionResponse")
public UpdateResult performUserTeamAssociationAction(
@WebParam(name = "userTeamAssociationAction", targetNamespace = "https://www.google.com/apis/ads/publisher/v201306")
UserTeamAssociationAction userTeamAssociationAction,
@WebParam(name = "statement", targetNamespace = "https://www.google.com/apis/ads/publisher/v201306")
Statement statement)
throws ApiException_Exception
;
|
@WebResult(name = "rval", targetNamespace = STRperformUserTeamAssociationActionSTRhttps: @ResponseWrapper(localName = "performUserTeamAssociationActionResponseSTRhttps: UpdateResult function( @WebParam(name = "userTeamAssociationActionSTRhttps: UserTeamAssociationAction userTeamAssociationAction, @WebParam(name = "statementSTRhttps: Statement statement) throws ApiException_Exception ;
|
/**
*
* Performs actions on {@link UserTeamAssociation} objects that match the
* given {@link Statement#query}.
*
* @param userTeamAssociationAction the action to perform
* @param filterStatement a Publisher Query Language statement used to filter
* a set of user team associations
* @return the result of the action performed
*
*
* @param statement
* @param userTeamAssociationAction
* @return
* returns com.google.api.ads.dfp.jaxws.v201306.UpdateResult
* @throws ApiException_Exception
*/
|
Performs actions on <code>UserTeamAssociation</code> objects that match the given <code>Statement#query</code>
|
performUserTeamAssociationAction
|
{
"repo_name": "nafae/developer",
"path": "modules/dfp_appengine/src/main/java/com/google/api/ads/dfp/jaxws/v201306/UserTeamAssociationServiceInterface.java",
"license": "apache-2.0",
"size": 12005
}
|
[
"javax.jws.WebParam",
"javax.jws.WebResult",
"javax.xml.ws.ResponseWrapper"
] |
import javax.jws.WebParam; import javax.jws.WebResult; import javax.xml.ws.ResponseWrapper;
|
import javax.jws.*; import javax.xml.ws.*;
|
[
"javax.jws",
"javax.xml"
] |
javax.jws; javax.xml;
| 1,574,445
|
private void convertOldNameToNewName(@Nonnull TaskListener listener, XmlFile confXmlFile) {
try {
String configuration = FileUtils.readFileToString(confXmlFile.getFile());
String newConfiguration = configuration.replaceAll(HPE_HP_REGEX, MICROFOCUS);
FileUtils.writeStringToFile(confXmlFile.getFile(), newConfiguration);
} catch (IOException e) {
listener.error("Failed to convert job configuration format to microfocus: %s", e.getMessage());
build.setResult(Result.FAILURE);
}
}
@Extension
public static class Descriptor extends BuildStepDescriptor<Builder> {
public Descriptor() {
load();
}
|
void function(@Nonnull TaskListener listener, XmlFile confXmlFile) { try { String configuration = FileUtils.readFileToString(confXmlFile.getFile()); String newConfiguration = configuration.replaceAll(HPE_HP_REGEX, MICROFOCUS); FileUtils.writeStringToFile(confXmlFile.getFile(), newConfiguration); } catch (IOException e) { listener.error(STR, e.getMessage()); build.setResult(Result.FAILURE); } } public static class Descriptor extends BuildStepDescriptor<Builder> { public Descriptor() { load(); }
|
/**
* Replace all occurrences of {@code oldName} of a given XML file.
* @param listener A place to send log output
* @param confXmlFile The XML file which we convert
* @see XmlFile
*/
|
Replace all occurrences of oldName of a given XML file
|
convertOldNameToNewName
|
{
"repo_name": "HPSoftware/hpaa-octane-dev",
"path": "src/main/java/com/microfocus/application/automation/tools/run/JobConfigRebrander.java",
"license": "mit",
"size": 7958
}
|
[
"hudson.model.Result",
"hudson.model.TaskListener",
"hudson.tasks.BuildStepDescriptor",
"hudson.tasks.Builder",
"java.io.IOException",
"javax.annotation.Nonnull",
"org.apache.commons.io.FileUtils"
] |
import hudson.model.Result; import hudson.model.TaskListener; import hudson.tasks.BuildStepDescriptor; import hudson.tasks.Builder; import java.io.IOException; import javax.annotation.Nonnull; import org.apache.commons.io.FileUtils;
|
import hudson.model.*; import hudson.tasks.*; import java.io.*; import javax.annotation.*; import org.apache.commons.io.*;
|
[
"hudson.model",
"hudson.tasks",
"java.io",
"javax.annotation",
"org.apache.commons"
] |
hudson.model; hudson.tasks; java.io; javax.annotation; org.apache.commons;
| 897,348
|
@Nullable public String getCodecName() {
return codecName;
}
|
@Nullable String function() { return codecName; }
|
/**
* Getter for the track codecName.
* Can be null if unknown or not applicable.
*
* @return - the codec name of the track.
*/
|
Getter for the track codecName. Can be null if unknown or not applicable
|
getCodecName
|
{
"repo_name": "kaltura/playkit-android",
"path": "playkit/src/main/java/com/kaltura/playkit/player/VideoTrack.java",
"license": "agpl-3.0",
"size": 3619
}
|
[
"androidx.annotation.Nullable"
] |
import androidx.annotation.Nullable;
|
import androidx.annotation.*;
|
[
"androidx.annotation"
] |
androidx.annotation;
| 1,917,583
|
super.initialize(stateManager, app);
sManager = stateManager;
spawnState = sManager.getState(SpawnState.class);
obstacleArray = new ArrayList<FactoryInterface>();
addObstacleArray();
}
|
super.initialize(stateManager, app); sManager = stateManager; spawnState = sManager.getState(SpawnState.class); obstacleArray = new ArrayList<FactoryInterface>(); addObstacleArray(); }
|
/**
* The initialize method.
*
* @param stateManager
* AppStateManager
* @param app
* Application The initialize method.
*/
|
The initialize method
|
initialize
|
{
"repo_name": "Denpeer/ContextProject",
"path": "src/main/java/com/funkydonkies/tiers/Tier5.java",
"license": "gpl-2.0",
"size": 1876
}
|
[
"com.funkydonkies.gamestates.SpawnState",
"com.funkydonkies.interfaces.FactoryInterface",
"java.util.ArrayList"
] |
import com.funkydonkies.gamestates.SpawnState; import com.funkydonkies.interfaces.FactoryInterface; import java.util.ArrayList;
|
import com.funkydonkies.gamestates.*; import com.funkydonkies.interfaces.*; import java.util.*;
|
[
"com.funkydonkies.gamestates",
"com.funkydonkies.interfaces",
"java.util"
] |
com.funkydonkies.gamestates; com.funkydonkies.interfaces; java.util;
| 2,315,522
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.