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
sequence | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
sequence | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
---|---|---|---|---|---|---|---|---|---|---|---|
public void addAdditionalInputPath(Path path) {
this.additionalInputPaths.add(path);
} | void function(Path path) { this.additionalInputPaths.add(path); } | /**
* Add an additional input path for this {@link Dataset}.
*/ | Add an additional input path for this <code>Dataset</code> | addAdditionalInputPath | {
"repo_name": "ydai1124/gobblin-1",
"path": "gobblin-compaction/src/main/java/gobblin/compaction/dataset/Dataset.java",
"license": "apache-2.0",
"size": 13348
} | [
"org.apache.hadoop.fs.Path"
] | import org.apache.hadoop.fs.Path; | import org.apache.hadoop.fs.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 1,129,584 |
public static void fill( final double[][] array, final long from, long to, final double value ) {
final long length = length( array );
BigArrays.ensureFromTo( length, from, to );
int fromSegment = segment( from );
int toSegment = segment( to );
int fromDispl = displacement( from );
int toDispl = displacement( to );
if ( fromSegment == toSegment ) {
DoubleArrays.fill( array[ fromSegment ], fromDispl, toDispl, value );
return;
}
if ( toDispl != 0 ) DoubleArrays.fill( array[ toSegment ], 0, toDispl, value );
while( --toSegment > fromSegment ) DoubleArrays.fill( array[ toSegment ], value );
DoubleArrays.fill( array[ fromSegment ], fromDispl, SEGMENT_SIZE, value );
} | static void function( final double[][] array, final long from, long to, final double value ) { final long length = length( array ); BigArrays.ensureFromTo( length, from, to ); int fromSegment = segment( from ); int toSegment = segment( to ); int fromDispl = displacement( from ); int toDispl = displacement( to ); if ( fromSegment == toSegment ) { DoubleArrays.fill( array[ fromSegment ], fromDispl, toDispl, value ); return; } if ( toDispl != 0 ) DoubleArrays.fill( array[ toSegment ], 0, toDispl, value ); while( --toSegment > fromSegment ) DoubleArrays.fill( array[ toSegment ], value ); DoubleArrays.fill( array[ fromSegment ], fromDispl, SEGMENT_SIZE, value ); } | /** Fills a portion of the given big array with the given value.
*
* <P>If possible (i.e., <code>from</code> is 0) this method uses a
* backward loop. In this case, it is significantly faster than the
* corresponding method in {@link java.util.Arrays}.
*
* @param array a big array.
* @param from the starting index of the portion to fill.
* @param to the end index of the portion to fill.
* @param value the new value for all elements of the specified portion of the big array.
*/ | Fills a portion of the given big array with the given value. If possible (i.e., <code>from</code> is 0) this method uses a backward loop. In this case, it is significantly faster than the corresponding method in <code>java.util.Arrays</code> | fill | {
"repo_name": "karussell/fastutil",
"path": "src/it/unimi/dsi/fastutil/doubles/DoubleBigArrays.java",
"license": "apache-2.0",
"size": 51385
} | [
"it.unimi.dsi.fastutil.BigArrays"
] | import it.unimi.dsi.fastutil.BigArrays; | import it.unimi.dsi.fastutil.*; | [
"it.unimi.dsi"
] | it.unimi.dsi; | 2,285,590 |
private static boolean webElementAttributeMatches(OrasiDriver driver, WebElement element, String attribute, String regex) {
WebDriverWait wait = new WebDriverWait(driver, 0);
try {
if(Highlight.getDebugMode()) Highlight.highlightDebug(driver, element);
return wait.until(ExtendedExpectedConditions.textToMatchInElementAttribute(element, attribute, regex));
} catch (TimeoutException te){
return false;
}
} | static boolean function(OrasiDriver driver, WebElement element, String attribute, String regex) { WebDriverWait wait = new WebDriverWait(driver, 0); try { if(Highlight.getDebugMode()) Highlight.highlightDebug(driver, element); return wait.until(ExtendedExpectedConditions.textToMatchInElementAttribute(element, attribute, regex)); } catch (TimeoutException te){ return false; } } | /**
* Use WebDriverWait and custom ExpectedConditions to determine if Element attribute matches expected value
*
* @author Justin
* @param driver
* Main WebDriver
* @param element
* Element to search for
* @param attribute
* Element attribute to validate
* @param regex
* Regular expression of attribute to validate
* @return TRUE if element attribute matches regular expression of expected value
*/ | Use WebDriverWait and custom ExpectedConditions to determine if Element attribute matches expected value | webElementAttributeMatches | {
"repo_name": "Orasi/java-automation-bs",
"path": "src/main/java/com/orasi/utils/PageLoaded.java",
"license": "bsd-3-clause",
"size": 51798
} | [
"com.orasi.utils.debugging.Highlight",
"org.openqa.selenium.TimeoutException",
"org.openqa.selenium.WebElement",
"org.openqa.selenium.support.ui.WebDriverWait"
] | import com.orasi.utils.debugging.Highlight; import org.openqa.selenium.TimeoutException; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.WebDriverWait; | import com.orasi.utils.debugging.*; import org.openqa.selenium.*; import org.openqa.selenium.support.ui.*; | [
"com.orasi.utils",
"org.openqa.selenium"
] | com.orasi.utils; org.openqa.selenium; | 2,741,961 |
public List<LibraryOperatorDescription> getOperatorDescriptions();
| List<LibraryOperatorDescription> function(); | /**
* This method must return the {@link OperatorDescription}'s of all
* defined operators.
*/ | This method must return the <code>OperatorDescription</code>'s of all defined operators | getOperatorDescriptions | {
"repo_name": "aborg0/rapidminer-vega",
"path": "src/com/rapidminer/operator/libraries/OperatorLibrary.java",
"license": "agpl-3.0",
"size": 5843
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,184,281 |
public void appendToStream(String streamPath, byte[] data, long offset, int byteCount) throws IOException, RestException {
byte[] toAppend = new byte[byteCount];
System.arraycopy(data, 0, toAppend, 0, byteCount);
client.fileSystems().append(accountName, streamPath, toAppend);
} | void function(String streamPath, byte[] data, long offset, int byteCount) throws IOException, RestException { byte[] toAppend = new byte[byteCount]; System.arraycopy(data, 0, toAppend, 0, byteCount); client.fileSystems().append(accountName, streamPath, toAppend); } | /**
* Appends to stream.
*
* @param streamPath The relative path to the stream.
* @param data The data to append to the stream
* @param offset This parameter is unused by this implementation, and any value put here is ignored
* @param byteCount The number of bytes from the data stream to append (starting at offset 0 of data).
* @throws IOException if the file does not exist or is inaccessible.
* @throws RestException if there is a failure communicating with the service.
*/ | Appends to stream | appendToStream | {
"repo_name": "herveyw/azure-sdk-for-java",
"path": "azure-mgmt-datalake-store-uploader/src/main/java/com/microsoft/azure/management/datalake/store/uploader/DataLakeStoreFrontEndAdapterImpl.java",
"license": "mit",
"size": 6570
} | [
"com.microsoft.rest.RestException",
"java.io.IOException"
] | import com.microsoft.rest.RestException; import java.io.IOException; | import com.microsoft.rest.*; import java.io.*; | [
"com.microsoft.rest",
"java.io"
] | com.microsoft.rest; java.io; | 1,170,708 |
protected RegionAttributes getRegionAttributes() {
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.GLOBAL);
factory.setDataPolicy(DataPolicy.REPLICATE);
factory.setConcurrencyChecksEnabled(true);
return factory.create();
} | RegionAttributes function() { AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.GLOBAL); factory.setDataPolicy(DataPolicy.REPLICATE); factory.setConcurrencyChecksEnabled(true); return factory.create(); } | /**
* Returns region attributes for a <code>GLOBAL</code> region
*/ | Returns region attributes for a <code>GLOBAL</code> region | getRegionAttributes | {
"repo_name": "ysung-pivotal/incubator-geode",
"path": "gemfire-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCCEDUnitTest.java",
"license": "apache-2.0",
"size": 8215
} | [
"com.gemstone.gemfire.cache.AttributesFactory",
"com.gemstone.gemfire.cache.DataPolicy",
"com.gemstone.gemfire.cache.RegionAttributes",
"com.gemstone.gemfire.cache.Scope"
] | import com.gemstone.gemfire.cache.AttributesFactory; import com.gemstone.gemfire.cache.DataPolicy; import com.gemstone.gemfire.cache.RegionAttributes; import com.gemstone.gemfire.cache.Scope; | import com.gemstone.gemfire.cache.*; | [
"com.gemstone.gemfire"
] | com.gemstone.gemfire; | 1,589,896 |
public XAConnection getXAConnection() throws SQLException; | XAConnection function() throws SQLException; | /**
* Create a connection to a database which can then be used in a distributed
* transaction.
*
* @return an XAConnection object representing the connection to the
* database, which can then be used in a distributed transaction.
* @throws SQLException
* if there is a problem accessing the database.
*/ | Create a connection to a database which can then be used in a distributed transaction | getXAConnection | {
"repo_name": "kavin256/Derby",
"path": "java/stubs/jdbc3/javax/sql/XADataSource.java",
"license": "apache-2.0",
"size": 5138
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 325,870 |
private static String normalizeExpectedCss(String expectedCss)
throws GssParserException {
List<SourceCode> inputs = ImmutableList.of(
new SourceCode("expectedCss", expectedCss));
CssTree tree = new GssParser(inputs).parse();
PrettyPrinter prettyPrinterPass = new PrettyPrinter(tree
.getVisitController());
prettyPrinterPass.runPass();
return prettyPrinterPass.getPrettyPrintedString();
} | static String function(String expectedCss) throws GssParserException { List<SourceCode> inputs = ImmutableList.of( new SourceCode(STR, expectedCss)); CssTree tree = new GssParser(inputs).parse(); PrettyPrinter prettyPrinterPass = new PrettyPrinter(tree .getVisitController()); prettyPrinterPass.runPass(); return prettyPrinterPass.getPrettyPrintedString(); } | /**
* Normalizes the expected CSS to a pretty-printed form that can be compared
* with the result of {@link #getCompiledCss()}.
*/ | Normalizes the expected CSS to a pretty-printed form that can be compared with the result of <code>#getCompiledCss()</code> | normalizeExpectedCss | {
"repo_name": "gravitydev/closure-stylesheets",
"path": "tests/com/google/common/css/compiler/ast/testing/NewFunctionalTestBase.java",
"license": "apache-2.0",
"size": 8731
} | [
"com.google.common.collect.ImmutableList",
"com.google.common.css.SourceCode",
"com.google.common.css.compiler.ast.CssTree",
"com.google.common.css.compiler.ast.GssParser",
"com.google.common.css.compiler.ast.GssParserException",
"com.google.common.css.compiler.passes.PrettyPrinter",
"java.util.List"
] | import com.google.common.collect.ImmutableList; import com.google.common.css.SourceCode; import com.google.common.css.compiler.ast.CssTree; import com.google.common.css.compiler.ast.GssParser; import com.google.common.css.compiler.ast.GssParserException; import com.google.common.css.compiler.passes.PrettyPrinter; import java.util.List; | import com.google.common.collect.*; import com.google.common.css.*; import com.google.common.css.compiler.ast.*; import com.google.common.css.compiler.passes.*; import java.util.*; | [
"com.google.common",
"java.util"
] | com.google.common; java.util; | 1,099,089 |
protected boolean isExclusiveField(Object keyName, Object keyValue) {
if (keyName != null && keyValue != null) {
String convertedKeyName = BusinessObjectFieldConverter.convertFromTransactionPropertyName(keyName.toString());
if (convertedKeyName.equals(KFSPropertyConstants.SUB_ACCOUNT_NUMBER) && keyValue.equals(Constant.CONSOLIDATED_SUB_ACCOUNT_NUMBER)) {
return true;
}
else if (convertedKeyName.equals(KFSPropertyConstants.SUB_OBJECT_CODE) && keyValue.equals(Constant.CONSOLIDATED_SUB_OBJECT_CODE)) {
return true;
}
else if (convertedKeyName.equals(KFSPropertyConstants.OBJECT_TYPE_CODE) && keyValue.equals(Constant.CONSOLIDATED_OBJECT_TYPE_CODE)) {
return true;
}
if (convertedKeyName.equals(KFSPropertyConstants.SUB_ACCOUNT_NUMBER) && keyValue.equals(KFSConstants.getDashSubAccountNumber())) {
return true;
}
else if (convertedKeyName.equals(KFSPropertyConstants.SUB_OBJECT_CODE) && keyValue.equals(KFSConstants.getDashFinancialSubObjectCode())) {
return true;
}
else if (convertedKeyName.equals(KFSPropertyConstants.PROJECT_CODE) && keyValue.equals(KFSConstants.getDashProjectCode())) {
return true;
}
}
return false;
} | boolean function(Object keyName, Object keyValue) { if (keyName != null && keyValue != null) { String convertedKeyName = BusinessObjectFieldConverter.convertFromTransactionPropertyName(keyName.toString()); if (convertedKeyName.equals(KFSPropertyConstants.SUB_ACCOUNT_NUMBER) && keyValue.equals(Constant.CONSOLIDATED_SUB_ACCOUNT_NUMBER)) { return true; } else if (convertedKeyName.equals(KFSPropertyConstants.SUB_OBJECT_CODE) && keyValue.equals(Constant.CONSOLIDATED_SUB_OBJECT_CODE)) { return true; } else if (convertedKeyName.equals(KFSPropertyConstants.OBJECT_TYPE_CODE) && keyValue.equals(Constant.CONSOLIDATED_OBJECT_TYPE_CODE)) { return true; } if (convertedKeyName.equals(KFSPropertyConstants.SUB_ACCOUNT_NUMBER) && keyValue.equals(KFSConstants.getDashSubAccountNumber())) { return true; } else if (convertedKeyName.equals(KFSPropertyConstants.SUB_OBJECT_CODE) && keyValue.equals(KFSConstants.getDashFinancialSubObjectCode())) { return true; } else if (convertedKeyName.equals(KFSPropertyConstants.PROJECT_CODE) && keyValue.equals(KFSConstants.getDashProjectCode())) { return true; } } return false; } | /**
* This method determines whether the input name-value pair is exclusive from the processing
*
* @param keyName the name of the name-value pair
* @param keyValue the value of the name-value pair
* @return true if the input key is in the exclusive list; otherwise, false
*/ | This method determines whether the input name-value pair is exclusive from the processing | isExclusiveField | {
"repo_name": "bhutchinson/kfs",
"path": "kfs-core/src/main/java/org/kuali/kfs/gl/businessobject/inquiry/AbstractGeneralLedgerInquirableImpl.java",
"license": "agpl-3.0",
"size": 20481
} | [
"org.kuali.kfs.gl.Constant",
"org.kuali.kfs.gl.businessobject.lookup.BusinessObjectFieldConverter",
"org.kuali.kfs.sys.KFSConstants",
"org.kuali.kfs.sys.KFSPropertyConstants"
] | import org.kuali.kfs.gl.Constant; import org.kuali.kfs.gl.businessobject.lookup.BusinessObjectFieldConverter; import org.kuali.kfs.sys.KFSConstants; import org.kuali.kfs.sys.KFSPropertyConstants; | import org.kuali.kfs.gl.*; import org.kuali.kfs.gl.businessobject.lookup.*; import org.kuali.kfs.sys.*; | [
"org.kuali.kfs"
] | org.kuali.kfs; | 80,628 |
Constructor<?> getFileObjectDecoratorConst(); | Constructor<?> getFileObjectDecoratorConst(); | /**
* The constructor associated to the fileObjectDecorator.
* We cache it here for performance reasons.
* @return the Constructor associated with the FileObjectDecorator.
*/ | The constructor associated to the fileObjectDecorator. We cache it here for performance reasons | getFileObjectDecoratorConst | {
"repo_name": "sandamal/wso2-commons-vfs",
"path": "core/src/main/java/org/apache/commons/vfs2/FileSystemManager.java",
"license": "apache-2.0",
"size": 13253
} | [
"java.lang.reflect.Constructor"
] | import java.lang.reflect.Constructor; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 2,088,575 |
void followTag(String tagId) throws QiitaException; | void followTag(String tagId) throws QiitaException; | /**
* Follows the tag.
* Needs access token.
*
* @param tagId the target tag identifier
* @throws QiitaException if arguments are incorrect or Qiita API is unavailable
*/ | Follows the tag. Needs access token | followTag | {
"repo_name": "Yuiki/Qiita4Jv2",
"path": "src/main/java/jp/yuiki/dev/qiita4jv2/resources/TagsResources.java",
"license": "mit",
"size": 2723
} | [
"jp.yuiki.dev.qiita4jv2.QiitaException"
] | import jp.yuiki.dev.qiita4jv2.QiitaException; | import jp.yuiki.dev.qiita4jv2.*; | [
"jp.yuiki.dev"
] | jp.yuiki.dev; | 2,558,950 |
@Override
public Value evalArg(Env env, boolean isTop) {
return evalVar(env);
} | Value function(Env env, boolean isTop) { return evalVar(env); } | /**
* Evaluates the expression.
*
* @param env the calling environment.
*
* @return the expression value.
*/ | Evaluates the expression | evalArg | {
"repo_name": "CleverCloud/Quercus",
"path": "quercus/src/main/java/com/caucho/quercus/expr/ArrayTailExpr.java",
"license": "gpl-2.0",
"size": 4259
} | [
"com.caucho.quercus.env.Env",
"com.caucho.quercus.env.Value"
] | import com.caucho.quercus.env.Env; import com.caucho.quercus.env.Value; | import com.caucho.quercus.env.*; | [
"com.caucho.quercus"
] | com.caucho.quercus; | 576,188 |
private String exportTF() {
FolderForm folderForm = (FolderForm) getForm();
try {
if ( tfDelegate == null ) {
tfDelegate = new TeachingFileDelegate();
tfDelegate.init(getCtx());
getCtx().getRequest().getSession().setAttribute(TeachingFileDelegate.TF_ATTRNAME, tfDelegate);
}
Set instances = tfDelegate.getSelectedInstances(folderForm.getStickyPatients(),
folderForm.getStickyStudies(),
folderForm.getStickySeries(),
folderForm.getStickyInstances());
if ( log.isDebugEnabled() ) log.debug("Selected Instances:"+instances);
TFModel.getModel( getCtx().getRequest() ).setInstances(instances);
} catch ( Exception x ) {
log.error("Error in export Teaching File:", x);
folderForm.setPopupMsg("Error:"+x.getMessage());
return FOLDER;
}
return EXPORT_SELECTOR;
} | String function() { FolderForm folderForm = (FolderForm) getForm(); try { if ( tfDelegate == null ) { tfDelegate = new TeachingFileDelegate(); tfDelegate.init(getCtx()); getCtx().getRequest().getSession().setAttribute(TeachingFileDelegate.TF_ATTRNAME, tfDelegate); } Set instances = tfDelegate.getSelectedInstances(folderForm.getStickyPatients(), folderForm.getStickyStudies(), folderForm.getStickySeries(), folderForm.getStickyInstances()); if ( log.isDebugEnabled() ) log.debug(STR+instances); TFModel.getModel( getCtx().getRequest() ).setInstances(instances); } catch ( Exception x ) { log.error(STR, x); folderForm.setPopupMsg(STR+x.getMessage()); return FOLDER; } return EXPORT_SELECTOR; } | /**
* Export selected instance to a Teaching Filesystem.
* <p>
*
* @return the name of the next view.
*/ | Export selected instance to a Teaching Filesystem. | exportTF | {
"repo_name": "medicayun/medicayundicom",
"path": "dcm4jboss-all/tags/DCM4JBOSS_2_7_6/dcm4jboss-web/src/java/org/dcm4chex/archive/web/maverick/FolderSubmitCtrl.java",
"license": "apache-2.0",
"size": 20743
} | [
"java.util.Set",
"org.dcm4chex.archive.web.maverick.tf.TFModel",
"org.dcm4chex.archive.web.maverick.tf.TeachingFileDelegate"
] | import java.util.Set; import org.dcm4chex.archive.web.maverick.tf.TFModel; import org.dcm4chex.archive.web.maverick.tf.TeachingFileDelegate; | import java.util.*; import org.dcm4chex.archive.web.maverick.tf.*; | [
"java.util",
"org.dcm4chex.archive"
] | java.util; org.dcm4chex.archive; | 2,875,134 |
List<History> getHistory( Date since ) throws TenableIoException; | List<History> getHistory( Date since ) throws TenableIoException; | /**
* Get scan histories
*
* @param since only histories since this date will be returned
* @return the list of scan histories
* @throws TenableIoException the Tenable IO exception
*/ | Get scan histories | getHistory | {
"repo_name": "tenable/Tenable.io-SDK-for-Java",
"path": "src/main/java/com/tenable/io/api/scans/interfaces/ScanBaseOp.java",
"license": "mit",
"size": 4477
} | [
"com.tenable.io.api.scans.models.History",
"com.tenable.io.core.exceptions.TenableIoException",
"java.util.Date",
"java.util.List"
] | import com.tenable.io.api.scans.models.History; import com.tenable.io.core.exceptions.TenableIoException; import java.util.Date; import java.util.List; | import com.tenable.io.api.scans.models.*; import com.tenable.io.core.exceptions.*; import java.util.*; | [
"com.tenable.io",
"java.util"
] | com.tenable.io; java.util; | 1,327,710 |
public static RepeatableContainers of(
Class<? extends Annotation> repeatable, @Nullable Class<? extends Annotation> container) {
return new ExplicitRepeatableContainer(null, repeatable, container);
} | static RepeatableContainers function( Class<? extends Annotation> repeatable, @Nullable Class<? extends Annotation> container) { return new ExplicitRepeatableContainer(null, repeatable, container); } | /**
* Create a {@link RepeatableContainers} instance that uses a defined
* container and repeatable type.
* @param repeatable the contained repeatable annotation
* @param container the container annotation or {@code null}. If specified,
* this annotation must declare a {@code value} attribute returning an array
* of repeatable annotations. If not specified, the container will be
* deduced by inspecting the {@code @Repeatable} annotation on
* {@code repeatable}.
* @return a {@link RepeatableContainers} instance
*/ | Create a <code>RepeatableContainers</code> instance that uses a defined container and repeatable type | of | {
"repo_name": "spring-projects/spring-framework",
"path": "spring-core/src/main/java/org/springframework/core/annotation/RepeatableContainers.java",
"license": "apache-2.0",
"size": 8843
} | [
"java.lang.annotation.Annotation",
"org.springframework.lang.Nullable"
] | import java.lang.annotation.Annotation; import org.springframework.lang.Nullable; | import java.lang.annotation.*; import org.springframework.lang.*; | [
"java.lang",
"org.springframework.lang"
] | java.lang; org.springframework.lang; | 2,839,110 |
public VideoGenerationResponse createVideoGenerationTask(VideoGenerationRequest videoGenerationRequest) {
InternalRequest request = this.createRequest(videoGenerationRequest, HttpMethodName.POST, MATLIB,
MATLIB_VIDEO_GENERATION);
return invokeHttpClient(request, VideoGenerationResponse.class);
} | VideoGenerationResponse function(VideoGenerationRequest videoGenerationRequest) { InternalRequest request = this.createRequest(videoGenerationRequest, HttpMethodName.POST, MATLIB, MATLIB_VIDEO_GENERATION); return invokeHttpClient(request, VideoGenerationResponse.class); } | /**
* create a video with materials and subtitles
*
* @param videoGenerationRequest videoGenerationResponse
* @return VideoGenerationResponse
*/ | create a video with materials and subtitles | createVideoGenerationTask | {
"repo_name": "baidubce/bce-sdk-java",
"path": "src/main/java/com/baidubce/services/bvw/BvwClient.java",
"license": "apache-2.0",
"size": 39847
} | [
"com.baidubce.http.HttpMethodName",
"com.baidubce.internal.InternalRequest",
"com.baidubce.services.bvw.model.matlib.VideoGenerationRequest",
"com.baidubce.services.bvw.model.matlib.VideoGenerationResponse"
] | import com.baidubce.http.HttpMethodName; import com.baidubce.internal.InternalRequest; import com.baidubce.services.bvw.model.matlib.VideoGenerationRequest; import com.baidubce.services.bvw.model.matlib.VideoGenerationResponse; | import com.baidubce.http.*; import com.baidubce.internal.*; import com.baidubce.services.bvw.model.matlib.*; | [
"com.baidubce.http",
"com.baidubce.internal",
"com.baidubce.services"
] | com.baidubce.http; com.baidubce.internal; com.baidubce.services; | 903,922 |
public void setPublishDate(final Timestamp publishDate) {
this.publishDate = publishDate;
} | void function(final Timestamp publishDate) { this.publishDate = publishDate; } | /**
* Sets the time when this {@link Content} was published.
* @param publishDate the time when this {@link Content} was published.
*/ | Sets the time when this <code>Content</code> was published | setPublishDate | {
"repo_name": "XMBomb/InComb",
"path": "src/main/java/com/incomb/server/model/Content.java",
"license": "apache-2.0",
"size": 5448
} | [
"java.sql.Timestamp"
] | import java.sql.Timestamp; | import java.sql.*; | [
"java.sql"
] | java.sql; | 1,283,124 |
public Iterator fieldsFor(final Class cls) {
return buildMap(cls, true).values().iterator();
} | Iterator function(final Class cls) { return buildMap(cls, true).values().iterator(); } | /**
* Returns an iterator for all fields for some class
*
* @param cls the class you are interested on
* @return an iterator for its fields
*/ | Returns an iterator for all fields for some class | fieldsFor | {
"repo_name": "lamsfoundation/lams",
"path": "3rdParty_sources/xstream/com/thoughtworks/xstream/converters/reflection/FieldDictionary.java",
"license": "gpl-2.0",
"size": 8612
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 390,481 |
protected boolean isProfileActive( MavenProject project, String profileId )
{
for ( Map.Entry<String, List<String>> entry : project.getInjectedProfileIds().entrySet() )
{
if ( entry.getValue().contains( profileId ) )
{
return true;
}
}
return false;
} | boolean function( MavenProject project, String profileId ) { for ( Map.Entry<String, List<String>> entry : project.getInjectedProfileIds().entrySet() ) { if ( entry.getValue().contains( profileId ) ) { return true; } } return false; } | /**
* Checks if profile is active.
*
* @param project the project
* @param profileId the profile name
* @return <code>true</code> if profile is active, otherwise <code>false</code>
*/ | Checks if profile is active | isProfileActive | {
"repo_name": "apache/maven-enforcer",
"path": "enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireActiveProfile.java",
"license": "apache-2.0",
"size": 4480
} | [
"java.util.List",
"java.util.Map",
"org.apache.maven.project.MavenProject"
] | import java.util.List; import java.util.Map; import org.apache.maven.project.MavenProject; | import java.util.*; import org.apache.maven.project.*; | [
"java.util",
"org.apache.maven"
] | java.util; org.apache.maven; | 2,639,346 |
private Middleware registration() {
Middleware registration = new Middleware();
Registration handler = new Registration();
registration
.add(this.noAuth).add(handler)
.addAlways(new Logging(REGISTRATION_PATH));;
return registration;
} | Middleware function() { Middleware registration = new Middleware(); Registration handler = new Registration(); registration .add(this.noAuth).add(handler) .addAlways(new Logging(REGISTRATION_PATH));; return registration; } | /**
* registration is a middleware for the registration endpoint
* @return Middleware handler for registration
*/ | registration is a middleware for the registration endpoint | registration | {
"repo_name": "Roverr/java-auth",
"path": "src/main/java/com/authcore/router/Router.java",
"license": "mit",
"size": 2896
} | [
"com.authcore.core.registration.Registration",
"com.authcore.router.middleware.Middleware",
"com.authcore.router.middleware.logger.Logging"
] | import com.authcore.core.registration.Registration; import com.authcore.router.middleware.Middleware; import com.authcore.router.middleware.logger.Logging; | import com.authcore.core.registration.*; import com.authcore.router.middleware.*; import com.authcore.router.middleware.logger.*; | [
"com.authcore.core",
"com.authcore.router"
] | com.authcore.core; com.authcore.router; | 2,895,417 |
public static URI getFileURI( final File file ) {
final StringBuffer buffer = new StringBuffer( "file://" );
final char[] chars = file.getAbsolutePath().toCharArray();
URI retval = null;
if ( chars != null ) {
if ( chars.length > 1 ) {
// If there is a drive delimiter ':' in the second position, we
// assume
// this is file is on a Windows system which does not return a
// leading /
if ( chars[1] == ':' ) {
buffer.append( "/" );
}
}
for ( int i = 0; i < chars.length; i++ ) {
final char c = chars[i];
switch ( c ) {
// Replace spaces
case ' ':
buffer.append( "%20" );
continue;
// Replace every Windows file separator
case '\\':
buffer.append( "/" );
continue;
default:
buffer.append( c );
continue;
}
}
try {
retval = new URI( buffer.toString() );
} catch ( final URISyntaxException e ) {
System.err.println( e.getMessage() );
}
}
return retval;
} | static URI function( final File file ) { final StringBuffer buffer = new StringBuffer( STR/STR%20STR/" ); continue; default: buffer.append( c ); continue; } } try { retval = new URI( buffer.toString() ); } catch ( final URISyntaxException e ) { System.err.println( e.getMessage() ); } } return retval; } | /**
* This returns a URI for the given file.
*
* @param file from which to generate a URI
*
* @return the URI of the given file or null if a logic error occurred
*/ | This returns a URI for the given file | getFileURI | {
"repo_name": "sdcote/commons",
"path": "src/main/java/coyote/commons/FileUtil.java",
"license": "mit",
"size": 61600
} | [
"java.io.File",
"java.net.URISyntaxException"
] | import java.io.File; import java.net.URISyntaxException; | import java.io.*; import java.net.*; | [
"java.io",
"java.net"
] | java.io; java.net; | 556,484 |
String writeTemporaryFile(InputStream file); | String writeTemporaryFile(InputStream file); | /**
* Write a file on a temporary path.
*
* The path wil be decided by the file store and returned to the client.
*
* @param file the content of the file
* @return the path created for the file
*/ | Write a file on a temporary path. The path wil be decided by the file store and returned to the client | writeTemporaryFile | {
"repo_name": "KurtStam/syndesis-rest",
"path": "filestore/src/main/java/io/syndesis/filestore/FileStore.java",
"license": "apache-2.0",
"size": 2523
} | [
"java.io.InputStream"
] | import java.io.InputStream; | import java.io.*; | [
"java.io"
] | java.io; | 730,560 |
@Test(expectedExceptions = IllegalArgumentException.class)
public void testConstructorDefaultAndMapNullMap() {
new UniqueIdSchemeDelegator<>("default", null);
} | @Test(expectedExceptions = IllegalArgumentException.class) void function() { new UniqueIdSchemeDelegator<>(STR, null); } | /**
* Tests that the map of delegates cannot be null.
*/ | Tests that the map of delegates cannot be null | testConstructorDefaultAndMapNullMap | {
"repo_name": "McLeodMoores/starling",
"path": "projects/util/src/test/java/com/opengamma/id/UniqueIdSchemeDelegatorTest.java",
"license": "apache-2.0",
"size": 5264
} | [
"org.testng.annotations.Test"
] | import org.testng.annotations.Test; | import org.testng.annotations.*; | [
"org.testng.annotations"
] | org.testng.annotations; | 284,398 |
Dimension getLensScaledSize()
{
return new Dimension(getScaledWidth(), getScaledHeight());
} | Dimension getLensScaledSize() { return new Dimension(getScaledWidth(), getScaledHeight()); } | /**
* Returns the scaled size of the lens, scaled by the imageZoomFactor.
*
* @return See above.
*/ | Returns the scaled size of the lens, scaled by the imageZoomFactor | getLensScaledSize | {
"repo_name": "simleo/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/util/ui/lens/LensModel.java",
"license": "gpl-2.0",
"size": 15316
} | [
"java.awt.Dimension"
] | import java.awt.Dimension; | import java.awt.*; | [
"java.awt"
] | java.awt; | 2,585,849 |
private void showGlobalContextActionBar() {
ActionBar actionBar = getActionBar();
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
actionBar.setTitle(R.string.app_name);
} | void function() { ActionBar actionBar = getActionBar(); actionBar.setDisplayShowTitleEnabled(true); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); actionBar.setTitle(R.string.app_name); } | /**
* Per the navigation drawer design guidelines, updates the action bar to show the global app
* 'context', rather than just what's in the current screen.
*/ | Per the navigation drawer design guidelines, updates the action bar to show the global app 'context', rather than just what's in the current screen | showGlobalContextActionBar | {
"repo_name": "firstthumb/TwitterCrawl",
"path": "app/src/main/java/com/ekocaman/twittercrawlapp/NavigationDrawerFragment.java",
"license": "apache-2.0",
"size": 10737
} | [
"android.support.v7.app.ActionBar"
] | import android.support.v7.app.ActionBar; | import android.support.v7.app.*; | [
"android.support"
] | android.support; | 1,128,727 |
@ApiOperation(value = "Retrieve a key", notes = "The id of the key is specified in the URL")
@RequestMapping(value = "{id}", method = RequestMethod.GET)
public Key findById(
@RequestHeader(value = "project-id") String projectId, @PathVariable("id") String id)
throws NotFoundException {
Key key = keyManagement.queryById(projectId, id);
if (key == null) throw new NotFoundException("No key found with ID " + id);
return key;
} | @ApiOperation(value = STR, notes = STR) @RequestMapping(value = "{id}", method = RequestMethod.GET) Key function( @RequestHeader(value = STR) String projectId, @PathVariable("id") String id) throws NotFoundException { Key key = keyManagement.queryById(projectId, id); if (key == null) throw new NotFoundException(STR + id); return key; } | /**
* Returns the Key selected by id
*
* @param id : The id of the Key
* @return User: The Key selected
*/ | Returns the Key selected by id | findById | {
"repo_name": "openbaton/NFVO",
"path": "api/src/main/java/org/openbaton/nfvo/api/admin/RestKeys.java",
"license": "apache-2.0",
"size": 5701
} | [
"io.swagger.annotations.ApiOperation",
"org.openbaton.catalogue.security.Key",
"org.openbaton.exceptions.NotFoundException",
"org.springframework.web.bind.annotation.PathVariable",
"org.springframework.web.bind.annotation.RequestHeader",
"org.springframework.web.bind.annotation.RequestMapping",
"org.springframework.web.bind.annotation.RequestMethod"
] | import io.swagger.annotations.ApiOperation; import org.openbaton.catalogue.security.Key; import org.openbaton.exceptions.NotFoundException; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; | import io.swagger.annotations.*; import org.openbaton.catalogue.security.*; import org.openbaton.exceptions.*; import org.springframework.web.bind.annotation.*; | [
"io.swagger.annotations",
"org.openbaton.catalogue",
"org.openbaton.exceptions",
"org.springframework.web"
] | io.swagger.annotations; org.openbaton.catalogue; org.openbaton.exceptions; org.springframework.web; | 1,944,916 |
public void testInvokeAll2() throws InterruptedException {
ExecutorService e = new ForkJoinPool(1);
final Collection<Callable<String>> emptyCollection
= Collections.emptyList();
try (PoolCleaner cleaner = cleaner(e)) {
List<Future<String>> r = e.invokeAll(emptyCollection);
assertTrue(r.isEmpty());
}
} | void function() throws InterruptedException { ExecutorService e = new ForkJoinPool(1); final Collection<Callable<String>> emptyCollection = Collections.emptyList(); try (PoolCleaner cleaner = cleaner(e)) { List<Future<String>> r = e.invokeAll(emptyCollection); assertTrue(r.isEmpty()); } } | /**
* invokeAll(empty collection) returns empty list
*/ | invokeAll(empty collection) returns empty list | testInvokeAll2 | {
"repo_name": "md-5/jdk10",
"path": "test/jdk/java/util/concurrent/tck/ForkJoinPoolTest.java",
"license": "gpl-2.0",
"size": 35583
} | [
"java.util.Collection",
"java.util.Collections",
"java.util.List",
"java.util.concurrent.Callable",
"java.util.concurrent.ExecutorService",
"java.util.concurrent.ForkJoinPool",
"java.util.concurrent.Future"
] | import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; import java.util.concurrent.ForkJoinPool; import java.util.concurrent.Future; | import java.util.*; import java.util.concurrent.*; | [
"java.util"
] | java.util; | 2,317,405 |
public static int getMaximumEndpointCacheSize(CamelContext camelContext) throws IllegalArgumentException {
if (camelContext != null) {
String s = camelContext.getGlobalOption(Exchange.MAXIMUM_ENDPOINT_CACHE_SIZE);
if (s != null) {
// we cannot use Camel type converters as they may not be ready this early
try {
Integer size = Integer.valueOf(s);
if (size == null || size <= 0) {
throw new IllegalArgumentException("Property " + Exchange.MAXIMUM_ENDPOINT_CACHE_SIZE + " must be a positive number, was: " + s);
}
return size;
} catch (NumberFormatException e) {
throw new IllegalArgumentException("Property " + Exchange.MAXIMUM_ENDPOINT_CACHE_SIZE + " must be a positive number, was: " + s, e);
}
}
}
// 1000 is the default fallback
return 1000;
} | static int function(CamelContext camelContext) throws IllegalArgumentException { if (camelContext != null) { String s = camelContext.getGlobalOption(Exchange.MAXIMUM_ENDPOINT_CACHE_SIZE); if (s != null) { try { Integer size = Integer.valueOf(s); if (size == null size <= 0) { throw new IllegalArgumentException(STR + Exchange.MAXIMUM_ENDPOINT_CACHE_SIZE + STR + s); } return size; } catch (NumberFormatException e) { throw new IllegalArgumentException(STR + Exchange.MAXIMUM_ENDPOINT_CACHE_SIZE + STR + s, e); } } } return 1000; } | /**
* Gets the maximum endpoint cache size.
* <p/>
* Will use the property set on CamelContext with the key {@link Exchange#MAXIMUM_ENDPOINT_CACHE_SIZE}.
* If no property has been set, then it will fallback to return a size of 1000.
*
* @param camelContext the camel context
* @return the maximum cache size
* @throws IllegalArgumentException is thrown if the property is illegal
*/ | Gets the maximum endpoint cache size. Will use the property set on CamelContext with the key <code>Exchange#MAXIMUM_ENDPOINT_CACHE_SIZE</code>. If no property has been set, then it will fallback to return a size of 1000 | getMaximumEndpointCacheSize | {
"repo_name": "jkorab/camel",
"path": "camel-core/src/main/java/org/apache/camel/util/CamelContextHelper.java",
"license": "apache-2.0",
"size": 32345
} | [
"org.apache.camel.CamelContext",
"org.apache.camel.Exchange"
] | import org.apache.camel.CamelContext; import org.apache.camel.Exchange; | import org.apache.camel.*; | [
"org.apache.camel"
] | org.apache.camel; | 792,769 |
public RestoreRequestInner withDatabases(List<DatabaseBackupSetting> databases) {
this.databases = databases;
return this;
} | RestoreRequestInner function(List<DatabaseBackupSetting> databases) { this.databases = databases; return this; } | /**
* Set the databases value.
*
* @param databases the databases value to set
* @return the RestoreRequestInner object itself.
*/ | Set the databases value | withDatabases | {
"repo_name": "martinsawicki/azure-sdk-for-java",
"path": "azure-mgmt-appservice/src/main/java/com/microsoft/azure/management/appservice/implementation/RestoreRequestInner.java",
"license": "mit",
"size": 8274
} | [
"com.microsoft.azure.management.appservice.DatabaseBackupSetting",
"java.util.List"
] | import com.microsoft.azure.management.appservice.DatabaseBackupSetting; import java.util.List; | import com.microsoft.azure.management.appservice.*; import java.util.*; | [
"com.microsoft.azure",
"java.util"
] | com.microsoft.azure; java.util; | 569,975 |
ColorDefinition getShadowColor( ); | ColorDefinition getShadowColor( ); | /**
* Returns the value of the '<em><b>Shadow Color</b></em>' containment
* reference. <!-- begin-user-doc --> <!-- end-user-doc --> <!--
* begin-model-doc -->
*
* Specifies the color to be used for the shadow.
*
* <!-- end-model-doc -->
*
* @return the value of the '<em>Shadow Color</em>' containment
* reference.
* @see #setShadowColor(ColorDefinition)
* @see org.eclipse.birt.chart.model.type.TypePackage#getLineSeries_ShadowColor()
* @model containment="true" resolveProxies="false" required="true"
* @generated
*/ | Returns the value of the 'Shadow Color' containment reference. Specifies the color to be used for the shadow. | getShadowColor | {
"repo_name": "Charling-Huang/birt",
"path": "chart/org.eclipse.birt.chart.engine/src/org/eclipse/birt/chart/model/type/LineSeries.java",
"license": "epl-1.0",
"size": 12148
} | [
"org.eclipse.birt.chart.model.attribute.ColorDefinition"
] | import org.eclipse.birt.chart.model.attribute.ColorDefinition; | import org.eclipse.birt.chart.model.attribute.*; | [
"org.eclipse.birt"
] | org.eclipse.birt; | 1,688,019 |
public IntersectionManager nextIntersectionManager(IntersectionManager im) {
// Build the cache if it doesn't exist
if(memoGetSubsequentIntersectionManager == null) {
memoGetSubsequentIntersectionManager =
new HashMap<IntersectionManager, IntersectionManager>();
IntersectionManager lastIM = null;
// Now run through the IntersectionManagers in order and set up
// the cache
for(IntersectionManager currIM : intersectionManagers.values()) {
// Don't include the first one as a value, since it isn't subsequent
// to anything
if(lastIM != null) {
memoGetSubsequentIntersectionManager.put(lastIM, currIM);
}
lastIM = currIM;
}
// Link up to the next Lane
if(lastIM != null && lane.hasNextLane()) {
memoGetSubsequentIntersectionManager.put(lastIM,
lane.getNextLane().
getLaneIM().
firstIntersectionManager());
}
}
return memoGetSubsequentIntersectionManager.get(im);
} | IntersectionManager function(IntersectionManager im) { if(memoGetSubsequentIntersectionManager == null) { memoGetSubsequentIntersectionManager = new HashMap<IntersectionManager, IntersectionManager>(); IntersectionManager lastIM = null; for(IntersectionManager currIM : intersectionManagers.values()) { if(lastIM != null) { memoGetSubsequentIntersectionManager.put(lastIM, currIM); } lastIM = currIM; } if(lastIM != null && lane.hasNextLane()) { memoGetSubsequentIntersectionManager.put(lastIM, lane.getNextLane(). getLaneIM(). firstIntersectionManager()); } } return memoGetSubsequentIntersectionManager.get(im); } | /**
* Get the IntersectionManager that this Lane, or any Lane it leads into
* enters, after the given IntersectionManager.
*
* @param im the IntersectionManager to which we would like the successor
* @return the IntersectionManager that this Lane, or any Lane it leads
* into enters, after the given IntersectionManager
*/ | Get the IntersectionManager that this Lane, or any Lane it leads into enters, after the given IntersectionManager | nextIntersectionManager | {
"repo_name": "Xanders94/AIM-Simulator",
"path": "src/main/java/aim4/map/lane/LaneIM.java",
"license": "gpl-3.0",
"size": 19533
} | [
"java.util.HashMap"
] | import java.util.HashMap; | import java.util.*; | [
"java.util"
] | java.util; | 2,195,476 |
public static boolean createDebugStore(@Nullable String storeType, @NonNull File storeFile,
@NonNull String storePassword, @NonNull String keyPassword,
@NonNull String keyAlias,
@NonNull ILogger logger) throws KeytoolException {
return createNewStore(storeType, storeFile, storePassword, keyPassword, keyAlias,
CERTIFICATE_DESC, 30 , logger);
} | static boolean function(@Nullable String storeType, @NonNull File storeFile, @NonNull String storePassword, @NonNull String keyPassword, @NonNull String keyAlias, @NonNull ILogger logger) throws KeytoolException { return createNewStore(storeType, storeFile, storePassword, keyPassword, keyAlias, CERTIFICATE_DESC, 30 , logger); } | /**
* Creates a new debug store with the location, keyalias, and passwords specified in the
* config.
*
* @param signingConfig The signing config
* @param logger a logger object to receive the log of the creation.
* @throws KeytoolException
*/ | Creates a new debug store with the location, keyalias, and passwords specified in the config | createDebugStore | {
"repo_name": "consulo/consulo-android",
"path": "tools-base/sdk-common/src/main/java/com/android/ide/common/signing/KeystoreHelper.java",
"license": "apache-2.0",
"size": 8847
} | [
"com.android.annotations.NonNull",
"com.android.annotations.Nullable",
"com.android.utils.ILogger",
"java.io.File"
] | import com.android.annotations.NonNull; import com.android.annotations.Nullable; import com.android.utils.ILogger; import java.io.File; | import com.android.annotations.*; import com.android.utils.*; import java.io.*; | [
"com.android.annotations",
"com.android.utils",
"java.io"
] | com.android.annotations; com.android.utils; java.io; | 1,482,170 |
public void setApiName(AS2ApiName apiName) {
this.apiName = apiName;
} | void function(AS2ApiName apiName) { this.apiName = apiName; } | /**
* What kind of operation to perform
*/ | What kind of operation to perform | setApiName | {
"repo_name": "sverkera/camel",
"path": "components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Configuration.java",
"license": "apache-2.0",
"size": 11999
} | [
"org.apache.camel.component.as2.internal.AS2ApiName"
] | import org.apache.camel.component.as2.internal.AS2ApiName; | import org.apache.camel.component.as2.internal.*; | [
"org.apache.camel"
] | org.apache.camel; | 1,296,245 |
@Test
public void testCreateAndGetIssueWithCategory() throws RedmineException {
IssueCategory newIssueCategory = null;
Issue newIssue = null;
try {
Project project = projectManager.getProjectByKey(projectKey);
// create an issue category
IssueCategory category = IssueCategoryFactory.create(project, "Category_"
+ new Date().getTime());
category.setAssignee(IntegrationTestHelper.getOurUser());
newIssueCategory = issueManager.createCategory(category);
// create an issue
Issue issueToCreate = IssueFactory.create(projectId, "getIssueWithCategory_" + UUID.randomUUID());
issueToCreate.setCategory(newIssueCategory);
newIssue = issueManager.createIssue(issueToCreate);
// retrieve issue
Issue retrievedIssue = issueManager.getIssueById(newIssue.getId());
// assert retrieved category of issue
IssueCategory retrievedCategory = retrievedIssue.getCategory();
assertNotNull("Category retrieved for issue " + newIssue.getId()
+ " should not be null", retrievedCategory);
assertEquals("ID of category retrieved for issue "
+ newIssue.getId() + " is wrong", newIssueCategory.getId(),
retrievedCategory.getId());
assertEquals("Name of category retrieved for issue "
+ newIssue.getId() + " is wrong",
newIssueCategory.getName(), retrievedCategory.getName());
} finally {
if (newIssue != null) {
issueManager.deleteIssue(newIssue.getId());
}
if (newIssueCategory != null) {
issueManager.deleteCategory(newIssueCategory);
}
}
} | void function() throws RedmineException { IssueCategory newIssueCategory = null; Issue newIssue = null; try { Project project = projectManager.getProjectByKey(projectKey); IssueCategory category = IssueCategoryFactory.create(project, STR + new Date().getTime()); category.setAssignee(IntegrationTestHelper.getOurUser()); newIssueCategory = issueManager.createCategory(category); Issue issueToCreate = IssueFactory.create(projectId, STR + UUID.randomUUID()); issueToCreate.setCategory(newIssueCategory); newIssue = issueManager.createIssue(issueToCreate); Issue retrievedIssue = issueManager.getIssueById(newIssue.getId()); IssueCategory retrievedCategory = retrievedIssue.getCategory(); assertNotNull(STR + newIssue.getId() + STR, retrievedCategory); assertEquals(STR + newIssue.getId() + STR, newIssueCategory.getId(), retrievedCategory.getId()); assertEquals(STR + newIssue.getId() + STR, newIssueCategory.getName(), retrievedCategory.getName()); } finally { if (newIssue != null) { issueManager.deleteIssue(newIssue.getId()); } if (newIssueCategory != null) { issueManager.deleteCategory(newIssueCategory); } } } | /**
* Tests the creation and retrieval of an
* {@link com.taskadapter.redmineapi.bean.Issue} with a
* {@link IssueCategory}.
*
* @throws RedmineException thrown in case something went wrong in Redmine
* @throws java.io.IOException thrown in case something went wrong while performing I/O
* operations
* @throws RedmineAuthenticationException thrown in case something went wrong while trying to login
* @throws NotFoundException thrown in case the objects requested for could not be found
*/ | Tests the creation and retrieval of an <code>com.taskadapter.redmineapi.bean.Issue</code> with a <code>IssueCategory</code> | testCreateAndGetIssueWithCategory | {
"repo_name": "sleroy/redmine-java-api",
"path": "src/test/java/com/taskadapter/redmineapi/IssueManagerTest.java",
"license": "apache-2.0",
"size": 59599
} | [
"com.taskadapter.redmineapi.IssueHelper",
"com.taskadapter.redmineapi.bean.Issue",
"com.taskadapter.redmineapi.bean.IssueCategory",
"com.taskadapter.redmineapi.bean.IssueCategoryFactory",
"com.taskadapter.redmineapi.bean.IssueFactory",
"com.taskadapter.redmineapi.bean.Project",
"java.util.Date",
"java.util.UUID",
"org.junit.Assert"
] | import com.taskadapter.redmineapi.IssueHelper; import com.taskadapter.redmineapi.bean.Issue; import com.taskadapter.redmineapi.bean.IssueCategory; import com.taskadapter.redmineapi.bean.IssueCategoryFactory; import com.taskadapter.redmineapi.bean.IssueFactory; import com.taskadapter.redmineapi.bean.Project; import java.util.Date; import java.util.UUID; import org.junit.Assert; | import com.taskadapter.redmineapi.*; import com.taskadapter.redmineapi.bean.*; import java.util.*; import org.junit.*; | [
"com.taskadapter.redmineapi",
"java.util",
"org.junit"
] | com.taskadapter.redmineapi; java.util; org.junit; | 1,269,605 |
public static MutationProto toMutationNoData(final MutationType type, final Mutation mutation)
throws IOException {
MutationProto.Builder builder = MutationProto.newBuilder();
return toMutationNoData(type, mutation, builder);
}
/**
* Code shared by {@link #toMutation(MutationType, Mutation)} and
* {@link #toMutationNoData(MutationType, Mutation)} | static MutationProto function(final MutationType type, final Mutation mutation) throws IOException { MutationProto.Builder builder = MutationProto.newBuilder(); return toMutationNoData(type, mutation, builder); } /** * Code shared by {@link #toMutation(MutationType, Mutation)} and * {@link #toMutationNoData(MutationType, Mutation)} | /**
* Create a protocol buffer MutationProto based on a client Mutation. Does NOT include data.
* Understanding is that the Cell will be transported other than via protobuf.
* @param type
* @param mutation
* @return a protobuf'd Mutation
* @throws IOException
*/ | Create a protocol buffer MutationProto based on a client Mutation. Does NOT include data. Understanding is that the Cell will be transported other than via protobuf | toMutationNoData | {
"repo_name": "lilonglai/hbase-0.96.2",
"path": "hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java",
"license": "apache-2.0",
"size": 94271
} | [
"java.io.IOException",
"org.apache.hadoop.hbase.client.Mutation",
"org.apache.hadoop.hbase.protobuf.generated.ClientProtos"
] | import java.io.IOException; import org.apache.hadoop.hbase.client.Mutation; import org.apache.hadoop.hbase.protobuf.generated.ClientProtos; | import java.io.*; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.protobuf.generated.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 1,214,412 |
protected static String literalBitsString(CstLiteralBits value) {
StringBuffer sb = new StringBuffer(100);
sb.append('#');
if (value instanceof CstKnownNull) {
sb.append("null");
} else {
sb.append(value.typeName());
sb.append(' ');
sb.append(value.toHuman());
}
return sb.toString();
}
/**
* Helper method to return a literal bits comment string.
*
* @param value the value
* @param width the width of the constant, in bits (used for displaying
* the uninterpreted bits; one of: {@code 4 8 16 32 64} | static String function(CstLiteralBits value) { StringBuffer sb = new StringBuffer(100); sb.append('#'); if (value instanceof CstKnownNull) { sb.append("null"); } else { sb.append(value.typeName()); sb.append(' '); sb.append(value.toHuman()); } return sb.toString(); } /** * Helper method to return a literal bits comment string. * * @param value the value * @param width the width of the constant, in bits (used for displaying * the uninterpreted bits; one of: {@code 4 8 16 32 64} | /**
* Helper method to return a literal bits argument string.
*
* @param value the value
* @return {@code non-null;} the string form
*/ | Helper method to return a literal bits argument string | literalBitsString | {
"repo_name": "RyanTech/DexHunter",
"path": "dalvik/dexgen/src/com/android/dexgen/dex/code/InsnFormat.java",
"license": "apache-2.0",
"size": 18563
} | [
"com.android.dexgen.rop.cst.CstKnownNull",
"com.android.dexgen.rop.cst.CstLiteralBits"
] | import com.android.dexgen.rop.cst.CstKnownNull; import com.android.dexgen.rop.cst.CstLiteralBits; | import com.android.dexgen.rop.cst.*; | [
"com.android.dexgen"
] | com.android.dexgen; | 1,483,122 |
@Auditable(parameters = {"parentNodeRef", "name", "typeQName"})
public FileInfo create(NodeRef parentNodeRef, String name, QName typeQName, QName assocQName) throws FileExistsException;
| @Auditable(parameters = {STR, "name", STR}) FileInfo function(NodeRef parentNodeRef, String name, QName typeQName, QName assocQName) throws FileExistsException; | /**
* Create a file or folder; or any valid node of type derived from file or folder
*
* @param parentNodeRef the parent node. The parent must be a valid
* {@link org.alfresco.model.ContentModel#TYPE_FOLDER folder}.
* @param name the name of the node
* @param typeQName the type to create
* @param assocQName the association QName to set for the path (may be <tt>null</tt>).
* @return Returns the new node's file information
* @throws FileExistsException
*/ | Create a file or folder; or any valid node of type derived from file or folder | create | {
"repo_name": "daniel-he/community-edition",
"path": "projects/repository/source/java/org/alfresco/service/cmr/model/FileFolderService.java",
"license": "lgpl-3.0",
"size": 21841
} | [
"org.alfresco.service.Auditable",
"org.alfresco.service.cmr.repository.NodeRef",
"org.alfresco.service.namespace.QName"
] | import org.alfresco.service.Auditable; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.namespace.QName; | import org.alfresco.service.*; import org.alfresco.service.cmr.repository.*; import org.alfresco.service.namespace.*; | [
"org.alfresco.service"
] | org.alfresco.service; | 838,652 |
protected boolean hasActionRequests(Document document) {
boolean hasActionRequests = false;
for (ActionRequest actionRequest : document.getActionRequests()) {
if (StringUtils.equals(actionRequest.getActionRequested().getCode(), ActionRequestType.APPROVE.getCode())
|| StringUtils.equals(actionRequest.getActionRequested().getCode(), ActionRequestType.COMPLETE.getCode())) {
hasActionRequests = true;
break;
}
}
return hasActionRequests;
}
| boolean function(Document document) { boolean hasActionRequests = false; for (ActionRequest actionRequest : document.getActionRequests()) { if (StringUtils.equals(actionRequest.getActionRequested().getCode(), ActionRequestType.APPROVE.getCode()) StringUtils.equals(actionRequest.getActionRequested().getCode(), ActionRequestType.COMPLETE.getCode())) { hasActionRequests = true; break; } } return hasActionRequests; } | /**
* Returns whether the {@code document} has any APPROVE or COMPLETE action requests.
*
* @param document the document to check
*
* @return true if the {@code document} has any APPROVE or COMPLETE action requests, false otherwise
*/ | Returns whether the document has any APPROVE or COMPLETE action requests | hasActionRequests | {
"repo_name": "jruchcolo/rice-cd",
"path": "rice-framework/krad-web-framework/src/main/java/org/kuali/rice/krad/document/DocumentPresentationControllerBase.java",
"license": "apache-2.0",
"size": 13676
} | [
"org.apache.commons.lang.StringUtils",
"org.kuali.rice.kew.api.action.ActionRequest",
"org.kuali.rice.kew.api.action.ActionRequestType"
] | import org.apache.commons.lang.StringUtils; import org.kuali.rice.kew.api.action.ActionRequest; import org.kuali.rice.kew.api.action.ActionRequestType; | import org.apache.commons.lang.*; import org.kuali.rice.kew.api.action.*; | [
"org.apache.commons",
"org.kuali.rice"
] | org.apache.commons; org.kuali.rice; | 1,670,179 |
public ServiceFuture<Void> deleteAsync(String resourceGroupName, String policyName, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, policyName), serviceCallback);
} | ServiceFuture<Void> function(String resourceGroupName, String policyName, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, policyName), serviceCallback); } | /**
* Deletes Policy.
*
* @param resourceGroupName The name of the resource group.
* @param policyName The name of the policy.
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/ | Deletes Policy | deleteAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/network/v2019_09_01/implementation/WebApplicationFirewallPoliciesInner.java",
"license": "mit",
"size": 51475
} | [
"com.microsoft.rest.ServiceCallback",
"com.microsoft.rest.ServiceFuture"
] | import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 1,584,087 |
public void setAllocationConfigs(final AllocationConfigs allocationConfigs) {
this.allocationConfigs = allocationConfigs;
} | void function(final AllocationConfigs allocationConfigs) { this.allocationConfigs = allocationConfigs; } | /**
* sets the allocation configs
*
*/ | sets the allocation configs | setAllocationConfigs | {
"repo_name": "AURIN/online-whatif",
"path": "src/main/java/au/org/aurin/wif/model/WifProject.java",
"license": "mit",
"size": 34306
} | [
"au.org.aurin.wif.model.allocation.AllocationConfigs"
] | import au.org.aurin.wif.model.allocation.AllocationConfigs; | import au.org.aurin.wif.model.allocation.*; | [
"au.org.aurin"
] | au.org.aurin; | 479,151 |
public static double utcOffset() {
Calendar cal = Calendar.getInstance();
// 4am
return 4 * 60 * 60 - (cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET)) / 1000;
} | static double function() { Calendar cal = Calendar.getInstance(); return 4 * 60 * 60 - (cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET)) / 1000; } | /**
* Calculate the UTC offset
*/ | Calculate the UTC offset | utcOffset | {
"repo_name": "stockcode/vicky-learn",
"path": "src/main/java/com/ichi2/libanki/Utils.java",
"license": "gpl-3.0",
"size": 46072
} | [
"java.util.Calendar"
] | import java.util.Calendar; | import java.util.*; | [
"java.util"
] | java.util; | 2,160,170 |
public Paint getTickLabelPaint(Comparable category) {
ParamChecks.nullNotPermitted(category, "category");
Paint result = this.tickLabelPaintMap.get(category);
// if there is no specific paint, use the general one...
if (result == null) {
result = getTickLabelPaint();
}
return result;
} | Paint function(Comparable category) { ParamChecks.nullNotPermitted(category, STR); Paint result = this.tickLabelPaintMap.get(category); if (result == null) { result = getTickLabelPaint(); } return result; } | /**
* Returns the paint for the tick label for the given category.
*
* @param category the category (<code>null</code> not permitted).
*
* @return The paint (never <code>null</code>).
*
* @see #setTickLabelPaint(Paint)
*/ | Returns the paint for the tick label for the given category | getTickLabelPaint | {
"repo_name": "akardapolov/ASH-Viewer",
"path": "jfreechart-fse/src/main/java/org/jfree/chart/axis/CategoryAxis.java",
"license": "gpl-3.0",
"size": 54058
} | [
"java.awt.Paint",
"org.jfree.chart.util.ParamChecks"
] | import java.awt.Paint; import org.jfree.chart.util.ParamChecks; | import java.awt.*; import org.jfree.chart.util.*; | [
"java.awt",
"org.jfree.chart"
] | java.awt; org.jfree.chart; | 1,193,272 |
private final void replaceFragment(ABaseFragment frag) {
getFragmentManager().beginTransaction().addToBackStack(null)
.replace(mTwoPane ? PANE_RIGHT : PANE_LEFT, frag, frag.getFragmentTag()).commit();
} | final void function(ABaseFragment frag) { getFragmentManager().beginTransaction().addToBackStack(null) .replace(mTwoPane ? PANE_RIGHT : PANE_LEFT, frag, frag.getFragmentTag()).commit(); } | /**
* Helper method to replace the fragment location of detailed views.
*
* @param frag
*/ | Helper method to replace the fragment location of detailed views | replaceFragment | {
"repo_name": "ToxicBakery/Tekdaqc-Android-Manager",
"path": "src/com/toxicbakery/android/tekdaqc/TekActivity.java",
"license": "apache-2.0",
"size": 1938
} | [
"com.toxicbakery.android.tekdaqc.fragments.ABaseFragment"
] | import com.toxicbakery.android.tekdaqc.fragments.ABaseFragment; | import com.toxicbakery.android.tekdaqc.fragments.*; | [
"com.toxicbakery.android"
] | com.toxicbakery.android; | 2,338,578 |
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<RedisResourceInner> listByResourceGroup(String resourceGroupName); | @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable<RedisResourceInner> listByResourceGroup(String resourceGroupName); | /**
* Lists all Redis caches in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response of list Redis operation as paginated response with {@link PagedIterable}.
*/ | Lists all Redis caches in a resource group | listByResourceGroup | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/RedisClient.java",
"license": "mit",
"size": 50974
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.PagedIterable",
"com.azure.resourcemanager.redis.fluent.models.RedisResourceInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.resourcemanager.redis.fluent.models.RedisResourceInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.resourcemanager.redis.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 1,081,644 |
public void addChangeListener(MarkerChangeListener listener) {
this.listenerList.add(MarkerChangeListener.class, listener);
}
| void function(MarkerChangeListener listener) { this.listenerList.add(MarkerChangeListener.class, listener); } | /**
* Registers an object for notification of changes to the marker.
*
* @param listener the object to be registered.
*
* @see #removeChangeListener(MarkerChangeListener)
*
* @since 1.0.3
*/ | Registers an object for notification of changes to the marker | addChangeListener | {
"repo_name": "martingwhite/astor",
"path": "examples/chart_11/source/org/jfree/chart/plot/Marker.java",
"license": "gpl-2.0",
"size": 21744
} | [
"org.jfree.chart.event.MarkerChangeListener"
] | import org.jfree.chart.event.MarkerChangeListener; | import org.jfree.chart.event.*; | [
"org.jfree.chart"
] | org.jfree.chart; | 2,379,521 |
public memcached_stat_st memcached_stat(memcached_st ptr, String args, IntByReference error); | memcached_stat_st function(memcached_st ptr, String args, IntByReference error); | /**
* C func: memcached_stat_st *memcached_stat(memcached_st *ptr, char *args, memcached_return_t *error);
*/ | C func: memcached_stat_st *memcached_stat(memcached_st *ptr, char *args, memcached_return_t *error) | memcached_stat | {
"repo_name": "nowelium/jna-libmemcached",
"path": "src/libmemcached/stats.java",
"license": "bsd-3-clause",
"size": 3773
} | [
"com.sun.jna.ptr.IntByReference"
] | import com.sun.jna.ptr.IntByReference; | import com.sun.jna.ptr.*; | [
"com.sun.jna"
] | com.sun.jna; | 191,211 |
public List<String> getAllValidationFailures() {
return allValidationFailures();
} | List<String> function() { return allValidationFailures(); } | /**
* All the validation failures, including index level validation failures.
*/ | All the validation failures, including index level validation failures | getAllValidationFailures | {
"repo_name": "jprante/elasticsearch-client",
"path": "elasticsearch-client-admin/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthResponse.java",
"license": "apache-2.0",
"size": 6863
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,684,587 |
Duration duration = new Duration(2);
activity = new Activity(duration);
Assert.assertEquals(duration, activity.duration);
Assert.assertNotNull(activity.legalTimeline);
Assert.assertEquals("", activity.title);
Assert.assertTrue(activity.legalTimeline.isEmpty());
Activity copy = (Activity) DeepCopy.copy(activity);
Assert.assertEquals(copy, activity);
Assert.assertFalse(copy == activity);
}
| Duration duration = new Duration(2); activity = new Activity(duration); Assert.assertEquals(duration, activity.duration); Assert.assertNotNull(activity.legalTimeline); Assert.assertEquals("", activity.title); Assert.assertTrue(activity.legalTimeline.isEmpty()); Activity copy = (Activity) DeepCopy.copy(activity); Assert.assertEquals(copy, activity); Assert.assertFalse(copy == activity); } | /**
* Test constructor
*/ | Test constructor | testActivityDuration | {
"repo_name": "bettytuan0209/travelscheduler",
"path": "test/schedulable/ActivityTest.java",
"license": "apache-2.0",
"size": 3651
} | [
"org.joda.time.Duration",
"org.junit.Assert"
] | import org.joda.time.Duration; import org.junit.Assert; | import org.joda.time.*; import org.junit.*; | [
"org.joda.time",
"org.junit"
] | org.joda.time; org.junit; | 2,710,835 |
public static BlockRegion calcChunkRegion(BlockRegion region, int chunkX, int chunkY, int chunkZ, BlockRegion dest) {
return dest.
setMin(calcChunkPos(region.getMinX(), chunkX), calcChunkPos(region.getMinY(), chunkY), calcChunkPos(region.getMinZ(), chunkZ)).
setMax(calcChunkPos(region.getMaxX(), chunkX), calcChunkPos(region.getMaxY(), chunkY), calcChunkPos(region.getMaxZ(), chunkZ));
} | static BlockRegion function(BlockRegion region, int chunkX, int chunkY, int chunkZ, BlockRegion dest) { return dest. setMin(calcChunkPos(region.getMinX(), chunkX), calcChunkPos(region.getMinY(), chunkY), calcChunkPos(region.getMinZ(), chunkZ)). setMax(calcChunkPos(region.getMaxX(), chunkX), calcChunkPos(region.getMaxY(), chunkY), calcChunkPos(region.getMaxZ(), chunkZ)); } | /**
* calculates a region that encasing a chunk
*
* @param region a bounding box that is contained
* @param chunkX the x unit size of the chunk in powers of 2
* @param chunkY the y unit size of the chunk in powers of 2
* @param chunkZ the z unit size of the chunk in powers of 2
* @param dest will hold the result
* @return dest
*/ | calculates a region that encasing a chunk | calcChunkRegion | {
"repo_name": "Malanius/Terasology",
"path": "engine/src/main/java/org/terasology/math/ChunkMath.java",
"license": "apache-2.0",
"size": 21176
} | [
"org.terasology.world.block.BlockRegion"
] | import org.terasology.world.block.BlockRegion; | import org.terasology.world.block.*; | [
"org.terasology.world"
] | org.terasology.world; | 1,498,242 |
public boolean removeWallItemFromWall(final WallItem item);
| boolean function(final WallItem item); | /**
* Removes a wall item.
*
* @param item the wall item to remove.
* @return <code>true</code> on success, <code>false</code> on failure.
*/ | Removes a wall item | removeWallItemFromWall | {
"repo_name": "marktriggs/nyu-sakai-10.4",
"path": "profile2/impl/src/java/org/sakaiproject/profile2/dao/ProfileDao.java",
"license": "apache-2.0",
"size": 19837
} | [
"org.sakaiproject.profile2.model.WallItem"
] | import org.sakaiproject.profile2.model.WallItem; | import org.sakaiproject.profile2.model.*; | [
"org.sakaiproject.profile2"
] | org.sakaiproject.profile2; | 1,180,454 |
@VisibleForTesting
protected String generateContainerNameFromImageRef(String image) {
String containerName;
if (image.contains("@")) {
// Image is tagged with digest; we trim digest to 10 chars and remove "sha256"
String[] parts = image.split("@");
String imagePart = parts[0];
String digest = parts[1];
if (digest.contains(":")) {
digest = digest.split(":")[1];
}
if (digest.length() > 10) {
digest = digest.substring(0, 10);
}
image = String.format("%s-%s", imagePart, digest);
}
containerName = image.toLowerCase().replaceAll("[^/]*/", "").replaceAll("[^\\d\\w-]", "-");
if (containerName.length() > 63) {
containerName = containerName.substring(0, 63);
}
return containerName;
}
public static class BrokersConfigs {
public Map<String, InternalMachineConfig> machines;
public Map<String, ConfigMap> configMaps;
public Map<String, Pod> pods;
} | String function(String image) { String containerName; if (image.contains("@")) { String[] parts = image.split("@"); String imagePart = parts[0]; String digest = parts[1]; if (digest.contains(":")) { digest = digest.split(":")[1]; } if (digest.length() > 10) { digest = digest.substring(0, 10); } image = String.format("%s-%s", imagePart, digest); } containerName = image.toLowerCase().replaceAll(STR, STR[^\\d\\w-]STR-"); if (containerName.length() > 63) { containerName = containerName.substring(0, 63); } return containerName; } public static class BrokersConfigs { public Map<String, InternalMachineConfig> machines; public Map<String, ConfigMap> configMaps; public Map<String, Pod> pods; } | /**
* Generate a container name from an image reference. Since full image references can be over 63
* characters, we need to strip registry and organization from the image reference to limit name
* length.
*/ | Generate a container name from an image reference. Since full image references can be over 63 characters, we need to strip registry and organization from the image reference to limit name length | generateContainerNameFromImageRef | {
"repo_name": "codenvy/che",
"path": "infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/wsplugins/brokerphases/BrokerEnvironmentFactory.java",
"license": "epl-1.0",
"size": 12781
} | [
"io.fabric8.kubernetes.api.model.ConfigMap",
"io.fabric8.kubernetes.api.model.Pod",
"java.util.Map",
"org.eclipse.che.api.workspace.server.spi.environment.InternalMachineConfig"
] | import io.fabric8.kubernetes.api.model.ConfigMap; import io.fabric8.kubernetes.api.model.Pod; import java.util.Map; import org.eclipse.che.api.workspace.server.spi.environment.InternalMachineConfig; | import io.fabric8.kubernetes.api.model.*; import java.util.*; import org.eclipse.che.api.workspace.server.spi.environment.*; | [
"io.fabric8.kubernetes",
"java.util",
"org.eclipse.che"
] | io.fabric8.kubernetes; java.util; org.eclipse.che; | 276,673 |
static void show(Context context) {
final Intent intent = new Intent(context, UserSettingsActivity.class);
context.startActivity(intent);
} | static void show(Context context) { final Intent intent = new Intent(context, UserSettingsActivity.class); context.startActivity(intent); } | /**
* Starts the PreferencesActivity for the specified user.
*
* @param context
* The application's environment.
*/ | Starts the PreferencesActivity for the specified user | show | {
"repo_name": "zhaque/my-wallpaper",
"path": "src/com/koonen/photostream/settings/UserSettingsActivity.java",
"license": "mit",
"size": 2434
} | [
"android.content.Context",
"android.content.Intent"
] | import android.content.Context; import android.content.Intent; | import android.content.*; | [
"android.content"
] | android.content; | 1,331,826 |
@ApiModelProperty(example = "null", value = "Internal server error message")
public String getError() {
return error;
} | @ApiModelProperty(example = "null", value = STR) String function() { return error; } | /**
* Internal server error message
* @return error
**/ | Internal server error message | getError | {
"repo_name": "Tmin10/EVE-Security-Service",
"path": "server-api/src/main/java/ru/tmin10/EVESecurityService/serverApi/model/GetUniverseSystemsSystemIdInternalServerError.java",
"license": "gpl-3.0",
"size": 2288
} | [
"io.swagger.annotations.ApiModelProperty"
] | import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.*; | [
"io.swagger.annotations"
] | io.swagger.annotations; | 724,337 |
public boolean isRegALocal(RegisterSpec spec) {
SsaInsn defn = getDefinitionForRegister(spec.getReg());
if (defn == null) {
// version 0 registers are never used as locals
return false;
}
// Does the definition have a local associated with it?
if (defn.getLocalAssignment() != null) return true;
// If not, is there a mark-local insn?
for (SsaInsn use : getUseListForRegister(spec.getReg())) {
Insn insn = use.getOriginalRopInsn();
if (insn != null
&& insn.getOpcode().getOpcode() == RegOps.MARK_LOCAL) {
return true;
}
}
return false;
} | boolean function(RegisterSpec spec) { SsaInsn defn = getDefinitionForRegister(spec.getReg()); if (defn == null) { return false; } if (defn.getLocalAssignment() != null) return true; for (SsaInsn use : getUseListForRegister(spec.getReg())) { Insn insn = use.getOriginalRopInsn(); if (insn != null && insn.getOpcode().getOpcode() == RegOps.MARK_LOCAL) { return true; } } return false; } | /**
* Checks to see if the given SSA reg is ever associated with a local
* local variable. Each SSA reg may be associated with at most one
* local var.
*
* @param spec {@code non-null;} ssa reg
* @return true if reg is ever associated with a local
*/ | Checks to see if the given SSA reg is ever associated with a local local variable. Each SSA reg may be associated with at most one local var | isRegALocal | {
"repo_name": "alibaba/atlas",
"path": "atlas-gradle-plugin/dexpatch/src/main/java/com/taobao/android/dx/ssa/SsaMethod.java",
"license": "apache-2.0",
"size": 27034
} | [
"com.taobao.android.dx.rop.code.Insn",
"com.taobao.android.dx.rop.code.RegOps",
"com.taobao.android.dx.rop.code.RegisterSpec"
] | import com.taobao.android.dx.rop.code.Insn; import com.taobao.android.dx.rop.code.RegOps; import com.taobao.android.dx.rop.code.RegisterSpec; | import com.taobao.android.dx.rop.code.*; | [
"com.taobao.android"
] | com.taobao.android; | 155,773 |
final int expectedCount = 50;
final int maxSizeQueue = 5;
final int timOut = 10000;
List<Integer> externalList = new ArrayList<>();
SimpleBlockingQueue<Integer> simpleBlockingQueue = new SimpleBlockingQueue<>(expectedCount, maxSizeQueue);
Threads allThread = new Threads(simpleBlockingQueue, externalList);
Thread[] producers = new Thread[simpleBlockingQueue.getRandomNumber()];
Thread[] consumers = new Thread[simpleBlockingQueue.getRandomNumber()];
for (int i = 0; i < producers.length; i++) {
producers[i] = allThread.getProducer();
producers[i].start();
}
for (int i = 0; i < consumers.length; i++) {
consumers[i] = allThread.getConsumer();
consumers[i].start();
}
try {
Thread.sleep(timOut);
} catch (InterruptedException e) {
e.printStackTrace();
}
assertThat(expectedCount, is(externalList.size()));
assertThat(0, is(simpleBlockingQueue.getSize()));
assertThat(expectedCount, is(simpleBlockingQueue.getCountOffer()));
} | final int expectedCount = 50; final int maxSizeQueue = 5; final int timOut = 10000; List<Integer> externalList = new ArrayList<>(); SimpleBlockingQueue<Integer> simpleBlockingQueue = new SimpleBlockingQueue<>(expectedCount, maxSizeQueue); Threads allThread = new Threads(simpleBlockingQueue, externalList); Thread[] producers = new Thread[simpleBlockingQueue.getRandomNumber()]; Thread[] consumers = new Thread[simpleBlockingQueue.getRandomNumber()]; for (int i = 0; i < producers.length; i++) { producers[i] = allThread.getProducer(); producers[i].start(); } for (int i = 0; i < consumers.length; i++) { consumers[i] = allThread.getConsumer(); consumers[i].start(); } try { Thread.sleep(timOut); } catch (InterruptedException e) { e.printStackTrace(); } assertThat(expectedCount, is(externalList.size())); assertThat(0, is(simpleBlockingQueue.getSize())); assertThat(expectedCount, is(simpleBlockingQueue.getCountOffer())); } | /**
* Testing patterns producer-consumer, with random count producer and consumer.
*/ | Testing patterns producer-consumer, with random count producer and consumer | whenRandomCountProducerRandomCountConsumerThenGetResult | {
"repo_name": "forvvard09/job4j_CoursesJunior",
"path": "2_Standart/02_Multithreading/04_WaitNotiyNotifyAll/task_2_02_04_01/src/test/java/ru/spoddubnyak/monitor/SimpleBlockingQueueTest.java",
"license": "apache-2.0",
"size": 2769
} | [
"java.util.ArrayList",
"java.util.List",
"org.hamcrest.core.Is",
"org.junit.Assert"
] | import java.util.ArrayList; import java.util.List; import org.hamcrest.core.Is; import org.junit.Assert; | import java.util.*; import org.hamcrest.core.*; import org.junit.*; | [
"java.util",
"org.hamcrest.core",
"org.junit"
] | java.util; org.hamcrest.core; org.junit; | 1,931,634 |
private List<RosterMember> getEnrollmentMembership(Site site, String enrollmentSetId, String enrollmentStatusId, String currentUserId) {
if (site == null) {
return null;
}
if (!isAllowed(currentUserId, RosterFunctions.ROSTER_FUNCTION_VIEWENROLLMENTSTATUS, site.getReference())) {
return null;
}
Map<String, List<RosterMember>> membersMap = getAndCacheSortedEnrollmentSet(site, enrollmentSetId);
String key = (enrollmentStatusId == null) ? enrollmentSetId + "#all" : enrollmentSetId + "#" + enrollmentStatusId;
if (log.isDebugEnabled()) {
log.debug("Trying to get members list " + key + " from membersMap ...");
}
List<RosterMember> members = membersMap.get(key);
if (members != null) {
return filterMembers(site, currentUserId, members, null);
} else {
log.error("No enrollment set");
return null;
}
} | List<RosterMember> function(Site site, String enrollmentSetId, String enrollmentStatusId, String currentUserId) { if (site == null) { return null; } if (!isAllowed(currentUserId, RosterFunctions.ROSTER_FUNCTION_VIEWENROLLMENTSTATUS, site.getReference())) { return null; } Map<String, List<RosterMember>> membersMap = getAndCacheSortedEnrollmentSet(site, enrollmentSetId); String key = (enrollmentStatusId == null) ? enrollmentSetId + "#all" : enrollmentSetId + "#" + enrollmentStatusId; if (log.isDebugEnabled()) { log.debug(STR + key + STR); } List<RosterMember> members = membersMap.get(key); if (members != null) { return filterMembers(site, currentUserId, members, null); } else { log.error(STR); return null; } } | /**
* Returns the enrollment set members for the specified site and enrollment
* set.
*
* @param siteId the ID of the site.
* @param enrollmentSetId the ID of the enrollment set.
* @return the enrollment set members for the specified site and enrollment
* set.
*/ | Returns the enrollment set members for the specified site and enrollment set | getEnrollmentMembership | {
"repo_name": "kingmook/sakai",
"path": "roster2/src/java/org/sakaiproject/roster/impl/SakaiProxyImpl.java",
"license": "apache-2.0",
"size": 37038
} | [
"java.util.List",
"java.util.Map",
"org.sakaiproject.roster.api.RosterFunctions",
"org.sakaiproject.roster.api.RosterMember",
"org.sakaiproject.site.api.Site"
] | import java.util.List; import java.util.Map; import org.sakaiproject.roster.api.RosterFunctions; import org.sakaiproject.roster.api.RosterMember; import org.sakaiproject.site.api.Site; | import java.util.*; import org.sakaiproject.roster.api.*; import org.sakaiproject.site.api.*; | [
"java.util",
"org.sakaiproject.roster",
"org.sakaiproject.site"
] | java.util; org.sakaiproject.roster; org.sakaiproject.site; | 2,513,361 |
public List<Worker> findByG_U(long groupId, long userId)
throws SystemException {
return findByG_U(groupId, userId, QueryUtil.ALL_POS, QueryUtil.ALL_POS,
null);
} | List<Worker> function(long groupId, long userId) throws SystemException { return findByG_U(groupId, userId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); } | /**
* Returns all the workers where groupId = ? and userId = ?.
*
* @param groupId the group ID
* @param userId the user ID
* @return the matching workers
* @throws SystemException if a system exception occurred
*/ | Returns all the workers where groupId = ? and userId = ? | findByG_U | {
"repo_name": "rsicart/mpwc",
"path": "docroot/WEB-INF/src/com/mpwc/service/persistence/WorkerPersistenceImpl.java",
"license": "bsd-3-clause",
"size": 189688
} | [
"com.liferay.portal.kernel.dao.orm.QueryUtil",
"com.liferay.portal.kernel.exception.SystemException",
"com.mpwc.model.Worker",
"java.util.List"
] | import com.liferay.portal.kernel.dao.orm.QueryUtil; import com.liferay.portal.kernel.exception.SystemException; import com.mpwc.model.Worker; import java.util.List; | import com.liferay.portal.kernel.dao.orm.*; import com.liferay.portal.kernel.exception.*; import com.mpwc.model.*; import java.util.*; | [
"com.liferay.portal",
"com.mpwc.model",
"java.util"
] | com.liferay.portal; com.mpwc.model; java.util; | 404,004 |
public void close() {
try {
initFooter(); // line added by David Freels
addTabs(1);
writeEnd(HtmlTags.BODY);
os.write(NEWLINE);
writeEnd(HtmlTags.HTML);
super.close();
}
catch(IOException ioe) {
throw new ExceptionConverter(ioe);
}
}
// some protected methods
| void function() { try { initFooter(); addTabs(1); writeEnd(HtmlTags.BODY); os.write(NEWLINE); writeEnd(HtmlTags.HTML); super.close(); } catch(IOException ioe) { throw new ExceptionConverter(ioe); } } | /**
* Signals that the <CODE>Document</CODE> was closed and that no other
* <CODE>Elements</CODE> will be added.
*/ | Signals that the <code>Document</code> was closed and that no other <code>Elements</code> will be added | close | {
"repo_name": "shitalm/jsignpdf2",
"path": "src/main/java/com/lowagie/text/html/HtmlWriter.java",
"license": "gpl-2.0",
"size": 40324
} | [
"com.lowagie.text.ExceptionConverter",
"java.io.IOException"
] | import com.lowagie.text.ExceptionConverter; import java.io.IOException; | import com.lowagie.text.*; import java.io.*; | [
"com.lowagie.text",
"java.io"
] | com.lowagie.text; java.io; | 1,055,757 |
protected AdaptiveTrackSelection createAdaptiveTrackSelection(
TrackGroup group,
BandwidthMeter bandwidthMeter,
int[] tracks,
int totalFixedTrackBandwidth) {
return new AdaptiveTrackSelection(
group,
tracks,
new DefaultBandwidthProvider(bandwidthMeter, bandwidthFraction, totalFixedTrackBandwidth),
minDurationForQualityIncreaseMs,
maxDurationForQualityDecreaseMs,
minDurationToRetainAfterDiscardMs,
bufferedFractionToLiveEdgeForQualityIncrease,
minTimeBetweenBufferReevaluationMs,
clock);
}
}
public static final int DEFAULT_MIN_DURATION_FOR_QUALITY_INCREASE_MS = 10000;
public static final int DEFAULT_MAX_DURATION_FOR_QUALITY_DECREASE_MS = 25000;
public static final int DEFAULT_MIN_DURATION_TO_RETAIN_AFTER_DISCARD_MS = 25000;
public static final float DEFAULT_BANDWIDTH_FRACTION = 0.7f;
public static final float DEFAULT_BUFFERED_FRACTION_TO_LIVE_EDGE_FOR_QUALITY_INCREASE = 0.75f;
public static final long DEFAULT_MIN_TIME_BETWEEN_BUFFER_REEVALUTATION_MS = 2000;
private final BandwidthProvider bandwidthProvider;
private final long minDurationForQualityIncreaseUs;
private final long maxDurationForQualityDecreaseUs;
private final long minDurationToRetainAfterDiscardUs;
private final float bufferedFractionToLiveEdgeForQualityIncrease;
private final long minTimeBetweenBufferReevaluationMs;
private final Clock clock;
private float playbackSpeed;
private int selectedIndex;
private int reason;
private long lastBufferEvaluationMs;
public AdaptiveTrackSelection(TrackGroup group, int[] tracks,
BandwidthMeter bandwidthMeter) {
this(
group,
tracks,
bandwidthMeter,
0,
DEFAULT_MIN_DURATION_FOR_QUALITY_INCREASE_MS,
DEFAULT_MAX_DURATION_FOR_QUALITY_DECREASE_MS,
DEFAULT_MIN_DURATION_TO_RETAIN_AFTER_DISCARD_MS,
DEFAULT_BANDWIDTH_FRACTION,
DEFAULT_BUFFERED_FRACTION_TO_LIVE_EDGE_FOR_QUALITY_INCREASE,
DEFAULT_MIN_TIME_BETWEEN_BUFFER_REEVALUTATION_MS,
Clock.DEFAULT);
}
public AdaptiveTrackSelection(
TrackGroup group,
int[] tracks,
BandwidthMeter bandwidthMeter,
long reservedBandwidth,
long minDurationForQualityIncreaseMs,
long maxDurationForQualityDecreaseMs,
long minDurationToRetainAfterDiscardMs,
float bandwidthFraction,
float bufferedFractionToLiveEdgeForQualityIncrease,
long minTimeBetweenBufferReevaluationMs,
Clock clock) {
this(
group,
tracks,
new DefaultBandwidthProvider(bandwidthMeter, bandwidthFraction, reservedBandwidth),
minDurationForQualityIncreaseMs,
maxDurationForQualityDecreaseMs,
minDurationToRetainAfterDiscardMs,
bufferedFractionToLiveEdgeForQualityIncrease,
minTimeBetweenBufferReevaluationMs,
clock);
}
private AdaptiveTrackSelection(
TrackGroup group,
int[] tracks,
BandwidthProvider bandwidthProvider,
long minDurationForQualityIncreaseMs,
long maxDurationForQualityDecreaseMs,
long minDurationToRetainAfterDiscardMs,
float bufferedFractionToLiveEdgeForQualityIncrease,
long minTimeBetweenBufferReevaluationMs,
Clock clock) {
super(group, tracks);
this.bandwidthProvider = bandwidthProvider;
this.minDurationForQualityIncreaseUs = minDurationForQualityIncreaseMs * 1000L;
this.maxDurationForQualityDecreaseUs = maxDurationForQualityDecreaseMs * 1000L;
this.minDurationToRetainAfterDiscardUs = minDurationToRetainAfterDiscardMs * 1000L;
this.bufferedFractionToLiveEdgeForQualityIncrease =
bufferedFractionToLiveEdgeForQualityIncrease;
this.minTimeBetweenBufferReevaluationMs = minTimeBetweenBufferReevaluationMs;
this.clock = clock;
playbackSpeed = 1f;
reason = C.SELECTION_REASON_UNKNOWN;
lastBufferEvaluationMs = C.TIME_UNSET;
} | AdaptiveTrackSelection function( TrackGroup group, BandwidthMeter bandwidthMeter, int[] tracks, int totalFixedTrackBandwidth) { return new AdaptiveTrackSelection( group, tracks, new DefaultBandwidthProvider(bandwidthMeter, bandwidthFraction, totalFixedTrackBandwidth), minDurationForQualityIncreaseMs, maxDurationForQualityDecreaseMs, minDurationToRetainAfterDiscardMs, bufferedFractionToLiveEdgeForQualityIncrease, minTimeBetweenBufferReevaluationMs, clock); } } public static final int DEFAULT_MIN_DURATION_FOR_QUALITY_INCREASE_MS = 10000; public static final int DEFAULT_MAX_DURATION_FOR_QUALITY_DECREASE_MS = 25000; public static final int DEFAULT_MIN_DURATION_TO_RETAIN_AFTER_DISCARD_MS = 25000; public static final float DEFAULT_BANDWIDTH_FRACTION = 0.7f; public static final float DEFAULT_BUFFERED_FRACTION_TO_LIVE_EDGE_FOR_QUALITY_INCREASE = 0.75f; public static final long DEFAULT_MIN_TIME_BETWEEN_BUFFER_REEVALUTATION_MS = 2000; private final BandwidthProvider bandwidthProvider; private final long minDurationForQualityIncreaseUs; private final long maxDurationForQualityDecreaseUs; private final long minDurationToRetainAfterDiscardUs; private final float bufferedFractionToLiveEdgeForQualityIncrease; private final long minTimeBetweenBufferReevaluationMs; private final Clock clock; private float playbackSpeed; private int selectedIndex; private int reason; private long lastBufferEvaluationMs; public AdaptiveTrackSelection(TrackGroup group, int[] tracks, BandwidthMeter bandwidthMeter) { this( group, tracks, bandwidthMeter, 0, DEFAULT_MIN_DURATION_FOR_QUALITY_INCREASE_MS, DEFAULT_MAX_DURATION_FOR_QUALITY_DECREASE_MS, DEFAULT_MIN_DURATION_TO_RETAIN_AFTER_DISCARD_MS, DEFAULT_BANDWIDTH_FRACTION, DEFAULT_BUFFERED_FRACTION_TO_LIVE_EDGE_FOR_QUALITY_INCREASE, DEFAULT_MIN_TIME_BETWEEN_BUFFER_REEVALUTATION_MS, Clock.DEFAULT); } public AdaptiveTrackSelection( TrackGroup group, int[] tracks, BandwidthMeter bandwidthMeter, long reservedBandwidth, long minDurationForQualityIncreaseMs, long maxDurationForQualityDecreaseMs, long minDurationToRetainAfterDiscardMs, float bandwidthFraction, float bufferedFractionToLiveEdgeForQualityIncrease, long minTimeBetweenBufferReevaluationMs, Clock clock) { this( group, tracks, new DefaultBandwidthProvider(bandwidthMeter, bandwidthFraction, reservedBandwidth), minDurationForQualityIncreaseMs, maxDurationForQualityDecreaseMs, minDurationToRetainAfterDiscardMs, bufferedFractionToLiveEdgeForQualityIncrease, minTimeBetweenBufferReevaluationMs, clock); } private AdaptiveTrackSelection( TrackGroup group, int[] tracks, BandwidthProvider bandwidthProvider, long minDurationForQualityIncreaseMs, long maxDurationForQualityDecreaseMs, long minDurationToRetainAfterDiscardMs, float bufferedFractionToLiveEdgeForQualityIncrease, long minTimeBetweenBufferReevaluationMs, Clock clock) { super(group, tracks); this.bandwidthProvider = bandwidthProvider; this.minDurationForQualityIncreaseUs = minDurationForQualityIncreaseMs * 1000L; this.maxDurationForQualityDecreaseUs = maxDurationForQualityDecreaseMs * 1000L; this.minDurationToRetainAfterDiscardUs = minDurationToRetainAfterDiscardMs * 1000L; this.bufferedFractionToLiveEdgeForQualityIncrease = bufferedFractionToLiveEdgeForQualityIncrease; this.minTimeBetweenBufferReevaluationMs = minTimeBetweenBufferReevaluationMs; this.clock = clock; playbackSpeed = 1f; reason = C.SELECTION_REASON_UNKNOWN; lastBufferEvaluationMs = C.TIME_UNSET; } | /**
* Creates a single adaptive selection for the given group, bandwidth meter and tracks.
*
* @param group The {@link TrackGroup}.
* @param bandwidthMeter A {@link BandwidthMeter} which can be used to select tracks.
* @param tracks The indices of the selected tracks in the track group.
* @param totalFixedTrackBandwidth The total bandwidth used by all non-adaptive tracks, in bits
* per second.
* @return An {@link AdaptiveTrackSelection} for the specified tracks.
*/ | Creates a single adaptive selection for the given group, bandwidth meter and tracks | createAdaptiveTrackSelection | {
"repo_name": "superbderrick/ExoPlayer",
"path": "library/core/src/main/java/com/google/android/exoplayer2/trackselection/AdaptiveTrackSelection.java",
"license": "apache-2.0",
"size": 33050
} | [
"com.google.android.exoplayer2.source.TrackGroup",
"com.google.android.exoplayer2.upstream.BandwidthMeter",
"com.google.android.exoplayer2.util.Clock"
] | import com.google.android.exoplayer2.source.TrackGroup; import com.google.android.exoplayer2.upstream.BandwidthMeter; import com.google.android.exoplayer2.util.Clock; | import com.google.android.exoplayer2.source.*; import com.google.android.exoplayer2.upstream.*; import com.google.android.exoplayer2.util.*; | [
"com.google.android"
] | com.google.android; | 858,349 |
@Override
public void close() {
for (ResultSet<O> resultSet : this.resultSets) {
resultSet.close();
}
} | void function() { for (ResultSet<O> resultSet : this.resultSets) { resultSet.close(); } } | /**
* Closes all of the underlying {@code ResultSet}s.
*/ | Closes all of the underlying ResultSets | close | {
"repo_name": "npgall/cqengine",
"path": "code/src/main/java/com/googlecode/cqengine/resultset/connective/ResultSetUnion.java",
"license": "apache-2.0",
"size": 7180
} | [
"com.googlecode.cqengine.resultset.ResultSet"
] | import com.googlecode.cqengine.resultset.ResultSet; | import com.googlecode.cqengine.resultset.*; | [
"com.googlecode.cqengine"
] | com.googlecode.cqengine; | 870,877 |
@Test
public void testCreateAmqpStreamMessageFromAmqpSequence() throws Exception {
MessageImpl message = (MessageImpl) Message.Factory.create();
List<String> list = new ArrayList<>();
message.setBody(new AmqpSequence(list));
javax.jms.Message jmsMessage = ServerJMSMessage.wrapCoreMessage(encodeAndCreateAMQPMessage(message).toCore());
assertNotNull("Message should not be null", jmsMessage);
assertEquals("Unexpected message class type", ServerJMSStreamMessage.class, jmsMessage.getClass());
} | void function() throws Exception { MessageImpl message = (MessageImpl) Message.Factory.create(); List<String> list = new ArrayList<>(); message.setBody(new AmqpSequence(list)); javax.jms.Message jmsMessage = ServerJMSMessage.wrapCoreMessage(encodeAndCreateAMQPMessage(message).toCore()); assertNotNull(STR, jmsMessage); assertEquals(STR, ServerJMSStreamMessage.class, jmsMessage.getClass()); } | /**
* Test that an amqp-sequence body containing a list results in an StreamMessage when not
* otherwise annotated to indicate the type of JMS message it is.
*
* @throws Exception
* if an error occurs during the test.
*/ | Test that an amqp-sequence body containing a list results in an StreamMessage when not otherwise annotated to indicate the type of JMS message it is | testCreateAmqpStreamMessageFromAmqpSequence | {
"repo_name": "andytaylor/activemq-artemis",
"path": "artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/converter/message/JMSMappingInboundTransformerTest.java",
"license": "apache-2.0",
"size": 28044
} | [
"java.util.ArrayList",
"java.util.List",
"org.apache.activemq.artemis.protocol.amqp.converter.jms.ServerJMSMessage",
"org.apache.activemq.artemis.protocol.amqp.converter.jms.ServerJMSStreamMessage",
"org.apache.qpid.proton.amqp.messaging.AmqpSequence",
"org.apache.qpid.proton.message.Message",
"org.apache.qpid.proton.message.impl.MessageImpl",
"org.junit.Assert"
] | import java.util.ArrayList; import java.util.List; import org.apache.activemq.artemis.protocol.amqp.converter.jms.ServerJMSMessage; import org.apache.activemq.artemis.protocol.amqp.converter.jms.ServerJMSStreamMessage; import org.apache.qpid.proton.amqp.messaging.AmqpSequence; import org.apache.qpid.proton.message.Message; import org.apache.qpid.proton.message.impl.MessageImpl; import org.junit.Assert; | import java.util.*; import org.apache.activemq.artemis.protocol.amqp.converter.jms.*; import org.apache.qpid.proton.amqp.messaging.*; import org.apache.qpid.proton.message.*; import org.apache.qpid.proton.message.impl.*; import org.junit.*; | [
"java.util",
"org.apache.activemq",
"org.apache.qpid",
"org.junit"
] | java.util; org.apache.activemq; org.apache.qpid; org.junit; | 1,063,710 |
public KualiDecimal getIncomeAmount() {
return incomeAmount;
} | KualiDecimal function() { return incomeAmount; } | /**
* Gets the incomeAmount attribute.
* @return Returns the incomeAmount.
*/ | Gets the incomeAmount attribute | getIncomeAmount | {
"repo_name": "Ariah-Group/Finance",
"path": "af_webapp/src/main/java/org/kuali/kfs/module/endow/businessobject/TransactionDocumentForReportLineBase.java",
"license": "apache-2.0",
"size": 5417
} | [
"org.kuali.rice.core.api.util.type.KualiDecimal"
] | import org.kuali.rice.core.api.util.type.KualiDecimal; | import org.kuali.rice.core.api.util.type.*; | [
"org.kuali.rice"
] | org.kuali.rice; | 1,196,502 |
Observable<ServiceResponse<String>> getWhitespaceWithServiceResponseAsync(); | Observable<ServiceResponse<String>> getWhitespaceWithServiceResponseAsync(); | /**
* Get string value with leading and trailing whitespace '<tab><space><space>Now is the time for all good men to come to the aid of their country<tab><space><space>'.
*
* @return the observable to the String object
*/ | Get string value with leading and trailing whitespace '<tab><space><space>Now is the time for all good men to come to the aid of their country<tab><space><space>' | getWhitespaceWithServiceResponseAsync | {
"repo_name": "anudeepsharma/autorest",
"path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/bodystring/Strings.java",
"license": "mit",
"size": 17112
} | [
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.rest.ServiceResponse; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 475,561 |
@XmlElement(name = "min_nics")
public Integer getMinNics() {
return minNics;
} | @XmlElement(name = STR) Integer function() { return minNics; } | /**
* Minimum number of NICs supported by this virtual pool.
*
*/ | Minimum number of NICs supported by this virtual pool | getMinNics | {
"repo_name": "emcvipr/controller-client-java",
"path": "models/src/main/java/com/emc/storageos/model/vpool/ComputeVirtualPoolRestRep.java",
"license": "apache-2.0",
"size": 9713
} | [
"javax.xml.bind.annotation.XmlElement"
] | import javax.xml.bind.annotation.XmlElement; | import javax.xml.bind.annotation.*; | [
"javax.xml"
] | javax.xml; | 2,451,238 |
@ActionDoc(text = "Compute the Sea Level Pressure", returns = "Equivalent Seal Level pressure")
public static double getSeaLevelPressure(@ParamDoc(name = "absolute pressure hPa") double pressure,
@ParamDoc(name = "temperature (°C)") double temp, @ParamDoc(name = "Altitude in meter") double altitude) {
return UnitUtils.getSeaLevelPressure(pressure, temp, altitude);
} | @ActionDoc(text = STR, returns = STR) static double function(@ParamDoc(name = STR) double pressure, @ParamDoc(name = STR) double temp, @ParamDoc(name = STR) double altitude) { return UnitUtils.getSeaLevelPressure(pressure, temp, altitude); } | /**
* Compute the Sea Level Pressure
*
* @param absolute pressure hPa
* @param temperature (°C)
* @param altitude in meter
* @return Equivalent Seal Level pressure
*
* http://keisan.casio.com/exec/system/1224575267
*
*/ | Compute the Sea Level Pressure | getSeaLevelPressure | {
"repo_name": "paolodenti/openhab",
"path": "bundles/action/org.openhab.action.weather/src/main/java/org/openhab/action/weather/internal/Weather.java",
"license": "epl-1.0",
"size": 2931
} | [
"org.openhab.binding.weather.internal.utils.UnitUtils",
"org.openhab.core.scriptengine.action.ActionDoc",
"org.openhab.core.scriptengine.action.ParamDoc"
] | import org.openhab.binding.weather.internal.utils.UnitUtils; import org.openhab.core.scriptengine.action.ActionDoc; import org.openhab.core.scriptengine.action.ParamDoc; | import org.openhab.binding.weather.internal.utils.*; import org.openhab.core.scriptengine.action.*; | [
"org.openhab.binding",
"org.openhab.core"
] | org.openhab.binding; org.openhab.core; | 2,488,977 |
private double[] getMeanElementRate(final SpacecraftState state,
final GaussQuadrature gauss,
final double low,
final double high) throws OrekitException {
final double[] meanElementRate = gauss.integrate(new IntegrableFunction(state, true, 0), low, high);
// Constant multiplier for integral
final double coef = 1. / (2. * FastMath.PI * B);
// Corrects mean element rates
for (int i = 0; i < 6; i++) {
meanElementRate[i] *= coef;
}
return meanElementRate;
} | double[] function(final SpacecraftState state, final GaussQuadrature gauss, final double low, final double high) throws OrekitException { final double[] meanElementRate = gauss.integrate(new IntegrableFunction(state, true, 0), low, high); final double coef = 1. / (2. * FastMath.PI * B); for (int i = 0; i < 6; i++) { meanElementRate[i] *= coef; } return meanElementRate; } | /** Computes the mean equinoctial elements rates da<sub>i</sub> / dt.
*
* @param state current state
* @param gauss Gauss quadrature
* @param low lower bound of the integral interval
* @param high upper bound of the integral interval
* @return the mean element rates
* @throws OrekitException if some specific error occurs
*/ | Computes the mean equinoctial elements rates dai / dt | getMeanElementRate | {
"repo_name": "attatrol/Orekit",
"path": "src/main/java/org/orekit/propagation/semianalytical/dsst/forces/AbstractGaussianContribution.java",
"license": "apache-2.0",
"size": 72743
} | [
"org.apache.commons.math3.util.FastMath",
"org.orekit.errors.OrekitException",
"org.orekit.propagation.SpacecraftState"
] | import org.apache.commons.math3.util.FastMath; import org.orekit.errors.OrekitException; import org.orekit.propagation.SpacecraftState; | import org.apache.commons.math3.util.*; import org.orekit.errors.*; import org.orekit.propagation.*; | [
"org.apache.commons",
"org.orekit.errors",
"org.orekit.propagation"
] | org.apache.commons; org.orekit.errors; org.orekit.propagation; | 2,099,616 |
@Override
public Double f(Vector x) {
this.tau = AbstractAlgorithm.get().getIterations();
return this.apply(this.tau, x);
} | Double function(Vector x) { this.tau = AbstractAlgorithm.get().getIterations(); return this.apply(this.tau, x); } | /**
* Evaluates the function.
*/ | Evaluates the function | f | {
"repo_name": "krharrison/cilib",
"path": "library/src/main/java/net/sourceforge/cilib/functions/continuous/dynamic/moo/fda1mod_zhou/FDA1_g.java",
"license": "gpl-3.0",
"size": 2982
} | [
"net.sourceforge.cilib.algorithm.AbstractAlgorithm",
"net.sourceforge.cilib.type.types.container.Vector"
] | import net.sourceforge.cilib.algorithm.AbstractAlgorithm; import net.sourceforge.cilib.type.types.container.Vector; | import net.sourceforge.cilib.algorithm.*; import net.sourceforge.cilib.type.types.container.*; | [
"net.sourceforge.cilib"
] | net.sourceforge.cilib; | 1,693,011 |
public static void deleteDoubleEdges(BrowsableNetwork graph) {
HashSet<Edge> toDelete = new HashSet<Edge>();
for (Edge edge1 : graph.getEdges()) {
for (Edge edge2 : graph.getEdges()) {
if (graph.getSource(edge1) == graph.getDest(edge2)
&& graph.getSource(edge2) == graph.getDest(edge1)
&& !toDelete.contains(edge1)
&& graph.getSource(edge1).toString()
.compareTo(graph.getDest(edge1).toString()) > 0) {
toDelete.add(edge1);
}
}
}
System.out.println(toDelete.size());
for (Edge edge : toDelete) {
System.out.println(graph.getEdges().contains(edge));
graph.removeEdge(edge);
}
} | static void function(BrowsableNetwork graph) { HashSet<Edge> toDelete = new HashSet<Edge>(); for (Edge edge1 : graph.getEdges()) { for (Edge edge2 : graph.getEdges()) { if (graph.getSource(edge1) == graph.getDest(edge2) && graph.getSource(edge2) == graph.getDest(edge1) && !toDelete.contains(edge1) && graph.getSource(edge1).toString() .compareTo(graph.getDest(edge1).toString()) > 0) { toDelete.add(edge1); } } } System.out.println(toDelete.size()); for (Edge edge : toDelete) { System.out.println(graph.getEdges().contains(edge)); graph.removeEdge(edge); } } | /**
* Erases the multiple edges of a graph
*
* @param graph
*/ | Erases the multiple edges of a graph | deleteDoubleEdges | {
"repo_name": "dev-cuttlefish/cuttlefish",
"path": "src/ch/ethz/sg/cuttlefish/misc/Utils.java",
"license": "gpl-2.0",
"size": 5833
} | [
"ch.ethz.sg.cuttlefish.networks.BrowsableNetwork",
"ch.ethz.sg.cuttlefish.networks.Edge",
"java.util.HashSet"
] | import ch.ethz.sg.cuttlefish.networks.BrowsableNetwork; import ch.ethz.sg.cuttlefish.networks.Edge; import java.util.HashSet; | import ch.ethz.sg.cuttlefish.networks.*; import java.util.*; | [
"ch.ethz.sg",
"java.util"
] | ch.ethz.sg; java.util; | 2,353,861 |
DeleteTableRequest generateDeleteTableRequest(Class<?> clazz); | DeleteTableRequest generateDeleteTableRequest(Class<?> clazz); | /**
* Parse the given POJO class and return the DeleteTableRequest for the DynamoDB table it
* represents.
*/ | Parse the given POJO class and return the DeleteTableRequest for the DynamoDB table it represents | generateDeleteTableRequest | {
"repo_name": "jentfoo/aws-sdk-java",
"path": "aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/IDynamoDBMapper.java",
"license": "apache-2.0",
"size": 39353
} | [
"com.amazonaws.services.dynamodbv2.model.DeleteTableRequest"
] | import com.amazonaws.services.dynamodbv2.model.DeleteTableRequest; | import com.amazonaws.services.dynamodbv2.model.*; | [
"com.amazonaws.services"
] | com.amazonaws.services; | 2,271,523 |
protected EntityManager createEntityManager(Map properties) {
if ( em != null && em.isOpen() ) {
em.close();
}
em = factory.createEntityManager( properties );
return em;
} | EntityManager function(Map properties) { if ( em != null && em.isOpen() ) { em.close(); } em = factory.createEntityManager( properties ); return em; } | /**
* always reopen a new EM and clse the existing one
*/ | always reopen a new EM and clse the existing one | createEntityManager | {
"repo_name": "codeApeFromChina/resource",
"path": "frame_packages/java_libs/hibernate-distribution-3.6.10.Final/project/hibernate-entitymanager/src/test/java/org/hibernate/ejb/test/TestCase.java",
"license": "unlicense",
"size": 6371
} | [
"java.util.Map",
"javax.persistence.EntityManager"
] | import java.util.Map; import javax.persistence.EntityManager; | import java.util.*; import javax.persistence.*; | [
"java.util",
"javax.persistence"
] | java.util; javax.persistence; | 1,262,397 |
public ErrorHandler getErrorHandler() {
ErrorHandler errorHandler = null;
try {
XMLErrorHandler xmlErrorHandler =
(XMLErrorHandler)fConfiguration.getProperty(ERROR_HANDLER);
if (xmlErrorHandler != null &&
xmlErrorHandler instanceof ErrorHandlerWrapper) {
errorHandler = ((ErrorHandlerWrapper)xmlErrorHandler).getErrorHandler();
}
}
catch (XMLConfigurationException e) {
// do nothing
}
return errorHandler;
} // getErrorHandler():ErrorHandler | ErrorHandler function() { ErrorHandler errorHandler = null; try { XMLErrorHandler xmlErrorHandler = (XMLErrorHandler)fConfiguration.getProperty(ERROR_HANDLER); if (xmlErrorHandler != null && xmlErrorHandler instanceof ErrorHandlerWrapper) { errorHandler = ((ErrorHandlerWrapper)xmlErrorHandler).getErrorHandler(); } } catch (XMLConfigurationException e) { } return errorHandler; } | /**
* Return the current error handler.
*
* @return The current error handler, or null if none
* has been registered.
* @see #setErrorHandler
*/ | Return the current error handler | getErrorHandler | {
"repo_name": "FauxFaux/jdk9-jaxp",
"path": "src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/DOMParser.java",
"license": "gpl-2.0",
"size": 24650
} | [
"com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper",
"com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException",
"com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler",
"org.xml.sax.ErrorHandler"
] | import com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper; import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler; import org.xml.sax.ErrorHandler; | import com.sun.org.apache.xerces.internal.util.*; import com.sun.org.apache.xerces.internal.xni.parser.*; import org.xml.sax.*; | [
"com.sun.org",
"org.xml.sax"
] | com.sun.org; org.xml.sax; | 488,264 |
@InterfaceAudience.Public
public void compact() throws CouchbaseLiteException {
if (!isOpen()) throw new CouchbaseLiteRuntimeException("Database is closed.");
storeRef.retain();
try {
store.compact();
garbageCollectAttachments();
} finally {
storeRef.release();
}
} | @InterfaceAudience.Public void function() throws CouchbaseLiteException { if (!isOpen()) throw new CouchbaseLiteRuntimeException(STR); storeRef.retain(); try { store.compact(); garbageCollectAttachments(); } finally { storeRef.release(); } } | /**
* Compacts the database file by purging non-current JSON bodies, pruning revisions older than
* the maxRevTreeDepth, deleting unused attachment files, and vacuuming the SQLite database.
*/ | Compacts the database file by purging non-current JSON bodies, pruning revisions older than the maxRevTreeDepth, deleting unused attachment files, and vacuuming the SQLite database | compact | {
"repo_name": "couchbase/couchbase-lite-java-core",
"path": "src/main/java/com/couchbase/lite/Database.java",
"license": "apache-2.0",
"size": 114145
} | [
"com.couchbase.lite.internal.InterfaceAudience"
] | import com.couchbase.lite.internal.InterfaceAudience; | import com.couchbase.lite.internal.*; | [
"com.couchbase.lite"
] | com.couchbase.lite; | 327,061 |
public CoordinatorJobInfo killJobs(String filter, int start, int length) throws CoordinatorEngineException {
try {
Map<String, List<String>> filterMap = parseJobsFilter(filter);
CoordinatorJobInfo coordinatorJobInfo =
new BulkCoordXCommand(filterMap, start, length, OperationType.Kill).call();
if (coordinatorJobInfo == null) {
return new CoordinatorJobInfo(new ArrayList<CoordinatorJobBean>(), 0, 0, 0);
}
return coordinatorJobInfo;
}
catch (CommandException ex) {
throw new CoordinatorEngineException(ex);
}
} | CoordinatorJobInfo function(String filter, int start, int length) throws CoordinatorEngineException { try { Map<String, List<String>> filterMap = parseJobsFilter(filter); CoordinatorJobInfo coordinatorJobInfo = new BulkCoordXCommand(filterMap, start, length, OperationType.Kill).call(); if (coordinatorJobInfo == null) { return new CoordinatorJobInfo(new ArrayList<CoordinatorJobBean>(), 0, 0, 0); } return coordinatorJobInfo; } catch (CommandException ex) { throw new CoordinatorEngineException(ex); } } | /**
* return a list of killed Coordinator job
*
* @param filter the filter string for which the coordinator jobs are killed
* @param start the starting index for coordinator jobs
* @param length maximum number of jobs to be killed
* @return coordinatorJobInfo the list of jobs being killed
* @throws CoordinatorEngineException thrown if one or more of the jobs cannot be killed
*/ | return a list of killed Coordinator job | killJobs | {
"repo_name": "cbaenziger/oozie",
"path": "core/src/main/java/org/apache/oozie/CoordinatorEngine.java",
"license": "apache-2.0",
"size": 43092
} | [
"java.util.ArrayList",
"java.util.List",
"java.util.Map",
"org.apache.oozie.command.CommandException",
"org.apache.oozie.command.OperationType",
"org.apache.oozie.command.coord.BulkCoordXCommand"
] | import java.util.ArrayList; import java.util.List; import java.util.Map; import org.apache.oozie.command.CommandException; import org.apache.oozie.command.OperationType; import org.apache.oozie.command.coord.BulkCoordXCommand; | import java.util.*; import org.apache.oozie.command.*; import org.apache.oozie.command.coord.*; | [
"java.util",
"org.apache.oozie"
] | java.util; org.apache.oozie; | 2,132,413 |
void setPopupValue(String value) throws QTasteException; | void setPopupValue(String value) throws QTasteException; | /**
* inserts a value in the active popup field.
*
* @param value the value to insert.
* @see JOptionPane#showInputDialog(Object)
*/ | inserts a value in the active popup field | setPopupValue | {
"repo_name": "qspin/qtaste",
"path": "plugins_src/javagui/src/main/java/com/qspin/qtaste/javagui/JavaGUI.java",
"license": "lgpl-3.0",
"size": 21383
} | [
"com.qspin.qtaste.testsuite.QTasteException"
] | import com.qspin.qtaste.testsuite.QTasteException; | import com.qspin.qtaste.testsuite.*; | [
"com.qspin.qtaste"
] | com.qspin.qtaste; | 99,316 |
private void getQuotedString(final String pattern, final ParsePosition pos) {
appendQuotedString(pattern, pos, null);
} | void function(final String pattern, final ParsePosition pos) { appendQuotedString(pattern, pos, null); } | /**
* Consume quoted string only
*
* @param pattern pattern to parse
* @param pos current parse position
*/ | Consume quoted string only | getQuotedString | {
"repo_name": "rikles/commons-lang",
"path": "src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java",
"license": "apache-2.0",
"size": 19389
} | [
"java.text.ParsePosition"
] | import java.text.ParsePosition; | import java.text.*; | [
"java.text"
] | java.text; | 1,961,664 |
public static <K1, K2, U, V> PTable<Pair<K1, K2>, Pair<U, V>> cross(
PTable<K1, U> left,
PTable<K2, V> right) {
return cross(left, right, DEFAULT_PARALLELISM);
} | static <K1, K2, U, V> PTable<Pair<K1, K2>, Pair<U, V>> function( PTable<K1, U> left, PTable<K2, V> right) { return cross(left, right, DEFAULT_PARALLELISM); } | /**
* Performs a full cross join on the specified {@link PTable}s (using the same strategy as Pig's CROSS operator).
*
* @see <a href="http://en.wikipedia.org/wiki/Join_(SQL)#Cross_join">Cross Join</a>
* @param left A PTable to perform a cross join on.
* @param right A PTable to perform a cross join on.
* @param <K1> Type of left PTable's keys.
* @param <K2> Type of right PTable's keys.
* @param <U> Type of the first {@link PTable}'s values
* @param <V> Type of the second {@link PTable}'s values
* @return The joined result as tuples of ((K1,K2), (U,V)).
*/ | Performs a full cross join on the specified <code>PTable</code>s (using the same strategy as Pig's CROSS operator) | cross | {
"repo_name": "cloudera/crunch",
"path": "crunch/src/main/java/org/apache/crunch/lib/Cartesian.java",
"license": "apache-2.0",
"size": 8694
} | [
"org.apache.crunch.PTable",
"org.apache.crunch.Pair"
] | import org.apache.crunch.PTable; import org.apache.crunch.Pair; | import org.apache.crunch.*; | [
"org.apache.crunch"
] | org.apache.crunch; | 1,797,204 |
public boolean register(String tag, Communicator client) {
if(registeredObjects.containsKey(tag)) {
Log.e("Duplicate tag", "An object is already registered with the given tag");
return false;
} else {
registeredObjects.put(tag, client);
return true;
}
} | boolean function(String tag, Communicator client) { if(registeredObjects.containsKey(tag)) { Log.e(STR, STR); return false; } else { registeredObjects.put(tag, client); return true; } } | /**
* Allows the activity to register objects for receiving messages
* from Javascript.
*
* The receiving object should implement the Communicator interface.
*
* @param tag the tag with which the receiving object will be invoked
* @param client an object implementing the communicator interface
* @see Communicator
*
* @return true if the object was successfully registered else false
* is the tag is already being used
*/ | Allows the activity to register objects for receiving messages from Javascript. The receiving object should implement the Communicator interface | register | {
"repo_name": "ignitesol/androidsockets",
"path": "java/com/ignite/webview_communicator/WebViewCommunicator.java",
"license": "mit",
"size": 6767
} | [
"android.util.Log"
] | import android.util.Log; | import android.util.*; | [
"android.util"
] | android.util; | 653,843 |
@Nullable IStrategoTerm invoke(HybridInterpreter runtime, IStrategoTerm input, String strategy)
throws MetaborgException; | @Nullable IStrategoTerm invoke(HybridInterpreter runtime, IStrategoTerm input, String strategy) throws MetaborgException; | /**
* Invokes a Strategy strategy in given runtime.
*
* @param runtime
* Stratego runtime to invoke the strategy in.
* @param input
* Input term
* @param strategy
* Name of the strategy to call.
* @return Resulting term, or null if the strategy failed.
* @throws MetaborgException
* When invoking the strategy fails unexpectedly.
*/ | Invokes a Strategy strategy in given runtime | invoke | {
"repo_name": "metaborg/spoofax",
"path": "org.metaborg.spoofax.core/src/main/java/org/metaborg/spoofax/core/stratego/IStrategoCommon.java",
"license": "apache-2.0",
"size": 8973
} | [
"javax.annotation.Nullable",
"org.metaborg.core.MetaborgException",
"org.spoofax.interpreter.terms.IStrategoTerm",
"org.strategoxt.HybridInterpreter"
] | import javax.annotation.Nullable; import org.metaborg.core.MetaborgException; import org.spoofax.interpreter.terms.IStrategoTerm; import org.strategoxt.HybridInterpreter; | import javax.annotation.*; import org.metaborg.core.*; import org.spoofax.interpreter.terms.*; import org.strategoxt.*; | [
"javax.annotation",
"org.metaborg.core",
"org.spoofax.interpreter",
"org.strategoxt"
] | javax.annotation; org.metaborg.core; org.spoofax.interpreter; org.strategoxt; | 862,296 |
public List<GroupWithPermissionDto> findGroupsWithPermission(DbSession dbSession, PermissionQuery query) {
Long componentId = componentId(query.component());
return toGroupQueryResult(permissionDao.selectGroups(dbSession, query, componentId), query);
} | List<GroupWithPermissionDto> function(DbSession dbSession, PermissionQuery query) { Long componentId = componentId(query.component()); return toGroupQueryResult(permissionDao.selectGroups(dbSession, query, componentId), query); } | /**
* Paging for groups search is done in Java in order to correctly handle the 'Anyone' group
*/ | Paging for groups search is done in Java in order to correctly handle the 'Anyone' group | findGroupsWithPermission | {
"repo_name": "abbeyj/sonarqube",
"path": "server/sonar-server/src/main/java/org/sonar/server/permission/PermissionFinder.java",
"license": "lgpl-3.0",
"size": 6022
} | [
"java.util.List",
"org.sonar.db.DbSession",
"org.sonar.db.permission.GroupWithPermissionDto",
"org.sonar.db.permission.PermissionQuery"
] | import java.util.List; import org.sonar.db.DbSession; import org.sonar.db.permission.GroupWithPermissionDto; import org.sonar.db.permission.PermissionQuery; | import java.util.*; import org.sonar.db.*; import org.sonar.db.permission.*; | [
"java.util",
"org.sonar.db"
] | java.util; org.sonar.db; | 828,025 |
private void doEditBiggerThanNoOfComponents4ModelStorage() {
this.oldNetworkModel = this.graphController.getNetworkModel().getCopy();
List<NetworkComponent> netCompsRemoved = new ArrayList<>();
for (NetworkComponent networkComponent : this.networkComponents2Remove) {
this.graphController.removeAgent(networkComponent);
netCompsRemoved.add(networkComponent);
}
this.graphController.getNetworkModel().removeNetworkComponents(this.networkComponents2Remove);
NetworkModelNotification notification = new NetworkModelNotification(NetworkModelNotification.NETWORK_MODEL_Component_Removed);
notification.setInfoObject(netCompsRemoved);
this.graphController.notifyObservers(notification);
this.graphController.setProjectUnsaved();
} | void function() { this.oldNetworkModel = this.graphController.getNetworkModel().getCopy(); List<NetworkComponent> netCompsRemoved = new ArrayList<>(); for (NetworkComponent networkComponent : this.networkComponents2Remove) { this.graphController.removeAgent(networkComponent); netCompsRemoved.add(networkComponent); } this.graphController.getNetworkModel().removeNetworkComponents(this.networkComponents2Remove); NetworkModelNotification notification = new NetworkModelNotification(NetworkModelNotification.NETWORK_MODEL_Component_Removed); notification.setInfoObject(netCompsRemoved); this.graphController.notifyObservers(notification); this.graphController.setProjectUnsaved(); } | /**
* Do edit if the number of components is BIGGER than the number in 'noOfComponents4ModelStorage'
*/ | Do edit if the number of components is BIGGER than the number in 'noOfComponents4ModelStorage' | doEditBiggerThanNoOfComponents4ModelStorage | {
"repo_name": "EnFlexIT/AgentWorkbench",
"path": "eclipseProjects/org.agentgui/bundles/org.awb.env.networkModel/src/org/awb/env/networkModel/controller/ui/commands/RemoveNetworkComponent.java",
"license": "lgpl-2.1",
"size": 12727
} | [
"java.util.ArrayList",
"java.util.List",
"org.awb.env.networkModel.NetworkComponent",
"org.awb.env.networkModel.controller.NetworkModelNotification"
] | import java.util.ArrayList; import java.util.List; import org.awb.env.networkModel.NetworkComponent; import org.awb.env.networkModel.controller.NetworkModelNotification; | import java.util.*; import org.awb.env.*; | [
"java.util",
"org.awb.env"
] | java.util; org.awb.env; | 1,752,469 |
public void addTMSProjectExchange(TMSProjectExchange l, Connection con) throws TorqueException
{
getTMSProjectExchanges(con).add(l);
l.setTPerson((TPerson) this);
}
private Criteria lastTMSProjectExchangesCriteria = null; | void function(TMSProjectExchange l, Connection con) throws TorqueException { getTMSProjectExchanges(con).add(l); l.setTPerson((TPerson) this); } private Criteria lastTMSProjectExchangesCriteria = null; | /**
* Method called to associate a TMSProjectExchange object to this object
* through the TMSProjectExchange foreign key attribute using connection.
*
* @param l TMSProjectExchange
* @throws TorqueException
*/ | Method called to associate a TMSProjectExchange object to this object through the TMSProjectExchange foreign key attribute using connection | addTMSProjectExchange | {
"repo_name": "trackplus/Genji",
"path": "src/main/java/com/aurel/track/persist/BaseTPerson.java",
"license": "gpl-3.0",
"size": 1013508
} | [
"com.aurel.track.persist.TPerson",
"java.sql.Connection",
"org.apache.torque.TorqueException",
"org.apache.torque.util.Criteria"
] | import com.aurel.track.persist.TPerson; import java.sql.Connection; import org.apache.torque.TorqueException; import org.apache.torque.util.Criteria; | import com.aurel.track.persist.*; import java.sql.*; import org.apache.torque.*; import org.apache.torque.util.*; | [
"com.aurel.track",
"java.sql",
"org.apache.torque"
] | com.aurel.track; java.sql; org.apache.torque; | 1,206,988 |
public SortedMap getDisplayNames(ICUService service) {
ULocale locale = ULocale.getDefault();
Collator col = Collator.getInstance(locale.toLocale());
return service.getDisplayNames(locale, col, null);
} | SortedMap function(ICUService service) { ULocale locale = ULocale.getDefault(); Collator col = Collator.getInstance(locale.toLocale()); return service.getDisplayNames(locale, col, null); } | /**
* Convenience override of getDisplayNames(ULocale, Comparator, String) that
* uses the current default ULocale as the locale, the default collator for
* the locale as the comparator to sort the display names, and null for
* the matchID.
*/ | Convenience override of getDisplayNames(ULocale, Comparator, String) that uses the current default ULocale as the locale, the default collator for the locale as the comparator to sort the display names, and null for the matchID | getDisplayNames | {
"repo_name": "Miracle121/quickdic-dictionary.dictionary",
"path": "jars/icu4j-52_1/main/tests/core/src/com/ibm/icu/dev/test/util/ICUServiceTest.java",
"license": "apache-2.0",
"size": 34211
} | [
"com.ibm.icu.impl.ICUService",
"com.ibm.icu.util.ULocale",
"java.text.Collator",
"java.util.SortedMap"
] | import com.ibm.icu.impl.ICUService; import com.ibm.icu.util.ULocale; import java.text.Collator; import java.util.SortedMap; | import com.ibm.icu.impl.*; import com.ibm.icu.util.*; import java.text.*; import java.util.*; | [
"com.ibm.icu",
"java.text",
"java.util"
] | com.ibm.icu; java.text; java.util; | 2,913,617 |
public String makeSql(PathQuery pathQuery) throws ObjectStoreException {
Query query = makeQuery(pathQuery);
ObjectStoreInterMineImpl osimi = (ObjectStoreInterMineImpl) os;
return osimi.generateSql(query);
} | String function(PathQuery pathQuery) throws ObjectStoreException { Query query = makeQuery(pathQuery); ObjectStoreInterMineImpl osimi = (ObjectStoreInterMineImpl) os; return osimi.generateSql(query); } | /**
* Creates an SQL query from a PathQuery.
*
* @param pathQuery the query to convert
* @return an SQL String
* @throws ObjectStoreException if problem creating query
*/ | Creates an SQL query from a PathQuery | makeSql | {
"repo_name": "joshkh/intermine",
"path": "intermine/api/main/src/org/intermine/api/query/WebResultsExecutor.java",
"license": "lgpl-2.1",
"size": 8123
} | [
"org.intermine.objectstore.ObjectStoreException",
"org.intermine.objectstore.intermine.ObjectStoreInterMineImpl",
"org.intermine.objectstore.query.Query",
"org.intermine.pathquery.PathQuery"
] | import org.intermine.objectstore.ObjectStoreException; import org.intermine.objectstore.intermine.ObjectStoreInterMineImpl; import org.intermine.objectstore.query.Query; import org.intermine.pathquery.PathQuery; | import org.intermine.objectstore.*; import org.intermine.objectstore.intermine.*; import org.intermine.objectstore.query.*; import org.intermine.pathquery.*; | [
"org.intermine.objectstore",
"org.intermine.pathquery"
] | org.intermine.objectstore; org.intermine.pathquery; | 1,052,953 |
public static Optional<String> toJSON(org.elasticsearch.action.search.SearchRequest esRequest) {
Optional<String> json = Optional.empty();
if(esRequest != null && esRequest.source() != null) {
try {
BytesReference requestBytes = esRequest.source().buildAsBytes();
json = Optional.of(XContentHelper.convertToJson(requestBytes, true));
} catch (Throwable t) {
LOG.error("Failed to convert search request to JSON", t);
}
}
return json;
} | static Optional<String> function(org.elasticsearch.action.search.SearchRequest esRequest) { Optional<String> json = Optional.empty(); if(esRequest != null && esRequest.source() != null) { try { BytesReference requestBytes = esRequest.source().buildAsBytes(); json = Optional.of(XContentHelper.convertToJson(requestBytes, true)); } catch (Throwable t) { LOG.error(STR, t); } } return json; } | /**
* Converts an Elasticsearch SearchRequest to JSON.
* @param esRequest The search request.
* @return The JSON representation of the SearchRequest.
*/ | Converts an Elasticsearch SearchRequest to JSON | toJSON | {
"repo_name": "cestella/incubator-metron",
"path": "metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/utils/ElasticsearchUtils.java",
"license": "apache-2.0",
"size": 15514
} | [
"java.util.Optional",
"org.elasticsearch.common.bytes.BytesReference",
"org.elasticsearch.common.xcontent.XContentHelper"
] | import java.util.Optional; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.XContentHelper; | import java.util.*; import org.elasticsearch.common.bytes.*; import org.elasticsearch.common.xcontent.*; | [
"java.util",
"org.elasticsearch.common"
] | java.util; org.elasticsearch.common; | 1,530,920 |
@Column(name = "event_name", length = 255)
public String getEventName();
// -------------------------------------------------------------------------
// FROM and INTO
// ------------------------------------------------------------------------- | @Column(name = STR, length = 255) String function(); | /**
* Getter for <code>cattle.external_handler_external_handler_process_map.event_name</code>.
*/ | Getter for <code>cattle.external_handler_external_handler_process_map.event_name</code> | getEventName | {
"repo_name": "vincent99/cattle",
"path": "code/iaas/model/src/main/java/io/cattle/platform/core/model/ExternalHandlerExternalHandlerProcessMap.java",
"license": "apache-2.0",
"size": 6476
} | [
"javax.persistence.Column"
] | import javax.persistence.Column; | import javax.persistence.*; | [
"javax.persistence"
] | javax.persistence; | 1,384,263 |
protected void setTldFile(Resource fileTld) throws TagLibException {
if(fileTld==null) return;
this.tldFile=fileTld;
String key;
Map<String,TagLib> map=new HashMap<String,TagLib>();
// First fill existing to set
for(int i=0;i<tlds.length;i++) {
key=getKey(tlds[i]);
map.put(key,tlds[i]);
}
TagLib tl;
// now overwrite with new data
if(fileTld.isDirectory()) {
Resource[] files=fileTld.listResources(new ExtensionResourceFilter(new String[]{"tld","tldx"}));
for(int i=0;i<files.length;i++) {
try {
tl = TagLibFactory.loadFromFile(files[i]);
key=getKey(tl);
if(!map.containsKey(key))
map.put(key,tl);
else
overwrite(map.get(key),tl);
}
catch(TagLibException tle) {
SystemOut.printDate(out,"can't load tld "+files[i]);
tle.printStackTrace(getErrWriter());
}
}
}
else if(fileTld.isFile()){
tl = TagLibFactory.loadFromFile(fileTld);
key=getKey(tl);
if(!map.containsKey(key))
map.put(key,tl);
else overwrite(map.get(key),tl);
}
// now fill back to array
tlds=new TagLib[map.size()];
int index=0;
Iterator<TagLib> it = map.values().iterator();
while(it.hasNext()) {
tlds[index++]=it.next();
}
} | void function(Resource fileTld) throws TagLibException { if(fileTld==null) return; this.tldFile=fileTld; String key; Map<String,TagLib> map=new HashMap<String,TagLib>(); for(int i=0;i<tlds.length;i++) { key=getKey(tlds[i]); map.put(key,tlds[i]); } TagLib tl; if(fileTld.isDirectory()) { Resource[] files=fileTld.listResources(new ExtensionResourceFilter(new String[]{"tld","tldx"})); for(int i=0;i<files.length;i++) { try { tl = TagLibFactory.loadFromFile(files[i]); key=getKey(tl); if(!map.containsKey(key)) map.put(key,tl); else overwrite(map.get(key),tl); } catch(TagLibException tle) { SystemOut.printDate(out,STR+files[i]); tle.printStackTrace(getErrWriter()); } } } else if(fileTld.isFile()){ tl = TagLibFactory.loadFromFile(fileTld); key=getKey(tl); if(!map.containsKey(key)) map.put(key,tl); else overwrite(map.get(key),tl); } tlds=new TagLib[map.size()]; int index=0; Iterator<TagLib> it = map.values().iterator(); while(it.hasNext()) { tlds[index++]=it.next(); } } | /**
* set the optional directory of the tag library deskriptors
* @param fileTld directory of the tag libray deskriptors
* @throws TagLibException
*/ | set the optional directory of the tag library deskriptors | setTldFile | {
"repo_name": "jzuijlek/Lucee4",
"path": "lucee-java/lucee-core/src/lucee/runtime/config/ConfigImpl.java",
"license": "lgpl-2.1",
"size": 102232
} | [
"java.util.HashMap",
"java.util.Iterator",
"java.util.Map"
] | import java.util.HashMap; import java.util.Iterator; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 329,282 |
@ImageOptions(flipRtl = true)
@Source("images/pagination_right_End_down.png")
ImageResource simplePagerFastForwardDown(); | @ImageOptions(flipRtl = true) @Source(STR) ImageResource simplePagerFastForwardDown(); | /**
* The pressed "fast forward" image.
*/ | The pressed "fast forward" image | simplePagerFastForwardDown | {
"repo_name": "A24Group/ssGWT-lib",
"path": "src/org/ssgwt/client/ui/datagrid/SSPager.java",
"license": "apache-2.0",
"size": 26935
} | [
"com.google.gwt.resources.client.ImageResource"
] | import com.google.gwt.resources.client.ImageResource; | import com.google.gwt.resources.client.*; | [
"com.google.gwt"
] | com.google.gwt; | 751,635 |
private void paintWithPen(int penObject, Shape shape) {
if (penObject >= 0) {
Color col = getColorFromObject(penObject);
if (!(firstEffectivePaint && (col.equals(Color.white)))) {
Rectangle rec = shape.getBounds();
resizeBounds((int)rec.getMinX(), (int)rec.getMinY());
resizeBounds((int)rec.getMaxX(), (int)rec.getMaxY());
firstEffectivePaint = false;
}
}
} | void function(int penObject, Shape shape) { if (penObject >= 0) { Color col = getColorFromObject(penObject); if (!(firstEffectivePaint && (col.equals(Color.white)))) { Rectangle rec = shape.getBounds(); resizeBounds((int)rec.getMinX(), (int)rec.getMinY()); resizeBounds((int)rec.getMaxX(), (int)rec.getMaxY()); firstEffectivePaint = false; } } } | /** Resize the bounds of the WMF image according with the bounds of the geometric
* Shape.
* There will be no resizing if one of the following properties is true :
* <ul>
* <li>the pen objects is < 0 (null object)</li>
* <li>the color of the geometric Shape is white, and no other Shapes has occured</li>
* </ul>
*/ | Resize the bounds of the WMF image according with the bounds of the geometric Shape. There will be no resizing if one of the following properties is true : the pen objects is the color of the geometric Shape is white, and no other Shapes has occured | paintWithPen | {
"repo_name": "Uni-Sol/batik",
"path": "sources/org/apache/batik/transcoder/wmf/tosvg/WMFHeaderProperties.java",
"license": "apache-2.0",
"size": 23364
} | [
"java.awt.Color",
"java.awt.Rectangle",
"java.awt.Shape"
] | import java.awt.Color; import java.awt.Rectangle; import java.awt.Shape; | import java.awt.*; | [
"java.awt"
] | java.awt; | 862,355 |
@Type(type = "com.servinglynk.hmis.warehouse.enums.InventoryBedtypeEnumType")
@Basic( optional = true )
@Column
public InventoryBedtypeEnum getBedtype() {
return this.bedtype;
} | @Type(type = STR) @Basic( optional = true ) InventoryBedtypeEnum function() { return this.bedtype; } | /**
* Return the value associated with the column: bedtype.
* @return A InventoryBedtypeEnum object (this.bedtype)
*/ | Return the value associated with the column: bedtype | getBedtype | {
"repo_name": "servinglynk/hmis-lynk-open-source",
"path": "hmis-model-v2016/src/main/java/com/servinglynk/hmis/warehouse/model/v2016/Inventory.java",
"license": "mpl-2.0",
"size": 19463
} | [
"com.servinglynk.hmis.warehouse.enums.InventoryBedtypeEnum",
"javax.persistence.Basic",
"org.hibernate.annotations.Type"
] | import com.servinglynk.hmis.warehouse.enums.InventoryBedtypeEnum; import javax.persistence.Basic; import org.hibernate.annotations.Type; | import com.servinglynk.hmis.warehouse.enums.*; import javax.persistence.*; import org.hibernate.annotations.*; | [
"com.servinglynk.hmis",
"javax.persistence",
"org.hibernate.annotations"
] | com.servinglynk.hmis; javax.persistence; org.hibernate.annotations; | 1,309,823 |
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
// Draw translucent background for the cropped area.
drawBackground(canvas);
if (mCropWindowHandler.showGuidelines()) {
// Determines whether guidelines should be drawn or not
if (mGuidelines == CropImageView.Guidelines.ON) {
drawGuidelines(canvas);
} else if (mGuidelines == CropImageView.Guidelines.ON_TOUCH && mMoveHandler != null) {
// Draw only when resizing
drawGuidelines(canvas);
}
}
drawBorders(canvas);
drawCorners(canvas);
} | void function(Canvas canvas) { super.onDraw(canvas); drawBackground(canvas); if (mCropWindowHandler.showGuidelines()) { if (mGuidelines == CropImageView.Guidelines.ON) { drawGuidelines(canvas); } else if (mGuidelines == CropImageView.Guidelines.ON_TOUCH && mMoveHandler != null) { drawGuidelines(canvas); } } drawBorders(canvas); drawCorners(canvas); } | /**
* Draw crop overview by drawing background over image not in the cripping area, then borders and guidelines.
*/ | Draw crop overview by drawing background over image not in the cripping area, then borders and guidelines | onDraw | {
"repo_name": "tibbi/Android-Image-Cropper",
"path": "cropper/src/main/java/com/theartofdev/edmodo/cropper/CropOverlayView.java",
"license": "apache-2.0",
"size": 39574
} | [
"android.graphics.Canvas"
] | import android.graphics.Canvas; | import android.graphics.*; | [
"android.graphics"
] | android.graphics; | 102,574 |
public static PaginatedResult<Event> getEvents(String location, String distance, int page, String apiKey) {
Map<String, String> params = new HashMap<String, String>();
params.put("page", String.valueOf(page));
if (location != null)
params.put("location", location);
if (distance != null)
params.put("distance", distance);
Result result = Caller.getInstance().call("geo.getEvents", apiKey, params);
if (!result.isSuccessful())
return new PaginatedResult<Event>(0, 0, Collections.<Event>emptyList());
DomElement element = result.getContentElement();
List<Event> events = new ArrayList<Event>();
for (DomElement domElement : element.getChildren("event")) {
events.add(Event.eventFromElement(domElement));
}
int currentPage = Integer.valueOf(element.getAttribute("page"));
int totalPages = Integer.valueOf(element.getAttribute("totalpages"));
return new PaginatedResult<Event>(page, totalPages, events);
} | static PaginatedResult<Event> function(String location, String distance, int page, String apiKey) { Map<String, String> params = new HashMap<String, String>(); params.put("page", String.valueOf(page)); if (location != null) params.put(STR, location); if (distance != null) params.put(STR, distance); Result result = Caller.getInstance().call(STR, apiKey, params); if (!result.isSuccessful()) return new PaginatedResult<Event>(0, 0, Collections.<Event>emptyList()); DomElement element = result.getContentElement(); List<Event> events = new ArrayList<Event>(); for (DomElement domElement : element.getChildren("event")) { events.add(Event.eventFromElement(domElement)); } int currentPage = Integer.valueOf(element.getAttribute("page")); int totalPages = Integer.valueOf(element.getAttribute(STR)); return new PaginatedResult<Event>(page, totalPages, events); } | /**
* Get all events in a specific location by country or city name.<br/>
* This method only returns the specified page of a paginated result.
*
* @param location Specifies a location to retrieve events for
* @param distance Find events within a specified distance
* @param page A page number for pagination
* @param apiKey A Last.fm API key.
* @return a {@link PaginatedResult} containing a list of events
*/ | Get all events in a specific location by country or city name. This method only returns the specified page of a paginated result | getEvents | {
"repo_name": "Tobiaswk/ophelia",
"path": "src/net/roarsoftware/lastfm/Geo.java",
"license": "gpl-3.0",
"size": 5128
} | [
"java.util.ArrayList",
"java.util.Collections",
"java.util.HashMap",
"java.util.List",
"java.util.Map",
"net.roarsoftware.xml.DomElement"
] | import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import net.roarsoftware.xml.DomElement; | import java.util.*; import net.roarsoftware.xml.*; | [
"java.util",
"net.roarsoftware.xml"
] | java.util; net.roarsoftware.xml; | 1,400,016 |
private ILineRange modelLinesToWidgetLines(ILineRange range) {
int widgetStartLine= -1;
int widgetEndLine= -1;
if (fViewer instanceof ITextViewerExtension5) {
ITextViewerExtension5 extension= (ITextViewerExtension5) fViewer;
int modelEndLine= end(range);
for (int modelLine= range.getStartLine(); modelLine < modelEndLine; modelLine++) {
int widgetLine= extension.modelLine2WidgetLine(modelLine);
if (widgetLine != -1) {
if (widgetStartLine == -1)
widgetStartLine= widgetLine;
widgetEndLine= widgetLine;
}
}
} else {
IRegion region= fViewer.getVisibleRegion();
IDocument document= fViewer.getDocument();
try {
int visibleStartLine= document.getLineOfOffset(region.getOffset());
int visibleEndLine= document.getLineOfOffset(region.getOffset() + region.getLength());
widgetStartLine= Math.max(0, range.getStartLine() - visibleStartLine);
widgetEndLine= Math.min(visibleEndLine, end(range) - 1);
} catch (BadLocationException x) {
x.printStackTrace();
// ignore and return null
}
}
if (widgetStartLine == -1 || widgetEndLine == -1)
return null;
return new LineRange(widgetStartLine, widgetEndLine - widgetStartLine + 1);
} | ILineRange function(ILineRange range) { int widgetStartLine= -1; int widgetEndLine= -1; if (fViewer instanceof ITextViewerExtension5) { ITextViewerExtension5 extension= (ITextViewerExtension5) fViewer; int modelEndLine= end(range); for (int modelLine= range.getStartLine(); modelLine < modelEndLine; modelLine++) { int widgetLine= extension.modelLine2WidgetLine(modelLine); if (widgetLine != -1) { if (widgetStartLine == -1) widgetStartLine= widgetLine; widgetEndLine= widgetLine; } } } else { IRegion region= fViewer.getVisibleRegion(); IDocument document= fViewer.getDocument(); try { int visibleStartLine= document.getLineOfOffset(region.getOffset()); int visibleEndLine= document.getLineOfOffset(region.getOffset() + region.getLength()); widgetStartLine= Math.max(0, range.getStartLine() - visibleStartLine); widgetEndLine= Math.min(visibleEndLine, end(range) - 1); } catch (BadLocationException x) { x.printStackTrace(); } } if (widgetStartLine == -1 widgetEndLine == -1) return null; return new LineRange(widgetStartLine, widgetEndLine - widgetStartLine + 1); } | /**
* Returns the visible extent of a document line range in widget lines.
*
* @param range the document line range
* @return the visible extent of <code>range</code> in widget lines
*/ | Returns the visible extent of a document line range in widget lines | modelLinesToWidgetLines | {
"repo_name": "brunyuriy/quick-fix-scout",
"path": "org.eclipse.jface.text_3.8.1.v20120828-155502/src/org/eclipse/jface/internal/text/revisions/RevisionPainter.java",
"license": "mit",
"size": 50454
} | [
"org.eclipse.jface.text.BadLocationException",
"org.eclipse.jface.text.IDocument",
"org.eclipse.jface.text.IRegion",
"org.eclipse.jface.text.ITextViewerExtension5",
"org.eclipse.jface.text.source.ILineRange",
"org.eclipse.jface.text.source.LineRange"
] | import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.ITextViewerExtension5; import org.eclipse.jface.text.source.ILineRange; import org.eclipse.jface.text.source.LineRange; | import org.eclipse.jface.text.*; import org.eclipse.jface.text.source.*; | [
"org.eclipse.jface"
] | org.eclipse.jface; | 106,485 |
void insertEntry(int entryIndex, @NullableDecl K key, @NullableDecl V value, int hash) {
this.entries[entryIndex] = ((long) hash << 32) | (NEXT_MASK & UNSET);
this.keys[entryIndex] = key;
this.values[entryIndex] = value;
} | void insertEntry(int entryIndex, @NullableDecl K key, @NullableDecl V value, int hash) { this.entries[entryIndex] = ((long) hash << 32) (NEXT_MASK & UNSET); this.keys[entryIndex] = key; this.values[entryIndex] = value; } | /**
* Creates a fresh entry with the specified object at the specified position in the entry arrays.
*/ | Creates a fresh entry with the specified object at the specified position in the entry arrays | insertEntry | {
"repo_name": "EdwardLee03/guava",
"path": "android/guava/src/com/google/common/collect/CompactHashMap.java",
"license": "apache-2.0",
"size": 25359
} | [
"org.checkerframework.checker.nullness.compatqual.NullableDecl"
] | import org.checkerframework.checker.nullness.compatqual.NullableDecl; | import org.checkerframework.checker.nullness.compatqual.*; | [
"org.checkerframework.checker"
] | org.checkerframework.checker; | 2,181,697 |
Property property = new Property("hello", "world");
assertEquals(property.getName(), "hello");
assertEquals(property.getValue(), "world");
} | Property property = new Property("hello", "world"); assertEquals(property.getName(), "hello"); assertEquals(property.getValue(), "world"); } | /**
* Test constructor
*/ | Test constructor | testConstructor | {
"repo_name": "turn/camino",
"path": "src/test/java/com/turn/camino/config/PropertyTest.java",
"license": "apache-2.0",
"size": 1013
} | [
"org.testng.Assert"
] | import org.testng.Assert; | import org.testng.*; | [
"org.testng"
] | org.testng; | 469,101 |
public boolean addTransactionRemovedInferredTriples(KiWiTriple triple) {
transactionRemovedInferredTriples.add(triple);
return true;
}
| boolean function(KiWiTriple triple) { transactionRemovedInferredTriples.add(triple); return true; } | /**
* add a triple to the list of triples that
* have been removed during the transaction
* @param triple
* @return
*/ | add a triple to the list of triples that have been removed during the transaction | addTransactionRemovedInferredTriples | {
"repo_name": "fregaham/KiWi",
"path": "src/action/kiwi/api/transaction/CIVersionBean.java",
"license": "bsd-3-clause",
"size": 11988
} | [
"kiwi.model.kbase.KiWiTriple"
] | import kiwi.model.kbase.KiWiTriple; | import kiwi.model.kbase.*; | [
"kiwi.model.kbase"
] | kiwi.model.kbase; | 2,486,029 |
public Enumeration<SAMLSSOServiceProviderDO> getAllServiceProviders() {
return serviceProviderMap.elements();
} | Enumeration<SAMLSSOServiceProviderDO> function() { return serviceProviderMap.elements(); } | /**
* Get all the SAMLSSOServiceProviderDO objects which are registered through the OSGi service.
*
* @return Enumeration of SAMLSSOServiceProviderDO objects
*/ | Get all the SAMLSSOServiceProviderDO objects which are registered through the OSGi service | getAllServiceProviders | {
"repo_name": "wso2-extensions/identity-inbound-auth-saml",
"path": "components/org.wso2.carbon.identity.sso.saml/src/main/java/org/wso2/carbon/identity/sso/saml/SSOServiceProviderConfigManager.java",
"license": "apache-2.0",
"size": 3300
} | [
"java.util.Enumeration",
"org.wso2.carbon.identity.core.model.SAMLSSOServiceProviderDO",
"org.wso2.carbon.identity.saml.metadata.model.SAMLSSOServiceProviderDO"
] | import java.util.Enumeration; import org.wso2.carbon.identity.core.model.SAMLSSOServiceProviderDO; import org.wso2.carbon.identity.saml.metadata.model.SAMLSSOServiceProviderDO; | import java.util.*; import org.wso2.carbon.identity.core.model.*; import org.wso2.carbon.identity.saml.metadata.model.*; | [
"java.util",
"org.wso2.carbon"
] | java.util; org.wso2.carbon; | 2,651,439 |
private ComponentHandler getComponentHandler() {
return this.mParent;
} | ComponentHandler function() { return this.mParent; } | /**
* returns the ComponentHandler instance...
*
* @return a ComponentHandler instance...
*/ | returns the ComponentHandler instance.. | getComponentHandler | {
"repo_name": "tuason/dj-battle-scoreboard",
"path": "src/main/java/ch/tuason/djbattlescore/lib/components/comps/MainLayoutPane.java",
"license": "mit",
"size": 2320
} | [
"ch.tuason.djbattlescore.lib.components.ComponentHandler"
] | import ch.tuason.djbattlescore.lib.components.ComponentHandler; | import ch.tuason.djbattlescore.lib.components.*; | [
"ch.tuason.djbattlescore"
] | ch.tuason.djbattlescore; | 1,312,898 |
public PasswordInfo passwordsCredentialIdUpdate(Long credentialId, String xProgrammeKey, UpdatePasswordParams request, String xCallref) throws ApiException {
ApiResponse<PasswordInfo> resp = passwordsCredentialIdUpdateWithHttpInfo(credentialId, xProgrammeKey, request, xCallref);
return resp.getData();
} | PasswordInfo function(Long credentialId, String xProgrammeKey, UpdatePasswordParams request, String xCallref) throws ApiException { ApiResponse<PasswordInfo> resp = passwordsCredentialIdUpdateWithHttpInfo(credentialId, xProgrammeKey, request, xCallref); return resp.getData(); } | /**
*
* Update the password for the credential identified by the credential_id path parameter. The value for the new password must satisfy all the restrictions imposed by the Password Profile linked to the Password Identity that this credential belongs to.
* @param credentialId The credential ID (required)
* @param xProgrammeKey This identifies your tenant and programme within OPE. The typical format is `tenantId|programmeId`, for example `team-01|3749203750`. (required)
* @param request (required)
* @param xCallref A unique call reference to provide correlation between application and system. This can be generated by your application. (optional)
* @return PasswordInfo
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/ | Update the password for the credential identified by the credential_id path parameter. The value for the new password must satisfy all the restrictions imposed by the Password Profile linked to the Password Identity that this credential belongs to | passwordsCredentialIdUpdate | {
"repo_name": "ixaris/ope-applicationclients",
"path": "java-client/src/main/java/com/ixaris/ope/applications/client/api/PasswordsApi.java",
"license": "mit",
"size": 70097
} | [
"com.ixaris.ope.applications.client.ApiException",
"com.ixaris.ope.applications.client.ApiResponse",
"com.ixaris.ope.applications.client.model.PasswordInfo",
"com.ixaris.ope.applications.client.model.UpdatePasswordParams"
] | import com.ixaris.ope.applications.client.ApiException; import com.ixaris.ope.applications.client.ApiResponse; import com.ixaris.ope.applications.client.model.PasswordInfo; import com.ixaris.ope.applications.client.model.UpdatePasswordParams; | import com.ixaris.ope.applications.client.*; import com.ixaris.ope.applications.client.model.*; | [
"com.ixaris.ope"
] | com.ixaris.ope; | 261,357 |
public static CommandElement choices(Translatable key, Map<String, ?> choices) {
return choices(key, choices, choices.size() <= 5);
} | static CommandElement function(Translatable key, Map<String, ?> choices) { return choices(key, choices, choices.size() <= 5); } | /**
* Return an argument that allows selecting from a limited set of values.
* If there are 5 or fewer choices available, the choices will be shown in the command usage. Otherwise, the usage
* will only display only the key. To override this behavior, see {@link #choices(Translatable, Map, boolean)}.
*
* @param key The key to store the resulting value under
* @param choices The choices users can choose from
* @return the element to match the input
*/ | Return an argument that allows selecting from a limited set of values. If there are 5 or fewer choices available, the choices will be shown in the command usage. Otherwise, the usage will only display only the key. To override this behavior, see <code>#choices(Translatable, Map, boolean)</code> | choices | {
"repo_name": "Phoenix616/PermissionsEx",
"path": "permissionsex-core/src/main/java/ninja/leaping/permissionsex/util/command/args/GenericArguments.java",
"license": "apache-2.0",
"size": 44159
} | [
"java.util.Map",
"ninja.leaping.permissionsex.util.Translatable"
] | import java.util.Map; import ninja.leaping.permissionsex.util.Translatable; | import java.util.*; import ninja.leaping.permissionsex.util.*; | [
"java.util",
"ninja.leaping.permissionsex"
] | java.util; ninja.leaping.permissionsex; | 355,895 |
if (isServiceEnabled(connection) == enabled)
return;
if (enabled) {
ServiceDiscoveryManager.getInstanceFor(connection).addFeature(AMPExtension.NAMESPACE);
}
else {
ServiceDiscoveryManager.getInstanceFor(connection).removeFeature(AMPExtension.NAMESPACE);
}
} | if (isServiceEnabled(connection) == enabled) return; if (enabled) { ServiceDiscoveryManager.getInstanceFor(connection).addFeature(AMPExtension.NAMESPACE); } else { ServiceDiscoveryManager.getInstanceFor(connection).removeFeature(AMPExtension.NAMESPACE); } } | /**
* Enables or disables the AMP support on a given connection.<p>
*
* Before starting to send AMP messages to a user, check that the user can handle XHTML
* messages. Enable the AMP support to indicate that this client handles XHTML messages.
*
* @param connection the connection where the service will be enabled or disabled
* @param enabled indicates if the service will be enabled or disabled
*/ | Enables or disables the AMP support on a given connection. Before starting to send AMP messages to a user, check that the user can handle XHTML messages. Enable the AMP support to indicate that this client handles XHTML messages | setServiceEnabled | {
"repo_name": "Tibo-lg/Smack",
"path": "smack-extensions/src/main/java/org/jivesoftware/smackx/amp/AMPManager.java",
"license": "apache-2.0",
"size": 4999
} | [
"org.jivesoftware.smackx.amp.packet.AMPExtension",
"org.jivesoftware.smackx.disco.ServiceDiscoveryManager"
] | import org.jivesoftware.smackx.amp.packet.AMPExtension; import org.jivesoftware.smackx.disco.ServiceDiscoveryManager; | import org.jivesoftware.smackx.amp.packet.*; import org.jivesoftware.smackx.disco.*; | [
"org.jivesoftware.smackx"
] | org.jivesoftware.smackx; | 1,132,080 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.