method
stringlengths 13
441k
| clean_method
stringlengths 7
313k
| doc
stringlengths 17
17.3k
| comment
stringlengths 3
1.42k
| method_name
stringlengths 1
273
| extra
dict | imports
list | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
list | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
---|---|---|---|---|---|---|---|---|---|---|---|
public FloatSortedSet keySet() {
if ( keys == null ) keys = new KeySet();
return keys;
}
private final class ValueIterator extends TreeIterator implements ObjectListIterator <V> {
public V next() { return nextEntry().value; }
|
FloatSortedSet function() { if ( keys == null ) keys = new KeySet(); return keys; } private final class ValueIterator extends TreeIterator implements ObjectListIterator <V> { public V next() { return nextEntry().value; }
|
/** Returns a type-specific sorted set view of the keys contained in this map.
*
* <P>In addition to the semantics of {@link java.util.Map#keySet()}, you can
* safely cast the set returned by this call to a type-specific sorted
* set interface.
*
* @return a type-specific sorted set view of the keys contained in this map.
*/
|
Returns a type-specific sorted set view of the keys contained in this map. In addition to the semantics of <code>java.util.Map#keySet()</code>, you can safely cast the set returned by this call to a type-specific sorted set interface
|
keySet
|
{
"repo_name": "karussell/fastutil",
"path": "src/it/unimi/dsi/fastutil/floats/Float2ReferenceRBTreeMap.java",
"license": "apache-2.0",
"size": 54271
}
|
[
"it.unimi.dsi.fastutil.objects.ObjectListIterator"
] |
import it.unimi.dsi.fastutil.objects.ObjectListIterator;
|
import it.unimi.dsi.fastutil.objects.*;
|
[
"it.unimi.dsi"
] |
it.unimi.dsi;
| 146,363 |
public RelOptCluster createCluster(
RelDataTypeFactory typeFactory,
RexBuilder rexBuilder) {
return new RelOptCluster(this, planner, typeFactory, rexBuilder);
}
|
RelOptCluster function( RelDataTypeFactory typeFactory, RexBuilder rexBuilder) { return new RelOptCluster(this, planner, typeFactory, rexBuilder); }
|
/**
* Creates a cluster.
*
* @param typeFactory Type factory
* @param rexBuilder Expression builder
* @return New cluster
*/
|
Creates a cluster
|
createCluster
|
{
"repo_name": "mapr/incubator-calcite",
"path": "core/src/main/java/org/apache/calcite/plan/RelOptQuery.java",
"license": "apache-2.0",
"size": 3346
}
|
[
"org.apache.calcite.rel.type.RelDataTypeFactory",
"org.apache.calcite.rex.RexBuilder"
] |
import org.apache.calcite.rel.type.RelDataTypeFactory; import org.apache.calcite.rex.RexBuilder;
|
import org.apache.calcite.rel.type.*; import org.apache.calcite.rex.*;
|
[
"org.apache.calcite"
] |
org.apache.calcite;
| 1,114,630 |
@Deprecated
public static String getApplicationId(final Event event) {
return (String)event.getProperty(PROPERTY_APPLICATION);
}
|
static String function(final Event event) { return (String)event.getProperty(PROPERTY_APPLICATION); }
|
/**
* Return the application id the event was created at.
* @param event
* @return The application id or null if the event has been created locally.
* @deprecated
*/
|
Return the application id the event was created at
|
getApplicationId
|
{
"repo_name": "plutext/sling",
"path": "bundles/extensions/event/src/main/java/org/apache/sling/event/EventUtil.java",
"license": "apache-2.0",
"size": 16032
}
|
[
"org.osgi.service.event.Event"
] |
import org.osgi.service.event.Event;
|
import org.osgi.service.event.*;
|
[
"org.osgi.service"
] |
org.osgi.service;
| 2,801,858 |
public static void renameFolder(String cheminRep, String newCheminRep)
throws UtilException {
File directory = new File(cheminRep);
if (directory.isDirectory()) {
File newDirectory = new File(newCheminRep);
if (!directory.renameTo(newDirectory)) {
SilverTrace.error("util", "FileFolderManager.renameFolder",
"util.EX_REPOSITORY_RENAME", cheminRep + " en "
+ newCheminRep);
throw new UtilException("FileFolderManager.renameFolder",
"util.EX_REPOSITORY_RENAME", cheminRep + " en "
+ newCheminRep);
}
} else {
SilverTrace.error("util", "FileFolderManager.renameFolder",
"util.EX_NO_CHEMIN_REPOS", cheminRep);
throw new UtilException("FileFolderManager.renameFolder",
"util.EX_NO_CHEMIN_REPOS", cheminRep);
}
}
|
static void function(String cheminRep, String newCheminRep) throws UtilException { File directory = new File(cheminRep); if (directory.isDirectory()) { File newDirectory = new File(newCheminRep); if (!directory.renameTo(newDirectory)) { SilverTrace.error("util", STR, STR, cheminRep + STR + newCheminRep); throw new UtilException(STR, STR, cheminRep + STR + newCheminRep); } } else { SilverTrace.error("util", STR, STR, cheminRep); throw new UtilException(STR, STR, cheminRep); } }
|
/**
* renameFolder : modification du nom d'un repertoire Param = chemin du repertoire
*/
|
renameFolder : modification du nom d'un repertoire Param = chemin du repertoire
|
renameFolder
|
{
"repo_name": "stephaneperry/Silverpeas-Core",
"path": "lib-core/src/main/java/com/stratelia/webactiv/util/fileFolder/FileFolderManager.java",
"license": "agpl-3.0",
"size": 13501
}
|
[
"com.stratelia.silverpeas.silvertrace.SilverTrace",
"com.stratelia.webactiv.util.exception.UtilException",
"java.io.File"
] |
import com.stratelia.silverpeas.silvertrace.SilverTrace; import com.stratelia.webactiv.util.exception.UtilException; import java.io.File;
|
import com.stratelia.silverpeas.silvertrace.*; import com.stratelia.webactiv.util.exception.*; import java.io.*;
|
[
"com.stratelia.silverpeas",
"com.stratelia.webactiv",
"java.io"
] |
com.stratelia.silverpeas; com.stratelia.webactiv; java.io;
| 379,717 |
if( titleLabel == null && title != null ) {
titleLabel = new Label(title, getElementId().child("title.label"), getStyle());
layout.addChild(titleLabel, BorderLayout.Position.North);
} else if( titleLabel != null && title == null ) {
layout.removeChild(titleLabel);
titleLabel = null;
} else {
titleLabel.setText(title);
}
}
|
if( titleLabel == null && title != null ) { titleLabel = new Label(title, getElementId().child(STR), getStyle()); layout.addChild(titleLabel, BorderLayout.Position.North); } else if( titleLabel != null && title == null ) { layout.removeChild(titleLabel); titleLabel = null; } else { titleLabel.setText(title); } }
|
/**
* Sets the title of this option panel.
*/
|
Sets the title of this option panel
|
setTitle
|
{
"repo_name": "jMonkeyEngine-Contributions/Lemur",
"path": "extensions/LemurProto/src/main/java/com/simsilica/lemur/OptionPanel.java",
"license": "bsd-3-clause",
"size": 9290
}
|
[
"com.simsilica.lemur.component.BorderLayout"
] |
import com.simsilica.lemur.component.BorderLayout;
|
import com.simsilica.lemur.component.*;
|
[
"com.simsilica.lemur"
] |
com.simsilica.lemur;
| 492,816 |
@SuppressWarnings("deprecation") public void setKeyOption(IntOption option) {
this.key.copyFrom(option);
}
|
@SuppressWarnings(STR) void function(IntOption option) { this.key.copyFrom(option); }
|
/**
* Sets key.
* @param option the value, or <code>null</code> to set this property to <code>null</code>
*/
|
Sets key
|
setKeyOption
|
{
"repo_name": "cocoatomo/asakusafw",
"path": "mapreduce/compiler/core/src/test/java/com/asakusafw/compiler/operator/model/MockSummarized.java",
"license": "apache-2.0",
"size": 4999
}
|
[
"com.asakusafw.runtime.value.IntOption"
] |
import com.asakusafw.runtime.value.IntOption;
|
import com.asakusafw.runtime.value.*;
|
[
"com.asakusafw.runtime"
] |
com.asakusafw.runtime;
| 675,887 |
public List<Action> getActions() {
return mActions;
}
|
List<Action> function() { return mActions; }
|
/**
* A list of available actions on the post (including commenting, liking,
* and an optional app-specified action).
*/
|
A list of available actions on the post (including commenting, liking, and an optional app-specified action)
|
getActions
|
{
"repo_name": "AllanWang/Facebook-Frost",
"path": "simple-facebook/src/main/java/com/sromku/simple/fb/entities/Post.java",
"license": "apache-2.0",
"size": 14048
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 155,744 |
private void initializeRasdamanService() throws IOException {
Properties properties = filePathToPropertiesObject(pathToConfigurationFile);
RasdamanServiceConfig config = new RasdamanServiceConfig(
properties.getProperty(KEY_RASDAMAN_URL),
properties.getProperty(KEY_RASDAMAN_DATABASE),
properties.getProperty(KEY_RASDAMAN_USER),
properties.getProperty(KEY_RASDAMAN_PASSWORD)
);
rasdamanService = new RasdamanService(config);
}
|
void function() throws IOException { Properties properties = filePathToPropertiesObject(pathToConfigurationFile); RasdamanServiceConfig config = new RasdamanServiceConfig( properties.getProperty(KEY_RASDAMAN_URL), properties.getProperty(KEY_RASDAMAN_DATABASE), properties.getProperty(KEY_RASDAMAN_USER), properties.getProperty(KEY_RASDAMAN_PASSWORD) ); rasdamanService = new RasdamanService(config); }
|
/**
* Initializes the rasdaman service from the petascope properties configuration file
*
* @throws IOException
*/
|
Initializes the rasdaman service from the petascope properties configuration file
|
initializeRasdamanService
|
{
"repo_name": "diogo-andrade/DataHubSystem",
"path": "petascope/src/main/java/petascope/wms2/orchestration/ServiceInitializer.java",
"license": "agpl-3.0",
"size": 12244
}
|
[
"java.io.IOException",
"java.util.Properties"
] |
import java.io.IOException; import java.util.Properties;
|
import java.io.*; import java.util.*;
|
[
"java.io",
"java.util"
] |
java.io; java.util;
| 383,980 |
@Test
public void testNoServer() {
context.refresh();
assertFalse(context.containsBean("initH2TCPServer"));
}
|
void function() { context.refresh(); assertFalse(context.containsBean(STR)); }
|
/**
* Verify that the embedded server is not started if h2 string is not specified.
*/
|
Verify that the embedded server is not started if h2 string is not specified
|
testNoServer
|
{
"repo_name": "jvalkeal/spring-cloud-data",
"path": "spring-cloud-dataflow-server-core/src/test/java/org/springframework/cloud/dataflow/server/config/DataFlowServerConfigurationTests.java",
"license": "apache-2.0",
"size": 7305
}
|
[
"org.junit.Assert"
] |
import org.junit.Assert;
|
import org.junit.*;
|
[
"org.junit"
] |
org.junit;
| 2,278,381 |
public void submit() {
this.append("Attempting to submit logs to HQ...", true);
DeviceReportState logSubmit = new DeviceReportState(LogReportUtils.REPORT_FORMAT_FULL) {
|
void function() { this.append(STR, true); DeviceReportState logSubmit = new DeviceReportState(LogReportUtils.REPORT_FORMAT_FULL) {
|
/**
* happens in its own thread
*/
|
happens in its own thread
|
submit
|
{
"repo_name": "wpride/commcare",
"path": "application/src/org/commcare/applogic/CommCareHomeState.java",
"license": "apache-2.0",
"size": 11567
}
|
[
"org.javarosa.log.activity.DeviceReportState",
"org.javarosa.log.util.LogReportUtils"
] |
import org.javarosa.log.activity.DeviceReportState; import org.javarosa.log.util.LogReportUtils;
|
import org.javarosa.log.activity.*; import org.javarosa.log.util.*;
|
[
"org.javarosa.log"
] |
org.javarosa.log;
| 2,553,252 |
public List<String> getTokens(String endpoint) throws UnknownHostException;
|
List<String> function(String endpoint) throws UnknownHostException;
|
/**
* Fetch string representations of the tokens for a specified node.
*
* @param endpoint string representation of an node
* @return a collection of tokens formatted as strings
*/
|
Fetch string representations of the tokens for a specified node
|
getTokens
|
{
"repo_name": "aboudreault/cassandra",
"path": "src/java/org/apache/cassandra/service/StorageServiceMBean.java",
"license": "apache-2.0",
"size": 31523
}
|
[
"java.net.UnknownHostException",
"java.util.List"
] |
import java.net.UnknownHostException; import java.util.List;
|
import java.net.*; import java.util.*;
|
[
"java.net",
"java.util"
] |
java.net; java.util;
| 670,054 |
public List<ClusterSchema> getClusterSchemas() {
return clusterSchemas;
}
|
List<ClusterSchema> function() { return clusterSchemas; }
|
/**
* Gets a list of the cluster schemas used by the transformation.
*
* @return a list of ClusterSchemas
*/
|
Gets a list of the cluster schemas used by the transformation
|
getClusterSchemas
|
{
"repo_name": "eayoungs/pentaho-kettle",
"path": "engine/src/org/pentaho/di/trans/TransMeta.java",
"license": "apache-2.0",
"size": 221441
}
|
[
"java.util.List",
"org.pentaho.di.cluster.ClusterSchema"
] |
import java.util.List; import org.pentaho.di.cluster.ClusterSchema;
|
import java.util.*; import org.pentaho.di.cluster.*;
|
[
"java.util",
"org.pentaho.di"
] |
java.util; org.pentaho.di;
| 2,316,623 |
private void promptSpeechInput() {
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());
intent.putExtra(RecognizerIntent.EXTRA_PROMPT,
getString(R.string.speech_prompt));
try {
startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);
} catch (ActivityNotFoundException a) {
Toast.makeText(getApplicationContext(),
getString(R.string.speech_not_supported),
Toast.LENGTH_SHORT).show();
}
}
|
void function() { Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault()); intent.putExtra(RecognizerIntent.EXTRA_PROMPT, getString(R.string.speech_prompt)); try { startActivityForResult(intent, REQ_CODE_SPEECH_INPUT); } catch (ActivityNotFoundException a) { Toast.makeText(getApplicationContext(), getString(R.string.speech_not_supported), Toast.LENGTH_SHORT).show(); } }
|
/**
* Showing google speech input dialog
*/
|
Showing google speech input dialog
|
promptSpeechInput
|
{
"repo_name": "fawick/notebark",
"path": "app/src/main/java/net/wickborn/notebark/MainActivity.java",
"license": "apache-2.0",
"size": 10111
}
|
[
"android.content.ActivityNotFoundException",
"android.content.Intent",
"android.speech.RecognizerIntent",
"android.widget.Toast",
"java.util.Locale"
] |
import android.content.ActivityNotFoundException; import android.content.Intent; import android.speech.RecognizerIntent; import android.widget.Toast; import java.util.Locale;
|
import android.content.*; import android.speech.*; import android.widget.*; import java.util.*;
|
[
"android.content",
"android.speech",
"android.widget",
"java.util"
] |
android.content; android.speech; android.widget; java.util;
| 1,570,212 |
@WebMethod
@WebResult(name = "rval", targetNamespace = "https://www.google.com/apis/ads/publisher/v201306")
@RequestWrapper(localName = "createCustomFields", targetNamespace = "https://www.google.com/apis/ads/publisher/v201306", className = "com.google.api.ads.dfp.jaxws.v201306.CustomFieldServiceInterfacecreateCustomFields")
@ResponseWrapper(localName = "createCustomFieldsResponse", targetNamespace = "https://www.google.com/apis/ads/publisher/v201306", className = "com.google.api.ads.dfp.jaxws.v201306.CustomFieldServiceInterfacecreateCustomFieldsResponse")
public List<CustomField> createCustomFields(
@WebParam(name = "customFields", targetNamespace = "https://www.google.com/apis/ads/publisher/v201306")
List<CustomField> customFields)
throws ApiException_Exception
;
|
@WebResult(name = "rval", targetNamespace = STRcreateCustomFieldsSTRhttps: @ResponseWrapper(localName = "createCustomFieldsResponseSTRhttps: List<CustomField> function( @WebParam(name = "customFieldsSTRhttps: List<CustomField> customFields) throws ApiException_Exception ;
|
/**
*
* Creates new {@link CustomField} objects.
*
* The following fields are required:
* <ul>
* <li>{@link CustomField#name}</li>
* <li>{@link CustomField#entityType}</li>
* <li>{@link CustomField#dataType}</li>
* <li>{@link CustomField#visibility}</li>
* </ul>
*
* @param customFields the custom fields to create
* @return the created custom fields with their IDs filled in
*
*
* @param customFields
* @return
* returns java.util.List<com.google.api.ads.dfp.jaxws.v201306.CustomField>
* @throws ApiException_Exception
*/
|
Creates new <code>CustomField</code> objects. The following fields are required: <code>CustomField#name</code> <code>CustomField#entityType</code> <code>CustomField#dataType</code> <code>CustomField#visibility</code>
|
createCustomFields
|
{
"repo_name": "nafae/developer",
"path": "modules/dfp_appengine/src/main/java/com/google/api/ads/dfp/jaxws/v201306/CustomFieldServiceInterface.java",
"license": "apache-2.0",
"size": 18450
}
|
[
"java.util.List",
"javax.jws.WebParam",
"javax.jws.WebResult",
"javax.xml.ws.ResponseWrapper"
] |
import java.util.List; import javax.jws.WebParam; import javax.jws.WebResult; import javax.xml.ws.ResponseWrapper;
|
import java.util.*; import javax.jws.*; import javax.xml.ws.*;
|
[
"java.util",
"javax.jws",
"javax.xml"
] |
java.util; javax.jws; javax.xml;
| 945,362 |
public void writeByteBufferPart(byte []buffer, int offset, int length)
throws IOException
{
while (length > 0) {
int sublen = length;
if (0x8000 < sublen)
sublen = 0x8000;
flush(); // bypass buffer
_os.write(BC_BINARY_CHUNK);
_os.write(sublen >> 8);
_os.write(sublen);
_os.write(buffer, offset, sublen);
length -= sublen;
offset += sublen;
}
}
|
void function(byte []buffer, int offset, int length) throws IOException { while (length > 0) { int sublen = length; if (0x8000 < sublen) sublen = 0x8000; flush(); _os.write(BC_BINARY_CHUNK); _os.write(sublen >> 8); _os.write(sublen); _os.write(buffer, offset, sublen); length -= sublen; offset += sublen; } }
|
/**
* Writes a byte buffer to the stream.
*
* <code><pre>
* b b16 b18 bytes
* </pre></code>
*/
|
Writes a byte buffer to the stream. <code><code> b b16 b18 bytes </code></code>
|
writeByteBufferPart
|
{
"repo_name": "zhushuchen/Ocean",
"path": "项目源码/dubbo/hessian-lite/src/main/java/com/alibaba/com/caucho/hessian/io/Hessian2Output.java",
"license": "agpl-3.0",
"size": 34700
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 695,549 |
@Override
public void open(Configuration parameters) throws Exception {
final FlinkKafkaProducerBase<T> internalProducer = (FlinkKafkaProducerBase<T>) userFunction;
internalProducer.open(parameters);
}
|
void function(Configuration parameters) throws Exception { final FlinkKafkaProducerBase<T> internalProducer = (FlinkKafkaProducerBase<T>) userFunction; internalProducer.open(parameters); }
|
/**
* This method is used for approach (a) (see above).
*/
|
This method is used for approach (a) (see above)
|
open
|
{
"repo_name": "hongyuhong/flink",
"path": "flink-connectors/flink-connector-kafka-0.10/src/main/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaProducer010.java",
"license": "apache-2.0",
"size": 21311
}
|
[
"org.apache.flink.configuration.Configuration"
] |
import org.apache.flink.configuration.Configuration;
|
import org.apache.flink.configuration.*;
|
[
"org.apache.flink"
] |
org.apache.flink;
| 552,948 |
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
return scrollable ? super.onInterceptTouchEvent(ev) : false;
}
|
boolean function(MotionEvent ev) { return scrollable ? super.onInterceptTouchEvent(ev) : false; }
|
/**
* enable disable touch to scroll
*
* @param ev
* @return
*/
|
enable disable touch to scroll
|
onInterceptTouchEvent
|
{
"repo_name": "lusfold/material-calendarview",
"path": "library/src/main/java/com/prolificinteractive/materialcalendarview/MonthPager.java",
"license": "apache-2.0",
"size": 1337
}
|
[
"android.view.MotionEvent"
] |
import android.view.MotionEvent;
|
import android.view.*;
|
[
"android.view"
] |
android.view;
| 1,030,441 |
private File getAttachmentResourceFile(String jasperName, Language currLang) {
File resFile = null;
MAttachmentEntry[] entries = attachment.getEntries();
// try baseName + "_" + language
for( int i=0; i<entries.length; i++) {
if ( entries[i].getName().equals( jasperName+currLang.getLocale().getLanguage()+".properties")) {
resFile = getAttachmentEntryFile(entries[i]);
break;
}
}
if (resFile==null) {
// try baseName only
for( int i=0; i<entries.length; i++) {
if ( entries[i].getName().equals( jasperName+".properties")) {
resFile = getAttachmentEntryFile(entries[i]);
break;
}
}
}
return resFile;
}
|
File function(String jasperName, Language currLang) { File resFile = null; MAttachmentEntry[] entries = attachment.getEntries(); for( int i=0; i<entries.length; i++) { if ( entries[i].getName().equals( jasperName+currLang.getLocale().getLanguage()+STR)) { resFile = getAttachmentEntryFile(entries[i]); break; } } if (resFile==null) { for( int i=0; i<entries.length; i++) { if ( entries[i].getName().equals( jasperName+STR)) { resFile = getAttachmentEntryFile(entries[i]); break; } } } return resFile; }
|
/**
* Get .property resource file from process attachment
* @param jasperName
* @param currLang
* @return File
*/
|
Get .property resource file from process attachment
|
getAttachmentResourceFile
|
{
"repo_name": "armenrz/adempiere",
"path": "JasperReports/src/org/compiere/report/ReportStarter.java",
"license": "gpl-2.0",
"size": 47782
}
|
[
"java.io.File",
"org.compiere.model.MAttachmentEntry",
"org.compiere.util.Language"
] |
import java.io.File; import org.compiere.model.MAttachmentEntry; import org.compiere.util.Language;
|
import java.io.*; import org.compiere.model.*; import org.compiere.util.*;
|
[
"java.io",
"org.compiere.model",
"org.compiere.util"
] |
java.io; org.compiere.model; org.compiere.util;
| 306,071 |
protected void doSkippedEntity(String name) throws SAXException {
}
|
void function(String name) throws SAXException { }
|
/**
* By default do nothing.
*
* @param name String
* @throws SAXException API told me so
*/
|
By default do nothing
|
doSkippedEntity
|
{
"repo_name": "apache/ant-ivy",
"path": "src/java/org/apache/ivy/osgi/util/DelegatingHandler.java",
"license": "apache-2.0",
"size": 21219
}
|
[
"org.xml.sax.SAXException"
] |
import org.xml.sax.SAXException;
|
import org.xml.sax.*;
|
[
"org.xml.sax"
] |
org.xml.sax;
| 269,644 |
private boolean isJobEnabled(hudson.model.Job job) {
boolean enabled = true;
if (job != null) {
try {
Object isDisabled = job.getClass().getMethod("isDisabled", null).invoke(job);
if (isDisabled instanceof Boolean) {
enabled = !(Boolean) isDisabled;
}
} catch (Exception e) {
LOG.log(Level.FINE, "Exception " + e.getMessage(), e.getCause());
}
}
return enabled;
}
|
boolean function(hudson.model.Job job) { boolean enabled = true; if (job != null) { try { Object isDisabled = job.getClass().getMethod(STR, null).invoke(job); if (isDisabled instanceof Boolean) { enabled = !(Boolean) isDisabled; } } catch (Exception e) { LOG.log(Level.FINE, STR + e.getMessage(), e.getCause()); } } return enabled; }
|
/**
* Whether the job has been disabled, since isDisabled is part of the AbstractProject and WorkflowJob doesn't
* extend it then let's use reflection.
*
* @return
*/
|
Whether the job has been disabled, since isDisabled is part of the AbstractProject and WorkflowJob doesn't extend it then let's use reflection
|
isJobEnabled
|
{
"repo_name": "jenkinsci/jenkinslint-plugin",
"path": "src/main/java/org/jenkins/ci/plugins/jenkinslint/JenkinsLintAction.java",
"license": "mit",
"size": 6579
}
|
[
"java.util.logging.Level",
"org.jenkins.ci.plugins.jenkinslint.model.Job"
] |
import java.util.logging.Level; import org.jenkins.ci.plugins.jenkinslint.model.Job;
|
import java.util.logging.*; import org.jenkins.ci.plugins.jenkinslint.model.*;
|
[
"java.util",
"org.jenkins.ci"
] |
java.util; org.jenkins.ci;
| 2,189,084 |
// visible for testing
static void check(final boolean enforceLimits, final boolean ignoreSystemChecks, final List<Check> checks, final String nodeName) {
check(enforceLimits, ignoreSystemChecks, checks, Loggers.getLogger(BootstrapCheck.class, nodeName));
}
|
static void check(final boolean enforceLimits, final boolean ignoreSystemChecks, final List<Check> checks, final String nodeName) { check(enforceLimits, ignoreSystemChecks, checks, Loggers.getLogger(BootstrapCheck.class, nodeName)); }
|
/**
* executes the provided checks and fails the node if
* enforceLimits is true, otherwise logs warnings
*
* @param enforceLimits true if the checks should be enforced or
* otherwise warned
* @param ignoreSystemChecks true if system checks should be enforced
* or otherwise warned
* @param checks the checks to execute
* @param nodeName the node name to be used as a logging prefix
*/
|
executes the provided checks and fails the node if enforceLimits is true, otherwise logs warnings
|
check
|
{
"repo_name": "trangvh/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/bootstrap/BootstrapCheck.java",
"license": "apache-2.0",
"size": 16794
}
|
[
"java.util.List",
"org.elasticsearch.common.logging.Loggers"
] |
import java.util.List; import org.elasticsearch.common.logging.Loggers;
|
import java.util.*; import org.elasticsearch.common.logging.*;
|
[
"java.util",
"org.elasticsearch.common"
] |
java.util; org.elasticsearch.common;
| 10,050 |
static <E> boolean addAllImpl(
List<E> list, int index, Iterable<? extends E> elements) {
boolean changed = false;
ListIterator<E> listIterator = list.listIterator(index);
for (E e : elements) {
listIterator.add(e);
changed = true;
}
return changed;
}
|
static <E> boolean addAllImpl( List<E> list, int index, Iterable<? extends E> elements) { boolean changed = false; ListIterator<E> listIterator = list.listIterator(index); for (E e : elements) { listIterator.add(e); changed = true; } return changed; }
|
/**
* An implementation of {@link List#addAll(int, Collection)}.
*/
|
An implementation of <code>List#addAll(int, Collection)</code>
|
addAllImpl
|
{
"repo_name": "mkeesey/guava-for-small-classpaths",
"path": "guava/src/com/google/common/collect/Lists.java",
"license": "apache-2.0",
"size": 33875
}
|
[
"java.util.List",
"java.util.ListIterator"
] |
import java.util.List; import java.util.ListIterator;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,004,468 |
public TypeHLAPI getContainerTypeHLAPI(){
if(item.getContainerType() == null) return null;
return new TypeHLAPI(item.getContainerType());
}
|
TypeHLAPI function(){ if(item.getContainerType() == null) return null; return new TypeHLAPI(item.getContainerType()); }
|
/**
* This accessor automatically encapsulate an element of the current object.
* WARNING : this creates a new object in memory.
* @return : null if the element is null
*/
|
This accessor automatically encapsulate an element of the current object. WARNING : this creates a new object in memory
|
getContainerTypeHLAPI
|
{
"repo_name": "lhillah/pnmlframework",
"path": "pnmlFw-HLPN/src/fr/lip6/move/pnml/hlpn/integers/hlapi/PositiveHLAPI.java",
"license": "epl-1.0",
"size": 18340
}
|
[
"fr.lip6.move.pnml.hlpn.hlcorestructure.hlapi.TypeHLAPI"
] |
import fr.lip6.move.pnml.hlpn.hlcorestructure.hlapi.TypeHLAPI;
|
import fr.lip6.move.pnml.hlpn.hlcorestructure.hlapi.*;
|
[
"fr.lip6.move"
] |
fr.lip6.move;
| 2,484,979 |
public void onSharedPreferenceChanged(SharedPreferences sp, String key) {
Log.d(TAG, "TrackerActivity, Shared Preference Changed, key = "
+ key);
// This is a hack. TrackerState is not a shared preference but
// this is called repeatedly throughout the run with this key.
// Don't understand why???
if (key.equals("TrackerState"))
return;
if (key != null && mBackgroundService != null) {
try {
mBackgroundService.changePreference(sp, key);
} catch (Exception e) {
Log.w(TAG, "TrackerActivity, Failed to inform Tracker of shared preference change", e);
}
}
mTrack.updatePreference(sp, key);
updateViewTrackingMode();
}
|
void function(SharedPreferences sp, String key) { Log.d(TAG, STR + key); if (key.equals(STR)) return; if (key != null && mBackgroundService != null) { try { mBackgroundService.changePreference(sp, key); } catch (Exception e) { Log.w(TAG, STR, e); } } mTrack.updatePreference(sp, key); updateViewTrackingMode(); }
|
/**
* Listener for changes to the Tracker Preferences. Since the Tracker
* service cannot listen for changes, this method will pass changes to
* the tracker.
*/
|
Listener for changes to the Tracker Preferences. Since the Tracker service cannot listen for changes, this method will pass changes to the tracker
|
onSharedPreferenceChanged
|
{
"repo_name": "sanyaade-g2g-repos/posit-mobile.haiti-commodity",
"path": "src/org/hfoss/posit/android/TrackerActivity.java",
"license": "lgpl-2.1",
"size": 40033
}
|
[
"android.content.SharedPreferences",
"android.util.Log"
] |
import android.content.SharedPreferences; import android.util.Log;
|
import android.content.*; import android.util.*;
|
[
"android.content",
"android.util"
] |
android.content; android.util;
| 2,723,828 |
@Override
public boolean isValid() {
try {
validate();
} catch (final ValidationException vex) {
return false;
}
return true;
}
|
boolean function() { try { validate(); } catch (final ValidationException vex) { return false; } return true; }
|
/**
* Method isValid.
*
* @return true if this object is valid according to the schema
*/
|
Method isValid
|
isValid
|
{
"repo_name": "rfdrake/opennms",
"path": "opennms-config-model/src/main/java/org/opennms/netmgt/config/snmp/SnmpConfig.java",
"license": "gpl-2.0",
"size": 12056
}
|
[
"org.exolab.castor.xml.ValidationException"
] |
import org.exolab.castor.xml.ValidationException;
|
import org.exolab.castor.xml.*;
|
[
"org.exolab.castor"
] |
org.exolab.castor;
| 2,461,104 |
protected void fillBackground(Graphics2D g2, Rectangle2D area) {
fillBackground(g2, area, PlotOrientation.VERTICAL);
}
|
void function(Graphics2D g2, Rectangle2D area) { fillBackground(g2, area, PlotOrientation.VERTICAL); }
|
/**
* Fills the specified area with the background paint.
*
* @param g2 the graphics device.
* @param area the area.
*
* @see #getBackgroundPaint()
* @see #getBackgroundAlpha()
* @see #fillBackground(Graphics2D, Rectangle2D, PlotOrientation)
*/
|
Fills the specified area with the background paint
|
fillBackground
|
{
"repo_name": "JSansalone/JFreeChart",
"path": "source/org/jfree/chart/plot/Plot.java",
"license": "lgpl-2.1",
"size": 52197
}
|
[
"java.awt.Graphics2D",
"java.awt.geom.Rectangle2D"
] |
import java.awt.Graphics2D; import java.awt.geom.Rectangle2D;
|
import java.awt.*; import java.awt.geom.*;
|
[
"java.awt"
] |
java.awt;
| 2,660,988 |
public List<GenomicDataResultValue> getValues() {
if (values == null) {
loadValues();
}
return values;
}
|
List<GenomicDataResultValue> function() { if (values == null) { loadValues(); } return values; }
|
/**
* Returns the values for this column.
*
* @return the values.
*/
|
Returns the values for this column
|
getValues
|
{
"repo_name": "NCIP/caintegrator",
"path": "caintegrator-war/src/gov/nih/nci/caintegrator/domain/application/GenomicDataResultColumn.java",
"license": "bsd-3-clause",
"size": 2363
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,120,079 |
EEnum getHAlignmentType();
|
EEnum getHAlignmentType();
|
/**
* Returns the meta object for enum '{@link guizmo.layout.HAlignmentType <em>HAlignment Type</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for enum '<em>HAlignment Type</em>'.
* @see guizmo.layout.HAlignmentType
* @generated
*/
|
Returns the meta object for enum '<code>guizmo.layout.HAlignmentType HAlignment Type</code>'.
|
getHAlignmentType
|
{
"repo_name": "osanchezUM/guizmo",
"path": "src/guizmo/layout/LayoutPackage.java",
"license": "apache-2.0",
"size": 87190
}
|
[
"org.eclipse.emf.ecore.EEnum"
] |
import org.eclipse.emf.ecore.EEnum;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 629,347 |
public static Symbol<Type> returnType(final Symbol<Type>[] signature) {
return signature[signature.length - 1];
}
|
static Symbol<Type> function(final Symbol<Type>[] signature) { return signature[signature.length - 1]; }
|
/**
* Gets the type descriptor of the return type in this (parsed) signature object.
*/
|
Gets the type descriptor of the return type in this (parsed) signature object
|
returnType
|
{
"repo_name": "smarr/Truffle",
"path": "espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/descriptors/Signatures.java",
"license": "gpl-2.0",
"size": 13216
}
|
[
"com.oracle.truffle.espresso.descriptors.Symbol"
] |
import com.oracle.truffle.espresso.descriptors.Symbol;
|
import com.oracle.truffle.espresso.descriptors.*;
|
[
"com.oracle.truffle"
] |
com.oracle.truffle;
| 2,373,392 |
public static void main(String[] args) {
final MonteCarloEstimationWRApp app = new MonteCarloEstimationWRApp();
new MonteCarloEstimationControl(app, app.plotFrame, args);
app.customize();
}
}
class MonteCarloEstimationControl extends EjsCalculationControl {
MonteCarloEstimationControl(MonteCarloEstimationApp model, DrawingFrame frame, String[] args) {
super(model, frame, args);
}
|
static void function(String[] args) { final MonteCarloEstimationWRApp app = new MonteCarloEstimationWRApp(); new MonteCarloEstimationControl(app, app.plotFrame, args); app.customize(); } } class MonteCarloEstimationControl extends EjsCalculationControl { MonteCarloEstimationControl(MonteCarloEstimationApp model, DrawingFrame frame, String[] args) { super(model, frame, args); }
|
/**
* Starts the program and loads an optional arg[0] XML data file.
* @param args String[]
*/
|
Starts the program and loads an optional arg[0] XML data file
|
main
|
{
"repo_name": "OpenSourcePhysics/STP",
"path": "src/org/opensourcephysics/stp/estimation/MonteCarloEstimationWRApp.java",
"license": "gpl-3.0",
"size": 5953
}
|
[
"org.opensourcephysics.display.DrawingFrame",
"org.opensourcephysics.ejs.control.EjsCalculationControl"
] |
import org.opensourcephysics.display.DrawingFrame; import org.opensourcephysics.ejs.control.EjsCalculationControl;
|
import org.opensourcephysics.display.*; import org.opensourcephysics.ejs.control.*;
|
[
"org.opensourcephysics.display",
"org.opensourcephysics.ejs"
] |
org.opensourcephysics.display; org.opensourcephysics.ejs;
| 2,003,552 |
public void solOut() {
test.set(DoubleSolenoid.Value.kReverse);
}
|
void function() { test.set(DoubleSolenoid.Value.kReverse); }
|
/**
* Makes the {@linkplain DoubleSolenoid solenoid} output.
* */
|
Makes the DoubleSolenoid solenoid output
|
solOut
|
{
"repo_name": "frc5431/FRC-2016-RED-TEAM",
"path": "src/org/usfirst/frc/team5431/libs/PneumaticBase.java",
"license": "gpl-3.0",
"size": 1336
}
|
[
"edu.wpi.first.wpilibj.DoubleSolenoid"
] |
import edu.wpi.first.wpilibj.DoubleSolenoid;
|
import edu.wpi.first.wpilibj.*;
|
[
"edu.wpi.first"
] |
edu.wpi.first;
| 1,718,555 |
public void setModificationReceiver(TransactionListener<List<ModelClass>> transactionListener) {
mTransactionListener = transactionListener;
}
/**
* If true, we will transact all modifications on the {@link com.raizlabs.android.dbflow.runtime.DBTransactionQueue}
|
void function(TransactionListener<List<ModelClass>> transactionListener) { mTransactionListener = transactionListener; } /** * If true, we will transact all modifications on the {@link com.raizlabs.android.dbflow.runtime.DBTransactionQueue}
|
/**
* Register for callbacks when data is changed on this list.
*
* @param transactionListener
*/
|
Register for callbacks when data is changed on this list
|
setModificationReceiver
|
{
"repo_name": "omegasoft7/DBFlow",
"path": "library/src/main/java/com/raizlabs/android/dbflow/list/FlowTableList.java",
"license": "mit",
"size": 17814
}
|
[
"com.raizlabs.android.dbflow.runtime.transaction.TransactionListener",
"java.util.List"
] |
import com.raizlabs.android.dbflow.runtime.transaction.TransactionListener; import java.util.List;
|
import com.raizlabs.android.dbflow.runtime.transaction.*; import java.util.*;
|
[
"com.raizlabs.android",
"java.util"
] |
com.raizlabs.android; java.util;
| 748,610 |
public static boolean isPublicStatic(Field f) {
final int modifiers = f.getModifiers();
return Modifier.isPublic(modifiers) && Modifier.isStatic(modifiers);
}
|
static boolean function(Field f) { final int modifiers = f.getModifiers(); return Modifier.isPublic(modifiers) && Modifier.isStatic(modifiers); }
|
/**
* Determine whether the field is declared public static
* @param f
* @return true if the field is declared public static
*/
|
Determine whether the field is declared public static
|
isPublicStatic
|
{
"repo_name": "clockworkorange/grails-core",
"path": "grails-core/src/main/groovy/grails/util/GrailsClassUtils.java",
"license": "apache-2.0",
"size": 39587
}
|
[
"java.lang.reflect.Field",
"java.lang.reflect.Modifier"
] |
import java.lang.reflect.Field; import java.lang.reflect.Modifier;
|
import java.lang.reflect.*;
|
[
"java.lang"
] |
java.lang;
| 2,271,383 |
public static TopicDescription toImplementation(TopicProperties properties) {
Objects.requireNonNull(properties, "'properties' cannot be null.");
if (topicAccessor == null) {
throw new ClientLogger(EntityHelper.class).logExceptionAsError(
new IllegalStateException("'topicAccessor' should not be null."));
}
final List<AuthorizationRuleImpl> rules = !properties.getAuthorizationRules().isEmpty()
? toImplementation(properties.getAuthorizationRules())
: Collections.emptyList();
return topicAccessor.toImplementation(properties, rules);
}
|
static TopicDescription function(TopicProperties properties) { Objects.requireNonNull(properties, STR); if (topicAccessor == null) { throw new ClientLogger(EntityHelper.class).logExceptionAsError( new IllegalStateException(STR)); } final List<AuthorizationRuleImpl> rules = !properties.getAuthorizationRules().isEmpty() ? toImplementation(properties.getAuthorizationRules()) : Collections.emptyList(); return topicAccessor.toImplementation(properties, rules); }
|
/**
* Creates a new queue given the existing queue.
*
* @param properties Options to create queue with.
*
* @return A new {@link TopicProperties} with the set options.
*/
|
Creates a new queue given the existing queue
|
toImplementation
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/EntityHelper.java",
"license": "mit",
"size": 23903
}
|
[
"com.azure.core.util.logging.ClientLogger",
"com.azure.messaging.servicebus.administration.models.TopicProperties",
"com.azure.messaging.servicebus.implementation.models.AuthorizationRuleImpl",
"com.azure.messaging.servicebus.implementation.models.TopicDescription",
"java.util.Collections",
"java.util.List",
"java.util.Objects"
] |
import com.azure.core.util.logging.ClientLogger; import com.azure.messaging.servicebus.administration.models.TopicProperties; import com.azure.messaging.servicebus.implementation.models.AuthorizationRuleImpl; import com.azure.messaging.servicebus.implementation.models.TopicDescription; import java.util.Collections; import java.util.List; import java.util.Objects;
|
import com.azure.core.util.logging.*; import com.azure.messaging.servicebus.administration.models.*; import com.azure.messaging.servicebus.implementation.models.*; import java.util.*;
|
[
"com.azure.core",
"com.azure.messaging",
"java.util"
] |
com.azure.core; com.azure.messaging; java.util;
| 1,601,506 |
App prevSelectedApp = (App) comboAppsModel.getSelectedItem();
comboAppsModel.removeAllElements();
while (apps.hasMoreElements()) {
App app = (App) apps.nextElement();
comboAppsModel.addElement(app);
}
if (prevSelectedApp != null){
comboAppsModel.setSelectedItem(prevSelectedApp);
}
}
|
App prevSelectedApp = (App) comboAppsModel.getSelectedItem(); comboAppsModel.removeAllElements(); while (apps.hasMoreElements()) { App app = (App) apps.nextElement(); comboAppsModel.addElement(app); } if (prevSelectedApp != null){ comboAppsModel.setSelectedItem(prevSelectedApp); } }
|
/**
* Set the the model of comboAppsModel, with the updated apps list
* @param apps
*/
|
Set the the model of comboAppsModel, with the updated apps list
|
setModelAppData
|
{
"repo_name": "becuz/RESTmoteControl",
"path": "src/main/java/org/zooper/becuz/restmote/ui/panels/PanelEditCategory.java",
"license": "mit",
"size": 11934
}
|
[
"org.zooper.becuz.restmote.model.App"
] |
import org.zooper.becuz.restmote.model.App;
|
import org.zooper.becuz.restmote.model.*;
|
[
"org.zooper.becuz"
] |
org.zooper.becuz;
| 1,880,215 |
public void testClose() throws Exception {
//Check no mbeans of this type before
int before = mBeanServer.getMBeanCount();
ObjectName name = getObjectName(-1);
assertEquals("Should have 0 mbeans matching object name",
0, mBeanServer.queryMBeans(name, null).size());
//Call constructor
cachingLogHandler = new CachingLogHandler();
//Check all mbeans are registered
int after = mBeanServer.getMBeanCount();
assertEquals("42 new MBeans should be registered.",
LOG_HISTORY_SIZE, after - before);
//Check 42 mbeans of this type
assertEquals("Should have 42 mbeans matching object name",
LOG_HISTORY_SIZE,
mBeanServer.queryMBeans(name, null).size());
cachingLogHandler.close();
//Check all mbeans are unregistered
int afterClose = mBeanServer.getMBeanCount();
assertEquals("0 MBeans should be registered.",
0, afterClose - before);
//Check no mbeans of this type
assertEquals("Should have 0 mbeans matching object name",
0, mBeanServer.queryMBeans(name, null).size());
}
|
void function() throws Exception { int before = mBeanServer.getMBeanCount(); ObjectName name = getObjectName(-1); assertEquals(STR, 0, mBeanServer.queryMBeans(name, null).size()); cachingLogHandler = new CachingLogHandler(); int after = mBeanServer.getMBeanCount(); assertEquals(STR, LOG_HISTORY_SIZE, after - before); assertEquals(STR, LOG_HISTORY_SIZE, mBeanServer.queryMBeans(name, null).size()); cachingLogHandler.close(); int afterClose = mBeanServer.getMBeanCount(); assertEquals(STR, 0, afterClose - before); assertEquals(STR, 0, mBeanServer.queryMBeans(name, null).size()); }
|
/**
* Test that close unregisters the registered mbeans.
*
* @throws Exception
*/
|
Test that close unregisters the registered mbeans
|
testClose
|
{
"repo_name": "netarchivesuite/netarchivesuite-svngit-migration",
"path": "tests/dk/netarkivet/monitor/logging/CachingLogHandlerTester.java",
"license": "lgpl-2.1",
"size": 14016
}
|
[
"javax.management.ObjectName"
] |
import javax.management.ObjectName;
|
import javax.management.*;
|
[
"javax.management"
] |
javax.management;
| 2,838,469 |
private void saveGroupNumbers(ISliceAnalysis sliceAnalysis) {
try {
PrintWriter analysisRoot = new PrintWriter(
new FileWriter(new File(new File(sliceAnalysis.getWorkingDirectory()), "accuracy.txt")));
Collection<String> conditions = DataCollection.get().getConditions();
conditions.forEach(c -> {
analysisRoot.print(c + ".Mean\t");
});
analysisRoot.println();
conditions.forEach(c -> {
analysisRoot.format("%.2f\t", DataCollection.get().getGroupAccuracy(c).getMean());
});
analysisRoot.println();
analysisRoot.close();
sliceAnalysis.addDetail("Group Accuracy", "accuracy.txt");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
PrintWriter analysisRoot = new PrintWriter(
new FileWriter(new File(new File(sliceAnalysis.getWorkingDirectory()), "latency.txt")));
Collection<String> conditions = DataCollection.get().getConditions();
conditions.forEach(c -> {
analysisRoot.print(c + ".Mean\t");
});
analysisRoot.println();
conditions.forEach(c -> {
analysisRoot.format("%.2f\t", DataCollection.get().getGroupLatency(c).getMean());
});
analysisRoot.println();
analysisRoot.close();
sliceAnalysis.addDetail("Group Latency", "latency.txt");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
|
void function(ISliceAnalysis sliceAnalysis) { try { PrintWriter analysisRoot = new PrintWriter( new FileWriter(new File(new File(sliceAnalysis.getWorkingDirectory()), STR))); Collection<String> conditions = DataCollection.get().getConditions(); conditions.forEach(c -> { analysisRoot.print(c + STR); }); analysisRoot.println(); conditions.forEach(c -> { analysisRoot.format(STR, DataCollection.get().getGroupAccuracy(c).getMean()); }); analysisRoot.println(); analysisRoot.close(); sliceAnalysis.addDetail(STR, STR); } catch (IOException e) { e.printStackTrace(); } try { PrintWriter analysisRoot = new PrintWriter( new FileWriter(new File(new File(sliceAnalysis.getWorkingDirectory()), STR))); Collection<String> conditions = DataCollection.get().getConditions(); conditions.forEach(c -> { analysisRoot.print(c + STR); }); analysisRoot.println(); conditions.forEach(c -> { analysisRoot.format(STR, DataCollection.get().getGroupLatency(c).getMean()); }); analysisRoot.println(); analysisRoot.close(); sliceAnalysis.addDetail(STR, STR); } catch (IOException e) { e.printStackTrace(); } }
|
/**
* save an analysis file local to the slice analysis
*
* @param sliceAnalysis
*/
|
save an analysis file local to the slice analysis
|
saveGroupNumbers
|
{
"repo_name": "amharrison/jactr-tutorials",
"path": "org.jactr.tutorial.unit4/src/org/jactr/tutorial/unit4/paired/data/Analyzer.java",
"license": "gpl-2.0",
"size": 6100
}
|
[
"java.io.File",
"java.io.FileWriter",
"java.io.IOException",
"java.io.PrintWriter",
"java.util.Collection",
"org.jactr.tools.itr.ortho.ISliceAnalysis"
] |
import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import java.util.Collection; import org.jactr.tools.itr.ortho.ISliceAnalysis;
|
import java.io.*; import java.util.*; import org.jactr.tools.itr.ortho.*;
|
[
"java.io",
"java.util",
"org.jactr.tools"
] |
java.io; java.util; org.jactr.tools;
| 534,857 |
@Deprecated
public static BooleanTemplate booleanTemplate(Template template, ImmutableList<?> args) {
return new BooleanTemplate(template, args);
}
|
static BooleanTemplate function(Template template, ImmutableList<?> args) { return new BooleanTemplate(template, args); }
|
/**
* Create a new Template expression
*
* @deprecated Use {@link #booleanTemplate(Template, List)} instead.
*
* @param template template
* @param args template parameters
* @return template expression
*/
|
Create a new Template expression
|
booleanTemplate
|
{
"repo_name": "johnktims/querydsl",
"path": "querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java",
"license": "apache-2.0",
"size": 74346
}
|
[
"com.google.common.collect.ImmutableList",
"com.querydsl.core.types.Template"
] |
import com.google.common.collect.ImmutableList; import com.querydsl.core.types.Template;
|
import com.google.common.collect.*; import com.querydsl.core.types.*;
|
[
"com.google.common",
"com.querydsl.core"
] |
com.google.common; com.querydsl.core;
| 164,360 |
public void testListEnum() {
List<PredefinedLayout> enumValueList = Arrays.asList(PredefinedLayout.values());
List<PredefinedLayout> enumTestList = new ArrayList<>();
enumTestList.add(PredefinedLayout.DEFAULT);
enumTestList.add(PredefinedLayout.MEDIA);
enumTestList.add(PredefinedLayout.NON_MEDIA);
enumTestList.add(PredefinedLayout.ONSCREEN_PRESETS);
enumTestList.add(PredefinedLayout.NAV_FULLSCREEN_MAP);
enumTestList.add(PredefinedLayout.NAV_LIST);
enumTestList.add(PredefinedLayout.NAV_KEYBOARD);
enumTestList.add(PredefinedLayout.GRAPHIC_WITH_TEXT);
enumTestList.add(PredefinedLayout.TEXT_WITH_GRAPHIC);
enumTestList.add(PredefinedLayout.TILES_ONLY);
enumTestList.add(PredefinedLayout.TEXTBUTTONS_ONLY);
enumTestList.add(PredefinedLayout.GRAPHIC_WITH_TILES);
enumTestList.add(PredefinedLayout.TILES_WITH_GRAPHIC);
enumTestList.add(PredefinedLayout.GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS);
enumTestList.add(PredefinedLayout.TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC);
enumTestList.add(PredefinedLayout.GRAPHIC_WITH_TEXTBUTTONS);
enumTestList.add(PredefinedLayout.TEXTBUTTONS_WITH_GRAPHIC);
enumTestList.add(PredefinedLayout.LARGE_GRAPHIC_WITH_SOFTBUTTONS);
enumTestList.add(PredefinedLayout.DOUBLE_GRAPHIC_WITH_SOFTBUTTONS);
enumTestList.add(PredefinedLayout.LARGE_GRAPHIC_ONLY);
assertTrue("Enum value list does not match enum class list",
enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList));
}
|
void function() { List<PredefinedLayout> enumValueList = Arrays.asList(PredefinedLayout.values()); List<PredefinedLayout> enumTestList = new ArrayList<>(); enumTestList.add(PredefinedLayout.DEFAULT); enumTestList.add(PredefinedLayout.MEDIA); enumTestList.add(PredefinedLayout.NON_MEDIA); enumTestList.add(PredefinedLayout.ONSCREEN_PRESETS); enumTestList.add(PredefinedLayout.NAV_FULLSCREEN_MAP); enumTestList.add(PredefinedLayout.NAV_LIST); enumTestList.add(PredefinedLayout.NAV_KEYBOARD); enumTestList.add(PredefinedLayout.GRAPHIC_WITH_TEXT); enumTestList.add(PredefinedLayout.TEXT_WITH_GRAPHIC); enumTestList.add(PredefinedLayout.TILES_ONLY); enumTestList.add(PredefinedLayout.TEXTBUTTONS_ONLY); enumTestList.add(PredefinedLayout.GRAPHIC_WITH_TILES); enumTestList.add(PredefinedLayout.TILES_WITH_GRAPHIC); enumTestList.add(PredefinedLayout.GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS); enumTestList.add(PredefinedLayout.TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC); enumTestList.add(PredefinedLayout.GRAPHIC_WITH_TEXTBUTTONS); enumTestList.add(PredefinedLayout.TEXTBUTTONS_WITH_GRAPHIC); enumTestList.add(PredefinedLayout.LARGE_GRAPHIC_WITH_SOFTBUTTONS); enumTestList.add(PredefinedLayout.DOUBLE_GRAPHIC_WITH_SOFTBUTTONS); enumTestList.add(PredefinedLayout.LARGE_GRAPHIC_ONLY); assertTrue(STR, enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList)); }
|
/**
* Verifies the possible enum values of PredefinedLayout.
*/
|
Verifies the possible enum values of PredefinedLayout
|
testListEnum
|
{
"repo_name": "anildahiya/sdl_android",
"path": "android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PredefinedLayoutTests.java",
"license": "bsd-3-clause",
"size": 6652
}
|
[
"com.smartdevicelink.proxy.rpc.enums.PredefinedLayout",
"java.util.ArrayList",
"java.util.Arrays",
"java.util.List"
] |
import com.smartdevicelink.proxy.rpc.enums.PredefinedLayout; import java.util.ArrayList; import java.util.Arrays; import java.util.List;
|
import com.smartdevicelink.proxy.rpc.enums.*; import java.util.*;
|
[
"com.smartdevicelink.proxy",
"java.util"
] |
com.smartdevicelink.proxy; java.util;
| 2,846,120 |
private Build getBuild(String buildName, String buildNumber, String buildStarted, RestResponse response) {
boolean buildStartedSupplied = StringUtils.isNotBlank(buildStarted);
try {
Build build = null;
if (buildStartedSupplied) {
BuildRun buildRun = buildService.getBuildRun(buildName, buildNumber, buildStarted);
if (buildRun != null) {
build = buildService.getBuild(buildRun);
}
} else {
//Take the latest build of the specified number
build = buildService.getLatestBuildByNameAndNumber(buildName, buildNumber);
}
if (build == null) {
StringBuilder builder = new StringBuilder().append("Could not find build '").append(buildName).
append("' #").append(buildNumber);
if (buildStartedSupplied) {
builder.append(" that started at ").append(buildStarted);
}
throwNotFoundError(response, builder.toString());
}
return build;
} catch (RepositoryRuntimeException e) {
String errorMessage = new StringBuilder().append("Error locating latest build for '").append(buildName).
append("' #").append(buildNumber).append(": ").append(e.getMessage()).toString();
throwInternalError(errorMessage, response);
}
//Should not happen
return null;
}
|
Build function(String buildName, String buildNumber, String buildStarted, RestResponse response) { boolean buildStartedSupplied = StringUtils.isNotBlank(buildStarted); try { Build build = null; if (buildStartedSupplied) { BuildRun buildRun = buildService.getBuildRun(buildName, buildNumber, buildStarted); if (buildRun != null) { build = buildService.getBuild(buildRun); } } else { build = buildService.getLatestBuildByNameAndNumber(buildName, buildNumber); } if (build == null) { StringBuilder builder = new StringBuilder().append(STR).append(buildName). append(STR).append(buildNumber); if (buildStartedSupplied) { builder.append(STR).append(buildStarted); } throwNotFoundError(response, builder.toString()); } return build; } catch (RepositoryRuntimeException e) { String errorMessage = new StringBuilder().append(STR).append(buildName). append(STR).append(buildNumber).append(STR).append(e.getMessage()).toString(); throwInternalError(errorMessage, response); } return null; }
|
/**
* get build info
*
* @param buildName - build name
* @param buildNumber - build number
* @param buildStarted - build date
* @param response - encapsulate data related to request
* @return
*/
|
get build info
|
getBuild
|
{
"repo_name": "alancnet/artifactory",
"path": "web/rest-ui/src/main/java/org/artifactory/ui/rest/service/builds/buildsinfo/tabs/licenses/BuildLicensesService.java",
"license": "apache-2.0",
"size": 8645
}
|
[
"org.apache.commons.lang.StringUtils",
"org.artifactory.build.BuildRun",
"org.artifactory.rest.common.service.RestResponse",
"org.artifactory.sapi.common.RepositoryRuntimeException",
"org.jfrog.build.api.Build"
] |
import org.apache.commons.lang.StringUtils; import org.artifactory.build.BuildRun; import org.artifactory.rest.common.service.RestResponse; import org.artifactory.sapi.common.RepositoryRuntimeException; import org.jfrog.build.api.Build;
|
import org.apache.commons.lang.*; import org.artifactory.build.*; import org.artifactory.rest.common.service.*; import org.artifactory.sapi.common.*; import org.jfrog.build.api.*;
|
[
"org.apache.commons",
"org.artifactory.build",
"org.artifactory.rest",
"org.artifactory.sapi",
"org.jfrog.build"
] |
org.apache.commons; org.artifactory.build; org.artifactory.rest; org.artifactory.sapi; org.jfrog.build;
| 286,561 |
private String insertFormats(String pattern, ArrayList<String> customPatterns)
{
if (!containsElements(customPatterns))
{
return pattern;
}
StringBuilder sb = new StringBuilder(pattern.length() * 2);
ParsePosition pos = new ParsePosition(0);
int fe = -1;
int depth = 0;
do
{
char c = pattern.charAt(pos.getIndex());
if (QUOTE == c)
{
appendQuotedString(pattern, pos, sb, false);
continue;
}
if (START_FE == c)
{
depth++;
if (depth == 1)
{
fe++;
sb.append(START_FE).append(readArgumentIndex(pattern, next(pos)));
String customPattern = customPatterns.get(fe);
if (customPattern != null)
{
sb.append(START_FMT).append(customPattern);
}
}
continue;
}
if (END_FE == c)
{
depth--;
}
//$FALL-THROUGH$
sb.append(c);
next(pos);
} while (pos.getIndex() < pattern.length());
return sb.toString();
}
|
String function(String pattern, ArrayList<String> customPatterns) { if (!containsElements(customPatterns)) { return pattern; } StringBuilder sb = new StringBuilder(pattern.length() * 2); ParsePosition pos = new ParsePosition(0); int fe = -1; int depth = 0; do { char c = pattern.charAt(pos.getIndex()); if (QUOTE == c) { appendQuotedString(pattern, pos, sb, false); continue; } if (START_FE == c) { depth++; if (depth == 1) { fe++; sb.append(START_FE).append(readArgumentIndex(pattern, next(pos))); String customPattern = customPatterns.get(fe); if (customPattern != null) { sb.append(START_FMT).append(customPattern); } } continue; } if (END_FE == c) { depth--; } sb.append(c); next(pos); } while (pos.getIndex() < pattern.length()); return sb.toString(); }
|
/**
* Insert formats back into the pattern for toPattern() support.
*
* @param pattern
* source
* @param customPatterns
* The custom patterns to re-insert, if any
* @return full pattern
*/
|
Insert formats back into the pattern for toPattern() support
|
insertFormats
|
{
"repo_name": "mfornos/humanize",
"path": "humanize-slim/src/main/java/humanize/text/ExtendedMessageFormat.java",
"license": "apache-2.0",
"size": 19301
}
|
[
"java.text.ParsePosition",
"java.util.ArrayList"
] |
import java.text.ParsePosition; import java.util.ArrayList;
|
import java.text.*; import java.util.*;
|
[
"java.text",
"java.util"
] |
java.text; java.util;
| 1,495,913 |
boolean remove(@Nullable Object key, @Nullable Object value);
// Bulk Operations
|
boolean remove(@Nullable Object key, @Nullable Object value);
|
/**
* Removes a single key-value pair from the multimap.
*
* @param key key of entry to remove from the multimap
* @param value value of entry to remove the multimap
* @return {@code true} if the multimap changed
*/
|
Removes a single key-value pair from the multimap
|
remove
|
{
"repo_name": "npvincent/guava",
"path": "guava/src/com/google/common/collect/Multimap.java",
"license": "apache-2.0",
"size": 14750
}
|
[
"javax.annotation.Nullable"
] |
import javax.annotation.Nullable;
|
import javax.annotation.*;
|
[
"javax.annotation"
] |
javax.annotation;
| 1,110,961 |
public RowMetaInterface getStepFields( StepMeta stepMeta ) throws KettleStepException {
return getStepFields( stepMeta, null );
}
|
RowMetaInterface function( StepMeta stepMeta ) throws KettleStepException { return getStepFields( stepMeta, null ); }
|
/**
* Returns the fields that are emitted by a certain step.
*
* @param stepMeta
* The step to be queried.
* @return A row containing the fields emitted.
* @throws KettleStepException
* the kettle step exception
*/
|
Returns the fields that are emitted by a certain step
|
getStepFields
|
{
"repo_name": "Advent51/pentaho-kettle",
"path": "engine/src/main/java/org/pentaho/di/trans/TransMeta.java",
"license": "apache-2.0",
"size": 225587
}
|
[
"org.pentaho.di.core.exception.KettleStepException",
"org.pentaho.di.core.row.RowMetaInterface",
"org.pentaho.di.trans.step.StepMeta"
] |
import org.pentaho.di.core.exception.KettleStepException; import org.pentaho.di.core.row.RowMetaInterface; import org.pentaho.di.trans.step.StepMeta;
|
import org.pentaho.di.core.exception.*; import org.pentaho.di.core.row.*; import org.pentaho.di.trans.step.*;
|
[
"org.pentaho.di"
] |
org.pentaho.di;
| 2,712,974 |
public static PlatformProcessor platformProcessor(Ignite grid) {
GridKernalContext ctx = ((IgniteKernal) grid).context();
return ctx.platform();
}
|
static PlatformProcessor function(Ignite grid) { GridKernalContext ctx = ((IgniteKernal) grid).context(); return ctx.platform(); }
|
/**
* Get GridGain platform processor.
*
* @param grid Ignite instance.
* @return Platform processor.
*/
|
Get GridGain platform processor
|
platformProcessor
|
{
"repo_name": "irudyak/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformUtils.java",
"license": "apache-2.0",
"size": 38830
}
|
[
"org.apache.ignite.Ignite",
"org.apache.ignite.internal.GridKernalContext",
"org.apache.ignite.internal.IgniteKernal",
"org.apache.ignite.internal.processors.platform.PlatformProcessor"
] |
import org.apache.ignite.Ignite; import org.apache.ignite.internal.GridKernalContext; import org.apache.ignite.internal.IgniteKernal; import org.apache.ignite.internal.processors.platform.PlatformProcessor;
|
import org.apache.ignite.*; import org.apache.ignite.internal.*; import org.apache.ignite.internal.processors.platform.*;
|
[
"org.apache.ignite"
] |
org.apache.ignite;
| 1,408,586 |
public Builder putAllExtraParam(Map<String, Object> map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
|
Builder function(Map<String, Object> map) { if (this.extraParams == null) { this.extraParams = new HashMap<>(); } this.extraParams.putAll(map); return this; }
|
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link ConfigurationUpdateParams.Features.SubscriptionUpdate#extraParams} for
* the field documentation.
*/
|
Add all map key/value pairs to `extraParams` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. See <code>ConfigurationUpdateParams.Features.SubscriptionUpdate#extraParams</code> for the field documentation
|
putAllExtraParam
|
{
"repo_name": "stripe/stripe-java",
"path": "src/main/java/com/stripe/param/billingportal/ConfigurationUpdateParams.java",
"license": "mit",
"size": 58333
}
|
[
"java.util.HashMap",
"java.util.Map"
] |
import java.util.HashMap; import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,659,637 |
public String getVilFileName(EObject rootObject) {
String vilFileName = "";
File vilFile = getVilFile(rootObject);
if (vilFile.exists()) {
vilFileName = vilFile.getName().substring(0, vilFile.getName().indexOf("."));
}
return vilFileName;
}
|
String function(EObject rootObject) { String vilFileName = STR.")); } return vilFileName; }
|
/**
* Returns the name of the current VIL file.
*
* @param rootObject the root element of the current context. Typically this is the <code>ImplementationUnit</code>.
* @return the name of the current VIL file or an empty string if the file could not be resolved.
*/
|
Returns the name of the current VIL file
|
getVilFileName
|
{
"repo_name": "SSEHUB/EASyProducer",
"path": "Plugins/Instantiation/de.uni_hildesheim.sse.vil.buildlang.ui/src/de/uni_hildesheim/sse/ui/contentassist/VilBuildLangProposalProviderUtility.java",
"license": "apache-2.0",
"size": 73518
}
|
[
"org.eclipse.emf.ecore.EObject"
] |
import org.eclipse.emf.ecore.EObject;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 755,909 |
@RetryOnFailure(attempts = 2, delay = 100, unit = TimeUnit.MILLISECONDS, types = SynapseException.class,
randomize = false)
public void downloadFileHandleWithRetry(String fileHandleId, File toFile) throws SynapseException {
rateLimiter.acquire();
synapseClient.downloadFromFileHandleTemporaryUrl(fileHandleId, toFile);
}
|
@RetryOnFailure(attempts = 2, delay = 100, unit = TimeUnit.MILLISECONDS, types = SynapseException.class, randomize = false) void function(String fileHandleId, File toFile) throws SynapseException { rateLimiter.acquire(); synapseClient.downloadFromFileHandleTemporaryUrl(fileHandleId, toFile); }
|
/**
* Download file handle from Synapse. This is a retry wrapper.
*
* @param fileHandleId
* file handle to download
* @param toFile
* File on local disk to write to
* @throws SynapseException
* if the call fails
*/
|
Download file handle from Synapse. This is a retry wrapper
|
downloadFileHandleWithRetry
|
{
"repo_name": "DwayneJengSage/Bridge-Exporter-1",
"path": "src/main/java/org/sagebionetworks/bridge/exporter/synapse/SynapseHelper.java",
"license": "apache-2.0",
"size": 47031
}
|
[
"com.jcabi.aspects.RetryOnFailure",
"java.io.File",
"java.util.concurrent.TimeUnit",
"org.sagebionetworks.client.exceptions.SynapseException"
] |
import com.jcabi.aspects.RetryOnFailure; import java.io.File; import java.util.concurrent.TimeUnit; import org.sagebionetworks.client.exceptions.SynapseException;
|
import com.jcabi.aspects.*; import java.io.*; import java.util.concurrent.*; import org.sagebionetworks.client.exceptions.*;
|
[
"com.jcabi.aspects",
"java.io",
"java.util",
"org.sagebionetworks.client"
] |
com.jcabi.aspects; java.io; java.util; org.sagebionetworks.client;
| 2,393,608 |
List<Project> listForAccount(Long accountId);
|
List<Project> listForAccount(Long accountId);
|
/**
* Lists all projects for a given account. Should return an empty list if no
* projects are associated with account. Depending on implementation, might
* throw exceptions if account with specified id doesn't exist
*
* @param accountId
* @return
*/
|
Lists all projects for a given account. Should return an empty list if no projects are associated with account. Depending on implementation, might throw exceptions if account with specified id doesn't exist
|
listForAccount
|
{
"repo_name": "ow2-xlcloud/vcms",
"path": "vcms-gui/modules/projects/src/main/java/org/xlcloud/console/projects/repository/ProjectsRepository.java",
"license": "apache-2.0",
"size": 3110
}
|
[
"java.util.List",
"org.xlcloud.service.Project"
] |
import java.util.List; import org.xlcloud.service.Project;
|
import java.util.*; import org.xlcloud.service.*;
|
[
"java.util",
"org.xlcloud.service"
] |
java.util; org.xlcloud.service;
| 2,275,952 |
public static TableOperation replace(final TableEntity entity) {
Utility.assertNotNullOrEmpty("entity etag", entity.getEtag());
return new TableOperation(entity, TableOperationType.REPLACE);
}
private TableEntity entity;
private TableOperationType opType = null;
private boolean echoContent;
protected TableOperation() {
// Empty constructor.
}
protected TableOperation(final TableEntity entity, final TableOperationType opType) {
this(entity, opType, false);
}
protected TableOperation(final TableEntity entity, final TableOperationType opType, final boolean echoContent) {
this.entity = entity;
this.opType = opType;
this.echoContent = echoContent;
}
|
static TableOperation function(final TableEntity entity) { Utility.assertNotNullOrEmpty(STR, entity.getEtag()); return new TableOperation(entity, TableOperationType.REPLACE); } private TableEntity entity; private TableOperationType opType = null; private boolean echoContent; protected TableOperation() { } protected TableOperation(final TableEntity entity, final TableOperationType opType) { this(entity, opType, false); } protected TableOperation(final TableEntity entity, final TableOperationType opType, final boolean echoContent) { this.entity = entity; this.opType = opType; this.echoContent = echoContent; }
|
/**
* A static factory method returning a {@link TableOperation} instance to replace the specified table entity. To
* execute this {@link TableOperation} on a given table, call the
* {@link CloudTable#execute(TableOperation)} method.
*
* @param entity
* The object instance implementing {@link TableEntity} to associate with the operation.
* @return
* A new {@link TableOperation} instance for replacing the table entity.
*/
|
A static factory method returning a <code>TableOperation</code> instance to replace the specified table entity. To execute this <code>TableOperation</code> on a given table, call the <code>CloudTable#execute(TableOperation)</code> method
|
replace
|
{
"repo_name": "iterate-ch/azure-storage-java",
"path": "microsoft-azure-storage/src/com/microsoft/azure/storage/table/TableOperation.java",
"license": "apache-2.0",
"size": 44819
}
|
[
"com.microsoft.azure.storage.core.Utility"
] |
import com.microsoft.azure.storage.core.Utility;
|
import com.microsoft.azure.storage.core.*;
|
[
"com.microsoft.azure"
] |
com.microsoft.azure;
| 2,796,243 |
static public Region copyRegionToUtility(RegionUtility utility, Region region) {
if (utility.getEventList().equals(region.utility.getEventList()))
return new Region(utility, region.backwardWeights, region.forwardWeights,
region.initialMarking);
Builder builder = new Builder(utility);
List<String> regionEventList = region.utility.getEventList();
for (int index = 0; index < regionEventList.size(); index++) {
int newIndex = utility.getEventIndex(regionEventList.get(index));
if (newIndex < 0)
throw new IllegalArgumentException("The given region utility does not have "
+ "event '" + regionEventList.get(index) + "'");
builder.forwardList.set(newIndex, region.forwardWeights.get(index));
builder.backwardList.set(newIndex, region.backwardWeights.get(index));
}
return builder.withInitialMarking(region.initialMarking);
}
}
}
|
static Region function(RegionUtility utility, Region region) { if (utility.getEventList().equals(region.utility.getEventList())) return new Region(utility, region.backwardWeights, region.forwardWeights, region.initialMarking); Builder builder = new Builder(utility); List<String> regionEventList = region.utility.getEventList(); for (int index = 0; index < regionEventList.size(); index++) { int newIndex = utility.getEventIndex(regionEventList.get(index)); if (newIndex < 0) throw new IllegalArgumentException(STR + STR + regionEventList.get(index) + "'"); builder.forwardList.set(newIndex, region.forwardWeights.get(index)); builder.backwardList.set(newIndex, region.backwardWeights.get(index)); } return builder.withInitialMarking(region.initialMarking); } } }
|
/**
* Create a copy of a region for a different RegionUtility. Every event used by the given region's
* utility must be available in the given utility!
* @param utility The utility to use.
* @param region The region to copy to the given utility.
* @return A new region with the same weights and initial token count as the given region, but referring
* to the given region utility.
* @throws IllegalArgumentException When the event lists are incompatible.
*/
|
Create a copy of a region for a different RegionUtility. Every event used by the given region's utility must be available in the given utility
|
copyRegionToUtility
|
{
"repo_name": "CvO-Theory/apt",
"path": "src/module/uniol/apt/analysis/synthesize/Region.java",
"license": "gpl-2.0",
"size": 18752
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 703,833 |
public Message readMessage() {
while (true) {
Tunnel tunnel = geTunnelOrReconnect(Integer.MAX_VALUE);
try {
// Blocking call
byte[] msgBuf = tunnel.readMessage();
return Message.constructMessage(msgBuf, 0);
} catch (MalformedMessageException e) {
// TODO : Send an ERR_ ?
logger.error("Dropping the message received from the router, reason:" + e.getMessage());
} catch (IOException e) {
logger.debug("PAMR Connection lost (while waiting for a message). A new connection will be established shortly",
e);
PAMRException cause = new PAMRException("PAMR connection lost (while waiting for a message)", e);
reportTunnelFailure(tunnel, cause);
}
}
}
|
Message function() { while (true) { Tunnel tunnel = geTunnelOrReconnect(Integer.MAX_VALUE); try { byte[] msgBuf = tunnel.readMessage(); return Message.constructMessage(msgBuf, 0); } catch (MalformedMessageException e) { logger.error(STR + e.getMessage()); } catch (IOException e) { logger.debug(STR, e); PAMRException cause = new PAMRException(STR, e); reportTunnelFailure(tunnel, cause); } } }
|
/**
* Block until a message is received
*
* Also in charge of handling tunnel failures
*
* @return the received message
*/
|
Block until a message is received Also in charge of handling tunnel failures
|
readMessage
|
{
"repo_name": "paraita/programming",
"path": "programming-extensions/programming-extension-pamr/src/main/java/org/objectweb/proactive/extensions/pamr/client/AgentImpl.java",
"license": "agpl-3.0",
"size": 38521
}
|
[
"java.io.IOException",
"org.objectweb.proactive.extensions.pamr.exceptions.MalformedMessageException",
"org.objectweb.proactive.extensions.pamr.exceptions.PAMRException",
"org.objectweb.proactive.extensions.pamr.protocol.message.Message"
] |
import java.io.IOException; import org.objectweb.proactive.extensions.pamr.exceptions.MalformedMessageException; import org.objectweb.proactive.extensions.pamr.exceptions.PAMRException; import org.objectweb.proactive.extensions.pamr.protocol.message.Message;
|
import java.io.*; import org.objectweb.proactive.extensions.pamr.exceptions.*; import org.objectweb.proactive.extensions.pamr.protocol.message.*;
|
[
"java.io",
"org.objectweb.proactive"
] |
java.io; org.objectweb.proactive;
| 601,369 |
private JTable getJTableThreadProtocolVector() {
if (jTableThreadProtocolVector == null) {
if (threadProtocolVector==null) {
jTableThreadProtocolVector = new JTable();
} else {
jTableThreadProtocolVector = new JTable(threadProtocolVector.getTableModel());
}
jTableThreadProtocolVector.setFillsViewportHeight(true);
jTableThreadProtocolVector.getTableHeader().setReorderingAllowed(false);
TableColumnModel tableModel = jTableThreadProtocolVector.getColumnModel();
tableModel.getColumn(0).setMinWidth(50);
tableModel.getColumn(0).setMaxWidth(150);
tableModel.getColumn(1).setMinWidth(150);
tableModel.getColumn(2).setMinWidth(150);
int numberColumnWidth = 120;
tableModel.getColumn(3).setMinWidth(numberColumnWidth);
tableModel.getColumn(3).setMaxWidth(numberColumnWidth);
tableModel.getColumn(4).setMinWidth(numberColumnWidth);
tableModel.getColumn(4).setMaxWidth(numberColumnWidth);
if (threadProtocolVector!=null) {
// --- Add a sorter if the model is available -------
TableRowSorter<TableModel> sorter = new TableRowSorter<TableModel>(jTableThreadProtocolVector.getModel());
List<RowSorter.SortKey> sortKeys = new ArrayList<RowSorter.SortKey>();
//--- sort system cpu time, descending ---
sortKeys.add(new RowSorter.SortKey(3, SortOrder.DESCENDING));
sorter.setSortKeys(sortKeys);
sorter.setSortsOnUpdates(true);
jTableThreadProtocolVector.setRowSorter(sorter);
}
}
return jTableThreadProtocolVector;
}
|
JTable function() { if (jTableThreadProtocolVector == null) { if (threadProtocolVector==null) { jTableThreadProtocolVector = new JTable(); } else { jTableThreadProtocolVector = new JTable(threadProtocolVector.getTableModel()); } jTableThreadProtocolVector.setFillsViewportHeight(true); jTableThreadProtocolVector.getTableHeader().setReorderingAllowed(false); TableColumnModel tableModel = jTableThreadProtocolVector.getColumnModel(); tableModel.getColumn(0).setMinWidth(50); tableModel.getColumn(0).setMaxWidth(150); tableModel.getColumn(1).setMinWidth(150); tableModel.getColumn(2).setMinWidth(150); int numberColumnWidth = 120; tableModel.getColumn(3).setMinWidth(numberColumnWidth); tableModel.getColumn(3).setMaxWidth(numberColumnWidth); tableModel.getColumn(4).setMinWidth(numberColumnWidth); tableModel.getColumn(4).setMaxWidth(numberColumnWidth); if (threadProtocolVector!=null) { TableRowSorter<TableModel> sorter = new TableRowSorter<TableModel>(jTableThreadProtocolVector.getModel()); List<RowSorter.SortKey> sortKeys = new ArrayList<RowSorter.SortKey>(); sortKeys.add(new RowSorter.SortKey(3, SortOrder.DESCENDING)); sorter.setSortKeys(sortKeys); sorter.setSortsOnUpdates(true); jTableThreadProtocolVector.setRowSorter(sorter); } } return jTableThreadProtocolVector; }
|
/**
* Gets the j table thread protocol vector.
* @return the j table thread protocol vector
*/
|
Gets the j table thread protocol vector
|
getJTableThreadProtocolVector
|
{
"repo_name": "EnFlexIT/AgentWorkbench",
"path": "eclipseProjects/org.agentgui/bundles/org.agentgui.core/src/agentgui/simulationService/load/threading/gui/ThreadMonitorProtocolTableTab.java",
"license": "lgpl-2.1",
"size": 8560
}
|
[
"java.util.ArrayList",
"java.util.List",
"javax.swing.JTable",
"javax.swing.RowSorter",
"javax.swing.SortOrder",
"javax.swing.table.TableColumnModel",
"javax.swing.table.TableModel",
"javax.swing.table.TableRowSorter"
] |
import java.util.ArrayList; import java.util.List; import javax.swing.JTable; import javax.swing.RowSorter; import javax.swing.SortOrder; import javax.swing.table.TableColumnModel; import javax.swing.table.TableModel; import javax.swing.table.TableRowSorter;
|
import java.util.*; import javax.swing.*; import javax.swing.table.*;
|
[
"java.util",
"javax.swing"
] |
java.util; javax.swing;
| 539,618 |
@POST
@Path("{notebookId}/paragraph")
@ZeppelinApi
public Response insertParagraph(@PathParam("notebookId") String notebookId, String message)
throws IOException {
LOG.info("insert paragraph {} {}", notebookId, message);
Note note = notebook.getNote(notebookId);
if (note == null) {
return new JsonResponse<>(Status.NOT_FOUND, "note not found.").build();
}
NewParagraphRequest request = gson.fromJson(message, NewParagraphRequest.class);
Paragraph p;
Double indexDouble = request.getIndex();
if (indexDouble == null) {
p = note.addParagraph();
} else {
p = note.insertParagraph(indexDouble.intValue());
}
p.setTitle(request.getTitle());
p.setText(request.getText());
AuthenticationInfo subject = new AuthenticationInfo(SecurityUtils.getPrincipal());
note.persist(subject);
notebookServer.broadcastNote(note);
return new JsonResponse<>(Status.CREATED, "", p.getId()).build();
}
|
@Path(STR) Response function(@PathParam(STR) String notebookId, String message) throws IOException { LOG.info(STR, notebookId, message); Note note = notebook.getNote(notebookId); if (note == null) { return new JsonResponse<>(Status.NOT_FOUND, STR).build(); } NewParagraphRequest request = gson.fromJson(message, NewParagraphRequest.class); Paragraph p; Double indexDouble = request.getIndex(); if (indexDouble == null) { p = note.addParagraph(); } else { p = note.insertParagraph(indexDouble.intValue()); } p.setTitle(request.getTitle()); p.setText(request.getText()); AuthenticationInfo subject = new AuthenticationInfo(SecurityUtils.getPrincipal()); note.persist(subject); notebookServer.broadcastNote(note); return new JsonResponse<>(Status.CREATED, "", p.getId()).build(); }
|
/**
* Insert paragraph REST API
*
* @param message - JSON containing paragraph's information
* @return JSON with status.OK
*/
|
Insert paragraph REST API
|
insertParagraph
|
{
"repo_name": "spacewalkman/incubator-zeppelin",
"path": "zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRestApi.java",
"license": "apache-2.0",
"size": 30579
}
|
[
"java.io.IOException",
"javax.ws.rs.Path",
"javax.ws.rs.PathParam",
"javax.ws.rs.core.Response",
"org.apache.zeppelin.notebook.Note",
"org.apache.zeppelin.notebook.Paragraph",
"org.apache.zeppelin.rest.message.NewParagraphRequest",
"org.apache.zeppelin.server.JsonResponse",
"org.apache.zeppelin.user.AuthenticationInfo",
"org.apache.zeppelin.utils.SecurityUtils"
] |
import java.io.IOException; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.core.Response; import org.apache.zeppelin.notebook.Note; import org.apache.zeppelin.notebook.Paragraph; import org.apache.zeppelin.rest.message.NewParagraphRequest; import org.apache.zeppelin.server.JsonResponse; import org.apache.zeppelin.user.AuthenticationInfo; import org.apache.zeppelin.utils.SecurityUtils;
|
import java.io.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import org.apache.zeppelin.notebook.*; import org.apache.zeppelin.rest.message.*; import org.apache.zeppelin.server.*; import org.apache.zeppelin.user.*; import org.apache.zeppelin.utils.*;
|
[
"java.io",
"javax.ws",
"org.apache.zeppelin"
] |
java.io; javax.ws; org.apache.zeppelin;
| 2,369,816 |
public void merge(final Readable input,
final ExtensionRegistry extensionRegistry,
final Message.Builder builder)
throws IOException {
// Read the entire input to a String then parse that.
// If StreamTokenizer were not quite so crippled, or if there were a kind
// of Reader that could read in chunks that match some particular regex,
// or if we wanted to write a custom Reader to tokenize our stream, then
// we would not have to read to one big String. Alas, none of these is
// the case. Oh well.
merge(toStringBuilder(input), extensionRegistry, builder);
}
private static final int BUFFER_SIZE = 4096;
|
void function(final Readable input, final ExtensionRegistry extensionRegistry, final Message.Builder builder) throws IOException { merge(toStringBuilder(input), extensionRegistry, builder); } private static final int BUFFER_SIZE = 4096;
|
/**
* Parse a text-format message from {@code input} and merge the contents
* into {@code builder}. Extensions will be recognized if they are
* registered in {@code extensionRegistry}.
*/
|
Parse a text-format message from input and merge the contents into builder. Extensions will be recognized if they are registered in extensionRegistry
|
merge
|
{
"repo_name": "danakj/chromium",
"path": "third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java",
"license": "bsd-3-clause",
"size": 70608
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,339,525 |
private static Throwable getOriginalThrowable(Throwable t) {
if (t instanceof SAXException) {
SAXException saxe = (SAXException)t;
if (saxe.getException() != null) {
return getOriginalThrowable(saxe.getException());
} else {
return saxe;
}
} else {
if (t.getCause() != null) {
return getOriginalThrowable(t.getCause());
} else {
return t;
}
}
}
|
static Throwable function(Throwable t) { if (t instanceof SAXException) { SAXException saxe = (SAXException)t; if (saxe.getException() != null) { return getOriginalThrowable(saxe.getException()); } else { return saxe; } } else { if (t.getCause() != null) { return getOriginalThrowable(t.getCause()); } else { return t; } } }
|
/**
* This method extracts the original exception from some exception. The exception
* might be nested multiple levels deep.
* @param t the Throwable to inspect
* @return the original Throwable or the method parameter t if there are no nested Throwables.
*/
|
This method extracts the original exception from some exception. The exception might be nested multiple levels deep
|
getOriginalThrowable
|
{
"repo_name": "spepping/fop-cs",
"path": "examples/embedding/java/embedding/events/ExampleEvents.java",
"license": "apache-2.0",
"size": 8507
}
|
[
"org.xml.sax.SAXException"
] |
import org.xml.sax.SAXException;
|
import org.xml.sax.*;
|
[
"org.xml.sax"
] |
org.xml.sax;
| 1,224,544 |
@Override
public boolean removeProperties(final String id) {
try {
return deleteIfExists(sidecarFile(id).toPath());
} catch (final IOException e) {
throw new RepositoryRuntimeException(id, e);
}
}
|
boolean function(final String id) { try { return deleteIfExists(sidecarFile(id).toPath()); } catch (final IOException e) { throw new RepositoryRuntimeException(id, e); } }
|
/**
* This is a trivial reimplementation of the private Modeshape implementation in
* org.modeshape.connector.filesystem.JsonSidecarExtraPropertyStore
*
* See: https://github.com/ModeShape/modeshape/blob/modeshape-4.2.0.Final/modeshape-jcr/src/main/java/
* org/modeshape/connector/filesystem/JsonSidecarExtraPropertyStore.java#L139
*
* @param id the identifier for the sidecar file
* @return whether the file was deleted
*/
|
This is a trivial reimplementation of the private Modeshape implementation in org.modeshape.connector.filesystem.JsonSidecarExtraPropertyStore See: HREF org/modeshape/connector/filesystem/JsonSidecarExtraPropertyStore.java#L139
|
removeProperties
|
{
"repo_name": "ruebot/fcrepo4",
"path": "fcrepo-connector-file/src/main/java/org/fcrepo/connector/file/ExternalJsonSidecarExtraPropertyStore.java",
"license": "apache-2.0",
"size": 9462
}
|
[
"java.io.IOException",
"java.nio.file.Files",
"org.fcrepo.kernel.api.exception.RepositoryRuntimeException"
] |
import java.io.IOException; import java.nio.file.Files; import org.fcrepo.kernel.api.exception.RepositoryRuntimeException;
|
import java.io.*; import java.nio.file.*; import org.fcrepo.kernel.api.exception.*;
|
[
"java.io",
"java.nio",
"org.fcrepo.kernel"
] |
java.io; java.nio; org.fcrepo.kernel;
| 560,548 |
@Override
public void writeStructEnd() throws TException {
lastFieldId_ = lastField_.pop();
}
|
void function() throws TException { lastFieldId_ = lastField_.pop(); }
|
/**
* Write a struct end. This doesn't actually put anything on the wire. We use this as an
* opportunity to pop the last field from the current struct off of the field stack.
*/
|
Write a struct end. This doesn't actually put anything on the wire. We use this as an opportunity to pop the last field from the current struct off of the field stack
|
writeStructEnd
|
{
"repo_name": "facebook/fbthrift",
"path": "thrift/lib/javadeprecated/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java",
"license": "apache-2.0",
"size": 29224
}
|
[
"com.facebook.thrift.TException"
] |
import com.facebook.thrift.TException;
|
import com.facebook.thrift.*;
|
[
"com.facebook.thrift"
] |
com.facebook.thrift;
| 388,713 |
public void addAgent(Object key, Agent agent) {
if (agentView.containsKey(key)) {
agentView.get(key).add(agent);
} else {
List<Agent> agentList = new ArrayList<Agent>();
agentList.add(agent);
agentView.put(key, agentList);
}
}
|
void function(Object key, Agent agent) { if (agentView.containsKey(key)) { agentView.get(key).add(agent); } else { List<Agent> agentList = new ArrayList<Agent>(); agentList.add(agent); agentView.put(key, agentList); } }
|
/**
* Adds an agent to this view.
*
* @param key The key/parameter to which the given agent conforms to.
* @param agent The agent to be added to the current view.
*/
|
Adds an agent to this view
|
addAgent
|
{
"repo_name": "LaSEEB/LAIS1",
"path": "src/org/laseeb/LAIS/agent/AgentView.java",
"license": "gpl-3.0",
"size": 2402
}
|
[
"java.util.ArrayList",
"java.util.List"
] |
import java.util.ArrayList; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,516,002 |
private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName,
javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {
java.lang.String attributeNamespace = qname.getNamespaceURI();
java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace);
if (attributePrefix == null) {
attributePrefix = registerPrefix(xmlWriter, attributeNamespace);
}
java.lang.String attributeValue;
if (attributePrefix.trim().length() > 0) {
attributeValue = attributePrefix + ":" + qname.getLocalPart();
} else {
attributeValue = qname.getLocalPart();
}
if (namespace.equals("")) {
xmlWriter.writeAttribute(attName, attributeValue);
} else {
registerPrefix(xmlWriter, namespace);
xmlWriter.writeAttribute(namespace, attName, attributeValue);
}
}
|
void function(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { java.lang.String attributeNamespace = qname.getNamespaceURI(); java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); if (attributePrefix == null) { attributePrefix = registerPrefix(xmlWriter, attributeNamespace); } java.lang.String attributeValue; if (attributePrefix.trim().length() > 0) { attributeValue = attributePrefix + ":" + qname.getLocalPart(); } else { attributeValue = qname.getLocalPart(); } if (namespace.equals("")) { xmlWriter.writeAttribute(attName, attributeValue); } else { registerPrefix(xmlWriter, namespace); xmlWriter.writeAttribute(namespace, attName, attributeValue); } }
|
/**
* Util method to write an attribute without the ns prefix
*/
|
Util method to write an attribute without the ns prefix
|
writeQNameAttribute
|
{
"repo_name": "sandamal/wso2-axis2",
"path": "modules/adb/src/org/apache/axis2/databinding/types/soapencoding/GYearMonth.java",
"license": "apache-2.0",
"size": 21210
}
|
[
"javax.xml.stream.XMLStreamWriter"
] |
import javax.xml.stream.XMLStreamWriter;
|
import javax.xml.stream.*;
|
[
"javax.xml"
] |
javax.xml;
| 1,013,178 |
public void setSkinnyLogfileInfo(SkinnyLogfileInfo skinnyInfo) {
this.skinnyLogfileInfo = skinnyInfo;
}
/**
* {@inheritDoc}
|
void function(SkinnyLogfileInfo skinnyInfo) { this.skinnyLogfileInfo = skinnyInfo; } /** * {@inheritDoc}
|
/**
* Set the skinny logfile info.
* @param skinnyInfo the skinny logfile info.
*/
|
Set the skinny logfile info
|
setSkinnyLogfileInfo
|
{
"repo_name": "jimv39/qvcsos",
"path": "qvcse-qvcslib/src/main/java/com/qumasoft/qvcslib/response/ServerResponseRenameArchive.java",
"license": "apache-2.0",
"size": 4962
}
|
[
"com.qumasoft.qvcslib.SkinnyLogfileInfo"
] |
import com.qumasoft.qvcslib.SkinnyLogfileInfo;
|
import com.qumasoft.qvcslib.*;
|
[
"com.qumasoft.qvcslib"
] |
com.qumasoft.qvcslib;
| 2,822,467 |
public ResourceList getResourcesFromPath(String serverId,String resourcePath, String resourceType, String resourceTypeFilter, String detailLevel,String pathToServersXML);
|
ResourceList function(String serverId,String resourcePath, String resourceType, String resourceTypeFilter, String detailLevel,String pathToServersXML);
|
/**
* Get all resources of passed in resource type from passed in resource path, this method traverses the resource tree from the
* starting resource path and builds a resource list of passed in resource type
* @param serverId target server config name
* @param resourcePath starting resource path if no resource path is passed /shared is defaulted to resource path
* @param resourceType resource type here is the list of valid resource types
* CONTAINER,DATA_SOURCE,DEFINITION_SET,LINK,PROCEDURE,TABLE,TREE,TRIGGER
* if resourceType is not passed then all resources are returned
* @param detail Level resource detail Level here is the list of valid detail levels
* FULL, SMIPLE, NONE. if detail level is not passed NONE is defaulted to detail level
* @param pathToServersXML path to the server values xml
* @return resource list with all resources of passed in resource type in the resource tree from the starting resource path
*/
|
Get all resources of passed in resource type from passed in resource path, this method traverses the resource tree from the starting resource path and builds a resource list of passed in resource type
|
getResourcesFromPath
|
{
"repo_name": "cisco/PDTool",
"path": "src/com/tibco/ps/deploytool/dao/ResourceDAO.java",
"license": "bsd-3-clause",
"size": 10687
}
|
[
"com.compositesw.services.system.admin.resource.ResourceList"
] |
import com.compositesw.services.system.admin.resource.ResourceList;
|
import com.compositesw.services.system.admin.resource.*;
|
[
"com.compositesw.services"
] |
com.compositesw.services;
| 103,106 |
@Override
public ULong getId() {
return (ULong) get(0);
}
|
ULong function() { return (ULong) get(0); }
|
/**
* Getter for <code>cafemapdb.landmark.id</code>.
*/
|
Getter for <code>cafemapdb.landmark.id</code>
|
getId
|
{
"repo_name": "curioswitch/curiostack",
"path": "database/cafemapdb/bindings/gen-src/main/java/org/curioswitch/database/cafemapdb/tables/records/LandmarkRecord.java",
"license": "mit",
"size": 8812
}
|
[
"org.jooq.types.ULong"
] |
import org.jooq.types.ULong;
|
import org.jooq.types.*;
|
[
"org.jooq.types"
] |
org.jooq.types;
| 37,135 |
private int locatePoint(final double time, final StepInterpolator interval) {
if (forward) {
if (time < interval.getPreviousTime()) {
return -1;
} else if (time > interval.getCurrentTime()) {
return +1;
} else {
return 0;
}
}
if (time > interval.getPreviousTime()) {
return -1;
} else if (time < interval.getCurrentTime()) {
return +1;
} else {
return 0;
}
}
|
int function(final double time, final StepInterpolator interval) { if (forward) { if (time < interval.getPreviousTime()) { return -1; } else if (time > interval.getCurrentTime()) { return +1; } else { return 0; } } if (time > interval.getPreviousTime()) { return -1; } else if (time < interval.getCurrentTime()) { return +1; } else { return 0; } }
|
/** Compare a step interval and a double.
* @param time point to locate
* @param interval step interval
* @return -1 if the double is before the interval, 0 if it is in
* the interval, and +1 if it is after the interval, according to
* the interval direction
*/
|
Compare a step interval and a double
|
locatePoint
|
{
"repo_name": "martingwhite/astor",
"path": "examples/math_32/src/main/java/org/apache/commons/math3/ode/ContinuousOutputModel.java",
"license": "gpl-2.0",
"size": 13047
}
|
[
"org.apache.commons.math3.ode.sampling.StepInterpolator"
] |
import org.apache.commons.math3.ode.sampling.StepInterpolator;
|
import org.apache.commons.math3.ode.sampling.*;
|
[
"org.apache.commons"
] |
org.apache.commons;
| 2,426,948 |
public int[] executeBatch(String sql, PrepateStatementAwareCallback callback) throws JdbcStoreException {
Connection con = DataSourceUtils.getConnection(dataSource);
PreparedStatement ps = null;
try {
ps = con.prepareStatement(sql);
ps.setQueryTimeout(settings.getQueryTimeout());
callback.fillPrepareStatement(ps);
return ps.executeBatch();
} catch (JdbcStoreException e) {
throw e;
} catch (Exception e) {
throw new JdbcStoreException("Failed to execute sql [" + sql + "]", e);
} finally {
DataSourceUtils.closeStatement(ps);
DataSourceUtils.releaseConnection(con);
}
}
|
int[] function(String sql, PrepateStatementAwareCallback callback) throws JdbcStoreException { Connection con = DataSourceUtils.getConnection(dataSource); PreparedStatement ps = null; try { ps = con.prepareStatement(sql); ps.setQueryTimeout(settings.getQueryTimeout()); callback.fillPrepareStatement(ps); return ps.executeBatch(); } catch (JdbcStoreException e) { throw e; } catch (Exception e) { throw new JdbcStoreException(STR + sql + "]", e); } finally { DataSourceUtils.closeStatement(ps); DataSourceUtils.releaseConnection(con); } }
|
/**
* A template method to execute that can execute the same sql several times using different
* values set to it (in the <code>fillPrepareStatement</code>) callback).
*/
|
A template method to execute that can execute the same sql several times using different values set to it (in the <code>fillPrepareStatement</code>) callback)
|
executeBatch
|
{
"repo_name": "vthriller/opensymphony-compass-backup",
"path": "src/main/src/org/apache/lucene/store/jdbc/support/JdbcTemplate.java",
"license": "apache-2.0",
"size": 8443
}
|
[
"java.sql.Connection",
"java.sql.PreparedStatement",
"org.apache.lucene.store.jdbc.JdbcStoreException",
"org.apache.lucene.store.jdbc.datasource.DataSourceUtils"
] |
import java.sql.Connection; import java.sql.PreparedStatement; import org.apache.lucene.store.jdbc.JdbcStoreException; import org.apache.lucene.store.jdbc.datasource.DataSourceUtils;
|
import java.sql.*; import org.apache.lucene.store.jdbc.*; import org.apache.lucene.store.jdbc.datasource.*;
|
[
"java.sql",
"org.apache.lucene"
] |
java.sql; org.apache.lucene;
| 343,333 |
void get(Handler<AsyncResult<Buffer>> completionHandler);
|
void get(Handler<AsyncResult<Buffer>> completionHandler);
|
/**
* Retrieves the configuration store in this store.
*
* @param completionHandler the handler to pass the configuration
*/
|
Retrieves the configuration store in this store
|
get
|
{
"repo_name": "cescoffier/vertx-configuration-service",
"path": "vertx-configuration/src/main/java/io/vertx/ext/configuration/spi/ConfigurationStore.java",
"license": "apache-2.0",
"size": 761
}
|
[
"io.vertx.core.AsyncResult",
"io.vertx.core.Handler",
"io.vertx.core.buffer.Buffer"
] |
import io.vertx.core.AsyncResult; import io.vertx.core.Handler; import io.vertx.core.buffer.Buffer;
|
import io.vertx.core.*; import io.vertx.core.buffer.*;
|
[
"io.vertx.core"
] |
io.vertx.core;
| 476,353 |
public Adapter createCountryTypeAdapter() {
return null;
}
|
Adapter function() { return null; }
|
/**
* Creates a new adapter for an object of class '{@link org.oasis.xAL.CountryType <em>Country Type</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.oasis.xAL.CountryType
* @generated
*/
|
Creates a new adapter for an object of class '<code>org.oasis.xAL.CountryType Country Type</code>'. This default implementation returns null so that we can easily ignore cases; it's useful to ignore a case when inheritance will catch all the cases anyway.
|
createCountryTypeAdapter
|
{
"repo_name": "markus1978/citygml4emf",
"path": "de.hub.citygml.emf.ecore/src/org/oasis/xAL/util/XALAdapterFactory.java",
"license": "apache-2.0",
"size": 61937
}
|
[
"org.eclipse.emf.common.notify.Adapter"
] |
import org.eclipse.emf.common.notify.Adapter;
|
import org.eclipse.emf.common.notify.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 1,353,522 |
private void hmine(int[] prefix, int prefixLength, List<Row> rowList) throws IOException {
// Note: we assume that only the frequent items are in the HStruct.
// ======== Otherwise
// For each item that can extend the current prefix and is frequent
for(Row row : rowList) {
// create the new projected row list
List<Row> newRowList = new ArrayList<Row>();
mapItemRow.clear();
// for each transaction containing the item
for(int pointer : row.pointers) {
int transactionBegin = pointer;
// if there is nothing after the item, we don't need
// to create a new row
transactionBegin++;
if(cells[transactionBegin] == -1) {
continue;
}
// find the end of the transaction
// and calculate the reamining support
int transactionEnd = -1;
for(int pos = transactionBegin; ; pos++) {
if(cells[pos] == -1) {
transactionEnd = pos-1;
break;
}
}
// otherwise, we create the projected row
// For each item in the transaction
for(int pos = transactionBegin; pos <= transactionEnd; pos++) {
int item = cells[pos];
Row rowItem = mapItemRow.get(item);
if(rowItem == null) {
rowItem = new Row(item);
mapItemRow.put(item, rowItem);
}
rowItem.support++;
// add new pointer
rowItem.pointers.add(pos);
}
}
// add all the promising row and sort them
for(Entry<Integer,Row> entry : mapItemRow.entrySet()) {
Row currentRow = entry.getValue();
if(currentRow.support >= minSupport) {
newRowList.add(currentRow);
}
}
// output this itemset
writeOut(itemsetBuffer, prefixLength, row.item, row.support);
|
void function(int[] prefix, int prefixLength, List<Row> rowList) throws IOException { for(Row row : rowList) { List<Row> newRowList = new ArrayList<Row>(); mapItemRow.clear(); for(int pointer : row.pointers) { int transactionBegin = pointer; transactionBegin++; if(cells[transactionBegin] == -1) { continue; } int transactionEnd = -1; for(int pos = transactionBegin; ; pos++) { if(cells[pos] == -1) { transactionEnd = pos-1; break; } } for(int pos = transactionBegin; pos <= transactionEnd; pos++) { int item = cells[pos]; Row rowItem = mapItemRow.get(item); if(rowItem == null) { rowItem = new Row(item); mapItemRow.put(item, rowItem); } rowItem.support++; rowItem.pointers.add(pos); } } for(Entry<Integer,Row> entry : mapItemRow.entrySet()) { Row currentRow = entry.getValue(); if(currentRow.support >= minSupport) { newRowList.add(currentRow); } } writeOut(itemsetBuffer, prefixLength, row.item, row.support);
|
/**
* This is the recursive method to find all patterns. It writes
* the itemsets to the output file.
* @param prefix This is the current prefix. Initially, it is empty.
* @param prefixLength The current prefix length
* @param rowList the list of row in the current HStruct (containing only promising items)
* @throws IOException
*/
|
This is the recursive method to find all patterns. It writes the itemsets to the output file
|
hmine
|
{
"repo_name": "ArneBinder/LanguageAnalyzer",
"path": "src/main/java/ca/pfv/spmf/algorithms/frequentpatterns/hmine/AlgoHMine.java",
"license": "gpl-3.0",
"size": 15609
}
|
[
"java.io.IOException",
"java.util.ArrayList",
"java.util.List",
"java.util.Map"
] |
import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Map;
|
import java.io.*; import java.util.*;
|
[
"java.io",
"java.util"
] |
java.io; java.util;
| 2,318,306 |
@POST
@Formatted
@Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_X_YAML})
public Response add(Permit permit);
|
@Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_X_YAML}) Response function(Permit permit);
|
/**
* Adds a Permit to the set aggregated by parent Role. The Permit
* must be one retrived from the capabilities resource.
*
* @param permit the Permit to add
* @return the new newly added Permit
*/
|
Adds a Permit to the set aggregated by parent Role. The Permit must be one retrived from the capabilities resource
|
add
|
{
"repo_name": "derekhiggins/ovirt-engine",
"path": "backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/PermitsResource.java",
"license": "apache-2.0",
"size": 2014
}
|
[
"javax.ws.rs.Consumes",
"javax.ws.rs.core.Response",
"org.ovirt.engine.api.model.Permit"
] |
import javax.ws.rs.Consumes; import javax.ws.rs.core.Response; import org.ovirt.engine.api.model.Permit;
|
import javax.ws.rs.*; import javax.ws.rs.core.*; import org.ovirt.engine.api.model.*;
|
[
"javax.ws",
"org.ovirt.engine"
] |
javax.ws; org.ovirt.engine;
| 472,818 |
public List<XMLObject> decryptDataToList(EncryptedData encryptedData) throws DecryptionException {
return decryptDataToList(encryptedData, isRootInNewDocument());
}
/**
* Decrypts the supplied EncryptedData and returns the resulting list of XMLObjects.
*
* This will succeed only if the decrypted EncryptedData contains at the top-level only DOM Elements (not other
* types of DOM Nodes).
*
* @param encryptedData encrypted data element containing the data to be decrypted
* @param rootInNewDocument if true, root the underlying Elements of the returned XMLObjects in a new Document as
* described in {@link Decrypter}
|
List<XMLObject> function(EncryptedData encryptedData) throws DecryptionException { return decryptDataToList(encryptedData, isRootInNewDocument()); } /** * Decrypts the supplied EncryptedData and returns the resulting list of XMLObjects. * * This will succeed only if the decrypted EncryptedData contains at the top-level only DOM Elements (not other * types of DOM Nodes). * * @param encryptedData encrypted data element containing the data to be decrypted * @param rootInNewDocument if true, root the underlying Elements of the returned XMLObjects in a new Document as * described in {@link Decrypter}
|
/**
* This is a convenience method for calling {@link #decryptDataToList(EncryptedData, boolean)},
* with the <code>rootInNewDocument</code> parameter value supplied by {@link #isRootInNewDocument()}.
*
* @param encryptedData encrypted data element containing the data to be decrypted
* @return the list decrypted top-level XMLObjects
* @throws DecryptionException exception indicating a decryption error, possibly because the decrypted data
* contained DOM nodes other than type of Element
*/
|
This is a convenience method for calling <code>#decryptDataToList(EncryptedData, boolean)</code>, with the <code>rootInNewDocument</code> parameter value supplied by <code>#isRootInNewDocument()</code>
|
decryptDataToList
|
{
"repo_name": "Safewhere/kombit-service-java",
"path": "XmlTooling/src/org/opensaml/xml/encryption/Decrypter.java",
"license": "mit",
"size": 47926
}
|
[
"java.util.List",
"org.opensaml.xml.XMLObject",
"org.w3c.dom.Document"
] |
import java.util.List; import org.opensaml.xml.XMLObject; import org.w3c.dom.Document;
|
import java.util.*; import org.opensaml.xml.*; import org.w3c.dom.*;
|
[
"java.util",
"org.opensaml.xml",
"org.w3c.dom"
] |
java.util; org.opensaml.xml; org.w3c.dom;
| 865,852 |
private Font getAsNotUIResource(Font font) {
if (!(font instanceof UIResource)) return font;
// PENDING JW: correct way to create another font instance?
return font.deriveFont(font.getAttributes());
}
|
Font function(Font font) { if (!(font instanceof UIResource)) return font; return font.deriveFont(font.getAttributes()); }
|
/**
* Returns a Font based on the param which is not of type UIResource.
*
* @param font the base font
* @return a font not of type UIResource, may be null.
*/
|
Returns a Font based on the param which is not of type UIResource
|
getAsNotUIResource
|
{
"repo_name": "syncer/swingx",
"path": "swingx-core/src/main/java/org/jdesktop/swingx/plaf/basic/BasicHeaderUI.java",
"license": "lgpl-2.1",
"size": 19964
}
|
[
"java.awt.Font",
"javax.swing.plaf.UIResource"
] |
import java.awt.Font; import javax.swing.plaf.UIResource;
|
import java.awt.*; import javax.swing.plaf.*;
|
[
"java.awt",
"javax.swing"
] |
java.awt; javax.swing;
| 1,910,499 |
protected void drawTop(final Graphics2D g2d, final int x, final int y,
final int width, final int height) {
}
|
void function(final Graphics2D g2d, final int x, final int y, final int width, final int height) { }
|
/**
* Draw the entity.
*
* @param g2d
* The graphics context.
* @param x
* The drawn X coordinate.
* @param y
* The drawn Y coordinate.
* @param width
* The drawn entity width.
* @param height
* The drawn entity height.
*/
|
Draw the entity
|
drawTop
|
{
"repo_name": "AntumDeluge/arianne-stendhal",
"path": "src/games/stendhal/client/gui/j2d/entity/Entity2DView.java",
"license": "gpl-2.0",
"size": 23578
}
|
[
"java.awt.Graphics2D"
] |
import java.awt.Graphics2D;
|
import java.awt.*;
|
[
"java.awt"
] |
java.awt;
| 1,473,889 |
private JSONWriter end(char mode, char c) throws JSONException {
if (this.mode != mode) {
throw new JSONException(mode == 'a'
? "Misplaced endArray."
: "Misplaced endObject.");
}
this.pop(mode);
try {
this.writer.write(c);
} catch (IOException e) {
throw new JSONException(e);
}
this.comma = true;
return this;
}
|
JSONWriter function(char mode, char c) throws JSONException { if (this.mode != mode) { throw new JSONException(mode == 'a' ? STR : STR); } this.pop(mode); try { this.writer.write(c); } catch (IOException e) { throw new JSONException(e); } this.comma = true; return this; }
|
/**
* End something.
* @param mode Mode
* @param c Closing character
* @return this
* @throws JSONException If unbalanced.
*/
|
End something
|
end
|
{
"repo_name": "sinofool/wechat-java-sdk",
"path": "src/main/java/net/sinofool/wechat/thirdparty/org/json/JSONWriter.java",
"license": "mit",
"size": 10709
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,136,482 |
private static Map<String, Route> putRoutesIntoMapByRouteId(
List<Route> routes) {
// Convert list of routes to a map keyed on routeId
Map<String, Route> routesMap = new HashMap<String, Route>();
for (Route route : routes) {
routesMap.put(route.getId(), route);
}
return routesMap;
}
|
static Map<String, Route> function( List<Route> routes) { Map<String, Route> routesMap = new HashMap<String, Route>(); for (Route route : routes) { routesMap.put(route.getId(), route); } return routesMap; }
|
/**
* Creates a map of routes keyed by route ID so that can easily find a route
* using its ID.
*
* @param routes
* @return
*/
|
Creates a map of routes keyed by route ID so that can easily find a route using its ID
|
putRoutesIntoMapByRouteId
|
{
"repo_name": "scrudden/core",
"path": "transitime/src/main/java/org/transitime/gtfs/DbConfig.java",
"license": "gpl-3.0",
"size": 33549
}
|
[
"java.util.HashMap",
"java.util.List",
"java.util.Map",
"org.transitime.db.structs.Route"
] |
import java.util.HashMap; import java.util.List; import java.util.Map; import org.transitime.db.structs.Route;
|
import java.util.*; import org.transitime.db.structs.*;
|
[
"java.util",
"org.transitime.db"
] |
java.util; org.transitime.db;
| 503,567 |
public static void invalidateRecentlyAddedAPICache(String username){
try{
PrivilegedCarbonContext.startTenantFlow();
APIManagerConfiguration config = HostObjectComponent.getAPIManagerConfiguration();
boolean isRecentlyAddedAPICacheEnabled =
Boolean.parseBoolean(config.getFirstProperty(APIConstants.API_STORE_RECENTLY_ADDED_API_CACHE_ENABLE));
if (username != null && isRecentlyAddedAPICacheEnabled) {
String tenantDomainFromUserName = MultitenantUtils.getTenantDomain(username);
if (tenantDomainFromUserName != null &&
!MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(tenantDomainFromUserName)) {
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantDomainFromUserName,
true);
} else {
PrivilegedCarbonContext.getThreadLocalCarbonContext()
.setTenantDomain(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME, true);
}
Caching.getCacheManager(APIConstants.API_MANAGER_CACHE_MANAGER).getCache("RECENTLY_ADDED_API")
.remove(username + ":" + tenantDomainFromUserName);
}
} finally {
PrivilegedCarbonContext.endTenantFlow();
}
}
|
static void function(String username){ try{ PrivilegedCarbonContext.startTenantFlow(); APIManagerConfiguration config = HostObjectComponent.getAPIManagerConfiguration(); boolean isRecentlyAddedAPICacheEnabled = Boolean.parseBoolean(config.getFirstProperty(APIConstants.API_STORE_RECENTLY_ADDED_API_CACHE_ENABLE)); if (username != null && isRecentlyAddedAPICacheEnabled) { String tenantDomainFromUserName = MultitenantUtils.getTenantDomain(username); if (tenantDomainFromUserName != null && !MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(tenantDomainFromUserName)) { PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantDomainFromUserName, true); } else { PrivilegedCarbonContext.getThreadLocalCarbonContext() .setTenantDomain(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME, true); } Caching.getCacheManager(APIConstants.API_MANAGER_CACHE_MANAGER).getCache(STR) .remove(username + ":" + tenantDomainFromUserName); } } finally { PrivilegedCarbonContext.endTenantFlow(); } }
|
/**
* This method will clear recently added API cache.
* @param username
*/
|
This method will clear recently added API cache
|
invalidateRecentlyAddedAPICache
|
{
"repo_name": "Arshardh/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/HostObjectUtils.java",
"license": "apache-2.0",
"size": 9019
}
|
[
"javax.cache.Caching",
"org.wso2.carbon.apimgt.hostobjects.internal.HostObjectComponent",
"org.wso2.carbon.apimgt.impl.APIConstants",
"org.wso2.carbon.apimgt.impl.APIManagerConfiguration",
"org.wso2.carbon.context.PrivilegedCarbonContext",
"org.wso2.carbon.utils.multitenancy.MultitenantConstants",
"org.wso2.carbon.utils.multitenancy.MultitenantUtils"
] |
import javax.cache.Caching; import org.wso2.carbon.apimgt.hostobjects.internal.HostObjectComponent; import org.wso2.carbon.apimgt.impl.APIConstants; import org.wso2.carbon.apimgt.impl.APIManagerConfiguration; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
|
import javax.cache.*; import org.wso2.carbon.apimgt.hostobjects.internal.*; import org.wso2.carbon.apimgt.impl.*; import org.wso2.carbon.context.*; import org.wso2.carbon.utils.multitenancy.*;
|
[
"javax.cache",
"org.wso2.carbon"
] |
javax.cache; org.wso2.carbon;
| 2,595,391 |
public static ExplicitReturnTypeInference explicit(RelDataType type) {
return explicit(RelDataTypeImpl.proto(type));
}
|
static ExplicitReturnTypeInference function(RelDataType type) { return explicit(RelDataTypeImpl.proto(type)); }
|
/**
* Creates an inference rule which returns a copy of a given data type.
*/
|
Creates an inference rule which returns a copy of a given data type
|
explicit
|
{
"repo_name": "minji-kim/calcite",
"path": "core/src/main/java/org/apache/calcite/sql/type/ReturnTypes.java",
"license": "apache-2.0",
"size": 31489
}
|
[
"org.apache.calcite.rel.type.RelDataType",
"org.apache.calcite.rel.type.RelDataTypeImpl"
] |
import org.apache.calcite.rel.type.RelDataType; import org.apache.calcite.rel.type.RelDataTypeImpl;
|
import org.apache.calcite.rel.type.*;
|
[
"org.apache.calcite"
] |
org.apache.calcite;
| 1,082,277 |
public static <T> DataTable<T> empty() {
return new BasicDataTable<>(Collections.emptyMap(), () -> VoidKeyBuffer.INSTANCE);
}
|
static <T> DataTable<T> function() { return new BasicDataTable<>(Collections.emptyMap(), () -> VoidKeyBuffer.INSTANCE); }
|
/**
* Returns an empty table.
* @param <T> the data type
* @return an empty table
*/
|
Returns an empty table
|
empty
|
{
"repo_name": "ashigeru/asakusafw-compiler",
"path": "dag/runtime/runtime/src/main/java/com/asakusafw/dag/runtime/table/BasicDataTable.java",
"license": "apache-2.0",
"size": 11323
}
|
[
"com.asakusafw.dag.runtime.adapter.DataTable",
"java.util.Collections"
] |
import com.asakusafw.dag.runtime.adapter.DataTable; import java.util.Collections;
|
import com.asakusafw.dag.runtime.adapter.*; import java.util.*;
|
[
"com.asakusafw.dag",
"java.util"
] |
com.asakusafw.dag; java.util;
| 150,758 |
public static KualiInteger getAppointmentRequestedAmountTotal(List<PendingBudgetConstructionAppointmentFunding> AppointmentFundings) {
KualiInteger appointmentRequestedAmountTotal = KualiInteger.ZERO;
for (PendingBudgetConstructionAppointmentFunding appointmentFunding : AppointmentFundings) {
KualiInteger requestedAmount = appointmentFunding.getAppointmentRequestedAmount();
if (requestedAmount != null) {
appointmentRequestedAmountTotal = appointmentRequestedAmountTotal.add(requestedAmount);
}
}
return appointmentRequestedAmountTotal;
}
|
static KualiInteger function(List<PendingBudgetConstructionAppointmentFunding> AppointmentFundings) { KualiInteger appointmentRequestedAmountTotal = KualiInteger.ZERO; for (PendingBudgetConstructionAppointmentFunding appointmentFunding : AppointmentFundings) { KualiInteger requestedAmount = appointmentFunding.getAppointmentRequestedAmount(); if (requestedAmount != null) { appointmentRequestedAmountTotal = appointmentRequestedAmountTotal.add(requestedAmount); } } return appointmentRequestedAmountTotal; }
|
/**
* calcaulte the total requested amount for the given appointment funding lines
*
* @param AppointmentFundings the given appointment funding lines
* @return the total requested amount for the given appointment funding lines
*/
|
calcaulte the total requested amount for the given appointment funding lines
|
getAppointmentRequestedAmountTotal
|
{
"repo_name": "UniversityOfHawaii/kfs",
"path": "kfs-bc/src/main/java/org/kuali/kfs/module/bc/util/SalarySettingCalculator.java",
"license": "agpl-3.0",
"size": 14523
}
|
[
"java.util.List",
"org.kuali.kfs.module.bc.businessobject.PendingBudgetConstructionAppointmentFunding",
"org.kuali.rice.core.api.util.type.KualiInteger"
] |
import java.util.List; import org.kuali.kfs.module.bc.businessobject.PendingBudgetConstructionAppointmentFunding; import org.kuali.rice.core.api.util.type.KualiInteger;
|
import java.util.*; import org.kuali.kfs.module.bc.businessobject.*; import org.kuali.rice.core.api.util.type.*;
|
[
"java.util",
"org.kuali.kfs",
"org.kuali.rice"
] |
java.util; org.kuali.kfs; org.kuali.rice;
| 2,739,678 |
public void generateFilter(ExpressionClassBuilder ecb,
MethodBuilder mb)
throws StandardException
{
generateExpression( ecb, mb );
}
|
void function(ExpressionClassBuilder ecb, MethodBuilder mb) throws StandardException { generateExpression( ecb, mb ); }
|
/**
* The only reason this routine exists is so that I don't have to change
* the protection on generateExpression() and rototill all of QueryTree.
*
* @param ecb The ExpressionClassBuilder for the class being built
* @param mb The method the expression will go into
*
*
* @exception StandardException Thrown on error
*/
|
The only reason this routine exists is so that I don't have to change the protection on generateExpression() and rototill all of QueryTree
|
generateFilter
|
{
"repo_name": "viaper/DBPlus",
"path": "DerbyHodgepodge/java/engine/org/apache/derby/impl/sql/compile/ValueNode.java",
"license": "apache-2.0",
"size": 43555
}
|
[
"org.apache.derby.iapi.error.StandardException",
"org.apache.derby.iapi.services.compiler.MethodBuilder"
] |
import org.apache.derby.iapi.error.StandardException; import org.apache.derby.iapi.services.compiler.MethodBuilder;
|
import org.apache.derby.iapi.error.*; import org.apache.derby.iapi.services.compiler.*;
|
[
"org.apache.derby"
] |
org.apache.derby;
| 1,179,483 |
public void clear() {
this.cache.clear();
for (Status status : NOT_OK_STATUS_VALUES) {
cacheOfNotOkResults.get(status).clear();
}
}
|
void function() { this.cache.clear(); for (Status status : NOT_OK_STATUS_VALUES) { cacheOfNotOkResults.get(status).clear(); } }
|
/**
* Clear the whole cache
*/
|
Clear the whole cache
|
clear
|
{
"repo_name": "tmaret/sling",
"path": "bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckResultCache.java",
"license": "apache-2.0",
"size": 9921
}
|
[
"org.apache.sling.hc.api.Result"
] |
import org.apache.sling.hc.api.Result;
|
import org.apache.sling.hc.api.*;
|
[
"org.apache.sling"
] |
org.apache.sling;
| 475,293 |
protected void onSubscriberRemoved(ComponentName subscriber) {
}
/**
* Lifecycle method called when the first subscriber is added. This will be called before
* {@link #onSubscriberAdded(ComponentName)}. Sources generally don't need to override this.
* For more details on the source lifecycle, see the discussion in the {@link LiveWallpaperSource}
|
void function(ComponentName subscriber) { } /** * Lifecycle method called when the first subscriber is added. This will be called before * {@link #onSubscriberAdded(ComponentName)}. Sources generally don't need to override this. * For more details on the source lifecycle, see the discussion in the {@link LiveWallpaperSource}
|
/**
* Lifecycle method called when a subscriber is removed. Sources generally don't need to
* override this. For more details on the source lifecycle, see the discussion in the
* {@link LiveWallpaperSource} reference.
*/
|
Lifecycle method called when a subscriber is removed. Sources generally don't need to override this. For more details on the source lifecycle, see the discussion in the <code>LiveWallpaperSource</code> reference
|
onSubscriberRemoved
|
{
"repo_name": "dhootha/ActionLauncherApi",
"path": "api/src/main/java/com/actionlauncher/api/LiveWallpaperSource.java",
"license": "apache-2.0",
"size": 18828
}
|
[
"android.content.ComponentName"
] |
import android.content.ComponentName;
|
import android.content.*;
|
[
"android.content"
] |
android.content;
| 899,206 |
private boolean hasPigArgUseHcat(List<String> pigArgs) {
return pigArgs.contains("-useHCatalog");
}
|
boolean function(List<String> pigArgs) { return pigArgs.contains(STR); }
|
/**
* Check if the pig arguments has -useHCatalog set
* see http://hive.apache.org/docs/hcat_r0.5.0/loadstore.pdf
*/
|
Check if the pig arguments has -useHCatalog set see HREF
|
hasPigArgUseHcat
|
{
"repo_name": "alanfgates/hive",
"path": "hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/PigDelegator.java",
"license": "apache-2.0",
"size": 6446
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,659,334 |
public ManagedCustomerDelegate getManagedCustomerDelegate() {
if (managedCustomerDelegate == null) {
synchronized (this) {
if (managedCustomerDelegate == null) {
managedCustomerDelegate = new ManagedCustomerDelegate(adWordsSession);
}
}
}
return managedCustomerDelegate;
}
|
ManagedCustomerDelegate function() { if (managedCustomerDelegate == null) { synchronized (this) { if (managedCustomerDelegate == null) { managedCustomerDelegate = new ManagedCustomerDelegate(adWordsSession); } } } return managedCustomerDelegate; }
|
/**
* Gets the ManagedCustomerDelegate associated with the{@code adWordsSession}.
*/
|
Gets the ManagedCustomerDelegate associated with theadWordsSession
|
getManagedCustomerDelegate
|
{
"repo_name": "shyTNT/googleads-java-lib",
"path": "modules/adwords_axis_utility_extension/src/main/java/com/google/api/ads/adwords/axis/utility/extension/DelegateLocator.java",
"license": "apache-2.0",
"size": 21889
}
|
[
"com.google.api.ads.adwords.axis.utility.extension.delegates.ManagedCustomerDelegate"
] |
import com.google.api.ads.adwords.axis.utility.extension.delegates.ManagedCustomerDelegate;
|
import com.google.api.ads.adwords.axis.utility.extension.delegates.*;
|
[
"com.google.api"
] |
com.google.api;
| 760,350 |
@Override
public Set<CharSequence> parseContext(ParseContext parseContext, XContentParser parser) throws IOException, ElasticsearchParseException {
if (fieldName != null) {
FieldMapper mapper = parseContext.docMapper().mappers().getMapper(fieldName);
if (!(mapper instanceof GeoPointFieldMapper)) {
throw new ElasticsearchParseException("referenced field must be mapped to geo_point");
}
}
final Set<CharSequence> contexts = new HashSet<>();
Token token = parser.currentToken();
if (token == Token.START_ARRAY) {
token = parser.nextToken();
// Test if value is a single point in <code>[lon, lat]</code> format
if (token == Token.VALUE_NUMBER) {
double lon = parser.doubleValue();
if (parser.nextToken() == Token.VALUE_NUMBER) {
double lat = parser.doubleValue();
if (parser.nextToken() == Token.END_ARRAY) {
contexts.add(stringEncode(lon, lat, precision));
} else {
throw new ElasticsearchParseException("only two values [lon, lat] expected");
}
} else {
throw new ElasticsearchParseException("latitude must be a numeric value");
}
} else {
while (token != Token.END_ARRAY) {
GeoPoint point = GeoUtils.parseGeoPoint(parser);
contexts.add(stringEncode(point.getLon(), point.getLat(), precision));
token = parser.nextToken();
}
}
} else if (token == Token.VALUE_STRING) {
final String geoHash = parser.text();
final CharSequence truncatedGeoHash = geoHash.subSequence(0, Math.min(geoHash.length(), precision));
contexts.add(truncatedGeoHash);
} else {
// or a single location
GeoPoint point = GeoUtils.parseGeoPoint(parser);
contexts.add(stringEncode(point.getLon(), point.getLat(), precision));
}
return contexts;
}
|
Set<CharSequence> function(ParseContext parseContext, XContentParser parser) throws IOException, ElasticsearchParseException { if (fieldName != null) { FieldMapper mapper = parseContext.docMapper().mappers().getMapper(fieldName); if (!(mapper instanceof GeoPointFieldMapper)) { throw new ElasticsearchParseException(STR); } } final Set<CharSequence> contexts = new HashSet<>(); Token token = parser.currentToken(); if (token == Token.START_ARRAY) { token = parser.nextToken(); if (token == Token.VALUE_NUMBER) { double lon = parser.doubleValue(); if (parser.nextToken() == Token.VALUE_NUMBER) { double lat = parser.doubleValue(); if (parser.nextToken() == Token.END_ARRAY) { contexts.add(stringEncode(lon, lat, precision)); } else { throw new ElasticsearchParseException(STR); } } else { throw new ElasticsearchParseException(STR); } } else { while (token != Token.END_ARRAY) { GeoPoint point = GeoUtils.parseGeoPoint(parser); contexts.add(stringEncode(point.getLon(), point.getLat(), precision)); token = parser.nextToken(); } } } else if (token == Token.VALUE_STRING) { final String geoHash = parser.text(); final CharSequence truncatedGeoHash = geoHash.subSequence(0, Math.min(geoHash.length(), precision)); contexts.add(truncatedGeoHash); } else { GeoPoint point = GeoUtils.parseGeoPoint(parser); contexts.add(stringEncode(point.getLon(), point.getLat(), precision)); } return contexts; }
|
/**
* Parse a set of {@link CharSequence} contexts at index-time.
* Acceptable formats:
*
* <ul>
* <li>Array: <pre>[<i><GEO POINT></i>, ..]</pre></li>
* <li>String/Object/Array: <pre>"GEO POINT"</pre></li>
* </ul>
*
* see {@link GeoUtils#parseGeoPoint(String, GeoPoint)} for GEO POINT
*/
|
Parse a set of <code>CharSequence</code> contexts at index-time. Acceptable formats: Array: <code>[<GEO POINT>, ..]</code> String/Object/Array: <code>"GEO POINT"</code> see <code>GeoUtils#parseGeoPoint(String, GeoPoint)</code> for GEO POINT
|
parseContext
|
{
"repo_name": "qwerty4030/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/search/suggest/completion/context/GeoContextMapping.java",
"license": "apache-2.0",
"size": 15482
}
|
[
"java.io.IOException",
"java.util.HashSet",
"java.util.Set",
"org.elasticsearch.ElasticsearchParseException",
"org.elasticsearch.common.geo.GeoPoint",
"org.elasticsearch.common.geo.GeoUtils",
"org.elasticsearch.common.xcontent.XContentParser",
"org.elasticsearch.index.mapper.FieldMapper",
"org.elasticsearch.index.mapper.GeoPointFieldMapper",
"org.elasticsearch.index.mapper.ParseContext"
] |
import java.io.IOException; import java.util.HashSet; import java.util.Set; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.geo.GeoUtils; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.mapper.FieldMapper; import org.elasticsearch.index.mapper.GeoPointFieldMapper; import org.elasticsearch.index.mapper.ParseContext;
|
import java.io.*; import java.util.*; import org.elasticsearch.*; import org.elasticsearch.common.geo.*; import org.elasticsearch.common.xcontent.*; import org.elasticsearch.index.mapper.*;
|
[
"java.io",
"java.util",
"org.elasticsearch",
"org.elasticsearch.common",
"org.elasticsearch.index"
] |
java.io; java.util; org.elasticsearch; org.elasticsearch.common; org.elasticsearch.index;
| 363,743 |
public synchronized CmapTable getCmap() throws IOException
{
CmapTable cmap = (CmapTable)tables.get( CmapTable.TAG );
if (cmap != null && !cmap.getInitialized())
{
readTable(cmap);
}
return cmap;
}
|
synchronized CmapTable function() throws IOException { CmapTable cmap = (CmapTable)tables.get( CmapTable.TAG ); if (cmap != null && !cmap.getInitialized()) { readTable(cmap); } return cmap; }
|
/**
* Get the "cmap" table for this TTF.
*
* @return The "cmap" table.
*/
|
Get the "cmap" table for this TTF
|
getCmap
|
{
"repo_name": "BezrukovM/veraPDF-pdfbox",
"path": "fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java",
"license": "apache-2.0",
"size": 18927
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,606,337 |
public DefaultApplication build() {
checkNotNull(appId, "ID cannot be null");
checkNotNull(version, "Version cannot be null");
checkNotNull(title, "Title cannot be null");
checkNotNull(description, "Description cannot be null");
checkNotNull(origin, "Origin cannot be null");
checkNotNull(category, "Category cannot be null");
checkNotNull(readme, "Readme cannot be null");
checkNotNull(role, "Role cannot be null");
checkNotNull(permissions, "Permissions cannot be null");
checkNotNull(featuresRepo, "Features repo cannot be null");
checkNotNull(features, "Features cannot be null");
checkNotNull(requiredApps, "Required apps cannot be null");
checkArgument(!features.isEmpty(), "There must be at least one feature");
return new DefaultApplication(appId, version, title,
description, origin, category,
url, readme, icon,
role, permissions,
featuresRepo, features,
requiredApps, imageUrl);
}
}
|
DefaultApplication function() { checkNotNull(appId, STR); checkNotNull(version, STR); checkNotNull(title, STR); checkNotNull(description, STR); checkNotNull(origin, STR); checkNotNull(category, STR); checkNotNull(readme, STR); checkNotNull(role, STR); checkNotNull(permissions, STR); checkNotNull(featuresRepo, STR); checkNotNull(features, STR); checkNotNull(requiredApps, STR); checkArgument(!features.isEmpty(), STR); return new DefaultApplication(appId, version, title, description, origin, category, url, readme, icon, role, permissions, featuresRepo, features, requiredApps, imageUrl); } }
|
/**
* Builds a default application object from the gathered parameters.
*
* @return new default application
*/
|
Builds a default application object from the gathered parameters
|
build
|
{
"repo_name": "gkatsikas/onos",
"path": "core/api/src/main/java/org/onosproject/core/DefaultApplication.java",
"license": "apache-2.0",
"size": 17710
}
|
[
"com.google.common.base.Preconditions"
] |
import com.google.common.base.Preconditions;
|
import com.google.common.base.*;
|
[
"com.google.common"
] |
com.google.common;
| 2,535,372 |
private static void offer(ImmutableModel model, double[][] coordinates,
List<Model> acceptedModels, Neighborhood neighborhood,
double minDistance)
{
// TODO: nPreviousChecks could be set > 0, but maybe not necessary.
final int nPreviousChecks = 0;
final int lastAcceptedId = acceptedModels.size() - 1;
final int limit = Math.max(0, lastAcceptedId - nPreviousChecks);
int acceptedId = lastAcceptedId;
boolean isAccepted = true;
for(; acceptedId > limit; acceptedId--) {
if(!isAccepted(model, coordinates, acceptedModels, acceptedId,
neighborhood, minDistance)) {
isAccepted = false;
break;
}
}
if(isAccepted) {
// acceptedId = acceptedId, acceptedId - 1, acceptedId - 2,
// acceptedId - 4, acceptedId - 8, ...
for(int i = 1; acceptedId >= 0; acceptedId -= i, i *= 2) {
if(!isAccepted(model, coordinates, acceptedModels, acceptedId,
neighborhood, minDistance)) {
isAccepted = false;
break;
}
}
if(isAccepted) {
model.attachCoordinates(coordinates);
acceptedModels.add(model);
}
}
}
|
static void function(ImmutableModel model, double[][] coordinates, List<Model> acceptedModels, Neighborhood neighborhood, double minDistance) { final int nPreviousChecks = 0; final int lastAcceptedId = acceptedModels.size() - 1; final int limit = Math.max(0, lastAcceptedId - nPreviousChecks); int acceptedId = lastAcceptedId; boolean isAccepted = true; for(; acceptedId > limit; acceptedId--) { if(!isAccepted(model, coordinates, acceptedModels, acceptedId, neighborhood, minDistance)) { isAccepted = false; break; } } if(isAccepted) { for(int i = 1; acceptedId >= 0; acceptedId -= i, i *= 2) { if(!isAccepted(model, coordinates, acceptedModels, acceptedId, neighborhood, minDistance)) { isAccepted = false; break; } } if(isAccepted) { model.attachCoordinates(coordinates); acceptedModels.add(model); } } }
|
/**
* Performs on-the-fly pruning.
*
* @param model the model to accept (add to <code>acceptedModels</code>) or
* discard.
* @param coordinates the coordinates of <code>model</code>.
* @param acceptedModels the previously accepted models.
* @param neighborhood the neighborhood to use.
* @param minDistance the minimum distance to previously accepted models to
* accept <code>model</code>, as per
* {@link Neighborhood#distance(Model, Model)}.
*/
|
Performs on-the-fly pruning
|
offer
|
{
"repo_name": "mkjensen/barriers",
"path": "src/com/martinkampjensen/thesis/barriers/TrajectoryConstructor.java",
"license": "apache-2.0",
"size": 23679
}
|
[
"com.martinkampjensen.thesis.barriers.neighborhood.Neighborhood",
"com.martinkampjensen.thesis.model.Model",
"com.martinkampjensen.thesis.model.impl.ImmutableModel",
"java.util.List"
] |
import com.martinkampjensen.thesis.barriers.neighborhood.Neighborhood; import com.martinkampjensen.thesis.model.Model; import com.martinkampjensen.thesis.model.impl.ImmutableModel; import java.util.List;
|
import com.martinkampjensen.thesis.barriers.neighborhood.*; import com.martinkampjensen.thesis.model.*; import com.martinkampjensen.thesis.model.impl.*; import java.util.*;
|
[
"com.martinkampjensen.thesis",
"java.util"
] |
com.martinkampjensen.thesis; java.util;
| 1,174,915 |
public static PlotCanvas plot(double[][] data, Line.Style style, Color color) {
return plot(null, data, style, color);
}
|
static PlotCanvas function(double[][] data, Line.Style style, Color color) { return plot(null, data, style, color); }
|
/**
* Create a plot canvas with the poly line plot of given data.
* @param data a n-by-2 or n-by-3 matrix that describes coordinates of points.
* @param style the stroke style of line.
* @param color the color of line.
*/
|
Create a plot canvas with the poly line plot of given data
|
plot
|
{
"repo_name": "wavelets/smile",
"path": "SmilePlot/src/smile/plot/LinePlot.java",
"license": "apache-2.0",
"size": 7956
}
|
[
"java.awt.Color"
] |
import java.awt.Color;
|
import java.awt.*;
|
[
"java.awt"
] |
java.awt;
| 1,306,926 |
void sendTitle(String msg, Player player, int fadeIn, int stay, int fadeOut);
|
void sendTitle(String msg, Player player, int fadeIn, int stay, int fadeOut);
|
/**
* Sends a title to the player.
* @param msg The message to be displayed. (Supports ColorCodes)
* @param player The player it is being sent to.
* @param fadeIn The fadeIn time in ticks (20 ticks per second)
* @param stay The stay time in ticks (20 ticks per second)
* @param fadeOut The fadeOut time in ticks (20 ticks per second)
*/
|
Sends a title to the player
|
sendTitle
|
{
"repo_name": "endercrest/ColorCube",
"path": "ColorCube-Core/src/main/java/com/endercrest/colorcube/handler/TitleHandler.java",
"license": "gpl-3.0",
"size": 4405
}
|
[
"org.bukkit.entity.Player"
] |
import org.bukkit.entity.Player;
|
import org.bukkit.entity.*;
|
[
"org.bukkit.entity"
] |
org.bukkit.entity;
| 735,681 |
public static void putFloat(final String key, final float value) {
final Editor editor = getPreferences().edit();
editor.putFloat(key, value);
editor.apply();
}
|
static void function(final String key, final float value) { final Editor editor = getPreferences().edit(); editor.putFloat(key, value); editor.apply(); }
|
/**
* Stores a float value.
*
* @param key The name of the preference to modify.
* @param value The new value for the preference.
* @see android.content.SharedPreferences.Editor#putFloat(String, float)
*/
|
Stores a float value
|
putFloat
|
{
"repo_name": "Pixplicity/EasyPreferences",
"path": "library/src/main/java/com/pixplicity/easyprefs/library/Prefs.java",
"license": "apache-2.0",
"size": 22380
}
|
[
"android.content.SharedPreferences"
] |
import android.content.SharedPreferences;
|
import android.content.*;
|
[
"android.content"
] |
android.content;
| 2,898,872 |
public synchronized int write(InputStream in) throws IOException {
int readCount = 0;
int inBufferPos = count - filledBufferSum;
int n = in.read(currentBuffer, inBufferPos, currentBuffer.length - inBufferPos);
while (n != -1) {
readCount += n;
inBufferPos += n;
count += n;
if (inBufferPos == currentBuffer.length) {
needNewBuffer(currentBuffer.length);
inBufferPos = 0;
}
n = in.read(currentBuffer, inBufferPos, currentBuffer.length - inBufferPos);
}
return readCount;
}
|
synchronized int function(InputStream in) throws IOException { int readCount = 0; int inBufferPos = count - filledBufferSum; int n = in.read(currentBuffer, inBufferPos, currentBuffer.length - inBufferPos); while (n != -1) { readCount += n; inBufferPos += n; count += n; if (inBufferPos == currentBuffer.length) { needNewBuffer(currentBuffer.length); inBufferPos = 0; } n = in.read(currentBuffer, inBufferPos, currentBuffer.length - inBufferPos); } return readCount; }
|
/**
* Writes the entire contents of the specified input stream to this
* byte stream. Bytes from the input stream are read directly into the
* internal buffers of this streams.
*
* @param in the input stream to read from
* @return total number of bytes read from the input stream
* (and written to this stream)
* @throws IOException if an I/O error occurs while reading the input stream
* @since 1.4
*/
|
Writes the entire contents of the specified input stream to this byte stream. Bytes from the input stream are read directly into the internal buffers of this streams
|
write
|
{
"repo_name": "angelozerr/typescript.java",
"path": "core/ts.core/src/ts/internal/io/output/ByteArrayOutputStream.java",
"license": "mit",
"size": 12462
}
|
[
"java.io.IOException",
"java.io.InputStream"
] |
import java.io.IOException; import java.io.InputStream;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 558,131 |
public void setFixedTextSize(@Dimension int unit, float size) {
Context context = getContext();
Resources resources;
if (context == null) {
resources = Resources.getSystem();
} else {
resources = context.getResources();
}
setTextSize(
Cue.TEXT_SIZE_TYPE_ABSOLUTE,
TypedValue.applyDimension(unit, size, resources.getDisplayMetrics()));
}
|
void function(@Dimension int unit, float size) { Context context = getContext(); Resources resources; if (context == null) { resources = Resources.getSystem(); } else { resources = context.getResources(); } setTextSize( Cue.TEXT_SIZE_TYPE_ABSOLUTE, TypedValue.applyDimension(unit, size, resources.getDisplayMetrics())); }
|
/**
* Set the text size to a given unit and value.
*
* <p>See {@link TypedValue} for the possible dimension units.
*
* @param unit The desired dimension unit.
* @param size The desired size in the given units.
*/
|
Set the text size to a given unit and value. See <code>TypedValue</code> for the possible dimension units
|
setFixedTextSize
|
{
"repo_name": "amzn/exoplayer-amazon-port",
"path": "library/ui/src/main/java/com/google/android/exoplayer2/ui/SubtitleView.java",
"license": "apache-2.0",
"size": 14195
}
|
[
"android.content.Context",
"android.content.res.Resources",
"android.util.TypedValue",
"androidx.annotation.Dimension",
"com.google.android.exoplayer2.text.Cue"
] |
import android.content.Context; import android.content.res.Resources; import android.util.TypedValue; import androidx.annotation.Dimension; import com.google.android.exoplayer2.text.Cue;
|
import android.content.*; import android.content.res.*; import android.util.*; import androidx.annotation.*; import com.google.android.exoplayer2.text.*;
|
[
"android.content",
"android.util",
"androidx.annotation",
"com.google.android"
] |
android.content; android.util; androidx.annotation; com.google.android;
| 2,870,230 |
public void testBuildErrorResponseMessage() {
Response response = RestUtil.buildErrorResponse(Status.BAD_REQUEST, "test");
validateResponse(response, Status.BAD_REQUEST);
JSONObject object = new JSONObject();
JsonUtil.addToJson(object, RestUtil.DEFAULT_ERROR_PROPERTY, JsonUtil.mapError("test"));
assertEquals(response.getEntity(), object.toString());
}
|
void function() { Response response = RestUtil.buildErrorResponse(Status.BAD_REQUEST, "test"); validateResponse(response, Status.BAD_REQUEST); JSONObject object = new JSONObject(); JsonUtil.addToJson(object, RestUtil.DEFAULT_ERROR_PROPERTY, JsonUtil.mapError("test")); assertEquals(response.getEntity(), object.toString()); }
|
/**
* Test build error response message.
*/
|
Test build error response message
|
testBuildErrorResponseMessage
|
{
"repo_name": "SirmaITT/conservation-space-1.7.0",
"path": "docker/sirma-platform/platform/seip-parent/platform/commons/commons-rest/src/test/java/com/sirma/itt/seip/rest/RestUtilTest.java",
"license": "lgpl-3.0",
"size": 2375
}
|
[
"com.sirma.itt.seip.json.JsonUtil",
"com.sirma.itt.seip.rest.RestUtil",
"javax.ws.rs.core.Response",
"org.json.JSONObject",
"org.testng.Assert"
] |
import com.sirma.itt.seip.json.JsonUtil; import com.sirma.itt.seip.rest.RestUtil; import javax.ws.rs.core.Response; import org.json.JSONObject; import org.testng.Assert;
|
import com.sirma.itt.seip.json.*; import com.sirma.itt.seip.rest.*; import javax.ws.rs.core.*; import org.json.*; import org.testng.*;
|
[
"com.sirma.itt",
"javax.ws",
"org.json",
"org.testng"
] |
com.sirma.itt; javax.ws; org.json; org.testng;
| 348,113 |
public Vector<String> getAssociationNames(String scheme, String version) {
Vector<String> association_vec = new Vector<String>();
try {
LexBIGService lbSvc = RemoteServerUtil.createLexBIGService();
CodingSchemeVersionOrTag versionOrTag = new CodingSchemeVersionOrTag();
versionOrTag.setVersion(version);
CodingScheme cs = lbSvc.resolveCodingScheme(scheme, versionOrTag);
SupportedHierarchy[] hierarchies = cs.getMappings().getSupportedHierarchy();
String[] ids = hierarchies[0].getAssociationNames();
for (int i = 0; i < ids.length; i++) {
if (!association_vec.contains(ids[i])) {
association_vec.add(ids[i]);
_logger.debug("AssociationName: " + ids[i]);
}
}
} catch (Exception ex) {
_logger.warn(ex.getMessage());
}
return association_vec;
}
|
Vector<String> function(String scheme, String version) { Vector<String> association_vec = new Vector<String>(); try { LexBIGService lbSvc = RemoteServerUtil.createLexBIGService(); CodingSchemeVersionOrTag versionOrTag = new CodingSchemeVersionOrTag(); versionOrTag.setVersion(version); CodingScheme cs = lbSvc.resolveCodingScheme(scheme, versionOrTag); SupportedHierarchy[] hierarchies = cs.getMappings().getSupportedHierarchy(); String[] ids = hierarchies[0].getAssociationNames(); for (int i = 0; i < ids.length; i++) { if (!association_vec.contains(ids[i])) { association_vec.add(ids[i]); _logger.debug(STR + ids[i]); } } } catch (Exception ex) { _logger.warn(ex.getMessage()); } return association_vec; }
|
/**
* Return a list of Association names
*
* @param scheme
* @param version
* @return
*/
|
Return a list of Association names
|
getAssociationNames
|
{
"repo_name": "NCIP/nci-mapping-tool",
"path": "software/ncimappingtool/src/java/gov/nih/nci/evs/browser/utils/SearchCart.java",
"license": "bsd-3-clause",
"size": 16281
}
|
[
"java.util.Vector"
] |
import java.util.Vector;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,305,041 |
final ArrayList<String> reports = new ArrayList<String>();
reports.add(REPORT_MASTER);
// reports.add(REPORT_VB);
// reports.add(REPORT_NKF);
// reports.add(REPORT_NUTZUNGEN);
// reports.add(REPORT_REBE);
// reports.add(REPORT_VORGAENGE);
// reports.add(REPORT_MIPA);
// reports.add(REPORT_BAUM);
final HashMap<String, JRDataSource> dataSourcesMap = new HashMap<String, JRDataSource>(reports.size());
// dataSourcesMap.put(REPORT_VB, new VerwaltungsBereichDataSource());
// dataSourcesMap.put(REPORT_NKF, new NKFUebersichtDataSource());
// dataSourcesMap.put(REPORT_NUTZUNGEN, new NutzungenDataSource());
// dataSourcesMap.put(REPORT_REBE, new ReBeDataSource());
// dataSourcesMap.put(REPORT_VORGAENGE, new VorgaengeDataSource());
// dataSourcesMap.put(REPORT_MIPA, new MiPaDataSource());
// dataSourcesMap.put(REPORT_BAUM, new BaumDateiDataSource());
dataSourcesMap.put(REPORT_MASTER, new EmptyDataSource(1));
final ReportSwingWorker worker = new ReportSwingWorker(
reports,
dataSourcesMap,
params,
true,
new JFrame(),
"/tmp");
worker.execute();
}
|
final ArrayList<String> reports = new ArrayList<String>(); reports.add(REPORT_MASTER); final HashMap<String, JRDataSource> dataSourcesMap = new HashMap<String, JRDataSource>(reports.size()); dataSourcesMap.put(REPORT_MASTER, new EmptyDataSource(1)); final ReportSwingWorker worker = new ReportSwingWorker( reports, dataSourcesMap, params, true, new JFrame(), "/tmp"); worker.execute(); }
|
/**
* DOCUMENT ME!
*
* @param params currentFS cidsBean DOCUMENT ME!
*/
|
DOCUMENT ME
|
showReport
|
{
"repo_name": "cismet/lagis-client",
"path": "src/main/java/de/cismet/lagis/report/FlurstueckDetailsReport.java",
"license": "gpl-3.0",
"size": 2994
}
|
[
"de.cismet.lagis.report.datasource.EmptyDataSource",
"java.util.ArrayList",
"java.util.HashMap",
"javax.swing.JFrame",
"net.sf.jasperreports.engine.JRDataSource"
] |
import de.cismet.lagis.report.datasource.EmptyDataSource; import java.util.ArrayList; import java.util.HashMap; import javax.swing.JFrame; import net.sf.jasperreports.engine.JRDataSource;
|
import de.cismet.lagis.report.datasource.*; import java.util.*; import javax.swing.*; import net.sf.jasperreports.engine.*;
|
[
"de.cismet.lagis",
"java.util",
"javax.swing",
"net.sf.jasperreports"
] |
de.cismet.lagis; java.util; javax.swing; net.sf.jasperreports;
| 2,876,125 |
public Object addLineHighlight(int line, Color color)
throws BadLocationException {
if (lineHighlightManager==null) {
lineHighlightManager = new LineHighlightManager(this);
}
return lineHighlightManager.addLineHighlight(line, color);
}
/**
* Begins an "atomic edit." All text editing operations between this call
* and the next call to <tt>endAtomicEdit()</tt> will be treated as a
* single operation by the undo manager.<p>
*
* Using this method should be done with great care. You should probably
* wrap the call to <tt>endAtomicEdit()</tt> in a <tt>finally</tt> block:
*
* <pre>
* textArea.beginAtomicEdit();
* try {
* // Do editing
* } finally {
* textArea.endAtomicEdit();
* }
|
Object function(int line, Color color) throws BadLocationException { if (lineHighlightManager==null) { lineHighlightManager = new LineHighlightManager(this); } return lineHighlightManager.addLineHighlight(line, color); } /** * Begins an STR All text editing operations between this call * and the next call to <tt>endAtomicEdit()</tt> will be treated as a * single operation by the undo manager.<p> * * Using this method should be done with great care. You should probably * wrap the call to <tt>endAtomicEdit()</tt> in a <tt>finally</tt> block: * * <pre> * textArea.beginAtomicEdit(); * try { * * } finally { * textArea.endAtomicEdit(); * }
|
/**
* Adds a line highlight.
*
* @param line The line to highlight. This is zero-based.
* @param color The color to highlight the line with.
* @throws BadLocationException If <code>line</code> is an invalid line
* number.
* @see #removeLineHighlight(Object)
* @see #removeAllLineHighlights()
*/
|
Adds a line highlight
|
addLineHighlight
|
{
"repo_name": "fanruan/finereport-design",
"path": "designer_base/src/com/fr/design/gui/syntax/ui/rtextarea/RTextArea.java",
"license": "gpl-3.0",
"size": 50571
}
|
[
"java.awt.Color",
"javax.swing.text.BadLocationException"
] |
import java.awt.Color; import javax.swing.text.BadLocationException;
|
import java.awt.*; import javax.swing.text.*;
|
[
"java.awt",
"javax.swing"
] |
java.awt; javax.swing;
| 1,271,425 |
if (string == null) {
throw new JSONException("Null pointer");
}
if (this.mode == 'o' || this.mode == 'a') {
try {
if (this.comma && this.mode == 'a') {
this.writer.write(',');
}
this.writer.write(string);
} catch (IOException e) {
throw new JSONException(e);
}
if (this.mode == 'o') {
this.mode = 'k';
}
this.comma = true;
return this;
}
throw new JSONException("Value out of sequence.");
}
|
if (string == null) { throw new JSONException(STR); } if (this.mode == 'o' this.mode == 'a') { try { if (this.comma && this.mode == 'a') { this.writer.write(','); } this.writer.write(string); } catch (IOException e) { throw new JSONException(e); } if (this.mode == 'o') { this.mode = 'k'; } this.comma = true; return this; } throw new JSONException(STR); }
|
/**
* Append a value.
* @param string A string value.
* @return this
* @throws JSONException If the value is out of sequence.
*/
|
Append a value
|
append
|
{
"repo_name": "fszeliga/eelserver",
"path": "server/src/org/json/JSONWriter.java",
"license": "gpl-3.0",
"size": 10353
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,748,339 |
static public boolean isHighEndGfx() {
return !isLowRamDeviceStatic() &&
!Resources.getSystem().getBoolean(com.android.internal.R.bool.config_avoidGfxAccel);
}
public static class RecentTaskInfo implements Parcelable {
public int id;
public int persistentId;
public Intent baseIntent;
public ComponentName origActivity;
public CharSequence description;
public int stackId;
public RecentTaskInfo() {
}
|
static boolean function() { return !isLowRamDeviceStatic() && !Resources.getSystem().getBoolean(com.android.internal.R.bool.config_avoidGfxAccel); } public static class RecentTaskInfo implements Parcelable { public int id; public int persistentId; public Intent baseIntent; public ComponentName origActivity; public CharSequence description; public int stackId; public RecentTaskInfo() { }
|
/**
* Used by persistent processes to determine if they are running on a
* higher-end device so should be okay using hardware drawing acceleration
* (which tends to consume a lot more RAM).
* @hide
*/
|
Used by persistent processes to determine if they are running on a higher-end device so should be okay using hardware drawing acceleration (which tends to consume a lot more RAM)
|
isHighEndGfx
|
{
"repo_name": "indashnet/InDashNet.Open.UN2000",
"path": "android/frameworks/base/core/java/android/app/ActivityManager.java",
"license": "apache-2.0",
"size": 83290
}
|
[
"android.content.ComponentName",
"android.content.Intent",
"android.content.res.Resources",
"android.os.Parcelable"
] |
import android.content.ComponentName; import android.content.Intent; import android.content.res.Resources; import android.os.Parcelable;
|
import android.content.*; import android.content.res.*; import android.os.*;
|
[
"android.content",
"android.os"
] |
android.content; android.os;
| 298,041 |
public static Boolean deleteLessonCourse(Long lessonId, CourseType courseType) {
// if [lessonId = null], return false
if (lessonId == null) {
return false;
}
// Get DAO
Connection conn = CommonDAO.getDAO();
try {
// Create SQL
StringBuffer sqlQuery = new StringBuffer();
sqlQuery.append(" DELETE FROM `T_LESSON_COURSE` \n");
sqlQuery.append(" WHERE \n");
sqlQuery.append(" `LESSON_ID` = ? \n");
if (!StringUtil.isNullOrEmpty(courseType)) {
sqlQuery.append(" AND `COURSE_TYPE` = ? \n");
}
// Create Statement
PreparedStatement stmt = conn.prepareStatement(sqlQuery.toString());
// Edit parameter
stmt.setLong(1, lessonId);
if (courseType != null) {
stmt.setString(2, courseType.getCode());
}
// Execute SQL
int cnt = stmt.executeUpdate();
if (cnt > 0) {
return true;
}
} catch(Exception ex) {
ex.printStackTrace();
}
return false;
}
|
static Boolean function(Long lessonId, CourseType courseType) { if (lessonId == null) { return false; } Connection conn = CommonDAO.getDAO(); try { StringBuffer sqlQuery = new StringBuffer(); sqlQuery.append(STR); sqlQuery.append(STR); sqlQuery.append(STR); if (!StringUtil.isNullOrEmpty(courseType)) { sqlQuery.append(STR); } PreparedStatement stmt = conn.prepareStatement(sqlQuery.toString()); stmt.setLong(1, lessonId); if (courseType != null) { stmt.setString(2, courseType.getCode()); } int cnt = stmt.executeUpdate(); if (cnt > 0) { return true; } } catch(Exception ex) { ex.printStackTrace(); } return false; }
|
/**
* Delete LessonCourse
*
* @param lessonId
* @param courseType
* @return Boolean True:Success / False:Fail
*/
|
Delete LessonCourse
|
deleteLessonCourse
|
{
"repo_name": "ttlpolo2008/JapStu",
"path": "SRC/LearnLanguage_Master/src/services/LessonCourseService.java",
"license": "mit",
"size": 5921
}
|
[
"java.sql.Connection",
"java.sql.PreparedStatement"
] |
import java.sql.Connection; import java.sql.PreparedStatement;
|
import java.sql.*;
|
[
"java.sql"
] |
java.sql;
| 1,125,749 |
private static void addSecretVolume(List<Volume> volumeList, CertSecretSource certSecretSource, boolean isOpenShift, String alias) {
String volumeName = alias != null ? alias + '-' + certSecretSource.getSecretName() : certSecretSource.getSecretName();
// skipping if a volume with same name was already added
if (!volumeList.stream().anyMatch(v -> v.getName().equals(volumeName))) {
volumeList.add(VolumeUtils.createSecretVolume(volumeName, certSecretSource.getSecretName(), isOpenShift));
}
}
|
static void function(List<Volume> volumeList, CertSecretSource certSecretSource, boolean isOpenShift, String alias) { String volumeName = alias != null ? alias + '-' + certSecretSource.getSecretName() : certSecretSource.getSecretName(); if (!volumeList.stream().anyMatch(v -> v.getName().equals(volumeName))) { volumeList.add(VolumeUtils.createSecretVolume(volumeName, certSecretSource.getSecretName(), isOpenShift)); } }
|
/**
* Creates the Volumes used for authentication of Kafka client based components, checking that the named volume has not already been
* created.
*
* @param volumeList List where the volume will be added
* @param certSecretSource Represents a certificate inside a Secret
* @param isOpenShift Indicates whether we run on OpenShift or not
* @param alias Alias to reference the Kafka Cluster
*/
|
Creates the Volumes used for authentication of Kafka client based components, checking that the named volume has not already been created
|
addSecretVolume
|
{
"repo_name": "ppatierno/kaas",
"path": "cluster-operator/src/main/java/io/strimzi/operator/cluster/model/VolumeUtils.java",
"license": "apache-2.0",
"size": 20020
}
|
[
"io.fabric8.kubernetes.api.model.Volume",
"io.strimzi.api.kafka.model.CertSecretSource",
"java.util.List"
] |
import io.fabric8.kubernetes.api.model.Volume; import io.strimzi.api.kafka.model.CertSecretSource; import java.util.List;
|
import io.fabric8.kubernetes.api.model.*; import io.strimzi.api.kafka.model.*; import java.util.*;
|
[
"io.fabric8.kubernetes",
"io.strimzi.api",
"java.util"
] |
io.fabric8.kubernetes; io.strimzi.api; java.util;
| 2,811,007 |
Collection<OrganizationalUnit> getOrganizationalUnits();
|
Collection<OrganizationalUnit> getOrganizationalUnits();
|
/**
* Get a list of all OrganizationalUnits the User has access to
* @return
*/
|
Get a list of all OrganizationalUnits the User has access to
|
getOrganizationalUnits
|
{
"repo_name": "cristianonicolai/kie-wb-distributions",
"path": "kie-wb-distribution-home/kie-wb-distribution-home-api/src/main/java/org/kie/workbench/common/screens/home/service/HomeService.java",
"license": "apache-2.0",
"size": 1007
}
|
[
"java.util.Collection",
"org.guvnor.structure.organizationalunit.OrganizationalUnit"
] |
import java.util.Collection; import org.guvnor.structure.organizationalunit.OrganizationalUnit;
|
import java.util.*; import org.guvnor.structure.organizationalunit.*;
|
[
"java.util",
"org.guvnor.structure"
] |
java.util; org.guvnor.structure;
| 1,991,514 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.