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 static String generateResetKey() {
return RandomStringUtils.randomNumeric(DEF_COUNT);
} | static String function() { return RandomStringUtils.randomNumeric(DEF_COUNT); } | /**
* Generates a reset key.
*
* @return the generated reset key
*/ | Generates a reset key | generateResetKey | {
"repo_name": "rootzoll/konfetti-api",
"path": "src/main/java/de/konfetti/utils/RandomUtil.java",
"license": "gpl-3.0",
"size": 1151
} | [
"org.apache.commons.lang3.RandomStringUtils"
] | import org.apache.commons.lang3.RandomStringUtils; | import org.apache.commons.lang3.*; | [
"org.apache.commons"
] | org.apache.commons; | 1,919,616 |
EList<IfcIndexedColourMap> getHasColours();
| EList<IfcIndexedColourMap> getHasColours(); | /**
* Returns the value of the '<em><b>Has Colours</b></em>' reference list.
* The list contents are of type {@link org.bimserver.models.ifc4.IfcIndexedColourMap}.
* It is bidirectional and its opposite is '{@link org.bimserver.models.ifc4.IfcIndexedColourMap#getMappedTo <em>Mapped To</em>}'.
* <!-- begin-u... | Returns the value of the 'Has Colours' reference list. The list contents are of type <code>org.bimserver.models.ifc4.IfcIndexedColourMap</code>. It is bidirectional and its opposite is '<code>org.bimserver.models.ifc4.IfcIndexedColourMap#getMappedTo Mapped To</code>'. If the meaning of the 'Has Colours' reference list ... | getHasColours | {
"repo_name": "opensourceBIM/BIMserver",
"path": "PluginBase/generated/org/bimserver/models/ifc4/IfcTessellatedFaceSet.java",
"license": "agpl-3.0",
"size": 8469
} | [
"org.eclipse.emf.common.util.EList"
] | import org.eclipse.emf.common.util.EList; | import org.eclipse.emf.common.util.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,257,031 |
@Override
protected T doSwitch(int classifierID, EObject theEObject) {
switch (classifierID) {
case mclevflatmcadPackage.MFLAT_MCAD: {
MFlatMCAD mFlatMCAD = (MFlatMCAD)theEObject;
T result = caseMFlatMCAD(mFlatMCAD);
if (result == null) result = caseMMCLEVFLATMCADPackageElement(mFlatMCAD);
if (... | T function(int classifierID, EObject theEObject) { switch (classifierID) { case mclevflatmcadPackage.MFLAT_MCAD: { MFlatMCAD mFlatMCAD = (MFlatMCAD)theEObject; T result = caseMFlatMCAD(mFlatMCAD); if (result == null) result = caseMMCLEVFLATMCADPackageElement(mFlatMCAD); if (result == null) result = caseMCommonPackageRe... | /**
* Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
* @return the first non-null result returned by a <code>caseXXX</code> call.
* @generated
*/ | Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result | doSwitch | {
"repo_name": "parraman/micobs",
"path": "mclev/es.uah.aut.srg.micobs.mclev/src/es/uah/aut/srg/micobs/mclev/mclevflatmcad/util/mclevflatmcadSwitch.java",
"license": "epl-1.0",
"size": 12299
} | [
"es.uah.aut.srg.micobs.mclev.mclevflatmcad.MFlatComponentInstance",
"es.uah.aut.srg.micobs.mclev.mclevflatmcad.MFlatConnection",
"es.uah.aut.srg.micobs.mclev.mclevflatmcad.MFlatDeviceDriverMapping",
"es.uah.aut.srg.micobs.mclev.mclevflatmcad.MFlatDriverSLibInstance",
"es.uah.aut.srg.micobs.mclev.mclevflatmc... | import es.uah.aut.srg.micobs.mclev.mclevflatmcad.MFlatComponentInstance; import es.uah.aut.srg.micobs.mclev.mclevflatmcad.MFlatConnection; import es.uah.aut.srg.micobs.mclev.mclevflatmcad.MFlatDeviceDriverMapping; import es.uah.aut.srg.micobs.mclev.mclevflatmcad.MFlatDriverSLibInstance; import es.uah.aut.srg.micobs.mcl... | import es.uah.aut.srg.micobs.mclev.mclevflatmcad.*; import org.eclipse.emf.ecore.*; | [
"es.uah.aut",
"org.eclipse.emf"
] | es.uah.aut; org.eclipse.emf; | 2,628,903 |
protected void selectSomething() {
int sel = choices.getSelectedIndex();
if ( sel != -1 ) {
Command cmd = cmds.get( choices.getValue( sel ) );
if ( cmd != null ) {
cmd.execute();
ruleModeller.refreshWidget();
}
}
} | void function() { int sel = choices.getSelectedIndex(); if ( sel != -1 ) { Command cmd = cmds.get( choices.getValue( sel ) ); if ( cmd != null ) { cmd.execute(); ruleModeller.refreshWidget(); } } } | /**
* Executed when a selection has been made. Refreshes the underlying
* RuleModeller widget
*/ | Executed when a selection has been made. Refreshes the underlying RuleModeller widget | selectSomething | {
"repo_name": "cristianonicolai/drools-wb",
"path": "drools-wb-screens/drools-wb-guided-rule-editor/drools-wb-guided-rule-editor-client/src/main/java/org/drools/workbench/screens/guided/rule/client/editor/AbstractRuleModellerSelectorPopup.java",
"license": "apache-2.0",
"size": 4018
} | [
"com.google.gwt.user.client.Command"
] | import com.google.gwt.user.client.Command; | import com.google.gwt.user.client.*; | [
"com.google.gwt"
] | com.google.gwt; | 231,190 |
public void print (double number, int fieldSize, int decimalPlaces)
{
double posValue = Math.abs (number);
int placesRemaining = fieldSize;
String format = null, numStr;
StringBuffer padding = new StringBuffer ();
if (number < 0)
placesRemaining--; // Space for the minus sign
... | void function (double number, int fieldSize, int decimalPlaces) { double posValue = Math.abs (number); int placesRemaining = fieldSize; String format = null, numStr; StringBuffer padding = new StringBuffer (); if (number < 0) placesRemaining--; if (posValue < 10.0) format = "0"; else if (posValue < 100.0) format = "00"... | /**
* Write a double precision floating point number (a "double") to
* the file with a specified field size and a specified number of
* decimal places.
*
* @param number The number to be written to the file.
* @param fieldSize The field width that the number is to be written in.
* @param decimalPla... | Write a double precision floating point number (a "double") to the file with a specified field size and a specified number of decimal places | print | {
"repo_name": "salamander2/HSA2",
"path": "hsa2/TextOutputFile.java",
"license": "gpl-2.0",
"size": 22355
} | [
"java.text.DecimalFormat",
"java.text.NumberFormat"
] | import java.text.DecimalFormat; import java.text.NumberFormat; | import java.text.*; | [
"java.text"
] | java.text; | 1,449,533 |
private void lillipop_connect(final WifiConfiguration wifiConfig, final int networkId, final long timeoutMsec) {
Log.i(TAG, "lillipop_connect SSID=" + wifiConfig.SSID + " within " + timeoutMsec);
boolean res;
synchronized (this) {
targetWifiConfiguration = wifiConfig;
... | void function(final WifiConfiguration wifiConfig, final int networkId, final long timeoutMsec) { Log.i(TAG, STR + wifiConfig.SSID + STR + timeoutMsec); boolean res; synchronized (this) { targetWifiConfiguration = wifiConfig; } | /**
* Make the actual connection to the requested Wi-Fi target.
*
* @param wifiConfig
* details of the Wi-Fi access point used by the WifiManger
* @param networkId
* id of the Wi-Fi configuration
* @param timeoutMsec
* period of time in Msec to co... | Make the actual connection to the requested Wi-Fi target | lillipop_connect | {
"repo_name": "octoblu/alljoyn",
"path": "alljoyn/services/onboarding/java/OnboardingManager/android/src/org/alljoyn/onboarding/sdk/OnboardingSDKWifiManager.java",
"license": "isc",
"size": 45776
} | [
"android.net.wifi.WifiConfiguration",
"android.util.Log"
] | import android.net.wifi.WifiConfiguration; import android.util.Log; | import android.net.wifi.*; import android.util.*; | [
"android.net",
"android.util"
] | android.net; android.util; | 2,749,375 |
protected Category getDefaultCategory()
{
return Category.XSS;
} | Category function() { return Category.XSS; } | /**
* DOCUMENT ME!
*
* @return DOCUMENT ME!
*/ | DOCUMENT ME | getDefaultCategory | {
"repo_name": "RIGS-IT/sonar-xanitizer",
"path": "src/test/resources/webgoat/plugin_extracted/trace-xss-1.0/org/owasp/webgoat/plugin/TraceXSS.java",
"license": "apache-2.0",
"size": 10946
} | [
"org.owasp.webgoat.lessons.Category"
] | import org.owasp.webgoat.lessons.Category; | import org.owasp.webgoat.lessons.*; | [
"org.owasp.webgoat"
] | org.owasp.webgoat; | 10,773 |
ListenerRegistration addChildListener(E parent, ElementListener<E> listener); | ListenerRegistration addChildListener(E parent, ElementListener<E> listener); | /**
* Attaches an element listener that listens on children being added to and
* removed from the specified parent. The listener will be removed if the
* element is deleted.
*/ | Attaches an element listener that listens on children being added to and removed from the specified parent. The listener will be removed if the element is deleted | addChildListener | {
"repo_name": "gburd/wave",
"path": "src/org/waveprotocol/wave/model/document/util/DocumentEventRouter.java",
"license": "apache-2.0",
"size": 2169
} | [
"org.waveprotocol.wave.model.util.ElementListener"
] | import org.waveprotocol.wave.model.util.ElementListener; | import org.waveprotocol.wave.model.util.*; | [
"org.waveprotocol.wave"
] | org.waveprotocol.wave; | 1,893,652 |
public void cdata(@Nonnull final String text) throws TagValidationException, CssValidationException, IOException {
// Validate that JSON can be parsed.
if (!this.context.getTagStack().hasAncestor("TEMPLATE")
&& this.context.getTagStack().isScriptTypeJsonChild()) {
try {
... | void function(@Nonnull final String text) throws TagValidationException, CssValidationException, IOException { if (!this.context.getTagStack().hasAncestor(STR) && this.context.getTagStack().isScriptTypeJsonChild()) { try { OBJECT_MAPPER.readTree(text); } catch (JsonProcessingException e) { List<String> params = new Arr... | /**
* Callback for cdata.
*
* @param text the css content to validate
* @throws TagValidationException tag validation exception.
* @throws CssValidationException css validation exception.
* @throws IOException IO exception.
*/ | Callback for cdata | cdata | {
"repo_name": "ampproject/validator-java",
"path": "src/main/java/dev/amp/validator/AMPHtmlHandler.java",
"license": "apache-2.0",
"size": 14647
} | [
"com.fasterxml.jackson.core.JsonProcessingException",
"dev.amp.validator.css.CssValidationException",
"dev.amp.validator.exception.TagValidationException",
"java.io.IOException",
"java.util.ArrayList",
"java.util.List",
"javax.annotation.Nonnull"
] | import com.fasterxml.jackson.core.JsonProcessingException; import dev.amp.validator.css.CssValidationException; import dev.amp.validator.exception.TagValidationException; import java.io.IOException; import java.util.ArrayList; import java.util.List; import javax.annotation.Nonnull; | import com.fasterxml.jackson.core.*; import dev.amp.validator.css.*; import dev.amp.validator.exception.*; import java.io.*; import java.util.*; import javax.annotation.*; | [
"com.fasterxml.jackson",
"dev.amp.validator",
"java.io",
"java.util",
"javax.annotation"
] | com.fasterxml.jackson; dev.amp.validator; java.io; java.util; javax.annotation; | 1,774,543 |
public Observable<ServiceResponse<Page<VirtualNetworkTapInner>>> listNextSinglePageAsync(final String nextPageLink) {
if (nextPageLink == null) {
throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
} | Observable<ServiceResponse<Page<VirtualNetworkTapInner>>> function(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException(STR); } | /**
* Gets all the VirtualNetworkTaps in a subscription.
*
ServiceResponse<PageImpl<VirtualNetworkTapInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList... | Gets all the VirtualNetworkTaps in a subscription | listNextSinglePageAsync | {
"repo_name": "navalev/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/network/v2019_04_01/implementation/VirtualNetworkTapsInner.java",
"license": "mit",
"size": 72534
} | [
"com.microsoft.azure.Page",
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.azure.Page; import com.microsoft.rest.ServiceResponse; | import com.microsoft.azure.*; import com.microsoft.rest.*; | [
"com.microsoft.azure",
"com.microsoft.rest"
] | com.microsoft.azure; com.microsoft.rest; | 373,409 |
public void syncProtocolFundingSourcesWithSpecialReviews() {
String fundingSourceNumber = form.getAwardDocument().getAward().getAwardNumber();
String fundingSourceTypeCode = FundingSourceType.AWARD;
String fundingSourceName = form.getAwardDocument().getAward().getSponsorName();
Strin... | void function() { String fundingSourceNumber = form.getAwardDocument().getAward().getAwardNumber(); String fundingSourceTypeCode = FundingSourceType.AWARD; String fundingSourceName = form.getAwardDocument().getAward().getSponsorName(); String fundingSourceTitle = form.getAwardDocument().getAward().getTitle(); syncProto... | /**
* Synchronizes the information between this Award's Special Reviews and the corresponding Protocol Funding Sources.
*/ | Synchronizes the information between this Award's Special Reviews and the corresponding Protocol Funding Sources | syncProtocolFundingSourcesWithSpecialReviews | {
"repo_name": "vivantech/kc_fixes",
"path": "src/main/java/org/kuali/kra/award/specialreview/SpecialReviewHelper.java",
"license": "apache-2.0",
"size": 3522
} | [
"org.kuali.kra.bo.FundingSourceType"
] | import org.kuali.kra.bo.FundingSourceType; | import org.kuali.kra.bo.*; | [
"org.kuali.kra"
] | org.kuali.kra; | 2,623,368 |
public boolean validateMySection_validateMySectionTitle(MySection mySection, DiagnosticChain diagnostics,
Map<Object, Object> context) {
return mySection.validateMySectionTitle(diagnostics, context);
}
| boolean function(MySection mySection, DiagnosticChain diagnostics, Map<Object, Object> context) { return mySection.validateMySectionTitle(diagnostics, context); } | /**
* Validates the validateMySectionTitle constraint of '<em>My Section</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | Validates the validateMySectionTitle constraint of 'My Section'. | validateMySection_validateMySectionTitle | {
"repo_name": "drbgfc/mdht",
"path": "cda/deprecated/org.openhealthtools.mdht.uml.cda.example/src/org/openhealthtools/mdht/uml/cda/example/util/ExampleValidator.java",
"license": "epl-1.0",
"size": 29681
} | [
"java.util.Map",
"org.eclipse.emf.common.util.DiagnosticChain",
"org.openhealthtools.mdht.uml.cda.example.MySection"
] | import java.util.Map; import org.eclipse.emf.common.util.DiagnosticChain; import org.openhealthtools.mdht.uml.cda.example.MySection; | import java.util.*; import org.eclipse.emf.common.util.*; import org.openhealthtools.mdht.uml.cda.example.*; | [
"java.util",
"org.eclipse.emf",
"org.openhealthtools.mdht"
] | java.util; org.eclipse.emf; org.openhealthtools.mdht; | 2,735,150 |
private JButton makeButton(String image, String cmd, String tip, String name) {
String imageLoc = AbstractMainFrame.SRC_PATH + image + ".png";
JButton button = new JButton(name);
button.setActionCommand(cmd);
button.setToolTipText(tip);
button.addActionListener(this);
try { // image found
butt... | JButton function(String image, String cmd, String tip, String name) { String imageLoc = AbstractMainFrame.SRC_PATH + image + ".png"; JButton button = new JButton(name); button.setActionCommand(cmd); button.setToolTipText(tip); button.addActionListener(this); try { button.setIcon(new ImageIcon(imageLoc, name)); } catch ... | /**
* Create a button with system specified parameters.
*
* @param image the URL of the icon image
* @param cmd the command name of the button
* @param tip the tool tip text
* @param name the name to be displayed
*
* @return the instance of a tool bar button
*/ | Create a button with system specified parameters | makeButton | {
"repo_name": "halayudha/bearded-octo-bugfixes",
"path": "BestPeerDevelop/sg/edu/nus/gui/server/ToolBar.java",
"license": "gpl-3.0",
"size": 4055
} | [
"javax.swing.ImageIcon",
"javax.swing.JButton",
"sg.edu.nus.gui.AbstractMainFrame"
] | import javax.swing.ImageIcon; import javax.swing.JButton; import sg.edu.nus.gui.AbstractMainFrame; | import javax.swing.*; import sg.edu.nus.gui.*; | [
"javax.swing",
"sg.edu.nus"
] | javax.swing; sg.edu.nus; | 1,175,441 |
@SuppressWarnings("unchecked")
@Test(timeout = 5000)
public void testDoesNotWaitForPendingRecordsIfFlushingDisabled() throws Throwable {
final DummyFlinkKafkaProducer<String> producer = new DummyFlinkKafkaProducer<>(
FakeStandardProducerConfig.get(), new KeyedSerializationSchemaWrapper<>(new SimpleStringSchem... | @SuppressWarnings(STR) @Test(timeout = 5000) void function() throws Throwable { final DummyFlinkKafkaProducer<String> producer = new DummyFlinkKafkaProducer<>( FakeStandardProducerConfig.get(), new KeyedSerializationSchemaWrapper<>(new SimpleStringSchema()), null); producer.setFlushOnCheckpoint(false); final KafkaProdu... | /**
* This test is meant to assure that testAtLeastOnceProducer is valid by testing that if flushing is disabled,
* the snapshot method does indeed finishes without waiting for pending records;
* we set a timeout because the test will not finish if the logic is broken.
*/ | This test is meant to assure that testAtLeastOnceProducer is valid by testing that if flushing is disabled, the snapshot method does indeed finishes without waiting for pending records; we set a timeout because the test will not finish if the logic is broken | testDoesNotWaitForPendingRecordsIfFlushingDisabled | {
"repo_name": "greghogan/flink",
"path": "flink-connectors/flink-connector-kafka/src/test/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaProducerBaseTest.java",
"license": "apache-2.0",
"size": 16898
} | [
"java.util.List",
"java.util.Properties",
"org.apache.flink.api.common.serialization.SimpleStringSchema",
"org.apache.flink.core.testutils.MultiShotLatch",
"org.apache.flink.streaming.api.operators.StreamSink",
"org.apache.flink.streaming.connectors.kafka.internals.KeyedSerializationSchemaWrapper",
"org... | import java.util.List; import java.util.Properties; import org.apache.flink.api.common.serialization.SimpleStringSchema; import org.apache.flink.core.testutils.MultiShotLatch; import org.apache.flink.streaming.api.operators.StreamSink; import org.apache.flink.streaming.connectors.kafka.internals.KeyedSerializationSchem... | import java.util.*; import org.apache.flink.api.common.serialization.*; import org.apache.flink.core.testutils.*; import org.apache.flink.streaming.api.operators.*; import org.apache.flink.streaming.connectors.kafka.internals.*; import org.apache.flink.streaming.connectors.kafka.partitioner.*; import org.apache.flink.s... | [
"java.util",
"org.apache.flink",
"org.apache.kafka",
"org.junit",
"org.mockito"
] | java.util; org.apache.flink; org.apache.kafka; org.junit; org.mockito; | 2,624,301 |
@Override
ParameterMode getMode();
/**
* Controls how unbound values for this IN/INOUT parameter registration will be handled prior to
* execution. There are 2 possible options to handle it:<ul>
* <li>bind the NULL to the parameter</li>
* <li>do not bind the NULL to the parameter</li>
* </ul>
... | ParameterMode getMode(); /** * Controls how unbound values for this IN/INOUT parameter registration will be handled prior to * execution. There are 2 possible options to handle it:<ul> * <li>bind the NULL to the parameter</li> * <li>do not bind the NULL to the parameter</li> * </ul> * <p/> * The reason for the distinct... | /**
* Retrieves the parameter "mode" which describes how the parameter is defined in the actual database procedure
* definition (is it an INPUT parameter? An OUTPUT parameter? etc).
*
* @return The parameter mode.
*/ | Retrieves the parameter "mode" which describes how the parameter is defined in the actual database procedure definition (is it an INPUT parameter? An OUTPUT parameter? etc) | getMode | {
"repo_name": "lamsfoundation/lams",
"path": "3rdParty_sources/hibernate-core/org/hibernate/procedure/ParameterRegistration.java",
"license": "gpl-2.0",
"size": 3815
} | [
"javax.persistence.ParameterMode"
] | import javax.persistence.ParameterMode; | import javax.persistence.*; | [
"javax.persistence"
] | javax.persistence; | 89,856 |
private void logTransactionCommit(String redelivered, String ids) {
if ("true".equals(redelivered)) {
// okay its a redelivered message so log at INFO level if rollbackLoggingLevel is INFO or higher
// this allows people to know that the redelivered message was committed this time
... | void function(String redelivered, String ids) { if ("true".equals(redelivered)) { if (rollbackLoggingLevel == LoggingLevel.INFO rollbackLoggingLevel == LoggingLevel.WARN rollbackLoggingLevel == LoggingLevel.ERROR) { log.info(STR, transactionKey, redelivered, ids); return; } } log.debug(STR, transactionKey, redelivered,... | /**
* Logs the transaction commit
*/ | Logs the transaction commit | logTransactionCommit | {
"repo_name": "kevinearls/camel",
"path": "components/camel-spring/src/main/java/org/apache/camel/spring/spi/TransactionErrorHandler.java",
"license": "apache-2.0",
"size": 15816
} | [
"org.apache.camel.LoggingLevel"
] | import org.apache.camel.LoggingLevel; | import org.apache.camel.*; | [
"org.apache.camel"
] | org.apache.camel; | 1,784,213 |
int delete( ProgramStageInstance programStageInstance );
| int delete( ProgramStageInstance programStageInstance ); | /**
* Deletes a {@link TrackedEntityDataValue}.
*
* @param programStageInstance ProgramStageInstance.
*/ | Deletes a <code>TrackedEntityDataValue</code> | delete | {
"repo_name": "troyel/dhis2-core",
"path": "dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueStore.java",
"license": "bsd-3-clause",
"size": 4716
} | [
"org.hisp.dhis.program.ProgramStageInstance"
] | import org.hisp.dhis.program.ProgramStageInstance; | import org.hisp.dhis.program.*; | [
"org.hisp.dhis"
] | org.hisp.dhis; | 1,664,987 |
public List<StampCapacityInner> environmentCapacities() {
return this.environmentCapacities;
} | List<StampCapacityInner> function() { return this.environmentCapacities; } | /**
* Get current total, used, and available worker capacities.
*
* @return the environmentCapacities value
*/ | Get current total, used, and available worker capacities | environmentCapacities | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/appservice/mgmt-v2019_08_01/src/main/java/com/microsoft/azure/management/appservice/v2019_08_01/implementation/AppServiceEnvironmentInner.java",
"license": "mit",
"size": 27475
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 344,969 |
@Override
public String toString() {
Objects.ToStringHelper s = Objects.toStringHelper(this);
if (initialCapacity != UNSET_INT) {
s.add("initialCapacity", initialCapacity);
}
if (concurrencyLevel != UNSET_INT) {
s.add("concurrencyLevel", concurrencyLevel);
}
if (maximumSize != UN... | String function() { Objects.ToStringHelper s = Objects.toStringHelper(this); if (initialCapacity != UNSET_INT) { s.add(STR, initialCapacity); } if (concurrencyLevel != UNSET_INT) { s.add(STR, concurrencyLevel); } if (maximumSize != UNSET_INT) { s.add(STR, maximumSize); } if (maximumWeight != UNSET_INT) { s.add(STR, max... | /**
* Returns a string representation for this CacheBuilder instance. The exact form of the returned
* string is not specified.
*/ | Returns a string representation for this CacheBuilder instance. The exact form of the returned string is not specified | toString | {
"repo_name": "eoneil1942/voltdb-4.7fix",
"path": "third_party/java/src/com/google_voltpatches/common/cache/CacheBuilder.java",
"license": "agpl-3.0",
"size": 38141
} | [
"com.google_voltpatches.common.base.Ascii",
"com.google_voltpatches.common.base.Objects"
] | import com.google_voltpatches.common.base.Ascii; import com.google_voltpatches.common.base.Objects; | import com.google_voltpatches.common.base.*; | [
"com.google_voltpatches.common"
] | com.google_voltpatches.common; | 2,838,435 |
public ResourceNameAvailabilityInner checkNameAvailability(String name, CheckNameResourceTypes type, Boolean isFqdn) {
return checkNameAvailabilityWithServiceResponseAsync(name, type, isFqdn).toBlocking().single().body();
} | ResourceNameAvailabilityInner function(String name, CheckNameResourceTypes type, Boolean isFqdn) { return checkNameAvailabilityWithServiceResponseAsync(name, type, isFqdn).toBlocking().single().body(); } | /**
* Check if a resource name is available.
* Check if a resource name is available.
*
* @param name Resource name to verify.
* @param type Resource type used for verification. Possible values include: 'Site', 'Slot', 'HostingEnvironment'
* @param isFqdn Is fully qualified domain name.
... | Check if a resource name is available. Check if a resource name is available | checkNameAvailability | {
"repo_name": "martinsawicki/azure-sdk-for-java",
"path": "azure-mgmt-appservice/src/main/java/com/microsoft/azure/management/appservice/implementation/WebSiteManagementClientImpl.java",
"license": "mit",
"size": 101428
} | [
"com.microsoft.azure.management.appservice.CheckNameResourceTypes"
] | import com.microsoft.azure.management.appservice.CheckNameResourceTypes; | import com.microsoft.azure.management.appservice.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 535,932 |
public void processPacket(INetHandlerPlayClient handler)
{
handler.handleUseBed(this);
} | void function(INetHandlerPlayClient handler) { handler.handleUseBed(this); } | /**
* Passes this Packet on to the NetHandler for processing.
*/ | Passes this Packet on to the NetHandler for processing | processPacket | {
"repo_name": "TorchPowered/CraftBloom",
"path": "src/net/minecraft/network/play/server/S0APacketUseBed.java",
"license": "mit",
"size": 1354
} | [
"net.minecraft.network.play.INetHandlerPlayClient"
] | import net.minecraft.network.play.INetHandlerPlayClient; | import net.minecraft.network.play.*; | [
"net.minecraft.network"
] | net.minecraft.network; | 1,996,422 |
private static void checkArguments(final Object parent) {
Preconditions.checkNotNull(parent, "IE01920: Parent argument can not be null");
} | static void function(final Object parent) { Preconditions.checkNotNull(parent, STR); } | /**
* Checks whether the arguments are null and throws an exception if they are null.
*
* @param parent Parent window used for dialogs.
*/ | Checks whether the arguments are null and throws an exception if they are null | checkArguments | {
"repo_name": "juneJuly/binnavi",
"path": "src/main/java/com/google/security/zynamics/binnavi/Gui/MainWindow/ProjectTree/Actions/CSearchAction.java",
"license": "apache-2.0",
"size": 3487
} | [
"com.google.common.base.Preconditions"
] | import com.google.common.base.Preconditions; | import com.google.common.base.*; | [
"com.google.common"
] | com.google.common; | 1,350,499 |
private static boolean resolveAndArchiveFile(Path archiveDir, File currentFile,
String archiveStartTime) throws IOException {
// build path as it should be in the archive
String filename = currentFile.getName();
Path archiveFile = new Path(archiveDir, filename);
FileSystem fs = currentFile.getFi... | static boolean function(Path archiveDir, File currentFile, String archiveStartTime) throws IOException { String filename = currentFile.getName(); Path archiveFile = new Path(archiveDir, filename); FileSystem fs = currentFile.getFileSystem(); if (fs.exists(archiveFile)) { if (LOG.isDebugEnabled()) { LOG.debug("File:" + ... | /**
* Attempt to archive the passed in file to the archive directory.
* <p>
* If the same file already exists in the archive, it is moved to a timestamped directory under
* the archive directory and the new file is put in its place.
* @param archiveDir {@link Path} to the directory that stores the archiv... | Attempt to archive the passed in file to the archive directory. If the same file already exists in the archive, it is moved to a timestamped directory under the archive directory and the new file is put in its place | resolveAndArchiveFile | {
"repo_name": "Guavus/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/backup/HFileArchiver.java",
"license": "apache-2.0",
"size": 26785
} | [
"java.io.IOException",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path"
] | import java.io.IOException; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; | import java.io.*; import org.apache.hadoop.fs.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 598,443 |
public Location getLocation() {
return location;
} | Location function() { return location; } | /**
* Returns the current location
*
* @return
*/ | Returns the current location | getLocation | {
"repo_name": "CMPUT301F17T01/Bronzify",
"path": "app/src/main/java/cmput301f17t01/bronzify/models/User.java",
"license": "mit",
"size": 8368
} | [
"android.location.Location"
] | import android.location.Location; | import android.location.*; | [
"android.location"
] | android.location; | 445,954 |
@Override
public ErrorPage findErrorPage(int errorCode) {
if (errorCode == 200) {
return (okErrorPage);
} else {
return (statusPages.get(Integer.valueOf(errorCode)));
}
} | ErrorPage function(int errorCode) { if (errorCode == 200) { return (okErrorPage); } else { return (statusPages.get(Integer.valueOf(errorCode))); } } | /**
* Return the error page entry for the specified HTTP error code,
* if any; otherwise return <code>null</code>.
*
* @param errorCode Error code to look up
*/ | Return the error page entry for the specified HTTP error code, if any; otherwise return <code>null</code> | findErrorPage | {
"repo_name": "xiaolds/tomcat7",
"path": "java/org/apache/catalina/core/StandardContext.java",
"license": "apache-2.0",
"size": 218176
} | [
"org.apache.catalina.deploy.ErrorPage"
] | import org.apache.catalina.deploy.ErrorPage; | import org.apache.catalina.deploy.*; | [
"org.apache.catalina"
] | org.apache.catalina; | 2,064,427 |
@Test(expected = ParseException.class)
public void testBodyNegative03() throws Exception {
TestPerformer testPerformer;
String modelFileName;
String oclFileName;
oclFileName = "constrainttypes/bodyNegative03.ocl";
modelFileName = "testmodel.uml";
testPerformer = TestPerformer.getInstance(
All... | @Test(expected = ParseException.class) void function() throws Exception { TestPerformer testPerformer; String modelFileName; String oclFileName; oclFileName = STR; modelFileName = STR; testPerformer = TestPerformer.getInstance( AllConstraintTypeTests.META_MODEL_ID, AllConstraintTypeTests.MODEL_BUNDLE, AllConstraintType... | /**
* <p>
* A test case to parse a body expression that should not be parsed
* appropriately.
* </p>
*/ | A test case to parse a body expression that should not be parsed appropriately. | testBodyNegative03 | {
"repo_name": "dresden-ocl/dresdenocl",
"path": "tests/org.dresdenocl.ocl2parser.test/src/org/dresdenocl/ocl2parser/test/constrainttypes/TestBody.java",
"license": "lgpl-3.0",
"size": 4730
} | [
"org.dresdenocl.ocl2parser.test.TestPerformer",
"org.dresdenocl.parser.ParseException",
"org.junit.Test"
] | import org.dresdenocl.ocl2parser.test.TestPerformer; import org.dresdenocl.parser.ParseException; import org.junit.Test; | import org.dresdenocl.ocl2parser.test.*; import org.dresdenocl.parser.*; import org.junit.*; | [
"org.dresdenocl.ocl2parser",
"org.dresdenocl.parser",
"org.junit"
] | org.dresdenocl.ocl2parser; org.dresdenocl.parser; org.junit; | 339,335 |
public long getStorageQueuedWriteTaskCount(StorageData storageData) {
try {
StorageData local = getLocalStorageDataObject(storageData);
if (!isStorageOpen(local)) {
return 0;
}
StorageWriter storageWriter = openedStoragesMap.get(local);
if (null == storageWriter) {
return 0;
} else {
... | long function(StorageData storageData) { try { StorageData local = getLocalStorageDataObject(storageData); if (!isStorageOpen(local)) { return 0; } StorageWriter storageWriter = openedStoragesMap.get(local); if (null == storageWriter) { return 0; } else { return storageWriter.getQueuedTaskCount(); } } catch (BusinessEx... | /**
* Returns the amount of writing tasks storage still has to process. Note that this is an
* approximate number.
*
* @param storageData
* Storage data to get information for.
* @return Returns number of queued tasks. Note that if the storage is not in writable mode
* <code>0</code> wi... | Returns the amount of writing tasks storage still has to process. Note that this is an approximate number | getStorageQueuedWriteTaskCount | {
"repo_name": "inspectIT/inspectIT",
"path": "inspectit.server/src/main/java/rocks/inspectit/server/storage/CmrStorageManager.java",
"license": "agpl-3.0",
"size": 42931
} | [
"rocks.inspectit.shared.all.exception.BusinessException",
"rocks.inspectit.shared.cs.storage.StorageData",
"rocks.inspectit.shared.cs.storage.StorageWriter"
] | import rocks.inspectit.shared.all.exception.BusinessException; import rocks.inspectit.shared.cs.storage.StorageData; import rocks.inspectit.shared.cs.storage.StorageWriter; | import rocks.inspectit.shared.all.exception.*; import rocks.inspectit.shared.cs.storage.*; | [
"rocks.inspectit.shared"
] | rocks.inspectit.shared; | 2,488,559 |
private boolean setArcsUp(HashSet<Arc> arcs) throws NullAggContextException, AggEdgeConstructionException {
if (arcs != null && !arcs.isEmpty()) {
for (Arc arc : arcs) {
switch (arc.getType().getName()) {
case "Transition":
addAnAggEdge(new Transition(IOHelper.getRandomString(), arc, this));
... | boolean function(HashSet<Arc> arcs) throws NullAggContextException, AggEdgeConstructionException { if (arcs != null && !arcs.isEmpty()) { for (Arc arc : arcs) { switch (arc.getType().getName()) { case STR: addAnAggEdge(new Transition(IOHelper.getRandomString(), arc, this)); break; default: throw new InconsistentEdgeTyp... | /**
* Sets up the transitions of this DTMC model from a hash set of agg arcs;
* It'll only be called when the nodes were set up ok
*
* @param arcs the underlying agg graph arcs
* @return true if everything ran fine and when there were arcs to setup; false otherwise
* @throws NullAggContextException shoul... | Sets up the transitions of this DTMC model from a hash set of agg arcs; It'll only be called when the nodes were set up ok | setArcsUp | {
"repo_name": "abiliooliveira/UnB-DALi",
"path": "src/main/java/br/unb/dali/models/agg/markovchains/DTMC.java",
"license": "mit",
"size": 8531
} | [
"br.unb.dali.models.agg.exceptions.AggEdgeConstructionException",
"br.unb.dali.models.agg.exceptions.InconsistentEdgeTypeException",
"br.unb.dali.models.agg.exceptions.NullAggContextException",
"br.unb.dali.models.agg.markovchains.dtmc.transitions.Transition",
"br.unb.dali.util.io.IOHelper",
"java.util.Ha... | import br.unb.dali.models.agg.exceptions.AggEdgeConstructionException; import br.unb.dali.models.agg.exceptions.InconsistentEdgeTypeException; import br.unb.dali.models.agg.exceptions.NullAggContextException; import br.unb.dali.models.agg.markovchains.dtmc.transitions.Transition; import br.unb.dali.util.io.IOHelper; im... | import br.unb.dali.models.agg.exceptions.*; import br.unb.dali.models.agg.markovchains.dtmc.transitions.*; import br.unb.dali.util.io.*; import java.util.*; | [
"br.unb.dali",
"java.util"
] | br.unb.dali; java.util; | 1,793,938 |
@Nullable
Match find(Binary haystack, long startPosition, SearchParams params); | Match find(Binary haystack, long startPosition, SearchParams params); | /**
* Searches the binary.
*
* @param haystack the binary being searched.
* @param startPosition the position to start searching from.
* @param params the search parameters.
* @return the found position, or {@code null} if there is no match.
*/ | Searches the binary | find | {
"repo_name": "trejkaz/hex",
"path": "main/src/main/java/org/trypticon/hex/gui/find/Searcher.java",
"license": "gpl-3.0",
"size": 1334
} | [
"org.trypticon.hex.binary.Binary"
] | import org.trypticon.hex.binary.Binary; | import org.trypticon.hex.binary.*; | [
"org.trypticon.hex"
] | org.trypticon.hex; | 2,037,757 |
private void txtaDescriptionFocusGained(final java.awt.event.FocusEvent evt) { //GEN-FIRST:event_txtaDescriptionFocusGained
NbBundle.setBranding(branding);
provideInformation(org.openide.util.NbBundle.getMessage(
BasicPropertiesPanel.class,
"BasicPropertiesPanel.txtaD... | void function(final java.awt.event.FocusEvent evt) { NbBundle.setBranding(branding); provideInformation(org.openide.util.NbBundle.getMessage( BasicPropertiesPanel.class, STR)); NbBundle.setBranding(null); } | /**
* DOCUMENT ME!
*
* @param evt DOCUMENT ME!
*/ | DOCUMENT ME | txtaDescriptionFocusGained | {
"repo_name": "switchonproject/cids-custom-switchon",
"path": "src/main/java/de/cismet/cids/custom/switchon/objecteditors/BasicPropertiesPanel.java",
"license": "lgpl-3.0",
"size": 19772
} | [
"org.openide.util.NbBundle"
] | import org.openide.util.NbBundle; | import org.openide.util.*; | [
"org.openide.util"
] | org.openide.util; | 2,543,539 |
public Scriptable getPeople(String filter, int maxResults)
{
Object[] people = null;
if (filter == null || filter.length() == 0)
{
people = personService.getAllPeople().toArray();
if (maxResults > 0 && people.length > maxResults)
{
... | Scriptable function(String filter, int maxResults) { Object[] people = null; if (filter == null filter.length() == 0) { people = personService.getAllPeople().toArray(); if (maxResults > 0 && people.length > maxResults) { Object[] dest = new Object[maxResults]; System.arraycopy(people, 0, dest, 0, maxResults); people = ... | /**
* Get the collection of people stored in the repository.
* An optional filter query may be provided by which to filter the people collection.
* Space separate the query terms i.e. "john bob" will find all users who's first or
* second names contain the strings "john" or "bob".
*
* @pa... | Get the collection of people stored in the repository. An optional filter query may be provided by which to filter the people collection. Space separate the query terms i.e. "john bob" will find all users who's first or second names contain the strings "john" or "bob" | getPeople | {
"repo_name": "surevine/alfresco-repository-client-customisations",
"path": "source/java/com/surevine/alfresco/repo/jscript/People.java",
"license": "gpl-2.0",
"size": 36669
} | [
"org.alfresco.service.cmr.search.LimitBy",
"org.alfresco.service.cmr.search.ResultSet",
"org.alfresco.service.cmr.search.SearchParameters",
"org.alfresco.service.cmr.search.SearchService",
"org.mozilla.javascript.Context",
"org.mozilla.javascript.Scriptable"
] | import org.alfresco.service.cmr.search.LimitBy; import org.alfresco.service.cmr.search.ResultSet; import org.alfresco.service.cmr.search.SearchParameters; import org.alfresco.service.cmr.search.SearchService; import org.mozilla.javascript.Context; import org.mozilla.javascript.Scriptable; | import org.alfresco.service.cmr.search.*; import org.mozilla.javascript.*; | [
"org.alfresco.service",
"org.mozilla.javascript"
] | org.alfresco.service; org.mozilla.javascript; | 2,385,698 |
public synchronized static IngestManager getInstance() {
if (instance == null) {
instance = new IngestManager();
instance.subscribeToCaseEvents();
}
return instance;
}
private IngestManager() {
this.ingestModuleRunTimes = new Concurr... | synchronized static IngestManager function() { if (instance == null) { instance = new IngestManager(); instance.subscribeToCaseEvents(); } return instance; } private IngestManager() { this.ingestModuleRunTimes = new ConcurrentHashMap<>(); this.ingestThreadActivitySnapshots = new ConcurrentHashMap<>(); this.ingestErrorM... | /**
* Gets the manager of the creation and execution of ingest jobs, i.e., the
* processing of data sources by ingest modules.
*
* @return A singleton ingest manager object.
*/ | Gets the manager of the creation and execution of ingest jobs, i.e., the processing of data sources by ingest modules | getInstance | {
"repo_name": "mhmdfy/autopsy",
"path": "Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java",
"license": "apache-2.0",
"size": 45441
} | [
"com.google.common.util.concurrent.ThreadFactoryBuilder",
"java.util.concurrent.ConcurrentHashMap",
"java.util.concurrent.Executors",
"java.util.concurrent.atomic.AtomicLong",
"org.sleuthkit.autopsy.core.ServicesMonitor",
"org.sleuthkit.autopsy.core.UserPreferences",
"org.sleuthkit.autopsy.events.Autops... | import com.google.common.util.concurrent.ThreadFactoryBuilder; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicLong; import org.sleuthkit.autopsy.core.ServicesMonitor; import org.sleuthkit.autopsy.core.UserPreferences; import org.sleuthkit.a... | import com.google.common.util.concurrent.*; import java.util.concurrent.*; import java.util.concurrent.atomic.*; import org.sleuthkit.autopsy.core.*; import org.sleuthkit.autopsy.events.*; | [
"com.google.common",
"java.util",
"org.sleuthkit.autopsy"
] | com.google.common; java.util; org.sleuthkit.autopsy; | 2,671,821 |
public static boolean updateMeterstand(Meterstanden m){
Session session = HibernateUtil.getSessionFactory().openSession();
try {
Meterstanden mOld = session.get(Meterstanden.class, m.getId());
Meterstanden mNieuw = new Meterstanden();
mNieuw.copyFrom(m);
deleteMeterstand(mOld.getId());
persistMete... | static boolean function(Meterstanden m){ Session session = HibernateUtil.getSessionFactory().openSession(); try { Meterstanden mOld = session.get(Meterstanden.class, m.getId()); Meterstanden mNieuw = new Meterstanden(); mNieuw.copyFrom(m); deleteMeterstand(mOld.getId()); persistMeterstand(mNieuw); } catch(Exception e){... | /**
* Update the meterstand with this one
*
* @param m the meterstand to be updated
* @return true if succes
*/ | Update the meterstand with this one | updateMeterstand | {
"repo_name": "borrob/Meterstanden",
"path": "src/main/java/meterstanden/hibernate/HibernateUtil.java",
"license": "mit",
"size": 7862
} | [
"org.hibernate.Session"
] | import org.hibernate.Session; | import org.hibernate.*; | [
"org.hibernate"
] | org.hibernate; | 236,279 |
public void pushCurrentPlace(Place targetPlace); | void function(Place targetPlace); | /**
* This method can be used to change the URL in the browser without reloading the page.
*
* @param currentPlace
*/ | This method can be used to change the URL in the browser without reloading the page | pushCurrentPlace | {
"repo_name": "Sage-Bionetworks/SynapseWebClient",
"path": "src/main/java/org/sagebionetworks/web/client/GlobalApplicationState.java",
"license": "apache-2.0",
"size": 3121
} | [
"com.google.gwt.place.shared.Place"
] | import com.google.gwt.place.shared.Place; | import com.google.gwt.place.shared.*; | [
"com.google.gwt"
] | com.google.gwt; | 1,059,676 |
protected void clearReferences() {
// De-register any remaining JDBC drivers
clearReferencesJdbc();
// Stop any threads the web application started
clearReferencesThreads();
// Check for leaks triggered by ThreadLocals loaded by this class loader
checkThreadLocalsF... | void function() { clearReferencesJdbc(); clearReferencesThreads(); checkThreadLocalsForLeaks(); clearReferencesRmiTargets(); if (clearReferencesStatic) { clearReferencesStaticFinal(); } IntrospectionUtils.clear(); if (clearReferencesLogFactoryRelease) { org.apache.juli.logging.LogFactory.release(this); } clearReference... | /**
* Clear references.
*/ | Clear references | clearReferences | {
"repo_name": "wenzhucjy/tomcat_source",
"path": "tomcat-7.0.63-sourcecode/target/classes/org/apache/catalina/loader/WebappClassLoader.java",
"license": "apache-2.0",
"size": 125620
} | [
"org.apache.tomcat.util.IntrospectionUtils"
] | import org.apache.tomcat.util.IntrospectionUtils; | import org.apache.tomcat.util.*; | [
"org.apache.tomcat"
] | org.apache.tomcat; | 690,390 |
public List<EventTypeInner> listEventTypes(String resourceGroupName, String providerNamespace, String resourceTypeName, String resourceName) {
return listEventTypesWithServiceResponseAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName).toBlocking().single().body();
} | List<EventTypeInner> function(String resourceGroupName, String providerNamespace, String resourceTypeName, String resourceName) { return listEventTypesWithServiceResponseAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName).toBlocking().single().body(); } | /**
* List topic event types.
* List event types for a topic.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param providerNamespace Namespace of the provider of the topic.
* @param resourceTypeName Name of the topic type.
* @param resou... | List topic event types. List event types for a topic | listEventTypes | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/eventgrid/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_06_01/implementation/TopicsInner.java",
"license": "mit",
"size": 112449
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,732,542 |
public static void saveFile(File file, String contents) {
writeBytesToFile(file, contents.getBytes());
} | static void function(File file, String contents) { writeBytesToFile(file, contents.getBytes()); } | /**
* Writes a string to a file.
*/ | Writes a string to a file | saveFile | {
"repo_name": "Tankernn/AccountManager",
"path": "src/main/java/eu/tankernn/accounts/FileManager.java",
"license": "mit",
"size": 3015
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 1,254,306 |
public synchronized Enumeration enumerateInstances(CIMObjectPath pClassPath,
boolean pDeepInheritance, boolean pLocalOnly, boolean pIncludeQualifiers,
boolean pIncludeClassOrigin, java.lang.String[] pPropertyList) throws CIMException {
Benchmark.startTimer();
preCheck();
Enumeration enumeration = iH... | synchronized Enumeration function(CIMObjectPath pClassPath, boolean pDeepInheritance, boolean pLocalOnly, boolean pIncludeQualifiers, boolean pIncludeClassOrigin, java.lang.String[] pPropertyList) throws CIMException { Benchmark.startTimer(); preCheck(); Enumeration enumeration = iHandle.enumerateInstances(pClassPath, ... | /**
* Enumerates the CIM instances on the target CIM server that are of the
* specified class or its subclasses and returns copies of these instances.
*
* @param pClassPath
* CIM class path to the CIM class whose instances will be
* enumerated. Instances of its subclasses in the... | Enumerates the CIM instances on the target CIM server that are of the specified class or its subclasses and returns copies of these instances | enumerateInstances | {
"repo_name": "acleasby/sblim-cim-client",
"path": "cim-client-java/src/main/java/org/sblim/wbem/client/CIMClient.java",
"license": "epl-1.0",
"size": 203192
} | [
"java.util.Enumeration",
"org.sblim.wbem.cim.CIMException",
"org.sblim.wbem.cim.CIMObjectPath",
"org.sblim.wbem.util.Benchmark"
] | import java.util.Enumeration; import org.sblim.wbem.cim.CIMException; import org.sblim.wbem.cim.CIMObjectPath; import org.sblim.wbem.util.Benchmark; | import java.util.*; import org.sblim.wbem.cim.*; import org.sblim.wbem.util.*; | [
"java.util",
"org.sblim.wbem"
] | java.util; org.sblim.wbem; | 268,012 |
public static List<Integer> quickSort(List<Integer> array){
if(array.isEmpty()) {
return array;
}
else {
List<Integer> answer = new ArrayList<>();
List<Integer> less = new ArrayList<>();
List<Integer> equal = new ArrayList<>();
List<Integer> more = new ArrayList<>();
int pivot = array... | static List<Integer> function(List<Integer> array){ if(array.isEmpty()) { return array; } else { List<Integer> answer = new ArrayList<>(); List<Integer> less = new ArrayList<>(); List<Integer> equal = new ArrayList<>(); List<Integer> more = new ArrayList<>(); int pivot = array.get(0); for(int a: array){ if(a > pivot) m... | /**
* QuickSort algorithm that uses a pivot value and sorts the
* array into 3 groups, items higher, equal and less than the
* pivot. It then combines those groups at the end
* @param list of unsorted integers
* @return sorted list
*/ | QuickSort algorithm that uses a pivot value and sorts the array into 3 groups, items higher, equal and less than the pivot. It then combines those groups at the end | quickSort | {
"repo_name": "bkstamm67/java",
"path": "algos/QuickSort.java",
"license": "mit",
"size": 1766
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,645,411 |
public IAuthorizationPrincipal newPrincipal(String key, Class type) {
final Tuple<String, Class> principalKey = new Tuple<String, Class>(key, type);
final Element element = this.principalCache.get(principalKey);
//principalCache is self populating, it can never return a null entry
return (IAuthorization... | IAuthorizationPrincipal function(String key, Class type) { final Tuple<String, Class> principalKey = new Tuple<String, Class>(key, type); final Element element = this.principalCache.get(principalKey); return (IAuthorizationPrincipal)element.getObjectValue(); } | /**
* Factory method for IAuthorizationPrincipal. First check the principal
* cache, and if not present, create the principal and cache it.
*
* @return org.jasig.portal.security.IAuthorizationPrincipal
* @param key java.lang.String
* @param type java.lang.Class
*/ | Factory method for IAuthorizationPrincipal. First check the principal cache, and if not present, create the principal and cache it | newPrincipal | {
"repo_name": "pspaude/uPortal",
"path": "uportal-war/src/main/java/org/jasig/portal/security/provider/AuthorizationImpl.java",
"license": "apache-2.0",
"size": 38152
} | [
"net.sf.ehcache.Element",
"org.jasig.portal.security.IAuthorizationPrincipal",
"org.jasig.portal.utils.Tuple"
] | import net.sf.ehcache.Element; import org.jasig.portal.security.IAuthorizationPrincipal; import org.jasig.portal.utils.Tuple; | import net.sf.ehcache.*; import org.jasig.portal.security.*; import org.jasig.portal.utils.*; | [
"net.sf.ehcache",
"org.jasig.portal"
] | net.sf.ehcache; org.jasig.portal; | 1,298,950 |
public void setViewportLocationInStorage(int x, int y) {
Activator.getDefault().getDialogSettings().put(getViewportXValueKey(),
x);
Activator.getDefault().getDialogSettings().put(getViewportYValueKey(),
y);
} | void function(int x, int y) { Activator.getDefault().getDialogSettings().put(getViewportXValueKey(), x); Activator.getDefault().getDialogSettings().put(getViewportYValueKey(), y); } | /**
* Convience method for manually setting the persisted scroll values
*/ | Convience method for manually setting the persisted scroll values | setViewportLocationInStorage | {
"repo_name": "nmohamad/bridgepoint",
"path": "src/org.xtuml.bp.ui.graphics/src/org/xtuml/bp/ui/graphics/editor/GraphicalEditor.java",
"license": "apache-2.0",
"size": 53993
} | [
"org.xtuml.bp.ui.graphics.Activator"
] | import org.xtuml.bp.ui.graphics.Activator; | import org.xtuml.bp.ui.graphics.*; | [
"org.xtuml.bp"
] | org.xtuml.bp; | 454,853 |
public UnsignedShort getNumberOfAttempts() {
return this.numberOfAttempts;
} | UnsignedShort function() { return this.numberOfAttempts; } | /**
* get numberOfAttempts of type UnsignedShort.
* @return type UnsignedShort to be set
*/ | get numberOfAttempts of type UnsignedShort | getNumberOfAttempts | {
"repo_name": "yalewkidane/Oliot-FC",
"path": "fc-server/src/main/java/kr/ac/kaist/resl/ltk/generated/parameters/TagObservationTrigger.java",
"license": "lgpl-2.1",
"size": 12733
} | [
"org.llrp.ltk.types.UnsignedShort"
] | import org.llrp.ltk.types.UnsignedShort; | import org.llrp.ltk.types.*; | [
"org.llrp.ltk"
] | org.llrp.ltk; | 2,433,729 |
@Override
public void populate(HttpServletRequest request) {
super.populate(request);
// now run through all of the accounting lines and make sure they've been uppercased and populated appropriately
SpringContext.getBean(BusinessObjectDictionaryService.class).performForceUppercase(getNe... | void function(HttpServletRequest request) { super.populate(request); SpringContext.getBean(BusinessObjectDictionaryService.class).performForceUppercase(getNewAdvanceDeposit()); List<AdvanceDepositDetail> advancedDeposits = getAdvanceDepositDocument().getAdvanceDeposits(); for (AdvanceDepositDetail detail : advancedDepo... | /**
* Overrides the parent to call super.populate and then tells each line to check the associated data dictionary and modify the
* values entered to follow all the attributes set for the values of the accounting line.
*
* @see org.kuali.rice.kns.web.struts.form.KualiTransactionalDocumentFormBase#p... | Overrides the parent to call super.populate and then tells each line to check the associated data dictionary and modify the values entered to follow all the attributes set for the values of the accounting line | populate | {
"repo_name": "Ariah-Group/Finance",
"path": "af_webapp/src/main/java/org/kuali/kfs/fp/document/web/struts/AdvanceDepositForm.java",
"license": "apache-2.0",
"size": 4083
} | [
"java.util.List",
"javax.servlet.http.HttpServletRequest",
"org.kuali.kfs.fp.businessobject.AdvanceDepositDetail",
"org.kuali.kfs.sys.context.SpringContext",
"org.kuali.rice.kns.service.BusinessObjectDictionaryService"
] | import java.util.List; import javax.servlet.http.HttpServletRequest; import org.kuali.kfs.fp.businessobject.AdvanceDepositDetail; import org.kuali.kfs.sys.context.SpringContext; import org.kuali.rice.kns.service.BusinessObjectDictionaryService; | import java.util.*; import javax.servlet.http.*; import org.kuali.kfs.fp.businessobject.*; import org.kuali.kfs.sys.context.*; import org.kuali.rice.kns.service.*; | [
"java.util",
"javax.servlet",
"org.kuali.kfs",
"org.kuali.rice"
] | java.util; javax.servlet; org.kuali.kfs; org.kuali.rice; | 901,041 |
if (configurableListableBeanFactory.containsBean(validatorFactoryBeanName)) {
BeanDefinition validatorFactoryBeanDefinition =
configurableListableBeanFactory.getBeanDefinition(validatorFactoryBeanName);
MutablePropertyValues propertyValues = validatorFactoryBeanDefinition.get... | if (configurableListableBeanFactory.containsBean(validatorFactoryBeanName)) { BeanDefinition validatorFactoryBeanDefinition = configurableListableBeanFactory.getBeanDefinition(validatorFactoryBeanName); MutablePropertyValues propertyValues = validatorFactoryBeanDefinition.getPropertyValues(); PropertyValue propertyValu... | /**
* Adds the validation configuration files to the list already held in the validator factory bean configuration.
* @param configurableListableBeanFactory the bean factory
*/ | Adds the validation configuration files to the list already held in the validator factory bean configuration | postProcessBeanFactory | {
"repo_name": "mkanev/kur2",
"path": "src/main/java/ru/leti/webapp/spring/ValidatorExtensionPostProcessor.java",
"license": "apache-2.0",
"size": 3812
} | [
"java.util.List",
"org.springframework.beans.MutablePropertyValues",
"org.springframework.beans.PropertyValue",
"org.springframework.beans.factory.config.BeanDefinition"
] | import java.util.List; import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.PropertyValue; import org.springframework.beans.factory.config.BeanDefinition; | import java.util.*; import org.springframework.beans.*; import org.springframework.beans.factory.config.*; | [
"java.util",
"org.springframework.beans"
] | java.util; org.springframework.beans; | 2,673,993 |
@Test
public void suspendRequestDebugTargetTerminated() {
final DebugTarget target = DebugPackage.eINSTANCE.getDebugFactory().createDebugTarget();
target.setContext(DebugPackage.eINSTANCE.getDebugFactory().createVariable());
target.setName("target");
target.setState(DebugTargetState.TERMINATED);
createThr... | void function() { final DebugTarget target = DebugPackage.eINSTANCE.getDebugFactory().createDebugTarget(); target.setContext(DebugPackage.eINSTANCE.getDebugFactory().createVariable()); target.setName(STR); target.setState(DebugTargetState.TERMINATED); createThreads(target); try { ThreadUtils.suspendRequest(target.getTh... | /**
* Tests {@link ThreadUtils#suspendRequest(Thread)} in {@link DebugTargetState#TERMINATING}.
*/ | Tests <code>ThreadUtils#suspendRequest(Thread)</code> in <code>DebugTargetState#TERMINATING</code> | suspendRequestDebugTargetTerminated | {
"repo_name": "SiriusLab/SiriusAnimator",
"path": "simulationmodelanimation/tests/org.eclipse.gemoc.dsl.debug.tests/src/org/eclipse/gemoc/dsl/debug/tests/ThreadUtilsTests.java",
"license": "epl-1.0",
"size": 179513
} | [
"org.eclipse.gemoc.dsl.debug.DebugPackage",
"org.eclipse.gemoc.dsl.debug.DebugTarget",
"org.eclipse.gemoc.dsl.debug.DebugTargetState",
"org.eclipse.gemoc.dsl.debug.ThreadUtils",
"org.junit.Assert"
] | import org.eclipse.gemoc.dsl.debug.DebugPackage; import org.eclipse.gemoc.dsl.debug.DebugTarget; import org.eclipse.gemoc.dsl.debug.DebugTargetState; import org.eclipse.gemoc.dsl.debug.ThreadUtils; import org.junit.Assert; | import org.eclipse.gemoc.dsl.debug.*; import org.junit.*; | [
"org.eclipse.gemoc",
"org.junit"
] | org.eclipse.gemoc; org.junit; | 1,920,636 |
public static String getServerID(ConnectionInfo info) {
return getServerID(KaaThriftService.OPERATIONS_SERVICE, info);
} | static String function(ConnectionInfo info) { return getServerID(KaaThriftService.OPERATIONS_SERVICE, info); } | /**
* Build server ID from ConnectionInfo object.
*
* @param info
* ConnectionInfo
* @return server ID in format thriftHost:thriftPort
*/ | Build server ID from ConnectionInfo object | getServerID | {
"repo_name": "Oleh-Kravchenko/kaa",
"path": "server/common/server-shared/src/main/java/org/kaaproject/kaa/server/thrift/Neighbors.java",
"license": "apache-2.0",
"size": 7807
} | [
"org.kaaproject.kaa.server.common.thrift.KaaThriftService",
"org.kaaproject.kaa.server.common.zk.gen.ConnectionInfo"
] | import org.kaaproject.kaa.server.common.thrift.KaaThriftService; import org.kaaproject.kaa.server.common.zk.gen.ConnectionInfo; | import org.kaaproject.kaa.server.common.thrift.*; import org.kaaproject.kaa.server.common.zk.gen.*; | [
"org.kaaproject.kaa"
] | org.kaaproject.kaa; | 132,123 |
public void setRetriesExhaustedLogLevel(LoggingLevel retriesExhaustedLogLevel) {
this.retriesExhaustedLogLevel = retriesExhaustedLogLevel;
} | void function(LoggingLevel retriesExhaustedLogLevel) { this.retriesExhaustedLogLevel = retriesExhaustedLogLevel; } | /**
* Sets the logging level to use for log messages when retries have been exhausted.
*/ | Sets the logging level to use for log messages when retries have been exhausted | setRetriesExhaustedLogLevel | {
"repo_name": "engagepoint/camel",
"path": "camel-core/src/main/java/org/apache/camel/processor/RedeliveryPolicy.java",
"license": "apache-2.0",
"size": 22036
} | [
"org.apache.camel.LoggingLevel"
] | import org.apache.camel.LoggingLevel; | import org.apache.camel.*; | [
"org.apache.camel"
] | org.apache.camel; | 1,529,722 |
public ContentType getContentType() {
return contentType;
} | ContentType function() { return contentType; } | /**
* Gets the Content-Type for the notification.
*
* @return The Content-Type for the notification.
*/ | Gets the Content-Type for the notification | getContentType | {
"repo_name": "Azure/azure-notificationhubs-java-backend",
"path": "NotificationHubs/src/com/windowsazure/messaging/Notification.java",
"license": "apache-2.0",
"size": 6916
} | [
"org.apache.hc.core5.http.ContentType"
] | import org.apache.hc.core5.http.ContentType; | import org.apache.hc.core5.http.*; | [
"org.apache.hc"
] | org.apache.hc; | 2,101,800 |
@Override
public boolean onPrepareOptionsMenu(final Menu menu) {
super.onPrepareOptionsMenu(menu);
final boolean isHistory = type == CacheListType.HISTORY;
final boolean isOffline = type == CacheListType.OFFLINE;
final boolean isEmpty = cacheList.isEmpty();
final boolean... | boolean function(final Menu menu) { super.onPrepareOptionsMenu(menu); final boolean isHistory = type == CacheListType.HISTORY; final boolean isOffline = type == CacheListType.OFFLINE; final boolean isEmpty = cacheList.isEmpty(); final boolean isConcrete = isConcreteList(); final boolean isNonDefaultList = isConcrete &&... | /**
* Menu items which are not at all usable with the current list type should be hidden.
* Menu items which are usable with the current list type but not in the current situation should be disabled.
*/ | Menu items which are not at all usable with the current list type should be hidden. Menu items which are usable with the current list type but not in the current situation should be disabled | onPrepareOptionsMenu | {
"repo_name": "pstorch/cgeo",
"path": "main/src/cgeo/geocaching/CacheListActivity.java",
"license": "apache-2.0",
"size": 84358
} | [
"android.view.Menu",
"java.util.List"
] | import android.view.Menu; import java.util.List; | import android.view.*; import java.util.*; | [
"android.view",
"java.util"
] | android.view; java.util; | 2,720,550 |
public double getEuclideanMetric() {
double sumSq = 0;
for (Entry<Axis, Double> entry : location.entrySet()) {
if (entry.getKey() instanceof ControllerAxis) {
sumSq += Math.pow(entry.getValue(), 2);
}
}
return Math.sqrt(sumSq);
} | double function() { double sumSq = 0; for (Entry<Axis, Double> entry : location.entrySet()) { if (entry.getKey() instanceof ControllerAxis) { sumSq += Math.pow(entry.getValue(), 2); } } return Math.sqrt(sumSq); } | /**
* Returns the Euclidean metric i.e. the distance in N-dimensional space of the AxesLocation from the origin
* i.e. treated as a vector.
*
* @return
*/ | Returns the Euclidean metric i.e. the distance in N-dimensional space of the AxesLocation from the origin i.e. treated as a vector | getEuclideanMetric | {
"repo_name": "openpnp/openpnp",
"path": "src/main/java/org/openpnp/model/AxesLocation.java",
"license": "gpl-3.0",
"size": 23830
} | [
"java.util.Map",
"org.openpnp.spi.Axis",
"org.openpnp.spi.ControllerAxis"
] | import java.util.Map; import org.openpnp.spi.Axis; import org.openpnp.spi.ControllerAxis; | import java.util.*; import org.openpnp.spi.*; | [
"java.util",
"org.openpnp.spi"
] | java.util; org.openpnp.spi; | 2,094,884 |
SwingUtilities.invokeLater(new Runnable() {
| SwingUtilities.invokeLater(new Runnable() { | /**
* Waits for the user to click the Continue button.
*/ | Waits for the user to click the Continue button | waitForUserInput | {
"repo_name": "victorfsf/testing-cin",
"path": "texasholdem/src/main/java/org/ozsoft/texasholdem/gui/ControlPanel.java",
"license": "mit",
"size": 7678
} | [
"javax.swing.SwingUtilities"
] | import javax.swing.SwingUtilities; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 1,190,464 |
private boolean isCompressable() {
// Check if content is not already gzipped
MessageBytes contentEncodingMB =
response.getMimeHeaders().getValue("Content-Encoding");
if ((contentEncodingMB != null)
&& (contentEncodingMB.indexOf("gzip") != -1)) {
... | boolean function() { MessageBytes contentEncodingMB = response.getMimeHeaders().getValue(STR); if ((contentEncodingMB != null) && (contentEncodingMB.indexOf("gzip") != -1)) { return false; } if (compressionLevel == 2) { return true; } long contentLength = response.getContentLengthLong(); if ((contentLength == -1) (cont... | /**
* Check if the resource could be compressed, if the client supports it.
*/ | Check if the resource could be compressed, if the client supports it | isCompressable | {
"repo_name": "pistolove/sourcecode4junit",
"path": "Source4Tomcat/src/org/apache/coyote/http11/AbstractHttp11Processor.java",
"license": "apache-2.0",
"size": 53973
} | [
"org.apache.tomcat.util.buf.MessageBytes"
] | import org.apache.tomcat.util.buf.MessageBytes; | import org.apache.tomcat.util.buf.*; | [
"org.apache.tomcat"
] | org.apache.tomcat; | 2,566,831 |
@VisibleForTesting
static List<XAttr> filterINodeXAttrs(
final List<XAttr> existingXAttrs, final List<XAttr> toFilter,
final List<XAttr> filtered)
throws AccessControlException {
if (existingXAttrs == null || existingXAttrs.isEmpty() ||
toFilter == null || toFilter.isEmpty()) {
ret... | static List<XAttr> filterINodeXAttrs( final List<XAttr> existingXAttrs, final List<XAttr> toFilter, final List<XAttr> filtered) throws AccessControlException { if (existingXAttrs == null existingXAttrs.isEmpty() toFilter == null toFilter.isEmpty()) { return existingXAttrs; } List<XAttr> newXAttrs = Lists.newArrayListWi... | /**
* Filter XAttrs from a list of existing XAttrs. Removes matched XAttrs from
* toFilter and puts them into filtered. Upon completion,
* toFilter contains the filter XAttrs that were not found, while
* fitleredXAttrs contains the XAttrs that were found.
*
* @param existingXAttrs Existing XAttrs to b... | Filter XAttrs from a list of existing XAttrs. Removes matched XAttrs from toFilter and puts them into filtered. Upon completion, toFilter contains the filter XAttrs that were not found, while fitleredXAttrs contains the XAttrs that were found | filterINodeXAttrs | {
"repo_name": "leechoongyon/HadoopSourceAnalyze",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirXAttrOp.java",
"license": "apache-2.0",
"size": 15726
} | [
"com.google.common.base.Preconditions",
"com.google.common.collect.Lists",
"java.util.List",
"java.util.ListIterator",
"org.apache.hadoop.fs.XAttr",
"org.apache.hadoop.security.AccessControlException"
] | import com.google.common.base.Preconditions; import com.google.common.collect.Lists; import java.util.List; import java.util.ListIterator; import org.apache.hadoop.fs.XAttr; import org.apache.hadoop.security.AccessControlException; | import com.google.common.base.*; import com.google.common.collect.*; import java.util.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.security.*; | [
"com.google.common",
"java.util",
"org.apache.hadoop"
] | com.google.common; java.util; org.apache.hadoop; | 964,065 |
@ApiModelProperty(example = "null", value = "When exempt, taxable with zero, suspended, not taxable, this field holds the official code number")
public String getCofinsExemptLegalReasonCode() {
return cofinsExemptLegalReasonCode;
} | @ApiModelProperty(example = "null", value = STR) String function() { return cofinsExemptLegalReasonCode; } | /**
* When exempt, taxable with zero, suspended, not taxable, this field holds the official code number
* @return cofinsExemptLegalReasonCode
**/ | When exempt, taxable with zero, suspended, not taxable, this field holds the official code number | getCofinsExemptLegalReasonCode | {
"repo_name": "Avalara/avataxbr-clients",
"path": "java-client/src/main/java/io/swagger/client/model/CfopConf.java",
"license": "gpl-3.0",
"size": 29385
} | [
"io.swagger.annotations.ApiModelProperty"
] | import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.*; | [
"io.swagger.annotations"
] | io.swagger.annotations; | 856,681 |
void notifyViewAutomaticallyStarted(UniqueId viewProcessId, String autoStartName); | void notifyViewAutomaticallyStarted(UniqueId viewProcessId, String autoStartName); | /**
* Called immediately after a view process has been created.
*
* @param viewProcessId
* the unique identifier of the view process that has been created
* @param autoStartName
* the name of the configuration which was auto-started
*/ | Called immediately after a view process has been created | notifyViewAutomaticallyStarted | {
"repo_name": "McLeodMoores/starling",
"path": "projects/engine/src/main/java/com/opengamma/engine/view/event/ViewProcessorEventListener.java",
"license": "apache-2.0",
"size": 1972
} | [
"com.opengamma.id.UniqueId"
] | import com.opengamma.id.UniqueId; | import com.opengamma.id.*; | [
"com.opengamma.id"
] | com.opengamma.id; | 2,042,783 |
Map<String, String> getServiceEndpoints(); | Map<String, String> getServiceEndpoints(); | /**
* Returns a map of the available services in this region and their
* endpoints. The keys of the map are service abbreviations, as defined in
* {@link ServiceAbbreviations}, and the values are the endpoint URLs.
*
* @return A map of the available services in this region.
*/ | Returns a map of the available services in this region and their endpoints. The keys of the map are service abbreviations, as defined in <code>ServiceAbbreviations</code>, and the values are the endpoint URLs | getServiceEndpoints | {
"repo_name": "zhangzhx/aws-toolkit-eclipse",
"path": "bundles/com.amazonaws.eclipse.core/src/com/amazonaws/eclipse/core/regions/Region.java",
"license": "apache-2.0",
"size": 4348
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 707,750 |
void setViewState(GroupViewState newViewState) {
if (isNull(newViewState) || isNull(newViewState.getGroup().orElse(null))) {
if (nonNull(getGroup())) {
getGroup().getFileIDs().removeListener(filesSyncListener);
}
this.grouping.set(null);
Plat... | void setViewState(GroupViewState newViewState) { if (isNull(newViewState) isNull(newViewState.getGroup().orElse(null))) { if (nonNull(getGroup())) { getGroup().getFileIDs().removeListener(filesSyncListener); } this.grouping.set(null); Platform.runLater(() -> { gridView.getItems().setAll(Collections.emptyList()); setCen... | /**
* assigns a grouping for this pane to represent and initializes grouping
* specific properties and listeners
*
* @param newViewState
*/ | assigns a grouping for this pane to represent and initializes grouping specific properties and listeners | setViewState | {
"repo_name": "esaunders/autopsy",
"path": "ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java",
"license": "apache-2.0",
"size": 38773
} | [
"java.util.Collections",
"java.util.Objects",
"org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupViewMode",
"org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupViewState"
] | import java.util.Collections; import java.util.Objects; import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupViewMode; import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupViewState; | import java.util.*; import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.*; | [
"java.util",
"org.sleuthkit.autopsy"
] | java.util; org.sleuthkit.autopsy; | 1,725,558 |
protected void fireCancelStarted() {
EventQueue.invokeLater(new Runnable() { | void function() { EventQueue.invokeLater(new Runnable() { | /**
* DOCUMENT ME!
*/ | DOCUMENT ME | fireCancelStarted | {
"repo_name": "cismet/belis-client",
"path": "src/main/java/de/cismet/belis/broker/BelisBroker.java",
"license": "gpl-3.0",
"size": 138018
} | [
"java.awt.EventQueue"
] | import java.awt.EventQueue; | import java.awt.*; | [
"java.awt"
] | java.awt; | 69,600 |
private void buildDl_Color_BadColorMap4() {
badColorMap4.addBody(new FileLine("ncolors = 6", 11));
ADLWidget whiteColor = new ADLWidget("dl_color", null, 12);
whiteColor.addBody(new FileLine("r=255", 13));
whiteColor.addBody(new FileLine("g=255", 14));
whiteColor.addBody(new ... | void function() { badColorMap4.addBody(new FileLine(STR, 11)); ADLWidget whiteColor = new ADLWidget(STR, null, 12); whiteColor.addBody(new FileLine("r=255", 13)); whiteColor.addBody(new FileLine("g=255", 14)); whiteColor.addBody(new FileLine("b=255", 15)); whiteColor.addBody(new FileLine(STR, 16)); ADLWidget greyColor ... | /**
* An example of a good color map
*/ | An example of a good color map | buildDl_Color_BadColorMap4 | {
"repo_name": "css-iter/cs-studio",
"path": "applications/apputil/apputil-plugins/org.csstudio.utility.adlParser/test/org/csstudio/utility/adlparser/fileParser/ColorMapTest.java",
"license": "epl-1.0",
"size": 19630
} | [
"org.junit.Test"
] | import org.junit.Test; | import org.junit.*; | [
"org.junit"
] | org.junit; | 287,322 |
protected void addInstanceTypePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_I2_xlarge_instanceType_feature"),
getString("_UI_PropertyDescr... | void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), Ec2Package.eINSTANCE.getI2_xlarge_InstanceType(), true, false, false, ItemPropertyDescriptor.GENE... | /**
* This adds a property descriptor for the Instance Type feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This adds a property descriptor for the Instance Type feature. | addInstanceTypePropertyDescriptor | {
"repo_name": "occiware/Multi-Cloud-Studio",
"path": "plugins/org.eclipse.cmf.occi.multicloud.aws.ec2.edit/src-gen/org/eclipse/cmf/occi/multicloud/aws/ec2/provider/I2_xlargeItemProvider.java",
"license": "epl-1.0",
"size": 6989
} | [
"org.eclipse.cmf.occi.multicloud.aws.ec2.Ec2Package",
"org.eclipse.emf.edit.provider.ComposeableAdapterFactory",
"org.eclipse.emf.edit.provider.ItemPropertyDescriptor"
] | import org.eclipse.cmf.occi.multicloud.aws.ec2.Ec2Package; import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; | import org.eclipse.cmf.occi.multicloud.aws.ec2.*; import org.eclipse.emf.edit.provider.*; | [
"org.eclipse.cmf",
"org.eclipse.emf"
] | org.eclipse.cmf; org.eclipse.emf; | 2,489,276 |
public DNASummary[] getSelected( DBconnection conn,
List libraryIDs,
String queryID )
throws SQLException {
ArrayList found = null;
LibrarySummary[] libraries = null;
LibrarySummary library = null;
ResultSet results = null;
String query =
... | DNASummary[] function( DBconnection conn, List libraryIDs, String queryID ) throws SQLException { ArrayList found = null; LibrarySummary[] libraries = null; LibrarySummary library = null; ResultSet results = null; String query = STR + getTableColumns( STR ) + " " + STR + queryID + STR + STR; conn.setQuery( query ); Ite... | /**
* Retrieves selected libraries as <code>LibrarySummary</code> objects,
* which implement the <code>DNASummary</code> interface, from result set
* using supplied ids. This method is used for downloading information
* for selected objects.
*
* @param conn An active connection to the dat... | Retrieves selected libraries as <code>LibrarySummary</code> objects, which implement the <code>DNASummary</code> interface, from result set using supplied ids. This method is used for downloading information for selected objects | getSelected | {
"repo_name": "tair/tairwebapp",
"path": "src/org/tair/search/dna/LibrarySearcher.java",
"license": "gpl-3.0",
"size": 26002
} | [
"java.sql.ResultSet",
"java.sql.SQLException",
"java.util.ArrayList",
"java.util.Iterator",
"java.util.List",
"org.tair.tfc.DBconnection"
] | import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.tair.tfc.DBconnection; | import java.sql.*; import java.util.*; import org.tair.tfc.*; | [
"java.sql",
"java.util",
"org.tair.tfc"
] | java.sql; java.util; org.tair.tfc; | 118,630 |
public boolean processRealtimeStats(byte[] data) {
HPlusDataRecordRealtime record;
try{
record = new HPlusDataRecordRealtime(data);
} catch(IllegalArgumentException e){
LOG.debug((e.getMessage()));
return false;
}
//Skip duplicated messag... | boolean function(byte[] data) { HPlusDataRecordRealtime record; try{ record = new HPlusDataRecordRealtime(data); } catch(IllegalArgumentException e){ LOG.debug((e.getMessage())); return false; } if(prevRealTimeRecord != null && record.same(prevRealTimeRecord)) return true; prevRealTimeRecord = record; getDevice().setBa... | /**
* Process a message containing real time information
*
* @param data the message from the device
* @return boolean indicating success or fail
*/ | Process a message containing real time information | processRealtimeStats | {
"repo_name": "roidelapluie/Gadgetbridge",
"path": "app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/hplus/HPlusHandlerThread.java",
"license": "agpl-3.0",
"size": 20853
} | [
"android.content.Intent",
"android.support.v4.content.LocalBroadcastManager"
] | import android.content.Intent; import android.support.v4.content.LocalBroadcastManager; | import android.content.*; import android.support.v4.content.*; | [
"android.content",
"android.support"
] | android.content; android.support; | 2,746,183 |
@Override
public TradeHistoryParams createTradeHistoryParams() {
BitcoindeTradeHistoryParams params = new BitcoindeTradeHistoryParams();
params.setState(BitcoindeMyTrade.State.SUCCESSFUL);
return params;
} | TradeHistoryParams function() { BitcoindeTradeHistoryParams params = new BitcoindeTradeHistoryParams(); params.setState(BitcoindeMyTrade.State.SUCCESSFUL); return params; } | /**
* Create trade history parameters with state specified to "Successful"
*
* @return tradeHistoryParams
*/ | Create trade history parameters with state specified to "Successful" | createTradeHistoryParams | {
"repo_name": "stachon/XChange",
"path": "xchange-bitcoinde/src/main/java/org/knowm/xchange/bitcoinde/v4/service/BitcoindeTradeService.java",
"license": "mit",
"size": 6126
} | [
"org.knowm.xchange.bitcoinde.v4.dto.trade.BitcoindeMyTrade",
"org.knowm.xchange.service.trade.params.TradeHistoryParams"
] | import org.knowm.xchange.bitcoinde.v4.dto.trade.BitcoindeMyTrade; import org.knowm.xchange.service.trade.params.TradeHistoryParams; | import org.knowm.xchange.bitcoinde.v4.dto.trade.*; import org.knowm.xchange.service.trade.params.*; | [
"org.knowm.xchange"
] | org.knowm.xchange; | 144,478 |
@Test
public void testSetKeysIndex() {
assertSame(-1, this.model.getKeysIndex());
this.model.setKeysIndex(2);
assertSame(2, this.model.getKeysIndex());
} | void function() { assertSame(-1, this.model.getKeysIndex()); this.model.setKeysIndex(2); assertSame(2, this.model.getKeysIndex()); } | /**
* Test method for {@link ch.unibe.iam.scg.archie.model.ChartModel#setKeysIndex(int)}.
*/ | Test method for <code>ch.unibe.iam.scg.archie.model.ChartModel#setKeysIndex(int)</code> | testSetKeysIndex | {
"repo_name": "DavidGutknecht/elexis-3-base",
"path": "bundles/ch.unibe.iam.scg.archie/src/ch/unibe/iam/scg/archie/tests/ChartModelTest.java",
"license": "epl-1.0",
"size": 8015
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 2,373,334 |
public JSDocInfo getOwnPropertyJSDocInfo(String propertyName) {
return null;
} | JSDocInfo function(String propertyName) { return null; } | /**
* Gets the docInfo on the specified property on this type. This should not
* be done implemented recursively, as you generally need to know exactly on
* which type in the prototype chain the JSDocInfo exists.
*/ | Gets the docInfo on the specified property on this type. This should not be done implemented recursively, as you generally need to know exactly on which type in the prototype chain the JSDocInfo exists | getOwnPropertyJSDocInfo | {
"repo_name": "Dandandan/wikiprogramming",
"path": "jsrepl/tools/closure-compiler/trunk/src/com/google/javascript/rhino/jstype/ObjectType.java",
"license": "mit",
"size": 19192
} | [
"com.google.javascript.rhino.JSDocInfo"
] | import com.google.javascript.rhino.JSDocInfo; | import com.google.javascript.rhino.*; | [
"com.google.javascript"
] | com.google.javascript; | 466,572 |
private void accelerate(float dt) {
if (up) {
float initialVelocity = (float) Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));
if (initialVelocity < maxSpeed) {
dx += MathUtils.cos(orientation) * acceleration * dt;
dy += MathUtils.sin(orientation) * accel... | void function(float dt) { if (up) { float initialVelocity = (float) Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2)); if (initialVelocity < maxSpeed) { dx += MathUtils.cos(orientation) * acceleration * dt; dy += MathUtils.sin(orientation) * acceleration * dt; } acceleratingTimer += dt; if (acceleratingTimer > 0.1f) acceler... | /**
* Acceleration.
* If the Ship velocity is less than its max speed, increase speed.
*
* @param dt Time elapsed
*/ | Acceleration. If the Ship velocity is less than its max speed, increase speed | accelerate | {
"repo_name": "BlueDi/Evolution",
"path": "src/entities/Ship.java",
"license": "mit",
"size": 14360
} | [
"com.badlogic.gdx.math.MathUtils"
] | import com.badlogic.gdx.math.MathUtils; | import com.badlogic.gdx.math.*; | [
"com.badlogic.gdx"
] | com.badlogic.gdx; | 1,178,342 |
EventQueue.invokeLater(new Runnable() {
| EventQueue.invokeLater(new Runnable() { | /**
* Launch the application.
*/ | Launch the application | main | {
"repo_name": "JuanCarbo/POSFiscal",
"path": "src/ui/ListaVentas.java",
"license": "mit",
"size": 6645
} | [
"java.awt.EventQueue"
] | import java.awt.EventQueue; | import java.awt.*; | [
"java.awt"
] | java.awt; | 1,279,801 |
@Test
public void getKey() throws Exception {
KeyStore ks = provider.getKeyStore();
RSAPrivateKey key = (RSAPrivateKey)
ks.getKey("kangaroo", "kangaroo".toCharArray());
Certificate[] chain =
provider.getKeyStore().getCertificateChain("kangaroo");
a... | void function() throws Exception { KeyStore ks = provider.getKeyStore(); RSAPrivateKey key = (RSAPrivateKey) ks.getKey(STR, STR.toCharArray()); Certificate[] chain = provider.getKeyStore().getCertificateChain(STR); assertEquals(1, chain.length); RSAPublicKey pubKey = (RSAPublicKey) chain[0].getPublicKey(); assertEquals... | /**
* Assert that the key is valid, and can be used to verify the cert.
*
* @throws Exception Should not be thrown.
*/ | Assert that the key is valid, and can be used to verify the cert | getKey | {
"repo_name": "kangaroo-server/kangaroo",
"path": "kangaroo-common/src/test/java/net/krotscheck/kangaroo/server/keystore/GeneratedKeystoreProviderTest.java",
"license": "apache-2.0",
"size": 7163
} | [
"java.security.KeyStore",
"java.security.cert.Certificate",
"java.security.interfaces.RSAPrivateKey",
"java.security.interfaces.RSAPublicKey",
"junit.framework.TestCase"
] | import java.security.KeyStore; import java.security.cert.Certificate; import java.security.interfaces.RSAPrivateKey; import java.security.interfaces.RSAPublicKey; import junit.framework.TestCase; | import java.security.*; import java.security.cert.*; import java.security.interfaces.*; import junit.framework.*; | [
"java.security",
"junit.framework"
] | java.security; junit.framework; | 2,548,801 |
private Response.ResponseBuilder createViolationResponse(
Set<ConstraintViolation<?>> violations) {
log.fine("Validation completed. violations found: " + violations.size());
Map<String, String> responseObj = new HashMap<String, String>();
for (ConstraintViolation<?> violation : violations) {
res... | Response.ResponseBuilder function( Set<ConstraintViolation<?>> violations) { log.fine(STR + violations.size()); Map<String, String> responseObj = new HashMap<String, String>(); for (ConstraintViolation<?> violation : violations) { responseObj.put(violation.getPropertyPath().toString(), violation.getMessage()); } return... | /**
* Creates a JAX-RS "Bad Request" response including a map of all violation
* fields, and their message. This can then be used by clients to show
* violations.
*
* @param violations
* A set of violations that needs to be reported
* @return JAX-RS response containing all violations
... | Creates a JAX-RS "Bad Request" response including a map of all violation fields, and their message. This can then be used by clients to show violations | createViolationResponse | {
"repo_name": "uaijug/chronos",
"path": "src/main/java/br/com/uaijug/chronos/blog/resources/PageResource.java",
"license": "gpl-3.0",
"size": 6614
} | [
"java.util.HashMap",
"java.util.Map",
"java.util.Set",
"javax.validation.ConstraintViolation",
"javax.ws.rs.core.Response"
] | import java.util.HashMap; import java.util.Map; import java.util.Set; import javax.validation.ConstraintViolation; import javax.ws.rs.core.Response; | import java.util.*; import javax.validation.*; import javax.ws.rs.core.*; | [
"java.util",
"javax.validation",
"javax.ws"
] | java.util; javax.validation; javax.ws; | 2,790,548 |
public void abortTranslation(PascalErrorCode errorCode, Parser parser) {
// Notify the parser's listeners and then abort.
String fatalText = "FATAL ERROR: " + errorCode.toString();
parser.sendMessage(new Message(SYNTAX_ERROR, new Object[] { 0, 0, "", fatalText }));
System.exit(errorC... | void function(PascalErrorCode errorCode, Parser parser) { String fatalText = STR + errorCode.toString(); parser.sendMessage(new Message(SYNTAX_ERROR, new Object[] { 0, 0, "", fatalText })); System.exit(errorCode.getStatus()); } | /**
* Abort the translation.
*
* @param errorCode the error code.
* @param parser the parser.
*/ | Abort the translation | abortTranslation | {
"repo_name": "zavakid/parser-learning",
"path": "src/main/java/com/zavakid/learn/parser/frontend/pascal/PascalErrorHandler.java",
"license": "apache-2.0",
"size": 1668
} | [
"com.zavakid.learn.parser.frontend.Parser",
"com.zavakid.learn.parser.message.Message"
] | import com.zavakid.learn.parser.frontend.Parser; import com.zavakid.learn.parser.message.Message; | import com.zavakid.learn.parser.frontend.*; import com.zavakid.learn.parser.message.*; | [
"com.zavakid.learn"
] | com.zavakid.learn; | 762,497 |
protected void sendSaslMessage(NegotiationStatus status, byte[] payload) throws TTransportException {
if (payload == null)
payload = new byte[0];
messageHeader[0] = status.getValue();
EncodingUtils.encodeBigEndian(payload.length, messageHeader, STATUS_BYTES);
if (LOGGER.isDebugEnabled())
... | void function(NegotiationStatus status, byte[] payload) throws TTransportException { if (payload == null) payload = new byte[0]; messageHeader[0] = status.getValue(); EncodingUtils.encodeBigEndian(payload.length, messageHeader, STATUS_BYTES); if (LOGGER.isDebugEnabled()) LOGGER.debug(getRole() + STR, status, payload.le... | /**
* Send a complete Thrift SASL message.
*
* @param status
* The status to send.
* @param payload
* The data to send as the payload of this message.
* @throws TTransportException
*/ | Send a complete Thrift SASL message | sendSaslMessage | {
"repo_name": "mapr/impala",
"path": "thirdparty/thrift-0.9.0/lib/java/src/org/apache/thrift/transport/TSaslTransport.java",
"license": "apache-2.0",
"size": 17390
} | [
"org.apache.thrift.EncodingUtils"
] | import org.apache.thrift.EncodingUtils; | import org.apache.thrift.*; | [
"org.apache.thrift"
] | org.apache.thrift; | 1,553,882 |
@XmlElementRef
public DefaultTelephone getElement() {
return DefaultTelephone.castOrCopy(metadata);
} | DefaultTelephone function() { return DefaultTelephone.castOrCopy(metadata); } | /**
* Invoked by JAXB at marshalling time for getting the actual metadata to write
* inside the {@code <cit:CI_Telephone>} XML element.
* This is the value or a copy of the value given in argument to the {@code wrap} method.
*
* @return the metadata to be marshalled.
*/ | Invoked by JAXB at marshalling time for getting the actual metadata to write inside the XML element. This is the value or a copy of the value given in argument to the wrap method | getElement | {
"repo_name": "apache/sis",
"path": "core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_Telephone.java",
"license": "apache-2.0",
"size": 3129
} | [
"org.apache.sis.metadata.iso.citation.DefaultTelephone"
] | import org.apache.sis.metadata.iso.citation.DefaultTelephone; | import org.apache.sis.metadata.iso.citation.*; | [
"org.apache.sis"
] | org.apache.sis; | 134,483 |
public static final void encodeQuotedPrintable (final int b, @Nonnull final NonBlockingByteArrayOutputStream aBAOS)
{
final char cHigh = Character.toUpperCase (StringHelper.getHexChar ((b >> 4) & 0xF));
final char cLow = Character.toUpperCase (StringHelper.getHexChar (b & 0xF));
aBAOS.write (ESCAPE_CHAR... | static final void function (final int b, @Nonnull final NonBlockingByteArrayOutputStream aBAOS) { final char cHigh = Character.toUpperCase (StringHelper.getHexChar ((b >> 4) & 0xF)); final char cLow = Character.toUpperCase (StringHelper.getHexChar (b & 0xF)); aBAOS.write (ESCAPE_CHAR); aBAOS.write (cHigh); aBAOS.write ... | /**
* Encodes byte into its quoted-printable representation.
*
* @param b
* byte to encode
* @param aBAOS
* the buffer to write to
*/ | Encodes byte into its quoted-printable representation | encodeQuotedPrintable | {
"repo_name": "lsimons/phloc-schematron-standalone",
"path": "phloc-commons/src/main/java/com/phloc/commons/codec/QuotedPrintableCodec.java",
"license": "apache-2.0",
"size": 7579
} | [
"com.phloc.commons.io.streams.NonBlockingByteArrayOutputStream",
"com.phloc.commons.string.StringHelper",
"javax.annotation.Nonnull"
] | import com.phloc.commons.io.streams.NonBlockingByteArrayOutputStream; import com.phloc.commons.string.StringHelper; import javax.annotation.Nonnull; | import com.phloc.commons.io.streams.*; import com.phloc.commons.string.*; import javax.annotation.*; | [
"com.phloc.commons",
"javax.annotation"
] | com.phloc.commons; javax.annotation; | 818,533 |
private void buildMap() {
for (Attribute attribute : this.attributes) {
List<Attribute> listAttributes = this.attributesById.get(attribute.getAttributeId());
if (listAttributes == null) {
listAttributes = new ArrayList<Attribute>();
this.attributesById... | void function() { for (Attribute attribute : this.attributes) { List<Attribute> listAttributes = this.attributesById.get(attribute.getAttributeId()); if (listAttributes == null) { listAttributes = new ArrayList<Attribute>(); this.attributesById.put(attribute.getAttributeId(), listAttributes); } listAttributes.add(attri... | /**
* Builds the <code>Map</code> from {@link org.apache.openaz.xacml.api.Identifier}s for XACML AttributeIds
* to {@link org.apache.openaz.xacml.api.Attribute}s.
*/ | Builds the <code>Map</code> from <code>org.apache.openaz.xacml.api.Identifier</code>s for XACML AttributeIds to <code>org.apache.openaz.xacml.api.Attribute</code>s | buildMap | {
"repo_name": "dash-/apache-openaz",
"path": "openaz-xacml/src/main/java/org/apache/openaz/xacml/std/StdMutableAttributeCategory.java",
"license": "apache-2.0",
"size": 7723
} | [
"java.util.ArrayList",
"java.util.Collection",
"java.util.List",
"org.apache.openaz.xacml.api.Attribute",
"org.apache.openaz.xacml.api.AttributeCategory",
"org.apache.openaz.xacml.api.Identifier"
] | import java.util.ArrayList; import java.util.Collection; import java.util.List; import org.apache.openaz.xacml.api.Attribute; import org.apache.openaz.xacml.api.AttributeCategory; import org.apache.openaz.xacml.api.Identifier; | import java.util.*; import org.apache.openaz.xacml.api.*; | [
"java.util",
"org.apache.openaz"
] | java.util; org.apache.openaz; | 2,678,089 |
public double[] value(double x)
throws NoDataException {
// safety check
checkInterpolation();
final double[] value = new double[topDiagonal.get(0).length];
double valueCoeff = 1;
for (int i = 0; i < topDiagonal.size(); ++i) {
double[] dividedDifference ... | double[] function(double x) throws NoDataException { checkInterpolation(); final double[] value = new double[topDiagonal.get(0).length]; double valueCoeff = 1; for (int i = 0; i < topDiagonal.size(); ++i) { double[] dividedDifference = topDiagonal.get(i); for (int k = 0; k < value.length; ++k) { value[k] += dividedDiff... | /** Interpolate value at a specified abscissa.
* <p>
* Calling this method is equivalent to call the {@link PolynomialFunction#value(double)
* value} methods of all polynomials returned by {@link #getPolynomials() getPolynomials},
* except it does not build the intermediate polynomials, so this meth... | Interpolate value at a specified abscissa. Calling this method is equivalent to call the <code>PolynomialFunction#value(double) value</code> methods of all polynomials returned by <code>#getPolynomials() getPolynomials</code>, except it does not build the intermediate polynomials, so this method is faster and numerical... | value | {
"repo_name": "charles-cooper/idylfin",
"path": "src/org/apache/commons/math3/analysis/interpolation/HermiteInterpolator.java",
"license": "apache-2.0",
"size": 9494
} | [
"org.apache.commons.math3.exception.NoDataException"
] | import org.apache.commons.math3.exception.NoDataException; | import org.apache.commons.math3.exception.*; | [
"org.apache.commons"
] | org.apache.commons; | 80,759 |
protected Collection<JcrRepository> repositories() {
if (this.state == State.RUNNING) {
final Lock lock = this.lock.readLock();
try {
lock.lock();
return new ArrayList<JcrRepository>(repositories.values());
} finally {
lock.... | Collection<JcrRepository> function() { if (this.state == State.RUNNING) { final Lock lock = this.lock.readLock(); try { lock.lock(); return new ArrayList<JcrRepository>(repositories.values()); } finally { lock.unlock(); } } return Collections.emptyList(); } | /**
* Returns a copy of the repositories. Note that when returned, not all repositories may be active.
*
* @return a copy of the repositories; never null
*/ | Returns a copy of the repositories. Note that when returned, not all repositories may be active | repositories | {
"repo_name": "pleacu/modeshape",
"path": "modeshape-jcr/src/main/java/org/modeshape/jcr/ModeShapeEngine.java",
"license": "apache-2.0",
"size": 28070
} | [
"java.util.ArrayList",
"java.util.Collection",
"java.util.Collections",
"java.util.concurrent.locks.Lock"
] | import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.concurrent.locks.Lock; | import java.util.*; import java.util.concurrent.locks.*; | [
"java.util"
] | java.util; | 1,758,893 |
@Test
public void testBasico() throws ParametrosNoValidosException {
List<POJOPartida> partidas = new ArrayList<POJOPartida>();
final int CANTIDAD_PARTIDAS = 3;
for (int i = 0; i < CANTIDAD_PARTIDAS; i++) {
partidas.add(new POJOPartida(new POJOCreacionPartida(5, 5, "test"), "... | void function() throws ParametrosNoValidosException { List<POJOPartida> partidas = new ArrayList<POJOPartida>(); final int CANTIDAD_PARTIDAS = 3; for (int i = 0; i < CANTIDAD_PARTIDAS; i++) { partidas.add(new POJOPartida(new POJOCreacionPartida(5, 5, "test"), "juan")); } Gson gson = new Gson(); ControladorListadoPartid... | /**
* Prueba crear un par de partidas y recuperarlas.
* @throws ParametrosNoValidosException
*/ | Prueba crear un par de partidas y recuperarlas | testBasico | {
"repo_name": "nicolassatragno/zombieland",
"path": "zombieland-cliente/test/com/rzg/zombieland/cliente/comunicacion/controlador/ControladorListadoPartidasTest.java",
"license": "lgpl-3.0",
"size": 3047
} | [
"com.google.gson.Gson",
"com.rzg.zombieland.comunes.comunicacion.pojo.POJOCreacionPartida",
"com.rzg.zombieland.comunes.comunicacion.pojo.POJOPartida",
"com.rzg.zombieland.comunes.comunicacion.respuesta.POJOListadoPartidas",
"com.rzg.zombieland.comunes.comunicacion.respuesta.RespuestaGenerica",
"com.rzg.z... | import com.google.gson.Gson; import com.rzg.zombieland.comunes.comunicacion.pojo.POJOCreacionPartida; import com.rzg.zombieland.comunes.comunicacion.pojo.POJOPartida; import com.rzg.zombieland.comunes.comunicacion.respuesta.POJOListadoPartidas; import com.rzg.zombieland.comunes.comunicacion.respuesta.RespuestaGenerica;... | import com.google.gson.*; import com.rzg.zombieland.comunes.comunicacion.pojo.*; import com.rzg.zombieland.comunes.comunicacion.respuesta.*; import com.rzg.zombieland.comunes.misc.*; import java.util.*; import org.junit.*; | [
"com.google.gson",
"com.rzg.zombieland",
"java.util",
"org.junit"
] | com.google.gson; com.rzg.zombieland; java.util; org.junit; | 1,968,499 |
public void show(String title) {
final Display display = new Display(null, true);
voxels.forEach(v -> display.addObject(v.getView()));
display.run();
} | void function(String title) { final Display display = new Display(null, true); voxels.forEach(v -> display.addObject(v.getView())); display.run(); } | /**
* Display voxels in an new Window
* <pre><code>
* Voxel v = new Voxel(new Point(minx, miny, minz), new Point(maxx, maxy, maxz));
* Voxels voxels=new Voxels();
* voxels.add(v);
* final Display display = new Display(null, true);
* voxels.forEach(v -> display.addObject(v.getView()))... | Display voxels in an new Window <code><code> Voxel v = new Voxel(new Point(minx, miny, minz), new Point(maxx, maxy, maxz)); Voxels voxels=new Voxels(); voxels.add(v); final Display display = new Display(null, true); voxels.forEach(v -> display.addObject(v.getView())); display.run(); </code></code> | show | {
"repo_name": "JJponciano/JavaPointCloud",
"path": "src/main/java/info/ponciano/lab/jpc/pointcloud/stucture/octree/Voxels.java",
"license": "lgpl-3.0",
"size": 7308
} | [
"info.ponciano.lab.jpc.opengl.Display"
] | import info.ponciano.lab.jpc.opengl.Display; | import info.ponciano.lab.jpc.opengl.*; | [
"info.ponciano.lab"
] | info.ponciano.lab; | 2,330,061 |
public static boolean hasTransientState(@NonNull View view) {
if (Build.VERSION.SDK_INT >= 16) {
return Api16Impl.hasTransientState(view);
}
return false;
} | static boolean function(@NonNull View view) { if (Build.VERSION.SDK_INT >= 16) { return Api16Impl.hasTransientState(view); } return false; } | /**
* Indicates whether the view is currently tracking transient state that the
* app should not need to concern itself with saving and restoring, but that
* the framework should take special note to preserve when possible.
*
* @param view View to check for transient state
* @return true i... | Indicates whether the view is currently tracking transient state that the app should not need to concern itself with saving and restoring, but that the framework should take special note to preserve when possible | hasTransientState | {
"repo_name": "AndroidX/androidx",
"path": "core/core/src/main/java/androidx/core/view/ViewCompat.java",
"license": "apache-2.0",
"size": 224652
} | [
"android.os.Build",
"android.view.View",
"androidx.annotation.NonNull"
] | import android.os.Build; import android.view.View; import androidx.annotation.NonNull; | import android.os.*; import android.view.*; import androidx.annotation.*; | [
"android.os",
"android.view",
"androidx.annotation"
] | android.os; android.view; androidx.annotation; | 605,199 |
public BastionHostIPConfiguration withPublicIPAddress(SubResource publicIPAddress) {
this.publicIPAddress = publicIPAddress;
return this;
} | BastionHostIPConfiguration function(SubResource publicIPAddress) { this.publicIPAddress = publicIPAddress; return this; } | /**
* Set reference of the PublicIP resource.
*
* @param publicIPAddress the publicIPAddress value to set
* @return the BastionHostIPConfiguration object itself.
*/ | Set reference of the PublicIP resource | withPublicIPAddress | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/network/v2019_04_01/BastionHostIPConfiguration.java",
"license": "mit",
"size": 5038
} | [
"com.microsoft.azure.SubResource"
] | import com.microsoft.azure.SubResource; | import com.microsoft.azure.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 235,387 |
public DemoBuilder addComponent(Object parent, String target,
ModelComponent componentToAdd) {
effect(parent, makeAddComponent(target, componentToAdd));
return this;
}
// //////////////////////////////////////////////////////////
// Methods for making model pieces (do not modify entities)
// ////////////... | DemoBuilder function(Object parent, String target, ModelComponent componentToAdd) { effect(parent, makeAddComponent(target, componentToAdd)); return this; } /** * Creates a * {@link es.eucm.ead.schema.effects.controlstructures.ControlStructure} * effect of the given type ({@code clazz} ) with the given * {@code conditi... | /**
* Creates an {@link es.eucm.ead.schema.effects.AddComponent} effect with
* the given {@code target} and {@code componentToAdd} and adds it to the
* given {@code parent} container. For container supported types, see
* {@link #effect(Object, es.eucm.ead.schema.effects.Effect)}.
*/ | Creates an <code>es.eucm.ead.schema.effects.AddComponent</code> effect with the given target and componentToAdd and adds it to the given parent container. For container supported types, see <code>#effect(Object, es.eucm.ead.schema.effects.Effect)</code> | addComponent | {
"repo_name": "gorco/ead",
"path": "editor/desktop/src/main/java/es/eucm/ead/editor/demobuilder/DemoBuilder.java",
"license": "gpl-3.0",
"size": 43690
} | [
"es.eucm.ead.schema.components.ModelComponent",
"es.eucm.ead.schema.effects.controlstructures.ControlStructure"
] | import es.eucm.ead.schema.components.ModelComponent; import es.eucm.ead.schema.effects.controlstructures.ControlStructure; | import es.eucm.ead.schema.components.*; import es.eucm.ead.schema.effects.controlstructures.*; | [
"es.eucm.ead"
] | es.eucm.ead; | 1,037,172 |
void remove(SecurableResourceId resourceId, IAuthorizationContext authCtx)
throws UnauthorizedAccessAttemptException, EntityNotFoundException; | void remove(SecurableResourceId resourceId, IAuthorizationContext authCtx) throws UnauthorizedAccessAttemptException, EntityNotFoundException; | /**
* Remove the existing resource from the authorization infrastructure together
* with its references and extra grants.
*
* @param resourceId The id of the resource to unregister.
* @param authCtx The <code>IAuthorizationContext</code> used to authorize
* this operation.
*
* @throws Unauthoriz... | Remove the existing resource from the authorization infrastructure together with its references and extra grants | remove | {
"repo_name": "kit-data-manager/base",
"path": "Authorization/src/main/java/edu/kit/dama/authorization/services/administration/IResourceService.java",
"license": "apache-2.0",
"size": 18423
} | [
"edu.kit.dama.authorization.entities.IAuthorizationContext",
"edu.kit.dama.authorization.entities.SecurableResourceId",
"edu.kit.dama.authorization.exceptions.EntityNotFoundException",
"edu.kit.dama.authorization.exceptions.UnauthorizedAccessAttemptException"
] | import edu.kit.dama.authorization.entities.IAuthorizationContext; import edu.kit.dama.authorization.entities.SecurableResourceId; import edu.kit.dama.authorization.exceptions.EntityNotFoundException; import edu.kit.dama.authorization.exceptions.UnauthorizedAccessAttemptException; | import edu.kit.dama.authorization.entities.*; import edu.kit.dama.authorization.exceptions.*; | [
"edu.kit.dama"
] | edu.kit.dama; | 629,476 |
public Map<String,Object> pUnitProperties(Dictionary dict) {
Map<String,Object> props = new HashMap<String,Object>();
Enumeration keysEnum = dict.keys();
// Dump in all of the config props
while (keysEnum.hasMoreElements()) {
String key = (String)keysEnum.nextElement... | Map<String,Object> function(Dictionary dict) { Map<String,Object> props = new HashMap<String,Object>(); Enumeration keysEnum = dict.keys(); while (keysEnum.hasMoreElements()) { String key = (String)keysEnum.nextElement(); props.put(key, dict.get(key)); } props.remove(GeminiPersistenceUnitProperties.PUNIT_NAME); props.r... | /**
* Helper method to remove all of the reserved config properties and
* treat the rest as persistence descriptor <property> elements.
*/ | Helper method to remove all of the reserved config properties and treat the rest as persistence descriptor elements | pUnitProperties | {
"repo_name": "lunifera/lunifera-gemini-jpa",
"path": "org.lunifera.org.eclipse.gemini.jpa/src/org/eclipse/gemini/jpa/configadmin/PersistenceUnitConfiguration.java",
"license": "epl-1.0",
"size": 9686
} | [
"java.util.Dictionary",
"java.util.Enumeration",
"java.util.HashMap",
"java.util.Map",
"org.eclipse.gemini.jpa.GeminiPersistenceUnitProperties",
"org.eclipse.gemini.jpa.GeminiUtil",
"org.osgi.framework.Constants",
"org.osgi.service.cm.ConfigurationAdmin"
] | import java.util.Dictionary; import java.util.Enumeration; import java.util.HashMap; import java.util.Map; import org.eclipse.gemini.jpa.GeminiPersistenceUnitProperties; import org.eclipse.gemini.jpa.GeminiUtil; import org.osgi.framework.Constants; import org.osgi.service.cm.ConfigurationAdmin; | import java.util.*; import org.eclipse.gemini.jpa.*; import org.osgi.framework.*; import org.osgi.service.cm.*; | [
"java.util",
"org.eclipse.gemini",
"org.osgi.framework",
"org.osgi.service"
] | java.util; org.eclipse.gemini; org.osgi.framework; org.osgi.service; | 2,187,314 |
public boolean addElement(E element, int index) {
if (fElements.contains(element)) {
return false;
}
fElements.add(index, element);
if (isOkToUse(fTableControl)) {
fTable.refresh();
fTable.setSelection(new StructuredSelection(element));
}
dialogFieldChanged();
return true;
} | boolean function(E element, int index) { if (fElements.contains(element)) { return false; } fElements.add(index, element); if (isOkToUse(fTableControl)) { fTable.refresh(); fTable.setSelection(new StructuredSelection(element)); } dialogFieldChanged(); return true; } | /**
* Adds an element at a position.
*/ | Adds an element at a position | addElement | {
"repo_name": "elucash/eclipse-oxygen",
"path": "org.eclipse.jdt.ui/src/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java",
"license": "epl-1.0",
"size": 25112
} | [
"org.eclipse.jface.viewers.StructuredSelection"
] | import org.eclipse.jface.viewers.StructuredSelection; | import org.eclipse.jface.viewers.*; | [
"org.eclipse.jface"
] | org.eclipse.jface; | 2,538,493 |
@Authorized( { PrivilegeConstants.PURGE_USERS })
public void purgeUser(User user) throws APIException;
| @Authorized( { PrivilegeConstants.PURGE_USERS }) void function(User user) throws APIException; | /**
* Completely remove a location from the database (not reversible). This method delegates to
* #purgeLocation(location, boolean) method.
*
* @param user the User to remove from the database.
* @should delete given user
*/ | Completely remove a location from the database (not reversible). This method delegates to #purgeLocation(location, boolean) method | purgeUser | {
"repo_name": "Winbobob/openmrs-core",
"path": "api/src/main/java/org/openmrs/api/UserService.java",
"license": "mpl-2.0",
"size": 21666
} | [
"org.openmrs.User",
"org.openmrs.annotation.Authorized",
"org.openmrs.util.PrivilegeConstants"
] | import org.openmrs.User; import org.openmrs.annotation.Authorized; import org.openmrs.util.PrivilegeConstants; | import org.openmrs.*; import org.openmrs.annotation.*; import org.openmrs.util.*; | [
"org.openmrs",
"org.openmrs.annotation",
"org.openmrs.util"
] | org.openmrs; org.openmrs.annotation; org.openmrs.util; | 2,198,744 |
protected byte[] execute(Connection conn) throws SQLException, UnsupportedEncodingException, IOException, UnsupportedOperationException {
log.debug("executing jdbc");
Statement stmt = null;
try {
// Based on query return value, get results
String _queryType =... | byte[] function(Connection conn) throws SQLException, UnsupportedEncodingException, IOException, UnsupportedOperationException { log.debug(STR); Statement stmt = null; try { String _queryType = getQueryType(); if (SELECT.equals(_queryType)) { stmt = conn.createStatement(); stmt.setQueryTimeout(getIntegerQueryTimeout())... | /**
* Execute the test element.
*
* @param conn a {@link SampleResult} in case the test should sample; <code>null</code> if only execution is requested
* @return the result of the execute command
* @throws SQLException if a database error occurs
* @throws UnsupportedEncodingException when... | Execute the test element | execute | {
"repo_name": "ThiagoGarciaAlves/jmeter",
"path": "src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/AbstractJDBCTestElement.java",
"license": "apache-2.0",
"size": 25879
} | [
"java.io.IOException",
"java.io.UnsupportedEncodingException",
"java.sql.CallableStatement",
"java.sql.Connection",
"java.sql.PreparedStatement",
"java.sql.ResultSet",
"java.sql.SQLException",
"java.sql.Statement"
] | import java.io.IOException; import java.io.UnsupportedEncodingException; import java.sql.CallableStatement; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; | import java.io.*; import java.sql.*; | [
"java.io",
"java.sql"
] | java.io; java.sql; | 2,057,876 |
private OverflowBlob setStreamAsTempData(MessageFormatter messageFormatter,MessageContext msgContext,OMOutputFormat format) throws IOException {
OverflowBlob serialized = new OverflowBlob(256, 4096, "http-nio_", ".dat");
OutputStream out = serialized.getOutputStream();
try {
me... | OverflowBlob function(MessageFormatter messageFormatter,MessageContext msgContext,OMOutputFormat format) throws IOException { OverflowBlob serialized = new OverflowBlob(256, 4096, STR, ".dat"); OutputStream out = serialized.getOutputStream(); try { messageFormatter.writeTo(msgContext, format, out, false); } finally { o... | /**
* Write the stream to a temporary storage and calculate the content length
*
* @throws IOException if an exception occurred while writing data
*/ | Write the stream to a temporary storage and calculate the content length | setStreamAsTempData | {
"repo_name": "maheshika/wso2-synapse",
"path": "modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/PassThroughHttpSender.java",
"license": "apache-2.0",
"size": 26835
} | [
"java.io.IOException",
"java.io.OutputStream",
"org.apache.axiom.om.OMOutputFormat",
"org.apache.axiom.util.blob.OverflowBlob",
"org.apache.axis2.context.MessageContext",
"org.apache.axis2.transport.MessageFormatter"
] | import java.io.IOException; import java.io.OutputStream; import org.apache.axiom.om.OMOutputFormat; import org.apache.axiom.util.blob.OverflowBlob; import org.apache.axis2.context.MessageContext; import org.apache.axis2.transport.MessageFormatter; | import java.io.*; import org.apache.axiom.om.*; import org.apache.axiom.util.blob.*; import org.apache.axis2.context.*; import org.apache.axis2.transport.*; | [
"java.io",
"org.apache.axiom",
"org.apache.axis2"
] | java.io; org.apache.axiom; org.apache.axis2; | 241,869 |
public void forgetTemporaryStateInImplications() {
if( frozen )
throw new IllegalStateException("Cannot change frozen object. Get a mutable copy to do this.");
List<Pair<Aliasing, ConsList<Implication>>> new_entries = new LinkedList<Pair<Aliasing, ConsList<Implication>>>();
for(Map.Entry<Aliasing... | void function() { if( frozen ) throw new IllegalStateException(STR); List<Pair<Aliasing, ConsList<Implication>>> new_entries = new LinkedList<Pair<Aliasing, ConsList<Implication>>>(); for(Map.Entry<Aliasing, ConsList<Implication>> impls : knownImplications.entrySet()) { ConsList<Implication> cur_list = impls.getValue()... | /**
* Remove temporary state information for all of the implications
* contained by this DynamicStateLogic object.
*/ | Remove temporary state information for all of the implications contained by this DynamicStateLogic object | forgetTemporaryStateInImplications | {
"repo_name": "plaidgroup/plural",
"path": "Plural/src/edu/cmu/cs/plural/concrete/DynamicStateLogic.java",
"license": "gpl-2.0",
"size": 26879
} | [
"edu.cmu.cs.crystal.analysis.alias.Aliasing",
"edu.cmu.cs.crystal.util.ConsList",
"edu.cmu.cs.crystal.util.Pair",
"java.util.LinkedList",
"java.util.List",
"java.util.Map"
] | import edu.cmu.cs.crystal.analysis.alias.Aliasing; import edu.cmu.cs.crystal.util.ConsList; import edu.cmu.cs.crystal.util.Pair; import java.util.LinkedList; import java.util.List; import java.util.Map; | import edu.cmu.cs.crystal.analysis.alias.*; import edu.cmu.cs.crystal.util.*; import java.util.*; | [
"edu.cmu.cs",
"java.util"
] | edu.cmu.cs; java.util; | 1,968,214 |
private static String createFileTypeInCondition(Collection<String> mimeTypes) {
String types = StringUtils.join(mimeTypes, "', '");
return "mime_type IN ('" + types + "')";
} | static String function(Collection<String> mimeTypes) { String types = StringUtils.join(mimeTypes, STR); return STR + types + "')"; } | /**
* Converts a list of MIME types into an SQL "mime_type IN" condition.
*
* @param mimeTypes The MIIME types.
*
* @return The condition string.
*/ | Converts a list of MIME types into an SQL "mime_type IN" condition | createFileTypeInCondition | {
"repo_name": "dgrove727/autopsy",
"path": "Core/src/org/sleuthkit/autopsy/casemodule/services/FileManager.java",
"license": "apache-2.0",
"size": 30949
} | [
"java.util.Collection",
"org.apache.commons.lang3.StringUtils"
] | import java.util.Collection; import org.apache.commons.lang3.StringUtils; | import java.util.*; import org.apache.commons.lang3.*; | [
"java.util",
"org.apache.commons"
] | java.util; org.apache.commons; | 1,162,825 |
@Test
public void testGetRowKey() {
TaskSeriesCollection c = createCollection1();
assertEquals("S1", c.getRowKey(0));
assertEquals("S2", c.getRowKey(1));
} | void function() { TaskSeriesCollection c = createCollection1(); assertEquals("S1", c.getRowKey(0)); assertEquals("S2", c.getRowKey(1)); } | /**
* Some tests for the getRowKey() method.
*/ | Some tests for the getRowKey() method | testGetRowKey | {
"repo_name": "simon04/jfreechart",
"path": "src/test/java/org/jfree/data/gantt/TaskSeriesCollectionTest.java",
"license": "lgpl-2.1",
"size": 23212
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 1,099,321 |
public void testCreateExtendedResponse005() {
StartTlsRequest str = new StartTlsRequest();
try {
str.createExtendedResponse("", null, 1, 2);
fail("NamingException expected");
} catch (NamingException e) {}
} | void function() { StartTlsRequest str = new StartTlsRequest(); try { str.createExtendedResponse(STRNamingException expected"); } catch (NamingException e) {} } | /**
* <p>Test method for 'javax.naming.ldap.StartTlsRequest.createExtendedResponse(String, byte[], int, int)'</p>
* <p>Here we are testing if this method creates an extended response object that corresponds to the LDAP StartTLS extended request.
* In this case we are testing the extended response with the argumen... | Test method for 'javax.naming.ldap.StartTlsRequest.createExtendedResponse(String, byte[], int, int)' Here we are testing if this method creates an extended response object that corresponds to the LDAP StartTLS extended request. In this case we are testing the extended response with the argument ID="" The expected resul... | testCreateExtendedResponse005 | {
"repo_name": "freeVM/freeVM",
"path": "enhanced/archive/classlib/java6/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/StartTlsRequestTest.java",
"license": "apache-2.0",
"size": 5698
} | [
"javax.naming.NamingException",
"javax.naming.ldap.StartTlsRequest"
] | import javax.naming.NamingException; import javax.naming.ldap.StartTlsRequest; | import javax.naming.*; import javax.naming.ldap.*; | [
"javax.naming"
] | javax.naming; | 1,027,860 |
public Builder addSpendingLimit(SpendingLimit element) {
if (this.spendingLimits == null) {
this.spendingLimits = new ArrayList<>();
}
this.spendingLimits.add(element);
return this;
} | Builder function(SpendingLimit element) { if (this.spendingLimits == null) { this.spendingLimits = new ArrayList<>(); } this.spendingLimits.add(element); return this; } | /**
* Add an element to `spendingLimits` list. A list is initialized for the first `add/addAll`
* call, and subsequent calls adds additional elements to the original list. See {@link
* CardUpdateParams.SpendingControls#spendingLimits} for the field documentation.
*/ | Add an element to `spendingLimits` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. See <code>CardUpdateParams.SpendingControls#spendingLimits</code> for the field documentation | addSpendingLimit | {
"repo_name": "stripe/stripe-java",
"path": "src/main/java/com/stripe/param/issuing/CardUpdateParams.java",
"license": "mit",
"size": 125778
} | [
"java.util.ArrayList"
] | import java.util.ArrayList; | import java.util.*; | [
"java.util"
] | java.util; | 147,889 |
private void waitForTasksToFinish(List<PublisherBase> tasksList)
throws Exception {
boolean allTasksFinished = false;
while (!allTasksFinished) {
allTasksFinished = true;
for (PublisherBase task : tasksList) {
if (!task.isTaskComplete())
allTasksFinished = false;
}
logger.info("Waiting fo... | void function(List<PublisherBase> tasksList) throws Exception { boolean allTasksFinished = false; while (!allTasksFinished) { allTasksFinished = true; for (PublisherBase task : tasksList) { if (!task.isTaskComplete()) allTasksFinished = false; } logger.info(STR); Thread.sleep(2000); } if (allTasksFinished) logger.info(... | /**
* Wait for tasks to finish
*
* @param tasksList
* @throws Exception
*/ | Wait for tasks to finish | waitForTasksToFinish | {
"repo_name": "tmtsoftware/es-perftest",
"path": "mbsuite-publisher-base/src/com/persistent/bcsuite/process/Generator.java",
"license": "mit",
"size": 16053
} | [
"com.persistent.bcsuite.base.PublisherBase",
"java.util.List"
] | import com.persistent.bcsuite.base.PublisherBase; import java.util.List; | import com.persistent.bcsuite.base.*; import java.util.*; | [
"com.persistent.bcsuite",
"java.util"
] | com.persistent.bcsuite; java.util; | 2,826,541 |
public Optional<Power> getSupplyCenterHomePower(final Province province) {
final ProvinceData pd = provArray.get(province.getIndex());
if (pd != null) {
return Optional.ofNullable(pd.getSCHomePower());
}
return Optional.empty();
}// getSupplyCenterHomePower() | Optional<Power> function(final Province province) { final ProvinceData pd = provArray.get(province.getIndex()); if (pd != null) { return Optional.ofNullable(pd.getSCHomePower()); } return Optional.empty(); } | /**
* Get the home power of the supply center; null if no supply center or home power
*/ | Get the home power of the supply center; null if no supply center or home power | getSupplyCenterHomePower | {
"repo_name": "takaki/jdip",
"path": "src/main/java/dip/world/Position.java",
"license": "gpl-2.0",
"size": 22008
} | [
"java.util.Optional"
] | import java.util.Optional; | import java.util.*; | [
"java.util"
] | java.util; | 1,942,123 |
private static int enumerate(Iterator<int[]> iter) {
long time = System.currentTimeMillis();
int count = 0;
while (iter.hasNext()) {
iter.next();
count++;
}
time = System.currentTimeMillis() - time;
System.out.print("Enumerated ");
Sy... | static int function(Iterator<int[]> iter) { long time = System.currentTimeMillis(); int count = 0; while (iter.hasNext()) { iter.next(); count++; } time = System.currentTimeMillis() - time; System.out.print(STR); System.out.print(count); System.out.print(STR); System.out.print(time); System.out.println(STR); return cou... | /**
* Enumerates all elements from the iterator and prints some statistics
* @param iter
* @return the number of elements enumerated
*/ | Enumerates all elements from the iterator and prints some statistics | enumerate | {
"repo_name": "prasser/jhpl",
"path": "src/test/de/linearbits/jhpl/test/Test6.java",
"license": "apache-2.0",
"size": 3177
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 932,918 |
@Override
public final void prepareWrite(final int recordCount, final int inputSize,
final int idealSize) {
try {
this.inputCount = inputSize;
this.idealCount = idealSize;
this.output = new PrintStream(new FileOutputStream(this.file));
} catch (final IOException ex) {
throw new BufferedDataError(... | final void function(final int recordCount, final int inputSize, final int idealSize) { try { this.inputCount = inputSize; this.idealCount = idealSize; this.output = new PrintStream(new FileOutputStream(this.file)); } catch (final IOException ex) { throw new BufferedDataError(ex); } } | /**
* Prepare to write to a CSV file.
*
* @param recordCount
* The total record count, that will be written.
* @param inputSize
* The input size.
* @param idealSize
* The ideal size.
*/ | Prepare to write to a CSV file | prepareWrite | {
"repo_name": "larhoy/SentimentProjectV2",
"path": "SentimentAnalysisV2/encog-core-3.1.0/src/main/java/org/encog/ml/data/buffer/codec/CSVDataCODEC.java",
"license": "mit",
"size": 6954
} | [
"java.io.FileOutputStream",
"java.io.IOException",
"java.io.PrintStream",
"org.encog.ml.data.buffer.BufferedDataError"
] | import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintStream; import org.encog.ml.data.buffer.BufferedDataError; | import java.io.*; import org.encog.ml.data.buffer.*; | [
"java.io",
"org.encog.ml"
] | java.io; org.encog.ml; | 13,627 |
public static Short convertToShort(Schema schema, Object value) throws DataException {
return (Short) convertTo(Schema.OPTIONAL_INT16_SCHEMA, schema, value);
} | static Short function(Schema schema, Object value) throws DataException { return (Short) convertTo(Schema.OPTIONAL_INT16_SCHEMA, schema, value); } | /**
* Convert the specified value to an {@link Type#INT16} short value. The supplied schema is required if the value is a logical
* type when the schema contains critical information that might be necessary for converting to a short.
*
* @param schema the schema for the value; may be null
* @pa... | Convert the specified value to an <code>Type#INT16</code> short value. The supplied schema is required if the value is a logical type when the schema contains critical information that might be necessary for converting to a short | convertToShort | {
"repo_name": "ollie314/kafka",
"path": "connect/api/src/main/java/org/apache/kafka/connect/data/Values.java",
"license": "apache-2.0",
"size": 50847
} | [
"org.apache.kafka.connect.errors.DataException"
] | import org.apache.kafka.connect.errors.DataException; | import org.apache.kafka.connect.errors.*; | [
"org.apache.kafka"
] | org.apache.kafka; | 43,158 |
public static ViewParent getParentForAccessibility(View view) {
return IMPL.getParentForAccessibility(view);
} | static ViewParent function(View view) { return IMPL.getParentForAccessibility(view); } | /**
* Gets the parent for accessibility purposes. Note that the parent for
* accessibility is not necessary the immediate parent. It is the first
* predecessor that is important for accessibility.
*
* @param view View to retrieve parent for
* @return The parent for use in accessibility ins... | Gets the parent for accessibility purposes. Note that the parent for accessibility is not necessary the immediate parent. It is the first predecessor that is important for accessibility | getParentForAccessibility | {
"repo_name": "madhavanks26/com.vliesaputra.deviceinformation",
"path": "src/com/vliesaputra/cordova/plugins/android/support/v4/src/java/android/support/v4/view/ViewCompat.java",
"license": "mit",
"size": 127830
} | [
"android.view.View",
"android.view.ViewParent"
] | import android.view.View; import android.view.ViewParent; | import android.view.*; | [
"android.view"
] | android.view; | 757,715 |
public void processStream(InputStream stream, String systemId)
throws ValidationException, ParserConfigurationException,
SAXException, IOException, SchedulerException,
ClassNotFoundException, ParseException {
clearValidationExceptions();
scheduledJobs.clear();
... | void function(InputStream stream, String systemId) throws ValidationException, ParserConfigurationException, SAXException, IOException, SchedulerException, ClassNotFoundException, ParseException { clearValidationExceptions(); scheduledJobs.clear(); jobsToSchedule.clear(); calsToSchedule.clear(); getLog().info(STR + sys... | /**
* Process the xmlfile named <code>fileName</code> with the given system
* ID.
*
* @param stream
* an input stream containing the xml content.
* @param systemId
* system ID.
*/ | Process the xmlfile named <code>fileName</code> with the given system ID | processStream | {
"repo_name": "chandrasekhar4u/opensymphony-quartz-backup",
"path": "trunk/src/java/org/quartz/xml/JobSchedulingDataProcessor.java",
"license": "apache-2.0",
"size": 52482
} | [
"java.io.IOException",
"java.io.InputStream",
"java.text.ParseException",
"javax.xml.parsers.ParserConfigurationException",
"org.quartz.SchedulerException",
"org.xml.sax.InputSource",
"org.xml.sax.SAXException"
] | import java.io.IOException; import java.io.InputStream; import java.text.ParseException; import javax.xml.parsers.ParserConfigurationException; import org.quartz.SchedulerException; import org.xml.sax.InputSource; import org.xml.sax.SAXException; | import java.io.*; import java.text.*; import javax.xml.parsers.*; import org.quartz.*; import org.xml.sax.*; | [
"java.io",
"java.text",
"javax.xml",
"org.quartz",
"org.xml.sax"
] | java.io; java.text; javax.xml; org.quartz; org.xml.sax; | 2,324,647 |
E decode(GamePacket packet); | E decode(GamePacket packet); | /**
* Decodes the specified packet into a message.
*
* @param packet The packet.
* @return The message.
*/ | Decodes the specified packet into a message | decode | {
"repo_name": "atomicint/aj8",
"path": "server/src/src/main/java/org/apollo/game/msg/MessageDecoder.java",
"license": "isc",
"size": 652
} | [
"org.apollo.net.codec.game.GamePacket"
] | import org.apollo.net.codec.game.GamePacket; | import org.apollo.net.codec.game.*; | [
"org.apollo.net"
] | org.apollo.net; | 1,961,446 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.