method stringlengths 13 441k | clean_method stringlengths 7 313k | doc stringlengths 17 17.3k | comment stringlengths 3 1.42k | method_name stringlengths 1 273 | extra dict | imports list | imports_info stringlengths 19 34.8k | cluster_imports_info stringlengths 15 3.66k | libraries list | libraries_info stringlengths 6 661 | id int64 0 2.92M |
|---|---|---|---|---|---|---|---|---|---|---|---|
@Retries.RetryTranslated
CompleteMultipartUploadResult completeMPUwithRetries(
String destKey,
String uploadId,
List<PartETag> partETags,
long length,
AtomicInteger errorCount)
throws IOException; | @Retries.RetryTranslated CompleteMultipartUploadResult completeMPUwithRetries( String destKey, String uploadId, List<PartETag> partETags, long length, AtomicInteger errorCount) throws IOException; | /**
* This completes a multipart upload to the destination key via
* {@code finalizeMultipartUpload()}.
* Retry policy: retrying, translated.
* Retries increment the {@code errorCount} counter.
* @param destKey destination
* @param uploadId multipart operation Id
* @param partETags list of partial uploads
* @param length length of the upload
* @param errorCount a counter incremented by 1 on every error; for
* use in statistics
* @return the result of the operation.
* @throws IOException if problems arose which could not be retried, or
* the retry count was exceeded
*/ | This completes a multipart upload to the destination key via finalizeMultipartUpload(). Retry policy: retrying, translated. Retries increment the errorCount counter | completeMPUwithRetries | {
"repo_name": "steveloughran/hadoop",
"path": "hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/WriteOperations.java",
"license": "apache-2.0",
"size": 11587
} | [
"com.amazonaws.services.s3.model.CompleteMultipartUploadResult",
"com.amazonaws.services.s3.model.PartETag",
"java.io.IOException",
"java.util.List",
"java.util.concurrent.atomic.AtomicInteger"
] | import com.amazonaws.services.s3.model.CompleteMultipartUploadResult; import com.amazonaws.services.s3.model.PartETag; import java.io.IOException; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; | import com.amazonaws.services.s3.model.*; import java.io.*; import java.util.*; import java.util.concurrent.atomic.*; | [
"com.amazonaws.services",
"java.io",
"java.util"
] | com.amazonaws.services; java.io; java.util; | 1,929,645 |
@Transactional(propagation = Propagation.MANDATORY)
public void deleteParameters(final Long id) {
getJdbcTemplate().update(deleteTaskParametersQuery, id);
} | @Transactional(propagation = Propagation.MANDATORY) void function(final Long id) { getJdbcTemplate().update(deleteTaskParametersQuery, id); } | /**
* Deletes {@code Task Parameters} from database.
*
* @param id of the task
*/ | Deletes Task Parameters from database | deleteParameters | {
"repo_name": "epam/NGB",
"path": "server/catgenome/src/main/java/com/epam/catgenome/dao/blast/BlastTaskDao.java",
"license": "mit",
"size": 20740
} | [
"org.springframework.transaction.annotation.Propagation",
"org.springframework.transaction.annotation.Transactional"
] | import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.*; | [
"org.springframework.transaction"
] | org.springframework.transaction; | 1,259,238 |
FileObject parent = super.getParent();
if ( ( parent != null ) && !parent.exists() ) {
// check for existing local directory
FileSystemManager manager = getFileSystem().getFileSystemManager();
FileObject localDir = manager.resolveFile( "file://" +
GaeFileNameParser.getRootPath( manager.getBaseFile().getName() ) +
parent.getName().getPath() );
if ( localDir.exists() && localDir.getType().hasChildren() ) {
parent.createFolder(); // make sure GaeVFS "shadow" folder exists
}
}
return parent;
}
| FileObject parent = super.getParent(); if ( ( parent != null ) && !parent.exists() ) { FileSystemManager manager = getFileSystem().getFileSystemManager(); FileObject localDir = manager.resolveFile( "file: GaeFileNameParser.getRootPath( manager.getBaseFile().getName() ) + parent.getName().getPath() ); if ( localDir.exists() && localDir.getType().hasChildren() ) { parent.createFolder(); } } return parent; } | /**
* Override the superclass implementation to make sure GaeVFS "shadows"
* exist for local directories.
*/ | Override the superclass implementation to make sure GaeVFS "shadows" exist for local directories | getParent | {
"repo_name": "tberthel/gaevfs",
"path": "src/com/newatlanta/appengine/vfs/provider/GaeFileObject.java",
"license": "apache-2.0",
"size": 21645
} | [
"org.apache.commons.vfs.FileObject",
"org.apache.commons.vfs.FileSystemManager"
] | import org.apache.commons.vfs.FileObject; import org.apache.commons.vfs.FileSystemManager; | import org.apache.commons.vfs.*; | [
"org.apache.commons"
] | org.apache.commons; | 2,006,913 |
public Observable<ServiceResponse<AppInner>> updateWithServiceResponseAsync(String resourceGroupName, String resourceName, AppPatch appPatch) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (resourceName == null) {
throw new IllegalArgumentException("Parameter resourceName is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
if (appPatch == null) {
throw new IllegalArgumentException("Parameter appPatch is required and cannot be null.");
}
Validator.validate(appPatch);
Observable<Response<ResponseBody>> observable = service.update(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), appPatch, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<AppInner>() { }.getType());
} | Observable<ServiceResponse<AppInner>> function(String resourceGroupName, String resourceName, AppPatch appPatch) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); } if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (resourceName == null) { throw new IllegalArgumentException(STR); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException(STR); } if (appPatch == null) { throw new IllegalArgumentException(STR); } Validator.validate(appPatch); Observable<Response<ResponseBody>> observable = service.update(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), appPatch, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<AppInner>() { }.getType()); } | /**
* Update the metadata of an IoT Central application.
*
* @param resourceGroupName The name of the resource group that contains the IoT Central application.
* @param resourceName The ARM resource name of the IoT Central application.
* @param appPatch The IoT Central application metadata and security metadata.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/ | Update the metadata of an IoT Central application | updateWithServiceResponseAsync | {
"repo_name": "navalev/azure-sdk-for-java",
"path": "sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppsInner.java",
"license": "mit",
"size": 78627
} | [
"com.google.common.reflect.TypeToken",
"com.microsoft.azure.management.iotcentral.v2018_09_01.AppPatch",
"com.microsoft.rest.ServiceResponse",
"com.microsoft.rest.Validator"
] | import com.google.common.reflect.TypeToken; import com.microsoft.azure.management.iotcentral.v2018_09_01.AppPatch; import com.microsoft.rest.ServiceResponse; import com.microsoft.rest.Validator; | import com.google.common.reflect.*; import com.microsoft.azure.management.iotcentral.v2018_09_01.*; import com.microsoft.rest.*; | [
"com.google.common",
"com.microsoft.azure",
"com.microsoft.rest"
] | com.google.common; com.microsoft.azure; com.microsoft.rest; | 2,826,486 |
private void renameScenario(Document newDoc, int index)
{
// get the scenario object
NodeList list = newDoc.getElementsByTagName(ScenarioHandler.type);
Element scen = (Element) list.item(0);
scen.setAttribute(SCENARIO_NAME_ATTRIBUTE, newScenarioName(index));
}
| void function(Document newDoc, int index) { NodeList list = newDoc.getElementsByTagName(ScenarioHandler.type); Element scen = (Element) list.item(0); scen.setAttribute(SCENARIO_NAME_ATTRIBUTE, newScenarioName(index)); } | /**
* rename the scenario using the supplied index
*
* @param newDoc
* document containing the scenario to edit
* @param index
*/ | rename the scenario using the supplied index | renameScenario | {
"repo_name": "alastrina123/debrief",
"path": "org.mwc.asset.legacy/src/ASSET/Util/MonteCarlo/MultiScenarioGenerator.java",
"license": "epl-1.0",
"size": 30738
} | [
"org.w3c.dom.Document",
"org.w3c.dom.Element",
"org.w3c.dom.NodeList"
] | import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 1,761,364 |
protected String marshallMetadata(Object metadata, String mediaType) throws JAXBException {
final Class<?>[] jaxbClasses = new Class[] { Link.class, Attribute.class, Descriptor.class, LinkTemplate.class, PersistenceUnit.class, Query.class, LinkList.class, QueryList.class,
ResourceSchema.class, Property.class, Reference.class, LinkV2.class, MetadataCatalog.class, Resource.class, ItemLinks.class, ContextsCatalog.class };
final JAXBContext context = (JAXBContext) JAXBContextFactory.createContext(jaxbClasses, null);
final Marshaller marshaller = context.createMarshaller();
marshaller.setProperty(MarshallerProperties.JSON_INCLUDE_ROOT, Boolean.FALSE);
marshaller.setProperty(MarshallerProperties.MEDIA_TYPE, mediaType);
marshaller.setProperty(MarshallerProperties.JSON_REDUCE_ANY_ARRAYS, true);
final StringWriter writer = new StringWriter();
marshaller.marshal(metadata, writer);
return writer.toString();
} | String function(Object metadata, String mediaType) throws JAXBException { final Class<?>[] jaxbClasses = new Class[] { Link.class, Attribute.class, Descriptor.class, LinkTemplate.class, PersistenceUnit.class, Query.class, LinkList.class, QueryList.class, ResourceSchema.class, Property.class, Reference.class, LinkV2.class, MetadataCatalog.class, Resource.class, ItemLinks.class, ContextsCatalog.class }; final JAXBContext context = (JAXBContext) JAXBContextFactory.createContext(jaxbClasses, null); final Marshaller marshaller = context.createMarshaller(); marshaller.setProperty(MarshallerProperties.JSON_INCLUDE_ROOT, Boolean.FALSE); marshaller.setProperty(MarshallerProperties.MEDIA_TYPE, mediaType); marshaller.setProperty(MarshallerProperties.JSON_REDUCE_ANY_ARRAYS, true); final StringWriter writer = new StringWriter(); marshaller.marshal(metadata, writer); return writer.toString(); } | /**
* Marshall metadata.
*
* @param metadata the metadata
* @param mediaType the media type
* @return the string
* @throws JAXBException the jAXB exception
*/ | Marshall metadata | marshallMetadata | {
"repo_name": "RallySoftware/eclipselink.runtime",
"path": "dbws/org.eclipse.persistence.dbws/src/org/eclipse/persistence/jpa/rs/resources/common/AbstractResource.java",
"license": "epl-1.0",
"size": 11311
} | [
"java.io.StringWriter",
"javax.xml.bind.JAXBException",
"javax.xml.bind.Marshaller",
"org.eclipse.persistence.internal.jpa.rs.metadata.model.Attribute",
"org.eclipse.persistence.internal.jpa.rs.metadata.model.Descriptor",
"org.eclipse.persistence.internal.jpa.rs.metadata.model.ItemLinks",
"org.eclipse.persistence.internal.jpa.rs.metadata.model.Link",
"org.eclipse.persistence.internal.jpa.rs.metadata.model.LinkTemplate",
"org.eclipse.persistence.internal.jpa.rs.metadata.model.LinkV2",
"org.eclipse.persistence.internal.jpa.rs.metadata.model.PersistenceUnit",
"org.eclipse.persistence.internal.jpa.rs.metadata.model.Query",
"org.eclipse.persistence.internal.jpa.rs.metadata.model.v2.ContextsCatalog",
"org.eclipse.persistence.internal.jpa.rs.metadata.model.v2.MetadataCatalog",
"org.eclipse.persistence.internal.jpa.rs.metadata.model.v2.Property",
"org.eclipse.persistence.internal.jpa.rs.metadata.model.v2.Reference",
"org.eclipse.persistence.internal.jpa.rs.metadata.model.v2.Resource",
"org.eclipse.persistence.internal.jpa.rs.metadata.model.v2.ResourceSchema",
"org.eclipse.persistence.jaxb.JAXBContext",
"org.eclipse.persistence.jaxb.JAXBContextFactory",
"org.eclipse.persistence.jaxb.MarshallerProperties",
"org.eclipse.persistence.jpa.rs.util.list.LinkList",
"org.eclipse.persistence.jpa.rs.util.list.QueryList"
] | import java.io.StringWriter; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; import org.eclipse.persistence.internal.jpa.rs.metadata.model.Attribute; import org.eclipse.persistence.internal.jpa.rs.metadata.model.Descriptor; import org.eclipse.persistence.internal.jpa.rs.metadata.model.ItemLinks; import org.eclipse.persistence.internal.jpa.rs.metadata.model.Link; import org.eclipse.persistence.internal.jpa.rs.metadata.model.LinkTemplate; import org.eclipse.persistence.internal.jpa.rs.metadata.model.LinkV2; import org.eclipse.persistence.internal.jpa.rs.metadata.model.PersistenceUnit; import org.eclipse.persistence.internal.jpa.rs.metadata.model.Query; import org.eclipse.persistence.internal.jpa.rs.metadata.model.v2.ContextsCatalog; import org.eclipse.persistence.internal.jpa.rs.metadata.model.v2.MetadataCatalog; import org.eclipse.persistence.internal.jpa.rs.metadata.model.v2.Property; import org.eclipse.persistence.internal.jpa.rs.metadata.model.v2.Reference; import org.eclipse.persistence.internal.jpa.rs.metadata.model.v2.Resource; import org.eclipse.persistence.internal.jpa.rs.metadata.model.v2.ResourceSchema; import org.eclipse.persistence.jaxb.JAXBContext; import org.eclipse.persistence.jaxb.JAXBContextFactory; import org.eclipse.persistence.jaxb.MarshallerProperties; import org.eclipse.persistence.jpa.rs.util.list.LinkList; import org.eclipse.persistence.jpa.rs.util.list.QueryList; | import java.io.*; import javax.xml.bind.*; import org.eclipse.persistence.internal.jpa.rs.metadata.model.*; import org.eclipse.persistence.internal.jpa.rs.metadata.model.v2.*; import org.eclipse.persistence.jaxb.*; import org.eclipse.persistence.jpa.rs.util.list.*; | [
"java.io",
"javax.xml",
"org.eclipse.persistence"
] | java.io; javax.xml; org.eclipse.persistence; | 2,606,593 |
public I_DirectedLine draw(final Graphics graphic) {
graphic.drawLine((int) Math.round(sourceX),
(int) Math.round(sourceY),
(int) Math.round(targetX),
(int) Math.round(targetY));
return this;
} | I_DirectedLine function(final Graphics graphic) { graphic.drawLine((int) Math.round(sourceX), (int) Math.round(sourceY), (int) Math.round(targetX), (int) Math.round(targetY)); return this; } | /**
* Draws the solid line into the given graphic
*
* @param graphic to be drawn into
* @return line
*/ | Draws the solid line into the given graphic | draw | {
"repo_name": "vnu-dse/rtl",
"path": "src/gui/org/tzi/use/gui/views/diagrams/util/SolidDirectedLine.java",
"license": "gpl-2.0",
"size": 2350
} | [
"java.awt.Graphics"
] | import java.awt.Graphics; | import java.awt.*; | [
"java.awt"
] | java.awt; | 2,452,101 |
Choices loadChoices(final Choices model); | Choices loadChoices(final Choices model); | /**
* <p>
* Load and get a {@link Choices} associated with the specified {@link Choices}.
* </p>
*/ | Load and get a <code>Choices</code> associated with the specified <code>Choices</code>. | loadChoices | {
"repo_name": "wrml/wrml",
"path": "core/src/main/java/org/wrml/runtime/schema/SchemaLoader.java",
"license": "apache-2.0",
"size": 12232
} | [
"org.wrml.model.schema.Choices"
] | import org.wrml.model.schema.Choices; | import org.wrml.model.schema.*; | [
"org.wrml.model"
] | org.wrml.model; | 282,685 |
public static Shape intersect(Shape shape1, Shape shape2,
boolean canChangeShape1, boolean canChangeShape2) {
Rectangle2D r1 = ShapeUtils.getRectangle2D(shape1);
Rectangle2D r2 = ShapeUtils.getRectangle2D(shape2);
Shape returnValue;
if (r1 != null && r2 != null) {
returnValue = r1.createIntersection(r2);
} else if (r1 != null) {
returnValue = clipToRect(shape2, r1);
} else if (r2 != null) {
returnValue = clipToRect(shape1, r2);
} else {
// the next 30 lines just try to assign returnValue in a way that
// creates as few new Areas as possible.
if (shape1 instanceof Area) {
Area a1 = (Area) shape1;
if (shape2 instanceof Area) {
Area a2 = (Area) shape2;
if (canChangeShape1) {
a1.intersect(a2);
returnValue = a1;
} else if (canChangeShape2) {
a2.intersect(a1);
returnValue = a2;
} else {
Area copy = new Area(a1);
copy.intersect(a2);
returnValue = copy;
}
} else {
Area a2 = new Area(shape2);
a2.intersect(a1);
returnValue = a2;
}
} else if (shape2 instanceof Area) {
Area a1 = new Area(shape1);
Area a2 = (Area) shape2;
a1.intersect(a2);
returnValue = a2;
} else {
Area a1 = new Area(shape1);
Area a2 = new Area(shape2);
a1.intersect(a2);
returnValue = a1;
}
}
Rectangle returnValueAsRect = ShapeUtils.getRectangle(returnValue);
if (returnValueAsRect != null)
return returnValueAsRect;
Rectangle2D returnValueAsRect2D = ShapeUtils
.getRectangle2D(returnValue);
if (returnValueAsRect2D != null)
return returnValueAsRect2D;
return returnValue;
} | static Shape function(Shape shape1, Shape shape2, boolean canChangeShape1, boolean canChangeShape2) { Rectangle2D r1 = ShapeUtils.getRectangle2D(shape1); Rectangle2D r2 = ShapeUtils.getRectangle2D(shape2); Shape returnValue; if (r1 != null && r2 != null) { returnValue = r1.createIntersection(r2); } else if (r1 != null) { returnValue = clipToRect(shape2, r1); } else if (r2 != null) { returnValue = clipToRect(shape1, r2); } else { if (shape1 instanceof Area) { Area a1 = (Area) shape1; if (shape2 instanceof Area) { Area a2 = (Area) shape2; if (canChangeShape1) { a1.intersect(a2); returnValue = a1; } else if (canChangeShape2) { a2.intersect(a1); returnValue = a2; } else { Area copy = new Area(a1); copy.intersect(a2); returnValue = copy; } } else { Area a2 = new Area(shape2); a2.intersect(a1); returnValue = a2; } } else if (shape2 instanceof Area) { Area a1 = new Area(shape1); Area a2 = (Area) shape2; a1.intersect(a2); returnValue = a2; } else { Area a1 = new Area(shape1); Area a2 = new Area(shape2); a1.intersect(a2); returnValue = a1; } } Rectangle returnValueAsRect = ShapeUtils.getRectangle(returnValue); if (returnValueAsRect != null) return returnValueAsRect; Rectangle2D returnValueAsRect2D = ShapeUtils .getRectangle2D(returnValue); if (returnValueAsRect2D != null) return returnValueAsRect2D; return returnValue; } | /**
* Calculate the intersection of two shapes using the Clipper approach if
* possible.
* <p>
* If neither argument is rectangular then both shapes are converted to
* Areas to calculate the intersection.
*
* @param canChangeShape1
* if true then this method has permission to modify the "shape1"
* argument and return that argument. If false then this method
* will, if appropriate, either modify the "shape2" argument or
* create entirely new Area objects to calculate the
* intersection.
*
* @param canChangeShape2
* if true then this method has permission to modify the "shape2"
* argument and return that argument. If false then this method
* will, if appropriate, either modify the "shape1" argument or
* create entirely new Area objects to calculate the
* intersection.
*
* @return the intersection of the two arguments. This tries to return a
* Rectangle or Rectangle2D before it returns an abstract Shape.
*/ | Calculate the intersection of two shapes using the Clipper approach if possible. If neither argument is rectangular then both shapes are converted to Areas to calculate the intersection | intersect | {
"repo_name": "mickleness/pumpernickel",
"path": "src/main/java/com/pump/geom/Clipper.java",
"license": "mit",
"size": 21997
} | [
"java.awt.Rectangle",
"java.awt.Shape",
"java.awt.geom.Area",
"java.awt.geom.Rectangle2D"
] | import java.awt.Rectangle; import java.awt.Shape; import java.awt.geom.Area; import java.awt.geom.Rectangle2D; | import java.awt.*; import java.awt.geom.*; | [
"java.awt"
] | java.awt; | 1,764,265 |
int updateByExample(User record, UserExample example); | int updateByExample(User record, UserExample example); | /**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table user
*
* @ibatorgenerated Sat Jan 29 22:57:50 ICT 2011
*/ | This method was generated by Apache iBATIS ibator. This method corresponds to the database table user | updateByExample | {
"repo_name": "geekzy/stripes-xytable",
"path": "src/com/xybase/app/dao/UserDAO.java",
"license": "apache-2.0",
"size": 2873
} | [
"com.xybase.app.domain.User",
"com.xybase.app.domain.UserExample"
] | import com.xybase.app.domain.User; import com.xybase.app.domain.UserExample; | import com.xybase.app.domain.*; | [
"com.xybase.app"
] | com.xybase.app; | 1,196,223 |
public boolean isTableFunction()
{
if ( getAliasType() != AliasInfo.ALIAS_TYPE_FUNCTION_AS_CHAR ) { return false; }
RoutineAliasInfo rai = (RoutineAliasInfo) getAliasInfo();
return rai.getReturnType().isRowMultiSet();
} | boolean function() { if ( getAliasType() != AliasInfo.ALIAS_TYPE_FUNCTION_AS_CHAR ) { return false; } RoutineAliasInfo rai = (RoutineAliasInfo) getAliasInfo(); return rai.getReturnType().isRowMultiSet(); } | /**
* Report whether this descriptor describes a Table Function.
*
*/ | Report whether this descriptor describes a Table Function | isTableFunction | {
"repo_name": "trejkaz/derby",
"path": "java/engine/org/apache/derby/iapi/sql/dictionary/AliasDescriptor.java",
"license": "apache-2.0",
"size": 14301
} | [
"org.apache.derby.catalog.AliasInfo",
"org.apache.derby.catalog.types.RoutineAliasInfo"
] | import org.apache.derby.catalog.AliasInfo; import org.apache.derby.catalog.types.RoutineAliasInfo; | import org.apache.derby.catalog.*; import org.apache.derby.catalog.types.*; | [
"org.apache.derby"
] | org.apache.derby; | 1,384,924 |
@Test
public void testIsNtlmType1Message() {
final SimpleHttpRequest request = new SimpleHttpRequest();
final AuthorizationHeader header = new AuthorizationHeader(request);
Assert.assertFalse(header.isNtlmType1Message());
request.addHeader("Authorization", "");
Assert.assertFalse(header.isNtlmType1Message());
request.addHeader("Authorization", "NTLM TlRMTVNTUAABAAAABzIAAAYABgArAAAACwALACAAAABXT1JLU1RBVElPTkRPTUFJTg==");
Assert.assertTrue(header.isNtlmType1Message());
} | void function() { final SimpleHttpRequest request = new SimpleHttpRequest(); final AuthorizationHeader header = new AuthorizationHeader(request); Assert.assertFalse(header.isNtlmType1Message()); request.addHeader(STR, ""); Assert.assertFalse(header.isNtlmType1Message()); request.addHeader(STR, "NTLM TlRMTVNTUAABAAAABzIAAAYABgArAAAACwALACAAAABXT1JLU1RBVElPTkRPTUFJTg=="); Assert.assertTrue(header.isNtlmType1Message()); } | /**
* Test is ntlm type1 message.
*/ | Test is ntlm type1 message | testIsNtlmType1Message | {
"repo_name": "AriSuutariST/waffle",
"path": "Source/JNA/waffle-tests/src/test/java/waffle/util/AuthorizationHeaderTests.java",
"license": "epl-1.0",
"size": 6267
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 635,536 |
private void onRenameFileOperationFinish(RenameFileOperation operation, RemoteOperationResult result) {
dismissLoadingDialog();
OCFile renamedFile = operation.getFile();
if (result.isSuccess()) {
FileFragment details = getSecondFragment();
if (details != null) {
if (details instanceof FileDetailFragment && renamedFile.equals(details.getFile()) ) {
((FileDetailFragment) details).updateFileDetails(renamedFile, getAccount());
showDetails(renamedFile);
} else if (details instanceof PreviewMediaFragment && renamedFile.equals(details.getFile())) {
((PreviewMediaFragment) details).updateFile(renamedFile);
if (PreviewMediaFragment.canBePreviewed(renamedFile)) {
int position = ((PreviewMediaFragment)details).getPosition();
startMediaPreview(renamedFile, position, true);
} else {
getFileOperationsHelper().openFile(renamedFile);
}
}
}
if (getStorageManager().getFileById(renamedFile.getParentId()).equals(getCurrentDir())) {
refreshListOfFilesFragment();
}
} else {
Toast msg = Toast.makeText(this, ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources()),
Toast.LENGTH_LONG);
msg.show();
if (result.isSslRecoverableException()) {
mLastSslUntrustedServerResult = result;
showUntrustedCertDialog(mLastSslUntrustedServerResult);
}
}
} | void function(RenameFileOperation operation, RemoteOperationResult result) { dismissLoadingDialog(); OCFile renamedFile = operation.getFile(); if (result.isSuccess()) { FileFragment details = getSecondFragment(); if (details != null) { if (details instanceof FileDetailFragment && renamedFile.equals(details.getFile()) ) { ((FileDetailFragment) details).updateFileDetails(renamedFile, getAccount()); showDetails(renamedFile); } else if (details instanceof PreviewMediaFragment && renamedFile.equals(details.getFile())) { ((PreviewMediaFragment) details).updateFile(renamedFile); if (PreviewMediaFragment.canBePreviewed(renamedFile)) { int position = ((PreviewMediaFragment)details).getPosition(); startMediaPreview(renamedFile, position, true); } else { getFileOperationsHelper().openFile(renamedFile); } } } if (getStorageManager().getFileById(renamedFile.getParentId()).equals(getCurrentDir())) { refreshListOfFilesFragment(); } } else { Toast msg = Toast.makeText(this, ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources()), Toast.LENGTH_LONG); msg.show(); if (result.isSslRecoverableException()) { mLastSslUntrustedServerResult = result; showUntrustedCertDialog(mLastSslUntrustedServerResult); } } } | /**
* Updates the view associated to the activity after the finish of an operation trying to rename a
* file.
*
* @param operation Renaming operation performed.
* @param result Result of the renaming.
*/ | Updates the view associated to the activity after the finish of an operation trying to rename a file | onRenameFileOperationFinish | {
"repo_name": "Maysami/elenoon-drive",
"path": "src/com/elenoondrive/android/ui/activity/FileDisplayActivity.java",
"license": "gpl-2.0",
"size": 81358
} | [
"android.widget.Toast",
"com.elenoondrive.android.datamodel.OCFile",
"com.elenoondrive.android.operations.RenameFileOperation",
"com.elenoondrive.android.ui.fragment.FileDetailFragment",
"com.elenoondrive.android.ui.fragment.FileFragment",
"com.elenoondrive.android.ui.preview.PreviewMediaFragment",
"com.elenoondrive.android.utils.ErrorMessageAdapter",
"com.owncloud.android.lib.common.operations.RemoteOperationResult"
] | import android.widget.Toast; import com.elenoondrive.android.datamodel.OCFile; import com.elenoondrive.android.operations.RenameFileOperation; import com.elenoondrive.android.ui.fragment.FileDetailFragment; import com.elenoondrive.android.ui.fragment.FileFragment; import com.elenoondrive.android.ui.preview.PreviewMediaFragment; import com.elenoondrive.android.utils.ErrorMessageAdapter; import com.owncloud.android.lib.common.operations.RemoteOperationResult; | import android.widget.*; import com.elenoondrive.android.datamodel.*; import com.elenoondrive.android.operations.*; import com.elenoondrive.android.ui.fragment.*; import com.elenoondrive.android.ui.preview.*; import com.elenoondrive.android.utils.*; import com.owncloud.android.lib.common.operations.*; | [
"android.widget",
"com.elenoondrive.android",
"com.owncloud.android"
] | android.widget; com.elenoondrive.android; com.owncloud.android; | 953,508 |
public void setStepped(SteppedCallback steppedCallback) {
// sets the callback
this.steppedCallback = steppedCallback;
// stores and manages callback
getChart().getOptions().setCallback(getElement(), Property.STEPPED, steppedCallback, steppedCallbackProxy);
} | void function(SteppedCallback steppedCallback) { this.steppedCallback = steppedCallback; getChart().getOptions().setCallback(getElement(), Property.STEPPED, steppedCallback, steppedCallbackProxy); } | /**
* Sets the stepped callback.
*
* @param steppedCallback the stepped callback.
*/ | Sets the stepped callback | setStepped | {
"repo_name": "pepstock-org/Charba",
"path": "src/org/pepstock/charba/client/configuration/Line.java",
"license": "apache-2.0",
"size": 27516
} | [
"org.pepstock.charba.client.callbacks.SteppedCallback"
] | import org.pepstock.charba.client.callbacks.SteppedCallback; | import org.pepstock.charba.client.callbacks.*; | [
"org.pepstock.charba"
] | org.pepstock.charba; | 2,031,271 |
@Override
public Adapter createRouterMediatorOutputConnectorAdapter() {
if (routerMediatorOutputConnectorItemProvider == null) {
routerMediatorOutputConnectorItemProvider = new RouterMediatorOutputConnectorItemProvider(this);
}
return routerMediatorOutputConnectorItemProvider;
}
protected RouterMediatorTargetOutputConnectorItemProvider routerMediatorTargetOutputConnectorItemProvider; | Adapter function() { if (routerMediatorOutputConnectorItemProvider == null) { routerMediatorOutputConnectorItemProvider = new RouterMediatorOutputConnectorItemProvider(this); } return routerMediatorOutputConnectorItemProvider; } protected RouterMediatorTargetOutputConnectorItemProvider routerMediatorTargetOutputConnectorItemProvider; | /**
* This creates an adapter for a {@link org.wso2.developerstudio.eclipse.gmf.esb.RouterMediatorOutputConnector}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This creates an adapter for a <code>org.wso2.developerstudio.eclipse.gmf.esb.RouterMediatorOutputConnector</code>. | createRouterMediatorOutputConnectorAdapter | {
"repo_name": "rajeevanv89/developer-studio",
"path": "esb/org.wso2.developerstudio.eclipse.gmf.esb.edit/src/org/wso2/developerstudio/eclipse/gmf/esb/provider/EsbItemProviderAdapterFactory.java",
"license": "apache-2.0",
"size": 286852
} | [
"org.eclipse.emf.common.notify.Adapter"
] | import org.eclipse.emf.common.notify.Adapter; | import org.eclipse.emf.common.notify.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,344,782 |
public Observable<ServiceResponse<UUID>> createCustomPrebuiltEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, String name) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null.");
}
if (appId == null) {
throw new IllegalArgumentException("Parameter appId is required and cannot be null.");
}
if (versionId == null) {
throw new IllegalArgumentException("Parameter versionId is required and cannot be null.");
}
if (entityId == null) {
throw new IllegalArgumentException("Parameter entityId is required and cannot be null.");
} | Observable<ServiceResponse<UUID>> function(UUID appId, String versionId, UUID entityId, String name) { if (this.client.endpoint() == null) { throw new IllegalArgumentException(STR); } if (appId == null) { throw new IllegalArgumentException(STR); } if (versionId == null) { throw new IllegalArgumentException(STR); } if (entityId == null) { throw new IllegalArgumentException(STR); } | /**
* Create a role for a prebuilt entity in a version of the application.
*
* @param appId The application ID.
* @param versionId The version ID.
* @param entityId The entity model ID.
* @param name The entity role name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the UUID object
*/ | Create a role for a prebuilt entity in a version of the application | createCustomPrebuiltEntityRoleWithServiceResponseAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java",
"license": "mit",
"size": 818917
} | [
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.rest.ServiceResponse; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 2,213,502 |
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller<PollResult<Void>, Void> beginDelete(String resourceGroupName, String circuitName) {
return beginDeleteAsync(resourceGroupName, circuitName).getSyncPoller();
} | @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller<PollResult<Void>, Void> function(String resourceGroupName, String circuitName) { return beginDeleteAsync(resourceGroupName, circuitName).getSyncPoller(); } | /**
* Deletes the specified express route circuit.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of long-running operation.
*/ | Deletes the specified express route circuit | beginDelete | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitsClientImpl.java",
"license": "mit",
"size": 143721
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.management.polling.PollResult",
"com.azure.core.util.polling.SyncPoller"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.management.polling.PollResult; import com.azure.core.util.polling.SyncPoller; | import com.azure.core.annotation.*; import com.azure.core.management.polling.*; import com.azure.core.util.polling.*; | [
"com.azure.core"
] | com.azure.core; | 2,427,376 |
public Color getDayForeground(int dayOfWeek) {
Color c;
c = dayToColorTable.get(dayOfWeek);
if (c == null) {
c = getForeground();
}
return c;
} | Color function(int dayOfWeek) { Color c; c = dayToColorTable.get(dayOfWeek); if (c == null) { c = getForeground(); } return c; } | /**
* Return the color that should be used for painting the numerical day of the week.
*
* @param dayOfWeek The day of week to get the color for.
* @return The color to be used for painting the numeric day of the week.
* If this was no color has yet been defined the component foreground color
* will be returned.
*/ | Return the color that should be used for painting the numerical day of the week | getDayForeground | {
"repo_name": "syncer/swingx",
"path": "swingx-core/src/main/java/org/jdesktop/swingx/JXMonthView.java",
"license": "lgpl-2.1",
"size": 62756
} | [
"java.awt.Color"
] | import java.awt.Color; | import java.awt.*; | [
"java.awt"
] | java.awt; | 2,664,228 |
public List<String> getAnswers() {
return answer;
} | List<String> function() { return answer; } | /**
* Visszaadja a valaszadasi lehetosegek listajat.
* @return Egy lista.
**/ | Visszaadja a valaszadasi lehetosegek listajat | getAnswers | {
"repo_name": "Transfet/ProgtechQuiz",
"path": "src/main/java/hu/transfet/unideb/application/QuestionParser.java",
"license": "apache-2.0",
"size": 1678
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,548,928 |
@Override
public void clientConnected(Client connectedClient) {
System.out.println("Connected to " + connectedClient);
this.knownClients.add(connectedClient);
} | void function(Client connectedClient) { System.out.println(STR + connectedClient); this.knownClients.add(connectedClient); } | /**
* Adds the client to the collection of known clients.
*/ | Adds the client to the collection of known clients | clientConnected | {
"repo_name": "romoore/cs352-chat",
"path": "src/main/java/edu/rutgers/cs/chat/ui/ConsoleUI.java",
"license": "gpl-2.0",
"size": 7378
} | [
"edu.rutgers.cs.chat.Client"
] | import edu.rutgers.cs.chat.Client; | import edu.rutgers.cs.chat.*; | [
"edu.rutgers.cs"
] | edu.rutgers.cs; | 598,936 |
default AdvancedXQueryEndpointProducerBuilder configurationProperties(
Map<String, Object> configurationProperties) {
doSetProperty("configurationProperties", configurationProperties);
return this;
} | default AdvancedXQueryEndpointProducerBuilder configurationProperties( Map<String, Object> configurationProperties) { doSetProperty(STR, configurationProperties); return this; } | /**
* To set custom Saxon configuration properties.
*
* The option is a: <code>java.util.Map<java.lang.String,
* java.lang.Object></code> type.
*
* Group: advanced
*/ | To set custom Saxon configuration properties. The option is a: <code>java.util.Map<java.lang.String, java.lang.Object></code> type. Group: advanced | configurationProperties | {
"repo_name": "ullgren/camel",
"path": "core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/XQueryEndpointBuilderFactory.java",
"license": "apache-2.0",
"size": 63709
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,932,244 |
public Text evaluate(Text n, IntWritable fromBase, IntWritable toBase) {
if (n == null || fromBase == null || toBase == null) {
return null;
}
int fromBs = fromBase.get();
int toBs = toBase.get();
if (fromBs < Character.MIN_RADIX || fromBs > Character.MAX_RADIX
|| Math.abs(toBs) < Character.MIN_RADIX
|| Math.abs(toBs) > Character.MAX_RADIX) {
return null;
}
byte[] num = n.getBytes();
boolean negative = (num[0] == '-');
int first = 0;
if (negative) {
first = 1;
}
// Copy the digits in the right side of the array
for (int i = 1; i <= n.getLength() - first; i++) {
value[value.length - i] = num[n.getLength() - i];
}
char2byte(fromBs, value.length - n.getLength() + first);
// Do the conversion by going through a 64 bit integer
long val = encode(fromBs, value.length - n.getLength() + first);
if (negative && toBs > 0) {
if (val < 0) {
val = -1;
} else {
val = -val;
}
}
if (toBs < 0 && val < 0) {
val = -val;
negative = true;
}
decode(val, Math.abs(toBs));
// Find the first non-zero digit or the last digits if all are zero.
for (first = 0; first < value.length - 1 && value[first] == 0; first++) {
;
}
byte2char(Math.abs(toBs), first);
if (negative && toBs < 0) {
value[--first] = '-';
}
result.set(value, first, value.length - first);
return result;
} | Text function(Text n, IntWritable fromBase, IntWritable toBase) { if (n == null fromBase == null toBase == null) { return null; } int fromBs = fromBase.get(); int toBs = toBase.get(); if (fromBs < Character.MIN_RADIX fromBs > Character.MAX_RADIX Math.abs(toBs) < Character.MIN_RADIX Math.abs(toBs) > Character.MAX_RADIX) { return null; } byte[] num = n.getBytes(); boolean negative = (num[0] == '-'); int first = 0; if (negative) { first = 1; } for (int i = 1; i <= n.getLength() - first; i++) { value[value.length - i] = num[n.getLength() - i]; } char2byte(fromBs, value.length - n.getLength() + first); long val = encode(fromBs, value.length - n.getLength() + first); if (negative && toBs > 0) { if (val < 0) { val = -1; } else { val = -val; } } if (toBs < 0 && val < 0) { val = -val; negative = true; } decode(val, Math.abs(toBs)); for (first = 0; first < value.length - 1 && value[first] == 0; first++) { ; } byte2char(Math.abs(toBs), first); if (negative && toBs < 0) { value[--first] = '-'; } result.set(value, first, value.length - first); return result; } | /**
* Convert numbers between different number bases. If toBase>0 the result is
* unsigned, otherwise it is signed.
*
*/ | Convert numbers between different number bases. If toBase>0 the result is unsigned, otherwise it is signed | evaluate | {
"repo_name": "guohan/hadoop",
"path": "tdh_udf/src/org/apache/hadoop/hive/ql/udf/UDFConv.java",
"license": "apache-2.0",
"size": 6079
} | [
"org.apache.hadoop.io.IntWritable",
"org.apache.hadoop.io.Text"
] | import org.apache.hadoop.io.IntWritable; import org.apache.hadoop.io.Text; | import org.apache.hadoop.io.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 61,438 |
@POST
@Consumes({"text/cnd"})
@Timed
public Response updateCnd(final InputStream requestBodyStream)
throws RepositoryException, IOException {
try {
nodeService.registerNodeTypes(session, requestBodyStream);
return status(SC_NO_CONTENT).build();
} finally {
session.logout();
}
} | @Consumes({STR}) Response function(final InputStream requestBodyStream) throws RepositoryException, IOException { try { nodeService.registerNodeTypes(session, requestBodyStream); return status(SC_NO_CONTENT).build(); } finally { session.logout(); } } | /**
* Update the NodeTypes by POSTing a CND file/fragment
*
* @return 201
* @throws javax.jcr.RepositoryException
* @throws java.io.IOException
*/ | Update the NodeTypes by POSTing a CND file/fragment | updateCnd | {
"repo_name": "barmintor/fcrepo4",
"path": "fcrepo-http-api/src/main/java/org/fcrepo/http/api/repository/FedoraRepositoryNodeTypes.java",
"license": "apache-2.0",
"size": 3205
} | [
"java.io.IOException",
"java.io.InputStream",
"javax.jcr.RepositoryException",
"javax.ws.rs.Consumes",
"javax.ws.rs.core.Response"
] | import java.io.IOException; import java.io.InputStream; import javax.jcr.RepositoryException; import javax.ws.rs.Consumes; import javax.ws.rs.core.Response; | import java.io.*; import javax.jcr.*; import javax.ws.rs.*; import javax.ws.rs.core.*; | [
"java.io",
"javax.jcr",
"javax.ws"
] | java.io; javax.jcr; javax.ws; | 179,818 |
public final void pushNamespaceContext(PrefixResolver pr)
{
m_prefixResolvers.push(pr);
} | final void function(PrefixResolver pr) { m_prefixResolvers.push(pr); } | /**
* Push a current namespace context for the xpath.
*
* @param pr the prefix resolver to be used for resolving prefixes to
* namespace URLs.
*/ | Push a current namespace context for the xpath | pushNamespaceContext | {
"repo_name": "md-5/jdk10",
"path": "src/java.xml/share/classes/com/sun/org/apache/xpath/internal/XPathContext.java",
"license": "gpl-2.0",
"size": 40051
} | [
"com.sun.org.apache.xml.internal.utils.PrefixResolver"
] | import com.sun.org.apache.xml.internal.utils.PrefixResolver; | import com.sun.org.apache.xml.internal.utils.*; | [
"com.sun.org"
] | com.sun.org; | 871,867 |
public void setFileForWrite(String file) throws IOException;
| void function(String file) throws IOException; | /**
* Initializes the service on a given file path.
*
* @param file Path to initialize the service with.
* @throws IOException If there is an error initializing the service with
* <code>file</code>.
*/ | Initializes the service on a given file path | setFileForWrite | {
"repo_name": "bramalingam/bioformats",
"path": "components/formats-gpl/src/loci/formats/services/JHDFService.java",
"license": "gpl-2.0",
"size": 7084
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,839,260 |
public String toString(String pattern) {
if (pattern == null) {
return toString();
}
return DateTimeFormat.forPattern(pattern).print(this);
} | String function(String pattern) { if (pattern == null) { return toString(); } return DateTimeFormat.forPattern(pattern).print(this); } | /**
* Output the month-day using the specified format pattern.
*
* @param pattern the pattern specification, null means use <code>toString</code>
* @see org.joda.time.format.DateTimeFormat
*/ | Output the month-day using the specified format pattern | toString | {
"repo_name": "rbible/joda-time",
"path": "src/main/java/org/joda/time/MonthDay.java",
"license": "apache-2.0",
"size": 37597
} | [
"org.joda.time.format.DateTimeFormat"
] | import org.joda.time.format.DateTimeFormat; | import org.joda.time.format.*; | [
"org.joda.time"
] | org.joda.time; | 2,184,352 |
EEnum getSpaceType(); | EEnum getSpaceType(); | /**
* Returns the meta object for enum '{@link org.eclipse.emf.ecore.xml.namespace.SpaceType <em>Space Type</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for enum '<em>Space Type</em>'.
* @see org.eclipse.emf.ecore.xml.namespace.SpaceType
* @generated
*/ | Returns the meta object for enum '<code>org.eclipse.emf.ecore.xml.namespace.SpaceType Space Type</code>'. | getSpaceType | {
"repo_name": "markus1978/clickwatch",
"path": "external/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/xml/namespace/XMLNamespacePackage.java",
"license": "apache-2.0",
"size": 15639
} | [
"org.eclipse.emf.ecore.EEnum"
] | import org.eclipse.emf.ecore.EEnum; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 412,224 |
// These methods should actually be called for rendering
final public void render(Canvas canvas, AudioData data, Rect rect)
{
if (mPoints == null || mPoints.length < data.bytes.length * 4) {
mPoints = new float[data.bytes.length * 4];
}
onRender(canvas, data, rect);
} | final void function(Canvas canvas, AudioData data, Rect rect) { if (mPoints == null mPoints.length < data.bytes.length * 4) { mPoints = new float[data.bytes.length * 4]; } onRender(canvas, data, rect); } | /**
* Render the audio data onto the canvas
* @param canvas - Canvas to draw on
* @param data - Data to render
* @param rect - Rect to render into
*/ | Render the audio data onto the canvas | render | {
"repo_name": "JavierNicolas/JadaMusic",
"path": "app3/src/main/java/com/pheelicks/visualizer/renderer/Renderer.java",
"license": "gpl-3.0",
"size": 2061
} | [
"android.graphics.Canvas",
"android.graphics.Rect",
"com.pheelicks.visualizer.AudioData"
] | import android.graphics.Canvas; import android.graphics.Rect; import com.pheelicks.visualizer.AudioData; | import android.graphics.*; import com.pheelicks.visualizer.*; | [
"android.graphics",
"com.pheelicks.visualizer"
] | android.graphics; com.pheelicks.visualizer; | 871,752 |
public void removeChildrenDisplay(List children)
{
if (children == null) return;
Iterator i = children.iterator();
while (i.hasNext())
removeChildDisplay((TreeBrowserDisplay) i.next());
}
public boolean isExpanded() { return expanded; } | void function(List children) { if (children == null) return; Iterator i = children.iterator(); while (i.hasNext()) removeChildDisplay((TreeBrowserDisplay) i.next()); } public boolean isExpanded() { return expanded; } | /**
* Removes the children contained in the passed collection.
*
* @param children The collection to handle.
*/ | Removes the children contained in the passed collection | removeChildrenDisplay | {
"repo_name": "simleo/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/browser/TreeBrowserDisplay.java",
"license": "gpl-2.0",
"size": 10817
} | [
"java.util.Iterator",
"java.util.List"
] | import java.util.Iterator; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,833,334 |
private boolean separateResourceJar(
List<Artifact> resourceJars, JavaTargetAttributes attributes) {
return !resourceJars.isEmpty()
|| !attributes.getResources().isEmpty()
|| !attributes.getResourceJars().isEmpty()
|| !attributes.getClassPathResources().isEmpty()
|| !getTranslations().isEmpty();
} | boolean function( List<Artifact> resourceJars, JavaTargetAttributes attributes) { return !resourceJars.isEmpty() !attributes.getResources().isEmpty() !attributes.getResourceJars().isEmpty() !attributes.getClassPathResources().isEmpty() !getTranslations().isEmpty(); } | /**
* If there are sources and no resource, the only output is from the javac action. Otherwise
* create a separate jar for the compilation and add resources with singlejar.
*/ | If there are sources and no resource, the only output is from the javac action. Otherwise create a separate jar for the compilation and add resources with singlejar | separateResourceJar | {
"repo_name": "dslomov/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/java/JavaCompilationHelper.java",
"license": "apache-2.0",
"size": 37545
} | [
"com.google.devtools.build.lib.actions.Artifact",
"java.util.List"
] | import com.google.devtools.build.lib.actions.Artifact; import java.util.List; | import com.google.devtools.build.lib.actions.*; import java.util.*; | [
"com.google.devtools",
"java.util"
] | com.google.devtools; java.util; | 335,267 |
public static boolean registerDashboardComponent( IDashboardComponent dashboardComponent )
{
String strName = dashboardComponent.getName( );
if ( _mapDashboardComponents.containsKey( strName ) )
{
AppLogService.error( "Error while registering dashboard for {} class= {}, factory already contains class= {}", strName,
dashboardComponent.getClass( ), _mapDashboardComponents.get( strName ) );
return false;
}
_mapDashboardComponents.put( strName, dashboardComponent );
return true;
} | static boolean function( IDashboardComponent dashboardComponent ) { String strName = dashboardComponent.getName( ); if ( _mapDashboardComponents.containsKey( strName ) ) { AppLogService.error( STR, strName, dashboardComponent.getClass( ), _mapDashboardComponents.get( strName ) ); return false; } _mapDashboardComponents.put( strName, dashboardComponent ); return true; } | /**
* Registers the new component. Name must be unique
*
* @param dashboardComponent
* the component to register
* @return <code>true</code> if registered, <code>false</code> otherwise.
*/ | Registers the new component. Name must be unique | registerDashboardComponent | {
"repo_name": "lutece-platform/lutece-core",
"path": "src/java/fr/paris/lutece/portal/business/dashboard/DashboardFactory.java",
"license": "bsd-3-clause",
"size": 3570
} | [
"fr.paris.lutece.portal.service.dashboard.IDashboardComponent",
"fr.paris.lutece.portal.service.util.AppLogService"
] | import fr.paris.lutece.portal.service.dashboard.IDashboardComponent; import fr.paris.lutece.portal.service.util.AppLogService; | import fr.paris.lutece.portal.service.dashboard.*; import fr.paris.lutece.portal.service.util.*; | [
"fr.paris.lutece"
] | fr.paris.lutece; | 375,747 |
@Test
public void testMultiRuleMatch()
throws SAXException, IOException
{
Digester digester = newLoader( new AbstractRulesModule()
{ | void function() throws SAXException, IOException { Digester digester = newLoader( new AbstractRulesModule() { | /**
* Test that:
* <ul>
* <li>you can have rules matching the same pattern as the SetNestedPropertiesRule,</li>
* <li>you can have rules matching child elements of the rule,</li>
* <li>the Rules object is reset nicely.</li>
* </ul>
*/ | Test that: you can have rules matching the same pattern as the SetNestedPropertiesRule, you can have rules matching child elements of the rule, the Rules object is reset nicely. | testMultiRuleMatch | {
"repo_name": "callMeDimit/commons-digester",
"path": "core/src/test/java/org/apache/commons/digester3/SetNestedPropertiesRuleTestCase.java",
"license": "apache-2.0",
"size": 14812
} | [
"java.io.IOException",
"org.apache.commons.digester3.binder.AbstractRulesModule",
"org.apache.commons.digester3.binder.DigesterLoader",
"org.xml.sax.SAXException"
] | import java.io.IOException; import org.apache.commons.digester3.binder.AbstractRulesModule; import org.apache.commons.digester3.binder.DigesterLoader; import org.xml.sax.SAXException; | import java.io.*; import org.apache.commons.digester3.binder.*; import org.xml.sax.*; | [
"java.io",
"org.apache.commons",
"org.xml.sax"
] | java.io; org.apache.commons; org.xml.sax; | 2,649,520 |
protected static void makeRMatrix(String in_rf, String out_Rmat) {
// TODO Auto-generated method stub
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByName("Renjin");
if(engine == null) {
throw new RuntimeException("Renjin not found!!!");
}
try {
BufferedReader br = Utils.getBufferedReader(in_rf);
final BidiMap<Integer, String> scaffs =
new TreeBidiMap<Integer, String>();
String line;
String s[];
int w = 0;
double d, l;
while( (line=br.readLine())!=null &&
line.startsWith("##")) {
scaffs.put(w++, line.replaceAll("^##", ""));
}
int n = scaffs.size();
int A = w*(w-1)/2;
DoubleMatrixBuilder dMat = new DoubleMatrixBuilder(n,n);
DoubleMatrixBuilder lMat = new DoubleMatrixBuilder(n,n);
DoubleMatrixBuilder iMat = new DoubleMatrixBuilder(n,n);
DoubleMatrixBuilder dAllMat = new DoubleMatrixBuilder(A*2,4);
DoubleMatrixBuilder lAllMat = new DoubleMatrixBuilder(A*2,4);
w = 0;
while( line!=null ) {
s = line.split("\\s+");
int i=scaffs.getKey(s[5]),
j=scaffs.getKey(s[6]),
hs = Integer.parseInt(s[7]);
d = Math.min(RF_MAX, Double.parseDouble(s[0]));
l = calcLODFromRf(d, hs);
dMat.set(i,j,d);
dMat.set(j,i,d);
lMat.set(i,j,l);
lMat.set(j,i,l);
iMat.set(i,j,w+1);
iMat.set(j,i,w+1+A);
for(int k=0; k<4; k++) {
d = Math.min(RF_MAX, Double.parseDouble(s[k+1]));
l = calcLODFromRf(d, hs);
dAllMat.set(w, k, d);
dAllMat.set(w+A, (k==0||k==3)?k:(3-k), d);
lAllMat.set(w, k, l);
lAllMat.set(w+A, (k==0||k==3)?k:(3-k), l);
}
w++;
line = br.readLine();
}
br.close();
StringVector scf = new StringArrayVector(scaffs.values());
dMat.setRowNames(scf);
dMat.setColNames(scf);
lMat.setRowNames(scf);
lMat.setColNames(scf);
iMat.setRowNames(scf);
iMat.setColNames(scf);
Context context = Context.newTopLevelContext();
FileOutputStream fos = new FileOutputStream(out_Rmat);
GZIPOutputStream zos = new GZIPOutputStream(fos);
RDataWriter writer = new RDataWriter(context, zos);
ListVector.NamedBuilder Rdat = new ListVector.NamedBuilder();
Rdat.add("scaffs", scf);
Rdat.add("n", n);
Rdat.add("A", A);
Rdat.add("distanceMat", dMat.build());
Rdat.add("distanceAll", dAllMat.build());
Rdat.add("lodMat", lMat.build());
Rdat.add("lodAll", lAllMat.build());
Rdat.add("indexMat", iMat.build());
writer.save(Rdat.build());
writer.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
| static void function(String in_rf, String out_Rmat) { ScriptEngineManager manager = new ScriptEngineManager(); ScriptEngine engine = manager.getEngineByName(STR); if(engine == null) { throw new RuntimeException(STR); } try { BufferedReader br = Utils.getBufferedReader(in_rf); final BidiMap<Integer, String> scaffs = new TreeBidiMap<Integer, String>(); String line; String s[]; int w = 0; double d, l; while( (line=br.readLine())!=null && line.startsWith("##")) { scaffs.put(w++, line.replaceAll("^##", STR\\s+STRscaffsSTRnSTRASTRdistanceMatSTRdistanceAllSTRlodMatSTRlodAllSTRindexMat", iMat.build()); writer.save(Rdat.build()); writer.close(); } catch (IOException e) { e.printStackTrace(); } } | /**
* make RData object from Renjin
* renjin-script-engine-*-with dependencies.jar required
* https://nexus.bedatadriven.com/content/groups/public/org/renjin/renjin-script-engine/
**/ | make RData object from Renjin renjin-script-engine-*-with dependencies.jar required HREF | makeRMatrix | {
"repo_name": "c-zhou/polyGembler",
"path": "src/cz1/hmm/tools/RFUtils.java",
"license": "gpl-3.0",
"size": 12313
} | [
"java.io.BufferedReader",
"java.io.IOException",
"javax.script.ScriptEngine",
"javax.script.ScriptEngineManager",
"org.apache.commons.collections4.BidiMap",
"org.apache.commons.collections4.bidimap.TreeBidiMap"
] | import java.io.BufferedReader; import java.io.IOException; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import org.apache.commons.collections4.BidiMap; import org.apache.commons.collections4.bidimap.TreeBidiMap; | import java.io.*; import javax.script.*; import org.apache.commons.collections4.*; import org.apache.commons.collections4.bidimap.*; | [
"java.io",
"javax.script",
"org.apache.commons"
] | java.io; javax.script; org.apache.commons; | 1,873,981 |
public static void informActivityStarted(Activity activity) {
onStateChange(activity, ActivityState.CREATED);
onStateChange(activity, ActivityState.STARTED);
onStateChange(activity, ActivityState.RESUMED);
} | static void function(Activity activity) { onStateChange(activity, ActivityState.CREATED); onStateChange(activity, ActivityState.STARTED); onStateChange(activity, ActivityState.RESUMED); } | /**
* When ApplicationStatus initialized after application started, the onActivityCreated(),
* onActivityStarted() and onActivityResumed() callbacks will be missed.
* This function will give the chance to simulate these three callbacks.
*/ | When ApplicationStatus initialized after application started, the onActivityCreated(), onActivityStarted() and onActivityResumed() callbacks will be missed. This function will give the chance to simulate these three callbacks | informActivityStarted | {
"repo_name": "axinging/chromium-crosswalk",
"path": "base/android/java/src/org/chromium/base/ApplicationStatus.java",
"license": "bsd-3-clause",
"size": 18236
} | [
"android.app.Activity"
] | import android.app.Activity; | import android.app.*; | [
"android.app"
] | android.app; | 2,365,689 |
@Override
public Object decode(final Object obj) throws DecoderException {
if (obj instanceof byte[]) {
return decode((byte[]) obj);
} else if (obj instanceof String) {
return decode((String) obj);
} else {
throw new DecoderException(
"Parameter supplied to Base-N decode is not a byte[] or a String");
}
}
| Object function(final Object obj) throws DecoderException { if (obj instanceof byte[]) { return decode((byte[]) obj); } else if (obj instanceof String) { return decode((String) obj); } else { throw new DecoderException( STR); } } | /**
* Decodes an Object using the Base-N algorithm. This method is provided in order to satisfy the
* requirements of the Decoder interface, and will throw a DecoderException if the supplied
* object is not of type byte[] or String.
*
* @param obj Object to decode
* @return An object (of type byte[]) containing the binary data which corresponds to the byte[]
* or String supplied.
* @throws DecoderException if the parameter supplied is not of type byte[]
*/ | Decodes an Object using the Base-N algorithm. This method is provided in order to satisfy the requirements of the Decoder interface, and will throw a DecoderException if the supplied object is not of type byte[] or String | decode | {
"repo_name": "pico-research/JRendezvous",
"path": "libsrc/uk/ac/cam/cl/rendezvous/org/apache/commons/codec/binary/BaseNCodec.java",
"license": "mit",
"size": 19031
} | [
"uk.ac.cam.cl.rendezvous.org.apache.commons.codec.DecoderException"
] | import uk.ac.cam.cl.rendezvous.org.apache.commons.codec.DecoderException; | import uk.ac.cam.cl.rendezvous.org.apache.commons.codec.*; | [
"uk.ac.cam"
] | uk.ac.cam; | 1,142,955 |
public long getLastMillisecond(Calendar calendar) {
calendar.set(this.year, Calendar.DECEMBER, 31, 23, 59, 59);
calendar.set(Calendar.MILLISECOND, 999);
// in the following line, we'd rather call calendar.getTimeInMillis()
// to avoid object creation, but that isn't supported in Java 1.3.1
return calendar.getTime().getTime();
}
| long function(Calendar calendar) { calendar.set(this.year, Calendar.DECEMBER, 31, 23, 59, 59); calendar.set(Calendar.MILLISECOND, 999); return calendar.getTime().getTime(); } | /**
* Returns the last millisecond of the year, evaluated using the supplied
* calendar (which determines the time zone).
*
* @param calendar the calendar (<code>null</code> not permitted).
*
* @return The last millisecond of the year.
*
* @throws NullPointerException if <code>calendar</code> is
* <code>null</code>.
*/ | Returns the last millisecond of the year, evaluated using the supplied calendar (which determines the time zone) | getLastMillisecond | {
"repo_name": "SOCR/HTML5_WebSite",
"path": "SOCR2.8/src/jfreechart/org/jfree/data/time/Year.java",
"license": "lgpl-3.0",
"size": 12553
} | [
"java.util.Calendar"
] | import java.util.Calendar; | import java.util.*; | [
"java.util"
] | java.util; | 1,731,789 |
public String
processOutput (String input, JopsClient jopsClient)
{
if (input != null)
{
StringTokenizer st = new StringTokenizer (input, DELIMITER);
String command = st.nextToken ();
if (command.equals (RESULT_LIST_OUTPUTS))
{
List<String> out = new ArrayList<String> ();
while (st.hasMoreTokens ())
{
out.add (st.nextToken ());
}
jopsClient.setMixers (out);
}
else if (command.equals (RESULT_CREATE_PLAYER))
jopsClient.registerPlayer (st.nextToken ());
// Pass-through commands.
// All the protocol handler should do is pass the next token as output.
else if (command.equals (RESULT_GET_PLAYER_TYPE)
|| command.equals (RESULT_GET_PLAYER_OUTPUT))
return st.nextToken ();
}
return input;
}
| String function (String input, JopsClient jopsClient) { if (input != null) { StringTokenizer st = new StringTokenizer (input, DELIMITER); String command = st.nextToken (); if (command.equals (RESULT_LIST_OUTPUTS)) { List<String> out = new ArrayList<String> (); while (st.hasMoreTokens ()) { out.add (st.nextToken ()); } jopsClient.setMixers (out); } else if (command.equals (RESULT_CREATE_PLAYER)) jopsClient.registerPlayer (st.nextToken ()); else if (command.equals (RESULT_GET_PLAYER_TYPE) command.equals (RESULT_GET_PLAYER_OUTPUT)) return st.nextToken (); } return input; } | /**
* Process the given input string as a result from the server.
* @param input The raw input string.
* @param jopsClient The client.
* @return a command-dependent string.
*/ | Process the given input string as a result from the server | processOutput | {
"repo_name": "CaptainHayashi/JOPS-old",
"path": "src/jops/protocol/JopsProtocol.java",
"license": "gpl-3.0",
"size": 9812
} | [
"java.util.ArrayList",
"java.util.List",
"java.util.StringTokenizer"
] | import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; | import java.util.*; | [
"java.util"
] | java.util; | 133,255 |
public Map<String, String> getResourceRefBindings()
{
return getJNDIEnvironmentRefBindings(ResourceRef.class);
} | Map<String, String> function() { return getJNDIEnvironmentRefBindings(ResourceRef.class); } | /**
* Returns a list of Resource Reference Bindings (<resRefBindings>)
* configured for the resource references of the component.
**/ | Returns a list of Resource Reference Bindings (<resRefBindings>) configured for the resource references of the component | getResourceRefBindings | {
"repo_name": "kgibm/open-liberty",
"path": "dev/com.ibm.ws.injection.core/src/com/ibm/wsspi/injectionengine/ComponentNameSpaceConfiguration.java",
"license": "epl-1.0",
"size": 48728
} | [
"com.ibm.ws.javaee.dd.common.ResourceRef",
"java.util.Map"
] | import com.ibm.ws.javaee.dd.common.ResourceRef; import java.util.Map; | import com.ibm.ws.javaee.dd.common.*; import java.util.*; | [
"com.ibm.ws",
"java.util"
] | com.ibm.ws; java.util; | 952,095 |
@Test
public void updateProcessDefinitionSuspensionStateByKeyTest() throws ApiException {
String key = null;
ProcessDefinitionSuspensionStateDto processDefinitionSuspensionStateDto = null;
api.updateProcessDefinitionSuspensionStateByKey(key, processDefinitionSuspensionStateDto);
// TODO: test validations
} | void function() throws ApiException { String key = null; ProcessDefinitionSuspensionStateDto processDefinitionSuspensionStateDto = null; api.updateProcessDefinitionSuspensionStateByKey(key, processDefinitionSuspensionStateDto); } | /**
* Activate/Suspend by Id
*
* Activates or suspends a given process definition by latest version of process definition key which belongs to no tenant.
*
* @throws ApiException
* if the Api call fails
*/ | Activate/Suspend by Id Activates or suspends a given process definition by latest version of process definition key which belongs to no tenant | updateProcessDefinitionSuspensionStateByKeyTest | {
"repo_name": "camunda/camunda-consulting",
"path": "snippets/camunda-openapi-client/camunda-openapi-client/src/test/java/com/camunda/consulting/openapi/client/handler/ProcessDefinitionApiTest.java",
"license": "apache-2.0",
"size": 36593
} | [
"com.camunda.consulting.openapi.client.handler.ApiException",
"com.camunda.consulting.openapi.client.model.ProcessDefinitionSuspensionStateDto"
] | import com.camunda.consulting.openapi.client.handler.ApiException; import com.camunda.consulting.openapi.client.model.ProcessDefinitionSuspensionStateDto; | import com.camunda.consulting.openapi.client.handler.*; import com.camunda.consulting.openapi.client.model.*; | [
"com.camunda.consulting"
] | com.camunda.consulting; | 1,765,430 |
IComplexNDArray fftn(INDArray transform, int dimension, int numElements); | IComplexNDArray fftn(INDArray transform, int dimension, int numElements); | /**
* Computes the fft along the first non singleton dimension of op
* when it is a matrix
*
* @param transform the ndarray to op
* @param dimension the dimension to do fft along
* @param numElements the desired number of elements in each fft
* @return the fft of the specified ndarray
*/ | Computes the fft along the first non singleton dimension of op when it is a matrix | fftn | {
"repo_name": "drlebedev/nd4j",
"path": "nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/fft/FFTInstance.java",
"license": "apache-2.0",
"size": 7744
} | [
"org.nd4j.linalg.api.complex.IComplexNDArray",
"org.nd4j.linalg.api.ndarray.INDArray"
] | import org.nd4j.linalg.api.complex.IComplexNDArray; import org.nd4j.linalg.api.ndarray.INDArray; | import org.nd4j.linalg.api.complex.*; import org.nd4j.linalg.api.ndarray.*; | [
"org.nd4j.linalg"
] | org.nd4j.linalg; | 1,114,757 |
public static CompletableFuture<byte[]> packMessage(
Wallet wallet,
String recipientVk,
String senderVk,
byte[] message) throws IndyException {
ParamGuard.notNull(wallet, "wallet");
ParamGuard.notNull(message, "message");
ParamGuard.notNullOrWhiteSpace(recipientVk, "recipientVk");
CompletableFuture<byte[]> future = new CompletableFuture<byte[]>();
int commandHandle = addFuture(future);
int walletHandle = wallet.getWalletHandle();
int result = LibIndy.api.indy_pack_message(
commandHandle,
walletHandle,
message,
message.length,
recipientVk,
senderVk,
packMessageCb
);
checkResult(future, result);
return future;
}
/** Unpacks a JWE-like formatted message outputted by pack_message (Experimental)
*
* @param wallet The wallet.
* @param jwe_data The JWE to be unpacked.
*
* @return A future that resolves to a byte[] of unpacked data
*
* if authcrypt was used to pack the message returns this json structure:
* {
* message: decrypted message,
* sender_verkey: sender_verkey,
* recipient_verkey: recipient_verkey
* }
*
* OR
*
* if anoncrypt was used to pack the message returns this json structure:
* {
* message: decrypted message,
* recipient_verkey: recipient_verkey
* }
| static CompletableFuture<byte[]> function( Wallet wallet, String recipientVk, String senderVk, byte[] message) throws IndyException { ParamGuard.notNull(wallet, STR); ParamGuard.notNull(message, STR); ParamGuard.notNullOrWhiteSpace(recipientVk, STR); CompletableFuture<byte[]> future = new CompletableFuture<byte[]>(); int commandHandle = addFuture(future); int walletHandle = wallet.getWalletHandle(); int result = LibIndy.api.indy_pack_message( commandHandle, walletHandle, message, message.length, recipientVk, senderVk, packMessageCb ); checkResult(future, result); return future; } /** Unpacks a JWE-like formatted message outputted by pack_message (Experimental) * * @param wallet The wallet. * @param jwe_data The JWE to be unpacked. * * @return A future that resolves to a byte[] of unpacked data * * if authcrypt was used to pack the message returns this json structure: * { * message: decrypted message, * sender_verkey: sender_verkey, * recipient_verkey: recipient_verkey * } * * OR * * if anoncrypt was used to pack the message returns this json structure: * { * message: decrypted message, * recipient_verkey: recipient_verkey * } | /** Packs a message by encrypting the message and serializes it in a JWE-like format (Experimental)
*
* Note to use DID keys with this function you can call Did.keyForDid to get key id (verkey)
* for specific DID.
*
* @param wallet The wallet.
* @param recipientVk list of Id (verkey). formatted as json like ["receiver edge_agent_1 verkey", "receiver edge_agent_2 verkey"`]
* @param senderVk verkey of message sender. if null, will use AnonCrypt mode
* @param message message to be packed
*
* @return A future that resolves to an Agent Wire Message format as a byte array. See HIPE 0028 for detailed formats
*
* @throws IndyException Thrown if an error occurs when calling the underlying SDK.
*/ | Packs a message by encrypting the message and serializes it in a JWE-like format (Experimental) Note to use DID keys with this function you can call Did.keyForDid to get key id (verkey) for specific DID | packMessage | {
"repo_name": "Artemkaaas/indy-sdk",
"path": "wrappers/java/src/main/java/org/hyperledger/indy/sdk/crypto/Crypto.java",
"license": "apache-2.0",
"size": 20347
} | [
"java.util.concurrent.CompletableFuture",
"org.hyperledger.indy.sdk.IndyException",
"org.hyperledger.indy.sdk.LibIndy",
"org.hyperledger.indy.sdk.ParamGuard",
"org.hyperledger.indy.sdk.wallet.Wallet"
] | import java.util.concurrent.CompletableFuture; import org.hyperledger.indy.sdk.IndyException; import org.hyperledger.indy.sdk.LibIndy; import org.hyperledger.indy.sdk.ParamGuard; import org.hyperledger.indy.sdk.wallet.Wallet; | import java.util.concurrent.*; import org.hyperledger.indy.sdk.*; import org.hyperledger.indy.sdk.wallet.*; | [
"java.util",
"org.hyperledger.indy"
] | java.util; org.hyperledger.indy; | 2,682,021 |
protected void setCrossHairDomainIndex()
{
int value = this.slider.getValue();
if (this.chartPanel != null)
{
JFreeChart c = this.chart;
if (c != null)
{
XYPlot plot = (XYPlot) c.getPlot();
XYDataset dataset = plot.getDataset();
int itemCount = dataset.getItemCount(0);
double ndexD = (double)itemCount * ((double)value / 100);
int ndex = (int)ndexD;
// the index goes from 0 to (itemCount -1)
this.CrossHairDomainIndex = ndex >= itemCount ? itemCount-1: ndex;
}
}
}
public PortCounterPlotPanel()
{
super(new BorderLayout());
// initChart();
}
public PortCounterPlotPanel(IB_Vertex vertex, OSM_Port port, PortCounterName portCounter, boolean includeExtra)
{
super(new BorderLayout());
initChart(vertex, port, portCounter, includeExtra);
}
| void function() { int value = this.slider.getValue(); if (this.chartPanel != null) { JFreeChart c = this.chart; if (c != null) { XYPlot plot = (XYPlot) c.getPlot(); XYDataset dataset = plot.getDataset(); int itemCount = dataset.getItemCount(0); double ndexD = (double)itemCount * ((double)value / 100); int ndex = (int)ndexD; this.CrossHairDomainIndex = ndex >= itemCount ? itemCount-1: ndex; } } } public PortCounterPlotPanel() { super(new BorderLayout()); } public PortCounterPlotPanel(IB_Vertex vertex, OSM_Port port, PortCounterName portCounter, boolean includeExtra) { super(new BorderLayout()); initChart(vertex, port, portCounter, includeExtra); } | /**
* Sets the value of crossHairDomainIndex
*
* @param crossHairDomainIndex the crossHairDomainIndex to set
*
***********************************************************/ | Sets the value of crossHairDomainIndex | setCrossHairDomainIndex | {
"repo_name": "meier/opensm-smt",
"path": "src/main/java/gov/llnl/lc/infiniband/opensm/plugin/gui/chart/PortCounterCrossHairXYplot.java",
"license": "gpl-2.0",
"size": 15254
} | [
"gov.llnl.lc.infiniband.opensm.plugin.data.PFM_Port",
"java.awt.BorderLayout",
"org.jfree.chart.JFreeChart",
"org.jfree.chart.plot.XYPlot",
"org.jfree.data.xy.XYDataset"
] | import gov.llnl.lc.infiniband.opensm.plugin.data.PFM_Port; import java.awt.BorderLayout; import org.jfree.chart.JFreeChart; import org.jfree.chart.plot.XYPlot; import org.jfree.data.xy.XYDataset; | import gov.llnl.lc.infiniband.opensm.plugin.data.*; import java.awt.*; import org.jfree.chart.*; import org.jfree.chart.plot.*; import org.jfree.data.xy.*; | [
"gov.llnl.lc",
"java.awt",
"org.jfree.chart",
"org.jfree.data"
] | gov.llnl.lc; java.awt; org.jfree.chart; org.jfree.data; | 334,027 |
private void configurePropertyFilter(Map<String, ? extends Object> parameters, T instance) {
String propertyFilterObject = ParameterHelper.getParameterAsString(parameters,
getParameterNameProvider().getNameForPropertyFilter());
if (propertyFilterObject == null) {
return;
}
String[] propertyFilters = propertyFilterObject.split("\\},\\{");
Map<String, PropertyFilter> filterGroups = new HashMap<String, PropertyFilter>();
loop: for (String propertyFilter : propertyFilters) {
// TODO why not parsing as JSON?
String filterArray = StringUtils.substringBetween(propertyFilter, "[\"", "\"]");
if (filterArray == null
&& (filterArray = StringUtils.substringBetween(propertyFilter, "['", "']")) == null) {
continue loop;
}
// [0:Property, 1:Group, 2:Key, 3:Value, 4:MatchMode, 5:Negate (Optional)]
String[] filterDefinition = filterArray.split("[\"'],[\"']");
if ("contentTypes.discussion".equals(filterDefinition[2])) {
instance.setDiscussionFilterMode(DiscussionFilterMode.IS_DISCUSSION);
continue loop;
}
PropertyFilter filter = filterGroups.get(filterDefinition[1]);
if (NAMES_TO_PROPERTYABLES.get(filterDefinition[0]) == null) {
throw new IllegalArgumentException("The given property is invalid: "
+ filterDefinition[0]);
}
boolean negate = filterDefinition.length >= 6
&& (Boolean.parseBoolean(filterDefinition[5]) || "negate"
.equals(filterDefinition[5]));
filter = new PropertyFilter(filterDefinition[1],
NAMES_TO_PROPERTYABLES.get(filterDefinition[0]), negate);
filterGroups.put(filterDefinition[1], filter);
instance.addPropertyFilter(filter);
filter.addProperty(filterDefinition[2], filterDefinition[3],
PropertyFilter.MatchMode.valueOf(filterDefinition[4]));
}
}
| void function(Map<String, ? extends Object> parameters, T instance) { String propertyFilterObject = ParameterHelper.getParameterAsString(parameters, getParameterNameProvider().getNameForPropertyFilter()); if (propertyFilterObject == null) { return; } String[] propertyFilters = propertyFilterObject.split(STR); Map<String, PropertyFilter> filterGroups = new HashMap<String, PropertyFilter>(); loop: for (String propertyFilter : propertyFilters) { String filterArray = StringUtils.substringBetween(propertyFilter, "[\"STR\"]"); if (filterArray == null && (filterArray = StringUtils.substringBetween(propertyFilter, "['STR']")) == null) { continue loop; } String[] filterDefinition = filterArray.split("[\"'],[\"']"); if (STR.equals(filterDefinition[2])) { instance.setDiscussionFilterMode(DiscussionFilterMode.IS_DISCUSSION); continue loop; } PropertyFilter filter = filterGroups.get(filterDefinition[1]); if (NAMES_TO_PROPERTYABLES.get(filterDefinition[0]) == null) { throw new IllegalArgumentException(STR + filterDefinition[0]); } boolean negate = filterDefinition.length >= 6 && (Boolean.parseBoolean(filterDefinition[5]) STR .equals(filterDefinition[5])); filter = new PropertyFilter(filterDefinition[1], NAMES_TO_PROPERTYABLES.get(filterDefinition[0]), negate); filterGroups.put(filterDefinition[1], filter); instance.addPropertyFilter(filter); filter.addProperty(filterDefinition[2], filterDefinition[3], PropertyFilter.MatchMode.valueOf(filterDefinition[4])); } } | /**
* This method configures any property filters, if given.
*
* @param parameters
* The parameters.
* @param instance
* The query instance.
*/ | This method configures any property filters, if given | configurePropertyFilter | {
"repo_name": "Communote/communote-server",
"path": "communote/persistence/src/main/java/com/communote/server/core/vo/query/config/TimelineQueryParametersConfigurator.java",
"license": "apache-2.0",
"size": 23505
} | [
"com.communote.common.util.ParameterHelper",
"com.communote.server.core.vo.query.DiscussionFilterMode",
"com.communote.server.core.vo.query.filter.PropertyFilter",
"java.util.HashMap",
"java.util.Map",
"org.apache.commons.lang.StringUtils"
] | import com.communote.common.util.ParameterHelper; import com.communote.server.core.vo.query.DiscussionFilterMode; import com.communote.server.core.vo.query.filter.PropertyFilter; import java.util.HashMap; import java.util.Map; import org.apache.commons.lang.StringUtils; | import com.communote.common.util.*; import com.communote.server.core.vo.query.*; import com.communote.server.core.vo.query.filter.*; import java.util.*; import org.apache.commons.lang.*; | [
"com.communote.common",
"com.communote.server",
"java.util",
"org.apache.commons"
] | com.communote.common; com.communote.server; java.util; org.apache.commons; | 423,804 |
Long create(Employee employee); | Long create(Employee employee); | /**
* Creates given entity in database
* @param employee entity to created in database
* @return generated id of entity
*/ | Creates given entity in database | create | {
"repo_name": "samgau-repos/course_v1",
"path": "service/src/main/java/com/samgau/start/service/dao/EmployeeDAO.java",
"license": "apache-2.0",
"size": 1320
} | [
"com.samgau.start.model.Employee"
] | import com.samgau.start.model.Employee; | import com.samgau.start.model.*; | [
"com.samgau.start"
] | com.samgau.start; | 2,254,732 |
public static Package createPackage(String name, String version) {
final Package pkg = new Package();
pkg.setName(name);
if (version != null) {
pkg.setVersion(version);
}
return pkg;
} | static Package function(String name, String version) { final Package pkg = new Package(); pkg.setName(name); if (version != null) { pkg.setVersion(version); } return pkg; } | /**
* Create a Package-object with name and version
* @param name package-name
* @param version package-version
* @return Package
*/ | Create a Package-object with name and version | createPackage | {
"repo_name": "openthinclient/openthinclient-manager",
"path": "services/package-manager/src/main/java/org/openthinclient/pkgmgr/PackageManagerUtils.java",
"license": "gpl-2.0",
"size": 2630
} | [
"org.openthinclient.pkgmgr.db.Package"
] | import org.openthinclient.pkgmgr.db.Package; | import org.openthinclient.pkgmgr.db.*; | [
"org.openthinclient.pkgmgr"
] | org.openthinclient.pkgmgr; | 1,022,820 |
public List<ObjectBindingConstant> getObjBindingConstantList();
| List<ObjectBindingConstant> function(); | /**
* Returns an {@link ArrayList} containing all current binding of beans (
* {@link ObjectBindingConstant}).
*/ | Returns an <code>ArrayList</code> containing all current binding of beans ( <code>ObjectBindingConstant</code>) | getObjBindingConstantList | {
"repo_name": "OldRepoPreservation/jgentle",
"path": "src/org/jgentleframework/configure/BindingConfig.java",
"license": "apache-2.0",
"size": 3337
} | [
"java.util.List",
"org.jgentleframework.configure.objectmeta.ObjectBindingConstant"
] | import java.util.List; import org.jgentleframework.configure.objectmeta.ObjectBindingConstant; | import java.util.*; import org.jgentleframework.configure.objectmeta.*; | [
"java.util",
"org.jgentleframework.configure"
] | java.util; org.jgentleframework.configure; | 1,123,105 |
public String toString(boolean pretty)
throws ApfloatRuntimeException;
| String function(boolean pretty) throws ApfloatRuntimeException; | /**
* Convert this <code>ApfloatImpl</code> to <code>String</code>.
*
* @param pretty Flag for formatting.
*
* @return String representation of this <code>ApfloatImpl</code>.
*
* @see org.apfloat.Apfloat#toString(boolean)
*/ | Convert this <code>ApfloatImpl</code> to <code>String</code> | toString | {
"repo_name": "mtommila/apfloat",
"path": "apfloat/src/main/java/org/apfloat/spi/ApfloatImpl.java",
"license": "lgpl-2.1",
"size": 9213
} | [
"org.apfloat.ApfloatRuntimeException"
] | import org.apfloat.ApfloatRuntimeException; | import org.apfloat.*; | [
"org.apfloat"
] | org.apfloat; | 2,494,173 |
public void setImage(Image image) {
// handle multi-threadedness
RawData data =
NIVision.imaqFlatten(image, NIVision.FlattenType.FLATTEN_IMAGE,
NIVision.CompressionType.COMPRESSION_JPEG, 10 * m_quality);
ByteBuffer buffer = data.getBuffer();
boolean hwClient;
synchronized (this) {
hwClient = m_hwClient;
}
int index = 0;
if (hwClient) {
while (index < buffer.limit() - 1) {
if ((buffer.get(index) & 0xff) == 0xFF && (buffer.get(index + 1) & 0xff) == 0xD8) {
break;
}
index++;
}
}
if (buffer.limit() - index - 1 <= 2) {
throw new VisionException("data size of flattened image is less than 2. Try another "
+ "camera!");
}
setImageData(data, index);
} | void function(Image image) { RawData data = NIVision.imaqFlatten(image, NIVision.FlattenType.FLATTEN_IMAGE, NIVision.CompressionType.COMPRESSION_JPEG, 10 * m_quality); ByteBuffer buffer = data.getBuffer(); boolean hwClient; synchronized (this) { hwClient = m_hwClient; } int index = 0; if (hwClient) { while (index < buffer.limit() - 1) { if ((buffer.get(index) & 0xff) == 0xFF && (buffer.get(index + 1) & 0xff) == 0xD8) { break; } index++; } } if (buffer.limit() - index - 1 <= 2) { throw new VisionException(STR + STR); } setImageData(data, index); } | /**
* Manually change the image that is served by the MJPEG stream. This can be called to pass custom
* annotated images to the dashboard. Note that, for 640x480 video, this method could take between
* 40 and 50 milliseconds to complete.
*
* <p>This shouldn't be called if {@link #startAutomaticCapture} is called.
*
* @param image The IMAQ image to show on the dashboard
*/ | Manually change the image that is served by the MJPEG stream. This can be called to pass custom annotated images to the dashboard. Note that, for 640x480 video, this method could take between 40 and 50 milliseconds to complete. This shouldn't be called if <code>#startAutomaticCapture</code> is called | setImage | {
"repo_name": "ShadowShitler/Bridgette",
"path": "java/src/edu/wpi/first/wpilibj/vision/CameraServer.java",
"license": "bsd-3-clause",
"size": 11705
} | [
"com.ni.vision.NIVision",
"com.ni.vision.VisionException",
"java.nio.ByteBuffer"
] | import com.ni.vision.NIVision; import com.ni.vision.VisionException; import java.nio.ByteBuffer; | import com.ni.vision.*; import java.nio.*; | [
"com.ni.vision",
"java.nio"
] | com.ni.vision; java.nio; | 2,260,185 |
void toList(List<String> listToPopulate); | void toList(List<String> listToPopulate); | /**
* Appends every line of the file onto the given list.
* @param listToPopulate The writable list to populate.
*/ | Appends every line of the file onto the given list | toList | {
"repo_name": "JoelJ/FileIterator",
"path": "src/main/java/com/joelj/collections/FileIterable.java",
"license": "apache-2.0",
"size": 1362
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,505,287 |
public boolean setPhonebookAccessPermission(int value) {
if (sService == null) {
return false;
}
try {
return sService.setPhonebookAccessPermission(this, value);
} catch (RemoteException e) {
Log.e(TAG, "", e);
}
return false;
} | boolean function(int value) { if (sService == null) { return false; } try { return sService.setPhonebookAccessPermission(this, value); } catch (RemoteException e) { Log.e(TAG, "", e); } return false; } | /**
* Sets whether the phonebook access is allowed to this device.
* <p>Requires {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED}.
* @param value Can be {@link #ACCESS_UNKNOWN}, {@link #ACCESS_ALLOWED} or
* {@link #ACCESS_REJECTED}.
* @return Whether the value has been successfully set.
* @hide
*/ | Sets whether the phonebook access is allowed to this device. Requires <code>android.Manifest.permission#BLUETOOTH_PRIVILEGED</code> | setPhonebookAccessPermission | {
"repo_name": "daiqiquan/framework-base",
"path": "core/java/android/bluetooth/BluetoothDevice.java",
"license": "apache-2.0",
"size": 61148
} | [
"android.os.RemoteException",
"android.util.Log"
] | import android.os.RemoteException; import android.util.Log; | import android.os.*; import android.util.*; | [
"android.os",
"android.util"
] | android.os; android.util; | 549,659 |
@JSMethod(uiThread = false)
public Object getObject(){
ArrayList list = new ArrayList();
list.add("222");
list.add("test");
Map map = new HashMap();
map.put(11,"test11");
map.put("22","test22");
list.add(map);
return list;
} | @JSMethod(uiThread = false) Object function(){ ArrayList list = new ArrayList(); list.add("222"); list.add("test"); Map map = new HashMap(); map.put(11,STR); map.put("22",STR); list.add(map); return list; } | /**
* JSON NOT allow KeyValue as non-string value
* @return
*/ | JSON NOT allow KeyValue as non-string value | getObject | {
"repo_name": "leoward/incubator-weex",
"path": "android/playground/app/src/main/java/com/alibaba/weex/extend/module/SyncTestModule.java",
"license": "apache-2.0",
"size": 1914
} | [
"com.taobao.weex.annotation.JSMethod",
"java.util.ArrayList",
"java.util.HashMap",
"java.util.Map"
] | import com.taobao.weex.annotation.JSMethod; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; | import com.taobao.weex.annotation.*; import java.util.*; | [
"com.taobao.weex",
"java.util"
] | com.taobao.weex; java.util; | 519,942 |
public static File getJobDir(String jobid) {
return new File(getUserLogDir(), jobid);
} | static File function(String jobid) { return new File(getUserLogDir(), jobid); } | /**
* Get the user log directory for the job jobid.
*
* @param jobid string representation of the jobid
* @return user log directory for the job
*/ | Get the user log directory for the job jobid | getJobDir | {
"repo_name": "karahiyo/hanoi-hadoop-2.0.0-cdh",
"path": "src/mapred/org/apache/hadoop/mapred/TaskLog.java",
"license": "apache-2.0",
"size": 28103
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 1,220,059 |
EReference getExponentExpression_Left(); | EReference getExponentExpression_Left(); | /**
* Returns the meta object for the containment reference '{@link com.euclideanspace.spad.editor.ExponentExpression#getLeft <em>Left</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference '<em>Left</em>'.
* @see com.euclideanspace.spad.editor.ExponentExpression#getLeft()
* @see #getExponentExpression()
* @generated
*/ | Returns the meta object for the containment reference '<code>com.euclideanspace.spad.editor.ExponentExpression#getLeft Left</code>'. | getExponentExpression_Left | {
"repo_name": "martinbaker/euclideanspace",
"path": "com.euclideanspace.spad/src-gen/com/euclideanspace/spad/editor/EditorPackage.java",
"license": "agpl-3.0",
"size": 593321
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,228,890 |
public static final String getTagValue(Node n, KettleAttributeInterface code) {
return getTagValue(n, code.getXmlCode());
}
| static final String function(Node n, KettleAttributeInterface code) { return getTagValue(n, code.getXmlCode()); } | /**
* Get the value of a tag in a node
* @param n The node to look in
* @param tag The tag to look for
* @return The value of the tag or null if nothing was found.
*/ | Get the value of a tag in a node | getTagValue | {
"repo_name": "soluvas/pdi-ce",
"path": "src-core/org/pentaho/di/core/xml/XMLHandler.java",
"license": "apache-2.0",
"size": 34948
} | [
"org.pentaho.di.core.KettleAttributeInterface",
"org.w3c.dom.Node"
] | import org.pentaho.di.core.KettleAttributeInterface; import org.w3c.dom.Node; | import org.pentaho.di.core.*; import org.w3c.dom.*; | [
"org.pentaho.di",
"org.w3c.dom"
] | org.pentaho.di; org.w3c.dom; | 1,913,803 |
public static void traverseChildren(Node node, Consumer<Node> operator, short type)
{
Node child = node.getFirstChild();
while (child != null)
{
// Get the next node to process in case this one is changed or removed.
Node next = child.getNextSibling();
if (child.getNodeType() == type)
operator.accept(child);
// Proceed.
child = next;
}
} | static void function(Node node, Consumer<Node> operator, short type) { Node child = node.getFirstChild(); while (child != null) { Node next = child.getNextSibling(); if (child.getNodeType() == type) operator.accept(child); child = next; } } | /**
* Traverse the children of a node applying an operation.
*
* This is hardened against some level of DOM changes.
*
* @param node
* @param operator
* @param type
*/ | Traverse the children of a node applying an operation. This is hardened against some level of DOM changes | traverseChildren | {
"repo_name": "Thrameos/jpype",
"path": "native/java/org/jpype/javadoc/DomUtilities.java",
"license": "apache-2.0",
"size": 6547
} | [
"java.util.function.Consumer",
"org.w3c.dom.Node"
] | import java.util.function.Consumer; import org.w3c.dom.Node; | import java.util.function.*; import org.w3c.dom.*; | [
"java.util",
"org.w3c.dom"
] | java.util; org.w3c.dom; | 88,724 |
public void setIdleState() {
mProgressBar.setVisibility(View.GONE);
setState(State.DISCOVERY_IDLE);
} | void function() { mProgressBar.setVisibility(View.GONE); setState(State.DISCOVERY_IDLE); } | /**
* Indicates the chooser that no more items will be added.
*/ | Indicates the chooser that no more items will be added | setIdleState | {
"repo_name": "danakj/chromium",
"path": "chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java",
"license": "bsd-3-clause",
"size": 19645
} | [
"android.view.View"
] | import android.view.View; | import android.view.*; | [
"android.view"
] | android.view; | 732,298 |
private void writeObject(ObjectOutputStream stream) throws IOException {
stream.defaultWriteObject();
SerialUtilities.writePaint(this.defaultPaint, stream);
} | void function(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); SerialUtilities.writePaint(this.defaultPaint, stream); } | /**
* Provides serialization support.
*
* @param stream the output stream.
*
* @throws IOException if there is an I/O error.
*/ | Provides serialization support | writeObject | {
"repo_name": "akardapolov/ASH-Viewer",
"path": "jfreechart-fse/src/main/java/org/jfree/chart/renderer/LookupPaintScale.java",
"license": "gpl-3.0",
"size": 12285
} | [
"java.io.IOException",
"java.io.ObjectOutputStream",
"org.jfree.chart.util.SerialUtilities"
] | import java.io.IOException; import java.io.ObjectOutputStream; import org.jfree.chart.util.SerialUtilities; | import java.io.*; import org.jfree.chart.util.*; | [
"java.io",
"org.jfree.chart"
] | java.io; org.jfree.chart; | 1,313,366 |
public boolean isGet() {
return HttpMethod.GET.equals(getMethod());
} | boolean function() { return HttpMethod.GET.equals(getMethod()); } | /**
* Determines whether this is an HTTP GET request.
* <p/>
* @return a boolean value indicating if the HTTP method is GET.
* @see #getMethod()
* @see org.springframework.http.HttpMethod#GET
*/ | Determines whether this is an HTTP GET request. | isGet | {
"repo_name": "papicella/snappy-store",
"path": "gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/web/http/ClientHttpRequest.java",
"license": "apache-2.0",
"size": 18223
} | [
"org.springframework.http.HttpMethod"
] | import org.springframework.http.HttpMethod; | import org.springframework.http.*; | [
"org.springframework.http"
] | org.springframework.http; | 869,607 |
AppliedPTransform<?, ?, ?> getTransform(); | AppliedPTransform<?, ?, ?> getTransform(); | /**
* Returns the {@link AppliedPTransform} that produced this result.
*/ | Returns the <code>AppliedPTransform</code> that produced this result | getTransform | {
"repo_name": "shakamunyi/beam",
"path": "runners/direct-java/src/main/java/org/apache/beam/runners/direct/InProcessTransformResult.java",
"license": "apache-2.0",
"size": 3137
} | [
"org.apache.beam.sdk.transforms.AppliedPTransform"
] | import org.apache.beam.sdk.transforms.AppliedPTransform; | import org.apache.beam.sdk.transforms.*; | [
"org.apache.beam"
] | org.apache.beam; | 1,339,607 |
private int createVBridge(JsonObject requestBody,
final RestResource restResource) {
final JsonObject vbrRequestBody = VbrResourcesGenerator
.getCreateVbrRequestBody(requestBody);
StringBuilder sb = new StringBuilder();
sb.append(VtnServiceOpenStackConsts.VTN_PATH);
sb.append(VtnServiceOpenStackConsts.URI_CONCATENATOR);
sb.append(getTenantId());
sb.append(VtnServiceOpenStackConsts.VBRIDGE_PATH);
restResource.setPath(sb.toString());
restResource.setSessionID(getSessionID());
restResource.setConfigID(getConfigID());
return restResource.post(vbrRequestBody);
} | int function(JsonObject requestBody, final RestResource restResource) { final JsonObject vbrRequestBody = VbrResourcesGenerator .getCreateVbrRequestBody(requestBody); StringBuilder sb = new StringBuilder(); sb.append(VtnServiceOpenStackConsts.VTN_PATH); sb.append(VtnServiceOpenStackConsts.URI_CONCATENATOR); sb.append(getTenantId()); sb.append(VtnServiceOpenStackConsts.VBRIDGE_PATH); restResource.setPath(sb.toString()); restResource.setSessionID(getSessionID()); restResource.setConfigID(getConfigID()); return restResource.post(vbrRequestBody); } | /**
* Create VBridge at UNC
*
* @param requestBody
* - OpenStack request body
* @param restResource
* - RestResource instance
* @return - erorrCode, 200 for Success
*/ | Create VBridge at UNC | createVBridge | {
"repo_name": "opendaylight/vtn",
"path": "coordinator/java/vtn-javaapi/src/org/opendaylight/vtn/javaapi/resources/openstack/NetworksResource.java",
"license": "epl-1.0",
"size": 11867
} | [
"com.google.gson.JsonObject",
"org.opendaylight.vtn.javaapi.RestResource",
"org.opendaylight.vtn.javaapi.openstack.constants.VtnServiceOpenStackConsts",
"org.opendaylight.vtn.javaapi.openstack.convertor.VbrResourcesGenerator"
] | import com.google.gson.JsonObject; import org.opendaylight.vtn.javaapi.RestResource; import org.opendaylight.vtn.javaapi.openstack.constants.VtnServiceOpenStackConsts; import org.opendaylight.vtn.javaapi.openstack.convertor.VbrResourcesGenerator; | import com.google.gson.*; import org.opendaylight.vtn.javaapi.*; import org.opendaylight.vtn.javaapi.openstack.constants.*; import org.opendaylight.vtn.javaapi.openstack.convertor.*; | [
"com.google.gson",
"org.opendaylight.vtn"
] | com.google.gson; org.opendaylight.vtn; | 919,259 |
private Repository mockRepository()
{
Repository repository = mock(Repository.class);
when(repository.getPerson()).thenReturn(requesterNodeRef);
return repository;
}
| Repository function() { Repository repository = mock(Repository.class); when(repository.getPerson()).thenReturn(requesterNodeRef); return repository; } | /**
* Mocks up a Repository that will return the inviter as the current user.
*
* @return Repository
*/ | Mocks up a Repository that will return the inviter as the current user | mockRepository | {
"repo_name": "Alfresco/alfresco-repository",
"path": "src/test/java/org/alfresco/repo/invitation/site/InviteModeratedSenderTest.java",
"license": "lgpl-3.0",
"size": 11346
} | [
"org.alfresco.repo.model.Repository",
"org.mockito.Mockito"
] | import org.alfresco.repo.model.Repository; import org.mockito.Mockito; | import org.alfresco.repo.model.*; import org.mockito.*; | [
"org.alfresco.repo",
"org.mockito"
] | org.alfresco.repo; org.mockito; | 5,906 |
@SuppressWarnings("unchecked") //$NON-NLS-1$
public Map<String, String> getOptions() {
if (options != null) {
return options;
}
ValueBinding vb = getValueBinding("options"); //$NON-NLS-1$
if (vb != null) {
Object vbVal = vb.getValue(getFacesContext());
if( null != vbVal ){
return (Map<String, String>) vbVal;
}
}
return null;
} | @SuppressWarnings(STR) Map<String, String> function() { if (options != null) { return options; } ValueBinding vb = getValueBinding(STR); if (vb != null) { Object vbVal = vb.getValue(getFacesContext()); if( null != vbVal ){ return (Map<String, String>) vbVal; } } return null; } | /**
* Gets the options for the Value Picker, from the "options" property
*
* @return Map<String, String> of values
* @since org.openntf.domino.xsp 4.5.0
*/ | Gets the options for the Value Picker, from the "options" property | getOptions | {
"repo_name": "iharkhukhrakou/XPagesExtensionLibrary",
"path": "extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/component/picker/data/MapValuePickerData.java",
"license": "apache-2.0",
"size": 15946
} | [
"java.util.Map",
"javax.faces.el.ValueBinding"
] | import java.util.Map; import javax.faces.el.ValueBinding; | import java.util.*; import javax.faces.el.*; | [
"java.util",
"javax.faces"
] | java.util; javax.faces; | 2,272,318 |
@Test
public void dropColumn() throws Exception {
startGrids(3);
grid(0).cluster().state(ClusterState.ACTIVE);
createSmallTable(null);
collectStatistics(SMALL_TARGET);
waitForStats(SCHEMA, "SMALL", TIMEOUT, checkTotalRows, checkColumStats);
sql("DROP INDEX SMALL_B");
sql("ALTER TABLE SMALL DROP COLUMN B");
waitForStats(SCHEMA, "SMALL", TIMEOUT,
(stats) -> stats.forEach(s -> {
assertNotNull(s.columnStatistics("A"));
assertNotNull(s.columnStatistics("C"));
assertNull(s.columnStatistics("B"));
}));
for (Ignite ign : G.allGrids()) {
checkStatisticsInMetastore(((IgniteEx)ign).context().cache().context().database(), TIMEOUT,
SCHEMA, "SMALL", (s -> assertNull(s.data().get("B"))));
}
} | void function() throws Exception { startGrids(3); grid(0).cluster().state(ClusterState.ACTIVE); createSmallTable(null); collectStatistics(SMALL_TARGET); waitForStats(SCHEMA, "SMALL", TIMEOUT, checkTotalRows, checkColumStats); sql(STR); sql(STR); waitForStats(SCHEMA, "SMALL", TIMEOUT, (stats) -> stats.forEach(s -> { assertNotNull(s.columnStatistics("A")); assertNotNull(s.columnStatistics("C")); assertNull(s.columnStatistics("B")); })); for (Ignite ign : G.allGrids()) { checkStatisticsInMetastore(((IgniteEx)ign).context().cache().context().database(), TIMEOUT, SCHEMA, "SMALL", (s -> assertNull(s.data().get("B")))); } } | /**
* Check drop statistics when table's column is dropped.
*/ | Check drop statistics when table's column is dropped | dropColumn | {
"repo_name": "ascherbakoff/ignite",
"path": "modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/stat/StatisticsConfigurationTest.java",
"license": "apache-2.0",
"size": 21299
} | [
"org.apache.ignite.Ignite",
"org.apache.ignite.cluster.ClusterState",
"org.apache.ignite.internal.IgniteEx",
"org.apache.ignite.internal.util.typedef.G"
] | import org.apache.ignite.Ignite; import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.util.typedef.G; | import org.apache.ignite.*; import org.apache.ignite.cluster.*; import org.apache.ignite.internal.*; import org.apache.ignite.internal.util.typedef.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 1,163,670 |
public void setZoomLevels(List<ScaleInfo> zoomLevels) {
this.zoomLevels = zoomLevels;
} | void function(List<ScaleInfo> zoomLevels) { this.zoomLevels = zoomLevels; } | /**
* Sets a list of predefined zoom levels allowed by the map.
*
* @param zoomLevels
* list of levels (scales)
*/ | Sets a list of predefined zoom levels allowed by the map | setZoomLevels | {
"repo_name": "olivermay/geomajas",
"path": "backend/api/src/main/java/org/geomajas/configuration/client/ScaleConfigurationInfo.java",
"license": "agpl-3.0",
"size": 1880
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 785,258 |
public PluginsAndModules info() {
return info;
}
// a "bundle" is a group of plugins in a single classloader
// really should be 1-1, but we are not so fortunate
static class Bundle {
final PluginInfo plugin;
final Set<URL> urls;
Bundle(PluginInfo plugin, Set<URL> urls) {
this.plugin = Objects.requireNonNull(plugin);
this.urls = Objects.requireNonNull(urls);
} | PluginsAndModules function() { return info; } static class Bundle { final PluginInfo plugin; final Set<URL> urls; Bundle(PluginInfo plugin, Set<URL> urls) { this.plugin = Objects.requireNonNull(plugin); this.urls = Objects.requireNonNull(urls); } | /**
* Get information about plugins and modules
*/ | Get information about plugins and modules | info | {
"repo_name": "markwalkom/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/plugins/PluginsService.java",
"license": "apache-2.0",
"size": 20452
} | [
"java.util.Objects",
"java.util.Set",
"org.elasticsearch.action.admin.cluster.node.info.PluginsAndModules"
] | import java.util.Objects; import java.util.Set; import org.elasticsearch.action.admin.cluster.node.info.PluginsAndModules; | import java.util.*; import org.elasticsearch.action.admin.cluster.node.info.*; | [
"java.util",
"org.elasticsearch.action"
] | java.util; org.elasticsearch.action; | 2,105,052 |
private void setupAllAppsList() {
mAllAppsGridView = (EditFavoritesGridView) findViewById(R.id.allAppsGridView);
mAllAppsListAdapter = new AllAppsListAdapter(this);
mAllAppsListAdapter.setAllApps(mAllApps);
mAllAppsGridView.setLongClickable(true); | void function() { mAllAppsGridView = (EditFavoritesGridView) findViewById(R.id.allAppsGridView); mAllAppsListAdapter = new AllAppsListAdapter(this); mAllAppsListAdapter.setAllApps(mAllApps); mAllAppsGridView.setLongClickable(true); | /**
* Setup the list with all the apps installed on the device.
*/ | Setup the list with all the apps installed on the device | setupAllAppsList | {
"repo_name": "kimhansen/Fairphone---DEPRECATED",
"path": "FairPhoneHome/src/org/fairphone/launcher/edgeswipe/edit/EditFavoritesActivity.java",
"license": "apache-2.0",
"size": 19665
} | [
"org.fairphone.launcher.edgeswipe.ui.EditFavoritesGridView"
] | import org.fairphone.launcher.edgeswipe.ui.EditFavoritesGridView; | import org.fairphone.launcher.edgeswipe.ui.*; | [
"org.fairphone.launcher"
] | org.fairphone.launcher; | 2,863,116 |
public void toggleFavorite(Context context, Card card) {
card.setFavorite(!card.isFavorite());
datasource = new TableCardDatasource(context);
datasource.open();
datasource.updateCardFavorite(card.getId(), card.isFavorite());
datasource.close();
} | void function(Context context, Card card) { card.setFavorite(!card.isFavorite()); datasource = new TableCardDatasource(context); datasource.open(); datasource.updateCardFavorite(card.getId(), card.isFavorite()); datasource.close(); } | /**
* Changes the favorite status of a card
*
* @param context context
* @param card card
*/ | Changes the favorite status of a card | toggleFavorite | {
"repo_name": "interoberlin/lymbo",
"path": "app/src/main/java/de/interoberlin/lymbo/controller/CardsController.java",
"license": "gpl-3.0",
"size": 22250
} | [
"android.content.Context",
"de.interoberlin.lymbo.core.model.v1.impl.Card",
"de.interoberlin.lymbo.model.persistence.sqlite.cards.TableCardDatasource"
] | import android.content.Context; import de.interoberlin.lymbo.core.model.v1.impl.Card; import de.interoberlin.lymbo.model.persistence.sqlite.cards.TableCardDatasource; | import android.content.*; import de.interoberlin.lymbo.core.model.v1.impl.*; import de.interoberlin.lymbo.model.persistence.sqlite.cards.*; | [
"android.content",
"de.interoberlin.lymbo"
] | android.content; de.interoberlin.lymbo; | 361,945 |
public Callable getResolve() {
return resolve;
} | Callable function() { return resolve; } | /**
* Returns the [[Resolve]] field of this PromiseCapability record.
*
* @return the resolve function
*/ | Returns the [[Resolve]] field of this PromiseCapability record | getResolve | {
"repo_name": "jugglinmike/es6draft",
"path": "src/main/java/com/github/anba/es6draft/runtime/objects/promise/PromiseCapability.java",
"license": "mit",
"size": 2784
} | [
"com.github.anba.es6draft.runtime.types.Callable"
] | import com.github.anba.es6draft.runtime.types.Callable; | import com.github.anba.es6draft.runtime.types.*; | [
"com.github.anba"
] | com.github.anba; | 724,063 |
public Map<Metadata, Object> extractMetadata() {
Map<Metadata, Object> metadataMap = new EnumMap<>(Metadata.class);
for (Metadata metadata : Metadata.values()) {
metadataMap.put(metadata, sourceAndMetadata.remove(metadata.getFieldName()));
}
return metadataMap;
} | Map<Metadata, Object> function() { Map<Metadata, Object> metadataMap = new EnumMap<>(Metadata.class); for (Metadata metadata : Metadata.values()) { metadataMap.put(metadata, sourceAndMetadata.remove(metadata.getFieldName())); } return metadataMap; } | /**
* one time operation that extracts the metadata fields from the ingest document and returns them.
* Metadata fields that used to be accessible as ordinary top level fields will be removed as part of this call.
*/ | one time operation that extracts the metadata fields from the ingest document and returns them. Metadata fields that used to be accessible as ordinary top level fields will be removed as part of this call | extractMetadata | {
"repo_name": "robin13/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/ingest/IngestDocument.java",
"license": "apache-2.0",
"size": 39144
} | [
"java.util.EnumMap",
"java.util.Map"
] | import java.util.EnumMap; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,837,659 |
public synchronized void webSocket(String path, Class<?> handler) {
requireNonNull(path, "WebSocket path cannot be null");
requireNonNull(handler, "WebSocket handler class cannot be null");
if (initialized) {
throwBeforeRouteMappingException();
}
if (ServletFlag.isRunningFromServlet()) {
throw new IllegalStateException("WebSockets are only supported in the embedded server");
}
if (webSocketHandlers == null) {
webSocketHandlers = new HashMap<>();
}
webSocketHandlers.put(path, handler);
} | synchronized void function(String path, Class<?> handler) { requireNonNull(path, STR); requireNonNull(handler, STR); if (initialized) { throwBeforeRouteMappingException(); } if (ServletFlag.isRunningFromServlet()) { throw new IllegalStateException(STR); } if (webSocketHandlers == null) { webSocketHandlers = new HashMap<>(); } webSocketHandlers.put(path, handler); } | /**
* Maps the given path to the given WebSocket handler.
* <p>
* This is currently only available in the embedded server mode.
*
* @param path the WebSocket path.
* @param handler the handler class that will manage the WebSocket connection to the given path.
*/ | Maps the given path to the given WebSocket handler. This is currently only available in the embedded server mode | webSocket | {
"repo_name": "universsky/spark-1",
"path": "src/main/java/spark/SparkInstance.java",
"license": "apache-2.0",
"size": 15260
} | [
"java.util.HashMap",
"java.util.Objects"
] | import java.util.HashMap; import java.util.Objects; | import java.util.*; | [
"java.util"
] | java.util; | 1,015,342 |
public FilterDefinition filter(String language, String expression) {
return filter(new LanguageExpression(language, expression));
}
| FilterDefinition function(String language, String expression) { return filter(new LanguageExpression(language, expression)); } | /**
* <a href="http://camel.apache.org/message-filter.html">Message Filter EIP:</a>
* Creates a predicate language expression which only if it is <tt>true</tt> then the
* exchange is forwarded to the destination
*
* @param language language for expression
* @param expression the expression
* @return the builder
*/ | Creates a predicate language expression which only if it is true then the exchange is forwarded to the destination | filter | {
"repo_name": "everttigchelaar/camel-svn",
"path": "camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java",
"license": "apache-2.0",
"size": 120346
} | [
"org.apache.camel.model.language.LanguageExpression"
] | import org.apache.camel.model.language.LanguageExpression; | import org.apache.camel.model.language.*; | [
"org.apache.camel"
] | org.apache.camel; | 711,510 |
public void testStartABCDE_RebuildWithPipelineReorganisation() throws Exception {
new ABCDE(true);
awaitFullyMetQuorum();
// Now run several transactions
for (int i = 0; i < 5; i++)
simpleTransaction();
// destroy D&E
destroyD();
destroyE();
// clean shutdown ABC
shutdownA();
shutdownB();
shutdownC();
final HAGlue serverD = startD();
awaitPipeline(new HAGlue[] { serverD });
final HAGlue serverE = startE();
awaitPipeline(new HAGlue[] { serverD, serverE });
// Now start A.
final HAGlue serverA = startA();
awaitPipeline(new HAGlue[] { serverD, serverE, serverA });
// Now B.
final HAGlue serverB = startB();
awaitPipeline(new HAGlue[] { serverD, serverE, serverA, serverB });
// And finally start C.
final HAGlue serverC = startC();
// A & B should meet
final long token2 = awaitMetQuorum();
// The expected pipeline. D&E were moved to the end (in order?).
awaitPipeline(new HAGlue[] { serverA, serverB, serverC, serverD, serverE });
// Wait until A is fully ready.
assertEquals(HAStatusEnum.Leader, awaitNSSAndHAReady(serverA));
// Verify A is the leader.
assertEquals(serverA, quorum.getClient().getLeader(token2));
// Check journals for equality on A, B, C.
assertDigestsEquals(new HAGlue[] { serverA, serverB, serverC });
// Check HALogs equal on A, B, C.
assertHALogDigestsEquals(7L, 7L, new HAGlue[] {
serverA, serverB, serverC });
// D and E will have go through Rebuild before joining
assertEquals(token2, awaitFullyMetQuorum(20));
// Note: I have seen this timeout. This warrants exploring. BBT.
// // Wait until C is fully ready.
assertEquals(HAStatusEnum.Follower, awaitNSSAndHAReady(serverD, 4*awaitQuorumTimeout, TimeUnit.MILLISECONDS));
assertEquals(HAStatusEnum.Follower, awaitNSSAndHAReady(serverE, 4*awaitQuorumTimeout, TimeUnit.MILLISECONDS));
// Verify binary equality of ALL journals.
assertDigestsEquals(new HAGlue[] { serverA, serverB, serverC, serverD, serverE});
// Check HALogs equal on ALL services.
assertHALogDigestsEquals(7L, 7L, new HAGlue[] {
serverA, serverB, serverC, serverD, serverE });
} | void function() throws Exception { new ABCDE(true); awaitFullyMetQuorum(); for (int i = 0; i < 5; i++) simpleTransaction(); destroyD(); destroyE(); shutdownA(); shutdownB(); shutdownC(); final HAGlue serverD = startD(); awaitPipeline(new HAGlue[] { serverD }); final HAGlue serverE = startE(); awaitPipeline(new HAGlue[] { serverD, serverE }); final HAGlue serverA = startA(); awaitPipeline(new HAGlue[] { serverD, serverE, serverA }); final HAGlue serverB = startB(); awaitPipeline(new HAGlue[] { serverD, serverE, serverA, serverB }); final HAGlue serverC = startC(); final long token2 = awaitMetQuorum(); awaitPipeline(new HAGlue[] { serverA, serverB, serverC, serverD, serverE }); assertEquals(HAStatusEnum.Leader, awaitNSSAndHAReady(serverA)); assertEquals(serverA, quorum.getClient().getLeader(token2)); assertDigestsEquals(new HAGlue[] { serverA, serverB, serverC }); assertHALogDigestsEquals(7L, 7L, new HAGlue[] { serverA, serverB, serverC }); assertEquals(token2, awaitFullyMetQuorum(20)); assertEquals(HAStatusEnum.Follower, awaitNSSAndHAReady(serverD, 4*awaitQuorumTimeout, TimeUnit.MILLISECONDS)); assertEquals(HAStatusEnum.Follower, awaitNSSAndHAReady(serverE, 4*awaitQuorumTimeout, TimeUnit.MILLISECONDS)); assertDigestsEquals(new HAGlue[] { serverA, serverB, serverC, serverD, serverE}); assertHALogDigestsEquals(7L, 7L, new HAGlue[] { serverA, serverB, serverC, serverD, serverE }); } | /**
* Test Rebuild of early starting D&E services where quorum was previously
* fully met. This forces a pipeline re-organisation
*
* @throws Exception
*/ | Test Rebuild of early starting D&E services where quorum was previously fully met. This forces a pipeline re-organisation | testStartABCDE_RebuildWithPipelineReorganisation | {
"repo_name": "smalyshev/blazegraph",
"path": "bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA5JournalServer.java",
"license": "gpl-2.0",
"size": 26134
} | [
"com.bigdata.ha.HAGlue",
"com.bigdata.ha.HAStatusEnum",
"java.util.concurrent.TimeUnit"
] | import com.bigdata.ha.HAGlue; import com.bigdata.ha.HAStatusEnum; import java.util.concurrent.TimeUnit; | import com.bigdata.ha.*; import java.util.concurrent.*; | [
"com.bigdata.ha",
"java.util"
] | com.bigdata.ha; java.util; | 946,617 |
public static ArtifactGroupIdVersion parse(String stringArtifactGroupId)
throws ParseException {
try {
return new ArtifactGroupIdVersion(stringArtifactGroupId);
} catch (RuntimeException re) {
if (re.getCause() instanceof ParseException) {
throw (ParseException)re.getCause();
} else {
throw re;
}
}
} | static ArtifactGroupIdVersion function(String stringArtifactGroupId) throws ParseException { try { return new ArtifactGroupIdVersion(stringArtifactGroupId); } catch (RuntimeException re) { if (re.getCause() instanceof ParseException) { throw (ParseException)re.getCause(); } else { throw re; } } } | /**
* Parses an ArtifactGroupId literal.
*
* @param stringArtifactGroupId ArtifactVersion literal.
* @return Version.
* @throws ParseException If parsing fails.
*/ | Parses an ArtifactGroupId literal | parse | {
"repo_name": "azyva/dragom-api",
"path": "src/main/java/org/azyva/dragom/model/ArtifactGroupIdVersion.java",
"license": "agpl-3.0",
"size": 5373
} | [
"java.text.ParseException"
] | import java.text.ParseException; | import java.text.*; | [
"java.text"
] | java.text; | 644,758 |
@Test public void testJsonRoundTrip1() throws InterruptedException {
final Scene scene = new Scene();
scene.setCanvasSize(WIDTH, HEIGHT);
scene.setRenderMode(RenderMode.RENDERING);
scene.sky().setSkyMode(Sky.SkyMode.GRADIENT);
List<Vector4> white = new ArrayList<>();
white.add(new Vector4(0.5, 1, 0.25, 0));
white.add(new Vector4(0.5, 1, 0.25, 1));
scene.sky().setGradient(white);
scene.setTargetSpp(2);
scene.setName("json1");
JsonObject json = scene.toJson();
scene.fromJson(json);
scene.setRenderMode(RenderMode.RENDERING); // Un-pause after JSON import.
renderAndCheckSamples(scene, new double[] {0.5, 1, 0.25});
} | @Test void function() throws InterruptedException { final Scene scene = new Scene(); scene.setCanvasSize(WIDTH, HEIGHT); scene.setRenderMode(RenderMode.RENDERING); scene.sky().setSkyMode(Sky.SkyMode.GRADIENT); List<Vector4> white = new ArrayList<>(); white.add(new Vector4(0.5, 1, 0.25, 0)); white.add(new Vector4(0.5, 1, 0.25, 1)); scene.sky().setGradient(white); scene.setTargetSpp(2); scene.setName("json1"); JsonObject json = scene.toJson(); scene.fromJson(json); scene.setRenderMode(RenderMode.RENDERING); renderAndCheckSamples(scene, new double[] {0.5, 1, 0.25}); } | /**
* Test that render output is correct after JSON export/import.
*/ | Test that render output is correct after JSON export/import | testJsonRoundTrip1 | {
"repo_name": "leMaik/chunky",
"path": "chunky/src/test/se/llbit/chunky/renderer/BlankRenderTest.java",
"license": "gpl-3.0",
"size": 6729
} | [
"java.util.ArrayList",
"java.util.List",
"org.junit.Test",
"se.llbit.chunky.renderer.scene.Scene",
"se.llbit.chunky.renderer.scene.Sky",
"se.llbit.json.JsonObject",
"se.llbit.math.Vector4"
] | import java.util.ArrayList; import java.util.List; import org.junit.Test; import se.llbit.chunky.renderer.scene.Scene; import se.llbit.chunky.renderer.scene.Sky; import se.llbit.json.JsonObject; import se.llbit.math.Vector4; | import java.util.*; import org.junit.*; import se.llbit.chunky.renderer.scene.*; import se.llbit.json.*; import se.llbit.math.*; | [
"java.util",
"org.junit",
"se.llbit.chunky",
"se.llbit.json",
"se.llbit.math"
] | java.util; org.junit; se.llbit.chunky; se.llbit.json; se.llbit.math; | 181,468 |
@Test
public void testFindPvpSeasonDivisionFlag() {
System.out.println("findPvpSeasonDivisionFlag");
final String[] values = {
"CanLosePoints", // NOI18N.
"CanLoseTiers", // NOI18N.
"Repeatable", // NOI18N.
null,
"" // NOI18N.
};
final PvpSeasonDivisionFlag[] expResults = {
PvpSeasonDivisionFlag.CAN_LOSE_POINTS,
PvpSeasonDivisionFlag.CAN_LOSE_TIERS,
PvpSeasonDivisionFlag.REPEATABLE,
PvpSeasonDivisionFlag.UNKNOWN,
PvpSeasonDivisionFlag.UNKNOWN
};
assertEquals(values.length, expResults.length);
IntStream.range(0, values.length).
forEach(index -> {
final String value = values[index];
final PvpSeasonDivisionFlag expResult = expResults[index];
final PvpSeasonDivisionFlag result = EnumValueFactory.INSTANCE.mapEnumValue(PvpSeasonDivisionFlag.class, value);
assertEquals(expResult, result);
});
} | void function() { System.out.println(STR); final String[] values = { STR, STR, STR, null, "" }; final PvpSeasonDivisionFlag[] expResults = { PvpSeasonDivisionFlag.CAN_LOSE_POINTS, PvpSeasonDivisionFlag.CAN_LOSE_TIERS, PvpSeasonDivisionFlag.REPEATABLE, PvpSeasonDivisionFlag.UNKNOWN, PvpSeasonDivisionFlag.UNKNOWN }; assertEquals(values.length, expResults.length); IntStream.range(0, values.length). forEach(index -> { final String value = values[index]; final PvpSeasonDivisionFlag expResult = expResults[index]; final PvpSeasonDivisionFlag result = EnumValueFactory.INSTANCE.mapEnumValue(PvpSeasonDivisionFlag.class, value); assertEquals(expResult, result); }); } | /**
* Test of PvpSeasonDivisionFlag.
*/ | Test of PvpSeasonDivisionFlag | testFindPvpSeasonDivisionFlag | {
"repo_name": "fabricebouye/gw2-web-api-mapping",
"path": "test/api/web/gw2/mapping/v2/pvp/seasons/PvpSeasonUtilsTest.java",
"license": "bsd-3-clause",
"size": 6601
} | [
"java.util.stream.IntStream",
"org.junit.jupiter.api.Assertions"
] | import java.util.stream.IntStream; import org.junit.jupiter.api.Assertions; | import java.util.stream.*; import org.junit.jupiter.api.*; | [
"java.util",
"org.junit.jupiter"
] | java.util; org.junit.jupiter; | 144,456 |
private static int getTypeValue(MinorType type) {
if (TypeCastRules.isNumericType(type)) {
return 0;
}
switch (type) {
case TINYINT:
case SMALLINT:
case INT:
case BIGINT:
case UINT1:
case UINT2:
case UINT4:
case UINT8:
case DECIMAL9:
case DECIMAL18:
case DECIMAL28SPARSE:
case DECIMAL38SPARSE:
case FLOAT4:
case FLOAT8:
return 0;
case VARCHAR:
case VAR16CHAR:
return 1;
case VARBINARY:
return 2;
case BIT:
return 3;
case DATE:
return 4;
case TIMESTAMP:
return 5;
default:
return 6 + type.getNumber();
}
}
@FunctionTemplate(names = {"typeOf"},
scope = FunctionTemplate.FunctionScope.SIMPLE,
nulls = NullHandling.INTERNAL)
public static class GetType implements DrillSimpleFunc {
@Param
FieldReader input;
@Output
VarCharHolder out;
@Inject
DrillBuf buf;
public void setup() {} | static int function(MinorType type) { if (TypeCastRules.isNumericType(type)) { return 0; } switch (type) { case TINYINT: case SMALLINT: case INT: case BIGINT: case UINT1: case UINT2: case UINT4: case UINT8: case DECIMAL9: case DECIMAL18: case DECIMAL28SPARSE: case DECIMAL38SPARSE: case FLOAT4: case FLOAT8: return 0; case VARCHAR: case VAR16CHAR: return 1; case VARBINARY: return 2; case BIT: return 3; case DATE: return 4; case TIMESTAMP: return 5; default: return 6 + type.getNumber(); } } @FunctionTemplate(names = {STR}, scope = FunctionTemplate.FunctionScope.SIMPLE, nulls = NullHandling.INTERNAL) public static class GetType implements DrillSimpleFunc { FieldReader input; VarCharHolder out; DrillBuf buf; public void setup() {} | /**
* Gives a type ordering modeled after the behavior of MongoDB
* Numeric types are first, folowed by string types, followed by binary, then boolean, then date, then timestamp
* Any other times will be sorted after that
* @param type
* @return
*/ | Gives a type ordering modeled after the behavior of MongoDB Numeric types are first, folowed by string types, followed by binary, then boolean, then date, then timestamp Any other times will be sorted after that | getTypeValue | {
"repo_name": "bitblender/drill",
"path": "exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/UnionFunctions.java",
"license": "apache-2.0",
"size": 8772
} | [
"io.netty.buffer.DrillBuf",
"org.apache.drill.common.types.TypeProtos",
"org.apache.drill.exec.expr.DrillSimpleFunc",
"org.apache.drill.exec.expr.annotations.FunctionTemplate",
"org.apache.drill.exec.expr.holders.VarCharHolder",
"org.apache.drill.exec.resolver.TypeCastRules",
"org.apache.drill.exec.vector.complex.reader.FieldReader"
] | import io.netty.buffer.DrillBuf; import org.apache.drill.common.types.TypeProtos; import org.apache.drill.exec.expr.DrillSimpleFunc; import org.apache.drill.exec.expr.annotations.FunctionTemplate; import org.apache.drill.exec.expr.holders.VarCharHolder; import org.apache.drill.exec.resolver.TypeCastRules; import org.apache.drill.exec.vector.complex.reader.FieldReader; | import io.netty.buffer.*; import org.apache.drill.common.types.*; import org.apache.drill.exec.expr.*; import org.apache.drill.exec.expr.annotations.*; import org.apache.drill.exec.expr.holders.*; import org.apache.drill.exec.resolver.*; import org.apache.drill.exec.vector.complex.reader.*; | [
"io.netty.buffer",
"org.apache.drill"
] | io.netty.buffer; org.apache.drill; | 1,528,464 |
public void saveTournamentModules(ObservableList<TournamentModule> modules) {
if (!Files.exists(Paths.get(tournamentModuleFolder))) {
try {
Files.createDirectories(Paths.get(tournamentModuleFolder));
} catch (IOException e) {
log.log(Level.SEVERE,
"Could not create the folders needed to save tournament modules.",
e);
}
}
for (TournamentModule module : modules) {
File moduleFile = new File(
PreferencesManager.tournamentModuleFolder
+ module.getName().replaceAll("[:\\\\/*\"?|<>]",
"_") + ".ttm");
if (moduleFile.exists()) {
moduleFile.delete();
}
FileSaver.saveTournamentModuleToFile(module,
moduleFile.getAbsolutePath());
}
} | void function(ObservableList<TournamentModule> modules) { if (!Files.exists(Paths.get(tournamentModuleFolder))) { try { Files.createDirectories(Paths.get(tournamentModuleFolder)); } catch (IOException e) { log.log(Level.SEVERE, STR, e); } } for (TournamentModule module : modules) { File moduleFile = new File( PreferencesManager.tournamentModuleFolder + module.getName().replaceAll(STR? <>]STR_STR.ttm"); if (moduleFile.exists()) { moduleFile.delete(); } FileSaver.saveTournamentModuleToFile(module, moduleFile.getAbsolutePath()); } } | /**
* Save all tournament modules to the preferences folder replacing possible
* existing ones
*
* @param modules
* List of tournament modules to save
*/ | Save all tournament modules to the preferences folder replacing possible existing ones | saveTournamentModules | {
"repo_name": "Novanoid/Tourney",
"path": "Application/src/usspg31/tourney/controller/PreferencesManager.java",
"license": "gpl-3.0",
"size": 21922
} | [
"java.io.File",
"java.io.IOException",
"java.nio.file.Files",
"java.nio.file.Paths",
"java.util.logging.Level"
] | import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.logging.Level; | import java.io.*; import java.nio.file.*; import java.util.logging.*; | [
"java.io",
"java.nio",
"java.util"
] | java.io; java.nio; java.util; | 197,255 |
@Generated
@Selector("replaceCurrentItemWithPlayerItem:")
public native void replaceCurrentItemWithPlayerItem(AVPlayerItem item); | @Selector(STR) native void function(AVPlayerItem item); | /**
* replaceCurrentItemWithPlayerItem:
* <p>
* Replaces the player's current item with the specified player item.
* <p>
* In all releases of iOS 4, invoking replaceCurrentItemWithPlayerItem: with an AVPlayerItem that's already the receiver's currentItem results in an exception being raised. Starting with iOS 5, it's a no-op.
*
* @param item The AVPlayerItem that will become the player's current item.
*/ | replaceCurrentItemWithPlayerItem: Replaces the player's current item with the specified player item. In all releases of iOS 4, invoking replaceCurrentItemWithPlayerItem: with an AVPlayerItem that's already the receiver's currentItem results in an exception being raised. Starting with iOS 5, it's a no-op | replaceCurrentItemWithPlayerItem | {
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/avfoundation/AVPlayer.java",
"license": "apache-2.0",
"size": 61892
} | [
"org.moe.natj.objc.ann.Selector"
] | import org.moe.natj.objc.ann.Selector; | import org.moe.natj.objc.ann.*; | [
"org.moe.natj"
] | org.moe.natj; | 2,354,945 |
Collection loadAnnotationsUsedNotOwned(SecurityContext ctx,
Class annotationType, long userID)
throws DSOutOfServiceException, DSAccessException
{
Set result = new HashSet();
try {
IMetadataPrx service = gw.getMetadataService(ctx);
List<IObject> set = service.loadAnnotationsUsedNotOwned(
convertAnnotation(annotationType), userID);
Iterator<IObject> i = set.iterator();
IObject o;
while (i.hasNext()) {
o = i.next();
if (TagAnnotationData.class.equals(annotationType)) {
result.add(new TagAnnotationData((TagAnnotation) o));
}
}
return result;
} catch (Exception e) {
handleException(e, "Cannot find the Used Tags.");
}
return result;
} | Collection loadAnnotationsUsedNotOwned(SecurityContext ctx, Class annotationType, long userID) throws DSOutOfServiceException, DSAccessException { Set result = new HashSet(); try { IMetadataPrx service = gw.getMetadataService(ctx); List<IObject> set = service.loadAnnotationsUsedNotOwned( convertAnnotation(annotationType), userID); Iterator<IObject> i = set.iterator(); IObject o; while (i.hasNext()) { o = i.next(); if (TagAnnotationData.class.equals(annotationType)) { result.add(new TagAnnotationData((TagAnnotation) o)); } } return result; } catch (Exception e) { handleException(e, STR); } return result; } | /**
* Loads the tag Sets and the orphaned tags, if requested.
*
* @param ctx The security context.
* @param annotationType The type of annotation to retrieve.
* @param userID The identifier of the user.
* @return See above.
* @throws DSOutOfServiceException If the connection is broken, or logged
* in.
* @throws DSAccessException If an error occurred while trying to
* retrieve data from OMEDS service.
*/ | Loads the tag Sets and the orphaned tags, if requested | loadAnnotationsUsedNotOwned | {
"repo_name": "dpwrussell/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/env/data/OMEROGateway.java",
"license": "gpl-2.0",
"size": 262581
} | [
"java.util.Collection",
"java.util.HashSet",
"java.util.Iterator",
"java.util.List",
"java.util.Set"
] | import java.util.Collection; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 2,225,760 |
@Override
public String toString() {
return "FastDateFormat[" + printer.getPattern() + "," + printer.getLocale() + "," + printer.getTimeZone().getID() + "]";
}
/**
* <p>Performs the formatting by applying the rules to the
* specified calendar.</p>
*
* @param calendar the calendar to format
* @param buf the buffer to format into
* @return the specified string buffer
* @deprecated Use {@link #format(Calendar, Appendable)} | String function() { return STR + printer.getPattern() + "," + printer.getLocale() + "," + printer.getTimeZone().getID() + "]"; } /** * <p>Performs the formatting by applying the rules to the * specified calendar.</p> * * @param calendar the calendar to format * @param buf the buffer to format into * @return the specified string buffer * @deprecated Use {@link #format(Calendar, Appendable)} | /**
* <p>Gets a debugging string version of this formatter.</p>
*
* @return a debugging string
*/ | Gets a debugging string version of this formatter | toString | {
"repo_name": "hsjawanda/gae-objectify-utils",
"path": "src/main/java/com/hsjawanda/gaeobjectify/repackaged/commons/lang3/time/FastDateFormat.java",
"license": "apache-2.0",
"size": 24220
} | [
"java.util.Calendar"
] | import java.util.Calendar; | import java.util.*; | [
"java.util"
] | java.util; | 2,004,233 |
public void setBounds(Envelope bounds) {
this.bounds = bounds;
}
/**
* Changes the spatial/world extent of the view.
* <p>
* This method results in {@link Listener#onBoundsChanged(Viewport, Envelope, Envelope)} | void function(Envelope bounds) { this.bounds = bounds; } /** * Changes the spatial/world extent of the view. * <p> * This method results in {@link Listener#onBoundsChanged(Viewport, Envelope, Envelope)} | /**
* Sets the spatial/world extent of the view.
* <p>
* Application code should generally only call this method during initialization of the
* map/view and instead call {@link #zoomto(Envelope))} to change the bounds of the view
* dynamically. This method will not result in any events being fired.
* </p>
*/ | Sets the spatial/world extent of the view. Application code should generally only call this method during initialization of the map/view and instead call <code>#zoomto(Envelope))</code> to change the bounds of the view dynamically. This method will not result in any events being fired. | setBounds | {
"repo_name": "geosolutions-it/jeo",
"path": "core/src/main/java/org/jeo/map/Viewport.java",
"license": "apache-2.0",
"size": 9573
} | [
"com.vividsolutions.jts.geom.Envelope"
] | import com.vividsolutions.jts.geom.Envelope; | import com.vividsolutions.jts.geom.*; | [
"com.vividsolutions.jts"
] | com.vividsolutions.jts; | 2,285,611 |
@SuppressWarnings("unused")
private TypeReference findParameterType(Register p) {
RegisterOperand firstUse = p.useList;
if (firstUse == null) {
return null; // parameter has no uses
}
return firstUse.getType();
} | @SuppressWarnings(STR) TypeReference function(Register p) { RegisterOperand firstUse = p.useList; if (firstUse == null) { return null; } return firstUse.getType(); } | /**
* Find a parameter type.
*
* <p> Given a register that holds a parameter, look at the register's
* use chain to find the type of the parameter
*/ | Find a parameter type. Given a register that holds a parameter, look at the register's use chain to find the type of the parameter | findParameterType | {
"repo_name": "CodeOffloading/JikesRVM-CCO",
"path": "jikesrvm-3.1.3/rvm/src/org/jikesrvm/compilers/opt/ssa/EnterSSA.java",
"license": "epl-1.0",
"size": 44804
} | [
"org.jikesrvm.classloader.TypeReference",
"org.jikesrvm.compilers.opt.ir.Register",
"org.jikesrvm.compilers.opt.ir.operand.RegisterOperand"
] | import org.jikesrvm.classloader.TypeReference; import org.jikesrvm.compilers.opt.ir.Register; import org.jikesrvm.compilers.opt.ir.operand.RegisterOperand; | import org.jikesrvm.classloader.*; import org.jikesrvm.compilers.opt.ir.*; import org.jikesrvm.compilers.opt.ir.operand.*; | [
"org.jikesrvm.classloader",
"org.jikesrvm.compilers"
] | org.jikesrvm.classloader; org.jikesrvm.compilers; | 1,513,588 |
protected static void creaCella(Sheet sheet ,int row, int colonna, CellStyle stile, String contenuto)
{
if( sheet.getRow(row) == null)
{
sheet.createRow(row);
}
//creo cella 'bianca', e poi le setto lo stile ed il contenuto. Se la cella già esisteva sovrascrivo stile e contenuto
Cell cella = KAbstract_ExcelWriter.createBlankCell(sheet, row, colonna);
cella.setCellStyle(stile);
cella.setCellValue(contenuto);
}
| static void function(Sheet sheet ,int row, int colonna, CellStyle stile, String contenuto) { if( sheet.getRow(row) == null) { sheet.createRow(row); } Cell cella = KAbstract_ExcelWriter.createBlankCell(sheet, row, colonna); cella.setCellStyle(stile); cella.setCellValue(contenuto); } | /**
* Metodo di utility per creare una cella nella posizione indicata, che contenga una determinata stringa , con un determinato stile.<br>
* Se la riga a quell'indice non esiste, viene creata. Lo sheet invece deve esistere.<br>
* <h3>WARNING: se la cella già esiste viene sovrascritta</h3>
* @param sheet sheet nel quale si vuole creare la cella
* @param row indice di riga (nota: parte da 0)
* @param colonna indice di colonna (nota: parte da 0)
* @param stile stile da applicare alla cella
* @param contenuto Stringa da inserire nella cella
*/ | Metodo di utility per creare una cella nella posizione indicata, che contenga una determinata stringa , con un determinato stile. Se la riga a quell'indice non esiste, viene creata. Lo sheet invece deve esistere | creaCella | {
"repo_name": "giasap0/konga",
"path": "konga/src/it/konga/framework/util/excel/KAbstract_ExcelWriter.java",
"license": "gpl-2.0",
"size": 7708
} | [
"org.apache.poi.ss.usermodel.Cell",
"org.apache.poi.ss.usermodel.CellStyle",
"org.apache.poi.ss.usermodel.Sheet"
] | import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.Sheet; | import org.apache.poi.ss.usermodel.*; | [
"org.apache.poi"
] | org.apache.poi; | 2,147,469 |
// </editor-fold>
// <editor-fold desc="Methods">
public void addSeries(String seriesKey, double[] xvs, double[] yvs) {
((XYListDataset) this.dataset).addSeries(seriesKey, xvs, yvs);
PolylineBreak plb = new PolylineBreak();
plb.setColor(ColorUtil.getCommonColor(this.dataset.getSeriesCount()));
plb.setCaption(seriesKey);
seriesLegends.add(new SeriesLegend(plb));
Extent extent = this.getAutoExtent();
this.setDrawExtent(extent);
}
| void function(String seriesKey, double[] xvs, double[] yvs) { ((XYListDataset) this.dataset).addSeries(seriesKey, xvs, yvs); PolylineBreak plb = new PolylineBreak(); plb.setColor(ColorUtil.getCommonColor(this.dataset.getSeriesCount())); plb.setCaption(seriesKey); seriesLegends.add(new SeriesLegend(plb)); Extent extent = this.getAutoExtent(); this.setDrawExtent(extent); } | /**
* Add a series data
*
* @param seriesKey Series key
* @param xvs X value array
* @param yvs Y value array
*/ | Add a series data | addSeries | {
"repo_name": "meteoinfo/meteoinfolib",
"path": "src/org/meteoinfo/chart/plot/XY1DPlot.java",
"license": "lgpl-3.0",
"size": 34104
} | [
"org.meteoinfo.data.XYListDataset",
"org.meteoinfo.global.Extent",
"org.meteoinfo.global.colors.ColorUtil",
"org.meteoinfo.legend.PolylineBreak"
] | import org.meteoinfo.data.XYListDataset; import org.meteoinfo.global.Extent; import org.meteoinfo.global.colors.ColorUtil; import org.meteoinfo.legend.PolylineBreak; | import org.meteoinfo.data.*; import org.meteoinfo.global.*; import org.meteoinfo.global.colors.*; import org.meteoinfo.legend.*; | [
"org.meteoinfo.data",
"org.meteoinfo.global",
"org.meteoinfo.legend"
] | org.meteoinfo.data; org.meteoinfo.global; org.meteoinfo.legend; | 1,958,493 |
private String getPortletConfigParameterNameForLoadOnly(VelocityPortlet portlet)
{
// Check to see if the older non-merged parameter is present.
// This is really the "merged" parameter, but it was incorrectly
// named. This is for backward compatibility.
String configParameter = StringUtils.trimToNull(portlet.getPortletConfig().getInitParameter(
PORTLET_CONFIG_PARM_NON_MERGED_CHANNELS));
String configParameterName = configParameter != null ? PORTLET_CONFIG_PARM_NON_MERGED_CHANNELS
: PORTLET_CONFIG_PARM_MERGED_CHANNELS;
return configParameterName;
}
| String function(VelocityPortlet portlet) { String configParameter = StringUtils.trimToNull(portlet.getPortletConfig().getInitParameter( PORTLET_CONFIG_PARM_NON_MERGED_CHANNELS)); String configParameterName = configParameter != null ? PORTLET_CONFIG_PARM_NON_MERGED_CHANNELS : PORTLET_CONFIG_PARM_MERGED_CHANNELS; return configParameterName; } | /**
* This is a cover to return the right config parameter name, regardless of whether the parameter is using an older, deprecated name or the newer version.
*/ | This is a cover to return the right config parameter name, regardless of whether the parameter is using an older, deprecated name or the newer version | getPortletConfigParameterNameForLoadOnly | {
"repo_name": "wfuedu/sakai",
"path": "announcement/announcement-tool/tool/src/java/org/sakaiproject/announcement/tool/AnnouncementAction.java",
"license": "apache-2.0",
"size": 173293
} | [
"org.apache.commons.lang.StringUtils",
"org.sakaiproject.cheftool.VelocityPortlet"
] | import org.apache.commons.lang.StringUtils; import org.sakaiproject.cheftool.VelocityPortlet; | import org.apache.commons.lang.*; import org.sakaiproject.cheftool.*; | [
"org.apache.commons",
"org.sakaiproject.cheftool"
] | org.apache.commons; org.sakaiproject.cheftool; | 2,845,496 |
@Test public void testTileAlgorithm() {
final String explain = "EnumerableAggregate(group=[{2, 3}])\n"
+ " EnumerableTableScan(table=[[adhoc, m{16, 17, 32, 36, 37}]])";
checkTileAlgorithm(
FoodMartLatticeStatisticProvider.class.getCanonicalName() + "#FACTORY",
explain);
} | @Test void function() { final String explain = STR + STR; checkTileAlgorithm( FoodMartLatticeStatisticProvider.class.getCanonicalName() + STR, explain); } | /** Tests a model that uses an algorithm to generate an initial set of
* tiles.
*
* <p>Test case for
* <a href="https://issues.apache.org/jira/browse/CALCITE-428">[CALCITE-428]
* Use optimization algorithm to suggest which tiles of a lattice to
* materialize</a>. */ | Tests a model that uses an algorithm to generate an initial set of tiles. Test case for [CALCITE-428] Use optimization algorithm to suggest which tiles of a lattice to | testTileAlgorithm | {
"repo_name": "dindin5258/calcite",
"path": "core/src/test/java/org/apache/calcite/test/LatticeTest.java",
"license": "apache-2.0",
"size": 38292
} | [
"org.junit.Test"
] | import org.junit.Test; | import org.junit.*; | [
"org.junit"
] | org.junit; | 2,327,982 |
public static void dump(
final Logger log,
final String prefix,
final RealAtom aAtom) {
log.log(Level.INFO, "{0}:{1} (RealAtom)", new Object[]{
prefix, aAtom.getValue()
});
} | static void function( final Logger log, final String prefix, final RealAtom aAtom) { log.log(Level.INFO, STR, new Object[]{ prefix, aAtom.getValue() }); } | /**
* This method dumps a real atom to the log.
* @param log The log to dump data to.
* @param prefix A prefix to print before the atom value.
* @param aAtom The atom to dump.
*/ | This method dumps a real atom to the log | dump | {
"repo_name": "jarney/snackbot",
"path": "src/main/java/org/ensor/data/atom/log/AtomLogger.java",
"license": "mit",
"size": 6215
} | [
"java.util.logging.Level",
"java.util.logging.Logger",
"org.ensor.data.atom.RealAtom"
] | import java.util.logging.Level; import java.util.logging.Logger; import org.ensor.data.atom.RealAtom; | import java.util.logging.*; import org.ensor.data.atom.*; | [
"java.util",
"org.ensor.data"
] | java.util; org.ensor.data; | 2,202,546 |
private JPanel getJRecombColorPanel() {
if (jRecombColorPanel == null) {
jRecombColorLabel = new JLabel();
jRecombColorLabel.setText("Outline Color:");
jRecombColorPanel = new JPanel();
jRecombColorPanel.add(jRecombColorLabel, null);
jRecombColorPanel.add(getJRecombColorButton(), null);
jRecombColorPanel.add(getJShowColorPanel(), null);
}
return jRecombColorPanel;
} | JPanel function() { if (jRecombColorPanel == null) { jRecombColorLabel = new JLabel(); jRecombColorLabel.setText(STR); jRecombColorPanel = new JPanel(); jRecombColorPanel.add(jRecombColorLabel, null); jRecombColorPanel.add(getJRecombColorButton(), null); jRecombColorPanel.add(getJShowColorPanel(), null); } return jRecombColorPanel; } | /**
* This method initializes jRecombColorPanel
*
* @return javax.swing.JPanel
*/ | This method initializes jRecombColorPanel | getJRecombColorPanel | {
"repo_name": "jmeppley/strainer",
"path": "src/amd/strainer/display/actions/DisplayOptionsDialog.java",
"license": "lgpl-3.0",
"size": 56827
} | [
"javax.swing.JLabel",
"javax.swing.JPanel"
] | import javax.swing.JLabel; import javax.swing.JPanel; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 1,987,866 |
public static Object getMaxCountElement(HashMap<? extends Object, Integer> _countMap) {
Object _best = null;
int _bestCount = Integer.MIN_VALUE;
for(Object obj:_countMap.keySet()) {
if(_countMap.get(obj) > _bestCount) {
_best = obj;
_bestCount = _countMap.get(obj);
}
}
return _best;
} | static Object function(HashMap<? extends Object, Integer> _countMap) { Object _best = null; int _bestCount = Integer.MIN_VALUE; for(Object obj:_countMap.keySet()) { if(_countMap.get(obj) > _bestCount) { _best = obj; _bestCount = _countMap.get(obj); } } return _best; } | /**
* returns the object of the keySet which has the highest associated count
* if the map is empty, null will be returned
* @param _countMap
* @return
*/ | returns the object of the keySet which has the highest associated count if the map is empty, null will be returned | getMaxCountElement | {
"repo_name": "AndreasMaring/text2model",
"path": "src/transform/SearchUtils.java",
"license": "gpl-3.0",
"size": 9239
} | [
"java.util.HashMap"
] | import java.util.HashMap; | import java.util.*; | [
"java.util"
] | java.util; | 532,439 |
void saveClient(Client newPizza) throws DaoException;
| void saveClient(Client newPizza) throws DaoException; | /**
* Ajout d'une pizza
*
* @param newPizza
* pizza à ajouter
*
*/ | Ajout d'une pizza | saveClient | {
"repo_name": "elfindel69/formation-dta",
"path": "pizzeria-dao/src/main/java/fr/pizzeria/dao/IClientDao.java",
"license": "mit",
"size": 1013
} | [
"fr.pizzeria.exceptions.DaoException",
"fr.pizzeria.model.Client"
] | import fr.pizzeria.exceptions.DaoException; import fr.pizzeria.model.Client; | import fr.pizzeria.exceptions.*; import fr.pizzeria.model.*; | [
"fr.pizzeria.exceptions",
"fr.pizzeria.model"
] | fr.pizzeria.exceptions; fr.pizzeria.model; | 2,242,390 |
private void zippedXmlFilter(
InputStream inputStream, final XMLReaderService xmlReaderService,
final Accumulator accumulator, final CharsetDecoder charsetDecoder,
final RowIterator inputIterator, final RowEmitter outputEmitter) {
| void function( InputStream inputStream, final XMLReaderService xmlReaderService, final Accumulator accumulator, final CharsetDecoder charsetDecoder, final RowIterator inputIterator, final RowEmitter outputEmitter) { | /**
* Parse the XML of one XML document, not compressed and complete. Emit the row to Aster and handle skipping if detected.
* @param inputStream to read the compressed content from.
* @param xmlReaderService containing processing information like include and exclude lists.
* @param accumulator
* @param charsetDecoder
* @param inputIterator
* @param outputEmitter
*/ | Parse the XML of one XML document, not compressed and complete. Emit the row to Aster and handle skipping if detected | zippedXmlFilter | {
"repo_name": "juergenb-github/Teradata-Aster",
"path": "AsterXXLEdition/src/sqlmrFunctions/XMLFastFilter.java",
"license": "apache-2.0",
"size": 19585
} | [
"com.asterdata.ncluster.sqlmr.data.RowEmitter",
"com.asterdata.ncluster.sqlmr.data.RowIterator",
"java.io.InputStream",
"java.nio.charset.CharsetDecoder"
] | import com.asterdata.ncluster.sqlmr.data.RowEmitter; import com.asterdata.ncluster.sqlmr.data.RowIterator; import java.io.InputStream; import java.nio.charset.CharsetDecoder; | import com.asterdata.ncluster.sqlmr.data.*; import java.io.*; import java.nio.charset.*; | [
"com.asterdata.ncluster",
"java.io",
"java.nio"
] | com.asterdata.ncluster; java.io; java.nio; | 2,172,301 |
public FDFPageInfo getPageInfo()
{
FDFPageInfo retval = null;
COSDictionary dict = (COSDictionary)page.getDictionaryObject( COSName.INFO );
if( dict != null )
{
retval = new FDFPageInfo( dict );
}
return retval;
}
| FDFPageInfo function() { FDFPageInfo retval = null; COSDictionary dict = (COSDictionary)page.getDictionaryObject( COSName.INFO ); if( dict != null ) { retval = new FDFPageInfo( dict ); } return retval; } | /**
* This will get the FDF page info object.
*
* @return The Page info.
*/ | This will get the FDF page info object | getPageInfo | {
"repo_name": "kzganesan/PdfBox-Android",
"path": "library/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFPage.java",
"license": "apache-2.0",
"size": 2957
} | [
"org.apache.pdfbox.cos.COSDictionary",
"org.apache.pdfbox.cos.COSName"
] | import org.apache.pdfbox.cos.COSDictionary; import org.apache.pdfbox.cos.COSName; | import org.apache.pdfbox.cos.*; | [
"org.apache.pdfbox"
] | org.apache.pdfbox; | 2,594,865 |
public void setPrepareIsolation(int level) throws SQLException
{
if (level == getPrepareIsolation())
return;
switch (level)
{
case TransactionControl.READ_UNCOMMITTED_ISOLATION_LEVEL:
case TransactionControl.REPEATABLE_READ_ISOLATION_LEVEL:
case TransactionControl.READ_COMMITTED_ISOLATION_LEVEL:
case TransactionControl.SERIALIZABLE_ISOLATION_LEVEL:
case TransactionControl.UNSPECIFIED_ISOLATION_LEVEL:
break;
default:
throw newSQLException(
SQLState.UNIMPLEMENTED_ISOLATION_LEVEL, level);
}
synchronized(getConnectionSynchronization())
{
privilegedGetLCC().setPrepareIsolationLevel(level);
}
} | void function(int level) throws SQLException { if (level == getPrepareIsolation()) return; switch (level) { case TransactionControl.READ_UNCOMMITTED_ISOLATION_LEVEL: case TransactionControl.REPEATABLE_READ_ISOLATION_LEVEL: case TransactionControl.READ_COMMITTED_ISOLATION_LEVEL: case TransactionControl.SERIALIZABLE_ISOLATION_LEVEL: case TransactionControl.UNSPECIFIED_ISOLATION_LEVEL: break; default: throw newSQLException( SQLState.UNIMPLEMENTED_ISOLATION_LEVEL, level); } synchronized(getConnectionSynchronization()) { privilegedGetLCC().setPrepareIsolationLevel(level); } } | /**
* Set the transaction isolation level that will be used for the
* next prepare. Used by network server to implement DB2 style
* isolation levels.
* @param level Isolation level to change to. level is the DB2 level
* specified in the package names which happen to correspond
* to our internal levels. If
* level == TransactionControl.UNSPECIFIED_ISOLATION,
* the statement won't be prepared with an isolation level.
*
*
*/ | Set the transaction isolation level that will be used for the next prepare. Used by network server to implement DB2 style isolation levels | setPrepareIsolation | {
"repo_name": "apache/derby",
"path": "java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedConnection.java",
"license": "apache-2.0",
"size": 142318
} | [
"java.sql.SQLException",
"org.apache.derby.iapi.transaction.TransactionControl",
"org.apache.derby.shared.common.reference.SQLState"
] | import java.sql.SQLException; import org.apache.derby.iapi.transaction.TransactionControl; import org.apache.derby.shared.common.reference.SQLState; | import java.sql.*; import org.apache.derby.iapi.transaction.*; import org.apache.derby.shared.common.reference.*; | [
"java.sql",
"org.apache.derby"
] | java.sql; org.apache.derby; | 2,802,403 |
private List<T> generateAndCheck(final T existing, final AbsoluteDate date)
throws TimeStampedCacheException {
final List<T> entries = generator.generate(existing, date);
if (entries.isEmpty()) {
throw new TimeStampedCacheException(OrekitMessages.NO_DATA_GENERATED, date);
}
for (int i = 1; i < entries.size(); ++i) {
if (entries.get(i).getDate().compareTo(entries.get(i - 1).getDate()) < 0) {
throw new TimeStampedCacheException(OrekitMessages.NON_CHRONOLOGICALLY_SORTED_ENTRIES,
entries.get(i - 1).getDate(),
entries.get(i).getDate());
}
}
return entries;
}
private class Entry {
private final T data;
private final long quantum;
public Entry(final T data, final long quantum) {
this.quantum = quantum;
this.data = data;
} | List<T> function(final T existing, final AbsoluteDate date) throws TimeStampedCacheException { final List<T> entries = generator.generate(existing, date); if (entries.isEmpty()) { throw new TimeStampedCacheException(OrekitMessages.NO_DATA_GENERATED, date); } for (int i = 1; i < entries.size(); ++i) { if (entries.get(i).getDate().compareTo(entries.get(i - 1).getDate()) < 0) { throw new TimeStampedCacheException(OrekitMessages.NON_CHRONOLOGICALLY_SORTED_ENTRIES, entries.get(i - 1).getDate(), entries.get(i).getDate()); } } return entries; } private class Entry { private final T data; private final long quantum; public Entry(final T data, final long quantum) { this.quantum = quantum; this.data = data; } | /** Generate entries and check ordering.
* @param existing closest already existing entry (may be null)
* @param date date that must be covered by the range of the generated array
* (guaranteed to lie between {@link #getEarliest()} and {@link #getLatest()})
* @return chronologically sorted list of generated entries
* @exception TimeStampedCacheException if if entries are not chronologically
* sorted or if new data cannot be generated
*/ | Generate entries and check ordering | generateAndCheck | {
"repo_name": "treeform/orekit",
"path": "src/main/java/org/orekit/utils/GenericTimeStampedCache.java",
"license": "apache-2.0",
"size": 34018
} | [
"java.util.List",
"org.orekit.errors.OrekitMessages",
"org.orekit.errors.TimeStampedCacheException",
"org.orekit.time.AbsoluteDate"
] | import java.util.List; import org.orekit.errors.OrekitMessages; import org.orekit.errors.TimeStampedCacheException; import org.orekit.time.AbsoluteDate; | import java.util.*; import org.orekit.errors.*; import org.orekit.time.*; | [
"java.util",
"org.orekit.errors",
"org.orekit.time"
] | java.util; org.orekit.errors; org.orekit.time; | 136,907 |
public Node getSingleNodeValue() {
if (resultType != ANY_UNORDERED_NODE_TYPE
&& resultType != FIRST_ORDERED_NODE_TYPE) {
throw createXPathException
(XPathException.TYPE_ERR,
"xpath.invalid.result.type",
new Object[] { new Integer(resultType) });
}
return singleNodeValue;
} | Node function() { if (resultType != ANY_UNORDERED_NODE_TYPE && resultType != FIRST_ORDERED_NODE_TYPE) { throw createXPathException (XPathException.TYPE_ERR, STR, new Object[] { new Integer(resultType) }); } return singleNodeValue; } | /**
* Gets the single node value.
*/ | Gets the single node value | getSingleNodeValue | {
"repo_name": "adufilie/flex-sdk",
"path": "modules/thirdparty/batik/sources/org/apache/flex/forks/batik/dom/AbstractDocument.java",
"license": "apache-2.0",
"size": 95805
} | [
"org.w3c.dom.Node",
"org.w3c.dom.xpath.XPathException"
] | import org.w3c.dom.Node; import org.w3c.dom.xpath.XPathException; | import org.w3c.dom.*; import org.w3c.dom.xpath.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 1,088,592 |
protected String getLabel(String typeName) {
try {
return IFMLMetamodelEditPlugin.INSTANCE.getString("_UI_"
+ typeName + "_type");
} catch (MissingResourceException mre) {
IFMLMetamodelEditorPlugin.INSTANCE.log(mre);
}
return typeName;
} | String function(String typeName) { try { return IFMLMetamodelEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type"); } catch (MissingResourceException mre) { IFMLMetamodelEditorPlugin.INSTANCE.log(mre); } return typeName; } | /**
* Returns the label for the specified type name. <!-- begin-user-doc
* --> <!-- end-user-doc -->
*
* @generated
*/ | Returns the label for the specified type name. | getLabel | {
"repo_name": "ifml/ifml-editor",
"path": "plugins/IFMLEditor.editor/src/IFML/Core/presentation/CoreModelWizard.java",
"license": "mit",
"size": 25242
} | [
"java.util.MissingResourceException"
] | import java.util.MissingResourceException; | import java.util.*; | [
"java.util"
] | java.util; | 2,540,658 |
public Map<String, String> parseDeclaration(String decl) {
String rule = "ignore { " + decl + " }";
return parseRules(rule).get(0).properties;
} | Map<String, String> function(String decl) { String rule = STR + decl + STR; return parseRules(rule).get(0).properties; } | /**
* Parse a semicolon-separated list of properties, like "color:red;
* text-shadow:none"
*/ | Parse a semicolon-separated list of properties, like "color:red; text-shadow:none" | parseDeclaration | {
"repo_name": "mickleness/pumpernickel",
"path": "src/main/java/com/pump/text/html/css/CssParser.java",
"license": "mit",
"size": 10687
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,677,058 |
public List<OxAuthScope> searchScopes(String pattern, int sizeLimit) throws Exception {
Filter searchFilter = null;
if (StringHelper.isNotEmpty(pattern)) {
String[] targetArray = new String[] { pattern };
Filter displayNameFilter = Filter.createSubstringFilter(OxTrustConstants.displayName, null, targetArray, null);
Filter descriptionFilter = Filter.createSubstringFilter(OxTrustConstants.description, null, targetArray, null);
Filter inameFilter = Filter.createSubstringFilter(OxTrustConstants.iname, null, targetArray, null);
searchFilter = Filter.createORFilter(displayNameFilter, descriptionFilter, inameFilter);
}
List<OxAuthScope> result = ldapEntryManager.findEntries(getDnForScope(null), OxAuthScope.class, searchFilter, sizeLimit);
return result;
} | List<OxAuthScope> function(String pattern, int sizeLimit) throws Exception { Filter searchFilter = null; if (StringHelper.isNotEmpty(pattern)) { String[] targetArray = new String[] { pattern }; Filter displayNameFilter = Filter.createSubstringFilter(OxTrustConstants.displayName, null, targetArray, null); Filter descriptionFilter = Filter.createSubstringFilter(OxTrustConstants.description, null, targetArray, null); Filter inameFilter = Filter.createSubstringFilter(OxTrustConstants.iname, null, targetArray, null); searchFilter = Filter.createORFilter(displayNameFilter, descriptionFilter, inameFilter); } List<OxAuthScope> result = ldapEntryManager.findEntries(getDnForScope(null), OxAuthScope.class, searchFilter, sizeLimit); return result; } | /**
* Search scopes by pattern
*
* @param pattern
* Pattern
* @param sizeLimit
* Maximum count of results
* @return List of scopes
* @throws Exception
*/ | Search scopes by pattern | searchScopes | {
"repo_name": "madumlao/oxTrust",
"path": "server/src/main/java/org/gluu/oxtrust/ldap/service/ScopeService.java",
"license": "mit",
"size": 5096
} | [
"java.util.List",
"org.gluu.oxtrust.model.OxAuthScope",
"org.gluu.oxtrust.util.OxTrustConstants",
"org.gluu.search.filter.Filter",
"org.xdi.util.StringHelper"
] | import java.util.List; import org.gluu.oxtrust.model.OxAuthScope; import org.gluu.oxtrust.util.OxTrustConstants; import org.gluu.search.filter.Filter; import org.xdi.util.StringHelper; | import java.util.*; import org.gluu.oxtrust.model.*; import org.gluu.oxtrust.util.*; import org.gluu.search.filter.*; import org.xdi.util.*; | [
"java.util",
"org.gluu.oxtrust",
"org.gluu.search",
"org.xdi.util"
] | java.util; org.gluu.oxtrust; org.gluu.search; org.xdi.util; | 1,672,246 |
public Object[][] getClassSummaryDetails() {
try{
return tabularDataTo2DArray(buildClassSummaryDetails(),new String[] {
"Class Name", "Parent Class Name", "Cache Type", "Configured Size", "Current Size" });
} catch (Exception exception){
AbstractSessionLog.getLog().log(SessionLog.SEVERE, "jmx_enabled_platform_mbean_runtime_exception", PLATFORM_NAME, exception);
}
return null;
} | Object[][] function() { try{ return tabularDataTo2DArray(buildClassSummaryDetails(),new String[] { STR, STR, STR, STR, STR }); } catch (Exception exception){ AbstractSessionLog.getLog().log(SessionLog.SEVERE, STR, PLATFORM_NAME, exception); } return null; } | /**
* PUBLIC: Provide an instance of 2 Dimensional Array simulating tabular format information about all
* classes in the session.
*
* The 2 Dimensional array contains each item with values being row object array. Each row object array
* represents EclipseLink class details info with respect to below attributes:
* ["Class Name", "Parent Class Name", "Cache Type", "Configured Size", "Current Size"]
*
*/ | classes in the session. The 2 Dimensional array contains each item with values being row object array. Each row object array represents EclipseLink class details info with respect to below attributes: ["Class Name", "Parent Class Name", "Cache Type", "Configured Size", "Current Size"] | getClassSummaryDetails | {
"repo_name": "RallySoftware/eclipselink.runtime",
"path": "foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/services/RuntimeServices.java",
"license": "epl-1.0",
"size": 71352
} | [
"org.eclipse.persistence.logging.AbstractSessionLog",
"org.eclipse.persistence.logging.SessionLog"
] | import org.eclipse.persistence.logging.AbstractSessionLog; import org.eclipse.persistence.logging.SessionLog; | import org.eclipse.persistence.logging.*; | [
"org.eclipse.persistence"
] | org.eclipse.persistence; | 627,950 |
@SuppressWarnings("unchecked")
private void dupeTask(ActionEvent e) {
Task selected = ((TaskEditorTreeComponent<Task>) m_lastSelectedTreeNode.getUserObject()).getItem();
TaskList list = ((TaskEditorTreeComponent<TaskList>) m_lastParentSelectedTreeNode.getUserObject()).getItem();
new TaskPlannerController(m_model).addTask(list, new Task(selected));
} | @SuppressWarnings(STR) void function(ActionEvent e) { Task selected = ((TaskEditorTreeComponent<Task>) m_lastSelectedTreeNode.getUserObject()).getItem(); TaskList list = ((TaskEditorTreeComponent<TaskList>) m_lastParentSelectedTreeNode.getUserObject()).getItem(); new TaskPlannerController(m_model).addTask(list, new Task(selected)); } | /**
* Invoked when the user clicked on the duplicate task menuitem in the context menu
* @param e the actionevent that occured
*/ | Invoked when the user clicked on the duplicate task menuitem in the context menu | dupeTask | {
"repo_name": "MartijnTheunissen/PLNR",
"path": "src/psopv/taskplanner/views/TaskEditorTreeMouseListener.java",
"license": "gpl-2.0",
"size": 10401
} | [
"java.awt.event.ActionEvent"
] | import java.awt.event.ActionEvent; | import java.awt.event.*; | [
"java.awt"
] | java.awt; | 2,574,911 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.