method
stringlengths 13
441k
| clean_method
stringlengths 7
313k
| doc
stringlengths 17
17.3k
| comment
stringlengths 3
1.42k
| method_name
stringlengths 1
273
| extra
dict | imports
list | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
list | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
|---|---|---|---|---|---|---|---|---|---|---|---|
public int getColor(){
return Color.HSVToColor(mAlpha, new float[]{mHue,mSat,mVal});
}
|
int function(){ return Color.HSVToColor(mAlpha, new float[]{mHue,mSat,mVal}); }
|
/**
* Get the current color this view is showing.
* @return the current color.
*/
|
Get the current color this view is showing
|
getColor
|
{
"repo_name": "PAC-ROM/android_packages_apps_PACConsole",
"path": "java/net/margaritov/preference/colorpicker/ColorPickerView.java",
"license": "gpl-3.0",
"size": 25162
}
|
[
"android.graphics.Color"
] |
import android.graphics.Color;
|
import android.graphics.*;
|
[
"android.graphics"
] |
android.graphics;
| 2,287,055
|
private Object readResolve() throws ObjectStreamException {
makeReadOnly();
return this;
}
|
Object function() throws ObjectStreamException { makeReadOnly(); return this; }
|
/**
* Helper method that sets context to read-only after de-serialization.
*
* @return the corrected object version
* @throws ObjectStreamException if an error occurs
*/
|
Helper method that sets context to read-only after de-serialization
|
readResolve
|
{
"repo_name": "DaraghOKeeffe/openfire",
"path": "src/java/org/jivesoftware/util/log/ContextMap.java",
"license": "gpl-2.0",
"size": 5611
}
|
[
"java.io.ObjectStreamException"
] |
import java.io.ObjectStreamException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,742,276
|
public synchronized void updateCharacterStream(int columnIndex,
java.io.Reader x, int length) throws SQLException {
if (!this.onInsertRow) {
if (!this.doingUpdates) {
this.doingUpdates = true;
syncUpdate();
}
this.updater.setCharacterStream(columnIndex, x, length);
} else {
this.inserter.setCharacterStream(columnIndex, x, length);
if (x == null) {
this.thisRow.setColumnValue(columnIndex - 1, null);
} else {
this.thisRow.setColumnValue(columnIndex - 1, STREAM_DATA_MARKER);
}
}
}
|
synchronized void function(int columnIndex, java.io.Reader x, int length) throws SQLException { if (!this.onInsertRow) { if (!this.doingUpdates) { this.doingUpdates = true; syncUpdate(); } this.updater.setCharacterStream(columnIndex, x, length); } else { this.inserter.setCharacterStream(columnIndex, x, length); if (x == null) { this.thisRow.setColumnValue(columnIndex - 1, null); } else { this.thisRow.setColumnValue(columnIndex - 1, STREAM_DATA_MARKER); } } }
|
/**
* JDBC 2.0 Update a column with a character stream value. The updateXXX()
* methods are used to update column values in the current row, or the
* insert row. The updateXXX() methods do not update the underlying
* database, instead the updateRow() or insertRow() methods are called to
* update the database.
*
* @param columnIndex
* the first column is 1, the second is 2, ...
* @param x
* the new column value
* @param length
* the length of the stream
*
* @exception SQLException
* if a database-access error occurs
*/
|
JDBC 2.0 Update a column with a character stream value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database
|
updateCharacterStream
|
{
"repo_name": "shubhanshu-gupta/Apache-Solr",
"path": "example/solr/collection1/lib/mysql-connector-java-5.1.32/src/com/mysql/jdbc/UpdatableResultSet.java",
"license": "apache-2.0",
"size": 81419
}
|
[
"java.sql.SQLException"
] |
import java.sql.SQLException;
|
import java.sql.*;
|
[
"java.sql"
] |
java.sql;
| 2,816,672
|
public Set<ServerMethod> getSupportedMethods() {
return client != null ? ServerMethod.getSupportedMethods(client.getSupportedMethods(), client.getServerInfos()) : null;
}
/**
* Submits a string based query plan for execution and returns the result batches. Supported query types are:
* <p><ul>
* <li>{@link QueryType#LOGICAL}
* <li>{@link QueryType#PHYSICAL}
* <li>{@link QueryType#SQL}
|
Set<ServerMethod> function() { return client != null ? ServerMethod.getSupportedMethods(client.getSupportedMethods(), client.getServerInfos()) : null; } /** * Submits a string based query plan for execution and returns the result batches. Supported query types are: * <p><ul> * <li>{@link QueryType#LOGICAL} * <li>{@link QueryType#PHYSICAL} * <li>{@link QueryType#SQL}
|
/**
* Returns the list of methods supported by the server based on its advertised information.
*
* @return an immutable set of capabilities
*/
|
Returns the list of methods supported by the server based on its advertised information
|
getSupportedMethods
|
{
"repo_name": "Agirish/drill",
"path": "exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillClient.java",
"license": "apache-2.0",
"size": 36411
}
|
[
"java.util.Set",
"org.apache.drill.exec.proto.UserBitShared"
] |
import java.util.Set; import org.apache.drill.exec.proto.UserBitShared;
|
import java.util.*; import org.apache.drill.exec.proto.*;
|
[
"java.util",
"org.apache.drill"
] |
java.util; org.apache.drill;
| 2,048,516
|
@Override
public void addTouchables(ArrayList<View> views) {
// Note that we don't call super.addTouchables(), which means that
// we don't call View.addTouchables(). This is okay because a ViewPager
// is itself not touchable.
for (int i = 0; i < getChildCount(); i++) {
final View child = getChildAt(i);
if (child.getVisibility() == VISIBLE) {
ItemInfo ii = infoForChild(child);
if (ii != null && ii.position == mCurItem) {
child.addTouchables(views);
}
}
}
}
|
void function(ArrayList<View> views) { for (int i = 0; i < getChildCount(); i++) { final View child = getChildAt(i); if (child.getVisibility() == VISIBLE) { ItemInfo ii = infoForChild(child); if (ii != null && ii.position == mCurItem) { child.addTouchables(views); } } } }
|
/**
* We only want the current page that is being shown to be touchable.
*/
|
We only want the current page that is being shown to be touchable
|
addTouchables
|
{
"repo_name": "darlyhellen/oto",
"path": "ToWife/src/com/chenminna/towife/widget/vpager/VerticalViewPager.java",
"license": "apache-2.0",
"size": 87863
}
|
[
"android.view.View",
"java.util.ArrayList"
] |
import android.view.View; import java.util.ArrayList;
|
import android.view.*; import java.util.*;
|
[
"android.view",
"java.util"
] |
android.view; java.util;
| 915,397
|
public File lookup(String source, ExtractorConfig config, FileExtractor.FileType type);
|
File function(String source, ExtractorConfig config, FileExtractor.FileType type);
|
/**
* Look up a file in the TRAP cache.
*
* @param source the content of the file
* @param config the configuration options this file will be extracted with if it is not found in
* the cache
* @param type the type of the file
* @return {@literal null} if this TRAP cache does not support caching the given file; otherwise,
* a file in the TRAP cache which may either already exist (and then is guaranteed to hold
* cached information), or does not yet exist (and should be populated by the extractor)
*/
|
Look up a file in the TRAP cache
|
lookup
|
{
"repo_name": "github/codeql",
"path": "javascript/extractor/src/com/semmle/js/extractor/trapcache/ITrapCache.java",
"license": "mit",
"size": 867
}
|
[
"com.semmle.js.extractor.ExtractorConfig",
"com.semmle.js.extractor.FileExtractor",
"java.io.File"
] |
import com.semmle.js.extractor.ExtractorConfig; import com.semmle.js.extractor.FileExtractor; import java.io.File;
|
import com.semmle.js.extractor.*; import java.io.*;
|
[
"com.semmle.js",
"java.io"
] |
com.semmle.js; java.io;
| 1,279,883
|
@Override
protected void onPostExecute(Map result) {
progressBar.setVisibility(View.INVISIBLE);
if (result == null) {
loginButton.setText("Couldn't get user info");
} else {
// loginButton.setText("Logged in as " + result.get("given_name"));
loginButton.setText("Logged in as foo bar");
Log.i(TAG, "We manage to login user to server");
}
}
|
void function(Map result) { progressBar.setVisibility(View.INVISIBLE); if (result == null) { loginButton.setText(STR); } else { loginButton.setText(STR); Log.i(TAG, STR); } }
|
/**
* Processes the API's response.
*/
|
Processes the API's response
|
onPostExecute
|
{
"repo_name": "tdb-alcorn/defect-party",
"path": "app/src/main/java/com/projecttango/examples/java/floorplan/LoginActivity.java",
"license": "mit",
"size": 18427
}
|
[
"android.util.Log",
"android.view.View",
"java.util.Map"
] |
import android.util.Log; import android.view.View; import java.util.Map;
|
import android.util.*; import android.view.*; import java.util.*;
|
[
"android.util",
"android.view",
"java.util"
] |
android.util; android.view; java.util;
| 2,218,386
|
public static final boolean isDisconnectable(Map map) {
Boolean bool = (Boolean) map.get(DISCONNECTABLE);
if (bool != null)
return bool.booleanValue();
return true;
}
|
static final boolean function(Map map) { Boolean bool = (Boolean) map.get(DISCONNECTABLE); if (bool != null) return bool.booleanValue(); return true; }
|
/**
* Returns the disconnectable attribute from the specified map.
*/
|
Returns the disconnectable attribute from the specified map
|
isDisconnectable
|
{
"repo_name": "Baltasarq/Gia",
"path": "src/JGraph/src/org/jgraph/graph/GraphConstants.java",
"license": "mit",
"size": 48823
}
|
[
"java.util.Map"
] |
import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,183,844
|
public static PdcPositionEntity fromClassifyPosition(final ClassifyPosition position,
String inLanguage, final URI inClassificationByURI) {
String positionId = String.valueOf(position.getPositionId());
return new PdcPositionEntity(
fromClassifyValues(position.getListClassifyValue(), inLanguage)).withURI(
inClassificationByURI, positionId).
withId(positionId);
}
|
static PdcPositionEntity function(final ClassifyPosition position, String inLanguage, final URI inClassificationByURI) { String positionId = String.valueOf(position.getPositionId()); return new PdcPositionEntity( fromClassifyValues(position.getListClassifyValue(), inLanguage)).withURI( inClassificationByURI, positionId). withId(positionId); }
|
/**
* Creates a Web entity representing a position on the PdC from the specified business
* classification position. It is expressed in the specified language and it is located in the PdC
* classification identified by the specified URI.
* @param position the ClassifyPosition instance the web entity should represent.
* @param inLanguage the language in which the position should expressed.
* @param inClassificationByURI the URI identifying the PdC classification to which the position
* belongs.
* @return a PdcPositionEntity instance.
*/
|
Creates a Web entity representing a position on the PdC from the specified business classification position. It is expressed in the specified language and it is located in the PdC classification identified by the specified URI
|
fromClassifyPosition
|
{
"repo_name": "ebonnet/Silverpeas-Core",
"path": "core-web/src/main/java/org/silverpeas/core/webapi/pdc/PdcPositionEntity.java",
"license": "agpl-3.0",
"size": 10207
}
|
[
"org.silverpeas.core.pdc.pdc.model.ClassifyPosition"
] |
import org.silverpeas.core.pdc.pdc.model.ClassifyPosition;
|
import org.silverpeas.core.pdc.pdc.model.*;
|
[
"org.silverpeas.core"
] |
org.silverpeas.core;
| 2,260,300
|
boolean checkAndRowMutate(byte [] row, Filter filter, TimeRange timeRange,
RowMutations mutations) throws IOException;
|
boolean checkAndRowMutate(byte [] row, Filter filter, TimeRange timeRange, RowMutations mutations) throws IOException;
|
/**
* Atomically checks if a row matches the filter and if it does, it performs the row mutations.
* Use to do many mutations on a single row. Use checkAndMutate to do one checkAndMutate at a
* time.
* @param row to check
* @param filter the filter
* @param mutations data to put if check succeeds
* @param timeRange time range to check
* @return true if mutations were applied, false otherwise
*/
|
Atomically checks if a row matches the filter and if it does, it performs the row mutations. Use to do many mutations on a single row. Use checkAndMutate to do one checkAndMutate at a time
|
checkAndRowMutate
|
{
"repo_name": "francisliu/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Region.java",
"license": "apache-2.0",
"size": 23185
}
|
[
"java.io.IOException",
"org.apache.hadoop.hbase.client.RowMutations",
"org.apache.hadoop.hbase.filter.Filter",
"org.apache.hadoop.hbase.io.TimeRange"
] |
import java.io.IOException; import org.apache.hadoop.hbase.client.RowMutations; import org.apache.hadoop.hbase.filter.Filter; import org.apache.hadoop.hbase.io.TimeRange;
|
import java.io.*; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.filter.*; import org.apache.hadoop.hbase.io.*;
|
[
"java.io",
"org.apache.hadoop"
] |
java.io; org.apache.hadoop;
| 725,043
|
public Type getGenericType(String key) {
return getGenericType(bean.getClass(), key);
}
|
Type function(String key) { return getGenericType(bean.getClass(), key); }
|
/**
* Returns the generic type of a property.
*
* @param key
* The property name.
*
* @see
* #getGenericType(Class, String)
*/
|
Returns the generic type of a property
|
getGenericType
|
{
"repo_name": "ggeorg/chillverse",
"path": "src/org/apache/pivot/beans/BeanAdapter.java",
"license": "apache-2.0",
"size": 33186
}
|
[
"java.lang.reflect.Type"
] |
import java.lang.reflect.Type;
|
import java.lang.reflect.*;
|
[
"java.lang"
] |
java.lang;
| 388,698
|
interface Transformation<T, R>
{
TransformationState<R> process(@Nullable T element);
}
|
interface Transformation<T, R> { TransformationState<R> process(@Nullable T element); }
|
/**
* Processes input elements and returns current transformation state.
*
* @param element an element to be transformed. Will be null
* when there are no more elements. In such case transformation should
* finish processing and flush any remaining data.
* @return the current transformation state, optionally bearing a result
* @see TransformationState#needsMoreData()
* @see TransformationState#blocked(ListenableFuture)
* @see TransformationState#yielded()
* @see TransformationState#ofResult(Object)
* @see TransformationState#ofResult(Object, boolean)
* @see TransformationState#finished()
*/
|
Processes input elements and returns current transformation state
|
process
|
{
"repo_name": "ebyhr/presto",
"path": "core/trino-main/src/main/java/io/trino/operator/WorkProcessor.java",
"license": "apache-2.0",
"size": 13354
}
|
[
"javax.annotation.Nullable"
] |
import javax.annotation.Nullable;
|
import javax.annotation.*;
|
[
"javax.annotation"
] |
javax.annotation;
| 2,160,639
|
return WSDLConstants.WSDL20_2006Constants.MEP_URI_IN_OPTIONAL_OUT.equals(mep) ||
WSDL2Constants.MEP_URI_IN_ONLY.equals(mep) ||
WSDL2Constants.MEP_URI_IN_OUT.equals(mep) ||
WSDL2Constants.MEP_URI_OUT_IN.equals(mep) ||
WSDL2Constants.MEP_URI_OUT_OPTIONAL_IN.equals(mep) ||
WSDL2Constants.MEP_URI_ROBUST_IN_ONLY.equals(mep);
}
|
return WSDLConstants.WSDL20_2006Constants.MEP_URI_IN_OPTIONAL_OUT.equals(mep) WSDL2Constants.MEP_URI_IN_ONLY.equals(mep) WSDL2Constants.MEP_URI_IN_OUT.equals(mep) WSDL2Constants.MEP_URI_OUT_IN.equals(mep) WSDL2Constants.MEP_URI_OUT_OPTIONAL_IN.equals(mep) WSDL2Constants.MEP_URI_ROBUST_IN_ONLY.equals(mep); }
|
/**
* returns whether the given mep uri is one of the
* input meps
*
* @param mep
*/
|
returns whether the given mep uri is one of the input meps
|
isInputPresentForMEP
|
{
"repo_name": "supunmalinga/wso2-axis2",
"path": "modules/kernel/src/org/apache/axis2/wsdl/WSDLUtil.java",
"license": "apache-2.0",
"size": 4297
}
|
[
"org.apache.axis2.description.WSDL2Constants"
] |
import org.apache.axis2.description.WSDL2Constants;
|
import org.apache.axis2.description.*;
|
[
"org.apache.axis2"
] |
org.apache.axis2;
| 667,560
|
private String upload(final Shell shell, final String dir)
throws IOException {
String script = "";
try {
for (final Map.Entry<String, InputStream> asset
: this.profile.assets().entrySet()) {
shell.exec(
String.format(
"cat > %s",
SSH.escape(String.format("%s/%s", dir, asset.getKey()))
),
asset.getValue(),
Logger.stream(Level.INFO, true),
Logger.stream(Level.WARNING, true)
);
Logger.info(
this, "\"%s\" uploaded into %s",
asset.getKey(), dir
);
}
this.gpg(shell, dir);
} catch (final Profile.ConfigException ex) {
script = Logger.format(
"cat << EOT\n%s\nEOT\nexit -1",
ex.getLocalizedMessage()
);
}
return script;
}
|
String function(final Shell shell, final String dir) throws IOException { String script = STRcat > %sSTR%s/%sSTR\"%s\" uploaded into %sSTRcat << EOT\n%s\nEOT\nexit -1", ex.getLocalizedMessage() ); } return script; }
|
/**
* Upload assets.
* @param shell Shell
* @param dir Directory
* @return Script to use
* @throws IOException If fails
*/
|
Upload assets
|
upload
|
{
"repo_name": "joansmith/rultor",
"path": "src/main/java/com/rultor/agents/daemons/StartsDaemon.java",
"license": "bsd-3-clause",
"size": 8765
}
|
[
"com.jcabi.ssh.Shell",
"java.io.IOException"
] |
import com.jcabi.ssh.Shell; import java.io.IOException;
|
import com.jcabi.ssh.*; import java.io.*;
|
[
"com.jcabi.ssh",
"java.io"
] |
com.jcabi.ssh; java.io;
| 1,700,313
|
public void setPercent (BigDecimal Percent);
|
void function (BigDecimal Percent);
|
/** Set Percent.
* Percentage
*/
|
Set Percent. Percentage
|
setPercent
|
{
"repo_name": "geneos/adempiere",
"path": "base/src/org/compiere/model/I_C_Withholding.java",
"license": "gpl-2.0",
"size": 8795
}
|
[
"java.math.BigDecimal"
] |
import java.math.BigDecimal;
|
import java.math.*;
|
[
"java.math"
] |
java.math;
| 2,220,265
|
public void testRefresh() throws Exception {
// create new node
Node n = testRootNode.addNode(nodeName1, testNodeType);
ensureMixinType(n, mixLockable);
testRootNode.getSession().save();
// lock node and get lock token
Lock lock = n.lock(false, true);
// assert: lock must be alive
assertTrue("lock must be alive", lock.isLive());
// assert: refresh must succeed
lock.refresh();
// unlock node
n.unlock();
// assert: lock must not be alive
assertFalse("lock must not be alive", lock.isLive());
}
|
void function() throws Exception { Node n = testRootNode.addNode(nodeName1, testNodeType); ensureMixinType(n, mixLockable); testRootNode.getSession().save(); Lock lock = n.lock(false, true); assertTrue(STR, lock.isLive()); lock.refresh(); n.unlock(); assertFalse(STR, lock.isLive()); }
|
/**
* Test refresh
*/
|
Test refresh
|
testRefresh
|
{
"repo_name": "bartosz-grabski/jackrabbit",
"path": "jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/LockTest.java",
"license": "apache-2.0",
"size": 24849
}
|
[
"javax.jcr.Node",
"javax.jcr.lock.Lock"
] |
import javax.jcr.Node; import javax.jcr.lock.Lock;
|
import javax.jcr.*; import javax.jcr.lock.*;
|
[
"javax.jcr"
] |
javax.jcr;
| 1,843,085
|
DecoratorContext saveMeasure(Metric metric, Double value);
|
DecoratorContext saveMeasure(Metric metric, Double value);
|
/**
* Add a new measure on the current resource. It can not be executed from children contexts.
*
* @return the current object
*/
|
Add a new measure on the current resource. It can not be executed from children contexts
|
saveMeasure
|
{
"repo_name": "abbeyj/sonarqube",
"path": "sonar-plugin-api/src/main/java/org/sonar/api/batch/DecoratorContext.java",
"license": "lgpl-3.0",
"size": 2522
}
|
[
"org.sonar.api.measures.Metric"
] |
import org.sonar.api.measures.Metric;
|
import org.sonar.api.measures.*;
|
[
"org.sonar.api"
] |
org.sonar.api;
| 2,051,796
|
public void start(BootstrapContext ctx)
throws ResourceAdapterInternalException {
}
|
void function(BootstrapContext ctx) throws ResourceAdapterInternalException { }
|
/**
* This is called when a resource adapter instance is bootstrapped.
*
* @param ctx a bootstrap context containing references
* @throws ResourceAdapterInternalException indicates bootstrap failure.
*/
|
This is called when a resource adapter instance is bootstrapped
|
start
|
{
"repo_name": "xasx/wildfly",
"path": "testsuite/integration/smoke/src/test/java/org/jboss/as/test/smoke/rar/HelloWorldResourceAdapter.java",
"license": "lgpl-2.1",
"size": 5045
}
|
[
"javax.resource.spi.BootstrapContext",
"javax.resource.spi.ResourceAdapterInternalException"
] |
import javax.resource.spi.BootstrapContext; import javax.resource.spi.ResourceAdapterInternalException;
|
import javax.resource.spi.*;
|
[
"javax.resource"
] |
javax.resource;
| 558,488
|
protected boolean populateFromDisk(String org) {
_sequencerModel = new SequencerModel(settings.getScoItemSequenceFile(), settings);
_prereqTable = _sequencerModel.getItemsAsHash(org);
return (_prereqTable != null);
}
|
boolean function(String org) { _sequencerModel = new SequencerModel(settings.getScoItemSequenceFile(), settings); _prereqTable = _sequencerModel.getItemsAsHash(org); return (_prereqTable != null); }
|
/**
* Method to get the disk version of the package (what/what hasn't has been
* completed)
*
* @param org
* @return true is successful
*/
|
Method to get the disk version of the package (what/what hasn't has been completed)
|
populateFromDisk
|
{
"repo_name": "stevenhva/InfoLearn_OpenOLAT",
"path": "src/main/java/org/olat/modules/scorm/server/sequence/PrerequisiteManager.java",
"license": "apache-2.0",
"size": 11410
}
|
[
"org.olat.modules.scorm.server.servermodels.SequencerModel"
] |
import org.olat.modules.scorm.server.servermodels.SequencerModel;
|
import org.olat.modules.scorm.server.servermodels.*;
|
[
"org.olat.modules"
] |
org.olat.modules;
| 2,778,455
|
@FIXVersion(introduced="4.0")
@TagNumRef(tagNum=TagNum.TransactTime)
public Date getTransactTime() {
return transactTime;
}
|
@FIXVersion(introduced="4.0") @TagNumRef(tagNum=TagNum.TransactTime) Date function() { return transactTime; }
|
/**
* Message field getter.
* @return field value
*/
|
Message field getter
|
getTransactTime
|
{
"repo_name": "marvisan/HadesFIX",
"path": "Model/src/main/java/net/hades/fix/message/AdvertisementMsg.java",
"license": "gpl-3.0",
"size": 49255
}
|
[
"java.util.Date",
"net.hades.fix.message.anno.FIXVersion",
"net.hades.fix.message.anno.TagNumRef",
"net.hades.fix.message.type.TagNum"
] |
import java.util.Date; import net.hades.fix.message.anno.FIXVersion; import net.hades.fix.message.anno.TagNumRef; import net.hades.fix.message.type.TagNum;
|
import java.util.*; import net.hades.fix.message.anno.*; import net.hades.fix.message.type.*;
|
[
"java.util",
"net.hades.fix"
] |
java.util; net.hades.fix;
| 2,496,294
|
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Void> startAsync(String resourceGroupName, String cloudServiceName, Context context) {
return beginStartAsync(resourceGroupName, cloudServiceName, context)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
|
@ServiceMethod(returns = ReturnType.SINGLE) Mono<Void> function(String resourceGroupName, String cloudServiceName, Context context) { return beginStartAsync(resourceGroupName, cloudServiceName, context) .last() .flatMap(this.client::getLroFinalResultOrError); }
|
/**
* Starts the cloud service.
*
* @param resourceGroupName Name of the resource group.
* @param cloudServiceName Name of the cloud service.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ApiErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return A {@link Mono} that completes when a successful response is received.
*/
|
Starts the cloud service
|
startAsync
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/CloudServicesClientImpl.java",
"license": "mit",
"size": 179410
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.util.Context"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.util.Context;
|
import com.azure.core.annotation.*; import com.azure.core.util.*;
|
[
"com.azure.core"
] |
com.azure.core;
| 30,233
|
public void setTerminate(boolean value){
this.terminateWorker=value;
}
public Worker(ModuleManagement layerManagement, ThreadPool pool, String ID, LinkedBlockingQueue<PCEPMessage> requestQueue, Gcontroller graph){
lm = layerManagement;
this.pool = pool;
this.ID = ID;
this.requestQueue = requestQueue;
logger = LoggerFactory.getLogger("Worker-" + ID);
}
|
void function(boolean value){ this.terminateWorker=value; } public Worker(ModuleManagement layerManagement, ThreadPool pool, String ID, LinkedBlockingQueue<PCEPMessage> requestQueue, Gcontroller graph){ lm = layerManagement; this.pool = pool; this.ID = ID; this.requestQueue = requestQueue; logger = LoggerFactory.getLogger(STR + ID); }
|
/**Function to set the flag to terminate the worker thread
*
* @param value
*/
|
Function to set the flag to terminate the worker thread
|
setTerminate
|
{
"repo_name": "tamal123/Path-Computation-Element-Emulator",
"path": "PCEE/src/com/pcee/architecture/computationmodule/threadpool/Worker.java",
"license": "gpl-3.0",
"size": 3342
}
|
[
"com.graph.graphcontroller.Gcontroller",
"com.pcee.architecture.ModuleManagement",
"com.pcee.protocol.message.PCEPMessage",
"java.util.concurrent.LinkedBlockingQueue",
"org.slf4j.LoggerFactory"
] |
import com.graph.graphcontroller.Gcontroller; import com.pcee.architecture.ModuleManagement; import com.pcee.protocol.message.PCEPMessage; import java.util.concurrent.LinkedBlockingQueue; import org.slf4j.LoggerFactory;
|
import com.graph.graphcontroller.*; import com.pcee.architecture.*; import com.pcee.protocol.message.*; import java.util.concurrent.*; import org.slf4j.*;
|
[
"com.graph.graphcontroller",
"com.pcee.architecture",
"com.pcee.protocol",
"java.util",
"org.slf4j"
] |
com.graph.graphcontroller; com.pcee.architecture; com.pcee.protocol; java.util; org.slf4j;
| 1,238,204
|
@POST
@Path("submit/{type}")
@Consumes({MediaType.TEXT_XML, MediaType.TEXT_PLAIN})
@Produces({MediaType.TEXT_XML, MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
@Monitored(event = "submit")
@Override
public APIResult submit(
@Context HttpServletRequest request, @Dimension("entityType") @PathParam("type") final String type,
@Dimension("colo") @QueryParam("colo") final String ignore) {
final HttpServletRequest bufferedRequest = getBufferedRequest(request);
final Entity entity = getEntity(bufferedRequest, type);
Map<String, APIResult> results = new HashMap<String, APIResult>();
final Set<String> colos = getApplicableColos(type, entity);
validateEntity(entity, colos);
|
@Path(STR) @Consumes({MediaType.TEXT_XML, MediaType.TEXT_PLAIN}) @Produces({MediaType.TEXT_XML, MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON}) @Monitored(event = STR) APIResult function( @Context HttpServletRequest request, @Dimension(STR) @PathParam("type") final String type, @Dimension("colo") @QueryParam("colo") final String ignore) { final HttpServletRequest bufferedRequest = getBufferedRequest(request); final Entity entity = getEntity(bufferedRequest, type); Map<String, APIResult> results = new HashMap<String, APIResult>(); final Set<String> colos = getApplicableColos(type, entity); validateEntity(entity, colos);
|
/**
* Submit the given entity.
* @param request Servlet Request
* @param type Valid options are cluster, feed or process.
* @param ignore colo is ignored
* @return Result of the submission.
*/
|
Submit the given entity
|
submit
|
{
"repo_name": "sanjeevtripurari/falcon",
"path": "prism/src/main/java/org/apache/falcon/resource/proxy/SchedulableEntityManagerProxy.java",
"license": "apache-2.0",
"size": 39449
}
|
[
"java.util.HashMap",
"java.util.Map",
"java.util.Set",
"javax.servlet.http.HttpServletRequest",
"javax.ws.rs.Consumes",
"javax.ws.rs.Path",
"javax.ws.rs.PathParam",
"javax.ws.rs.Produces",
"javax.ws.rs.QueryParam",
"javax.ws.rs.core.Context",
"javax.ws.rs.core.MediaType",
"org.apache.falcon.entity.v0.Entity",
"org.apache.falcon.monitors.Dimension",
"org.apache.falcon.monitors.Monitored",
"org.apache.falcon.resource.APIResult"
] |
import java.util.HashMap; import java.util.Map; import java.util.Set; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.Consumes; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import org.apache.falcon.entity.v0.Entity; import org.apache.falcon.monitors.Dimension; import org.apache.falcon.monitors.Monitored; import org.apache.falcon.resource.APIResult;
|
import java.util.*; import javax.servlet.http.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import org.apache.falcon.entity.v0.*; import org.apache.falcon.monitors.*; import org.apache.falcon.resource.*;
|
[
"java.util",
"javax.servlet",
"javax.ws",
"org.apache.falcon"
] |
java.util; javax.servlet; javax.ws; org.apache.falcon;
| 879,583
|
public boolean isLastBeforeOthers() {
if (!beforeOthers) {
throw new IllegalStateException();
}
Iterator<Ordering> beforeIterator = before.iterator();
while (beforeIterator.hasNext()) {
Ordering check = beforeIterator.next();
if (!check.beforeOthers) {
return true;
} else if (check.isLastBeforeOthers()) {
return true;
}
}
return false;
}
|
boolean function() { if (!beforeOthers) { throw new IllegalStateException(); } Iterator<Ordering> beforeIterator = before.iterator(); while (beforeIterator.hasNext()) { Ordering check = beforeIterator.next(); if (!check.beforeOthers) { return true; } else if (check.isLastBeforeOthers()) { return true; } } return false; }
|
/**
* Check is a fragment marked as before others is after a fragment that
* is not.
*
* @return true if a fragment marked as before others is after a
* fragment that is not
*/
|
Check is a fragment marked as before others is after a fragment that is not
|
isLastBeforeOthers
|
{
"repo_name": "jstourac/wildfly",
"path": "undertow/src/main/java/org/wildfly/extension/undertow/deployment/WarMetaDataProcessor.java",
"license": "lgpl-2.1",
"size": 30961
}
|
[
"java.util.Iterator"
] |
import java.util.Iterator;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,873,103
|
@JMXBeanAttribute(sortValue = "10", nameKey = "org.fujion.console.cache.fsp.size.name", descriptionKey = "org.fujion.console.cache.fsp.size.description")
public String getFSPCacheSize() {
int size = fspCache.size();
return formatResult("fsp.size", size);
}
|
@JMXBeanAttribute(sortValue = "10", nameKey = STR, descriptionKey = STR) String function() { int size = fspCache.size(); return formatResult(STR, size); }
|
/**
* Returns the size of the page definition cache.
*
* @return The size of the cache.
*/
|
Returns the size of the page definition cache
|
getFSPCacheSize
|
{
"repo_name": "fujion/fujion-framework",
"path": "fujion-core/src/main/java/org/fujion/jmx/CacheManagementConsole.java",
"license": "apache-2.0",
"size": 4200
}
|
[
"com.udojava.jmx.wrapper.JMXBeanAttribute"
] |
import com.udojava.jmx.wrapper.JMXBeanAttribute;
|
import com.udojava.jmx.wrapper.*;
|
[
"com.udojava.jmx"
] |
com.udojava.jmx;
| 1,530,211
|
protected AccountingLineViewAction getRefreshAction(AccountingLine accountingLine, String accountingLinePropertyName, Integer accountingLineIndex, String groupTitle) {
String actionMethod = this.getRefreshLineMethod(accountingLine, accountingLinePropertyName, accountingLineIndex);
String actionLabel = getActionLabel(KFSKeyConstants.AccountingLineViewRendering.ACCOUNTING_LINE_REFRESH_ACTION_LABEL, groupTitle, accountingLineIndex + 1);
String actionImageName = getRiceImagePath() + "tinybutton-refresh.gif";
return new AccountingLineViewAction(actionMethod, actionLabel, actionImageName);
}
|
AccountingLineViewAction function(AccountingLine accountingLine, String accountingLinePropertyName, Integer accountingLineIndex, String groupTitle) { String actionMethod = this.getRefreshLineMethod(accountingLine, accountingLinePropertyName, accountingLineIndex); String actionLabel = getActionLabel(KFSKeyConstants.AccountingLineViewRendering.ACCOUNTING_LINE_REFRESH_ACTION_LABEL, groupTitle, accountingLineIndex + 1); String actionImageName = getRiceImagePath() + STR; return new AccountingLineViewAction(actionMethod, actionLabel, actionImageName); }
|
/**
* constructs a refresh action image and action
*
* @param accountingLine
* @param accountingLinePropertyName
* @param accountingLineIndex
* @param groupTitle
* @return
*/
|
constructs a refresh action image and action
|
getRefreshAction
|
{
"repo_name": "bhutchinson/kfs",
"path": "kfs-core/src/main/java/org/kuali/kfs/fp/document/authorization/FinancialTransactionalDocumentAccountingLineAuthorizerBase.java",
"license": "agpl-3.0",
"size": 3859
}
|
[
"org.kuali.kfs.sys.KFSKeyConstants",
"org.kuali.kfs.sys.businessobject.AccountingLine",
"org.kuali.kfs.sys.document.web.AccountingLineViewAction"
] |
import org.kuali.kfs.sys.KFSKeyConstants; import org.kuali.kfs.sys.businessobject.AccountingLine; import org.kuali.kfs.sys.document.web.AccountingLineViewAction;
|
import org.kuali.kfs.sys.*; import org.kuali.kfs.sys.businessobject.*; import org.kuali.kfs.sys.document.web.*;
|
[
"org.kuali.kfs"
] |
org.kuali.kfs;
| 1,396,690
|
public static void main(String[] args) {
System.out.printf("%s version %s%n", APP_NAME, APP_VERSION);
Logger.setup();
logSystemInfo();
// Determine if user intends to use the command-line interface, and gather args if so
boolean useCli = false;
List<String> argsCli = new ArrayList<>();
for (String arg : args) {
if (!useCli && arg.equals("-cli")) {
useCli = true;
} else if (useCli) {
argsCli.add(arg);
}
}
if (!useCli) {
// Launch the GUI
launch(args);
} else {
Logger.info("Tabulator is being used via the CLI.");
// Check for unexpected input
if (argsCli.size() == 0) {
Logger.severe(
"No config file path provided on command line!\n"
+ "Please provide a path to the config file!\n"
+ "See README.md for more details.");
System.exit(1);
} else if (argsCli.size() > 2) {
Logger.severe(
"Too many arguments! Max is 2 but got: %d\n" + "See README.md for more details.",
argsCli.size());
System.exit(2);
}
// Path to either: config file for configuring the tabulator, or Dominion JSONs
String providedPath = argsCli.get(0);
// Session object will manage the tabulation process
TabulatorSession session = new TabulatorSession(providedPath);
if (argsCli.size() == 2 && argsCli.get(1).equals("convert-to-cdf")) {
session.convertToCdf();
} else {
session.tabulate();
}
}
System.exit(0);
}
|
static void function(String[] args) { System.out.printf(STR, APP_NAME, APP_VERSION); Logger.setup(); logSystemInfo(); boolean useCli = false; List<String> argsCli = new ArrayList<>(); for (String arg : args) { if (!useCli && arg.equals("-cli")) { useCli = true; } else if (useCli) { argsCli.add(arg); } } if (!useCli) { launch(args); } else { Logger.info(STR); if (argsCli.size() == 0) { Logger.severe( STR + STR + STR); System.exit(1); } else if (argsCli.size() > 2) { Logger.severe( STR + STR, argsCli.size()); System.exit(2); } String providedPath = argsCli.get(0); TabulatorSession session = new TabulatorSession(providedPath); if (argsCli.size() == 2 && argsCli.get(1).equals(STR)) { session.convertToCdf(); } else { session.tabulate(); } } System.exit(0); }
|
/**
* Main entry point to the RCV tabulator program.
*
* @param args command-line args
*/
|
Main entry point to the RCV tabulator program
|
main
|
{
"repo_name": "BrightSpots/rcv",
"path": "src/main/java/network/brightspots/rcv/Main.java",
"license": "agpl-3.0",
"size": 3096
}
|
[
"java.util.ArrayList",
"java.util.List"
] |
import java.util.ArrayList; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,061,784
|
@Test
public void testFeverState() {
final SimpleBooleanNetwork<FeverState> n = new SimpleBooleanNetwork<>(
FeverState.HOT);
n.learn(FeverState.NONE, false);
n.learn(FeverState.NONE, false);
n.learn(FeverState.NONE, false);
n.learn(FeverState.NONE, false);
n.learn(FeverState.NONE, true);
n.learn(FeverState.LOW, false);
n.learn(FeverState.LOW, false);
n.learn(FeverState.LOW, false);
n.learn(FeverState.LOW, true);
n.learn(FeverState.LOW, true);
n.learn(FeverState.WARM, false);
n.learn(FeverState.WARM, false);
n.learn(FeverState.WARM, true);
n.learn(FeverState.WARM, true);
n.learn(FeverState.WARM, true);
n.learn(FeverState.HOT, false);
n.learn(FeverState.HOT, true);
n.learn(FeverState.HOT, true);
n.learn(FeverState.HOT, true);
n.learn(FeverState.HOT, true);
n.getGoal().setState(BooleanState.TRUE);
// check some probabilities
final double nonePercentage = n.getPercentage(FeverState.NONE);
final double lowPercentage = n.getPercentage(FeverState.LOW);
final double warmPercentage = n.getPercentage(FeverState.WARM);
final double hotPercentage = n.getPercentage(FeverState.HOT);
final boolean condition = (nonePercentage < lowPercentage)
&& (lowPercentage < warmPercentage)
&& (warmPercentage < hotPercentage);
Assert.assertTrue("incorrect fever to sickness mapping! "
+ nonePercentage + " < " + lowPercentage + " < "
+ warmPercentage + " < " + hotPercentage, condition);
}
|
void function() { final SimpleBooleanNetwork<FeverState> n = new SimpleBooleanNetwork<>( FeverState.HOT); n.learn(FeverState.NONE, false); n.learn(FeverState.NONE, false); n.learn(FeverState.NONE, false); n.learn(FeverState.NONE, false); n.learn(FeverState.NONE, true); n.learn(FeverState.LOW, false); n.learn(FeverState.LOW, false); n.learn(FeverState.LOW, false); n.learn(FeverState.LOW, true); n.learn(FeverState.LOW, true); n.learn(FeverState.WARM, false); n.learn(FeverState.WARM, false); n.learn(FeverState.WARM, true); n.learn(FeverState.WARM, true); n.learn(FeverState.WARM, true); n.learn(FeverState.HOT, false); n.learn(FeverState.HOT, true); n.learn(FeverState.HOT, true); n.learn(FeverState.HOT, true); n.learn(FeverState.HOT, true); n.getGoal().setState(BooleanState.TRUE); final double nonePercentage = n.getPercentage(FeverState.NONE); final double lowPercentage = n.getPercentage(FeverState.LOW); final double warmPercentage = n.getPercentage(FeverState.WARM); final double hotPercentage = n.getPercentage(FeverState.HOT); final boolean condition = (nonePercentage < lowPercentage) && (lowPercentage < warmPercentage) && (warmPercentage < hotPercentage); Assert.assertTrue(STR + nonePercentage + STR + lowPercentage + STR + warmPercentage + STR + hotPercentage, condition); }
|
/**
* tests four-state boolean bayesian network, mapping "fevers' -> sickness
*/
|
tests four-state boolean bayesian network, mapping "fevers' -> sickness
|
testFeverState
|
{
"repo_name": "automenta/java_dann",
"path": "test/syncleus/dann/graphicalmodel/bayesian/TestSimpleBooleanNetwork.java",
"license": "agpl-3.0",
"size": 9696
}
|
[
"org.junit.Assert"
] |
import org.junit.Assert;
|
import org.junit.*;
|
[
"org.junit"
] |
org.junit;
| 1,130,192
|
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("/{alertId}/notifications")
@Description("Returns all notifications for the given alert ID.")
public List<NotificationDto> getAllNotifications(@Context HttpServletRequest req, @PathParam("alertId") BigInteger alertId) {
if (alertId == null || alertId.compareTo(BigInteger.ZERO) < 1) {
throw new WebApplicationException("Alert Id cannot be null and must be a positive non-zero number.", Status.BAD_REQUEST);
}
PrincipalUser owner = validateAndGetOwner(req, null);
Alert alert = alertService.findAlertByPrimaryKey(alertId);
if (alert != null) {
if(!alert.isShared()) {
validateResourceAuthorization(req, alert.getOwner(), owner);
}
return NotificationDto.transformToDto(alert.getNotifications());
}
throw new WebApplicationException(Response.Status.NOT_FOUND.getReasonPhrase(), Response.Status.NOT_FOUND);
}
|
@Produces(MediaType.APPLICATION_JSON) @Path(STR) @Description(STR) List<NotificationDto> function(@Context HttpServletRequest req, @PathParam(STR) BigInteger alertId) { if (alertId == null alertId.compareTo(BigInteger.ZERO) < 1) { throw new WebApplicationException(STR, Status.BAD_REQUEST); } PrincipalUser owner = validateAndGetOwner(req, null); Alert alert = alertService.findAlertByPrimaryKey(alertId); if (alert != null) { if(!alert.isShared()) { validateResourceAuthorization(req, alert.getOwner(), owner); } return NotificationDto.transformToDto(alert.getNotifications()); } throw new WebApplicationException(Response.Status.NOT_FOUND.getReasonPhrase(), Response.Status.NOT_FOUND); }
|
/**
* Returns the list of notifications for a given alert id.
*
* @param req The HttpServlet request object. Cannot be null.
* @param alertId The alert Id for which notifications are requested. Cannot be null and must be a positive non-zero number.
*
* @return List of notifications.
*
* @throws WebApplicationException The exception with 404 status will be thrown if an alert does not exist.
*/
|
Returns the list of notifications for a given alert id
|
getAllNotifications
|
{
"repo_name": "rajsarkapally-sfdc/Argus",
"path": "ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/AlertResources.java",
"license": "bsd-3-clause",
"size": 53696
}
|
[
"com.salesforce.dva.argus.entity.Alert",
"com.salesforce.dva.argus.entity.PrincipalUser",
"com.salesforce.dva.argus.ws.annotation.Description",
"com.salesforce.dva.argus.ws.dto.NotificationDto",
"java.math.BigInteger",
"java.util.List",
"javax.servlet.http.HttpServletRequest",
"javax.ws.rs.Path",
"javax.ws.rs.PathParam",
"javax.ws.rs.Produces",
"javax.ws.rs.WebApplicationException",
"javax.ws.rs.core.Context",
"javax.ws.rs.core.MediaType",
"javax.ws.rs.core.Response"
] |
import com.salesforce.dva.argus.entity.Alert; import com.salesforce.dva.argus.entity.PrincipalUser; import com.salesforce.dva.argus.ws.annotation.Description; import com.salesforce.dva.argus.ws.dto.NotificationDto; import java.math.BigInteger; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response;
|
import com.salesforce.dva.argus.entity.*; import com.salesforce.dva.argus.ws.annotation.*; import com.salesforce.dva.argus.ws.dto.*; import java.math.*; import java.util.*; import javax.servlet.http.*; import javax.ws.rs.*; import javax.ws.rs.core.*;
|
[
"com.salesforce.dva",
"java.math",
"java.util",
"javax.servlet",
"javax.ws"
] |
com.salesforce.dva; java.math; java.util; javax.servlet; javax.ws;
| 1,584,457
|
public static BaseComponent getDefaultTargetComponent(MetaObject metaObject, File file, View viewObject)
{
BaseComponent targetComponent = new BaseComponent();
if (viewObject == null)
{
viewObject = ViewImpl.getViewImpl();//new ViewImpl();
}
targetComponent.setView(viewObject);
targetComponent.setMeta(metaObject);
targetComponent.setFile(file);
targetComponent.setType(Config.MAP_COMPONENT_TARGET_TYPE);
//todo: come up better solution on setting the type and kind value.
targetComponent.setKind(Config.HL7_V3_DEFINITION_DEFAULT_KIND);
return targetComponent;
}
//
// public static BaseComponent getDefaultFunctionComponent(MetaObject metaObject, File file, View viewObject)
// {
// BaseComponent functionComponent = new FunctionComponent();
// if (viewObject == null)
// {
// viewObject = new ViewImpl();
// }
// functionComponent.setView(viewObject);
// functionComponent.setMeta(metaObject);
// functionComponent.setFile(file);
// functionComponent.setType(Config.MAP_COMPONENT_FUNCTION_TYPE);
// return functionComponent;
// }
}
/**
* HISTORY : $Log: not supported by cvs2svn $
* HISTORY : Revision 1.2 2007/07/18 20:36:17 wangeug
* HISTORY : create CSV-H7L mapping with mapppingV4.0.xsd
* HISTORY :
* HISTORY : Revision 1.1 2007/05/24 15:03:30 wangeug
* HISTORY : initial loading
* HISTORY :
* HISTORY : Revision 1.14 2006/08/02 18:44:20 jiangsc
* HISTORY : License Update
* HISTORY :
* HISTORY : Revision 1.13 2006/01/03 19:16:52 jiangsc
* HISTORY : License Update
* HISTORY :
* HISTORY : Revision 1.12 2006/01/03 18:56:24 jiangsc
* HISTORY : License Update
* HISTORY :
* HISTORY : Revision 1.11 2005/12/29 23:06:13 jiangsc
* HISTORY : Changed to latest project name.
* HISTORY :
* HISTORY : Revision 1.10 2005/12/19 22:44:16 jiangsc
* HISTORY : Feature enhancement
* HISTORY :
* HISTORY : Revision 1.9 2005/09/19 20:26:52 giordanm
* HISTORY : remove references to CsvComponent and CloneComponent. I don't think we need these anymore. I have not deleted them from CVS yet. In addition, the MapParser and MapBuilder and now handle database (dbf) files.
* HISTORY :
* HISTORY : Revision 1.8 2005/08/22 21:35:26 jiangsc
* HISTORY : Changed BaseComponentFactory and other UI classes to use File instead of string name;
* HISTORY : Added first implementation of Function Constant;
* HISTORY :
* HISTORY : Revision 1.7 2005/08/22 17:32:44 giordanm
* HISTORY : change the file attribute within BaseComponent from a String to a File, this checkin also contains some refactor work to the FileUtil.
* HISTORY :
* HISTORY : Revision 1.6 2005/07/14 21:48:56 giordanm
* HISTORY : purely aesthetic stuff - license headers, class headers, javdoc comments, etc.
* HISTORY :
* HISTORY : Revision 1.5 2005/07/07 20:27:36 chene
* HISTORY : Change BaseComponenet Meta getData() to Meta getMeta
* HISTORY :
* HISTORY : Revision 1.4 2005/07/07 20:22:15 chene
* HISTORY : Change BaseComponenet Meta getData() to Meta getMeta
* HISTORY :
* HISTORY : Revision 1.3 2005/06/09 16:57:42 jiangsc
* HISTORY : Further save point.
* HISTORY :
* HISTORY : Revision 1.2 2005/06/09 15:08:36 jiangsc
* HISTORY : More functions are added.
* HISTORY :
* HISTORY : Revision 1.1 2005/06/09 15:04:40 jiangsc
* HISTORY : Facilitate creation of various component classes with some default settings, such as view class.
* HISTORY :
|
static BaseComponent function(MetaObject metaObject, File file, View viewObject) { BaseComponent targetComponent = new BaseComponent(); if (viewObject == null) { viewObject = ViewImpl.getViewImpl(); } targetComponent.setView(viewObject); targetComponent.setMeta(metaObject); targetComponent.setFile(file); targetComponent.setType(Config.MAP_COMPONENT_TARGET_TYPE); targetComponent.setKind(Config.HL7_V3_DEFINITION_DEFAULT_KIND); return targetComponent; } } /** * HISTORY : $Log: not supported by cvs2svn $ * HISTORY : Revision 1.2 2007/07/18 20:36:17 wangeug * HISTORY : create CSV-H7L mapping with mapppingV4.0.xsd * HISTORY : * HISTORY : Revision 1.1 2007/05/24 15:03:30 wangeug * HISTORY : initial loading * HISTORY : * HISTORY : Revision 1.14 2006/08/02 18:44:20 jiangsc * HISTORY : License Update * HISTORY : * HISTORY : Revision 1.13 2006/01/03 19:16:52 jiangsc * HISTORY : License Update * HISTORY : * HISTORY : Revision 1.12 2006/01/03 18:56:24 jiangsc * HISTORY : License Update * HISTORY : * HISTORY : Revision 1.11 2005/12/29 23:06:13 jiangsc * HISTORY : Changed to latest project name. * HISTORY : * HISTORY : Revision 1.10 2005/12/19 22:44:16 jiangsc * HISTORY : Feature enhancement * HISTORY : * HISTORY : Revision 1.9 2005/09/19 20:26:52 giordanm * HISTORY : remove references to CsvComponent and CloneComponent. I don't think we need these anymore. I have not deleted them from CVS yet. In addition, the MapParser and MapBuilder and now handle database (dbf) files. * HISTORY : * HISTORY : Revision 1.8 2005/08/22 21:35:26 jiangsc * HISTORY : Changed BaseComponentFactory and other UI classes to use File instead of string name; * HISTORY : Added first implementation of Function Constant; * HISTORY : * HISTORY : Revision 1.7 2005/08/22 17:32:44 giordanm * HISTORY : change the file attribute within BaseComponent from a String to a File, this checkin also contains some refactor work to the FileUtil. * HISTORY : * HISTORY : Revision 1.6 2005/07/14 21:48:56 giordanm * HISTORY : purely aesthetic stuff - license headers, class headers, javdoc comments, etc. * HISTORY : * HISTORY : Revision 1.5 2005/07/07 20:27:36 chene * HISTORY : Change BaseComponenet Meta getData() to Meta getMeta * HISTORY : * HISTORY : Revision 1.4 2005/07/07 20:22:15 chene * HISTORY : Change BaseComponenet Meta getData() to Meta getMeta * HISTORY : * HISTORY : Revision 1.3 2005/06/09 16:57:42 jiangsc * HISTORY : Further save point. * HISTORY : * HISTORY : Revision 1.2 2005/06/09 15:08:36 jiangsc * HISTORY : More functions are added. * HISTORY : * HISTORY : Revision 1.1 2005/06/09 15:04:40 jiangsc * HISTORY : Facilitate creation of various component classes with some default settings, such as view class. * HISTORY :
|
/**
* Return a constructed target component
*
* @param metaObject
* @return BaseComponent
*/
|
Return a constructed target component
|
getDefaultTargetComponent
|
{
"repo_name": "NCIP/caadapter",
"path": "software/caadapter/src/java/gov/nih/nci/caadapter/common/map/BaseComponentFactory.java",
"license": "bsd-3-clause",
"size": 5981
}
|
[
"gov.nih.nci.caadapter.common.MetaObject",
"gov.nih.nci.caadapter.common.util.Config",
"java.io.File"
] |
import gov.nih.nci.caadapter.common.MetaObject; import gov.nih.nci.caadapter.common.util.Config; import java.io.File;
|
import gov.nih.nci.caadapter.common.*; import gov.nih.nci.caadapter.common.util.*; import java.io.*;
|
[
"gov.nih.nci",
"java.io"
] |
gov.nih.nci; java.io;
| 2,755,504
|
public PipelineAggregator.Parser pipelineAggregator(String type) {
return pipelineAggregatorParsers.get(type);
}
|
PipelineAggregator.Parser function(String type) { return pipelineAggregatorParsers.get(type); }
|
/**
* Returns the parser that is registered under the given pipeline aggregator
* type.
*
* @param type
* The pipeline aggregator type
* @return The parser associated with the given pipeline aggregator type.
*/
|
Returns the parser that is registered under the given pipeline aggregator type
|
pipelineAggregator
|
{
"repo_name": "AshishThakur/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/search/aggregations/AggregatorParsers.java",
"license": "apache-2.0",
"size": 11950
}
|
[
"org.elasticsearch.search.aggregations.pipeline.PipelineAggregator"
] |
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
|
import org.elasticsearch.search.aggregations.pipeline.*;
|
[
"org.elasticsearch.search"
] |
org.elasticsearch.search;
| 1,408,774
|
@Override
public void setJavaFileInfo(JavaFileInfo javaInfo) {
javaFileInfo = javaInfo;
}
|
void function(JavaFileInfo javaInfo) { javaFileInfo = javaInfo; }
|
/**
* Sets the java file info object.
*
* @param javaInfo java file info object
*/
|
Sets the java file info object
|
setJavaFileInfo
|
{
"repo_name": "maheshraju-Huawei/actn",
"path": "utils/yangutils/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaEnumeration.java",
"license": "apache-2.0",
"size": 4348
}
|
[
"org.onosproject.yangutils.translator.tojava.JavaFileInfo"
] |
import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
|
import org.onosproject.yangutils.translator.tojava.*;
|
[
"org.onosproject.yangutils"
] |
org.onosproject.yangutils;
| 2,531,069
|
public static void dCalcVectorCross3(DVector3 a, DVector3C b, DVector3C c) {
a.set0( b.get1()*c.get2() - b.get2()*c.get1() );
a.set1( b.get2()*c.get0() - b.get0()*c.get2() );
a.set2( b.get0()*c.get1() - b.get1()*c.get0() );
}
|
static void function(DVector3 a, DVector3C b, DVector3C c) { a.set0( b.get1()*c.get2() - b.get2()*c.get1() ); a.set1( b.get2()*c.get0() - b.get0()*c.get2() ); a.set2( b.get0()*c.get1() - b.get1()*c.get0() ); }
|
/**
* Cross product, set a = b x c.
*/
|
Cross product, set a = b x c
|
dCalcVectorCross3
|
{
"repo_name": "billhj/Etoile-java",
"path": "Ode4j/src/org/ode4j/ode/OdeMath.java",
"license": "mit",
"size": 52618
}
|
[
"org.ode4j.math.DVector3",
"org.ode4j.math.DVector3C"
] |
import org.ode4j.math.DVector3; import org.ode4j.math.DVector3C;
|
import org.ode4j.math.*;
|
[
"org.ode4j.math"
] |
org.ode4j.math;
| 383,536
|
private List<String> getValuesOfGroupsFromUserAttributes(Map<ClaimMapping, String> userAttributes) {
if (MapUtils.isNotEmpty(userAttributes)) {
for (Map.Entry<ClaimMapping, String> entry : userAttributes.entrySet()) {
if (entry.getKey().getRemoteClaim() != null) {
if (StringUtils.equals(entry.getKey().getRemoteClaim().getClaimUri(), OAuth2Constants.GROUPS)) {
return Arrays.asList(entry.getValue().split(Pattern.quote(ATTRIBUTE_SEPARATOR)));
}
}
}
}
return null;
}
|
List<String> function(Map<ClaimMapping, String> userAttributes) { if (MapUtils.isNotEmpty(userAttributes)) { for (Map.Entry<ClaimMapping, String> entry : userAttributes.entrySet()) { if (entry.getKey().getRemoteClaim() != null) { if (StringUtils.equals(entry.getKey().getRemoteClaim().getClaimUri(), OAuth2Constants.GROUPS)) { return Arrays.asList(entry.getValue().split(Pattern.quote(ATTRIBUTE_SEPARATOR))); } } } } return null; }
|
/**
* Get groups params Roles from User attributes.
*
* @param userAttributes User Attributes
* @return User attribute map
*/
|
Get groups params Roles from User attributes
|
getValuesOfGroupsFromUserAttributes
|
{
"repo_name": "wso2-extensions/identity-inbound-auth-oauth",
"path": "components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth2/validators/JDBCScopeValidator.java",
"license": "apache-2.0",
"size": 21169
}
|
[
"java.util.Arrays",
"java.util.List",
"java.util.Map",
"java.util.regex.Pattern",
"org.apache.commons.collections.MapUtils",
"org.apache.commons.lang.StringUtils",
"org.wso2.carbon.identity.application.common.model.ClaimMapping",
"org.wso2.carbon.identity.oauth2.OAuth2Constants"
] |
import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.regex.Pattern; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang.StringUtils; import org.wso2.carbon.identity.application.common.model.ClaimMapping; import org.wso2.carbon.identity.oauth2.OAuth2Constants;
|
import java.util.*; import java.util.regex.*; import org.apache.commons.collections.*; import org.apache.commons.lang.*; import org.wso2.carbon.identity.application.common.model.*; import org.wso2.carbon.identity.oauth2.*;
|
[
"java.util",
"org.apache.commons",
"org.wso2.carbon"
] |
java.util; org.apache.commons; org.wso2.carbon;
| 631,456
|
public ResultSetFuture executeAsyncSelect (
Object postid) throws Exception {
return
this.getQuery(kSelectName).executeAsync(
postid);
}
|
ResultSetFuture function ( Object postid) throws Exception { return this.getQuery(kSelectName).executeAsync( postid); }
|
/**
* executeAsyncSelect
* executes Select Query asynchronously
* @param postid
* @return ResultSetFuture
* @throws Exception
*/
|
executeAsyncSelect executes Select Query asynchronously
|
executeAsyncSelect
|
{
"repo_name": "vangav/vos_instagram",
"path": "app/com/vangav/vos_instagram/cassandra_keyspaces/ig_app_data/PostLikesCount.java",
"license": "mit",
"size": 12456
}
|
[
"com.datastax.driver.core.ResultSetFuture"
] |
import com.datastax.driver.core.ResultSetFuture;
|
import com.datastax.driver.core.*;
|
[
"com.datastax.driver"
] |
com.datastax.driver;
| 2,227,833
|
private static List<Dependency> consecutiveTestDeps( List<Dependency> dependencies )
{
List<Dependency> testDependencies = new ArrayList<Dependency>();
for ( Dependency dependency : sortByLineNumberDescending( dependencies ) )
{
if ( Artifact.SCOPE_TEST.equals( dependency.getScope() ) )
{
testDependencies.add( dependency );
}
else
{
break;
}
}
return testDependencies;
}
|
static List<Dependency> function( List<Dependency> dependencies ) { List<Dependency> testDependencies = new ArrayList<Dependency>(); for ( Dependency dependency : sortByLineNumberDescending( dependencies ) ) { if ( Artifact.SCOPE_TEST.equals( dependency.getScope() ) ) { testDependencies.add( dependency ); } else { break; } } return testDependencies; }
|
/**
* Returns continuous sequence of test deps from the end of the pom, stops as soon
* as it hits a non-test dep
*/
|
Returns continuous sequence of test deps from the end of the pom, stops as soon as it hits a non-test dep
|
consecutiveTestDeps
|
{
"repo_name": "HubSpot/maven-plugins",
"path": "maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/analyze/FixMojo.java",
"license": "apache-2.0",
"size": 16793
}
|
[
"java.util.ArrayList",
"java.util.List",
"org.apache.maven.artifact.Artifact",
"org.apache.maven.model.Dependency"
] |
import java.util.ArrayList; import java.util.List; import org.apache.maven.artifact.Artifact; import org.apache.maven.model.Dependency;
|
import java.util.*; import org.apache.maven.artifact.*; import org.apache.maven.model.*;
|
[
"java.util",
"org.apache.maven"
] |
java.util; org.apache.maven;
| 769,375
|
public void testIgnoreResourceDiff() throws Exception {
Processor processor = new Processor();
DiffPluginImpl differ = new DiffPluginImpl();
differ.setIgnore("b/b");
Baseline baseline = new Baseline(processor, differ);
Builder a = new Builder();
a.setProperty("-includeresource", "a/a;literal='aa',b/b;literal='bb'");
a.setProperty("-resourceonly", "true");
Jar aj = a.build();
Builder b = new Builder();
b.setProperty("-includeresource", "a/a;literal='aa',b/b;literal='bbb'");
b.setProperty("-resourceonly", "true");
Jar bj = b.build();
Set<Info> infoSet = baseline.baseline(aj, bj, null);
BundleInfo binfo = baseline.getBundleInfo();
assertFalse(binfo.mismatch);
a.close();
b.close();
}
|
void function() throws Exception { Processor processor = new Processor(); DiffPluginImpl differ = new DiffPluginImpl(); differ.setIgnore("b/b"); Baseline baseline = new Baseline(processor, differ); Builder a = new Builder(); a.setProperty(STR, STR); a.setProperty(STR, "true"); Jar aj = a.build(); Builder b = new Builder(); b.setProperty(STR, STR); b.setProperty(STR, "true"); Jar bj = b.build(); Set<Info> infoSet = baseline.baseline(aj, bj, null); BundleInfo binfo = baseline.getBundleInfo(); assertFalse(binfo.mismatch); a.close(); b.close(); }
|
/**
* Check if we can ignore resources in the baseline. First build two jars
* that are identical except for the b/b resource. Then do baseline on them.
*/
|
Check if we can ignore resources in the baseline. First build two jars that are identical except for the b/b resource. Then do baseline on them
|
testIgnoreResourceDiff
|
{
"repo_name": "GEBIT/bnd",
"path": "biz.aQute.bndlib.tests/src/test/baseline/BaselineTest.java",
"license": "apache-2.0",
"size": 14804
}
|
[
"java.util.Set"
] |
import java.util.Set;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,364,138
|
public static Identity group(String email) {
return new Identity(Type.GROUP, checkNotNull(email));
}
|
static Identity function(String email) { return new Identity(Type.GROUP, checkNotNull(email)); }
|
/**
* Returns a new group identity.
*
* @param email An email address that represents a Google group. For example,
* <I>admins@example.com</I>.
*/
|
Returns a new group identity
|
group
|
{
"repo_name": "jabubake/google-cloud-java",
"path": "google-cloud-core/src/main/java/com/google/cloud/Identity.java",
"license": "apache-2.0",
"size": 6869
}
|
[
"com.google.common.base.Preconditions"
] |
import com.google.common.base.Preconditions;
|
import com.google.common.base.*;
|
[
"com.google.common"
] |
com.google.common;
| 2,452,053
|
public Boolean isValid(ReservationDateException resExcept, BindingResult result) {
if (resExcept.getdescription() == null) {
String msg = messageSource.getMessage("reservationDateException.descriptionNotValid", new Object[]{},
LocaleContextHolder.getLocale());
result.addError(new FieldError(result.getObjectName(), "description",
resExcept.getdescription(), false,
null, null, msg));
return false;
}
else if (resExcept.getStartDate() == null) {
String msg = messageSource.getMessage("reservationDateException.startDateNotValid", new Object[]{},
LocaleContextHolder.getLocale());
result.addError(new FieldError(result.getObjectName(), "startDate",
resExcept.getStartDate(), false,
null, null, msg));
return false;
}
else if (exceptionDateExists(resExcept, result)) {
return false;
}
else return !isEndDateBeforeBeginDate(resExcept, result);
}
|
Boolean function(ReservationDateException resExcept, BindingResult result) { if (resExcept.getdescription() == null) { String msg = messageSource.getMessage(STR, new Object[]{}, LocaleContextHolder.getLocale()); result.addError(new FieldError(result.getObjectName(), STR, resExcept.getdescription(), false, null, null, msg)); return false; } else if (resExcept.getStartDate() == null) { String msg = messageSource.getMessage(STR, new Object[]{}, LocaleContextHolder.getLocale()); result.addError(new FieldError(result.getObjectName(), STR, resExcept.getStartDate(), false, null, null, msg)); return false; } else if (exceptionDateExists(resExcept, result)) { return false; } else return !isEndDateBeforeBeginDate(resExcept, result); }
|
/**
* Checks whether the given ReservationDateException is valid. This by checking the description
* and/or the start date not being null.
*
* @param resExcept The given ReservationDateException to check.
* @param result The result of the check.
* @return A boolean value representing whether the ReservationDateException is valid.
*/
|
Checks whether the given ReservationDateException is valid. This by checking the description and/or the start date not being null
|
isValid
|
{
"repo_name": "IISH/delivery",
"path": "src/main/java/org/socialhistoryservices/delivery/reservation/service/ReservationDateExceptionServiceImpl.java",
"license": "gpl-3.0",
"size": 10011
}
|
[
"org.socialhistoryservices.delivery.reservation.entity.ReservationDateException",
"org.springframework.context.i18n.LocaleContextHolder",
"org.springframework.validation.BindingResult",
"org.springframework.validation.FieldError"
] |
import org.socialhistoryservices.delivery.reservation.entity.ReservationDateException; import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.validation.BindingResult; import org.springframework.validation.FieldError;
|
import org.socialhistoryservices.delivery.reservation.entity.*; import org.springframework.context.i18n.*; import org.springframework.validation.*;
|
[
"org.socialhistoryservices.delivery",
"org.springframework.context",
"org.springframework.validation"
] |
org.socialhistoryservices.delivery; org.springframework.context; org.springframework.validation;
| 2,023,855
|
public static void denyLastRequestedPermissions() {
if (permissions == null) {
return;
}
int[] result = new int[permissions.length];
for (int i = 0; i < result.length; i++) {
result[i] = PackageManager.PERMISSION_DENIED;
}
activity.onRequestPermissionsResult(requestCode, permissions, result);
}
|
static void function() { if (permissions == null) { return; } int[] result = new int[permissions.length]; for (int i = 0; i < result.length; i++) { result[i] = PackageManager.PERMISSION_DENIED; } activity.onRequestPermissionsResult(requestCode, permissions, result); }
|
/**
* Denies the last set of permissions requested by the app.
*/
|
Denies the last set of permissions requested by the app
|
denyLastRequestedPermissions
|
{
"repo_name": "jisqyv/appinventor-sources",
"path": "appinventor/components/tests/com/google/appinventor/components/runtime/shadows/ShadowActivityCompat.java",
"license": "apache-2.0",
"size": 1993
}
|
[
"android.content.pm.PackageManager"
] |
import android.content.pm.PackageManager;
|
import android.content.pm.*;
|
[
"android.content"
] |
android.content;
| 803,619
|
public static void createNetworkInterface(com.azure.resourcemanager.AzureResourceManager azure) {
azure
.networks()
.manager()
.serviceClient()
.getNetworkInterfaces()
.createOrUpdate(
"rg1",
"test-nic",
new NetworkInterfaceInner()
.withLocation("eastus")
.withIpConfigurations(
Arrays
.asList(
new NetworkInterfaceIpConfigurationInner()
.withName("ipconfig1")
.withSubnet(
new SubnetInner()
.withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"))
.withPublicIpAddress(
new PublicIpAddressInner()
.withId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"))))
.withEnableAcceleratedNetworking(true),
Context.NONE);
}
|
static void function(com.azure.resourcemanager.AzureResourceManager azure) { azure .networks() .manager() .serviceClient() .getNetworkInterfaces() .createOrUpdate( "rg1", STR, new NetworkInterfaceInner() .withLocation(STR) .withIpConfigurations( Arrays .asList( new NetworkInterfaceIpConfigurationInner() .withName(STR) .withSubnet( new SubnetInner() .withId( STR)) .withPublicIpAddress( new PublicIpAddressInner() .withId( STR)))) .withEnableAcceleratedNetworking(true), Context.NONE); }
|
/**
* Sample code: Create network interface.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
|
Sample code: Create network interface
|
createNetworkInterface
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/NetworkInterfacesCreateOrUpdateSamples.java",
"license": "mit",
"size": 4611
}
|
[
"com.azure.core.util.Context",
"com.azure.resourcemanager.network.fluent.models.NetworkInterfaceInner",
"com.azure.resourcemanager.network.fluent.models.NetworkInterfaceIpConfigurationInner",
"com.azure.resourcemanager.network.fluent.models.PublicIpAddressInner",
"com.azure.resourcemanager.network.fluent.models.SubnetInner",
"java.util.Arrays"
] |
import com.azure.core.util.Context; import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceInner; import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceIpConfigurationInner; import com.azure.resourcemanager.network.fluent.models.PublicIpAddressInner; import com.azure.resourcemanager.network.fluent.models.SubnetInner; import java.util.Arrays;
|
import com.azure.core.util.*; import com.azure.resourcemanager.network.fluent.models.*; import java.util.*;
|
[
"com.azure.core",
"com.azure.resourcemanager",
"java.util"
] |
com.azure.core; com.azure.resourcemanager; java.util;
| 480,159
|
PortEntity updateInputPort(Revision revision, PortDTO inputPortDTO);
|
PortEntity updateInputPort(Revision revision, PortDTO inputPortDTO);
|
/**
* Updates the specified input port.
*
* @param revision Revision to compare with current base revision
* @param inputPortDTO The input PortDTO
* @return snapshot
*/
|
Updates the specified input port
|
updateInputPort
|
{
"repo_name": "mans2singh/nifi",
"path": "nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiServiceFacade.java",
"license": "apache-2.0",
"size": 84641
}
|
[
"org.apache.nifi.web.api.dto.PortDTO",
"org.apache.nifi.web.api.entity.PortEntity"
] |
import org.apache.nifi.web.api.dto.PortDTO; import org.apache.nifi.web.api.entity.PortEntity;
|
import org.apache.nifi.web.api.dto.*; import org.apache.nifi.web.api.entity.*;
|
[
"org.apache.nifi"
] |
org.apache.nifi;
| 1,377,078
|
new AlertDialog.Builder(activity)
.setTitle(title)
.setMessage(message)
.setCancelable(false)
.setPositiveButton(activity.getString(android.R.string.ok), listener)
.show();
}
|
new AlertDialog.Builder(activity) .setTitle(title) .setMessage(message) .setCancelable(false) .setPositiveButton(activity.getString(android.R.string.ok), listener) .show(); }
|
/**
* Pops an AlertDialog that quits the app on OK.
*/
|
Pops an AlertDialog that quits the app on OK
|
showAlertDialog
|
{
"repo_name": "LNSD/Citykey",
"path": "app/src/main/java/es/lnsd/citikey/util/AlertDialogHelper.java",
"license": "mit",
"size": 1080
}
|
[
"android.app.AlertDialog"
] |
import android.app.AlertDialog;
|
import android.app.*;
|
[
"android.app"
] |
android.app;
| 501,196
|
protected void handleNotAuthorized(HttpServletRequest request, HttpServletResponse response, Object handler)
throws ServletException, IOException {
response.sendError(HttpServletResponse.SC_FORBIDDEN);
}
|
void function(HttpServletRequest request, HttpServletResponse response, Object handler) throws ServletException, IOException { response.sendError(HttpServletResponse.SC_FORBIDDEN); }
|
/**
* Handle a request that is not authorized according to this interceptor.
* Default implementation sends HTTP status code 403 ("forbidden").
* <p>This method can be overridden to write a custom message, forward or
* redirect to some error page or login page, or throw a ServletException.
* @param request current HTTP request
* @param response current HTTP response
* @param handler chosen handler to execute, for type and/or instance evaluation
* @throws javax.servlet.ServletException if there is an internal error
* @throws java.io.IOException in case of an I/O error when writing the response
*/
|
Handle a request that is not authorized according to this interceptor. Default implementation sends HTTP status code 403 ("forbidden"). This method can be overridden to write a custom message, forward or redirect to some error page or login page, or throw a ServletException
|
handleNotAuthorized
|
{
"repo_name": "dachengxi/spring1.1.1_source",
"path": "src/org/springframework/web/servlet/handler/UserRoleAuthorizationInterceptor.java",
"license": "mit",
"size": 2701
}
|
[
"java.io.IOException",
"javax.servlet.ServletException",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse"
] |
import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
|
import java.io.*; import javax.servlet.*; import javax.servlet.http.*;
|
[
"java.io",
"javax.servlet"
] |
java.io; javax.servlet;
| 331,176
|
public void stop() {
log.info("Stopping OSPF Controller...!!!");
for (ChannelGroup cg : cgList) {
cg.close();
}
for (NioServerSocketChannelFactory execFactory : execFactoryLst) {
execFactory.shutdown();
}
processes.clear();
}
|
void function() { log.info(STR); for (ChannelGroup cg : cgList) { cg.close(); } for (NioServerSocketChannelFactory execFactory : execFactoryLst) { execFactory.shutdown(); } processes.clear(); }
|
/**
* Stops the Controller.
*/
|
Stops the Controller
|
stop
|
{
"repo_name": "Phaneendra-Huawei/demo",
"path": "protocols/ospf/ctl/src/main/java/org/onosproject/ospf/controller/impl/Controller.java",
"license": "apache-2.0",
"size": 33295
}
|
[
"org.jboss.netty.channel.group.ChannelGroup",
"org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory"
] |
import org.jboss.netty.channel.group.ChannelGroup; import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
|
import org.jboss.netty.channel.group.*; import org.jboss.netty.channel.socket.nio.*;
|
[
"org.jboss.netty"
] |
org.jboss.netty;
| 2,447,596
|
public InputStream getBinaryStream() throws SQLException {
return this.blob.getBinaryStream();
}
|
InputStream function() throws SQLException { return this.blob.getBinaryStream(); }
|
/**
* Retrieves the <code>BLOB</code> value designated by this
* <code>Blob</code> instance as a stream.
*
* @return a stream containing the <code>BLOB</code> data
* @exception SQLException
* if there is an error accessing the <code>BLOB</code> value
* @see #setBinaryStream
* @since 1.2
*/
|
Retrieves the <code>BLOB</code> value designated by this <code>Blob</code> instance as a stream
|
getBinaryStream
|
{
"repo_name": "abecquereau/awake-file",
"path": "src-main/org/kawanfw/commons/jdbc/abstracts/AbstractBlob.java",
"license": "lgpl-2.1",
"size": 11580
}
|
[
"java.io.InputStream",
"java.sql.SQLException"
] |
import java.io.InputStream; import java.sql.SQLException;
|
import java.io.*; import java.sql.*;
|
[
"java.io",
"java.sql"
] |
java.io; java.sql;
| 850,699
|
public static Timestamp generateTimestamp() {
java.sql.Timestamp now = new java.sql.Timestamp( System.currentTimeMillis());
return now;
}
|
static Timestamp function() { java.sql.Timestamp now = new java.sql.Timestamp( System.currentTimeMillis()); return now; }
|
/**
* Generate timestamp.
* @return timestamp
*/
|
Generate timestamp
|
generateTimestamp
|
{
"repo_name": "chrisekelley/zeprs",
"path": "src/zeprs/org/cidrz/webapp/dynasite/utils/DateUtils.java",
"license": "apache-2.0",
"size": 13126
}
|
[
"java.sql.Timestamp"
] |
import java.sql.Timestamp;
|
import java.sql.*;
|
[
"java.sql"
] |
java.sql;
| 1,458,955
|
public void mouseReleased(MouseEvent e) {
synchronized (mouseLock) {
mousePressed = false;
}
}
|
void function(MouseEvent e) { synchronized (mouseLock) { mousePressed = false; } }
|
/**
* This method cannot be called directly.
*/
|
This method cannot be called directly
|
mouseReleased
|
{
"repo_name": "hosny1993/vogella",
"path": "de.vogella.algorithms.riddles/src/edu/princeton/draw/StdDraw.java",
"license": "epl-1.0",
"size": 32148
}
|
[
"java.awt.event.MouseEvent"
] |
import java.awt.event.MouseEvent;
|
import java.awt.event.*;
|
[
"java.awt"
] |
java.awt;
| 2,831,009
|
public void addChild(Container child) {
Context context = (Context) child;
String contextPath = context.getPath();
if (contextPath == null)
throw new IllegalArgumentException
(sm.getString("standardHost.pathRequired"));
else if (!contextPath.equals("") && !contextPath.startsWith("/"))
throw new IllegalArgumentException
(sm.getString("standardHost.pathFormat", contextPath));
if (host.findChild(contextPath) != null)
throw new IllegalStateException
(sm.getString("standardHost.pathUsed", contextPath));
if (this.overrideDocBase != null)
context.setDocBase(this.overrideDocBase);
if (this.overrideConfigFile != null)
context.setConfigFile(this.overrideConfigFile);
host.fireContainerEvent(PRE_INSTALL_EVENT, context);
host.addChild(child);
host.fireContainerEvent(INSTALL_EVENT, context);
}
|
void function(Container child) { Context context = (Context) child; String contextPath = context.getPath(); if (contextPath == null) throw new IllegalArgumentException (sm.getString(STR)); else if (!contextPath.equals(STR/STRstandardHost.pathFormatSTRstandardHost.pathUsed", contextPath)); if (this.overrideDocBase != null) context.setDocBase(this.overrideDocBase); if (this.overrideConfigFile != null) context.setConfigFile(this.overrideConfigFile); host.fireContainerEvent(PRE_INSTALL_EVENT, context); host.addChild(child); host.fireContainerEvent(INSTALL_EVENT, context); }
|
/**
* Delegate a request to add a child Context to our associated Host.
*
* @param child The child Context to be added
*/
|
Delegate a request to add a child Context to our associated Host
|
addChild
|
{
"repo_name": "devjin24/howtomcatworks",
"path": "bookrefer/jakarta-tomcat-5.0.18-src/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHostDeployer.java",
"license": "apache-2.0",
"size": 35574
}
|
[
"org.apache.catalina.Container",
"org.apache.catalina.Context"
] |
import org.apache.catalina.Container; import org.apache.catalina.Context;
|
import org.apache.catalina.*;
|
[
"org.apache.catalina"
] |
org.apache.catalina;
| 2,269,454
|
private void borrar()
{
System.out.print("Introduce edad: ");
int edad = teclado.nextInt();
HashSet<String> borrados = map.borrarMenoresDe(edad);
System.out.println("\nBorrados los jugadores de edad menor a " + edad);
System.out.println(borrados.toString());
teclado.nextLine();
}
|
void function() { System.out.print(STR); int edad = teclado.nextInt(); HashSet<String> borrados = map.borrarMenoresDe(edad); System.out.println(STR + edad); System.out.println(borrados.toString()); teclado.nextLine(); }
|
/**
* borra los jugadores de edad menor que la indicada
*/
|
borra los jugadores de edad menor que la indicada
|
borrar
|
{
"repo_name": "djgonza/Programacion",
"path": "UT6/UT6 Entrega 1 Map Equipos Baloncesto AL 15-16/pkgequipo/interfaz/IUConsola.java",
"license": "mit",
"size": 4764
}
|
[
"java.util.HashSet"
] |
import java.util.HashSet;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,728,920
|
@Test
public void testMessageParameters() {
MessageMap testMap = new MessageMap();
testMap.putError("accountNbr", RiceKeyConstants.ERROR_INACTIVE, "Account Number");
testMap.putError("accountNbr", RiceKeyConstants.ERROR_REQUIRED, "Account Number");
// check duplicate message doesn't get added
testMap.putError("accountNbr", RiceKeyConstants.ERROR_INACTIVE, "Account Number");
testMap.putError("chartCode", RiceKeyConstants.ERROR_REQUIRED, "Chart Code");
assertEquals(3, testMap.getErrorCount());
AutoPopulatingList errorMessages = testMap.getMessages("accountNbr");
assertEquals(2, errorMessages.size());
checkMessageParemeters(errorMessages, 0, RiceKeyConstants.ERROR_INACTIVE, new String[]{"Account Number"});
checkMessageParemeters(errorMessages, 1, RiceKeyConstants.ERROR_REQUIRED, new String[]{"Account Number"});
errorMessages = testMap.getMessages("chartCode");
assertEquals(1, errorMessages.size());
checkMessageParemeters(errorMessages, 0, RiceKeyConstants.ERROR_REQUIRED, new String[]{"Chart Code"});
}
|
void function() { MessageMap testMap = new MessageMap(); testMap.putError(STR, RiceKeyConstants.ERROR_INACTIVE, STR); testMap.putError(STR, RiceKeyConstants.ERROR_REQUIRED, STR); testMap.putError(STR, RiceKeyConstants.ERROR_INACTIVE, STR); testMap.putError(STR, RiceKeyConstants.ERROR_REQUIRED, STR); assertEquals(3, testMap.getErrorCount()); AutoPopulatingList errorMessages = testMap.getMessages(STR); assertEquals(2, errorMessages.size()); checkMessageParemeters(errorMessages, 0, RiceKeyConstants.ERROR_INACTIVE, new String[]{STR}); checkMessageParemeters(errorMessages, 1, RiceKeyConstants.ERROR_REQUIRED, new String[]{STR}); errorMessages = testMap.getMessages(STR); assertEquals(1, errorMessages.size()); checkMessageParemeters(errorMessages, 0, RiceKeyConstants.ERROR_REQUIRED, new String[]{STR}); }
|
/**
* Test message parameters are being correctly added and associated with an error message.
*/
|
Test message parameters are being correctly added and associated with an error message
|
testMessageParameters
|
{
"repo_name": "quikkian-ua-devops/will-financials",
"path": "kfs-kns/src/test/java/org/kuali/kfs/krad/util/MessageMapTest.java",
"license": "agpl-3.0",
"size": 16818
}
|
[
"org.junit.Assert",
"org.kuali.rice.core.api.util.RiceKeyConstants",
"org.springframework.util.AutoPopulatingList"
] |
import org.junit.Assert; import org.kuali.rice.core.api.util.RiceKeyConstants; import org.springframework.util.AutoPopulatingList;
|
import org.junit.*; import org.kuali.rice.core.api.util.*; import org.springframework.util.*;
|
[
"org.junit",
"org.kuali.rice",
"org.springframework.util"
] |
org.junit; org.kuali.rice; org.springframework.util;
| 250,205
|
LineNumberReader in=new LineNumberReader(new FileReader(file));
String line;
while((line=in.readLine())!=null){
String[] words=line.trim().split("\\s+");
if(words.length!=2)
badLine(line,in);
int n=0;
try{
n=Integer.parseInt(words[0]);
}catch(NumberFormatException e){
badLine(line,in);
}
total+=n;
freq.put(words[1],getDouble(n));
}
in.close();
}
|
LineNumberReader in=new LineNumberReader(new FileReader(file)); String line; while((line=in.readLine())!=null){ String[] words=line.trim().split("\\s+"); if(words.length!=2) badLine(line,in); int n=0; try{ n=Integer.parseInt(words[0]); }catch(NumberFormatException e){ badLine(line,in); } total+=n; freq.put(words[1],getDouble(n)); } in.close(); }
|
/** Load a file where each line contains a <count,word> pair.
*/
|
Load a file where each line contains a pair
|
load
|
{
"repo_name": "TeamCohen/MinorThird",
"path": "src/main/java/edu/cmu/minorthird/text/model/UnigramModel.java",
"license": "bsd-3-clause",
"size": 4157
}
|
[
"java.io.FileReader",
"java.io.LineNumberReader"
] |
import java.io.FileReader; import java.io.LineNumberReader;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 704,886
|
@ServiceMethod(returns = ReturnType.SINGLE)
public SyncPoller<PollResult<GatewayRouteListResultInner>, GatewayRouteListResultInner> beginGetAdvertisedRoutes(
String resourceGroupName, String virtualNetworkGatewayName, String peer) {
return beginGetAdvertisedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, peer).getSyncPoller();
}
|
@ServiceMethod(returns = ReturnType.SINGLE) SyncPoller<PollResult<GatewayRouteListResultInner>, GatewayRouteListResultInner> function( String resourceGroupName, String virtualNetworkGatewayName, String peer) { return beginGetAdvertisedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, peer).getSyncPoller(); }
|
/**
* This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer.
*
* @param resourceGroupName The name of the resource group.
* @param virtualNetworkGatewayName The name of the virtual network gateway.
* @param peer The IP address of the peer.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return list of virtual network gateway routes.
*/
|
This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer
|
beginGetAdvertisedRoutes
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkGatewaysClientImpl.java",
"license": "mit",
"size": 322151
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.management.polling.PollResult",
"com.azure.core.util.polling.SyncPoller",
"com.azure.resourcemanager.network.fluent.models.GatewayRouteListResultInner"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.management.polling.PollResult; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.network.fluent.models.GatewayRouteListResultInner;
|
import com.azure.core.annotation.*; import com.azure.core.management.polling.*; import com.azure.core.util.polling.*; import com.azure.resourcemanager.network.fluent.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 2,797,378
|
logger.log(Level.FINE, logPrefix+"setting result on Future");
if (result == null) {
logger.log(Level.WARNING, logPrefix+"Setting null result - Future will not terminate!");
}
synchronized (syncObj) {
if (this.result != null) {
logger.log(Level.WARNING, logPrefix+"Result was already set - any but first Result may be used, previous Results may be lost!");
}
this.result = result;
syncObj.notifyAll();
}
}
|
logger.log(Level.FINE, logPrefix+STR); if (result == null) { logger.log(Level.WARNING, logPrefix+STR); } synchronized (syncObj) { if (this.result != null) { logger.log(Level.WARNING, logPrefix+STR); } this.result = result; syncObj.notifyAll(); } }
|
/**
* Sets result and notifies observers. Result should only be set once.
* If multiple results are being set, it is not safe to assume which one
* may be used by calling code.
* @param result result to store
*/
|
Sets result and notifies observers. Result should only be set once. If multiple results are being set, it is not safe to assume which one may be used by calling code
|
setResult
|
{
"repo_name": "glutrot/amqp-process-manager",
"path": "src/main/java/de/glutrot/tools/amqpprocessmanager/ProcessCommunicator.java",
"license": "mit",
"size": 16691
}
|
[
"java.util.logging.Level"
] |
import java.util.logging.Level;
|
import java.util.logging.*;
|
[
"java.util"
] |
java.util;
| 1,884,968
|
public static java.lang.Object unmarshal(java.io.Reader reader)
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
return (org.gridsphere.portletcontainer.impl.descriptor.CustomWindowStateType) Unmarshaller.unmarshal(org.gridsphere.portletcontainer.impl.descriptor.CustomWindowStateType.class, reader);
} //-- java.lang.Object unmarshal(java.io.Reader)
|
static java.lang.Object function(java.io.Reader reader) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (org.gridsphere.portletcontainer.impl.descriptor.CustomWindowStateType) Unmarshaller.unmarshal(org.gridsphere.portletcontainer.impl.descriptor.CustomWindowStateType.class, reader); }
|
/**
* Method unmarshal
*
* @param reader
*/
|
Method unmarshal
|
unmarshal
|
{
"repo_name": "brandt/GridSphere",
"path": "src/org/gridsphere/portletcontainer/impl/descriptor/CustomWindowStateType.java",
"license": "apache-2.0",
"size": 8228
}
|
[
"org.exolab.castor.xml.Unmarshaller"
] |
import org.exolab.castor.xml.Unmarshaller;
|
import org.exolab.castor.xml.*;
|
[
"org.exolab.castor"
] |
org.exolab.castor;
| 1,944,858
|
public static String getRegistrationId(Context context) {
final SharedPreferences prefs = getGcmPreferences(context);
String registrationId = prefs.getString(PROPERTY_REG_ID, "");
if (registrationId.isEmpty()) {
Log.i(TAG, "Registration not found.");
return "";
}
// Check if app was updated; if so, it must clear the registration ID
// since the existing regID is not guaranteed to work with the new
// app version.
int registeredVersion = prefs.getInt(PROPERTY_APP_VERSION, Integer.MIN_VALUE);
int currentVersion = getAppVersion(context);
if (registeredVersion != currentVersion) {
Log.i(TAG, "App version changed.");
return "";
}
return registrationId;
}
|
static String function(Context context) { final SharedPreferences prefs = getGcmPreferences(context); String registrationId = prefs.getString(PROPERTY_REG_ID, STRRegistration not found.STRSTRApp version changed.STR"; } return registrationId; }
|
/**
* Gets the current registration ID for application on GCM service, if there is one.
* <p>
* If result is empty, the app needs to register.
*
* @return registration ID, or empty string if there is no existing
* registration ID.
*/
|
Gets the current registration ID for application on GCM service, if there is one. If result is empty, the app needs to register
|
getRegistrationId
|
{
"repo_name": "natuan241/easygcm",
"path": "easygcm/src/main/java/eu/inloop/easygcm/GcmHelper.java",
"license": "apache-2.0",
"size": 7516
}
|
[
"android.content.Context",
"android.content.SharedPreferences"
] |
import android.content.Context; import android.content.SharedPreferences;
|
import android.content.*;
|
[
"android.content"
] |
android.content;
| 1,420,494
|
protected final List<HttpMessageWriter<?>> getMessageWriters() {
if (this.messageWriters == null) {
this.messageWriters = new ArrayList<>();
configureMessageWriters(this.messageWriters);
if (this.messageWriters.isEmpty()) {
addDefaultHttpMessageWriters(this.messageWriters);
}
extendMessageWriters(this.messageWriters);
}
return this.messageWriters;
}
|
final List<HttpMessageWriter<?>> function() { if (this.messageWriters == null) { this.messageWriters = new ArrayList<>(); configureMessageWriters(this.messageWriters); if (this.messageWriters.isEmpty()) { addDefaultHttpMessageWriters(this.messageWriters); } extendMessageWriters(this.messageWriters); } return this.messageWriters; }
|
/**
* Main method to access message writers to use for encoding return values.
* <p>Use {@link #configureMessageWriters(List)} to configure the list or
* {@link #extendMessageWriters(List)} to add in addition to the default ones.
*/
|
Main method to access message writers to use for encoding return values. Use <code>#configureMessageWriters(List)</code> to configure the list or <code>#extendMessageWriters(List)</code> to add in addition to the default ones
|
getMessageWriters
|
{
"repo_name": "boggad/jdk9-sample",
"path": "sample-catalog/spring-jdk9/src/spring.web.reactive/org/springframework/web/reactive/config/WebReactiveConfigurationSupport.java",
"license": "mit",
"size": 19293
}
|
[
"java.util.ArrayList",
"java.util.List",
"org.springframework.http.codec.HttpMessageWriter"
] |
import java.util.ArrayList; import java.util.List; import org.springframework.http.codec.HttpMessageWriter;
|
import java.util.*; import org.springframework.http.codec.*;
|
[
"java.util",
"org.springframework.http"
] |
java.util; org.springframework.http;
| 529,782
|
public static ResultSet queryAllMetadata(Connection conn, String qSourceTableName,
String qTargetTableName, long scrutinyTimeMillis) throws SQLException {
PTable pMetadata = PhoenixRuntime.getTable(conn, OUTPUT_METADATA_TABLE_NAME);
List<String> metadataCols = SchemaUtil.getColumnNames(pMetadata.getColumns());
return queryMetadata(conn, metadataCols, qSourceTableName, qTargetTableName,
scrutinyTimeMillis);
}
|
static ResultSet function(Connection conn, String qSourceTableName, String qTargetTableName, long scrutinyTimeMillis) throws SQLException { PTable pMetadata = PhoenixRuntime.getTable(conn, OUTPUT_METADATA_TABLE_NAME); List<String> metadataCols = SchemaUtil.getColumnNames(pMetadata.getColumns()); return queryMetadata(conn, metadataCols, qSourceTableName, qTargetTableName, scrutinyTimeMillis); }
|
/**
* Query the metadata table for all columns
* @param conn connection to use
* @param qSourceTableName source table full name
* @param qTargetTableName target table full name
* @param scrutinyTimeMillis time when scrutiny was run
* @return
* @throws SQLException
*/
|
Query the metadata table for all columns
|
queryAllMetadata
|
{
"repo_name": "ankitsinghal/phoenix",
"path": "phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexScrutinyTableOutput.java",
"license": "apache-2.0",
"size": 20096
}
|
[
"java.sql.Connection",
"java.sql.ResultSet",
"java.sql.SQLException",
"java.util.List",
"org.apache.phoenix.schema.PTable",
"org.apache.phoenix.util.PhoenixRuntime",
"org.apache.phoenix.util.SchemaUtil"
] |
import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.util.List; import org.apache.phoenix.schema.PTable; import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.SchemaUtil;
|
import java.sql.*; import java.util.*; import org.apache.phoenix.schema.*; import org.apache.phoenix.util.*;
|
[
"java.sql",
"java.util",
"org.apache.phoenix"
] |
java.sql; java.util; org.apache.phoenix;
| 855,141
|
private String findAndReplace(String value) {
String result = null;
if (this.regex) {
Matcher matcher = this.pattern.matcher(value);
result = matcher.replaceAll(this.replacement);
} else {
result = value.replace(this.findPattern, this.replacement);
}
if (!value.equals(result)) {
this.matches++;
return result;
} else {
return null;
}
}
|
String function(String value) { String result = null; if (this.regex) { Matcher matcher = this.pattern.matcher(value); result = matcher.replaceAll(this.replacement); } else { result = value.replace(this.findPattern, this.replacement); } if (!value.equals(result)) { this.matches++; return result; } else { return null; } }
|
/**
* Return a new String with replaced values or null, if no matches were found.
*
* @param value
* @return
*/
|
Return a new String with replaced values or null, if no matches were found
|
findAndReplace
|
{
"repo_name": "NABUCCO/org.nabucco.testautomation.script",
"path": "org.nabucco.testautomation.script.facade.datatype/src/main/man/org/nabucco/testautomation/script/facade/datatype/visitor/FindAndReplaceMetadataVisitor.java",
"license": "epl-1.0",
"size": 4398
}
|
[
"java.util.regex.Matcher"
] |
import java.util.regex.Matcher;
|
import java.util.regex.*;
|
[
"java.util"
] |
java.util;
| 245,264
|
public Map<String, IntVar> getSetRelationVariables() {
return this.setRelationVariables;
}
|
Map<String, IntVar> function() { return this.setRelationVariables; }
|
/**
* Returns the collection of set relation variables currently in the reasoner.
*
* @return The set relation variables in the reasoner.
*/
|
Returns the collection of set relation variables currently in the reasoner
|
getSetRelationVariables
|
{
"repo_name": "cvidalmsu/FaMA",
"path": "reasoner_choco_3/src/co/icesi/i2t/Choco3Reasoner/simple/Choco3Reasoner.java",
"license": "lgpl-3.0",
"size": 49991
}
|
[
"java.util.Map"
] |
import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,403,161
|
public IPConfiguration withPublicIPAddress(PublicIPAddressInner publicIPAddress) {
this.publicIPAddress = publicIPAddress;
return this;
}
|
IPConfiguration function(PublicIPAddressInner publicIPAddress) { this.publicIPAddress = publicIPAddress; return this; }
|
/**
* Set the reference of the public IP resource.
*
* @param publicIPAddress the publicIPAddress value to set
* @return the IPConfiguration object itself.
*/
|
Set the reference of the public IP resource
|
withPublicIPAddress
|
{
"repo_name": "navalev/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IPConfiguration.java",
"license": "mit",
"size": 6238
}
|
[
"com.microsoft.azure.management.network.v2018_06_01.implementation.PublicIPAddressInner"
] |
import com.microsoft.azure.management.network.v2018_06_01.implementation.PublicIPAddressInner;
|
import com.microsoft.azure.management.network.v2018_06_01.implementation.*;
|
[
"com.microsoft.azure"
] |
com.microsoft.azure;
| 1,515,461
|
PagedFlux<SqlEncryptionProtector> listAsync();
}
|
PagedFlux<SqlEncryptionProtector> listAsync(); }
|
/**
* Asynchronously lists Azure SQL the Encryption Protector resources.
*
* @return a representation of the deferred computation of this call
*/
|
Asynchronously lists Azure SQL the Encryption Protector resources
|
listAsync
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-sql/src/main/java/com/azure/resourcemanager/sql/models/SqlEncryptionProtectorOperations.java",
"license": "mit",
"size": 5497
}
|
[
"com.azure.core.http.rest.PagedFlux"
] |
import com.azure.core.http.rest.PagedFlux;
|
import com.azure.core.http.rest.*;
|
[
"com.azure.core"
] |
com.azure.core;
| 117,240
|
@Override
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException {
MessageDispatchNotification info = (MessageDispatchNotification) o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalCachedObject(wireFormat, info.getConsumerId(), dataOut);
looseMarshalCachedObject(wireFormat, info.getDestination(), dataOut);
looseMarshalLong(wireFormat, info.getDeliverySequenceId(), dataOut);
looseMarshalNestedObject(wireFormat, info.getMessageId(), dataOut);
}
|
void function(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { MessageDispatchNotification info = (MessageDispatchNotification) o; super.looseMarshal(wireFormat, o, dataOut); looseMarshalCachedObject(wireFormat, info.getConsumerId(), dataOut); looseMarshalCachedObject(wireFormat, info.getDestination(), dataOut); looseMarshalLong(wireFormat, info.getDeliverySequenceId(), dataOut); looseMarshalNestedObject(wireFormat, info.getMessageId(), dataOut); }
|
/**
* Write the booleans that this object uses to a BooleanStream
*/
|
Write the booleans that this object uses to a BooleanStream
|
looseMarshal
|
{
"repo_name": "apache/activemq-openwire",
"path": "openwire-legacy/src/main/java/org/apache/activemq/openwire/codec/v1/MessageDispatchNotificationMarshaller.java",
"license": "apache-2.0",
"size": 5847
}
|
[
"java.io.DataOutput",
"java.io.IOException",
"org.apache.activemq.openwire.codec.OpenWireFormat",
"org.apache.activemq.openwire.commands.MessageDispatchNotification"
] |
import java.io.DataOutput; import java.io.IOException; import org.apache.activemq.openwire.codec.OpenWireFormat; import org.apache.activemq.openwire.commands.MessageDispatchNotification;
|
import java.io.*; import org.apache.activemq.openwire.codec.*; import org.apache.activemq.openwire.commands.*;
|
[
"java.io",
"org.apache.activemq"
] |
java.io; org.apache.activemq;
| 171,841
|
public void setAttributeEx (Attribute attribute)
{
setAttribute (attribute);
}
|
void function (Attribute attribute) { setAttribute (attribute); }
|
/**
* Set an attribute.
* @param attribute The attribute to set.
* @see #setAttribute(Attribute)
*/
|
Set an attribute
|
setAttributeEx
|
{
"repo_name": "socialwareinc/html-parser",
"path": "lexer/src/main/java/org/htmlparser/nodes/TagNode.java",
"license": "lgpl-3.0",
"size": 29166
}
|
[
"org.htmlparser.Attribute"
] |
import org.htmlparser.Attribute;
|
import org.htmlparser.*;
|
[
"org.htmlparser"
] |
org.htmlparser;
| 72,241
|
public final static long getInternalStoreTotalSize() {
File path = Environment.getRootDirectory();
StatFs sf = new StatFs(path.getPath());
long blockSize = sf.getBlockSize();
long totalBlocks = sf.getBlockCount();
return totalBlocks * blockSize;
}
|
final static long function() { File path = Environment.getRootDirectory(); StatFs sf = new StatFs(path.getPath()); long blockSize = sf.getBlockSize(); long totalBlocks = sf.getBlockCount(); return totalBlocks * blockSize; }
|
/**
* Get internal store total size.
*
* @return long
*/
|
Get internal store total size
|
getInternalStoreTotalSize
|
{
"repo_name": "mingming-killer/K7Utils",
"path": "K7Utils/src/com/eebbk/mingming/k7utils/StoreUtils.java",
"license": "apache-2.0",
"size": 10710
}
|
[
"android.os.Environment",
"android.os.StatFs",
"java.io.File"
] |
import android.os.Environment; import android.os.StatFs; import java.io.File;
|
import android.os.*; import java.io.*;
|
[
"android.os",
"java.io"
] |
android.os; java.io;
| 1,922,458
|
public static @Nullable User getById(String id, boolean create) {
return getOrCreate(id, id, create);
}
|
static @Nullable User function(String id, boolean create) { return getOrCreate(id, id, create); }
|
/**
* Gets the {@link User} object by its <code>id</code>
*
* @param id
* the id of the user to retrieve and optionally create if it does not exist.
* @param create
* If <code>true</code>, this method will never return <code>null</code> for valid input (by creating a
* new {@link User} object if none exists.) If <code>false</code>, this method will return
* <code>null</code> if {@link User} object with the given id doesn't exist.
* @return the a User whose id is <code>id</code>, or <code>null</code> if <code>create</code> is <code>false</code>
* and the user does not exist.
* @since 1.651.2 / 2.3
*/
|
Gets the <code>User</code> object by its <code>id</code>
|
getById
|
{
"repo_name": "kohsuke/hudson",
"path": "core/src/main/java/hudson/model/User.java",
"license": "mit",
"size": 52731
}
|
[
"javax.annotation.Nullable"
] |
import javax.annotation.Nullable;
|
import javax.annotation.*;
|
[
"javax.annotation"
] |
javax.annotation;
| 2,465,829
|
public void checkCompatibleWithApkTargeting(ModuleSplit moduleSplit) {
checkCompatibleWithApkTargeting(moduleSplit.getApkTargeting());
}
|
void function(ModuleSplit moduleSplit) { checkCompatibleWithApkTargeting(moduleSplit.getApkTargeting()); }
|
/**
* Checks if a device is compatible with targeting of a given split, considering the targeting
* alternatives.
*
* @throws IncompatibleDeviceException
*/
|
Checks if a device is compatible with targeting of a given split, considering the targeting alternatives
|
checkCompatibleWithApkTargeting
|
{
"repo_name": "google/bundletool",
"path": "src/main/java/com/android/tools/build/bundletool/device/ApkMatcher.java",
"license": "apache-2.0",
"size": 16602
}
|
[
"com.android.tools.build.bundletool.model.ModuleSplit"
] |
import com.android.tools.build.bundletool.model.ModuleSplit;
|
import com.android.tools.build.bundletool.model.*;
|
[
"com.android.tools"
] |
com.android.tools;
| 2,532,063
|
@SuppressWarnings("deprecation")
public static void writeIgniteConfiguration(BinaryRawWriter w, IgniteConfiguration cfg,
ClientListenerProtocolVersion ver) {
assert w != null;
assert cfg != null;
w.writeBoolean(true);
w.writeBoolean(cfg.isClientMode());
w.writeIntArray(cfg.getIncludeEventTypes());
w.writeBoolean(true);
w.writeLong(cfg.getMetricsExpireTime());
w.writeBoolean(true);
w.writeInt(cfg.getMetricsHistorySize());
w.writeBoolean(true);
w.writeLong(cfg.getMetricsLogFrequency());
w.writeBoolean(true);
w.writeLong(cfg.getMetricsUpdateFrequency());
w.writeBoolean(true);
w.writeInt(cfg.getNetworkSendRetryCount());
w.writeBoolean(true);
w.writeLong(cfg.getNetworkSendRetryDelay());
w.writeBoolean(true);
w.writeLong(cfg.getNetworkTimeout());
w.writeString(cfg.getWorkDirectory());
w.writeString(cfg.getLocalHost());
w.writeBoolean(true);
w.writeBoolean(cfg.isDaemon());
w.writeBoolean(true);
w.writeLong(cfg.getFailureDetectionTimeout());
w.writeBoolean(true);
w.writeLong(cfg.getClientFailureDetectionTimeout());
w.writeBoolean(true);
w.writeLong(cfg.getLongQueryWarningTimeout());
w.writeBoolean(true);
w.writeBoolean(cfg.isActiveOnStart());
w.writeBoolean(true);
w.writeBoolean(cfg.isAuthenticationEnabled());
if (cfg.getSqlSchemas() == null)
w.writeInt(-1);
else {
w.writeInt(cfg.getSqlSchemas().length);
for (String schema : cfg.getSqlSchemas())
w.writeString(schema);
}
w.writeObject(cfg.getConsistentId());
// Thread pools.
w.writeBoolean(true);
w.writeInt(cfg.getPublicThreadPoolSize());
w.writeBoolean(true);
w.writeInt(cfg.getStripedPoolSize());
w.writeBoolean(true);
w.writeInt(cfg.getServiceThreadPoolSize());
w.writeBoolean(true);
w.writeInt(cfg.getSystemThreadPoolSize());
w.writeBoolean(true);
w.writeInt(cfg.getAsyncCallbackPoolSize());
w.writeBoolean(true);
w.writeInt(cfg.getManagementThreadPoolSize());
w.writeBoolean(true);
w.writeInt(cfg.getDataStreamerThreadPoolSize());
w.writeBoolean(true);
w.writeInt(cfg.getUtilityCacheThreadPoolSize());
w.writeBoolean(true);
w.writeInt(cfg.getQueryThreadPoolSize());
CacheConfiguration[] cacheCfg = cfg.getCacheConfiguration();
if (cacheCfg != null) {
w.writeInt(cacheCfg.length);
for (CacheConfiguration ccfg : cacheCfg)
writeCacheConfiguration(w, ccfg, ver);
}
else
w.writeInt(0);
writeDiscoveryConfiguration(w, cfg.getDiscoverySpi());
CommunicationSpi comm = cfg.getCommunicationSpi();
if (comm instanceof TcpCommunicationSpi) {
w.writeBoolean(true);
TcpCommunicationSpi tcp = (TcpCommunicationSpi) comm;
w.writeInt(tcp.getAckSendThreshold());
w.writeLong(tcp.getConnectTimeout());
w.writeBoolean(tcp.isDirectBuffer());
w.writeBoolean(tcp.isDirectSendBuffer());
w.writeLong(tcp.getIdleConnectionTimeout());
w.writeString(tcp.getLocalAddress());
w.writeInt(tcp.getLocalPort());
w.writeInt(tcp.getLocalPortRange());
w.writeLong(tcp.getMaxConnectTimeout());
w.writeInt(tcp.getMessageQueueLimit());
w.writeInt(tcp.getReconnectCount());
w.writeInt(tcp.getSelectorsCount());
w.writeInt(tcp.getSlowClientQueueLimit());
w.writeInt(tcp.getSocketReceiveBuffer());
w.writeInt(tcp.getSocketSendBuffer());
w.writeBoolean(tcp.isTcpNoDelay());
w.writeInt(tcp.getUnacknowledgedMessagesBufferSize());
}
else
w.writeBoolean(false);
BinaryConfiguration bc = cfg.getBinaryConfiguration();
if (bc != null) {
w.writeBoolean(true); // binary config exists
w.writeBoolean(true); // compact footer is set
w.writeBoolean(bc.isCompactFooter());
w.writeBoolean(bc.getNameMapper() instanceof BinaryBasicNameMapper &&
((BinaryBasicNameMapper)(bc.getNameMapper())).isSimpleName());
}
else
w.writeBoolean(false);
Map<String, ?> attrs = cfg.getUserAttributes();
if (attrs != null) {
w.writeInt(attrs.size());
for (Map.Entry<String, ?> e : attrs.entrySet()) {
w.writeString(e.getKey());
w.writeObject(e.getValue());
}
}
else
w.writeInt(0);
AtomicConfiguration atomic = cfg.getAtomicConfiguration();
if (atomic != null) {
w.writeBoolean(true);
w.writeInt(atomic.getAtomicSequenceReserveSize());
w.writeInt(atomic.getBackups());
writeEnumInt(w, atomic.getCacheMode(), AtomicConfiguration.DFLT_CACHE_MODE);
}
else
w.writeBoolean(false);
TransactionConfiguration tx = cfg.getTransactionConfiguration();
if (tx != null) {
w.writeBoolean(true);
w.writeInt(tx.getPessimisticTxLogSize());
writeEnumInt(w, tx.getDefaultTxConcurrency(), TransactionConfiguration.DFLT_TX_CONCURRENCY);
writeEnumInt(w, tx.getDefaultTxIsolation(), TransactionConfiguration.DFLT_TX_ISOLATION);
w.writeLong(tx.getDefaultTxTimeout());
w.writeInt(tx.getPessimisticTxLogLinger());
w.writeLong(tx.getTxTimeoutOnPartitionMapExchange());
}
else
w.writeBoolean(false);
EventStorageSpi evtStorageSpi = cfg.getEventStorageSpi();
if (evtStorageSpi == null)
w.writeByte((byte) 0);
else if (evtStorageSpi instanceof NoopEventStorageSpi)
w.writeByte((byte) 1);
else if (evtStorageSpi instanceof MemoryEventStorageSpi) {
w.writeByte((byte) 2);
w.writeLong(((MemoryEventStorageSpi)evtStorageSpi).getExpireCount());
w.writeLong(((MemoryEventStorageSpi)evtStorageSpi).getExpireAgeMs());
}
writeMemoryConfiguration(w, cfg.getMemoryConfiguration());
writeSqlConnectorConfiguration(w, cfg.getSqlConnectorConfiguration());
writeClientConnectorConfiguration(w, cfg.getClientConnectorConfiguration());
w.writeBoolean(cfg.getClientConnectorConfiguration() != null);
writePersistentStoreConfiguration(w, cfg.getPersistentStoreConfiguration());
writeDataStorageConfiguration(w, cfg.getDataStorageConfiguration());
writeSslContextFactory(w, cfg.getSslContextFactory());
FailureHandler failureHnd = cfg.getFailureHandler();
if (failureHnd instanceof NoOpFailureHandler) {
w.writeBoolean(true);
w.writeByte((byte) 0);
}
else if (failureHnd instanceof StopNodeFailureHandler) {
w.writeBoolean(true);
w.writeByte((byte) 1);
}
else if (failureHnd instanceof StopNodeOrHaltFailureHandler) {
w.writeBoolean(true);
w.writeByte((byte) 2);
w.writeBoolean(((StopNodeOrHaltFailureHandler)failureHnd).tryStop());
w.writeLong(((StopNodeOrHaltFailureHandler)failureHnd).timeout());
} else
w.writeBoolean(false);
w.writeString(cfg.getIgniteHome());
w.writeLong(ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getInit());
w.writeLong(ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getMax());
}
|
@SuppressWarnings(STR) static void function(BinaryRawWriter w, IgniteConfiguration cfg, ClientListenerProtocolVersion ver) { assert w != null; assert cfg != null; w.writeBoolean(true); w.writeBoolean(cfg.isClientMode()); w.writeIntArray(cfg.getIncludeEventTypes()); w.writeBoolean(true); w.writeLong(cfg.getMetricsExpireTime()); w.writeBoolean(true); w.writeInt(cfg.getMetricsHistorySize()); w.writeBoolean(true); w.writeLong(cfg.getMetricsLogFrequency()); w.writeBoolean(true); w.writeLong(cfg.getMetricsUpdateFrequency()); w.writeBoolean(true); w.writeInt(cfg.getNetworkSendRetryCount()); w.writeBoolean(true); w.writeLong(cfg.getNetworkSendRetryDelay()); w.writeBoolean(true); w.writeLong(cfg.getNetworkTimeout()); w.writeString(cfg.getWorkDirectory()); w.writeString(cfg.getLocalHost()); w.writeBoolean(true); w.writeBoolean(cfg.isDaemon()); w.writeBoolean(true); w.writeLong(cfg.getFailureDetectionTimeout()); w.writeBoolean(true); w.writeLong(cfg.getClientFailureDetectionTimeout()); w.writeBoolean(true); w.writeLong(cfg.getLongQueryWarningTimeout()); w.writeBoolean(true); w.writeBoolean(cfg.isActiveOnStart()); w.writeBoolean(true); w.writeBoolean(cfg.isAuthenticationEnabled()); if (cfg.getSqlSchemas() == null) w.writeInt(-1); else { w.writeInt(cfg.getSqlSchemas().length); for (String schema : cfg.getSqlSchemas()) w.writeString(schema); } w.writeObject(cfg.getConsistentId()); w.writeBoolean(true); w.writeInt(cfg.getPublicThreadPoolSize()); w.writeBoolean(true); w.writeInt(cfg.getStripedPoolSize()); w.writeBoolean(true); w.writeInt(cfg.getServiceThreadPoolSize()); w.writeBoolean(true); w.writeInt(cfg.getSystemThreadPoolSize()); w.writeBoolean(true); w.writeInt(cfg.getAsyncCallbackPoolSize()); w.writeBoolean(true); w.writeInt(cfg.getManagementThreadPoolSize()); w.writeBoolean(true); w.writeInt(cfg.getDataStreamerThreadPoolSize()); w.writeBoolean(true); w.writeInt(cfg.getUtilityCacheThreadPoolSize()); w.writeBoolean(true); w.writeInt(cfg.getQueryThreadPoolSize()); CacheConfiguration[] cacheCfg = cfg.getCacheConfiguration(); if (cacheCfg != null) { w.writeInt(cacheCfg.length); for (CacheConfiguration ccfg : cacheCfg) writeCacheConfiguration(w, ccfg, ver); } else w.writeInt(0); writeDiscoveryConfiguration(w, cfg.getDiscoverySpi()); CommunicationSpi comm = cfg.getCommunicationSpi(); if (comm instanceof TcpCommunicationSpi) { w.writeBoolean(true); TcpCommunicationSpi tcp = (TcpCommunicationSpi) comm; w.writeInt(tcp.getAckSendThreshold()); w.writeLong(tcp.getConnectTimeout()); w.writeBoolean(tcp.isDirectBuffer()); w.writeBoolean(tcp.isDirectSendBuffer()); w.writeLong(tcp.getIdleConnectionTimeout()); w.writeString(tcp.getLocalAddress()); w.writeInt(tcp.getLocalPort()); w.writeInt(tcp.getLocalPortRange()); w.writeLong(tcp.getMaxConnectTimeout()); w.writeInt(tcp.getMessageQueueLimit()); w.writeInt(tcp.getReconnectCount()); w.writeInt(tcp.getSelectorsCount()); w.writeInt(tcp.getSlowClientQueueLimit()); w.writeInt(tcp.getSocketReceiveBuffer()); w.writeInt(tcp.getSocketSendBuffer()); w.writeBoolean(tcp.isTcpNoDelay()); w.writeInt(tcp.getUnacknowledgedMessagesBufferSize()); } else w.writeBoolean(false); BinaryConfiguration bc = cfg.getBinaryConfiguration(); if (bc != null) { w.writeBoolean(true); w.writeBoolean(true); w.writeBoolean(bc.isCompactFooter()); w.writeBoolean(bc.getNameMapper() instanceof BinaryBasicNameMapper && ((BinaryBasicNameMapper)(bc.getNameMapper())).isSimpleName()); } else w.writeBoolean(false); Map<String, ?> attrs = cfg.getUserAttributes(); if (attrs != null) { w.writeInt(attrs.size()); for (Map.Entry<String, ?> e : attrs.entrySet()) { w.writeString(e.getKey()); w.writeObject(e.getValue()); } } else w.writeInt(0); AtomicConfiguration atomic = cfg.getAtomicConfiguration(); if (atomic != null) { w.writeBoolean(true); w.writeInt(atomic.getAtomicSequenceReserveSize()); w.writeInt(atomic.getBackups()); writeEnumInt(w, atomic.getCacheMode(), AtomicConfiguration.DFLT_CACHE_MODE); } else w.writeBoolean(false); TransactionConfiguration tx = cfg.getTransactionConfiguration(); if (tx != null) { w.writeBoolean(true); w.writeInt(tx.getPessimisticTxLogSize()); writeEnumInt(w, tx.getDefaultTxConcurrency(), TransactionConfiguration.DFLT_TX_CONCURRENCY); writeEnumInt(w, tx.getDefaultTxIsolation(), TransactionConfiguration.DFLT_TX_ISOLATION); w.writeLong(tx.getDefaultTxTimeout()); w.writeInt(tx.getPessimisticTxLogLinger()); w.writeLong(tx.getTxTimeoutOnPartitionMapExchange()); } else w.writeBoolean(false); EventStorageSpi evtStorageSpi = cfg.getEventStorageSpi(); if (evtStorageSpi == null) w.writeByte((byte) 0); else if (evtStorageSpi instanceof NoopEventStorageSpi) w.writeByte((byte) 1); else if (evtStorageSpi instanceof MemoryEventStorageSpi) { w.writeByte((byte) 2); w.writeLong(((MemoryEventStorageSpi)evtStorageSpi).getExpireCount()); w.writeLong(((MemoryEventStorageSpi)evtStorageSpi).getExpireAgeMs()); } writeMemoryConfiguration(w, cfg.getMemoryConfiguration()); writeSqlConnectorConfiguration(w, cfg.getSqlConnectorConfiguration()); writeClientConnectorConfiguration(w, cfg.getClientConnectorConfiguration()); w.writeBoolean(cfg.getClientConnectorConfiguration() != null); writePersistentStoreConfiguration(w, cfg.getPersistentStoreConfiguration()); writeDataStorageConfiguration(w, cfg.getDataStorageConfiguration()); writeSslContextFactory(w, cfg.getSslContextFactory()); FailureHandler failureHnd = cfg.getFailureHandler(); if (failureHnd instanceof NoOpFailureHandler) { w.writeBoolean(true); w.writeByte((byte) 0); } else if (failureHnd instanceof StopNodeFailureHandler) { w.writeBoolean(true); w.writeByte((byte) 1); } else if (failureHnd instanceof StopNodeOrHaltFailureHandler) { w.writeBoolean(true); w.writeByte((byte) 2); w.writeBoolean(((StopNodeOrHaltFailureHandler)failureHnd).tryStop()); w.writeLong(((StopNodeOrHaltFailureHandler)failureHnd).timeout()); } else w.writeBoolean(false); w.writeString(cfg.getIgniteHome()); w.writeLong(ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getInit()); w.writeLong(ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getMax()); }
|
/**
* Writes Ignite configuration.
*
* @param w Writer.
* @param cfg Configuration.
* @param ver Client version.
*/
|
Writes Ignite configuration
|
writeIgniteConfiguration
|
{
"repo_name": "amirakhmedov/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java",
"license": "apache-2.0",
"size": 75809
}
|
[
"java.lang.management.ManagementFactory",
"java.util.Map",
"org.apache.ignite.binary.BinaryBasicNameMapper",
"org.apache.ignite.binary.BinaryRawWriter",
"org.apache.ignite.configuration.AtomicConfiguration",
"org.apache.ignite.configuration.BinaryConfiguration",
"org.apache.ignite.configuration.CacheConfiguration",
"org.apache.ignite.configuration.IgniteConfiguration",
"org.apache.ignite.configuration.TransactionConfiguration",
"org.apache.ignite.failure.FailureHandler",
"org.apache.ignite.failure.NoOpFailureHandler",
"org.apache.ignite.failure.StopNodeFailureHandler",
"org.apache.ignite.failure.StopNodeOrHaltFailureHandler",
"org.apache.ignite.internal.processors.odbc.ClientListenerProtocolVersion",
"org.apache.ignite.spi.communication.CommunicationSpi",
"org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi",
"org.apache.ignite.spi.eventstorage.EventStorageSpi",
"org.apache.ignite.spi.eventstorage.NoopEventStorageSpi",
"org.apache.ignite.spi.eventstorage.memory.MemoryEventStorageSpi"
] |
import java.lang.management.ManagementFactory; import java.util.Map; import org.apache.ignite.binary.BinaryBasicNameMapper; import org.apache.ignite.binary.BinaryRawWriter; import org.apache.ignite.configuration.AtomicConfiguration; import org.apache.ignite.configuration.BinaryConfiguration; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.configuration.TransactionConfiguration; import org.apache.ignite.failure.FailureHandler; import org.apache.ignite.failure.NoOpFailureHandler; import org.apache.ignite.failure.StopNodeFailureHandler; import org.apache.ignite.failure.StopNodeOrHaltFailureHandler; import org.apache.ignite.internal.processors.odbc.ClientListenerProtocolVersion; import org.apache.ignite.spi.communication.CommunicationSpi; import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi; import org.apache.ignite.spi.eventstorage.EventStorageSpi; import org.apache.ignite.spi.eventstorage.NoopEventStorageSpi; import org.apache.ignite.spi.eventstorage.memory.MemoryEventStorageSpi;
|
import java.lang.management.*; import java.util.*; import org.apache.ignite.binary.*; import org.apache.ignite.configuration.*; import org.apache.ignite.failure.*; import org.apache.ignite.internal.processors.odbc.*; import org.apache.ignite.spi.communication.*; import org.apache.ignite.spi.communication.tcp.*; import org.apache.ignite.spi.eventstorage.*; import org.apache.ignite.spi.eventstorage.memory.*;
|
[
"java.lang",
"java.util",
"org.apache.ignite"
] |
java.lang; java.util; org.apache.ignite;
| 1,361,337
|
@Override public BitSet getFilteredPartitions(Expression expressionTree,
PartitionInfo partitionInfo) {
Partitioner partitioner = PartitionUtil.getPartitioner(partitionInfo);
return createPartitionFilterTree(expressionTree, partitionInfo).applyFilter(partitioner);
}
|
@Override BitSet function(Expression expressionTree, PartitionInfo partitionInfo) { Partitioner partitioner = PartitionUtil.getPartitioner(partitionInfo); return createPartitionFilterTree(expressionTree, partitionInfo).applyFilter(partitioner); }
|
/**
* Get the map of required partitions
* The value of "1" in BitSet represent the required partition
* @param expressionTree
* @param partitionInfo
* @return
*/
|
Get the map of required partitions The value of "1" in BitSet represent the required partition
|
getFilteredPartitions
|
{
"repo_name": "jatin9896/incubator-carbondata",
"path": "core/src/main/java/org/apache/carbondata/core/scan/filter/FilterExpressionProcessor.java",
"license": "apache-2.0",
"size": 24919
}
|
[
"java.util.BitSet",
"org.apache.carbondata.core.metadata.schema.PartitionInfo",
"org.apache.carbondata.core.scan.expression.Expression",
"org.apache.carbondata.core.scan.partition.PartitionUtil",
"org.apache.carbondata.core.scan.partition.Partitioner"
] |
import java.util.BitSet; import org.apache.carbondata.core.metadata.schema.PartitionInfo; import org.apache.carbondata.core.scan.expression.Expression; import org.apache.carbondata.core.scan.partition.PartitionUtil; import org.apache.carbondata.core.scan.partition.Partitioner;
|
import java.util.*; import org.apache.carbondata.core.metadata.schema.*; import org.apache.carbondata.core.scan.expression.*; import org.apache.carbondata.core.scan.partition.*;
|
[
"java.util",
"org.apache.carbondata"
] |
java.util; org.apache.carbondata;
| 1,872,416
|
public static AbstractScannedResultCollector getScannedResultCollector(
BlockExecutionInfo blockExecutionInfo) {
AbstractScannedResultCollector scannerResultAggregator = null;
if (blockExecutionInfo.isRawRecordDetailQuery()) {
if (blockExecutionInfo.isRestructuredBlock()) {
if (blockExecutionInfo.isRequiredRowId()) {
LOGGER.info("RowId Restructure based raw ollector is used to scan and collect the data");
scannerResultAggregator = new RowIdRestructureBasedRawResultCollector(blockExecutionInfo);
} else {
LOGGER.info("Restructure based raw collector is used to scan and collect the data");
scannerResultAggregator = new RestructureBasedRawResultCollector(blockExecutionInfo);
}
} else {
if (blockExecutionInfo.isRequiredRowId()) {
LOGGER.info("RowId based raw collector is used to scan and collect the data");
scannerResultAggregator = new RowIdRawBasedResultCollector(blockExecutionInfo);
} else {
LOGGER.info("Row based raw collector is used to scan and collect the data");
scannerResultAggregator = new RawBasedResultCollector(blockExecutionInfo);
}
}
} else if (blockExecutionInfo.isVectorBatchCollector()) {
if (blockExecutionInfo.isRestructuredBlock()) {
LOGGER.info("Restructure dictionary vector collector is used to scan and collect the data");
scannerResultAggregator = new RestructureBasedVectorResultCollector(blockExecutionInfo);
} else {
LOGGER.info("Vector based dictionary collector is used to scan and collect the data");
scannerResultAggregator = new DictionaryBasedVectorResultCollector(blockExecutionInfo);
}
} else {
if (blockExecutionInfo.isRestructuredBlock()) {
LOGGER.info("Restructure based dictionary collector is used to scan and collect the data");
scannerResultAggregator = new RestructureBasedDictionaryResultCollector(blockExecutionInfo);
} else if (blockExecutionInfo.isRequiredRowId()) {
LOGGER.info("RowId based dictionary collector is used to scan and collect the data");
scannerResultAggregator = new RowIdBasedResultCollector(blockExecutionInfo);
} else {
LOGGER.info("Row based dictionary collector is used to scan and collect the data");
scannerResultAggregator = new DictionaryBasedResultCollector(blockExecutionInfo);
}
}
return scannerResultAggregator;
}
private ResultCollectorFactory() {
}
|
static AbstractScannedResultCollector function( BlockExecutionInfo blockExecutionInfo) { AbstractScannedResultCollector scannerResultAggregator = null; if (blockExecutionInfo.isRawRecordDetailQuery()) { if (blockExecutionInfo.isRestructuredBlock()) { if (blockExecutionInfo.isRequiredRowId()) { LOGGER.info(STR); scannerResultAggregator = new RowIdRestructureBasedRawResultCollector(blockExecutionInfo); } else { LOGGER.info(STR); scannerResultAggregator = new RestructureBasedRawResultCollector(blockExecutionInfo); } } else { if (blockExecutionInfo.isRequiredRowId()) { LOGGER.info(STR); scannerResultAggregator = new RowIdRawBasedResultCollector(blockExecutionInfo); } else { LOGGER.info(STR); scannerResultAggregator = new RawBasedResultCollector(blockExecutionInfo); } } } else if (blockExecutionInfo.isVectorBatchCollector()) { if (blockExecutionInfo.isRestructuredBlock()) { LOGGER.info(STR); scannerResultAggregator = new RestructureBasedVectorResultCollector(blockExecutionInfo); } else { LOGGER.info(STR); scannerResultAggregator = new DictionaryBasedVectorResultCollector(blockExecutionInfo); } } else { if (blockExecutionInfo.isRestructuredBlock()) { LOGGER.info(STR); scannerResultAggregator = new RestructureBasedDictionaryResultCollector(blockExecutionInfo); } else if (blockExecutionInfo.isRequiredRowId()) { LOGGER.info(STR); scannerResultAggregator = new RowIdBasedResultCollector(blockExecutionInfo); } else { LOGGER.info(STR); scannerResultAggregator = new DictionaryBasedResultCollector(blockExecutionInfo); } } return scannerResultAggregator; } private ResultCollectorFactory() { }
|
/**
* This method will create result collector based on the given type
*
* @param blockExecutionInfo
* @return
*/
|
This method will create result collector based on the given type
|
getScannedResultCollector
|
{
"repo_name": "jackylk/incubator-carbondata",
"path": "core/src/main/java/org/apache/carbondata/core/scan/collector/ResultCollectorFactory.java",
"license": "apache-2.0",
"size": 4889
}
|
[
"org.apache.carbondata.core.scan.collector.impl.AbstractScannedResultCollector",
"org.apache.carbondata.core.scan.collector.impl.DictionaryBasedResultCollector",
"org.apache.carbondata.core.scan.collector.impl.DictionaryBasedVectorResultCollector",
"org.apache.carbondata.core.scan.collector.impl.RawBasedResultCollector",
"org.apache.carbondata.core.scan.collector.impl.RestructureBasedDictionaryResultCollector",
"org.apache.carbondata.core.scan.collector.impl.RestructureBasedRawResultCollector",
"org.apache.carbondata.core.scan.collector.impl.RestructureBasedVectorResultCollector",
"org.apache.carbondata.core.scan.collector.impl.RowIdBasedResultCollector",
"org.apache.carbondata.core.scan.collector.impl.RowIdRawBasedResultCollector",
"org.apache.carbondata.core.scan.collector.impl.RowIdRestructureBasedRawResultCollector",
"org.apache.carbondata.core.scan.executor.infos.BlockExecutionInfo"
] |
import org.apache.carbondata.core.scan.collector.impl.AbstractScannedResultCollector; import org.apache.carbondata.core.scan.collector.impl.DictionaryBasedResultCollector; import org.apache.carbondata.core.scan.collector.impl.DictionaryBasedVectorResultCollector; import org.apache.carbondata.core.scan.collector.impl.RawBasedResultCollector; import org.apache.carbondata.core.scan.collector.impl.RestructureBasedDictionaryResultCollector; import org.apache.carbondata.core.scan.collector.impl.RestructureBasedRawResultCollector; import org.apache.carbondata.core.scan.collector.impl.RestructureBasedVectorResultCollector; import org.apache.carbondata.core.scan.collector.impl.RowIdBasedResultCollector; import org.apache.carbondata.core.scan.collector.impl.RowIdRawBasedResultCollector; import org.apache.carbondata.core.scan.collector.impl.RowIdRestructureBasedRawResultCollector; import org.apache.carbondata.core.scan.executor.infos.BlockExecutionInfo;
|
import org.apache.carbondata.core.scan.collector.impl.*; import org.apache.carbondata.core.scan.executor.infos.*;
|
[
"org.apache.carbondata"
] |
org.apache.carbondata;
| 1,079,960
|
public static void main(String[] arguments) throws Exception
{
String systemName = ConfigurationUtil.getRequiredParam("migration.systemname",
System.getProperties(), arguments);
String migrationSettings = ConfigurationUtil.getOptionalParam("migration.settings",
System.getProperties(), arguments, 1);
// The MigrationLauncher is responsible for handling the interaction
// between the PatchTable and the underlying MigrationTasks; as each
// task is executed, the patch level is incremented, etc.
try
{
DistributedJdbcMigrationLauncherFactory factory =
new DistributedJdbcMigrationLauncherFactory();
JdbcMigrationLauncher launcher = null;
if (migrationSettings == null)
{
log.info("Using migration.properties (default)");
launcher = factory.createMigrationLauncher(systemName);
}
else
{
log.info("Using " + migrationSettings);
launcher = factory.createMigrationLauncher(systemName, migrationSettings);
}
launcher.doMigrations();
}
catch (Exception e)
{
log.error(e);
throw e;
}
}
|
static void function(String[] arguments) throws Exception { String systemName = ConfigurationUtil.getRequiredParam(STR, System.getProperties(), arguments); String migrationSettings = ConfigurationUtil.getOptionalParam(STR, System.getProperties(), arguments, 1); try { DistributedJdbcMigrationLauncherFactory factory = new DistributedJdbcMigrationLauncherFactory(); JdbcMigrationLauncher launcher = null; if (migrationSettings == null) { log.info(STR); launcher = factory.createMigrationLauncher(systemName); } else { log.info(STR + migrationSettings); launcher = factory.createMigrationLauncher(systemName, migrationSettings); } launcher.doMigrations(); } catch (Exception e) { log.error(e); throw e; } }
|
/**
* Run the migrations for the given system name
*
* @param arguments the command line arguments, if any (none are used)
* @throws Exception if anything goes wrong
*/
|
Run the migrations for the given system name
|
main
|
{
"repo_name": "lamsfoundation/lams",
"path": "3rdParty_sources/tacitknowledge/autopatch/src/main/java/com/tacitknowledge/util/migration/jdbc/DistributedStandaloneMigrationLauncher.java",
"license": "gpl-2.0",
"size": 3598
}
|
[
"com.tacitknowledge.util.migration.jdbc.util.ConfigurationUtil"
] |
import com.tacitknowledge.util.migration.jdbc.util.ConfigurationUtil;
|
import com.tacitknowledge.util.migration.jdbc.util.*;
|
[
"com.tacitknowledge.util"
] |
com.tacitknowledge.util;
| 1,358,178
|
public static class ParserErrorHandler implements ErrorHandler {
protected static Log log =
LogFactory.getLog(ParserErrorHandler.class.getName());
private String getParseExceptionInfo(SAXParseException spe) {
String systemId = spe.getSystemId();
if (systemId == null) {
systemId = "null";
}
String info = "URI=" + systemId +
" Line=" + spe.getLineNumber() +
": " + spe.getMessage();
return info;
}
// The following methods are standard SAX ErrorHandler methods.
// See SAX documentation for more info.
|
static class ParserErrorHandler implements ErrorHandler { protected static Log log = LogFactory.getLog(ParserErrorHandler.class.getName()); private String function(SAXParseException spe) { String systemId = spe.getSystemId(); if (systemId == null) { systemId = "null"; } String info = "URI=" + systemId + STR + spe.getLineNumber() + STR + spe.getMessage(); return info; }
|
/**
* Returns a string describing parse exception details
*/
|
Returns a string describing parse exception details
|
getParseExceptionInfo
|
{
"repo_name": "hugosato/apache-axis",
"path": "src/org/apache/axis/utils/XMLUtils.java",
"license": "apache-2.0",
"size": 34551
}
|
[
"org.apache.axis.components.logger.LogFactory",
"org.apache.commons.logging.Log",
"org.xml.sax.ErrorHandler",
"org.xml.sax.SAXParseException"
] |
import org.apache.axis.components.logger.LogFactory; import org.apache.commons.logging.Log; import org.xml.sax.ErrorHandler; import org.xml.sax.SAXParseException;
|
import org.apache.axis.components.logger.*; import org.apache.commons.logging.*; import org.xml.sax.*;
|
[
"org.apache.axis",
"org.apache.commons",
"org.xml.sax"
] |
org.apache.axis; org.apache.commons; org.xml.sax;
| 1,319,100
|
public void replaceTasks(Collection<Task> tasks)
{
this.tasks.clear();
this.tasks.addAll(tasks);
}
|
void function(Collection<Task> tasks) { this.tasks.clear(); this.tasks.addAll(tasks); }
|
/**
* Replace the current list of Tasks with the provided Tasks.
*
* @param tasks Collection of Tasks.
*/
|
Replace the current list of Tasks with the provided Tasks
|
replaceTasks
|
{
"repo_name": "Miller189/RaiderPlanner",
"path": "src/Model/Milestone.java",
"license": "gpl-3.0",
"size": 5796
}
|
[
"java.util.Collection"
] |
import java.util.Collection;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 15,414
|
public static ComponentUI createUI(JComponent a) {
MultiSeparatorUI mui = new MultiSeparatorUI();
return MultiLookAndFeel.createUIs(mui, mui.uis, a);
}
|
static ComponentUI function(JComponent a) { MultiSeparatorUI mui = new MultiSeparatorUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, a); }
|
/**
* Returns a multiplexing UI instance if any of the auxiliary
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
* UI object obtained from the default <code>LookAndFeel</code>.
*
* @param a the component to create the UI for
* @return the UI delegate created
*/
|
Returns a multiplexing UI instance if any of the auxiliary <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the UI object obtained from the default <code>LookAndFeel</code>
|
createUI
|
{
"repo_name": "FauxFaux/jdk9-jdk",
"path": "src/java.desktop/share/classes/javax/swing/plaf/multi/MultiSeparatorUI.java",
"license": "gpl-2.0",
"size": 7212
}
|
[
"javax.swing.JComponent",
"javax.swing.plaf.ComponentUI"
] |
import javax.swing.JComponent; import javax.swing.plaf.ComponentUI;
|
import javax.swing.*; import javax.swing.plaf.*;
|
[
"javax.swing"
] |
javax.swing;
| 2,200,291
|
EClass getLongFunction();
|
EClass getLongFunction();
|
/**
* Returns the meta object for class '{@link org.tud.inf.st.mbt.functions.LongFunction <em>Long Function</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Long Function</em>'.
* @see org.tud.inf.st.mbt.functions.LongFunction
* @generated
*/
|
Returns the meta object for class '<code>org.tud.inf.st.mbt.functions.LongFunction Long Function</code>'.
|
getLongFunction
|
{
"repo_name": "paetti1988/qmate",
"path": "MATE/org.tud.inf.st.mbt.emf/src-gen/org/tud/inf/st/mbt/functions/FunctionsPackage.java",
"license": "apache-2.0",
"size": 134465
}
|
[
"org.eclipse.emf.ecore.EClass"
] |
import org.eclipse.emf.ecore.EClass;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 1,666,126
|
private static void parseDir(File dir)
{
for (File file : dir.listFiles(_htmFilter))
{
if (file.isDirectory())
parseDir(file);
else
loadFile(file);
}
}
|
static void function(File dir) { for (File file : dir.listFiles(_htmFilter)) { if (file.isDirectory()) parseDir(file); else loadFile(file); } }
|
/**
* Parse given directory, all html files are loaded to HtmCache.
* @param dir : Directory to be parsed.
*/
|
Parse given directory, all html files are loaded to HtmCache
|
parseDir
|
{
"repo_name": "VytautasBoznis/l2.skilas.lt",
"path": "aCis_gameserver/java/net/sf/l2j/gameserver/cache/HtmCache.java",
"license": "gpl-2.0",
"size": 4341
}
|
[
"java.io.File"
] |
import java.io.File;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,694,908
|
public EvictionConfig setMaximumSizePolicy(MaxSizePolicy maxSizePolicy) {
this.maxSizePolicy = checkNotNull(maxSizePolicy, "maxSizePolicy cannot be null!");
return this;
}
|
EvictionConfig function(MaxSizePolicy maxSizePolicy) { this.maxSizePolicy = checkNotNull(maxSizePolicy, STR); return this; }
|
/**
* Sets the {@link MaxSizePolicy} of this eviction configuration.
*
* @param maxSizePolicy the {@link MaxSizePolicy} of this eviction configuration
* @return this EvictionConfig instance
*/
|
Sets the <code>MaxSizePolicy</code> of this eviction configuration
|
setMaximumSizePolicy
|
{
"repo_name": "Donnerbart/hazelcast",
"path": "hazelcast/src/main/java/com/hazelcast/config/EvictionConfig.java",
"license": "apache-2.0",
"size": 13821
}
|
[
"com.hazelcast.util.Preconditions"
] |
import com.hazelcast.util.Preconditions;
|
import com.hazelcast.util.*;
|
[
"com.hazelcast.util"
] |
com.hazelcast.util;
| 931,670
|
public List<org.ng200.openolympus.jooq.tables.pojos.Group> fetchById(Long... values) {
return fetch(Group.GROUP.ID, values);
}
|
List<org.ng200.openolympus.jooq.tables.pojos.Group> function(Long... values) { return fetch(Group.GROUP.ID, values); }
|
/**
* Fetch records that have <code>id IN (values)</code>
*/
|
Fetch records that have <code>id IN (values)</code>
|
fetchById
|
{
"repo_name": "nickguletskii/OpenOlympus",
"path": "src-gen/main/java/org/ng200/openolympus/jooq/tables/daos/GroupDao.java",
"license": "mit",
"size": 3254
}
|
[
"java.util.List",
"org.ng200.openolympus.jooq.tables.Group"
] |
import java.util.List; import org.ng200.openolympus.jooq.tables.Group;
|
import java.util.*; import org.ng200.openolympus.jooq.tables.*;
|
[
"java.util",
"org.ng200.openolympus"
] |
java.util; org.ng200.openolympus;
| 1,522,453
|
public int getRangedLevel() {
return levels[Skill.RANGED];
}
|
int function() { return levels[Skill.RANGED]; }
|
/**
* Gets the minimum ranged level required to equip this item.
*
* @return The level.
*/
|
Gets the minimum ranged level required to equip this item
|
getRangedLevel
|
{
"repo_name": "DealerNextDoor/ApolloDev",
"path": "src/org/apollo/game/model/def/EquipmentDefinition.java",
"license": "isc",
"size": 5978
}
|
[
"org.apollo.game.model.Skill"
] |
import org.apollo.game.model.Skill;
|
import org.apollo.game.model.*;
|
[
"org.apollo.game"
] |
org.apollo.game;
| 2,399,441
|
public static Properties loadProperties(String filePath) throws MnoConfigurationException {
Properties properties = new Properties();
InputStream input = getInputStreamFromClassPathOrFile(filePath);
try {
properties.load(input);
} catch (IOException e) {
throw new MnoConfigurationException("Could not load properties file: " + filePath, e);
} finally {
IOUtils.closeQuietly(input);
}
return properties;
}
|
static Properties function(String filePath) throws MnoConfigurationException { Properties properties = new Properties(); InputStream input = getInputStreamFromClassPathOrFile(filePath); try { properties.load(input); } catch (IOException e) { throw new MnoConfigurationException(STR + filePath, e); } finally { IOUtils.closeQuietly(input); } return properties; }
|
/**
* load Properties from a filePath, in the classPath or absolute
*
* @param filePath
* @return
* @throws MnoConfigurationException
*/
|
load Properties from a filePath, in the classPath or absolute
|
loadProperties
|
{
"repo_name": "maestrano/maestrano-java",
"path": "src/main/java/com/maestrano/Maestrano.java",
"license": "mit",
"size": 7722
}
|
[
"com.maestrano.exception.MnoConfigurationException",
"java.io.IOException",
"java.io.InputStream",
"java.util.Properties",
"org.apache.commons.io.IOUtils"
] |
import com.maestrano.exception.MnoConfigurationException; import java.io.IOException; import java.io.InputStream; import java.util.Properties; import org.apache.commons.io.IOUtils;
|
import com.maestrano.exception.*; import java.io.*; import java.util.*; import org.apache.commons.io.*;
|
[
"com.maestrano.exception",
"java.io",
"java.util",
"org.apache.commons"
] |
com.maestrano.exception; java.io; java.util; org.apache.commons;
| 1,865,558
|
static Node getArgumentForFunction(Node function, int index) {
Preconditions.checkState(function.isFunction());
return getNthSibling(
function.getFirstChild().getNext().getFirstChild(), index);
}
|
static Node getArgumentForFunction(Node function, int index) { Preconditions.checkState(function.isFunction()); return getNthSibling( function.getFirstChild().getNext().getFirstChild(), index); }
|
/**
* Given the function, this returns the nth
* argument or null if no such parameter exists.
*/
|
Given the function, this returns the nth argument or null if no such parameter exists
|
getArgumentForFunction
|
{
"repo_name": "ajukraine/closure-compiler",
"path": "src/com/google/javascript/jscomp/NodeUtil.java",
"license": "apache-2.0",
"size": 95188
}
|
[
"com.google.common.base.Preconditions",
"com.google.javascript.rhino.Node"
] |
import com.google.common.base.Preconditions; import com.google.javascript.rhino.Node;
|
import com.google.common.base.*; import com.google.javascript.rhino.*;
|
[
"com.google.common",
"com.google.javascript"
] |
com.google.common; com.google.javascript;
| 2,152,908
|
CompletableFuture<NavigableSet<String>> navigableKeySet();
|
CompletableFuture<NavigableSet<String>> navigableKeySet();
|
/**
* Returns a navigable set of the keys in this map.
*
* @return a navigable key set (this may be empty)
*/
|
Returns a navigable set of the keys in this map
|
navigableKeySet
|
{
"repo_name": "osinstom/onos",
"path": "core/api/src/main/java/org/onosproject/store/service/AsyncConsistentTreeMap.java",
"license": "apache-2.0",
"size": 5576
}
|
[
"java.util.NavigableSet",
"java.util.concurrent.CompletableFuture"
] |
import java.util.NavigableSet; import java.util.concurrent.CompletableFuture;
|
import java.util.*; import java.util.concurrent.*;
|
[
"java.util"
] |
java.util;
| 1,239,706
|
public void paint(Graphics g) {
super.paint(g);
Graphics2D g2d = (Graphics2D) g;
// search all layers for polygons
// do this in reverse order so layers at the top of the list will be drawn on top of other layers
for (int count=layers.size()-1; count>=0; count--) {
HILayer layer = layers.get(count);
// only draw user selected layer in isolation mode
// if ( isolationMode && layer != this.userSelectedLayer ) continue;
// construct combined polygon path of all polygons on current layer
combinedPath.reset();
for (RelativePolygon polygon : layer.getRelativePolygons())
if ( polygon.isClosed() ) // only add closed polygon paths
combinedPath.append(polygon.getPolygonPath(), false);
// DEBUG highlight user selected layer (not needed if in isolation mode)
if ( layer == userSelectedLayer && highlightLayer && !isolationMode )
highlightPolygon(g2d, combinedPath, layer.getSolidColour(), 10);
// draw inside of all closed polygons on this layer
g2d.setColor(layer.getColour());
if ( !isolationMode || layer == this.userSelectedLayer ) g2d.fill(combinedPath);
// draw outline of all polygons on this layer, anchors for active polygon, open polygons
for (RelativePolygon polygon : layer.getRelativePolygons()) {
// if this is an open polygon path: composite open polygon over image and other polygons
if ( !polygon.isClosed() ) {
Composite orgComposite = g2d.getComposite();
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.2f));
if (openPolygonTexturePaint!= null ) { // sanity check: is custom texture available?
g2d.setPaint(openPolygonTexturePaint);
g2d.fill(polygon.getPolygonPath());
}
g2d.setComposite(orgComposite);
}
if ( !isolationMode || layer == userSelectedLayer) {
if ( (polygon.getType() == HiPolygonTypes.HI_FREEDESIGN) || (polygon.getType() == HiPolygonTypes.HI_FREEHAND) ) {
// draw polygon outline (dashed strokes)
g2d.setStroke(selectStrokeWhite);
g2d.setColor(Color.WHITE);
g2d.draw(polygon.getPolygonPath());
g2d.setStroke(selectStrokeBlack);
g2d.setColor(layer.getColour().darker());
g2d.draw(polygon.getPolygonPath());
} else {
// draw solid outline for fixed polygons
g2d.setStroke(selectStrokeSolid);
g2d.setColor(layer.getColour().darker());
g2d.draw(polygon.getPolygonPath());
}
} else {
// draw black / layer colour outline for non-selected layers in isolation mode
g2d.setStroke(selectStrokeSolid);
g2d.setColor(layer.getColour().darker());
g2d.draw(polygon.getPolygonPath());
g2d.setStroke(selectStrokeBlack);
g2d.setColor(layer.getColour());
g2d.draw(polygon.getPolygonPath());
}
// draw resize frame for user selected polygon if any
if ( polygon == selectedPolygon )
drawResizeFrame(g2d, polygon.getPolygonPath());
// draw anchors for currently active polygon (mouse over) if any
if ( polygon == activePolygon ) {
// draw anchors
g2d.setStroke(selectStrokeBlack);
g2d.setColor(Color.BLACK);
g2d.draw(polygon.getPolygonPath());
if ( (polygon.getType() == HiPolygonTypes.HI_FREEDESIGN) || (polygon.getType() == HiPolygonTypes.HI_FREEHAND) ) // only draw drag anchors for free design polygons
for (int i=0;i<polygon.size();i++)
drawAnchor(g2d, layer.getColour(), polygon.getPoint(i), 6);
if ( !polygon.isClosed() && polygon.size() > 0 ) {
// for open polygon paths: highlight the first and last anchor point
g2d.drawImage(closePathIcon,
polygon.getPoint(0).x-13, polygon.getPoint(0).y-3, 26, 17, null);
if ( polygon.size() > 1 )
drawAnchor(g2d, Color.WHITE, polygon.getPoint(polygon.size()-1), 6);
}
}
}
}
}
|
void function(Graphics g) { super.paint(g); Graphics2D g2d = (Graphics2D) g; for (int count=layers.size()-1; count>=0; count--) { HILayer layer = layers.get(count); combinedPath.reset(); for (RelativePolygon polygon : layer.getRelativePolygons()) if ( polygon.isClosed() ) combinedPath.append(polygon.getPolygonPath(), false); if ( layer == userSelectedLayer && highlightLayer && !isolationMode ) highlightPolygon(g2d, combinedPath, layer.getSolidColour(), 10); g2d.setColor(layer.getColour()); if ( !isolationMode layer == this.userSelectedLayer ) g2d.fill(combinedPath); for (RelativePolygon polygon : layer.getRelativePolygons()) { if ( !polygon.isClosed() ) { Composite orgComposite = g2d.getComposite(); g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.2f)); if (openPolygonTexturePaint!= null ) { g2d.setPaint(openPolygonTexturePaint); g2d.fill(polygon.getPolygonPath()); } g2d.setComposite(orgComposite); } if ( !isolationMode layer == userSelectedLayer) { if ( (polygon.getType() == HiPolygonTypes.HI_FREEDESIGN) (polygon.getType() == HiPolygonTypes.HI_FREEHAND) ) { g2d.setStroke(selectStrokeWhite); g2d.setColor(Color.WHITE); g2d.draw(polygon.getPolygonPath()); g2d.setStroke(selectStrokeBlack); g2d.setColor(layer.getColour().darker()); g2d.draw(polygon.getPolygonPath()); } else { g2d.setStroke(selectStrokeSolid); g2d.setColor(layer.getColour().darker()); g2d.draw(polygon.getPolygonPath()); } } else { g2d.setStroke(selectStrokeSolid); g2d.setColor(layer.getColour().darker()); g2d.draw(polygon.getPolygonPath()); g2d.setStroke(selectStrokeBlack); g2d.setColor(layer.getColour()); g2d.draw(polygon.getPolygonPath()); } if ( polygon == selectedPolygon ) drawResizeFrame(g2d, polygon.getPolygonPath()); if ( polygon == activePolygon ) { g2d.setStroke(selectStrokeBlack); g2d.setColor(Color.BLACK); g2d.draw(polygon.getPolygonPath()); if ( (polygon.getType() == HiPolygonTypes.HI_FREEDESIGN) (polygon.getType() == HiPolygonTypes.HI_FREEHAND) ) for (int i=0;i<polygon.size();i++) drawAnchor(g2d, layer.getColour(), polygon.getPoint(i), 6); if ( !polygon.isClosed() && polygon.size() > 0 ) { g2d.drawImage(closePathIcon, polygon.getPoint(0).x-13, polygon.getPoint(0).y-3, 26, 17, null); if ( polygon.size() > 1 ) drawAnchor(g2d, Color.WHITE, polygon.getPoint(polygon.size()-1), 6); } } } } }
|
/**
* Overrides @see DisplayJAI paint method. Adds the ability to display semi-transparent polygons on top of
* a background image.
*/
|
Overrides @see DisplayJAI paint method. Adds the ability to display semi-transparent polygons on top of a background image
|
paint
|
{
"repo_name": "bitgilde/HyperImage3",
"path": "hi3-editor/src/org/hyperimage/client/gui/PolygonEditorControl.java",
"license": "apache-2.0",
"size": 39910
}
|
[
"java.awt.AlphaComposite",
"java.awt.Color",
"java.awt.Composite",
"java.awt.Graphics",
"java.awt.Graphics2D",
"org.hyperimage.client.model.HILayer",
"org.hyperimage.client.model.RelativePolygon"
] |
import java.awt.AlphaComposite; import java.awt.Color; import java.awt.Composite; import java.awt.Graphics; import java.awt.Graphics2D; import org.hyperimage.client.model.HILayer; import org.hyperimage.client.model.RelativePolygon;
|
import java.awt.*; import org.hyperimage.client.model.*;
|
[
"java.awt",
"org.hyperimage.client"
] |
java.awt; org.hyperimage.client;
| 2,795,460
|
private static List<Point> generateNRandomPoints(int n) {
List<Point> randomPoints = new ArrayList<>(0);
for (int i = 0; i < n; i++) {
double x = StdRandom.uniform(0.00, 1.00);
double y = StdRandom.uniform(0.00, 1.00);
Point point = new Point(x, y);
StdOut.print(point);
randomPoints.add(point);
}
return randomPoints;
}
|
static List<Point> function(int n) { List<Point> randomPoints = new ArrayList<>(0); for (int i = 0; i < n; i++) { double x = StdRandom.uniform(0.00, 1.00); double y = StdRandom.uniform(0.00, 1.00); Point point = new Point(x, y); StdOut.print(point); randomPoints.add(point); } return randomPoints; }
|
/**
* generates n random points in a unit square.
* i.e. whose x & y coordinates lie between 0 and 1.
*
* @param n number of points required.
* @return list of random points.
*/
|
generates n random points in a unit square. i.e. whose x & y coordinates lie between 0 and 1
|
generateNRandomPoints
|
{
"repo_name": "pratiksanglikar/Data-Structures",
"path": "src/ds/pratiksanglikar/chapter1/exercise2/problem1/Ch1Exercise2Problem1.java",
"license": "gpl-3.0",
"size": 2228
}
|
[
"java.util.ArrayList",
"java.util.List"
] |
import java.util.ArrayList; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 958,040
|
public static DB get(String name) {
requireNonNull(name, "Name is null");
return instances.get(name);
}
public DB(DataSource dataSource) {
requireNonNull(dataSource, "Data source is null");
this.dataSource = dataSource;
}
|
static DB function(String name) { requireNonNull(name, STR); return instances.get(name); } public DB(DataSource dataSource) { requireNonNull(dataSource, STR); this.dataSource = dataSource; }
|
/**
* Get a registered DB instance.
*
* @param name the instance name
* @return the named DB instance
* @see #register(String)
*/
|
Get a registered DB instance
|
get
|
{
"repo_name": "ivanmelotte/iota",
"path": "src/main/java/io/melotte/iota/DB.java",
"license": "mit",
"size": 9496
}
|
[
"java.util.Objects",
"javax.sql.DataSource"
] |
import java.util.Objects; import javax.sql.DataSource;
|
import java.util.*; import javax.sql.*;
|
[
"java.util",
"javax.sql"
] |
java.util; javax.sql;
| 1,336,372
|
@SuppressWarnings("unchecked")
private void processOptionAttributes(Element element, Map<String, Map<ConfType, Object>> configs, String tableId) {
if (hasAttribute(element, "name")) {
String name = getStringValue(element, "name");
Option<?> configToken = DatatableOptions.findByName(name);
String value = getStringValue(element, "value");
if (configToken == null) {
throw new DandelionException("'" + name + "' is not a valid option. Please read the documentation.");
}
else {
if (configs.get(tableId).containsKey(ConfType.OPTION)) {
((Map<Option<?>, Object>) configs.get(tableId).get(ConfType.OPTION)).put(configToken, value);
}
else {
Map<Option<?>, Object> stagingConf = new HashMap<Option<?>, Object>();
stagingConf.put(configToken, value);
configs.get(tableId).put(ConfType.OPTION, stagingConf);
}
}
}
else {
throw new DandelionException("The attribute 'dt:name' is required when overloading a configuration option.");
}
}
|
@SuppressWarnings(STR) void function(Element element, Map<String, Map<ConfType, Object>> configs, String tableId) { if (hasAttribute(element, "name")) { String name = getStringValue(element, "name"); Option<?> configToken = DatatableOptions.findByName(name); String value = getStringValue(element, "value"); if (configToken == null) { throw new DandelionException("'" + name + STR); } else { if (configs.get(tableId).containsKey(ConfType.OPTION)) { ((Map<Option<?>, Object>) configs.get(tableId).get(ConfType.OPTION)).put(configToken, value); } else { Map<Option<?>, Object> stagingConf = new HashMap<Option<?>, Object>(); stagingConf.put(configToken, value); configs.get(tableId).put(ConfType.OPTION, stagingConf); } } } else { throw new DandelionException(STR); } }
|
/**
* <p>
* Processes attributes in order to overload locally the properties
* configured globally.
* </p>
*
* @param element
* The {@code div} element which holds the attribute.
*/
|
Processes attributes in order to overload locally the properties configured globally.
|
processOptionAttributes
|
{
"repo_name": "atreeyang/dandelion-datatables",
"path": "datatables-thymeleaf/src/main/java/com/github/dandelion/datatables/thymeleaf/processor/config/DivConfTypeAttrProcessor.java",
"license": "bsd-3-clause",
"size": 22194
}
|
[
"com.github.dandelion.core.DandelionException",
"com.github.dandelion.core.option.Option",
"com.github.dandelion.datatables.core.option.DatatableOptions",
"java.util.HashMap",
"java.util.Map",
"org.thymeleaf.dom.Element"
] |
import com.github.dandelion.core.DandelionException; import com.github.dandelion.core.option.Option; import com.github.dandelion.datatables.core.option.DatatableOptions; import java.util.HashMap; import java.util.Map; import org.thymeleaf.dom.Element;
|
import com.github.dandelion.core.*; import com.github.dandelion.core.option.*; import com.github.dandelion.datatables.core.option.*; import java.util.*; import org.thymeleaf.dom.*;
|
[
"com.github.dandelion",
"java.util",
"org.thymeleaf.dom"
] |
com.github.dandelion; java.util; org.thymeleaf.dom;
| 8,922
|
public static String quote(String string) {
StringWriter sw = new StringWriter();
synchronized (sw.getBuffer()) {
try {
return quote(string, sw).toString();
} catch (IOException ignored) {
// will never happen - we are writing to a string writer
return "";
}
}
}
|
static String function(String string) { StringWriter sw = new StringWriter(); synchronized (sw.getBuffer()) { try { return quote(string, sw).toString(); } catch (IOException ignored) { return ""; } } }
|
/**
* Produce a string in double quotes with backslash sequences in all the
* right places. A backslash will be inserted within </, producing <\/,
* allowing JSON text to be delivered in HTML. In JSON text, a string cannot
* contain a control character or an unescaped quote or backslash.
*
* @param string
* A String
* @return A String correctly formatted for insertion in a JSON text.
*/
|
Produce a string in double quotes with backslash sequences in all the right places. A backslash will be inserted within </, producing <\/, allowing JSON text to be delivered in HTML. In JSON text, a string cannot contain a control character or an unescaped quote or backslash
|
quote
|
{
"repo_name": "cping/RipplePower",
"path": "eclipse/jcoinlibs/src/org/json/JSONObject.java",
"license": "apache-2.0",
"size": 47491
}
|
[
"java.io.IOException",
"java.io.StringWriter"
] |
import java.io.IOException; import java.io.StringWriter;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,330,184
|
public JSONWebKey getKeyValue(String keyId) {
for (JSONWebKey JSONWebKey : keys) {
if (JSONWebKey.getKeyId().equals(keyId)) {
return JSONWebKey;
}
}
return null;
}
|
JSONWebKey function(String keyId) { for (JSONWebKey JSONWebKey : keys) { if (JSONWebKey.getKeyId().equals(keyId)) { return JSONWebKey; } } return null; }
|
/**
* Search and returns a {@link org.xdi.oxauth.model.jwk.JSONWebKey} given its <code>keyId</code>.
*
* @param keyId The key id.
* @return The JSONWebKey if found, otherwise <code>null</code>.
*/
|
Search and returns a <code>org.xdi.oxauth.model.jwk.JSONWebKey</code> given its <code>keyId</code>
|
getKeyValue
|
{
"repo_name": "diedertimmers/oxAuth",
"path": "Client/src/main/java/org/xdi/oxauth/client/JwkResponse.java",
"license": "mit",
"size": 3914
}
|
[
"org.xdi.oxauth.model.jwk.JSONWebKey"
] |
import org.xdi.oxauth.model.jwk.JSONWebKey;
|
import org.xdi.oxauth.model.jwk.*;
|
[
"org.xdi.oxauth"
] |
org.xdi.oxauth;
| 10,570
|
protected void applyCamelPostProcessor() throws Exception {
// use the bean post processor if the test class is not dependency injected already by Spring Framework
boolean spring = hasClassAnnotation("org.springframework.boot.test.context.SpringBootTest", "org.springframework.context.annotation.ComponentScan");
if (!spring) {
context.getExtension(ExtendedCamelContext.class).getBeanPostProcessor().postProcessBeforeInitialization(this, getClass().getName());
context.getExtension(ExtendedCamelContext.class).getBeanPostProcessor().postProcessAfterInitialization(this, getClass().getName());
}
}
|
void function() throws Exception { boolean spring = hasClassAnnotation(STR, STR); if (!spring) { context.getExtension(ExtendedCamelContext.class).getBeanPostProcessor().postProcessBeforeInitialization(this, getClass().getName()); context.getExtension(ExtendedCamelContext.class).getBeanPostProcessor().postProcessAfterInitialization(this, getClass().getName()); } }
|
/**
* Applies the {@link CamelBeanPostProcessor} to this instance.
*
* Derived classes using IoC / DI frameworks may wish to turn this into a NoOp such as for CDI
* we would just use CDI to inject this
*/
|
Applies the <code>CamelBeanPostProcessor</code> to this instance. Derived classes using IoC / DI frameworks may wish to turn this into a NoOp such as for CDI we would just use CDI to inject this
|
applyCamelPostProcessor
|
{
"repo_name": "Fabryprog/camel",
"path": "components/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java",
"license": "apache-2.0",
"size": 45851
}
|
[
"org.apache.camel.ExtendedCamelContext"
] |
import org.apache.camel.ExtendedCamelContext;
|
import org.apache.camel.*;
|
[
"org.apache.camel"
] |
org.apache.camel;
| 837,115
|
protected void activate(ComponentContext componentContext)
throws InvalidKeyException, NoSuchAlgorithmException,
IllegalStateException, UnsupportedEncodingException {
this.componentContext = componentContext;
Dictionary<?, ?> properties = componentContext.getProperties();
this.userAdminGroupName = OsgiUtil.toString(properties.get(PAR_USER_ADMIN_GROUP_NAME),
DEFAULT_USER_ADMIN_GROUP_NAME);
log.info("User Admin Group Name {}", this.userAdminGroupName);
this.groupAdminGroupName = OsgiUtil.toString(properties.get(PAR_GROUP_ADMIN_GROUP_NAME),
DEFAULT_GROUP_ADMIN_GROUP_NAME);
log.info("Group Admin Group Name {}", this.groupAdminGroupName);
}
|
void function(ComponentContext componentContext) throws InvalidKeyException, NoSuchAlgorithmException, IllegalStateException, UnsupportedEncodingException { this.componentContext = componentContext; Dictionary<?, ?> properties = componentContext.getProperties(); this.userAdminGroupName = OsgiUtil.toString(properties.get(PAR_USER_ADMIN_GROUP_NAME), DEFAULT_USER_ADMIN_GROUP_NAME); log.info(STR, this.userAdminGroupName); this.groupAdminGroupName = OsgiUtil.toString(properties.get(PAR_GROUP_ADMIN_GROUP_NAME), DEFAULT_GROUP_ADMIN_GROUP_NAME); log.info(STR, this.groupAdminGroupName); }
|
/**
* Called by SCR to activate the component.
*
* @throws InvalidKeyException
* @throws NoSuchAlgorithmException
* @throws IllegalStateException
* @throws UnsupportedEncodingException
*/
|
Called by SCR to activate the component
|
activate
|
{
"repo_name": "dulvac/sling",
"path": "bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/AuthorizablePrivilegesInfoImpl.java",
"license": "apache-2.0",
"size": 14749
}
|
[
"java.io.UnsupportedEncodingException",
"java.security.InvalidKeyException",
"java.security.NoSuchAlgorithmException",
"java.util.Dictionary",
"org.apache.sling.commons.osgi.OsgiUtil",
"org.osgi.service.component.ComponentContext"
] |
import java.io.UnsupportedEncodingException; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.util.Dictionary; import org.apache.sling.commons.osgi.OsgiUtil; import org.osgi.service.component.ComponentContext;
|
import java.io.*; import java.security.*; import java.util.*; import org.apache.sling.commons.osgi.*; import org.osgi.service.component.*;
|
[
"java.io",
"java.security",
"java.util",
"org.apache.sling",
"org.osgi.service"
] |
java.io; java.security; java.util; org.apache.sling; org.osgi.service;
| 1,598,938
|
private void printResults(OPT_IR ir) {
if (forward) {
System.out.println("Results of dominators computation for method " + ir.method.getName() + "\n");
System.out.println(" Here's the CFG:");
System.out.println(ir.cfg);
System.out.println("\n\n Here's the Dominator Info:");
} else {
System.out.println("Results of Post-Dominators computation for method " + ir.method.getName() + "\n");
System.out.println(" Here's the CFG:");
System.out.println(ir.cfg);
System.out.println("\n\n Here's the Post-Dominator Info:");
}
for (Enumeration<OPT_BasicBlock> bbEnum = cfg.basicBlocks(); bbEnum.hasMoreElements();) {
OPT_BasicBlock block = bbEnum.nextElement();
// We don't compute a result for the exit node for forward direction
if (!forward || !block.isExit()) {
System.out.println("Dominators of " + block + ":" + OPT_LTDominatorInfo.getInfo(block).dominators(block, ir));
}
}
System.out.println("\n");
}
|
void function(OPT_IR ir) { if (forward) { System.out.println(STR + ir.method.getName() + "\n"); System.out.println(STR); System.out.println(ir.cfg); System.out.println(STR); } else { System.out.println(STR + ir.method.getName() + "\n"); System.out.println(STR); System.out.println(ir.cfg); System.out.println(STR); } for (Enumeration<OPT_BasicBlock> bbEnum = cfg.basicBlocks(); bbEnum.hasMoreElements();) { OPT_BasicBlock block = bbEnum.nextElement(); if (!forward !block.isExit()) { System.out.println(STR + block + ":" + OPT_LTDominatorInfo.getInfo(block).dominators(block, ir)); } } System.out.println("\n"); }
|
/**
* Print the nodes that dominate each basic block
* @param ir the IR
*/
|
Print the nodes that dominate each basic block
|
printResults
|
{
"repo_name": "rmcilroy/HeraJVM",
"path": "rvm/src/org/jikesrvm/compilers/opt/OPT_LTDominators.java",
"license": "epl-1.0",
"size": 19434
}
|
[
"java.util.Enumeration"
] |
import java.util.Enumeration;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,003,308
|
public static RectangleEdge resolveRangeAxisLocation(
AxisLocation location, PlotOrientation orientation) {
ParamChecks.nullNotPermitted(location, "location");
ParamChecks.nullNotPermitted(orientation, "orientation");
RectangleEdge result = null;
if (location == AxisLocation.TOP_OR_RIGHT) {
if (orientation == PlotOrientation.HORIZONTAL) {
result = RectangleEdge.TOP;
}
else if (orientation == PlotOrientation.VERTICAL) {
result = RectangleEdge.RIGHT;
}
}
else if (location == AxisLocation.TOP_OR_LEFT) {
if (orientation == PlotOrientation.HORIZONTAL) {
result = RectangleEdge.TOP;
}
else if (orientation == PlotOrientation.VERTICAL) {
result = RectangleEdge.LEFT;
}
}
else if (location == AxisLocation.BOTTOM_OR_RIGHT) {
if (orientation == PlotOrientation.HORIZONTAL) {
result = RectangleEdge.BOTTOM;
}
else if (orientation == PlotOrientation.VERTICAL) {
result = RectangleEdge.RIGHT;
}
}
else if (location == AxisLocation.BOTTOM_OR_LEFT) {
if (orientation == PlotOrientation.HORIZONTAL) {
result = RectangleEdge.BOTTOM;
}
else if (orientation == PlotOrientation.VERTICAL) {
result = RectangleEdge.LEFT;
}
}
// the above should cover all the options...
if (result == null) {
throw new IllegalStateException("resolveRangeAxisLocation()");
}
return result;
}
|
static RectangleEdge function( AxisLocation location, PlotOrientation orientation) { ParamChecks.nullNotPermitted(location, STR); ParamChecks.nullNotPermitted(orientation, STR); RectangleEdge result = null; if (location == AxisLocation.TOP_OR_RIGHT) { if (orientation == PlotOrientation.HORIZONTAL) { result = RectangleEdge.TOP; } else if (orientation == PlotOrientation.VERTICAL) { result = RectangleEdge.RIGHT; } } else if (location == AxisLocation.TOP_OR_LEFT) { if (orientation == PlotOrientation.HORIZONTAL) { result = RectangleEdge.TOP; } else if (orientation == PlotOrientation.VERTICAL) { result = RectangleEdge.LEFT; } } else if (location == AxisLocation.BOTTOM_OR_RIGHT) { if (orientation == PlotOrientation.HORIZONTAL) { result = RectangleEdge.BOTTOM; } else if (orientation == PlotOrientation.VERTICAL) { result = RectangleEdge.RIGHT; } } else if (location == AxisLocation.BOTTOM_OR_LEFT) { if (orientation == PlotOrientation.HORIZONTAL) { result = RectangleEdge.BOTTOM; } else if (orientation == PlotOrientation.VERTICAL) { result = RectangleEdge.LEFT; } } if (result == null) { throw new IllegalStateException(STR); } return result; }
|
/**
* Resolves a range axis location for a given plot orientation.
*
* @param location the location (<code>null</code> not permitted).
* @param orientation the orientation (<code>null</code> not permitted).
*
* @return The edge (never <code>null</code>).
*/
|
Resolves a range axis location for a given plot orientation
|
resolveRangeAxisLocation
|
{
"repo_name": "ceabie/jfreechart",
"path": "source/org/jfree/chart/plot/Plot.java",
"license": "lgpl-2.1",
"size": 52271
}
|
[
"org.jfree.chart.axis.AxisLocation",
"org.jfree.chart.util.ParamChecks",
"org.jfree.ui.RectangleEdge"
] |
import org.jfree.chart.axis.AxisLocation; import org.jfree.chart.util.ParamChecks; import org.jfree.ui.RectangleEdge;
|
import org.jfree.chart.axis.*; import org.jfree.chart.util.*; import org.jfree.ui.*;
|
[
"org.jfree.chart",
"org.jfree.ui"
] |
org.jfree.chart; org.jfree.ui;
| 524,406
|
public static Channel createNewChannel(Connection conn, EstablishChannelRequestOne message, int timeStampOpen, String changeAddressServer, String changeAddressClient) throws SQLException {
PreparedStatement stmt = null;
try {
stmt = conn.prepareStatement("INSERT INTO channels (pub_key_client, pub_key_server, change_address_server, change_address_client , master_priv_key_server, timestamp_open, timestamp_close, establish_phase, is_ready, key_chain_depth, key_chain_child) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
DeterministicKey key = KeyDerivation.getMasterKey(MySQLConnection.getKeyCount(conn));
String masterKey = key.serializePrivB58(Constants.getNetwork());
// String masterKey = key.serializePrivB58();
stmt.setString(1, message.pubKey);
stmt.setString(2, Tools.byteToString(key.getPubKey()));
stmt.setString(3, changeAddressServer);
stmt.setString(4, changeAddressClient);
stmt.setString(5, masterKey);
stmt.setInt(6, timeStampOpen);
stmt.setInt(7, timeStampOpen + 60 * 60 * 24 * message.timeInDays);
stmt.setInt(8, 1);
stmt.setInt(9, 0);
stmt.setInt(10, ( message.timeInDays * 24 * 60 * 60 / Constants.TIMEFRAME_PER_KEY_DEPTH ) );
stmt.setInt(11, 0);
// System.out.println(stmt.toString());
// System.out.println(stmt.executeUpdate());
stmt.executeUpdate();
conn.commit();
Channel channel = MySQLConnection.getChannel(conn, message.pubKey);
// Channel channel = new Channel();
// channel.setMasterPrivateKeyServer(masterKey);
// channel.setPubKeyClient(message.pubKey);
// channel.setChangeAddressClient(changeAddressClient);
// channel.setChangeAddressServer(changeAddressServer);
// channel.setKeyChainChild(0);
// channel.setKeyChainDepth(( (int) (message.timeInDays * 24 * 60 * 60 / Constants.TIMEFRAME_PER_KEY_DEPTH ) ));
// conn.commit();
return channel;
} finally {
if(stmt != null) stmt.close();
}
}
|
static Channel function(Connection conn, EstablishChannelRequestOne message, int timeStampOpen, String changeAddressServer, String changeAddressClient) throws SQLException { PreparedStatement stmt = null; try { stmt = conn.prepareStatement(STR); DeterministicKey key = KeyDerivation.getMasterKey(MySQLConnection.getKeyCount(conn)); String masterKey = key.serializePrivB58(Constants.getNetwork()); stmt.setString(1, message.pubKey); stmt.setString(2, Tools.byteToString(key.getPubKey())); stmt.setString(3, changeAddressServer); stmt.setString(4, changeAddressClient); stmt.setString(5, masterKey); stmt.setInt(6, timeStampOpen); stmt.setInt(7, timeStampOpen + 60 * 60 * 24 * message.timeInDays); stmt.setInt(8, 1); stmt.setInt(9, 0); stmt.setInt(10, ( message.timeInDays * 24 * 60 * 60 / Constants.TIMEFRAME_PER_KEY_DEPTH ) ); stmt.setInt(11, 0); stmt.executeUpdate(); conn.commit(); Channel channel = MySQLConnection.getChannel(conn, message.pubKey); return channel; } finally { if(stmt != null) stmt.close(); } }
|
/**
* Create a new channel based on the request MessageOneRequest
* Will also create a new master key for us to use in this channel
*
* @param conn
* @param message
* @param pubkeyChannel
* @return
* @throws SQLException
*/
|
Create a new channel based on the request MessageOneRequest Will also create a new master key for us to use in this channel
|
createNewChannel
|
{
"repo_name": "martindale/thundernetwork",
"path": "thunder-client/src/main/java/network/thunder/client/database/MySQLConnection.java",
"license": "agpl-3.0",
"size": 77132
}
|
[
"java.sql.Connection",
"java.sql.PreparedStatement",
"java.sql.SQLException",
"network.thunder.client.communications.objects.EstablishChannelRequestOne",
"network.thunder.client.database.objects.Channel",
"network.thunder.client.etc.Constants",
"network.thunder.client.etc.KeyDerivation",
"network.thunder.client.etc.Tools",
"org.bitcoinj.crypto.DeterministicKey"
] |
import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; import network.thunder.client.communications.objects.EstablishChannelRequestOne; import network.thunder.client.database.objects.Channel; import network.thunder.client.etc.Constants; import network.thunder.client.etc.KeyDerivation; import network.thunder.client.etc.Tools; import org.bitcoinj.crypto.DeterministicKey;
|
import java.sql.*; import network.thunder.client.communications.objects.*; import network.thunder.client.database.objects.*; import network.thunder.client.etc.*; import org.bitcoinj.crypto.*;
|
[
"java.sql",
"network.thunder.client",
"org.bitcoinj.crypto"
] |
java.sql; network.thunder.client; org.bitcoinj.crypto;
| 1,161,145
|
protected Promise<Pair<? extends Version, VersionedValue<VersionState>>> nextFuture() {
final Promise<Pair<? extends Version, VersionedValue<VersionState>>> future = this.future;
this.future = LoggingFutureListener.listen(logger, SettableFuturePromise.<Pair<? extends Version, VersionedValue<VersionState>>>create());
return future;
}
private final class Pending<V> extends SimpleToStringListenableFuture<V> implements Runnable {
private Pending(ListenableFuture<V> delegate) {
super(delegate);
pending.add(this);
}
|
Promise<Pair<? extends Version, VersionedValue<VersionState>>> function() { final Promise<Pair<? extends Version, VersionedValue<VersionState>>> future = this.future; this.future = LoggingFutureListener.listen(logger, SettableFuturePromise.<Pair<? extends Version, VersionedValue<VersionState>>>create()); return future; } private final class Pending<V> extends SimpleToStringListenableFuture<V> implements Runnable { private Pending(ListenableFuture<V> delegate) { super(delegate); pending.add(this); }
|
/**
* assumes write lock is held
*/
|
assumes write lock is held
|
nextFuture
|
{
"repo_name": "lisaglendenning/safari",
"path": "src/main/java/edu/uw/zookeeper/safari/storage/volumes/VolumeVersionCache.java",
"license": "apache-2.0",
"size": 54338
}
|
[
"com.google.common.util.concurrent.ListenableFuture",
"edu.uw.zookeeper.common.LoggingFutureListener",
"edu.uw.zookeeper.common.Pair",
"edu.uw.zookeeper.common.Promise",
"edu.uw.zookeeper.common.SettableFuturePromise",
"edu.uw.zookeeper.common.ToStringListenableFuture",
"edu.uw.zookeeper.safari.VersionedValue"
] |
import com.google.common.util.concurrent.ListenableFuture; import edu.uw.zookeeper.common.LoggingFutureListener; import edu.uw.zookeeper.common.Pair; import edu.uw.zookeeper.common.Promise; import edu.uw.zookeeper.common.SettableFuturePromise; import edu.uw.zookeeper.common.ToStringListenableFuture; import edu.uw.zookeeper.safari.VersionedValue;
|
import com.google.common.util.concurrent.*; import edu.uw.zookeeper.common.*; import edu.uw.zookeeper.safari.*;
|
[
"com.google.common",
"edu.uw.zookeeper"
] |
com.google.common; edu.uw.zookeeper;
| 2,494,281
|
public void testNewParameterizedTypeImmutability() {
Type[] typesIn = { String.class, Integer.class };
ParameterizedType parameterizedType
= Types.newParameterizedType(Map.class, typesIn);
typesIn[0] = null;
typesIn[1] = null;
Type[] typesOut = parameterizedType.getActualTypeArguments();
typesOut[0] = null;
typesOut[1] = null;
assertEquals(String.class, parameterizedType.getActualTypeArguments()[0]);
assertEquals(Integer.class, parameterizedType.getActualTypeArguments()[1]);
}
|
void function() { Type[] typesIn = { String.class, Integer.class }; ParameterizedType parameterizedType = Types.newParameterizedType(Map.class, typesIn); typesIn[0] = null; typesIn[1] = null; Type[] typesOut = parameterizedType.getActualTypeArguments(); typesOut[0] = null; typesOut[1] = null; assertEquals(String.class, parameterizedType.getActualTypeArguments()[0]); assertEquals(Integer.class, parameterizedType.getActualTypeArguments()[1]); }
|
/**
* Working with arrays requires defensive code. Verify that we clone the
* type array for both input and output.
*/
|
Working with arrays requires defensive code. Verify that we clone the type array for both input and output
|
testNewParameterizedTypeImmutability
|
{
"repo_name": "DaveAKing/guava-libraries",
"path": "guava-tests/test/com/google/common/reflect/TypesTest.java",
"license": "apache-2.0",
"size": 15386
}
|
[
"java.lang.reflect.ParameterizedType",
"java.lang.reflect.Type",
"java.util.Map"
] |
import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.util.Map;
|
import java.lang.reflect.*; import java.util.*;
|
[
"java.lang",
"java.util"
] |
java.lang; java.util;
| 1,658,482
|
public void init(
boolean forEncryption,
CipherParameters params)
{
if (params instanceof KeyParameter)
{
workingKey = generateWorkingKey(((KeyParameter)params).getKey());
this.forEncryption = forEncryption;
return;
}
throw new IllegalArgumentException("invalid parameter passed to Rijndael init - " + params.getClass().getName());
}
|
void function( boolean forEncryption, CipherParameters params) { if (params instanceof KeyParameter) { workingKey = generateWorkingKey(((KeyParameter)params).getKey()); this.forEncryption = forEncryption; return; } throw new IllegalArgumentException(STR + params.getClass().getName()); }
|
/**
* initialise a Rijndael cipher.
*
* @param forEncryption whether or not we are for encryption.
* @param params the parameters required to set up the cipher.
* @exception IllegalArgumentException if the params argument is
* inappropriate.
*/
|
initialise a Rijndael cipher
|
init
|
{
"repo_name": "Skywalker-11/spongycastle",
"path": "core/src/main/java/org/spongycastle/crypto/engines/RijndaelEngine.java",
"license": "mit",
"size": 30090
}
|
[
"org.spongycastle.crypto.CipherParameters",
"org.spongycastle.crypto.params.KeyParameter"
] |
import org.spongycastle.crypto.CipherParameters; import org.spongycastle.crypto.params.KeyParameter;
|
import org.spongycastle.crypto.*; import org.spongycastle.crypto.params.*;
|
[
"org.spongycastle.crypto"
] |
org.spongycastle.crypto;
| 1,895,985
|
@see org.hl7.rim.Employee#setJobClassCode
*/
public void setJobClassCode(CE jobClassCode) {
if(jobClassCode instanceof org.hl7.hibernate.ClonableCollection)
jobClassCode = ((org.hl7.hibernate.ClonableCollection<CE>) jobClassCode).cloneHibernateCollectionIfNecessary();
_jobClassCode = jobClassCode;
}
|
@see org.hl7.rim.Employee#setJobClassCode */ void function(CE jobClassCode) { if(jobClassCode instanceof org.hl7.hibernate.ClonableCollection) jobClassCode = ((org.hl7.hibernate.ClonableCollection<CE>) jobClassCode).cloneHibernateCollectionIfNecessary(); _jobClassCode = jobClassCode; }
|
/** Sets the property jobClassCode.
@see org.hl7.rim.Employee#setJobClassCode
*/
|
Sets the property jobClassCode
|
setJobClassCode
|
{
"repo_name": "markusgumbel/dshl7",
"path": "hl7-javasig/gencode/org/hl7/rim/impl/EmployeeImpl.java",
"license": "apache-2.0",
"size": 8405
}
|
[
"org.hl7.rim.Employee"
] |
import org.hl7.rim.Employee;
|
import org.hl7.rim.*;
|
[
"org.hl7.rim"
] |
org.hl7.rim;
| 766,585
|
public Map<String,String> getAll( ) {
return mapArgs;
}
|
Map<String,String> function( ) { return mapArgs; }
|
/**
* Gets the all.
*
* @return the all
*/
|
Gets the all
|
getAll
|
{
"repo_name": "petezybrick/iote2e",
"path": "iote2e-common/src/main/java/com/pzybrick/iote2e/common/utils/ArgMap.java",
"license": "apache-2.0",
"size": 4052
}
|
[
"java.util.Map"
] |
import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,185,419
|
public void addSeparator(String menuName) {
JMenu temp = null;
for (String name : menuNames.keySet()){
if (name.equals(menuName)) {
temp = menuNames.get(name);
break;
}
}
if (temp == null) temp = new JMenu();
temp.addSeparator();
}
|
void function(String menuName) { JMenu temp = null; for (String name : menuNames.keySet()){ if (name.equals(menuName)) { temp = menuNames.get(name); break; } } if (temp == null) temp = new JMenu(); temp.addSeparator(); }
|
/**
* add separator in menu bar
* @param menuName main menu name
*/
|
add separator in menu bar
|
addSeparator
|
{
"repo_name": "andyballer/battleGame",
"path": "src/display/util/MenuBar.java",
"license": "mit",
"size": 2085
}
|
[
"javax.swing.JMenu"
] |
import javax.swing.JMenu;
|
import javax.swing.*;
|
[
"javax.swing"
] |
javax.swing;
| 2,181,360
|
@Method(selector = "purgePullQueue:completionBlock:")
public native void purgePullQueue(String queueName, @Block App42ResponseBlock completionBlock);
|
@Method(selector = STR) native void function(String queueName, @Block App42ResponseBlock completionBlock);
|
/**
* Purges message on the Queue. Note: once the Queue is purged the messages
* are removed from the Queue and wont be available for dequeuing.
*
* @param queueName
* - The name of the queue which has to be purged
*
* @return App42Response object containing queue name which has been purged
*
*/
|
Purges message on the Queue. Note: once the Queue is purged the messages are removed from the Queue and wont be available for dequeuing
|
purgePullQueue
|
{
"repo_name": "mariamKh/robovm-ios-bindings",
"path": "app42/src/org/robovm/bindings/app42/QueueService.java",
"license": "apache-2.0",
"size": 5228
}
|
[
"org.robovm.objc.annotation.Block",
"org.robovm.objc.annotation.Method"
] |
import org.robovm.objc.annotation.Block; import org.robovm.objc.annotation.Method;
|
import org.robovm.objc.annotation.*;
|
[
"org.robovm.objc"
] |
org.robovm.objc;
| 1,632,592
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.