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
|
|---|---|---|---|---|---|---|---|---|---|---|---|
void draw(Graphics2D graphics);
|
void draw(Graphics2D graphics);
|
/**
* Draws the animation with the given graphics. The {@link Color} and the
* {@link AffineTransform} of the graphics are not changed by this method.
*
* @param graphics
* the graphics to use for drawing
*/
|
Draws the animation with the given graphics. The <code>Color</code> and the <code>AffineTransform</code> of the graphics are not changed by this method
|
draw
|
{
"repo_name": "rapidminer/rapidminer-studio",
"path": "src/main/java/com/rapidminer/gui/animation/Animation.java",
"license": "agpl-3.0",
"size": 1682
}
|
[
"java.awt.Graphics2D"
] |
import java.awt.Graphics2D;
|
import java.awt.*;
|
[
"java.awt"
] |
java.awt;
| 1,002,327
|
public Node getNode();
|
Node function();
|
/**
* the {@link Node} information for this node.
* @return {@link Node} information for this node.
*/
|
the <code>Node</code> information for this node
|
getNode
|
{
"repo_name": "JingchengDu/hadoop",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmnode/RMNode.java",
"license": "apache-2.0",
"size": 6612
}
|
[
"org.apache.hadoop.net.Node"
] |
import org.apache.hadoop.net.Node;
|
import org.apache.hadoop.net.*;
|
[
"org.apache.hadoop"
] |
org.apache.hadoop;
| 491,132
|
public void setProcessor(Processor processor)
{
this.processor = processor;
}
|
void function(Processor processor) { this.processor = processor; }
|
/**
* Sets the processor
*
* @param processor the processor
*/
|
Sets the processor
|
setProcessor
|
{
"repo_name": "nguyentienlong/community-edition",
"path": "projects/repository/source/java/org/alfresco/repo/processor/BaseProcessorExtension.java",
"license": "lgpl-3.0",
"size": 1884
}
|
[
"org.alfresco.processor.Processor"
] |
import org.alfresco.processor.Processor;
|
import org.alfresco.processor.*;
|
[
"org.alfresco.processor"
] |
org.alfresco.processor;
| 2,384,986
|
public void destroyCurrentEquippedItem()
{
this.inventory.setInventorySlotContents(this.inventory.currentItem, (ItemStack)null);
}
|
void function() { this.inventory.setInventorySlotContents(this.inventory.currentItem, (ItemStack)null); }
|
/**
* Destroys the currently equipped item from the player's inventory.
*/
|
Destroys the currently equipped item from the player's inventory
|
destroyCurrentEquippedItem
|
{
"repo_name": "TheHecticByte/BananaJ1.7.10Beta",
"path": "src/net/minecraft/Server1_7_10/entity/player/EntityPlayer.java",
"license": "gpl-3.0",
"size": 71186
}
|
[
"net.minecraft.Server1_7_10"
] |
import net.minecraft.Server1_7_10;
|
import net.minecraft.*;
|
[
"net.minecraft"
] |
net.minecraft;
| 468,817
|
public void setProfile(Profile profile) throws SOAPException;
|
void function(Profile profile) throws SOAPException;
|
/**
* Set the Profile information for the service.
* @param profile
* @throws SOAPException
*/
|
Set the Profile information for the service
|
setProfile
|
{
"repo_name": "avadev/AvaTax-SOAP-Java-SDK",
"path": "avatax4j-accountsvc/src/com/avalara/avatax/services/base/BaseSvcSoap.java",
"license": "apache-2.0",
"size": 1715
}
|
[
"javax.xml.soap.SOAPException"
] |
import javax.xml.soap.SOAPException;
|
import javax.xml.soap.*;
|
[
"javax.xml"
] |
javax.xml;
| 1,992,651
|
@Test
public void testPreadLocalFS() throws IOException {
Configuration conf = new HdfsConfiguration();
FileSystem fileSys = FileSystem.getLocal(conf);
try {
Path file1 = new Path(GenericTestUtils.getTempPath("preadtest.dat"));
writeFile(fileSys, file1);
pReadFile(fileSys, file1);
cleanupFile(fileSys, file1);
} finally {
fileSys.close();
}
}
|
void function() throws IOException { Configuration conf = new HdfsConfiguration(); FileSystem fileSys = FileSystem.getLocal(conf); try { Path file1 = new Path(GenericTestUtils.getTempPath(STR)); writeFile(fileSys, file1); pReadFile(fileSys, file1); cleanupFile(fileSys, file1); } finally { fileSys.close(); } }
|
/**
* Tests positional read in LocalFS.
*/
|
Tests positional read in LocalFS
|
testPreadLocalFS
|
{
"repo_name": "legend-hua/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestPread.java",
"license": "apache-2.0",
"size": 20571
}
|
[
"java.io.IOException",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.test.GenericTestUtils"
] |
import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.test.GenericTestUtils;
|
import java.io.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.test.*;
|
[
"java.io",
"org.apache.hadoop"
] |
java.io; org.apache.hadoop;
| 875,759
|
public JsStatement destroy()
{
return new JsQuery(this).$().chain("datepicker", "'destroy'");
}
|
JsStatement function() { return new JsQuery(this).$().chain(STR, STR); }
|
/**
* Method to destroy the datepicker This will return the element back to its pre-init
* state.
*
* @return the associated JsStatement
*/
|
Method to destroy the datepicker This will return the element back to its pre-init state
|
destroy
|
{
"repo_name": "jijopaulose/wiquery",
"path": "wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/datepicker/DatePicker.java",
"license": "mit",
"size": 35412
}
|
[
"org.odlabs.wiquery.core.javascript.JsQuery",
"org.odlabs.wiquery.core.javascript.JsStatement"
] |
import org.odlabs.wiquery.core.javascript.JsQuery; import org.odlabs.wiquery.core.javascript.JsStatement;
|
import org.odlabs.wiquery.core.javascript.*;
|
[
"org.odlabs.wiquery"
] |
org.odlabs.wiquery;
| 1,013,041
|
public java.util.List<fr.lip6.move.pnml.hlpn.lists.hlapi.MakeListHLAPI> getSubterm_lists_MakeListHLAPI(){
java.util.List<fr.lip6.move.pnml.hlpn.lists.hlapi.MakeListHLAPI> retour = new ArrayList<fr.lip6.move.pnml.hlpn.lists.hlapi.MakeListHLAPI>();
for (Term elemnt : getSubterm()) {
if(elemnt.getClass().equals(fr.lip6.move.pnml.hlpn.lists.impl.MakeListImpl.class)){
retour.add(new fr.lip6.move.pnml.hlpn.lists.hlapi.MakeListHLAPI(
(fr.lip6.move.pnml.hlpn.lists.MakeList)elemnt
));
}
}
return retour;
}
|
java.util.List<fr.lip6.move.pnml.hlpn.lists.hlapi.MakeListHLAPI> function(){ java.util.List<fr.lip6.move.pnml.hlpn.lists.hlapi.MakeListHLAPI> retour = new ArrayList<fr.lip6.move.pnml.hlpn.lists.hlapi.MakeListHLAPI>(); for (Term elemnt : getSubterm()) { if(elemnt.getClass().equals(fr.lip6.move.pnml.hlpn.lists.impl.MakeListImpl.class)){ retour.add(new fr.lip6.move.pnml.hlpn.lists.hlapi.MakeListHLAPI( (fr.lip6.move.pnml.hlpn.lists.MakeList)elemnt )); } } return retour; }
|
/**
* This accessor return a list of encapsulated subelement, only of MakeListHLAPI kind.
* WARNING : this method can creates a lot of new object in memory.
*/
|
This accessor return a list of encapsulated subelement, only of MakeListHLAPI kind. WARNING : this method can creates a lot of new object in memory
|
getSubterm_lists_MakeListHLAPI
|
{
"repo_name": "lhillah/pnmlframework",
"path": "pnmlFw-HLPN/src/fr/lip6/move/pnml/hlpn/lists/hlapi/EmptyListHLAPI.java",
"license": "epl-1.0",
"size": 113924
}
|
[
"fr.lip6.move.pnml.hlpn.terms.Term",
"java.util.ArrayList",
"java.util.List"
] |
import fr.lip6.move.pnml.hlpn.terms.Term; import java.util.ArrayList; import java.util.List;
|
import fr.lip6.move.pnml.hlpn.terms.*; import java.util.*;
|
[
"fr.lip6.move",
"java.util"
] |
fr.lip6.move; java.util;
| 5,428
|
public final List<MockComponent> getShowingVisibleChildren() {
List<MockComponent> allChildren = getChildren();
if (allChildren.size() == 0) {
return NO_CHILDREN;
}
List<MockComponent> showingVisibleChildren = new ArrayList<MockComponent>();
for (MockComponent child : allChildren) {
if (child.isVisibleComponent() && child.showComponentInDesigner()) {
showingVisibleChildren.add(child);
}
}
return showingVisibleChildren;
}
|
final List<MockComponent> function() { List<MockComponent> allChildren = getChildren(); if (allChildren.size() == 0) { return NO_CHILDREN; } List<MockComponent> showingVisibleChildren = new ArrayList<MockComponent>(); for (MockComponent child : allChildren) { if (child.isVisibleComponent() && child.showComponentInDesigner()) { showingVisibleChildren.add(child); } } return showingVisibleChildren; }
|
/**
* Returns the visible children of this component that should be showing.
* <p>
* The returned list should not be modified.
*/
|
Returns the visible children of this component that should be showing. The returned list should not be modified
|
getShowingVisibleChildren
|
{
"repo_name": "GodUseVPN/appinventor-sources",
"path": "appinventor/appengine/src/com/google/appinventor/client/editor/simple/components/MockComponent.java",
"license": "apache-2.0",
"size": 32453
}
|
[
"java.util.ArrayList",
"java.util.List"
] |
import java.util.ArrayList; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 123,012
|
@POST
@Path("entitlements-all")
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@ApiOperation(value = "Get all entitlements for a given set of parameters",
response = AllEntitlementsResponseModel.class)
@ApiResponses(value = {
@ApiResponse(code = 200, message = "All Entitlements response",
response = AllEntitlementsResponseModel.class),
@ApiResponse(code = 40010, message = EntitlementEndpointConstants.ERROR_UNAUTHORIZED_MESSAGE,
response = ExceptionBean.class),
@ApiResponse(code = 40020, message = EntitlementEndpointConstants.ERROR_REQUEST_PARSE_MESSAGE,
response = ExceptionBean.class),
@ApiResponse(code = 40010, message = EntitlementEndpointConstants.ERROR_RESPONSE_READ_MESSAGE,
response = ExceptionBean.class)
})
public AllEntitlementsResponseModel getAllEntitlements(@ApiParam(value = "Request Media Type", required = true)
@HeaderParam(EntitlementEndpointConstants.ACCEPT_HEADER) String format,
@ApiParam(value = "Authentication Type", required = true)
@HeaderParam(EntitlementEndpointConstants.AUTHENTICATION_TYPE_HEADER) String authMechanism,
@ApiParam(value = "Add HTTP Basic Authorization", required = true)
@HeaderParam(EntitlementEndpointConstants.AUTHORIZATION_HEADER) String authorization,
@ApiParam(value = "Response Media Type", required = true)
@HeaderParam(EntitlementEndpointConstants.CONTENT_TYPE_HEADER) String contentType,
@ApiParam(value = "All Entitlements Model", required = true)
AllEntitlementsRequestModel request) {
PolicySearch policySearch = EntitlementEngine.getInstance().getPolicySearch();
EntitledResultSetDTO resultSet = policySearch.getEntitledAttributes(request.getIdentifier(), request.getGivenAttributes());
AllEntitlementsResponseModel response = new AllEntitlementsResponseModel();
response.setEntitledResultSetDTO(resultSet);
return response;
}
|
@Path(STR) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) @ApiOperation(value = STR, response = AllEntitlementsResponseModel.class) @ApiResponses(value = { @ApiResponse(code = 200, message = STR, response = AllEntitlementsResponseModel.class), @ApiResponse(code = 40010, message = EntitlementEndpointConstants.ERROR_UNAUTHORIZED_MESSAGE, response = ExceptionBean.class), @ApiResponse(code = 40020, message = EntitlementEndpointConstants.ERROR_REQUEST_PARSE_MESSAGE, response = ExceptionBean.class), @ApiResponse(code = 40010, message = EntitlementEndpointConstants.ERROR_RESPONSE_READ_MESSAGE, response = ExceptionBean.class) }) AllEntitlementsResponseModel function(@ApiParam(value = STR, required = true) @HeaderParam(EntitlementEndpointConstants.ACCEPT_HEADER) String format, @ApiParam(value = STR, required = true) @HeaderParam(EntitlementEndpointConstants.AUTHENTICATION_TYPE_HEADER) String authMechanism, @ApiParam(value = STR, required = true) @HeaderParam(EntitlementEndpointConstants.AUTHORIZATION_HEADER) String authorization, @ApiParam(value = STR, required = true) @HeaderParam(EntitlementEndpointConstants.CONTENT_TYPE_HEADER) String contentType, @ApiParam(value = STR, required = true) AllEntitlementsRequestModel request) { PolicySearch policySearch = EntitlementEngine.getInstance().getPolicySearch(); EntitledResultSetDTO resultSet = policySearch.getEntitledAttributes(request.getIdentifier(), request.getGivenAttributes()); AllEntitlementsResponseModel response = new AllEntitlementsResponseModel(); response.setEntitledResultSetDTO(resultSet); return response; }
|
/**
* API endpoint for returning all entitlements for a given set of parameters
*
* @return AllEntitlementResponseModel object
*/
|
API endpoint for returning all entitlements for a given set of parameters
|
getAllEntitlements
|
{
"repo_name": "nuwandi-is/identity-framework",
"path": "components/entitlement/org.wso2.carbon.identity.entitlement.endpoint/src/main/java/org/wso2/carbon/identity/entitlement/endpoint/resources/DecisionResource.java",
"license": "apache-2.0",
"size": 17909
}
|
[
"io.swagger.annotations.ApiOperation",
"io.swagger.annotations.ApiParam",
"io.swagger.annotations.ApiResponse",
"io.swagger.annotations.ApiResponses",
"javax.ws.rs.Consumes",
"javax.ws.rs.HeaderParam",
"javax.ws.rs.Path",
"javax.ws.rs.Produces",
"javax.ws.rs.core.MediaType",
"org.wso2.carbon.identity.entitlement.dto.EntitledResultSetDTO",
"org.wso2.carbon.identity.entitlement.endpoint.exception.ExceptionBean",
"org.wso2.carbon.identity.entitlement.endpoint.resources.models.AllEntitlementsRequestModel",
"org.wso2.carbon.identity.entitlement.endpoint.resources.models.AllEntitlementsResponseModel",
"org.wso2.carbon.identity.entitlement.endpoint.util.EntitlementEndpointConstants",
"org.wso2.carbon.identity.entitlement.pdp.EntitlementEngine",
"org.wso2.carbon.identity.entitlement.policy.search.PolicySearch"
] |
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; import javax.ws.rs.Consumes; import javax.ws.rs.HeaderParam; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import org.wso2.carbon.identity.entitlement.dto.EntitledResultSetDTO; import org.wso2.carbon.identity.entitlement.endpoint.exception.ExceptionBean; import org.wso2.carbon.identity.entitlement.endpoint.resources.models.AllEntitlementsRequestModel; import org.wso2.carbon.identity.entitlement.endpoint.resources.models.AllEntitlementsResponseModel; import org.wso2.carbon.identity.entitlement.endpoint.util.EntitlementEndpointConstants; import org.wso2.carbon.identity.entitlement.pdp.EntitlementEngine; import org.wso2.carbon.identity.entitlement.policy.search.PolicySearch;
|
import io.swagger.annotations.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import org.wso2.carbon.identity.entitlement.dto.*; import org.wso2.carbon.identity.entitlement.endpoint.exception.*; import org.wso2.carbon.identity.entitlement.endpoint.resources.models.*; import org.wso2.carbon.identity.entitlement.endpoint.util.*; import org.wso2.carbon.identity.entitlement.pdp.*; import org.wso2.carbon.identity.entitlement.policy.search.*;
|
[
"io.swagger.annotations",
"javax.ws",
"org.wso2.carbon"
] |
io.swagger.annotations; javax.ws; org.wso2.carbon;
| 1,900,612
|
public void createMaterialZoneTemplate(Spatial geometry, int worldId, int materialId, boolean failOnMissing) {
ZoneName zoneName = null;
if (failOnMissing)
zoneName = ZoneName.get(geometry.getName() + "_" + worldId);
else
zoneName = ZoneName.createOrGet(geometry.getName() + "_" + worldId);
if (zoneName.name().equals(ZoneName.NONE))
return;
ZoneHandler handler = collidableHandlers.get(zoneName);
if (handler == null) {
if (materialId == 11) {
if (GeoDataConfig.GEO_SHIELDS_ENABLE) {
handler = new SiegeShield(geometry);
ShieldService.getInstance().registerShield(worldId, (SiegeShield) handler);
}
else
return;
}
else {
MaterialTemplate template = DataManager.MATERIAL_DATA.getTemplate(materialId);
if (template == null)
return;
handler = new MaterialZoneHandler(geometry, template);
}
collidableHandlers.put(zoneName, handler);
}
Collection<ZoneInfo> areas = this.zoneByMapIdMap.get(worldId);
if (areas == null) {
this.zoneByMapIdMap.put(worldId, new ArrayList<ZoneInfo>());
areas = this.zoneByMapIdMap.get(worldId);
}
ZoneInfo zoneInfo = null;
for (ZoneInfo area : areas) {
if (area.getZoneTemplate().getName().equals(zoneName)) {
zoneInfo = area;
break;
}
}
if (zoneInfo == null) {
MaterialZoneTemplate zoneTemplate = new MaterialZoneTemplate(geometry, worldId);
// maybe add to zone data if needed search ?
Area zoneInfoArea = null;
if (zoneTemplate.getSphere() != null) {
zoneInfoArea = new SphereArea(zoneName, worldId, zoneTemplate.getSphere().getX(), zoneTemplate.getSphere().getY(), zoneTemplate
.getSphere().getZ(), zoneTemplate.getSphere().getR());
}
else if (zoneTemplate.getCylinder() != null) {
zoneInfoArea = new CylinderArea(zoneName, worldId, zoneTemplate.getCylinder().getX(), zoneTemplate.getCylinder().getY(),
zoneTemplate.getCylinder().getR(), zoneTemplate.getCylinder().getBottom(), zoneTemplate.getCylinder().getTop());
}
else if (zoneTemplate.getSemisphere() != null) {
zoneInfoArea = new SemisphereArea(zoneName, worldId, zoneTemplate.getSemisphere().getX(), zoneTemplate.getSemisphere().getY(),
zoneTemplate.getSemisphere().getZ(), zoneTemplate.getSemisphere().getR());
}
if (zoneInfoArea != null) {
zoneInfo = new ZoneInfo(zoneInfoArea, zoneTemplate);
areas.add(zoneInfo);
}
}
}
|
void function(Spatial geometry, int worldId, int materialId, boolean failOnMissing) { ZoneName zoneName = null; if (failOnMissing) zoneName = ZoneName.get(geometry.getName() + "_" + worldId); else zoneName = ZoneName.createOrGet(geometry.getName() + "_" + worldId); if (zoneName.name().equals(ZoneName.NONE)) return; ZoneHandler handler = collidableHandlers.get(zoneName); if (handler == null) { if (materialId == 11) { if (GeoDataConfig.GEO_SHIELDS_ENABLE) { handler = new SiegeShield(geometry); ShieldService.getInstance().registerShield(worldId, (SiegeShield) handler); } else return; } else { MaterialTemplate template = DataManager.MATERIAL_DATA.getTemplate(materialId); if (template == null) return; handler = new MaterialZoneHandler(geometry, template); } collidableHandlers.put(zoneName, handler); } Collection<ZoneInfo> areas = this.zoneByMapIdMap.get(worldId); if (areas == null) { this.zoneByMapIdMap.put(worldId, new ArrayList<ZoneInfo>()); areas = this.zoneByMapIdMap.get(worldId); } ZoneInfo zoneInfo = null; for (ZoneInfo area : areas) { if (area.getZoneTemplate().getName().equals(zoneName)) { zoneInfo = area; break; } } if (zoneInfo == null) { MaterialZoneTemplate zoneTemplate = new MaterialZoneTemplate(geometry, worldId); Area zoneInfoArea = null; if (zoneTemplate.getSphere() != null) { zoneInfoArea = new SphereArea(zoneName, worldId, zoneTemplate.getSphere().getX(), zoneTemplate.getSphere().getY(), zoneTemplate .getSphere().getZ(), zoneTemplate.getSphere().getR()); } else if (zoneTemplate.getCylinder() != null) { zoneInfoArea = new CylinderArea(zoneName, worldId, zoneTemplate.getCylinder().getX(), zoneTemplate.getCylinder().getY(), zoneTemplate.getCylinder().getR(), zoneTemplate.getCylinder().getBottom(), zoneTemplate.getCylinder().getTop()); } else if (zoneTemplate.getSemisphere() != null) { zoneInfoArea = new SemisphereArea(zoneName, worldId, zoneTemplate.getSemisphere().getX(), zoneTemplate.getSemisphere().getY(), zoneTemplate.getSemisphere().getZ(), zoneTemplate.getSemisphere().getR()); } if (zoneInfoArea != null) { zoneInfo = new ZoneInfo(zoneInfoArea, zoneTemplate); areas.add(zoneInfo); } } }
|
/**
* Method for single instances of meshes (if specified in mesh_materials.xml)
*
* @param geometry
* @param worldId
* @param materialId
*/
|
Method for single instances of meshes (if specified in mesh_materials.xml)
|
createMaterialZoneTemplate
|
{
"repo_name": "Estada1401/anuwhscript",
"path": "GameServer/src/com/aionemu/gameserver/world/zone/ZoneService.java",
"license": "gpl-3.0",
"size": 14310
}
|
[
"com.aionemu.gameserver.configs.main.GeoDataConfig",
"com.aionemu.gameserver.dataholders.DataManager",
"com.aionemu.gameserver.geoEngine.scene.Spatial",
"com.aionemu.gameserver.model.geometry.Area",
"com.aionemu.gameserver.model.geometry.CylinderArea",
"com.aionemu.gameserver.model.geometry.SemisphereArea",
"com.aionemu.gameserver.model.geometry.SphereArea",
"com.aionemu.gameserver.model.siege.SiegeShield",
"com.aionemu.gameserver.model.templates.materials.MaterialTemplate",
"com.aionemu.gameserver.model.templates.zone.MaterialZoneTemplate",
"com.aionemu.gameserver.model.templates.zone.ZoneInfo",
"com.aionemu.gameserver.services.ShieldService",
"com.aionemu.gameserver.world.zone.handler.MaterialZoneHandler",
"com.aionemu.gameserver.world.zone.handler.ZoneHandler",
"java.util.ArrayList",
"java.util.Collection"
] |
import com.aionemu.gameserver.configs.main.GeoDataConfig; import com.aionemu.gameserver.dataholders.DataManager; import com.aionemu.gameserver.geoEngine.scene.Spatial; import com.aionemu.gameserver.model.geometry.Area; import com.aionemu.gameserver.model.geometry.CylinderArea; import com.aionemu.gameserver.model.geometry.SemisphereArea; import com.aionemu.gameserver.model.geometry.SphereArea; import com.aionemu.gameserver.model.siege.SiegeShield; import com.aionemu.gameserver.model.templates.materials.MaterialTemplate; import com.aionemu.gameserver.model.templates.zone.MaterialZoneTemplate; import com.aionemu.gameserver.model.templates.zone.ZoneInfo; import com.aionemu.gameserver.services.ShieldService; import com.aionemu.gameserver.world.zone.handler.MaterialZoneHandler; import com.aionemu.gameserver.world.zone.handler.ZoneHandler; import java.util.ArrayList; import java.util.Collection;
|
import com.aionemu.gameserver.*; import com.aionemu.gameserver.configs.main.*; import com.aionemu.gameserver.dataholders.*; import com.aionemu.gameserver.model.geometry.*; import com.aionemu.gameserver.model.siege.*; import com.aionemu.gameserver.model.templates.materials.*; import com.aionemu.gameserver.model.templates.zone.*; import com.aionemu.gameserver.services.*; import com.aionemu.gameserver.world.zone.handler.*; import java.util.*;
|
[
"com.aionemu.gameserver",
"java.util"
] |
com.aionemu.gameserver; java.util;
| 2,180,413
|
boolean resetRecovery(CancellableThreads newTargetCancellableThreads) throws IOException {
if (finished.compareAndSet(false, true)) {
try {
logger.debug("reset of recovery with shard {} and id [{}]", shardId, recoveryId);
} finally {
// release the initial reference. recovery files will be cleaned as soon as ref count goes to zero, potentially now.
decRef();
}
try {
newTargetCancellableThreads.execute(closedLatch::await);
} catch (CancellableThreads.ExecutionCancelledException e) {
logger.trace("new recovery target cancelled for shard {} while waiting on old recovery target with id [{}] to close",
shardId, recoveryId);
return false;
}
RecoveryState.Stage stage = indexShard.recoveryState().getStage();
if (indexShard.recoveryState().getPrimary() && (stage == RecoveryState.Stage.FINALIZE || stage == RecoveryState.Stage.DONE)) {
// once primary relocation has moved past the finalization step, the relocation source can be moved to RELOCATED state
// and start indexing as primary into the target shard (see TransportReplicationAction). Resetting the target shard in this
// state could mean that indexing is halted until the recovery retry attempt is completed and could also destroy existing
// documents indexed and acknowledged before the reset.
assert stage != RecoveryState.Stage.DONE : "recovery should not have completed when it's being reset";
throw new IllegalStateException("cannot reset recovery as previous attempt made it past finalization step");
}
indexShard.performRecoveryRestart();
return true;
}
return false;
}
/**
* cancel the recovery. calling this method will clean temporary files and release the store
* unless this object is in use (in which case it will be cleaned once all ongoing users call
* {@link #decRef()}
|
boolean resetRecovery(CancellableThreads newTargetCancellableThreads) throws IOException { if (finished.compareAndSet(false, true)) { try { logger.debug(STR, shardId, recoveryId); } finally { decRef(); } try { newTargetCancellableThreads.execute(closedLatch::await); } catch (CancellableThreads.ExecutionCancelledException e) { logger.trace(STR, shardId, recoveryId); return false; } RecoveryState.Stage stage = indexShard.recoveryState().getStage(); if (indexShard.recoveryState().getPrimary() && (stage == RecoveryState.Stage.FINALIZE stage == RecoveryState.Stage.DONE)) { assert stage != RecoveryState.Stage.DONE : STR; throw new IllegalStateException(STR); } indexShard.performRecoveryRestart(); return true; } return false; } /** * cancel the recovery. calling this method will clean temporary files and release the store * unless this object is in use (in which case it will be cleaned once all ongoing users call * {@link #decRef()}
|
/**
* Closes the current recovery target and waits up to a certain timeout for resources to be freed.
* Returns true if resetting the recovery was successful, false if the recovery target is already cancelled / failed or marked as done.
*/
|
Closes the current recovery target and waits up to a certain timeout for resources to be freed. Returns true if resetting the recovery was successful, false if the recovery target is already cancelled / failed or marked as done
|
resetRecovery
|
{
"repo_name": "qwerty4030/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/indices/recovery/RecoveryTarget.java",
"license": "apache-2.0",
"size": 22785
}
|
[
"java.io.IOException",
"org.elasticsearch.common.util.CancellableThreads"
] |
import java.io.IOException; import org.elasticsearch.common.util.CancellableThreads;
|
import java.io.*; import org.elasticsearch.common.util.*;
|
[
"java.io",
"org.elasticsearch.common"
] |
java.io; org.elasticsearch.common;
| 2,086,430
|
void onNodeSelected(ImageDisplay newNode, Set<ImageDisplay> nodes)
{
if (newNode == null) return;
rootDisplay.setTitle(currentPathString(newNode));
//paint the nodes
List<ImageDisplay> selected = new ArrayList<ImageDisplay>();
selected.add(newNode);
if (isMultiSelection() || nodes == null)
setNodesColor(selected, null);
else setNodesColor(selected, nodes);
}
|
void onNodeSelected(ImageDisplay newNode, Set<ImageDisplay> nodes) { if (newNode == null) return; rootDisplay.setTitle(currentPathString(newNode)); List<ImageDisplay> selected = new ArrayList<ImageDisplay>(); selected.add(newNode); if (isMultiSelection() nodes == null) setNodesColor(selected, null); else setNodesColor(selected, nodes); }
|
/**
* Sets the title and the color of the selected node.
*
* @param newNode The selected node.
* @param nodes The previously selected nodes.
*/
|
Sets the title and the color of the selected node
|
onNodeSelected
|
{
"repo_name": "simleo/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/agents/dataBrowser/browser/BrowserModel.java",
"license": "gpl-2.0",
"size": 28381
}
|
[
"java.util.ArrayList",
"java.util.List",
"java.util.Set"
] |
import java.util.ArrayList; import java.util.List; import java.util.Set;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,083,277
|
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable<AppServiceCertificateResourceInner> listCertificates(
String resourceGroupName, String certificateOrderName, Context context) {
return new PagedIterable<>(listCertificatesAsync(resourceGroupName, certificateOrderName, context));
}
|
@ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable<AppServiceCertificateResourceInner> function( String resourceGroupName, String certificateOrderName, Context context) { return new PagedIterable<>(listCertificatesAsync(resourceGroupName, certificateOrderName, context)); }
|
/**
* List all certificates associated with a certificate order.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param certificateOrderName Name of the certificate order.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return collection of certificate order certificates.
*/
|
List all certificates associated with a certificate order
|
listCertificates
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceCertificateOrdersClientImpl.java",
"license": "mit",
"size": 205075
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.PagedIterable",
"com.azure.core.util.Context",
"com.azure.resourcemanager.appservice.fluent.models.AppServiceCertificateResourceInner"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.resourcemanager.appservice.fluent.models.AppServiceCertificateResourceInner;
|
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.appservice.fluent.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 1,360,407
|
long[] getRequiredBundles(long bundleIdentifier) throws IOException;
|
long[] getRequiredBundles(long bundleIdentifier) throws IOException;
|
/**
* Answer an array of ids of bundles the given bundle depends on.
*
* @param bundleIdentifier the bundle identifier to find the dependencies
* for
* @return the bundle identifiers of the dependencies
* @throws IOException if the operation fails
* @throws IllegalArgumentException if the bundle indicated does not exist
*/
|
Answer an array of ids of bundles the given bundle depends on
|
getRequiredBundles
|
{
"repo_name": "eclipse/gemini.managment",
"path": "org.eclipse.gemini.management/src/main/java/org/osgi/jmx/framework/BundleStateMBean.java",
"license": "apache-2.0",
"size": 26526
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 616,601
|
protected Node exitDefinedValue(Production node)
throws ParseException {
return node;
}
|
Node function(Production node) throws ParseException { return node; }
|
/**
* Called when exiting a parse tree node.
*
* @param node the node being exited
*
* @return the node to add to the parse tree, or
* null if no parse tree should be created
*
* @throws ParseException if the node analysis discovered errors
*/
|
Called when exiting a parse tree node
|
exitDefinedValue
|
{
"repo_name": "richb-hanover/mibble-2.9.2",
"path": "src/java/net/percederberg/mibble/asn1/Asn1Analyzer.java",
"license": "gpl-2.0",
"size": 275483
}
|
[
"net.percederberg.grammatica.parser.Node",
"net.percederberg.grammatica.parser.ParseException",
"net.percederberg.grammatica.parser.Production"
] |
import net.percederberg.grammatica.parser.Node; import net.percederberg.grammatica.parser.ParseException; import net.percederberg.grammatica.parser.Production;
|
import net.percederberg.grammatica.parser.*;
|
[
"net.percederberg.grammatica"
] |
net.percederberg.grammatica;
| 447,712
|
Collection<ClusterNode> aliveServerNodesWithCaches(final long topVer) {
return filter(topVer, aliveSrvNodesWithCaches);
}
|
Collection<ClusterNode> aliveServerNodesWithCaches(final long topVer) { return filter(topVer, aliveSrvNodesWithCaches); }
|
/**
* Gets all alive server nodes with at least one cache configured.
*
* @param topVer Topology version.
* @return Collection of nodes.
*/
|
Gets all alive server nodes with at least one cache configured
|
aliveServerNodesWithCaches
|
{
"repo_name": "agoncharuk/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java",
"license": "apache-2.0",
"size": 104025
}
|
[
"java.util.Collection",
"org.apache.ignite.cluster.ClusterNode"
] |
import java.util.Collection; import org.apache.ignite.cluster.ClusterNode;
|
import java.util.*; import org.apache.ignite.cluster.*;
|
[
"java.util",
"org.apache.ignite"
] |
java.util; org.apache.ignite;
| 1,709,233
|
public boolean isInGroup(Group group) {
return isInGroup(group, "global");
}
|
boolean function(Group group) { return isInGroup(group, STR); }
|
/**
* Check to see if the user is a member of a group
* @param group The group to check membership of
* @return true if the user is a member of the group
*/
|
Check to see if the user is a member of a group
|
isInGroup
|
{
"repo_name": "Boomclaw/LuckPerms",
"path": "common/src/main/java/me/lucko/luckperms/users/User.java",
"license": "mit",
"size": 12805
}
|
[
"me.lucko.luckperms.groups.Group"
] |
import me.lucko.luckperms.groups.Group;
|
import me.lucko.luckperms.groups.*;
|
[
"me.lucko.luckperms"
] |
me.lucko.luckperms;
| 2,707,607
|
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<IdentifierInner> listSiteIdentifiersAssignedToHostname();
|
@ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable<IdentifierInner> listSiteIdentifiersAssignedToHostname();
|
/**
* Description for List all apps that are assigned to a hostname.
*
* @throws com.azure.resourcemanager.appservice.models.DefaultErrorResponseErrorException thrown if the request is
* rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return collection of identifiers.
*/
|
Description for List all apps that are assigned to a hostname
|
listSiteIdentifiersAssignedToHostname
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/ResourceProvidersClient.java",
"license": "mit",
"size": 46577
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.PagedIterable",
"com.azure.resourcemanager.appservice.fluent.models.IdentifierInner"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.resourcemanager.appservice.fluent.models.IdentifierInner;
|
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.resourcemanager.appservice.fluent.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 1,824,560
|
@Override
public void addRole(Role role) {
synchronized (roles) {
if (!roles.contains(role)) {
roles.add(role);
}
}
}
|
void function(Role role) { synchronized (roles) { if (!roles.contains(role)) { roles.add(role); } } }
|
/**
* Add a new {@link Role} to those assigned specifically to this user.
*
* @param role The new role
*/
|
Add a new <code>Role</code> to those assigned specifically to this user
|
addRole
|
{
"repo_name": "pistolove/sourcecode4junit",
"path": "Source4Tomcat/src/org/apache/catalina/users/MemoryUser.java",
"license": "apache-2.0",
"size": 9302
}
|
[
"org.apache.catalina.Role"
] |
import org.apache.catalina.Role;
|
import org.apache.catalina.*;
|
[
"org.apache.catalina"
] |
org.apache.catalina;
| 614,008
|
public static void makeDefaultPhone(Context context) {
synchronized(Phone.class) {
if (!sMadeDefaults) {
sLooper = Looper.myLooper();
sContext = context;
if (sLooper == null) {
throw new RuntimeException(
"PhoneFactory.makeDefaultPhone must be called from Looper thread");
}
int retryCount = 0;
for(;;) {
boolean hasException = false;
retryCount ++;
try {
// use UNIX domain socket to
// prevent subsequent initialization
new LocalServerSocket("com.android.internal.telephony");
} catch (java.io.IOException ex) {
hasException = true;
}
if ( !hasException ) {
break;
} else if (retryCount > SOCKET_OPEN_MAX_RETRY) {
throw new RuntimeException("PhoneFactory probably already running");
} else {
try {
Thread.sleep(SOCKET_OPEN_RETRY_MILLIS);
} catch (InterruptedException er) {
}
}
}
sPhoneNotifier = new DefaultPhoneNotifier();
//Get preferredNetworkMode from Settings.System
int networkMode = Settings.Secure.getInt(context.getContentResolver(),
Settings.Secure.PREFERRED_NETWORK_MODE, preferredNetworkMode);
Log.i(LOG_TAG, "Network Mode set to " + Integer.toString(networkMode));
//Get preferredNetworkMode from Settings.System
int cdmaSubscription = Settings.Secure.getInt(context.getContentResolver(),
Settings.Secure.PREFERRED_CDMA_SUBSCRIPTION, preferredCdmaSubscription);
Log.i(LOG_TAG, "Cdma Subscription set to " + Integer.toString(cdmaSubscription));
//reads the system properties and makes commandsinterface
sCommandsInterface = new RIL(context, networkMode, cdmaSubscription);
int phoneType = getPhoneType(networkMode);
if (phoneType == Phone.PHONE_TYPE_GSM) {
Log.i(LOG_TAG, "Creating GSMPhone");
sProxyPhone = new PhoneProxy(new GSMPhone(context,
sCommandsInterface, sPhoneNotifier));
} else if (phoneType == Phone.PHONE_TYPE_CDMA) {
Log.i(LOG_TAG, "Creating CDMAPhone");
sProxyPhone = new PhoneProxy(new CDMAPhone(context,
sCommandsInterface, sPhoneNotifier));
}
sMadeDefaults = true;
}
}
}
|
static void function(Context context) { synchronized(Phone.class) { if (!sMadeDefaults) { sLooper = Looper.myLooper(); sContext = context; if (sLooper == null) { throw new RuntimeException( STR); } int retryCount = 0; for(;;) { boolean hasException = false; retryCount ++; try { new LocalServerSocket(STR); } catch (java.io.IOException ex) { hasException = true; } if ( !hasException ) { break; } else if (retryCount > SOCKET_OPEN_MAX_RETRY) { throw new RuntimeException(STR); } else { try { Thread.sleep(SOCKET_OPEN_RETRY_MILLIS); } catch (InterruptedException er) { } } } sPhoneNotifier = new DefaultPhoneNotifier(); int networkMode = Settings.Secure.getInt(context.getContentResolver(), Settings.Secure.PREFERRED_NETWORK_MODE, preferredNetworkMode); Log.i(LOG_TAG, STR + Integer.toString(networkMode)); int cdmaSubscription = Settings.Secure.getInt(context.getContentResolver(), Settings.Secure.PREFERRED_CDMA_SUBSCRIPTION, preferredCdmaSubscription); Log.i(LOG_TAG, STR + Integer.toString(cdmaSubscription)); sCommandsInterface = new RIL(context, networkMode, cdmaSubscription); int phoneType = getPhoneType(networkMode); if (phoneType == Phone.PHONE_TYPE_GSM) { Log.i(LOG_TAG, STR); sProxyPhone = new PhoneProxy(new GSMPhone(context, sCommandsInterface, sPhoneNotifier)); } else if (phoneType == Phone.PHONE_TYPE_CDMA) { Log.i(LOG_TAG, STR); sProxyPhone = new PhoneProxy(new CDMAPhone(context, sCommandsInterface, sPhoneNotifier)); } sMadeDefaults = true; } } }
|
/**
* FIXME replace this with some other way of making these
* instances
*/
|
FIXME replace this with some other way of making these instances
|
makeDefaultPhone
|
{
"repo_name": "mateor/PDroidHistory",
"path": "frameworks/base/telephony/java/com/android/internal/telephony/PhoneFactory.java",
"license": "gpl-3.0",
"size": 6925
}
|
[
"android.content.Context",
"android.net.LocalServerSocket",
"android.os.Looper",
"android.provider.Settings",
"android.util.Log",
"com.android.internal.telephony.cdma.CDMAPhone",
"com.android.internal.telephony.gsm.GSMPhone"
] |
import android.content.Context; import android.net.LocalServerSocket; import android.os.Looper; import android.provider.Settings; import android.util.Log; import com.android.internal.telephony.cdma.CDMAPhone; import com.android.internal.telephony.gsm.GSMPhone;
|
import android.content.*; import android.net.*; import android.os.*; import android.provider.*; import android.util.*; import com.android.internal.telephony.cdma.*; import com.android.internal.telephony.gsm.*;
|
[
"android.content",
"android.net",
"android.os",
"android.provider",
"android.util",
"com.android.internal"
] |
android.content; android.net; android.os; android.provider; android.util; com.android.internal;
| 475,305
|
public void toggleFullscreen()
{
try
{
fullscreen = !fullscreen;
if (fullscreen)
{
Display.setDisplayMode(Display.getDesktopDisplayMode());
displayWidth = Display.getDisplayMode().getWidth();
displayHeight = Display.getDisplayMode().getHeight();
if (displayWidth <= 0)
{
displayWidth = 1;
}
if (displayHeight <= 0)
{
displayHeight = 1;
}
}
else
{
if (mcCanvas != null)
{
displayWidth = mcCanvas.getWidth();
displayHeight = mcCanvas.getHeight();
}
else
{
displayWidth = tempDisplayWidth;
displayHeight = tempDisplayHeight;
}
if (displayWidth <= 0)
{
displayWidth = 1;
}
if (displayHeight <= 0)
{
displayHeight = 1;
}
}
if (currentScreen != null)
{
resize(displayWidth, displayHeight);
}
Display.setFullscreen(fullscreen);
Display.update();
}
catch (Exception exception)
{
exception.printStackTrace();
}
}
|
void function() { try { fullscreen = !fullscreen; if (fullscreen) { Display.setDisplayMode(Display.getDesktopDisplayMode()); displayWidth = Display.getDisplayMode().getWidth(); displayHeight = Display.getDisplayMode().getHeight(); if (displayWidth <= 0) { displayWidth = 1; } if (displayHeight <= 0) { displayHeight = 1; } } else { if (mcCanvas != null) { displayWidth = mcCanvas.getWidth(); displayHeight = mcCanvas.getHeight(); } else { displayWidth = tempDisplayWidth; displayHeight = tempDisplayHeight; } if (displayWidth <= 0) { displayWidth = 1; } if (displayHeight <= 0) { displayHeight = 1; } } if (currentScreen != null) { resize(displayWidth, displayHeight); } Display.setFullscreen(fullscreen); Display.update(); } catch (Exception exception) { exception.printStackTrace(); } }
|
/**
* Toggles fullscreen mode.
*/
|
Toggles fullscreen mode
|
toggleFullscreen
|
{
"repo_name": "sethten/MoDesserts",
"path": "mcp50/src/minecraft/net/minecraft/client/Minecraft.java",
"license": "gpl-3.0",
"size": 82916
}
|
[
"org.lwjgl.opengl.Display"
] |
import org.lwjgl.opengl.Display;
|
import org.lwjgl.opengl.*;
|
[
"org.lwjgl.opengl"
] |
org.lwjgl.opengl;
| 1,802,910
|
@SuppressWarnings("unchecked")
@Test
public void testAggregatorSimple() {
PublishSubject<String> r1 = PublishSubject.create();
PublishSubject<String> r2 = PublishSubject.create();
Observer<String> observer = mock(Observer.class);
Observable.zip(r1, r2, zipr2).subscribe(observer);
r1.onNext("hello");
r2.onNext("world");
InOrder inOrder = inOrder(observer);
verify(observer, never()).onError(any(Throwable.class));
verify(observer, never()).onCompleted();
inOrder.verify(observer, times(1)).onNext("helloworld");
r1.onNext("hello ");
r2.onNext("again");
verify(observer, never()).onError(any(Throwable.class));
verify(observer, never()).onCompleted();
inOrder.verify(observer, times(1)).onNext("hello again");
r1.onCompleted();
r2.onCompleted();
inOrder.verify(observer, never()).onNext(anyString());
verify(observer, times(1)).onCompleted();
}
|
@SuppressWarnings(STR) void function() { PublishSubject<String> r1 = PublishSubject.create(); PublishSubject<String> r2 = PublishSubject.create(); Observer<String> observer = mock(Observer.class); Observable.zip(r1, r2, zipr2).subscribe(observer); r1.onNext("hello"); r2.onNext("world"); InOrder inOrder = inOrder(observer); verify(observer, never()).onError(any(Throwable.class)); verify(observer, never()).onCompleted(); inOrder.verify(observer, times(1)).onNext(STR); r1.onNext(STR); r2.onNext("again"); verify(observer, never()).onError(any(Throwable.class)); verify(observer, never()).onCompleted(); inOrder.verify(observer, times(1)).onNext(STR); r1.onCompleted(); r2.onCompleted(); inOrder.verify(observer, never()).onNext(anyString()); verify(observer, times(1)).onCompleted(); }
|
/**
* Testing internal private logic due to the complexity so I want to use TDD to test as a I build it rather than relying purely on the overall functionality expected by the public methods.
*/
|
Testing internal private logic due to the complexity so I want to use TDD to test as a I build it rather than relying purely on the overall functionality expected by the public methods
|
testAggregatorSimple
|
{
"repo_name": "marcogarcia23/RxJava",
"path": "src/test/java/rx/internal/operators/OperatorZipTest.java",
"license": "apache-2.0",
"size": 45375
}
|
[
"org.mockito.InOrder",
"org.mockito.Mockito"
] |
import org.mockito.InOrder; import org.mockito.Mockito;
|
import org.mockito.*;
|
[
"org.mockito"
] |
org.mockito;
| 2,091,952
|
public synchronized static Collection<Class<? extends Parent>> getClassesSupportingWrapping() {
if (classesSupportingWrapping == null) {
classesSupportingWrapping = new ArrayList<>();
classesSupportingWrapping.add(javafx.scene.layout.AnchorPane.class);
classesSupportingWrapping.add(javafx.scene.layout.GridPane.class);
classesSupportingWrapping.add(javafx.scene.Group.class);
classesSupportingWrapping.add(javafx.scene.layout.HBox.class);
classesSupportingWrapping.add(javafx.scene.layout.Pane.class);
classesSupportingWrapping.add(javafx.scene.control.ScrollPane.class);
classesSupportingWrapping.add(javafx.scene.control.SplitPane.class);
classesSupportingWrapping.add(javafx.scene.layout.StackPane.class);
classesSupportingWrapping.add(javafx.scene.control.TabPane.class);
classesSupportingWrapping.add(javafx.scene.control.TitledPane.class);
classesSupportingWrapping.add(javafx.scene.control.ToolBar.class);
classesSupportingWrapping.add(javafx.scene.layout.VBox.class);
classesSupportingWrapping = Collections.unmodifiableList(classesSupportingWrapping);
}
return classesSupportingWrapping;
}
|
synchronized static Collection<Class<? extends Parent>> function() { if (classesSupportingWrapping == null) { classesSupportingWrapping = new ArrayList<>(); classesSupportingWrapping.add(javafx.scene.layout.AnchorPane.class); classesSupportingWrapping.add(javafx.scene.layout.GridPane.class); classesSupportingWrapping.add(javafx.scene.Group.class); classesSupportingWrapping.add(javafx.scene.layout.HBox.class); classesSupportingWrapping.add(javafx.scene.layout.Pane.class); classesSupportingWrapping.add(javafx.scene.control.ScrollPane.class); classesSupportingWrapping.add(javafx.scene.control.SplitPane.class); classesSupportingWrapping.add(javafx.scene.layout.StackPane.class); classesSupportingWrapping.add(javafx.scene.control.TabPane.class); classesSupportingWrapping.add(javafx.scene.control.TitledPane.class); classesSupportingWrapping.add(javafx.scene.control.ToolBar.class); classesSupportingWrapping.add(javafx.scene.layout.VBox.class); classesSupportingWrapping = Collections.unmodifiableList(classesSupportingWrapping); } return classesSupportingWrapping; }
|
/**
* Return the list of classes that can be passed to
* {@link EditorController#performWrap(java.lang.Class)}.
*
* @return the list of classes.
*/
|
Return the list of classes that can be passed to <code>EditorController#performWrap(java.lang.Class)</code>
|
getClassesSupportingWrapping
|
{
"repo_name": "maiklos-mirrors/jfx78",
"path": "apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/EditorController.java",
"license": "gpl-2.0",
"size": 68314
}
|
[
"java.util.ArrayList",
"java.util.Collection",
"java.util.Collections"
] |
import java.util.ArrayList; import java.util.Collection; import java.util.Collections;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,693,829
|
private void mdfft(MultiDimensionalComplexMatrix mdcm, boolean forward,
int d, int[] subVector)
throws IllegalArgumentException {
int[] dimensionSize = mdcm.getDimensionSizes();
//if done
if (subVector.length == dimensionSize.length) {
Complex[] temp = new Complex[dimensionSize[d]];
for (int i = 0; i < dimensionSize[d]; i++) {
//fft along dimension d
subVector[d] = i;
temp[i] = mdcm.get(subVector);
}
if (forward)
temp = transform2(temp);
else
temp = inversetransform2(temp);
for (int i = 0; i < dimensionSize[d]; i++) {
subVector[d] = i;
mdcm.set(temp[i], subVector);
}
} else {
int[] vector = new int[subVector.length + 1];
System.arraycopy(subVector, 0, vector, 0, subVector.length);
if (subVector.length == d) {
//value is not important once the recursion is done.
//then an fft will be applied along the dimension d.
vector[d] = 0;
mdfft(mdcm, forward, d, vector);
} else {
for (int i = 0; i < dimensionSize[subVector.length]; i++) {
vector[subVector.length] = i;
//further split along the next dimension
mdfft(mdcm, forward, d, vector);
}
}
}
return;
}
private static class MultiDimensionalComplexMatrix
implements Cloneable {
protected int[] dimensionSize;
protected Object multiDimensionalComplexArray;
public MultiDimensionalComplexMatrix(Object multiDimensionalComplexArray) {
this.multiDimensionalComplexArray = multiDimensionalComplexArray;
// count dimensions
int numOfDimensions = 0;
for (Object lastDimension = multiDimensionalComplexArray;
lastDimension instanceof Object[];) {
final Object[] array = (Object[]) lastDimension;
numOfDimensions++;
lastDimension = array[0];
}
// allocate array with exact count
dimensionSize = new int[numOfDimensions];
// fill array
numOfDimensions = 0;
for (Object lastDimension = multiDimensionalComplexArray;
lastDimension instanceof Object[];) {
final Object[] array = (Object[]) lastDimension;
dimensionSize[numOfDimensions++] = array.length;
lastDimension = array[0];
}
}
|
void function(MultiDimensionalComplexMatrix mdcm, boolean forward, int d, int[] subVector) throws IllegalArgumentException { int[] dimensionSize = mdcm.getDimensionSizes(); if (subVector.length == dimensionSize.length) { Complex[] temp = new Complex[dimensionSize[d]]; for (int i = 0; i < dimensionSize[d]; i++) { subVector[d] = i; temp[i] = mdcm.get(subVector); } if (forward) temp = transform2(temp); else temp = inversetransform2(temp); for (int i = 0; i < dimensionSize[d]; i++) { subVector[d] = i; mdcm.set(temp[i], subVector); } } else { int[] vector = new int[subVector.length + 1]; System.arraycopy(subVector, 0, vector, 0, subVector.length); if (subVector.length == d) { vector[d] = 0; mdfft(mdcm, forward, d, vector); } else { for (int i = 0; i < dimensionSize[subVector.length]; i++) { vector[subVector.length] = i; mdfft(mdcm, forward, d, vector); } } } return; } private static class MultiDimensionalComplexMatrix implements Cloneable { protected int[] dimensionSize; protected Object multiDimensionalComplexArray; public MultiDimensionalComplexMatrix(Object multiDimensionalComplexArray) { this.multiDimensionalComplexArray = multiDimensionalComplexArray; int numOfDimensions = 0; for (Object lastDimension = multiDimensionalComplexArray; lastDimension instanceof Object[];) { final Object[] array = (Object[]) lastDimension; numOfDimensions++; lastDimension = array[0]; } dimensionSize = new int[numOfDimensions]; numOfDimensions = 0; for (Object lastDimension = multiDimensionalComplexArray; lastDimension instanceof Object[];) { final Object[] array = (Object[]) lastDimension; dimensionSize[numOfDimensions++] = array.length; lastDimension = array[0]; } }
|
/**
* Performs one dimension of a multi-dimensional Fourier transform.
*
* @param mdcm input matrix
* @param forward inverseTransform2 is preformed if this is false
* @param d index of the dimension to process
* @param subVector recursion subvector
* @throws IllegalArgumentException if any dimension is not a power of two
*/
|
Performs one dimension of a multi-dimensional Fourier transform
|
mdfft
|
{
"repo_name": "haisamido/SFDaaS",
"path": "src/org/apache/commons/math/transform/FastFourierTransformer.java",
"license": "lgpl-3.0",
"size": 34071
}
|
[
"org.apache.commons.math.complex.Complex"
] |
import org.apache.commons.math.complex.Complex;
|
import org.apache.commons.math.complex.*;
|
[
"org.apache.commons"
] |
org.apache.commons;
| 2,370,079
|
public void setErrorHandler(XMLErrorHandler errorHandler);
|
void function(XMLErrorHandler errorHandler);
|
/**
* Sets the error handler.
*
* @param errorHandler The error handler.
*/
|
Sets the error handler
|
setErrorHandler
|
{
"repo_name": "md-5/jdk10",
"path": "src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xni/grammars/XMLGrammarLoader.java",
"license": "gpl-2.0",
"size": 5179
}
|
[
"com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler"
] |
import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
|
import com.sun.org.apache.xerces.internal.xni.parser.*;
|
[
"com.sun.org"
] |
com.sun.org;
| 726,339
|
@Override
public int run(String[] filteredargs) throws Exception {
try
{
// retrieve the input and output paths
if (filteredargs.length != 2)
{
System.err.println("Usage: InferenceDriver <input-path> <output-dir>");
return -1;
}
inPath_ = filteredargs[filteredargs.length-2];
outPath_ = filteredargs[filteredargs.length-1];
// locate the native libraries
Configuration conf = getConf();
String configuredLibHDFSPath_ = conf_.get("xdata.bayesnets.smile.library.path");
if (configuredLibHDFSPath_ == null || configuredLibHDFSPath_.isEmpty())
{
s_logger.warn("SMILE library path defaulting to " + libHDFSPath_);
s_logger.warn("Set xdata.bayesnets.smile.library.path to change. ");
}
else
{
libHDFSPath_ = configuredLibHDFSPath_;
}
// put the libraries in the job working dir
DistributedCache.createSymlink(conf_);
try {
DistributedCache.addCacheFile(
new URI(libHDFSPath_ + "/smile.jar#smile.jar"), conf_);
DistributedCache.addCacheFile(
new URI(libHDFSPath_ + "/libjsmile.so#libjsmile.so"), conf_);
DistributedCache.addCacheFile(
new URI(networkFileHDFSPath_ + "#" + basename(networkFileHDFSPath_)), conf_);
} catch (URISyntaxException e) {
s_logger.fatal("Bad URL for network file.");
return -12;
}
// assume the network and data is configured already - for example
Job job = new Job(conf);
job.setJarByClass(InferenceDriver.class);
job.setJobName("SMILE-WIDE Inference");
FileInputFormat.addInputPath(job, new Path(inPath_));
FileOutputFormat.setOutputPath(job, new Path(outPath_));
job.setMapperClass(PerInstanceInferenceMapper.class);
job.setMapOutputKeyClass(IntWritable.class);
job.setMapOutputValueClass(DoubleArrayWritable.class);
s_logger.info("Job working directory is " + job.getWorkingDirectory());
System.exit(job.waitForCompletion(true) ? 3 : 0);
}
catch (IOException e)
{
System.err.println("Something went badly wrong in IO.");
System.exit(2);
} catch (InterruptedException e) {
System.err.println("Job interrupted.");
e.printStackTrace();
} catch (ClassNotFoundException e) {
System.err.println("ClassNotFound exception.");
e.printStackTrace();
}
return 0;
}
|
int function(String[] filteredargs) throws Exception { try { if (filteredargs.length != 2) { System.err.println(STR); return -1; } inPath_ = filteredargs[filteredargs.length-2]; outPath_ = filteredargs[filteredargs.length-1]; Configuration conf = getConf(); String configuredLibHDFSPath_ = conf_.get(STR); if (configuredLibHDFSPath_ == null configuredLibHDFSPath_.isEmpty()) { s_logger.warn(STR + libHDFSPath_); s_logger.warn(STR); } else { libHDFSPath_ = configuredLibHDFSPath_; } DistributedCache.createSymlink(conf_); try { DistributedCache.addCacheFile( new URI(libHDFSPath_ + STR), conf_); DistributedCache.addCacheFile( new URI(libHDFSPath_ + STR), conf_); DistributedCache.addCacheFile( new URI(networkFileHDFSPath_ + "#" + basename(networkFileHDFSPath_)), conf_); } catch (URISyntaxException e) { s_logger.fatal(STR); return -12; } Job job = new Job(conf); job.setJarByClass(InferenceDriver.class); job.setJobName(STR); FileInputFormat.addInputPath(job, new Path(inPath_)); FileOutputFormat.setOutputPath(job, new Path(outPath_)); job.setMapperClass(PerInstanceInferenceMapper.class); job.setMapOutputKeyClass(IntWritable.class); job.setMapOutputValueClass(DoubleArrayWritable.class); s_logger.info(STR + job.getWorkingDirectory()); System.exit(job.waitForCompletion(true) ? 3 : 0); } catch (IOException e) { System.err.println(STR); System.exit(2); } catch (InterruptedException e) { System.err.println(STR); e.printStackTrace(); } catch (ClassNotFoundException e) { System.err.println(STR); e.printStackTrace(); } return 0; }
|
/** Main per-instance inference driver.
* Takes 2 arguments "on the command line" - input and output path.
*
* Relevant configuration parameters:
* - xdata.bayesnets.smile.library.path
* - xdata.bayesnets.networkfile
* - xdata.bayesnets.datasetreader.class
* - xdata.bayesnets.datasetreader.filter
* - xdata.bayesnets.datasetreader.variablenames
* - xdata.bayesnets.datasetreader.instid
* - xdata.bayesnets.queryvariable
*
* TODO: update the driver to answer a set of queries, not just one
*
*/
|
Main per-instance inference driver. Takes 2 arguments "on the command line" - input and output path. Relevant configuration parameters: - xdata.bayesnets.smile.library.path - xdata.bayesnets.networkfile - xdata.bayesnets.datasetreader.class - xdata.bayesnets.datasetreader.filter - xdata.bayesnets.datasetreader.variablenames - xdata.bayesnets.datasetreader.instid - xdata.bayesnets.queryvariable
|
run
|
{
"repo_name": "SmileWide/main",
"path": "src/main/java/smile/wide/InferenceDriver.java",
"license": "apache-2.0",
"size": 7411
}
|
[
"java.io.IOException",
"java.net.URISyntaxException",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.filecache.DistributedCache",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.io.IntWritable",
"org.apache.hadoop.mapreduce.Job",
"org.apache.hadoop.mapreduce.lib.input.FileInputFormat",
"org.apache.hadoop.mapreduce.lib.output.FileOutputFormat"
] |
import java.io.IOException; import java.net.URISyntaxException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.filecache.DistributedCache; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.IntWritable; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
|
import java.io.*; import java.net.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.filecache.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.io.*; import org.apache.hadoop.mapreduce.*; import org.apache.hadoop.mapreduce.lib.input.*; import org.apache.hadoop.mapreduce.lib.output.*;
|
[
"java.io",
"java.net",
"org.apache.hadoop"
] |
java.io; java.net; org.apache.hadoop;
| 258,193
|
private int calculateNextMessPosition(int lastYValue, Event event, Lifeline owner) {
int value = lastYValue;
// if there has not been drawn a message so far
// -> calculate position of first message in the sequence diagram
if (lastYValue == 0) {
FontMetrics fm = getFontMetrics(fProperties.getFont());
// Offset between message and edge = 2
if (event instanceof ObjectCreatedEvent || event instanceof LinkInsertedEvent) {
value = fProperties.yStart() + owner.getObjectBox().getHeight() / 2 + fm.getHeight() + 2;
} else {
value = fProperties.yStart();
if (fProperties.getActManDist() != -1) {
value += fProperties.getActManDist() + fm.getHeight() + 2;
} else {
value += fProperties.actStep();
}
if (owner.isShowStates() && owner.hasStatesMachine() && fProperties.isStatesShown()) {
value += fProperties.getStateNodeHeight();
}
}
// otherwise
// -> calculate next position subject to the user settings
} else {
if (fProperties.getActManDist() != -1) {
value += fProperties.getActManDist();
} else {
value += fProperties.actStep();
}
}
// return position for the next message
return value;
}
|
int function(int lastYValue, Event event, Lifeline owner) { int value = lastYValue; if (lastYValue == 0) { FontMetrics fm = getFontMetrics(fProperties.getFont()); if (event instanceof ObjectCreatedEvent event instanceof LinkInsertedEvent) { value = fProperties.yStart() + owner.getObjectBox().getHeight() / 2 + fm.getHeight() + 2; } else { value = fProperties.yStart(); if (fProperties.getActManDist() != -1) { value += fProperties.getActManDist() + fm.getHeight() + 2; } else { value += fProperties.actStep(); } if (owner.isShowStates() && owner.hasStatesMachine() && fProperties.isStatesShown()) { value += fProperties.getStateNodeHeight(); } } } else { if (fProperties.getActManDist() != -1) { value += fProperties.getActManDist(); } else { value += fProperties.actStep(); } } return value; }
|
/**
* Calculates the position of the next message depending on the given
* parameters.
*
* @param lastYValue the y value of the last drawn message
* @param cmd the command to be drawn in the diagram
* @param owner the owner lifeline of the command message
* @return the position of the next message
*/
|
Calculates the position of the next message depending on the given parameters
|
calculateNextMessPosition
|
{
"repo_name": "classicwuhao/maxuse",
"path": "src/gui/org/tzi/use/gui/views/diagrams/behavior/sequencediagram/SequenceDiagram.java",
"license": "gpl-2.0",
"size": 56909
}
|
[
"java.awt.FontMetrics",
"org.tzi.use.uml.sys.events.Event",
"org.tzi.use.uml.sys.events.LinkInsertedEvent",
"org.tzi.use.uml.sys.events.ObjectCreatedEvent"
] |
import java.awt.FontMetrics; import org.tzi.use.uml.sys.events.Event; import org.tzi.use.uml.sys.events.LinkInsertedEvent; import org.tzi.use.uml.sys.events.ObjectCreatedEvent;
|
import java.awt.*; import org.tzi.use.uml.sys.events.*;
|
[
"java.awt",
"org.tzi.use"
] |
java.awt; org.tzi.use;
| 1,147,774
|
void parameters(Action<? super P> configureAction);
/**
* Specifies the maximum number of tasks that can use this service in parallel. Setting this to 1 means that the service will be used by a single task at a time.
* When this property has no value defined, then any number of tasks may use this service in parallel. This is the default.
*
* <p>
* IMPORTANT: the build service must be explicitly registered with every using task via {@link org.gradle.api.Task#usesService(Provider) Task#usesService}
|
void parameters(Action<? super P> configureAction); /** * Specifies the maximum number of tasks that can use this service in parallel. Setting this to 1 means that the service will be used by a single task at a time. * When this property has no value defined, then any number of tasks may use this service in parallel. This is the default. * * <p> * IMPORTANT: the build service must be explicitly registered with every using task via {@link org.gradle.api.Task#usesService(Provider) Task#usesService}
|
/**
* Runs the given action to configure the parameters.
*/
|
Runs the given action to configure the parameters
|
parameters
|
{
"repo_name": "gradle/gradle",
"path": "subprojects/core-api/src/main/java/org/gradle/api/services/BuildServiceSpec.java",
"license": "apache-2.0",
"size": 1857
}
|
[
"org.gradle.api.Action"
] |
import org.gradle.api.Action;
|
import org.gradle.api.*;
|
[
"org.gradle.api"
] |
org.gradle.api;
| 1,577,698
|
public EPRRecipe addReferenceParameter(Header h) {
if(h==null) throw new IllegalArgumentException();
referenceParameters.add(h);
return this;
}
|
EPRRecipe function(Header h) { if(h==null) throw new IllegalArgumentException(); referenceParameters.add(h); return this; }
|
/**
* Adds a new reference parameter.
*/
|
Adds a new reference parameter
|
addReferenceParameter
|
{
"repo_name": "FauxFaux/jdk9-jaxws",
"path": "src/java.xml.ws/share/classes/com/sun/xml/internal/ws/developer/EPRRecipe.java",
"license": "gpl-2.0",
"size": 4357
}
|
[
"com.sun.xml.internal.ws.api.message.Header"
] |
import com.sun.xml.internal.ws.api.message.Header;
|
import com.sun.xml.internal.ws.api.message.*;
|
[
"com.sun.xml"
] |
com.sun.xml;
| 1,613,008
|
public String getMessage(String messageId, Locale locale) {
return messageSource.getMessage(messageId, null, locale);
}
|
String function(String messageId, Locale locale) { return messageSource.getMessage(messageId, null, locale); }
|
/**
* Returns a messsage for the given message id and locale
* @param messageId The key to the messages resource file
* @param locale The Locale
**/
|
Returns a messsage for the given message id and locale
|
getMessage
|
{
"repo_name": "paralotnik/devopsbuddy",
"path": "src/main/java/com/devopsbuddy/web/i18n/I18NService.java",
"license": "mit",
"size": 1312
}
|
[
"java.util.Locale"
] |
import java.util.Locale;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,985,268
|
public void valueChanged (ListSelectionEvent event)
{
}
|
void function (ListSelectionEvent event) { }
|
/**
* A sensor was selected from the list.
*
* @param event The list selection event.
*/
|
A sensor was selected from the list
|
valueChanged
|
{
"repo_name": "grappendorf/openmetix",
"path": "plugin/metix-exporter/src/java/de/iritgo/openmetix/exporter/gui/ExporterWizard.java",
"license": "gpl-2.0",
"size": 28023
}
|
[
"javax.swing.event.ListSelectionEvent"
] |
import javax.swing.event.ListSelectionEvent;
|
import javax.swing.event.*;
|
[
"javax.swing"
] |
javax.swing;
| 1,495,112
|
public static void assertFileExists(String filename) {
File file = new File(filename).getAbsoluteFile();
assertTrue(file.exists(), "File " + filename + " should exist");
}
|
static void function(String filename) { File file = new File(filename).getAbsoluteFile(); assertTrue(file.exists(), STR + filename + STR); }
|
/**
* To be used to check is a file is found in the file system
*/
|
To be used to check is a file is found in the file system
|
assertFileExists
|
{
"repo_name": "cexbrayat/camel",
"path": "components/camel-testng/src/main/java/org/apache/camel/testng/TestSupport.java",
"license": "apache-2.0",
"size": 17582
}
|
[
"java.io.File"
] |
import java.io.File;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 401,254
|
boolean isToWrite(JRComponentElement componentElement, JRXmlWriter reportWriter);
|
boolean isToWrite(JRComponentElement componentElement, JRXmlWriter reportWriter);
|
/**
* Specifies whether this component should be written out. This is useful for versioning.
*/
|
Specifies whether this component should be written out. This is useful for versioning
|
isToWrite
|
{
"repo_name": "MHTaleb/Encologim",
"path": "lib/JasperReport/src/net/sf/jasperreports/engine/component/ComponentXmlWriter.java",
"license": "gpl-3.0",
"size": 2167
}
|
[
"net.sf.jasperreports.engine.JRComponentElement",
"net.sf.jasperreports.engine.xml.JRXmlWriter"
] |
import net.sf.jasperreports.engine.JRComponentElement; import net.sf.jasperreports.engine.xml.JRXmlWriter;
|
import net.sf.jasperreports.engine.*; import net.sf.jasperreports.engine.xml.*;
|
[
"net.sf.jasperreports"
] |
net.sf.jasperreports;
| 2,064,059
|
public static void main(String[] args) {
JFrame frame = new JFrame(XTreeDemo.class.getAnnotation(DemoProperties.class).value());
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(new XTreeDemo());
frame.setPreferredSize(new Dimension(800, 600));
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
|
static void function(String[] args) { JFrame frame = new JFrame(XTreeDemo.class.getAnnotation(DemoProperties.class).value()); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().add(new XTreeDemo()); frame.setPreferredSize(new Dimension(800, 600)); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); }
|
/**
* main method allows us to run as a standalone demo.
*/
|
main method allows us to run as a standalone demo
|
main
|
{
"repo_name": "syncer/swingx",
"path": "swingx-demos/swingx-demos-content/src/main/java/org/jdesktop/swingx/demos/tree/XTreeDemo.java",
"license": "lgpl-2.1",
"size": 10226
}
|
[
"com.sun.swingset3.DemoProperties",
"java.awt.Dimension",
"javax.swing.JFrame"
] |
import com.sun.swingset3.DemoProperties; import java.awt.Dimension; import javax.swing.JFrame;
|
import com.sun.swingset3.*; import java.awt.*; import javax.swing.*;
|
[
"com.sun.swingset3",
"java.awt",
"javax.swing"
] |
com.sun.swingset3; java.awt; javax.swing;
| 2,505,482
|
public void removePropertyChangeListener(PropertyChangeListener listener)
{
changeSupport.removePropertyChangeListener(listener);
}
|
void function(PropertyChangeListener listener) { changeSupport.removePropertyChangeListener(listener); }
|
/**
* Removes a <code>PropertyChangeListener</code> object from this model.
*
* @param listener the listener to remove.
*/
|
Removes a <code>PropertyChangeListener</code> object from this model
|
removePropertyChangeListener
|
{
"repo_name": "shaotuanchen/sunflower_exp",
"path": "tools/source/gcc-4.2.4/libjava/classpath/javax/swing/tree/DefaultTreeSelectionModel.java",
"license": "bsd-3-clause",
"size": 29291
}
|
[
"java.beans.PropertyChangeListener"
] |
import java.beans.PropertyChangeListener;
|
import java.beans.*;
|
[
"java.beans"
] |
java.beans;
| 2,186,927
|
public OpenIDUserRPDTO getOpenIDUserRPInfo(String openID, String rpUrl) throws IdentityProviderException {
String userName = null;
try {
userName = OpenIDUtil.getUserName(openID);
} catch (MalformedURLException e) {
throw new IdentityProviderException("Failed to get username from OpenID " + openID, e);
}
String domainName = MultitenantUtils.getTenantDomain(userName);
int tenantId = IdentityTenantUtil.getTenantId(domainName);
OpenIDUserRPDO rpdo = null;
OpenIDUserRPDAO dao = new OpenIDUserRPDAO();
rpdo = dao.getOpenIDUserRP(userName, rpUrl, tenantId);
if (rpdo == null) {
return null;
}
return new OpenIDUserRPDTO(rpdo);
}
|
OpenIDUserRPDTO function(String openID, String rpUrl) throws IdentityProviderException { String userName = null; try { userName = OpenIDUtil.getUserName(openID); } catch (MalformedURLException e) { throw new IdentityProviderException(STR + openID, e); } String domainName = MultitenantUtils.getTenantDomain(userName); int tenantId = IdentityTenantUtil.getTenantId(domainName); OpenIDUserRPDO rpdo = null; OpenIDUserRPDAO dao = new OpenIDUserRPDAO(); rpdo = dao.getOpenIDUserRP(userName, rpUrl, tenantId); if (rpdo == null) { return null; } return new OpenIDUserRPDTO(rpdo); }
|
/**
* Returns RP DTO for the given OpenID and RP
*
* @param openID
* @param rpUrl
* @return openIDUserRPDTO
* @throws IdentityProviderException
*/
|
Returns RP DTO for the given OpenID and RP
|
getOpenIDUserRPInfo
|
{
"repo_name": "wso2-incubator/identity-connectors",
"path": "components/openid/org.wso2.carbon.identity.provider/src/main/java/org/wso2/carbon/identity/provider/OpenIDProviderService.java",
"license": "apache-2.0",
"size": 34974
}
|
[
"java.net.MalformedURLException",
"org.wso2.carbon.identity.core.dao.OpenIDUserRPDAO",
"org.wso2.carbon.identity.core.model.OpenIDUserRPDO",
"org.wso2.carbon.identity.core.util.IdentityTenantUtil",
"org.wso2.carbon.identity.provider.dto.OpenIDUserRPDTO",
"org.wso2.carbon.identity.provider.openid.OpenIDUtil",
"org.wso2.carbon.utils.multitenancy.MultitenantUtils"
] |
import java.net.MalformedURLException; import org.wso2.carbon.identity.core.dao.OpenIDUserRPDAO; import org.wso2.carbon.identity.core.model.OpenIDUserRPDO; import org.wso2.carbon.identity.core.util.IdentityTenantUtil; import org.wso2.carbon.identity.provider.dto.OpenIDUserRPDTO; import org.wso2.carbon.identity.provider.openid.OpenIDUtil; import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
|
import java.net.*; import org.wso2.carbon.identity.core.dao.*; import org.wso2.carbon.identity.core.model.*; import org.wso2.carbon.identity.core.util.*; import org.wso2.carbon.identity.provider.dto.*; import org.wso2.carbon.identity.provider.openid.*; import org.wso2.carbon.utils.multitenancy.*;
|
[
"java.net",
"org.wso2.carbon"
] |
java.net; org.wso2.carbon;
| 154,449
|
private void logSQLException(SQLException sqlexc, String sqlQuery) {
_Log.error("Exception trying to execute query: " + sqlQuery);
while (sqlexc != null) {
_Log.error("Error code: [" + sqlexc.getErrorCode() + "]");
_Log.error("Error message: [" + sqlexc.getMessage() + "]");
_Log.error("Error SQL State: [" + sqlexc.getSQLState() + "]");
sqlexc = sqlexc.getNextException();
}
}
|
void function(SQLException sqlexc, String sqlQuery) { _Log.error(STR + sqlQuery); while (sqlexc != null) { _Log.error(STR + sqlexc.getErrorCode() + "]"); _Log.error(STR + sqlexc.getMessage() + "]"); _Log.error(STR + sqlexc.getSQLState() + "]"); sqlexc = sqlexc.getNextException(); } }
|
/**
* Helper method for logging an SQL exception.
*/
|
Helper method for logging an SQL exception
|
logSQLException
|
{
"repo_name": "lmu-bioinformatics/xmlpipedb",
"path": "gmbuilder/src/edu/lmu/xmlpipedb/gmbuilder/databasetoolkit/profiles/ArabidopsisThalianaUniProtSpeciesProfile.java",
"license": "lgpl-3.0",
"size": 18347
}
|
[
"java.sql.SQLException",
"org.apache.commons.logging.Log"
] |
import java.sql.SQLException; import org.apache.commons.logging.Log;
|
import java.sql.*; import org.apache.commons.logging.*;
|
[
"java.sql",
"org.apache.commons"
] |
java.sql; org.apache.commons;
| 933,643
|
public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) {
this.parentAdapterFactory = parentAdapterFactory;
}
|
void function(ComposedAdapterFactory parentAdapterFactory) { this.parentAdapterFactory = parentAdapterFactory; }
|
/**
* This sets the composed adapter factory that contains this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
|
This sets the composed adapter factory that contains this factory.
|
setParentAdapterFactory
|
{
"repo_name": "openmapsoftware/mappingtools",
"path": "openmap-mapper-edit/src/main/java/com/openMap1/mapper/provider/MapperItemProviderAdapterFactory.java",
"license": "epl-1.0",
"size": 26253
}
|
[
"org.eclipse.emf.edit.provider.ComposedAdapterFactory"
] |
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
|
import org.eclipse.emf.edit.provider.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 2,588,704
|
public List<INDArray> windows(boolean flattened) {
List<INDArray> ret = new ArrayList<>();
int window = 0;
for(int i = 0; i < toSlice.length(); i++) {
if(window >= toSlice.length())
break;
double[] w = new double[this.windowRowSize * this.windowColumnSize];
for(int count = 0; count < this.windowRowSize * this.windowColumnSize; count++) {
w[count] = toSlice.getDouble(count + window);
}
INDArray add = Nd4j.create(w);
if(flattened)
add = add.ravel();
else
add = add.reshape(windowRowSize,windowColumnSize);
if(addRotate) {
INDArray currRotation = add.dup();
//3 different orientations besides the original
for(int rotation = 0; rotation < 3; rotation++) {
Nd4j.rot90(currRotation);
ret.add(currRotation.dup());
}
}
window += this.windowRowSize * this.windowColumnSize;
ret.add(add);
}
return ret;
}
|
List<INDArray> function(boolean flattened) { List<INDArray> ret = new ArrayList<>(); int window = 0; for(int i = 0; i < toSlice.length(); i++) { if(window >= toSlice.length()) break; double[] w = new double[this.windowRowSize * this.windowColumnSize]; for(int count = 0; count < this.windowRowSize * this.windowColumnSize; count++) { w[count] = toSlice.getDouble(count + window); } INDArray add = Nd4j.create(w); if(flattened) add = add.ravel(); else add = add.reshape(windowRowSize,windowColumnSize); if(addRotate) { INDArray currRotation = add.dup(); for(int rotation = 0; rotation < 3; rotation++) { Nd4j.rot90(currRotation); ret.add(currRotation.dup()); } } window += this.windowRowSize * this.windowColumnSize; ret.add(add); } return ret; }
|
/**
* Moving window, capture a row x column moving window of
* a given matrix
* @param flattened whether the arrays should be flattened or not
* @return the list of moving windows
*/
|
Moving window, capture a row x column moving window of a given matrix
|
windows
|
{
"repo_name": "xuzhongxing/deeplearning4j",
"path": "deeplearning4j-nn/src/main/java/org/deeplearning4j/util/MovingWindowMatrix.java",
"license": "apache-2.0",
"size": 3741
}
|
[
"java.util.ArrayList",
"java.util.List",
"org.nd4j.linalg.api.ndarray.INDArray",
"org.nd4j.linalg.factory.Nd4j"
] |
import java.util.ArrayList; import java.util.List; import org.nd4j.linalg.api.ndarray.INDArray; import org.nd4j.linalg.factory.Nd4j;
|
import java.util.*; import org.nd4j.linalg.api.ndarray.*; import org.nd4j.linalg.factory.*;
|
[
"java.util",
"org.nd4j.linalg"
] |
java.util; org.nd4j.linalg;
| 1,781,389
|
String getName(HttpServletRequest request);
|
String getName(HttpServletRequest request);
|
/**
* This is the actual text name used to locate the theme. It refers to
* assets which live under: /src/main/resources/templates/themes/[this name]
*
* @param request - request containing variables on which to decide theme(s)
* @return the name of the theme
*/
|
This is the actual text name used to locate the theme. It refers to assets which live under: /src/main/resources/templates/themes/[this name]
|
getName
|
{
"repo_name": "wjase/theme-tree",
"path": "src/main/java/au/com/cybernostics/themetree/theme/resolvers/CandidateTheme.java",
"license": "apache-2.0",
"size": 1931
}
|
[
"javax.servlet.http.HttpServletRequest"
] |
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.*;
|
[
"javax.servlet"
] |
javax.servlet;
| 709,631
|
public static void applicationDidBecomeActive() {
ArrayList<Runnable> callbacks = null;
synchronized(instance.onActiveListeners) {
instance.isActive = true;
callbacks = new ArrayList<Runnable>(instance.onActiveListeners.size());
callbacks.addAll(instance.onActiveListeners);
instance.onActiveListeners.clear();
}
for (Runnable callback : callbacks) {
callback.run();
}
minimized = false;
if(instance.life != null) {
instance.life.applicationDidBecomeActive();
}
|
static void function() { ArrayList<Runnable> callbacks = null; synchronized(instance.onActiveListeners) { instance.isActive = true; callbacks = new ArrayList<Runnable>(instance.onActiveListeners.size()); callbacks.addAll(instance.onActiveListeners); instance.onActiveListeners.clear(); } for (Runnable callback : callbacks) { callback.run(); } minimized = false; if(instance.life != null) { instance.life.applicationDidBecomeActive(); }
|
/**
* Called as part of the transition from the background to the inactive state;
* here you can undo many of the changes made on entering the background.
*/
|
Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background
|
applicationDidBecomeActive
|
{
"repo_name": "shannah/CodenameOne",
"path": "Ports/iOSPort/src/com/codename1/impl/ios/IOSImplementation.java",
"license": "gpl-2.0",
"size": 281624
}
|
[
"java.util.ArrayList"
] |
import java.util.ArrayList;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,042,108
|
protected void createDialog() {
JPanel panel;
SpinnerNumberModel model;
JLabel label;
getContentPane().setLayout(new BorderLayout());
panel = new JPanel(new GridLayout(5, 2));
getContentPane().add(panel, BorderLayout.CENTER);
// Precision
model = (SpinnerNumberModel) m_MeanPrecSpinner.getModel();
model.setMaximum(new Integer(20));
model.setMinimum(new Integer(0));
model = (SpinnerNumberModel) m_StdDevPrecSpinner.getModel();
model.setMaximum(new Integer(20));
model.setMinimum(new Integer(0));
label = new JLabel(Messages.getInstance().getString("OutputFormatDialog_CreateDialog_MeanPrecision_JLabel_Text"));
label.setDisplayedMnemonic('M');
label.setLabelFor(m_MeanPrecSpinner);
panel.add(label);
panel.add(m_MeanPrecSpinner);
label = new JLabel(Messages.getInstance().getString("OutputFormatDialog_CreateDialog_StdDevPrecision_JLabel_Text"));
label.setDisplayedMnemonic('S');
label.setLabelFor(m_StdDevPrecSpinner);
panel.add(label);
panel.add(m_StdDevPrecSpinner);
|
void function() { JPanel panel; SpinnerNumberModel model; JLabel label; getContentPane().setLayout(new BorderLayout()); panel = new JPanel(new GridLayout(5, 2)); getContentPane().add(panel, BorderLayout.CENTER); model = (SpinnerNumberModel) m_MeanPrecSpinner.getModel(); model.setMaximum(new Integer(20)); model.setMinimum(new Integer(0)); model = (SpinnerNumberModel) m_StdDevPrecSpinner.getModel(); model.setMaximum(new Integer(20)); model.setMinimum(new Integer(0)); label = new JLabel(Messages.getInstance().getString(STR)); label.setDisplayedMnemonic('M'); label.setLabelFor(m_MeanPrecSpinner); panel.add(label); panel.add(m_MeanPrecSpinner); label = new JLabel(Messages.getInstance().getString(STR)); label.setDisplayedMnemonic('S'); label.setLabelFor(m_StdDevPrecSpinner); panel.add(label); panel.add(m_StdDevPrecSpinner);
|
/**
* performs the creation of the dialog and all its components.
*/
|
performs the creation of the dialog and all its components
|
createDialog
|
{
"repo_name": "williamClanton/jbossBA",
"path": "weka/src/main/java/weka/gui/experiment/OutputFormatDialog.java",
"license": "gpl-2.0",
"size": 12705
}
|
[
"java.awt.BorderLayout",
"java.awt.GridLayout",
"javax.swing.JLabel",
"javax.swing.JPanel",
"javax.swing.SpinnerNumberModel"
] |
import java.awt.BorderLayout; import java.awt.GridLayout; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.SpinnerNumberModel;
|
import java.awt.*; import javax.swing.*;
|
[
"java.awt",
"javax.swing"
] |
java.awt; javax.swing;
| 1,239,222
|
public Collection<List<?>> getPairsList() {
Collection<List<?>> result = new ArrayList<List<?>>();
if (generalNames == null) {
return result;
}
for (GeneralName generalName : generalNames) {
result.add(generalName.getAsList());
}
return result;
}
|
Collection<List<?>> function() { Collection<List<?>> result = new ArrayList<List<?>>(); if (generalNames == null) { return result; } for (GeneralName generalName : generalNames) { result.add(generalName.getAsList()); } return result; }
|
/**
* Returns the collection of pairs: (Integer (tag), Object (name value))*
*/
|
Returns the collection of pairs: (Integer (tag), Object (name value))
|
getPairsList
|
{
"repo_name": "MindMac/android-vts",
"path": "app/src/main/java/android/framework/org/apache/harmony/security_custom/x509/GeneralNames.java",
"license": "mit",
"size": 4304
}
|
[
"java.util.ArrayList",
"java.util.Collection",
"java.util.List"
] |
import java.util.ArrayList; import java.util.Collection; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 856,070
|
public void setTestScriptContainer(TestScriptContainer testScriptContainer) {
this.testScriptContainer = testScriptContainer;
}
|
void function(TestScriptContainer testScriptContainer) { this.testScriptContainer = testScriptContainer; }
|
/**
* Missing description at method setTestScriptContainer.
*
* @param testScriptContainer the TestScriptContainer.
*/
|
Missing description at method setTestScriptContainer
|
setTestScriptContainer
|
{
"repo_name": "NABUCCO/org.nabucco.testautomation.config",
"path": "org.nabucco.testautomation.config.facade.message/src/main/gen/org/nabucco/testautomation/config/facade/message/ProduceTestScriptContainerMsg.java",
"license": "epl-1.0",
"size": 7546
}
|
[
"org.nabucco.testautomation.config.facade.datatype.TestScriptContainer"
] |
import org.nabucco.testautomation.config.facade.datatype.TestScriptContainer;
|
import org.nabucco.testautomation.config.facade.datatype.*;
|
[
"org.nabucco.testautomation"
] |
org.nabucco.testautomation;
| 644,271
|
public static void interruptIfNecessary(Throwable t)
{
if(t == null)
{
return;
}
Throwable current=t;
do
{
if(current instanceof InterruptedIOException || current instanceof InterruptedException)
{
Thread.currentThread().interrupt();
break;
}
current=current.getCause();
}
while(current !=null);
}
|
static void function(Throwable t) { if(t == null) { return; } Throwable current=t; do { if(current instanceof InterruptedIOException current instanceof InterruptedException) { Thread.currentThread().interrupt(); break; } current=current.getCause(); } while(current !=null); }
|
/**
* This method calls Thread.currentThread().interrupt() if any exception
* in the hierarchy (including all getCause()) is either InterruptedIOException
* or InterruptedException.
*
* This method should be called in every catch(IOException), catch(Exception) or
* catch(Throwable) block.
*
* @param t the Throwable to be checked for interruption. Does nothing if null.
*/
|
This method calls Thread.currentThread().interrupt() if any exception in the hierarchy (including all getCause()) is either InterruptedIOException or InterruptedException. This method should be called in every catch(IOException), catch(Exception) or catch(Throwable) block
|
interruptIfNecessary
|
{
"repo_name": "166MMX/sulky",
"path": "sulky-io/src/main/java/de/huxhorn/sulky/io/IOUtilities.java",
"license": "apache-2.0",
"size": 6836
}
|
[
"java.io.InterruptedIOException"
] |
import java.io.InterruptedIOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,770,157
|
public List<MeasurementValues> searchMeasurementValuess(String _searchString, int _maxResults);
|
List<MeasurementValues> function(String _searchString, int _maxResults);
|
/**
* Searches for entities of type MeasurementValues.
*/
|
Searches for entities of type MeasurementValues
|
searchMeasurementValuess
|
{
"repo_name": "CBSti/csv2DB",
"path": "src/main/java/de/peterspan/csv2db/domain/dao/IDBOperationsBase.java",
"license": "gpl-3.0",
"size": 4316
}
|
[
"de.peterspan.csv2db.domain.entities.MeasurementValues",
"java.util.List"
] |
import de.peterspan.csv2db.domain.entities.MeasurementValues; import java.util.List;
|
import de.peterspan.csv2db.domain.entities.*; import java.util.*;
|
[
"de.peterspan.csv2db",
"java.util"
] |
de.peterspan.csv2db; java.util;
| 516,253
|
public boolean cacheGroupAffinityNode(ClusterNode node, int grpId) {
CacheGroupAffinity aff = registeredCacheGrps.get(grpId);
return CU.affinityNode(node, aff.cacheFilter);
}
|
boolean function(ClusterNode node, int grpId) { CacheGroupAffinity aff = registeredCacheGrps.get(grpId); return CU.affinityNode(node, aff.cacheFilter); }
|
/**
* Checks if node is a data node for the given cache group.
*
* @param node Node to check.
* @param grpId Cache group ID.
* @return {@code True} if node is a cache data node.
*/
|
Checks if node is a data node for the given cache group
|
cacheGroupAffinityNode
|
{
"repo_name": "ntikhonov/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java",
"license": "apache-2.0",
"size": 113733
}
|
[
"org.apache.ignite.cluster.ClusterNode",
"org.apache.ignite.internal.util.typedef.internal.CU"
] |
import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.internal.util.typedef.internal.CU;
|
import org.apache.ignite.cluster.*; import org.apache.ignite.internal.util.typedef.internal.*;
|
[
"org.apache.ignite"
] |
org.apache.ignite;
| 2,783,884
|
public DeleteRoleMappingResponse deleteRoleMapping(DeleteRoleMappingRequest request, RequestOptions options) throws IOException {
return restHighLevelClient.performRequestAndParseEntity(request, SecurityRequestConverters::deleteRoleMapping, options,
DeleteRoleMappingResponse::fromXContent, emptySet());
}
|
DeleteRoleMappingResponse function(DeleteRoleMappingRequest request, RequestOptions options) throws IOException { return restHighLevelClient.performRequestAndParseEntity(request, SecurityRequestConverters::deleteRoleMapping, options, DeleteRoleMappingResponse::fromXContent, emptySet()); }
|
/**
* Delete a role mapping.
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html">
* the docs</a> for more.
* @param request the request with the role mapping name to be deleted.
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
* @return the response from the delete role mapping call
* @throws IOException in case there is a problem sending the request or parsing back the response
*/
|
Delete a role mapping. See the docs for more
|
deleteRoleMapping
|
{
"repo_name": "coding0011/elasticsearch",
"path": "client/rest-high-level/src/main/java/org/elasticsearch/client/SecurityClient.java",
"license": "apache-2.0",
"size": 62531
}
|
[
"java.io.IOException",
"java.util.Collections",
"org.elasticsearch.client.security.DeleteRoleMappingRequest",
"org.elasticsearch.client.security.DeleteRoleMappingResponse"
] |
import java.io.IOException; import java.util.Collections; import org.elasticsearch.client.security.DeleteRoleMappingRequest; import org.elasticsearch.client.security.DeleteRoleMappingResponse;
|
import java.io.*; import java.util.*; import org.elasticsearch.client.security.*;
|
[
"java.io",
"java.util",
"org.elasticsearch.client"
] |
java.io; java.util; org.elasticsearch.client;
| 18,406
|
static Set<JPAPuId> scanForTxSynchronizationCollisions(List<Object> bindingList) {
if (bindingList == null) {
return new HashSet<JPAPuId>();
}
HashMap<JPAPuId, Boolean> knownPuIdMap = new HashMap<JPAPuId, Boolean>();
HashSet<JPAPuId> returnSet = new HashSet<JPAPuId>();
for (Object o : bindingList) {
JPAPCtxtInjectionBinding injBinding = (JPAPCtxtInjectionBinding) o;
JPAPuId puid = injBinding.ivPuId;
Boolean isUnsynchronized = injBinding.isUnsynchronized() ? Boolean.TRUE : Boolean.FALSE;
if (Boolean.TRUE.equals(isUnsynchronized)) {
returnSet.add(puid);
}
Boolean pVal = knownPuIdMap.put(puid, isUnsynchronized);
if (pVal != null) {
// JPAPuId has been seen before, verify that the sync type remains the same.
if (!pVal.equals(isUnsynchronized)) {
// Mismatching SynchronizationType
Tr.error(tc, "JPATXSYNC_INCOMPATIBLE_CWWJP0044E", puid);
String msgTxt = "CWWJP0044E: Multiple extended persistence context definitions of the persistence unit " +
puid +
" have been declared with unequal synchronization configuration.";
throw new IllegalStateException(msgTxt);
}
}
}
return returnSet;
}
|
static Set<JPAPuId> scanForTxSynchronizationCollisions(List<Object> bindingList) { if (bindingList == null) { return new HashSet<JPAPuId>(); } HashMap<JPAPuId, Boolean> knownPuIdMap = new HashMap<JPAPuId, Boolean>(); HashSet<JPAPuId> returnSet = new HashSet<JPAPuId>(); for (Object o : bindingList) { JPAPCtxtInjectionBinding injBinding = (JPAPCtxtInjectionBinding) o; JPAPuId puid = injBinding.ivPuId; Boolean isUnsynchronized = injBinding.isUnsynchronized() ? Boolean.TRUE : Boolean.FALSE; if (Boolean.TRUE.equals(isUnsynchronized)) { returnSet.add(puid); } Boolean pVal = knownPuIdMap.put(puid, isUnsynchronized); if (pVal != null) { if (!pVal.equals(isUnsynchronized)) { Tr.error(tc, STR, puid); String msgTxt = STR + puid + STR; throw new IllegalStateException(msgTxt); } } } return returnSet; }
|
/**
* Scans the provided binding map for Transaction Synchronization configuration conflicts
* (All extended scope EntityManagers assigned to a common PU must have the same synchronization)\
*
* @param bindingList A List containing JPAPCtxtInjectionBinding objects associated with a SFSB.
* @return A Set of <JPAPuId> types which denote an extended scope persistence context associated
* with SynchronizationType.UNSYNCHRONIZED.
*
* The method will thrown an IllegalStateException if it finds two or more mappings to a common JPAPuId
* and have mismatching SynchronizationType.
*/
|
Scans the provided binding map for Transaction Synchronization configuration conflicts (All extended scope EntityManagers assigned to a common PU must have the same synchronization)\
|
scanForTxSynchronizationCollisions
|
{
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/JPAExEntityManager.java",
"license": "epl-1.0",
"size": 45724
}
|
[
"com.ibm.websphere.ras.Tr",
"com.ibm.ws.jpa.JPAPuId",
"java.util.HashMap",
"java.util.HashSet",
"java.util.List",
"java.util.Set"
] |
import com.ibm.websphere.ras.Tr; import com.ibm.ws.jpa.JPAPuId; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Set;
|
import com.ibm.websphere.ras.*; import com.ibm.ws.jpa.*; import java.util.*;
|
[
"com.ibm.websphere",
"com.ibm.ws",
"java.util"
] |
com.ibm.websphere; com.ibm.ws; java.util;
| 2,377,120
|
@SuppressWarnings("unchecked")
public static void appendHeader(Map<String, Object> headers, String key, Object value) {
if (headers.containsKey(key)) {
Object existing = headers.get(key);
List<Object> list;
if (existing instanceof List) {
list = (List<Object>) existing;
} else {
list = new ArrayList<>();
list.add(existing);
}
list.add(value);
value = list;
}
headers.put(key, value);
}
|
@SuppressWarnings(STR) static void function(Map<String, Object> headers, String key, Object value) { if (headers.containsKey(key)) { Object existing = headers.get(key); List<Object> list; if (existing instanceof List) { list = (List<Object>) existing; } else { list = new ArrayList<>(); list.add(existing); } list.add(value); value = list; } headers.put(key, value); }
|
/**
* Appends the key/value to the headers.
* <p/>
* This implementation supports keys with multiple values. In such situations the value
* will be a {@link java.util.List} that contains the multiple values.
*
* @param headers headers
* @param key the key
* @param value the value
*/
|
Appends the key/value to the headers. This implementation supports keys with multiple values. In such situations the value will be a <code>java.util.List</code> that contains the multiple values
|
appendHeader
|
{
"repo_name": "onders86/camel",
"path": "components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpHelper.java",
"license": "apache-2.0",
"size": 11131
}
|
[
"java.util.ArrayList",
"java.util.List",
"java.util.Map"
] |
import java.util.ArrayList; import java.util.List; import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,911,303
|
public Map<String, Types.NetworkOperations> getCurrentOperations(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "network.get_current_operations";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
Map response = c.dispatch(method_call, method_params);
Object result = response.get("Value");
return Types.toMapOfStringNetworkOperations(result);
}
|
Map<String, Types.NetworkOperations> function(Connection c) throws BadServerResponse, XenAPIException, XmlRpcException { String method_call = STR; String session = c.getSessionReference(); Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)}; Map response = c.dispatch(method_call, method_params); Object result = response.get("Value"); return Types.toMapOfStringNetworkOperations(result); }
|
/**
* Get the current_operations field of the given network.
*
* @return value of the field
*/
|
Get the current_operations field of the given network
|
getCurrentOperations
|
{
"repo_name": "mufaddalq/cloudstack-datera-driver",
"path": "deps/XenServerJava/src/com/xensource/xenapi/Network.java",
"license": "apache-2.0",
"size": 30009
}
|
[
"com.xensource.xenapi.Types",
"java.util.Map",
"org.apache.xmlrpc.XmlRpcException"
] |
import com.xensource.xenapi.Types; import java.util.Map; import org.apache.xmlrpc.XmlRpcException;
|
import com.xensource.xenapi.*; import java.util.*; import org.apache.xmlrpc.*;
|
[
"com.xensource.xenapi",
"java.util",
"org.apache.xmlrpc"
] |
com.xensource.xenapi; java.util; org.apache.xmlrpc;
| 2,336,325
|
public UserCommentsAndRatingsController createUserCommentsControllerMinimized(UserRequest ureq, WindowControl wControl);
|
UserCommentsAndRatingsController function(UserRequest ureq, WindowControl wControl);
|
/**
* Create a minimized user comments controller that only shows the number of comments. The link information can be clicked to trigger something
*
* @param ureq
* @param wControl
* @return
*/
|
Create a minimized user comments controller that only shows the number of comments. The link information can be clicked to trigger something
|
createUserCommentsControllerMinimized
|
{
"repo_name": "RLDevOps/Scholastic",
"path": "src/main/java/org/olat/core/commons/services/commentAndRating/CommentAndRatingService.java",
"license": "apache-2.0",
"size": 5515
}
|
[
"org.olat.core.commons.services.commentAndRating.impl.ui.UserCommentsAndRatingsController",
"org.olat.core.gui.UserRequest",
"org.olat.core.gui.control.WindowControl"
] |
import org.olat.core.commons.services.commentAndRating.impl.ui.UserCommentsAndRatingsController; import org.olat.core.gui.UserRequest; import org.olat.core.gui.control.WindowControl;
|
import org.olat.core.commons.services.*; import org.olat.core.gui.*; import org.olat.core.gui.control.*;
|
[
"org.olat.core"
] |
org.olat.core;
| 1,281,717
|
@Override
public void getTransform(Matrix transform) {
if (mTransformCallback != null) {
mTransformCallback.getTransform(transform);
} else {
transform.reset();
}
}
|
void function(Matrix transform) { if (mTransformCallback != null) { mTransformCallback.getTransform(transform); } else { transform.reset(); } }
|
/**
* TransformationCallback methods
*/
|
TransformationCallback methods
|
getTransform
|
{
"repo_name": "weiwenqiang/GitHub",
"path": "expert/fresco/drawee/src/main/java/com/facebook/drawee/drawable/ArrayDrawable.java",
"license": "apache-2.0",
"size": 10147
}
|
[
"android.graphics.Matrix"
] |
import android.graphics.Matrix;
|
import android.graphics.*;
|
[
"android.graphics"
] |
android.graphics;
| 2,515,159
|
public static IComplex complex(final long real_numerator, final long real_denominator,
final long imag_numerator, final long imag_denominator) {
return ComplexSym.valueOf(real_numerator, real_denominator, imag_numerator, imag_denominator);
}
|
static IComplex function(final long real_numerator, final long real_denominator, final long imag_numerator, final long imag_denominator) { return ComplexSym.valueOf(real_numerator, real_denominator, imag_numerator, imag_denominator); }
|
/**
* Create a symbolic complex number
*
* @param real_numerator
* @param real_denominator
* @param imag_numerator
* @param imag_denominator
* @return
*/
|
Create a symbolic complex number
|
complex
|
{
"repo_name": "axkr/symja_android_library",
"path": "symja_android_library/matheclipse-core/src/main/java/org/matheclipse/core/expression/F.java",
"license": "gpl-3.0",
"size": 283472
}
|
[
"org.matheclipse.core.interfaces.IComplex"
] |
import org.matheclipse.core.interfaces.IComplex;
|
import org.matheclipse.core.interfaces.*;
|
[
"org.matheclipse.core"
] |
org.matheclipse.core;
| 140,747
|
public static ResponseProperties getICalendar(String workEffortId, Map<String, Object> context) throws GenericEntityException {
Delegator delegator = (Delegator) context.get("delegator");
GenericValue publishProperties = EntityQuery.use(delegator).from("WorkEffort").where("workEffortId", workEffortId).queryOne();
if (!isCalendarPublished(publishProperties)) {
Debug.logInfo("WorkEffort calendar is not published: " + workEffortId, module);
return ICalWorker.createNotFoundResponse(null);
}
if (!"WES_PUBLIC".equals(publishProperties.get("scopeEnumId"))) {
if (context.get("userLogin") == null) {
return ICalWorker.createNotAuthorizedResponse(null);
}
if (!hasPermission(workEffortId, "VIEW", context)) {
return ICalWorker.createForbiddenResponse(null);
}
}
Calendar calendar = makeCalendar(publishProperties, context);
ComponentList<CalendarComponent> components = calendar.getComponents();
List<GenericValue> workEfforts = getRelatedWorkEfforts(publishProperties, context);
if (workEfforts != null) {
for (GenericValue workEffort : workEfforts) {
ResponseProperties responseProps = toCalendarComponent(components, workEffort, context);
if (responseProps != null) {
return responseProps;
}
}
}
if (Debug.verboseOn()) {
try {
calendar.validate(true);
Debug.logVerbose("iCalendar passes validation", module);
} catch (ValidationException e) {
if (Debug.verboseOn()) Debug.logVerbose("iCalendar fails validation: " + e, module);
}
}
return ICalWorker.createOkResponse(calendar.toString());
}
|
static ResponseProperties function(String workEffortId, Map<String, Object> context) throws GenericEntityException { Delegator delegator = (Delegator) context.get(STR); GenericValue publishProperties = EntityQuery.use(delegator).from(STR).where(STR, workEffortId).queryOne(); if (!isCalendarPublished(publishProperties)) { Debug.logInfo(STR + workEffortId, module); return ICalWorker.createNotFoundResponse(null); } if (!STR.equals(publishProperties.get(STR))) { if (context.get(STR) == null) { return ICalWorker.createNotAuthorizedResponse(null); } if (!hasPermission(workEffortId, "VIEW", context)) { return ICalWorker.createForbiddenResponse(null); } } Calendar calendar = makeCalendar(publishProperties, context); ComponentList<CalendarComponent> components = calendar.getComponents(); List<GenericValue> workEfforts = getRelatedWorkEfforts(publishProperties, context); if (workEfforts != null) { for (GenericValue workEffort : workEfforts) { ResponseProperties responseProps = toCalendarComponent(components, workEffort, context); if (responseProps != null) { return responseProps; } } } if (Debug.verboseOn()) { try { calendar.validate(true); Debug.logVerbose(STR, module); } catch (ValidationException e) { if (Debug.verboseOn()) Debug.logVerbose(STR + e, module); } } return ICalWorker.createOkResponse(calendar.toString()); }
|
/** Returns a calendar derived from a Work Effort calendar publish point.
* @param workEffortId ID of a work effort with <code>workEffortTypeId</code> equal to
* <code>PUBLISH_PROPS</code>.
* @param context The conversion context
* @return An iCalendar as a <code>String</code>, or <code>null</code>
* if <code>workEffortId</code> is invalid.
* @throws GenericEntityException
*/
|
Returns a calendar derived from a Work Effort calendar publish point
|
getICalendar
|
{
"repo_name": "ilscipio/scipio-erp",
"path": "applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalConverter.java",
"license": "apache-2.0",
"size": 50120
}
|
[
"java.util.List",
"java.util.Map",
"net.fortuna.ical4j.model.Calendar",
"net.fortuna.ical4j.model.ComponentList",
"net.fortuna.ical4j.model.component.CalendarComponent",
"net.fortuna.ical4j.validate.ValidationException",
"org.ofbiz.base.util.Debug",
"org.ofbiz.entity.Delegator",
"org.ofbiz.entity.GenericEntityException",
"org.ofbiz.entity.GenericValue",
"org.ofbiz.entity.util.EntityQuery",
"org.ofbiz.workeffort.workeffort.ICalWorker"
] |
import java.util.List; import java.util.Map; import net.fortuna.ical4j.model.Calendar; import net.fortuna.ical4j.model.ComponentList; import net.fortuna.ical4j.model.component.CalendarComponent; import net.fortuna.ical4j.validate.ValidationException; import org.ofbiz.base.util.Debug; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.util.EntityQuery; import org.ofbiz.workeffort.workeffort.ICalWorker;
|
import java.util.*; import net.fortuna.ical4j.model.*; import net.fortuna.ical4j.model.component.*; import net.fortuna.ical4j.validate.*; import org.ofbiz.base.util.*; import org.ofbiz.entity.*; import org.ofbiz.entity.util.*; import org.ofbiz.workeffort.workeffort.*;
|
[
"java.util",
"net.fortuna.ical4j",
"org.ofbiz.base",
"org.ofbiz.entity",
"org.ofbiz.workeffort"
] |
java.util; net.fortuna.ical4j; org.ofbiz.base; org.ofbiz.entity; org.ofbiz.workeffort;
| 2,751,284
|
@Ignore @Test
public void queueFailover() throws Exception {
utility1.createMultiRegions(htable1, famName);
// killing the RS with .META. can result into failed puts until we solve
// IO fencing
int rsToKill1 =
utility1.getHBaseCluster().getServerWithMeta() == 0 ? 1 : 0;
int rsToKill2 =
utility2.getHBaseCluster().getServerWithMeta() == 0 ? 1 : 0;
// Takes about 20 secs to run the full loading, kill around the middle
Thread killer1 = killARegionServer(utility1, 7500, rsToKill1);
Thread killer2 = killARegionServer(utility2, 10000, rsToKill2);
LOG.info("Start loading table");
int initialCount = utility1.loadTable(htable1, famName);
LOG.info("Done loading table");
killer1.join(5000);
killer2.join(5000);
LOG.info("Done waiting for threads");
Result[] res;
while (true) {
try {
Scan scan = new Scan();
ResultScanner scanner = htable1.getScanner(scan);
res = scanner.next(initialCount);
scanner.close();
break;
} catch (UnknownScannerException ex) {
LOG.info("Cluster wasn't ready yet, restarting scanner");
}
}
// Test we actually have all the rows, we may miss some because we
// don't have IO fencing.
if (res.length != initialCount) {
LOG.warn("We lost some rows on the master cluster!");
// We don't really expect the other cluster to have more rows
initialCount = res.length;
}
Scan scan2 = new Scan();
int lastCount = 0;
for (int i = 0; i < NB_RETRIES; i++) {
if (i==NB_RETRIES-1) {
fail("Waited too much time for queueFailover replication");
}
ResultScanner scanner2 = htable2.getScanner(scan2);
Result[] res2 = scanner2.next(initialCount * 2);
scanner2.close();
if (res2.length < initialCount) {
if (lastCount < res2.length) {
i--; // Don't increment timeout if we make progress
}
lastCount = res2.length;
LOG.info("Only got " + lastCount + " rows instead of " +
initialCount + " current i=" + i);
Thread.sleep(SLEEP_TIME*2);
} else {
break;
}
}
}
|
@Ignore void function() throws Exception { utility1.createMultiRegions(htable1, famName); int rsToKill1 = utility1.getHBaseCluster().getServerWithMeta() == 0 ? 1 : 0; int rsToKill2 = utility2.getHBaseCluster().getServerWithMeta() == 0 ? 1 : 0; Thread killer1 = killARegionServer(utility1, 7500, rsToKill1); Thread killer2 = killARegionServer(utility2, 10000, rsToKill2); LOG.info(STR); int initialCount = utility1.loadTable(htable1, famName); LOG.info(STR); killer1.join(5000); killer2.join(5000); LOG.info(STR); Result[] res; while (true) { try { Scan scan = new Scan(); ResultScanner scanner = htable1.getScanner(scan); res = scanner.next(initialCount); scanner.close(); break; } catch (UnknownScannerException ex) { LOG.info(STR); } } if (res.length != initialCount) { LOG.warn(STR); initialCount = res.length; } Scan scan2 = new Scan(); int lastCount = 0; for (int i = 0; i < NB_RETRIES; i++) { if (i==NB_RETRIES-1) { fail(STR); } ResultScanner scanner2 = htable2.getScanner(scan2); Result[] res2 = scanner2.next(initialCount * 2); scanner2.close(); if (res2.length < initialCount) { if (lastCount < res2.length) { i--; } lastCount = res2.length; LOG.info(STR + lastCount + STR + initialCount + STR + i); Thread.sleep(SLEEP_TIME*2); } else { break; } } }
|
/**
* Load up multiple tables over 2 region servers and kill a source during
* the upload. The failover happens internally.
* @throws Exception
*/
|
Load up multiple tables over 2 region servers and kill a source during the upload. The failover happens internally
|
queueFailover
|
{
"repo_name": "abaranau/hbase",
"path": "src/test/java/org/apache/hadoop/hbase/replication/TestReplication.java",
"license": "apache-2.0",
"size": 15170
}
|
[
"org.apache.hadoop.hbase.UnknownScannerException",
"org.apache.hadoop.hbase.client.Result",
"org.apache.hadoop.hbase.client.ResultScanner",
"org.apache.hadoop.hbase.client.Scan",
"org.junit.Assert",
"org.junit.Ignore"
] |
import org.apache.hadoop.hbase.UnknownScannerException; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.ResultScanner; import org.apache.hadoop.hbase.client.Scan; import org.junit.Assert; import org.junit.Ignore;
|
import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.client.*; import org.junit.*;
|
[
"org.apache.hadoop",
"org.junit"
] |
org.apache.hadoop; org.junit;
| 1,947,672
|
ParameterNameProvider getParameterNameProvider();
|
ParameterNameProvider getParameterNameProvider();
|
/**
* Returns the parameter name provider for this configuration.
* <p/>
* {@link ParameterNameProvider} is defined in the following decreasing priority:
* <ul>
* <li>set via the {@link Configuration} programmatic API</li>
* <li>defined in {@code META-INF/validation.xml} provided that
* {@code ignoreXmlConfiguration} is {@code false}. In this case the instance
* is created via its no-arg constructor.</li>
* <li>{@code null} if undefined.</li>
* </ul>
*
* @return parameter name provider instance or {@code null} if not defined
*
* @since 1.1
*/
|
Returns the parameter name provider for this configuration. <code>ParameterNameProvider</code> is defined in the following decreasing priority: set via the <code>Configuration</code> programmatic API defined in META-INF/validation.xml provided that ignoreXmlConfiguration is false. In this case the instance is created via its no-arg constructor. null if undefined.
|
getParameterNameProvider
|
{
"repo_name": "lpandzic/beanvalidation-api",
"path": "src/main/java/javax/validation/spi/ConfigurationState.java",
"license": "apache-2.0",
"size": 5855
}
|
[
"javax.validation.ParameterNameProvider"
] |
import javax.validation.ParameterNameProvider;
|
import javax.validation.*;
|
[
"javax.validation"
] |
javax.validation;
| 593,445
|
@Test
public void test_quicksortRepair_jkali() throws Exception {
AstorMain main1 = new AstorMain();
CommandSummary command = (getQuixBugsCommand("quicksort"));
command.command.put("-maxgen", "500");
command.command.put("-mode", "jkali");
main1.execute(command.flat());
assertTrue("No solution", main1.getEngine().getSolutions().size() > 0);
}
|
void function() throws Exception { AstorMain main1 = new AstorMain(); CommandSummary command = (getQuixBugsCommand(STR)); command.command.put(STR, "500"); command.command.put("-mode", "jkali"); main1.execute(command.flat()); assertTrue(STR, main1.getEngine().getSolutions().size() > 0); }
|
/**
* Repaired in paper
*
* @throws Exception
*/
|
Repaired in paper
|
test_quicksortRepair_jkali
|
{
"repo_name": "martingwhite/astor",
"path": "src/test/java/fr/inria/astor/test/repair/QuixBugsRepairTest.java",
"license": "gpl-2.0",
"size": 20449
}
|
[
"fr.inria.main.CommandSummary",
"fr.inria.main.evolution.AstorMain",
"org.junit.Assert"
] |
import fr.inria.main.CommandSummary; import fr.inria.main.evolution.AstorMain; import org.junit.Assert;
|
import fr.inria.main.*; import fr.inria.main.evolution.*; import org.junit.*;
|
[
"fr.inria.main",
"org.junit"
] |
fr.inria.main; org.junit;
| 1,736,195
|
public static Delta get(GraphService gs, long from, long to){
ArrayList<Long> times = MetalyzerAPIHelper.getTimestamps(gs, from, to);
ArrayList<IdentifierGraph> deletes = new ArrayList<>();
ArrayList<IdentifierGraph> updates = new ArrayList<>();
if( times.size() <= 1 ){
return new DeltaImpl(deletes, updates);
}
int index = 0;
do{
Delta delta = gs.getDelta( times.get(index) , times.get(index+1) );
deletes.addAll( delta.getDeletes() );
updates.addAll( delta.getUpdates() );
index++;
}while( index+1 < times.size() );
return new DeltaImpl(deletes, updates);
}
|
static Delta function(GraphService gs, long from, long to){ ArrayList<Long> times = MetalyzerAPIHelper.getTimestamps(gs, from, to); ArrayList<IdentifierGraph> deletes = new ArrayList<>(); ArrayList<IdentifierGraph> updates = new ArrayList<>(); if( times.size() <= 1 ){ return new DeltaImpl(deletes, updates); } int index = 0; do{ Delta delta = gs.getDelta( times.get(index) , times.get(index+1) ); deletes.addAll( delta.getDeletes() ); updates.addAll( delta.getUpdates() ); index++; }while( index+1 < times.size() ); return new DeltaImpl(deletes, updates); }
|
/**
* Returns a new Delta with all the changes within the given delta.
*
* @param gs if-map connection against the request will be processed.
* @param from start timestamp
* @param to end timestamp
* @return
*/
|
Returns a new Delta with all the changes within the given delta
|
get
|
{
"repo_name": "trustathsh/metalyzer",
"path": "dataservice-module/src/main/java/de/hshannover/f4/trust/metalyzer/api/helper/DeltaBuilder.java",
"license": "apache-2.0",
"size": 3061
}
|
[
"de.hshannover.f4.trust.visitmeta.implementations.internal.DeltaImpl",
"de.hshannover.f4.trust.visitmeta.interfaces.Delta",
"de.hshannover.f4.trust.visitmeta.interfaces.GraphService",
"de.hshannover.f4.trust.visitmeta.interfaces.IdentifierGraph",
"java.util.ArrayList"
] |
import de.hshannover.f4.trust.visitmeta.implementations.internal.DeltaImpl; import de.hshannover.f4.trust.visitmeta.interfaces.Delta; import de.hshannover.f4.trust.visitmeta.interfaces.GraphService; import de.hshannover.f4.trust.visitmeta.interfaces.IdentifierGraph; import java.util.ArrayList;
|
import de.hshannover.f4.trust.visitmeta.implementations.internal.*; import de.hshannover.f4.trust.visitmeta.interfaces.*; import java.util.*;
|
[
"de.hshannover.f4",
"java.util"
] |
de.hshannover.f4; java.util;
| 1,569,900
|
protected List<Integer> getDatacenterIdsList() {
return datacenterIdsList;
}
|
List<Integer> function() { return datacenterIdsList; }
|
/**
* Gets the datacenter ids list.
*
* @return the datacenter ids list
*/
|
Gets the datacenter ids list
|
getDatacenterIdsList
|
{
"repo_name": "harihar90/dynamiccloudsim",
"path": "src/org/cloudbus/cloudsim/DatacenterBroker.java",
"license": "lgpl-3.0",
"size": 18411
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,296,837
|
public static DefaultConnectionFactory newLdaptiveConnectionFactory(final AbstractLdapProperties l) {
LOGGER.debug("Creating LDAP connection factory for [{}]", l.getLdapUrl());
val cc = newLdaptiveConnectionConfig(l);
val bindCf = new DefaultConnectionFactory(cc);
if (l.getProviderClass() != null) {
try {
val clazz = ClassUtils.getClass(l.getProviderClass());
bindCf.setProvider(Provider.class.cast(clazz.getDeclaredConstructor().newInstance()));
} catch (final Exception e) {
LOGGER.error(e.getMessage(), e);
}
}
return bindCf;
}
|
static DefaultConnectionFactory function(final AbstractLdapProperties l) { LOGGER.debug(STR, l.getLdapUrl()); val cc = newLdaptiveConnectionConfig(l); val bindCf = new DefaultConnectionFactory(cc); if (l.getProviderClass() != null) { try { val clazz = ClassUtils.getClass(l.getProviderClass()); bindCf.setProvider(Provider.class.cast(clazz.getDeclaredConstructor().newInstance())); } catch (final Exception e) { LOGGER.error(e.getMessage(), e); } } return bindCf; }
|
/**
* New connection factory connection factory.
*
* @param l the l
* @return the connection factory
*/
|
New connection factory connection factory
|
newLdaptiveConnectionFactory
|
{
"repo_name": "frett/cas",
"path": "support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java",
"license": "apache-2.0",
"size": 45179
}
|
[
"org.apache.commons.lang3.ClassUtils",
"org.apereo.cas.configuration.model.support.ldap.AbstractLdapProperties",
"org.ldaptive.DefaultConnectionFactory",
"org.ldaptive.provider.Provider"
] |
import org.apache.commons.lang3.ClassUtils; import org.apereo.cas.configuration.model.support.ldap.AbstractLdapProperties; import org.ldaptive.DefaultConnectionFactory; import org.ldaptive.provider.Provider;
|
import org.apache.commons.lang3.*; import org.apereo.cas.configuration.model.support.ldap.*; import org.ldaptive.*; import org.ldaptive.provider.*;
|
[
"org.apache.commons",
"org.apereo.cas",
"org.ldaptive",
"org.ldaptive.provider"
] |
org.apache.commons; org.apereo.cas; org.ldaptive; org.ldaptive.provider;
| 2,575,943
|
@Override
public void setRightDecoration(JComponent decoration) {
if (right != null) topPanel.remove(right);
right = decoration;
if (right != null) {
topPanel.add(decoration, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, UIManager.getInsets("JXTitledPanel.rightDecorationInsets"), 0, 0));
}
}
|
void function(JComponent decoration) { if (right != null) topPanel.remove(right); right = decoration; if (right != null) { topPanel.add(decoration, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, UIManager.getInsets(STR), 0, 0)); } }
|
/**
* Adds the given JComponent as a decoration on the right of the title
* @param decoration
*/
|
Adds the given JComponent as a decoration on the right of the title
|
setRightDecoration
|
{
"repo_name": "trejkaz/swingx",
"path": "swingx-core/src/main/java/org/jdesktop/swingx/plaf/basic/BasicTitledPanelUI.java",
"license": "lgpl-2.1",
"size": 14226
}
|
[
"java.awt.GridBagConstraints",
"javax.swing.JComponent",
"javax.swing.UIManager"
] |
import java.awt.GridBagConstraints; import javax.swing.JComponent; import javax.swing.UIManager;
|
import java.awt.*; import javax.swing.*;
|
[
"java.awt",
"javax.swing"
] |
java.awt; javax.swing;
| 185,182
|
public void setLabels(@NonNull List<String> labels) {
mLabels = labels;
}
|
void function(@NonNull List<String> labels) { mLabels = labels; }
|
/**
* Sets the user-viewable spinner labels
*
* @param labels
* A list of strings
*/
|
Sets the user-viewable spinner labels
|
setLabels
|
{
"repo_name": "genious7/FanFictionReader",
"path": "fanfictionReader/src/main/java/com/spicymango/fanfictionreader/menu/storymenu/FilterDialog/SpinnerData.java",
"license": "gpl-3.0",
"size": 4310
}
|
[
"androidx.annotation.NonNull",
"java.util.List"
] |
import androidx.annotation.NonNull; import java.util.List;
|
import androidx.annotation.*; import java.util.*;
|
[
"androidx.annotation",
"java.util"
] |
androidx.annotation; java.util;
| 1,509,176
|
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<PagedResponse<ResourceMetricInner>> listMetricsSinglePageAsync(
String resourceGroupName, String name, Boolean details, String filter) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (name == null) {
return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.listMetrics(
this.client.getEndpoint(),
resourceGroupName,
name,
details,
filter,
this.client.getSubscriptionId(),
this.client.getApiVersion(),
accept,
context))
.<PagedResponse<ResourceMetricInner>>map(
res ->
new PagedResponseBase<>(
res.getRequest(),
res.getStatusCode(),
res.getHeaders(),
res.getValue().value(),
res.getValue().nextLink(),
null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
|
@ServiceMethod(returns = ReturnType.SINGLE) Mono<PagedResponse<ResourceMetricInner>> function( String resourceGroupName, String name, Boolean details, String filter) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (name == null) { return Mono.error(new IllegalArgumentException(STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( STR)); } final String accept = STR; return FluxUtil .withContext( context -> service .listMetrics( this.client.getEndpoint(), resourceGroupName, name, details, filter, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) .<PagedResponse<ResourceMetricInner>>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); }
|
/**
* Get global metrics of an App Service Environment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service Environment.
* @param details Specify <code>true</code> to include instance details. The default is
* <code>false</code>.
* @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example:
* $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and
* endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return global metrics of an App Service Environment.
*/
|
Get global metrics of an App Service Environment
|
listMetricsSinglePageAsync
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceEnvironmentsClientImpl.java",
"license": "mit",
"size": 563770
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.PagedResponse",
"com.azure.core.http.rest.PagedResponseBase",
"com.azure.core.util.FluxUtil",
"com.azure.resourcemanager.appservice.fluent.models.ResourceMetricInner"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.appservice.fluent.models.ResourceMetricInner;
|
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.appservice.fluent.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 2,642,891
|
private DocumentReference getMappingDocument()
{
DocumentReference mapping = getCurrentUserConfiguration();
if (mapping == null) {
mapping = this.configurationManager.getActiveConfiguration().getPhenotypeMapping();
}
return mapping;
}
|
DocumentReference function() { DocumentReference mapping = getCurrentUserConfiguration(); if (mapping == null) { mapping = this.configurationManager.getActiveConfiguration().getPhenotypeMapping(); } return mapping; }
|
/**
* Determine which document was configured as the mapping source in the current user's preferences, or, if missing,
* in the current space's preferences.
*
* @return a document reference, as configured in the space preferences
*/
|
Determine which document was configured as the mapping source in the current user's preferences, or, if missing, in the current space's preferences
|
getMappingDocument
|
{
"repo_name": "danielpgross/phenotips",
"path": "components/patient-tools/src/main/java/org/phenotips/tools/PhenotypeMappingService.java",
"license": "agpl-3.0",
"size": 10293
}
|
[
"org.xwiki.model.reference.DocumentReference"
] |
import org.xwiki.model.reference.DocumentReference;
|
import org.xwiki.model.reference.*;
|
[
"org.xwiki.model"
] |
org.xwiki.model;
| 865,142
|
Collection<MarkerEntry> generateMarkerEntries(IProgressMonitor monitor) {
List<MarkerEntry> result = new LinkedList<>();
String[] typeIds = getTypes();
boolean includeSubTypes = builder.includeMarkerSubTypes();
boolean cancelled = gatherMarkers(typeIds, includeSubTypes, result,
monitor);
if (cancelled) {
result.clear();
}
return result;
}
|
Collection<MarkerEntry> generateMarkerEntries(IProgressMonitor monitor) { List<MarkerEntry> result = new LinkedList<>(); String[] typeIds = getTypes(); boolean includeSubTypes = builder.includeMarkerSubTypes(); boolean cancelled = gatherMarkers(typeIds, includeSubTypes, result, monitor); if (cancelled) { result.clear(); } return result; }
|
/**
* Refresh gathered markers entries
*
* @param monitor
*/
|
Refresh gathered markers entries
|
generateMarkerEntries
|
{
"repo_name": "elucash/eclipse-oxygen",
"path": "org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/MarkerContentGenerator.java",
"license": "epl-1.0",
"size": 32099
}
|
[
"java.util.Collection",
"java.util.LinkedList",
"java.util.List",
"org.eclipse.core.runtime.IProgressMonitor"
] |
import java.util.Collection; import java.util.LinkedList; import java.util.List; import org.eclipse.core.runtime.IProgressMonitor;
|
import java.util.*; import org.eclipse.core.runtime.*;
|
[
"java.util",
"org.eclipse.core"
] |
java.util; org.eclipse.core;
| 357,439
|
private int createClusterFromConfig(final OStorageClusterConfiguration iConfig) throws IOException {
OCluster cluster = clusterMap.get(iConfig.getName());
if (cluster != null) {
if (cluster instanceof OClusterLocal)
// ALREADY CONFIGURED, JUST OVERWRITE CONFIG
((OClusterLocal) cluster).configure(this, iConfig);
return -1;
}
cluster = Orient.instance().getClusterFactory().createCluster(iConfig);
cluster.configure(this, iConfig);
return registerCluster(cluster);
}
|
int function(final OStorageClusterConfiguration iConfig) throws IOException { OCluster cluster = clusterMap.get(iConfig.getName()); if (cluster != null) { if (cluster instanceof OClusterLocal) ((OClusterLocal) cluster).configure(this, iConfig); return -1; } cluster = Orient.instance().getClusterFactory().createCluster(iConfig); cluster.configure(this, iConfig); return registerCluster(cluster); }
|
/**
* Create the cluster by reading the configuration received as argument and register it assigning it the higher serial id.
*
* @param iConfig
* A OStorageClusterConfiguration implementation, namely physical or logical
* @return The id (physical position into the array) of the new cluster just created. First is 0.
* @throws IOException
* @throws IOException
*/
|
Create the cluster by reading the configuration received as argument and register it assigning it the higher serial id
|
createClusterFromConfig
|
{
"repo_name": "redox/OrientDB",
"path": "core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OStorageLocal.java",
"license": "apache-2.0",
"size": 63401
}
|
[
"com.orientechnologies.orient.core.Orient",
"com.orientechnologies.orient.core.config.OStorageClusterConfiguration",
"com.orientechnologies.orient.core.storage.OCluster",
"java.io.IOException"
] |
import com.orientechnologies.orient.core.Orient; import com.orientechnologies.orient.core.config.OStorageClusterConfiguration; import com.orientechnologies.orient.core.storage.OCluster; import java.io.IOException;
|
import com.orientechnologies.orient.core.*; import com.orientechnologies.orient.core.config.*; import com.orientechnologies.orient.core.storage.*; import java.io.*;
|
[
"com.orientechnologies.orient",
"java.io"
] |
com.orientechnologies.orient; java.io;
| 70,237
|
@GetMapping({ "/private/customer/profile", "/auth/customer/profile" })
@ApiImplicitParams({ @ApiImplicitParam(name = "store", dataType = "string", defaultValue = "DEFAULT"),
@ApiImplicitParam(name = "lang", dataType = "string", defaultValue = "en") })
public ReadableCustomer getAuthUser(@ApiIgnore MerchantStore merchantStore, @ApiIgnore Language language,
HttpServletRequest request) {
Principal principal = request.getUserPrincipal();
String userName = principal.getName();
return customerFacade.getCustomerByNick(userName, merchantStore, language);
}
|
@GetMapping({ STR, STR }) @ApiImplicitParams({ @ApiImplicitParam(name = "store", dataType = STR, defaultValue = STR), @ApiImplicitParam(name = "lang", dataType = STR, defaultValue = "en") }) ReadableCustomer function(@ApiIgnore MerchantStore merchantStore, @ApiIgnore Language language, HttpServletRequest request) { Principal principal = request.getUserPrincipal(); String userName = principal.getName(); return customerFacade.getCustomerByNick(userName, merchantStore, language); }
|
/**
* Get logged in customer profile
*
* @param merchantStore
* @param language
* @param request
* @return
*/
|
Get logged in customer profile
|
getAuthUser
|
{
"repo_name": "shopizer-ecommerce/shopizer",
"path": "sm-shop/src/main/java/com/salesmanager/shop/store/api/v1/customer/CustomerApi.java",
"license": "apache-2.0",
"size": 9434
}
|
[
"com.salesmanager.core.model.merchant.MerchantStore",
"com.salesmanager.core.model.reference.language.Language",
"com.salesmanager.shop.model.customer.ReadableCustomer",
"io.swagger.annotations.ApiImplicitParam",
"io.swagger.annotations.ApiImplicitParams",
"java.security.Principal",
"javax.servlet.http.HttpServletRequest",
"org.springframework.web.bind.annotation.GetMapping"
] |
import com.salesmanager.core.model.merchant.MerchantStore; import com.salesmanager.core.model.reference.language.Language; import com.salesmanager.shop.model.customer.ReadableCustomer; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import java.security.Principal; import javax.servlet.http.HttpServletRequest; import org.springframework.web.bind.annotation.GetMapping;
|
import com.salesmanager.core.model.merchant.*; import com.salesmanager.core.model.reference.language.*; import com.salesmanager.shop.model.customer.*; import io.swagger.annotations.*; import java.security.*; import javax.servlet.http.*; import org.springframework.web.bind.annotation.*;
|
[
"com.salesmanager.core",
"com.salesmanager.shop",
"io.swagger.annotations",
"java.security",
"javax.servlet",
"org.springframework.web"
] |
com.salesmanager.core; com.salesmanager.shop; io.swagger.annotations; java.security; javax.servlet; org.springframework.web;
| 1,318,349
|
@Log(logLevel = LogLevel.DEBUG, measureExecutionTime = true)
@Handler(pathMapping = "/memory", method = HttpMethod.get, mimeType = MimeType.JSON, responseTransformer = JsonResponseTransformer.class)
public <T extends Object> HttpResponse memory(final Request request, final Response response) {
return DataResponse.ok().withPayload(memoryStatus());
}
|
@Log(logLevel = LogLevel.DEBUG, measureExecutionTime = true) @Handler(pathMapping = STR, method = HttpMethod.get, mimeType = MimeType.JSON, responseTransformer = JsonResponseTransformer.class) <T extends Object> HttpResponse function(final Request request, final Response response) { return DataResponse.ok().withPayload(memoryStatus()); }
|
/**
* Returns information about the currently used memory.
*
* @param <T> a T object.
* @param request a {@link spark.Request} object.
* @param response a {@link spark.Response} object.
* @return the status message
*/
|
Returns information about the currently used memory
|
memory
|
{
"repo_name": "mojo2012/spot-framework",
"path": "spot-core/src/main/java/io/spotnext/core/management/service/impl/StatusRestEndpoint.java",
"license": "apache-2.0",
"size": 7954
}
|
[
"io.spotnext.core.infrastructure.annotation.logging.Log",
"io.spotnext.core.infrastructure.http.DataResponse",
"io.spotnext.core.infrastructure.http.HttpResponse",
"io.spotnext.core.infrastructure.support.LogLevel",
"io.spotnext.core.infrastructure.support.MimeType",
"io.spotnext.core.management.annotation.Handler",
"io.spotnext.core.management.transformer.JsonResponseTransformer"
] |
import io.spotnext.core.infrastructure.annotation.logging.Log; import io.spotnext.core.infrastructure.http.DataResponse; import io.spotnext.core.infrastructure.http.HttpResponse; import io.spotnext.core.infrastructure.support.LogLevel; import io.spotnext.core.infrastructure.support.MimeType; import io.spotnext.core.management.annotation.Handler; import io.spotnext.core.management.transformer.JsonResponseTransformer;
|
import io.spotnext.core.infrastructure.annotation.logging.*; import io.spotnext.core.infrastructure.http.*; import io.spotnext.core.infrastructure.support.*; import io.spotnext.core.management.annotation.*; import io.spotnext.core.management.transformer.*;
|
[
"io.spotnext.core"
] |
io.spotnext.core;
| 1,300,708
|
@Test
public void testInterpret_validProgram_list_variable_postfix() {
doReturn(Value.of(ImmutableList.of(Complex.valueOf(2), Complex.valueOf(3)))).when(this.mockedMemory).getListVariableValue(ListVariable.fromName("ABC"));
getEnvironment().interpret("∟ABC²");
verifyLastResultValueList(4d, 9d);
}
|
void function() { doReturn(Value.of(ImmutableList.of(Complex.valueOf(2), Complex.valueOf(3)))).when(this.mockedMemory).getListVariableValue(ListVariable.fromName("ABC")); getEnvironment().interpret("∟ABC²"); verifyLastResultValueList(4d, 9d); }
|
/**
* Test if any postfix operators work with lists.
*/
|
Test if any postfix operators work with lists
|
testInterpret_validProgram_list_variable_postfix
|
{
"repo_name": "jhendess/tibaija",
"path": "src/test/java/org/xlrnet/tibaija/processor/InterpretListsTest.java",
"license": "mit",
"size": 8852
}
|
[
"com.google.common.collect.ImmutableList",
"org.apache.commons.math3.complex.Complex",
"org.mockito.Mockito",
"org.xlrnet.tibaija.commons.Value",
"org.xlrnet.tibaija.memory.ListVariable"
] |
import com.google.common.collect.ImmutableList; import org.apache.commons.math3.complex.Complex; import org.mockito.Mockito; import org.xlrnet.tibaija.commons.Value; import org.xlrnet.tibaija.memory.ListVariable;
|
import com.google.common.collect.*; import org.apache.commons.math3.complex.*; import org.mockito.*; import org.xlrnet.tibaija.commons.*; import org.xlrnet.tibaija.memory.*;
|
[
"com.google.common",
"org.apache.commons",
"org.mockito",
"org.xlrnet.tibaija"
] |
com.google.common; org.apache.commons; org.mockito; org.xlrnet.tibaija;
| 1,839,689
|
public void addFlight(FlightEntity flight);
|
void function(FlightEntity flight);
|
/**
* Add new airplane
* @param flight
*/
|
Add new airplane
|
addFlight
|
{
"repo_name": "raulsuarezdabo/flight",
"path": "src/main/java/com/raulsuarezdabo/flight/dao/FlightDAO.java",
"license": "mit",
"size": 3229
}
|
[
"com.raulsuarezdabo.flight.entity.FlightEntity"
] |
import com.raulsuarezdabo.flight.entity.FlightEntity;
|
import com.raulsuarezdabo.flight.entity.*;
|
[
"com.raulsuarezdabo.flight"
] |
com.raulsuarezdabo.flight;
| 89,303
|
@Schema(example = "1", description = "Notification ID")
public Integer getId() {
return id;
}
|
@Schema(example = "1", description = STR) Integer function() { return id; }
|
/**
* Notification ID
* @return id
**/
|
Notification ID
|
getId
|
{
"repo_name": "iterate-ch/cyberduck",
"path": "brick/src/main/java/ch/cyberduck/core/brick/io/swagger/client/model/ActionNotificationExportResultEntity.java",
"license": "gpl-3.0",
"size": 8855
}
|
[
"io.swagger.v3.oas.annotations.media.Schema"
] |
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.*;
|
[
"io.swagger.v3"
] |
io.swagger.v3;
| 2,790,578
|
@Test
public void testDupSentinels()
{
ReplaySequencer dut = new ReplaySequencer();
TransactionInfoBaseMessage sntl1 = makeSentinel(1L);
TransactionInfoBaseMessage frag1 = makeFragment(1L);
TransactionInfoBaseMessage cmpl1 = makeCompleteTxn(1L);
TransactionInfoBaseMessage init1 = makeIv2InitTask(2L);
TransactionInfoBaseMessage init2 = makeIv2InitTask(3L);
assertTrue(dut.offer(1L, sntl1));
assertTrue(dut.offer(1L, frag1));
assertTrue(dut.offer(2L, init1));
assertEquals(frag1, dut.poll());
assertEquals(init1, dut.poll());
assertFalse(dut.offer(1L, cmpl1));
assertNull(dut.poll());
assertNull(dut.dedupe(1L, sntl1)); // don't care about sentinels
assertTrue(dut.offer(1L, sntl1));
assertFalse(dut.offer(3L, init2));
assertNull(dut.poll());
}
|
void function() { ReplaySequencer dut = new ReplaySequencer(); TransactionInfoBaseMessage sntl1 = makeSentinel(1L); TransactionInfoBaseMessage frag1 = makeFragment(1L); TransactionInfoBaseMessage cmpl1 = makeCompleteTxn(1L); TransactionInfoBaseMessage init1 = makeIv2InitTask(2L); TransactionInfoBaseMessage init2 = makeIv2InitTask(3L); assertTrue(dut.offer(1L, sntl1)); assertTrue(dut.offer(1L, frag1)); assertTrue(dut.offer(2L, init1)); assertEquals(frag1, dut.poll()); assertEquals(init1, dut.poll()); assertFalse(dut.offer(1L, cmpl1)); assertNull(dut.poll()); assertNull(dut.dedupe(1L, sntl1)); assertTrue(dut.offer(1L, sntl1)); assertFalse(dut.offer(3L, init2)); assertNull(dut.poll()); }
|
/**
* No harm in sending duplicate sentinels
*/
|
No harm in sending duplicate sentinels
|
testDupSentinels
|
{
"repo_name": "kobronson/cs-voltdb",
"path": "tests/frontend/org/voltdb/iv2/TestReplaySequencer.java",
"license": "agpl-3.0",
"size": 27366
}
|
[
"org.voltcore.messaging.TransactionInfoBaseMessage"
] |
import org.voltcore.messaging.TransactionInfoBaseMessage;
|
import org.voltcore.messaging.*;
|
[
"org.voltcore.messaging"
] |
org.voltcore.messaging;
| 1,348,835
|
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ThemableView, defStyleAttr, defStyleRes);
int styleId = a.getResourceId(R.styleable.ThemableView_v_styleId, 0);
a.recycle();
return styleId;
}
|
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ThemableView, defStyleAttr, defStyleRes); int styleId = a.getResourceId(R.styleable.ThemableView_v_styleId, 0); a.recycle(); return styleId; }
|
/**
* Get the styleId from attributes.
* @param context
* @param attrs
* @param defStyleAttr
* @param defStyleRes
* @return The styleId.
*/
|
Get the styleId from attributes
|
getStyleId
|
{
"repo_name": "egojit8/MaterialEasyAndroid",
"path": "lib/src/main/java/com/egojit/android/app/ThemeManager.java",
"license": "apache-2.0",
"size": 8117
}
|
[
"android.content.res.TypedArray"
] |
import android.content.res.TypedArray;
|
import android.content.res.*;
|
[
"android.content"
] |
android.content;
| 2,783,707
|
public static String transform(Document doc, InputSource xsl) throws TransformerException {
return transform(doc, xsl, null);
}
|
static String function(Document doc, InputSource xsl) throws TransformerException { return transform(doc, xsl, null); }
|
/**
* transform a XML Document to another format, with help of a XSL Stylesheet
*
* @param doc xml to convert
* @param xsl xsl used to convert
* @return resulting string
* @throws TransformerException
* @throws SAXException
* @throws IOException
*/
|
transform a XML Document to another format, with help of a XSL Stylesheet
|
transform
|
{
"repo_name": "lucee/Lucee",
"path": "core/src/main/java/lucee/runtime/text/xml/XMLUtil.java",
"license": "lgpl-2.1",
"size": 49748
}
|
[
"javax.xml.transform.TransformerException",
"org.w3c.dom.Document",
"org.xml.sax.InputSource"
] |
import javax.xml.transform.TransformerException; import org.w3c.dom.Document; import org.xml.sax.InputSource;
|
import javax.xml.transform.*; import org.w3c.dom.*; import org.xml.sax.*;
|
[
"javax.xml",
"org.w3c.dom",
"org.xml.sax"
] |
javax.xml; org.w3c.dom; org.xml.sax;
| 2,673,188
|
public static List<Byte> toList(byte... array) {
PreCon.notNull(array);
ArrayList<Byte> result = new ArrayList<>(array.length + 5);
for (byte b : array) {
result.add(b);
}
return result;
}
|
static List<Byte> function(byte... array) { PreCon.notNull(array); ArrayList<Byte> result = new ArrayList<>(array.length + 5); for (byte b : array) { result.add(b); } return result; }
|
/**
* Convert an array to an array list.
*
* @param array The array to convert.
*/
|
Convert an array to an array list
|
toList
|
{
"repo_name": "JCThePants/NucleusFramework",
"path": "src/com/jcwhatever/nucleus/utils/ArrayUtils.java",
"license": "mit",
"size": 83295
}
|
[
"java.util.ArrayList",
"java.util.List"
] |
import java.util.ArrayList; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,472,183
|
@Test
public void testFillAndRead()
{
Map<Integer,Block> stored = new HashMap<Integer,Block>();
for (int i = 0 ; i < ram.getBlockCount() ; i += Math.max(ram.getBlockCount()/1000,1))
{
Block block = Block.create(i, getRandomBitMatrix(ram.getBlockSizeBits()), true);
stored.put(block.getId(), block);
System.out.printf("writing i = %d\n",i);
ram.storeBlock(block);
Block actual = ram.fetchBlock(block.getId());
assertTrue(areEqual(block, actual));
}
for (int i = 0 ; i < ram.getBlockCount() ; i += Math.max(ram.getBlockCount()/1000,1))
{
System.out.printf("reading i = %d\n",i);
assertTrue(areEqual(stored.get(i), ram.fetchBlock(i)));
}
}
|
void function() { Map<Integer,Block> stored = new HashMap<Integer,Block>(); for (int i = 0 ; i < ram.getBlockCount() ; i += Math.max(ram.getBlockCount()/1000,1)) { Block block = Block.create(i, getRandomBitMatrix(ram.getBlockSizeBits()), true); stored.put(block.getId(), block); System.out.printf(STR,i); ram.storeBlock(block); Block actual = ram.fetchBlock(block.getId()); assertTrue(areEqual(block, actual)); } for (int i = 0 ; i < ram.getBlockCount() ; i += Math.max(ram.getBlockCount()/1000,1)) { System.out.printf(STR,i); assertTrue(areEqual(stored.get(i), ram.fetchBlock(i))); } }
|
/**
* Fills the storage, then reads all written and asserts
*/
|
Fills the storage, then reads all written and asserts
|
testFillAndRead
|
{
"repo_name": "factcenter/inchworm",
"path": "src/test/java/org/factcenter/pathORam/test/BlockStorageTest.java",
"license": "mit",
"size": 3495
}
|
[
"java.util.HashMap",
"java.util.Map",
"org.factcenter.pathORam.Block",
"org.junit.Assert"
] |
import java.util.HashMap; import java.util.Map; import org.factcenter.pathORam.Block; import org.junit.Assert;
|
import java.util.*; import org.factcenter.*; import org.junit.*;
|
[
"java.util",
"org.factcenter",
"org.junit"
] |
java.util; org.factcenter; org.junit;
| 1,880,197
|
List<String> asEnumMembers();
|
List<String> asEnumMembers();
|
/**
* A list of enum members or empty list if this expression is of type primitive or geospatial.
* @return a list of all enum members or empty list
*/
|
A list of enum members or empty list if this expression is of type primitive or geospatial
|
asEnumMembers
|
{
"repo_name": "apache/olingo-odata4",
"path": "lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmConstantExpression.java",
"license": "apache-2.0",
"size": 1918
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 415,411
|
@Test
public void not_equal_to_state_with_different_puzzle()
{
PuzzleState a = new PuzzleState(getSolvedPuzzle());
PuzzleState b = new PuzzleState(getPuzzle(2));
assertNotEquals(a, b);
}
|
void function() { PuzzleState a = new PuzzleState(getSolvedPuzzle()); PuzzleState b = new PuzzleState(getPuzzle(2)); assertNotEquals(a, b); }
|
/**
* Is not equal to another state when the puzzles are different
*/
|
Is not equal to another state when the puzzles are different
|
not_equal_to_state_with_different_puzzle
|
{
"repo_name": "TeachingKidsProgramming/TeachingKidsProgramming.Source.Java",
"path": "src/test/java/org/teachingextensions/logo/PuzzleStateTest.java",
"license": "apache-2.0",
"size": 4392
}
|
[
"org.junit.Assert",
"org.teachingextensions.logo.utils.PuzzleUtils"
] |
import org.junit.Assert; import org.teachingextensions.logo.utils.PuzzleUtils;
|
import org.junit.*; import org.teachingextensions.logo.utils.*;
|
[
"org.junit",
"org.teachingextensions.logo"
] |
org.junit; org.teachingextensions.logo;
| 1,519,359
|
public JSONObject put(String key, Collection value) throws JSONException {
put(key, new JSONArray(value));
return this;
}
|
JSONObject function(String key, Collection value) throws JSONException { put(key, new JSONArray(value)); return this; }
|
/**
* Put a key/value pair in the JSONObject, where the value will be a
* JSONArray which is produced from a Collection.
* @param key A key string.
* @param value A Collection value.
* @return this.
* @throws JSONException
*/
|
Put a key/value pair in the JSONObject, where the value will be a JSONArray which is produced from a Collection
|
put
|
{
"repo_name": "Appverse/appverse-mobile",
"path": "appverse-core/src/java/com/gft/unity/core/json/JSONObject.java",
"license": "mpl-2.0",
"size": 55955
}
|
[
"java.util.Collection"
] |
import java.util.Collection;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,472,990
|
public List<IncludeScannable> getLipoScannables() {
return lipoScannables;
}
|
List<IncludeScannable> function() { return lipoScannables; }
|
/**
* Returns the {@link IncludeScannable} objects this C++ compile action contributes to a
* LIPO context collector.
*/
|
Returns the <code>IncludeScannable</code> objects this C++ compile action contributes to a LIPO context collector
|
getLipoScannables
|
{
"repo_name": "variac/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationOutputs.java",
"license": "apache-2.0",
"size": 8900
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,203,716
|
public static void dumpMifareClassic1KCard(MfReaderWriter reader, MfCard card, List<String> keys)
throws CardException {
for (int sectorIndex = 0; sectorIndex < MIFARE_1K_SECTOR_COUNT; sectorIndex++) {
// For each sector...
for (int blockIndex = 0; blockIndex < MIFARE_1K_PER_SECTOR_BLOCK_COUNT; blockIndex++) {
// For each block...
dumpMifareClassic1KBlock(reader, card, sectorIndex, blockIndex, keys);
}
}
}
|
static void function(MfReaderWriter reader, MfCard card, List<String> keys) throws CardException { for (int sectorIndex = 0; sectorIndex < MIFARE_1K_SECTOR_COUNT; sectorIndex++) { for (int blockIndex = 0; blockIndex < MIFARE_1K_PER_SECTOR_BLOCK_COUNT; blockIndex++) { dumpMifareClassic1KBlock(reader, card, sectorIndex, blockIndex, keys); } } }
|
/**
* Dumps a Mifare Classic 1K card.
* @param reader the reader
* @param card the card
* @param keys the keys to be tested for reading
*/
|
Dumps a Mifare Classic 1K card
|
dumpMifareClassic1KCard
|
{
"repo_name": "mdeverdelhan/ACR122U-reader-writer",
"path": "src/main/java/eu/verdelhan/acr122urw/MifareUtils.java",
"license": "mit",
"size": 9703
}
|
[
"java.util.List",
"javax.smartcardio.CardException",
"org.nfctools.mf.MfReaderWriter",
"org.nfctools.mf.card.MfCard"
] |
import java.util.List; import javax.smartcardio.CardException; import org.nfctools.mf.MfReaderWriter; import org.nfctools.mf.card.MfCard;
|
import java.util.*; import javax.smartcardio.*; import org.nfctools.mf.*; import org.nfctools.mf.card.*;
|
[
"java.util",
"javax.smartcardio",
"org.nfctools.mf"
] |
java.util; javax.smartcardio; org.nfctools.mf;
| 2,411,277
|
public void remove(int index)
{
super.remove(index);
GridBagConstraints constraints = new GridBagConstraints();
constraints.fill = GridBagConstraints.BOTH;
constraints.weightx = 100.0;
constraints.weighty = 100.0;
Component[] items = getComponents();
for (int i = index; i < items.length; i++)
{
constraints.gridy = i;
super.add(items[i], constraints, i);
}
}
|
void function(int index) { super.remove(index); GridBagConstraints constraints = new GridBagConstraints(); constraints.fill = GridBagConstraints.BOTH; constraints.weightx = 100.0; constraints.weighty = 100.0; Component[] items = getComponents(); for (int i = index; i < items.length; i++) { constraints.gridy = i; super.add(items[i], constraints, i); } }
|
/**
* Revomes component at the given index from the menu.
*
* @param index index of the component that will be removed in the menu
*/
|
Revomes component at the given index from the menu
|
remove
|
{
"repo_name": "aosm/gcc_40",
"path": "libjava/javax/swing/JPopupMenu.java",
"license": "gpl-2.0",
"size": 30899
}
|
[
"java.awt.Component",
"java.awt.GridBagConstraints"
] |
import java.awt.Component; import java.awt.GridBagConstraints;
|
import java.awt.*;
|
[
"java.awt"
] |
java.awt;
| 1,960,433
|
public void testHashCodeUnequal() {
String a = "8478231212478987482988429808779810457634781384756794987";
int aScale = 41;
String b = "92948782094488478231212478987482988429808779810457634781384756794987";
int bScale = -24;
BigDecimal aNumber = new BigDecimal(new BigInteger(a), aScale);
BigDecimal bNumber = new BigDecimal(new BigInteger(b), bScale);
assertTrue("incorrect value", aNumber.hashCode() != bNumber.hashCode());
}
|
void function() { String a = STR; int aScale = 41; String b = STR; int bScale = -24; BigDecimal aNumber = new BigDecimal(new BigInteger(a), aScale); BigDecimal bNumber = new BigDecimal(new BigInteger(b), bScale); assertTrue(STR, aNumber.hashCode() != bNumber.hashCode()); }
|
/**
* hashCode() for unequal BigDecimals
*/
|
hashCode() for unequal BigDecimals
|
testHashCodeUnequal
|
{
"repo_name": "shannah/cn1",
"path": "Ports/iOSPort/xmlvm/apache-harmony-6.0-src-r991881/classlib/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalCompareTest.java",
"license": "gpl-2.0",
"size": 20607
}
|
[
"java.math.BigDecimal",
"java.math.BigInteger"
] |
import java.math.BigDecimal; import java.math.BigInteger;
|
import java.math.*;
|
[
"java.math"
] |
java.math;
| 2,791,716
|
private static void createHandshakeInstance() throws Exception {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createHandshakeInstance");
try {
instance = Class.forName(MfpConstants.COMP_HANDSHAKE_CLASS).newInstance();
} catch (Exception e) {
FFDCFilter.processException(e, "com.ibm.ws.sib.mfp.CompHandshakeFactory.createHandshakeInstance", "88");
SibTr.error(tc, "UNABLE_TO_CREATE_COMPHANDSHAKE_CWSIF0051", e);
throw e;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createHandshakeInstance");
}
|
static void function() throws Exception { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, STR); try { instance = Class.forName(MfpConstants.COMP_HANDSHAKE_CLASS).newInstance(); } catch (Exception e) { FFDCFilter.processException(e, STR, "88"); SibTr.error(tc, STR, e); throw e; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, STR); }
|
/**
* Create the singleton ComponentHandshake instance.
*
* @exception Exception The method rethrows any Exception caught during
* creaton of the singleton object.
*/
|
Create the singleton ComponentHandshake instance
|
createHandshakeInstance
|
{
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/CompHandshakeFactory.java",
"license": "epl-1.0",
"size": 2976
}
|
[
"com.ibm.websphere.ras.TraceComponent",
"com.ibm.ws.ffdc.FFDCFilter",
"com.ibm.ws.sib.mfp.MfpConstants",
"com.ibm.ws.sib.utils.ras.SibTr"
] |
import com.ibm.websphere.ras.TraceComponent; import com.ibm.ws.ffdc.FFDCFilter; import com.ibm.ws.sib.mfp.MfpConstants; import com.ibm.ws.sib.utils.ras.SibTr;
|
import com.ibm.websphere.ras.*; import com.ibm.ws.ffdc.*; import com.ibm.ws.sib.mfp.*; import com.ibm.ws.sib.utils.ras.*;
|
[
"com.ibm.websphere",
"com.ibm.ws"
] |
com.ibm.websphere; com.ibm.ws;
| 389,361
|
public static Object createVariable(Constants.TYPES type, String value) {
if (type.equals(Constants.TYPES.STRING)) {
return String.valueOf(value);
} else if (type.equals(Constants.TYPES.INTEGER)) {
return Integer.valueOf(value);
} else if (type.equals(Constants.TYPES.BOOLEAN)) {
return Boolean.valueOf(value);
} else if (type.equals(Constants.TYPES.DOUBLE)) {
return Double.valueOf(value);
} else if (type.equals(Constants.TYPES.FLOAT)) {
return Float.valueOf(value);
} else if (type.equals(Constants.TYPES.LONG)) {
return Long.valueOf(value);
} else if (type.equals(Constants.TYPES.SHORT)) {
return Short.valueOf(value);
} else if (type.equals(Constants.TYPES.MESSAGE)) {
return new DefaultCarbonMessage();
} else if (type.equals(Constants.TYPES.XML)) {
log.info("XML Variable type not yet implemented! Using string instead.");
return String.valueOf(value);
} else if (type.equals(Constants.TYPES.JSON)) {
log.info("JSON Variable type not yet implemented! Using string instead.");
return String.valueOf(value);
} else {
log.error("Unrecognized variable type " + type);
return null;
}
}
|
static Object function(Constants.TYPES type, String value) { if (type.equals(Constants.TYPES.STRING)) { return String.valueOf(value); } else if (type.equals(Constants.TYPES.INTEGER)) { return Integer.valueOf(value); } else if (type.equals(Constants.TYPES.BOOLEAN)) { return Boolean.valueOf(value); } else if (type.equals(Constants.TYPES.DOUBLE)) { return Double.valueOf(value); } else if (type.equals(Constants.TYPES.FLOAT)) { return Float.valueOf(value); } else if (type.equals(Constants.TYPES.LONG)) { return Long.valueOf(value); } else if (type.equals(Constants.TYPES.SHORT)) { return Short.valueOf(value); } else if (type.equals(Constants.TYPES.MESSAGE)) { return new DefaultCarbonMessage(); } else if (type.equals(Constants.TYPES.XML)) { log.info(STR); return String.valueOf(value); } else if (type.equals(Constants.TYPES.JSON)) { log.info(STR); return String.valueOf(value); } else { log.error(STR + type); return null; } }
|
/**
* Provides instantiated object of give variable type.
* @param type
* @param value
* @return Object of variable type
*/
|
Provides instantiated object of give variable type
|
createVariable
|
{
"repo_name": "hasithajayasundara/carbon-gateway-framework",
"path": "ballerina-core/components/org.wso2.ballerina.core/src/main/java/org/wso2/ballerina/core/util/VariableUtil.java",
"license": "apache-2.0",
"size": 12769
}
|
[
"org.wso2.ballerina.core.Constants",
"org.wso2.carbon.messaging.DefaultCarbonMessage"
] |
import org.wso2.ballerina.core.Constants; import org.wso2.carbon.messaging.DefaultCarbonMessage;
|
import org.wso2.ballerina.core.*; import org.wso2.carbon.messaging.*;
|
[
"org.wso2.ballerina",
"org.wso2.carbon"
] |
org.wso2.ballerina; org.wso2.carbon;
| 273,298
|
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
|
void function(ObjectInputStream s) throws InvalidObjectException { throw new InvalidObjectException(STR); }
|
/**
* Defend against malicious streams.
*
* @param s the stream to read
* @throws InvalidObjectException always
*/
|
Defend against malicious streams
|
readObject
|
{
"repo_name": "JetBrains/jdk8u_jdk",
"path": "src/share/classes/java/time/chrono/JapaneseChronology.java",
"license": "gpl-2.0",
"size": 21423
}
|
[
"java.io.InvalidObjectException",
"java.io.ObjectInputStream"
] |
import java.io.InvalidObjectException; import java.io.ObjectInputStream;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 34,678
|
public static void loadFromFile(Properties p, File file) throws IOException {
FileInputStream fis = null;
try {
fis = new FileInputStream(file);
p.load(fis);
} finally {
StreamUtil.close(fis);
}
}
|
static void function(Properties p, File file) throws IOException { FileInputStream fis = null; try { fis = new FileInputStream(file); p.load(fis); } finally { StreamUtil.close(fis); } }
|
/**
* Loads properties from the file. Properties are appended to the existing
* properties object.
*
* @param p properties to fill in
* @param file file to read properties from
*/
|
Loads properties from the file. Properties are appended to the existing properties object
|
loadFromFile
|
{
"repo_name": "007slm/jodd",
"path": "jodd-core/src/main/java/jodd/util/PropertiesUtil.java",
"license": "bsd-3-clause",
"size": 6748
}
|
[
"java.io.File",
"java.io.FileInputStream",
"java.io.IOException",
"java.util.Properties"
] |
import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.util.Properties;
|
import java.io.*; import java.util.*;
|
[
"java.io",
"java.util"
] |
java.io; java.util;
| 2,352,865
|
@ScalarFunction
public static String[] split(String input, String delimiter) {
return StringUtils.split(input, delimiter);
}
|
static String[] function(String input, String delimiter) { return StringUtils.split(input, delimiter); }
|
/**
* see String#split(String)
* @param input
* @param delimiter
* @return splits string on specified delimiter and returns an array.
*/
|
see String#split(String)
|
split
|
{
"repo_name": "linkedin/pinot",
"path": "pinot-common/src/main/java/org/apache/pinot/common/function/scalar/StringFunctions.java",
"license": "apache-2.0",
"size": 10261
}
|
[
"org.apache.commons.lang3.StringUtils"
] |
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.*;
|
[
"org.apache.commons"
] |
org.apache.commons;
| 642,825
|
public DataNode setName(IDataset name);
|
DataNode function(IDataset name);
|
/**
* Descriptive name of sample
*
* @param name the name
*/
|
Descriptive name of sample
|
setName
|
{
"repo_name": "jamesmudd/dawnsci",
"path": "org.eclipse.dawnsci.nexus/autogen/org/eclipse/dawnsci/nexus/NXsample.java",
"license": "epl-1.0",
"size": 48938
}
|
[
"org.eclipse.dawnsci.analysis.api.tree.DataNode",
"org.eclipse.january.dataset.IDataset"
] |
import org.eclipse.dawnsci.analysis.api.tree.DataNode; import org.eclipse.january.dataset.IDataset;
|
import org.eclipse.dawnsci.analysis.api.tree.*; import org.eclipse.january.dataset.*;
|
[
"org.eclipse.dawnsci",
"org.eclipse.january"
] |
org.eclipse.dawnsci; org.eclipse.january;
| 2,574,713
|
List<ServerProfileSchemaDto> getServerProfileSchemasByApplicationId(String applicationId) throws ControlServiceException;
|
List<ServerProfileSchemaDto> getServerProfileSchemasByApplicationId(String applicationId) throws ControlServiceException;
|
/**
* Gets the server profile schemas by application id.
*
* @param applicationId
* the application id
* @return the server profile schemas by application id
* @throws ControlServiceException
* the control service exception
*/
|
Gets the server profile schemas by application id
|
getServerProfileSchemasByApplicationId
|
{
"repo_name": "forGGe/kaa",
"path": "server/node/src/main/java/org/kaaproject/kaa/server/control/service/ControlService.java",
"license": "apache-2.0",
"size": 61702
}
|
[
"java.util.List",
"org.kaaproject.kaa.common.dto.ServerProfileSchemaDto",
"org.kaaproject.kaa.server.control.service.exception.ControlServiceException"
] |
import java.util.List; import org.kaaproject.kaa.common.dto.ServerProfileSchemaDto; import org.kaaproject.kaa.server.control.service.exception.ControlServiceException;
|
import java.util.*; import org.kaaproject.kaa.common.dto.*; import org.kaaproject.kaa.server.control.service.exception.*;
|
[
"java.util",
"org.kaaproject.kaa"
] |
java.util; org.kaaproject.kaa;
| 2,449,587
|
@Test
public void testEscapeNonStringValue()
{
Object value = 42;
assertEquals("Wrong escaped object", value,
handler.escape(value, ListDelimiterHandler.NOOP_TRANSFORMER));
}
|
void function() { Object value = 42; assertEquals(STR, value, handler.escape(value, ListDelimiterHandler.NOOP_TRANSFORMER)); }
|
/**
* Tests whether a non-string value is correctly escaped. The object should
* not be modified.
*/
|
Tests whether a non-string value is correctly escaped. The object should not be modified
|
testEscapeNonStringValue
|
{
"repo_name": "mohanaraosv/commons-configuration",
"path": "src/test/java/org/apache/commons/configuration2/convert/TestDisabledListDelimiterHandler.java",
"license": "apache-2.0",
"size": 6784
}
|
[
"org.junit.Assert"
] |
import org.junit.Assert;
|
import org.junit.*;
|
[
"org.junit"
] |
org.junit;
| 1,472,884
|
public String getCourseStudentListAsCsv(String courseId, String googleId) throws EntityDoesNotExistException {
Map<String, CourseDetailsBundle> courses = getCourseSummariesForInstructor(googleId, false);
CourseDetailsBundle course = courses.get(courseId);
boolean hasSection = hasIndicatedSections(courseId);
StringBuilder export = new StringBuilder(100);
String courseInfo = "Course ID," + SanitizationHelper.sanitizeForCsv(courseId) + Const.EOL
+ "Course Name," + SanitizationHelper.sanitizeForCsv(course.course.getName()) + Const.EOL
+ Const.EOL + Const.EOL;
export.append(courseInfo);
String header = (hasSection ? "Section," : "") + "Team,Full Name,Last Name,Status,Email" + Const.EOL;
export.append(header);
for (SectionDetailsBundle section : course.sections) {
for (TeamDetailsBundle team : section.teams) {
for (StudentAttributes student : team.students) {
String studentStatus = null;
if (student.googleId == null || student.googleId.isEmpty()) {
studentStatus = Const.STUDENT_COURSE_STATUS_YET_TO_JOIN;
} else {
studentStatus = Const.STUDENT_COURSE_STATUS_JOINED;
}
if (hasSection) {
export.append(SanitizationHelper.sanitizeForCsv(section.name)).append(',');
}
export.append(SanitizationHelper.sanitizeForCsv(team.name) + ','
+ SanitizationHelper.sanitizeForCsv(StringHelper.removeExtraSpace(student.name)) + ','
+ SanitizationHelper.sanitizeForCsv(StringHelper.removeExtraSpace(student.lastName)) + ','
+ SanitizationHelper.sanitizeForCsv(studentStatus) + ','
+ SanitizationHelper.sanitizeForCsv(student.email) + Const.EOL);
}
}
}
return export.toString();
}
|
String function(String courseId, String googleId) throws EntityDoesNotExistException { Map<String, CourseDetailsBundle> courses = getCourseSummariesForInstructor(googleId, false); CourseDetailsBundle course = courses.get(courseId); boolean hasSection = hasIndicatedSections(courseId); StringBuilder export = new StringBuilder(100); String courseInfo = STR + SanitizationHelper.sanitizeForCsv(courseId) + Const.EOL + STR + SanitizationHelper.sanitizeForCsv(course.course.getName()) + Const.EOL + Const.EOL + Const.EOL; export.append(courseInfo); String header = (hasSection ? STR : STRTeam,Full Name,Last Name,Status,Email" + Const.EOL; export.append(header); for (SectionDetailsBundle section : course.sections) { for (TeamDetailsBundle team : section.teams) { for (StudentAttributes student : team.students) { String studentStatus = null; if (student.googleId == null student.googleId.isEmpty()) { studentStatus = Const.STUDENT_COURSE_STATUS_YET_TO_JOIN; } else { studentStatus = Const.STUDENT_COURSE_STATUS_JOINED; } if (hasSection) { export.append(SanitizationHelper.sanitizeForCsv(section.name)).append(','); } export.append(SanitizationHelper.sanitizeForCsv(team.name) + ',' + SanitizationHelper.sanitizeForCsv(StringHelper.removeExtraSpace(student.name)) + ',' + SanitizationHelper.sanitizeForCsv(StringHelper.removeExtraSpace(student.lastName)) + ',' + SanitizationHelper.sanitizeForCsv(studentStatus) + ',' + SanitizationHelper.sanitizeForCsv(student.email) + Const.EOL); } } } return export.toString(); }
|
/**
* Returns a CSV for the details (name, email, status) of all students belonging to a given course.
*/
|
Returns a CSV for the details (name, email, status) of all students belonging to a given course
|
getCourseStudentListAsCsv
|
{
"repo_name": "Mynk96/teammates",
"path": "src/main/java/teammates/logic/core/CoursesLogic.java",
"license": "gpl-2.0",
"size": 29793
}
|
[
"java.util.Map"
] |
import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,442,092
|
public List<SortedSet<Literal>> getPrimeImplicates() {
return this.primeImplicates;
}
|
List<SortedSet<Literal>> function() { return this.primeImplicates; }
|
/**
* Returns the list of prime implicates.
* @return the list of prime implicates
*/
|
Returns the list of prime implicates
|
getPrimeImplicates
|
{
"repo_name": "logic-ng/LogicNG",
"path": "src/main/java/org/logicng/primecomputation/PrimeResult.java",
"license": "apache-2.0",
"size": 5103
}
|
[
"java.util.List",
"java.util.SortedSet",
"org.logicng.formulas.Literal"
] |
import java.util.List; import java.util.SortedSet; import org.logicng.formulas.Literal;
|
import java.util.*; import org.logicng.formulas.*;
|
[
"java.util",
"org.logicng.formulas"
] |
java.util; org.logicng.formulas;
| 1,333,109
|
private void throwIfClosed() throws AlreadyClosedSqlException,
SQLException {
// Statement.isClosed() call is to avoid exception from getResultSet().
if (statement.isClosed()
|| (statement.getResultSet() != null // result set doesn't exist for prepared statement cases
&& statement.getResultSet().isClosed())) {
throw new AlreadyClosedSqlException(
"ResultSetMetaData's ResultSet is already closed." );
}
}
|
void function() throws AlreadyClosedSqlException, SQLException { if (statement.isClosed() (statement.getResultSet() != null && statement.getResultSet().isClosed())) { throw new AlreadyClosedSqlException( STR ); } }
|
/**
* Throws AlreadyClosedSqlException if the associated ResultSet is closed.
*
* @throws AlreadyClosedSqlException if ResultSet is closed
* @throws SQLException if error in checking ResultSet's status
*/
|
Throws AlreadyClosedSqlException if the associated ResultSet is closed
|
throwIfClosed
|
{
"repo_name": "tgrall/drill",
"path": "exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillResultSetMetaDataImpl.java",
"license": "apache-2.0",
"size": 7045
}
|
[
"java.sql.SQLException",
"org.apache.drill.jdbc.AlreadyClosedSqlException"
] |
import java.sql.SQLException; import org.apache.drill.jdbc.AlreadyClosedSqlException;
|
import java.sql.*; import org.apache.drill.jdbc.*;
|
[
"java.sql",
"org.apache.drill"
] |
java.sql; org.apache.drill;
| 1,246,390
|
@POST
@RolesAllowed("responsable_formation")
public Response postUe(Ue ue) {
return Response.ok("Ajouter une UE dans la promotion").build();
}
|
@RolesAllowed(STR) Response function(Ue ue) { return Response.ok(STR).build(); }
|
/**
* Ajouter une UE dans la promotion
*
* @param ue
* L'UE à ajouter à la promotion
*
* @return Le code de retour de l'ajout à la base
*/
|
Ajouter une UE dans la promotion
|
postUe
|
{
"repo_name": "ThomasFerro/lup1",
"path": "src/main/java/fr/da2i/lup1/resource/ue/UePromotionResource.java",
"license": "gpl-3.0",
"size": 2709
}
|
[
"fr.da2i.lup1.entity.note.Ue",
"javax.annotation.security.RolesAllowed",
"javax.ws.rs.core.Response"
] |
import fr.da2i.lup1.entity.note.Ue; import javax.annotation.security.RolesAllowed; import javax.ws.rs.core.Response;
|
import fr.da2i.lup1.entity.note.*; import javax.annotation.security.*; import javax.ws.rs.core.*;
|
[
"fr.da2i.lup1",
"javax.annotation",
"javax.ws"
] |
fr.da2i.lup1; javax.annotation; javax.ws;
| 2,543,384
|
private void indexFiles() {
String[] initialFiles = this.initialFiles;
if (initialFiles != null) {
this.initialFiles = null;
// Files on disk only, sorted by last modified time.
// TODO: Use last access time.
Set<CacheFile> diskOnly = new TreeSet<CacheFile>();
for (String name : initialFiles) {
// If the file hasn't been accessed in this process...
if (!accessOrder.containsKey(name)) {
diskOnly.add(new CacheFile(directory, name));
}
}
if (!diskOnly.isEmpty()) {
// Add files not accessed in this process to the beginning
// of accessOrder.
Map<String, File> newOrder = newAccessOrder();
for (CacheFile cacheFile : diskOnly) {
newOrder.put(cacheFile.name, cacheFile);
}
newOrder.putAll(accessOrder);
this.accessOrder = newOrder;
}
}
}
|
void function() { String[] initialFiles = this.initialFiles; if (initialFiles != null) { this.initialFiles = null; Set<CacheFile> diskOnly = new TreeSet<CacheFile>(); for (String name : initialFiles) { if (!accessOrder.containsKey(name)) { diskOnly.add(new CacheFile(directory, name)); } } if (!diskOnly.isEmpty()) { Map<String, File> newOrder = newAccessOrder(); for (CacheFile cacheFile : diskOnly) { newOrder.put(cacheFile.name, cacheFile); } newOrder.putAll(accessOrder); this.accessOrder = newOrder; } } }
|
/**
* Lazily updates accessOrder to know about all files as opposed to
* just the files accessed since this process started.
*/
|
Lazily updates accessOrder to know about all files as opposed to just the files accessed since this process started
|
indexFiles
|
{
"repo_name": "rex-xxx/mt6572_x201",
"path": "libcore/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/FileClientSessionCache.java",
"license": "gpl-2.0",
"size": 12715
}
|
[
"java.io.File",
"java.util.Map",
"java.util.Set",
"java.util.TreeSet"
] |
import java.io.File; import java.util.Map; import java.util.Set; import java.util.TreeSet;
|
import java.io.*; import java.util.*;
|
[
"java.io",
"java.util"
] |
java.io; java.util;
| 805,631
|
public static void setCustomStateMapper(Block block, IStateMapper mapper)
{
customStateMappers.put(block.delegate, mapper);
}
|
static void function(Block block, IStateMapper mapper) { customStateMappers.put(block.delegate, mapper); }
|
/**
* Adds a custom IBlockState -> model variant logic.
*/
|
Adds a custom IBlockState -> model variant logic
|
setCustomStateMapper
|
{
"repo_name": "jdpadrnos/MinecraftForge",
"path": "src/main/java/net/minecraftforge/client/model/ModelLoader.java",
"license": "lgpl-2.1",
"size": 51606
}
|
[
"net.minecraft.block.Block",
"net.minecraft.client.renderer.block.statemap.IStateMapper"
] |
import net.minecraft.block.Block; import net.minecraft.client.renderer.block.statemap.IStateMapper;
|
import net.minecraft.block.*; import net.minecraft.client.renderer.block.statemap.*;
|
[
"net.minecraft.block",
"net.minecraft.client"
] |
net.minecraft.block; net.minecraft.client;
| 1,656,815
|
@Override
public void close() throws HiveSQLException {
try {
acquire(true);
cancelDelegationToken();
} finally {
try {
super.close();
} finally {
try {
FileSystem.closeAllForUGI(sessionUgi);
} catch (IOException ioe) {
throw new HiveSQLException("Could not clean up file-system handles for UGI: "
+ sessionUgi, ioe);
}
}
}
}
|
void function() throws HiveSQLException { try { acquire(true); cancelDelegationToken(); } finally { try { super.close(); } finally { try { FileSystem.closeAllForUGI(sessionUgi); } catch (IOException ioe) { throw new HiveSQLException(STR + sessionUgi, ioe); } } } }
|
/**
* Close the file systems for the session and remove it from the FileSystem cache.
* Cancel the session's delegation token and close the metastore connection
*/
|
Close the file systems for the session and remove it from the FileSystem cache. Cancel the session's delegation token and close the metastore connection
|
close
|
{
"repo_name": "wangbin83-gmail-com/hive-1.1.0-cdh5.4.8",
"path": "service/src/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java",
"license": "apache-2.0",
"size": 6702
}
|
[
"java.io.IOException",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hive.service.cli.HiveSQLException"
] |
import java.io.IOException; import org.apache.hadoop.fs.FileSystem; import org.apache.hive.service.cli.HiveSQLException;
|
import java.io.*; import org.apache.hadoop.fs.*; import org.apache.hive.service.cli.*;
|
[
"java.io",
"org.apache.hadoop",
"org.apache.hive"
] |
java.io; org.apache.hadoop; org.apache.hive;
| 960,378
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.