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 String toString()
{
if (SanityManager.DEBUG)
{
return super.toString() +
"checkOption: " + checkOption + "\n" +
"qeText: " + qeText + "\n";
}
else
{
return "";
}
} | String function() { if (SanityManager.DEBUG) { return super.toString() + STR + checkOption + "\n" + STR + qeText + "\n"; } else { return ""; } } | /**
* Convert this object to a String. See comments in QueryTreeNode.java
* for how this should be done for tree printing.
*
* @return This object as a String
*/ | Convert this object to a String. See comments in QueryTreeNode.java for how this should be done for tree printing | toString | {
"repo_name": "lpxz/grail-derby104",
"path": "java/engine/org/apache/derby/impl/sql/compile/CreateViewNode.java",
"license": "apache-2.0",
"size": 12488
} | [
"org.apache.derby.iapi.services.sanity.SanityManager"
] | import org.apache.derby.iapi.services.sanity.SanityManager; | import org.apache.derby.iapi.services.sanity.*; | [
"org.apache.derby"
] | org.apache.derby; | 716,698 |
public static File copyAudioToTmp(String fileName, File newFileName) {
File inputFile = new File(TEST_DATA_DIR, fileName);
File outputFile = getTestDataTmpFile(newFileName.getName());
assertThat(Utils.copy(inputFile, outputFile), is(true));
return outputFile;
} | static File function(String fileName, File newFileName) { File inputFile = new File(TEST_DATA_DIR, fileName); File outputFile = getTestDataTmpFile(newFileName.getName()); assertThat(Utils.copy(inputFile, outputFile), is(true)); return outputFile; } | /**
* Copy audiofile to processing dir ready for use in test, use this if using
* same file in multiple tests because with junit multithreading can have
* problems otherwise
*
* @param fileName file name to copy
*
* @return new file to use
*/ | Copy audiofile to processing dir ready for use in test, use this if using same file in multiple tests because with junit multithreading can have problems otherwise | copyAudioToTmp | {
"repo_name": "pandasys/ealvatag",
"path": "ealvatag/src/test/java/ealvatag/TestUtil.java",
"license": "lgpl-3.0",
"size": 5436
} | [
"java.io.File",
"org.hamcrest.CoreMatchers",
"org.hamcrest.MatcherAssert"
] | import java.io.File; import org.hamcrest.CoreMatchers; import org.hamcrest.MatcherAssert; | import java.io.*; import org.hamcrest.*; | [
"java.io",
"org.hamcrest"
] | java.io; org.hamcrest; | 1,746,633 |
try {
Call<ResponseBody> call = service.getNull();
ServiceResponse<List<Integer>> response = getNullDelegate(call.execute(), null);
return response.getBody();
} catch (ServiceException ex) {
throw ex;
} catch (Exception ex) {
throw new ServiceException(ex);
}
} | try { Call<ResponseBody> call = service.getNull(); ServiceResponse<List<Integer>> response = getNullDelegate(call.execute(), null); return response.getBody(); } catch (ServiceException ex) { throw ex; } catch (Exception ex) { throw new ServiceException(ex); } } | /**
* Get null array value
*
* @return the List<Integer> object if successful.
* @throws ServiceException the exception wrapped in ServiceException if failed.
*/ | Get null array value | getNull | {
"repo_name": "BretJohnson/autorest",
"path": "AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/bodyarray/ArrayImpl.java",
"license": "mit",
"size": 128720
} | [
"com.microsoft.rest.ServiceException",
"com.microsoft.rest.ServiceResponse",
"com.squareup.okhttp.ResponseBody",
"java.util.List"
] | import com.microsoft.rest.ServiceException; import com.microsoft.rest.ServiceResponse; import com.squareup.okhttp.ResponseBody; import java.util.List; | import com.microsoft.rest.*; import com.squareup.okhttp.*; import java.util.*; | [
"com.microsoft.rest",
"com.squareup.okhttp",
"java.util"
] | com.microsoft.rest; com.squareup.okhttp; java.util; | 1,406,125 |
public void setParties(ArrayList<String> s){
for (String u : s){
JsonTools<User> json = new JsonTools<>(new TypeReference<User>(){});
Users users = new Users();
User user = json.toEntity(users.get(u));
this.parties.add(user.getKey());
this.partiesId.put(user.getKey(), user.getId());
}
this.contract.setParties(s);
| void function(ArrayList<String> s){ for (String u : s){ JsonTools<User> json = new JsonTools<>(new TypeReference<User>(){}); Users users = new Users(); User user = json.toEntity(users.get(u)); this.parties.add(user.getKey()); this.partiesId.put(user.getKey(), user.getId()); } this.contract.setParties(s); | /**
* Find the parties keys
* @param s : List of user ids
*/ | Find the parties keys | setParties | {
"repo_name": "SturgisRaphael/ResilientSXP",
"path": "src/main/java/protocol/impl/sigma/SigmaContract.java",
"license": "lgpl-3.0",
"size": 6804
} | [
"com.fasterxml.jackson.core.type.TypeReference",
"java.util.ArrayList"
] | import com.fasterxml.jackson.core.type.TypeReference; import java.util.ArrayList; | import com.fasterxml.jackson.core.type.*; import java.util.*; | [
"com.fasterxml.jackson",
"java.util"
] | com.fasterxml.jackson; java.util; | 106,353 |
public String getAdditional() {
return additional;
}
}
private class StackNode {
private final int ancestorMask;
private final String name; // null if not HTML
private final String role;
private final String activeDescendant;
private final String forAttr;
private Set<Locator> imagesLackingAlt = new HashSet<Locator>();
private Locator nonEmptyOption = null;
private Locator locator = null;
private boolean selectedOptions = false;
private boolean labeledDescendants = false;
private boolean trackDescendants = false;
private boolean textNodeFound = false;
private boolean imgFound = false;
private boolean embeddedContentFound = false;
private boolean figcaptionNeeded = false;
private boolean figcaptionContentFound = false;
private boolean headingFound = false;
private boolean optionNeeded = false;
private boolean optionFound = false;
private boolean noValueOptionFound = false;
private boolean emptyValueOptionFound = false;
public StackNode(int ancestorMask, String name, String role,
String activeDescendant, String forAttr) {
this.ancestorMask = ancestorMask;
this.name = name;
this.role = role;
this.activeDescendant = activeDescendant;
this.forAttr = forAttr;
} | String function() { return additional; } } private class StackNode { private final int ancestorMask; private final String name; private final String role; private final String activeDescendant; private final String forAttr; private Set<Locator> imagesLackingAlt = new HashSet<Locator>(); private Locator nonEmptyOption = null; private Locator locator = null; private boolean selectedOptions = false; private boolean labeledDescendants = false; private boolean trackDescendants = false; private boolean textNodeFound = false; private boolean imgFound = false; private boolean embeddedContentFound = false; private boolean figcaptionNeeded = false; private boolean figcaptionContentFound = false; private boolean headingFound = false; private boolean optionNeeded = false; private boolean optionFound = false; private boolean noValueOptionFound = false; private boolean emptyValueOptionFound = false; public StackNode(int ancestorMask, String name, String role, String activeDescendant, String forAttr) { this.ancestorMask = ancestorMask; this.name = name; this.role = role; this.activeDescendant = activeDescendant; this.forAttr = forAttr; } | /**
* Returns the additional.
*
* @return the additional
*/ | Returns the additional | getAdditional | {
"repo_name": "YOTOV-LIMITED/validator",
"path": "src/nu/validator/checker/schematronequiv/Assertions.java",
"license": "mit",
"size": 111886
} | [
"java.util.HashSet",
"java.util.Set",
"org.xml.sax.Locator"
] | import java.util.HashSet; import java.util.Set; import org.xml.sax.Locator; | import java.util.*; import org.xml.sax.*; | [
"java.util",
"org.xml.sax"
] | java.util; org.xml.sax; | 1,118,236 |
private MetadataEntry[] convertMetadata(Map metadataMap) {
MetadataEntry[] metadata = new MetadataEntry[metadataMap.size()];
Iterator metadataIter = metadataMap.entrySet().iterator();
int index = 0;
while (metadataIter.hasNext()) {
Map.Entry entry = (Map.Entry) metadataIter.next();
Object metadataName = entry.getKey();
Object metadataValue = entry.getValue();
if (log.isDebugEnabled()) {
log.debug("Setting metadata: " + metadataName + "=" + metadataValue);
}
MetadataEntry mdEntry = new MetadataEntry();
mdEntry.setName(metadataName.toString());
mdEntry.setValue(metadataValue.toString());
metadata[index++] = mdEntry;
}
return metadata;
}
////////////////////////////////////////////////////////////////
// Methods below this point implement S3Service abstract methods
//////////////////////////////////////////////////////////////// | MetadataEntry[] function(Map metadataMap) { MetadataEntry[] metadata = new MetadataEntry[metadataMap.size()]; Iterator metadataIter = metadataMap.entrySet().iterator(); int index = 0; while (metadataIter.hasNext()) { Map.Entry entry = (Map.Entry) metadataIter.next(); Object metadataName = entry.getKey(); Object metadataValue = entry.getValue(); if (log.isDebugEnabled()) { log.debug(STR + metadataName + "=" + metadataValue); } MetadataEntry mdEntry = new MetadataEntry(); mdEntry.setName(metadataName.toString()); mdEntry.setValue(metadataValue.toString()); metadata[index++] = mdEntry; } return metadata; } | /**
* Converts metadata information from a standard map to SOAP objects.
*
* @param metadataMap
* @return
*/ | Converts metadata information from a standard map to SOAP objects | convertMetadata | {
"repo_name": "ind9/jets3t",
"path": "src/org/jets3t/service/impl/soap/axis/SoapS3Service.java",
"license": "apache-2.0",
"size": 44725
} | [
"java.util.Iterator",
"java.util.Map",
"org.jets3t.service.impl.soap.axis._2006_03_01.MetadataEntry"
] | import java.util.Iterator; import java.util.Map; import org.jets3t.service.impl.soap.axis._2006_03_01.MetadataEntry; | import java.util.*; import org.jets3t.service.impl.soap.axis.*; | [
"java.util",
"org.jets3t.service"
] | java.util; org.jets3t.service; | 1,407,484 |
public List<ShardRouting> getActiveShards() {
return activeShards();
} | List<ShardRouting> function() { return activeShards(); } | /**
* Returns a {@link List} of active shards
*
* @return a {@link List} of shards
*/ | Returns a <code>List</code> of active shards | getActiveShards | {
"repo_name": "ern/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/cluster/routing/IndexShardRoutingTable.java",
"license": "apache-2.0",
"size": 26322
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,867,671 |
private static int compareField(int Pfield, int Qfield) {
if (Pfield == Qfield) {
//fields are either equal in value or both undefined.
// Step B. 1.1 AND optimized result of performing 1.1-1.4.
return DatatypeConstants.EQUAL;
} else {
if (Pfield == DatatypeConstants.FIELD_UNDEFINED || Qfield == DatatypeConstants.FIELD_UNDEFINED) {
// Step B. 1.2
return DatatypeConstants.INDETERMINATE;
} else {
// Step B. 1.3-4.
return (Pfield < Qfield ? DatatypeConstants.LESSER : DatatypeConstants.GREATER);
}
}
} | static int function(int Pfield, int Qfield) { if (Pfield == Qfield) { return DatatypeConstants.EQUAL; } else { if (Pfield == DatatypeConstants.FIELD_UNDEFINED Qfield == DatatypeConstants.FIELD_UNDEFINED) { return DatatypeConstants.INDETERMINATE; } else { return (Pfield < Qfield ? DatatypeConstants.LESSER : DatatypeConstants.GREATER); } } } | /**
* <p>Implement Step B from
* http://www.w3.org/TR/xmlschema-2/#dateTime-order.</p>
*/ | Implement Step B from HREF | compareField | {
"repo_name": "openjdk/jdk8u",
"path": "jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java",
"license": "gpl-2.0",
"size": 118225
} | [
"javax.xml.datatype.DatatypeConstants"
] | import javax.xml.datatype.DatatypeConstants; | import javax.xml.datatype.*; | [
"javax.xml"
] | javax.xml; | 2,211,987 |
public void deleteExecService(ExecService execService); | void function(ExecService execService); | /**
* Remove execService
*
* @param execService execService to be removed
*/ | Remove execService | deleteExecService | {
"repo_name": "ondrocks/perun",
"path": "perun-controller/src/main/java/cz/metacentrum/perun/controller/service/GeneralServiceManager.java",
"license": "bsd-2-clause",
"size": 14197
} | [
"cz.metacentrum.perun.taskslib.model.ExecService"
] | import cz.metacentrum.perun.taskslib.model.ExecService; | import cz.metacentrum.perun.taskslib.model.*; | [
"cz.metacentrum.perun"
] | cz.metacentrum.perun; | 1,959,064 |
@Nullable
public PermissionGrantPolicy put(@Nonnull final PermissionGrantPolicy newPermissionGrantPolicy) throws ClientException {
return send(HttpMethod.PUT, newPermissionGrantPolicy);
} | PermissionGrantPolicy function(@Nonnull final PermissionGrantPolicy newPermissionGrantPolicy) throws ClientException { return send(HttpMethod.PUT, newPermissionGrantPolicy); } | /**
* Creates a PermissionGrantPolicy with a new object
*
* @param newPermissionGrantPolicy the object to create/update
* @return the created PermissionGrantPolicy
* @throws ClientException this exception occurs if the request was unable to complete for any reason
*/ | Creates a PermissionGrantPolicy with a new object | put | {
"repo_name": "microsoftgraph/msgraph-sdk-java",
"path": "src/main/java/com/microsoft/graph/requests/PermissionGrantPolicyRequest.java",
"license": "mit",
"size": 6540
} | [
"com.microsoft.graph.core.ClientException",
"com.microsoft.graph.http.HttpMethod",
"com.microsoft.graph.models.PermissionGrantPolicy",
"javax.annotation.Nonnull"
] | import com.microsoft.graph.core.ClientException; import com.microsoft.graph.http.HttpMethod; import com.microsoft.graph.models.PermissionGrantPolicy; import javax.annotation.Nonnull; | import com.microsoft.graph.core.*; import com.microsoft.graph.http.*; import com.microsoft.graph.models.*; import javax.annotation.*; | [
"com.microsoft.graph",
"javax.annotation"
] | com.microsoft.graph; javax.annotation; | 1,102,744 |
public void run() throws Exception {
Exporter me = new ValidMainExporter();
Exporter be = new ISEExporter();
Remote ro = new SPTRemoteObject();
ProxyTrustExporter pte = createPTE(me, be);
try {
pte.export(ro);
// FAIL
throw new TestException(
"export(" + ro + ") method of constructed "
+ "ProxyTrustExporter did not throw any exception "
+ "while IllegalStateException was expected.");
} catch (IllegalStateException ise) {
// PASS
logger.fine("export(" + ro + ") method of constructed "
+ "ProxyTrustExporter threw IllegalStateException "
+ "as expected.");
}
me = new ISEExporter();
be = new ValidBootExporter();
pte = createPTE(me, be);
try {
pte.export(ro);
// FAIL
throw new TestException(
"export(" + ro + ") method of constructed "
+ "ProxyTrustExporter did not throw any exception "
+ "while IllegalStateException was expected.");
} catch (IllegalStateException ise) {
// PASS
logger.fine("export(" + ro + ") method of constructed "
+ "ProxyTrustExporter threw IllegalStateException "
+ "as expected.");
}
}
class ISEExporter implements Exporter { | void function() throws Exception { Exporter me = new ValidMainExporter(); Exporter be = new ISEExporter(); Remote ro = new SPTRemoteObject(); ProxyTrustExporter pte = createPTE(me, be); try { pte.export(ro); throw new TestException( STR + ro + STR + STR + STR); } catch (IllegalStateException ise) { logger.fine(STR + ro + STR + STR + STR); } me = new ISEExporter(); be = new ValidBootExporter(); pte = createPTE(me, be); try { pte.export(ro); throw new TestException( STR + ro + STR + STR + STR); } catch (IllegalStateException ise) { logger.fine(STR + ro + STR + STR + STR); } } class ISEExporter implements Exporter { | /**
* This method performs all actions mentioned in class description.
*
*/ | This method performs all actions mentioned in class description | run | {
"repo_name": "cdegroot/river",
"path": "qa/src/com/sun/jini/test/spec/security/proxytrust/proxytrustexporter/Export_IllegalStateExceptionTest.java",
"license": "apache-2.0",
"size": 4951
} | [
"com.sun.jini.qa.harness.TestException",
"com.sun.jini.test.spec.security.proxytrust.util.SPTRemoteObject",
"com.sun.jini.test.spec.security.proxytrust.util.ValidBootExporter",
"com.sun.jini.test.spec.security.proxytrust.util.ValidMainExporter",
"java.rmi.Remote",
"net.jini.export.Exporter",
"net.jini.security.proxytrust.ProxyTrustExporter"
] | import com.sun.jini.qa.harness.TestException; import com.sun.jini.test.spec.security.proxytrust.util.SPTRemoteObject; import com.sun.jini.test.spec.security.proxytrust.util.ValidBootExporter; import com.sun.jini.test.spec.security.proxytrust.util.ValidMainExporter; import java.rmi.Remote; import net.jini.export.Exporter; import net.jini.security.proxytrust.ProxyTrustExporter; | import com.sun.jini.qa.harness.*; import com.sun.jini.test.spec.security.proxytrust.util.*; import java.rmi.*; import net.jini.export.*; import net.jini.security.proxytrust.*; | [
"com.sun.jini",
"java.rmi",
"net.jini.export",
"net.jini.security"
] | com.sun.jini; java.rmi; net.jini.export; net.jini.security; | 1,501,495 |
public MatchType isNumberMatch(PhoneNumber firstNumber, String secondNumber) {
// First see if the second number has an implicit country calling code, by attempting to parse
// it.
try {
PhoneNumber secondNumberAsProto = parse(secondNumber, UNKNOWN_REGION);
return isNumberMatch(firstNumber, secondNumberAsProto);
} catch (NumberParseException e) {
if (e.getErrorType() == NumberParseException.ErrorType.INVALID_COUNTRY_CODE) {
// The second number has no country calling code. EXACT_MATCH is no longer possible.
// We parse it as if the region was the same as that for the first number, and if
// EXACT_MATCH is returned, we replace this with NSN_MATCH.
String firstNumberRegion = getRegionCodeForCountryCode(firstNumber.getCountryCode());
try {
if (!firstNumberRegion.equals(UNKNOWN_REGION)) {
PhoneNumber secondNumberWithFirstNumberRegion = parse(secondNumber, firstNumberRegion);
MatchType match = isNumberMatch(firstNumber, secondNumberWithFirstNumberRegion);
if (match == MatchType.EXACT_MATCH) {
return MatchType.NSN_MATCH;
}
return match;
} else {
// If the first number didn't have a valid country calling code, then we parse the
// second number without one as well.
PhoneNumber secondNumberProto = new PhoneNumber();
parseHelper(secondNumber, null, false, false, secondNumberProto);
return isNumberMatch(firstNumber, secondNumberProto);
}
} catch (NumberParseException e2) {
// Fall-through to return NOT_A_NUMBER.
}
}
}
// One or more of the phone numbers we are trying to match is not a viable phone number.
return MatchType.NOT_A_NUMBER;
} | MatchType function(PhoneNumber firstNumber, String secondNumber) { try { PhoneNumber secondNumberAsProto = parse(secondNumber, UNKNOWN_REGION); return isNumberMatch(firstNumber, secondNumberAsProto); } catch (NumberParseException e) { if (e.getErrorType() == NumberParseException.ErrorType.INVALID_COUNTRY_CODE) { String firstNumberRegion = getRegionCodeForCountryCode(firstNumber.getCountryCode()); try { if (!firstNumberRegion.equals(UNKNOWN_REGION)) { PhoneNumber secondNumberWithFirstNumberRegion = parse(secondNumber, firstNumberRegion); MatchType match = isNumberMatch(firstNumber, secondNumberWithFirstNumberRegion); if (match == MatchType.EXACT_MATCH) { return MatchType.NSN_MATCH; } return match; } else { PhoneNumber secondNumberProto = new PhoneNumber(); parseHelper(secondNumber, null, false, false, secondNumberProto); return isNumberMatch(firstNumber, secondNumberProto); } } catch (NumberParseException e2) { } } } return MatchType.NOT_A_NUMBER; } | /**
* Takes two phone numbers and compares them for equality. This is a convenience wrapper for
* {@link #isNumberMatch(PhoneNumber, PhoneNumber)}. No default region is known.
*
* @param firstNumber first number to compare in proto buffer format.
* @param secondNumber second number to compare. Can contain formatting, and can have country
* calling code specified with + at the start.
* @return NOT_A_NUMBER, NO_MATCH, SHORT_NSN_MATCH, NSN_MATCH, EXACT_MATCH. See
* {@link #isNumberMatch(PhoneNumber, PhoneNumber)} for more details.
*/ | Takes two phone numbers and compares them for equality. This is a convenience wrapper for <code>#isNumberMatch(PhoneNumber, PhoneNumber)</code>. No default region is known | isNumberMatch | {
"repo_name": "tg123/libphonenumber",
"path": "java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java",
"license": "apache-2.0",
"size": 161577
} | [
"com.google.i18n.phonenumbers.Phonenumber"
] | import com.google.i18n.phonenumbers.Phonenumber; | import com.google.i18n.phonenumbers.*; | [
"com.google.i18n"
] | com.google.i18n; | 696,761 |
public WorldGenerator getRandomWorldGenForGrass(Random rand)
{
return rand.nextInt(4) == 0 ? new WorldGenTallGrass(BlockTallGrass.EnumType.FERN) : new WorldGenTallGrass(BlockTallGrass.EnumType.GRASS);
} | WorldGenerator function(Random rand) { return rand.nextInt(4) == 0 ? new WorldGenTallGrass(BlockTallGrass.EnumType.FERN) : new WorldGenTallGrass(BlockTallGrass.EnumType.GRASS); } | /**
* Gets a WorldGen appropriate for this biome.
*/ | Gets a WorldGen appropriate for this biome | getRandomWorldGenForGrass | {
"repo_name": "aebert1/BigTransport",
"path": "build/tmp/recompileMc/sources/net/minecraft/world/biome/BiomeGenJungle.java",
"license": "gpl-3.0",
"size": 3841
} | [
"java.util.Random",
"net.minecraft.block.BlockTallGrass",
"net.minecraft.world.gen.feature.WorldGenTallGrass",
"net.minecraft.world.gen.feature.WorldGenerator"
] | import java.util.Random; import net.minecraft.block.BlockTallGrass; import net.minecraft.world.gen.feature.WorldGenTallGrass; import net.minecraft.world.gen.feature.WorldGenerator; | import java.util.*; import net.minecraft.block.*; import net.minecraft.world.gen.feature.*; | [
"java.util",
"net.minecraft.block",
"net.minecraft.world"
] | java.util; net.minecraft.block; net.minecraft.world; | 2,716,569 |
public Builder withR(int r)
{
this.r = new Quorum(r);
return this;
} | Builder function(int r) { this.r = new Quorum(r); return this; } | /**
* Set the r value. Individual requests (or buckets in a bucket type)
* can override this.
*
* @param r the r value as an integer.
* @return a reference to this object.
*/ | Set the r value. Individual requests (or buckets in a bucket type) can override this | withR | {
"repo_name": "basho/riak-java-client",
"path": "src/main/java/com/basho/riak/client/core/query/BucketProperties.java",
"license": "apache-2.0",
"size": 32623
} | [
"com.basho.riak.client.api.cap.Quorum"
] | import com.basho.riak.client.api.cap.Quorum; | import com.basho.riak.client.api.cap.*; | [
"com.basho.riak"
] | com.basho.riak; | 1,593,425 |
private void finish() throws IOException {
// Update the last shard if at least one element was written.
if (previousShard.isPresent()) {
finishShard();
}
long startOfBloomFilter = out.getCount();
ScalableBloomFilterCoder.of().encode(bloomFilterBuilder.build(), out);
long startOfIndex = out.getCount();
IsmFormat.ISM_SHARD_INDEX_CODER.encode(new ArrayList<>(shardKeyToShardMap.values()), out);
FooterCoder.of()
.encode(Footer.of(startOfIndex, startOfBloomFilter, numberOfKeysWritten), out);
} | void function() throws IOException { if (previousShard.isPresent()) { finishShard(); } long startOfBloomFilter = out.getCount(); ScalableBloomFilterCoder.of().encode(bloomFilterBuilder.build(), out); long startOfIndex = out.getCount(); IsmFormat.ISM_SHARD_INDEX_CODER.encode(new ArrayList<>(shardKeyToShardMap.values()), out); FooterCoder.of() .encode(Footer.of(startOfIndex, startOfBloomFilter, numberOfKeysWritten), out); } | /**
* Completes the construction of the Ism file. This is done by:
*
* <ul>
* <li>finishing the last shard if present
* <li>writing out the Bloom filter
* <li>writing out the shard index
* <li>writing out the footer
* </ul>
*
* @throws IOException if an underlying write fails
*/ | Completes the construction of the Ism file. This is done by: finishing the last shard if present writing out the Bloom filter writing out the shard index writing out the footer | finish | {
"repo_name": "rangadi/beam",
"path": "runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/IsmSink.java",
"license": "apache-2.0",
"size": 12798
} | [
"java.io.IOException",
"java.util.ArrayList",
"org.apache.beam.runners.dataflow.internal.IsmFormat",
"org.apache.beam.runners.dataflow.worker.util.ScalableBloomFilter"
] | import java.io.IOException; import java.util.ArrayList; import org.apache.beam.runners.dataflow.internal.IsmFormat; import org.apache.beam.runners.dataflow.worker.util.ScalableBloomFilter; | import java.io.*; import java.util.*; import org.apache.beam.runners.dataflow.internal.*; import org.apache.beam.runners.dataflow.worker.util.*; | [
"java.io",
"java.util",
"org.apache.beam"
] | java.io; java.util; org.apache.beam; | 793,170 |
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<CustomerPolicyInner> getByCustomerWithResponse(
String billingAccountName, String customerName, Context context) {
return getByCustomerWithResponseAsync(billingAccountName, customerName, context).block();
} | @ServiceMethod(returns = ReturnType.SINGLE) Response<CustomerPolicyInner> function( String billingAccountName, String customerName, Context context) { return getByCustomerWithResponseAsync(billingAccountName, customerName, context).block(); } | /**
* Lists the policies for a customer. This operation is supported only for billing accounts with agreement type
* Microsoft Partner Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param customerName The ID that uniquely identifies a customer.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the customer's Policy.
*/ | Lists the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement | getByCustomerWithResponse | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PoliciesClientImpl.java",
"license": "mit",
"size": 35613
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.core.util.Context",
"com.azure.resourcemanager.billing.fluent.models.CustomerPolicyInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.billing.fluent.models.CustomerPolicyInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.billing.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 744,408 |
public ParseContext transform(ParseContext pctx) throws SemanticException {
pCtx = pctx;
if (HiveConf.getBoolVar(pCtx.getConf(),HiveConf.ConfVars.HIVECONVERTJOIN)) {
findPossibleAutoConvertedJoinOperators();
}
// detect correlations
CorrelationNodeProcCtx corrCtx = new CorrelationNodeProcCtx(pCtx);
Map<Rule, NodeProcessor> opRules = new LinkedHashMap<Rule, NodeProcessor>();
opRules.put(new RuleRegExp("R1", ReduceSinkOperator.getOperatorName() + "%"),
new CorrelationNodeProc());
Dispatcher disp = new DefaultRuleDispatcher(getDefaultProc(), opRules, corrCtx);
GraphWalker ogw = new DefaultGraphWalker(disp);
// Create a list of topOp nodes
List<Node> topNodes = new ArrayList<Node>();
topNodes.addAll(pCtx.getTopOps().values());
ogw.startWalking(topNodes, null);
// We have finished tree walking (correlation detection).
// We will first see if we need to abort (the operator tree has not been changed).
// If not, we will start to transform the operator tree.
abort = corrCtx.isAbort();
if (abort) {
LOG.info("Abort. Reasons are ...");
for (String reason : corrCtx.getAbortReasons()) {
LOG.info("-- " + reason);
}
} else {
// transform the operator tree
LOG.info("Begain query plan transformation based on intra-query correlations. " +
corrCtx.getCorrelations().size() + " correlation(s) to be applied");
for (IntraQueryCorrelation correlation : corrCtx.getCorrelations()) {
QueryPlanTreeTransformation.applyCorrelation(pCtx, corrCtx, correlation);
}
}
return pCtx;
}
private class CorrelationNodeProc implements NodeProcessor { | ParseContext function(ParseContext pctx) throws SemanticException { pCtx = pctx; if (HiveConf.getBoolVar(pCtx.getConf(),HiveConf.ConfVars.HIVECONVERTJOIN)) { findPossibleAutoConvertedJoinOperators(); } CorrelationNodeProcCtx corrCtx = new CorrelationNodeProcCtx(pCtx); Map<Rule, NodeProcessor> opRules = new LinkedHashMap<Rule, NodeProcessor>(); opRules.put(new RuleRegExp("R1", ReduceSinkOperator.getOperatorName() + "%"), new CorrelationNodeProc()); Dispatcher disp = new DefaultRuleDispatcher(getDefaultProc(), opRules, corrCtx); GraphWalker ogw = new DefaultGraphWalker(disp); List<Node> topNodes = new ArrayList<Node>(); topNodes.addAll(pCtx.getTopOps().values()); ogw.startWalking(topNodes, null); abort = corrCtx.isAbort(); if (abort) { LOG.info(STR); for (String reason : corrCtx.getAbortReasons()) { LOG.info(STR + reason); } } else { LOG.info(STR + corrCtx.getCorrelations().size() + STR); for (IntraQueryCorrelation correlation : corrCtx.getCorrelations()) { QueryPlanTreeTransformation.applyCorrelation(pCtx, corrCtx, correlation); } } return pCtx; } private class CorrelationNodeProc implements NodeProcessor { | /**
* Detect correlations and transform the query tree.
*
* @param pactx
* current parse context
* @throws SemanticException
*/ | Detect correlations and transform the query tree | transform | {
"repo_name": "asonipsl/hive",
"path": "ql/src/java/org/apache/hadoop/hive/ql/optimizer/correlation/CorrelationOptimizer.java",
"license": "apache-2.0",
"size": 29917
} | [
"java.util.ArrayList",
"java.util.LinkedHashMap",
"java.util.List",
"java.util.Map",
"org.apache.hadoop.hive.conf.HiveConf",
"org.apache.hadoop.hive.ql.exec.ReduceSinkOperator",
"org.apache.hadoop.hive.ql.lib.DefaultGraphWalker",
"org.apache.hadoop.hive.ql.lib.DefaultRuleDispatcher",
"org.apache.hadoop.hive.ql.lib.Dispatcher",
"org.apache.hadoop.hive.ql.lib.GraphWalker",
"org.apache.hadoop.hive.ql.lib.Node",
"org.apache.hadoop.hive.ql.lib.NodeProcessor",
"org.apache.hadoop.hive.ql.lib.Rule",
"org.apache.hadoop.hive.ql.lib.RuleRegExp",
"org.apache.hadoop.hive.ql.parse.ParseContext",
"org.apache.hadoop.hive.ql.parse.SemanticException"
] | import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.ql.exec.ReduceSinkOperator; import org.apache.hadoop.hive.ql.lib.DefaultGraphWalker; import org.apache.hadoop.hive.ql.lib.DefaultRuleDispatcher; import org.apache.hadoop.hive.ql.lib.Dispatcher; import org.apache.hadoop.hive.ql.lib.GraphWalker; import org.apache.hadoop.hive.ql.lib.Node; import org.apache.hadoop.hive.ql.lib.NodeProcessor; import org.apache.hadoop.hive.ql.lib.Rule; import org.apache.hadoop.hive.ql.lib.RuleRegExp; import org.apache.hadoop.hive.ql.parse.ParseContext; import org.apache.hadoop.hive.ql.parse.SemanticException; | import java.util.*; import org.apache.hadoop.hive.conf.*; import org.apache.hadoop.hive.ql.exec.*; import org.apache.hadoop.hive.ql.lib.*; import org.apache.hadoop.hive.ql.parse.*; | [
"java.util",
"org.apache.hadoop"
] | java.util; org.apache.hadoop; | 1,568,183 |
public void addExternalId(final ExternalId legalentityId) {
ArgumentChecker.notNull(legalentityId, "legalentityId");
addExternalIds(Arrays.asList(legalentityId));
} | void function(final ExternalId legalentityId) { ArgumentChecker.notNull(legalentityId, STR); addExternalIds(Arrays.asList(legalentityId)); } | /**
* Adds a single legal entity external identifier to the collection to search for. Unless customized, the search will match
* {@link com.opengamma.id.ExternalIdSearchType#ANY any} of the identifiers.
*
* @param legalentityId
* the legal entity key identifier to add, not null
*/ | Adds a single legal entity external identifier to the collection to search for. Unless customized, the search will match <code>com.opengamma.id.ExternalIdSearchType#ANY any</code> of the identifiers | addExternalId | {
"repo_name": "McLeodMoores/starling",
"path": "projects/master/src/main/java/com/opengamma/master/legalentity/LegalEntitySearchRequest.java",
"license": "apache-2.0",
"size": 27714
} | [
"com.opengamma.id.ExternalId",
"com.opengamma.util.ArgumentChecker",
"java.util.Arrays"
] | import com.opengamma.id.ExternalId; import com.opengamma.util.ArgumentChecker; import java.util.Arrays; | import com.opengamma.id.*; import com.opengamma.util.*; import java.util.*; | [
"com.opengamma.id",
"com.opengamma.util",
"java.util"
] | com.opengamma.id; com.opengamma.util; java.util; | 1,339,713 |
@Override
public BlobClientBuilder credential(AzureNamedKeyCredential credential) {
Objects.requireNonNull(credential, "'credential' cannot be null.");
return credential(StorageSharedKeyCredential.fromAzureNamedKeyCredential(credential));
} | BlobClientBuilder function(AzureNamedKeyCredential credential) { Objects.requireNonNull(credential, STR); return credential(StorageSharedKeyCredential.fromAzureNamedKeyCredential(credential)); } | /**
* Sets the {@link AzureNamedKeyCredential} used to authorize requests sent to the service.
*
* @param credential {@link AzureNamedKeyCredential}.
* @return the updated BlobClientBuilder
* @throws NullPointerException If {@code credential} is {@code null}.
*/ | Sets the <code>AzureNamedKeyCredential</code> used to authorize requests sent to the service | credential | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobClientBuilder.java",
"license": "mit",
"size": 29263
} | [
"com.azure.core.credential.AzureNamedKeyCredential",
"com.azure.storage.common.StorageSharedKeyCredential",
"java.util.Objects"
] | import com.azure.core.credential.AzureNamedKeyCredential; import com.azure.storage.common.StorageSharedKeyCredential; import java.util.Objects; | import com.azure.core.credential.*; import com.azure.storage.common.*; import java.util.*; | [
"com.azure.core",
"com.azure.storage",
"java.util"
] | com.azure.core; com.azure.storage; java.util; | 333,726 |
// -----------------------------------------------------------------------
public static boolean contentEquals(File file1, File file2) throws IOException {
boolean file1Exists = file1.exists();
if (file1Exists != file2.exists()) {
return false;
}
if (!file1Exists) {
// two not existing files are equal
return true;
}
if (file1.isDirectory() || file2.isDirectory()) {
// don't want to compare directory contents
throw new IOException("Can't compare directories, only files");
}
if (file1.length() != file2.length()) {
// lengths differ, cannot be equal
return false;
}
if (file1.getCanonicalFile().equals(file2.getCanonicalFile())) {
// same file
return true;
}
InputStream input1 = null;
InputStream input2 = null;
try {
input1 = new FileInputStream(file1);
input2 = new FileInputStream(file2);
return IOUtils.contentEquals(input1, input2);
}
finally {
IOUtils.closeQuietly(input1);
IOUtils.closeQuietly(input2);
}
} | static boolean function(File file1, File file2) throws IOException { boolean file1Exists = file1.exists(); if (file1Exists != file2.exists()) { return false; } if (!file1Exists) { return true; } if (file1.isDirectory() file2.isDirectory()) { throw new IOException(STR); } if (file1.length() != file2.length()) { return false; } if (file1.getCanonicalFile().equals(file2.getCanonicalFile())) { return true; } InputStream input1 = null; InputStream input2 = null; try { input1 = new FileInputStream(file1); input2 = new FileInputStream(file2); return IOUtils.contentEquals(input1, input2); } finally { IOUtils.closeQuietly(input1); IOUtils.closeQuietly(input2); } } | /**
* Compares the contents of two files to determine if they are equal or not.
* <p>
* This method checks to see if the two files are different lengths or if they point to the same file, before resorting to byte-by-byte comparison of the contents.
* <p>
* Code origin: Avalon
*
* @param file1 the first file
* @param file2 the second file
* @return true if the content of the files are equal or they both don't
* exist, false otherwise
* @throws IOException in case of an I/O error
*/ | Compares the contents of two files to determine if they are equal or not. This method checks to see if the two files are different lengths or if they point to the same file, before resorting to byte-by-byte comparison of the contents. Code origin: Avalon | contentEquals | {
"repo_name": "OhmGeek/ThanCue",
"path": "src/org/zeroturnaround/zip/commons/FileUtils.java",
"license": "gpl-3.0",
"size": 35202
} | [
"java.io.File",
"java.io.FileInputStream",
"java.io.IOException",
"java.io.InputStream"
] | import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; | import java.io.*; | [
"java.io"
] | java.io; | 1,970,084 |
public int findNrPrevJobEntries( JobEntryCopy from ) {
return findNrPrevJobEntries( from, false );
} | int function( JobEntryCopy from ) { return findNrPrevJobEntries( from, false ); } | /**
* Find nr prev job entries.
*
* @param from the from
* @return the int
*/ | Find nr prev job entries | findNrPrevJobEntries | {
"repo_name": "ViswesvarSekar/pentaho-kettle",
"path": "engine/src/org/pentaho/di/job/JobMeta.java",
"license": "apache-2.0",
"size": 86688
} | [
"org.pentaho.di.job.entry.JobEntryCopy"
] | import org.pentaho.di.job.entry.JobEntryCopy; | import org.pentaho.di.job.entry.*; | [
"org.pentaho.di"
] | org.pentaho.di; | 2,663,384 |
public String unescape( String s ) {
StringBuffer buf = new StringBuffer( s.length() );
Matcher m = entityPtn.matcher( s );
String decRef;
String hexRef;
int charCode;
String entName;
String entity;
while ( m.find() ) {
decRef = m.group( 1 );
hexRef = m.group( 2 );
entName = m.group( 3 );
if ( (decRef != null) ) {
// Decimal character reference.
charCode = Integer.parseInt( decRef );
entity = Character.toString( (char)charCode );
}
else if ( (hexRef != null) ) {
// Hex character reference.
charCode = Integer.parseInt( hexRef, 16 );
entity = Character.toString( (char)charCode );
}
else {
entity = entityMap.get( entName );
if ( entity == null ) {
// Unknown entity, repeat it as-is.
entity = "&"+ entName +";";
}
}
m.appendReplacement( buf, entity );
}
m.appendTail( buf );
return buf.toString();
} | String function( String s ) { StringBuffer buf = new StringBuffer( s.length() ); Matcher m = entityPtn.matcher( s ); String decRef; String hexRef; int charCode; String entName; String entity; while ( m.find() ) { decRef = m.group( 1 ); hexRef = m.group( 2 ); entName = m.group( 3 ); if ( (decRef != null) ) { charCode = Integer.parseInt( decRef ); entity = Character.toString( (char)charCode ); } else if ( (hexRef != null) ) { charCode = Integer.parseInt( hexRef, 16 ); entity = Character.toString( (char)charCode ); } else { entity = entityMap.get( entName ); if ( entity == null ) { entity = "&"+ entName +";"; } } m.appendReplacement( buf, entity ); } m.appendTail( buf ); return buf.toString(); } | /**
* Unescapes standard named entities and numeric character references.
* This applies to attributes and element values.
*
* They are: lt, gt, quot, apos, amp, #1234, #x1a2b.
*/ | Unescapes standard named entities and numeric character references. This applies to attributes and element values. They are: lt, gt, quot, apos, amp, #1234, #x1a2b | unescape | {
"repo_name": "Vhati/ftl-profile-editor",
"path": "src/main/java/net/vhati/modmanager/core/SloppyXMLParser.java",
"license": "gpl-2.0",
"size": 16542
} | [
"java.util.regex.Matcher"
] | import java.util.regex.Matcher; | import java.util.regex.*; | [
"java.util"
] | java.util; | 1,926,789 |
protected void setConfigurationContextService(ConfigurationContextService service) {
if (log.isDebugEnabled()) {
log.debug("carbon-registry deployment synchronizer component bound to the configuration context service");
}
RegistryServiceReferenceHolder.setConfigurationContextService(service);
} | void function(ConfigurationContextService service) { if (log.isDebugEnabled()) { log.debug(STR); } RegistryServiceReferenceHolder.setConfigurationContextService(service); } | /**
* This method is used to set configuration context service.
*
* @param service configuration context service.
*/ | This method is used to set configuration context service | setConfigurationContextService | {
"repo_name": "laki88/carbon-registry",
"path": "components/registry/org.wso2.carbon.registry.deployment.synchronizer/src/main/java/org/wso2/carbon/registry/deployment/synchronizer/internal/RegistryDeploymentSynchronizerComponent.java",
"license": "apache-2.0",
"size": 4399
} | [
"org.wso2.carbon.registry.deployment.synchronizer.utils.RegistryServiceReferenceHolder",
"org.wso2.carbon.utils.ConfigurationContextService"
] | import org.wso2.carbon.registry.deployment.synchronizer.utils.RegistryServiceReferenceHolder; import org.wso2.carbon.utils.ConfigurationContextService; | import org.wso2.carbon.registry.deployment.synchronizer.utils.*; import org.wso2.carbon.utils.*; | [
"org.wso2.carbon"
] | org.wso2.carbon; | 1,592,157 |
@Override
public void getBeerOfMonth() {
new BeerRequest().start(this,
(Iface) getClient(new Client.Factory(), mPluginName),
(Object) null);
} | void function() { new BeerRequest().start(this, (Iface) getClient(new Client.Factory(), mPluginName), (Object) null); } | /**
* Initiates a request to the server to get the beer of the month.
*/ | Initiates a request to the server to get the beer of the month | getBeerOfMonth | {
"repo_name": "ValentinMinder/pocketcampus",
"path": "plugin/satellite/android/src/main/java/org/pocketcampus/plugin/satellite/android/SatelliteController.java",
"license": "bsd-3-clause",
"size": 1774
} | [
"org.pocketcampus.plugin.satellite.android.req.BeerRequest",
"org.pocketcampus.plugin.satellite.shared.SatelliteService"
] | import org.pocketcampus.plugin.satellite.android.req.BeerRequest; import org.pocketcampus.plugin.satellite.shared.SatelliteService; | import org.pocketcampus.plugin.satellite.android.req.*; import org.pocketcampus.plugin.satellite.shared.*; | [
"org.pocketcampus.plugin"
] | org.pocketcampus.plugin; | 602,234 |
public static void main(String args[]) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException ex) {
} catch (InstantiationException ex) {
} catch (IllegalAccessException ex) {
} catch (UnsupportedLookAndFeelException ex) {
} | static void function(String args[]) { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException ex) { } catch (InstantiationException ex) { } catch (IllegalAccessException ex) { } catch (UnsupportedLookAndFeelException ex) { } | /**
* Runs the uninstaller.
* @param args Command line arguments are not supported.
*/ | Runs the uninstaller | main | {
"repo_name": "JLimperg/SalSSuite",
"path": "src/salssuite/util/gui/Uninstaller.java",
"license": "gpl-3.0",
"size": 10215
} | [
"javax.swing.UIManager",
"javax.swing.UnsupportedLookAndFeelException"
] | import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 2,212,093 |
KafkaChannel buildChannel(String id, SelectionKey key, int maxReceiveSize) throws KafkaException; | KafkaChannel buildChannel(String id, SelectionKey key, int maxReceiveSize) throws KafkaException; | /**
* returns a Channel with TransportLayer and Authenticator configured.
* @param id channel id
* @param key SelectionKey
*/ | returns a Channel with TransportLayer and Authenticator configured | buildChannel | {
"repo_name": "usakey/kafka",
"path": "clients/src/main/java/org/apache/kafka/common/network/ChannelBuilder.java",
"license": "apache-2.0",
"size": 1510
} | [
"java.nio.channels.SelectionKey",
"org.apache.kafka.common.KafkaException"
] | import java.nio.channels.SelectionKey; import org.apache.kafka.common.KafkaException; | import java.nio.channels.*; import org.apache.kafka.common.*; | [
"java.nio",
"org.apache.kafka"
] | java.nio; org.apache.kafka; | 9,260 |
public SnapshotPolicyPatch withWeeklySchedule(WeeklySchedule weeklySchedule) {
if (this.innerProperties() == null) {
this.innerProperties = new SnapshotPolicyProperties();
}
this.innerProperties().withWeeklySchedule(weeklySchedule);
return this;
} | SnapshotPolicyPatch function(WeeklySchedule weeklySchedule) { if (this.innerProperties() == null) { this.innerProperties = new SnapshotPolicyProperties(); } this.innerProperties().withWeeklySchedule(weeklySchedule); return this; } | /**
* Set the weeklySchedule property: Schedule for weekly snapshots.
*
* @param weeklySchedule the weeklySchedule value to set.
* @return the SnapshotPolicyPatch object itself.
*/ | Set the weeklySchedule property: Schedule for weekly snapshots | withWeeklySchedule | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SnapshotPolicyPatch.java",
"license": "mit",
"size": 7723
} | [
"com.azure.resourcemanager.netapp.fluent.models.SnapshotPolicyProperties"
] | import com.azure.resourcemanager.netapp.fluent.models.SnapshotPolicyProperties; | import com.azure.resourcemanager.netapp.fluent.models.*; | [
"com.azure.resourcemanager"
] | com.azure.resourcemanager; | 1,982,745 |
public void endLocator(String namespaceURI, String sName, String qName) throws XLinkException {
;
}
| void function(String namespaceURI, String sName, String qName) throws XLinkException { ; } | /**
* Handle the end of the locator.
*/ | Handle the end of the locator | endLocator | {
"repo_name": "martinggww/Programming",
"path": "XBRL/xbrl-api/module-api/src/main/java/org/xbrlapi/xlink/handler/XBRLXLinkHandlerImpl.java",
"license": "gpl-2.0",
"size": 15679
} | [
"org.xbrlapi.xlink.XLinkException"
] | import org.xbrlapi.xlink.XLinkException; | import org.xbrlapi.xlink.*; | [
"org.xbrlapi.xlink"
] | org.xbrlapi.xlink; | 2,696,753 |
public Map<String, String> getRequestParameters() {
return requestParameters;
} | Map<String, String> function() { return requestParameters; } | /**
* Returns the complete map of additional request parameters to be included
* in the pre-signed URL.
*
* @return The complete map of additional request parameters to be included
* in the pre-signed URL.
*/ | Returns the complete map of additional request parameters to be included in the pre-signed URL | getRequestParameters | {
"repo_name": "trasa/aws-sdk-java",
"path": "aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/GeneratePresignedUrlRequest.java",
"license": "apache-2.0",
"size": 21304
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,625,896 |
public static void buildSize( StringBuffer styleBuffer, IStyle style)
{
buildProperty( styleBuffer, HTMLTags.ATTR_HEIGHT, style.getHeight( ) );
buildProperty( styleBuffer, HTMLTags.ATTR_WIDTH, style.getWidth( ) );
} | static void function( StringBuffer styleBuffer, IStyle style) { buildProperty( styleBuffer, HTMLTags.ATTR_HEIGHT, style.getHeight( ) ); buildProperty( styleBuffer, HTMLTags.ATTR_WIDTH, style.getWidth( ) ); } | /**
* Build size style, set height and width
*
* @param styleBuffer
* The <code>StringBuffer</code> to which the result is output.
* @param style
* The style object.
*/ | Build size style, set height and width | buildSize | {
"repo_name": "sguan-actuate/birt",
"path": "engine/org.eclipse.birt.report.engine.emitter.html/src/org/eclipse/birt/report/engine/emitter/html/AttributeBuilder.java",
"license": "epl-1.0",
"size": 21204
} | [
"org.eclipse.birt.report.engine.content.IStyle",
"org.eclipse.birt.report.engine.emitter.HTMLTags"
] | import org.eclipse.birt.report.engine.content.IStyle; import org.eclipse.birt.report.engine.emitter.HTMLTags; | import org.eclipse.birt.report.engine.content.*; import org.eclipse.birt.report.engine.emitter.*; | [
"org.eclipse.birt"
] | org.eclipse.birt; | 424,948 |
void removeChangeListener(RendererChangeListener listener);
//// TOOL TIP GENERATOR /////////////////////////////////////////////////// | void removeChangeListener(RendererChangeListener listener); | /**
* Removes a change listener.
*
* @param listener the listener.
*/ | Removes a change listener | removeChangeListener | {
"repo_name": "jfree/jfreechart",
"path": "src/main/java/org/jfree/chart/renderer/PolarItemRenderer.java",
"license": "lgpl-2.1",
"size": 6378
} | [
"org.jfree.chart.event.RendererChangeListener"
] | import org.jfree.chart.event.RendererChangeListener; | import org.jfree.chart.event.*; | [
"org.jfree.chart"
] | org.jfree.chart; | 87,859 |
public boolean invertDirectInversion(DenseMatrix64F A) {
createSolver(A.numCols);
return invertUnsafe(getInversionSolver(), A, false);
} | boolean function(DenseMatrix64F A) { createSolver(A.numCols); return invertUnsafe(getInversionSolver(), A, false); } | /**
* Invert symmetric positive definite matrix A. On output a replaced by A^-1.
*
* @param A the matrix A
* @return False if the matrix is singular (no solution)
*/ | Invert symmetric positive definite matrix A. On output a replaced by A^-1 | invertDirectInversion | {
"repo_name": "aherbert/GDSC-SMLM",
"path": "src/main/java/uk/ac/sussex/gdsc/smlm/fitting/linear/EjmlLinearSolver.java",
"license": "gpl-3.0",
"size": 40872
} | [
"org.ejml.data.DenseMatrix64F"
] | import org.ejml.data.DenseMatrix64F; | import org.ejml.data.*; | [
"org.ejml.data"
] | org.ejml.data; | 2,223,335 |
@Test
public void testRemovingPropertyDefinition() {
String name = "asdt-rpd";
String propName = name + "-name";
Toolkit toolkit = mToolkit;
Scope scope = mScope;
Assert.assertNotNull(toolkit);
Assert.assertNotNull(scope);
StructureDefinition newDef = checkAndCreate(name);
PropertyDefinition newPD = toolkit.createNewPropertyDefinition(scope, propName, PropertyType.String);
newDef = newDef.addPropertyDefinition(newPD);
toolkit.writeStructureDefinition(scope, newDef);
StructureDefinition testDef = toolkit.lookupStructureDefinitionByName(scope, name);
Assert.assertNotNull(testDef);
Map<String, PropertyDefinition> testProperties = testDef.getPropertyDefinitions();
Assert.assertNotNull(testProperties);
PropertyDefinition testPD = testProperties.get(propName);
Assert.assertNotNull(testPD);
Assert.assertEquals("Serialized property does not match", propName, testPD.getName());
Map<String, PropertyDefinition> testAllProperties = testDef.getAllProperties();
Assert.assertNotNull(testAllProperties);
PropertyDefinition testAllPD = testAllProperties.get(propName);
Assert.assertNotNull(testAllPD);
Assert.assertEquals("Serialized property name does not match", propName, testAllPD.getName());
testDef = testDef.removePropertyDefinition(testPD);
toolkit.writeStructureDefinition(scope, testDef);
testDef = toolkit.lookupStructureDefinitionByName(scope, name);
Assert.assertNotNull(testDef);
testProperties = testDef.getPropertyDefinitions();
Assert.assertNotNull(testProperties);
testPD = testProperties.get(propName);
Assert.assertNull(testPD);
testAllProperties = testDef.getAllProperties();
Assert.assertNotNull(testAllProperties);
testAllPD = testAllProperties.get(propName);
Assert.assertNull(testAllPD);
} | void function() { String name = STR; String propName = name + "-name"; Toolkit toolkit = mToolkit; Scope scope = mScope; Assert.assertNotNull(toolkit); Assert.assertNotNull(scope); StructureDefinition newDef = checkAndCreate(name); PropertyDefinition newPD = toolkit.createNewPropertyDefinition(scope, propName, PropertyType.String); newDef = newDef.addPropertyDefinition(newPD); toolkit.writeStructureDefinition(scope, newDef); StructureDefinition testDef = toolkit.lookupStructureDefinitionByName(scope, name); Assert.assertNotNull(testDef); Map<String, PropertyDefinition> testProperties = testDef.getPropertyDefinitions(); Assert.assertNotNull(testProperties); PropertyDefinition testPD = testProperties.get(propName); Assert.assertNotNull(testPD); Assert.assertEquals(STR, propName, testPD.getName()); Map<String, PropertyDefinition> testAllProperties = testDef.getAllProperties(); Assert.assertNotNull(testAllProperties); PropertyDefinition testAllPD = testAllProperties.get(propName); Assert.assertNotNull(testAllPD); Assert.assertEquals(STR, propName, testAllPD.getName()); testDef = testDef.removePropertyDefinition(testPD); toolkit.writeStructureDefinition(scope, testDef); testDef = toolkit.lookupStructureDefinitionByName(scope, name); Assert.assertNotNull(testDef); testProperties = testDef.getPropertyDefinitions(); Assert.assertNotNull(testProperties); testPD = testProperties.get(propName); Assert.assertNull(testPD); testAllProperties = testDef.getAllProperties(); Assert.assertNotNull(testAllProperties); testAllPD = testAllProperties.get(propName); Assert.assertNull(testAllPD); } | /**
* Test that removing an existing PropertyDefinition survies a write/read
*/ | Test that removing an existing PropertyDefinition survies a write/read | testRemovingPropertyDefinition | {
"repo_name": "diamondq/dq-common-java",
"path": "model/common-model.standard/src/test/java/com/diamondq/adventuretools/model/AbstractStructureDefinitionTests.java",
"license": "apache-2.0",
"size": 11899
} | [
"com.diamondq.common.model.interfaces.PropertyDefinition",
"com.diamondq.common.model.interfaces.PropertyType",
"com.diamondq.common.model.interfaces.Scope",
"com.diamondq.common.model.interfaces.StructureDefinition",
"com.diamondq.common.model.interfaces.Toolkit",
"java.util.Map",
"org.junit.Assert"
] | import com.diamondq.common.model.interfaces.PropertyDefinition; import com.diamondq.common.model.interfaces.PropertyType; import com.diamondq.common.model.interfaces.Scope; import com.diamondq.common.model.interfaces.StructureDefinition; import com.diamondq.common.model.interfaces.Toolkit; import java.util.Map; import org.junit.Assert; | import com.diamondq.common.model.interfaces.*; import java.util.*; import org.junit.*; | [
"com.diamondq.common",
"java.util",
"org.junit"
] | com.diamondq.common; java.util; org.junit; | 246,411 |
public List<String> getKemidsByCampusCode(List<String> campusCodes); | List<String> function(List<String> campusCodes); | /**
* Gets the campus codes, using the campus codes
*
* @param campusCodes
* @return
*/ | Gets the campus codes, using the campus codes | getKemidsByCampusCode | {
"repo_name": "Ariah-Group/Finance",
"path": "af_webapp/src/main/java/org/kuali/kfs/module/endow/dataaccess/KemidBenefittingOrganizationDao.java",
"license": "apache-2.0",
"size": 2757
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 293,545 |
private static List<Object[]> memStoreTSAndTagsCombination() {
List<Object[]> configurations = new ArrayList<>();
configurations.add(new Object[] { false, false });
configurations.add(new Object[] { false, true });
configurations.add(new Object[] { true, false });
configurations.add(new Object[] { true, true });
return Collections.unmodifiableList(configurations);
} | static List<Object[]> function() { List<Object[]> configurations = new ArrayList<>(); configurations.add(new Object[] { false, false }); configurations.add(new Object[] { false, true }); configurations.add(new Object[] { true, false }); configurations.add(new Object[] { true, true }); return Collections.unmodifiableList(configurations); } | /**
* Create combination of memstoreTS and tags
*/ | Create combination of memstoreTS and tags | memStoreTSAndTagsCombination | {
"repo_name": "ndimiduk/hbase",
"path": "hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtil.java",
"license": "apache-2.0",
"size": 151074
} | [
"java.util.ArrayList",
"java.util.Collections",
"java.util.List"
] | import java.util.ArrayList; import java.util.Collections; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 756,798 |
double asum(INDArray x); | double asum(INDArray x); | /**
* Compute || x ||_1 (1-norm, sum of absolute values)
*/ | Compute || x ||_1 (1-norm, sum of absolute values) | asum | {
"repo_name": "phvu/nd4j",
"path": "nd4j-api/src/main/java/org/nd4j/linalg/factory/BlasWrapper.java",
"license": "apache-2.0",
"size": 9818
} | [
"org.nd4j.linalg.api.ndarray.INDArray"
] | import org.nd4j.linalg.api.ndarray.INDArray; | import org.nd4j.linalg.api.ndarray.*; | [
"org.nd4j.linalg"
] | org.nd4j.linalg; | 1,299,073 |
public void initialize(CordovaInterface cordova, CordovaWebView webView) {
} | void function(CordovaInterface cordova, CordovaWebView webView) { } | /**
* Called after plugin construction and fields have been initialized.
* Prefer to use pluginInitialize instead since there is no value in
* having parameters on the initialize() function.
*/ | Called after plugin construction and fields have been initialized. Prefer to use pluginInitialize instead since there is no value in having parameters on the initialize() function | initialize | {
"repo_name": "zendey/Zendey",
"path": "zendey/platforms/android/CordovaLib/src/org/apache/cordova/CordovaPlugin.java",
"license": "gpl-3.0",
"size": 15690
} | [
"org.apache.cordova.CordovaInterface",
"org.apache.cordova.CordovaWebView"
] | import org.apache.cordova.CordovaInterface; import org.apache.cordova.CordovaWebView; | import org.apache.cordova.*; | [
"org.apache.cordova"
] | org.apache.cordova; | 1,249,115 |
public List<ExpectedStudyProject> getAllStudyProjectsByStudy(Long studyId);
| List<ExpectedStudyProject> function(Long studyId); | /**
* This method gets a list of expectedStudyProject by a given projectExpectedStudy identifier.
*
* @param studyId is the projectExpectedStudy identifier.
* @return a list of expectedStudyProject objects.
*/ | This method gets a list of expectedStudyProject by a given projectExpectedStudy identifier | getAllStudyProjectsByStudy | {
"repo_name": "CCAFS/MARLO",
"path": "marlo-data/src/main/java/org/cgiar/ccafs/marlo/data/manager/ExpectedStudyProjectManager.java",
"license": "gpl-3.0",
"size": 3534
} | [
"java.util.List",
"org.cgiar.ccafs.marlo.data.model.ExpectedStudyProject"
] | import java.util.List; import org.cgiar.ccafs.marlo.data.model.ExpectedStudyProject; | import java.util.*; import org.cgiar.ccafs.marlo.data.model.*; | [
"java.util",
"org.cgiar.ccafs"
] | java.util; org.cgiar.ccafs; | 3,381 |
public I_CmsPrincipal lookupPrincipal(CmsRequestContext context, String principalName) {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
I_CmsPrincipal result = null;
try {
result = m_driverManager.lookupPrincipal(dbc, CmsOrganizationalUnit.removeLeadingSeparator(principalName));
} finally {
dbc.clear();
}
return result;
} | I_CmsPrincipal function(CmsRequestContext context, String principalName) { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); I_CmsPrincipal result = null; try { result = m_driverManager.lookupPrincipal(dbc, CmsOrganizationalUnit.removeLeadingSeparator(principalName)); } finally { dbc.clear(); } return result; } | /**
* Lookup and read the user or group with the given name.<p>
*
* @param context the current request context
* @param principalName the name of the principal to lookup
*
* @return the principal (group or user) if found, otherwise <code>null</code>
*/ | Lookup and read the user or group with the given name | lookupPrincipal | {
"repo_name": "sbonoc/opencms-core",
"path": "src/org/opencms/db/CmsSecurityManager.java",
"license": "lgpl-2.1",
"size": 287876
} | [
"org.opencms.file.CmsRequestContext",
"org.opencms.security.CmsOrganizationalUnit",
"org.opencms.security.CmsPrincipal"
] | import org.opencms.file.CmsRequestContext; import org.opencms.security.CmsOrganizationalUnit; import org.opencms.security.CmsPrincipal; | import org.opencms.file.*; import org.opencms.security.*; | [
"org.opencms.file",
"org.opencms.security"
] | org.opencms.file; org.opencms.security; | 2,580,098 |
@SuppressWarnings("unchecked")
public Type setBody(Expression expression) {
SetBodyDefinition answer = new SetBodyDefinition(expression);
addOutput(answer);
return (Type) this;
} | @SuppressWarnings(STR) Type function(Expression expression) { SetBodyDefinition answer = new SetBodyDefinition(expression); addOutput(answer); return (Type) this; } | /**
* <a href="http://camel.apache.org/message-translator.html">Message
* Translator EIP:</a> Adds a processor which sets the body on the IN
* message
*
* @param expression
* the expression used to set the body
* @return the builder
*/ | Message message | setBody | {
"repo_name": "shuliangtao/apache-camel-2.13.0-src",
"path": "camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java",
"license": "apache-2.0",
"size": 138060
} | [
"org.apache.camel.Expression"
] | import org.apache.camel.Expression; | import org.apache.camel.*; | [
"org.apache.camel"
] | org.apache.camel; | 264,730 |
public static void setResult(String key, double _result, String _unit, AggregationPolicy _aggregationPolicy) {
setResult(new ScalarResult(SECONDARY_RESULT_PREFIX + key, _result, _unit, _aggregationPolicy));
} | static void function(String key, double _result, String _unit, AggregationPolicy _aggregationPolicy) { setResult(new ScalarResult(SECONDARY_RESULT_PREFIX + key, _result, _unit, _aggregationPolicy)); } | /**
* Insert the counter value as secondary result. An existing counter value is replaced.
*/ | Insert the counter value as secondary result. An existing counter value is replaced | setResult | {
"repo_name": "headissue/cache2k-benchmark",
"path": "jmh-suite/src/main/java/org/cache2k/benchmark/jmh/MiscResultRecorderProfiler.java",
"license": "gpl-3.0",
"size": 3728
} | [
"org.openjdk.jmh.results.AggregationPolicy",
"org.openjdk.jmh.results.ScalarResult"
] | import org.openjdk.jmh.results.AggregationPolicy; import org.openjdk.jmh.results.ScalarResult; | import org.openjdk.jmh.results.*; | [
"org.openjdk.jmh"
] | org.openjdk.jmh; | 1,540,613 |
public static KeyStructureInfo getKeyStructureInfo(SegmentProperties segmentProperties,
DimColumnResolvedFilterInfo dimColumnEvaluatorInfo) throws KeyGenException {
int colGrpId = getColumnGroupId(segmentProperties, dimColumnEvaluatorInfo.getColumnIndex());
KeyGenerator keyGenerator = segmentProperties.getColumnGroupAndItsKeygenartor().get(colGrpId);
List<Integer> mdKeyOrdinal = new ArrayList<Integer>();
mdKeyOrdinal.add(segmentProperties
.getColumnGroupMdKeyOrdinal(colGrpId, dimColumnEvaluatorInfo.getColumnIndex()));
int[] maskByteRanges = QueryUtil.getMaskedByteRangeBasedOrdinal(mdKeyOrdinal, keyGenerator);
byte[] maxKey = QueryUtil.getMaxKeyBasedOnOrinal(mdKeyOrdinal, keyGenerator);
KeyStructureInfo restructureInfos = new KeyStructureInfo();
restructureInfos.setKeyGenerator(keyGenerator);
restructureInfos.setMaskByteRanges(maskByteRanges);
restructureInfos.setMaxKey(maxKey);
return restructureInfos;
} | static KeyStructureInfo function(SegmentProperties segmentProperties, DimColumnResolvedFilterInfo dimColumnEvaluatorInfo) throws KeyGenException { int colGrpId = getColumnGroupId(segmentProperties, dimColumnEvaluatorInfo.getColumnIndex()); KeyGenerator keyGenerator = segmentProperties.getColumnGroupAndItsKeygenartor().get(colGrpId); List<Integer> mdKeyOrdinal = new ArrayList<Integer>(); mdKeyOrdinal.add(segmentProperties .getColumnGroupMdKeyOrdinal(colGrpId, dimColumnEvaluatorInfo.getColumnIndex())); int[] maskByteRanges = QueryUtil.getMaskedByteRangeBasedOrdinal(mdKeyOrdinal, keyGenerator); byte[] maxKey = QueryUtil.getMaxKeyBasedOnOrinal(mdKeyOrdinal, keyGenerator); KeyStructureInfo restructureInfos = new KeyStructureInfo(); restructureInfos.setKeyGenerator(keyGenerator); restructureInfos.setMaskByteRanges(maskByteRanges); restructureInfos.setMaxKey(maxKey); return restructureInfos; } | /**
* Below method will be used to get the key structure for the column group
*
* @param segmentProperties segment properties
* @param dimColumnEvaluatorInfo dimension evaluator info
* @return key structure info for column group dimension
* @throws KeyGenException
*/ | Below method will be used to get the key structure for the column group | getKeyStructureInfo | {
"repo_name": "mayunSaicmotor/incubator-carbondata",
"path": "core/src/main/java/org/apache/carbondata/core/scan/executor/util/QueryUtil.java",
"license": "apache-2.0",
"size": 40568
} | [
"java.util.ArrayList",
"java.util.List",
"org.apache.carbondata.core.datastore.block.SegmentProperties",
"org.apache.carbondata.core.keygenerator.KeyGenException",
"org.apache.carbondata.core.keygenerator.KeyGenerator",
"org.apache.carbondata.core.scan.executor.infos.KeyStructureInfo",
"org.apache.carbondata.core.scan.filter.resolver.resolverinfo.DimColumnResolvedFilterInfo"
] | import java.util.ArrayList; import java.util.List; import org.apache.carbondata.core.datastore.block.SegmentProperties; import org.apache.carbondata.core.keygenerator.KeyGenException; import org.apache.carbondata.core.keygenerator.KeyGenerator; import org.apache.carbondata.core.scan.executor.infos.KeyStructureInfo; import org.apache.carbondata.core.scan.filter.resolver.resolverinfo.DimColumnResolvedFilterInfo; | import java.util.*; import org.apache.carbondata.core.datastore.block.*; import org.apache.carbondata.core.keygenerator.*; import org.apache.carbondata.core.scan.executor.infos.*; import org.apache.carbondata.core.scan.filter.resolver.resolverinfo.*; | [
"java.util",
"org.apache.carbondata"
] | java.util; org.apache.carbondata; | 922,320 |
FormDataMultiPart localFormData = formData;
if (entity != null && !entity.getDataList().isEmpty()) {
for (int i = 0; i < entity.getDataList().size(); i++) {
int inc = i + 1;
TOneASCreativeAssetsApproveData data = entity.getDataList().get(i);
localFormData = setIsHttps(localFormData, data);
localFormData = setAdvertiserID(localFormData, data);
localFormData = setLandingPage(localFormData, inc, data);
localFormData = setClickURL(localFormData, inc, data);
localFormData = setPrimary(localFormData, inc, data);
localFormData = setBackup(localFormData, inc, data);
localFormData = setConcept(localFormData, inc, data);
}
}
return localFormData;
}
| FormDataMultiPart localFormData = formData; if (entity != null && !entity.getDataList().isEmpty()) { for (int i = 0; i < entity.getDataList().size(); i++) { int inc = i + 1; TOneASCreativeAssetsApproveData data = entity.getDataList().get(i); localFormData = setIsHttps(localFormData, data); localFormData = setAdvertiserID(localFormData, data); localFormData = setLandingPage(localFormData, inc, data); localFormData = setClickURL(localFormData, inc, data); localFormData = setPrimary(localFormData, inc, data); localFormData = setBackup(localFormData, inc, data); localFormData = setConcept(localFormData, inc, data); } } return localFormData; } | /**
* Creates a Multi Part Form object.
*
* @param entity
* expects a TOneASCreativeAssetsApprove entity.
* @param formData
* expects a FormDataMultiPart formData object.
* @return
*/ | Creates a Multi Part Form object | getMultiPartForm | {
"repo_name": "MediaMath/t1-java",
"path": "src/main/java/com/mediamath/terminalone/models/helper/TOneCreativeAssetsApproveHelper.java",
"license": "apache-2.0",
"size": 4853
} | [
"com.mediamath.terminalone.models.TOneASCreativeAssetsApproveData",
"org.glassfish.jersey.media.multipart.FormDataMultiPart"
] | import com.mediamath.terminalone.models.TOneASCreativeAssetsApproveData; import org.glassfish.jersey.media.multipart.FormDataMultiPart; | import com.mediamath.terminalone.models.*; import org.glassfish.jersey.media.multipart.*; | [
"com.mediamath.terminalone",
"org.glassfish.jersey"
] | com.mediamath.terminalone; org.glassfish.jersey; | 121,652 |
public T textSize(float size) {
if (view instanceof TextView) {
TextView tv = (TextView) view;
tv.setTextSize(size);
}
return self();
} | T function(float size) { if (view instanceof TextView) { TextView tv = (TextView) view; tv.setTextSize(size); } return self(); } | /**
* Set the text size (in sp) of a TextView.
*
* @param size size
* @return self
*/ | Set the text size (in sp) of a TextView | textSize | {
"repo_name": "tsdl2013/COCOQuery",
"path": "query/src/main/java/com/cocosw/query/AbstractViewQuery.java",
"license": "apache-2.0",
"size": 31255
} | [
"android.widget.TextView"
] | import android.widget.TextView; | import android.widget.*; | [
"android.widget"
] | android.widget; | 103,273 |
public ColumnMetadata getColumn() {
return m_column;
} | ColumnMetadata function() { return m_column; } | /**
* INTERNAL:
* Used for OX mapping.
*/ | Used for OX mapping | getColumn | {
"repo_name": "RallySoftware/eclipselink.runtime",
"path": "jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/accessors/mappings/BasicAccessor.java",
"license": "epl-1.0",
"size": 23098
} | [
"org.eclipse.persistence.internal.jpa.metadata.columns.ColumnMetadata"
] | import org.eclipse.persistence.internal.jpa.metadata.columns.ColumnMetadata; | import org.eclipse.persistence.internal.jpa.metadata.columns.*; | [
"org.eclipse.persistence"
] | org.eclipse.persistence; | 1,152,288 |
public Link two() {
return two;
} | Link function() { return two; } | /**
* Returns the second link in this bi-link.
*
* @return the second link
*/ | Returns the second link in this bi-link | two | {
"repo_name": "Shashikanth-Huawei/bmp",
"path": "core/api/src/main/java/org/onosproject/ui/topo/BiLink.java",
"license": "apache-2.0",
"size": 2663
} | [
"org.onosproject.net.Link"
] | import org.onosproject.net.Link; | import org.onosproject.net.*; | [
"org.onosproject.net"
] | org.onosproject.net; | 429,990 |
public static List<File> deeplyEnclosedJavaTestFiles(File directory) {
if (!directory.exists())
throw new IllegalArgumentException("directory does not exist: " + directory);
if (!directory.isDirectory())
throw new IllegalArgumentException("found file instead of directory: " + directory);
List<File> javaFiles = new ArrayList<File>(); | static List<File> function(File directory) { if (!directory.exists()) throw new IllegalArgumentException(STR + directory); if (!directory.isDirectory()) throw new IllegalArgumentException(STR + directory); List<File> javaFiles = new ArrayList<File>(); | /**
* Returns all the java files that are descendants of the given directory
*/ | Returns all the java files that are descendants of the given directory | deeplyEnclosedJavaTestFiles | {
"repo_name": "biddyweb/checker-framework",
"path": "framework/src/org/checkerframework/framework/test/TestUtilities.java",
"license": "gpl-2.0",
"size": 6847
} | [
"java.io.File",
"java.util.ArrayList",
"java.util.List"
] | import java.io.File; import java.util.ArrayList; import java.util.List; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 2,872,957 |
@Internal
public void setBrcTop( BorderCode field_37_brcTop )
{
this.field_37_brcTop = field_37_brcTop;
} | void function( BorderCode field_37_brcTop ) { this.field_37_brcTop = field_37_brcTop; } | /**
* Set the brcTop field for the TAP record.
*/ | Set the brcTop field for the TAP record | setBrcTop | {
"repo_name": "lvweiwolf/poi-3.16",
"path": "src/scratchpad/src/org/apache/poi/hwpf/model/types/TAPAbstractType.java",
"license": "apache-2.0",
"size": 73127
} | [
"org.apache.poi.hwpf.usermodel.BorderCode"
] | import org.apache.poi.hwpf.usermodel.BorderCode; | import org.apache.poi.hwpf.usermodel.*; | [
"org.apache.poi"
] | org.apache.poi; | 1,949,986 |
@ApiMethod(name = "getGareByCode", httpMethod = ApiMethod.HttpMethod.GET, path = "getGareByCode")
public Gare getGareByCode(@Named("codeUIC") Integer codeUIC) {
return GareRepository.getInstance().findGareByCode(codeUIC);
} | @ApiMethod(name = STR, httpMethod = ApiMethod.HttpMethod.GET, path = STR) Gare function(@Named(STR) Integer codeUIC) { return GareRepository.getInstance().findGareByCode(codeUIC); } | /**
* Recherche une gare par son codeUIC
*
* @param codeUIC
* le codeUIC d'une gare
* @return la gare ou null
*/ | Recherche une gare par son codeUIC | getGareByCode | {
"repo_name": "Mag-Stellon/dar-transilienupmc",
"path": "src/main/java/com/upmc/transilien/v1/endPoint/GaresEndPoint.java",
"license": "apache-2.0",
"size": 1838
} | [
"com.google.api.server.spi.config.ApiMethod",
"com.google.api.server.spi.config.Named",
"com.upmc.transilien.v1.model.Gare",
"com.upmc.transilien.v1.repository.GareRepository"
] | import com.google.api.server.spi.config.ApiMethod; import com.google.api.server.spi.config.Named; import com.upmc.transilien.v1.model.Gare; import com.upmc.transilien.v1.repository.GareRepository; | import com.google.api.server.spi.config.*; import com.upmc.transilien.v1.model.*; import com.upmc.transilien.v1.repository.*; | [
"com.google.api",
"com.upmc.transilien"
] | com.google.api; com.upmc.transilien; | 866,804 |
protected weka.classifiers.Classifier getBestClassifier(weka.classifiers.Classifier template, weka.classifiers.Classifier trained) {
weka.classifiers.Classifier result;
result = template;
if (m_OutputBestSetup && (m_Folds < 2)) {
try {
if (trained instanceof GridSearch)
result = ObjectCopyHelper.copyObject(((GridSearch) trained).getBestClassifier());
else if (trained instanceof MultiSearch)
result = ObjectCopyHelper.copyObject(((MultiSearch) trained).getBestClassifier());
// TODO: further optimizers
}
catch (Exception e) {
getLogger().log(Level.SEVERE, "Failed to copy best '" + trained.getClass().getName() + "' classifier:", e);
result = template;
}
}
return result;
} | weka.classifiers.Classifier function(weka.classifiers.Classifier template, weka.classifiers.Classifier trained) { weka.classifiers.Classifier result; result = template; if (m_OutputBestSetup && (m_Folds < 2)) { try { if (trained instanceof GridSearch) result = ObjectCopyHelper.copyObject(((GridSearch) trained).getBestClassifier()); else if (trained instanceof MultiSearch) result = ObjectCopyHelper.copyObject(((MultiSearch) trained).getBestClassifier()); } catch (Exception e) { getLogger().log(Level.SEVERE, STR + trained.getClass().getName() + STR, e); result = template; } } return result; } | /**
* In case of GridSearch/MultiSearch the best setup is returned, otherwise
* the classifier itself.
*
* @param template the template classifier
* @param trained the trained classifier
* @return either the best classifier (in case of GridSearch/MultiSearch) or the template
*/ | In case of GridSearch/MultiSearch the best setup is returned, otherwise the classifier itself | getBestClassifier | {
"repo_name": "waikato-datamining/adams-base",
"path": "adams-weka/src/main/java/adams/flow/transformer/WekaClassifierRanker.java",
"license": "gpl-3.0",
"size": 35983
} | [
"java.util.logging.Level"
] | import java.util.logging.Level; | import java.util.logging.*; | [
"java.util"
] | java.util; | 1,642,824 |
List<T> list = new LinkedList<T>(coll);
Collections.sort(list, new UComp<T>());
return list;
} | List<T> list = new LinkedList<T>(coll); Collections.sort(list, new UComp<T>()); return list; } | /** Returns a list containing all the objects from a collection,
in increasing lexicographic order of their string
representations. */ | Returns a list containing all the objects from a collection | sortedCollection | {
"repo_name": "protegeproject/jpaul",
"path": "src/main/java/jpaul/Misc/Debug.java",
"license": "bsd-3-clause",
"size": 1865
} | [
"java.util.Collections",
"java.util.LinkedList",
"java.util.List"
] | import java.util.Collections; import java.util.LinkedList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 579,754 |
@Test
public void setValueAtNotEditable()
{
final String expected = "a";
Object result = _tableModel.getValueAt(0, 1);
assertThat(result, instanceOf(String.class));
assertThat((String)result, is(expected));
// This call fails (silently) because the cell is not editable.
_tableModel.setValueAt("foobar", 0, 1);
result = _tableModel.getValueAt(0, 1);
assertThat(result, instanceOf(String.class));
assertThat((String)result, is(expected));
} | void function() { final String expected = "a"; Object result = _tableModel.getValueAt(0, 1); assertThat(result, instanceOf(String.class)); assertThat((String)result, is(expected)); _tableModel.setValueAt(STR, 0, 1); result = _tableModel.getValueAt(0, 1); assertThat(result, instanceOf(String.class)); assertThat((String)result, is(expected)); } | /**
* Test the <code>setValueAt()</code> method.
*/ | Test the <code>setValueAt()</code> method | setValueAtNotEditable | {
"repo_name": "jmthompson2015/rivalry",
"path": "swingui/src/test/java/org/rivalry/swingui/table/CriterionTableModelTest.java",
"license": "mit",
"size": 4617
} | [
"org.hamcrest.CoreMatchers",
"org.junit.Assert"
] | import org.hamcrest.CoreMatchers; import org.junit.Assert; | import org.hamcrest.*; import org.junit.*; | [
"org.hamcrest",
"org.junit"
] | org.hamcrest; org.junit; | 2,873,765 |
public static String abbreviate(String str, int max) {
str = str.trim();
int len = str.length();
int suffixlength = 20;
if (len <= max) {
return str;
}
suffixlength = Math.min(suffixlength, (max - 3) / 2);
String rev = StringUtils.reverse(str);
// get the last few words
String suffix = WordUtils.abbreviate(rev, 0, suffixlength, "");
suffix = StringUtils.reverse(suffix);
// first few ..
String prefix = StringUtils.abbreviate(str, max - suffix.length());
return prefix + suffix;
}
public static final String NSTR = "";
public static enum StreamStatus {
EOF, TERMINATED
} | static String function(String str, int max) { str = str.trim(); int len = str.length(); int suffixlength = 20; if (len <= max) { return str; } suffixlength = Math.min(suffixlength, (max - 3) / 2); String rev = StringUtils.reverse(str); String suffix = WordUtils.abbreviate(rev, 0, suffixlength, STR"; public static enum StreamStatus { EOF, TERMINATED } | /**
* convert "From src insert blah blah" to "From src insert ... blah"
*/ | convert "From src insert blah blah" to "From src insert ... blah" | abbreviate | {
"repo_name": "WANdisco/amplab-hive",
"path": "ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java",
"license": "apache-2.0",
"size": 137553
} | [
"org.apache.commons.lang.StringUtils",
"org.apache.commons.lang.WordUtils"
] | import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.WordUtils; | import org.apache.commons.lang.*; | [
"org.apache.commons"
] | org.apache.commons; | 2,089,231 |
public boolean find(boolean update) {
BasicDBList list = new BasicDBList();
for (Object pk : getPK()) {
if (pk instanceof String) {
String pks = (String) pk;
if (getField(pks) != null) {
list.add(new BasicDBObject(pks, getField(pks)));
}
} else if (pk instanceof Integer) {
Integer pks = (Integer) pk;
if (getField(pks) != null) {
list.add(new BasicDBObject(String.valueOf(pks), getField(pks)));
}
}
}
if (list.size() == 0)
return false;
DBCursor cursor = getCollection().find(new BasicDBObject("$or", list));
if (cursor.size() > 0) {
if (update) {
mongoDBObject = cursor.next();
}
return true;
} else
return false;
} | boolean function(boolean update) { BasicDBList list = new BasicDBList(); for (Object pk : getPK()) { if (pk instanceof String) { String pks = (String) pk; if (getField(pks) != null) { list.add(new BasicDBObject(pks, getField(pks))); } } else if (pk instanceof Integer) { Integer pks = (Integer) pk; if (getField(pks) != null) { list.add(new BasicDBObject(String.valueOf(pks), getField(pks))); } } } if (list.size() == 0) return false; DBCursor cursor = getCollection().find(new BasicDBObject("$or", list)); if (cursor.size() > 0) { if (update) { mongoDBObject = cursor.next(); } return true; } else return false; } | /**
* Query a object based on the list of PKs.
*
* @param update update object case found.
* @return true case the object is found.
*/ | Query a object based on the list of PKs | find | {
"repo_name": "AKSW/LODVader",
"path": "src/main/java/lodVader/mongodb/DBSuperClass2.java",
"license": "apache-2.0",
"size": 9085
} | [
"com.mongodb.BasicDBList",
"com.mongodb.BasicDBObject",
"com.mongodb.DBCursor"
] | import com.mongodb.BasicDBList; import com.mongodb.BasicDBObject; import com.mongodb.DBCursor; | import com.mongodb.*; | [
"com.mongodb"
] | com.mongodb; | 293,299 |
public synchronized OServerAdmin copyDatabase(final String databaseName, final String iDatabaseUserName,
final String iDatabaseUserPassword, final String iRemoteName, final String iRemoteEngine) throws IOException {
try {
final OChannelBinaryAsynchClient network = storage.beginRequest(OChannelBinaryProtocol.REQUEST_DB_COPY);
try {
network.writeString(databaseName);
network.writeString(iDatabaseUserName);
network.writeString(iDatabaseUserPassword);
network.writeString(iRemoteName);
network.writeString(iRemoteEngine);
} finally {
storage.endRequest(network);
}
storage.getResponse(network);
OLogManager.instance().debug(this, "Database '%s' has been copied to the server '%s'", databaseName, iRemoteName);
} catch (Exception e) {
throw new OStorageException("Cannot copy the database: " + databaseName, e);
}
return this;
}
| synchronized OServerAdmin function(final String databaseName, final String iDatabaseUserName, final String iDatabaseUserPassword, final String iRemoteName, final String iRemoteEngine) throws IOException { try { final OChannelBinaryAsynchClient network = storage.beginRequest(OChannelBinaryProtocol.REQUEST_DB_COPY); try { network.writeString(databaseName); network.writeString(iDatabaseUserName); network.writeString(iDatabaseUserPassword); network.writeString(iRemoteName); network.writeString(iRemoteEngine); } finally { storage.endRequest(network); } storage.getResponse(network); OLogManager.instance().debug(this, STR, databaseName, iRemoteName); } catch (Exception e) { throw new OStorageException(STR + databaseName, e); } return this; } | /**
* Copies a database to a remote server instance.
*
* @param databaseName
* @param iDatabaseUserName
* @param iDatabaseUserPassword
* @param iRemoteName
* @param iRemoteEngine
* @return The instance itself. Useful to execute method in chain
* @throws IOException
*/ | Copies a database to a remote server instance | copyDatabase | {
"repo_name": "sanyaade-g2g-repos/orientdb",
"path": "client/src/main/java/com/orientechnologies/orient/client/remote/OServerAdmin.java",
"license": "apache-2.0",
"size": 20090
} | [
"com.orientechnologies.common.log.OLogManager",
"com.orientechnologies.orient.core.exception.OStorageException",
"com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynchClient",
"com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryProtocol",
"java.io.IOException"
] | import com.orientechnologies.common.log.OLogManager; import com.orientechnologies.orient.core.exception.OStorageException; import com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynchClient; import com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryProtocol; import java.io.IOException; | import com.orientechnologies.common.log.*; import com.orientechnologies.orient.core.exception.*; import com.orientechnologies.orient.enterprise.channel.binary.*; import java.io.*; | [
"com.orientechnologies.common",
"com.orientechnologies.orient",
"java.io"
] | com.orientechnologies.common; com.orientechnologies.orient; java.io; | 2,051,889 |
private Boolean locateNonStrictModuleArtifact(Module module, String sha1, String md5) {
List<Artifact> artifacts = module.getArtifacts();
if (artifacts != null) {
for (Artifact artifact : artifacts) {
String artifactSha1 = artifact.getSha1();
String artifactMd5 = artifact.getMd5();
if (isArtifactMatch(sha1, md5, artifactSha1, artifactMd5)) {
return true;
}
}
}
return false;
} | Boolean function(Module module, String sha1, String md5) { List<Artifact> artifacts = module.getArtifacts(); if (artifacts != null) { for (Artifact artifact : artifacts) { String artifactSha1 = artifact.getSha1(); String artifactMd5 = artifact.getMd5(); if (isArtifactMatch(sha1, md5, artifactSha1, artifactMd5)) { return true; } } } return false; } | /**
* Locates the given modules produced artifact
*
* @param module Module to extract artifact from
* @return Repo path of produced artifact if found. Null if not
*/ | Locates the given modules produced artifact | locateNonStrictModuleArtifact | {
"repo_name": "alancnet/artifactory",
"path": "web/rest-ui/src/main/java/org/artifactory/ui/rest/service/artifacts/browse/treebrowser/tabs/builds/GetArtifactBuildsService.java",
"license": "apache-2.0",
"size": 10066
} | [
"java.util.List",
"org.jfrog.build.api.Artifact",
"org.jfrog.build.api.Module"
] | import java.util.List; import org.jfrog.build.api.Artifact; import org.jfrog.build.api.Module; | import java.util.*; import org.jfrog.build.api.*; | [
"java.util",
"org.jfrog.build"
] | java.util; org.jfrog.build; | 2,319,081 |
protected List<SolutionStep> findAllHiddenXle() {
sudoku = finder.getSudoku();
List<SolutionStep> oldList = steps;
List<SolutionStep> newList = new ArrayList<SolutionStep>();
steps = newList;
List<SolutionStep> tmpSteps = findAllHiddenSingles();
steps.addAll(tmpSteps);
for (int i = 2; i <= 4; i++) {
findHiddenXleInEntity(2 * Sudoku2.UNITS, Sudoku2.BLOCKS, i, false);
findHiddenXleInEntity(0, Sudoku2.LINES, i, false);
findHiddenXleInEntity(Sudoku2.UNITS, Sudoku2.COLS, i, false);
}
Collections.sort(steps);
steps = oldList;
return newList;
} | List<SolutionStep> function() { sudoku = finder.getSudoku(); List<SolutionStep> oldList = steps; List<SolutionStep> newList = new ArrayList<SolutionStep>(); steps = newList; List<SolutionStep> tmpSteps = findAllHiddenSingles(); steps.addAll(tmpSteps); for (int i = 2; i <= 4; i++) { findHiddenXleInEntity(2 * Sudoku2.UNITS, Sudoku2.BLOCKS, i, false); findHiddenXleInEntity(0, Sudoku2.LINES, i, false); findHiddenXleInEntity(Sudoku2.UNITS, Sudoku2.COLS, i, false); } Collections.sort(steps); steps = oldList; return newList; } | /**
* Find all Hidden Subsets in the grid.
* @return
*/ | Find all Hidden Subsets in the grid | findAllHiddenXle | {
"repo_name": "mbraeunlein/ExtendedHodoku",
"path": "src/solver/SimpleSolver.java",
"license": "gpl-3.0",
"size": 46044
} | [
"java.util.ArrayList",
"java.util.Collections",
"java.util.List"
] | import java.util.ArrayList; import java.util.Collections; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,153,101 |
public void install()
{
// the manager is needed by both the participant or the coordinator recovery modules so whichever
// one gets there first creates it. No synchronization is needed as modules are only ever
// installed in a single thread
if (!XTSBARecoveryManagerImple.isRecoveryManagerInitialised()) {
XTSBARecoveryManager baRecoveryManager = new XTSBARecoveryManagerImple(_recoveryStore);
XTSBARecoveryManager.setRecoveryManager(baRecoveryManager);
}
Implementations.install();
} | void function() { if (!XTSBARecoveryManagerImple.isRecoveryManagerInitialised()) { XTSBARecoveryManager baRecoveryManager = new XTSBARecoveryManagerImple(_recoveryStore); XTSBARecoveryManager.setRecoveryManager(baRecoveryManager); } Implementations.install(); } | /**
* called by the service startup code before the recovery module is added to the recovery managers
* module list
*/ | called by the service startup code before the recovery module is added to the recovery managers module list | install | {
"repo_name": "nmcl/scratch",
"path": "graalvm/transactions/fork/narayana/XTS/recovery/src/org/jboss/jbossts/xts/recovery/coordinator/ba/BACoordinatorRecoveryModule.java",
"license": "apache-2.0",
"size": 10472
} | [
"org.jboss.jbossts.xts.recovery.participant.ba.XTSBARecoveryManager",
"org.jboss.jbossts.xts.recovery.participant.ba.XTSBARecoveryManagerImple"
] | import org.jboss.jbossts.xts.recovery.participant.ba.XTSBARecoveryManager; import org.jboss.jbossts.xts.recovery.participant.ba.XTSBARecoveryManagerImple; | import org.jboss.jbossts.xts.recovery.participant.ba.*; | [
"org.jboss.jbossts"
] | org.jboss.jbossts; | 1,873,204 |
@Test
public void testUpdateInstructionsFinishedSoFar_1() throws Exception {
RdaCloudlet cloudlet = new RdaCloudlet(1, 1, 1L, 1L, "src/test/resources/input1.csv",
false);
cloudlet.setInstructionsFinishedSoFar(1L);
long instructionsFinishedSoFar = 2L;
cloudlet.updateInstructionsFinishedSoFar(instructionsFinishedSoFar);
assertEquals(3, cloudlet.getInstructionsFinishedSoFar(), 0);
}
| void function() throws Exception { RdaCloudlet cloudlet = new RdaCloudlet(1, 1, 1L, 1L, STR, false); cloudlet.setInstructionsFinishedSoFar(1L); long instructionsFinishedSoFar = 2L; cloudlet.updateInstructionsFinishedSoFar(instructionsFinishedSoFar); assertEquals(3, cloudlet.getInstructionsFinishedSoFar(), 0); } | /**
* Run the void updateInstructionsFinishedSoFar(long) method test.
*
* @throws Exception
*
* @generatedBy CodePro at 5/11/15 10:59 AM
*/ | Run the void updateInstructionsFinishedSoFar(long) method test | testUpdateInstructionsFinishedSoFar_1 | {
"repo_name": "pattad/cloudsim-rda",
"path": "src/test/java/ch/uzh/ifi/csg/cloudsim/rda/RdaCloudletTest.java",
"license": "gpl-2.0",
"size": 16697
} | [
"ch.uzh.ifi.csg.cloudsim.rda.RdaCloudlet",
"org.junit.Assert"
] | import ch.uzh.ifi.csg.cloudsim.rda.RdaCloudlet; import org.junit.Assert; | import ch.uzh.ifi.csg.cloudsim.rda.*; import org.junit.*; | [
"ch.uzh.ifi",
"org.junit"
] | ch.uzh.ifi; org.junit; | 1,841,901 |
public static String getDetailType(CmsObject cms, CmsResource detailPage, CmsResource parentFolder) {
String type = null;
try {
if (OpenCms.getADEManager().isDetailPage(cms, detailPage)) {
List<CmsDetailPageInfo> detailPages = OpenCms.getADEManager().getRawDetailPages(cms);
if (parentFolder == null) {
parentFolder = cms.readParentFolder(detailPage.getStructureId());
}
for (CmsDetailPageInfo info : detailPages) {
if (info.getId().equals(detailPage.getStructureId())
|| info.getId().equals(parentFolder.getStructureId())) {
type = info.getType();
if (type.startsWith(CmsDetailPageInfo.FUNCTION_PREFIX)) {
type = CmsXmlDynamicFunctionHandler.TYPE_FUNCTION;
}
break;
}
}
}
} catch (CmsException e) {
// parent folder can't be read, ignore
}
return type;
} | static String function(CmsObject cms, CmsResource detailPage, CmsResource parentFolder) { String type = null; try { if (OpenCms.getADEManager().isDetailPage(cms, detailPage)) { List<CmsDetailPageInfo> detailPages = OpenCms.getADEManager().getRawDetailPages(cms); if (parentFolder == null) { parentFolder = cms.readParentFolder(detailPage.getStructureId()); } for (CmsDetailPageInfo info : detailPages) { if (info.getId().equals(detailPage.getStructureId()) info.getId().equals(parentFolder.getStructureId())) { type = info.getType(); if (type.startsWith(CmsDetailPageInfo.FUNCTION_PREFIX)) { type = CmsXmlDynamicFunctionHandler.TYPE_FUNCTION; } break; } } } } catch (CmsException e) { } return type; } | /**
* Returns the detail content type for container pages that may be detail pages.<p>
*
* @param cms the cms context
* @param detailPage the container page resource
* @param parentFolder the parent folder or <code>null</code>
*
* @return the detail content type
*/ | Returns the detail content type for container pages that may be detail pages | getDetailType | {
"repo_name": "alkacon/opencms-core",
"path": "src/org/opencms/ui/components/CmsResourceIcon.java",
"license": "lgpl-2.1",
"size": 19666
} | [
"java.util.List",
"org.opencms.ade.detailpage.CmsDetailPageInfo",
"org.opencms.file.CmsObject",
"org.opencms.file.CmsResource",
"org.opencms.main.CmsException",
"org.opencms.main.OpenCms",
"org.opencms.xml.containerpage.CmsXmlDynamicFunctionHandler"
] | import java.util.List; import org.opencms.ade.detailpage.CmsDetailPageInfo; import org.opencms.file.CmsObject; import org.opencms.file.CmsResource; import org.opencms.main.CmsException; import org.opencms.main.OpenCms; import org.opencms.xml.containerpage.CmsXmlDynamicFunctionHandler; | import java.util.*; import org.opencms.ade.detailpage.*; import org.opencms.file.*; import org.opencms.main.*; import org.opencms.xml.containerpage.*; | [
"java.util",
"org.opencms.ade",
"org.opencms.file",
"org.opencms.main",
"org.opencms.xml"
] | java.util; org.opencms.ade; org.opencms.file; org.opencms.main; org.opencms.xml; | 2,762,306 |
@SuppressWarnings("unchecked")
public HashMap<String, String> getTestMap() {
//return testMap;
return (HashMap<String, String>) testMap.clone();
}
public FinalClassExample(int i, String n, HashMap<String,String> hm){
System.out.println("Performing Deep Copy for Object initialization");
this.id=i;
this.name=n;
HashMap<String,String> tempMap=new HashMap<String,String>();
String key;
Iterator<String> it = hm.keySet().iterator();
while(it.hasNext()){
key=it.next();
tempMap.put(key, hm.get(key));
}
this.testMap=tempMap;
}
| @SuppressWarnings(STR) HashMap<String, String> function() { return (HashMap<String, String>) testMap.clone(); } public FinalClassExample(int i, String n, HashMap<String,String> hm){ System.out.println(STR); this.id=i; this.name=n; HashMap<String,String> tempMap=new HashMap<String,String>(); String key; Iterator<String> it = hm.keySet().iterator(); while(it.hasNext()){ key=it.next(); tempMap.put(key, hm.get(key)); } this.testMap=tempMap; } | /**
* Accessor function for mutable objects
*/ | Accessor function for mutable objects | getTestMap | {
"repo_name": "thekant/myCodeRepo",
"path": "src/com/kant/design/patterns/classes/FinalClassExample.java",
"license": "mit",
"size": 2594
} | [
"java.util.HashMap",
"java.util.Iterator"
] | import java.util.HashMap; import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 2,124,889 |
ServiceResponse<Void> getSwaggerQueryValid(String q1) throws ErrorException, IOException; | ServiceResponse<Void> getSwaggerQueryValid(String q1) throws ErrorException, IOException; | /**
* Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'.
*
* @param q1 An unencoded query parameter with value 'value1&q2=value2&q3=value3'. Possible values for this parameter include: 'value1&q2=value2&q3=value3'
* @throws ErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the ServiceResponse object if successful.
*/ | Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3' | getSwaggerQueryValid | {
"repo_name": "vulcansteel/autorest",
"path": "AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azurespecials/SkipUrlEncodingOperations.java",
"license": "mit",
"size": 10406
} | [
"com.microsoft.rest.ServiceResponse",
"java.io.IOException"
] | import com.microsoft.rest.ServiceResponse; import java.io.IOException; | import com.microsoft.rest.*; import java.io.*; | [
"com.microsoft.rest",
"java.io"
] | com.microsoft.rest; java.io; | 2,674,912 |
public RexLiteral makeApproxLiteral(BigDecimal bd, RelDataType type) {
assert SqlTypeFamily.APPROXIMATE_NUMERIC.getTypeNames().contains(
type.getSqlTypeName());
return makeLiteral(bd, type, SqlTypeName.DOUBLE);
} | RexLiteral function(BigDecimal bd, RelDataType type) { assert SqlTypeFamily.APPROXIMATE_NUMERIC.getTypeNames().contains( type.getSqlTypeName()); return makeLiteral(bd, type, SqlTypeName.DOUBLE); } | /**
* Creates an approximate numeric literal (double or float).
*
* @param bd literal value
* @param type approximate numeric type
* @return new literal
*/ | Creates an approximate numeric literal (double or float) | makeApproxLiteral | {
"repo_name": "b-slim/calcite",
"path": "core/src/main/java/org/apache/calcite/rex/RexBuilder.java",
"license": "apache-2.0",
"size": 51633
} | [
"java.math.BigDecimal",
"org.apache.calcite.rel.type.RelDataType",
"org.apache.calcite.sql.type.SqlTypeFamily",
"org.apache.calcite.sql.type.SqlTypeName"
] | import java.math.BigDecimal; import org.apache.calcite.rel.type.RelDataType; import org.apache.calcite.sql.type.SqlTypeFamily; import org.apache.calcite.sql.type.SqlTypeName; | import java.math.*; import org.apache.calcite.rel.type.*; import org.apache.calcite.sql.type.*; | [
"java.math",
"org.apache.calcite"
] | java.math; org.apache.calcite; | 1,209,849 |
public void valueChanged(ListSelectionEvent e) {
if (!e.getValueIsAdjusting()) {
JList list = (JList) e.getSource();
PreferencesCategory selectedCategory =
(PreferencesCategory) list.getSelectedValue();
if (!builtForms.contains(selectedCategory.getCategoryID())) {
// The selected form has not been built yet so we create it.
PreferencesForm form = new PreferencesForm(selectedCategory);
form.put(DashboardContext.class, dashboardContext);
form.addPropertyChangeListener(this);
restartRequiredSettings.addAll(form.getRequireRestartSettings());
preferencesPanels.add(form.getPanel(), selectedCategory.getCategoryID());
builtForms.add(selectedCategory.getCategoryID());
}
CardLayout layout = (CardLayout) preferencesPanels.getLayout();
layout.show(preferencesPanels, selectedCategory.getCategoryID());
pack();
}
} | void function(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { JList list = (JList) e.getSource(); PreferencesCategory selectedCategory = (PreferencesCategory) list.getSelectedValue(); if (!builtForms.contains(selectedCategory.getCategoryID())) { PreferencesForm form = new PreferencesForm(selectedCategory); form.put(DashboardContext.class, dashboardContext); form.addPropertyChangeListener(this); restartRequiredSettings.addAll(form.getRequireRestartSettings()); preferencesPanels.add(form.getPanel(), selectedCategory.getCategoryID()); builtForms.add(selectedCategory.getCategoryID()); } CardLayout layout = (CardLayout) preferencesPanels.getLayout(); layout.show(preferencesPanels, selectedCategory.getCategoryID()); pack(); } } | /**
* Called when the category is changed
*/ | Called when the category is changed | valueChanged | {
"repo_name": "superzadeh/processdash",
"path": "src/net/sourceforge/processdash/tool/prefs/PreferencesDialog.java",
"license": "gpl-3.0",
"size": 14258
} | [
"java.awt.CardLayout",
"javax.swing.JList",
"javax.swing.event.ListSelectionEvent",
"net.sourceforge.processdash.DashboardContext"
] | import java.awt.CardLayout; import javax.swing.JList; import javax.swing.event.ListSelectionEvent; import net.sourceforge.processdash.DashboardContext; | import java.awt.*; import javax.swing.*; import javax.swing.event.*; import net.sourceforge.processdash.*; | [
"java.awt",
"javax.swing",
"net.sourceforge.processdash"
] | java.awt; javax.swing; net.sourceforge.processdash; | 2,086,985 |
@ApiModelProperty(example = "null", value = "")
public List<OntologyItem> getServiceClasses() {
return serviceClasses;
} | @ApiModelProperty(example = "null", value = "") List<OntologyItem> function() { return serviceClasses; } | /**
* Get serviceClasses
* @return serviceClasses
**/ | Get serviceClasses | getServiceClasses | {
"repo_name": "Metatavu/kunta-api-spec",
"path": "java-client-generated/src/main/java/fi/metatavu/kuntaapi/client/model/Service.java",
"license": "agpl-3.0",
"size": 24169
} | [
"fi.metatavu.kuntaapi.client.model.OntologyItem",
"io.swagger.annotations.ApiModelProperty",
"java.util.List"
] | import fi.metatavu.kuntaapi.client.model.OntologyItem; import io.swagger.annotations.ApiModelProperty; import java.util.List; | import fi.metatavu.kuntaapi.client.model.*; import io.swagger.annotations.*; import java.util.*; | [
"fi.metatavu.kuntaapi",
"io.swagger.annotations",
"java.util"
] | fi.metatavu.kuntaapi; io.swagger.annotations; java.util; | 1,937,680 |
public static Pointer getStdin() {
return Utils.get_stdin();
} | static Pointer function() { return Utils.get_stdin(); } | /**
* Obtain stdin FILE* stream.
*
* @return stdin FILE* stream
*/ | Obtain stdin FILE* stream | getStdin | {
"repo_name": "liyi-david/ePMC",
"path": "plugins/util/src/main/java/epmc/util/JNATools.java",
"license": "gpl-3.0",
"size": 11655
} | [
"com.sun.jna.Pointer"
] | import com.sun.jna.Pointer; | import com.sun.jna.*; | [
"com.sun.jna"
] | com.sun.jna; | 2,450,818 |
public Date getCreateDate(){
Object value = this.source.getProperty( ModuleProperties.CREATE_DATE);
if( value == null )
return Calendar.getInstance().getTime();
return ( Date )value;
}
| Date function(){ Object value = this.source.getProperty( ModuleProperties.CREATE_DATE); if( value == null ) return Calendar.getInstance().getTime(); return ( Date )value; } | /**
* Get the create date
*/ | Get the create date | getCreateDate | {
"repo_name": "chaupal/jp2p",
"path": "Workspace/net.jp2p.container/src/net/jp2p/container/activator/AbstractJp2pService.java",
"license": "apache-2.0",
"size": 5006
} | [
"java.util.Calendar",
"java.util.Date"
] | import java.util.Calendar; import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 2,718,268 |
public void playerLoggedOut(EntityPlayerMP playerIn)
{
playerIn.triggerAchievement(StatList.leaveGameStat);
this.writePlayerData(playerIn);
WorldServer var2 = playerIn.getServerForPlayer();
if (playerIn.ridingEntity != null)
{
var2.removePlayerEntityDangerously(playerIn.ridingEntity);
logger.debug("removing player mount");
}
var2.removeEntity(playerIn);
var2.getPlayerManager().removePlayer(playerIn);
this.playerEntityList.remove(playerIn);
this.field_177454_f.remove(playerIn.getUniqueID());
this.playerStatFiles.remove(playerIn.getUniqueID());
this.sendPacketToAllPlayers(new S38PacketPlayerListItem(S38PacketPlayerListItem.Action.REMOVE_PLAYER, new EntityPlayerMP[] {playerIn}));
} | void function(EntityPlayerMP playerIn) { playerIn.triggerAchievement(StatList.leaveGameStat); this.writePlayerData(playerIn); WorldServer var2 = playerIn.getServerForPlayer(); if (playerIn.ridingEntity != null) { var2.removePlayerEntityDangerously(playerIn.ridingEntity); logger.debug(STR); } var2.removeEntity(playerIn); var2.getPlayerManager().removePlayer(playerIn); this.playerEntityList.remove(playerIn); this.field_177454_f.remove(playerIn.getUniqueID()); this.playerStatFiles.remove(playerIn.getUniqueID()); this.sendPacketToAllPlayers(new S38PacketPlayerListItem(S38PacketPlayerListItem.Action.REMOVE_PLAYER, new EntityPlayerMP[] {playerIn})); } | /**
* Called when a player disconnects from the game. Writes player data to disk and removes them from the world.
*/ | Called when a player disconnects from the game. Writes player data to disk and removes them from the world | playerLoggedOut | {
"repo_name": "Hexeption/Youtube-Hacked-Client-1.8",
"path": "minecraft/net/minecraft/server/management/ServerConfigurationManager.java",
"license": "mit",
"size": 39517
} | [
"net.minecraft.entity.player.EntityPlayerMP",
"net.minecraft.network.play.server.S38PacketPlayerListItem",
"net.minecraft.stats.StatList",
"net.minecraft.world.WorldServer"
] | import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.network.play.server.S38PacketPlayerListItem; import net.minecraft.stats.StatList; import net.minecraft.world.WorldServer; | import net.minecraft.entity.player.*; import net.minecraft.network.play.server.*; import net.minecraft.stats.*; import net.minecraft.world.*; | [
"net.minecraft.entity",
"net.minecraft.network",
"net.minecraft.stats",
"net.minecraft.world"
] | net.minecraft.entity; net.minecraft.network; net.minecraft.stats; net.minecraft.world; | 1,973,088 |
@UiThreadTest
public void testPush() {
GithubEvent event = createEvent(EventType.PushEvent);
PushEventPayload payload = new PushEventPayload();
payload.ref = "refs/heads/master";
event.payload = payload;
updateView(event);
verify("user pushed to master at user/repo");
} | void function() { GithubEvent event = createEvent(EventType.PushEvent); PushEventPayload payload = new PushEventPayload(); payload.ref = STR; event.payload = payload; updateView(event); verify(STR); } | /**
* Verify text of push event
*/ | Verify text of push event | testPush | {
"repo_name": "marceloneil/PocketHub",
"path": "app/src/androidTest/java/com/github/pockethub/tests/NewsEventTextTest.java",
"license": "apache-2.0",
"size": 9525
} | [
"com.alorma.github.sdk.bean.dto.response.GithubEvent",
"com.alorma.github.sdk.bean.dto.response.events.EventType",
"com.alorma.github.sdk.bean.dto.response.events.payload.PushEventPayload"
] | import com.alorma.github.sdk.bean.dto.response.GithubEvent; import com.alorma.github.sdk.bean.dto.response.events.EventType; import com.alorma.github.sdk.bean.dto.response.events.payload.PushEventPayload; | import com.alorma.github.sdk.bean.dto.response.*; import com.alorma.github.sdk.bean.dto.response.events.*; import com.alorma.github.sdk.bean.dto.response.events.payload.*; | [
"com.alorma.github"
] | com.alorma.github; | 1,227,337 |
@Override
protected LI_Source wrap(final Source metadata) {
return new LI_Source(metadata);
} | LI_Source function(final Source metadata) { return new LI_Source(metadata); } | /**
* Invoked by {@link PropertyType} at marshalling time for wrapping the given metadata value
* in a {@code <gmd:LI_Source>} XML element.
*
* @param metadata the metadata element to marshall.
* @return a {@code PropertyType} wrapping the given the metadata element.
*/ | Invoked by <code>PropertyType</code> at marshalling time for wrapping the given metadata value in a XML element | wrap | {
"repo_name": "Geomatys/sis",
"path": "core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/LI_Source.java",
"license": "apache-2.0",
"size": 3147
} | [
"org.opengis.metadata.lineage.Source"
] | import org.opengis.metadata.lineage.Source; | import org.opengis.metadata.lineage.*; | [
"org.opengis.metadata"
] | org.opengis.metadata; | 202,686 |
@Test
public void testRegisteredPrefix() throws Exception {
Log.info(Log.FAC_TEST, "Starting testRegisteredPrefix");
TestInterestHandler tfl = new TestInterestHandler();
TestContentHandler tl = new TestContentHandler();
ContentName testName1 = new ContentName(testPrefix, "foo");
Interest interest1 = new Interest(testName1);
ContentName testName2 = new ContentName(testName1, "bar"); // /foo/bar
Interest interest2 = new Interest(testName2);
ContentName testName3 = new ContentName(testName2, "blaz"); // /foo/bar/blaz
ContentName testName4 = new ContentName(testName2, "xxx"); // /foo/bar/xxx
Interest interest4 = new Interest(testName4);
ContentName testName5 = new ContentName(testPrefix, "zoo"); // /zoo
ContentName testName6 = new ContentName(testName1, "zoo"); // /foo/zoo
ContentName testName7 = new ContentName(testName2, "spaz"); // /foo/bar/spaz
Interest interest6 = new Interest(testName6);
// Test that we don't receive interests above what we registered
gotInterest = false;
putHandle.registerFilter(testName2, tfl);
getHandle.expressInterest(interest1, tl);
Assert.assertFalse(gotInterest);
getHandle.cancelInterest(interest1, tl);
getHandle.expressInterest(interest2, tl);
Assert.assertTrue("Couldn't get semaphore", filterSema.tryAcquire(WAIT_MILLIS, TimeUnit.MILLISECONDS));
getHandle.checkError(TEST_TIMEOUT);
Assert.assertTrue(gotInterest);
getHandle.cancelInterest(interest2, tl);
// Test that an "in-between" prefix gets registered properly
gotInterest = false;
putHandle.getNetworkManager().cancelInterestFilter(testName2, tfl);
putHandle.registerFilter(testName3, tfl);
putHandle.registerFilter(testName4, tfl);
putHandle.registerFilter(testName5, tfl);
putHandle.registerFilter(testName2, tfl);
putHandle.registerFilter(testName1, tfl);
gotInterest = false;
filterSema.drainPermits();
getHandle.expressInterest(interest6, tl);
Assert.assertTrue("Couldn't acquire semaphore", filterSema.tryAcquire(WAIT_MILLIS, TimeUnit.MILLISECONDS));
getHandle.checkError(TEST_TIMEOUT);
Assert.assertTrue(gotInterest);
getHandle.cancelInterest(interest6, tl);
// Make sure that a filter that is a prefix of a registered filter
// doesn't get registered separately.
gotInterest = false;
filterSema.drainPermits();
putHandle.registerFilter(testName7, tfl);
ArrayList<ContentName> prefixes = putHandle.getNetworkManager().getRegisteredPrefixes();
Assert.assertFalse(prefixes.contains(testName7));
getHandle.expressInterest(interest4, tl);
Assert.assertTrue("Couldn't acquire semaphore", filterSema.tryAcquire(WAIT_MILLIS, TimeUnit.MILLISECONDS));
getHandle.checkError(TEST_TIMEOUT);
Assert.assertTrue(gotInterest);
getHandle.cancelInterest(interest4, tl);
gotInterest = false;
filterSema.drainPermits();
getHandle.expressInterest(interest6, tl);
Assert.assertTrue("Couldn't acquire semaphore", filterSema.tryAcquire(WAIT_MILLIS, TimeUnit.MILLISECONDS));
getHandle.checkError(TEST_TIMEOUT);
Assert.assertTrue(gotInterest);
getHandle.cancelInterest(interest6, tl);
putHandle.unregisterFilter(testName1, tfl);
putHandle.unregisterFilter(testName2, tfl);
putHandle.unregisterFilter(testName3, tfl);
putHandle.unregisterFilter(testName5, tfl);
putHandle.unregisterFilter(testName7, tfl);
// Make sure nothing is registered after a /
ContentName slashName = ContentName.fromNative("/");
putHandle.registerFilter(testName1, tfl);
putHandle.registerFilter(slashName, tfl);
putHandle.registerFilter(testName5, tfl);
prefixes = putHandle.getNetworkManager().getRegisteredPrefixes();
Assert.assertFalse(prefixes.contains(testName5));
putHandle.unregisterFilter(testName1, tfl);
putHandle.unregisterFilter(slashName, tfl);
putHandle.unregisterFilter(testName5, tfl);
Log.info(Log.FAC_TEST, "Completed testRegisteredPrefix");
} | void function() throws Exception { Log.info(Log.FAC_TEST, STR); TestInterestHandler tfl = new TestInterestHandler(); TestContentHandler tl = new TestContentHandler(); ContentName testName1 = new ContentName(testPrefix, "foo"); Interest interest1 = new Interest(testName1); ContentName testName2 = new ContentName(testName1, "bar"); Interest interest2 = new Interest(testName2); ContentName testName3 = new ContentName(testName2, "blaz"); ContentName testName4 = new ContentName(testName2, "xxx"); Interest interest4 = new Interest(testName4); ContentName testName5 = new ContentName(testPrefix, "zoo"); ContentName testName6 = new ContentName(testName1, "zoo"); ContentName testName7 = new ContentName(testName2, "spaz"); Interest interest6 = new Interest(testName6); gotInterest = false; putHandle.registerFilter(testName2, tfl); getHandle.expressInterest(interest1, tl); Assert.assertFalse(gotInterest); getHandle.cancelInterest(interest1, tl); getHandle.expressInterest(interest2, tl); Assert.assertTrue(STR, filterSema.tryAcquire(WAIT_MILLIS, TimeUnit.MILLISECONDS)); getHandle.checkError(TEST_TIMEOUT); Assert.assertTrue(gotInterest); getHandle.cancelInterest(interest2, tl); gotInterest = false; putHandle.getNetworkManager().cancelInterestFilter(testName2, tfl); putHandle.registerFilter(testName3, tfl); putHandle.registerFilter(testName4, tfl); putHandle.registerFilter(testName5, tfl); putHandle.registerFilter(testName2, tfl); putHandle.registerFilter(testName1, tfl); gotInterest = false; filterSema.drainPermits(); getHandle.expressInterest(interest6, tl); Assert.assertTrue(STR, filterSema.tryAcquire(WAIT_MILLIS, TimeUnit.MILLISECONDS)); getHandle.checkError(TEST_TIMEOUT); Assert.assertTrue(gotInterest); getHandle.cancelInterest(interest6, tl); gotInterest = false; filterSema.drainPermits(); putHandle.registerFilter(testName7, tfl); ArrayList<ContentName> prefixes = putHandle.getNetworkManager().getRegisteredPrefixes(); Assert.assertFalse(prefixes.contains(testName7)); getHandle.expressInterest(interest4, tl); Assert.assertTrue(STR, filterSema.tryAcquire(WAIT_MILLIS, TimeUnit.MILLISECONDS)); getHandle.checkError(TEST_TIMEOUT); Assert.assertTrue(gotInterest); getHandle.cancelInterest(interest4, tl); gotInterest = false; filterSema.drainPermits(); getHandle.expressInterest(interest6, tl); Assert.assertTrue(STR, filterSema.tryAcquire(WAIT_MILLIS, TimeUnit.MILLISECONDS)); getHandle.checkError(TEST_TIMEOUT); Assert.assertTrue(gotInterest); getHandle.cancelInterest(interest6, tl); putHandle.unregisterFilter(testName1, tfl); putHandle.unregisterFilter(testName2, tfl); putHandle.unregisterFilter(testName3, tfl); putHandle.unregisterFilter(testName5, tfl); putHandle.unregisterFilter(testName7, tfl); ContentName slashName = ContentName.fromNative("/"); putHandle.registerFilter(testName1, tfl); putHandle.registerFilter(slashName, tfl); putHandle.registerFilter(testName5, tfl); prefixes = putHandle.getNetworkManager().getRegisteredPrefixes(); Assert.assertFalse(prefixes.contains(testName5)); putHandle.unregisterFilter(testName1, tfl); putHandle.unregisterFilter(slashName, tfl); putHandle.unregisterFilter(testName5, tfl); Log.info(Log.FAC_TEST, STR); } | /**
* Partially test prefix registration/deregistration
* @throws Exception
*/ | Partially test prefix registration/deregistration | testRegisteredPrefix | {
"repo_name": "MobileCloudNetworking/icnaas",
"path": "mcn-ccn-router/ccnx-0.8.2/javasrc/src/systemtest/org/ccnx/ccn/impl/NetworkTest.java",
"license": "apache-2.0",
"size": 13810
} | [
"java.util.ArrayList",
"java.util.concurrent.TimeUnit",
"org.ccnx.ccn.impl.support.Log",
"org.ccnx.ccn.protocol.ContentName",
"org.ccnx.ccn.protocol.Interest",
"org.junit.Assert"
] | import java.util.ArrayList; import java.util.concurrent.TimeUnit; import org.ccnx.ccn.impl.support.Log; import org.ccnx.ccn.protocol.ContentName; import org.ccnx.ccn.protocol.Interest; import org.junit.Assert; | import java.util.*; import java.util.concurrent.*; import org.ccnx.ccn.impl.support.*; import org.ccnx.ccn.protocol.*; import org.junit.*; | [
"java.util",
"org.ccnx.ccn",
"org.junit"
] | java.util; org.ccnx.ccn; org.junit; | 2,310,041 |
public void setLocation(Location location) {
this.location = location;
} | void function(Location location) { this.location = location; } | /**
* Sets the location to search around. Either the location or the search text (or both) must be specified.
*
* @param location the Location to search around
*/ | Sets the location to search around. Either the location or the search text (or both) must be specified | setLocation | {
"repo_name": "jonathangerbaud/Klyph",
"path": "Klyph/src/com/facebook/widget/KlyphPlacePickerFragment.java",
"license": "mit",
"size": 22294
} | [
"android.location.Location"
] | import android.location.Location; | import android.location.*; | [
"android.location"
] | android.location; | 298,232 |
public static IAtom getClosestAtom(int xPosition, int yPosition, IAtomContainer atomCon) {
IAtom closestAtom = null;
IAtom currentAtom;
double smallestMouseDistance = -1;
double mouseDistance;
double atomX;
double atomY;
for (int i = 0; i < atomCon.getAtomCount(); i++) {
currentAtom = atomCon.getAtom(i);
atomX = currentAtom.getPoint2d().x;
atomY = currentAtom.getPoint2d().y;
mouseDistance = Math.sqrt(Math.pow(atomX - xPosition, 2) + Math.pow(atomY - yPosition, 2));
if (mouseDistance < smallestMouseDistance || smallestMouseDistance == -1) {
smallestMouseDistance = mouseDistance;
closestAtom = currentAtom;
}
}
return closestAtom;
} | static IAtom function(int xPosition, int yPosition, IAtomContainer atomCon) { IAtom closestAtom = null; IAtom currentAtom; double smallestMouseDistance = -1; double mouseDistance; double atomX; double atomY; for (int i = 0; i < atomCon.getAtomCount(); i++) { currentAtom = atomCon.getAtom(i); atomX = currentAtom.getPoint2d().x; atomY = currentAtom.getPoint2d().y; mouseDistance = Math.sqrt(Math.pow(atomX - xPosition, 2) + Math.pow(atomY - yPosition, 2)); if (mouseDistance < smallestMouseDistance smallestMouseDistance == -1) { smallestMouseDistance = mouseDistance; closestAtom = currentAtom; } } return closestAtom; } | /**
* Returns the atom of the given molecule that is closest to the given
* coordinates. See comment for center(IAtomContainer atomCon, Dimension
* areaDim, HashMap renderingCoordinates) for details on coordinate sets
*
* @param xPosition The x coordinate
* @param yPosition The y coordinate
* @param atomCon The molecule that is searched for the closest atom
* @return The atom that is closest to the given coordinates
*/ | Returns the atom of the given molecule that is closest to the given coordinates. See comment for center(IAtomContainer atomCon, Dimension areaDim, HashMap renderingCoordinates) for details on coordinate sets | getClosestAtom | {
"repo_name": "asad/ReactionDecoder",
"path": "src/main/java/uk/ac/ebi/reactionblast/graphics/direct/GeometryTools.java",
"license": "lgpl-3.0",
"size": 74105
} | [
"org.openscience.cdk.interfaces.IAtom",
"org.openscience.cdk.interfaces.IAtomContainer"
] | import org.openscience.cdk.interfaces.IAtom; import org.openscience.cdk.interfaces.IAtomContainer; | import org.openscience.cdk.interfaces.*; | [
"org.openscience.cdk"
] | org.openscience.cdk; | 1,744,158 |
public List<ConnectionMonitorOutput> outputs() {
return this.outputs;
} | List<ConnectionMonitorOutput> function() { return this.outputs; } | /**
* Get list of connection monitor outputs.
*
* @return the outputs value
*/ | Get list of connection monitor outputs | outputs | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_01/implementation/ConnectionMonitorResultInner.java",
"license": "mit",
"size": 10417
} | [
"com.microsoft.azure.management.network.v2020_04_01.ConnectionMonitorOutput",
"java.util.List"
] | import com.microsoft.azure.management.network.v2020_04_01.ConnectionMonitorOutput; import java.util.List; | import com.microsoft.azure.management.network.v2020_04_01.*; import java.util.*; | [
"com.microsoft.azure",
"java.util"
] | com.microsoft.azure; java.util; | 482,511 |
public void setOctetCodec(OctetCodec octetCodec) {
this.octetCodec = octetCodec;
} | void function(OctetCodec octetCodec) { this.octetCodec = octetCodec; } | /**
* Sets the OctetCodec instance used for encoding OCTET.
*
* @param octetCodec
* the OctetCodec instance used for encoding OCTET
*/ | Sets the OctetCodec instance used for encoding OCTET | setOctetCodec | {
"repo_name": "pires/openj21",
"path": "src/main/java/net/openj21/mih/protocol/codec/GenericEncoder.java",
"license": "apache-2.0",
"size": 18798
} | [
"net.openj21.mih.protocol.codec.basic.OctetCodec"
] | import net.openj21.mih.protocol.codec.basic.OctetCodec; | import net.openj21.mih.protocol.codec.basic.*; | [
"net.openj21.mih"
] | net.openj21.mih; | 2,210,457 |
private void doJazziness(View item, int position, int scrollDirection) {
if (mIsScrolling) {
if (mOnlyAnimateNewItems && mAlreadyAnimatedItems.contains(position))
return;
if (mOnlyAnimateOnFling && !mIsFlingEvent)
return;
if (mMaxVelocity > MAX_VELOCITY_OFF && mMaxVelocity < mSpeed)
return;
if (mSimulateGridWithList) {
ViewGroup itemRow = (ViewGroup) item;
for (int i = 0; i < itemRow.getChildCount(); i++)
doJazzinessImpl(itemRow.getChildAt(i), position, scrollDirection);
} else {
doJazzinessImpl(item, position, scrollDirection);
}
mAlreadyAnimatedItems.add(position);
}
} | void function(View item, int position, int scrollDirection) { if (mIsScrolling) { if (mOnlyAnimateNewItems && mAlreadyAnimatedItems.contains(position)) return; if (mOnlyAnimateOnFling && !mIsFlingEvent) return; if (mMaxVelocity > MAX_VELOCITY_OFF && mMaxVelocity < mSpeed) return; if (mSimulateGridWithList) { ViewGroup itemRow = (ViewGroup) item; for (int i = 0; i < itemRow.getChildCount(); i++) doJazzinessImpl(itemRow.getChildAt(i), position, scrollDirection); } else { doJazzinessImpl(item, position, scrollDirection); } mAlreadyAnimatedItems.add(position); } } | /**
* Initializes the item view and triggers the animation.
*
* @param item The view to be animated.
* @param position The index of the view in the list.
* @param scrollDirection Positive number indicating scrolling down, or negative number indicating scrolling up.
*/ | Initializes the item view and triggers the animation | doJazziness | {
"repo_name": "lonfen1108/Coding-Android-master",
"path": "scrollanimationlibrary/src/main/java/com/twotoasters/jazzylistview/JazzyHelper.java",
"license": "mit",
"size": 12125
} | [
"android.view.View",
"android.view.ViewGroup"
] | import android.view.View; import android.view.ViewGroup; | import android.view.*; | [
"android.view"
] | android.view; | 1,315,252 |
public static @Nullable String getViewIdText(AccessibilityNodeInfoCompat node) {
if (node == null) {
return null;
}
String resourceName = node.getViewIdResourceName();
if (resourceName == null) {
return null;
}
String[] parsedResourceName = RESOURCE_NAME_SPLIT_PATTERN.split(resourceName, 2);
if (parsedResourceName.length != 2
|| TextUtils.isEmpty(parsedResourceName[0])
|| TextUtils.isEmpty(parsedResourceName[1])) {
return null;
}
return parsedResourceName[1].replace('_', ' '); // readable View ID text
} | static @Nullable String function(AccessibilityNodeInfoCompat node) { if (node == null) { return null; } String resourceName = node.getViewIdResourceName(); if (resourceName == null) { return null; } String[] parsedResourceName = RESOURCE_NAME_SPLIT_PATTERN.split(resourceName, 2); if (parsedResourceName.length != 2 TextUtils.isEmpty(parsedResourceName[0]) TextUtils.isEmpty(parsedResourceName[1])) { return null; } return parsedResourceName[1].replace('_', ' '); } | /**
* Gets the textual representation of the view ID that can be used when no custom label is
* available. For better readability/listenability, the "_" characters are replaced with spaces.
*
* @param node The node
* @return Readable text of the view Id
*/ | Gets the textual representation of the view ID that can be used when no custom label is available. For better readability/listenability, the "_" characters are replaced with spaces | getViewIdText | {
"repo_name": "google/talkback",
"path": "utils/src/main/java/com/google/android/accessibility/utils/AccessibilityNodeInfoUtils.java",
"license": "apache-2.0",
"size": 105305
} | [
"android.text.TextUtils",
"androidx.core.view.accessibility.AccessibilityNodeInfoCompat",
"org.checkerframework.checker.nullness.qual.Nullable"
] | import android.text.TextUtils; import androidx.core.view.accessibility.AccessibilityNodeInfoCompat; import org.checkerframework.checker.nullness.qual.Nullable; | import android.text.*; import androidx.core.view.accessibility.*; import org.checkerframework.checker.nullness.qual.*; | [
"android.text",
"androidx.core",
"org.checkerframework.checker"
] | android.text; androidx.core; org.checkerframework.checker; | 1,400,553 |
boolean refreshMuteState() {
boolean oldMuteState = mIsMuted;
mIsMuted = mAudioManager.isStreamMute(mStreamType);
if (DEBUG_LEVEL >= 2) Log.i(TAG, "refresh: muted=" + mIsMuted);
return oldMuteState != mIsMuted;
}
private final int mStreamType;
// Cached maximum volume index. Stored as float for easier calculations.
private final float mMaxVolumeIndexAsFloat;
// Cached minimum volume index.
private int mMinVolumeIndex;
// Current volume index. Stored as float for easier calculations.
float mVolumeIndexAsFloat;
boolean mIsMuted;
}
private static final String TAG = "VolumeControlAndroid";
private static final int DEBUG_LEVEL = 0;
// Hidden intent actions of AudioManager.
private static final String VOLUME_CHANGED_ACTION = "android.media.VOLUME_CHANGED_ACTION";
private static final String STREAM_MUTE_CHANGED_ACTION =
"android.media.STREAM_MUTE_CHANGED_ACTION";
private static final String EXTRA_VOLUME_STREAM_TYPE = "android.media.EXTRA_VOLUME_STREAM_TYPE";
// Mapping from Android's stream_type to Cast's AudioContentType (used for callback).
private static final SparseIntArray ANDROID_TYPE_TO_CAST_TYPE_MAP = new SparseIntArray(4) {
{
append(AudioManager.STREAM_MUSIC, AudioContentType.MEDIA);
append(AudioManager.STREAM_ALARM, AudioContentType.ALARM);
append(AudioManager.STREAM_SYSTEM, AudioContentType.COMMUNICATION);
append(AudioManager.STREAM_VOICE_CALL, AudioContentType.OTHER);
}
};
private final long mNativeVolumeControl;
private Context mContext;
private AudioManager mAudioManager;
private BroadcastReceiver mMediaEventIntentListener;
// Mapping from Cast's AudioContentType to their respective Settings instance.
private SparseArray<Settings> mSettings; | boolean refreshMuteState() { boolean oldMuteState = mIsMuted; mIsMuted = mAudioManager.isStreamMute(mStreamType); if (DEBUG_LEVEL >= 2) Log.i(TAG, STR + mIsMuted); return oldMuteState != mIsMuted; } private final int mStreamType; private final float mMaxVolumeIndexAsFloat; private int mMinVolumeIndex; float mVolumeIndexAsFloat; boolean mIsMuted; } private static final String TAG = STR; private static final int DEBUG_LEVEL = 0; private static final String VOLUME_CHANGED_ACTION = STR; private static final String STREAM_MUTE_CHANGED_ACTION = STR; private static final String EXTRA_VOLUME_STREAM_TYPE = STR; private static final SparseIntArray ANDROID_TYPE_TO_CAST_TYPE_MAP = new SparseIntArray(4) { { append(AudioManager.STREAM_MUSIC, AudioContentType.MEDIA); append(AudioManager.STREAM_ALARM, AudioContentType.ALARM); append(AudioManager.STREAM_SYSTEM, AudioContentType.COMMUNICATION); append(AudioManager.STREAM_VOICE_CALL, AudioContentType.OTHER); } }; private final long mNativeVolumeControl; private Context mContext; private AudioManager mAudioManager; private BroadcastReceiver mMediaEventIntentListener; private SparseArray<Settings> mSettings; | /** Refreshes the stored mute state by reading it from AudioManager.
* Returns true if the state changed, false otherwise. */ | Refreshes the stored mute state by reading it from AudioManager | refreshMuteState | {
"repo_name": "chromium/chromium",
"path": "chromecast/media/cma/backend/android/java/src/org/chromium/chromecast/cma/backend/android/VolumeControl.java",
"license": "bsd-3-clause",
"size": 12007
} | [
"android.content.BroadcastReceiver",
"android.content.Context",
"android.media.AudioManager",
"android.util.SparseArray",
"android.util.SparseIntArray",
"org.chromium.base.Log",
"org.chromium.chromecast.media.AudioContentType"
] | import android.content.BroadcastReceiver; import android.content.Context; import android.media.AudioManager; import android.util.SparseArray; import android.util.SparseIntArray; import org.chromium.base.Log; import org.chromium.chromecast.media.AudioContentType; | import android.content.*; import android.media.*; import android.util.*; import org.chromium.base.*; import org.chromium.chromecast.media.*; | [
"android.content",
"android.media",
"android.util",
"org.chromium.base",
"org.chromium.chromecast"
] | android.content; android.media; android.util; org.chromium.base; org.chromium.chromecast; | 573,103 |
public void testPublicCloneable() {
XYSeriesCollection c1 = new XYSeriesCollection();
assertTrue(c1 instanceof PublicCloneable);
} | void function() { XYSeriesCollection c1 = new XYSeriesCollection(); assertTrue(c1 instanceof PublicCloneable); } | /**
* Verify that this class implements {@link PublicCloneable}.
*/ | Verify that this class implements <code>PublicCloneable</code> | testPublicCloneable | {
"repo_name": "integrated/jfreechart",
"path": "tests/org/jfree/data/xy/junit/XYSeriesCollectionTests.java",
"license": "lgpl-2.1",
"size": 8569
} | [
"org.jfree.data.xy.XYSeriesCollection",
"org.jfree.util.PublicCloneable"
] | import org.jfree.data.xy.XYSeriesCollection; import org.jfree.util.PublicCloneable; | import org.jfree.data.xy.*; import org.jfree.util.*; | [
"org.jfree.data",
"org.jfree.util"
] | org.jfree.data; org.jfree.util; | 254,930 |
public static String getPrintingLocale(Partner partner) {
if (partner != null) {
return Beans.get(PartnerServiceImpl.class).getPartnerLanguageCode(partner);
} else {
return Beans.get(UserService.class).getLanguage();
}
} | static String function(Partner partner) { if (partner != null) { return Beans.get(PartnerServiceImpl.class).getPartnerLanguageCode(partner); } else { return Beans.get(UserService.class).getLanguage(); } } | /**
* Get the language select for a partner or current connected user.
*
* @param partner The partner affected. You can pass a new partner to get the default partner
* language. If null, the user language is used.
* @return Partner language selected or User language if no partner is given. Otherwise, english.
*/ | Get the language select for a partner or current connected user | getPrintingLocale | {
"repo_name": "axelor/axelor-business-suite",
"path": "axelor-base/src/main/java/com/axelor/apps/report/engine/ReportSettings.java",
"license": "agpl-3.0",
"size": 7548
} | [
"com.axelor.apps.base.db.Partner",
"com.axelor.apps.base.service.PartnerServiceImpl",
"com.axelor.apps.base.service.user.UserService",
"com.axelor.inject.Beans"
] | import com.axelor.apps.base.db.Partner; import com.axelor.apps.base.service.PartnerServiceImpl; import com.axelor.apps.base.service.user.UserService; import com.axelor.inject.Beans; | import com.axelor.apps.base.db.*; import com.axelor.apps.base.service.*; import com.axelor.apps.base.service.user.*; import com.axelor.inject.*; | [
"com.axelor.apps",
"com.axelor.inject"
] | com.axelor.apps; com.axelor.inject; | 1,214,020 |
public Byte[] getValueAsByteObjectArray() {
return this.getIsNull() ? null : Base64.decodeAsByteObjectArray(this.value);
} | Byte[] function() { return this.getIsNull() ? null : Base64.decodeAsByteObjectArray(this.value); } | /**
* Gets the value of this {@link EntityProperty} as a <code>Byte</code> array.
*
* @return
* A <code>Byte[]</code> representation of the {@link EntityProperty} value, or <code>null</code>.
*/ | Gets the value of this <code>EntityProperty</code> as a <code>Byte</code> array | getValueAsByteObjectArray | {
"repo_name": "risezhang/azure-storage-cli",
"path": "src/main/java/com/microsoft/azure/storage/table/EntityProperty.java",
"license": "mit",
"size": 27532
} | [
"com.microsoft.azure.storage.core.Base64"
] | import com.microsoft.azure.storage.core.Base64; | import com.microsoft.azure.storage.core.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 275,058 |
void addTab(SlidingTabSpec newTab) {
BackgroundImage bgImg = new BackgroundImage(mContext, mNumTabs, newTab);
final int drawableWidth = bgImg.getDrawable().getIntrinsicWidth();
final int drawableHeight = bgImg.getDrawable().getIntrinsicHeight();
final int hPadding = Math.round((float)(mSeparationWidth - drawableWidth) / 2.0f);
final int vPadding = Math.round((float)((int)(SCROLLBAR_HEIGHT * sScale) - drawableHeight) / 2.0f);
bgImg.setOverlayIconResource(newTab.getBigIconResource());
final int sliderWidth = mSlider.getBackground().getIntrinsicWidth() - 2 * SHADOW_PADDING;
final int borderVPadding = (int) Math.floor((float)(sliderWidth - drawableWidth) / 2.0f);
if (mNumTabs == 0) {
bgImg.setPadding(borderVPadding, vPadding, hPadding, 0);
mSlider.setImageResource(newTab.getActiveIconResource());
mInverseSliderWidth += (borderVPadding + drawableWidth + hPadding);
} else {
if (mNumTabs > 1) {
BackgroundImage lastTab = (BackgroundImage)mInverseSliderBackground.getChildAt(mNumTabs - 1);
mInverseSliderWidth += (lastTab.getPaddingLeft() - lastTab.getPaddingRight());
lastTab.setPadding(lastTab.getPaddingLeft(), lastTab.getPaddingTop(), lastTab.getPaddingLeft(), 0);
}
mInverseSliderWidth += (hPadding + drawableWidth + borderVPadding);
bgImg.setPadding(hPadding, vPadding, borderVPadding, 0);
}
if (bgImg.getLayoutParams() == null) {
final LinearLayout.LayoutParams lp = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, 1.0f);
lp.setMargins(0, 0, 0, 0);
bgImg.setLayoutParams(lp);
}
| void addTab(SlidingTabSpec newTab) { BackgroundImage bgImg = new BackgroundImage(mContext, mNumTabs, newTab); final int drawableWidth = bgImg.getDrawable().getIntrinsicWidth(); final int drawableHeight = bgImg.getDrawable().getIntrinsicHeight(); final int hPadding = Math.round((float)(mSeparationWidth - drawableWidth) / 2.0f); final int vPadding = Math.round((float)((int)(SCROLLBAR_HEIGHT * sScale) - drawableHeight) / 2.0f); bgImg.setOverlayIconResource(newTab.getBigIconResource()); final int sliderWidth = mSlider.getBackground().getIntrinsicWidth() - 2 * SHADOW_PADDING; final int borderVPadding = (int) Math.floor((float)(sliderWidth - drawableWidth) / 2.0f); if (mNumTabs == 0) { bgImg.setPadding(borderVPadding, vPadding, hPadding, 0); mSlider.setImageResource(newTab.getActiveIconResource()); mInverseSliderWidth += (borderVPadding + drawableWidth + hPadding); } else { if (mNumTabs > 1) { BackgroundImage lastTab = (BackgroundImage)mInverseSliderBackground.getChildAt(mNumTabs - 1); mInverseSliderWidth += (lastTab.getPaddingLeft() - lastTab.getPaddingRight()); lastTab.setPadding(lastTab.getPaddingLeft(), lastTab.getPaddingTop(), lastTab.getPaddingLeft(), 0); } mInverseSliderWidth += (hPadding + drawableWidth + borderVPadding); bgImg.setPadding(hPadding, vPadding, borderVPadding, 0); } if (bgImg.getLayoutParams() == null) { final LinearLayout.LayoutParams lp = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, 1.0f); lp.setMargins(0, 0, 0, 0); bgImg.setLayoutParams(lp); } | /**
* Adds a new tab and sets the correct paddings defined by the
* separation width.
* @param newTab
*/ | Adds a new tab and sets the correct paddings defined by the separation width | addTab | {
"repo_name": "star-app/xbmc-remote-control",
"path": "src/org/xbmc/android/widget/slidingtabs/SlidingTabWidget.java",
"license": "gpl-2.0",
"size": 18709
} | [
"android.view.ViewGroup",
"android.widget.LinearLayout",
"org.xbmc.android.widget.slidingtabs.SlidingTabHost"
] | import android.view.ViewGroup; import android.widget.LinearLayout; import org.xbmc.android.widget.slidingtabs.SlidingTabHost; | import android.view.*; import android.widget.*; import org.xbmc.android.widget.slidingtabs.*; | [
"android.view",
"android.widget",
"org.xbmc.android"
] | android.view; android.widget; org.xbmc.android; | 210,757 |
@Override
public void logProcessingStage(MessageContext ctx, LoggingHandlerStage stage) throws ServiceException {
} | void function(MessageContext ctx, LoggingHandlerStage stage) throws ServiceException { } | /**
* Log processing stage.
*
* @param ctx
* the ctx
* @param stage
* the stage
* @throws ServiceException
* the service exception
* @see org.ebayopensource.turmeric.runtime.common.pipeline.LoggingHandler#logProcessingStage(org.ebayopensource.turmeric.runtime.common.pipeline.MessageContext,
* org.ebayopensource.turmeric.runtime.common.pipeline.LoggingHandlerStage)
*/ | Log processing stage | logProcessingStage | {
"repo_name": "ebayopensource/turmeric-runtime",
"path": "logging-handler-cassandra/src/main/java/org/ebayopensource/turmeric/runtime/error/cassandra/handler/CassandraErrorLoggingHandler.java",
"license": "apache-2.0",
"size": 12016
} | [
"org.ebayopensource.turmeric.runtime.common.exceptions.ServiceException",
"org.ebayopensource.turmeric.runtime.common.pipeline.LoggingHandlerStage",
"org.ebayopensource.turmeric.runtime.common.pipeline.MessageContext"
] | import org.ebayopensource.turmeric.runtime.common.exceptions.ServiceException; import org.ebayopensource.turmeric.runtime.common.pipeline.LoggingHandlerStage; import org.ebayopensource.turmeric.runtime.common.pipeline.MessageContext; | import org.ebayopensource.turmeric.runtime.common.exceptions.*; import org.ebayopensource.turmeric.runtime.common.pipeline.*; | [
"org.ebayopensource.turmeric"
] | org.ebayopensource.turmeric; | 2,196,787 |
List<Field> result = Lists.newArrayList();
Class c = clazz;
while (c != null) {
for (Field declaredField : c.getDeclaredFields()) {
if (!Modifier.isPublic(declaredField.getModifiers())) {
if (forceAccess) {
declaredField.setAccessible(true);//NOSONAR only works from sufficiently privileged code
} else {
continue;
}
}
result.add(declaredField);
}
c = c.getSuperclass();
}
for (Object anInterface : ClassUtils.getAllInterfaces(clazz)) {
Collections.addAll(result, ((Class) anInterface).getDeclaredFields());
}
return result;
} | List<Field> result = Lists.newArrayList(); Class c = clazz; while (c != null) { for (Field declaredField : c.getDeclaredFields()) { if (!Modifier.isPublic(declaredField.getModifiers())) { if (forceAccess) { declaredField.setAccessible(true); } else { continue; } } result.add(declaredField); } c = c.getSuperclass(); } for (Object anInterface : ClassUtils.getAllInterfaces(clazz)) { Collections.addAll(result, ((Class) anInterface).getDeclaredFields()); } return result; } | /**
* Get accessible <code>Field</code> breaking scope if requested. Superclasses/interfaces are considered.
*
* @param clazz the class to reflect, must not be null
* @param forceAccess whether to break scope restrictions using the <code>setAccessible</code> method.
* <code>False</code> only matches public fields.
*/ | Get accessible <code>Field</code> breaking scope if requested. Superclasses/interfaces are considered | getFields | {
"repo_name": "jmecosta/sonar",
"path": "sonar-plugin-api/src/main/java/org/sonar/api/utils/FieldUtils2.java",
"license": "lgpl-3.0",
"size": 2347
} | [
"com.google.common.collect.Lists",
"java.lang.reflect.Field",
"java.lang.reflect.Modifier",
"java.util.Collections",
"java.util.List",
"org.apache.commons.lang.ClassUtils"
] | import com.google.common.collect.Lists; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.Collections; import java.util.List; import org.apache.commons.lang.ClassUtils; | import com.google.common.collect.*; import java.lang.reflect.*; import java.util.*; import org.apache.commons.lang.*; | [
"com.google.common",
"java.lang",
"java.util",
"org.apache.commons"
] | com.google.common; java.lang; java.util; org.apache.commons; | 933,631 |
public boolean hasPropValue(String propType, String propValue) {
if (otherProperties == null) {
return false;
}
for (Map.Entry<String, String> kv: otherProperties.entrySet()) {
if (propType.equals(kv.getKey())) {
if (propValue == null) {
return true;
}
if (propValue.equals(kv.getValue())) {
return true;
}
}
}
return false;
} | boolean function(String propType, String propValue) { if (otherProperties == null) { return false; } for (Map.Entry<String, String> kv: otherProperties.entrySet()) { if (propType.equals(kv.getKey())) { if (propValue == null) { return true; } if (propValue.equals(kv.getValue())) { return true; } } } return false; } | /**
* Ask property type has value.
*
* @param propType property type to ask
* @param propValue property value to be equal
* @return true property of the type has the value
*/ | Ask property type has value | hasPropValue | {
"repo_name": "miurahr/tmpotter",
"path": "src/main/java/org/tmpotter/core/TmxEntry.java",
"license": "gpl-3.0",
"size": 3559
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,659,825 |
@MXBeanDescription("String presentation of the start timestamp.")
public String getStartTimestampFormatted(); | @MXBeanDescription(STR) String function(); | /**
* Gets string presentation of the start timestamp.
*
* @return String presentation of the start timestamp.
*/ | Gets string presentation of the start timestamp | getStartTimestampFormatted | {
"repo_name": "pperalta/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiManagementMBean.java",
"license": "apache-2.0",
"size": 2653
} | [
"org.apache.ignite.mxbean.MXBeanDescription"
] | import org.apache.ignite.mxbean.MXBeanDescription; | import org.apache.ignite.mxbean.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 180,921 |
public static String generateLoadReportURLDownloadDispatch( HttpServletRequest request, String reportId )
{
return generateLoadReportURL( request, reportId, XDocProcessServletConstants.DOWNLOAD_DISPATCH );
} | static String function( HttpServletRequest request, String reportId ) { return generateLoadReportURL( request, reportId, XDocProcessServletConstants.DOWNLOAD_DISPATCH ); } | /**
* Generate URL to call loadReport servlet to download original document archive from the report.
*
* <pre>
* ex : http://localhost:8080/xdocreport-webapp/loadReport?reportId=$reportId&dispatch=download
* </pre>
*
* @param request
* @param reportId
* @param dispatch
* @return
*/ | Generate URL to call loadReport servlet to download original document archive from the report. <code> ex : HREF </code> | generateLoadReportURLDownloadDispatch | {
"repo_name": "xiaoguiguiaichixiaomomo/Learning",
"path": "word报表生成/xdocreport.samples-master/demo-webapp/src/main/java/fr/opensagres/xdocreport/webapp/utils/HTMLUtils.java",
"license": "mit",
"size": 22982
} | [
"fr.opensagres.xdocreport.document.web.XDocProcessServletConstants",
"javax.servlet.http.HttpServletRequest"
] | import fr.opensagres.xdocreport.document.web.XDocProcessServletConstants; import javax.servlet.http.HttpServletRequest; | import fr.opensagres.xdocreport.document.web.*; import javax.servlet.http.*; | [
"fr.opensagres.xdocreport",
"javax.servlet"
] | fr.opensagres.xdocreport; javax.servlet; | 420,760 |
private void shortenFields(Idea idea) {
if (null != idea) {
idea.setTitle(StringUtils.abbreviate(idea.getTitle(), 50));
idea.setDescription(StringUtils.abbreviate(idea.getDescription(), 150));
}
} | void function(Idea idea) { if (null != idea) { idea.setTitle(StringUtils.abbreviate(idea.getTitle(), 50)); idea.setDescription(StringUtils.abbreviate(idea.getDescription(), 150)); } } | /**
* Shortens the length of title and description fields
*
* @param idea
*/ | Shortens the length of title and description fields | shortenFields | {
"repo_name": "akrain/thoughtsite",
"path": "src/main/java/com/google/ie/common/builder/IdeaBuilder.java",
"license": "apache-2.0",
"size": 10732
} | [
"com.google.ie.business.domain.Idea",
"org.apache.commons.lang.StringUtils"
] | import com.google.ie.business.domain.Idea; import org.apache.commons.lang.StringUtils; | import com.google.ie.business.domain.*; import org.apache.commons.lang.*; | [
"com.google.ie",
"org.apache.commons"
] | com.google.ie; org.apache.commons; | 2,389,473 |
public CmsUUID getEntryId() {
return m_entryId;
} | CmsUUID function() { return m_entryId; } | /**
* Returns the entry id.<p>
*
* @return the entry id
*/ | Returns the entry id | getEntryId | {
"repo_name": "alkacon/opencms-core",
"path": "src-gwt/org/opencms/ade/sitemap/client/CmsSitemapTreeItem.java",
"license": "lgpl-2.1",
"size": 33865
} | [
"org.opencms.util.CmsUUID"
] | import org.opencms.util.CmsUUID; | import org.opencms.util.*; | [
"org.opencms.util"
] | org.opencms.util; | 2,596,294 |
public List<Group> getGroupsToSynchronize(PerunSession sess) throws InternalErrorException {
try {
// Get all groups which have defined
return jdbc.query("select " + groupMappingSelectQuery + " from groups, attr_names, group_attr_values " +
"where attr_names.attr_name=? and attr_names.id=group_attr_values.attr_id and group_attr_values.attr_value='true' and " +
"group_attr_values.group_id=groups.id", GROUP_MAPPER, GroupsManager.GROUPSYNCHROENABLED_ATTRNAME);
} catch (EmptyResultDataAccessException e) {
return new ArrayList<Group>();
} catch (RuntimeException e) {
throw new InternalErrorException(e);
}
} | List<Group> function(PerunSession sess) throws InternalErrorException { try { return jdbc.query(STR + groupMappingSelectQuery + STR + STR + STR, GROUP_MAPPER, GroupsManager.GROUPSYNCHROENABLED_ATTRNAME); } catch (EmptyResultDataAccessException e) { return new ArrayList<Group>(); } catch (RuntimeException e) { throw new InternalErrorException(e); } } | /**
* Gets all groups which have enabled synchronization.
*
* @param sess
* @return list of groups to synchronize
* @throws InternalErrorException
*/ | Gets all groups which have enabled synchronization | getGroupsToSynchronize | {
"repo_name": "Simcsa/perun",
"path": "perun-core/src/main/java/cz/metacentrum/perun/core/impl/GroupsManagerImpl.java",
"license": "bsd-2-clause",
"size": 33106
} | [
"cz.metacentrum.perun.core.api.Group",
"cz.metacentrum.perun.core.api.GroupsManager",
"cz.metacentrum.perun.core.api.PerunSession",
"cz.metacentrum.perun.core.api.exceptions.InternalErrorException",
"java.util.ArrayList",
"java.util.List",
"org.springframework.dao.EmptyResultDataAccessException"
] | import cz.metacentrum.perun.core.api.Group; import cz.metacentrum.perun.core.api.GroupsManager; import cz.metacentrum.perun.core.api.PerunSession; import cz.metacentrum.perun.core.api.exceptions.InternalErrorException; import java.util.ArrayList; import java.util.List; import org.springframework.dao.EmptyResultDataAccessException; | import cz.metacentrum.perun.core.api.*; import cz.metacentrum.perun.core.api.exceptions.*; import java.util.*; import org.springframework.dao.*; | [
"cz.metacentrum.perun",
"java.util",
"org.springframework.dao"
] | cz.metacentrum.perun; java.util; org.springframework.dao; | 577,455 |
public static Name
fromAddress(String addr, int family) throws UnknownHostException {
byte [] array = Address.toByteArray(addr, family);
if (array == null)
throw new UnknownHostException("Invalid IP address");
return fromAddress(array);
} | static Name function(String addr, int family) throws UnknownHostException { byte [] array = Address.toByteArray(addr, family); if (array == null) throw new UnknownHostException(STR); return fromAddress(array); } | /**
* Creates a reverse map name corresponding to an address contained in
* a String.
* @param addr The address from which to build a name.
* @return The name corresponding to the address in the reverse map.
* @throws UnknownHostException The string does not contain a valid address.
*/ | Creates a reverse map name corresponding to an address contained in a String | fromAddress | {
"repo_name": "Jimmy-Gao/browsermob-proxy",
"path": "src/main/java/org/xbill/DNS/ReverseMap.java",
"license": "apache-2.0",
"size": 4003
} | [
"java.net.UnknownHostException"
] | import java.net.UnknownHostException; | import java.net.*; | [
"java.net"
] | java.net; | 1,336,049 |
EReference getAssignmentExpression_LeftExpr(); | EReference getAssignmentExpression_LeftExpr(); | /**
* Returns the meta object for the containment reference '{@link org.eclipse.xtext.testlanguages.backtracking.beeLangTestLanguage.AssignmentExpression#getLeftExpr <em>Left Expr</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference '<em>Left Expr</em>'.
* @see org.eclipse.xtext.testlanguages.backtracking.beeLangTestLanguage.AssignmentExpression#getLeftExpr()
* @see #getAssignmentExpression()
* @generated
*/ | Returns the meta object for the containment reference '<code>org.eclipse.xtext.testlanguages.backtracking.beeLangTestLanguage.AssignmentExpression#getLeftExpr Left Expr</code>'. | getAssignmentExpression_LeftExpr | {
"repo_name": "miklossy/xtext-core",
"path": "org.eclipse.xtext.testlanguages/src-gen/org/eclipse/xtext/testlanguages/backtracking/beeLangTestLanguage/BeeLangTestLanguagePackage.java",
"license": "epl-1.0",
"size": 161651
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 682,259 |
public JSONObject refViewRetrieveJSON(ContextualisedStorage storage,CSPRequestCredentials creds,CSPRequestCache cache,String path, JSONObject restrictions) throws ExistException,UnimplementedException, UnderlyingStorageException, JSONException, UnsupportedEncodingException {
try {
JSONObject out=new JSONObject();
JSONObject pagination=new JSONObject();
JSONObject listitems = new JSONObject();
//not all the records need a reference, look in cspace-config.xml for which that don't
if(r.hasTermsUsed()){
path = getRestrictedPath(path, restrictions,"kw", "", false, "");
if(r.hasSoftDeleteMethod()){//XXX completely not the right thinsg to do but a good enough hack
path = softpath(path);
}
if(r.hasHierarchyUsed("screen")){
path = hierarchicalpath(path);
}
ReturnedDocument all = conn.getXMLDocument(RequestMethod.GET,path,null,creds,cache);
if(all.getStatus()!=200)
throw new ConnectionException("Bad request during identifier cache map update: status not 200",all.getStatus(),path);
Document list=all.getDocument();
//assumes consistency in service layer payloads - possible could configure this rather than hard code?
List<Node> nodes=list.selectNodes("authority-ref-list
data.put("sourceFieldselector", fieldinstance.getSelector());
data.put("sourceFieldName", fieldName);
data.put("sourceFieldType", r.getID());
if(listitems.has(key)){
JSONArray temp = listitems.getJSONArray(key).put(data);
listitems.put(key,temp);
}
else{
JSONArray temp = new JSONArray();
temp.put(data);
listitems.put(key,temp);
}
}
}
}
else{
pagination.put(node.getName(), node.getText());
}
}
}
out.put("pagination", pagination);
out.put("listItems", listitems);
return out;
} catch (ConnectionException e) {
throw new UnderlyingStorageException("Connection problem"+e.getLocalizedMessage(),e.getStatus(),e.getUrl(),e);
}
} | JSONObject function(ContextualisedStorage storage,CSPRequestCredentials creds,CSPRequestCache cache,String path, JSONObject restrictions) throws ExistException,UnimplementedException, UnderlyingStorageException, JSONException, UnsupportedEncodingException { try { JSONObject out=new JSONObject(); JSONObject pagination=new JSONObject(); JSONObject listitems = new JSONObject(); if(r.hasTermsUsed()){ path = getRestrictedPath(path, restrictions,"kw", STRSTRscreenSTRBad request during identifier cache map update: status not 200STRauthority-ref-list data.put(STR, fieldinstance.getSelector()); data.put(STR, fieldName); data.put(STR, r.getID()); if(listitems.has(key)){ JSONArray temp = listitems.getJSONArray(key).put(data); listitems.put(key,temp); } else{ JSONArray temp = new JSONArray(); temp.put(data); listitems.put(key,temp); } } } } else{ pagination.put(node.getName(), node.getText()); } } } out.put(STR, pagination); out.put(STR, listitems); return out; } catch (ConnectionException e) { throw new UnderlyingStorageException(STR+e.getLocalizedMessage(),e.getStatus(),e.getUrl(),e); } } | /**
* get data needed for terms Used block of a record
* @param creds
* @param cache
* @param path
* @return
* @throws ExistException
* @throws UnimplementedException
* @throws UnderlyingStorageException
* @throws JSONException
* @throws UnsupportedEncodingException
*/ | get data needed for terms Used block of a record | refViewRetrieveJSON | {
"repo_name": "cherryhill/collectionspace-application",
"path": "cspi-services/src/main/java/org/collectionspace/chain/csp/persistence/services/GenericStorage.java",
"license": "apache-2.0",
"size": 93300
} | [
"java.io.UnsupportedEncodingException",
"org.collectionspace.chain.csp.persistence.services.connection.ConnectionException",
"org.collectionspace.csp.api.core.CSPRequestCache",
"org.collectionspace.csp.api.core.CSPRequestCredentials",
"org.collectionspace.csp.api.persistence.ExistException",
"org.collectionspace.csp.api.persistence.UnderlyingStorageException",
"org.collectionspace.csp.api.persistence.UnimplementedException",
"org.collectionspace.csp.helper.persistence.ContextualisedStorage",
"org.json.JSONArray",
"org.json.JSONException",
"org.json.JSONObject"
] | import java.io.UnsupportedEncodingException; import org.collectionspace.chain.csp.persistence.services.connection.ConnectionException; import org.collectionspace.csp.api.core.CSPRequestCache; import org.collectionspace.csp.api.core.CSPRequestCredentials; import org.collectionspace.csp.api.persistence.ExistException; import org.collectionspace.csp.api.persistence.UnderlyingStorageException; import org.collectionspace.csp.api.persistence.UnimplementedException; import org.collectionspace.csp.helper.persistence.ContextualisedStorage; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; | import java.io.*; import org.collectionspace.chain.csp.persistence.services.connection.*; import org.collectionspace.csp.api.core.*; import org.collectionspace.csp.api.persistence.*; import org.collectionspace.csp.helper.persistence.*; import org.json.*; | [
"java.io",
"org.collectionspace.chain",
"org.collectionspace.csp",
"org.json"
] | java.io; org.collectionspace.chain; org.collectionspace.csp; org.json; | 1,472,954 |
public synchronized void removeAppFromRegistry(ApplicationId appId) {
Map<String, Token<AMRMTokenIdentifier>> subClusterTokenMap =
this.appSubClusterTokenMap.get(appId);
LOG.info("Removing all registry entries for {}", appId);
if (subClusterTokenMap == null || subClusterTokenMap.size() == 0) {
return;
}
// Lastly remove the application directory
String key = getRegistryKey(appId, null);
try {
removeKeyRegistry(this.registry, this.user, key, true, true);
subClusterTokenMap.clear();
} catch (YarnException e) {
LOG.error("Failed removing registry directory key " + key, e);
}
} | synchronized void function(ApplicationId appId) { Map<String, Token<AMRMTokenIdentifier>> subClusterTokenMap = this.appSubClusterTokenMap.get(appId); LOG.info(STR, appId); if (subClusterTokenMap == null subClusterTokenMap.size() == 0) { return; } String key = getRegistryKey(appId, null); try { removeKeyRegistry(this.registry, this.user, key, true, true); subClusterTokenMap.clear(); } catch (YarnException e) { LOG.error(STR + key, e); } } | /**
* Remove an application from registry.
*
* @param appId application id
*/ | Remove an application from registry | removeAppFromRegistry | {
"repo_name": "mapr/hadoop-common",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/federation/utils/FederationRegistryClient.java",
"license": "apache-2.0",
"size": 11583
} | [
"java.util.Map",
"org.apache.hadoop.security.token.Token",
"org.apache.hadoop.yarn.api.records.ApplicationId",
"org.apache.hadoop.yarn.exceptions.YarnException",
"org.apache.hadoop.yarn.security.AMRMTokenIdentifier"
] | import java.util.Map; import org.apache.hadoop.security.token.Token; import org.apache.hadoop.yarn.api.records.ApplicationId; import org.apache.hadoop.yarn.exceptions.YarnException; import org.apache.hadoop.yarn.security.AMRMTokenIdentifier; | import java.util.*; import org.apache.hadoop.security.token.*; import org.apache.hadoop.yarn.api.records.*; import org.apache.hadoop.yarn.exceptions.*; import org.apache.hadoop.yarn.security.*; | [
"java.util",
"org.apache.hadoop"
] | java.util; org.apache.hadoop; | 993,408 |
private void sendResponse( String status, String mime, Properties header, InputStream data )
{
try
{
if ( status == null )
throw new Error( "sendResponse(): Status can't be null." );
OutputStream out = mySocket.getOutputStream();
PrintWriter pw = new PrintWriter( out );
pw.print("HTTP/1.0 " + status + " \r\n");
if ( mime != null )
pw.print("Content-Type: " + mime + "\r\n");
if ( header == null || header.getProperty( "Date" ) == null )
pw.print( "Date: " + gmtFrmt.format( new Date()) + "\r\n");
if ( header != null )
{
Enumeration e = header.keys();
while ( e.hasMoreElements())
{
String key = (String)e.nextElement();
String value = header.getProperty( key );
pw.print( key + ": " + value + "\r\n");
}
}
pw.print("\r\n");
pw.flush();
if ( data != null )
{
byte[] buff = new byte[2048];
while (true)
{
int read = data.read( buff, 0, 2048 );
if (read <= 0)
break;
out.write( buff, 0, read );
}
}
out.flush();
out.close();
if ( data != null )
data.close();
}
catch( IOException ioe )
{
// Couldn't write? No can do.
try { mySocket.close(); } catch( Throwable t ) {}
}
}
private Socket mySocket;
} | void function( String status, String mime, Properties header, InputStream data ) { try { if ( status == null ) throw new Error( STR ); OutputStream out = mySocket.getOutputStream(); PrintWriter pw = new PrintWriter( out ); pw.print(STR + status + STR); if ( mime != null ) pw.print(STR + mime + "\r\n"); if ( header == null header.getProperty( "Date" ) == null ) pw.print( STR + gmtFrmt.format( new Date()) + "\r\n"); if ( header != null ) { Enumeration e = header.keys(); while ( e.hasMoreElements()) { String key = (String)e.nextElement(); String value = header.getProperty( key ); pw.print( key + STR + value + "\r\n"); } } pw.print("\r\n"); pw.flush(); if ( data != null ) { byte[] buff = new byte[2048]; while (true) { int read = data.read( buff, 0, 2048 ); if (read <= 0) break; out.write( buff, 0, read ); } } out.flush(); out.close(); if ( data != null ) data.close(); } catch( IOException ioe ) { try { mySocket.close(); } catch( Throwable t ) {} } } private Socket mySocket; } | /**
* Sends given response to the socket.
*/ | Sends given response to the socket | sendResponse | {
"repo_name": "s373/s373-processing-libs",
"path": "apache/src/s373/apache/NanoHTTPD.java",
"license": "lgpl-2.1",
"size": 30675
} | [
"java.io.IOException",
"java.io.InputStream",
"java.io.OutputStream",
"java.io.PrintWriter",
"java.net.Socket",
"java.util.Date",
"java.util.Enumeration",
"java.util.Properties"
] | import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import java.net.Socket; import java.util.Date; import java.util.Enumeration; import java.util.Properties; | import java.io.*; import java.net.*; import java.util.*; | [
"java.io",
"java.net",
"java.util"
] | java.io; java.net; java.util; | 133,322 |
@Override()
public java.lang.Class<?> getJavaClass(
) {
return org.opennms.netmgt.config.threshd.ThresholdingConfig.class;
} | @Override() java.lang.Class<?> function( ) { return org.opennms.netmgt.config.threshd.ThresholdingConfig.class; } | /**
* Method getJavaClass.
*
* @return the Java class represented by this descriptor.
*/ | Method getJavaClass | getJavaClass | {
"repo_name": "vishwaAbhinav/OpenNMS",
"path": "opennms-config/target/generated-sources/castor/org/opennms/netmgt/config/threshd/descriptors/ThresholdingConfigDescriptor.java",
"license": "gpl-2.0",
"size": 6138
} | [
"org.opennms.netmgt.config.threshd.ThresholdingConfig"
] | import org.opennms.netmgt.config.threshd.ThresholdingConfig; | import org.opennms.netmgt.config.threshd.*; | [
"org.opennms.netmgt"
] | org.opennms.netmgt; | 919,371 |
public void testFailedFuture_null() {
try {
CompletableFuture<Integer> f = CompletableFuture.failedFuture(null);
shouldThrow();
} catch (NullPointerException success) {}
} | void function() { try { CompletableFuture<Integer> f = CompletableFuture.failedFuture(null); shouldThrow(); } catch (NullPointerException success) {} } | /**
* failedFuture(null) throws NPE
*/ | failedFuture(null) throws NPE | testFailedFuture_null | {
"repo_name": "google/desugar_jdk_libs",
"path": "jdk11/src/libcore/ojluni/src/test/java/util/concurrent/tck/CompletableFutureTest.java",
"license": "gpl-2.0",
"size": 182910
} | [
"java.util.concurrent.CompletableFuture"
] | import java.util.concurrent.CompletableFuture; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 114,315 |
@Test
public void whenKingWayUpLeftOutputCorrectThenTrue() throws ImpossibleMoveException {
Board board = new Board();
Figure figure = new King('C', 3);
board.addFigures(figure);
Cell cellDist = new Cell('D', 4);
Cell[] result = figure.way(cellDist);
Cell[] expected = new Cell[1];
expected[0] = new Cell('D', 4);
assertThat(result[0].getHorizontal(), is(expected[0].getHorizontal()));
assertThat(result[0].getVertical(), is(expected[0].getVertical()));
} | void function() throws ImpossibleMoveException { Board board = new Board(); Figure figure = new King('C', 3); board.addFigures(figure); Cell cellDist = new Cell('D', 4); Cell[] result = figure.way(cellDist); Cell[] expected = new Cell[1]; expected[0] = new Cell('D', 4); assertThat(result[0].getHorizontal(), is(expected[0].getHorizontal())); assertThat(result[0].getVertical(), is(expected[0].getVertical())); } | /**
* 6.4.5 Test King exception way Up Left.
* @throws ImpossibleMoveException Impossible Move figure.
*/ | 6.4.5 Test King exception way Up Left | whenKingWayUpLeftOutputCorrectThenTrue | {
"repo_name": "rvkhaustov/rkhaustov",
"path": "chapter_002/src/test/java/ru/rkhaustov/chess/BoardTest.java",
"license": "apache-2.0",
"size": 34285
} | [
"org.hamcrest.core.Is",
"org.junit.Assert"
] | import org.hamcrest.core.Is; import org.junit.Assert; | import org.hamcrest.core.*; import org.junit.*; | [
"org.hamcrest.core",
"org.junit"
] | org.hamcrest.core; org.junit; | 170,896 |
public static List<AbstractWarningsParser> getParsers(final String group) {
return getParsers(Collections.singleton(group));
} | static List<AbstractWarningsParser> function(final String group) { return getParsers(Collections.singleton(group)); } | /**
* Returns a list of parsers that match the specified group name. Note that the
* mapping of groups to parsers is one to many.
*
* @param group
* the parser group
* @return a list of parsers, might be modified by the receiver
*/ | Returns a list of parsers that match the specified group name. Note that the mapping of groups to parsers is one to many | getParsers | {
"repo_name": "recena/warnings-plugin",
"path": "src/main/java/hudson/plugins/warnings/parser/ParserRegistry.java",
"license": "mit",
"size": 12649
} | [
"java.util.Collections",
"java.util.List"
] | import java.util.Collections; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,676,413 |
private long makeDate(int day) {
cal.set((Calendar.DAY_OF_YEAR), day);
return cal.getTime().getTime();
} | long function(int day) { cal.set((Calendar.DAY_OF_YEAR), day); return cal.getTime().getTime(); } | /**
* Little utility for making up java.util.Dates for different days, just
* to generate test data.
*/ | Little utility for making up java.util.Dates for different days, just to generate test data | makeDate | {
"repo_name": "racker/omnibus",
"path": "source/db-5.0.26.NC/examples_java/src/persist/EventExample.java",
"license": "apache-2.0",
"size": 15076
} | [
"java.util.Calendar"
] | import java.util.Calendar; | import java.util.*; | [
"java.util"
] | java.util; | 460,058 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.