method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public FeatureResultSet queryFeaturesForChunk(boolean distinct, String[] columns, BoundingBox boundingBox, Projection projection, String where, String[] whereArgs, int limit, long offset) { return queryFeaturesForChunk(distinct, columns, boundingBox, projection, where, whereArgs, getPkColumnName(), limit, offset); }
FeatureResultSet function(boolean distinct, String[] columns, BoundingBox boundingBox, Projection projection, String where, String[] whereArgs, int limit, long offset) { return queryFeaturesForChunk(distinct, columns, boundingBox, projection, where, whereArgs, getPkColumnName(), limit, offset); }
/** * Query for features within the bounding box in the provided projection * ordered by id, starting at the offset and returning no more than the * limit * * @param distinct * distinct rows * @param columns * columns * @param boundingBox * bounding box * @param projection * projection * @param where * where clause * @param whereArgs * where arguments * @param limit * chunk limit * @param offset * chunk query offset * @return feature results * @since 6.2.0 */
Query for features within the bounding box in the provided projection ordered by id, starting at the offset and returning no more than the limit
queryFeaturesForChunk
{ "repo_name": "ngageoint/geopackage-java", "path": "src/main/java/mil/nga/geopackage/extension/rtree/RTreeIndexTableDao.java", "license": "mit", "size": 349361 }
[ "mil.nga.geopackage.BoundingBox", "mil.nga.geopackage.features.user.FeatureResultSet", "mil.nga.proj.Projection" ]
import mil.nga.geopackage.BoundingBox; import mil.nga.geopackage.features.user.FeatureResultSet; import mil.nga.proj.Projection;
import mil.nga.geopackage.*; import mil.nga.geopackage.features.user.*; import mil.nga.proj.*;
[ "mil.nga.geopackage", "mil.nga.proj" ]
mil.nga.geopackage; mil.nga.proj;
1,962,629
public void setName(Name name) { this.name = name; }
void function(Name name) { this.name = name; }
/** * The name of the effect. * * @param name the Name. */
The name of the effect
setName
{ "repo_name": "NABUCCO/org.nabucco.framework.workflow", "path": "org.nabucco.framework.workflow.facade.datatype/src/main/gen/org/nabucco/framework/workflow/facade/datatype/definition/effect/WorkflowEffect.java", "license": "epl-1.0", "size": 11615 }
[ "org.nabucco.framework.base.facade.datatype.Name" ]
import org.nabucco.framework.base.facade.datatype.Name;
import org.nabucco.framework.base.facade.datatype.*;
[ "org.nabucco.framework" ]
org.nabucco.framework;
194,908
public CompletableFuture<GrpcDeleteOperationResponse> deleteConfigLogicalPort(String switchAddress, Integer port) { GrpcSession sender = new GrpcSession(mapper, switchAddress); return sender.login(name, password) .thenCompose(e -> sender.deleteLogicalPort(port)) .thenApply(optional -> optional .map(value -> new GrpcDeleteOperationResponse(value.getReplyStatus() == 0)) .orElseThrow(() -> new GrpcException(format("Could not delete logical port %d for switch %s", port, switchAddress)))) .whenComplete((e, ex) -> sender.shutdown()); }
CompletableFuture<GrpcDeleteOperationResponse> function(String switchAddress, Integer port) { GrpcSession sender = new GrpcSession(mapper, switchAddress); return sender.login(name, password) .thenCompose(e -> sender.deleteLogicalPort(port)) .thenApply(optional -> optional .map(value -> new GrpcDeleteOperationResponse(value.getReplyStatus() == 0)) .orElseThrow(() -> new GrpcException(format(STR, port, switchAddress)))) .whenComplete((e, ex) -> sender.shutdown()); }
/** * Deletes logical port config. * * @param switchAddress the switch address. * @param port the port number. * @return {@link CompletableFuture} with the execution result. */
Deletes logical port config
deleteConfigLogicalPort
{ "repo_name": "jonvestal/open-kilda", "path": "src-java/grpc-speaker/grpc-service/src/main/java/org/openkilda/grpc/speaker/service/GrpcSenderService.java", "license": "apache-2.0", "size": 13699 }
[ "java.util.concurrent.CompletableFuture", "org.openkilda.grpc.speaker.client.GrpcSession", "org.openkilda.grpc.speaker.exception.GrpcException", "org.openkilda.grpc.speaker.model.GrpcDeleteOperationResponse" ]
import java.util.concurrent.CompletableFuture; import org.openkilda.grpc.speaker.client.GrpcSession; import org.openkilda.grpc.speaker.exception.GrpcException; import org.openkilda.grpc.speaker.model.GrpcDeleteOperationResponse;
import java.util.concurrent.*; import org.openkilda.grpc.speaker.client.*; import org.openkilda.grpc.speaker.exception.*; import org.openkilda.grpc.speaker.model.*;
[ "java.util", "org.openkilda.grpc" ]
java.util; org.openkilda.grpc;
431,145
public void readEntityFromNBT(NBTTagCompound tagCompund) { super.readEntityFromNBT(tagCompund); this.dataWatcher.updateObject(17, Byte.valueOf((byte)(tagCompund.getBoolean("powered") ? 1 : 0))); if (tagCompund.hasKey("Fuse", 99)) { this.fuseTime = tagCompund.getShort("Fuse"); } if (tagCompund.hasKey("ExplosionRadius", 99)) { this.explosionRadius = tagCompund.getByte("ExplosionRadius"); } if (tagCompund.getBoolean("ignited")) { this.ignite(); } }
void function(NBTTagCompound tagCompund) { super.readEntityFromNBT(tagCompund); this.dataWatcher.updateObject(17, Byte.valueOf((byte)(tagCompund.getBoolean(STR) ? 1 : 0))); if (tagCompund.hasKey("Fuse", 99)) { this.fuseTime = tagCompund.getShort("Fuse"); } if (tagCompund.hasKey(STR, 99)) { this.explosionRadius = tagCompund.getByte(STR); } if (tagCompund.getBoolean(STR)) { this.ignite(); } }
/** * (abstract) Protected helper method to read subclass entity data from NBT. */
(abstract) Protected helper method to read subclass entity data from NBT
readEntityFromNBT
{ "repo_name": "TorchPowered/CraftBloom", "path": "src/net/minecraft/entity/monster/EntityCreeper.java", "license": "mit", "size": 9564 }
[ "net.minecraft.nbt.NBTTagCompound" ]
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.*;
[ "net.minecraft.nbt" ]
net.minecraft.nbt;
1,483,270
private void assertNoPropertySet(String message, String property) throws IOException { Process process = new ProcessBuilder("getprop").start(); Scanner scanner = null; try { scanner = new Scanner(process.getInputStream()); while (scanner.hasNextLine()) { String line = scanner.nextLine(); assertFalse(message + "Property found: " + line, line.startsWith("[" + property + "]")); } } finally { if (scanner != null) { scanner.close(); } } } private static final Pattern BOARD_PATTERN = Pattern.compile("^([0-9A-Za-z._-]+)$"); private static final Pattern BRAND_PATTERN = Pattern.compile("^([0-9A-Za-z._-]+)$"); private static final Pattern DEVICE_PATTERN = Pattern.compile("^([0-9A-Za-z._-]+)$"); private static final Pattern ID_PATTERN = Pattern.compile("^([0-9A-Za-z._-]+)$"); private static final Pattern HARDWARE_PATTERN = Pattern.compile("^([0-9A-Za-z.,_-]+)$"); private static final Pattern PRODUCT_PATTERN = Pattern.compile("^([0-9A-Za-z._-]+)$"); private static final Pattern SERIAL_NUMBER_PATTERN = Pattern.compile("^([0-9A-Za-z]{6,20})$"); private static final Pattern TAGS_PATTERN = Pattern.compile("^([0-9A-Za-z.,_-]+)$"); private static final Pattern TYPE_PATTERN = Pattern.compile("^([0-9A-Za-z._-]+)$");
void function(String message, String property) throws IOException { Process process = new ProcessBuilder(STR).start(); Scanner scanner = null; try { scanner = new Scanner(process.getInputStream()); while (scanner.hasNextLine()) { String line = scanner.nextLine(); assertFalse(message + STR + line, line.startsWith("[" + property + "]")); } } finally { if (scanner != null) { scanner.close(); } } } private static final Pattern BOARD_PATTERN = Pattern.compile(STR); private static final Pattern BRAND_PATTERN = Pattern.compile(STR); private static final Pattern DEVICE_PATTERN = Pattern.compile(STR); private static final Pattern ID_PATTERN = Pattern.compile(STR); private static final Pattern HARDWARE_PATTERN = Pattern.compile(STR); private static final Pattern PRODUCT_PATTERN = Pattern.compile(STR); private static final Pattern SERIAL_NUMBER_PATTERN = Pattern.compile(STR); private static final Pattern TAGS_PATTERN = Pattern.compile(STR); private static final Pattern TYPE_PATTERN = Pattern.compile(STR);
/** * Check that a property is not set by scanning through the list of properties returned by * getprop, since calling getprop on an property set to "" and on a non-existent property * yields the same output. * * @param message shown when the test fails * @param property name passed to getprop */
Check that a property is not set by scanning through the list of properties returned by getprop, since calling getprop on an property set to "" and on a non-existent property yields the same output
assertNoPropertySet
{ "repo_name": "wiki2014/Learning-Summary", "path": "alps/cts/tests/tests/os/src/android/os/cts/BuildTest.java", "license": "gpl-3.0", "size": 8645 }
[ "java.io.IOException", "java.util.Scanner", "java.util.regex.Pattern" ]
import java.io.IOException; import java.util.Scanner; import java.util.regex.Pattern;
import java.io.*; import java.util.*; import java.util.regex.*;
[ "java.io", "java.util" ]
java.io; java.util;
514,125
public static HttpStatus notFound() { return new HttpStatus(HttpServletResponse.SC_NOT_FOUND); }
static HttpStatus function() { return new HttpStatus(HttpServletResponse.SC_NOT_FOUND); }
/** * Creates an instance with status code <code>404 Not Found</code>. */
Creates an instance with status code <code>404 Not Found</code>
notFound
{ "repo_name": "apache/tapestry-5", "path": "tapestry-core/src/main/java/org/apache/tapestry5/services/HttpStatus.java", "license": "apache-2.0", "size": 8173 }
[ "javax.servlet.http.HttpServletResponse" ]
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.*;
[ "javax.servlet" ]
javax.servlet;
515,358
public java.util.List<fr.lip6.move.pnml.hlpn.cyclicEnumerations.hlapi.PredecessorHLAPI> getSubterm_cyclicEnumerations_PredecessorHLAPI(){ java.util.List<fr.lip6.move.pnml.hlpn.cyclicEnumerations.hlapi.PredecessorHLAPI> retour = new ArrayList<fr.lip6.move.pnml.hlpn.cyclicEnumerations.hlapi.PredecessorHLAPI>(); for (Term elemnt : getSubterm()) { if(elemnt.getClass().equals(fr.lip6.move.pnml.hlpn.cyclicEnumerations.impl.PredecessorImpl.class)){ retour.add(new fr.lip6.move.pnml.hlpn.cyclicEnumerations.hlapi.PredecessorHLAPI( (fr.lip6.move.pnml.hlpn.cyclicEnumerations.Predecessor)elemnt )); } } return retour; }
java.util.List<fr.lip6.move.pnml.hlpn.cyclicEnumerations.hlapi.PredecessorHLAPI> function(){ java.util.List<fr.lip6.move.pnml.hlpn.cyclicEnumerations.hlapi.PredecessorHLAPI> retour = new ArrayList<fr.lip6.move.pnml.hlpn.cyclicEnumerations.hlapi.PredecessorHLAPI>(); for (Term elemnt : getSubterm()) { if(elemnt.getClass().equals(fr.lip6.move.pnml.hlpn.cyclicEnumerations.impl.PredecessorImpl.class)){ retour.add(new fr.lip6.move.pnml.hlpn.cyclicEnumerations.hlapi.PredecessorHLAPI( (fr.lip6.move.pnml.hlpn.cyclicEnumerations.Predecessor)elemnt )); } } return retour; }
/** * This accessor return a list of encapsulated subelement, only of PredecessorHLAPI kind. * WARNING : this method can creates a lot of new object in memory. */
This accessor return a list of encapsulated subelement, only of PredecessorHLAPI kind. WARNING : this method can creates a lot of new object in memory
getSubterm_cyclicEnumerations_PredecessorHLAPI
{ "repo_name": "lhillah/pnmlframework", "path": "pnmlFw-HLPN/src/fr/lip6/move/pnml/hlpn/lists/hlapi/SublistHLAPI.java", "license": "epl-1.0", "size": 111755 }
[ "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;
283,784
public List<VirtualNetworkPeeringInner> virtualNetworkPeerings() { return this.virtualNetworkPeerings; }
List<VirtualNetworkPeeringInner> function() { return this.virtualNetworkPeerings; }
/** * Get the virtualNetworkPeerings property: A list of peerings in a Virtual Network. * * @return the virtualNetworkPeerings value. */
Get the virtualNetworkPeerings property: A list of peerings in a Virtual Network
virtualNetworkPeerings
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkPropertiesFormat.java", "license": "mit", "size": 12968 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
789,017
UserModel getUserModel(String username);
UserModel getUserModel(String username);
/** * Retrieve the user object for the specified username. * * @param username * @return a user object or null * @since 0.5.0 */
Retrieve the user object for the specified username
getUserModel
{ "repo_name": "gitblit/gitblit", "path": "src/main/java/com/gitblit/IUserService.java", "license": "apache-2.0", "size": 6533 }
[ "com.gitblit.models.UserModel" ]
import com.gitblit.models.UserModel;
import com.gitblit.models.*;
[ "com.gitblit.models" ]
com.gitblit.models;
1,821,735
public void readPacketData(PacketBuffer p_148837_1_) throws IOException { this.field_149624_a = p_148837_1_.readFloat(); this.field_149622_b = p_148837_1_.readFloat(); this.field_149623_c = p_148837_1_.readBoolean(); this.field_149621_d = p_148837_1_.readBoolean(); }
void function(PacketBuffer p_148837_1_) throws IOException { this.field_149624_a = p_148837_1_.readFloat(); this.field_149622_b = p_148837_1_.readFloat(); this.field_149623_c = p_148837_1_.readBoolean(); this.field_149621_d = p_148837_1_.readBoolean(); }
/** * Reads the raw packet data from the data stream. */
Reads the raw packet data from the data stream
readPacketData
{ "repo_name": "TheHecticByte/BananaJ1.7.10Beta", "path": "src/net/minecraft/Server1_7_10/network/play/client/C0CPacketInput.java", "license": "gpl-3.0", "size": 1905 }
[ "java.io.IOException", "net.minecraft.Server1_7_10" ]
import java.io.IOException; import net.minecraft.Server1_7_10;
import java.io.*; import net.minecraft.*;
[ "java.io", "net.minecraft" ]
java.io; net.minecraft;
480,454
public void accept(final MethodVisitor mv) { AbstractInsnNode insn = first; while (insn != null) { insn.accept(mv); insn = insn.next; } }
void function(final MethodVisitor mv) { AbstractInsnNode insn = first; while (insn != null) { insn.accept(mv); insn = insn.next; } }
/** * Makes the given visitor visit all of the instructions in this list. * * @param mv * the method visitor that must visit the instructions. */
Makes the given visitor visit all of the instructions in this list
accept
{ "repo_name": "kostaskougios/javaflow", "path": "asm/src/main/java/org/objectweb/asm/tree/InsnList.java", "license": "apache-2.0", "size": 15686 }
[ "org.objectweb.asm.MethodVisitor" ]
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.*;
[ "org.objectweb.asm" ]
org.objectweb.asm;
1,820,896
public void addPluginSearchpath(File directory) { addPluginSearchpath_native(directory.getAbsolutePath()); }
void function(File directory) { addPluginSearchpath_native(directory.getAbsolutePath()); }
/** * Adds a directory to search for plugins. * * @param directory * The direcotry. */
Adds a directory to search for plugins
addPluginSearchpath
{ "repo_name": "42ShadowsofAMan/libpurple-android", "path": "jpurple/src/im/pidgin/jpurple/core/PurpleInstance.java", "license": "gpl-2.0", "size": 3220 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
1,859,971
@Test public void testPendingDeleteUnknownBlocks() throws Exception { final int fileNum = 5; // 5 files final Path[] files = new Path[fileNum]; final DataNodeProperties[] dnprops = new DataNodeProperties[REPLICATION]; // create a group of files, each file contains 1 block for (int i = 0; i < fileNum; i++) { files[i] = new Path("/file" + i); DFSTestUtil.createFile(dfs, files[i], BLOCKSIZE, REPLICATION, i); } // wait until all DataNodes have replicas waitForReplication(); for (int i = REPLICATION - 1; i >= 0; i--) { dnprops[i] = cluster.stopDataNode(i); } Thread.sleep(2000); // delete 2 files, we still have 3 files remaining so that we can cover // every DN storage for (int i = 0; i < 2; i++) { dfs.delete(files[i], true); } // restart NameNode cluster.restartNameNode(false); InvalidateBlocks invalidateBlocks = (InvalidateBlocks) Whitebox .getInternalState(cluster.getNamesystem().getBlockManager(), "invalidateBlocks"); InvalidateBlocks mockIb = Mockito.spy(invalidateBlocks); Mockito.doReturn(1L).when(mockIb).getInvalidationDelay(); Whitebox.setInternalState(cluster.getNamesystem().getBlockManager(), "invalidateBlocks", mockIb); Assert.assertEquals(0L, cluster.getNamesystem().getPendingDeletionBlocks()); // restart DataNodes for (int i = 0; i < REPLICATION; i++) { cluster.restartDataNode(dnprops[i], true); } cluster.waitActive(); for (int i = 0; i < REPLICATION; i++) { DataNodeTestUtils.triggerBlockReport(cluster.getDataNodes().get(i)); } Thread.sleep(2000); // make sure we have received block reports by checking the total block # Assert.assertEquals(3, cluster.getNamesystem().getBlocksTotal()); Assert.assertEquals(4, cluster.getNamesystem().getPendingDeletionBlocks()); cluster.restartNameNode(true); waitForNumPendingDeletionBlocks(0); Assert.assertEquals(3, cluster.getNamesystem().getBlocksTotal()); Assert.assertEquals(0, cluster.getNamesystem().getPendingDeletionBlocks()); }
void function() throws Exception { final int fileNum = 5; final Path[] files = new Path[fileNum]; final DataNodeProperties[] dnprops = new DataNodeProperties[REPLICATION]; for (int i = 0; i < fileNum; i++) { files[i] = new Path("/file" + i); DFSTestUtil.createFile(dfs, files[i], BLOCKSIZE, REPLICATION, i); } waitForReplication(); for (int i = REPLICATION - 1; i >= 0; i--) { dnprops[i] = cluster.stopDataNode(i); } Thread.sleep(2000); for (int i = 0; i < 2; i++) { dfs.delete(files[i], true); } cluster.restartNameNode(false); InvalidateBlocks invalidateBlocks = (InvalidateBlocks) Whitebox .getInternalState(cluster.getNamesystem().getBlockManager(), STR); InvalidateBlocks mockIb = Mockito.spy(invalidateBlocks); Mockito.doReturn(1L).when(mockIb).getInvalidationDelay(); Whitebox.setInternalState(cluster.getNamesystem().getBlockManager(), STR, mockIb); Assert.assertEquals(0L, cluster.getNamesystem().getPendingDeletionBlocks()); for (int i = 0; i < REPLICATION; i++) { cluster.restartDataNode(dnprops[i], true); } cluster.waitActive(); for (int i = 0; i < REPLICATION; i++) { DataNodeTestUtils.triggerBlockReport(cluster.getDataNodes().get(i)); } Thread.sleep(2000); Assert.assertEquals(3, cluster.getNamesystem().getBlocksTotal()); Assert.assertEquals(4, cluster.getNamesystem().getPendingDeletionBlocks()); cluster.restartNameNode(true); waitForNumPendingDeletionBlocks(0); Assert.assertEquals(3, cluster.getNamesystem().getBlocksTotal()); Assert.assertEquals(0, cluster.getNamesystem().getPendingDeletionBlocks()); }
/** * Test whether we can delay the deletion of unknown blocks in DataNode's * first several block reports. */
Test whether we can delay the deletion of unknown blocks in DataNode's first several block reports
testPendingDeleteUnknownBlocks
{ "repo_name": "jaypatil/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java", "license": "gpl-3.0", "size": 8459 }
[ "org.apache.hadoop.fs.Path", "org.apache.hadoop.hdfs.DFSTestUtil", "org.apache.hadoop.hdfs.MiniDFSCluster", "org.apache.hadoop.hdfs.server.datanode.DataNodeTestUtils", "org.junit.Assert", "org.mockito.Mockito", "org.mockito.internal.util.reflection.Whitebox" ]
import org.apache.hadoop.fs.Path; import org.apache.hadoop.hdfs.DFSTestUtil; import org.apache.hadoop.hdfs.MiniDFSCluster; import org.apache.hadoop.hdfs.server.datanode.DataNodeTestUtils; import org.junit.Assert; import org.mockito.Mockito; import org.mockito.internal.util.reflection.Whitebox;
import org.apache.hadoop.fs.*; import org.apache.hadoop.hdfs.*; import org.apache.hadoop.hdfs.server.datanode.*; import org.junit.*; import org.mockito.*; import org.mockito.internal.util.reflection.*;
[ "org.apache.hadoop", "org.junit", "org.mockito", "org.mockito.internal" ]
org.apache.hadoop; org.junit; org.mockito; org.mockito.internal;
2,794,210
public static ShortBuffer createShortBuffer(int size) { ShortBuffer buf = ByteBuffer.allocateDirect(SIZEOF_SHORT * size).order(ByteOrder.nativeOrder()).asShortBuffer(); buf.clear(); return buf; }
static ShortBuffer function(int size) { ShortBuffer buf = ByteBuffer.allocateDirect(SIZEOF_SHORT * size).order(ByteOrder.nativeOrder()).asShortBuffer(); buf.clear(); return buf; }
/** * Create a new ShortBuffer of the specified size. * * @param size required number of ints to store. * * @return the new ShortBuffer */
Create a new ShortBuffer of the specified size
createShortBuffer
{ "repo_name": "hkaj/CoFITS", "path": "mt4j/mt4j-core/src/org/mt4j/util/math/ToolsBuffers.java", "license": "gpl-2.0", "size": 21153 }
[ "java.nio.ByteBuffer", "java.nio.ByteOrder", "java.nio.ShortBuffer" ]
import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.ShortBuffer;
import java.nio.*;
[ "java.nio" ]
java.nio;
376,915
public static List<Integer> getPartitions(ZooKeeper zk) { List<Integer> partitions = new ArrayList<Integer>(); try { List<String> children = zk.getChildren(VoltZK.leaders_initiators, null); for (String child : children) { partitions.add(LeaderElector.getPartitionFromElectionDir(child)); } } catch (KeeperException e) { VoltDB.crashLocalVoltDB("Failed to get partition IDs from ZK", true, e); } catch (InterruptedException e) { VoltDB.crashLocalVoltDB("Failed to get partition IDs from ZK", true, e); } return partitions; }
static List<Integer> function(ZooKeeper zk) { List<Integer> partitions = new ArrayList<Integer>(); try { List<String> children = zk.getChildren(VoltZK.leaders_initiators, null); for (String child : children) { partitions.add(LeaderElector.getPartitionFromElectionDir(child)); } } catch (KeeperException e) { VoltDB.crashLocalVoltDB(STR, true, e); } catch (InterruptedException e) { VoltDB.crashLocalVoltDB(STR, true, e); } return partitions; }
/** * Returns the IDs of the partitions currently in the cluster. * @return A list of partition IDs */
Returns the IDs of the partitions currently in the cluster
getPartitions
{ "repo_name": "zheguang/voltdb", "path": "src/frontend/org/voltdb/iv2/Cartographer.java", "license": "agpl-3.0", "size": 23200 }
[ "java.util.ArrayList", "java.util.List", "org.apache.zookeeper_voltpatches.KeeperException", "org.apache.zookeeper_voltpatches.ZooKeeper", "org.voltcore.zk.LeaderElector", "org.voltdb.VoltDB", "org.voltdb.VoltZK" ]
import java.util.ArrayList; import java.util.List; import org.apache.zookeeper_voltpatches.KeeperException; import org.apache.zookeeper_voltpatches.ZooKeeper; import org.voltcore.zk.LeaderElector; import org.voltdb.VoltDB; import org.voltdb.VoltZK;
import java.util.*; import org.apache.zookeeper_voltpatches.*; import org.voltcore.zk.*; import org.voltdb.*;
[ "java.util", "org.apache.zookeeper_voltpatches", "org.voltcore.zk", "org.voltdb" ]
java.util; org.apache.zookeeper_voltpatches; org.voltcore.zk; org.voltdb;
1,398,465
public void testInitDoFinal() { System.out.println("API test"); SecureRandom random = new SecureRandom(); Key key = new SecretKeySpec(AEShelper.testVect128_key, "WBAES"); AES_Cipher encryptor = new AES_Cipher(); try { encryptor.engineInit(Cipher.ENCRYPT_MODE, key, random); } catch (InvalidKeyException e) {} byte[] outputEnc = new byte[16]; try { outputEnc = encryptor.engineDoFinal(AEShelper.testVect128_plain[1], 0, 16); } catch (Exception e) {} AES_Cipher decryptor = new AES_Cipher(); try { decryptor.engineInit(Cipher.DECRYPT_MODE, key, random); } catch (InvalidKeyException e) {} byte[] outputDec = new byte[16]; try { outputDec = decryptor.engineDoFinal(outputEnc, 0, 16); } catch (Exception e) {} State plain = new State(AEShelper.testVect128_plain[1], true, false); State cipher = new State(AEShelper.testVect128_cipher[1], true, false); System.out.println("Testvector plaintext sour: \n" + plain); System.out.println("Testvector ciphertext sour: \n"+ cipher); State cipher2 = new State(outputEnc, true, false); State plain2 = new State(outputDec, true, false); System.out.println("Testvector plaintext comp: \n" + cipher2); System.out.println("Testvector ciphertext comp: \n"+ plain2); // problem with byte arrays comparison - used States assertEquals("Cipher output mismatch in API", true, plain2.equals(plain)); }
void function() { System.out.println(STR); SecureRandom random = new SecureRandom(); Key key = new SecretKeySpec(AEShelper.testVect128_key, "WBAES"); AES_Cipher encryptor = new AES_Cipher(); try { encryptor.engineInit(Cipher.ENCRYPT_MODE, key, random); } catch (InvalidKeyException e) {} byte[] outputEnc = new byte[16]; try { outputEnc = encryptor.engineDoFinal(AEShelper.testVect128_plain[1], 0, 16); } catch (Exception e) {} AES_Cipher decryptor = new AES_Cipher(); try { decryptor.engineInit(Cipher.DECRYPT_MODE, key, random); } catch (InvalidKeyException e) {} byte[] outputDec = new byte[16]; try { outputDec = decryptor.engineDoFinal(outputEnc, 0, 16); } catch (Exception e) {} State plain = new State(AEShelper.testVect128_plain[1], true, false); State cipher = new State(AEShelper.testVect128_cipher[1], true, false); System.out.println(STR + plain); System.out.println(STR+ cipher); State cipher2 = new State(outputEnc, true, false); State plain2 = new State(outputDec, true, false); System.out.println(STR + cipher2); System.out.println(STR+ plain2); assertEquals(STR, true, plain2.equals(plain)); }
/** * Test of API - init and doFinal */
Test of API - init and doFinal
testInitDoFinal
{ "repo_name": "xbacinsk/Whitebox-crypto-AES-java", "path": "src/main/java/cz/muni/fi/xklinec/whiteboxAES/AES_CipherTest.java", "license": "bsd-3-clause", "size": 6098 }
[ "cz.muni.fi.xklinec.whiteboxAES.generator.AEShelper", "java.security.InvalidKeyException", "java.security.Key", "java.security.SecureRandom", "javax.crypto.Cipher", "javax.crypto.spec.SecretKeySpec" ]
import cz.muni.fi.xklinec.whiteboxAES.generator.AEShelper; import java.security.InvalidKeyException; import java.security.Key; import java.security.SecureRandom; import javax.crypto.Cipher; import javax.crypto.spec.SecretKeySpec;
import cz.muni.fi.xklinec.*; import java.security.*; import javax.crypto.*; import javax.crypto.spec.*;
[ "cz.muni.fi", "java.security", "javax.crypto" ]
cz.muni.fi; java.security; javax.crypto;
295,991
public static URL resolveMandatoryResourceAsUrl(ClassResolver classResolver, String uri) throws FileNotFoundException, MalformedURLException { URL url = resolveResourceAsUrl(classResolver, uri); if (url == null) { String resolvedName = resolveUriPath(uri); throw new FileNotFoundException("Cannot find resource: " + resolvedName + " in classpath for URI: " + uri); } else { return url; } }
static URL function(ClassResolver classResolver, String uri) throws FileNotFoundException, MalformedURLException { URL url = resolveResourceAsUrl(classResolver, uri); if (url == null) { String resolvedName = resolveUriPath(uri); throw new FileNotFoundException(STR + resolvedName + STR + uri); } else { return url; } }
/** * Resolves the mandatory resource. * * @param classResolver the class resolver to load the resource from the classpath * @param uri uri of the resource * @return the resource as an {@link java.net.URL}. * @throws java.io.FileNotFoundException is thrown if the resource file could not be found * @throws java.net.MalformedURLException if the URI is malformed */
Resolves the mandatory resource
resolveMandatoryResourceAsUrl
{ "repo_name": "isavin/camel", "path": "camel-core/src/main/java/org/apache/camel/util/ResourceHelper.java", "license": "apache-2.0", "size": 15488 }
[ "java.io.FileNotFoundException", "java.net.MalformedURLException", "org.apache.camel.spi.ClassResolver" ]
import java.io.FileNotFoundException; import java.net.MalformedURLException; import org.apache.camel.spi.ClassResolver;
import java.io.*; import java.net.*; import org.apache.camel.spi.*;
[ "java.io", "java.net", "org.apache.camel" ]
java.io; java.net; org.apache.camel;
894,752
@Test public void testImmutableConfigurationsAt() { List<ImmutableHierarchicalConfiguration> lstFlds = config.immutableConfigurationsAt("tables.table(1).fields.field"); checkSubConfigurations(lstFlds); }
void function() { List<ImmutableHierarchicalConfiguration> lstFlds = config.immutableConfigurationsAt(STR); checkSubConfigurations(lstFlds); }
/** * Tests whether a list of immutable sub configurations can be queried. */
Tests whether a list of immutable sub configurations can be queried
testImmutableConfigurationsAt
{ "repo_name": "mohanaraosv/commons-configuration", "path": "src/test/java/org/apache/commons/configuration2/TestHierarchicalConfiguration.java", "license": "apache-2.0", "size": 23759 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,241,133
public ReportWriterService getgLInterfaceBatchTotalProcessedReportsWriterService() { return gLInterfaceBatchTotalProcessedReportsWriterService; }
ReportWriterService function() { return gLInterfaceBatchTotalProcessedReportsWriterService; }
/** * Gets the gLInterfaceBatchTotalProcessedReportsWriterService attribute. * @return Returns the gLInterfaceBatchTotalProcessedReportsWriterService. */
Gets the gLInterfaceBatchTotalProcessedReportsWriterService attribute
getgLInterfaceBatchTotalProcessedReportsWriterService
{ "repo_name": "Ariah-Group/Finance", "path": "af_webapp/src/main/java/org/kuali/kfs/module/endow/batch/service/impl/GeneralLedgerInterfaceBatchProcessServiceImpl.java", "license": "apache-2.0", "size": 58405 }
[ "org.kuali.kfs.sys.service.ReportWriterService" ]
import org.kuali.kfs.sys.service.ReportWriterService;
import org.kuali.kfs.sys.service.*;
[ "org.kuali.kfs" ]
org.kuali.kfs;
388,757
public void fail() throws IllegalStateException { State oldState; do { oldState = stateRef.get(); if (oldState.isDone()) { throw ElytronMessages.log.alreadyComplete(); } if (! oldState.isStarted()) { throw ElytronMessages.log.noAuthenticationInProgress(); } } while (!stateRef.compareAndSet(oldState, FAILED)); if (oldState.getId() == ASSIGNED_ID) { oldState.getRealmIdentity().dispose(); } }
void function() throws IllegalStateException { State oldState; do { oldState = stateRef.get(); if (oldState.isDone()) { throw ElytronMessages.log.alreadyComplete(); } if (! oldState.isStarted()) { throw ElytronMessages.log.noAuthenticationInProgress(); } } while (!stateRef.compareAndSet(oldState, FAILED)); if (oldState.getId() == ASSIGNED_ID) { oldState.getRealmIdentity().dispose(); } }
/** * Mark this authentication as "failed". The context cannot be used after this method is called. * * @throws IllegalStateException if no authentication has been initiated or authentication is already completed */
Mark this authentication as "failed". The context cannot be used after this method is called
fail
{ "repo_name": "kabir/wildfly-elytron", "path": "src/main/java/org/wildfly/security/auth/server/ServerAuthenticationContext.java", "license": "apache-2.0", "size": 38289 }
[ "org.wildfly.security._private.ElytronMessages" ]
import org.wildfly.security._private.ElytronMessages;
import org.wildfly.security._private.*;
[ "org.wildfly.security" ]
org.wildfly.security;
2,590,305
protected boolean addResult(final GfxdFunctionReplyMessage replyMsg, final GfxdResponseCode responseCode) { if (responseCode.isGrant() || responseCode.isWaiting()) { addResult(replyMsg.getSender(), replyMsg.singleResult); } else { if (!responseCode.isException()) { Assert.fail("GfxdFunctionReplyMessageProcessor: " + "unexpected responseCode=" + responseCode); } if (this.latch == null) { addResult(replyMsg.getSender(), replyMsg.getException()); } } return processResponseCode(replyMsg, responseCode); }
boolean function(final GfxdFunctionReplyMessage replyMsg, final GfxdResponseCode responseCode) { if (responseCode.isGrant() responseCode.isWaiting()) { addResult(replyMsg.getSender(), replyMsg.singleResult); } else { if (!responseCode.isException()) { Assert.fail(STR + STR + responseCode); } if (this.latch == null) { addResult(replyMsg.getSender(), replyMsg.getException()); } } return processResponseCode(replyMsg, responseCode); }
/** * Add a reply message from a member having given {@link GfxdResponseCode}. * * @return true if more results are expected from the member else false */
Add a reply message from a member having given <code>GfxdResponseCode</code>
addResult
{ "repo_name": "papicella/snappy-store", "path": "gemfirexd/core/src/main/java/com/pivotal/gemfirexd/internal/engine/distributed/message/GfxdFunctionMessage.java", "license": "apache-2.0", "size": 66241 }
[ "com.gemstone.gemfire.internal.Assert", "com.pivotal.gemfirexd.internal.engine.distributed.GfxdResponseCode" ]
import com.gemstone.gemfire.internal.Assert; import com.pivotal.gemfirexd.internal.engine.distributed.GfxdResponseCode;
import com.gemstone.gemfire.internal.*; import com.pivotal.gemfirexd.internal.engine.distributed.*;
[ "com.gemstone.gemfire", "com.pivotal.gemfirexd" ]
com.gemstone.gemfire; com.pivotal.gemfirexd;
1,452,526
@Override public void mousePressed(MouseEvent e) { synchronized (mouseLock) { mouseX = StdDraw.userX(e.getX()); mouseY = StdDraw.userY(e.getY()); mousePressed = true; } }
void function(MouseEvent e) { synchronized (mouseLock) { mouseX = StdDraw.userX(e.getX()); mouseY = StdDraw.userY(e.getY()); mousePressed = true; } }
/** * This method cannot be called directly. */
This method cannot be called directly
mousePressed
{ "repo_name": "clbx/CS121", "path": "STDTest/StdDraw.java", "license": "mit", "size": 73020 }
[ "java.awt.event.MouseEvent" ]
import java.awt.event.MouseEvent;
import java.awt.event.*;
[ "java.awt" ]
java.awt;
1,171,762
@SuppressWarnings("unused") public boolean representedAsString() { return true; } } private static class DateDecorator extends Decorator<Date> { public DateDecorator(@NotNull final String name, @NotNull final Date arg) { super(name, arg); }
@SuppressWarnings(STR) boolean function() { return true; } } private static class DateDecorator extends Decorator<Date> { public DateDecorator(@NotNull final String name, @NotNull final Date arg) { super(name, arg); }
/** * Checks whether it's represented as string. * @return {@code true}. */
Checks whether it's represented as string
representedAsString
{ "repo_name": "rydnr/java-commons", "path": "src/main/java/org/acmsl/commons/utils/ToStringUtils.java", "license": "gpl-2.0", "size": 19105 }
[ "java.util.Date", "org.jetbrains.annotations.NotNull" ]
import java.util.Date; import org.jetbrains.annotations.NotNull;
import java.util.*; import org.jetbrains.annotations.*;
[ "java.util", "org.jetbrains.annotations" ]
java.util; org.jetbrains.annotations;
2,366,364
@Override public void ZWaveIncomingEvent(ZWaveEvent event) { if (event instanceof ZWaveConfigurationParameterEvent) { // Write the node to disk ZWaveNodeSerializer nodeSerializer = new ZWaveNodeSerializer(); nodeSerializer.SerializeNode(zController.getNode(event.getNodeId())); // We've received an updated configuration parameter // See if this is something in our 'pending' list and remove it PendingCfg.Remove(ZWaveCommandClass.CommandClass.CONFIGURATION.getKey(), event.getNodeId(), ((ZWaveConfigurationParameterEvent) event).getParameter().getIndex()); return; } if (event instanceof ZWaveAssociationEvent) { // Write the node to disk ZWaveNodeSerializer nodeSerializer = new ZWaveNodeSerializer(); nodeSerializer.SerializeNode(zController.getNode(event.getNodeId())); // We've received an updated association group // See if this is something in our 'pending' list and remove it for (ZWaveNode node : zController.getNodes()) { PendingCfg.Remove(ZWaveCommandClass.CommandClass.ASSOCIATION.getKey(), event.getNodeId(), ((ZWaveAssociationEvent) event).getGroup(), node.getNodeId()); } return; } if (event instanceof ZWaveWakeUpCommandClass.ZWaveWakeUpEvent) { // We only care about the wake-up report if (((ZWaveWakeUpCommandClass.ZWaveWakeUpEvent) event) .getEvent() != ZWaveWakeUpCommandClass.WAKE_UP_INTERVAL_REPORT) { return; } // Write the node to disk ZWaveNodeSerializer nodeSerializer = new ZWaveNodeSerializer(); nodeSerializer.SerializeNode(zController.getNode(event.getNodeId())); // Remove this node from the pending list PendingCfg.Remove(ZWaveCommandClass.CommandClass.WAKE_UP.getKey(), event.getNodeId()); return; } if (event instanceof ZWaveSwitchAllCommandClass.ZWaveSwitchAllModeEvent) { ZWaveSwitchAllCommandClass.ZWaveSwitchAllModeEvent e = (ZWaveSwitchAllCommandClass.ZWaveSwitchAllModeEvent) event; // Write the node to disk ZWaveNodeSerializer nodeSerializer = new ZWaveNodeSerializer(); nodeSerializer.SerializeNode(zController.getNode(event.getNodeId())); // Remove this node from the pending list PendingCfg.Remove(ZWaveCommandClass.CommandClass.SWITCH_ALL.getKey(), e.getNodeId()); return; } if (event instanceof ZWaveInclusionEvent) { handleInclusionEvent((ZWaveInclusionEvent) event); } }
void function(ZWaveEvent event) { if (event instanceof ZWaveConfigurationParameterEvent) { ZWaveNodeSerializer nodeSerializer = new ZWaveNodeSerializer(); nodeSerializer.SerializeNode(zController.getNode(event.getNodeId())); PendingCfg.Remove(ZWaveCommandClass.CommandClass.CONFIGURATION.getKey(), event.getNodeId(), ((ZWaveConfigurationParameterEvent) event).getParameter().getIndex()); return; } if (event instanceof ZWaveAssociationEvent) { ZWaveNodeSerializer nodeSerializer = new ZWaveNodeSerializer(); nodeSerializer.SerializeNode(zController.getNode(event.getNodeId())); for (ZWaveNode node : zController.getNodes()) { PendingCfg.Remove(ZWaveCommandClass.CommandClass.ASSOCIATION.getKey(), event.getNodeId(), ((ZWaveAssociationEvent) event).getGroup(), node.getNodeId()); } return; } if (event instanceof ZWaveWakeUpCommandClass.ZWaveWakeUpEvent) { if (((ZWaveWakeUpCommandClass.ZWaveWakeUpEvent) event) .getEvent() != ZWaveWakeUpCommandClass.WAKE_UP_INTERVAL_REPORT) { return; } ZWaveNodeSerializer nodeSerializer = new ZWaveNodeSerializer(); nodeSerializer.SerializeNode(zController.getNode(event.getNodeId())); PendingCfg.Remove(ZWaveCommandClass.CommandClass.WAKE_UP.getKey(), event.getNodeId()); return; } if (event instanceof ZWaveSwitchAllCommandClass.ZWaveSwitchAllModeEvent) { ZWaveSwitchAllCommandClass.ZWaveSwitchAllModeEvent e = (ZWaveSwitchAllCommandClass.ZWaveSwitchAllModeEvent) event; ZWaveNodeSerializer nodeSerializer = new ZWaveNodeSerializer(); nodeSerializer.SerializeNode(zController.getNode(event.getNodeId())); PendingCfg.Remove(ZWaveCommandClass.CommandClass.SWITCH_ALL.getKey(), e.getNodeId()); return; } if (event instanceof ZWaveInclusionEvent) { handleInclusionEvent((ZWaveInclusionEvent) event); } }
/** * Event handler method for incoming Z-Wave events. * * @param event * the incoming Z-Wave event. */
Event handler method for incoming Z-Wave events
ZWaveIncomingEvent
{ "repo_name": "paolodenti/openhab", "path": "bundles/binding/org.openhab.binding.zwave/src/main/java/org/openhab/binding/zwave/internal/config/ZWaveConfiguration.java", "license": "epl-1.0", "size": 69958 }
[ "org.openhab.binding.zwave.internal.protocol.ZWaveNode", "org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveAssociationCommandClass", "org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveCommandClass", "org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveConfigurationCommandClass", "org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveSwitchAllCommandClass", "org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveWakeUpCommandClass", "org.openhab.binding.zwave.internal.protocol.event.ZWaveEvent", "org.openhab.binding.zwave.internal.protocol.event.ZWaveInclusionEvent", "org.openhab.binding.zwave.internal.protocol.initialization.ZWaveNodeSerializer" ]
import org.openhab.binding.zwave.internal.protocol.ZWaveNode; import org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveAssociationCommandClass; import org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveCommandClass; import org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveConfigurationCommandClass; import org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveSwitchAllCommandClass; import org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveWakeUpCommandClass; import org.openhab.binding.zwave.internal.protocol.event.ZWaveEvent; import org.openhab.binding.zwave.internal.protocol.event.ZWaveInclusionEvent; import org.openhab.binding.zwave.internal.protocol.initialization.ZWaveNodeSerializer;
import org.openhab.binding.zwave.internal.protocol.*; import org.openhab.binding.zwave.internal.protocol.commandclass.*; import org.openhab.binding.zwave.internal.protocol.event.*; import org.openhab.binding.zwave.internal.protocol.initialization.*;
[ "org.openhab.binding" ]
org.openhab.binding;
2,872,894
public String toString() { return "null"; } } private final Map map; public static final Object NULL = new Null(); public static ThreadLocal<Set> cyclicDependencySet = new ThreadLocal(); public static ThreadLocal<Boolean> cyclicDepChkEnabled = new ThreadLocal(); public JSONObject() { this.map = new LinkedHashMap(); } public JSONObject(JSONObject jo, String[] names) { this(); for (int i = 0; i < names.length; i += 1) { try { this.putOnce(names[i], jo.opt(names[i])); } catch (Exception ignore) { } } } public JSONObject(JSONTokener x) throws JSONException { this(); char c; String key; if (x.nextClean() != '{') { throw x.syntaxError("A JSONObject text must begin with '{'"); } for (;;) { c = x.nextClean(); switch (c) { case 0: throw x.syntaxError("A JSONObject text must end with '}'"); case '}': return; default: x.back(); key = x.nextValue().toString(); } // The key is followed by ':'. We will also tolerate '=' or '=>'. c = x.nextClean(); if (c == '=') { if (x.next() != '>') { x.back(); } } else if (c != ':') { throw x.syntaxError("Expected a ':' after a key"); } this.putOnce(key, x.nextValue()); // Pairs are separated by ','. We will also tolerate ';'. switch (x.nextClean()) { case ';': case ',': if (x.nextClean() == '}') { return; } x.back(); break; case '}': return; default: throw x.syntaxError("Expected a ',' or '}'"); } } } public JSONObject(Map map) { this.map = new LinkedHashMap(); if (map != null) { Iterator i = map.entrySet().iterator(); while (i.hasNext()) { Map.Entry e = (Map.Entry)i.next(); Object value = e.getValue(); if (value != null) { this.map.put(e.getKey(), wrap(value)); } } } } public JSONObject(Object bean) { this(); this.populateMap(bean); } public JSONObject(Object object, String names[]) { this(); Class c = object.getClass(); for (int i = 0; i < names.length; i += 1) { String name = names[i]; try { this.putOpt(name, c.getField(name).get(object)); } catch (Exception ignore) { } } } public JSONObject(String source) throws JSONException { this(new JSONTokener(source)); } public JSONObject(String baseName, Locale locale) throws JSONException { this(); ResourceBundle bundle = ResourceBundle.getBundle(baseName, locale, Thread.currentThread().getContextClassLoader()); // Iterate through the keys in the bundle. Enumeration keys = bundle.getKeys(); while (keys.hasMoreElements()) { Object key = keys.nextElement(); if (key instanceof String) { // Go through the path, ensuring that there is a nested JSONObject for each // segment except the last. Add the value using the last segment's name into // the deepest nested JSONObject. String[] path = ((String)key).split("\\."); int last = path.length - 1; JSONObject target = this; for (int i = 0; i < last; i += 1) { String segment = path[i]; JSONObject nextTarget = target.optJSONObject(segment); if (nextTarget == null) { nextTarget = new JSONObject(); target.put(segment, nextTarget); } target = nextTarget; } target.put(path[last], bundle.getString((String)key)); } } }
String function() { return "null"; } } private final Map map; public static final Object NULL = new Null(); public static ThreadLocal<Set> cyclicDependencySet = new ThreadLocal(); public static ThreadLocal<Boolean> cyclicDepChkEnabled = new ThreadLocal(); public JSONObject() { this.map = new LinkedHashMap(); } public JSONObject(JSONObject jo, String[] names) { this(); for (int i = 0; i < names.length; i += 1) { try { this.putOnce(names[i], jo.opt(names[i])); } catch (Exception ignore) { } } } public JSONObject(JSONTokener x) throws JSONException { this(); char c; String key; if (x.nextClean() != '{') { throw x.syntaxError(STR); } for (;;) { c = x.nextClean(); switch (c) { case 0: throw x.syntaxError(STR); case '}': return; default: x.back(); key = x.nextValue().toString(); } c = x.nextClean(); if (c == '=') { if (x.next() != '>') { x.back(); } } else if (c != ':') { throw x.syntaxError(STR); } this.putOnce(key, x.nextValue()); switch (x.nextClean()) { case ';': case ',': if (x.nextClean() == '}') { return; } x.back(); break; case '}': return; default: throw x.syntaxError(STR); } } } public JSONObject(Map map) { this.map = new LinkedHashMap(); if (map != null) { Iterator i = map.entrySet().iterator(); while (i.hasNext()) { Map.Entry e = (Map.Entry)i.next(); Object value = e.getValue(); if (value != null) { this.map.put(e.getKey(), wrap(value)); } } } } public JSONObject(Object bean) { this(); this.populateMap(bean); } public JSONObject(Object object, String names[]) { this(); Class c = object.getClass(); for (int i = 0; i < names.length; i += 1) { String name = names[i]; try { this.putOpt(name, c.getField(name).get(object)); } catch (Exception ignore) { } } } public JSONObject(String source) throws JSONException { this(new JSONTokener(source)); } public JSONObject(String baseName, Locale locale) throws JSONException { this(); ResourceBundle bundle = ResourceBundle.getBundle(baseName, locale, Thread.currentThread().getContextClassLoader()); Enumeration keys = bundle.getKeys(); while (keys.hasMoreElements()) { Object key = keys.nextElement(); if (key instanceof String) { String[] path = ((String)key).split("\\."); int last = path.length - 1; JSONObject target = this; for (int i = 0; i < last; i += 1) { String segment = path[i]; JSONObject nextTarget = target.optJSONObject(segment); if (nextTarget == null) { nextTarget = new JSONObject(); target.put(segment, nextTarget); } target = nextTarget; } target.put(path[last], bundle.getString((String)key)); } } }
/** * Get the "null" string value. * @return The string "null". */
Get the "null" string value
toString
{ "repo_name": "ysung-pivotal/incubator-geode", "path": "gemfire-json/src/main/java/org/json/JSONObject.java", "license": "apache-2.0", "size": 55334 }
[ "java.util.Enumeration", "java.util.Iterator", "java.util.LinkedHashMap", "java.util.Locale", "java.util.Map", "java.util.ResourceBundle", "java.util.Set" ]
import java.util.Enumeration; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Locale; import java.util.Map; import java.util.ResourceBundle; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
589,368
Manager getManager();
Manager getManager();
/** * Returns the {@link Manager} used as a real source of monitors. * * @return Manager to get the monitors from */
Returns the <code>Manager</code> used as a real source of monitors
getManager
{ "repo_name": "karouani/javasimon", "path": "core/src/main/java/org/javasimon/source/MonitorSource.java", "license": "bsd-3-clause", "size": 956 }
[ "org.javasimon.Manager" ]
import org.javasimon.Manager;
import org.javasimon.*;
[ "org.javasimon" ]
org.javasimon;
2,068,147
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "OS_OPEN_STREAM") // We know about this, but it's very hard to fix public InputStream getWarContent(String fileInWar) { for (Handler h : handlers.values()) { if (h instanceof WebAppContext) { try { String war = ((WebAppContext) h).getWar(); if (war == null) continue; JarFile jf = new JarFile(war); for (Enumeration<JarEntry> e = jf.entries(); e.hasMoreElements();) { JarEntry je = e.nextElement(); if (je.getName().endsWith(fileInWar)) { // TODO: This is a problem, because we can't close the war file return jf.getInputStream(je); } } } catch (Throwable t) { ErrorLogger.log(GluewineJettyLauncher.class, t); } } } return null; }
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = STR) InputStream function(String fileInWar) { for (Handler h : handlers.values()) { if (h instanceof WebAppContext) { try { String war = ((WebAppContext) h).getWar(); if (war == null) continue; JarFile jf = new JarFile(war); for (Enumeration<JarEntry> e = jf.entries(); e.hasMoreElements();) { JarEntry je = e.nextElement(); if (je.getName().endsWith(fileInWar)) { return jf.getInputStream(je); } } } catch (Throwable t) { ErrorLogger.log(GluewineJettyLauncher.class, t); } } } return null; }
/** Looks for an entry with the specified name in all war files, and returns an InputStream for the entry. * @param fileInWar the entry to look for. * @return an InputStream for the entry. */
Looks for an entry with the specified name in all war files, and returns an InputStream for the entry
getWarContent
{ "repo_name": "sergeds/Gluewine", "path": "imp/src/java/org/gluewine/jetty/GluewineJettyLauncher.java", "license": "apache-2.0", "size": 26235 }
[ "java.io.InputStream", "java.util.Enumeration", "java.util.jar.JarEntry", "java.util.jar.JarFile", "org.eclipse.jetty.server.Handler", "org.eclipse.jetty.webapp.WebAppContext", "org.gluewine.utils.ErrorLogger" ]
import java.io.InputStream; import java.util.Enumeration; import java.util.jar.JarEntry; import java.util.jar.JarFile; import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.webapp.WebAppContext; import org.gluewine.utils.ErrorLogger;
import java.io.*; import java.util.*; import java.util.jar.*; import org.eclipse.jetty.server.*; import org.eclipse.jetty.webapp.*; import org.gluewine.utils.*;
[ "java.io", "java.util", "org.eclipse.jetty", "org.gluewine.utils" ]
java.io; java.util; org.eclipse.jetty; org.gluewine.utils;
1,185,585
final View content = LayoutInflater.from(context) .inflate(R.layout.favorite_search_addition_dialog_content, null); final Spinner categorySelector = initSpinner(content); final EditText input = initInput(content); new AlertDialog.Builder(context) .setTitle(R.string.favorite_add_title) .setView(content) .setCancelable(true) .setNegativeButton(R.string.cancel, (d, i) -> d.cancel()) .setPositiveButton(R.string.ok, (d, i) -> { @ColorInt final int color = ((ColorDrawable) view.getBackground()).getColor(); final String query = input.getText().toString(); if (TextUtils.isEmpty(query)) { Toaster.snackShort( view, R.string.favorite_search_addition_dialog_empty_message, color ); return; } final String category = categorySelector.getSelectedItem().toString(); new Insertion(context, category, query).insert(); final String message = MessageFormat.format( context.getString(R.string.favorite_search_addition_successful_format), query ); Toaster.snackShort(view, message, color); d.dismiss(); }) .show(); }
final View content = LayoutInflater.from(context) .inflate(R.layout.favorite_search_addition_dialog_content, null); final Spinner categorySelector = initSpinner(content); final EditText input = initInput(content); new AlertDialog.Builder(context) .setTitle(R.string.favorite_add_title) .setView(content) .setCancelable(true) .setNegativeButton(R.string.cancel, (d, i) -> d.cancel()) .setPositiveButton(R.string.ok, (d, i) -> { @ColorInt final int color = ((ColorDrawable) view.getBackground()).getColor(); final String query = input.getText().toString(); if (TextUtils.isEmpty(query)) { Toaster.snackShort( view, R.string.favorite_search_addition_dialog_empty_message, color ); return; } final String category = categorySelector.getSelectedItem().toString(); new Insertion(context, category, query).insert(); final String message = MessageFormat.format( context.getString(R.string.favorite_search_addition_successful_format), query ); Toaster.snackShort(view, message, color); d.dismiss(); }) .show(); }
/** * Show input dialog. */
Show input dialog
invoke
{ "repo_name": "toastkidjp/SearchWidget_Android", "path": "app/src/main/java/jp/toastkid/search_widget/favorite/Addition.java", "license": "epl-1.0", "size": 4328 }
[ "android.graphics.drawable.ColorDrawable", "android.support.annotation.ColorInt", "android.support.v7.app.AlertDialog", "android.text.TextUtils", "android.view.LayoutInflater", "android.view.View", "android.widget.EditText", "android.widget.Spinner", "java.text.MessageFormat", "jp.toastkid.search_widget.libs.Toaster" ]
import android.graphics.drawable.ColorDrawable; import android.support.annotation.ColorInt; import android.support.v7.app.AlertDialog; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; import android.widget.EditText; import android.widget.Spinner; import java.text.MessageFormat; import jp.toastkid.search_widget.libs.Toaster;
import android.graphics.drawable.*; import android.support.annotation.*; import android.support.v7.app.*; import android.text.*; import android.view.*; import android.widget.*; import java.text.*; import jp.toastkid.search_widget.libs.*;
[ "android.graphics", "android.support", "android.text", "android.view", "android.widget", "java.text", "jp.toastkid.search_widget" ]
android.graphics; android.support; android.text; android.view; android.widget; java.text; jp.toastkid.search_widget;
2,429,743
List<Application> getApplications(String subscriber) throws APIManagementException;
List<Application> getApplications(String subscriber) throws APIManagementException;
/** * Returns a list of applications for a given subscriber * * @param subscriber Subscriber * @return Applications * @throws APIManagementException if failed to applications for given subscriber */
Returns a list of applications for a given subscriber
getApplications
{ "repo_name": "Minoli/carbon-apimgt", "path": "components/apimgt/org.wso2.carbon.apimgt.core/src/main/java/org/wso2/carbon/apimgt/core/api/APIStore.java", "license": "apache-2.0", "size": 24087 }
[ "java.util.List", "org.wso2.carbon.apimgt.core.exception.APIManagementException", "org.wso2.carbon.apimgt.core.models.Application" ]
import java.util.List; import org.wso2.carbon.apimgt.core.exception.APIManagementException; import org.wso2.carbon.apimgt.core.models.Application;
import java.util.*; import org.wso2.carbon.apimgt.core.exception.*; import org.wso2.carbon.apimgt.core.models.*;
[ "java.util", "org.wso2.carbon" ]
java.util; org.wso2.carbon;
2,660,773
DirContextOperations searchForUser(String username) throws UsernameNotFoundException;
DirContextOperations searchForUser(String username) throws UsernameNotFoundException;
/** * Locates a single user in the directory and returns the LDAP information for that * user. * * @param username the login name supplied to the authentication service. * * @return a DirContextOperations object containing the user's full DN and requested * attributes. * @throws UsernameNotFoundException if no user with the supplied name could be * located by the search. */
Locates a single user in the directory and returns the LDAP information for that user
searchForUser
{ "repo_name": "ractive/spring-security", "path": "ldap/src/main/java/org/springframework/security/ldap/search/LdapUserSearch.java", "license": "apache-2.0", "size": 1753 }
[ "org.springframework.ldap.core.DirContextOperations", "org.springframework.security.core.userdetails.UsernameNotFoundException" ]
import org.springframework.ldap.core.DirContextOperations; import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.ldap.core.*; import org.springframework.security.core.userdetails.*;
[ "org.springframework.ldap", "org.springframework.security" ]
org.springframework.ldap; org.springframework.security;
703,429
BytesRef getTokenBytesWithLeaf(BytesRef result);
BytesRef getTokenBytesWithLeaf(BytesRef result);
/** * Returns the bytes for this cell, with a leaf byte <em>if this is a leaf cell</em>. * The result param is used to save object allocation, though its bytes aren't used. * @param result where the result goes, or null to create new */
Returns the bytes for this cell, with a leaf byte if this is a leaf cell. The result param is used to save object allocation, though its bytes aren't used
getTokenBytesWithLeaf
{ "repo_name": "yida-lxw/solr-5.3.1", "path": "lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/Cell.java", "license": "apache-2.0", "size": 4869 }
[ "org.apache.lucene.util.BytesRef" ]
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.*;
[ "org.apache.lucene" ]
org.apache.lucene;
2,647,349
private boolean configureConnectionForHttpPost(HttpURLConnection connection) throws IOException { // Read the boundary which we need for the content type. String boundary = readBoundary(); if (boundary == null) { return false; } connection.setDoOutput(true); connection.setRequestProperty("Connection", "Keep-Alive"); connection.setRequestProperty("Content-Encoding", "gzip"); connection.setRequestProperty("Content-Type", String.format(CONTENT_TYPE_TMPL, boundary)); return true; }
boolean function(HttpURLConnection connection) throws IOException { String boundary = readBoundary(); if (boundary == null) { return false; } connection.setDoOutput(true); connection.setRequestProperty(STR, STR); connection.setRequestProperty(STR, "gzip"); connection.setRequestProperty(STR, String.format(CONTENT_TYPE_TMPL, boundary)); return true; }
/** * Configures a HttpURLConnection to send a HTTP POST request for uploading the minidump. * * This also reads the content-type from the minidump file. * * @param connection the HttpURLConnection to configure * @return true if successful. * @throws IOException */
Configures a HttpURLConnection to send a HTTP POST request for uploading the minidump. This also reads the content-type from the minidump file
configureConnectionForHttpPost
{ "repo_name": "was4444/chromium.src", "path": "chrome/android/java/src/org/chromium/chrome/browser/crash/MinidumpUploadCallable.java", "license": "bsd-3-clause", "size": 12728 }
[ "java.io.IOException", "java.net.HttpURLConnection" ]
import java.io.IOException; import java.net.HttpURLConnection;
import java.io.*; import java.net.*;
[ "java.io", "java.net" ]
java.io; java.net;
924,418
public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { mGLThread.onWindowResize(w, h); }
void function(SurfaceHolder holder, int format, int w, int h) { mGLThread.onWindowResize(w, h); }
/** * This method is part of the SurfaceHolder.Callback interface, and is * not normally called or subclassed by clients of GLSurfaceView. */
This method is part of the SurfaceHolder.Callback interface, and is not normally called or subclassed by clients of GLSurfaceView
surfaceChanged
{ "repo_name": "simonkinghk/Nobuhaka", "path": "src/com/stickycoding/rokon/GLSurfaceView.java", "license": "bsd-3-clause", "size": 56589 }
[ "android.view.SurfaceHolder" ]
import android.view.SurfaceHolder;
import android.view.*;
[ "android.view" ]
android.view;
18,184
@Override public RecordReader<ImmutableBytesWritable, Result> createRecordReader( InputSplit split, TaskAttemptContext context) throws IOException { // Just in case a subclass is relying on JobConfigurable magic. if (table == null) { initialize(context); } // null check in case our child overrides getTable to not throw. try { if (getTable() == null) { // initialize() must not have been implemented in the subclass. throw new IOException(INITIALIZATION_ERROR); } } catch (IllegalStateException exception) { throw new IOException(INITIALIZATION_ERROR, exception); } TableSplit tSplit = (TableSplit) split; LOG.info("Input split length: " + StringUtils.humanReadableInt(tSplit.getLength()) + " bytes."); final TableRecordReader trr = this.tableRecordReader != null ? this.tableRecordReader : new TableRecordReader(); Scan sc = new Scan(this.scan); sc.setStartRow(tSplit.getStartRow()); sc.setStopRow(tSplit.getEndRow()); trr.setScan(sc); trr.setTable(getTable()); return new RecordReader<ImmutableBytesWritable, Result>() {
RecordReader<ImmutableBytesWritable, Result> function( InputSplit split, TaskAttemptContext context) throws IOException { if (table == null) { initialize(context); } try { if (getTable() == null) { throw new IOException(INITIALIZATION_ERROR); } } catch (IllegalStateException exception) { throw new IOException(INITIALIZATION_ERROR, exception); } TableSplit tSplit = (TableSplit) split; LOG.info(STR + StringUtils.humanReadableInt(tSplit.getLength()) + STR); final TableRecordReader trr = this.tableRecordReader != null ? this.tableRecordReader : new TableRecordReader(); Scan sc = new Scan(this.scan); sc.setStartRow(tSplit.getStartRow()); sc.setStopRow(tSplit.getEndRow()); trr.setScan(sc); trr.setTable(getTable()); return new RecordReader<ImmutableBytesWritable, Result>() {
/** * Builds a {@link TableRecordReader}. If no {@link TableRecordReader} was provided, uses * the default. * * @param split The split to work with. * @param context The current context. * @return The newly created record reader. * @throws IOException When creating the reader fails. * @see org.apache.hadoop.mapreduce.InputFormat#createRecordReader( * org.apache.hadoop.mapreduce.InputSplit, * org.apache.hadoop.mapreduce.TaskAttemptContext) */
Builds a <code>TableRecordReader</code>. If no <code>TableRecordReader</code> was provided, uses the default
createRecordReader
{ "repo_name": "ibmsoe/hbase", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormatBase.java", "license": "apache-2.0", "size": 29435 }
[ "java.io.IOException", "org.apache.hadoop.hbase.client.Result", "org.apache.hadoop.hbase.client.Scan", "org.apache.hadoop.hbase.io.ImmutableBytesWritable", "org.apache.hadoop.mapreduce.InputSplit", "org.apache.hadoop.mapreduce.RecordReader", "org.apache.hadoop.mapreduce.TaskAttemptContext", "org.apache.hadoop.util.StringUtils" ]
import java.io.IOException; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.io.ImmutableBytesWritable; import org.apache.hadoop.mapreduce.InputSplit; import org.apache.hadoop.mapreduce.RecordReader; import org.apache.hadoop.mapreduce.TaskAttemptContext; import org.apache.hadoop.util.StringUtils;
import java.io.*; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.io.*; import org.apache.hadoop.mapreduce.*; import org.apache.hadoop.util.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
255,021
//// APPEND INSTRUCTION. public void appendInstruction(Instruction s) { currentBBLE.block.appendInstruction(s); s.position = gc.inlineSequence; s.bcIndex = instrIndex; lastInstr = s; if (DBG_INSTR || DBG_SELECTED) db("-> " + s.bcIndex + ":\t" + s); }
void function(Instruction s) { currentBBLE.block.appendInstruction(s); s.position = gc.inlineSequence; s.bcIndex = instrIndex; lastInstr = s; if (DBG_INSTR DBG_SELECTED) db(STR + s.bcIndex + ":\t" + s); }
/** * Append an instruction to the current basic block. * * @param s instruction to append */
Append an instruction to the current basic block
appendInstruction
{ "repo_name": "ut-osa/laminar", "path": "jikesrvm-3.0.0/rvm/src/org/jikesrvm/compilers/opt/bc2ir/BC2IR.java", "license": "bsd-3-clause", "size": 233116 }
[ "org.jikesrvm.compilers.opt.ir.Instruction" ]
import org.jikesrvm.compilers.opt.ir.Instruction;
import org.jikesrvm.compilers.opt.ir.*;
[ "org.jikesrvm.compilers" ]
org.jikesrvm.compilers;
1,813,235
public static void cleanUpTestDir(File dir) { if (!dir.isDirectory() || !dir.exists()) throw new IllegalStateException( "Not an existing directory: " + dir); File[] files = dir.listFiles(); if (files == null) return; for (File file : files) { if ("je.properties".equals(file.getName())) continue; if (file.isDirectory()) { cleanUpTestDir(file); if (file.list().length == 0 && !file.delete()) throw new IllegalStateException( "Unable to delete" + file); } else { if(!file.delete()) throw new IllegalStateException( "Unable to delete " + file); } } }
static void function(File dir) { if (!dir.isDirectory() !dir.exists()) throw new IllegalStateException( STR + dir); File[] files = dir.listFiles(); if (files == null) return; for (File file : files) { if (STR.equals(file.getName())) continue; if (file.isDirectory()) { cleanUpTestDir(file); if (file.list().length == 0 && !file.delete()) throw new IllegalStateException( STR + file); } else { if(!file.delete()) throw new IllegalStateException( STR + file); } } }
/** * Clean up everything in JE test destination directory including all kind * files and sub directories generated by last test except je.properties. */
Clean up everything in JE test destination directory including all kind files and sub directories generated by last test except je.properties
cleanUpTestDir
{ "repo_name": "genehallman/node-berkeleydb", "path": "deps/db-18.1.40/test/java/compat/src/com/sleepycat/util/test/SharedTestUtils.java", "license": "mit", "size": 9677 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
2,513,549
Collection<ProcessDefinition> getProcesses(QueryContext queryContext);
Collection<ProcessDefinition> getProcesses(QueryContext queryContext);
/** * Returns all process definitions available * @param queryContext control parameters for the result e.g. sorting, paging * @return A list of all available processes, in the form a of a list of {@link ProcessAssetDesc} instances. */
Returns all process definitions available
getProcesses
{ "repo_name": "sutaakar/jbpm", "path": "jbpm-services/jbpm-services-api/src/main/java/org/jbpm/services/api/RuntimeDataService.java", "license": "apache-2.0", "size": 25543 }
[ "java.util.Collection", "org.jbpm.services.api.model.ProcessDefinition", "org.kie.api.runtime.query.QueryContext" ]
import java.util.Collection; import org.jbpm.services.api.model.ProcessDefinition; import org.kie.api.runtime.query.QueryContext;
import java.util.*; import org.jbpm.services.api.model.*; import org.kie.api.runtime.query.*;
[ "java.util", "org.jbpm.services", "org.kie.api" ]
java.util; org.jbpm.services; org.kie.api;
604,104
@Test public void testToCollectionStrings() { Collection<String> coll = ArrayUtils.toCollectionStrings("a,b,c"); assertEquals(coll.size(), 3); }
void function() { Collection<String> coll = ArrayUtils.toCollectionStrings("a,b,c"); assertEquals(coll.size(), 3); }
/** * Test of toStringArray method, of class ArrayUtils. */
Test of toStringArray method, of class ArrayUtils
testToCollectionStrings
{ "repo_name": "EPICScotland/Broadwick", "path": "src/test/java/broadwick/utils/ArrayUtilsTest.java", "license": "apache-2.0", "size": 3538 }
[ "java.util.Collection", "org.junit.Assert" ]
import java.util.Collection; import org.junit.Assert;
import java.util.*; import org.junit.*;
[ "java.util", "org.junit" ]
java.util; org.junit;
1,614,775
String build(String ticketId, Service service);
String build(String ticketId, Service service);
/** * Build token. * * @param ticketId the ticket id * @param service the service * @return the token identifier */
Build token
build
{ "repo_name": "Unicon/cas", "path": "support/cas-server-support-token-core/src/main/java/org/apereo/cas/token/TokenTicketBuilder.java", "license": "apache-2.0", "size": 444 }
[ "org.apereo.cas.authentication.principal.Service" ]
import org.apereo.cas.authentication.principal.Service;
import org.apereo.cas.authentication.principal.*;
[ "org.apereo.cas" ]
org.apereo.cas;
1,591,667
public void setFocusPoint(@NonNull final Result result, @Nullable Point point) { final FocusPointFeature focusPointFeature = cameraFeatures.getFocusPoint(); focusPointFeature.setValue(point); focusPointFeature.updateBuilder(previewRequestBuilder); refreshPreviewCaptureSession( () -> result.success(null), (code, message) -> result.error("setFocusPointFailed", "Could not set focus point.", null)); this.setFocusMode(null, cameraFeatures.getAutoFocus().getValue()); }
void function(@NonNull final Result result, @Nullable Point point) { final FocusPointFeature focusPointFeature = cameraFeatures.getFocusPoint(); focusPointFeature.setValue(point); focusPointFeature.updateBuilder(previewRequestBuilder); refreshPreviewCaptureSession( () -> result.success(null), (code, message) -> result.error(STR, STR, null)); this.setFocusMode(null, cameraFeatures.getAutoFocus().getValue()); }
/** * Sets new focus point from dart. * * @param result Flutter result. * @param point the new coordinates. */
Sets new focus point from dart
setFocusPoint
{ "repo_name": "tvolkert/plugins", "path": "packages/camera/camera/android/src/main/java/io/flutter/plugins/camera/Camera.java", "license": "bsd-3-clause", "size": 41067 }
[ "androidx.annotation.NonNull", "androidx.annotation.Nullable", "io.flutter.plugin.common.MethodChannel", "io.flutter.plugins.camera.features.Point", "io.flutter.plugins.camera.features.focuspoint.FocusPointFeature" ]
import androidx.annotation.NonNull; import androidx.annotation.Nullable; import io.flutter.plugin.common.MethodChannel; import io.flutter.plugins.camera.features.Point; import io.flutter.plugins.camera.features.focuspoint.FocusPointFeature;
import androidx.annotation.*; import io.flutter.plugin.common.*; import io.flutter.plugins.camera.features.*; import io.flutter.plugins.camera.features.focuspoint.*;
[ "androidx.annotation", "io.flutter.plugin", "io.flutter.plugins" ]
androidx.annotation; io.flutter.plugin; io.flutter.plugins;
1,945,665
private SortedMap<Float, CmsWorkplaceEditorConfiguration> filterEditorsForResourceType(String resourceType) { SortedMap<Float, CmsWorkplaceEditorConfiguration> filteredEditors = new TreeMap<Float, CmsWorkplaceEditorConfiguration>(); Iterator<CmsWorkplaceEditorConfiguration> i = m_editorConfigurations.iterator(); while (i.hasNext()) { CmsWorkplaceEditorConfiguration currentConfig = i.next(); if (currentConfig.matchesResourceType(resourceType)) { float key = currentConfig.getRankingForResourceType(resourceType); if (key >= 0) { filteredEditors.put(new Float(key), currentConfig); } } } return filteredEditors; }
SortedMap<Float, CmsWorkplaceEditorConfiguration> function(String resourceType) { SortedMap<Float, CmsWorkplaceEditorConfiguration> filteredEditors = new TreeMap<Float, CmsWorkplaceEditorConfiguration>(); Iterator<CmsWorkplaceEditorConfiguration> i = m_editorConfigurations.iterator(); while (i.hasNext()) { CmsWorkplaceEditorConfiguration currentConfig = i.next(); if (currentConfig.matchesResourceType(resourceType)) { float key = currentConfig.getRankingForResourceType(resourceType); if (key >= 0) { filteredEditors.put(new Float(key), currentConfig); } } } return filteredEditors; }
/** * Filters the matching editors for the given resource type from the list of all available editors.<p> * * @param resourceType the resource type to filter * @return a map of filtered editor configurations sorted asceding by the ranking for the current resource type, with the (Float) ranking as key */
Filters the matching editors for the given resource type from the list of all available editors
filterEditorsForResourceType
{ "repo_name": "mediaworx/opencms-core", "path": "src/org/opencms/workplace/editors/CmsWorkplaceEditorManager.java", "license": "lgpl-2.1", "size": 18281 }
[ "java.util.Iterator", "java.util.SortedMap", "java.util.TreeMap" ]
import java.util.Iterator; import java.util.SortedMap; import java.util.TreeMap;
import java.util.*;
[ "java.util" ]
java.util;
2,843,929
public Observable<ServiceResponse<Object>> beginFlushWithServiceResponseAsync(String resourceGroupName, String cacheName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (cacheName == null) { throw new IllegalArgumentException("Parameter cacheName is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); }
Observable<ServiceResponse<Object>> function(String resourceGroupName, String cacheName) { if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); } if (cacheName == null) { throw new IllegalArgumentException(STR); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException(STR); }
/** * Tells a cache to write all dirty data to the StorageTarget(s). During the flush, clients will see errors returned until the flush is complete. * * @param resourceGroupName Target resource group. * @param cacheName Name of cache. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the Object object */
Tells a cache to write all dirty data to the StorageTarget(s). During the flush, clients will see errors returned until the flush is complete
beginFlushWithServiceResponseAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/storagecache/mgmt-v2019_08_01/src/main/java/com/microsoft/azure/management/storagecache/v2019_08_01/implementation/CachesInner.java", "license": "mit", "size": 107334 }
[ "com.microsoft.rest.ServiceResponse" ]
import com.microsoft.rest.ServiceResponse;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
2,116,358
public static List<String> listPartitionValues(Path file, Path root, boolean hasDirsOnly) { String[] dirs = parsePartitions(file, root, hasDirsOnly); if (dirs == null) { return Collections.emptyList(); } return Arrays.asList(dirs); }
static List<String> function(Path file, Path root, boolean hasDirsOnly) { String[] dirs = parsePartitions(file, root, hasDirsOnly); if (dirs == null) { return Collections.emptyList(); } return Arrays.asList(dirs); }
/** * Compares root and file path to determine directories * that are present in the file path but absent in root. * Example: root - a/b/c, file - a/b/c/d/e/0_0_0.parquet, result - d/e. * Stores different directory names in the list in successive order. * * @param file file path * @param root root directory * @param hasDirsOnly whether it is file or directory * @return list of directory names */
Compares root and file path to determine directories that are present in the file path but absent in root. Example: root - a/b/c, file - a/b/c/d/e/0_0_0.parquet, result - d/e. Stores different directory names in the list in successive order
listPartitionValues
{ "repo_name": "vdiravka/drill", "path": "exec/java-exec/src/main/java/org/apache/drill/exec/store/ColumnExplorer.java", "license": "apache-2.0", "size": 22993 }
[ "java.util.Arrays", "java.util.Collections", "java.util.List", "org.apache.hadoop.fs.Path" ]
import java.util.Arrays; import java.util.Collections; import java.util.List; import org.apache.hadoop.fs.Path;
import java.util.*; import org.apache.hadoop.fs.*;
[ "java.util", "org.apache.hadoop" ]
java.util; org.apache.hadoop;
741,759
protected ByteOrder getByteOrder(){ return mByteOrder; }
ByteOrder function(){ return mByteOrder; }
/** * Gets the byte order. */
Gets the byte order
getByteOrder
{ "repo_name": "hikelee/projector", "path": "android/master/src/com/android/gallery3d/exif/ExifData.java", "license": "mit", "size": 9334 }
[ "java.nio.ByteOrder" ]
import java.nio.ByteOrder;
import java.nio.*;
[ "java.nio" ]
java.nio;
2,074,677
public static void resetStreamCache(Message message) { if (message == null) { return; } Object body = message.getBody(); if (body != null && body instanceof StreamCache) { ((StreamCache) body).reset(); } }
static void function(Message message) { if (message == null) { return; } Object body = message.getBody(); if (body != null && body instanceof StreamCache) { ((StreamCache) body).reset(); } }
/** * If the message body contains a {@link StreamCache} instance, reset the * cache to enable reading from it again. * * @param message the message for which to reset the body */
If the message body contains a <code>StreamCache</code> instance, reset the cache to enable reading from it again
resetStreamCache
{ "repo_name": "YMartsynkevych/camel", "path": "camel-core/src/main/java/org/apache/camel/util/MessageHelper.java", "license": "apache-2.0", "size": 22010 }
[ "org.apache.camel.Message", "org.apache.camel.StreamCache" ]
import org.apache.camel.Message; import org.apache.camel.StreamCache;
import org.apache.camel.*;
[ "org.apache.camel" ]
org.apache.camel;
342,472
public void add(final QueryProperty property) { if (nameOfCollectionController == null) { nameOfCollectionController = getNameOfCollectionController(property.getCollectionContainerParentType(), property.getCollectionNameInItsParentTypeContext()); } if (propertyNameOfCollectionParent == null) { propertyNameOfCollectionParent = property.getPropertyNameOfCollectionParent(); } final Calculated calcAnnotation = AnnotationReflector.getPropertyAnnotation(Calculated.class, property.getEntityClass(), property.getPropertyName()); final Boolean all = calcAnnotation == null ? null : calcAnnotation.attribute().equals(CalculatedPropertyAttribute.ALL) ? Boolean.TRUE : calcAnnotation.attribute().equals(CalculatedPropertyAttribute.ANY) ? Boolean.FALSE : null; if (Boolean.TRUE.equals(all)) { allProperties.add(property); // ALL properties list } else if (Boolean.FALSE.equals(all)) { anyProperties.add(property); // ANY properties list } else { filteringProperties.add(property); // FILTERING properties list } }
void function(final QueryProperty property) { if (nameOfCollectionController == null) { nameOfCollectionController = getNameOfCollectionController(property.getCollectionContainerParentType(), property.getCollectionNameInItsParentTypeContext()); } if (propertyNameOfCollectionParent == null) { propertyNameOfCollectionParent = property.getPropertyNameOfCollectionParent(); } final Calculated calcAnnotation = AnnotationReflector.getPropertyAnnotation(Calculated.class, property.getEntityClass(), property.getPropertyName()); final Boolean all = calcAnnotation == null ? null : calcAnnotation.attribute().equals(CalculatedPropertyAttribute.ALL) ? Boolean.TRUE : calcAnnotation.attribute().equals(CalculatedPropertyAttribute.ANY) ? Boolean.FALSE : null; if (Boolean.TRUE.equals(all)) { allProperties.add(property); } else if (Boolean.FALSE.equals(all)) { anyProperties.add(property); } else { filteringProperties.add(property); } }
/** * Adds a property to a relevant sub-collection (FILTERING, ALL, ANY). * * @param all * -- <code>true</code> to add to ALL properties, <code>false</code> -- to add to ANY properties, <code>null</code> to add to FILTERING properties. */
Adds a property to a relevant sub-collection (FILTERING, ALL, ANY)
add
{ "repo_name": "fieldenms/tg", "path": "platform-pojo-bl/src/main/java/ua/com/fielden/platform/entity_centre/review/DynamicQueryBuilder.java", "license": "mit", "size": 59882 }
[ "java.lang.Boolean", "ua.com.fielden.platform.domaintree.ICalculatedProperty", "ua.com.fielden.platform.entity.annotation.Calculated", "ua.com.fielden.platform.reflection.AnnotationReflector" ]
import java.lang.Boolean; import ua.com.fielden.platform.domaintree.ICalculatedProperty; import ua.com.fielden.platform.entity.annotation.Calculated; import ua.com.fielden.platform.reflection.AnnotationReflector;
import java.lang.*; import ua.com.fielden.platform.domaintree.*; import ua.com.fielden.platform.entity.annotation.*; import ua.com.fielden.platform.reflection.*;
[ "java.lang", "ua.com.fielden" ]
java.lang; ua.com.fielden;
2,124,949
private void setListShown(boolean shown, boolean animate) { ensureList(); if (mProgressContainer == null) { throw new IllegalStateException("Can't be used with a custom content view"); } if (mListShown == shown) { return; } mListShown = shown; if (shown) { if (animate) { mProgressContainer.startAnimation(AnimationUtils.loadAnimation( getActivity(), android.R.anim.fade_out)); mListContainer.startAnimation(AnimationUtils.loadAnimation( getActivity(), android.R.anim.fade_in)); } else { mProgressContainer.clearAnimation(); mListContainer.clearAnimation(); } mProgressContainer.setVisibility(View.GONE); mListContainer.setVisibility(View.VISIBLE); } else { if (animate) { mProgressContainer.startAnimation(AnimationUtils.loadAnimation( getActivity(), android.R.anim.fade_in)); mListContainer.startAnimation(AnimationUtils.loadAnimation( getActivity(), android.R.anim.fade_out)); } else { mProgressContainer.clearAnimation(); mListContainer.clearAnimation(); } mProgressContainer.setVisibility(View.VISIBLE); mListContainer.setVisibility(View.GONE); } }
void function(boolean shown, boolean animate) { ensureList(); if (mProgressContainer == null) { throw new IllegalStateException(STR); } if (mListShown == shown) { return; } mListShown = shown; if (shown) { if (animate) { mProgressContainer.startAnimation(AnimationUtils.loadAnimation( getActivity(), android.R.anim.fade_out)); mListContainer.startAnimation(AnimationUtils.loadAnimation( getActivity(), android.R.anim.fade_in)); } else { mProgressContainer.clearAnimation(); mListContainer.clearAnimation(); } mProgressContainer.setVisibility(View.GONE); mListContainer.setVisibility(View.VISIBLE); } else { if (animate) { mProgressContainer.startAnimation(AnimationUtils.loadAnimation( getActivity(), android.R.anim.fade_in)); mListContainer.startAnimation(AnimationUtils.loadAnimation( getActivity(), android.R.anim.fade_out)); } else { mProgressContainer.clearAnimation(); mListContainer.clearAnimation(); } mProgressContainer.setVisibility(View.VISIBLE); mListContainer.setVisibility(View.GONE); } }
/** * Control whether the list is being displayed. You can make it not * displayed if you are waiting for the initial data to show in it. During * this time an indeterminant progress indicator will be shown instead. * * @param shown If true, the list view is shown; if false, the progress * indicator. The initial value is true. * @param animate If true, an animation will be used to transition to the * new state. */
Control whether the list is being displayed. You can make it not displayed if you are waiting for the initial data to show in it. During this time an indeterminant progress indicator will be shown instead
setListShown
{ "repo_name": "MaTriXy/strictmode", "path": "src/strictmode-viewer-app/src/com/robomorphine/strictmode/viewer/fragment/ConfigurableListFragment.java", "license": "apache-2.0", "size": 14293 }
[ "android.view.View", "android.view.animation.AnimationUtils" ]
import android.view.View; import android.view.animation.AnimationUtils;
import android.view.*; import android.view.animation.*;
[ "android.view" ]
android.view;
2,011,339
EReference getCloudNetwork_Servers();
EReference getCloudNetwork_Servers();
/** * Returns the meta object for the containment reference list '{@link datacenter.core.CloudNetwork#getServers <em>Servers</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the containment reference list '<em>Servers</em>'. * @see datacenter.core.CloudNetwork#getServers() * @see #getCloudNetwork() * @generated */
Returns the meta object for the containment reference list '<code>datacenter.core.CloudNetwork#getServers Servers</code>'.
getCloudNetwork_Servers
{ "repo_name": "diverse-project/flink-datacenter", "path": "datacenter/src/datacenter/core/CorePackage.java", "license": "mit", "size": 36104 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,413,947
public void setUpBoard() { // Link board to cells and layout for(int r = 0; r < BOARD_ROWS; ++r) { // For each row, we link the TableRow TableRow tr = new TableRow(this); boardRowLayout[r] = tr; // For each row, we link each column for(int c = 0; c < BOARD_COLS; ++c) { // Create ImageView ImageView iv = new ImageView(this); // Assign the image resource to GROUND (it's useless because // when we create the Cell later, it will be do the same again, and // when we will call clearBoard() too!!!) iv.setImageResource(R.drawable.cell_ground); // Add ImageView to TableRow tr.addView(iv); // Link board cell to a new Cell object boardCells[r][c] = new Cell(Cell.CELL_GROUND, iv); } // Add the TableRow to the TableLayout boardLayout.addView(tr); } }
void function() { for(int r = 0; r < BOARD_ROWS; ++r) { TableRow tr = new TableRow(this); boardRowLayout[r] = tr; for(int c = 0; c < BOARD_COLS; ++c) { ImageView iv = new ImageView(this); iv.setImageResource(R.drawable.cell_ground); tr.addView(iv); boardCells[r][c] = new Cell(Cell.CELL_GROUND, iv); } boardLayout.addView(tr); } }
/** * Set up the board for the first time. */
Set up the board for the first time
setUpBoard
{ "repo_name": "MiguelVis/RobotsAndroidStudio", "path": "app/src/main/java/es/floppysoftware/robots/MainActivity.java", "license": "gpl-2.0", "size": 19146 }
[ "android.widget.ImageView", "android.widget.TableRow" ]
import android.widget.ImageView; import android.widget.TableRow;
import android.widget.*;
[ "android.widget" ]
android.widget;
1,306,116
public List<String> rewrite(Reader content, Uri source, UriMaker uriMaker, Writer writer, boolean extractImports, GadgetContext gadgetContext) throws RewritingException { try { String original = IOUtils.toString(content); try { CssTree.StyleSheet stylesheet = cssParser.parseDom(original, source); List<String> stringList = rewrite(stylesheet, source, uriMaker, extractImports, gadgetContext); // Serialize the stylesheet cssParser.serialize(stylesheet, writer); return stringList; } catch (GadgetException ge) { if (ge.getCause() instanceof ParseException) { if (LOG.isLoggable(Level.WARNING)) { LOG.logp(Level.WARNING, classname, "rewrite", MessageKeys.CAJA_CSS_PARSE_FAILURE, new Object[] {ge.getCause().getMessage(),source}); } writer.write(original); return Collections.emptyList(); } else { throw new RewritingException(ge, ge.getHttpStatusCode()); } } } catch (IOException ioe) { throw new RewritingException(ioe, HttpResponse.SC_INTERNAL_SERVER_ERROR); } }
List<String> function(Reader content, Uri source, UriMaker uriMaker, Writer writer, boolean extractImports, GadgetContext gadgetContext) throws RewritingException { try { String original = IOUtils.toString(content); try { CssTree.StyleSheet stylesheet = cssParser.parseDom(original, source); List<String> stringList = rewrite(stylesheet, source, uriMaker, extractImports, gadgetContext); cssParser.serialize(stylesheet, writer); return stringList; } catch (GadgetException ge) { if (ge.getCause() instanceof ParseException) { if (LOG.isLoggable(Level.WARNING)) { LOG.logp(Level.WARNING, classname, STR, MessageKeys.CAJA_CSS_PARSE_FAILURE, new Object[] {ge.getCause().getMessage(),source}); } writer.write(original); return Collections.emptyList(); } else { throw new RewritingException(ge, ge.getHttpStatusCode()); } } } catch (IOException ioe) { throw new RewritingException(ioe, HttpResponse.SC_INTERNAL_SERVER_ERROR); } }
/** * Rewrite the given CSS content and optionally extract the import references. * @param content CSS content * @param source Uri of content * @param uriMaker a Uri Maker * @param writer Output * @param extractImports If true remove the import statements from the output and return their * referenced URIs. * @param gadgetContext The gadgetContext * * @return Empty list of extracted import URIs. */
Rewrite the given CSS content and optionally extract the import references
rewrite
{ "repo_name": "apparentlymart/shindig", "path": "java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/CssResponseRewriter.java", "license": "apache-2.0", "size": 9627 }
[ "com.google.caja.lexer.ParseException", "com.google.caja.parser.css.CssTree", "java.io.IOException", "java.io.Reader", "java.io.Writer", "java.util.Collections", "java.util.List", "java.util.logging.Level", "org.apache.commons.io.IOUtils", "org.apache.shindig.common.logging.i18n.MessageKeys", "org.apache.shindig.common.uri.Uri", "org.apache.shindig.gadgets.GadgetContext", "org.apache.shindig.gadgets.GadgetException", "org.apache.shindig.gadgets.http.HttpResponse" ]
import com.google.caja.lexer.ParseException; import com.google.caja.parser.css.CssTree; import java.io.IOException; import java.io.Reader; import java.io.Writer; import java.util.Collections; import java.util.List; import java.util.logging.Level; import org.apache.commons.io.IOUtils; import org.apache.shindig.common.logging.i18n.MessageKeys; import org.apache.shindig.common.uri.Uri; import org.apache.shindig.gadgets.GadgetContext; import org.apache.shindig.gadgets.GadgetException; import org.apache.shindig.gadgets.http.HttpResponse;
import com.google.caja.lexer.*; import com.google.caja.parser.css.*; import java.io.*; import java.util.*; import java.util.logging.*; import org.apache.commons.io.*; import org.apache.shindig.common.logging.i18n.*; import org.apache.shindig.common.uri.*; import org.apache.shindig.gadgets.*; import org.apache.shindig.gadgets.http.*;
[ "com.google.caja", "java.io", "java.util", "org.apache.commons", "org.apache.shindig" ]
com.google.caja; java.io; java.util; org.apache.commons; org.apache.shindig;
2,374,004
@Override public List<Email> getRecentEmails(LocalDateTime emailAfterThisDate) { emailAfterThisDate = LocalDateTime.now().minusMonths(1); List<Email> localListOfEmails = new ArrayList<>(); for (Email email: listOfEmails) { if (email.getTimeReceived().isAfter(emailAfterThisDate)) { localListOfEmails.add(email); } } return localListOfEmails; }
List<Email> function(LocalDateTime emailAfterThisDate) { emailAfterThisDate = LocalDateTime.now().minusMonths(1); List<Email> localListOfEmails = new ArrayList<>(); for (Email email: listOfEmails) { if (email.getTimeReceived().isAfter(emailAfterThisDate)) { localListOfEmails.add(email); } } return localListOfEmails; }
/** * Method that retrieves a list of emails within the past 30 days */
Method that retrieves a list of emails within the past 30 days
getRecentEmails
{ "repo_name": "jimtryon/mvc", "path": "Jim-ModelViewController/src/edu/greenriver/it/model/TestPlannerRepository.java", "license": "mit", "size": 3212 }
[ "edu.greenriver.it.entities.Email", "java.time.LocalDateTime", "java.util.ArrayList", "java.util.List" ]
import edu.greenriver.it.entities.Email; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List;
import edu.greenriver.it.entities.*; import java.time.*; import java.util.*;
[ "edu.greenriver.it", "java.time", "java.util" ]
edu.greenriver.it; java.time; java.util;
1,859,613
@VisibleForTesting public static Bundle createResponseBundle(int responseCode) { Bundle bundle = new Bundle(); bundle.putInt(RESPONSE_ACKNOWLEDGE_RESPONSE_CODE, responseCode); return bundle; }
static Bundle function(int responseCode) { Bundle bundle = new Bundle(); bundle.putInt(RESPONSE_ACKNOWLEDGE_RESPONSE_CODE, responseCode); return bundle; }
/** * Creates a {@link Bundle} that represents the result of an acknowledge call. This would be * carried out by the client app and is only here to help testing. */
Creates a <code>Bundle</code> that represents the result of an acknowledge call. This would be carried out by the client app and is only here to help testing
createResponseBundle
{ "repo_name": "nwjs/chromium.src", "path": "chrome/android/java/src/org/chromium/chrome/browser/browserservices/digitalgoods/AcknowledgeConverter.java", "license": "bsd-3-clause", "size": 3416 }
[ "android.os.Bundle" ]
import android.os.Bundle;
import android.os.*;
[ "android.os" ]
android.os;
1,019,286
FormDefinitionQuery formVersionLowerThanOrEquals(Integer formVersion); /** * Only select the forms which are the latest deployed (ie. which have the highest version number for the given key). * * Can also be used without any other criteria (ie. query.latest().list()), which will then give all the latest versions of all the deployed decision tables. * * @throws FlowableIllegalArgumentException * if used in combination with {@link #groupId(string)}, {@link #formVersion(int)} or {@link #deploymentId(String)}
FormDefinitionQuery formVersionLowerThanOrEquals(Integer formVersion); /** * Only select the forms which are the latest deployed (ie. which have the highest version number for the given key). * * Can also be used without any other criteria (ie. query.latest().list()), which will then give all the latest versions of all the deployed decision tables. * * @throws FlowableIllegalArgumentException * if used in combination with {@link #groupId(string)}, {@link #formVersion(int)} or {@link #deploymentId(String)}
/** * Only select forms which version are lower than or equals a certain version. */
Only select forms which version are lower than or equals a certain version
formVersionLowerThanOrEquals
{ "repo_name": "lsmall/flowable-engine", "path": "modules/flowable-form-api/src/main/java/org/flowable/form/api/FormDefinitionQuery.java", "license": "apache-2.0", "size": 5978 }
[ "org.flowable.common.engine.api.FlowableIllegalArgumentException" ]
import org.flowable.common.engine.api.FlowableIllegalArgumentException;
import org.flowable.common.engine.api.*;
[ "org.flowable.common" ]
org.flowable.common;
2,899,353
public void updatePing() throws SteamCondenserException, TimeoutException { this.sendRequest(new A2S_INFO_Packet()); long startTime = System.currentTimeMillis(); this.getReply(); long endTime = System.currentTimeMillis(); this.ping = Long.valueOf(endTime - startTime).intValue(); }
void function() throws SteamCondenserException, TimeoutException { this.sendRequest(new A2S_INFO_Packet()); long startTime = System.currentTimeMillis(); this.getReply(); long endTime = System.currentTimeMillis(); this.ping = Long.valueOf(endTime - startTime).intValue(); }
/** * Sends a A2S_INFO request to the server and measures the time needed for * the reply * <p/> * If this information is vital to you, be sure to call this method * regularly to stay up-to-date. * * @see #getPing * @see #initialize * @throws SteamCondenserException if the request fails * @throws TimeoutException if the request times out */
Sends a A2S_INFO request to the server and measures the time needed for the reply If this information is vital to you, be sure to call this method regularly to stay up-to-date
updatePing
{ "repo_name": "JamesGames/steam-condenser-for-rust", "path": "src/main/java/com/github/koraktor/steamcondenser/steam/servers/GameServer.java", "license": "bsd-3-clause", "size": 24102 }
[ "com.github.koraktor.steamcondenser.exceptions.SteamCondenserException", "java.util.concurrent.TimeoutException" ]
import com.github.koraktor.steamcondenser.exceptions.SteamCondenserException; import java.util.concurrent.TimeoutException;
import com.github.koraktor.steamcondenser.exceptions.*; import java.util.concurrent.*;
[ "com.github.koraktor", "java.util" ]
com.github.koraktor; java.util;
1,689,919
public static void collectStats(final StatsCollector collector) { collector.record("rpc.received", requests, "type=put"); collector.record("rpc.errors", hbase_errors, "type=hbase_errors"); collector.record("rpc.errors", invalid_values, "type=invalid_values"); collector.record("rpc.errors", illegal_arguments, "type=illegal_arguments"); collector.record("rpc.errors", unknown_metrics, "type=unknown_metrics"); } /** * Imports a single data point. * @param tsdb The TSDB to import the data point into. * @param words The words describing the data point to import, in * the following format: {@code [metric, timestamp, value, ..tags..]}
static void function(final StatsCollector collector) { collector.record(STR, requests, STR); collector.record(STR, hbase_errors, STR); collector.record(STR, invalid_values, STR); collector.record(STR, illegal_arguments, STR); collector.record(STR, unknown_metrics, STR); } /** * Imports a single data point. * @param tsdb The TSDB to import the data point into. * @param words The words describing the data point to import, in * the following format: {@code [metric, timestamp, value, ..tags..]}
/** * Collects the stats and metrics tracked by this instance. * @param collector The collector to use. */
Collects the stats and metrics tracked by this instance
collectStats
{ "repo_name": "adeneche/opentsdb", "path": "src/tsd/PutDataPointRpc.java", "license": "gpl-3.0", "size": 10494 }
[ "net.opentsdb.stats.StatsCollector" ]
import net.opentsdb.stats.StatsCollector;
import net.opentsdb.stats.*;
[ "net.opentsdb.stats" ]
net.opentsdb.stats;
279,034
public static String getSecondaryNameNodeHost(ComponentConfig hadoopConfig) { return (String) hadoopConfig .getAdvanceConfProperty(HadoopConstants.AdvanceConfKeys.SECONDARY_NAMENODE); }
static String function(ComponentConfig hadoopConfig) { return (String) hadoopConfig .getAdvanceConfProperty(HadoopConstants.AdvanceConfKeys.SECONDARY_NAMENODE); }
/** * Gets the secondary name node host. * * @param hadoopConfig * the hadoop config * @return the secondary name node host */
Gets the secondary name node host
getSecondaryNameNodeHost
{ "repo_name": "impetus-opensource/ankush", "path": "ankush/src/main/java/com/impetus/ankush2/hadoop/utils/HadoopUtils.java", "license": "lgpl-3.0", "size": 62017 }
[ "com.impetus.ankush2.framework.config.ComponentConfig" ]
import com.impetus.ankush2.framework.config.ComponentConfig;
import com.impetus.ankush2.framework.config.*;
[ "com.impetus.ankush2" ]
com.impetus.ankush2;
2,736,848
public void execSQL(String sql, Object[] bindArgs) throws SQLException { if (bindArgs == null) { throw new IllegalArgumentException("Empty bindArgs"); } long timeStart = SystemClock.uptimeMillis(); lock(); if (!isOpen()) { throw new IllegalStateException("database not open"); } SQLiteStatement statement = null; try { statement = compileStatement(sql); if (bindArgs != null) { int numArgs = bindArgs.length; for (int i = 0; i < numArgs; i++) { DatabaseUtils.bindObjectToProgram(statement, i + 1, bindArgs[i]); } } statement.execute(); } catch (SQLiteDatabaseCorruptException e) { onCorruption(); throw e; } finally { if (statement != null) { statement.close(); } unlock(); } logTimeStat(sql, timeStart); }
void function(String sql, Object[] bindArgs) throws SQLException { if (bindArgs == null) { throw new IllegalArgumentException(STR); } long timeStart = SystemClock.uptimeMillis(); lock(); if (!isOpen()) { throw new IllegalStateException(STR); } SQLiteStatement statement = null; try { statement = compileStatement(sql); if (bindArgs != null) { int numArgs = bindArgs.length; for (int i = 0; i < numArgs; i++) { DatabaseUtils.bindObjectToProgram(statement, i + 1, bindArgs[i]); } } statement.execute(); } catch (SQLiteDatabaseCorruptException e) { onCorruption(); throw e; } finally { if (statement != null) { statement.close(); } unlock(); } logTimeStat(sql, timeStart); }
/** * Execute a single SQL statement that is not a query. For example, CREATE * TABLE, DELETE, INSERT, etc. Multiple statements separated by ;s are not * supported. it takes a write lock, * * @param sql * @param bindArgs only byte[], String, Long and Double are supported in bindArgs. * @throws SQLException If the SQL string is invalid for some reason */
Execute a single SQL statement that is not a query. For example, CREATE TABLE, DELETE, INSERT, etc. Multiple statements separated by ;s are not supported. it takes a write lock
execSQL
{ "repo_name": "eighthave/android-database-sqlcipher", "path": "src/net/sqlcipher/database/SQLiteDatabase.java", "license": "apache-2.0", "size": 101196 }
[ "android.os.SystemClock", "net.sqlcipher.DatabaseUtils", "net.sqlcipher.SQLException" ]
import android.os.SystemClock; import net.sqlcipher.DatabaseUtils; import net.sqlcipher.SQLException;
import android.os.*; import net.sqlcipher.*;
[ "android.os", "net.sqlcipher" ]
android.os; net.sqlcipher;
286,504
private static SwtUniversalImage loadFromClassLoader( Display display, ClassLoader classLoader, String location ) { InputStream s = null; try { s = classLoader.getResourceAsStream( location ); } catch ( Throwable t ) { log.logDebug( "Unable to load image from classloader [" + location + "]" ); } if ( s == null ) { return null; } try { return loadImage( display, s, location ); } finally { IOUtils.closeQuietly( s ); } }
static SwtUniversalImage function( Display display, ClassLoader classLoader, String location ) { InputStream s = null; try { s = classLoader.getResourceAsStream( location ); } catch ( Throwable t ) { log.logDebug( STR + location + "]" ); } if ( s == null ) { return null; } try { return loadImage( display, s, location ); } finally { IOUtils.closeQuietly( s ); } }
/** * Internal image loading by ClassLoader.getResourceAsStream. */
Internal image loading by ClassLoader.getResourceAsStream
loadFromClassLoader
{ "repo_name": "IvanNikolaychuk/pentaho-kettle", "path": "ui/src/org/pentaho/di/ui/util/SwtSvgImageUtil.java", "license": "apache-2.0", "size": 10484 }
[ "java.io.InputStream", "org.apache.commons.io.IOUtils", "org.eclipse.swt.widgets.Display", "org.pentaho.di.core.SwtUniversalImage" ]
import java.io.InputStream; import org.apache.commons.io.IOUtils; import org.eclipse.swt.widgets.Display; import org.pentaho.di.core.SwtUniversalImage;
import java.io.*; import org.apache.commons.io.*; import org.eclipse.swt.widgets.*; import org.pentaho.di.core.*;
[ "java.io", "org.apache.commons", "org.eclipse.swt", "org.pentaho.di" ]
java.io; org.apache.commons; org.eclipse.swt; org.pentaho.di;
876,031
@Test public void testFullInstantiation() { User user = new User("test", "Test", "@", "1234567890", true); assertNotNull(user); }
void function() { User user = new User("test", "Test", "@", STR, true); assertNotNull(user); }
/** * Test the instantiation of User with all the info */
Test the instantiation of User with all the info
testFullInstantiation
{ "repo_name": "CMPUT301F16T13/ThunderCab", "path": "app/src/test/java/thundersquadron/thundercab/model/UserTest.java", "license": "mit", "size": 3902 }
[ "com.thundersquadron.thundercab.models.User", "junit.framework.Assert", "org.junit.Test" ]
import com.thundersquadron.thundercab.models.User; import junit.framework.Assert; import org.junit.Test;
import com.thundersquadron.thundercab.models.*; import junit.framework.*; import org.junit.*;
[ "com.thundersquadron.thundercab", "junit.framework", "org.junit" ]
com.thundersquadron.thundercab; junit.framework; org.junit;
470,723
private void setOwner(final FileSystem fs, final Path path, final String user, final String group, final boolean recursive) throws IOException { if (user != null || group != null) { if (recursive && fs.isDirectory(path)) { for (FileStatus child : fs.listStatus(path)) { setOwner(fs, child.getPath(), user, group, recursive); } } fs.setOwner(path, user, group); } }
void function(final FileSystem fs, final Path path, final String user, final String group, final boolean recursive) throws IOException { if (user != null group != null) { if (recursive && fs.isDirectory(path)) { for (FileStatus child : fs.listStatus(path)) { setOwner(fs, child.getPath(), user, group, recursive); } } fs.setOwner(path, user, group); } }
/** * Set path ownership. */
Set path ownership
setOwner
{ "repo_name": "vincentpoon/hbase", "path": "hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java", "license": "apache-2.0", "size": 45712 }
[ "java.io.IOException", "org.apache.hadoop.fs.FileStatus", "org.apache.hadoop.fs.FileSystem", "org.apache.hadoop.fs.Path" ]
import java.io.IOException; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path;
import java.io.*; import org.apache.hadoop.fs.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
213,621
public AppServiceEnvironmentInner withClusterSettings(List<NameValuePair> clusterSettings) { this.clusterSettings = clusterSettings; return this; }
AppServiceEnvironmentInner function(List<NameValuePair> clusterSettings) { this.clusterSettings = clusterSettings; return this; }
/** * Set custom settings for changing the behavior of the App Service Environment. * * @param clusterSettings the clusterSettings value to set * @return the AppServiceEnvironmentInner object itself. */
Set custom settings for changing the behavior of the App Service Environment
withClusterSettings
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/appservice/mgmt-v2019_08_01/src/main/java/com/microsoft/azure/management/appservice/v2019_08_01/implementation/AppServiceEnvironmentInner.java", "license": "mit", "size": 27475 }
[ "com.microsoft.azure.management.appservice.v2019_08_01.NameValuePair", "java.util.List" ]
import com.microsoft.azure.management.appservice.v2019_08_01.NameValuePair; import java.util.List;
import com.microsoft.azure.management.appservice.v2019_08_01.*; import java.util.*;
[ "com.microsoft.azure", "java.util" ]
com.microsoft.azure; java.util;
344,973
public static List<Boundary> boundaryForName(String name) { List<Boundary> bounds = new ArrayList<Boundary>(); for (Boundary boundary : boundaries) { if (boundary.getName().equalsIgnoreCase(name)) { bounds.add(boundary); } } return bounds; }
static List<Boundary> function(String name) { List<Boundary> bounds = new ArrayList<Boundary>(); for (Boundary boundary : boundaries) { if (boundary.getName().equalsIgnoreCase(name)) { bounds.add(boundary); } } return bounds; }
/** * Gets a boundary by its name. * * @param name * The name. * @return The boundary. */
Gets a boundary by its name
boundaryForName
{ "repo_name": "kewle003/hyperion", "path": "src/org/rs2server/rs2/model/boundary/BoundaryManager.java", "license": "mit", "size": 3753 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,088,900
public BigInteger getP() { return p; }
BigInteger function() { return p; }
/** * Returns the prime modulus <code>p</code>. * * @return the prime modulus <code>p</code> */
Returns the prime modulus <code>p</code>
getP
{ "repo_name": "GaloisInc/hacrypto", "path": "src/Java/BouncyCastle/BouncyCastle-1.50/jce/src/main/java/javax/crypto/spec/DHPrivateKeySpec.java", "license": "bsd-3-clause", "size": 1219 }
[ "java.math.BigInteger" ]
import java.math.BigInteger;
import java.math.*;
[ "java.math" ]
java.math;
1,237,716
public static HttpURLConnection setAcl(final URI rootUri, final TableRequestOptions options, final OperationContext opContext) throws IOException, URISyntaxException, StorageException { UriQueryBuilder queryBuilder = new UriQueryBuilder(); queryBuilder.add(Constants.QueryConstants.COMPONENT, "acl"); final HttpURLConnection retConnection = BaseRequest.createURLConnection(rootUri, options, queryBuilder, opContext); retConnection.setRequestMethod("PUT"); retConnection.setDoOutput(true); return retConnection; }
static HttpURLConnection function(final URI rootUri, final TableRequestOptions options, final OperationContext opContext) throws IOException, URISyntaxException, StorageException { UriQueryBuilder queryBuilder = new UriQueryBuilder(); queryBuilder.add(Constants.QueryConstants.COMPONENT, "acl"); final HttpURLConnection retConnection = BaseRequest.createURLConnection(rootUri, options, queryBuilder, opContext); retConnection.setRequestMethod("PUT"); retConnection.setDoOutput(true); return retConnection; }
/** * Sets the ACL for the table. Sign with length of aclBytes. * * @param rootUri * A <code>java.net.URI</code> containing an absolute URI to the resource. * @param tableOptions * A {@link TableRequestOptions} object that specifies execution options such as retry policy and timeout * settings for the operation. Specify <code>null</code> to use the request options specified on the * {@link CloudTableClient}. * @param opContext * An {@link OperationContext} object for tracking the current operation. Specify <code>null</code> to * safely ignore operation context. * * @return a HttpURLConnection configured for the operation. * @throws StorageException * */
Sets the ACL for the table. Sign with length of aclBytes
setAcl
{ "repo_name": "esummers-msft/azure-storage-java", "path": "microsoft-azure-storage/src/com/microsoft/azure/storage/table/TableRequest.java", "license": "apache-2.0", "size": 23675 }
[ "com.microsoft.azure.storage.Constants", "com.microsoft.azure.storage.OperationContext", "com.microsoft.azure.storage.StorageException", "com.microsoft.azure.storage.core.BaseRequest", "com.microsoft.azure.storage.core.UriQueryBuilder", "java.io.IOException", "java.net.HttpURLConnection", "java.net.URISyntaxException" ]
import com.microsoft.azure.storage.Constants; import com.microsoft.azure.storage.OperationContext; import com.microsoft.azure.storage.StorageException; import com.microsoft.azure.storage.core.BaseRequest; import com.microsoft.azure.storage.core.UriQueryBuilder; import java.io.IOException; import java.net.HttpURLConnection; import java.net.URISyntaxException;
import com.microsoft.azure.storage.*; import com.microsoft.azure.storage.core.*; import java.io.*; import java.net.*;
[ "com.microsoft.azure", "java.io", "java.net" ]
com.microsoft.azure; java.io; java.net;
2,804,852
public static Endpoint resolveMandatoryEndpoint(CamelContext context, String uri) { Endpoint endpoint = context.getEndpoint(uri); assertNotNull("No endpoint found for URI: " + uri, endpoint); return endpoint; }
static Endpoint function(CamelContext context, String uri) { Endpoint endpoint = context.getEndpoint(uri); assertNotNull(STR + uri, endpoint); return endpoint; }
/** * Resolves an endpoint and asserts that it is found */
Resolves an endpoint and asserts that it is found
resolveMandatoryEndpoint
{ "repo_name": "mgyongyosi/camel", "path": "components/camel-test/src/main/java/org/apache/camel/test/junit4/TestSupport.java", "license": "apache-2.0", "size": 20660 }
[ "org.apache.camel.CamelContext", "org.apache.camel.Endpoint" ]
import org.apache.camel.CamelContext; import org.apache.camel.Endpoint;
import org.apache.camel.*;
[ "org.apache.camel" ]
org.apache.camel;
2,522,627
//region > Name, Description, Help (convenience for facets) @Override public String getName() { final NamedFacet facet = getFacet(NamedFacet.class); final String name = facet.value(); if (name != null) { return name; } else { // this should now be redundant, see NamedFacetDefault return StringExtensions.asNaturalName2(getId()); } }
String function() { final NamedFacet facet = getFacet(NamedFacet.class); final String name = facet.value(); if (name != null) { return name; } else { return StringExtensions.asNaturalName2(getId()); } }
/** * Return the default label for this member. This is based on the name of * this member. * * @see #getId() */
Return the default label for this member. This is based on the name of this member
getName
{ "repo_name": "niv0/isis", "path": "core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectMemberAbstract.java", "license": "apache-2.0", "size": 17427 }
[ "org.apache.isis.core.commons.lang.StringExtensions", "org.apache.isis.core.metamodel.facets.all.named.NamedFacet" ]
import org.apache.isis.core.commons.lang.StringExtensions; import org.apache.isis.core.metamodel.facets.all.named.NamedFacet;
import org.apache.isis.core.commons.lang.*; import org.apache.isis.core.metamodel.facets.all.named.*;
[ "org.apache.isis" ]
org.apache.isis;
2,899,154
protected void onBeforeCommitReplaceFragment(FragmentManager fm, FragmentTransaction ft, Fragment fragment) { //ft.setCustomAnimations(R.anim.fragment_fade_in, R.anim.fragment_fade_out, R.anim.fragment_fade_in, R.anim.fragment_fade_out); ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE); }
void function(FragmentManager fm, FragmentTransaction ft, Fragment fragment) { ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE); }
/** * Called just before a fragment replacement transaction is committed in response to an intent * being fired and substituted for a fragment. * <p/> * Here you can put custom animation or any other customization for fragment replacement. */
Called just before a fragment replacement transaction is committed in response to an intent being fired and substituted for a fragment. Here you can put custom animation or any other customization for fragment replacement
onBeforeCommitReplaceFragment
{ "repo_name": "juanpabloprado/sms-ticket", "path": "mobile/src/main/java/eu/inmite/apps/smsjizdenka/framework/activity/BaseSinglePaneActivity.java", "license": "apache-2.0", "size": 3987 }
[ "android.support.v4.app.Fragment", "android.support.v4.app.FragmentManager", "android.support.v4.app.FragmentTransaction" ]
import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction;
import android.support.v4.app.*;
[ "android.support" ]
android.support;
1,784,342
public void testUnwrapDataHelper() { assertTrue(SDOHelper.unwrap(dataHelper, SDODataHelper.class) instanceof SDODataHelper); }
void function() { assertTrue(SDOHelper.unwrap(dataHelper, SDODataHelper.class) instanceof SDODataHelper); }
/** * Also tests getDataHelper method. */
Also tests getDataHelper method
testUnwrapDataHelper
{ "repo_name": "RallySoftware/eclipselink.runtime", "path": "sdo/eclipselink.sdo.test/src/org/eclipse/persistence/testing/sdo/helper/sdohelper/SDOHelperTestCases.java", "license": "epl-1.0", "size": 9476 }
[ "org.eclipse.persistence.sdo.SDOHelper", "org.eclipse.persistence.sdo.helper.SDODataHelper" ]
import org.eclipse.persistence.sdo.SDOHelper; import org.eclipse.persistence.sdo.helper.SDODataHelper;
import org.eclipse.persistence.sdo.*; import org.eclipse.persistence.sdo.helper.*;
[ "org.eclipse.persistence" ]
org.eclipse.persistence;
2,638
EClass getFeature();
EClass getFeature();
/** * Returns the meta object for class '{@link com.mguidi.soa.soa.Feature <em>Feature</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Feature</em>'. * @see com.mguidi.soa.soa.Feature * @generated */
Returns the meta object for class '<code>com.mguidi.soa.soa.Feature Feature</code>'.
getFeature
{ "repo_name": "mguidi/SOA-Code-Factory", "path": "com.mguidi.soa/src-gen/com/mguidi/soa/soa/SoaPackage.java", "license": "apache-2.0", "size": 49882 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
398,835
public long sendRpc(ByteBuffer message, RpcResponseCallback callback) { long startTime = System.currentTimeMillis(); if (logger.isTraceEnabled()) { logger.trace("Sending RPC to {}", getRemoteAddress(channel)); } long requestId = Math.abs(UUID.randomUUID().getLeastSignificantBits()); handler.addRpcRequest(requestId, callback); channel.writeAndFlush(new RpcRequest(requestId, new NioManagedBuffer(message))) .addListener(future -> { if (future.isSuccess()) { long timeTaken = System.currentTimeMillis() - startTime; if (logger.isTraceEnabled()) { logger.trace("Sending request {} to {} took {} ms", requestId, getRemoteAddress(channel), timeTaken); } } else { String errorMsg = String.format("Failed to send RPC %s to %s: %s", requestId, getRemoteAddress(channel), future.cause()); logger.error(errorMsg, future.cause()); handler.removeRpcRequest(requestId); channel.close(); try { callback.onFailure(new IOException(errorMsg, future.cause())); } catch (Exception e) { logger.error("Uncaught exception in RPC response callback handler!", e); } } }); return requestId; }
long function(ByteBuffer message, RpcResponseCallback callback) { long startTime = System.currentTimeMillis(); if (logger.isTraceEnabled()) { logger.trace(STR, getRemoteAddress(channel)); } long requestId = Math.abs(UUID.randomUUID().getLeastSignificantBits()); handler.addRpcRequest(requestId, callback); channel.writeAndFlush(new RpcRequest(requestId, new NioManagedBuffer(message))) .addListener(future -> { if (future.isSuccess()) { long timeTaken = System.currentTimeMillis() - startTime; if (logger.isTraceEnabled()) { logger.trace(STR, requestId, getRemoteAddress(channel), timeTaken); } } else { String errorMsg = String.format(STR, requestId, getRemoteAddress(channel), future.cause()); logger.error(errorMsg, future.cause()); handler.removeRpcRequest(requestId); channel.close(); try { callback.onFailure(new IOException(errorMsg, future.cause())); } catch (Exception e) { logger.error(STR, e); } } }); return requestId; }
/** * Sends an opaque message to the RpcHandler on the server-side. The callback will be invoked * with the server's response or upon any failure. * * @param message The message to send. * @param callback Callback to handle the RPC's reply. * @return The RPC's id. */
Sends an opaque message to the RpcHandler on the server-side. The callback will be invoked with the server's response or upon any failure
sendRpc
{ "repo_name": "aokolnychyi/spark", "path": "common/network-common/src/main/java/org/apache/spark/network/client/TransportClient.java", "license": "apache-2.0", "size": 12066 }
[ "java.io.IOException", "java.nio.ByteBuffer", "java.util.UUID", "org.apache.spark.network.buffer.NioManagedBuffer", "org.apache.spark.network.protocol.RpcRequest", "org.apache.spark.network.util.NettyUtils" ]
import java.io.IOException; import java.nio.ByteBuffer; import java.util.UUID; import org.apache.spark.network.buffer.NioManagedBuffer; import org.apache.spark.network.protocol.RpcRequest; import org.apache.spark.network.util.NettyUtils;
import java.io.*; import java.nio.*; import java.util.*; import org.apache.spark.network.buffer.*; import org.apache.spark.network.protocol.*; import org.apache.spark.network.util.*;
[ "java.io", "java.nio", "java.util", "org.apache.spark" ]
java.io; java.nio; java.util; org.apache.spark;
561,091
public final TriadOwner getOwner() { return _owner; }
final TriadOwner function() { return _owner; }
/** * Returns the owner */
Returns the owner
getOwner
{ "repo_name": "WelcomeHUME/svn-caucho-com-resin", "path": "modules/resin/src/com/caucho/server/distcache/DistCacheEntry.java", "license": "gpl-2.0", "size": 44515 }
[ "com.caucho.cloud.topology.TriadOwner" ]
import com.caucho.cloud.topology.TriadOwner;
import com.caucho.cloud.topology.*;
[ "com.caucho.cloud" ]
com.caucho.cloud;
325,434
private void startForeground(User user) { currentNotification = new Notification.Builder(this); currentNotification .setContentTitle(getString(R.string.upload_to_openstreetmap)) .setContentText( getString(R.string.upload_to_openstreetmap_progress, user.getUsername())) .setSmallIcon(android.R.drawable.ic_menu_upload); currentNotification.setProgress(0, 0, true); this.startForeground(NOTIFICATION_ID, currentNotification.build()); }
void function(User user) { currentNotification = new Notification.Builder(this); currentNotification .setContentTitle(getString(R.string.upload_to_openstreetmap)) .setContentText( getString(R.string.upload_to_openstreetmap_progress, user.getUsername())) .setSmallIcon(android.R.drawable.ic_menu_upload); currentNotification.setProgress(0, 0, true); this.startForeground(NOTIFICATION_ID, currentNotification.build()); }
/** * Moves the service to foreground and posts a notification for the user. * * @param user * The user to upload for */
Moves the service to foreground and posts a notification for the user
startForeground
{ "repo_name": "Data4All/Data4All", "path": "src/main/java/io/github/data4all/service/UploadElementsService.java", "license": "apache-2.0", "size": 13187 }
[ "android.app.Notification", "io.github.data4all.model.data.User" ]
import android.app.Notification; import io.github.data4all.model.data.User;
import android.app.*; import io.github.data4all.model.data.*;
[ "android.app", "io.github.data4all" ]
android.app; io.github.data4all;
1,562,154
public boolean matches(QName name) { if (_except == null) return true; else return ! _except.matches(name); }
boolean function(QName name) { if (_except == null) return true; else return ! _except.matches(name); }
/** * Returns true if the name matches. */
Returns true if the name matches
matches
{ "repo_name": "christianchristensen/resin", "path": "modules/kernel/src/com/caucho/relaxng/program/AnyNameItem.java", "license": "gpl-2.0", "size": 2315 }
[ "com.caucho.xml.QName" ]
import com.caucho.xml.QName;
import com.caucho.xml.*;
[ "com.caucho.xml" ]
com.caucho.xml;
223,006
HP3ParAccountDBStore acc = HP3ParCredentials.getInternalCredential(accountName); PhysicalInfraAccount infraAccount = AccountUtil.getAccountByName(accountName); PhysicalConnectivityStatus status = new PhysicalConnectivityStatus(infraAccount); StorageAccountStatus accStatus = new StorageAccountStatus(); accStatus.setAccountName(infraAccount.getAccountName()); accStatus.setDcName(acc.getPod()); try { HP3ParToken t = new HP3ParToken(new HP3ParCredentials(accountName)); String token = t.getToken(); if (token != null) { accStatus.setReachable(true); t.release(); accStatus.setLastMessage("Connection OK"); status.setConnectionOK(true); } else { accStatus.setReachable(false); status.setConnectionOK(false); accStatus.setLastMessage("Could not connect (check username/password)"); } } catch (@SuppressWarnings("unused") InvalidHP3ParTokenException e) { logger.warn("Connection failed: " + accountName); accStatus.setLastMessage("Could not connect (check username/password)"); accStatus.setReachable(false); status.setConnectionOK(false); } catch (@SuppressWarnings("unused") Exception e) { logger.warn("Connection failed: " + accountName); accStatus.setLastMessage("Could not connect (is the array down?)"); accStatus.setReachable(false); status.setConnectionOK(false); } accStatus.setLicense(""); accStatus.setLastUpdated(System.currentTimeMillis()); accStatus.setModel("3PAR"); accStatus.setServerAddress(acc.getServerAddress()); accStatus.setVersion("1"); persistStorageAccountStatus(accStatus); }
HP3ParAccountDBStore acc = HP3ParCredentials.getInternalCredential(accountName); PhysicalInfraAccount infraAccount = AccountUtil.getAccountByName(accountName); PhysicalConnectivityStatus status = new PhysicalConnectivityStatus(infraAccount); StorageAccountStatus accStatus = new StorageAccountStatus(); accStatus.setAccountName(infraAccount.getAccountName()); accStatus.setDcName(acc.getPod()); try { HP3ParToken t = new HP3ParToken(new HP3ParCredentials(accountName)); String token = t.getToken(); if (token != null) { accStatus.setReachable(true); t.release(); accStatus.setLastMessage(STR); status.setConnectionOK(true); } else { accStatus.setReachable(false); status.setConnectionOK(false); accStatus.setLastMessage(STR); } } catch (@SuppressWarnings(STR) InvalidHP3ParTokenException e) { logger.warn(STR + accountName); accStatus.setLastMessage(STR); accStatus.setReachable(false); status.setConnectionOK(false); } catch (@SuppressWarnings(STR) Exception e) { logger.warn(STR + accountName); accStatus.setLastMessage(STR); accStatus.setReachable(false); status.setConnectionOK(false); } accStatus.setLicense(STR3PARSTR1"); persistStorageAccountStatus(accStatus); }
/** * Obtain account summary information * * @param accountName * @throws Exception */
Obtain account summary information
accountSummary
{ "repo_name": "CiscoUKIDCDev/HP3ParPlugin", "path": "3PAR_Plugin/src/com/cisco/matday/ucsd/hp3par/account/status/StorageAccountStatusSummary.java", "license": "mit", "size": 4699 }
[ "com.cisco.matday.ucsd.hp3par.account.HP3ParAccountDBStore", "com.cisco.matday.ucsd.hp3par.account.HP3ParCredentials", "com.cisco.matday.ucsd.hp3par.exceptions.InvalidHP3ParTokenException", "com.cisco.matday.ucsd.hp3par.rest.HP3ParToken", "com.cloupia.lib.cIaaS.netapp.model.StorageAccountStatus", "com.cloupia.lib.connector.account.AccountUtil", "com.cloupia.lib.connector.account.PhysicalConnectivityStatus", "com.cloupia.lib.connector.account.PhysicalInfraAccount" ]
import com.cisco.matday.ucsd.hp3par.account.HP3ParAccountDBStore; import com.cisco.matday.ucsd.hp3par.account.HP3ParCredentials; import com.cisco.matday.ucsd.hp3par.exceptions.InvalidHP3ParTokenException; import com.cisco.matday.ucsd.hp3par.rest.HP3ParToken; import com.cloupia.lib.cIaaS.netapp.model.StorageAccountStatus; import com.cloupia.lib.connector.account.AccountUtil; import com.cloupia.lib.connector.account.PhysicalConnectivityStatus; import com.cloupia.lib.connector.account.PhysicalInfraAccount;
import com.cisco.matday.ucsd.hp3par.account.*; import com.cisco.matday.ucsd.hp3par.exceptions.*; import com.cisco.matday.ucsd.hp3par.rest.*; import com.cloupia.lib.*; import com.cloupia.lib.connector.account.*;
[ "com.cisco.matday", "com.cloupia.lib" ]
com.cisco.matday; com.cloupia.lib;
2,531,310
public void notifyChanged(Notification notification) { updateChildren(notification); super.notifyChanged(notification); }
void function(Notification notification) { updateChildren(notification); super.notifyChanged(notification); }
/** * This handles model notifications by calling {@link #updateChildren} to update any cached * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This handles model notifications by calling <code>#updateChildren</code> to update any cached children and by creating a viewer notification, which it passes to <code>#fireNotifyChanged</code>.
notifyChanged
{ "repo_name": "tht-krisztian/EMF-IncQuery-Examples", "path": "query-driven-soft-interconnections/derivedModels.edit/src/process/provider/GatewayItemProvider.java", "license": "epl-1.0", "size": 2969 }
[ "org.eclipse.emf.common.notify.Notification" ]
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,761,349
int updateByPrimaryKeySelective(QuestCoModel record);
int updateByPrimaryKeySelective(QuestCoModel record);
/** * This method was generated by MyBatis Generator. * This method corresponds to the database table collection_quest * * @mbggenerated */
This method was generated by MyBatis Generator. This method corresponds to the database table collection_quest
updateByPrimaryKeySelective
{ "repo_name": "wanghongfei/taolijie", "path": "src/main/java/com/fh/taolijie/dao/mapper/QuestCoModelMapper.java", "license": "gpl-3.0", "size": 1858 }
[ "com.fh.taolijie.domain.quest.QuestCoModel" ]
import com.fh.taolijie.domain.quest.QuestCoModel;
import com.fh.taolijie.domain.quest.*;
[ "com.fh.taolijie" ]
com.fh.taolijie;
2,683,951
@Nullable @CalledByNative("VideoEncoderSelector") VideoCodecInfo onAvailableBitrate(int kbps);
@Nullable @CalledByNative(STR) VideoCodecInfo onAvailableBitrate(int kbps);
/** * Called with the current available bitrate. Returns null if the encoder selector prefers to * keep the current encoder or a VideoCodecInfo if a new encoder is preferred. */
Called with the current available bitrate. Returns null if the encoder selector prefers to keep the current encoder or a VideoCodecInfo if a new encoder is preferred
onAvailableBitrate
{ "repo_name": "endlessm/chromium-browser", "path": "third_party/webrtc/sdk/android/api/org/webrtc/VideoEncoderFactory.java", "license": "bsd-3-clause", "size": 2216 }
[ "android.support.annotation.Nullable" ]
import android.support.annotation.Nullable;
import android.support.annotation.*;
[ "android.support" ]
android.support;
614,575
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { javax.swing.JPanel jPanel1 = new javax.swing.JPanel(); jButtonZiel = new javax.swing.JButton(); jTextFieldPfad = new javax.swing.JTextField(); javax.swing.JLabel jLabel1 = new javax.swing.JLabel(); jButtonOk = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jButtonZiel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mediathek/res/muster/button-file-open.png"))); // NOI18N jButtonZiel.setToolTipText("Datei auswählen"); jLabel1.setText("Ziel:"); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTextFieldPfad, javax.swing.GroupLayout.DEFAULT_SIZE, 334, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButtonZiel) .addContainerGap()) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabel1) .addComponent(jTextFieldPfad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButtonZiel)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jButtonZiel, jTextFieldPfad}); jButtonOk.setText("Ok"); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(jButtonOk, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jButtonOk) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButtonOk; private javax.swing.JButton jButtonZiel; private javax.swing.JTextField jTextFieldPfad; // End of variables declaration//GEN-END:variables private class OkBeobachter implements ActionListener {
void function() { javax.swing.JPanel jPanel1 = new javax.swing.JPanel(); jButtonZiel = new javax.swing.JButton(); jTextFieldPfad = new javax.swing.JTextField(); javax.swing.JLabel jLabel1 = new javax.swing.JLabel(); jButtonOk = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jButtonZiel.setIcon(new javax.swing.ImageIcon(getClass().getResource(STR))); jButtonZiel.setToolTipText(STR); jLabel1.setText("Ziel:"); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTextFieldPfad, javax.swing.GroupLayout.DEFAULT_SIZE, 334, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButtonZiel) .addContainerGap()) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabel1) .addComponent(jTextFieldPfad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButtonZiel)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jButtonZiel, jTextFieldPfad}); jButtonOk.setText("Ok"); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(jButtonOk, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jButtonOk) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); } private javax.swing.JButton jButtonOk; private javax.swing.JButton jButtonZiel; private javax.swing.JTextField jTextFieldPfad; private class OkBeobachter implements ActionListener {
/** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */
This method is called from within the constructor to initialize the form. always regenerated by the Form Editor
initComponents
{ "repo_name": "derreisende77/MediathekView", "path": "src/main/java/mediathek/gui/dialogEinstellungen/DialogZielExportPset.java", "license": "gpl-3.0", "size": 9555 }
[ "java.awt.Component", "java.awt.event.ActionListener" ]
import java.awt.Component; import java.awt.event.ActionListener;
import java.awt.*; import java.awt.event.*;
[ "java.awt" ]
java.awt;
530,247
Callable<Object> callable(JexlContext context);
Callable<Object> callable(JexlContext context);
/** * Creates a Callable from this script. * <p>This allows to submit it to an executor pool and provides support for asynchronous calls.</p> * <p>The interpreter will handle interruption/cancellation gracefully if needed.</p> * @param context the context * @return the callable * @since 2.1 */
Creates a Callable from this script. This allows to submit it to an executor pool and provides support for asynchronous calls. The interpreter will handle interruption/cancellation gracefully if needed
callable
{ "repo_name": "genome-vendor/libcommons-jexl2-java", "path": "src/main/java/org/apache/commons/jexl2/Script.java", "license": "apache-2.0", "size": 3905 }
[ "java.util.concurrent.Callable" ]
import java.util.concurrent.Callable;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
2,892,110
public static LinkedList getTile(int position) { if (board == null) { return null; } return board.getTileNotesOrValue(position); }
static LinkedList function(int position) { if (board == null) { return null; } return board.getTileNotesOrValue(position); }
/** * Retrieve a LinkedList of Integers representing the current Value/Notes associated with the selected Tile. * * @param position The 0 - 80 index of the Tile you want. * @return A LinkedList of Integers representing the current Value/Notes associated with the selected Tile. Null * if the provided index is out of bounds or there is no current game. */
Retrieve a LinkedList of Integers representing the current Value/Notes associated with the selected Tile
getTile
{ "repo_name": "valesken/ClassicSudoku", "path": "ClassicSudoku/app/src/main/java/me/valesken/jeff/sudoku_model/ModelProxy.java", "license": "mit", "size": 6696 }
[ "java.util.LinkedList" ]
import java.util.LinkedList;
import java.util.*;
[ "java.util" ]
java.util;
2,054,304
public void setPrintClip( BOUNDARY value ) { prefs.setName( COSName.PRINT_CLIP, value.toString() ); }
void function( BOUNDARY value ) { prefs.setName( COSName.PRINT_CLIP, value.toString() ); }
/** * Set the PrintClip preference. See BOUNDARY enumeration. * * @param value Set the PrintClip preference. */
Set the PrintClip preference. See BOUNDARY enumeration
setPrintClip
{ "repo_name": "torakiki/sambox", "path": "src/main/java/org/sejda/sambox/pdmodel/interactive/viewerpreferences/PDViewerPreferences.java", "license": "apache-2.0", "size": 14358 }
[ "org.sejda.sambox.cos.COSName" ]
import org.sejda.sambox.cos.COSName;
import org.sejda.sambox.cos.*;
[ "org.sejda.sambox" ]
org.sejda.sambox;
1,063,832
public void close(final NotificationType close, final MAP map, final ArjunaContext arjunaContext) { if (WSTLogger.logger.isTraceEnabled()) { WSTLogger.logger.trace(getClass().getSimpleName() + ".close"); } final State current ; synchronized(this) { current = state ; if (current == State.STATE_COMPLETED) { changeState(State.STATE_CLOSING) ; } } if (WSTLogger.logger.isTraceEnabled()) { WSTLogger.logger.trace(getClass().getSimpleName() + ".close. State: " + current); } if (current == State.STATE_COMPLETED) { if (timerTask != null) { timerTask.cancel() ; } executeClose() ; } else if (current == State.STATE_ENDED) { sendClosed() ; } }
void function(final NotificationType close, final MAP map, final ArjunaContext arjunaContext) { if (WSTLogger.logger.isTraceEnabled()) { WSTLogger.logger.trace(getClass().getSimpleName() + STR); } final State current ; synchronized(this) { current = state ; if (current == State.STATE_COMPLETED) { changeState(State.STATE_CLOSING) ; } } if (WSTLogger.logger.isTraceEnabled()) { WSTLogger.logger.trace(getClass().getSimpleName() + STR + current); } if (current == State.STATE_COMPLETED) { if (timerTask != null) { timerTask.cancel() ; } executeClose() ; } else if (current == State.STATE_ENDED) { sendClosed() ; } }
/** * Handle the close event. * @param close The close notification. * @param map The addressing context. * @param arjunaContext The arjuna context. * * Active -&gt; Active (invalid state) * Canceling -&gt; Canceling (invalid state) * Completed -&gt; Closing * Closing -&gt; Closing * Compensating -&gt; Compensating (invalid state) * Failing-Active -&gt; Failing-Active (invalid state) * Failing-Canceling -&gt; Failing-Canceling (invalid state) * Failing-Compensating -&gt; Failing-Compensating (invalid state) * NotCompleting -&gt; NotCompleting (invalid state) * Exiting -&gt; Exiting (invalid state) * Ended -&gt; Ended (send Closed) */
Handle the close event
close
{ "repo_name": "nmcl/scratch", "path": "graalvm/transactions/fork/narayana/XTS/WS-T/dev/src/com/arjuna/wst11/messaging/engines/ParticipantCompletionParticipantEngine.java", "license": "apache-2.0", "size": 48706 }
[ "com.arjuna.webservices.logging.WSTLogger", "com.arjuna.webservices11.wsarj.ArjunaContext", "com.arjuna.webservices11.wsba.State", "org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType" ]
import com.arjuna.webservices.logging.WSTLogger; import com.arjuna.webservices11.wsarj.ArjunaContext; import com.arjuna.webservices11.wsba.State; import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
import com.arjuna.webservices.logging.*; import com.arjuna.webservices11.wsarj.*; import com.arjuna.webservices11.wsba.*; import org.oasis_open.docs.ws_tx.wsba.*;
[ "com.arjuna.webservices", "com.arjuna.webservices11", "org.oasis_open.docs" ]
com.arjuna.webservices; com.arjuna.webservices11; org.oasis_open.docs;
1,867,877
protected void init(ArtifactProvider artifactProvider) { this.artifactProvider = artifactProvider; } /** * Creates a {@link Map} with pairs of keys and {@link ArtifactSerializer}. * The models implementation should call this method from * {@code BaseModel#createArtifactSerializersMap}
void function(ArtifactProvider artifactProvider) { this.artifactProvider = artifactProvider; } /** * Creates a {@link Map} with pairs of keys and {@link ArtifactSerializer}. * The models implementation should call this method from * {@code BaseModel#createArtifactSerializersMap}
/** * Initializes the ToolFactory with an artifact provider. */
Initializes the ToolFactory with an artifact provider
init
{ "repo_name": "jzonthemtn/opennlp", "path": "opennlp-tools/src/main/java/opennlp/tools/util/BaseToolFactory.java", "license": "apache-2.0", "size": 4509 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,052,856
public Event newEvent(String event, String resource, boolean modify, int priority) { return new BaseEvent(event, resource, modify, priority, null); }
Event function(String event, String resource, boolean modify, int priority) { return new BaseEvent(event, resource, modify, priority, null); }
/** * Construct a Event object. * * @param event * The Event id. * @param resource * The resource reference. * @param modify * Set to true if this event caused a resource modification, false if it was just an access. * @param priority * The Event's notification priority. * @return A new Event object that can be used with this service. */
Construct a Event object
newEvent
{ "repo_name": "ouit0408/sakai", "path": "kernel/kernel-impl/src/main/java/org/sakaiproject/event/impl/BaseEventTrackingService.java", "license": "apache-2.0", "size": 23874 }
[ "org.sakaiproject.event.api.Event" ]
import org.sakaiproject.event.api.Event;
import org.sakaiproject.event.api.*;
[ "org.sakaiproject.event" ]
org.sakaiproject.event;
1,865,891
public List getOredCriteria() { return oredCriteria; }
List function() { return oredCriteria; }
/** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table t_family_water_details * * @ibatorgenerated Tue Aug 30 15:25:34 GMT+08:00 2016 */
This method was generated by Apache iBATIS ibator. This method corresponds to the database table t_family_water_details
getOredCriteria
{ "repo_name": "tkdiooo/framework", "path": "QI-Family/QI-Family-Assistant/src/main/java/com/qi/assistant/web/model/example/WaterDetailsExample.java", "license": "gpl-2.0", "size": 25070 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,151,735
public boolean connect() throws KuraException;
boolean function() throws KuraException;
/** * Connect to devices GATT server. * * @return If connection was successful */
Connect to devices GATT server
connect
{ "repo_name": "markoer/kura", "path": "kura/org.eclipse.kura.api/src/main/java/org/eclipse/kura/bluetooth/BluetoothGatt.java", "license": "epl-1.0", "size": 4039 }
[ "org.eclipse.kura.KuraException" ]
import org.eclipse.kura.KuraException;
import org.eclipse.kura.*;
[ "org.eclipse.kura" ]
org.eclipse.kura;
1,409,125
Provider<? extends Task> getRunTask();
Provider<? extends Task> getRunTask();
/** * Returns the task that runs the tests for this component. */
Returns the task that runs the tests for this component
getRunTask
{ "repo_name": "gradle/gradle", "path": "subprojects/testing-native/src/main/java/org/gradle/nativeplatform/test/TestComponent.java", "license": "apache-2.0", "size": 1034 }
[ "org.gradle.api.Task", "org.gradle.api.provider.Provider" ]
import org.gradle.api.Task; import org.gradle.api.provider.Provider;
import org.gradle.api.*; import org.gradle.api.provider.*;
[ "org.gradle.api" ]
org.gradle.api;
2,346,589
protected static void assertImageDescriptors(ImageDescriptor expected, ImageDescriptor actual) throws Exception { String expectedImage = getImage(expected); String actualImage = getImage(actual); if (!Strings.equal(expectedImage, actualImage)) { throw new ComparisonFailure("Not same image descriptors", expectedImage, actualImage); } }
static void function(ImageDescriptor expected, ImageDescriptor actual) throws Exception { String expectedImage = getImage(expected); String actualImage = getImage(actual); if (!Strings.equal(expectedImage, actualImage)) { throw new ComparisonFailure(STR, expectedImage, actualImage); } }
/** Assert the given image descriptors are the equal. * * @param expected - the expected image descriptor. * @param actual - the current image descriptor. * @throws Exception if the test cannot be done. */
Assert the given image descriptors are the equal
assertImageDescriptors
{ "repo_name": "jgfoster/sarl", "path": "tests/io.sarl.tests.api.ui/src/io/sarl/tests/api/AbstractSarlUiTest.java", "license": "apache-2.0", "size": 15188 }
[ "org.eclipse.jface.resource.ImageDescriptor", "org.eclipse.xtext.util.Strings", "org.junit.ComparisonFailure" ]
import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.xtext.util.Strings; import org.junit.ComparisonFailure;
import org.eclipse.jface.resource.*; import org.eclipse.xtext.util.*; import org.junit.*;
[ "org.eclipse.jface", "org.eclipse.xtext", "org.junit" ]
org.eclipse.jface; org.eclipse.xtext; org.junit;
483,200
public void setZoomInterpolator(Interpolator interpolator) { mInterpolator = interpolator; }
void function(Interpolator interpolator) { mInterpolator = interpolator; }
/** * Set the zoom interpolator * @param interpolator the zoom interpolator */
Set the zoom interpolator
setZoomInterpolator
{ "repo_name": "DNLDsht/LeafPic", "path": "photoview/src/main/java/uk/co/senab/photoview/PhotoViewAttacher.java", "license": "gpl-3.0", "size": 39745 }
[ "android.view.animation.Interpolator" ]
import android.view.animation.Interpolator;
import android.view.animation.*;
[ "android.view" ]
android.view;
68,015
//----------------------------// // getFirstDisplayedStubIndex // //----------------------------// private int getFirstDisplayedStubIndex (Book book) { for (SheetStub stub : book.getStubs()) { final JComponent component = stub.getAssembly().getComponent(); final int tabIndex = stubsPane.indexOfComponent(component); if (tabIndex != -1) { return tabIndex; } } return -1; }
int function (Book book) { for (SheetStub stub : book.getStubs()) { final JComponent component = stub.getAssembly().getComponent(); final int tabIndex = stubsPane.indexOfComponent(component); if (tabIndex != -1) { return tabIndex; } } return -1; }
/** * Report the index of the first displayed stub (valid or not) from the given book. * * @param book the provided book * @return the index in stubsPane of first displayed stub or -1 if none */
Report the index of the first displayed stub (valid or not) from the given book
getFirstDisplayedStubIndex
{ "repo_name": "Audiveris/audiveris", "path": "src/main/org/audiveris/omr/sheet/ui/StubsController.java", "license": "agpl-3.0", "size": 39483 }
[ "javax.swing.JComponent", "org.audiveris.omr.sheet.Book", "org.audiveris.omr.sheet.SheetStub" ]
import javax.swing.JComponent; import org.audiveris.omr.sheet.Book; import org.audiveris.omr.sheet.SheetStub;
import javax.swing.*; import org.audiveris.omr.sheet.*;
[ "javax.swing", "org.audiveris.omr" ]
javax.swing; org.audiveris.omr;
2,729,350
@Override public List<CtMethod<?>> inputAmplify(List<CtMethod<?>> testMethods, int i) { LOGGER.info("Amplification of inputs..."); List<CtMethod<?>> inputAmplifiedTests = testMethods.parallelStream() .flatMap(test -> { DSpotUtils.printProgress(testMethods.indexOf(test), testMethods.size()); return inputAmplifyTest(test, i); }).collect(Collectors.toList()); LOGGER.info("{} new tests generated", inputAmplifiedTests.size()); return reduce(inputAmplifiedTests); }
List<CtMethod<?>> function(List<CtMethod<?>> testMethods, int i) { LOGGER.info(STR); List<CtMethod<?>> inputAmplifiedTests = testMethods.parallelStream() .flatMap(test -> { DSpotUtils.printProgress(testMethods.indexOf(test), testMethods.size()); return inputAmplifyTest(test, i); }).collect(Collectors.toList()); LOGGER.info(STR, inputAmplifiedTests.size()); return reduce(inputAmplifiedTests); }
/** * Input amplification of multiple tests. * * @param testMethods Test methods * @return New generated tests */
Input amplification of multiple tests
inputAmplify
{ "repo_name": "danzone/dspot", "path": "dspot/src/main/java/eu/stamp_project/dspot/budget/NoBudgetizer.java", "license": "lgpl-3.0", "size": 5077 }
[ "eu.stamp_project.utils.DSpotUtils", "java.util.List", "java.util.stream.Collectors" ]
import eu.stamp_project.utils.DSpotUtils; import java.util.List; import java.util.stream.Collectors;
import eu.stamp_project.utils.*; import java.util.*; import java.util.stream.*;
[ "eu.stamp_project.utils", "java.util" ]
eu.stamp_project.utils; java.util;
2,677,658
public void setPotentialLifeTimeValue (BigDecimal PotentialLifeTimeValue);
void function (BigDecimal PotentialLifeTimeValue);
/** Set Potential Life Time Value. * Total Revenue expected */
Set Potential Life Time Value. Total Revenue expected
setPotentialLifeTimeValue
{ "repo_name": "geneos/adempiere", "path": "base/src/org/compiere/model/I_C_BPartner.java", "license": "gpl-2.0", "size": 26142 }
[ "java.math.BigDecimal" ]
import java.math.BigDecimal;
import java.math.*;
[ "java.math" ]
java.math;
1,786,657
public Map<String, String> getRequestHeaders() { return requestHeaders; }
Map<String, String> function() { return requestHeaders; }
/** * Gets the headers associated with the request. */
Gets the headers associated with the request
getRequestHeaders
{ "repo_name": "vic797/prowebview", "path": "library/src/main/java/vcm/github/webkit/proview/ProWebResourceRequest.java", "license": "apache-2.0", "size": 3213 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,005,046
public void write(byte[] payload, boolean flush) throws IOException, InterruptedException { synchronized (this) { while (!isClosed && !writeReady.compareAndSet(true, false)) wait(); if (isClosed) { throw new IOException("Stream closed"); } } byte[] packet = AdbProtocol.generateWrite(localId, remoteId, payload); adbConn.outputStream.write(packet); if (flush) adbConn.outputStream.flush(); }
void function(byte[] payload, boolean flush) throws IOException, InterruptedException { synchronized (this) { while (!isClosed && !writeReady.compareAndSet(true, false)) wait(); if (isClosed) { throw new IOException(STR); } } byte[] packet = AdbProtocol.generateWrite(localId, remoteId, payload); adbConn.outputStream.write(packet); if (flush) adbConn.outputStream.flush(); }
/** * Queues a write packet and optionally sends it immediately. * @param payload Payload in the form of a byte array * @param flush Specifies whether to send the packet immediately * @throws IOException If the stream fails while sending data * @throws InterruptedException If we are unable to wait to send data */
Queues a write packet and optionally sends it immediately
write
{ "repo_name": "8enet/AppOpsX", "path": "AdbLib/src/main/java/com/cgutman/adblib/AdbStream.java", "license": "mit", "size": 5618 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
78,589
public static int write(Sequence in, int type, File out) throws IOException { List providers = getMidiFileWriters(); //$$fb 2002-04-17: Fix for 4635287: Standard MidiFileWriter cannot write empty Sequences int bytesWritten = -2; for (int i = 0; i < providers.size(); i++ ) { MidiFileWriter writer = (MidiFileWriter) providers.get(i); if( writer.isFileTypeSupported( type, in ) ) { bytesWritten = writer.write(in, type, out); break; } } if (bytesWritten == -2) { throw new IllegalArgumentException("MIDI file type is not supported"); } return bytesWritten; } // HELPER METHODS
static int function(Sequence in, int type, File out) throws IOException { List providers = getMidiFileWriters(); int bytesWritten = -2; for (int i = 0; i < providers.size(); i++ ) { MidiFileWriter writer = (MidiFileWriter) providers.get(i); if( writer.isFileTypeSupported( type, in ) ) { bytesWritten = writer.write(in, type, out); break; } } if (bytesWritten == -2) { throw new IllegalArgumentException(STR); } return bytesWritten; }
/** * Writes a stream of bytes representing a file of the MIDI file type * indicated to the external file provided. * @param in sequence containing MIDI data to be written to the file * @param type the file type of the file to be written to the output stream * @param out external file to which the file data should be written * @return the number of bytes written to the file * @throws IOException if an I/O exception occurs * @throws IllegalArgumentException if the file type is not supported by * the system * @see #isFileTypeSupported(int, Sequence) * @see #getMidiFileTypes(Sequence) */
Writes a stream of bytes representing a file of the MIDI file type indicated to the external file provided
write
{ "repo_name": "ohpauleez/soymacchiato", "path": "src/jdk/src/share/classes/javax/sound/midi/MidiSystem.java", "license": "gpl-2.0", "size": 58868 }
[ "java.io.File", "java.io.IOException", "java.util.List", "javax.sound.midi.spi.MidiFileWriter" ]
import java.io.File; import java.io.IOException; import java.util.List; import javax.sound.midi.spi.MidiFileWriter;
import java.io.*; import java.util.*; import javax.sound.midi.spi.*;
[ "java.io", "java.util", "javax.sound" ]
java.io; java.util; javax.sound;
1,039,433
// Read the jacoco.exec file. Multiple data files could be merged // at this point loadExecutionData(); // Run the structure analyzer on a single class folder to build up // the coverage model. The process would be similar if your classes // were in a jar file. Typically you would create a bundle for each // class folder and each jar you want in your report. If you have // more than one bundle you will need to add a grouping node to your // report final IBundleCoverage bundleCoverage = analyzeStructure(); createReport(bundleCoverage); }
loadExecutionData(); final IBundleCoverage bundleCoverage = analyzeStructure(); createReport(bundleCoverage); }
/** * Create the report. * * @throws IOException */
Create the report
create
{ "repo_name": "Learn-Android-app/buck", "path": "src/com/facebook/buck/java/coverage/ReportGenerator.java", "license": "apache-2.0", "size": 8477 }
[ "org.jacoco.core.analysis.IBundleCoverage" ]
import org.jacoco.core.analysis.IBundleCoverage;
import org.jacoco.core.analysis.*;
[ "org.jacoco.core" ]
org.jacoco.core;
2,133,451
public boolean isBundleOfProductFeature(String bundleID) { if (bundleID!=null && bundleID.isEmpty()==false) { ArrayList<String> featureIDs = this.getFeaturesOfBundle(bundleID); for (String featureID : featureIDs) { if (featureID.equals(this.getProductFeatureID())==true) { return true; } } } return false; }
boolean function(String bundleID) { if (bundleID!=null && bundleID.isEmpty()==false) { ArrayList<String> featureIDs = this.getFeaturesOfBundle(bundleID); for (String featureID : featureIDs) { if (featureID.equals(this.getProductFeatureID())==true) { return true; } } } return false; }
/** * Checks if the specified bundle (bundle-ID) is a bundle of product feature. * * @param bundleID the bundle ID * @return true, if the bundle is element of product feature */
Checks if the specified bundle (bundle-ID) is a bundle of product feature
isBundleOfProductFeature
{ "repo_name": "EnFlexIT/AgentWorkbench", "path": "eclipseProjects/org.agentgui/bundles/de.enflexit.common/src/de/enflexit/common/featureEvaluation/FeatureEvaluator.java", "license": "lgpl-2.1", "size": 22592 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
876,836
public void readFields(DataInput in) throws IOException { DatanodeID id = new DatanodeID(); id.readFields(in); long capacity = in.readLong(); long remaining = in.readLong(); long lastUpdate = in.readLong(); int xceiverCount = in.readInt(); // update the DatanodeDescriptor with the data we read in node.updateRegInfo(id); node.setStorageID(id.getStorageID()); node.setCapacity(capacity); node.setRemaining(remaining); node.setLastUpdate(lastUpdate); node.setXceiverCount(xceiverCount); } }
void function(DataInput in) throws IOException { DatanodeID id = new DatanodeID(); id.readFields(in); long capacity = in.readLong(); long remaining = in.readLong(); long lastUpdate = in.readLong(); int xceiverCount = in.readInt(); node.updateRegInfo(id); node.setStorageID(id.getStorageID()); node.setCapacity(capacity); node.setRemaining(remaining); node.setLastUpdate(lastUpdate); node.setXceiverCount(xceiverCount); } }
/** * Public method that reads a serialized Datanode * from the fsImage. */
Public method that reads a serialized Datanode from the fsImage
readFields
{ "repo_name": "ryanobjc/hadoop-cloudera", "path": "src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSImage.java", "license": "apache-2.0", "size": 59654 }
[ "java.io.DataInput", "java.io.IOException", "org.apache.hadoop.hdfs.protocol.DatanodeID" ]
import java.io.DataInput; import java.io.IOException; import org.apache.hadoop.hdfs.protocol.DatanodeID;
import java.io.*; import org.apache.hadoop.hdfs.protocol.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
1,321,510
public synchronized boolean deleteMilestone(RepositoryModel repository, String milestone, String createdBy, boolean notifyOpenTickets) { if (StringUtils.isEmpty(milestone)) { throw new IllegalArgumentException("milestone can not be empty!"); } Repository db = null; try { TicketMilestone tm = getMilestone(repository, milestone); if (tm == null) { return false; } db = repositoryManager.getRepository(repository.name); StoredConfig config = db.getConfig(); config.unsetSection(MILESTONE, milestone); config.save(); milestonesCache.remove(repository.name); TicketNotifier notifier = createNotifier(); for (QueryResult qr : tm.tickets) { Change change = new Change(createdBy); change.setField(Field.milestone, ""); TicketModel ticket = updateTicket(repository, qr.number, change); if (notifyOpenTickets && ticket.isOpen()) { notifier.queueMailing(ticket); } } if (notifyOpenTickets) { notifier.sendAll(); } return true; } catch (IOException e) { log.error("failed to delete milestone " + milestone + " in " + repository, e); } finally { if (db != null) { db.close(); } } return false; }
synchronized boolean function(RepositoryModel repository, String milestone, String createdBy, boolean notifyOpenTickets) { if (StringUtils.isEmpty(milestone)) { throw new IllegalArgumentException(STR); } Repository db = null; try { TicketMilestone tm = getMilestone(repository, milestone); if (tm == null) { return false; } db = repositoryManager.getRepository(repository.name); StoredConfig config = db.getConfig(); config.unsetSection(MILESTONE, milestone); config.save(); milestonesCache.remove(repository.name); TicketNotifier notifier = createNotifier(); for (QueryResult qr : tm.tickets) { Change change = new Change(createdBy); change.setField(Field.milestone, STRfailed to delete milestone STR in " + repository, e); } finally { if (db != null) { db.close(); } } return false; }
/** * Deletes a milestone. * * @param repository * @param milestone * @param createdBy * @param notifyOpenTickets * @return true if successful * @since 1.6.0 */
Deletes a milestone
deleteMilestone
{ "repo_name": "paulsputer/gitblit", "path": "src/main/java/com/gitblit/tickets/ITicketService.java", "license": "apache-2.0", "size": 37082 }
[ "com.gitblit.models.RepositoryModel", "com.gitblit.models.TicketModel", "com.gitblit.utils.StringUtils", "org.eclipse.jgit.lib.Repository", "org.eclipse.jgit.lib.StoredConfig" ]
import com.gitblit.models.RepositoryModel; import com.gitblit.models.TicketModel; import com.gitblit.utils.StringUtils; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.lib.StoredConfig;
import com.gitblit.models.*; import com.gitblit.utils.*; import org.eclipse.jgit.lib.*;
[ "com.gitblit.models", "com.gitblit.utils", "org.eclipse.jgit" ]
com.gitblit.models; com.gitblit.utils; org.eclipse.jgit;
833,926
public void exportScores(File file) throws IOException { exportScores(file, "\t"); }
void function(File file) throws IOException { exportScores(file, "\t"); }
/** * Export the scores to the specified file in delimited (one per line) UTF-8 format, tab delimited * * @param file File to write to */
Export the scores to the specified file in delimited (one per line) UTF-8 format, tab delimited
exportScores
{ "repo_name": "xuzhongxing/deeplearning4j", "path": "deeplearning4j-nn/src/main/java/org/deeplearning4j/optimize/listeners/CollectScoresIterationListener.java", "license": "apache-2.0", "size": 3295 }
[ "java.io.File", "java.io.IOException" ]
import java.io.File; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,662,444