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 void flushImages() { for (DcField field : getFields()) { if (field.getValueType() == DcRepository.ValueTypes._PICTURE) { Picture picture = (Picture) getValue(field.getIndex()); if (picture != null) { DcImageIcon icon = (DcImageIcon) pict...
void function() { for (DcField field : getFields()) { if (field.getValueType() == DcRepository.ValueTypes._PICTURE) { Picture picture = (Picture) getValue(field.getIndex()); if (picture != null) { DcImageIcon icon = (DcImageIcon) picture.getValue(Picture._D_IMAGE); if (icon != null) icon.flush(); } } } }
/** * Frees the resources hold by this items pictures. */
Frees the resources hold by this items pictures
flushImages
{ "repo_name": "alexeq/datacrown", "path": "datacrow-core/_source/net/datacrow/core/objects/DcObject.java", "license": "gpl-3.0", "size": 55666 }
[ "net.datacrow.core.DcRepository" ]
import net.datacrow.core.DcRepository;
import net.datacrow.core.*;
[ "net.datacrow.core" ]
net.datacrow.core;
1,042,260
public static String replaceFirst(CharSequence receiver, Pattern pattern, Function<Matcher, String> replacementBuilder) { Matcher m = pattern.matcher(receiver); if (false == m.find()) { // CharSequqence's toString is *supposed* to always return the characters in the sequence as a String ...
static String function(CharSequence receiver, Pattern pattern, Function<Matcher, String> replacementBuilder) { Matcher m = pattern.matcher(receiver); if (false == m.find()) { return receiver.toString(); } StringBuffer result = new StringBuffer(initialBufferForReplaceWith(receiver)); m.appendReplacement(result, Matcher....
/** * Replace the first match. Similar to {@link Matcher#replaceFirst(String)} but allows you to customize the replacement based on the * match. */
Replace the first match. Similar to <code>Matcher#replaceFirst(String)</code> but allows you to customize the replacement based on the match
replaceFirst
{ "repo_name": "sreeramjayan/elasticsearch", "path": "modules/lang-painless/src/main/java/org/elasticsearch/painless/Augmentation.java", "license": "apache-2.0", "size": 17954 }
[ "java.util.function.Function", "java.util.regex.Matcher", "java.util.regex.Pattern" ]
import java.util.function.Function; import java.util.regex.Matcher; import java.util.regex.Pattern;
import java.util.function.*; import java.util.regex.*;
[ "java.util" ]
java.util;
2,025,436
ConnectionStatisticsEntity getConnectionStatistics(String connectionId);
ConnectionStatisticsEntity getConnectionStatistics(String connectionId);
/** * Gets analytical statistics for the specified connection. * * @param connectionId connection * @return statistics */
Gets analytical statistics for the specified connection
getConnectionStatistics
{ "repo_name": "mans2singh/nifi", "path": "nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiServiceFacade.java", "license": "apache-2.0", "size": 84641 }
[ "org.apache.nifi.web.api.entity.ConnectionStatisticsEntity" ]
import org.apache.nifi.web.api.entity.ConnectionStatisticsEntity;
import org.apache.nifi.web.api.entity.*;
[ "org.apache.nifi" ]
org.apache.nifi;
1,377,060
final String executorNode = response.getExecutorNodeName(); synchronized (responseLock) { if (!responses.containsKey(executorNode)) { ODistributedServerLog.warn(this, response.getSenderNodeName(), executorNode, DIRECTION.IN, "received response for request (%s) from unexpected node. E...
final String executorNode = response.getExecutorNodeName(); synchronized (responseLock) { if (!responses.containsKey(executorNode)) { ODistributedServerLog.warn(this, response.getSenderNodeName(), executorNode, DIRECTION.IN, STR, request, getExpectedNodes()); Orient.instance().getProfiler() .updateCounter(STR, STR, +1)...
/** * Not synchronized, it's called when a message arrives * * @param response * Received response to collect * @return True if all the nodes responded, otherwise false */
Not synchronized, it's called when a message arrives
collectResponse
{ "repo_name": "jdillon/orientdb", "path": "server/src/main/java/com/orientechnologies/orient/server/distributed/ODistributedResponseManager.java", "license": "apache-2.0", "size": 23932 }
[ "com.orientechnologies.common.collection.OMultiValue", "com.orientechnologies.orient.core.Orient", "java.util.ArrayList", "java.util.Collection", "java.util.List" ]
import com.orientechnologies.common.collection.OMultiValue; import com.orientechnologies.orient.core.Orient; import java.util.ArrayList; import java.util.Collection; import java.util.List;
import com.orientechnologies.common.collection.*; import com.orientechnologies.orient.core.*; import java.util.*;
[ "com.orientechnologies.common", "com.orientechnologies.orient", "java.util" ]
com.orientechnologies.common; com.orientechnologies.orient; java.util;
2,271,207
public final MetaProperty<Double> putAmount() { return _putAmount; }
final MetaProperty<Double> function() { return _putAmount; }
/** * The meta-property for the {@code putAmount} property. * @return the meta-property, not null */
The meta-property for the putAmount property
putAmount
{ "repo_name": "jeorme/OG-Platform", "path": "projects/OG-FinancialTypes/src/main/java/com/opengamma/financial/security/option/NonDeliverableFXOptionSecurity.java", "license": "apache-2.0", "size": 24557 }
[ "org.joda.beans.MetaProperty" ]
import org.joda.beans.MetaProperty;
import org.joda.beans.*;
[ "org.joda.beans" ]
org.joda.beans;
1,905,390
protected void extractPayments(boolean immediateOnly, Date processRunDate) { LOG.debug("extractPayments() started"); Person uuser = getPersonService().getPersonByPrincipalName(KFSConstants.SYSTEM_USER); if (uuser == null) { LOG.error("extractPayments() Unable to find user " + KF...
void function(boolean immediateOnly, Date processRunDate) { LOG.debug(STR); Person uuser = getPersonService().getPersonByPrincipalName(KFSConstants.SYSTEM_USER); if (uuser == null) { LOG.error(STR + KFSConstants.SYSTEM_USER); throw new IllegalArgumentException(STR + KFSConstants.SYSTEM_USER); } List<String> campusesToP...
/** * Extracts payments from the database * * @param immediateOnly whether to pick up immediate payments only * @param processRunDate time/date to use to put on the {@link Batch} that's created; and when immediateOnly is false, is also * used as the maximum allowed PREQ pay date when sea...
Extracts payments from the database
extractPayments
{ "repo_name": "Ariah-Group/Finance", "path": "af_webapp/src/main/java/org/kuali/kfs/module/purap/service/impl/PdpExtractServiceImpl.java", "license": "apache-2.0", "size": 53829 }
[ "java.util.Date", "java.util.List", "org.kuali.kfs.sys.KFSConstants", "org.kuali.rice.kim.api.identity.Person" ]
import java.util.Date; import java.util.List; import org.kuali.kfs.sys.KFSConstants; import org.kuali.rice.kim.api.identity.Person;
import java.util.*; import org.kuali.kfs.sys.*; import org.kuali.rice.kim.api.identity.*;
[ "java.util", "org.kuali.kfs", "org.kuali.rice" ]
java.util; org.kuali.kfs; org.kuali.rice;
500,834
public Builder setEnvironment(Map<String, String> environment) { this.environment = ImmutableMap.copyOf(environment); this.useDefaultShellEnvironment = false; return this; }
Builder function(Map<String, String> environment) { this.environment = ImmutableMap.copyOf(environment); this.useDefaultShellEnvironment = false; return this; }
/** * Sets the map of environment variables. Do not use! This makes the builder ignore the * 'default shell environment', which is computed from the --action_env command line option. */
Sets the map of environment variables. Do not use! This makes the builder ignore the 'default shell environment', which is computed from the --action_env command line option
setEnvironment
{ "repo_name": "damienmg/bazel", "path": "src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnAction.java", "license": "apache-2.0", "size": 55262 }
[ "com.google.common.collect.ImmutableMap", "java.util.Map" ]
import com.google.common.collect.ImmutableMap; import java.util.Map;
import com.google.common.collect.*; import java.util.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
1,993,421
public boolean validateNumber_Pattern(BigInteger number, DiagnosticChain diagnostics, Map<Object, Object> context) { return validatePattern(XhtmlPackage.Literals.NUMBER, number, NUMBER__PATTERN__VALUES, diagnostics, context); } public static final BigInteger NUMBER__MAX__VALUE = new BigInteger("100");
boolean function(BigInteger number, DiagnosticChain diagnostics, Map<Object, Object> context) { return validatePattern(XhtmlPackage.Literals.NUMBER, number, NUMBER__PATTERN__VALUES, diagnostics, context); } public static final BigInteger NUMBER__MAX__VALUE = new BigInteger("100");
/** * Validates the Pattern constraint of '<em>Number</em>'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
Validates the Pattern constraint of 'Number'.
validateNumber_Pattern
{ "repo_name": "drbgfc/mdht", "path": "hl7/plugins/org.openhealthtools.mdht.emf.hl7.mif2/src/org/openhealthtools/mdht/emf/w3c/xhtml/util/XhtmlValidator.java", "license": "epl-1.0", "size": 48254 }
[ "java.math.BigInteger", "java.util.Map", "org.eclipse.emf.common.util.DiagnosticChain", "org.openhealthtools.mdht.emf.w3c.xhtml.XhtmlPackage" ]
import java.math.BigInteger; import java.util.Map; import org.eclipse.emf.common.util.DiagnosticChain; import org.openhealthtools.mdht.emf.w3c.xhtml.XhtmlPackage;
import java.math.*; import java.util.*; import org.eclipse.emf.common.util.*; import org.openhealthtools.mdht.emf.w3c.xhtml.*;
[ "java.math", "java.util", "org.eclipse.emf", "org.openhealthtools.mdht" ]
java.math; java.util; org.eclipse.emf; org.openhealthtools.mdht;
524,129
private void cleanupPackedInputFiles(ModuleInstance instance) { for(InstanceInput ii : instance.inputs()){ String currentInputFileName = ii.name(); File fi = new File(currentInputFileName); if(fi.isFile()) fi.delete(); } for(InstanceOutput ii : instance.outputs()){ String currentOutputFileName ...
void function(ModuleInstance instance) { for(InstanceInput ii : instance.inputs()){ String currentInputFileName = ii.name(); File fi = new File(currentInputFileName); if(fi.isFile()) fi.delete(); } for(InstanceOutput ii : instance.outputs()){ String currentOutputFileName = ii.name(); File fi = new File(currentOutputFil...
/** * Cleaning up files created in previous dumps. * @param instance */
Cleaning up files created in previous dumps
cleanupPackedInputFiles
{ "repo_name": "Data2Semantics/ducktape", "path": "src/main/java/org/data2semantics/platform/domain/PythonDomain.java", "license": "mit", "size": 8049 }
[ "java.io.File", "org.data2semantics.platform.core.ModuleInstance", "org.data2semantics.platform.core.data.InstanceInput", "org.data2semantics.platform.core.data.InstanceOutput" ]
import java.io.File; import org.data2semantics.platform.core.ModuleInstance; import org.data2semantics.platform.core.data.InstanceInput; import org.data2semantics.platform.core.data.InstanceOutput;
import java.io.*; import org.data2semantics.platform.core.*; import org.data2semantics.platform.core.data.*;
[ "java.io", "org.data2semantics.platform" ]
java.io; org.data2semantics.platform;
1,110,210
try (InputStream is = Main.class.getResourceAsStream("/samplemachine.xml")) { SCXMLEngine scxmlEngine = new SCXMLEngine(); scxmlEngine.setModelByInputFileStream(is); scxmlEngine.setBootstrapMin(1); String masterURL = "local[5]"; //String masterURL =...
try (InputStream is = Main.class.getResourceAsStream(STR)) { SCXMLEngine scxmlEngine = new SCXMLEngine(); scxmlEngine.setModelByInputFileStream(is); scxmlEngine.setBootstrapMin(1); String masterURL = STR; final String[] outTemplate = new String[]{STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR}; SparkDistrib...
/** * Entry point for the example. * @param argv Command-line arguments for the example * @throws IOException IO Exception */
Entry point for the example
main
{ "repo_name": "Brijeshrpatel9/DataGeneratorFinal", "path": "dg-spark/src/main/java/org/finra/datagenerator/Main.java", "license": "apache-2.0", "size": 2024 }
[ "java.io.InputStream", "org.finra.datagenerator.engine.scxml.SCXMLEngine" ]
import java.io.InputStream; import org.finra.datagenerator.engine.scxml.SCXMLEngine;
import java.io.*; import org.finra.datagenerator.engine.scxml.*;
[ "java.io", "org.finra.datagenerator" ]
java.io; org.finra.datagenerator;
1,699,608
@VisibleForTesting static Map<String, String> getLocalAppEngineEnvironmentVariables(String gaeRuntime) { Map<String, String> environment = Maps.newHashMap(); String gaeEnv = "localdev"; environment.put("GAE_ENV", gaeEnv); environment.put("GAE_RUNTIME", gaeRuntime); return environment; }
static Map<String, String> getLocalAppEngineEnvironmentVariables(String gaeRuntime) { Map<String, String> environment = Maps.newHashMap(); String gaeEnv = STR; environment.put(STR, gaeEnv); environment.put(STR, gaeRuntime); return environment; }
/** * Gets a {@code Map<String, String>} of the environment variables for running the {@link * DevServer}. * * @param gaeRuntime the runtime ID to set the environment variable GAE_RUNTIME to * @return {@code Map<String, String>} that maps from the environment variable name to its value */
Gets a Map of the environment variables for running the <code>DevServer</code>
getLocalAppEngineEnvironmentVariables
{ "repo_name": "GoogleCloudPlatform/appengine-plugins-core", "path": "src/main/java/com/google/cloud/tools/appengine/operations/DevServer.java", "license": "apache-2.0", "size": 10815 }
[ "com.google.common.collect.Maps", "java.util.Map" ]
import com.google.common.collect.Maps; import java.util.Map;
import com.google.common.collect.*; import java.util.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
2,266,569
private void setColors() { switch(colorIndex) { case 0: overlayColor = Color.white; geomColor = Color.magenta; break; case 1: overlayColor = Color.magenta; geomColor = Color.white; break; case 2: overlayColor = Color.red; geomColor = Color.green; break; case ...
void function() { switch(colorIndex) { case 0: overlayColor = Color.white; geomColor = Color.magenta; break; case 1: overlayColor = Color.magenta; geomColor = Color.white; break; case 2: overlayColor = Color.red; geomColor = Color.green; break; case 3: overlayColor = Color.red; geomColor = Color.white; break; } }
/** * Used to set the colors for overlay and geometry * */
Used to set the colors for overlay and geometry
setColors
{ "repo_name": "TomyLobo/Slick", "path": "src/main/java/org/newdawn/slick/tests/GeomAccuracyTest.java", "license": "bsd-3-clause", "size": 7011 }
[ "org.newdawn.slick.Color" ]
import org.newdawn.slick.Color;
import org.newdawn.slick.*;
[ "org.newdawn.slick" ]
org.newdawn.slick;
238,200
public List<FeatureVec> extractFeaturesConllOnly(String conllFile, boolean train) { List<FeatureVec> instances = new ArrayList<FeatureVec>(); List<PltagExample> conllExamples = Utils.readConllExamples(conllFile); for(PltagExample ex : conllExamples) { try ...
List<FeatureVec> function(String conllFile, boolean train) { List<FeatureVec> instances = new ArrayList<FeatureVec>(); List<PltagExample> conllExamples = Utils.readConllExamples(conllFile); for(PltagExample ex : conllExamples) { try { ConllExample conllEx = new ConllExample(conllFile, ex.getGoldStandard(), opts, featur...
/** * Extract features using only bilexical information, between predicate and argument (and their relative position). * We can cheaply train this model relying on information from the CoNLL training file, and * avoid the much more costly solution of parsing sections 02-21 of WSJ. * @param conllFile...
Extract features using only bilexical information, between predicate and argument (and their relative position). We can cheaply train this model relying on information from the CoNLL training file, and avoid the much more costly solution of parsing sections 02-21 of WSJ
extractFeaturesConllOnly
{ "repo_name": "sinantie/PLTAG", "path": "src/pltag/parser/semantics/classifier/ArgumentClassifier.java", "license": "gpl-3.0", "size": 32382 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,594,958
@Test public void testBug1832432() throws CloneNotSupportedException { TimeSeries s1 = new TimeSeries("Series"); TimeSeries s2 = (TimeSeries) s1.clone(); assertNotSame(s1, s2); assertSame(s1.getClass(), s2.getClass()); assertEquals(s1, s2); // test in...
void function() throws CloneNotSupportedException { TimeSeries s1 = new TimeSeries(STR); TimeSeries s2 = (TimeSeries) s1.clone(); assertNotSame(s1, s2); assertSame(s1.getClass(), s2.getClass()); assertEquals(s1, s2); s1.add(new Day(1, 1, 2007), 100.0); assertFalse(s1.equals(s2)); }
/** * A test for bug 1832432. */
A test for bug 1832432
testBug1832432
{ "repo_name": "greearb/jfreechart-fse-ct", "path": "src/test/java/org/jfree/data/time/TimeSeriesTest.java", "license": "lgpl-2.1", "size": 36986 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
1,308,933
private static BundleEntryComponent medicationClaim(RandomNumberGenerator rand, BundleEntryComponent personEntry, Bundle bundle, BundleEntryComponent encounterEntry, Claim claim, BundleEntryComponent medicationEntry) { org.hl7.fhir.dstu3.model.Claim claimResource = new org.hl7.fhir.dstu3.model...
static BundleEntryComponent function(RandomNumberGenerator rand, BundleEntryComponent personEntry, Bundle bundle, BundleEntryComponent encounterEntry, Claim claim, BundleEntryComponent medicationEntry) { org.hl7.fhir.dstu3.model.Claim claimResource = new org.hl7.fhir.dstu3.model.Claim(); org.hl7.fhir.dstu3.model.Encoun...
/** * Create an entry for the given Claim, which references a Medication. * * @param rand Source of randomness to use when generating ids etc * @param personEntry Entry for the person * @param bundle The Bundle to add to * @param encounterEntry The current Encounter * @param claim the Claim object ...
Create an entry for the given Claim, which references a Medication
medicationClaim
{ "repo_name": "synthetichealth/synthea", "path": "src/main/java/org/mitre/synthea/export/FhirStu3.java", "license": "apache-2.0", "size": 114287 }
[ "org.hl7.fhir.dstu3.model.Bundle", "org.hl7.fhir.dstu3.model.Claim", "org.hl7.fhir.dstu3.model.Money", "org.hl7.fhir.dstu3.model.PositiveIntType", "org.hl7.fhir.dstu3.model.Reference", "org.mitre.synthea.helpers.RandomNumberGenerator", "org.mitre.synthea.world.concepts.Claim", "org.mitre.synthea.world...
import org.hl7.fhir.dstu3.model.Bundle; import org.hl7.fhir.dstu3.model.Claim; import org.hl7.fhir.dstu3.model.Money; import org.hl7.fhir.dstu3.model.PositiveIntType; import org.hl7.fhir.dstu3.model.Reference; import org.mitre.synthea.helpers.RandomNumberGenerator; import org.mitre.synthea.world.concepts.Claim; import ...
import org.hl7.fhir.dstu3.model.*; import org.mitre.synthea.helpers.*; import org.mitre.synthea.world.concepts.*;
[ "org.hl7.fhir", "org.mitre.synthea" ]
org.hl7.fhir; org.mitre.synthea;
2,734,419
public static void provisioningSuccess(Collection<Container> containers, Long timeout) throws Exception { Set<Container> cntset = new HashSet<>(containers); long startedAt = System.currentTimeMillis(); long remaining = timeout; while (!cntset.isEmpty() && remaining > 0 && !Thread.int...
static void function(Collection<Container> containers, Long timeout) throws Exception { Set<Container> cntset = new HashSet<>(containers); long startedAt = System.currentTimeMillis(); long remaining = timeout; while (!cntset.isEmpty() && remaining > 0 && !Thread.interrupted()) { containerStatus(containers, STR, remaini...
/** * Wait for a container to provision and assert its status. */
Wait for a container to provision and assert its status
provisioningSuccess
{ "repo_name": "janstey/fabric8", "path": "itests/common/src/main/java/io/fabric8/itests/support/ProvisionSupport.java", "license": "apache-2.0", "size": 10820 }
[ "io.fabric8.api.Container", "java.util.Collection", "java.util.HashSet", "java.util.Set" ]
import io.fabric8.api.Container; import java.util.Collection; import java.util.HashSet; import java.util.Set;
import io.fabric8.api.*; import java.util.*;
[ "io.fabric8.api", "java.util" ]
io.fabric8.api; java.util;
1,936,411
@Test public void testIndexOf() { YIntervalSeries s1 = new YIntervalSeries("Series 1"); s1.add(1.0, 1.0, 1.0, 2.0); s1.add(2.0, 2.0, 2.0, 3.0); s1.add(3.0, 3.0, 3.0, 4.0); assertEquals(0, s1.indexOf(1.0)); }
void function() { YIntervalSeries s1 = new YIntervalSeries(STR); s1.add(1.0, 1.0, 1.0, 2.0); s1.add(2.0, 2.0, 2.0, 3.0); s1.add(3.0, 3.0, 3.0, 4.0); assertEquals(0, s1.indexOf(1.0)); }
/** * Simple test for the indexOf() method. */
Simple test for the indexOf() method
testIndexOf
{ "repo_name": "oskopek/jfreechart-fse", "path": "src/test/java/org/jfree/data/xy/YIntervalSeriesTest.java", "license": "lgpl-2.1", "size": 9795 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
58,859
public final static Prestamo makePrestamo(ResultSet rs) throws SQLException{ VideoDao dao = new VideoDaoJDBC(); Ficha ficha = dao.getFichaById(rs.getLong(Prestamo.FIELDS[2])); Cinta cinta = dao.getCintaById(rs.getLong(Prestamo.FIELDS[1])); Prestamo obj = new Prestamo(rs.getDate(Prest...
final static Prestamo function(ResultSet rs) throws SQLException{ VideoDao dao = new VideoDaoJDBC(); Ficha ficha = dao.getFichaById(rs.getLong(Prestamo.FIELDS[2])); Cinta cinta = dao.getCintaById(rs.getLong(Prestamo.FIELDS[1])); Prestamo obj = new Prestamo(rs.getDate(Prestamo.FIELDS[3]), EEstatusPrestamo.valueOf(rs.get...
/** * Realiza un mapeo de un {@code ResultSet} a un objeto {@code Prestamo}. * * @param rs {@code ResultSet} a convertir * @return {@code Prestamo} con los parámetros conseguidos por la búsqueda * @throws SQLException en caso de que no consida el tipo del campo cuando * lo pedimos *...
Realiza un mapeo de un ResultSet a un objeto Prestamo
makePrestamo
{ "repo_name": "eZubia/video-club", "path": "src/main/java/mx/uach/videoclub/dao/jdbc/helper/VideoDaoJdbcHelper.java", "license": "mit", "size": 6111 }
[ "java.sql.ResultSet", "java.sql.SQLException", "mx.uach.videoclub.dao.VideoDao", "mx.uach.videoclub.dao.jdbc.VideoDaoJDBC", "mx.uach.videoclub.modelos.Cinta", "mx.uach.videoclub.modelos.Ficha", "mx.uach.videoclub.modelos.Prestamo", "mx.uach.videoclub.modelos.enums.EEstatusPrestamo" ]
import java.sql.ResultSet; import java.sql.SQLException; import mx.uach.videoclub.dao.VideoDao; import mx.uach.videoclub.dao.jdbc.VideoDaoJDBC; import mx.uach.videoclub.modelos.Cinta; import mx.uach.videoclub.modelos.Ficha; import mx.uach.videoclub.modelos.Prestamo; import mx.uach.videoclub.modelos.enums.EEstatusPresta...
import java.sql.*; import mx.uach.videoclub.dao.*; import mx.uach.videoclub.dao.jdbc.*; import mx.uach.videoclub.modelos.*; import mx.uach.videoclub.modelos.enums.*;
[ "java.sql", "mx.uach.videoclub" ]
java.sql; mx.uach.videoclub;
1,140,915
public void testSquarefreeFactors() { dfac = new GenPolynomialRing<AlgebraicNumber<ModInteger>>(fac, rl, to, vars); a = dfac.random(kl, 3, 2, q); b = dfac.random(kl, 3, 2, q); c = dfac.random(kl, 3, 2, q); //System.out.println("a = " + a); //System.out.println("b ...
void function() { dfac = new GenPolynomialRing<AlgebraicNumber<ModInteger>>(fac, rl, to, vars); a = dfac.random(kl, 3, 2, q); b = dfac.random(kl, 3, 2, q); c = dfac.random(kl, 3, 2, q); if (a.isZERO() b.isZERO() c.isZERO()) { return; } d = a.multiply(a).multiply(b).multiply(b).multiply(b).multiply(c); SortedMap<GenPoly...
/** * Test squarefree factors. * */
Test squarefree factors
testSquarefreeFactors
{ "repo_name": "breandan/java-algebra-system", "path": "trc/edu/jas/ufd/SquarefreeAlgModTest.java", "license": "gpl-2.0", "size": 23729 }
[ "edu.jas.arith.ModInteger", "edu.jas.poly.AlgebraicNumber", "edu.jas.poly.GenPolynomial", "edu.jas.poly.GenPolynomialRing", "java.util.SortedMap" ]
import edu.jas.arith.ModInteger; import edu.jas.poly.AlgebraicNumber; import edu.jas.poly.GenPolynomial; import edu.jas.poly.GenPolynomialRing; import java.util.SortedMap;
import edu.jas.arith.*; import edu.jas.poly.*; import java.util.*;
[ "edu.jas.arith", "edu.jas.poly", "java.util" ]
edu.jas.arith; edu.jas.poly; java.util;
2,849,351
public static Map<String, Object> handleSwitchMultilevelStopLevelChange(byte[] payload) { // Create our response map Map<String, Object> response = new HashMap<String, Object>(); // Return the map of processed response data; return response; }
static Map<String, Object> function(byte[] payload) { Map<String, Object> response = new HashMap<String, Object>(); return response; }
/** * Processes a received frame with the SWITCH_MULTILEVEL_STOP_LEVEL_CHANGE command. * <p> * Switch Multilevel Stop Level Change * * @param payload the {@link byte[]} payload data to process * @return a {@link Map} of processed response data */
Processes a received frame with the SWITCH_MULTILEVEL_STOP_LEVEL_CHANGE command. Switch Multilevel Stop Level Change
handleSwitchMultilevelStopLevelChange
{ "repo_name": "zsmartsystems/com.zsmartsystems.zwave", "path": "com.zsmartsystems.zwave/src/main/java/com/zsmartsystems/zwave/commandclass/impl/CommandClassSwitchMultilevelV4.java", "license": "epl-1.0", "size": 22214 }
[ "java.util.HashMap", "java.util.Map" ]
import java.util.HashMap; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
831,002
private void addNamespacePanelBody(Panel panel, Attribute attribute) { if (attribute.getValue() == null) { return; } PanelBody body = new PanelBody(); body.addStyleName(PerunProfileResources.INSTANCE.gss().noPadding()); addNamespaceNameItems(body, attribute); panel.add(body); }
void function(Panel panel, Attribute attribute) { if (attribute.getValue() == null) { return; } PanelBody body = new PanelBody(); body.addStyleName(PerunProfileResources.INSTANCE.gss().noPadding()); addNamespaceNameItems(body, attribute); panel.add(body); }
/** * Sets up the body of the panel with preferred group names */
Sets up the body of the panel with preferred group names
addNamespacePanelBody
{ "repo_name": "zlamalp/perun-wui", "path": "perun-wui-profile/src/main/java/cz/metacentrum/perun/wui/profile/pages/settings/preferredgroupnames/PreferredGroupNamesView.java", "license": "bsd-2-clause", "size": 8350 }
[ "cz.metacentrum.perun.wui.model.beans.Attribute", "cz.metacentrum.perun.wui.profile.client.resources.PerunProfileResources", "org.gwtbootstrap3.client.ui.Panel", "org.gwtbootstrap3.client.ui.PanelBody" ]
import cz.metacentrum.perun.wui.model.beans.Attribute; import cz.metacentrum.perun.wui.profile.client.resources.PerunProfileResources; import org.gwtbootstrap3.client.ui.Panel; import org.gwtbootstrap3.client.ui.PanelBody;
import cz.metacentrum.perun.wui.model.beans.*; import cz.metacentrum.perun.wui.profile.client.resources.*; import org.gwtbootstrap3.client.ui.*;
[ "cz.metacentrum.perun", "org.gwtbootstrap3.client" ]
cz.metacentrum.perun; org.gwtbootstrap3.client;
72,956
public void test_getSubject() { Subject subj = new Subject(); AccessControlContext acc = new AccessControlContext(new ProtectionDomain[0]); try { assertNull(Subject.getSubject(acc)); } catch (Exception e) { fail("Unexpected exception " + e); } }
void function() { Subject subj = new Subject(); AccessControlContext acc = new AccessControlContext(new ProtectionDomain[0]); try { assertNull(Subject.getSubject(acc)); } catch (Exception e) { fail(STR + e); } }
/** * javax.security.auth.Subject#getSubject(AccessControlContext acc) */
javax.security.auth.Subject#getSubject(AccessControlContext acc)
test_getSubject
{ "repo_name": "JuudeDemos/android-sdk-20", "path": "src/org/apache/harmony/tests/javax/security/auth/SubjectTest.java", "license": "apache-2.0", "size": 8544 }
[ "java.security.AccessControlContext", "java.security.ProtectionDomain", "javax.security.auth.Subject" ]
import java.security.AccessControlContext; import java.security.ProtectionDomain; import javax.security.auth.Subject;
import java.security.*; import javax.security.auth.*;
[ "java.security", "javax.security" ]
java.security; javax.security;
359,152
@PostMapping(value = "/updateLoggerLevel") @ResponseBody public void updateLoggerLevel(@RequestParam final String loggerName, @RequestParam final String loggerLevel, @RequestParam(defaultValue = "false") final boolean additive, ...
@PostMapping(value = STR) void function(@RequestParam final String loggerName, @RequestParam final String loggerLevel, @RequestParam(defaultValue = "false") final boolean additive, final HttpServletRequest request, final HttpServletResponse response) throws Exception { ensureEndpointAccessIsAuthorized(request, response...
/** * Looks up the logger in the logger factory, * and attempts to find the real logger instance * based on the underlying logging framework * and retrieve the logger object. Then, updates the level. * This functionality at this point is heavily dependant * on the log4j API. * * ...
Looks up the logger in the logger factory, and attempts to find the real logger instance based on the underlying logging framework and retrieve the logger object. Then, updates the level. This functionality at this point is heavily dependant on the log4j API
updateLoggerLevel
{ "repo_name": "Unicon/cas", "path": "support/cas-server-support-reports/src/main/java/org/apereo/cas/web/report/LoggingConfigController.java", "license": "apache-2.0", "size": 11327 }
[ "java.util.Collection", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "org.apache.logging.log4j.Level", "org.apache.logging.log4j.core.config.LoggerConfig", "org.springframework.util.Assert", "org.springframework.web.bind.annotation.PostMapping", "org.springframewo...
import java.util.Collection; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.logging.log4j.Level; import org.apache.logging.log4j.core.config.LoggerConfig; import org.springframework.util.Assert; import org.springframework.web.bind.annotation.PostMapping; i...
import java.util.*; import javax.servlet.http.*; import org.apache.logging.log4j.*; import org.apache.logging.log4j.core.config.*; import org.springframework.util.*; import org.springframework.web.bind.annotation.*;
[ "java.util", "javax.servlet", "org.apache.logging", "org.springframework.util", "org.springframework.web" ]
java.util; javax.servlet; org.apache.logging; org.springframework.util; org.springframework.web;
494,653
void index(IndexableObject object, boolean create) throws IOException;
void index(IndexableObject object, boolean create) throws IOException;
/** * Index operation. Indicating that an object has been built and is ready to be indexed. * The source of the document is held by the XContentBuilder. * * @param object the indexable object * @param create true if the document should be created * @throws IOException when indexing fails ...
Index operation. Indicating that an object has been built and is ready to be indexed. The source of the document is held by the XContentBuilder
index
{ "repo_name": "zuoyebushiwo/elasticsearch-1.5.0", "path": "src/main/java/org/xbib/elasticsearch/river/jdbc/RiverMouth.java", "license": "apache-2.0", "size": 4771 }
[ "java.io.IOException", "org.xbib.elasticsearch.plugin.jdbc.util.IndexableObject" ]
import java.io.IOException; import org.xbib.elasticsearch.plugin.jdbc.util.IndexableObject;
import java.io.*; import org.xbib.elasticsearch.plugin.jdbc.util.*;
[ "java.io", "org.xbib.elasticsearch" ]
java.io; org.xbib.elasticsearch;
2,806,250
public Map<String, Object> processFieldRules() { HashMap<String, Object> inMap = new HashMap<String, Object>(); if (isSkipDataConversion()) { Map<String, Object> skipParams = new HashMap<String, Object>(); if (getSkipFieldPattern() != null) { skipParams.put("fieldPattern", getSkipFieldPattern()); ...
Map<String, Object> function() { HashMap<String, Object> inMap = new HashMap<String, Object>(); if (isSkipDataConversion()) { Map<String, Object> skipParams = new HashMap<String, Object>(); if (getSkipFieldPattern() != null) { skipParams.put(STR, getSkipFieldPattern()); } else if (getSkipStartField() != null && getSkip...
/** * Process the field rules and return an input map for field handling rules * in the deeper layers of P4Java. * * @return map of field handling rules */
Process the field rules and return an input map for field handling rules in the deeper layers of P4Java
processFieldRules
{ "repo_name": "paulseawa/p4ic4idea", "path": "p4java/src/com/perforce/p4java/option/server/ExportRecordsOptions.java", "license": "apache-2.0", "size": 14003 }
[ "com.perforce.p4java.server.CmdSpec", "java.util.HashMap", "java.util.Map" ]
import com.perforce.p4java.server.CmdSpec; import java.util.HashMap; import java.util.Map;
import com.perforce.p4java.server.*; import java.util.*;
[ "com.perforce.p4java", "java.util" ]
com.perforce.p4java; java.util;
119,437
public void setId(TLAbsInputPhoto id) { this.id = id; }
void function(TLAbsInputPhoto id) { this.id = id; }
/** * Sets id. * * @param id the id */
Sets id
setId
{ "repo_name": "rubenlagus/TelegramApi", "path": "src/main/java/org/telegram/api/input/chat/photo/TLInputChatPhoto.java", "license": "mit", "size": 1359 }
[ "org.telegram.api.input.photo.TLAbsInputPhoto" ]
import org.telegram.api.input.photo.TLAbsInputPhoto;
import org.telegram.api.input.photo.*;
[ "org.telegram.api" ]
org.telegram.api;
2,681,417
EEnum getApiResourceUrlStyle();
EEnum getApiResourceUrlStyle();
/** * Returns the meta object for enum '{@link org.wso2.developerstudio.eclipse.esb.ApiResourceUrlStyle <em>Api Resource Url Style</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for enum '<em>Api Resource Url Style</em>'. * @see org.wso2.developerstudio.eclipse.esb.ApiReso...
Returns the meta object for enum '<code>org.wso2.developerstudio.eclipse.esb.ApiResourceUrlStyle Api Resource Url Style</code>'.
getApiResourceUrlStyle
{ "repo_name": "chanakaudaya/developer-studio", "path": "esb/org.wso2.developerstudio.eclipse.esb/src/org/wso2/developerstudio/eclipse/esb/EsbPackage.java", "license": "apache-2.0", "size": 373548 }
[ "org.eclipse.emf.ecore.EEnum" ]
import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,235,378
protected void buildRequiredValidUntilFilterIfNeeded(final SamlRegisteredService service, final List<MetadataFilter> metadataFilterList) { if (service.getMetadataMaxValidity() > 0) { final RequiredValidUntilFilter requiredValidUntilFilter = new RequiredValidUntilFilter(service.getMet...
void function(final SamlRegisteredService service, final List<MetadataFilter> metadataFilterList) { if (service.getMetadataMaxValidity() > 0) { final RequiredValidUntilFilter requiredValidUntilFilter = new RequiredValidUntilFilter(service.getMetadataMaxValidity()); metadataFilterList.add(requiredValidUntilFilter); LOGG...
/** * Build required valid until filter if needed. See {@link RequiredValidUntilFilter}. * * @param service the service * @param metadataFilterList the metadata filter list */
Build required valid until filter if needed. See <code>RequiredValidUntilFilter</code>
buildRequiredValidUntilFilterIfNeeded
{ "repo_name": "Unicon/cas", "path": "support/cas-server-support-saml-idp/src/main/java/org/apereo/cas/support/saml/services/idp/metadata/cache/resolver/BaseSamlRegisteredServiceMetadataResolver.java", "license": "apache-2.0", "size": 9233 }
[ "java.util.List", "org.apereo.cas.support.saml.services.SamlRegisteredService", "org.opensaml.saml.metadata.resolver.filter.MetadataFilter", "org.opensaml.saml.metadata.resolver.filter.impl.RequiredValidUntilFilter" ]
import java.util.List; import org.apereo.cas.support.saml.services.SamlRegisteredService; import org.opensaml.saml.metadata.resolver.filter.MetadataFilter; import org.opensaml.saml.metadata.resolver.filter.impl.RequiredValidUntilFilter;
import java.util.*; import org.apereo.cas.support.saml.services.*; import org.opensaml.saml.metadata.resolver.filter.*; import org.opensaml.saml.metadata.resolver.filter.impl.*;
[ "java.util", "org.apereo.cas", "org.opensaml.saml" ]
java.util; org.apereo.cas; org.opensaml.saml;
2,297,454
public void updateBigDecimal(String columnName, BigDecimal x) throws SQLException { checkIfClosed("updateBigDecimal"); updateBigDecimal(findColumnName(columnName), x); }
void function(String columnName, BigDecimal x) throws SQLException { checkIfClosed(STR); updateBigDecimal(findColumnName(columnName), x); }
/** * JDBC 2.0 * * Update a column with a BigDecimal value. * * The updateXXX() methods are used to update column values in the * current row, or the insert row. The updateXXX() methods do not * update the underlying database, instead the updateRow() or insertRow() * methods ar...
JDBC 2.0 Update a column with a BigDecimal value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database
updateBigDecimal
{ "repo_name": "splicemachine/spliceengine", "path": "db-engine/src/main/java/com/splicemachine/db/impl/jdbc/EmbedResultSet20.java", "license": "agpl-3.0", "size": 14606 }
[ "java.math.BigDecimal", "java.sql.SQLException" ]
import java.math.BigDecimal; import java.sql.SQLException;
import java.math.*; import java.sql.*;
[ "java.math", "java.sql" ]
java.math; java.sql;
439,506
private String getPostBackWindowId(FacesContext facesContext) { Map<String, String> requestParams = facesContext.getExternalContext().getRequestParameterMap(); String windowId = requestParams.get(DELTASPIKE_WINDOW_ID_POST_PARAM); return windowId; }
String function(FacesContext facesContext) { Map<String, String> requestParams = facesContext.getExternalContext().getRequestParameterMap(); String windowId = requestParams.get(DELTASPIKE_WINDOW_ID_POST_PARAM); return windowId; }
/** * Extract the windowId for http POST */
Extract the windowId for http POST
getPostBackWindowId
{ "repo_name": "hwellmann/deltaspike", "path": "deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/scope/window/DefaultClientWindow.java", "license": "apache-2.0", "size": 9163 }
[ "java.util.Map", "javax.faces.context.FacesContext" ]
import java.util.Map; import javax.faces.context.FacesContext;
import java.util.*; import javax.faces.context.*;
[ "java.util", "javax.faces" ]
java.util; javax.faces;
2,677,866
private void writeLargeRecord( ByteBuffer record, int targetSubpartition, DataType dataType, boolean isBroadcast) throws IOException { fileWriter.startNewRegion(isBroadcast); List<BufferWithChannel> toWrite = new ArrayList<>(); Queue<MemorySegment> segments = getWrit...
void function( ByteBuffer record, int targetSubpartition, DataType dataType, boolean isBroadcast) throws IOException { fileWriter.startNewRegion(isBroadcast); List<BufferWithChannel> toWrite = new ArrayList<>(); Queue<MemorySegment> segments = getWriteBuffers(); while (record.hasRemaining()) { if (segments.isEmpty()) {...
/** * Spills the large record into the target {@link PartitionedFile} as a separate data region. */
Spills the large record into the target <code>PartitionedFile</code> as a separate data region
writeLargeRecord
{ "repo_name": "clarkyzl/flink", "path": "flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/SortMergeResultPartition.java", "license": "apache-2.0", "size": 18358 }
[ "java.io.IOException", "java.nio.ByteBuffer", "java.util.ArrayList", "java.util.List", "java.util.Queue", "org.apache.flink.core.memory.MemorySegment", "org.apache.flink.runtime.io.network.buffer.Buffer", "org.apache.flink.runtime.io.network.buffer.NetworkBuffer", "org.apache.flink.util.Precondition...
import java.io.IOException; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; import java.util.Queue; import org.apache.flink.core.memory.MemorySegment; import org.apache.flink.runtime.io.network.buffer.Buffer; import org.apache.flink.runtime.io.network.buffer.NetworkBuffer; import org.apac...
import java.io.*; import java.nio.*; import java.util.*; import org.apache.flink.core.memory.*; import org.apache.flink.runtime.io.network.buffer.*; import org.apache.flink.util.*;
[ "java.io", "java.nio", "java.util", "org.apache.flink" ]
java.io; java.nio; java.util; org.apache.flink;
993,223
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) { if (state.getValue(VARIANT) == DirtType.PODZOL) { Block block = worldIn.getBlockState(pos.up()).getBlock(); state = state.withProperty(SNOWY, Boolean.valueOf(block == Blocks.snow ||...
IBlockState function(IBlockState state, IBlockAccess worldIn, BlockPos pos) { if (state.getValue(VARIANT) == DirtType.PODZOL) { Block block = worldIn.getBlockState(pos.up()).getBlock(); state = state.withProperty(SNOWY, Boolean.valueOf(block == Blocks.snow block == Blocks.snow_layer)); } return state; }
/** * Get the actual Block state of this Block at the given position. This applies properties not visible in the * metadata, such as fence connections. */
Get the actual Block state of this Block at the given position. This applies properties not visible in the metadata, such as fence connections
getActualState
{ "repo_name": "TorchPowered/CraftBloom", "path": "src/net/minecraft/block/BlockDirt.java", "license": "mit", "size": 5108 }
[ "net.minecraft.block.state.IBlockState", "net.minecraft.init.Blocks", "net.minecraft.util.BlockPos", "net.minecraft.world.IBlockAccess" ]
import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import net.minecraft.util.BlockPos; import net.minecraft.world.IBlockAccess;
import net.minecraft.block.state.*; import net.minecraft.init.*; import net.minecraft.util.*; import net.minecraft.world.*;
[ "net.minecraft.block", "net.minecraft.init", "net.minecraft.util", "net.minecraft.world" ]
net.minecraft.block; net.minecraft.init; net.minecraft.util; net.minecraft.world;
2,657,118
void recomputeProgress() { if (isComplete()) { this.progress = 1; // update the counters and the state TaskStatus completedStatus = taskStatuses.get(getSuccessfulTaskid()); this.counters = completedStatus.getCounters(); this.state = completedStatus.getStateString(); } else if (fa...
void recomputeProgress() { if (isComplete()) { this.progress = 1; TaskStatus completedStatus = taskStatuses.get(getSuccessfulTaskid()); this.counters = completedStatus.getCounters(); this.state = completedStatus.getStateString(); } else if (failed) { this.progress = 0; this.state = STR"; Counters bestCounters = new Cou...
/** * This method is called whenever there's a status change * for one of the TIP's sub-tasks. It recomputes the overall * progress for the TIP. We examine all sub-tasks and find * the one that's most advanced (and non-failed). */
This method is called whenever there's a status change for one of the TIP's sub-tasks. It recomputes the overall progress for the TIP. We examine all sub-tasks and find the one that's most advanced (and non-failed)
recomputeProgress
{ "repo_name": "coderplay/hadoop-common", "path": "src/mapred/org/apache/hadoop/mapred/TaskInProgress.java", "license": "apache-2.0", "size": 39289 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
110,683
public DeviceId getId(String ip) { for (Device device : deviceService.getAvailableDevices()) { String val = device.annotations().value(IP); if (ip.equals(val)) { return device.id(); } } throw new NetL3VpnException(getMgmtIpUnAvailErr(ip)); ...
DeviceId function(String ip) { for (Device device : deviceService.getAvailableDevices()) { String val = device.annotations().value(IP); if (ip.equals(val)) { return device.id(); } } throw new NetL3VpnException(getMgmtIpUnAvailErr(ip)); }
/** * Returns the device id whose management ip address matches with the ip * received. * * @param ip ip address * @return device id */
Returns the device id whose management ip address matches with the ip received
getId
{ "repo_name": "LorenzReinhart/ONOSnew", "path": "apps/l3vpn/src/main/java/org/onosproject/l3vpn/netl3vpn/impl/NetL3VpnManager.java", "license": "apache-2.0", "size": 42529 }
[ "org.onosproject.l3vpn.netl3vpn.NetL3VpnException", "org.onosproject.net.Device", "org.onosproject.net.DeviceId" ]
import org.onosproject.l3vpn.netl3vpn.NetL3VpnException; import org.onosproject.net.Device; import org.onosproject.net.DeviceId;
import org.onosproject.l3vpn.netl3vpn.*; import org.onosproject.net.*;
[ "org.onosproject.l3vpn", "org.onosproject.net" ]
org.onosproject.l3vpn; org.onosproject.net;
329,850
public static void loadTestData(ApplicationContext appContext, JdbcTemplate jdbcTemplate) { Resource testDataScript = appContext .getResource(TEST_DATA_SCRIPT_LOCATION); try { JdbcTestUtils.deleteFromTables(jdbcTemplate, "occurrence", "occurrence_raw", "occurrence_extension"); JdbcTestUtils.de...
static void function(ApplicationContext appContext, JdbcTemplate jdbcTemplate) { Resource testDataScript = appContext .getResource(TEST_DATA_SCRIPT_LOCATION); try { JdbcTestUtils.deleteFromTables(jdbcTemplate, STR, STR, STR); JdbcTestUtils.deleteFromTables(jdbcTemplate, STR); JdbcTestUtils.deleteFromTables(jdbcTemplate...
/** * Delete and insert data from the insert-test-data.sql script. * * @param appContext * @param template */
Delete and insert data from the insert-test-data.sql script
loadTestData
{ "repo_name": "sibbr/explorador", "path": "src/test/java/net/canadensys/dataportal/occurrence/TestDataHelper.java", "license": "mit", "size": 1649 }
[ "java.sql.Connection", "org.junit.Assert", "org.springframework.context.ApplicationContext", "org.springframework.core.io.Resource", "org.springframework.jdbc.core.JdbcTemplate", "org.springframework.jdbc.datasource.DataSourceUtils", "org.springframework.jdbc.datasource.init.ScriptException", "org.spr...
import java.sql.Connection; import org.junit.Assert; import org.springframework.context.ApplicationContext; import org.springframework.core.io.Resource; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.datasource.DataSourceUtils; import org.springframework.jdbc.datasource.init.ScriptEx...
import java.sql.*; import org.junit.*; import org.springframework.context.*; import org.springframework.core.io.*; import org.springframework.jdbc.core.*; import org.springframework.jdbc.datasource.*; import org.springframework.jdbc.datasource.init.*; import org.springframework.test.jdbc.*;
[ "java.sql", "org.junit", "org.springframework.context", "org.springframework.core", "org.springframework.jdbc", "org.springframework.test" ]
java.sql; org.junit; org.springframework.context; org.springframework.core; org.springframework.jdbc; org.springframework.test;
2,563,240
public void createObjectList() { setMyobjectList(new ArrayList<MyMTObject>()); }
void function() { setMyobjectList(new ArrayList<MyMTObject>()); }
/**Erstellt eine Objektliste. * in dieser Liste werden alle Objekte auf einer Scene abgespeichert. * */
Erstellt eine Objektliste. in dieser Liste werden alle Objekte auf einer Scene abgespeichert
createObjectList
{ "repo_name": "steffe/MT4J_KTSI", "path": "ktsi/ch/mitoco/dataController/DataController.java", "license": "gpl-2.0", "size": 11373 }
[ "ch.mitoco.components.visibleComponents.MyMTObject", "java.util.ArrayList" ]
import ch.mitoco.components.visibleComponents.MyMTObject; import java.util.ArrayList;
import ch.mitoco.components.*; import java.util.*;
[ "ch.mitoco.components", "java.util" ]
ch.mitoco.components; java.util;
297,054
private void setPlant(PlantComposite plant) { // If the incoming value is null, set it to the default, empty plant. if (plant == null) { plant = defaultPlant; } // We only need to do anything if the value has actually changed. if (plant != this.plant) { this.plant = plant; // Set the plant for ...
void function(PlantComposite plant) { if (plant == null) { plant = defaultPlant; } if (plant != this.plant) { this.plant = plant; plantApp.setPlant(plant); } return; }
/** * Sets the plant that is displayed in the {@link #plantApp}. * * @param plant * The new plant. If null, the view will revert to an empty * plant. */
Sets the plant that is displayed in the <code>#plantApp</code>
setPlant
{ "repo_name": "gorindn/ice", "path": "src/org.eclipse.ice.client.widgets.reactoreditor.lwr/src/org/eclipse/ice/client/widgets/reactoreditor/lwr/PlantAnalysisView.java", "license": "epl-1.0", "size": 6642 }
[ "org.eclipse.ice.reactor.plant.PlantComposite" ]
import org.eclipse.ice.reactor.plant.PlantComposite;
import org.eclipse.ice.reactor.plant.*;
[ "org.eclipse.ice" ]
org.eclipse.ice;
1,298,844
public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof DefaultDrawingSupplier)) { return false; } DefaultDrawingSupplier that = (DefaultDrawingSupplier) obj; if (!Arrays.equals(this.paintSeque...
boolean function(Object obj) { if (obj == this) { return true; } if (!(obj instanceof DefaultDrawingSupplier)) { return false; } DefaultDrawingSupplier that = (DefaultDrawingSupplier) obj; if (!Arrays.equals(this.paintSequence, that.paintSequence)) { return false; } if (this.paintIndex != that.paintIndex) { return fals...
/** * Tests this object for equality with another object. * * @param obj the object (<code>null</code> permitted). * * @return A boolean. */
Tests this object for equality with another object
equals
{ "repo_name": "ilyessou/jfreechart", "path": "source/org/jfree/chart/plot/DefaultDrawingSupplier.java", "license": "lgpl-2.1", "size": 18128 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
2,177,232
private Collection<EnforceabilityProblem> checkInitiators( ChoreographySubProcess subProcess) { Collection<ProcessNode> nodes = getInitialNodes(subProcess); nodes = nextNeighbourChoreographyActivities(nodes, Direction.Forward); Collection<EnforceabilityProblem> problems = checkInitia...
Collection<EnforceabilityProblem> function( ChoreographySubProcess subProcess) { Collection<ProcessNode> nodes = getInitialNodes(subProcess); nodes = nextNeighbourChoreographyActivities(nodes, Direction.Forward); Collection<EnforceabilityProblem> problems = checkInitiatorsInSubprocess(nodes, subProcess); return problem...
/** * checks, that all initial activities of the ChoreographySubProcess are initiated * by the initiator of the SubProcess. */
checks, that all initial activities of the ChoreographySubProcess are initiated by the initiator of the SubProcess
checkInitiators
{ "repo_name": "bptlab/processeditor", "path": "src/com/inubit/research/gui/plugins/choreography/enforceabilityChecker/SubProcessCheck.java", "license": "apache-2.0", "size": 6091 }
[ "java.util.Collection", "net.frapu.code.visualization.ProcessNode", "net.frapu.code.visualization.bpmn.ChoreographySubProcess" ]
import java.util.Collection; import net.frapu.code.visualization.ProcessNode; import net.frapu.code.visualization.bpmn.ChoreographySubProcess;
import java.util.*; import net.frapu.code.visualization.*; import net.frapu.code.visualization.bpmn.*;
[ "java.util", "net.frapu.code" ]
java.util; net.frapu.code;
433,655
public static VideoFileManager get() throws IOException { return new VideoFileManager(); } private Path targetDir_ = Paths.get("videos"); // The VideoFileManager.get() method should be used // to obtain an instance private VideoFileManager() throws IOException{ if(!Files.exists(targetDir_)){ Files.cr...
static VideoFileManager function() throws IOException { return new VideoFileManager(); } private Path targetDir_ = Paths.get(STR); private VideoFileManager() throws IOException{ if(!Files.exists(targetDir_)){ Files.createDirectories(targetDir_); } }
/** * This static factory method creates and returns a * VideoFileManager object to the caller. Feel free to customize * this method to take parameters, etc. if you want. * * @return * @throws IOException */
This static factory method creates and returns a VideoFileManager object to the caller. Feel free to customize this method to take parameters, etc. if you want
get
{ "repo_name": "strawberrysocialist/mobilecloud-15", "path": "assignments/assignment3/video-service/src/main/java/vandy/mooc/video/server/VideoFileManager.java", "license": "apache-2.0", "size": 3554 }
[ "java.io.IOException", "java.nio.file.Files", "java.nio.file.Path", "java.nio.file.Paths" ]
import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths;
import java.io.*; import java.nio.file.*;
[ "java.io", "java.nio" ]
java.io; java.nio;
1,952,350
private static void setImageViewScaleTypeMatrix(ImageView imageView) { if (null != imageView) { if (imageView instanceof PhotoView) { } else { imageView.setScaleType(ScaleType.MATRIX); } } } private WeakReference<ImageView> mImageView; private ViewTreeObserver mViewTreeObserver; // Gestur...
static void function(ImageView imageView) { if (null != imageView) { if (imageView instanceof PhotoView) { } else { imageView.setScaleType(ScaleType.MATRIX); } } } WeakReference<ImageView> mImageView; private ViewTreeObserver mViewTreeObserver; private GestureDetector mGestureDetector; private VersionedGestureDetector ...
/** * Set's the ImageView's ScaleType to Matrix. */
Set's the ImageView's ScaleType to Matrix
setImageViewScaleTypeMatrix
{ "repo_name": "haodynasty/BaseUtilsLib", "path": "XUtilsViewLib/src/main/java/com/plusub/lib/view/photoview/PhotoViewAttacher.java", "license": "apache-2.0", "size": 25460 }
[ "android.graphics.Matrix", "android.graphics.RectF", "android.view.GestureDetector", "android.view.View", "android.view.ViewTreeObserver", "android.widget.ImageView", "java.lang.ref.WeakReference" ]
import android.graphics.Matrix; import android.graphics.RectF; import android.view.GestureDetector; import android.view.View; import android.view.ViewTreeObserver; import android.widget.ImageView; import java.lang.ref.WeakReference;
import android.graphics.*; import android.view.*; import android.widget.*; import java.lang.ref.*;
[ "android.graphics", "android.view", "android.widget", "java.lang" ]
android.graphics; android.view; android.widget; java.lang;
918,279
public static void setAttribute(FacesContext context, UIComponent component, String name, Object value) { ValueBinding binding = component.getValueBinding(name); if (binding != null) { try { binding.setValue(context, value); ...
static void function(FacesContext context, UIComponent component, String name, Object value) { ValueBinding binding = component.getValueBinding(name); if (binding != null) { try { binding.setValue(context, value); } catch (IllegalArgumentException e) { binding.setValue(context, String.valueOf(value)); } } else { compon...
/** * Sets component attribute value - if a ValueBinding exists for that * attribute, set through the binding; otherwise, set the value directly on * the component. */
Sets component attribute value - if a ValueBinding exists for that attribute, set through the binding; otherwise, set the value directly on the component
setAttribute
{ "repo_name": "harfalm/Sakai-10.1", "path": "jsf/jsf-widgets/src/java/org/sakaiproject/jsf/util/RendererUtil.java", "license": "apache-2.0", "size": 18084 }
[ "javax.faces.component.UIComponent", "javax.faces.context.FacesContext", "javax.faces.el.ValueBinding" ]
import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.el.ValueBinding;
import javax.faces.component.*; import javax.faces.context.*; import javax.faces.el.*;
[ "javax.faces" ]
javax.faces;
362,255
public static boolean isTableEnabled(Configuration conf, String tableName) throws IOException { return isTableEnabled(conf, Bytes.toBytes(tableName)); }
static boolean function(Configuration conf, String tableName) throws IOException { return isTableEnabled(conf, Bytes.toBytes(tableName)); }
/** * Tells whether or not a table is enabled or not. * @param conf The Configuration object to use. * @param tableName Name of table to check. * @return {@code true} if table is online. * @throws IOException if a remote or network exception occurs */
Tells whether or not a table is enabled or not
isTableEnabled
{ "repo_name": "abaranau/hbase", "path": "src/main/java/org/apache/hadoop/hbase/client/HTable.java", "license": "apache-2.0", "size": 46700 }
[ "java.io.IOException", "org.apache.hadoop.conf.Configuration", "org.apache.hadoop.hbase.util.Bytes" ]
import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.util.Bytes;
import java.io.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.hbase.util.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
320,439
private void checkMessageCounters(int expectedMessageCount, int expectedMessageCountDelta) throws Exception { long start = System.currentTimeMillis(); long now; JsonObject messageCounters; do { Thread.sleep((long) (SAMPLE_PERIOD / 2.0)); ModelNode result = exe...
void function(int expectedMessageCount, int expectedMessageCountDelta) throws Exception { long start = System.currentTimeMillis(); long now; JsonObject messageCounters; do { Thread.sleep((long) (SAMPLE_PERIOD / 2.0)); ModelNode result = execute(getQueueOperation(STR), true); Assert.assertTrue(result.isDefined()); Asser...
/** * Given that message counters are sampled, we fetched them several time (with a period shorter than the sample period) * to make the test pass faster. */
Given that message counters are sampled, we fetched them several time (with a period shorter than the sample period) to make the test pass faster
checkMessageCounters
{ "repo_name": "jstourac/wildfly", "path": "testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/messaging/mgmt/JMSQueueManagementTestCase.java", "license": "lgpl-2.1", "size": 21027 }
[ "javax.json.JsonObject", "org.jboss.dmr.ModelNode", "org.jboss.dmr.ModelType", "org.junit.Assert" ]
import javax.json.JsonObject; import org.jboss.dmr.ModelNode; import org.jboss.dmr.ModelType; import org.junit.Assert;
import javax.json.*; import org.jboss.dmr.*; import org.junit.*;
[ "javax.json", "org.jboss.dmr", "org.junit" ]
javax.json; org.jboss.dmr; org.junit;
13,307
public void addColumn(SQLColumn c) { startOfStatement(); print("<addColumn "); print(getTableQualifier(c.getParent())); println(">"); println(columnDefinition(" ", c, false)); println("</addColumn>"); if (c.isAutoIncrementSequenceNameSet() && c.isAutoIncrement()) { print("<createSequence se...
void function(SQLColumn c) { startOfStatement(); print(STR); print(getTableQualifier(c.getParent())); println(">"); println(columnDefinition(" ", c, false)); println(STR); if (c.isAutoIncrementSequenceNameSet() && c.isAutoIncrement()) { print(STRSTR\"/>"); } endOfStatement(); endStatement(StatementType.XMLTAG, c); }
/** * Creates a <addColumn> definition tag */
Creates a definition tag
addColumn
{ "repo_name": "amitkr/power-architect", "path": "src/main/java/ca/sqlpower/architect/ddl/LiquibaseDDLGenerator.java", "license": "gpl-3.0", "size": 29092 }
[ "ca.sqlpower.architect.ddl.DDLStatement", "ca.sqlpower.sqlobject.SQLColumn" ]
import ca.sqlpower.architect.ddl.DDLStatement; import ca.sqlpower.sqlobject.SQLColumn;
import ca.sqlpower.architect.ddl.*; import ca.sqlpower.sqlobject.*;
[ "ca.sqlpower.architect", "ca.sqlpower.sqlobject" ]
ca.sqlpower.architect; ca.sqlpower.sqlobject;
555,385
public static <T> T fromMap(Map<String, Object> map, Class<T> type) { return gson.fromJson(gson.toJson(map), type); }
static <T> T function(Map<String, Object> map, Class<T> type) { return gson.fromJson(gson.toJson(map), type); }
/** * Returns the JSON object as a plain java object by the specified type. * * @param map * a Map representation of an object. * @param type * the type of the desired object. * @return a plain java object by the specified type. */
Returns the JSON object as a plain java object by the specified type
fromMap
{ "repo_name": "craciunbogdangeorge/GsonUtils", "path": "src/main/java/com/apecs/util/GsonUtils.java", "license": "apache-2.0", "size": 5313 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,017,559
@Name("quercus_is_pro") public static boolean is_pro(Env env) { return env.getQuercus().isPro(); }
@Name(STR) static boolean function(Env env) { return env.getQuercus().isPro(); }
/** * Returns true if this is the Professional version. */
Returns true if this is the Professional version
is_pro
{ "repo_name": "dlitz/resin", "path": "modules/quercus/src/com/caucho/quercus/lib/QuercusModule.java", "license": "gpl-2.0", "size": 4258 }
[ "com.caucho.quercus.annotation.Name", "com.caucho.quercus.env.Env" ]
import com.caucho.quercus.annotation.Name; import com.caucho.quercus.env.Env;
import com.caucho.quercus.annotation.*; import com.caucho.quercus.env.*;
[ "com.caucho.quercus" ]
com.caucho.quercus;
2,256,433
public void undo() throws EditionCommandException { if (moreUndoCommands()) { cr.undoCommand(); } }
void function() throws EditionCommandException { if (moreUndoCommands()) { cr.undoCommand(); } }
/** * Undo the last command added. * @throws EditionCommandException */
Undo the last command added
undo
{ "repo_name": "iCarto/siga", "path": "appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/commands/DefaultEditableFeatureSource.java", "license": "gpl-3.0", "size": 10522 }
[ "com.iver.cit.gvsig.exceptions.commands.EditionCommandException" ]
import com.iver.cit.gvsig.exceptions.commands.EditionCommandException;
import com.iver.cit.gvsig.exceptions.commands.*;
[ "com.iver.cit" ]
com.iver.cit;
2,284,849
public void refreshEmittedFiles() throws CoreException { // refresh *.js, *.js.map files for (IFile emittedFile : emittedFiles) { TypeScriptResourceUtil.refreshFile(emittedFile, true); } for (IFile tsFile : getFilesToRefresh()) { try { TypeScriptResourceUtil.refreshAndCollectEmittedFiles(tsF...
void function() throws CoreException { for (IFile emittedFile : emittedFiles) { TypeScriptResourceUtil.refreshFile(emittedFile, true); } for (IFile tsFile : getFilesToRefresh()) { try { TypeScriptResourceUtil.refreshAndCollectEmittedFiles(tsFile, tsconfig, true, null); } catch (CoreException e) { Trace.trace(Trace.SEVE...
/** * Refresh emitted files *.js , *.js.map * * @throws CoreException */
Refresh emitted files *.js , *.js.map
refreshEmittedFiles
{ "repo_name": "webratio/typescript.java", "path": "eclipse/ts.eclipse.ide.core/src/ts/eclipse/ide/core/compiler/IDETypeScriptCompilerMessageHandler.java", "license": "mit", "size": 5207 }
[ "org.eclipse.core.resources.IContainer", "org.eclipse.core.resources.IFile", "org.eclipse.core.runtime.CoreException", "org.eclipse.core.runtime.IPath" ]
import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IFile; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath;
import org.eclipse.core.resources.*; import org.eclipse.core.runtime.*;
[ "org.eclipse.core" ]
org.eclipse.core;
1,824,085
public static String createDefaultResourceNameFromTestMethod(Method testMethod, String dataStoreId, ResourceType resourceType) { return testMethod.getDeclaringClass().getSimpleName() + "-" + testMethod.getName() + resolveDataStoreSuffix(dataStoreId, resourceType); }
static String function(Method testMethod, String dataStoreId, ResourceType resourceType) { return testMethod.getDeclaringClass().getSimpleName() + "-" + testMethod.getName() + resolveDataStoreSuffix(dataStoreId, resourceType); }
/** * Creates a default resource name from {@code testMethod}. * <br><br> * Example: Given test method com.mycompany.project.module.MyTest#myTestMethod * <br><br> * The result: {@code MyTest-myTestMethod.&lt;datastore-suffix&gt;}. * The {@literal <datastore-suffix>} will be generated from ...
Creates a default resource name from testMethod. Example: Given test method com.mycompany.project.module.MyTest#myTestMethod The result: MyTest-myTestMethod.&lt;datastore-suffix&gt;. The will be generated from dataStoreId and resourceType
createDefaultResourceNameFromTestMethod
{ "repo_name": "syzer/dataset", "path": "src/main/java/org/failearly/dataset/resource/ResourcePathUtils.java", "license": "gpl-3.0", "size": 6551 }
[ "java.lang.reflect.Method", "org.failearly.dataset.internal.resource.ResourceType" ]
import java.lang.reflect.Method; import org.failearly.dataset.internal.resource.ResourceType;
import java.lang.reflect.*; import org.failearly.dataset.internal.resource.*;
[ "java.lang", "org.failearly.dataset" ]
java.lang; org.failearly.dataset;
682,488
private File searchFile(File directory, String pattern) { for(File file : directory.listFiles()) { if (file.getName().matches(pattern)) return file; } return null; }
File function(File directory, String pattern) { for(File file : directory.listFiles()) { if (file.getName().matches(pattern)) return file; } return null; }
/** * File search (easy glob) * @param directory directory path * @param pattern searching file pattern with regular representation * @return matched file */
File search (easy glob)
searchFile
{ "repo_name": "deezer/weslang", "path": "third_party/java/language-detection-v2/src/com/cybozu/labs/langdetect/Command.java", "license": "apache-2.0", "size": 11185 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
1,720,935
public void copyTo(VGDLSprite toSprite) { //this.color, this.draw_arrow don't need to be copied. toSprite.name = this.name; toSprite.is_static = this.is_static; toSprite.only_active = this.only_active; toSprite.disabled = this.disabled; toSprite.is_avatar = this.i...
void function(VGDLSprite toSprite) { toSprite.name = this.name; toSprite.is_static = this.is_static; toSprite.only_active = this.only_active; toSprite.disabled = this.disabled; toSprite.is_avatar = this.is_avatar; toSprite.is_stochastic = this.is_stochastic; toSprite.cooldown = this.cooldown; toSprite.speed = this.spee...
/** * Copies the attributes of this object to the one passed as parameter. * @param toSprite the sprite to copy to. */
Copies the attributes of this object to the one passed as parameter
copyTo
{ "repo_name": "tohahn/UE_ML", "path": "UE06/gvgai/src/core/VGDLSprite.java", "license": "gpl-3.0", "size": 32756 }
[ "java.awt.Rectangle", "java.util.ArrayList", "java.util.Map", "java.util.Set", "java.util.TreeMap" ]
import java.awt.Rectangle; import java.util.ArrayList; import java.util.Map; import java.util.Set; import java.util.TreeMap;
import java.awt.*; import java.util.*;
[ "java.awt", "java.util" ]
java.awt; java.util;
870,543
public static Timestamp toTimestamp(Date d) { return new Timestamp(d.getTime()); }
static Timestamp function(Date d) { return new Timestamp(d.getTime()); }
/** * Return a java.sql.Timestamp given a java.util.Date. * * @param d a date * @return the date wrapped as a Timestamp * @since 1.6.6 */
Return a java.sql.Timestamp given a java.util.Date
toTimestamp
{ "repo_name": "avafanasiev/groovy", "path": "subprojects/groovy-sql/src/main/java/org/codehaus/groovy/runtime/SqlGroovyMethods.java", "license": "apache-2.0", "size": 4296 }
[ "java.sql.Timestamp", "java.util.Date" ]
import java.sql.Timestamp; import java.util.Date;
import java.sql.*; import java.util.*;
[ "java.sql", "java.util" ]
java.sql; java.util;
1,188,270
public void delete(Inode node, User user, boolean respectFrontendRoles) throws DotDataException, DotSecurityException, DotStateException;
void function(Inode node, User user, boolean respectFrontendRoles) throws DotDataException, DotSecurityException, DotStateException;
/** * This method completely deletes the given node from the system * * @param node * @param user * @param respectFrontendRoles * @throws DotDataException * @throws DotSecurityException */
This method completely deletes the given node from the system
delete
{ "repo_name": "zhiqinghuang/core", "path": "src/com/dotmarketing/business/skeleton/DotCMSAPIPostHook.java", "license": "gpl-3.0", "size": 24644 }
[ "com.dotmarketing.beans.Inode", "com.dotmarketing.business.DotStateException", "com.dotmarketing.exception.DotDataException", "com.dotmarketing.exception.DotSecurityException", "com.liferay.portal.model.User" ]
import com.dotmarketing.beans.Inode; import com.dotmarketing.business.DotStateException; import com.dotmarketing.exception.DotDataException; import com.dotmarketing.exception.DotSecurityException; import com.liferay.portal.model.User;
import com.dotmarketing.beans.*; import com.dotmarketing.business.*; import com.dotmarketing.exception.*; import com.liferay.portal.model.*;
[ "com.dotmarketing.beans", "com.dotmarketing.business", "com.dotmarketing.exception", "com.liferay.portal" ]
com.dotmarketing.beans; com.dotmarketing.business; com.dotmarketing.exception; com.liferay.portal;
1,967,150
public static void assertStreamEquals( final String witness, final byte[] actual, final int[] skip, final int endCompare) throws IOException { File witnessFile = new File(witness); if (witnessFile.exists()) { int skipIndex = 0; byte[] expected = new byte[actual.length]; FileInputStr...
static void function( final String witness, final byte[] actual, final int[] skip, final int endCompare) throws IOException { File witnessFile = new File(witness); if (witnessFile.exists()) { int skipIndex = 0; byte[] expected = new byte[actual.length]; FileInputStream is = new FileInputStream(witnessFile); int bytesRe...
/** * Asserts the serialized form of an object. * @param witness file name of expected serialization. * @param actual byte array of actual serialization. * @param skip positions to skip comparison. * @param endCompare position to stop comparison. * @throws IOException thrown on IO or serialization exc...
Asserts the serialized form of an object
assertStreamEquals
{ "repo_name": "prmsheriff/log4j", "path": "tests/src/java/org/apache/log4j/util/SerializationTestHelper.java", "license": "apache-2.0", "size": 4864 }
[ "java.io.File", "java.io.FileInputStream", "java.io.FileOutputStream", "java.io.IOException", "junit.framework.TestCase" ]
import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import junit.framework.TestCase;
import java.io.*; import junit.framework.*;
[ "java.io", "junit.framework" ]
java.io; junit.framework;
103,726
public boolean memberExists(String name, String email, String phone) { final List<WebElement> membersList = getRows(); if (!CollectionUtils.isEmpty(membersList)) { for (WebElement row : membersList) { if (row != null) { List<WebElement> columns = row.f...
boolean function(String name, String email, String phone) { final List<WebElement> membersList = getRows(); if (!CollectionUtils.isEmpty(membersList)) { for (WebElement row : membersList) { if (row != null) { List<WebElement> columns = row.findElements(By.className(columnClassName)); int matchesFound = 0; for (int j = ...
/** * Finds whether a member exists in the list. * * @param name The name. * @param email The email. * @param phone The phone. * @return true or false */
Finds whether a member exists in the list
memberExists
{ "repo_name": "tolis-e/continuous-integration-of-mobile-web-applications-on-android", "path": "src/test/java/org/jboss/as/quickstarts/kitchensink/html5/mobile/demo/pages/MembersPage.java", "license": "apache-2.0", "size": 5696 }
[ "java.util.List", "org.apache.commons.collections.CollectionUtils", "org.openqa.selenium.By", "org.openqa.selenium.WebElement" ]
import java.util.List; import org.apache.commons.collections.CollectionUtils; import org.openqa.selenium.By; import org.openqa.selenium.WebElement;
import java.util.*; import org.apache.commons.collections.*; import org.openqa.selenium.*;
[ "java.util", "org.apache.commons", "org.openqa.selenium" ]
java.util; org.apache.commons; org.openqa.selenium;
133,584
public long insert(String table, String nullColumnHack, ContentValues values) { try { return insertWithOnConflict(table, nullColumnHack, values, CONFLICT_NONE); } catch (SQLException e) { Log.e(TAG, "Error inserting " + values, e); return -1; } }
long function(String table, String nullColumnHack, ContentValues values) { try { return insertWithOnConflict(table, nullColumnHack, values, CONFLICT_NONE); } catch (SQLException e) { Log.e(TAG, STR + values, e); return -1; } }
/** * Convenience method for inserting a row into the database. * * @param table the table to insert the row into * @param nullColumnHack optional; may be <code>null</code>. * SQL doesn't allow inserting a completely empty row without * naming at least one column name...
Convenience method for inserting a row into the database
insert
{ "repo_name": "szpaddy/android-4.1.2_r2-core", "path": "java/android/database/sqlite/SQLiteDatabase.java", "license": "apache-2.0", "size": 94045 }
[ "android.content.ContentValues", "android.database.SQLException", "android.util.Log" ]
import android.content.ContentValues; import android.database.SQLException; import android.util.Log;
import android.content.*; import android.database.*; import android.util.*;
[ "android.content", "android.database", "android.util" ]
android.content; android.database; android.util;
2,449,947
public OffsetCriteria withOffsetString(String offsetString) { Preconditions.checkNotNull(offsetString, "Must provide offset string"); if (offsetString.equalsIgnoreCase(OffsetType.SMALLEST.toString())) { _offsetCriteria.setOffsetType(OffsetType.SMALLEST); } else if (offsetString.equalsIgno...
OffsetCriteria function(String offsetString) { Preconditions.checkNotNull(offsetString, STR); if (offsetString.equalsIgnoreCase(OffsetType.SMALLEST.toString())) { _offsetCriteria.setOffsetType(OffsetType.SMALLEST); } else if (offsetString.equalsIgnoreCase(OffsetType.LARGEST.toString())) { _offsetCriteria.setOffsetType(...
/** * Builds an {@link OffsetCriteria} with the right {@link OffsetType} given the offset string * @param offsetString * @return */
Builds an <code>OffsetCriteria</code> with the right <code>OffsetType</code> given the offset string
withOffsetString
{ "repo_name": "linkedin/pinot", "path": "pinot-spi/src/main/java/org/apache/pinot/spi/stream/OffsetCriteria.java", "license": "apache-2.0", "size": 6409 }
[ "com.google.common.base.Preconditions", "org.apache.pinot.spi.utils.TimeUtils" ]
import com.google.common.base.Preconditions; import org.apache.pinot.spi.utils.TimeUtils;
import com.google.common.base.*; import org.apache.pinot.spi.utils.*;
[ "com.google.common", "org.apache.pinot" ]
com.google.common; org.apache.pinot;
16,994
List<AbstractStorageLabel<?>> getAllLabels();
List<AbstractStorageLabel<?>> getAllLabels();
/** * Returns all labels registered on the CMR. The labels returned are only the one that are saved * on the CMR database for purpose of label suggestions. * * @return Returns all labels registered on the CMR. */
Returns all labels registered on the CMR. The labels returned are only the one that are saved on the CMR database for purpose of label suggestions
getAllLabels
{ "repo_name": "inspectIT/inspectIT", "path": "inspectit.shared.cs/src/main/java/rocks/inspectit/shared/cs/cmr/service/IStorageService.java", "license": "agpl-3.0", "size": 23065 }
[ "java.util.List", "rocks.inspectit.shared.cs.storage.label.AbstractStorageLabel" ]
import java.util.List; import rocks.inspectit.shared.cs.storage.label.AbstractStorageLabel;
import java.util.*; import rocks.inspectit.shared.cs.storage.label.*;
[ "java.util", "rocks.inspectit.shared" ]
java.util; rocks.inspectit.shared;
2,454,114
AnalyzeTableHandle beginStatisticsCollection(Session session, TableHandle tableHandle);
AnalyzeTableHandle beginStatisticsCollection(Session session, TableHandle tableHandle);
/** * Begin statistics collection */
Begin statistics collection
beginStatisticsCollection
{ "repo_name": "ptkool/presto", "path": "presto-main/src/main/java/com/facebook/presto/metadata/Metadata.java", "license": "apache-2.0", "size": 17661 }
[ "com.facebook.presto.Session", "com.facebook.presto.spi.TableHandle" ]
import com.facebook.presto.Session; import com.facebook.presto.spi.TableHandle;
import com.facebook.presto.*; import com.facebook.presto.spi.*;
[ "com.facebook.presto" ]
com.facebook.presto;
2,099,345
public static <ReqT, RespT> ServerCallHandler<ReqT, RespT> asyncUnaryCall( UnaryMethod<ReqT, RespT> method) { return new UnaryServerCallHandler<>(method, false); }
static <ReqT, RespT> ServerCallHandler<ReqT, RespT> function( UnaryMethod<ReqT, RespT> method) { return new UnaryServerCallHandler<>(method, false); }
/** * Creates a {@link ServerCallHandler} for a unary call method of the service. * * @param method an adaptor to the actual method on the service implementation. */
Creates a <code>ServerCallHandler</code> for a unary call method of the service
asyncUnaryCall
{ "repo_name": "dapengzhang0/grpc-java", "path": "stub/src/main/java/io/grpc/stub/ServerCalls.java", "license": "apache-2.0", "size": 16937 }
[ "io.grpc.ServerCallHandler" ]
import io.grpc.ServerCallHandler;
import io.grpc.*;
[ "io.grpc" ]
io.grpc;
5,963
public static IntegerVerifier verify(final Integer value) { return verify(value, null); }
static IntegerVerifier function(final Integer value) { return verify(value, null); }
/** * <p> * Starts a chain for verifying the specified {@code value} as an integer using an {@link IntegerVerifier}. * </p> * <p> * If {@code value} fails any subsequent verifications within this chain a {@link VerifierException} will be thrown * immediately by the method for the offending...
Starts a chain for verifying the specified value as an integer using an <code>IntegerVerifier</code>. If value fails any subsequent verifications within this chain a <code>VerifierException</code> will be thrown immediately by the method for the offending verification.
verify
{ "repo_name": "Skelp/verifier", "path": "src/main/java/org/notninja/verifier/Verifier.java", "license": "mit", "size": 49484 }
[ "org.notninja.verifier.type.IntegerVerifier" ]
import org.notninja.verifier.type.IntegerVerifier;
import org.notninja.verifier.type.*;
[ "org.notninja.verifier" ]
org.notninja.verifier;
2,253,890
protected void pop() throws EmptyStackException { EventQueue previous = prev; if (previous == null) throw new EmptyStackException(); synchronized (previous) { synchronized (this) { EventQueue nextQueue = next; if (nextQueue != null) ...
void function() throws EmptyStackException { EventQueue previous = prev; if (previous == null) throw new EmptyStackException(); synchronized (previous) { synchronized (this) { EventQueue nextQueue = next; if (nextQueue != null) { nextQueue.pop(); } else { previous.next = null; while (peekEvent() != null) { try { previo...
/** Transfer any pending events from this queue back to the parent queue that * was previously push()ed. Event dispatch from this queue is suspended. * * @exception EmptyStackException If no previous push was made on this * EventQueue. */
Transfer any pending events from this queue back to the parent queue that was previously push()ed. Event dispatch from this queue is suspended
pop
{ "repo_name": "SanDisk-Open-Source/SSD_Dashboard", "path": "uefi/gcc/gcc-4.6.3/libjava/classpath/java/awt/EventQueue.java", "license": "gpl-2.0", "size": 20450 }
[ "java.util.EmptyStackException" ]
import java.util.EmptyStackException;
import java.util.*;
[ "java.util" ]
java.util;
2,397,082
@Test public void testQuintic() { double[] c = { 0, 0, 15, -13, -3, 1 }; PolynomialFunction f = new PolynomialFunction(c); // verify that we are equal to c[0] when x=0 Assert.assertEquals(f.value(0), c[0], tolerance); // now check a few other places Assert.asser...
void function() { double[] c = { 0, 0, 15, -13, -3, 1 }; PolynomialFunction f = new PolynomialFunction(c); Assert.assertEquals(f.value(0), c[0], tolerance); Assert.assertEquals(0, f.value(5), tolerance); Assert.assertEquals(0, f.value(1), tolerance); Assert.assertEquals(0, f.value(-3), tolerance); Assert.assertEquals(5...
/** * This will test the quintic function * f(x) = x^2(x-5)(x+3)(x-1) = x^5 - 3x^4 -13x^3 + 15x^2</p> */
This will test the quintic function f(x) = x^2(x-5)(x+3)(x-1) = x^5 - 3x^4 -13x^3 + 15x^2
testQuintic
{ "repo_name": "venkateshamurthy/java-quantiles", "path": "src/test/java/org/apache/commons/math3/analysis/polynomials/PolynomialFunctionTest.java", "license": "apache-2.0", "size": 10012 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
999,698
public Long inc(KeyInfo keyInfo, int increment, int expires) throws MyException { ServerInfo server; ProtoCommon.PkgHeader header; byte[] bsPackage; int offset; int value_len; header = new ProtoCommon.PkgHeader(); header.key_hash_code = keyInfo.getHashCode();...
Long function(KeyInfo keyInfo, int increment, int expires) throws MyException { ServerInfo server; ProtoCommon.PkgHeader header; byte[] bsPackage; int offset; int value_len; header = new ProtoCommon.PkgHeader(); header.key_hash_code = keyInfo.getHashCode(); server = this.serverGroup.getServer(header.key_hash_code); if ...
/** * retrieve value of key * * @param keyInfo the key to get * @param increment increment value * @param expires expire timestamp, ProtoCommon.FDHT_EXPIRES_NEVER for never expired * @return none null for success, null for fail */
retrieve value of key
inc
{ "repo_name": "chen1457789/iBase4J", "path": "iBase4J-Common/src/main/java/org/csource/fastdht/FastDHTClient.java", "license": "apache-2.0", "size": 32184 }
[ "java.io.IOException", "java.io.OutputStream", "org.csource.common.MyException" ]
import java.io.IOException; import java.io.OutputStream; import org.csource.common.MyException;
import java.io.*; import org.csource.common.*;
[ "java.io", "org.csource.common" ]
java.io; org.csource.common;
1,170,442
public static @Nullable String build(@Nullable final Enumeration<?> enumeration, final boolean indent) { final Buffer buffer = new Buffer(); buildWithIndent(buffer, enumeration, indent ? DEFAULT_INDENTATION : null); if (buffer.size() == 0) return null; try { return buffer.readUtf8(); } f...
static @Nullable String function(@Nullable final Enumeration<?> enumeration, final boolean indent) { final Buffer buffer = new Buffer(); buildWithIndent(buffer, enumeration, indent ? DEFAULT_INDENTATION : null); if (buffer.size() == 0) return null; try { return buffer.readUtf8(); } finally { buffer.close(); } }
/** * Converts the given list (enumeration) representation of a json array to its string representation. * @param enumeration the json array. * @param indent whether to indent (2 spaces) the result or not. * @return either a string or null if the enumeration doesn't represent a valid json array. */
Converts the given list (enumeration) representation of a json array to its string representation
build
{ "repo_name": "programingjd/okjson", "path": "src/main/java/info/jdavid/ok/json/Builder.java", "license": "apache-2.0", "size": 25524 }
[ "java.util.Enumeration", "javax.annotation.Nullable" ]
import java.util.Enumeration; import javax.annotation.Nullable;
import java.util.*; import javax.annotation.*;
[ "java.util", "javax.annotation" ]
java.util; javax.annotation;
2,316,143
protected Refactoring createRefactoring(final RefactoringDescriptor descriptor, final RefactoringStatus status, final IProgressMonitor monitor) throws CoreException { try { Assert.isNotNull(descriptor); return createRefactoring(descriptor, status); // call for backward compatibility } finally { if (moni...
Refactoring function(final RefactoringDescriptor descriptor, final RefactoringStatus status, final IProgressMonitor monitor) throws CoreException { try { Assert.isNotNull(descriptor); return createRefactoring(descriptor, status); } finally { if (monitor != null) { monitor.done(); } } }
/** * Method which is called to create a refactoring instance from a * refactoring descriptor. The refactoring must be in an initialized state * at the return of the method call. The default implementation delegates * the task to the refactoring descriptor. * * @param descriptor * the refactori...
Method which is called to create a refactoring instance from a refactoring descriptor. The refactoring must be in an initialized state at the return of the method call. The default implementation delegates the task to the refactoring descriptor
createRefactoring
{ "repo_name": "dhuebner/che", "path": "plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/PerformRefactoringHistoryOperation.java", "license": "epl-1.0", "size": 10028 }
[ "org.eclipse.core.runtime.Assert", "org.eclipse.core.runtime.CoreException", "org.eclipse.core.runtime.IProgressMonitor" ]
import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.*;
[ "org.eclipse.core" ]
org.eclipse.core;
1,319,665
public void excludeFields(String... fieldKeys) { HashSet<String> fieldKeysToRemove = new HashSet<>(Arrays.asList(fieldKeys)); this.itemMap.keySet().removeAll(fieldKeysToRemove); }
void function(String... fieldKeys) { HashSet<String> fieldKeysToRemove = new HashSet<>(Arrays.asList(fieldKeys)); this.itemMap.keySet().removeAll(fieldKeysToRemove); }
/** * Exclude some fields from current item * the excluded fields will not be available for output * * @param fieldKeys the names of fields to exclude */
Exclude some fields from current item the excluded fields will not be available for output
excludeFields
{ "repo_name": "ylimit/PrivacyStreams", "path": "privacystreams-android-sdk/src/main/java/io/github/privacystreams/core/Item.java", "license": "apache-2.0", "size": 6110 }
[ "java.util.Arrays", "java.util.HashSet" ]
import java.util.Arrays; import java.util.HashSet;
import java.util.*;
[ "java.util" ]
java.util;
2,714,009
private static String getInstanceName(DetailAST methodCallAst) { final String methodCallName = FullIdent.createFullIdentBelow(methodCallAst).getText(); final int lastDotIndex = methodCallName.lastIndexOf('.'); String instanceName = ""; if (lastDotIndex != -1) { ...
static String function(DetailAST methodCallAst) { final String methodCallName = FullIdent.createFullIdentBelow(methodCallAst).getText(); final int lastDotIndex = methodCallName.lastIndexOf('.'); String instanceName = ""; if (lastDotIndex != -1) { instanceName = methodCallName.substring(0, lastDotIndex); } return instan...
/** * Get name of instance whose method is called. * @param methodCallAst * DetailAST of METHOD_CALL. * @return name of instance. */
Get name of instance whose method is called
getInstanceName
{ "repo_name": "Bhavik3/checkstyle", "path": "src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/VariableDeclarationUsageDistanceCheck.java", "license": "lgpl-2.1", "size": 32428 }
[ "com.puppycrawl.tools.checkstyle.api.DetailAST", "com.puppycrawl.tools.checkstyle.api.FullIdent" ]
import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.FullIdent;
import com.puppycrawl.tools.checkstyle.api.*;
[ "com.puppycrawl.tools" ]
com.puppycrawl.tools;
2,090,635
protected synchronized RSAPrivateKey getPrivateKey() { try { ConfidentialStore cs = ConfidentialStore.get(); if (priv == null || cs != lastCS) { lastCS = cs; byte[] payload = load(); if (payload == null) { KeyPairGen...
synchronized RSAPrivateKey function() { try { ConfidentialStore cs = ConfidentialStore.get(); if (priv == null cs != lastCS) { lastCS = cs; byte[] payload = load(); if (payload == null) { KeyPairGenerator gen = KeyPairGenerator.getInstance("RSA"); gen.initialize(2048, new SecureRandom()); KeyPair keys = gen.generateKey...
/** * Obtains the private key (lazily.) * <p> * This method is not publicly exposed as per the design principle of {@link ConfidentialKey}. * Instead of exposing private key, define methods that use them in specific way, such as * {@link RSADigitalSignatureConfidentialKey}. * * @throw...
Obtains the private key (lazily.) This method is not publicly exposed as per the design principle of <code>ConfidentialKey</code>. Instead of exposing private key, define methods that use them in specific way, such as <code>RSADigitalSignatureConfidentialKey</code>
getPrivateKey
{ "repo_name": "stephenc/jenkins", "path": "core/src/main/java/jenkins/security/RSAConfidentialKey.java", "license": "mit", "size": 4313 }
[ "java.io.IOException", "java.security.GeneralSecurityException", "java.security.KeyFactory", "java.security.KeyPair", "java.security.KeyPairGenerator", "java.security.SecureRandom", "java.security.interfaces.RSAPrivateCrtKey", "java.security.interfaces.RSAPrivateKey", "java.security.interfaces.RSAPu...
import java.io.IOException; import java.security.GeneralSecurityException; import java.security.KeyFactory; import java.security.KeyPair; import java.security.KeyPairGenerator; import java.security.SecureRandom; import java.security.interfaces.RSAPrivateCrtKey; import java.security.interfaces.RSAPrivateKey; import java...
import java.io.*; import java.security.*; import java.security.interfaces.*; import java.security.spec.*;
[ "java.io", "java.security" ]
java.io; java.security;
1,579,969
private void updateItem(int slot) { ItemStack source = getItem(slot); slots[slot] = source == null ? null : source.clone(); }
void function(int slot) { ItemStack source = getItem(slot); slots[slot] = source == null ? null : source.clone(); }
/** * Update the given slot with the current value from the inventory. * * @param slot The slot to update. */
Update the given slot with the current value from the inventory
updateItem
{ "repo_name": "LukBukkit/GlowstonePlusPlus", "path": "src/main/java/net/glowstone/inventory/EquipmentMonitor.java", "license": "mit", "size": 3048 }
[ "org.bukkit.inventory.ItemStack" ]
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.*;
[ "org.bukkit.inventory" ]
org.bukkit.inventory;
941,362
public List<StorageQueue> getAllStorageQueues() { return new ArrayList<>(storageQueueMap.values()); }
List<StorageQueue> function() { return new ArrayList<>(storageQueueMap.values()); }
/** * Get all storage queues registered in the broker. * * @return a list of queues */
Get all storage queues registered in the broker
getAllStorageQueues
{ "repo_name": "indikasampath2000/andes", "path": "modules/andes-core/broker/src/main/java/org/wso2/andes/kernel/registry/StorageQueueRegistry.java", "license": "apache-2.0", "size": 6433 }
[ "java.util.ArrayList", "java.util.List", "org.wso2.andes.kernel.subscription.StorageQueue" ]
import java.util.ArrayList; import java.util.List; import org.wso2.andes.kernel.subscription.StorageQueue;
import java.util.*; import org.wso2.andes.kernel.subscription.*;
[ "java.util", "org.wso2.andes" ]
java.util; org.wso2.andes;
1,619,159
private void downloadDB(String langCode, int category) { final ProgressDialog progressDialog = new ProgressDialog(context); progressDialog.setTitle(R.string.dialog_title_download_offline_db); progressDialog.setMessage(LanguageUtils.getLocalizedLanguageName(langCode) + " " + CategoryUtils.getNa...
void function(String langCode, int category) { final ProgressDialog progressDialog = new ProgressDialog(context); progressDialog.setTitle(R.string.dialog_title_download_offline_db); progressDialog.setMessage(LanguageUtils.getLocalizedLanguageName(langCode) + " " + CategoryUtils.getName(context, category)); progressDial...
/** * This shows a progress dialog to show the downloading progress. * * @param langCode */
This shows a progress dialog to show the downloading progress
downloadDB
{ "repo_name": "Vosie/WikiCards", "path": "src/org/vosie/wikicards/DownloadDBListAdapter.java", "license": "gpl-3.0", "size": 10848 }
[ "android.app.ProgressDialog", "org.vosie.wikicards.data.DownloadDBListener", "org.vosie.wikicards.data.WordsStorage", "org.vosie.wikicards.utils.CategoryUtils", "org.vosie.wikicards.utils.LanguageUtils" ]
import android.app.ProgressDialog; import org.vosie.wikicards.data.DownloadDBListener; import org.vosie.wikicards.data.WordsStorage; import org.vosie.wikicards.utils.CategoryUtils; import org.vosie.wikicards.utils.LanguageUtils;
import android.app.*; import org.vosie.wikicards.data.*; import org.vosie.wikicards.utils.*;
[ "android.app", "org.vosie.wikicards" ]
android.app; org.vosie.wikicards;
960,077
private void testLogForDumpWithURL(Path logFilePath, String path, long skipBytes, boolean expected) throws Exception { Pattern pattern = Pattern.compile("-+REQUEST-+.+" + path + ".+-+RESPONSE-+", Pattern.DOTALL); Matcher m; long startTime = System.currentTimeMillis(); boolean hasFou...
void function(Path logFilePath, String path, long skipBytes, boolean expected) throws Exception { Pattern pattern = Pattern.compile(STR + path + STR, Pattern.DOTALL); Matcher m; long startTime = System.currentTimeMillis(); boolean hasFound = false; long currTime; String content; do { currTime = System.currentTimeMillis...
/** * Searching log for request dump of request to particular path. If no such request dump is found there is sanity loop to * ensure that system has had enough time to write data to the disk. * * @param logFilePath path to log file * @param path URI path searched for in log file * ...
Searching log for request dump of request to particular path. If no such request dump is found there is sanity loop to ensure that system has had enough time to write data to the disk
testLogForDumpWithURL
{ "repo_name": "jstourac/wildfly", "path": "testsuite/integration/web/src/test/java/org/jboss/as/test/integration/web/handlers/RequestDumpingHandlerTestImpl.java", "license": "lgpl-2.1", "size": 18867 }
[ "java.nio.file.Path", "java.util.regex.Matcher", "java.util.regex.Pattern", "org.junit.Assert" ]
import java.nio.file.Path; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.junit.Assert;
import java.nio.file.*; import java.util.regex.*; import org.junit.*;
[ "java.nio", "java.util", "org.junit" ]
java.nio; java.util; org.junit;
185,175
Graph g = new Graph(); HashSet<Integer> nodes = new HashSet<Integer>(); //create for all nodes in the semantic graph a node for(int n =0;n< len;n++) { g.createNode(IGraph.NODE); nodes.add(n); } float best =Float.NEGATIVE_INFINITY; int s=-1,t=-1, edge=-1; for(int n1 : nodes) { for(in...
Graph g = new Graph(); HashSet<Integer> nodes = new HashSet<Integer>(); for(int n =0;n< len;n++) { g.createNode(IGraph.NODE); nodes.add(n); } float best =Float.NEGATIVE_INFINITY; int s=-1,t=-1, edge=-1; for(int n1 : nodes) { for(int n2 : nodes) { if (n1==n2) continue; for(int l =0;l < d.edge[0][0].length;l++) { if(best...
/** * Build a dependency tree based on the data * @param * @param pos part-of-speech tags * @param x the data * @param projective projective or non-projective * @param edges the edges * @return a parse tree * @throws InterruptedException */
Build a dependency tree based on the data
decode
{ "repo_name": "matxin/matxin-lineariser", "path": "tg/src/sem2syn2/Decoder.java", "license": "gpl-3.0", "size": 5602 }
[ "java.util.ArrayList", "java.util.HashSet" ]
import java.util.ArrayList; import java.util.HashSet;
import java.util.*;
[ "java.util" ]
java.util;
562,458
public static long indexOf(AbstractByteBuffer data, byte[] pattern, long fromOffset) throws IOException { long fileSize = data.getFileSize(); if (fileSize <= 0 || pattern.length == 0) { return -1; } int[] failure = computeFailure(pattern); AbstractByteBuffer.Cache...
static long function(AbstractByteBuffer data, byte[] pattern, long fromOffset) throws IOException { long fileSize = data.getFileSize(); if (fileSize <= 0 pattern.length == 0) { return -1; } int[] failure = computeFailure(pattern); AbstractByteBuffer.CacheStrategy cacheStrategy = data.getCacheStrategy(); data.setCacheSt...
/** * Returns the offset within the ByteBuffer of the first occurrence of the specified data, starting at the specified offset. * * @param data buffer for search * @param pattern the data to search for * @param fromOffset the offset from which to start the search * @return the offset of th...
Returns the offset within the ByteBuffer of the first occurrence of the specified data, starting at the specified offset
indexOf
{ "repo_name": "Keltek/mucommander", "path": "src/main/ru/trolsoft/hexeditor/search/ByteBufferSearchUtils.java", "license": "gpl-3.0", "size": 5843 }
[ "java.io.IOException", "ru.trolsoft.hexeditor.data.AbstractByteBuffer" ]
import java.io.IOException; import ru.trolsoft.hexeditor.data.AbstractByteBuffer;
import java.io.*; import ru.trolsoft.hexeditor.data.*;
[ "java.io", "ru.trolsoft.hexeditor" ]
java.io; ru.trolsoft.hexeditor;
2,188,452
final Map<String, Tmetadata> bundleMetadata = new HashMap<String, Tmetadata>(); final ServiceReference<MetaTypeService> ref = ctx.getServiceReference(MetaTypeService.class); final MetaTypeService metaTypeService = ctx.getService(ref); try { final MetaTypeInformation mti = metaTypeS...
final Map<String, Tmetadata> bundleMetadata = new HashMap<String, Tmetadata>(); final ServiceReference<MetaTypeService> ref = ctx.getServiceReference(MetaTypeService.class); final MetaTypeService metaTypeService = ctx.getService(ref); try { final MetaTypeInformation mti = metaTypeService.getMetaTypeInformation(bnd); if...
/** * Returns a Map with all the MetaType Object Class Definitions contained in the bundle. * * @param ctx * @param bnd * @return */
Returns a Map with all the MetaType Object Class Definitions contained in the bundle
getMetadata
{ "repo_name": "cdealti/kura", "path": "kura/org.eclipse.kura.core.configuration/src/main/java/org/eclipse/kura/core/configuration/util/ComponentUtil.java", "license": "epl-1.0", "size": 16564 }
[ "java.util.ArrayList", "java.util.Arrays", "java.util.HashMap", "java.util.List", "java.util.Map", "org.eclipse.kura.core.configuration.metatype.Tmetadata", "org.osgi.framework.ServiceReference", "org.osgi.service.metatype.MetaTypeInformation", "org.osgi.service.metatype.MetaTypeService" ]
import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.eclipse.kura.core.configuration.metatype.Tmetadata; import org.osgi.framework.ServiceReference; import org.osgi.service.metatype.MetaTypeInformation; import org.osgi.service.metatype.Me...
import java.util.*; import org.eclipse.kura.core.configuration.metatype.*; import org.osgi.framework.*; import org.osgi.service.metatype.*;
[ "java.util", "org.eclipse.kura", "org.osgi.framework", "org.osgi.service" ]
java.util; org.eclipse.kura; org.osgi.framework; org.osgi.service;
1,401,582
public final void init(Key key, SecureRandom random) throws InvalidKeyException { spiImpl.engineInit(key, random); }
final void function(Key key, SecureRandom random) throws InvalidKeyException { spiImpl.engineInit(key, random); }
/** * Initializes this {@code KeyAgreement} with the specified key and the * specified randomness source. * * @param key * the key to initialize this key agreement. * @param random * the source for any randomness needed. * @throws InvalidKeyException * ...
Initializes this KeyAgreement with the specified key and the specified randomness source
init
{ "repo_name": "JSDemos/android-sdk-20", "path": "src/javax/crypto/KeyAgreement.java", "license": "apache-2.0", "size": 11952 }
[ "java.security.InvalidKeyException", "java.security.Key", "java.security.SecureRandom" ]
import java.security.InvalidKeyException; import java.security.Key; import java.security.SecureRandom;
import java.security.*;
[ "java.security" ]
java.security;
2,484,436
@Override public String getCreateChildText(Object owner, Object feature, Object child, Collection<?> selection) { Object childFeature = feature; Object childObject = child; boolean qualify = childFeature == SelPackage.Literals.FILL__FIELD || childFeature == SelPackage.Literals.FILL__VALUE; if (quali...
String function(Object owner, Object feature, Object child, Collection<?> selection) { Object childFeature = feature; Object childObject = child; boolean qualify = childFeature == SelPackage.Literals.FILL__FIELD childFeature == SelPackage.Literals.FILL__VALUE; if (qualify) { return getString (STR, new Object[] { getTyp...
/** * This returns the label text for {@link org.eclipse.emf.edit.command.CreateChildCommand}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This returns the label text for <code>org.eclipse.emf.edit.command.CreateChildCommand</code>.
getCreateChildText
{ "repo_name": "afraisse/BrowserAutomationDSL", "path": "Selenium.edit/src/org/xtext/emn/selenium/sel/provider/FillItemProvider.java", "license": "gpl-3.0", "size": 8840 }
[ "java.util.Collection", "org.xtext.emn.selenium.sel.SelPackage" ]
import java.util.Collection; import org.xtext.emn.selenium.sel.SelPackage;
import java.util.*; import org.xtext.emn.selenium.sel.*;
[ "java.util", "org.xtext.emn" ]
java.util; org.xtext.emn;
2,127,264
public static AllocateIds allocate(final List<Key> keys) { return new AllocateIds(keys); }
static AllocateIds function(final List<Key> keys) { return new AllocateIds(keys); }
/** * Start building a new ALLOCATE query. * * @param keys list of partial keys to allocate. * @return an in-construction ALLOCATE query. */
Start building a new ALLOCATE query
allocate
{ "repo_name": "spotify/async-datastore-client", "path": "src/main/java/com/spotify/asyncdatastoreclient/QueryBuilder.java", "license": "apache-2.0", "size": 11222 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,208,461
protected static Document loadTestSuiteDocument(String testSuiteURI) throws TestException{ Document doc = null; try{ DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); doc = docBuilder.parse(testSuiteURI); ...
static Document function(String testSuiteURI) throws TestException{ Document doc = null; try{ DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); doc = docBuilder.parse(testSuiteURI); }catch(Exception e){ StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.p...
/** * Loads the URI as a <tt>Document</tt> */
Loads the URI as a Document
loadTestSuiteDocument
{ "repo_name": "Uni-Sol/batik", "path": "test-sources/org/apache/batik/test/xml/XMLTestSuiteLoader.java", "license": "apache-2.0", "size": 6046 }
[ "java.io.PrintWriter", "java.io.StringWriter", "javax.xml.parsers.DocumentBuilder", "javax.xml.parsers.DocumentBuilderFactory", "org.apache.batik.test.TestException", "org.w3c.dom.Document" ]
import java.io.PrintWriter; import java.io.StringWriter; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.apache.batik.test.TestException; import org.w3c.dom.Document;
import java.io.*; import javax.xml.parsers.*; import org.apache.batik.test.*; import org.w3c.dom.*;
[ "java.io", "javax.xml", "org.apache.batik", "org.w3c.dom" ]
java.io; javax.xml; org.apache.batik; org.w3c.dom;
1,133,154
public void run() { int length; char cs[] = new char[256]; int ioErrorCount = 0; Reader reader = pair.getReader(); log.fine("Starting primary loop"); while ( !stopRequested && !foundEOF && ioErrorCount < 4) { try { log.fin...
void function() { int length; char cs[] = new char[256]; int ioErrorCount = 0; Reader reader = pair.getReader(); log.fine(STR); while ( !stopRequested && !foundEOF && ioErrorCount < 4) { try { log.finest(STR); boolean ready = false; try { ready = reader.ready(); if( reader.markSupported() ) log.fine(STR); } catch(Excep...
/** * TODO Handle timeout of zero to expect, that shouldn't wait */
TODO Handle timeout of zero to expect, that shouldn't wait
run
{ "repo_name": "icanfly/expect4j", "path": "src/main/java/expect4j/PollingConsumer.java", "license": "apache-2.0", "size": 8842 }
[ "java.io.IOException", "java.io.Reader", "java.util.logging.Level" ]
import java.io.IOException; import java.io.Reader; import java.util.logging.Level;
import java.io.*; import java.util.logging.*;
[ "java.io", "java.util" ]
java.io; java.util;
422,654
@Test public void testOneOffPatchModifyingAMiscFileDeletingAnotherMiscFile() throws Exception { // prepare the patch String patchID = randomString(); File oneOffPatchDir = mkdir(tempDir, patchID); final String testFilePath1 = AS_DISTRIBUTION + FILE_SEPARATOR + "README.txt"; ...
void function() throws Exception { String patchID = randomString(); File oneOffPatchDir = mkdir(tempDir, patchID); final String testFilePath1 = AS_DISTRIBUTION + FILE_SEPARATOR + STR; final String testContent1 = STR; final String originalContent1 = readFile(testFilePath1); final String testFilePathDeleted = AS_DISTRIBU...
/** * Prepare a one-off patch which modifies misc file and deletes another misc file. Apply it, check that the files was replaced a deleted. * Roll it back, check that the files was restored, created and apply it again to make sure re-applying works as expected */
Prepare a one-off patch which modifies misc file and deletes another misc file. Apply it, check that the files was replaced a deleted. Roll it back, check that the files was restored, created and apply it again to make sure re-applying works as expected
testOneOffPatchModifyingAMiscFileDeletingAnotherMiscFile
{ "repo_name": "jamezp/wildfly-core", "path": "testsuite/patching/src/test/java/org/jboss/as/test/patching/BasicOneOffPatchingScenariosTestCase.java", "license": "lgpl-2.1", "size": 90564 }
[ "java.io.File", "org.jboss.as.patching.IoUtils", "org.jboss.as.patching.metadata.ContentModification", "org.jboss.as.test.patching.PatchingTestUtil" ]
import java.io.File; import org.jboss.as.patching.IoUtils; import org.jboss.as.patching.metadata.ContentModification; import org.jboss.as.test.patching.PatchingTestUtil;
import java.io.*; import org.jboss.as.patching.*; import org.jboss.as.patching.metadata.*; import org.jboss.as.test.patching.*;
[ "java.io", "org.jboss.as" ]
java.io; org.jboss.as;
2,018,614
public static <T> T fromJSON(final String json, final Class<T> c) throws IOException { return constructJackson().readValue(json, c); }
static <T> T function(final String json, final Class<T> c) throws IOException { return constructJackson().readValue(json, c); }
/** * fromJSON method will accept a JSON string and Class template * and will deserialize the JSON to that Class. * * NOTE: Written for perfomance thus NULL checks are not performed. * * @param <T> Type of the class object. * * @param json * A valid JSON document. * @param c * ...
fromJSON method will accept a JSON string and Class template and will deserialize the JSON to that Class
fromJSON
{ "repo_name": "Bjond/bjond-utilities", "path": "src/main/java/com/bjond/utilities/JSONUtils.java", "license": "apache-2.0", "size": 6944 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,917,726
private boolean isFormSubmission(HttpServletRequest request) { return "POST".equals(request.getMethod()); }
boolean function(HttpServletRequest request) { return "POST".equals(request.getMethod()); }
/** * Determine if the given request represents a form submission. * * @param request current HTTP request * @return if the request represents a form submission */
Determine if the given request represents a form submission
isFormSubmission
{ "repo_name": "MadMarty/madsonic-server-5.1", "path": "madsonic-main/src/main/java/org/madsonic/controller/LastFMSettingsController.java", "license": "gpl-3.0", "size": 5468 }
[ "javax.servlet.http.HttpServletRequest" ]
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.*;
[ "javax.servlet" ]
javax.servlet;
430,618
protected Collection<String> getInitialObjectNames() { if (initialObjectNames == null) { initialObjectNames = new ArrayList<String>(); for (EClassifier eClassifier : occiPackage.getEClassifiers()) { if (eClassifier instanceof EClass) { EClass eClass = (EClass)eClassifier; if (!eClass.isAbstract...
Collection<String> function() { if (initialObjectNames == null) { initialObjectNames = new ArrayList<String>(); for (EClassifier eClassifier : occiPackage.getEClassifiers()) { if (eClassifier instanceof EClass) { EClass eClass = (EClass)eClassifier; if (!eClass.isAbstract()) { initialObjectNames.add(eClass.getName()); ...
/** * Returns the names of the types that can be created as the root object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
Returns the names of the types that can be created as the root object.
getInitialObjectNames
{ "repo_name": "occiware/OCCI-Studio", "path": "plugins/org.eclipse.cmf.occi.core.editor/src-gen/org/eclipse/cmf/occi/core/presentation/OCCIModelWizard.java", "license": "epl-1.0", "size": 17927 }
[ "java.util.ArrayList", "java.util.Collection", "java.util.Collections", "org.eclipse.emf.common.CommonPlugin", "org.eclipse.emf.ecore.EClass", "org.eclipse.emf.ecore.EClassifier" ]
import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import org.eclipse.emf.common.CommonPlugin; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EClassifier;
import java.util.*; import org.eclipse.emf.common.*; import org.eclipse.emf.ecore.*;
[ "java.util", "org.eclipse.emf" ]
java.util; org.eclipse.emf;
1,288,156
public static String join(List<String> strings, String separator) { return join(strings, separator, false, false); }
static String function(List<String> strings, String separator) { return join(strings, separator, false, false); }
/** * Join all strings into a new concatenated string. * @param strings * @param separator * @return concatenated string with separator in between elements. */
Join all strings into a new concatenated string
join
{ "repo_name": "vtkio/vtk", "path": "src/main/java/vtk/util/text/TextUtils.java", "license": "bsd-3-clause", "size": 26605 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,274,252
@Override public String getCalendarType() { return calendarType; } //----------------------------------------------------------------------- /** * Obtains a local date in Hijrah calendar system from the * era, year-of-era, month-of-year and day-of-month fields. * * @para...
String function() { return calendarType; } /** * Obtains a local date in Hijrah calendar system from the * era, year-of-era, month-of-year and day-of-month fields. * * @param era the Hijrah era, not null * @param yearOfEra the year-of-era * @param month the month-of-year * @param dayOfMonth the day-of-month * @return t...
/** * Gets the calendar type of the Islamic calendar. * <p> * The calendar type is an identifier defined by the * <em>Unicode Locale Data Markup Language (LDML)</em> specification. * It can be used to lookup the {@code Chronology} using {@link Chronology#of(String)}. * * @return the c...
Gets the calendar type of the Islamic calendar. The calendar type is an identifier defined by the Unicode Locale Data Markup Language (LDML) specification. It can be used to lookup the Chronology using <code>Chronology#of(String)</code>
getCalendarType
{ "repo_name": "md-5/jdk10", "path": "src/java.base/share/classes/java/time/chrono/HijrahChronology.java", "license": "gpl-2.0", "size": 38126 }
[ "java.time.DateTimeException" ]
import java.time.DateTimeException;
import java.time.*;
[ "java.time" ]
java.time;
1,843,010
public static native int crc16X25CCITT(JBuffer buffer, int offset, int length);
static native int function(JBuffer buffer, int offset, int length);
/** * Calculate CCITT CRC16 X.25 checksum using a CCITT seed. * * @param buffer * buffer to calculate crc on * @param offset * offset into the buffer * @param length * length within the buffer * @return calculated crc */
Calculate CCITT CRC16 X.25 checksum using a CCITT seed
crc16X25CCITT
{ "repo_name": "pvenne/jgoose", "path": "libs/JNetPcap_1_4/src/java1.5/org/jnetpcap/util/checksum/Checksum.java", "license": "gpl-3.0", "size": 7821 }
[ "org.jnetpcap.nio.JBuffer" ]
import org.jnetpcap.nio.JBuffer;
import org.jnetpcap.nio.*;
[ "org.jnetpcap.nio" ]
org.jnetpcap.nio;
2,577,407
protected void waitForBackup(ClientSessionFactoryInternal sessionFactory, int seconds) throws Exception { final ActiveMQServerImpl actualServer = (ActiveMQServerImpl) backupServer.getServer(); if (actualServer.getHAPolicy().isSharedStore()) { waitForServerToStart(actualServer); } else { ...
void function(ClientSessionFactoryInternal sessionFactory, int seconds) throws Exception { final ActiveMQServerImpl actualServer = (ActiveMQServerImpl) backupServer.getServer(); if (actualServer.getHAPolicy().isSharedStore()) { waitForServerToStart(actualServer); } else { waitForRemoteBackup(sessionFactory, seconds, tr...
/** * Waits for backup to be in the "started" state and to finish synchronization with its live. * * @param sessionFactory * @param seconds * @throws Exception */
Waits for backup to be in the "started" state and to finish synchronization with its live
waitForBackup
{ "repo_name": "tabish121/activemq-artemis", "path": "tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTestBase.java", "license": "apache-2.0", "size": 17428 }
[ "org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryInternal", "org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl" ]
import org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryInternal; import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl;
import org.apache.activemq.artemis.core.client.impl.*; import org.apache.activemq.artemis.core.server.impl.*;
[ "org.apache.activemq" ]
org.apache.activemq;
909,630
protected boolean flow(DiGraphNode<N, Branch> node) { FlowState<L> state = node.getAnnotation(); if (isForward()) { L outBefore = state.out; state.out = flowThrough(node.getValue(), state.in); return !outBefore.equals(state.out); } else { L inBefore = state.in; state.in = flo...
boolean function(DiGraphNode<N, Branch> node) { FlowState<L> state = node.getAnnotation(); if (isForward()) { L outBefore = state.out; state.out = flowThrough(node.getValue(), state.in); return !outBefore.equals(state.out); } else { L inBefore = state.in; state.in = flowThrough(node.getValue(), state.out); return !inBe...
/** * Performs a single flow through a node. * * @return {@code true} if the flow state differs from the previous state. */
Performs a single flow through a node
flow
{ "repo_name": "dushmis/closure-compiler", "path": "src/com/google/javascript/jscomp/DataFlowAnalysis.java", "license": "apache-2.0", "size": 18857 }
[ "com.google.javascript.jscomp.ControlFlowGraph", "com.google.javascript.jscomp.graph.DiGraph" ]
import com.google.javascript.jscomp.ControlFlowGraph; import com.google.javascript.jscomp.graph.DiGraph;
import com.google.javascript.jscomp.*; import com.google.javascript.jscomp.graph.*;
[ "com.google.javascript" ]
com.google.javascript;
491,212
public List<EvalTemplateItem> getBlockChildTemplateItemsForBlockParent(Long parentId, boolean includeParent); // PERMISSIONS
List<EvalTemplateItem> function(Long parentId, boolean includeParent);
/** * Get the child block templateItems for a parent templateItem, * optionally include the parent templateItem, * returns the items in display order (with parent first if requested) * * @param parentId the unique id of the parent {@link EvalTemplateItem} object * @param includeParent if false ...
Get the child block templateItems for a parent templateItem, optionally include the parent templateItem, returns the items in display order (with parent first if requested)
getBlockChildTemplateItemsForBlockParent
{ "repo_name": "sakaiproject/evaluation", "path": "sakai-evaluation-api/src/java/org/sakaiproject/evaluation/logic/EvalAuthoringService.java", "license": "apache-2.0", "size": 35963 }
[ "java.util.List", "org.sakaiproject.evaluation.model.EvalTemplateItem" ]
import java.util.List; import org.sakaiproject.evaluation.model.EvalTemplateItem;
import java.util.*; import org.sakaiproject.evaluation.model.*;
[ "java.util", "org.sakaiproject.evaluation" ]
java.util; org.sakaiproject.evaluation;
2,422,601
return create(vertx, clientId, clientSecret, new HttpClientOptions()); }
return create(vertx, clientId, clientSecret, new HttpClientOptions()); }
/** * Create a OAuth2Auth provider for Dropbox * * @param clientId the client id given to you by Dropbox * @param clientSecret the client secret given to you by Dropbox */
Create a OAuth2Auth provider for Dropbox
create
{ "repo_name": "nevenr/vertx-auth", "path": "vertx-auth-oauth2/src/main/java/io/vertx/ext/auth/oauth2/providers/DropboxAuth.java", "license": "apache-2.0", "size": 1638 }
[ "io.vertx.core.http.HttpClientOptions" ]
import io.vertx.core.http.HttpClientOptions;
import io.vertx.core.http.*;
[ "io.vertx.core" ]
io.vertx.core;
891,580
public void setResources(PDResources resources) { pageResources = resources; if (resources != null) { page.setItem(COSName.RESOURCES, resources); } else { page.removeItem(COSName.RESOURCES); } }
void function(PDResources resources) { pageResources = resources; if (resources != null) { page.setItem(COSName.RESOURCES, resources); } else { page.removeItem(COSName.RESOURCES); } }
/** * This will set the resources for this page. * * @param resources The new resources for this page. */
This will set the resources for this page
setResources
{ "repo_name": "ChunghwaTelecom/pdfbox", "path": "pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java", "license": "apache-2.0", "size": 20506 }
[ "org.apache.pdfbox.cos.COSName" ]
import org.apache.pdfbox.cos.COSName;
import org.apache.pdfbox.cos.*;
[ "org.apache.pdfbox" ]
org.apache.pdfbox;
298,553
public DateTime getMaxPhenomenonTime(Session session) { Criteria criteriaStart = session.createCriteria(getObservationTimeClass()) .setProjection(Projections.max(AbstractObservation.PHENOMENON_TIME_START)) .add(Restrictions.eq(AbstractObservat...
DateTime function(Session session) { Criteria criteriaStart = session.createCriteria(getObservationTimeClass()) .setProjection(Projections.max(AbstractObservation.PHENOMENON_TIME_START)) .add(Restrictions.eq(AbstractObservation.DELETED, false)); LOGGER.debug(STR, HibernateHelper.getSqlString(criteriaStart)); Object max...
/** * Get max phenomenon time from observations * * @param session * Hibernate session Hibernate session * * @return max time */
Get max phenomenon time from observations
getMaxPhenomenonTime
{ "repo_name": "johnjohndoe/SOS", "path": "hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/AbstractObservationDAO.java", "license": "gpl-2.0", "size": 54579 }
[ "org.hibernate.Criteria", "org.hibernate.Session", "org.hibernate.criterion.Projections", "org.hibernate.criterion.Restrictions", "org.joda.time.DateTime", "org.joda.time.DateTimeZone", "org.n52.sos.ds.hibernate.entities.AbstractObservation", "org.n52.sos.ds.hibernate.util.HibernateHelper" ]
import org.hibernate.Criteria; import org.hibernate.Session; import org.hibernate.criterion.Projections; import org.hibernate.criterion.Restrictions; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import org.n52.sos.ds.hibernate.entities.AbstractObservation; import org.n52.sos.ds.hibernate.util.Hiber...
import org.hibernate.*; import org.hibernate.criterion.*; import org.joda.time.*; import org.n52.sos.ds.hibernate.entities.*; import org.n52.sos.ds.hibernate.util.*;
[ "org.hibernate", "org.hibernate.criterion", "org.joda.time", "org.n52.sos" ]
org.hibernate; org.hibernate.criterion; org.joda.time; org.n52.sos;
104,528
public static Appender translateSinglePath(ARGPath pPath, RichModel model) { PathToRealCTranslator translator = new PathToRealCTranslator(); translator.translateSinglePath0(pPath, new RealCEdgeVisitor(translator, model.getExactVariableValuePath(pPath.getInnerEdges()))); return translator.generat...
static Appender function(ARGPath pPath, RichModel model) { PathToRealCTranslator translator = new PathToRealCTranslator(); translator.translateSinglePath0(pPath, new RealCEdgeVisitor(translator, model.getExactVariableValuePath(pPath.getInnerEdges()))); return translator.generateCCode(); }
/** * Transform a single linear path into C code. * The path needs to be loop free. * * TODO: Detect loops in the paths and signal an error. * Currently when there are loops, the generated C code is invalid * because there is a goto to a missing label. * * @param pPath The path. * @param mode...
Transform a single linear path into C code. The path needs to be loop free. Currently when there are loops, the generated C code is invalid because there is a goto to a missing label
translateSinglePath
{ "repo_name": "nishanttotla/predator", "path": "cpachecker/src/org/sosy_lab/cpachecker/util/cwriter/PathToRealCTranslator.java", "license": "gpl-3.0", "size": 3461 }
[ "org.sosy_lab.common.Appender", "org.sosy_lab.cpachecker.core.counterexample.RichModel", "org.sosy_lab.cpachecker.cpa.arg.ARGPath" ]
import org.sosy_lab.common.Appender; import org.sosy_lab.cpachecker.core.counterexample.RichModel; import org.sosy_lab.cpachecker.cpa.arg.ARGPath;
import org.sosy_lab.common.*; import org.sosy_lab.cpachecker.core.counterexample.*; import org.sosy_lab.cpachecker.cpa.arg.*;
[ "org.sosy_lab.common", "org.sosy_lab.cpachecker" ]
org.sosy_lab.common; org.sosy_lab.cpachecker;
774,914
public void testPoolMaxTasks() throws Exception { // Set up pools file PrintWriter out = new PrintWriter(new FileWriter(ALLOC_FILE)); out.println("<?xml version=\"1.0\"?>"); out.println("<allocations>"); out.println("<defaultMaxTotalInitedTasks>10</defaultMaxTotalInitedTasks>"); out.println("<...
void function() throws Exception { PrintWriter out = new PrintWriter(new FileWriter(ALLOC_FILE)); out.println(STR1.0\"?>"); out.println(STR); out.println(STR); out.println(STRdefault\">"); out.println(STR); out.println(STR); out.println(STR); out.close(); scheduler.getPoolManager().reloadAllocs(); JobInProgress job1 = ...
/** * This test starts by submitting four jobs in the default pool. However, the * maxTotalInitedTasks for this pool has been set to 40. We should see only * the first two jobs get initialized, each with half the total slots. */
This test starts by submitting four jobs in the default pool. However, the maxTotalInitedTasks for this pool has been set to 40. We should see only the first two jobs get initialized, each with half the total slots
testPoolMaxTasks
{ "repo_name": "jchen123/hadoop-20-warehouse-fix", "path": "src/contrib/fairscheduler/src/test/org/apache/hadoop/mapred/TestFairScheduler.java", "license": "apache-2.0", "size": 109598 }
[ "java.io.FileWriter", "java.io.PrintWriter", "org.apache.hadoop.mapred.FairScheduler", "org.apache.hadoop.mapred.JobStatus" ]
import java.io.FileWriter; import java.io.PrintWriter; import org.apache.hadoop.mapred.FairScheduler; import org.apache.hadoop.mapred.JobStatus;
import java.io.*; import org.apache.hadoop.mapred.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
1,708,826
@Override public void setScheme(String scheme) throws UnsupportedSchemeException { SchemeValues val = SchemeValues.match(scheme, 0, scheme.length()); if (null == val) { throw new UnsupportedSchemeException("Illegal scheme " + scheme); } setScheme(val); }
void function(String scheme) throws UnsupportedSchemeException { SchemeValues val = SchemeValues.match(scheme, 0, scheme.length()); if (null == val) { throw new UnsupportedSchemeException(STR + scheme); } setScheme(val); }
/** * Set the scheme value to the given input. * * @param scheme * @throws UnsupportedSchemeException */
Set the scheme value to the given input
setScheme
{ "repo_name": "kgibm/open-liberty", "path": "dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpRequestMessageImpl.java", "license": "epl-1.0", "size": 82823 }
[ "com.ibm.wsspi.genericbnf.exception.UnsupportedSchemeException", "com.ibm.wsspi.http.channel.values.SchemeValues" ]
import com.ibm.wsspi.genericbnf.exception.UnsupportedSchemeException; import com.ibm.wsspi.http.channel.values.SchemeValues;
import com.ibm.wsspi.genericbnf.exception.*; import com.ibm.wsspi.http.channel.values.*;
[ "com.ibm.wsspi" ]
com.ibm.wsspi;
372,163
Future<OperationStatusResponse> createAsync(NetworkReservedIPCreateParameters parameters);
Future<OperationStatusResponse> createAsync(NetworkReservedIPCreateParameters parameters);
/** * The Create Reserved IP operation creates a reserved IP from your the * subscription. * * @param parameters Required. Parameters supplied to the Create Reserved IP * operation. * @return The response body contains the status of the specified * asynchronous operation, indicating whether ...
The Create Reserved IP operation creates a reserved IP from your the subscription
createAsync
{ "repo_name": "oaastest/azure-sdk-for-java", "path": "management-network/src/main/java/com/microsoft/windowsazure/management/network/ReservedIPOperations.java", "license": "apache-2.0", "size": 13902 }
[ "com.microsoft.windowsazure.core.OperationStatusResponse", "com.microsoft.windowsazure.management.network.models.NetworkReservedIPCreateParameters", "java.util.concurrent.Future" ]
import com.microsoft.windowsazure.core.OperationStatusResponse; import com.microsoft.windowsazure.management.network.models.NetworkReservedIPCreateParameters; import java.util.concurrent.Future;
import com.microsoft.windowsazure.core.*; import com.microsoft.windowsazure.management.network.models.*; import java.util.concurrent.*;
[ "com.microsoft.windowsazure", "java.util" ]
com.microsoft.windowsazure; java.util;
758,238
private static void getChildDimensionDictionaryDetail(CarbonDimension queryDimensions, Set<String> dictionaryDimensionFromQuery) { for (int j = 0; j < queryDimensions.numberOfChild(); j++) { List<Encoding> encodingList = queryDimensions.getListOfChildDimensions().get(j).getEncoder(); if (queryDi...
static void function(CarbonDimension queryDimensions, Set<String> dictionaryDimensionFromQuery) { for (int j = 0; j < queryDimensions.numberOfChild(); j++) { List<Encoding> encodingList = queryDimensions.getListOfChildDimensions().get(j).getEncoder(); if (queryDimensions.getListOfChildDimensions().get(j).numberOfChild(...
/** * Below method will be used to fill the children dimension column id * * @param queryDimensions query dimension * @param dictionaryDimensionFromQuery dictionary dimension for query */
Below method will be used to fill the children dimension column id
getChildDimensionDictionaryDetail
{ "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.List", "java.util.Set", "org.apache.carbondata.core.metadata.encoder.Encoding", "org.apache.carbondata.core.metadata.schema.table.column.CarbonDimension", "org.apache.carbondata.core.util.CarbonUtil" ]
import java.util.List; import java.util.Set; import org.apache.carbondata.core.metadata.encoder.Encoding; import org.apache.carbondata.core.metadata.schema.table.column.CarbonDimension; import org.apache.carbondata.core.util.CarbonUtil;
import java.util.*; import org.apache.carbondata.core.metadata.encoder.*; import org.apache.carbondata.core.metadata.schema.table.column.*; import org.apache.carbondata.core.util.*;
[ "java.util", "org.apache.carbondata" ]
java.util; org.apache.carbondata;
922,312