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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
@Override
public Collection<GitClientApplication> getClientApplications() {
// prefer user definitions, if they exist
File userDefs = new File(runtimeManager.getBaseFolder(), "clientapps.json");
if (userDefs.exists()) {
Date lastModified = new Date(userDefs.lastModified());
if (clientApplications.hasCurrent("user", lastModified)) {
return clientApplications.getObject("user");
} else {
// (re)load user definitions
try {
InputStream is = new FileInputStream(userDefs);
Collection<GitClientApplication> clients = readClientApplications(is);
is.close();
if (clients != null) {
clientApplications.updateObject("user", lastModified, clients);
return clients;
}
} catch (IOException e) {
logger.error("Failed to deserialize " + userDefs.getAbsolutePath(), e);
}
}
}
// no user definitions, use system definitions
if (!clientApplications.hasCurrent("system", new Date(0))) {
try {
InputStream is = GitblitManager.class.getResourceAsStream("/clientapps.json");
Collection<GitClientApplication> clients = readClientApplications(is);
is.close();
if (clients != null) {
clientApplications.updateObject("system", new Date(0), clients);
}
} catch (IOException e) {
logger.error("Failed to deserialize clientapps.json resource!", e);
}
}
return clientApplications.getObject("system");
} | Collection<GitClientApplication> function() { File userDefs = new File(runtimeManager.getBaseFolder(), STR); if (userDefs.exists()) { Date lastModified = new Date(userDefs.lastModified()); if (clientApplications.hasCurrent("user", lastModified)) { return clientApplications.getObject("user"); } else { try { InputStream is = new FileInputStream(userDefs); Collection<GitClientApplication> clients = readClientApplications(is); is.close(); if (clients != null) { clientApplications.updateObject("user", lastModified, clients); return clients; } } catch (IOException e) { logger.error(STR + userDefs.getAbsolutePath(), e); } } } if (!clientApplications.hasCurrent(STR, new Date(0))) { try { InputStream is = GitblitManager.class.getResourceAsStream(STR); Collection<GitClientApplication> clients = readClientApplications(is); is.close(); if (clients != null) { clientApplications.updateObject(STR, new Date(0), clients); } } catch (IOException e) { logger.error(STR, e); } } return clientApplications.getObject(STR); } | /**
* Returns the list of custom client applications to be used for the
* repository url panel;
*
* @return a collection of client applications
*/ | Returns the list of custom client applications to be used for the repository url panel | getClientApplications | {
"repo_name": "wellington-junio/gitblit",
"path": "src/main/java/com/gitblit/manager/GitblitManager.java",
"license": "apache-2.0",
"size": 37481
} | [
"com.gitblit.models.GitClientApplication",
"java.io.File",
"java.io.FileInputStream",
"java.io.IOException",
"java.io.InputStream",
"java.util.Collection",
"java.util.Date"
] | import com.gitblit.models.GitClientApplication; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.Collection; import java.util.Date; | import com.gitblit.models.*; import java.io.*; import java.util.*; | [
"com.gitblit.models",
"java.io",
"java.util"
] | com.gitblit.models; java.io; java.util; | 1,385,242 |
public void refreshServiceAcl(Configuration conf, PolicyProvider provider) {
serviceAuthorizationManager.refresh(conf, provider);
} | void function(Configuration conf, PolicyProvider provider) { serviceAuthorizationManager.refresh(conf, provider); } | /**
* Refresh the service authorization ACL for the service handled by this server.
*/ | Refresh the service authorization ACL for the service handled by this server | refreshServiceAcl | {
"repo_name": "apurtell/hadoop",
"path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java",
"license": "apache-2.0",
"size": 146393
} | [
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.security.authorize.PolicyProvider"
] | import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.security.authorize.PolicyProvider; | import org.apache.hadoop.conf.*; import org.apache.hadoop.security.authorize.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 2,596,745 |
public boolean isNull(Column column)
throws SQLException
{
return column.isNull(_buffer, _rowOffset);
} | boolean function(Column column) throws SQLException { return column.isNull(_buffer, _rowOffset); } | /**
* Returns true if the column is null.
*/ | Returns true if the column is null | isNull | {
"repo_name": "dlitz/resin",
"path": "modules/resin/src/com/caucho/db/table/TableIterator.java",
"license": "gpl-2.0",
"size": 11080
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,468,011 |
public final MetaProperty<Currency> callCurrency() {
return _callCurrency;
} | final MetaProperty<Currency> function() { return _callCurrency; } | /**
* The meta-property for the {@code callCurrency} property.
* @return the meta-property, not null
*/ | The meta-property for the callCurrency property | callCurrency | {
"repo_name": "McLeodMoores/starling",
"path": "projects/financial-types/src/main/java/com/opengamma/financial/security/option/FXOptionSecurity.java",
"license": "apache-2.0",
"size": 21800
} | [
"com.opengamma.util.money.Currency",
"org.joda.beans.MetaProperty"
] | import com.opengamma.util.money.Currency; import org.joda.beans.MetaProperty; | import com.opengamma.util.money.*; import org.joda.beans.*; | [
"com.opengamma.util",
"org.joda.beans"
] | com.opengamma.util; org.joda.beans; | 297,661 |
public Enumeration<String> enumerateRuleFile(
) {
return Collections.enumeration(this._ruleFileList);
} | Enumeration<String> function( ) { return Collections.enumeration(this._ruleFileList); } | /**
* Method enumerateRuleFile.
*
* @return an Enumeration over all possible elements of this
* collection
*/ | Method enumerateRuleFile | enumerateRuleFile | {
"repo_name": "tdefilip/opennms",
"path": "opennms-correlation/drools-correlation-engine/src/main/java/org/opennms/netmgt/correlation/drools/config/RuleSet.java",
"license": "agpl-3.0",
"size": 26206
} | [
"java.util.Collections",
"java.util.Enumeration"
] | import java.util.Collections; import java.util.Enumeration; | import java.util.*; | [
"java.util"
] | java.util; | 1,420,007 |
public void transfer(Channel channel) {
if (paused || eventLoopGroup == null) {
throw ActiveMQMessageBundle.BUNDLE.acceptorUnavailable();
}
channel.pipeline().addLast(protocolHandler.getProtocolDecoder());
} | void function(Channel channel) { if (paused eventLoopGroup == null) { throw ActiveMQMessageBundle.BUNDLE.acceptorUnavailable(); } channel.pipeline().addLast(protocolHandler.getProtocolDecoder()); } | /**
* Transfers the Netty channel that has been created outside of this NettyAcceptor
* to control it and configure it according to this NettyAcceptor setting.
*
* @param channel A Netty channel created outside this NettyAcceptor.
*/ | Transfers the Netty channel that has been created outside of this NettyAcceptor to control it and configure it according to this NettyAcceptor setting | transfer | {
"repo_name": "mnovak1/activemq-artemis",
"path": "artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java",
"license": "apache-2.0",
"size": 37256
} | [
"io.netty.channel.Channel",
"org.apache.activemq.artemis.core.server.ActiveMQMessageBundle"
] | import io.netty.channel.Channel; import org.apache.activemq.artemis.core.server.ActiveMQMessageBundle; | import io.netty.channel.*; import org.apache.activemq.artemis.core.server.*; | [
"io.netty.channel",
"org.apache.activemq"
] | io.netty.channel; org.apache.activemq; | 981,293 |
public void write(String name, String value) throws IOException {
this.write(name, value, false);
} | void function(String name, String value) throws IOException { this.write(name, value, false); } | /**
* Writes a character array variable to the MAT-file.
* @param name The name of the variable.
* @param value The <code>String</code> to write.
* @throws IOException if writing to the underlying stream fails.
*/ | Writes a character array variable to the MAT-file | write | {
"repo_name": "bwkimmel/jmist",
"path": "jmist-core/src/main/java/ca/eandb/jmist/util/matlab/MatlabWriter.java",
"license": "mit",
"size": 83818
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 192,274 |
public Request getRequest() {
return request;
} | Request function() { return request; } | /** Get the request associated with this processor.
*
* @return The request
*/ | Get the request associated with this processor | getRequest | {
"repo_name": "plumer/codana",
"path": "tomcat_files/7.0.0/AbstractHttp11Processor.java",
"license": "mit",
"size": 18790
} | [
"org.apache.coyote.Request"
] | import org.apache.coyote.Request; | import org.apache.coyote.*; | [
"org.apache.coyote"
] | org.apache.coyote; | 1,720,794 |
public void setTint(ColorStateList tint) {
if (mTint == tint) return;
mTint = tint;
updateTintColor();
} | void function(ColorStateList tint) { if (mTint == tint) return; mTint = tint; updateTintColor(); } | /**
* Sets the tint color for the given Drawable for all button states.
* @param tint The set of colors to use to color the ImageButton.
*/ | Sets the tint color for the given Drawable for all button states | setTint | {
"repo_name": "wuhengzhi/chromium-crosswalk",
"path": "chrome/android/java/src/org/chromium/chrome/browser/widget/TintedDrawable.java",
"license": "bsd-3-clause",
"size": 2341
} | [
"android.content.res.ColorStateList"
] | import android.content.res.ColorStateList; | import android.content.res.*; | [
"android.content"
] | android.content; | 1,448,992 |
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
timelineTable.setEnabled(true);
} | void function(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); timelineTable.setEnabled(true); } | /**
* This method is used to re-enable table selection once the user returns from viewing
* just a single table entry in another activity. The whole enable/disable is used to
* prevent the user from spam-clicking on slower devices and opening up many activities.
*/ | This method is used to re-enable table selection once the user returns from viewing just a single table entry in another activity. The whole enable/disable is used to prevent the user from spam-clicking on slower devices and opening up many activities | onActivityResult | {
"repo_name": "istanev93/iPixo",
"path": "ipixo/src/main/java/com/ebusinessuk/ipixo/ui/home/fragment/CirclesFacesFragment.java",
"license": "agpl-3.0",
"size": 1785
} | [
"android.content.Intent"
] | import android.content.Intent; | import android.content.*; | [
"android.content"
] | android.content; | 1,332,460 |
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter a sentence:");
return br.readLine();
} | BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); System.out.println(STR); return br.readLine(); } | /**
* Read a sentence from the console
*
* @return The typed sentence
* @throws IOException
*/ | Read a sentence from the console | readSentence | {
"repo_name": "jdtimmerman/orm-prototyper",
"path": "OrmLibraryAPI/src/main/java/nl/ru/jtimmerm/orm/GrammarTester.java",
"license": "gpl-3.0",
"size": 1883
} | [
"java.io.BufferedReader",
"java.io.InputStreamReader"
] | import java.io.BufferedReader; import java.io.InputStreamReader; | import java.io.*; | [
"java.io"
] | java.io; | 1,840,029 |
@Id
@Basic( optional = false )
@Column( name = "id", nullable = false ) @org.hibernate.annotations.Type(type="org.hibernate.type.PostgresUUIDType")
public java.util.UUID getId() {
return this.id;
} | @Basic( optional = false ) @Column( name = "id", nullable = false ) @org.hibernate.annotations.Type(type=STR) java.util.UUID function() { return this.id; } | /**
* Return the value associated with the column: id.
* @return A java.util.UUID object (this.id)
*/ | Return the value associated with the column: id | getId | {
"repo_name": "servinglynk/hmis-lynk-open-source",
"path": "hmis-model-v2016/src/main/java/com/servinglynk/hmis/warehouse/model/v2016/Project.java",
"license": "mpl-2.0",
"size": 18010
} | [
"javax.persistence.Basic",
"javax.persistence.Column",
"org.hibernate.annotations.Type"
] | import javax.persistence.Basic; import javax.persistence.Column; import org.hibernate.annotations.Type; | import javax.persistence.*; import org.hibernate.annotations.*; | [
"javax.persistence",
"org.hibernate.annotations"
] | javax.persistence; org.hibernate.annotations; | 1,888,634 |
public static AccountDAO getDefault() {
return (AccountDAO) SpringUtils.getSpringBean("daoAccount");
}
public AccountDAO() {
super(false);
} | static AccountDAO function() { return (AccountDAO) SpringUtils.getSpringBean(STR); } public AccountDAO() { super(false); } | /**
* Get default AccountDAO as defined in Spring's configuration file.
*
* @return the default singleton AccountDAO
*/ | Get default AccountDAO as defined in Spring's configuration file | getDefault | {
"repo_name": "terrex/tntconcept-materials-testing",
"path": "src/main/java/com/autentia/intra/dao/hibernate/AccountDAO.java",
"license": "gpl-2.0",
"size": 4209
} | [
"com.autentia.intra.util.SpringUtils"
] | import com.autentia.intra.util.SpringUtils; | import com.autentia.intra.util.*; | [
"com.autentia.intra"
] | com.autentia.intra; | 446,050 |
protected void createProperty(String tikaKey, String ns, String propertyName)
throws XMPException {
String value = metadata.get( tikaKey );
if (value != null && value.length() > 0) {
meta.setProperty( ns, propertyName, value );
}
} | void function(String tikaKey, String ns, String propertyName) throws XMPException { String value = metadata.get( tikaKey ); if (value != null && value.length() > 0) { meta.setProperty( ns, propertyName, value ); } } | /**
* Creates a simple property.
*
* @param tikaKey
* Key in the Tika metadata map
* @param ns
* namespace the property should be created in
* @param propertyName
* name of the property
* @throws XMPException
* if the property could not be created
*/ | Creates a simple property | createProperty | {
"repo_name": "zamattiac/tika",
"path": "tika-xmp/src/main/java/org/apache/tika/xmp/convert/AbstractConverter.java",
"license": "apache-2.0",
"size": 7434
} | [
"com.adobe.xmp.XMPException"
] | import com.adobe.xmp.XMPException; | import com.adobe.xmp.*; | [
"com.adobe.xmp"
] | com.adobe.xmp; | 1,678,837 |
public Stopwatch stop() {
long tick = ticker.read();
checkState(isRunning, "This stopwatch is already stopped.");
isRunning = false;
elapsedNanos += tick - startTick;
return this;
} | Stopwatch function() { long tick = ticker.read(); checkState(isRunning, STR); isRunning = false; elapsedNanos += tick - startTick; return this; } | /**
* Stops the stopwatch. Future reads will return the fixed duration that had
* elapsed up to this point.
*
* @return this {@code Stopwatch} instance
* @throws IllegalStateException if the stopwatch is already stopped.
*/ | Stops the stopwatch. Future reads will return the fixed duration that had elapsed up to this point | stop | {
"repo_name": "wolffcm/voltdb",
"path": "third_party/java/src/com/google_voltpatches/common/base/Stopwatch.java",
"license": "agpl-3.0",
"size": 7802
} | [
"com.google_voltpatches.common.base.Preconditions"
] | import com.google_voltpatches.common.base.Preconditions; | import com.google_voltpatches.common.base.*; | [
"com.google_voltpatches.common"
] | com.google_voltpatches.common; | 991,329 |
@Override
public String getQuickInfo() {
String result;
result = QuickInfoHelper.toString(this, "URL", m_URL, "URL: ");
result += QuickInfoHelper.toString(this, "method", m_Method, ", method: ");
result += QuickInfoHelper.toString(this, "mimeType", (m_MimeType.isEmpty() ? MediaTypeHelper.OCTECT_STREAM : m_MimeType), ", mime-type: ");
return result;
} | String function() { String result; result = QuickInfoHelper.toString(this, "URL", m_URL, STR); result += QuickInfoHelper.toString(this, STR, m_Method, STR); result += QuickInfoHelper.toString(this, STR, (m_MimeType.isEmpty() ? MediaTypeHelper.OCTECT_STREAM : m_MimeType), STR); return result; } | /**
* Returns a quick info about the actor, which will be displayed in the GUI.
*
* @return null if no info available, otherwise short string
*/ | Returns a quick info about the actor, which will be displayed in the GUI | getQuickInfo | {
"repo_name": "waikato-datamining/adams-base",
"path": "adams-net/src/main/java/adams/flow/transformer/HttpRequest.java",
"license": "gpl-3.0",
"size": 10972
} | [
"com.github.fracpete.requests4j.core.MediaTypeHelper",
"com.github.fracpete.requests4j.request.Method"
] | import com.github.fracpete.requests4j.core.MediaTypeHelper; import com.github.fracpete.requests4j.request.Method; | import com.github.fracpete.requests4j.core.*; import com.github.fracpete.requests4j.request.*; | [
"com.github.fracpete"
] | com.github.fracpete; | 726,992 |
private DetachedCriteria getDetachedCriteriaProceduresForObservablePropertyFromSeries(
String observablePropertyIdentifier, Session session) throws OwsExceptionReport {
final DetachedCriteria detachedCriteria =
DetachedCriteria.forClass(getDaoFactory().getSeriesDAO().getSeriesClass());
detachedCriteria.add(Restrictions.eq(DatasetEntity.PROPERTY_DELETED, false));
detachedCriteria.createCriteria(DatasetEntity.PROPERTY_PHENOMENON)
.add(Restrictions.eq(PhenomenonEntity.IDENTIFIER, observablePropertyIdentifier));
detachedCriteria.setProjection(Projections.distinct(Projections.property(DatasetEntity.PROPERTY_PROCEDURE)));
return detachedCriteria;
} | DetachedCriteria function( String observablePropertyIdentifier, Session session) throws OwsExceptionReport { final DetachedCriteria detachedCriteria = DetachedCriteria.forClass(getDaoFactory().getSeriesDAO().getSeriesClass()); detachedCriteria.add(Restrictions.eq(DatasetEntity.PROPERTY_DELETED, false)); detachedCriteria.createCriteria(DatasetEntity.PROPERTY_PHENOMENON) .add(Restrictions.eq(PhenomenonEntity.IDENTIFIER, observablePropertyIdentifier)); detachedCriteria.setProjection(Projections.distinct(Projections.property(DatasetEntity.PROPERTY_PROCEDURE))); return detachedCriteria; } | /**
* Get Hibernate Detached Criteria for class Series and observableProperty
* identifier
*
* @param observablePropertyIdentifier
* ObservableProperty identifier parameter
* @param session
* Hibernate session
* @return Hiberante Detached Criteria with ProcedureEntity entities
* @throws CodedException
*/ | Get Hibernate Detached Criteria for class Series and observableProperty identifier | getDetachedCriteriaProceduresForObservablePropertyFromSeries | {
"repo_name": "autermann/SOS",
"path": "hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/ProcedureDAO.java",
"license": "gpl-2.0",
"size": 50312
} | [
"org.hibernate.Session",
"org.hibernate.criterion.DetachedCriteria",
"org.hibernate.criterion.Projections",
"org.hibernate.criterion.Restrictions",
"org.n52.series.db.beans.DatasetEntity",
"org.n52.series.db.beans.PhenomenonEntity",
"org.n52.shetland.ogc.ows.exception.OwsExceptionReport"
] | import org.hibernate.Session; import org.hibernate.criterion.DetachedCriteria; import org.hibernate.criterion.Projections; import org.hibernate.criterion.Restrictions; import org.n52.series.db.beans.DatasetEntity; import org.n52.series.db.beans.PhenomenonEntity; import org.n52.shetland.ogc.ows.exception.OwsExceptionReport; | import org.hibernate.*; import org.hibernate.criterion.*; import org.n52.series.db.beans.*; import org.n52.shetland.ogc.ows.exception.*; | [
"org.hibernate",
"org.hibernate.criterion",
"org.n52.series",
"org.n52.shetland"
] | org.hibernate; org.hibernate.criterion; org.n52.series; org.n52.shetland; | 324,159 |
protected int nextInTopLevel() throws IOException, XMLException {
switch (current) {
case 0x9:
case 0xA:
case 0xD:
case 0x20:
do {
nextChar();
} while (current != -1 &&
XMLUtilities.isXMLSpace((char)current));
return LexicalUnits.S;
case '<':
switch (nextChar()) {
case '?':
context = PI_CONTEXT;
return readPIStart();
case '!':
switch (nextChar()) {
case '-':
return readComment();
case 'D':
context = DOCTYPE_CONTEXT;
return readIdentifier("OCTYPE",
LexicalUnits.DOCTYPE_START,
-1);
default:
throw createXMLException("invalid.character");
}
default:
context = START_TAG_CONTEXT;
depth++;
return readName(LexicalUnits.START_TAG);
}
case -1:
return LexicalUnits.EOF;
default:
throw createXMLException("invalid.character");
}
} | int function() throws IOException, XMLException { switch (current) { case 0x9: case 0xA: case 0xD: case 0x20: do { nextChar(); } while (current != -1 && XMLUtilities.isXMLSpace((char)current)); return LexicalUnits.S; case '<': switch (nextChar()) { case '?': context = PI_CONTEXT; return readPIStart(); case '!': switch (nextChar()) { case '-': return readComment(); case 'D': context = DOCTYPE_CONTEXT; return readIdentifier(STR, LexicalUnits.DOCTYPE_START, -1); default: throw createXMLException(STR); } default: context = START_TAG_CONTEXT; depth++; return readName(LexicalUnits.START_TAG); } case -1: return LexicalUnits.EOF; default: throw createXMLException(STR); } } | /**
* Advances to the next lexical unit in the top level context.
* @return The type of the lexical unit like defined in LexicalUnits.
*/ | Advances to the next lexical unit in the top level context | nextInTopLevel | {
"repo_name": "shyamalschandra/flex-sdk",
"path": "modules/thirdparty/batik/sources/org/apache/flex/forks/batik/xml/XMLScanner.java",
"license": "apache-2.0",
"size": 60952
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,041,824 |
public QueryManager getQueryManager() {
return queryManager;
} | QueryManager function() { return queryManager; } | /**
* Gets query manager. Contains all information about queries and provides methods to get them.
*
* @return query manager
*/ | Gets query manager. Contains all information about queries and provides methods to get them | getQueryManager | {
"repo_name": "jmingo-projects/jmingo",
"path": "jmingo-core/src/main/java/org/jmingo/context/Context.java",
"license": "gpl-3.0",
"size": 8801
} | [
"org.jmingo.query.QueryManager"
] | import org.jmingo.query.QueryManager; | import org.jmingo.query.*; | [
"org.jmingo.query"
] | org.jmingo.query; | 2,790,562 |
public static <T> T prop(JavaScriptObject o, Object id, Class<? extends T> type) {
return o == null ? null : o.<JsCache> cast().get(id, type);
} | static <T> T function(JavaScriptObject o, Object id, Class<? extends T> type) { return o == null ? null : o.<JsCache> cast().get(id, type); } | /**
* Returns a property present in a javascript object.
*/ | Returns a property present in a javascript object | prop | {
"repo_name": "ArcBees/gwtquery",
"path": "gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java",
"license": "mit",
"size": 20852
} | [
"com.google.gwt.core.client.JavaScriptObject"
] | import com.google.gwt.core.client.JavaScriptObject; | import com.google.gwt.core.client.*; | [
"com.google.gwt"
] | com.google.gwt; | 404,411 |
private List<String> parseString(String input){
return parseString (input, new ArrayList<String>());
} | List<String> function(String input){ return parseString (input, new ArrayList<String>()); } | /**
* Separates a string into smaller parts so that Google will not reject the request.
* @param input The string you want to separate
* @return A List<String> of the String fragments from your input..
*/ | Separates a string into smaller parts so that Google will not reject the request | parseString | {
"repo_name": "QuantumPhi/ScalAR",
"path": "app/src/main/java/com/skylion/speech/Synthesiser.java",
"license": "gpl-3.0",
"size": 10339
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 666,935 |
public void writeOut(OutputStream out) throws IOException {
out.write(_header);
byte[] recdata = new byte[4];
LittleEndian.putInt(recdata, 0, _index);
out.write(recdata);
} | void function(OutputStream out) throws IOException { out.write(_header); byte[] recdata = new byte[4]; LittleEndian.putInt(recdata, 0, _index); out.write(recdata); } | /**
* Write the contents of the record back, so it can be written to disk
*/ | Write the contents of the record back, so it can be written to disk | writeOut | {
"repo_name": "tobyclemson/msci-project",
"path": "vendor/poi-3.6/src/scratchpad/src/org/apache/poi/hslf/record/OutlineTextRefAtom.java",
"license": "mit",
"size": 3331
} | [
"java.io.IOException",
"java.io.OutputStream",
"org.apache.poi.util.LittleEndian"
] | import java.io.IOException; import java.io.OutputStream; import org.apache.poi.util.LittleEndian; | import java.io.*; import org.apache.poi.util.*; | [
"java.io",
"org.apache.poi"
] | java.io; org.apache.poi; | 894,422 |
private FeatureDataSource getObjects() throws Exception {
final List<Map<String, Object>> features = new ArrayList<Map<String, Object>>();
final boolean first = true;
final String art = createArtString();
for (final String sb : gemDataMap.keySet()) {
sheetNames.add("Objekte " + gemDataMap.get(sb).getGmdName());
for (final Integer gew : getGew(sb)) {
for (final SbPartObjGeschl obj : getObjects(sb, gew)) {
final Map<String, Object> feature = new HashMap<String, Object>();
feature.put("group", String.valueOf(sb));
feature.put("gmdNr", sb);
feature.put("gmdName", gemDataMap.get(sb).getGmdName());
feature.put("gewName", getGewName(sb, gew));
feature.put("code", getBaCd(sb, gew));
feature.put("arten", art);
feature.put("laenge", getLengthGew(sb, gew));
feature.put("von", convertStation(obj.getFrom()));
feature.put("bis", convertStation(obj.getTill()));
feature.put("anzahlObj", getObjects(sb, gew).size());
feature.put("tf", getTf(obj.getTf()));
feature.put("dim", getDim(obj.getDim()));
feature.put("ls", obj.getLs());
feature.put("prof", obj.getProf());
feature.put("ma", obj.getMa());
feature.put("objNr", obj.getObjNr());
feature.put("tr", obj.getTr());
feature.put("ausbaujahr", obj.getAusbaujahr());
feature.put("wbbl", obj.getWbbl());
feature.put("art", obj.getArt());
feature.put("laengeObj", obj.getLength());
feature.put("faktor", obj.getLs());
feature.put("zustKl", obj.getLs());
feature.put("br", obj.getLs());
feature.put("brOben", obj.getBrOben());
feature.put("hoehe", obj.getHoehe());
feature.put("hEin", obj.gethEin());
feature.put("hAus", obj.gethAus());
feature.put("gefaelle", obj.getGefaelle());
feature.put("dhAus", obj.getDhAus());
feature.put("dhEin", obj.getDhEin());
feature.put("hAb", obj.gethAb());
feature.put("hAuf", obj.gethAuf());
feature.put("aufstieg", obj.getAufstieg());
features.add(feature);
}
}
}
features.add(createKumFeature(features, false));
return new FeatureDataSource(features);
} | FeatureDataSource function() throws Exception { final List<Map<String, Object>> features = new ArrayList<Map<String, Object>>(); final boolean first = true; final String art = createArtString(); for (final String sb : gemDataMap.keySet()) { sheetNames.add(STR + gemDataMap.get(sb).getGmdName()); for (final Integer gew : getGew(sb)) { for (final SbPartObjGeschl obj : getObjects(sb, gew)) { final Map<String, Object> feature = new HashMap<String, Object>(); feature.put("group", String.valueOf(sb)); feature.put("gmdNr", sb); feature.put(STR, gemDataMap.get(sb).getGmdName()); feature.put(STR, getGewName(sb, gew)); feature.put("code", getBaCd(sb, gew)); feature.put("arten", art); feature.put(STR, getLengthGew(sb, gew)); feature.put("von", convertStation(obj.getFrom())); feature.put("bis", convertStation(obj.getTill())); feature.put(STR, getObjects(sb, gew).size()); feature.put("tf", getTf(obj.getTf())); feature.put("dim", getDim(obj.getDim())); feature.put("ls", obj.getLs()); feature.put("prof", obj.getProf()); feature.put("ma", obj.getMa()); feature.put("objNr", obj.getObjNr()); feature.put("tr", obj.getTr()); feature.put(STR, obj.getAusbaujahr()); feature.put("wbbl", obj.getWbbl()); feature.put("art", obj.getArt()); feature.put(STR, obj.getLength()); feature.put(STR, obj.getLs()); feature.put(STR, obj.getLs()); feature.put("br", obj.getLs()); feature.put(STR, obj.getBrOben()); feature.put("hoehe", obj.getHoehe()); feature.put("hEin", obj.gethEin()); feature.put("hAus", obj.gethAus()); feature.put(STR, obj.getGefaelle()); feature.put("dhAus", obj.getDhAus()); feature.put("dhEin", obj.getDhEin()); feature.put("hAb", obj.gethAb()); feature.put("hAuf", obj.gethAuf()); feature.put(STR, obj.getAufstieg()); features.add(feature); } } } features.add(createKumFeature(features, false)); return new FeatureDataSource(features); } | /**
* DOCUMENT ME!
*
* @return DOCUMENT ME!
*
* @throws Exception DOCUMENT ME!
*/ | DOCUMENT ME | getObjects | {
"repo_name": "cismet/watergis-client",
"path": "src/main/java/de/cismet/watergis/reports/GerinneGSbReport.java",
"license": "lgpl-3.0",
"size": 87145
} | [
"de.cismet.watergis.reports.types.FeatureDataSource",
"de.cismet.watergis.reports.types.SbPartObjGeschl",
"java.util.ArrayList",
"java.util.HashMap",
"java.util.List",
"java.util.Map"
] | import de.cismet.watergis.reports.types.FeatureDataSource; import de.cismet.watergis.reports.types.SbPartObjGeschl; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; | import de.cismet.watergis.reports.types.*; import java.util.*; | [
"de.cismet.watergis",
"java.util"
] | de.cismet.watergis; java.util; | 2,254,493 |
public Container createSubJobXmlAndGetContainer(ComponentEditPart componentEditPart, List clipboardList, IFile file) {
Container container = new Container();
Component inputSubComponent = SubJobPortLinkUtilty.addInputSubJobComponentAndLink(container,
inputSubjobCompCache, clipboardList);
Component outSubComponent = SubJobPortLinkUtilty.addOutputSubJobComponentAndLink(container,
inputSubjobCompCache, outputSubjobCompCache, clipboardList);
for (Object object : clipboardList) {
container.addSubJobChild((Component) object);
}
doSaveAsSubJob(file, container);
inputSubComponent.getProperties().put(Constants.SCHEMA_TO_PROPAGATE, new HashMap<>());
propogateSchemaToSubjob((componentEditPart.getCastedModel()), outSubComponent);
updateParametersInGrid((componentEditPart.getCastedModel()), file.getFullPath());
componentEditPart.getCastedModel().getSubJobContainer().put(Constants.SUBJOB_CONTAINER, container);
return container;
} | Container function(ComponentEditPart componentEditPart, List clipboardList, IFile file) { Container container = new Container(); Component inputSubComponent = SubJobPortLinkUtilty.addInputSubJobComponentAndLink(container, inputSubjobCompCache, clipboardList); Component outSubComponent = SubJobPortLinkUtilty.addOutputSubJobComponentAndLink(container, inputSubjobCompCache, outputSubjobCompCache, clipboardList); for (Object object : clipboardList) { container.addSubJobChild((Component) object); } doSaveAsSubJob(file, container); inputSubComponent.getProperties().put(Constants.SCHEMA_TO_PROPAGATE, new HashMap<>()); propogateSchemaToSubjob((componentEditPart.getCastedModel()), outSubComponent); updateParametersInGrid((componentEditPart.getCastedModel()), file.getFullPath()); componentEditPart.getCastedModel().getSubJobContainer().put(Constants.SUBJOB_CONTAINER, container); return container; } | /**
* Create sub graph xml,open the subjob in new editor and return subjob container.
*
* @param componentEditPart
* the component edit part
* @param clipboardList
* the clipboard list
* @param file
* the file
* @return
*/ | Create sub graph xml,open the subjob in new editor and return subjob container | createSubJobXmlAndGetContainer | {
"repo_name": "capitalone/Hydrograph",
"path": "hydrograph.ui/hydrograph.ui.graph/src/main/java/hydrograph/ui/graph/utility/SubJobUtility.java",
"license": "apache-2.0",
"size": 29086
} | [
"java.util.HashMap",
"java.util.List",
"org.eclipse.core.resources.IFile"
] | import java.util.HashMap; import java.util.List; import org.eclipse.core.resources.IFile; | import java.util.*; import org.eclipse.core.resources.*; | [
"java.util",
"org.eclipse.core"
] | java.util; org.eclipse.core; | 1,764,863 |
public DERObject toASN1Object()
{
ASN1EncodableVector dev = new ASN1EncodableVector();
dev.add(policyQualifierId);
dev.add(qualifier);
return new DERSequence(dev);
} | DERObject function() { ASN1EncodableVector dev = new ASN1EncodableVector(); dev.add(policyQualifierId); dev.add(qualifier); return new DERSequence(dev); } | /**
* Returns a DER-encodable representation of this instance.
*
* @return a <code>DERObject</code> value
*/ | Returns a DER-encodable representation of this instance | toASN1Object | {
"repo_name": "meetdestiny/geronimo-trader",
"path": "modules/util/src/java/org/apache/geronimo/util/asn1/x509/PolicyQualifierInfo.java",
"license": "apache-2.0",
"size": 3347
} | [
"org.apache.geronimo.util.asn1.ASN1EncodableVector",
"org.apache.geronimo.util.asn1.DERObject",
"org.apache.geronimo.util.asn1.DERSequence"
] | import org.apache.geronimo.util.asn1.ASN1EncodableVector; import org.apache.geronimo.util.asn1.DERObject; import org.apache.geronimo.util.asn1.DERSequence; | import org.apache.geronimo.util.asn1.*; | [
"org.apache.geronimo"
] | org.apache.geronimo; | 526,259 |
protected static int[][] getArray10() {
int WIDTH = 100;
int HEIGHT = 100;
Random random = new Random();
int[][] result = new int[HEIGHT][WIDTH];
for (int y = 0; y < result.length; y++) {
result[y] = new int[WIDTH];
for (int x = 0; x < WIDTH; x++) {
result[y][x] = random.nextInt(10000);
}
}
return result;
} | static int[][] function() { int WIDTH = 100; int HEIGHT = 100; Random random = new Random(); int[][] result = new int[HEIGHT][WIDTH]; for (int y = 0; y < result.length; y++) { result[y] = new int[WIDTH]; for (int x = 0; x < WIDTH; x++) { result[y][x] = random.nextInt(10000); } } return result; } | /**
* Gets the array10.
*
* @return the array10
*/ | Gets the array10 | getArray10 | {
"repo_name": "prasser/jhc",
"path": "src/main/de/linearbits/examples/ExampleData.java",
"license": "epl-1.0",
"size": 5882
} | [
"java.util.Random"
] | import java.util.Random; | import java.util.*; | [
"java.util"
] | java.util; | 252,425 |
public List updaters() {
return this.updaters;
} | List function() { return this.updaters; } | /**
* Returns the live ordered list of update expressions in this for statement.
* <p>
* The list should consist of so called statement expressions. Otherwise, the for statement would have no Java source
* equivalent.
* </p>
*
* @return the live list of update expressions (element type: {@link Expression})
*/ | Returns the live ordered list of update expressions in this for statement. The list should consist of so called statement expressions. Otherwise, the for statement would have no Java source equivalent. | updaters | {
"repo_name": "riuvshin/che-plugins",
"path": "plugin-java/che-plugin-java-ext-java/src/main/java/org/eclipse/che/ide/ext/java/jdt/core/dom/ForStatement.java",
"license": "epl-1.0",
"size": 12198
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,756,006 |
public Image getInfoImage() {
return getSWTImage(SWT.ICON_INFORMATION);
} | Image function() { return getSWTImage(SWT.ICON_INFORMATION); } | /**
* Return the <code>Image</code> to be used when displaying information.
*
* @return image the information image
*/ | Return the <code>Image</code> to be used when displaying information | getInfoImage | {
"repo_name": "ghillairet/gef-gwt",
"path": "src/main/java/org/eclipse/jface/dialogs/IconAndMessageDialog.java",
"license": "epl-1.0",
"size": 8449
} | [
"org.eclipse.swt.graphics.Image"
] | import org.eclipse.swt.graphics.Image; | import org.eclipse.swt.graphics.*; | [
"org.eclipse.swt"
] | org.eclipse.swt; | 1,369,374 |
private boolean isCompressable(File f){
String ext = FilenameUtils.getExtension(f.getAbsolutePath()).toLowerCase();
return !getSkippedExtensions().contains(ext);
}
| boolean function(File f){ String ext = FilenameUtils.getExtension(f.getAbsolutePath()).toLowerCase(); return !getSkippedExtensions().contains(ext); } | /**
* checks whether the file extension is 'blacklisted' for compression
*/ | checks whether the file extension is 'blacklisted' for compression | isCompressable | {
"repo_name": "Top-Q/difido-reports",
"path": "binders/difido-testng/src/main/java/il/co/topq/difido/reporters/RemoteDifidoReporter.java",
"license": "apache-2.0",
"size": 8116
} | [
"java.io.File",
"org.apache.commons.io.FilenameUtils"
] | import java.io.File; import org.apache.commons.io.FilenameUtils; | import java.io.*; import org.apache.commons.io.*; | [
"java.io",
"org.apache.commons"
] | java.io; org.apache.commons; | 1,794,992 |
public Date getCreatedtime() {
return createdtime;
} | Date function() { return createdtime; } | /**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column m_ecm_external_drive.createdTime
*
* @return the value of m_ecm_external_drive.createdTime
*
* @mbggenerated Mon Sep 21 13:52:03 ICT 2015
*/ | This method was generated by MyBatis Generator. This method returns the value of the database column m_ecm_external_drive.createdTime | getCreatedtime | {
"repo_name": "maduhu/mycollab",
"path": "mycollab-services/src/main/java/com/esofthead/mycollab/module/ecm/domain/ExternalDrive.java",
"license": "agpl-3.0",
"size": 10375
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 1,145,889 |
public XMLX509SubjectName itemSubjectName(int i)
throws XMLSecurityException {
Element e = XMLUtils.selectDsNode(this._constructionElement.getFirstChild(),
Constants._TAG_X509SUBJECTNAME,i);
if (e != null) {
return new XMLX509SubjectName(e, this._baseURI);
}
return null;
} | XMLX509SubjectName function(int i) throws XMLSecurityException { Element e = XMLUtils.selectDsNode(this._constructionElement.getFirstChild(), Constants._TAG_X509SUBJECTNAME,i); if (e != null) { return new XMLX509SubjectName(e, this._baseURI); } return null; } | /**
* Method itemSubjectName
*
* @param i
* @return the X509SubjectName, null if not present
* @throws XMLSecurityException
*/ | Method itemSubjectName | itemSubjectName | {
"repo_name": "andreagenso/java2scala",
"path": "test/J2s/java/openjdk-6-src-b27/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/X509Data.java",
"license": "apache-2.0",
"size": 14872
} | [
"com.sun.org.apache.xml.internal.security.exceptions.XMLSecurityException",
"com.sun.org.apache.xml.internal.security.keys.content.x509.XMLX509SubjectName",
"com.sun.org.apache.xml.internal.security.utils.Constants",
"com.sun.org.apache.xml.internal.security.utils.XMLUtils",
"org.w3c.dom.Element"
] | import com.sun.org.apache.xml.internal.security.exceptions.XMLSecurityException; import com.sun.org.apache.xml.internal.security.keys.content.x509.XMLX509SubjectName; import com.sun.org.apache.xml.internal.security.utils.Constants; import com.sun.org.apache.xml.internal.security.utils.XMLUtils; import org.w3c.dom.Element; | import com.sun.org.apache.xml.internal.security.exceptions.*; import com.sun.org.apache.xml.internal.security.keys.content.x509.*; import com.sun.org.apache.xml.internal.security.utils.*; import org.w3c.dom.*; | [
"com.sun.org",
"org.w3c.dom"
] | com.sun.org; org.w3c.dom; | 2,051,546 |
private final SerialOutputStream out = new SerialOutputStream();
public OutputStream getOutputStream()
{
if (debug)
z.reportln( "RXTXPort:getOutputStream() called and returning");
return out;
} | final SerialOutputStream out = new SerialOutputStream(); public OutputStream function() { if (debug) z.reportln( STR); return out; } | /**
* get the OutputStream
* @return OutputStream
*/ | get the OutputStream | getOutputStream | {
"repo_name": "quan2hua/rxtx-solaris",
"path": "rxtx-2.2.1pre2/CNI/RXTXPort.java",
"license": "lgpl-2.1",
"size": 54109
} | [
"java.io.OutputStream"
] | import java.io.OutputStream; | import java.io.*; | [
"java.io"
] | java.io; | 1,154,834 |
public boolean matches(String surt, Date captureDate, Date retrievalDate, String who2) {
return (who == null || who.length() == 0 || who.equals(who2))
&& matches(surt, captureDate, retrievalDate);
} | boolean function(String surt, Date captureDate, Date retrievalDate, String who2) { return (who == null who.length() == 0 who.equals(who2)) && matches(surt, captureDate, retrievalDate); } | /**
* Return true if the given request matches against this rule.
*
* @param surt SURT of requested document
* @param captureDate Capture date of document
* @param retrievalDate
* @param who2 Group name of requesting user
* @return
*/ | Return true if the given request matches against this rule | matches | {
"repo_name": "iipc/openwayback-access-control",
"path": "access-control/src/main/java/org/archive/accesscontrol/model/Rule.java",
"license": "apache-2.0",
"size": 9934
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 2,318,830 |
IHeaderResponse getHeaderResponse()
{
if (headerResponse == null)
{
// we don't need to decorate the header response here because this is called from
// within AjaxHtmlHeaderContainer, which decorates the response
headerResponse = new AjaxHeaderResponse();
}
return headerResponse;
} | IHeaderResponse getHeaderResponse() { if (headerResponse == null) { headerResponse = new AjaxHeaderResponse(); } return headerResponse; } | /**
* Gets or creates an IHeaderResponse instance to use for the header contributions.
*
* @return IHeaderResponse instance to use for the header contributions.
*/ | Gets or creates an IHeaderResponse instance to use for the header contributions | getHeaderResponse | {
"repo_name": "zwsong/wicket",
"path": "wicket-core/src/main/java/org/apache/wicket/ajax/AbstractAjaxResponse.java",
"license": "apache-2.0",
"size": 19977
} | [
"org.apache.wicket.markup.head.IHeaderResponse"
] | import org.apache.wicket.markup.head.IHeaderResponse; | import org.apache.wicket.markup.head.*; | [
"org.apache.wicket"
] | org.apache.wicket; | 1,509,881 |
public Shape getLegendLine() {
return this.legendLine;
} | Shape function() { return this.legendLine; } | /**
* Returns the shape used to represent a line in the legend.
*
* @return The legend line (never <code>null</code>).
*
* @see #setLegendLine(Shape)
*/ | Returns the shape used to represent a line in the legend | getLegendLine | {
"repo_name": "hongliangpan/manydesigns.cn",
"path": "trunk/portofino-chart/jfreechat.src/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java",
"license": "lgpl-3.0",
"size": 45827
} | [
"java.awt.Shape"
] | import java.awt.Shape; | import java.awt.*; | [
"java.awt"
] | java.awt; | 905,877 |
private static String getPropertyValue(String propertyName, Properties properties,
String[] arguments, int index, boolean throwException)
{
String value = properties.getProperty(propertyName);
if (value == null)
{
if ((arguments != null) && (arguments.length > 0) && (index < arguments.length))
{
value = arguments[index].trim();
}
else if (throwException)
{
throw new IllegalArgumentException("The " + propertyName
+ " system property is required");
}
else
{
value = null;
}
}
return value;
} | static String function(String propertyName, Properties properties, String[] arguments, int index, boolean throwException) { String value = properties.getProperty(propertyName); if (value == null) { if ((arguments != null) && (arguments.length > 0) && (index < arguments.length)) { value = arguments[index].trim(); } else if (throwException) { throw new IllegalArgumentException(STR + propertyName + STR); } else { value = null; } } return value; } | /**
* Gets the value of the supplied property name. First it searches in system properties. If
* not found then it examines the supplied array of command line arguments.
*
* @param propertyName the property naem to get
* @param properties the <code>Properties</code> for the Java system
* @param arguments the array of command line arguments
* @param index the index of the property in the command line arguments
* @param throwException if <code>true</code> then the method will throw an exception; if
* <code>false</code> is supplied then it will return <code>null</code>
* @return the property value if found; <code>null</code> otherwise
*/ | Gets the value of the supplied property name. First it searches in system properties. If not found then it examines the supplied array of command line arguments | getPropertyValue | {
"repo_name": "lamsfoundation/lams",
"path": "3rdParty_sources/tacitknowledge/autopatch/src/main/java/com/tacitknowledge/util/migration/jdbc/util/ConfigurationUtil.java",
"license": "gpl-2.0",
"size": 10260
} | [
"java.util.Properties"
] | import java.util.Properties; | import java.util.*; | [
"java.util"
] | java.util; | 783,962 |
public InteractiveSession startShell() throws IOException {
Session session = client.startSession();
session.allocateDefaultPTY();
Shell shell = session.startShell();
return new ShellSession(shell);
}
private static class ShellSession implements InteractiveSession {
private final Shell shell;
public ShellSession(Shell shell) {
this.shell = shell;
} | InteractiveSession function() throws IOException { Session session = client.startSession(); session.allocateDefaultPTY(); Shell shell = session.startShell(); return new ShellSession(shell); } private static class ShellSession implements InteractiveSession { private final Shell shell; public ShellSession(Shell shell) { this.shell = shell; } | /**
* Starts a new interactive shell
*
* @return the {@link InteractiveSession} with input and output streams
* @throws IOException failed to open the session
*/ | Starts a new interactive shell | startShell | {
"repo_name": "bugminer/bugminer",
"path": "bugminer-server/src/main/java/de/unistuttgart/iste/rss/bugminer/computing/SshConnection.java",
"license": "mit",
"size": 7312
} | [
"java.io.IOException",
"net.schmizz.sshj.connection.channel.direct.Session"
] | import java.io.IOException; import net.schmizz.sshj.connection.channel.direct.Session; | import java.io.*; import net.schmizz.sshj.connection.channel.direct.*; | [
"java.io",
"net.schmizz.sshj"
] | java.io; net.schmizz.sshj; | 1,362,482 |
public void increment( ValueMetric metric,
long incrementalValue ) {
assert metric != null;
ValueHistory history = values.get(metric);
if (history != null) history.recordIncrement(incrementalValue);
} | void function( ValueMetric metric, long incrementalValue ) { assert metric != null; ValueHistory history = values.get(metric); if (history != null) history.recordIncrement(incrementalValue); } | /**
* Record an incremental change to a value, called by the code that knows when and how the metric changes.
*
* @param metric the metric; may not be null
* @param incrementalValue the positive or negative increment
* @see #increment(ValueMetric)
* @see #decrement(ValueMetric)
* @see #recordDuration(DurationMetric, long, TimeUnit, Map)
*/ | Record an incremental change to a value, called by the code that knows when and how the metric changes | increment | {
"repo_name": "stemig62/modeshape",
"path": "modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryStatistics.java",
"license": "apache-2.0",
"size": 40403
} | [
"org.modeshape.jcr.api.monitor.ValueMetric"
] | import org.modeshape.jcr.api.monitor.ValueMetric; | import org.modeshape.jcr.api.monitor.*; | [
"org.modeshape.jcr"
] | org.modeshape.jcr; | 538,521 |
private static List<FacetValue> extractFacetValues(FacetField field) {
// use linked list because there is a lot removing from the list
List<FacetValue> values = new LinkedList<>();
for (Count count : field.getValues()) {
if (count.getCount() > 0) {
FacetValue value = new FacetValue();
value.setCount(count.getCount());
if (count.getName() == null) {
value.setId(FacetQueryParameters.NO_VALUE);
} else {
value.setId(count.getName());
}
values.add(value);
}
}
return values;
} | static List<FacetValue> function(FacetField field) { List<FacetValue> values = new LinkedList<>(); for (Count count : field.getValues()) { if (count.getCount() > 0) { FacetValue value = new FacetValue(); value.setCount(count.getCount()); if (count.getName() == null) { value.setId(FacetQueryParameters.NO_VALUE); } else { value.setId(count.getName()); } values.add(value); } } return values; } | /**
* Iterates the values of the provided facet field and extracts any value that has positive count. If the value
* lacks a name, it is considered a missing value.
*
* @param field
* - the facet field
* @return list of extracted facet values
*/ | Iterates the values of the provided facet field and extracts any value that has positive count. If the value lacks a name, it is considered a missing value | extractFacetValues | {
"repo_name": "SirmaITT/conservation-space-1.7.0",
"path": "docker/sirma-platform/platform/seip-parent/extensions/emf-solr-parent/emf-solr-impl/src/main/java/com/sirma/itt/emf/solr/services/impl/facet/FacetResultTransformer.java",
"license": "lgpl-3.0",
"size": 14176
} | [
"com.sirma.itt.seip.domain.search.facet.FacetQueryParameters",
"com.sirma.itt.seip.domain.search.facet.FacetValue",
"java.util.LinkedList",
"java.util.List",
"org.apache.solr.client.solrj.response.FacetField"
] | import com.sirma.itt.seip.domain.search.facet.FacetQueryParameters; import com.sirma.itt.seip.domain.search.facet.FacetValue; import java.util.LinkedList; import java.util.List; import org.apache.solr.client.solrj.response.FacetField; | import com.sirma.itt.seip.domain.search.facet.*; import java.util.*; import org.apache.solr.client.solrj.response.*; | [
"com.sirma.itt",
"java.util",
"org.apache.solr"
] | com.sirma.itt; java.util; org.apache.solr; | 1,715,320 |
public ResequenceDefinition resequence(Expression expression) {
ResequenceDefinition answer = new ResequenceDefinition();
answer.setExpression(ExpressionNodeHelper.toExpressionDefinition(expression));
addOutput(answer);
return answer;
} | ResequenceDefinition function(Expression expression) { ResequenceDefinition answer = new ResequenceDefinition(); answer.setExpression(ExpressionNodeHelper.toExpressionDefinition(expression)); addOutput(answer); return answer; } | /**
* <a href="http://camel.apache.org/resequencer.html">Resequencer EIP:</a>
* Creates a resequencer allowing you to reorganize messages based on some comparator.
*
* @param expression the expression on which to compare messages in order
* @return the builder
*/ | Creates a resequencer allowing you to reorganize messages based on some comparator | resequence | {
"repo_name": "oscerd/camel",
"path": "camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java",
"license": "apache-2.0",
"size": 144870
} | [
"org.apache.camel.Expression"
] | import org.apache.camel.Expression; | import org.apache.camel.*; | [
"org.apache.camel"
] | org.apache.camel; | 945,655 |
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof JFreeChart)) {
return false;
}
JFreeChart that = (JFreeChart) obj;
if (!this.renderingHints.equals(that.renderingHints)) {
return false;
}
if (this.borderVisible != that.borderVisible) {
return false;
}
if (!ObjectUtilities.equal(this.borderStroke, that.borderStroke)) {
return false;
}
if (!PaintUtilities.equal(this.borderPaint, that.borderPaint)) {
return false;
}
if (!this.padding.equals(that.padding)) {
return false;
}
if (!ObjectUtilities.equal(this.title, that.title)) {
return false;
}
if (!ObjectUtilities.equal(this.subtitles, that.subtitles)) {
return false;
}
if (!ObjectUtilities.equal(this.plot, that.plot)) {
return false;
}
if (!PaintUtilities.equal(
this.backgroundPaint, that.backgroundPaint
)) {
return false;
}
if (!ObjectUtilities.equal(this.backgroundImage,
that.backgroundImage)) {
return false;
}
if (this.backgroundImageAlignment != that.backgroundImageAlignment) {
return false;
}
if (this.backgroundImageAlpha != that.backgroundImageAlpha) {
return false;
}
if (this.notify != that.notify) {
return false;
}
return true;
} | boolean function(Object obj) { if (obj == this) { return true; } if (!(obj instanceof JFreeChart)) { return false; } JFreeChart that = (JFreeChart) obj; if (!this.renderingHints.equals(that.renderingHints)) { return false; } if (this.borderVisible != that.borderVisible) { return false; } if (!ObjectUtilities.equal(this.borderStroke, that.borderStroke)) { return false; } if (!PaintUtilities.equal(this.borderPaint, that.borderPaint)) { return false; } if (!this.padding.equals(that.padding)) { return false; } if (!ObjectUtilities.equal(this.title, that.title)) { return false; } if (!ObjectUtilities.equal(this.subtitles, that.subtitles)) { return false; } if (!ObjectUtilities.equal(this.plot, that.plot)) { return false; } if (!PaintUtilities.equal( this.backgroundPaint, that.backgroundPaint )) { return false; } if (!ObjectUtilities.equal(this.backgroundImage, that.backgroundImage)) { return false; } if (this.backgroundImageAlignment != that.backgroundImageAlignment) { return false; } if (this.backgroundImageAlpha != that.backgroundImageAlpha) { return false; } if (this.notify != that.notify) { return false; } return true; } | /**
* Tests this chart for equality with another object.
*
* @param obj the object (<code>null</code> permitted).
*
* @return A boolean.
*/ | Tests this chart for equality with another object | equals | {
"repo_name": "raedle/univis",
"path": "lib/jfreechart-1.0.1/src/org/jfree/chart/JFreeChart.java",
"license": "lgpl-2.1",
"size": 60091
} | [
"org.jfree.util.ObjectUtilities",
"org.jfree.util.PaintUtilities"
] | import org.jfree.util.ObjectUtilities; import org.jfree.util.PaintUtilities; | import org.jfree.util.*; | [
"org.jfree.util"
] | org.jfree.util; | 2,568,488 |
public void setAmountToDraw(KualiDecimal amountToDraw) {
this.amountToDraw = amountToDraw;
} | void function(KualiDecimal amountToDraw) { this.amountToDraw = amountToDraw; } | /**
* Sets the amountToDraw attribute value.
*
* @param amountToDraw The amountToDraw to set.
*/ | Sets the amountToDraw attribute value | setAmountToDraw | {
"repo_name": "quikkian-ua-devops/will-financials",
"path": "kfs-ar/src/main/java/org/kuali/kfs/module/ar/businessobject/ContractsGrantsLOCReport.java",
"license": "agpl-3.0",
"size": 6342
} | [
"org.kuali.rice.core.api.util.type.KualiDecimal"
] | import org.kuali.rice.core.api.util.type.KualiDecimal; | import org.kuali.rice.core.api.util.type.*; | [
"org.kuali.rice"
] | org.kuali.rice; | 2,754,725 |
@Test
public void testValueAsObject() {
final MongoTimestampElement element = new MongoTimestampElement("foo",
1010101);
assertEquals(new Long(1010101), element.getValueAsObject());
} | void function() { final MongoTimestampElement element = new MongoTimestampElement("foo", 1010101); assertEquals(new Long(1010101), element.getValueAsObject()); } | /**
* Test method for {@link MongoTimestampElement#getValueAsObject()}.
*/ | Test method for <code>MongoTimestampElement#getValueAsObject()</code> | testValueAsObject | {
"repo_name": "allanbank/mongodb-async-driver",
"path": "src/test/java/com/allanbank/mongodb/bson/element/MongoTimestampElementTest.java",
"license": "apache-2.0",
"size": 7349
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 1,625,254 |
public void delete(final PostMessage relation) {
super.delete(relation, relation.getPostMessageId());
} | void function(final PostMessage relation) { super.delete(relation, relation.getPostMessageId()); } | /**
* Delete the input PostMessage from the database.
*
* @param relation the PostMessage tha we want to delete
*/ | Delete the input PostMessage from the database | delete | {
"repo_name": "EaW1805/data",
"path": "src/main/java/com/eaw1805/data/managers/PostMessageManager.java",
"license": "mit",
"size": 2856
} | [
"com.eaw1805.data.model.PostMessage"
] | import com.eaw1805.data.model.PostMessage; | import com.eaw1805.data.model.*; | [
"com.eaw1805.data"
] | com.eaw1805.data; | 106,894 |
public void setChildren(List<Trait> children) {
this.children = children;
} | void function(List<Trait> children) { this.children = children; } | /**
* Sets the more detailed results for the facets of each dimension as inferred from the input text.
*
* @param children the new children
*/ | Sets the more detailed results for the facets of each dimension as inferred from the input text | setChildren | {
"repo_name": "JoshSharpe/java-sdk",
"path": "personality-insights/src/main/java/com/ibm/watson/developer_cloud/personality_insights/v3/model/Trait.java",
"license": "apache-2.0",
"size": 3376
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 181,956 |
private BufferedImage paintNotVisibleComponent(Component component,
Container container, Rectangle rectangle){
BufferedImage img = new BufferedImage(rectangle.width,
rectangle.height, BufferedImage.TYPE_INT_RGB);
Graphics2D g = img.createGraphics();
SwingUtilities.paintComponent(g, component, container, rectangle);
g.dispose();
return img;
}
class ShowPanel extends JFrame{
public ShowPanel(JPanel panel, Dimension size, String name){
super(name);
this.setPreferredSize(size);
this.add(panel);
this.setVisible(true);
}
} | BufferedImage function(Component component, Container container, Rectangle rectangle){ BufferedImage img = new BufferedImage(rectangle.width, rectangle.height, BufferedImage.TYPE_INT_RGB); Graphics2D g = img.createGraphics(); SwingUtilities.paintComponent(g, component, container, rectangle); g.dispose(); return img; } class ShowPanel extends JFrame{ public ShowPanel(JPanel panel, Dimension size, String name){ super(name); this.setPreferredSize(size); this.add(panel); this.setVisible(true); } } | /**
* create a BufferedImage and paint component in it.
* @param component component to paint
* @param container a possible empty container
* @param rectangle size of image
* @return
*/ | create a BufferedImage and paint component in it | paintNotVisibleComponent | {
"repo_name": "muhd7rosli/desmoj",
"path": "src/desmoj/extensions/grafic/util/PaintPanel.java",
"license": "apache-2.0",
"size": 3792
} | [
"java.awt.Component",
"java.awt.Container",
"java.awt.Dimension",
"java.awt.Graphics2D",
"java.awt.Rectangle",
"java.awt.image.BufferedImage",
"javax.swing.JFrame",
"javax.swing.JPanel",
"javax.swing.SwingUtilities"
] | import java.awt.Component; import java.awt.Container; import java.awt.Dimension; import java.awt.Graphics2D; import java.awt.Rectangle; import java.awt.image.BufferedImage; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.SwingUtilities; | import java.awt.*; import java.awt.image.*; import javax.swing.*; | [
"java.awt",
"javax.swing"
] | java.awt; javax.swing; | 1,430,014 |
public Settings settings() {
return this.settings;
} | Settings function() { return this.settings; } | /**
* Returns repository-specific snapshot settings
*
* @return repository-specific snapshot settings
*/ | Returns repository-specific snapshot settings | settings | {
"repo_name": "zuoyebushiwo/elasticsearch1.7-study",
"path": "src/main/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotRequest.java",
"license": "apache-2.0",
"size": 17384
} | [
"org.elasticsearch.common.settings.Settings"
] | import org.elasticsearch.common.settings.Settings; | import org.elasticsearch.common.settings.*; | [
"org.elasticsearch.common"
] | org.elasticsearch.common; | 2,479,658 |
@Override
protected void onPostExecute(Void result)
{
Handler handler = new Handler(Looper.getMainLooper());
handler.post(runnable);
}
}).execute();
} | void function(Void result) { Handler handler = new Handler(Looper.getMainLooper()); handler.post(runnable); } }).execute(); } | /**
* Always invoked on UI thread.
*/ | Always invoked on UI thread | onPostExecute | {
"repo_name": "hieupham007/Titanium_Mobile",
"path": "android/titanium/src/java/org/appcelerator/titanium/util/TiUIHelper.java",
"license": "apache-2.0",
"size": 31547
} | [
"android.os.Handler",
"android.os.Looper"
] | import android.os.Handler; import android.os.Looper; | import android.os.*; | [
"android.os"
] | android.os; | 994,844 |
public void setDescriptionTypeface(Typeface t) {
mDescPaint.setTypeface(t);
} | void function(Typeface t) { mDescPaint.setTypeface(t); } | /**
* sets the typeface for the description paint
*
* @param t
*/ | sets the typeface for the description paint | setDescriptionTypeface | {
"repo_name": "codezork/BlueNodes",
"path": "mobile/bluenodes/src/main/java/com/github/mikephil/charting/charts/Chart.java",
"license": "apache-2.0",
"size": 51621
} | [
"android.graphics.Typeface"
] | import android.graphics.Typeface; | import android.graphics.*; | [
"android.graphics"
] | android.graphics; | 689,703 |
void prettyLog(RedwoodChannels channels, String description); | void prettyLog(RedwoodChannels channels, String description); | /**
* Pretty logs the current object to specific Redwood channels.
*
* @param channels
* the channels which should be logged to -- all logging calls should
* use logging methods on the channels (e.g. channels.log(), etc.)
* @param description
* The description of the object. It will potentially identify the
* object's functional role or (failing that) its class. This is
* typically used as a track name surrounding the contents of this
* object.
*/ | Pretty logs the current object to specific Redwood channels | prettyLog | {
"repo_name": "intfloat/CoreNLP",
"path": "src/edu/stanford/nlp/util/logging/PrettyLoggable.java",
"license": "gpl-2.0",
"size": 1325
} | [
"edu.stanford.nlp.util.logging.Redwood"
] | import edu.stanford.nlp.util.logging.Redwood; | import edu.stanford.nlp.util.logging.*; | [
"edu.stanford.nlp"
] | edu.stanford.nlp; | 524,139 |
@Override
public void initialize(BackendInstanceSpec config)
throws BackendInitializationException {
super.initialize(config);
if (this.mappingsFactory == null) {
setMappingsFactory(null);
}
this.relationalDatabaseSpecBuilder
= createRelationalDatabaseSpecBuilder();
} | void function(BackendInstanceSpec config) throws BackendInitializationException { super.initialize(config); if (this.mappingsFactory == null) { setMappingsFactory(null); } this.relationalDatabaseSpecBuilder = createRelationalDatabaseSpecBuilder(); } | /**
* Collects the database connection information specified in this backend's
* configuration, and uses it to try and get a SQL generator with which to
* generate database queries.
*
* @param config the {@link BackendInstanceSpec} that specifies this
* backend's configuration parameters.
*
* @throws DataSourceBackendInitializationException if bad database
* connection information was provided or a SQL generator that is compatible
* with the database and available drivers is not available.
*/ | Collects the database connection information specified in this backend's configuration, and uses it to try and get a SQL generator with which to generate database queries | initialize | {
"repo_name": "eurekaclinical/protempa",
"path": "protempa-dsb-relationaldb/src/main/java/org/protempa/backend/dsb/relationaldb/RelationalDbDataSourceBackend.java",
"license": "apache-2.0",
"size": 30508
} | [
"org.protempa.backend.BackendInitializationException",
"org.protempa.backend.BackendInstanceSpec"
] | import org.protempa.backend.BackendInitializationException; import org.protempa.backend.BackendInstanceSpec; | import org.protempa.backend.*; | [
"org.protempa.backend"
] | org.protempa.backend; | 1,093,987 |
EReference getResolvedValueSetHeader_IncludesResolvedValueSet();
/**
* Returns the meta object for class '{@link org.openhealthtools.mdht.cts2.valuesetdefinition.ResolvedValueSetMsg <em>Resolved Value Set Msg</em>} | EReference getResolvedValueSetHeader_IncludesResolvedValueSet(); /** * Returns the meta object for class '{@link org.openhealthtools.mdht.cts2.valuesetdefinition.ResolvedValueSetMsg <em>Resolved Value Set Msg</em>} | /**
* Returns the meta object for the containment reference list '
* {@link org.openhealthtools.mdht.cts2.valuesetdefinition.ResolvedValueSetHeader#getIncludesResolvedValueSet
* <em>Includes Resolved Value Set</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @return the meta object for the containment reference list '<em>Includes Resolved Value Set</em>'.
* @see org.openhealthtools.mdht.cts2.valuesetdefinition.ResolvedValueSetHeader#getIncludesResolvedValueSet()
* @see #getResolvedValueSetHeader()
* @generated
*/ | Returns the meta object for the containment reference list ' <code>org.openhealthtools.mdht.cts2.valuesetdefinition.ResolvedValueSetHeader#getIncludesResolvedValueSet Includes Resolved Value Set</code>'. | getResolvedValueSetHeader_IncludesResolvedValueSet | {
"repo_name": "drbgfc/mdht",
"path": "cts2/plugins/org.openhealthtools.mdht.cts2.core/src/org/openhealthtools/mdht/cts2/valuesetdefinition/ValueSetDefinitionPackage.java",
"license": "epl-1.0",
"size": 132102
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,550,598 |
public synchronized void acceptText(TextEvent e) {
if (m_outText == null) {
setUpResultHistory();
}
StringBuffer result = new StringBuffer();
result.append(e.getText());
// m_resultsString.append(e.getText());
// m_outText.setText(m_resultsString.toString());
String name = (new SimpleDateFormat("HH:mm:ss - "))
.format(new Date());
name += e.getTextTitle();
// System.err.println(name);
if (name.length() > 30) {
name = name.substring(0, 30);
}
if (m_outText != null) {
// see if there is an entry with this name already in the list -
// could happen if two items with the same name arrive at the same second
int mod = 2;
String nameOrig = new String(name);
while (m_history.getNamedBuffer(name) != null) {
name = new String(nameOrig+""+mod);
mod++;
}
m_history.addResult(name, result);
m_history.setSingle(name);
}
if (m_headlessEvents != null) {
m_headlessEvents.add(e);
}
// pass on the event to any listeners
notifyTextListeners(e);
} | synchronized void function(TextEvent e) { if (m_outText == null) { setUpResultHistory(); } StringBuffer result = new StringBuffer(); result.append(e.getText()); String name = (new SimpleDateFormat(STR)) .format(new Date()); name += e.getTextTitle(); if (name.length() > 30) { name = name.substring(0, 30); } if (m_outText != null) { int mod = 2; String nameOrig = new String(name); while (m_history.getNamedBuffer(name) != null) { name = new String(nameOrig+""+mod); mod++; } m_history.addResult(name, result); m_history.setSingle(name); } if (m_headlessEvents != null) { m_headlessEvents.add(e); } notifyTextListeners(e); } | /**
* Accept some text
*
* @param e a <code>TextEvent</code> value
*/ | Accept some text | acceptText | {
"repo_name": "dsibournemouth/autoweka",
"path": "weka-3.7.7/src/main/java/weka/gui/beans/TextViewer.java",
"license": "gpl-3.0",
"size": 19372
} | [
"java.text.SimpleDateFormat",
"java.util.Date"
] | import java.text.SimpleDateFormat; import java.util.Date; | import java.text.*; import java.util.*; | [
"java.text",
"java.util"
] | java.text; java.util; | 2,322,059 |
FreeStyleProject p = createFreeStyleProject();
// used to coordinate polling and check out
final OneShotEvent checkoutStarted = new OneShotEvent();
p.setScm(new TestSCM(checkoutStarted));
Future<FreeStyleBuild> build = p.scheduleBuild2(0, new Cause.UserCause());
checkoutStarted.block();
assertFalse("SCM-poll after build has started should wait until that build finishes SCM-update", p.pollSCMChanges(StreamTaskListener.fromStdout()));
build.get(); // let mock build finish
}
private static class TestSCM extends NullSCM {
private volatile int myRev = 1;
private final OneShotEvent checkoutStarted;
public TestSCM(OneShotEvent checkoutStarted) {
this.checkoutStarted = checkoutStarted;
} | FreeStyleProject p = createFreeStyleProject(); final OneShotEvent checkoutStarted = new OneShotEvent(); p.setScm(new TestSCM(checkoutStarted)); Future<FreeStyleBuild> build = p.scheduleBuild2(0, new Cause.UserCause()); checkoutStarted.block(); assertFalse(STR, p.pollSCMChanges(StreamTaskListener.fromStdout())); build.get(); } private static class TestSCM extends NullSCM { private volatile int myRev = 1; private final OneShotEvent checkoutStarted; public TestSCM(OneShotEvent checkoutStarted) { this.checkoutStarted = checkoutStarted; } | /**
* Make sure that SCMTrigger doesn't trigger another build when a build has just started,
* but not yet completed its SCM update.
*/ | Make sure that SCMTrigger doesn't trigger another build when a build has just started, but not yet completed its SCM update | testSimultaneousPollAndBuild | {
"repo_name": "sumitk1/jenkins",
"path": "test/src/test/java/hudson/triggers/SCMTriggerTest.java",
"license": "mit",
"size": 5692
} | [
"hudson.model.Cause",
"hudson.model.FreeStyleBuild",
"hudson.model.FreeStyleProject",
"hudson.scm.NullSCM",
"hudson.util.OneShotEvent",
"hudson.util.StreamTaskListener",
"java.util.concurrent.Future"
] | import hudson.model.Cause; import hudson.model.FreeStyleBuild; import hudson.model.FreeStyleProject; import hudson.scm.NullSCM; import hudson.util.OneShotEvent; import hudson.util.StreamTaskListener; import java.util.concurrent.Future; | import hudson.model.*; import hudson.scm.*; import hudson.util.*; import java.util.concurrent.*; | [
"hudson.model",
"hudson.scm",
"hudson.util",
"java.util"
] | hudson.model; hudson.scm; hudson.util; java.util; | 2,162,254 |
public Timestamp getDateInvoiced();
public static final String COLUMNNAME_DateOrdered = "DateOrdered"; | Timestamp function(); public static final String COLUMNNAME_DateOrdered = STR; | /** Get Date Invoiced.
* Date printed on Invoice
*/ | Get Date Invoiced. Date printed on Invoice | getDateInvoiced | {
"repo_name": "geneos/adempiere",
"path": "base/src/org/compiere/model/I_C_OrderLine.java",
"license": "gpl-2.0",
"size": 21322
} | [
"java.sql.Timestamp"
] | import java.sql.Timestamp; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,751,762 |
@Test
public void testGatewaySenderEventListenerPoolImpl() {
Integer lnPort = (Integer) vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));
Integer nyPort = (Integer) vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort));
createCacheInVMs(nyPort, vm2, vm3);
createReceiverInVMs(vm2, vm3);
createCacheInVMs(lnPort, vm4);
vm4.invoke(() -> WANTestBase.createSenderWithListener("ln", 2, false, 100, 10, false, false,
null, false, false));
vm4.invoke(() -> SerialGatewaySenderEventListenerDUnitTest.validateNoPoolCreation("ln"));
} | void function() { Integer lnPort = (Integer) vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1)); Integer nyPort = (Integer) vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort)); createCacheInVMs(nyPort, vm2, vm3); createReceiverInVMs(vm2, vm3); createCacheInVMs(lnPort, vm4); vm4.invoke(() -> WANTestBase.createSenderWithListener("ln", 2, false, 100, 10, false, false, null, false, false)); vm4.invoke(() -> SerialGatewaySenderEventListenerDUnitTest.validateNoPoolCreation("ln")); } | /**
* Test validates whether the PoolImpl is created. Ideally when a listener is attached pool should
* not be created.
*/ | Test validates whether the PoolImpl is created. Ideally when a listener is attached pool should not be created | testGatewaySenderEventListenerPoolImpl | {
"repo_name": "PurelyApplied/geode",
"path": "geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderEventListenerDUnitTest.java",
"license": "apache-2.0",
"size": 15120
} | [
"org.apache.geode.internal.cache.wan.WANTestBase"
] | import org.apache.geode.internal.cache.wan.WANTestBase; | import org.apache.geode.internal.cache.wan.*; | [
"org.apache.geode"
] | org.apache.geode; | 2,279,294 |
EReference getH6Start_Content(); | EReference getH6Start_Content(); | /**
* Returns the meta object for the reference '{@link org.lunifera.doc.dsl.doccompiler.H6Start#getContent <em>Content</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference '<em>Content</em>'.
* @see org.lunifera.doc.dsl.doccompiler.H6Start#getContent()
* @see #getH6Start()
* @generated
*/ | Returns the meta object for the reference '<code>org.lunifera.doc.dsl.doccompiler.H6Start#getContent Content</code>'. | getH6Start_Content | {
"repo_name": "lunifera/lunifera-doc",
"path": "org.lunifera.doc.dsl.semantic/src/org/lunifera/doc/dsl/doccompiler/DocCompilerPackage.java",
"license": "epl-1.0",
"size": 267430
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 428,006 |
@Test
public void testPcePathsEmpty() {
expect(pceService.queryAllPath())
.andReturn(null)
.anyTimes();
replay(pceService);
WebTarget wt = target();
String response = wt.path("path").request().get(String.class);
assertThat(response, is("{\"paths\":[]}"));
} | void function() { expect(pceService.queryAllPath()) .andReturn(null) .anyTimes(); replay(pceService); WebTarget wt = target(); String response = wt.path("path").request().get(String.class); assertThat(response, is("{\"paths\":[]}")); } | /**
* Tests the result of the rest api GET when there are no pce paths.
*/ | Tests the result of the rest api GET when there are no pce paths | testPcePathsEmpty | {
"repo_name": "wuwenbin2/onos_bgp_evpn",
"path": "apps/pce/pcerest/src/test/java/org/onosproject/pcerest/PcePathResourceTest.java",
"license": "apache-2.0",
"size": 11359
} | [
"javax.ws.rs.client.WebTarget",
"org.easymock.EasyMock",
"org.hamcrest.Matchers",
"org.junit.Assert"
] | import javax.ws.rs.client.WebTarget; import org.easymock.EasyMock; import org.hamcrest.Matchers; import org.junit.Assert; | import javax.ws.rs.client.*; import org.easymock.*; import org.hamcrest.*; import org.junit.*; | [
"javax.ws",
"org.easymock",
"org.hamcrest",
"org.junit"
] | javax.ws; org.easymock; org.hamcrest; org.junit; | 1,348,967 |
final AfterConstructorFailedEvent event1 = new AfterConstructorFailedEvent(TSTAMP, TRACE_ID, ORDER_INDEX, FQ_OPERATION_SIGNATURE, FQ_CLASSNAME, CAUSE);
Assert.assertEquals("Unexpected timestamp", TSTAMP, event1.getTimestamp());
Assert.assertEquals("Unexpected trace ID", TRACE_ID, event1.getTraceId());
Assert.assertEquals("Unexpected order index", ORDER_INDEX, event1.getOrderIndex());
Assert.assertEquals("Unexpected class name", FQ_CLASSNAME, event1.getClassSignature());
Assert.assertEquals("Unexpected operation signature", FQ_OPERATION_SIGNATURE, event1.getOperationSignature());
Assert.assertEquals("Unexpected cause", CAUSE, event1.getCause());
} | final AfterConstructorFailedEvent event1 = new AfterConstructorFailedEvent(TSTAMP, TRACE_ID, ORDER_INDEX, FQ_OPERATION_SIGNATURE, FQ_CLASSNAME, CAUSE); Assert.assertEquals(STR, TSTAMP, event1.getTimestamp()); Assert.assertEquals(STR, TRACE_ID, event1.getTraceId()); Assert.assertEquals(STR, ORDER_INDEX, event1.getOrderIndex()); Assert.assertEquals(STR, FQ_CLASSNAME, event1.getClassSignature()); Assert.assertEquals(STR, FQ_OPERATION_SIGNATURE, event1.getOperationSignature()); Assert.assertEquals(STR, CAUSE, event1.getCause()); } | /**
* Tests the constructor and toArray(..) methods of {@link AfterConstructorFailedEvent}.
*
* Assert that a record instance event1 equals an instance event2 created by serializing event1 to an array event1Array
* and using event1Array to construct event2. This ignores a set loggingTimestamp!
*/ | Tests the constructor and toArray(..) methods of <code>AfterConstructorFailedEvent</code>. Assert that a record instance event1 equals an instance event2 created by serializing event1 to an array event1Array and using event1Array to construct event2. This ignores a set loggingTimestamp | testSerializeDeserializeEquals | {
"repo_name": "kieker-monitoring/kieker",
"path": "kieker-common/test/kieker/test/common/junit/record/flow/trace/operation/constructor/TestAfterConstructorFailedEvent.java",
"license": "apache-2.0",
"size": 4469
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 1,691,768 |
public static final KeyPressHandler getVatIdKeyPressHandler(
final TakesValue<?> pcountryCodeField) {
return new VatIdKeyPressHandler(pcountryCodeField);
} | static final KeyPressHandler function( final TakesValue<?> pcountryCodeField) { return new VatIdKeyPressHandler(pcountryCodeField); } | /**
* get a key press handler which allows characters for vat id of a referenced country.
*
* @param pcountryCodeField reference to country code field
* @return key press handler
*/ | get a key press handler which allows characters for vat id of a referenced country | getVatIdKeyPressHandler | {
"repo_name": "ManfredTremmel/gwt-mt-widgets",
"path": "src/main/java/de/knightsoftnet/mtwidgets/client/ui/handler/HandlerFactory.java",
"license": "apache-2.0",
"size": 9662
} | [
"com.google.gwt.event.dom.client.KeyPressHandler",
"com.google.gwt.user.client.TakesValue"
] | import com.google.gwt.event.dom.client.KeyPressHandler; import com.google.gwt.user.client.TakesValue; | import com.google.gwt.event.dom.client.*; import com.google.gwt.user.client.*; | [
"com.google.gwt"
] | com.google.gwt; | 799,188 |
public Timestamp getBenchmarkDate ()
{
return (Timestamp)get_Value(COLUMNNAME_BenchmarkDate);
} | Timestamp function () { return (Timestamp)get_Value(COLUMNNAME_BenchmarkDate); } | /** Get Date.
@return Benchmark Date
*/ | Get Date | getBenchmarkDate | {
"repo_name": "geneos/adempiere",
"path": "base/src/org/compiere/model/X_PA_BenchmarkData.java",
"license": "gpl-2.0",
"size": 5852
} | [
"java.sql.Timestamp"
] | import java.sql.Timestamp; | import java.sql.*; | [
"java.sql"
] | java.sql; | 995,274 |
public void reschedule() {
TriggerConditions triggerConditions = new TriggerConditions(false, 0, false);
scheduleBackup(triggerConditions, DateUtils.MINUTE_IN_MILLIS * 5);
} | void function() { TriggerConditions triggerConditions = new TriggerConditions(false, 0, false); scheduleBackup(triggerConditions, DateUtils.MINUTE_IN_MILLIS * 5); } | /**
* Method for rescheduling a background task for offline pages in the event of OS upgrade or
* GooglePlayServices upgrade.
* We use the least restrictive trigger conditions. A wakeup will cause the queue to be
* checked, and the trigger conditions will be replaced by the current trigger conditions
* needed.
*/ | Method for rescheduling a background task for offline pages in the event of OS upgrade or GooglePlayServices upgrade. We use the least restrictive trigger conditions. A wakeup will cause the queue to be checked, and the trigger conditions will be replaced by the current trigger conditions needed | reschedule | {
"repo_name": "endlessm/chromium-browser",
"path": "chrome/android/java/src/org/chromium/chrome/browser/offlinepages/BackgroundScheduler.java",
"license": "bsd-3-clause",
"size": 3853
} | [
"android.text.format.DateUtils"
] | import android.text.format.DateUtils; | import android.text.format.*; | [
"android.text"
] | android.text; | 373,362 |
public File getSourceMapFile() {
return sourceMapFile;
} | File function() { return sourceMapFile; } | /**
* Return the source map file.
*
* @return The source map file or <em>null</em> if no source map should generated.
*/ | Return the source map file | getSourceMapFile | {
"repo_name": "uhees/jsass",
"path": "src/main/java/de/bit3/jsass/Options.java",
"license": "mit",
"size": 5301
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 2,094,599 |
protected void updatePreview() {
if ( initializing ) {
return;
}
if ( previewBusy.get() ) {
return;
}
try {
previewBusy.set( true );
CsvInputMeta meta = new CsvInputMeta();
getInfo( meta );
// Validate some basic data...
//
if ( Const.isEmpty( meta.getFilename() ) ) {
return;
}
if ( Const.isEmpty( meta.getInputFields() ) ) {
return;
}
String stepname = wStepname.getText();
// StepMeta stepMeta = new StepMeta(stepname, meta);
StringBuffer buffer = new StringBuffer();
final List<Object[]> rowsData = new ArrayList<Object[]>();
final RowMetaInterface rowMeta = new RowMeta();
try {
meta.getFields( rowMeta, stepname, null, null, transMeta, repository, metaStore ); | void function() { if ( initializing ) { return; } if ( previewBusy.get() ) { return; } try { previewBusy.set( true ); CsvInputMeta meta = new CsvInputMeta(); getInfo( meta ); return; } if ( Const.isEmpty( meta.getInputFields() ) ) { return; } String stepname = wStepname.getText(); StringBuffer buffer = new StringBuffer(); final List<Object[]> rowsData = new ArrayList<Object[]>(); final RowMetaInterface rowMeta = new RowMeta(); try { meta.getFields( rowMeta, stepname, null, null, transMeta, repository, metaStore ); | /**
* Load metadata from step window
*/ | Load metadata from step window | updatePreview | {
"repo_name": "tgf/pentaho-kettle",
"path": "ui/src/org/pentaho/di/ui/trans/steps/csvinput/CsvInputDialog.java",
"license": "apache-2.0",
"size": 45108
} | [
"java.util.ArrayList",
"java.util.List",
"org.pentaho.di.core.Const",
"org.pentaho.di.core.row.RowMeta",
"org.pentaho.di.core.row.RowMetaInterface",
"org.pentaho.di.trans.steps.csvinput.CsvInputMeta"
] | import java.util.ArrayList; import java.util.List; import org.pentaho.di.core.Const; import org.pentaho.di.core.row.RowMeta; import org.pentaho.di.core.row.RowMetaInterface; import org.pentaho.di.trans.steps.csvinput.CsvInputMeta; | import java.util.*; import org.pentaho.di.core.*; import org.pentaho.di.core.row.*; import org.pentaho.di.trans.steps.csvinput.*; | [
"java.util",
"org.pentaho.di"
] | java.util; org.pentaho.di; | 2,888,831 |
private boolean formatShape(Roi roi, ShapeData shape)
{
ShapeSettingsData settings = shape.getShapeSettings();
if (roi.getStrokeWidth() > 0) {
settings.setStrokeWidth(new LengthI((double) roi.getStrokeWidth(),
UnitsFactory.Shape_StrokeWidth));
}
Color color;
if (roi.getStrokeColor() != null) {
color = roi.getStrokeColor();
settings.setStroke(new Color(color.getRed(), color.getGreen(),
color.getBlue(), color.getAlpha()));
}
if (roi.getFillColor() != null) {
color = roi.getFillColor();
settings.setFill(new Color(color.getRed(), color.getGreen(),
color.getBlue(), color.getAlpha()));
}
int pos = roi.getPosition();
int c = roi.getCPosition();
int z = roi.getZPosition();
int t = roi.getTPosition();
ImagePlus image = roi.getImage();
int imageC = 1;
int imageT = 1;
int imageZ = 1;
if (image != null) {
imageC = image.getNChannels();
imageT = image.getNFrames();
imageZ = image.getNSlices();
}
if (imageC == 1 && imageZ == 1) {
shape.setC(0);
shape.setZ(0);
z = 0;
c = 0;
t = pos;
} else if (imageZ == 1 && imageT == 1) {
c = pos;
z = 0;
t = 0;
shape.setZ(0);
shape.setT(0);
} else if (imageC == 1 && imageT == 1) {
z = pos;
t = 0;
c = 0;
shape.setC(0);
shape.setT(0);
}
if (c > imageC || z > imageZ || t > imageT) {
return false;
}
if (c != 0) {
shape.setC(c-1);
}
if (z != 0) {
shape.setZ(z-1);
}
if (t != 0) {
shape.setT(t-1);
}
return true;
} | boolean function(Roi roi, ShapeData shape) { ShapeSettingsData settings = shape.getShapeSettings(); if (roi.getStrokeWidth() > 0) { settings.setStrokeWidth(new LengthI((double) roi.getStrokeWidth(), UnitsFactory.Shape_StrokeWidth)); } Color color; if (roi.getStrokeColor() != null) { color = roi.getStrokeColor(); settings.setStroke(new Color(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha())); } if (roi.getFillColor() != null) { color = roi.getFillColor(); settings.setFill(new Color(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha())); } int pos = roi.getPosition(); int c = roi.getCPosition(); int z = roi.getZPosition(); int t = roi.getTPosition(); ImagePlus image = roi.getImage(); int imageC = 1; int imageT = 1; int imageZ = 1; if (image != null) { imageC = image.getNChannels(); imageT = image.getNFrames(); imageZ = image.getNSlices(); } if (imageC == 1 && imageZ == 1) { shape.setC(0); shape.setZ(0); z = 0; c = 0; t = pos; } else if (imageZ == 1 && imageT == 1) { c = pos; z = 0; t = 0; shape.setZ(0); shape.setT(0); } else if (imageC == 1 && imageT == 1) { z = pos; t = 0; c = 0; shape.setC(0); shape.setT(0); } if (c > imageC z > imageZ t > imageT) { return false; } if (c != 0) { shape.setC(c-1); } if (z != 0) { shape.setZ(z-1); } if (t != 0) { shape.setT(t-1); } return true; } | /**
* Formats the shape.
*
* @param roi The ImageJ roi.
* @param shape The internal roi.
* @return <code>true</code> if the shape is valid, <code>false</code>
* otherwise.
*/ | Formats the shape | formatShape | {
"repo_name": "knabar/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/util/roi/io/ROIReader.java",
"license": "gpl-2.0",
"size": 18852
} | [
"java.awt.Color"
] | import java.awt.Color; | import java.awt.*; | [
"java.awt"
] | java.awt; | 476,976 |
public static String fromPath(IPath path) {
return path.toOSString();
} | static String function(IPath path) { return path.toOSString(); } | /**
* Do all path to string conversions here, to ensure consistency throughout
* DepAn.
*/ | Do all path to string conversions here, to ensure consistency throughout DepAn | fromPath | {
"repo_name": "google/depan",
"path": "DepanPlatform/prod/src/com/google/devtools/depan/platform/PlatformTools.java",
"license": "apache-2.0",
"size": 5516
} | [
"org.eclipse.core.runtime.IPath"
] | import org.eclipse.core.runtime.IPath; | import org.eclipse.core.runtime.*; | [
"org.eclipse.core"
] | org.eclipse.core; | 2,573,314 |
String prefix = "urn:oasis:names:tc:SAML:2.0:status:";
String requester = prefix + "Requester";
String responder = prefix + "Responder";
String versionMismatch = prefix + "VersionMismatch";
String authnFailed = prefix + "AuthnFailed";
String invalidAttr = prefix + "InvalidAttrNameOrValue";
String invalidNameID = prefix + "InvalidNameIDPolicy";
String noAuthnContext = prefix + "NoAuthnContext";
String noAvailableIDP = prefix + "NoAvailableIDP";
String noPassive = prefix + "NoPassive";
String noSupportedIDP = prefix + "NoSupportedIDP";
String partialLogout = prefix + "PartialLogout";
String proxyCountExceeded = prefix + "ProxyCountExceeded";
String requestDenied = prefix + "RequestDenied";
String requestUnsupported = prefix + "RequestUnsupported";
String requestVersionDeprecated = prefix + "RequestVersionDeprecated";
String requestVersionTooHigh = prefix + "RequestVersionTooHigh";
String requestVersionTooLow = prefix + "RequestVersionTooLow";
String resourceNotRecognized = prefix + "ResourceNotRecognized";
String tooManyResponse = prefix + "TooManyResponse";
String unknownAttrProfile = prefix + "UnknownAttrProfile";
String unkownPrincipal = prefix + "UnknownPrincipal";
String unsupportedBinding = prefix + "UnsupportedBinding";
AuthnResponseError testObj = null;
testObj = new AuthnResponseError(CODE.REQUESTER, "", "", "");
Assert.assertEquals(testObj.getStatus(), requester);
testObj = new AuthnResponseError(CODE.RESPONDER, "", "", "");
Assert.assertEquals(testObj.getStatus(), responder);
testObj = new AuthnResponseError(CODE.VERSION_MISMATCH, "", "", "");
Assert.assertEquals(testObj.getStatus(), versionMismatch);
testObj = new AuthnResponseError(CODE.AUTHN_FAILED, "", "", "");
Assert.assertEquals(testObj.getStatus(), authnFailed);
testObj = new AuthnResponseError(CODE.INVALID_ATTR_NAME_OR_VALUE, "", "", "");
Assert.assertEquals(testObj.getStatus(), invalidAttr);
testObj = new AuthnResponseError(CODE.INVALID_NAME_ID_POLICY, "", "", "");
Assert.assertEquals(testObj.getStatus(), invalidNameID);
testObj = new AuthnResponseError(CODE.NO_AUTHN_CONTEXT, "", "", "");
Assert.assertEquals(testObj.getStatus(), noAuthnContext);
testObj = new AuthnResponseError(CODE.NO_AVAILABLE_IDP, "", "", "");
Assert.assertEquals(testObj.getStatus(), noAvailableIDP);
testObj = new AuthnResponseError(CODE.NO_PASSIV, "", "", "");
Assert.assertEquals(testObj.getStatus(), noPassive);
testObj = new AuthnResponseError(CODE.NO_SUPPORTED_IDP, "", "", "");
Assert.assertEquals(testObj.getStatus(), noSupportedIDP);
testObj = new AuthnResponseError(CODE.PARTIAL_LOGOUT, "", "", "");
Assert.assertEquals(testObj.getStatus(), partialLogout);
testObj = new AuthnResponseError(CODE.PROXY_COUNT_EXCEEDED, "", "", "");
Assert.assertEquals(testObj.getStatus(), proxyCountExceeded);
testObj = new AuthnResponseError(CODE.REQUEST_DENIED, "", "", "");
Assert.assertEquals(testObj.getStatus(), requestDenied);
testObj = new AuthnResponseError(CODE.REQUEST_UNSUPPORTED, "", "", "");
Assert.assertEquals(testObj.getStatus(), requestUnsupported);
testObj = new AuthnResponseError(CODE.REQUEST_VERSION_DEPRECATED, "", "", "");
Assert.assertEquals(testObj.getStatus(), requestVersionDeprecated);
testObj = new AuthnResponseError(CODE.REQUEST_VERSION_TOO_HIGH, "", "", "");
Assert.assertEquals(testObj.getStatus(), requestVersionTooHigh);
testObj = new AuthnResponseError(CODE.REQUEST_VERSION_TOO_LOW, "", "", "");
Assert.assertEquals(testObj.getStatus(), requestVersionTooLow);
testObj = new AuthnResponseError(CODE.RESOURCE_NOT_RECOGNIZED, "", "", "");
Assert.assertEquals(testObj.getStatus(), resourceNotRecognized);
testObj = new AuthnResponseError(CODE.TOO_MANY_RESPONSE, "", "", "");
Assert.assertEquals(testObj.getStatus(), tooManyResponse);
testObj = new AuthnResponseError(CODE.UNKNOWN_ATTR_PROFILE, "", "", "");
Assert.assertEquals(testObj.getStatus(), unknownAttrProfile);
testObj = new AuthnResponseError(CODE.UNKNOWN_PRINCIPAL, "", "", "");
Assert.assertEquals(testObj.getStatus(), unkownPrincipal);
testObj = new AuthnResponseError(CODE.UNSUPPORTED_BINDING, "", "", "");
Assert.assertEquals(testObj.getStatus(), unsupportedBinding);
} | String prefix = STR; String requester = prefix + STR; String responder = prefix + STR; String versionMismatch = prefix + STR; String authnFailed = prefix + STR; String invalidAttr = prefix + STR; String invalidNameID = prefix + STR; String noAuthnContext = prefix + STR; String noAvailableIDP = prefix + STR; String noPassive = prefix + STR; String noSupportedIDP = prefix + STR; String partialLogout = prefix + STR; String proxyCountExceeded = prefix + STR; String requestDenied = prefix + STR; String requestUnsupported = prefix + STR; String requestVersionDeprecated = prefix + STR; String requestVersionTooHigh = prefix + STR; String requestVersionTooLow = prefix + STR; String resourceNotRecognized = prefix + STR; String tooManyResponse = prefix + STR; String unknownAttrProfile = prefix + STR; String unkownPrincipal = prefix + STR; String unsupportedBinding = prefix + STR; AuthnResponseError testObj = null; testObj = new AuthnResponseError(CODE.REQUESTER, STRSTR"); Assert.assertEquals(testObj.getStatus(), requester); testObj = new AuthnResponseError(CODE.RESPONDER, STRSTR"); Assert.assertEquals(testObj.getStatus(), responder); testObj = new AuthnResponseError(CODE.VERSION_MISMATCH, STRSTR"); Assert.assertEquals(testObj.getStatus(), versionMismatch); testObj = new AuthnResponseError(CODE.AUTHN_FAILED, STRSTR"); Assert.assertEquals(testObj.getStatus(), authnFailed); testObj = new AuthnResponseError(CODE.INVALID_ATTR_NAME_OR_VALUE, STRSTR"); Assert.assertEquals(testObj.getStatus(), invalidAttr); testObj = new AuthnResponseError(CODE.INVALID_NAME_ID_POLICY, STRSTR"); Assert.assertEquals(testObj.getStatus(), invalidNameID); testObj = new AuthnResponseError(CODE.NO_AUTHN_CONTEXT, STRSTR"); Assert.assertEquals(testObj.getStatus(), noAuthnContext); testObj = new AuthnResponseError(CODE.NO_AVAILABLE_IDP, STRSTR"); Assert.assertEquals(testObj.getStatus(), noAvailableIDP); testObj = new AuthnResponseError(CODE.NO_PASSIV, STRSTR"); Assert.assertEquals(testObj.getStatus(), noPassive); testObj = new AuthnResponseError(CODE.NO_SUPPORTED_IDP, STRSTR"); Assert.assertEquals(testObj.getStatus(), noSupportedIDP); testObj = new AuthnResponseError(CODE.PARTIAL_LOGOUT, STRSTR"); Assert.assertEquals(testObj.getStatus(), partialLogout); testObj = new AuthnResponseError(CODE.PROXY_COUNT_EXCEEDED, STRSTR"); Assert.assertEquals(testObj.getStatus(), proxyCountExceeded); testObj = new AuthnResponseError(CODE.REQUEST_DENIED, STRSTR"); Assert.assertEquals(testObj.getStatus(), requestDenied); testObj = new AuthnResponseError(CODE.REQUEST_UNSUPPORTED, STRSTR"); Assert.assertEquals(testObj.getStatus(), requestUnsupported); testObj = new AuthnResponseError(CODE.REQUEST_VERSION_DEPRECATED, STRSTR"); Assert.assertEquals(testObj.getStatus(), requestVersionDeprecated); testObj = new AuthnResponseError(CODE.REQUEST_VERSION_TOO_HIGH, STRSTR"); Assert.assertEquals(testObj.getStatus(), requestVersionTooHigh); testObj = new AuthnResponseError(CODE.REQUEST_VERSION_TOO_LOW, STRSTR"); Assert.assertEquals(testObj.getStatus(), requestVersionTooLow); testObj = new AuthnResponseError(CODE.RESOURCE_NOT_RECOGNIZED, STRSTR"); Assert.assertEquals(testObj.getStatus(), resourceNotRecognized); testObj = new AuthnResponseError(CODE.TOO_MANY_RESPONSE, STRSTR"); Assert.assertEquals(testObj.getStatus(), tooManyResponse); testObj = new AuthnResponseError(CODE.UNKNOWN_ATTR_PROFILE, STRSTR"); Assert.assertEquals(testObj.getStatus(), unknownAttrProfile); testObj = new AuthnResponseError(CODE.UNKNOWN_PRINCIPAL, STRSTR"); Assert.assertEquals(testObj.getStatus(), unkownPrincipal); testObj = new AuthnResponseError(CODE.UNSUPPORTED_BINDING, STRSTR"); Assert.assertEquals(testObj.getStatus(), unsupportedBinding); } | /**
* Tests the serialization of the SAML AuthnRequest message.
* @throws TransformerException
* @throws XMLSignatureException
* @throws MarshalException
* @throws ParserConfigurationException
* @throws SAXException
* @throws InvalidAlgorithmParameterException
* @throws UnrecoverableEntryException
* @throws KeyStoreException
* @throws CertificateException
* @throws NoSuchAlgorithmException
*/ | Tests the serialization of the SAML AuthnRequest message | testToFromXML | {
"repo_name": "obale/saml_identity_provider",
"path": "src/test/java/to/networld/test/security/common/data/TestAuthnResponseError.java",
"license": "gpl-3.0",
"size": 6709
} | [
"org.junit.Assert",
"to.networld.security.common.data.AuthnResponseError"
] | import org.junit.Assert; import to.networld.security.common.data.AuthnResponseError; | import org.junit.*; import to.networld.security.common.data.*; | [
"org.junit",
"to.networld.security"
] | org.junit; to.networld.security; | 1,429,626 |
private String [] getArgArrayProperty(Properties props, String prefix,
String [] defaults) {
int cur = 0;
ArrayList<String> al = new ArrayList<String>();
while (true) {
String curProp = prefix + "." + cur;
String curStr = props.getProperty(curProp, null);
if (null == curStr) {
break;
}
al.add(curStr);
cur++;
}
if (cur == 0) {
// Couldn't find an array here; return the defaults.
return defaults;
}
return al.toArray(new String[0]);
} | String [] function(Properties props, String prefix, String [] defaults) { int cur = 0; ArrayList<String> al = new ArrayList<String>(); while (true) { String curProp = prefix + "." + cur; String curStr = props.getProperty(curProp, null); if (null == curStr) { break; } al.add(curStr); cur++; } if (cur == 0) { return defaults; } return al.toArray(new String[0]); } | /**
* Given a property prefix that denotes a set of numbered properties,
* return an array containing all the properties.
*
* For instance, if prefix is "foo", then return properties "foo.0",
* "foo.1", "foo.2", and so on as an array. If no such properties
* exist, return 'defaults'.
*/ | Given a property prefix that denotes a set of numbered properties, return an array containing all the properties. For instance, if prefix is "foo", then return properties "foo.0", "foo.1", "foo.2", and so on as an array. If no such properties exist, return 'defaults' | getArgArrayProperty | {
"repo_name": "Tapad/sqoop",
"path": "src/java/org/apache/sqoop/SqoopOptions.java",
"license": "apache-2.0",
"size": 71739
} | [
"java.util.ArrayList",
"java.util.Properties"
] | import java.util.ArrayList; import java.util.Properties; | import java.util.*; | [
"java.util"
] | java.util; | 2,615,132 |
private String fixIEIssue(String input) {
return StringEscapeUtils.unescapeHtml(input);
} | String function(String input) { return StringEscapeUtils.unescapeHtml(input); } | /**
* this is fix the IE issue that it's input shell /command auto add '<br>
* ' if \n
*
* @param input
* @return
*/ | this is fix the IE issue that it's input shell /command auto add ' ' if \n | fixIEIssue | {
"repo_name": "jenkinsci/ssh2easy-plugin",
"path": "src/main/java/jenkins/plugins/ssh2easy/gssh/client/DefaultSshClient.java",
"license": "apache-2.0",
"size": 9198
} | [
"org.apache.commons.lang.StringEscapeUtils"
] | import org.apache.commons.lang.StringEscapeUtils; | import org.apache.commons.lang.*; | [
"org.apache.commons"
] | org.apache.commons; | 559,760 |
public void input(String in){
//TODO convert all string words into word words for Marla to understand them easier
//Check if input is a question
if(lockedActivator == null) {
for (Activator ac : activators) {
if (ac.check(in)) {
//TODO
}
}
}else{
if(in.equals("reload")) ;
else if(!in.equals("!exit"))
lockedActivator.in(in);
else{
output("Exiting from " + lockedActivator.getActivators()[0]);
lockedActivator = null;
}
}
//return this;
} | void function(String in){ if(lockedActivator == null) { for (Activator ac : activators) { if (ac.check(in)) { } } }else{ if(in.equals(STR)) ; else if(!in.equals("!exit")) lockedActivator.in(in); else{ output(STR + lockedActivator.getActivators()[0]); lockedActivator = null; } } } | /**
* How input is handled. From here Marla will figure out
* how to parse the input, and what plugins need to be
* told about the input. Also handles how a user might escape from
* locked in plugins, or specific Marla only commands.
* @param in
* @return this instance of Marla
*/ | How input is handled. From here Marla will figure out how to parse the input, and what plugins need to be told about the input. Also handles how a user might escape from locked in plugins, or specific Marla only commands | input | {
"repo_name": "ProjectMarla/Marla",
"path": "src/com/gmail/robmadeyou/brain/Marla.java",
"license": "unlicense",
"size": 9136
} | [
"com.gmail.robmadeyou.plugin.Activator"
] | import com.gmail.robmadeyou.plugin.Activator; | import com.gmail.robmadeyou.plugin.*; | [
"com.gmail.robmadeyou"
] | com.gmail.robmadeyou; | 1,767,371 |
public List<Integer> findNearbyIndexes( Point2D q ) {
List<Integer> nearby = new ArrayList<Integer>();
findNearby(q, new Segment(0, waypoints.length - 1), nearby );
return nearby;
} | List<Integer> function( Point2D q ) { List<Integer> nearby = new ArrayList<Integer>(); findNearby(q, new Segment(0, waypoints.length - 1), nearby ); return nearby; } | /**
* Find all points of S whose distances from q are within the target distance and are also local minima.
* @param q
* @return A list of the indexes of the found points.
*/ | Find all points of S whose distances from q are within the target distance and are also local minima | findNearbyIndexes | {
"repo_name": "melato/next-bus",
"path": "src/org/melato/geometry/gpx/ProximityFinder.java",
"license": "gpl-3.0",
"size": 11333
} | [
"java.util.ArrayList",
"java.util.List",
"org.melato.gps.Point2D"
] | import java.util.ArrayList; import java.util.List; import org.melato.gps.Point2D; | import java.util.*; import org.melato.gps.*; | [
"java.util",
"org.melato.gps"
] | java.util; org.melato.gps; | 1,524,782 |
TriggerBindingBuilder annotatedWith(Class<? extends Annotation> annotationType); | TriggerBindingBuilder annotatedWith(Class<? extends Annotation> annotationType); | /**
* Adds the specified annotation type to the configured binding target.
*
* @param annotationType the binding annotation type
* @return a builder which is used to configure the cron expression
* @throws NullPointerException if annotationType is null
*/ | Adds the specified annotation type to the configured binding target | annotatedWith | {
"repo_name": "palava/palava-cron",
"path": "src/main/java/de/cosmocode/palava/cron/AnnotatedTriggerBindingBuilder.java",
"license": "apache-2.0",
"size": 1600
} | [
"java.lang.annotation.Annotation"
] | import java.lang.annotation.Annotation; | import java.lang.annotation.*; | [
"java.lang"
] | java.lang; | 2,829,949 |
@SuppressWarnings("unused")
private void printConnecteds(Connections c) {
int[][] cons = c.getConnecteds();
for(int i = 0;i < cons.length;i++) {
System.out.println("c: " + Arrays.toString(cons[i]));
}
} | @SuppressWarnings(STR) void function(Connections c) { int[][] cons = c.getConnecteds(); for(int i = 0;i < cons.length;i++) { System.out.println(STR + Arrays.toString(cons[i])); } } | /**
* Prints the connected column mapping to standard out
* @param c
*/ | Prints the connected column mapping to standard out | printConnecteds | {
"repo_name": "sambitgaan/htm.java",
"path": "src/test/java/org/numenta/nupic/algorithms/SpatialPoolerCompatibilityTest.java",
"license": "agpl-3.0",
"size": 24534
} | [
"java.util.Arrays",
"org.numenta.nupic.model.Connections"
] | import java.util.Arrays; import org.numenta.nupic.model.Connections; | import java.util.*; import org.numenta.nupic.model.*; | [
"java.util",
"org.numenta.nupic"
] | java.util; org.numenta.nupic; | 310,581 |
void update(TagController controller, Player target); | void update(TagController controller, Player target); | /**
* Update a tag controller for the specified player.
*
* @param controller the controller to update
* @param target the player who the update should be sent to
*
* @see #update(TagController)
*/ | Update a tag controller for the specified player | update | {
"repo_name": "iso2013/MultiLineAPI",
"path": "MultiLineAPI/src/main/java/net/iso2013/mlapi/api/MultiLineAPI.java",
"license": "lgpl-3.0",
"size": 4296
} | [
"net.iso2013.mlapi.api.tag.TagController",
"org.bukkit.entity.Player"
] | import net.iso2013.mlapi.api.tag.TagController; import org.bukkit.entity.Player; | import net.iso2013.mlapi.api.tag.*; import org.bukkit.entity.*; | [
"net.iso2013.mlapi",
"org.bukkit.entity"
] | net.iso2013.mlapi; org.bukkit.entity; | 2,196,312 |
public String getFirstHeader(String headerName) {
List<String> headerValues = getHeaders(headerName);
return headerValues.isEmpty() ? null : headerValues.get(0);
} | String function(String headerName) { List<String> headerValues = getHeaders(headerName); return headerValues.isEmpty() ? null : headerValues.get(0); } | /**
* Returns the first header entry for the specified header name
* using case sensitive search.
*
* @param headerName header name to search
* @return first header entry
*/ | Returns the first header entry for the specified header name using case sensitive search | getFirstHeader | {
"repo_name": "junejosheeraz/IRIS",
"path": "interaction-core/src/main/java/com/temenos/interaction/core/web/RequestContext.java",
"license": "agpl-3.0",
"size": 7488
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,884,018 |
private void dropTempTables( List<AnalyticsTable> tables, JobProgress progress )
{
progress.runStage( tables, AnalyticsTable::getTableName, tableManager::dropTempTable );
} | void function( List<AnalyticsTable> tables, JobProgress progress ) { progress.runStage( tables, AnalyticsTable::getTableName, tableManager::dropTempTable ); } | /**
* Drops the given temporary analytics tables.
*/ | Drops the given temporary analytics tables | dropTempTables | {
"repo_name": "msf-oca-his/dhis2-core",
"path": "dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/DefaultAnalyticsTableService.java",
"license": "bsd-3-clause",
"size": 12478
} | [
"java.util.List",
"org.hisp.dhis.analytics.AnalyticsTable",
"org.hisp.dhis.scheduling.JobProgress"
] | import java.util.List; import org.hisp.dhis.analytics.AnalyticsTable; import org.hisp.dhis.scheduling.JobProgress; | import java.util.*; import org.hisp.dhis.analytics.*; import org.hisp.dhis.scheduling.*; | [
"java.util",
"org.hisp.dhis"
] | java.util; org.hisp.dhis; | 2,621,618 |
public void setUploadDate( OffsetDateTime uploadDate ) {
this.uploadDate = uploadDate;
} | void function( OffsetDateTime uploadDate ) { this.uploadDate = uploadDate; } | /**
* Date and time of upload.
*
* @param uploadDate Date and time.
*/ | Date and time of upload | setUploadDate | {
"repo_name": "coffeine-009/storage",
"path": "src/main/java/com/thecoffeine/storage/models/entities/File.java",
"license": "mit",
"size": 4591
} | [
"java.time.OffsetDateTime"
] | import java.time.OffsetDateTime; | import java.time.*; | [
"java.time"
] | java.time; | 2,177,430 |
public void createSoftPhone(String server) throws MediaException;
| void function(String server) throws MediaException; | /**
* Create the softphone handlers and stack
*/ | Create the softphone handlers and stack | createSoftPhone | {
"repo_name": "joshuairl/toothchat-client",
"path": "src/plugins/sip/src/java/net/java/sipmack/softphone/SoftPhone.java",
"license": "apache-2.0",
"size": 3790
} | [
"net.java.sipmack.media.MediaException"
] | import net.java.sipmack.media.MediaException; | import net.java.sipmack.media.*; | [
"net.java.sipmack"
] | net.java.sipmack; | 2,910,068 |
public static long purge(File directory, Duration duration, FilenameFilter filter, boolean recurse) throws FileNotFoundException {
return purge(directory, duration == null ? null : DateTimeHelper.earlier(duration), filter, recurse);
} | static long function(File directory, Duration duration, FilenameFilter filter, boolean recurse) throws FileNotFoundException { return purge(directory, duration == null ? null : DateTimeHelper.earlier(duration), filter, recurse); } | /**
* Deletes all files in the given directory, and child directories if recurse is true, older than the given
* duration.
*
* @param directory The directory to be purged.
* @param duration The age files must be before they are deleted.
* @param filter An optional FilenameFilter used to filter which files are deleted.
* @param recurse If true, then child files and directories will also be recursively purged.
* @return The number of files deleted.
* @throws FileNotFoundException If the directory does not exist.
*/ | Deletes all files in the given directory, and child directories if recurse is true, older than the given duration | purge | {
"repo_name": "Permafrost/Tundra.java",
"path": "src/main/java/permafrost/tundra/io/DirectoryHelper.java",
"license": "mit",
"size": 24096
} | [
"java.io.File",
"java.io.FileNotFoundException",
"java.io.FilenameFilter",
"javax.xml.datatype.Duration"
] | import java.io.File; import java.io.FileNotFoundException; import java.io.FilenameFilter; import javax.xml.datatype.Duration; | import java.io.*; import javax.xml.datatype.*; | [
"java.io",
"javax.xml"
] | java.io; javax.xml; | 1,065,196 |
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public static void setupSharedElementTransitions(@NonNull Activity activity,
@Nullable View mockFab,
int dialogCornerRadius) {
if (!activity.getIntent().hasExtra(EXTRA_SHARED_ELEMENT_START_COLOR)) return;
int startCornerRadius = activity.getIntent()
.getIntExtra(EXTRA_SHARED_ELEMENT_START_CORNER_RADIUS, -1);
ArcMotion arcMotion = new ArcMotion();
arcMotion.setMinimumHorizontalAngle(5f);
arcMotion.setMinimumVerticalAngle(10f);
arcMotion.setMaximumAngle(10f);
int color = activity.getIntent().getIntExtra(EXTRA_SHARED_ELEMENT_START_COLOR, Color.TRANSPARENT);
Interpolator easeInOut =
AnimationUtils.loadInterpolator(activity, android.R.interpolator.fast_out_slow_in);
MorphFabToDialog sharedEnter =
new MorphFabToDialog(color, dialogCornerRadius, startCornerRadius);
sharedEnter.setPathMotion(arcMotion);
sharedEnter.setInterpolator(easeInOut);
MorphDialogToFab sharedReturn = new MorphDialogToFab(color, startCornerRadius);
sharedReturn.setPathMotion(arcMotion);
sharedReturn.setInterpolator(easeInOut);
if (mockFab != null) {
sharedEnter.addTarget(mockFab);
sharedReturn.addTarget(mockFab);
}
TransitionSet set = new TransitionSet();
set.addTransition(sharedEnter);
//TODO: Elevation flicker is due to FAB still visible
set.addTransition(new ChangeElevation());
TransitionSet set2 = new TransitionSet();
set2.addTransition(sharedReturn);
set2.addTransition(new ChangeElevation());
activity.getWindow().setSharedElementEnterTransition(set);
activity.getWindow().setSharedElementReturnTransition(set2);
} | @TargetApi(Build.VERSION_CODES.LOLLIPOP) static void function(@NonNull Activity activity, @Nullable View mockFab, int dialogCornerRadius) { if (!activity.getIntent().hasExtra(EXTRA_SHARED_ELEMENT_START_COLOR)) return; int startCornerRadius = activity.getIntent() .getIntExtra(EXTRA_SHARED_ELEMENT_START_CORNER_RADIUS, -1); ArcMotion arcMotion = new ArcMotion(); arcMotion.setMinimumHorizontalAngle(5f); arcMotion.setMinimumVerticalAngle(10f); arcMotion.setMaximumAngle(10f); int color = activity.getIntent().getIntExtra(EXTRA_SHARED_ELEMENT_START_COLOR, Color.TRANSPARENT); Interpolator easeInOut = AnimationUtils.loadInterpolator(activity, android.R.interpolator.fast_out_slow_in); MorphFabToDialog sharedEnter = new MorphFabToDialog(color, dialogCornerRadius, startCornerRadius); sharedEnter.setPathMotion(arcMotion); sharedEnter.setInterpolator(easeInOut); MorphDialogToFab sharedReturn = new MorphDialogToFab(color, startCornerRadius); sharedReturn.setPathMotion(arcMotion); sharedReturn.setInterpolator(easeInOut); if (mockFab != null) { sharedEnter.addTarget(mockFab); sharedReturn.addTarget(mockFab); } TransitionSet set = new TransitionSet(); set.addTransition(sharedEnter); set.addTransition(new ChangeElevation()); TransitionSet set2 = new TransitionSet(); set2.addTransition(sharedReturn); set2.addTransition(new ChangeElevation()); activity.getWindow().setSharedElementEnterTransition(set); activity.getWindow().setSharedElementReturnTransition(set2); } | /**
* Configure the shared element transitions for morphin from a fab <-> dialog. We need to do
* this in code rather than declaratively as we need to supply the color to transition from/to
* and the dialog corner radius which is dynamically supplied depending upon where this screen
* is launched from.
*/ | Configure the shared element transitions for morphin from a fab dialog. We need to do this in code rather than declaratively as we need to supply the color to transition from/to and the dialog corner radius which is dynamically supplied depending upon where this screen is launched from | setupSharedElementTransitions | {
"repo_name": "plusCubed/anticipate",
"path": "app/src/main/java/com/pluscubed/anticipate/transition/FabDialogMorphSetup.java",
"license": "gpl-3.0",
"size": 3169
} | [
"android.annotation.TargetApi",
"android.app.Activity",
"android.graphics.Color",
"android.os.Build",
"android.support.annotation.NonNull",
"android.support.annotation.Nullable",
"android.transition.ArcMotion",
"android.transition.TransitionSet",
"android.view.View",
"android.view.animation.Animat... | import android.annotation.TargetApi; import android.app.Activity; import android.graphics.Color; import android.os.Build; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.transition.ArcMotion; import android.transition.TransitionSet; import android.view.View; import android.view.animation.AnimationUtils; import android.view.animation.Interpolator; | import android.annotation.*; import android.app.*; import android.graphics.*; import android.os.*; import android.support.annotation.*; import android.transition.*; import android.view.*; import android.view.animation.*; | [
"android.annotation",
"android.app",
"android.graphics",
"android.os",
"android.support",
"android.transition",
"android.view"
] | android.annotation; android.app; android.graphics; android.os; android.support; android.transition; android.view; | 297,141 |
void deleteHistoricDecisionInstancesBulk(List<String> decisionInstanceIds); | void deleteHistoricDecisionInstancesBulk(List<String> decisionInstanceIds); | /**
* Deletes decision instances and all related historic data in bulk manner. DELETE SQL statement will be created for each entity type. They will have list
* of given decision instance ids in IN clause. Therefore, DB limitation for number of values in IN clause must be taken into account.
*
* @param decisionInstanceIds list of decision instance ids for removal.
*
* @throws AuthorizationException
* If the user has no {@link Permissions#DELETE_HISTORY} permission on {@link Resources#DECISION_DEFINITION}.
*/ | Deletes decision instances and all related historic data in bulk manner. DELETE SQL statement will be created for each entity type. They will have list of given decision instance ids in IN clause. Therefore, DB limitation for number of values in IN clause must be taken into account | deleteHistoricDecisionInstancesBulk | {
"repo_name": "filiphr/camunda-bpm-platform",
"path": "engine/src/main/java/org/camunda/bpm/engine/HistoryService.java",
"license": "apache-2.0",
"size": 20070
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,536,824 |
void overrideProperties(Properties overrides) {
if(overrides != null) {
for (Object propertyName : overrides.keySet()) {
String value = (String) overrides.get(propertyName);
if (value != null && value.length() > 0) {
properties.setProperty((String) propertyName, value);
}
}
}
}
| void overrideProperties(Properties overrides) { if(overrides != null) { for (Object propertyName : overrides.keySet()) { String value = (String) overrides.get(propertyName); if (value != null && value.length() > 0) { properties.setProperty((String) propertyName, value); } } } } | /**
* Override all non-null values from
*
* @param originals
* @param overrides
*/ | Override all non-null values from | overrideProperties | {
"repo_name": "xschildw/Synapse-Repository-Services",
"path": "lib/stackConfiguration/src/main/java/org/sagebionetworks/ConfigurationPropertiesImpl.java",
"license": "apache-2.0",
"size": 4747
} | [
"java.util.Properties"
] | import java.util.Properties; | import java.util.*; | [
"java.util"
] | java.util; | 1,246,397 |
public LockComponentBuilder setShared() {
component.setType(LockType.SHARED_READ);
return this;
} | LockComponentBuilder function() { component.setType(LockType.SHARED_READ); return this; } | /**
* Set the lock to be shared.
* @return reference to this builder
*/ | Set the lock to be shared | setShared | {
"repo_name": "scalingdata/Impala",
"path": "thirdparty/hive-1.2.1.2.3.0.0-2557/src/metastore/src/java/org/apache/hadoop/hive/metastore/LockComponentBuilder.java",
"license": "apache-2.0",
"size": 2987
} | [
"org.apache.hadoop.hive.metastore.api.LockType"
] | import org.apache.hadoop.hive.metastore.api.LockType; | import org.apache.hadoop.hive.metastore.api.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 2,891,012 |
private static ArrayList<ArrayList<LatLng>> parseCoordinatesArrays(JSONArray coordinates)
throws JSONException {
ArrayList<ArrayList<LatLng>> coordinatesArray = new ArrayList<ArrayList<LatLng>>();
for (int i = 0; i < coordinates.length(); i++) {
coordinatesArray.add(parseCoordinatesArray(coordinates.getJSONArray(i)));
}
return coordinatesArray;
} | static ArrayList<ArrayList<LatLng>> function(JSONArray coordinates) throws JSONException { ArrayList<ArrayList<LatLng>> coordinatesArray = new ArrayList<ArrayList<LatLng>>(); for (int i = 0; i < coordinates.length(); i++) { coordinatesArray.add(parseCoordinatesArray(coordinates.getJSONArray(i))); } return coordinatesArray; } | /**
* Parses an array of arrays containing coordinates into an ArrayList of an ArrayList of LatLng
* objects
*
* @param coordinates array of an array containing the GeoJSON coordinates
* @return ArrayList of an ArrayList of LatLng objects
* @throws JSONException if coordinates cannot be parsed
*/ | Parses an array of arrays containing coordinates into an ArrayList of an ArrayList of LatLng objects | parseCoordinatesArrays | {
"repo_name": "mastrgamr/mapbox-android-utils",
"path": "library/src/main/java/net/mastrgamr/mbmapboxutils/geojson/GeoJsonParser.java",
"license": "apache-2.0",
"size": 18859
} | [
"com.mapbox.mapboxsdk.geometry.LatLng",
"java.util.ArrayList",
"org.json.JSONArray",
"org.json.JSONException"
] | import com.mapbox.mapboxsdk.geometry.LatLng; import java.util.ArrayList; import org.json.JSONArray; import org.json.JSONException; | import com.mapbox.mapboxsdk.geometry.*; import java.util.*; import org.json.*; | [
"com.mapbox.mapboxsdk",
"java.util",
"org.json"
] | com.mapbox.mapboxsdk; java.util; org.json; | 2,306,534 |
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<PagedResponse<FirewallPolicyInner>> listByResourceGroupSinglePageAsync(
String resourceGroupName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String apiVersion = "2020-05-01";
context = this.client.mergeContext(context);
return service
.listByResourceGroup(
this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context)
.map(
res ->
new PagedResponseBase<>(
res.getRequest(),
res.getStatusCode(),
res.getHeaders(),
res.getValue().value(),
res.getValue().nextLink(),
null));
} | @ServiceMethod(returns = ReturnType.SINGLE) Mono<PagedResponse<FirewallPolicyInner>> function( String resourceGroupName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( STR)); } final String apiVersion = STR; context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) .map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } | /**
* Lists all Firewall Policies in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ListFirewallPolicies API service call.
*/ | Lists all Firewall Policies in a resource group | listByResourceGroupSinglePageAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/FirewallPoliciesClientImpl.java",
"license": "mit",
"size": 59146
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.PagedResponse",
"com.azure.core.http.rest.PagedResponseBase",
"com.azure.core.util.Context",
"com.azure.resourcemanager.network.fluent.models.FirewallPolicyInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.util.Context; import com.azure.resourcemanager.network.fluent.models.FirewallPolicyInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.network.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 135,132 |
public final Experiment setInput(JsonMap params) {
for (String key : params.keySet()) {
setInput(key, params.get(key));
}
return this;
} | final Experiment function(JsonMap params) { for (String key : params.keySet()) { setInput(key, params.get(key)); } return this; } | /**
* Sets an input parameter for this experiment by copying those from an existing
* map
*
* @param params
* The input parameters
* @return This experiment
*/ | Sets an input parameter for this experiment by copying those from an existing map | setInput | {
"repo_name": "liflab/labpal",
"path": "Source/Core/src/ca/uqac/lif/labpal/Experiment.java",
"license": "gpl-3.0",
"size": 31622
} | [
"ca.uqac.lif.json.JsonMap"
] | import ca.uqac.lif.json.JsonMap; | import ca.uqac.lif.json.*; | [
"ca.uqac.lif"
] | ca.uqac.lif; | 2,380,833 |
private static void appendTagsFromFieldValues(String field_,
Context context_, Tags tags_) {
if (context_.extraFields == null) {
return;
}
final List<FieldValue> values = context_.extraFields.get(field_);
if (values == null) {
return;
}
for (FieldValue value : values) {
try {
// Only single line tags supported
if (value.location.startLine != value.location.endLine) {
// Only single line names are supported
value.location.endLine = value.location.startLine;
value.location.endColumn = context_.lineInfos.getLineContent(
(int) value.location.startLine).length() + 1;
}
// Workaround for bad "end-of-line" position
value.location.startColumn = Math.min(value.location.startColumn,
value.location.endColumn);
Tag.Kind kind;
try {
kind = Tag.Kind.valueOf(value.context);
} catch (IllegalArgumentException ex) {
_log.log(Level.SEVERE, "Bad kind!", ex);
continue;
}
Location loc;
try {
// I assume that we got a location with exclusive end (as it is in
// the thrift API documentation), so let`s convert it to inclusive.
loc = new Location(
(int) value.location.startLine,
(int) value.location.startColumn,
(int) value.location.endColumn - 1);
} catch (IllegalArgumentException ex) {
_log.log(Level.FINE, "Skipping tag: ''{0}'' due to its wrong " +
"location: {1}", new Object[]{value.value,
value.location.toString()});
continue;
}
// Convert field to a tag
final Tag tag = new Tag(loc, value.value, value.context, kind);
// Calculate start offset
final int offset = context_.lineInfos.locationToStartOffset(
tag.location);
tags_.add(tag, offset);
} catch (IndexOutOfBoundsException ex) {
_log.log(Level.FINE, "Possibly bad line or column number!", ex);
}
}
} | static void function(String field_, Context context_, Tags tags_) { if (context_.extraFields == null) { return; } final List<FieldValue> values = context_.extraFields.get(field_); if (values == null) { return; } for (FieldValue value : values) { try { if (value.location.startLine != value.location.endLine) { value.location.endLine = value.location.startLine; value.location.endColumn = context_.lineInfos.getLineContent( (int) value.location.startLine).length() + 1; } value.location.startColumn = Math.min(value.location.startColumn, value.location.endColumn); Tag.Kind kind; try { kind = Tag.Kind.valueOf(value.context); } catch (IllegalArgumentException ex) { _log.log(Level.SEVERE, STR, ex); continue; } Location loc; try { loc = new Location( (int) value.location.startLine, (int) value.location.startColumn, (int) value.location.endColumn - 1); } catch (IllegalArgumentException ex) { _log.log(Level.FINE, STR + STR, new Object[]{value.value, value.location.toString()}); continue; } final Tag tag = new Tag(loc, value.value, value.context, kind); final int offset = context_.lineInfos.locationToStartOffset( tag.location); tags_.add(tag, offset); } catch (IndexOutOfBoundsException ex) { _log.log(Level.FINE, STR, ex); } } } | /**
* Adds tags the from user provided extra field map (if any).
*
* @param field a document field.
* @param context_ indexer context.
* @param tags_ tag container.
*/ | Adds tags the from user provided extra field map (if any) | appendTagsFromFieldValues | {
"repo_name": "Ericsson/CodeCompass",
"path": "plugins/search/indexer/indexer-java/src/cc/search/indexer/AbstractIndexer.java",
"license": "gpl-3.0",
"size": 14495
} | [
"cc.parser.search.FieldValue",
"cc.search.analysis.Location",
"cc.search.analysis.tags.Tag",
"cc.search.analysis.tags.Tags",
"java.util.List",
"java.util.logging.Level"
] | import cc.parser.search.FieldValue; import cc.search.analysis.Location; import cc.search.analysis.tags.Tag; import cc.search.analysis.tags.Tags; import java.util.List; import java.util.logging.Level; | import cc.parser.search.*; import cc.search.analysis.*; import cc.search.analysis.tags.*; import java.util.*; import java.util.logging.*; | [
"cc.parser.search",
"cc.search.analysis",
"java.util"
] | cc.parser.search; cc.search.analysis; java.util; | 914,019 |
void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter,
boolean durable) throws ActiveMQException; | void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, boolean durable) throws ActiveMQException; | /**
* Creates a <em>non-temporary</em> queue.
*
* @param address the queue will be bound to this address
* @param routingType the delivery mode for this queue, MULTICAST or ANYCAST
* @param queueName the name of the queue
* @param filter only messages which match this filter will be put in the queue
* @param durable whether the queue is durable or not
* @throws ActiveMQException in an exception occurs while creating the queue
*/ | Creates a non-temporary queue | createQueue | {
"repo_name": "willr3/activemq-artemis",
"path": "artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientSession.java",
"license": "apache-2.0",
"size": 41343
} | [
"org.apache.activemq.artemis.api.core.ActiveMQException",
"org.apache.activemq.artemis.api.core.SimpleString",
"org.apache.activemq.artemis.core.server.RoutingType"
] | import org.apache.activemq.artemis.api.core.ActiveMQException; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.core.server.RoutingType; | import org.apache.activemq.artemis.api.core.*; import org.apache.activemq.artemis.core.server.*; | [
"org.apache.activemq"
] | org.apache.activemq; | 1,943,094 |
public TreeNode<IBaseVO<? extends Serializable>> getTreeNode(){
return null;
} | TreeNode<IBaseVO<? extends Serializable>> function(){ return null; } | /**
* Recupera arvore de arquivos e processos
* @return
*/ | Recupera arvore de arquivos e processos | getTreeNode | {
"repo_name": "darciopacifico/omr",
"path": "modulesOMR/trunk/JazzOMR/portlet/src/main/java/br/com/dlp/jazzomr/event/EventProcJSFBean.java",
"license": "apache-2.0",
"size": 25460
} | [
"br.com.dlp.framework.vo.IBaseVO",
"java.io.Serializable",
"org.richfaces.model.TreeNode"
] | import br.com.dlp.framework.vo.IBaseVO; import java.io.Serializable; import org.richfaces.model.TreeNode; | import br.com.dlp.framework.vo.*; import java.io.*; import org.richfaces.model.*; | [
"br.com.dlp",
"java.io",
"org.richfaces.model"
] | br.com.dlp; java.io; org.richfaces.model; | 348,776 |
public static Set<KijiUser> deserializeKijiUsers(byte[] bytes) throws IOException {
SpecificDatumReader<SecurityUserList> reader =
new SpecificDatumReader<SecurityUserList>(SecurityUserList.SCHEMA$);
Decoder decoder = DecoderFactory.get().binaryDecoder(bytes, null);
SecurityUserList securityUserList = reader.read(null, decoder);
Set<KijiUser> result = new HashSet<KijiUser>();
for (KijiUserRecord userRecord : securityUserList.getUsers()) {
result.add(KijiUser.fromName(userRecord.getName()));
}
return result;
} | static Set<KijiUser> function(byte[] bytes) throws IOException { SpecificDatumReader<SecurityUserList> reader = new SpecificDatumReader<SecurityUserList>(SecurityUserList.SCHEMA$); Decoder decoder = DecoderFactory.get().binaryDecoder(bytes, null); SecurityUserList securityUserList = reader.read(null, decoder); Set<KijiUser> result = new HashSet<KijiUser>(); for (KijiUserRecord userRecord : securityUserList.getUsers()) { result.add(KijiUser.fromName(userRecord.getName())); } return result; } | /**
* Deserializes a set of KijiUsers from a byte array.
*
* @param bytes to deserialize.
* @return deserialized users.
* @throws IOException on I/O error.
*/ | Deserializes a set of KijiUsers from a byte array | deserializeKijiUsers | {
"repo_name": "rpinzon/kiji-schema",
"path": "kiji-schema/src/main/java/org/kiji/schema/security/KijiUser.java",
"license": "apache-2.0",
"size": 5836
} | [
"java.io.IOException",
"java.util.HashSet",
"java.util.Set",
"org.apache.avro.io.Decoder",
"org.apache.avro.io.DecoderFactory",
"org.apache.avro.specific.SpecificDatumReader",
"org.kiji.schema.avro.KijiUserRecord",
"org.kiji.schema.avro.SecurityUserList"
] | import java.io.IOException; import java.util.HashSet; import java.util.Set; import org.apache.avro.io.Decoder; import org.apache.avro.io.DecoderFactory; import org.apache.avro.specific.SpecificDatumReader; import org.kiji.schema.avro.KijiUserRecord; import org.kiji.schema.avro.SecurityUserList; | import java.io.*; import java.util.*; import org.apache.avro.io.*; import org.apache.avro.specific.*; import org.kiji.schema.avro.*; | [
"java.io",
"java.util",
"org.apache.avro",
"org.kiji.schema"
] | java.io; java.util; org.apache.avro; org.kiji.schema; | 2,082,569 |
Set<String> getClassAnnotations(String className, int scanPolicies);
// | Set<String> getClassAnnotations(String className, int scanPolicies); // | /**
* <p>Answer the names of annotations on the specified class. Restrict results
* to only those recorded in the specified regions.</p>
*
* @param className The name of the class for which to select class annotations.
* @param scanPolicies The policies for which to select class annotations, as bitwise
* OR of scan policy values.
*
* @return The names of class annotations of the named class, selected from the
* specified results.
*/ | Answer the names of annotations on the specified class. Restrict results to only those recorded in the specified regions | getClassAnnotations | {
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.anno/src/com/ibm/wsspi/annocache/targets/AnnotationTargets_Targets.java",
"license": "epl-1.0",
"size": 34094
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 75,396 |
public static String getDefaultBooleanAcceptHeader() {
// Copy into a Set.
final Set<BooleanQueryResultFormat> values = new LinkedHashSet<BooleanQueryResultFormat>(
BooleanQueryResultFormat.values());
final BooleanQueryResultParserRegistry registry = BooleanQueryResultParserRegistry
.getInstance();
final Iterator<BooleanQueryResultFormat> itr = values.iterator();
while (itr.hasNext()) {
final BooleanQueryResultFormat format = itr.next();
if (registry.get(format) == null) {
itr.remove();
}
}
final List<String> list3 = AcceptHeaderFactory.getAcceptParams(
values,
BooleanQueryResultFormat.SPARQL);
return toString(list3);
}
| static String function() { final Set<BooleanQueryResultFormat> values = new LinkedHashSet<BooleanQueryResultFormat>( BooleanQueryResultFormat.values()); final BooleanQueryResultParserRegistry registry = BooleanQueryResultParserRegistry .getInstance(); final Iterator<BooleanQueryResultFormat> itr = values.iterator(); while (itr.hasNext()) { final BooleanQueryResultFormat format = itr.next(); if (registry.get(format) == null) { itr.remove(); } } final List<String> list3 = AcceptHeaderFactory.getAcceptParams( values, BooleanQueryResultFormat.SPARQL); return toString(list3); } | /**
* Return an accept header which establishes a preference pattern for
* boolean data. The accept header will not include any formats for
* which we can not discover a parser.
*/ | Return an accept header which establishes a preference pattern for boolean data. The accept header will not include any formats for which we can not discover a parser | getDefaultBooleanAcceptHeader | {
"repo_name": "blazegraph/database",
"path": "bigdata-client/src/main/java/com/bigdata/rdf/sail/webapp/client/AcceptHeaderFactory.java",
"license": "gpl-2.0",
"size": 10269
} | [
"java.util.Iterator",
"java.util.LinkedHashSet",
"java.util.List",
"java.util.Set",
"org.openrdf.query.resultio.BooleanQueryResultFormat",
"org.openrdf.query.resultio.BooleanQueryResultParserRegistry"
] | import java.util.Iterator; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; import org.openrdf.query.resultio.BooleanQueryResultFormat; import org.openrdf.query.resultio.BooleanQueryResultParserRegistry; | import java.util.*; import org.openrdf.query.resultio.*; | [
"java.util",
"org.openrdf.query"
] | java.util; org.openrdf.query; | 2,669,346 |
@Override
public String getText(Object object) {
String label = ((SystemVariable)object).getSysId();
return label == null || label.length() == 0 ?
getString("_UI_SystemVariable_type") :
getString("_UI_SystemVariable_type") + " " + label;
}
| String function(Object object) { String label = ((SystemVariable)object).getSysId(); return label == null label.length() == 0 ? getString(STR) : getString(STR) + " " + label; } | /**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This returns the label text for the adapted class. | getText | {
"repo_name": "FTSRG/mondo-collab-framework",
"path": "archive/workspaceTracker/VA/ikerlanEMF.edit/src/eu/mondo/collaboration/operationtracemodel/example/WTSpec/provider/SystemVariableItemProvider.java",
"license": "epl-1.0",
"size": 4552
} | [
"eu.mondo.collaboration.operationtracemodel.example.WTSpec"
] | import eu.mondo.collaboration.operationtracemodel.example.WTSpec; | import eu.mondo.collaboration.operationtracemodel.example.*; | [
"eu.mondo.collaboration"
] | eu.mondo.collaboration; | 1,668,011 |
public boolean updateBeacons(List<BeaconEnvironment> beaconList) {
Options options = getDefaultOptions();
options.channel = Options.CHANNEL_STOMP;
return super.updateToBool("me", "beaconEnvironment", null, beaconList, options, null);
} | boolean function(List<BeaconEnvironment> beaconList) { Options options = getDefaultOptions(); options.channel = Options.CHANNEL_STOMP; return super.updateToBool("me", STR, null, beaconList, options, null); } | /**
* Updates the current users account with the given beacons.
*
* @return True if successfully updated, false else.
*/ | Updates the current users account with the given beacons | updateBeacons | {
"repo_name": "secucard/secucard-connect-java-sdk",
"path": "src/main/java/com/secucard/connect/product/general/AccountsService.java",
"license": "apache-2.0",
"size": 4937
} | [
"com.secucard.connect.net.Options",
"com.secucard.connect.product.general.model.BeaconEnvironment",
"java.util.List"
] | import com.secucard.connect.net.Options; import com.secucard.connect.product.general.model.BeaconEnvironment; import java.util.List; | import com.secucard.connect.net.*; import com.secucard.connect.product.general.model.*; import java.util.*; | [
"com.secucard.connect",
"java.util"
] | com.secucard.connect; java.util; | 774,115 |
protected ScriptSource getScriptSource(String beanName, String scriptSourceLocator) {
synchronized (this.scriptSourceCache) {
ScriptSource scriptSource = (ScriptSource) this.scriptSourceCache.get(beanName);
if (scriptSource == null) {
scriptSource = convertToScriptSource(beanName, scriptSourceLocator, this.resourceLoader);
this.scriptSourceCache.put(beanName, scriptSource);
}
return scriptSource;
}
} | ScriptSource function(String beanName, String scriptSourceLocator) { synchronized (this.scriptSourceCache) { ScriptSource scriptSource = (ScriptSource) this.scriptSourceCache.get(beanName); if (scriptSource == null) { scriptSource = convertToScriptSource(beanName, scriptSourceLocator, this.resourceLoader); this.scriptSourceCache.put(beanName, scriptSource); } return scriptSource; } } | /**
* Obtain a ScriptSource for the given bean, lazily creating it
* if not cached already.
* @param beanName the name of the scripted bean
* @param scriptSourceLocator the script source locator associated with the bean
* @return the corresponding ScriptSource instance
* @see #convertToScriptSource
*/ | Obtain a ScriptSource for the given bean, lazily creating it if not cached already | getScriptSource | {
"repo_name": "cbeams-archive/spring-framework-2.5.x",
"path": "src/org/springframework/scripting/support/ScriptFactoryPostProcessor.java",
"license": "apache-2.0",
"size": 23558
} | [
"org.springframework.scripting.ScriptSource"
] | import org.springframework.scripting.ScriptSource; | import org.springframework.scripting.*; | [
"org.springframework.scripting"
] | org.springframework.scripting; | 60,699 |
public static <TSource, TInner, TKey, TResult> Enumerable<TResult> groupJoin(
final Enumerable<TSource> outer, final Enumerable<TInner> inner,
final Function1<TSource, TKey> outerKeySelector,
final Function1<TInner, TKey> innerKeySelector,
final Function2<TSource, Enumerable<TInner>, TResult> resultSelector) {
return new AbstractEnumerable<TResult>() {
final Map<TKey, TSource> outerMap = outer.toMap(outerKeySelector);
final Lookup<TKey, TInner> innerLookup = inner.toLookup(innerKeySelector);
final Enumerator<Map.Entry<TKey, TSource>> entries =
Linq4j.enumerator(outerMap.entrySet()); | static <TSource, TInner, TKey, TResult> Enumerable<TResult> function( final Enumerable<TSource> outer, final Enumerable<TInner> inner, final Function1<TSource, TKey> outerKeySelector, final Function1<TInner, TKey> innerKeySelector, final Function2<TSource, Enumerable<TInner>, TResult> resultSelector) { return new AbstractEnumerable<TResult>() { final Map<TKey, TSource> outerMap = outer.toMap(outerKeySelector); final Lookup<TKey, TInner> innerLookup = inner.toLookup(innerKeySelector); final Enumerator<Map.Entry<TKey, TSource>> entries = Linq4j.enumerator(outerMap.entrySet()); | /**
* Correlates the elements of two sequences based on
* equality of keys and groups the results. The default equality
* comparer is used to compare keys.
*/ | Correlates the elements of two sequences based on equality of keys and groups the results. The default equality comparer is used to compare keys | groupJoin | {
"repo_name": "vlsi/calcite",
"path": "linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableDefaults.java",
"license": "apache-2.0",
"size": 156877
} | [
"java.util.Map",
"org.apache.calcite.linq4j.function.Function1",
"org.apache.calcite.linq4j.function.Function2"
] | import java.util.Map; import org.apache.calcite.linq4j.function.Function1; import org.apache.calcite.linq4j.function.Function2; | import java.util.*; import org.apache.calcite.linq4j.function.*; | [
"java.util",
"org.apache.calcite"
] | java.util; org.apache.calcite; | 2,853,227 |
public TokenHolder link(IToken<?> token) {
currentHolderCheck("No current TokenHolder to link, you should use link(TokenHolder, IToken) instead!");
TokenHolder parent = current.getLast();
TokenHolder newHolder = parent.link(token, parent);
keepEnter(newHolder);
return newHolder;
} | TokenHolder function(IToken<?> token) { currentHolderCheck(STR); TokenHolder parent = current.getLast(); TokenHolder newHolder = parent.link(token, parent); keepEnter(newHolder); return newHolder; } | /**
* Link Token to current
* @param token Token
* @return new TokenHolder created for Token
*/ | Link Token to current | link | {
"repo_name": "JonathanxD/TextLexer",
"path": "src/main/java/com/github/jonathanxd/textlexer/ext/parser/structure/ParseSection.java",
"license": "agpl-3.0",
"size": 5565
} | [
"com.github.jonathanxd.textlexer.ext.parser.holder.TokenHolder",
"com.github.jonathanxd.textlexer.lexer.token.IToken"
] | import com.github.jonathanxd.textlexer.ext.parser.holder.TokenHolder; import com.github.jonathanxd.textlexer.lexer.token.IToken; | import com.github.jonathanxd.textlexer.ext.parser.holder.*; import com.github.jonathanxd.textlexer.lexer.token.*; | [
"com.github.jonathanxd"
] | com.github.jonathanxd; | 523,157 |
@ApiModelProperty(example = "ceef66a5-a545-413b-9312-78a53caadbc4", value = "See Accounts")
public UUID getAccountID() {
return accountID;
} | @ApiModelProperty(example = STR, value = STR) UUID function() { return accountID; } | /**
* See Accounts
*
* @return accountID
*/ | See Accounts | getAccountID | {
"repo_name": "XeroAPI/Xero-Java",
"path": "src/main/java/com/xero/models/accounting/JournalLine.java",
"license": "mit",
"size": 13809
} | [
"io.swagger.annotations.ApiModelProperty"
] | import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.*; | [
"io.swagger.annotations"
] | io.swagger.annotations; | 1,925,998 |
public int quantityDropped(Random random)
{
return this.isDouble() ? 2 : 1;
} | int function(Random random) { return this.isDouble() ? 2 : 1; } | /**
* Returns the quantity of items to drop on block destruction.
*/ | Returns the quantity of items to drop on block destruction | quantityDropped | {
"repo_name": "TorchPowered/Thallium",
"path": "src/main/java/net/minecraft/block/BlockSlab.java",
"license": "mit",
"size": 4670
} | [
"java.util.Random"
] | import java.util.Random; | import java.util.*; | [
"java.util"
] | java.util; | 2,431,616 |
@Test
public void testEnableTextIndexOnExistingRawColumn()
throws Exception {
Set<String> textIndexColumns = new HashSet<>();
textIndexColumns.add(EXISTING_STRING_COL_RAW);
_indexLoadingConfig.setTextIndexColumns(textIndexColumns);
// Create a segment in V3, enable text index on existing column
constructV3Segment();
SegmentMetadataImpl segmentMetadata = new SegmentMetadataImpl(_indexDir);
ColumnMetadata columnMetadata = segmentMetadata.getColumnMetadataFor(EXISTING_STRING_COL_RAW);
// column exists and does not have text index enabled
Assert.assertNotNull(columnMetadata);
Assert.assertEquals(columnMetadata.getTextIndexType(), TextIndexType.NONE);
checkTextIndexCreation(EXISTING_STRING_COL_RAW, 5, 3, _schema, false, false, false, 0);
// Create a segment in V1, add a new column with text index enabled
constructV1Segment();
segmentMetadata = new SegmentMetadataImpl(_indexDir);
columnMetadata = segmentMetadata.getColumnMetadataFor(EXISTING_STRING_COL_RAW);
// column exists and does not have text index enabled
Assert.assertNotNull(columnMetadata);
Assert.assertEquals(columnMetadata.getTextIndexType(), TextIndexType.NONE);
checkTextIndexCreation(EXISTING_STRING_COL_RAW, 5, 3, _schema, false, false, false, 0);
} | void function() throws Exception { Set<String> textIndexColumns = new HashSet<>(); textIndexColumns.add(EXISTING_STRING_COL_RAW); _indexLoadingConfig.setTextIndexColumns(textIndexColumns); constructV3Segment(); SegmentMetadataImpl segmentMetadata = new SegmentMetadataImpl(_indexDir); ColumnMetadata columnMetadata = segmentMetadata.getColumnMetadataFor(EXISTING_STRING_COL_RAW); Assert.assertNotNull(columnMetadata); Assert.assertEquals(columnMetadata.getTextIndexType(), TextIndexType.NONE); checkTextIndexCreation(EXISTING_STRING_COL_RAW, 5, 3, _schema, false, false, false, 0); constructV1Segment(); segmentMetadata = new SegmentMetadataImpl(_indexDir); columnMetadata = segmentMetadata.getColumnMetadataFor(EXISTING_STRING_COL_RAW); Assert.assertNotNull(columnMetadata); Assert.assertEquals(columnMetadata.getTextIndexType(), TextIndexType.NONE); checkTextIndexCreation(EXISTING_STRING_COL_RAW, 5, 3, _schema, false, false, false, 0); } | /**
* Test to check text index creation during segment load after text index
* creation is enabled on an existing raw column.
* This will exercise the SegmentPreprocessor code path during segment load
* @throws Exception
*/ | Test to check text index creation during segment load after text index creation is enabled on an existing raw column. This will exercise the SegmentPreprocessor code path during segment load | testEnableTextIndexOnExistingRawColumn | {
"repo_name": "linkedin/pinot",
"path": "pinot-core/src/test/java/org/apache/pinot/core/segment/index/loader/SegmentPreProcessorTest.java",
"license": "apache-2.0",
"size": 42056
} | [
"java.util.HashSet",
"java.util.Set",
"org.apache.pinot.core.segment.creator.TextIndexType",
"org.apache.pinot.core.segment.index.metadata.ColumnMetadata",
"org.apache.pinot.core.segment.index.metadata.SegmentMetadataImpl",
"org.testng.Assert"
] | import java.util.HashSet; import java.util.Set; import org.apache.pinot.core.segment.creator.TextIndexType; import org.apache.pinot.core.segment.index.metadata.ColumnMetadata; import org.apache.pinot.core.segment.index.metadata.SegmentMetadataImpl; import org.testng.Assert; | import java.util.*; import org.apache.pinot.core.segment.creator.*; import org.apache.pinot.core.segment.index.metadata.*; import org.testng.*; | [
"java.util",
"org.apache.pinot",
"org.testng"
] | java.util; org.apache.pinot; org.testng; | 1,992,610 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.