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 setDetail(ContactDetail pubDetail) { if (pubDetail.getPK().equals(pk)) { if (pubDetail.getFirstName() != null) firstName = pubDetail.getFirstName(); if (pubDetail.getLastName() != null) lastName = pubDetail.getLastName(); if (pubDetail.getEmail() != null) email = pubDetail.getEmail(); if (pubDetail.getPhone() != null) phone = pubDetail.getPhone(); if (pubDetail.getFax() != null) fax = pubDetail.getFax(); userId = pubDetail.getUserId(); if (pubDetail.getCreationDate() != null) creationDate = pubDetail.getCreationDate(); if (pubDetail.getCreatorId() != null) creatorId = pubDetail.getCreatorId(); isModified = true; } else { throw new ContactRuntimeException("ContactEJB.setDetail()", SilverpeasRuntimeException.ERROR, "contact.EX_SET_CONTACT_DETAIL_FAILED"); } }
void function(ContactDetail pubDetail) { if (pubDetail.getPK().equals(pk)) { if (pubDetail.getFirstName() != null) firstName = pubDetail.getFirstName(); if (pubDetail.getLastName() != null) lastName = pubDetail.getLastName(); if (pubDetail.getEmail() != null) email = pubDetail.getEmail(); if (pubDetail.getPhone() != null) phone = pubDetail.getPhone(); if (pubDetail.getFax() != null) fax = pubDetail.getFax(); userId = pubDetail.getUserId(); if (pubDetail.getCreationDate() != null) creationDate = pubDetail.getCreationDate(); if (pubDetail.getCreatorId() != null) creatorId = pubDetail.getCreatorId(); isModified = true; } else { throw new ContactRuntimeException(STR, SilverpeasRuntimeException.ERROR, STR); } }
/** * Update the attributes of the contact * @param pubDetail the ContactDetail which contains updated data * @see com.stratelia.webactiv.util.contact.model.ContactDetail * @since 1.0 */
Update the attributes of the contact
setDetail
{ "repo_name": "stephaneperry/Silverpeas-Core", "path": "ejb-core/contact/src/main/java/com/stratelia/webactiv/util/contact/ejb/ContactEJB.java", "license": "agpl-3.0", "size": 12878 }
[ "com.stratelia.webactiv.util.contact.model.ContactDetail", "com.stratelia.webactiv.util.contact.model.ContactRuntimeException", "com.stratelia.webactiv.util.exception.SilverpeasRuntimeException" ]
import com.stratelia.webactiv.util.contact.model.ContactDetail; import com.stratelia.webactiv.util.contact.model.ContactRuntimeException; import com.stratelia.webactiv.util.exception.SilverpeasRuntimeException;
import com.stratelia.webactiv.util.contact.model.*; import com.stratelia.webactiv.util.exception.*;
[ "com.stratelia.webactiv" ]
com.stratelia.webactiv;
1,290,607
protected Settings transportClientSettings() { return Settings.EMPTY; }
Settings function() { return Settings.EMPTY; }
/** * This method is used to obtain additional settings for clients created by the internal cluster. * These settings will be applied on the client in addition to some randomized settings defined in * the cluster. These settings will also override any other settings the internal cluster might * add by default. */
This method is used to obtain additional settings for clients created by the internal cluster. These settings will be applied on the client in addition to some randomized settings defined in the cluster. These settings will also override any other settings the internal cluster might add by default
transportClientSettings
{ "repo_name": "LeoYao/elasticsearch", "path": "test/framework/src/main/java/org/elasticsearch/test/ESIntegTestCase.java", "license": "apache-2.0", "size": 105264 }
[ "org.elasticsearch.common.settings.Settings" ]
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.*;
[ "org.elasticsearch.common" ]
org.elasticsearch.common;
95,661
XSAny createAttributeValue(final String namespace, final String name, final String prefix, Map<QName, String> attributes) { XSAny attribute = createAny(namespace, name, prefix, attributes); return createAttributeValue(Arrays.asList(attribute)); }
XSAny createAttributeValue(final String namespace, final String name, final String prefix, Map<QName, String> attributes) { XSAny attribute = createAny(namespace, name, prefix, attributes); return createAttributeValue(Arrays.asList(attribute)); }
/** * Creates the attribute value. * * @param namespace the namespace * @param name the name * @param prefix the prefix * @param attributes the attributes * @return the xS any */
Creates the attribute value
createAttributeValue
{ "repo_name": "AurionProject/Aurion", "path": "Product/Production/Common/CONNECTCoreLib/src/main/java/gov/hhs/fha/nhinc/callback/openSAML/OpenSAML2ComponentBuilder.java", "license": "bsd-3-clause", "size": 33078 }
[ "java.util.Arrays", "java.util.Map", "javax.xml.namespace.QName", "org.opensaml.xml.schema.XSAny" ]
import java.util.Arrays; import java.util.Map; import javax.xml.namespace.QName; import org.opensaml.xml.schema.XSAny;
import java.util.*; import javax.xml.namespace.*; import org.opensaml.xml.schema.*;
[ "java.util", "javax.xml", "org.opensaml.xml" ]
java.util; javax.xml; org.opensaml.xml;
2,262,401
public CallHandle monitorDirectory(SecurityContext ctx, File directory, DataObject container, long userID, long groupID, AgentEventListener observer);
CallHandle function(SecurityContext ctx, File directory, DataObject container, long userID, long groupID, AgentEventListener observer);
/** * Monitors the passed directory. * * @param ctx The security context. * @param directory The directory to monitor. * @param container The container where to import the images into or * <code>null</code>. * @param userID The id of the user. * @param groupID The id of the group. * @param observer Call-back handler. * @return See above. */
Monitors the passed directory
monitorDirectory
{ "repo_name": "joansmith/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/env/data/views/ImageDataView.java", "license": "gpl-2.0", "size": 16243 }
[ "java.io.File", "org.openmicroscopy.shoola.env.event.AgentEventListener" ]
import java.io.File; import org.openmicroscopy.shoola.env.event.AgentEventListener;
import java.io.*; import org.openmicroscopy.shoola.env.event.*;
[ "java.io", "org.openmicroscopy.shoola" ]
java.io; org.openmicroscopy.shoola;
1,017,317
public static List<String> getAllInstances(HelixAdmin helixAdmin, String clusterName) { return helixAdmin.getInstancesInCluster(clusterName); }
static List<String> function(HelixAdmin helixAdmin, String clusterName) { return helixAdmin.getInstancesInCluster(clusterName); }
/** * Returns all instances for the given cluster. * * @param helixAdmin The HelixAdmin object used to interact with the Helix cluster * @param clusterName Name of the cluster for which to get all the instances for. * @return Returns a List of strings containing the instance names for the given cluster. */
Returns all instances for the given cluster
getAllInstances
{ "repo_name": "tkao1000/pinot", "path": "pinot-common/src/main/java/com/linkedin/pinot/common/utils/helix/HelixHelper.java", "license": "apache-2.0", "size": 15108 }
[ "java.util.List", "org.apache.helix.HelixAdmin" ]
import java.util.List; import org.apache.helix.HelixAdmin;
import java.util.*; import org.apache.helix.*;
[ "java.util", "org.apache.helix" ]
java.util; org.apache.helix;
1,842,299
public static ims.edischarge.domain.objects.Summary extractSummary(ims.domain.ILightweightDomainFactory domainFactory, ims.clinical.vo.EDischargeSTHKSummaryForProcComponentVo valueObject) { return extractSummary(domainFactory, valueObject, new HashMap()); }
static ims.edischarge.domain.objects.Summary function(ims.domain.ILightweightDomainFactory domainFactory, ims.clinical.vo.EDischargeSTHKSummaryForProcComponentVo valueObject) { return extractSummary(domainFactory, valueObject, new HashMap()); }
/** * Create the domain object from the value object. * @param domainFactory - used to create existing (persistent) domain objects. * @param valueObject - extract the domain object fields from this. */
Create the domain object from the value object
extractSummary
{ "repo_name": "FreudianNM/openMAXIMS", "path": "Source Library/openmaxims_workspace/ValueObjects/src/ims/clinical/vo/domain/EDischargeSTHKSummaryForProcComponentVoAssembler.java", "license": "agpl-3.0", "size": 17058 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
2,305,145
void writeTo(ReportBuilder pReportBuilder) { if (Reports.isRequired(fReport)) { getProjectLogger().debug("Creating dashboard section '{}'", fName); transform(pReportBuilder); } else getProjectLogger().debug( "Report '{}' for dashboard section '{}' is disabled, skipping", fReport.getName(), fName); }
void writeTo(ReportBuilder pReportBuilder) { if (Reports.isRequired(fReport)) { getProjectLogger().debug(STR, fName); transform(pReportBuilder); } else getProjectLogger().debug( STR, fReport.getName(), fName); }
/** * Write this section to a report by letting the specified report builder apply the * transformation. If the underlying XML report isn't enabled nothing will be output. * * @param pReportBuilder The report builder holding the report to write this section to. */
Write this section to a report by letting the specified report builder apply the transformation. If the underlying XML report isn't enabled nothing will be output
writeTo
{ "repo_name": "handmadecode/quill", "path": "src/main/java/org/myire/quill/dashboard/DashboardSection.java", "license": "apache-2.0", "size": 8143 }
[ "org.myire.quill.report.ReportBuilder", "org.myire.quill.report.Reports" ]
import org.myire.quill.report.ReportBuilder; import org.myire.quill.report.Reports;
import org.myire.quill.report.*;
[ "org.myire.quill" ]
org.myire.quill;
2,330,530
@Test public void testQueryNoStatistics() { try { Plan p = getTPCH3Plan(); p.setExecutionConfig(defaultExecutionConfig); // compile final OptimizedPlan plan = compileNoStats(p); final OptimizerPlanNodeResolver or = getOptimizerPlanNodeResolver(plan); // get the nodes from the final plan final SinkPlanNode sink = or.getNode(SINK); final SingleInputPlanNode reducer = or.getNode(REDUCE_NAME); final SingleInputPlanNode combiner = reducer.getPredecessor() instanceof SingleInputPlanNode ? (SingleInputPlanNode) reducer.getPredecessor() : null; final DualInputPlanNode join = or.getNode(JOIN_NAME); final SingleInputPlanNode filteringMapper = or.getNode(MAPPER_NAME); // verify the optimizer choices checkStandardStrategies(filteringMapper, join, combiner, reducer, sink); Assert.assertTrue(checkRepartitionShipStrategies(join, reducer, combiner)); Assert.assertTrue( checkHashJoinStrategies(join, reducer, true) || checkHashJoinStrategies(join, reducer, false)); } catch (Exception e) { e.printStackTrace(); Assert.fail(e.getMessage()); } }
void function() { try { Plan p = getTPCH3Plan(); p.setExecutionConfig(defaultExecutionConfig); final OptimizedPlan plan = compileNoStats(p); final OptimizerPlanNodeResolver or = getOptimizerPlanNodeResolver(plan); final SinkPlanNode sink = or.getNode(SINK); final SingleInputPlanNode reducer = or.getNode(REDUCE_NAME); final SingleInputPlanNode combiner = reducer.getPredecessor() instanceof SingleInputPlanNode ? (SingleInputPlanNode) reducer.getPredecessor() : null; final DualInputPlanNode join = or.getNode(JOIN_NAME); final SingleInputPlanNode filteringMapper = or.getNode(MAPPER_NAME); checkStandardStrategies(filteringMapper, join, combiner, reducer, sink); Assert.assertTrue(checkRepartitionShipStrategies(join, reducer, combiner)); Assert.assertTrue( checkHashJoinStrategies(join, reducer, true) checkHashJoinStrategies(join, reducer, false)); } catch (Exception e) { e.printStackTrace(); Assert.fail(e.getMessage()); } }
/** * Verifies that a robust repartitioning plan with a hash join is created in the absence of * statistics. */
Verifies that a robust repartitioning plan with a hash join is created in the absence of statistics
testQueryNoStatistics
{ "repo_name": "apache/flink", "path": "flink-tests/src/test/java/org/apache/flink/test/optimizer/examples/RelationalQueryCompilerTest.java", "license": "apache-2.0", "size": 22339 }
[ "org.apache.flink.api.common.Plan", "org.apache.flink.optimizer.plan.DualInputPlanNode", "org.apache.flink.optimizer.plan.OptimizedPlan", "org.apache.flink.optimizer.plan.SingleInputPlanNode", "org.apache.flink.optimizer.plan.SinkPlanNode", "org.junit.Assert" ]
import org.apache.flink.api.common.Plan; import org.apache.flink.optimizer.plan.DualInputPlanNode; import org.apache.flink.optimizer.plan.OptimizedPlan; import org.apache.flink.optimizer.plan.SingleInputPlanNode; import org.apache.flink.optimizer.plan.SinkPlanNode; import org.junit.Assert;
import org.apache.flink.api.common.*; import org.apache.flink.optimizer.plan.*; import org.junit.*;
[ "org.apache.flink", "org.junit" ]
org.apache.flink; org.junit;
2,151,281
@Setup(Level.Trial) public void doSetupTrial() throws Exception { this.encoder = super.newEncoder(false, getNullOutputStream()); this.testData = new float[getBatchSize()]; for (int i = 0; i < testData.length; i++) { testData[i] = super.getRandom().nextFloat(); } } } @State(Scope.Thread) public static class TestStateDecode extends BasicState { private byte[] testData; private Decoder decoder; private Utf8 utf = new Utf8(); public TestStateDecode() { super(); }
@Setup(Level.Trial) void function() throws Exception { this.encoder = super.newEncoder(false, getNullOutputStream()); this.testData = new float[getBatchSize()]; for (int i = 0; i < testData.length; i++) { testData[i] = super.getRandom().nextFloat(); } } } @State(Scope.Thread) public static class TestStateDecode extends BasicState { private byte[] testData; private Decoder decoder; private Utf8 utf = new Utf8(); public TestStateDecode() { super(); }
/** * Setup each trial * * @throws IOException Could not setup test data */
Setup each trial
doSetupTrial
{ "repo_name": "apache/avro", "path": "lang/java/perf/src/main/java/org/apache/avro/perf/test/basic/MapTest.java", "license": "apache-2.0", "size": 4362 }
[ "org.apache.avro.io.Decoder", "org.apache.avro.perf.test.BasicState", "org.apache.avro.util.Utf8", "org.openjdk.jmh.annotations.Level", "org.openjdk.jmh.annotations.Scope", "org.openjdk.jmh.annotations.Setup", "org.openjdk.jmh.annotations.State" ]
import org.apache.avro.io.Decoder; import org.apache.avro.perf.test.BasicState; import org.apache.avro.util.Utf8; import org.openjdk.jmh.annotations.Level; import org.openjdk.jmh.annotations.Scope; import org.openjdk.jmh.annotations.Setup; import org.openjdk.jmh.annotations.State;
import org.apache.avro.io.*; import org.apache.avro.perf.test.*; import org.apache.avro.util.*; import org.openjdk.jmh.annotations.*;
[ "org.apache.avro", "org.openjdk.jmh" ]
org.apache.avro; org.openjdk.jmh;
2,211,167
public static void test35subset() throws IOException, FileNotFoundException, SAXException, ParserConfigurationException, CanonicalizationException, InvalidCanonicalizerException, TransformerException { String descri = "3.5 Entity References. (uncommented)"; String fileIn = prefix + "in/35_input.xml"; String fileRef = prefix + "in/35_c14n.xml"; String fileOut = prefix + "out/xpath_35_output.xml"; String c14nURI = Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS; boolean validating = true; String xpath = Canonicalizer.XPATH_C14N_WITH_COMMENTS_SINGLE_NODE; assertTrue(descri, c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, validating, xpath)); }
static void function() throws IOException, FileNotFoundException, SAXException, ParserConfigurationException, CanonicalizationException, InvalidCanonicalizerException, TransformerException { String descri = STR; String fileIn = prefix + STR; String fileRef = prefix + STR; String fileOut = prefix + STR; String c14nURI = Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS; boolean validating = true; String xpath = Canonicalizer.XPATH_C14N_WITH_COMMENTS_SINGLE_NODE; assertTrue(descri, c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, validating, xpath)); }
/** * 3.5 Entity References * * @throws CanonicalizationException * @throws FileNotFoundException * @throws IOException * @throws InvalidCanonicalizerException * @throws ParserConfigurationException * @throws SAXException * @see <A HREF="http://www.w3.org/TR/2001/PR-xml-c14n-20010119#Example-Entities">the example from the spec</A> * @throws TransformerException */
3.5 Entity References
test35subset
{ "repo_name": "test2v/DanDelXAdES", "path": "proj/xml-security-src-1_3_0/xml-security-1_3_0/src_unitTests/org/apache/xml/security/test/c14n/implementations/Canonicalizer20010315Test.java", "license": "lgpl-3.0", "size": 46843 }
[ "java.io.FileNotFoundException", "java.io.IOException", "javax.xml.parsers.ParserConfigurationException", "javax.xml.transform.TransformerException", "org.apache.xml.security.c14n.CanonicalizationException", "org.apache.xml.security.c14n.Canonicalizer", "org.apache.xml.security.c14n.InvalidCanonicalizerException", "org.xml.sax.SAXException" ]
import java.io.FileNotFoundException; import java.io.IOException; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.TransformerException; import org.apache.xml.security.c14n.CanonicalizationException; import org.apache.xml.security.c14n.Canonicalizer; import org.apache.xml.security.c14n.InvalidCanonicalizerException; import org.xml.sax.SAXException;
import java.io.*; import javax.xml.parsers.*; import javax.xml.transform.*; import org.apache.xml.security.c14n.*; import org.xml.sax.*;
[ "java.io", "javax.xml", "org.apache.xml", "org.xml.sax" ]
java.io; javax.xml; org.apache.xml; org.xml.sax;
1,449,822
protected void addDependency( XMLWriter writer, IdeDependency dep, ArtifactRepository localRepository, File basedir, String deployPath ) throws MojoExecutionException { String handle; String dependentObject = null; String archiveName; // ejb's and wars must always be toplevel if ( Constants.PROJECT_PACKAGING_WAR.equals( dep.getType() ) || Constants.PROJECT_PACKAGING_EJB.equals( dep.getType() ) ) { deployPath = "/"; } if ( dep.isReferencedProject() ) { // <dependent-module deploy-path="/WEB-INF/lib" // handle="module:/resource/artifactid/artifactid"> // <dependency-type>uses</dependency-type> // </dependent-module> handle = "module:/resource/" + dep.getEclipseProjectName() + "/" + dep.getEclipseProjectName(); //$NON-NLS-1$ //$NON-NLS-2$ String archiveExtension = dep.getType(); if ( Constants.PROJECT_PACKAGING_EJB.equals( dep.getType() ) ) { dependentObject = "EjbModule_"; // an EJB module is packed as a .jar file archiveExtension = Constants.PROJECT_PACKAGING_JAR; } else if ( Constants.PROJECT_PACKAGING_WAR.equals( dep.getType() ) ) { dependentObject = "WebModule_"; } archiveName = dep.getEclipseProjectName() + "." + archiveExtension; } else { // <dependent-module deploy-path="/WEB-INF/lib" // handle="module:/classpath/var/M2_REPO/cl/cl/2.1/cl-2.1.jar"> // <dependency-type>uses</dependency-type> // </dependent-module> File artifactPath = dep.getFile(); if ( artifactPath == null ) { log.error( Messages.getString( "EclipsePlugin.artifactpathisnull", dep.getId() ) ); //$NON-NLS-1$ return; } String fullPath = artifactPath.getPath(); File repoFile = new File( fullPath ); if ( dep.isSystemScoped() ) { handle = "module:/classpath/lib/" //$NON-NLS-1$ + IdeUtils.toRelativeAndFixSeparator( config.getEclipseProjectDirectory(), repoFile, false ); } else { File localRepositoryFile = new File( localRepository.getBasedir() ); String relativePath = IdeUtils.toRelativeAndFixSeparator( localRepositoryFile, repoFile, false ); if ( !new File( relativePath ).isAbsolute() ) { handle = "module:/classpath/var/M2_REPO/" //$NON-NLS-1$ + relativePath; } else { handle = "module:/classpath/lib/" //$NON-NLS-1$ + IdeUtils.toRelativeAndFixSeparator( config.getEclipseProjectDirectory(), repoFile, false ); } } if ( Constants.PROJECT_PACKAGING_EAR.equals( this.config.getPackaging() ) && !"/".equals( deployPath ) ) { // This is a very ugly hack around a WTP bug! a delpoydir in the configuration file is duplicated. // a deploy dir like "lib" will be used as "lib/lib" the only workig workaround is to include a .. // in the archive name. archiveName = "../" + artifactPath.getName(); } else { archiveName = artifactPath.getName(); } } writer.startElement( ELT_DEPENDENT_MODULE ); writer.addAttribute( "archiveName", archiveName ); writer.addAttribute( ATTR_DEPLOY_PATH, deployPath ); //$NON-NLS-1$ writer.addAttribute( ATTR_HANDLE, handle ); if ( dependentObject != null && config.getWtpVersion() >= 2.0f ) { writer.startElement( ELT_DEPENDENCY_OBJECT ); writer.writeText( dependentObject + System.identityHashCode( dep ) ); writer.endElement(); } writer.startElement( ELT_DEPENDENCY_TYPE ); writer.writeText( "uses" ); //$NON-NLS-1$ writer.endElement(); writer.endElement(); }
void function( XMLWriter writer, IdeDependency dep, ArtifactRepository localRepository, File basedir, String deployPath ) throws MojoExecutionException { String handle; String dependentObject = null; String archiveName; if ( Constants.PROJECT_PACKAGING_WAR.equals( dep.getType() ) Constants.PROJECT_PACKAGING_EJB.equals( dep.getType() ) ) { deployPath = "/"; } if ( dep.isReferencedProject() ) { handle = STR + dep.getEclipseProjectName() + "/" + dep.getEclipseProjectName(); String archiveExtension = dep.getType(); if ( Constants.PROJECT_PACKAGING_EJB.equals( dep.getType() ) ) { dependentObject = STR; archiveExtension = Constants.PROJECT_PACKAGING_JAR; } else if ( Constants.PROJECT_PACKAGING_WAR.equals( dep.getType() ) ) { dependentObject = STR; } archiveName = dep.getEclipseProjectName() + "." + archiveExtension; } else { File artifactPath = dep.getFile(); if ( artifactPath == null ) { log.error( Messages.getString( STR, dep.getId() ) ); return; } String fullPath = artifactPath.getPath(); File repoFile = new File( fullPath ); if ( dep.isSystemScoped() ) { handle = STR + IdeUtils.toRelativeAndFixSeparator( config.getEclipseProjectDirectory(), repoFile, false ); } else { File localRepositoryFile = new File( localRepository.getBasedir() ); String relativePath = IdeUtils.toRelativeAndFixSeparator( localRepositoryFile, repoFile, false ); if ( !new File( relativePath ).isAbsolute() ) { handle = STR + relativePath; } else { handle = STR + IdeUtils.toRelativeAndFixSeparator( config.getEclipseProjectDirectory(), repoFile, false ); } } if ( Constants.PROJECT_PACKAGING_EAR.equals( this.config.getPackaging() ) && !"/".equals( deployPath ) ) { archiveName = "../" + artifactPath.getName(); } else { archiveName = artifactPath.getName(); } } writer.startElement( ELT_DEPENDENT_MODULE ); writer.addAttribute( STR, archiveName ); writer.addAttribute( ATTR_DEPLOY_PATH, deployPath ); writer.addAttribute( ATTR_HANDLE, handle ); if ( dependentObject != null && config.getWtpVersion() >= 2.0f ) { writer.startElement( ELT_DEPENDENCY_OBJECT ); writer.writeText( dependentObject + System.identityHashCode( dep ) ); writer.endElement(); } writer.startElement( ELT_DEPENDENCY_TYPE ); writer.writeText( "uses" ); writer.endElement(); writer.endElement(); }
/** * Adds dependency for Eclipse WTP project. * * @param writer * @param artifact * @param localRepository * @param basedir * @throws MojoExecutionException */
Adds dependency for Eclipse WTP project
addDependency
{ "repo_name": "kikinteractive/maven-plugins", "path": "maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/wtp/AbstractWtpResourceWriter.java", "license": "apache-2.0", "size": 12752 }
[ "java.io.File", "org.apache.maven.artifact.repository.ArtifactRepository", "org.apache.maven.plugin.MojoExecutionException", "org.apache.maven.plugin.eclipse.Constants", "org.apache.maven.plugin.eclipse.Messages", "org.apache.maven.plugin.ide.IdeDependency", "org.apache.maven.plugin.ide.IdeUtils", "org.codehaus.plexus.util.xml.XMLWriter" ]
import java.io.File; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.eclipse.Constants; import org.apache.maven.plugin.eclipse.Messages; import org.apache.maven.plugin.ide.IdeDependency; import org.apache.maven.plugin.ide.IdeUtils; import org.codehaus.plexus.util.xml.XMLWriter;
import java.io.*; import org.apache.maven.artifact.repository.*; import org.apache.maven.plugin.*; import org.apache.maven.plugin.eclipse.*; import org.apache.maven.plugin.ide.*; import org.codehaus.plexus.util.xml.*;
[ "java.io", "org.apache.maven", "org.codehaus.plexus" ]
java.io; org.apache.maven; org.codehaus.plexus;
897,211
@SuppressWarnings("unused") @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") @SmallTest public void testSkipMigrateData() throws IOException, InterruptedException, ExecutionException { ApplicationData.clearAppData(getInstrumentation().getTargetContext()); // Write old state files. File filesDir = getInstrumentation().getTargetContext().getFilesDir(); File stateFile = new File(filesDir, TabPersistentStore.SAVED_STATE_FILE); File tab0 = new File(filesDir, TabState.SAVED_TAB_STATE_FILE_PREFIX + "0"); File tab1 = new File(filesDir, TabState.SAVED_TAB_STATE_FILE_PREFIX + "1"); File tab2 = new File(filesDir, TabState.SAVED_TAB_STATE_FILE_PREFIX_INCOGNITO + "2"); File tab3 = new File(filesDir, TabState.SAVED_TAB_STATE_FILE_PREFIX_INCOGNITO + "3"); assertTrue("Could not create state file", stateFile.createNewFile()); assertTrue("Could not create tab 0 file", tab0.createNewFile()); assertTrue("Could not create tab 1 file", tab1.createNewFile()); assertTrue("Could not create tab 2 file", tab2.createNewFile()); assertTrue("Could not create tab 3 file", tab3.createNewFile()); // Write new state files File newDir = TabPersistentStore.getStateDirectory(getInstrumentation().getTargetContext(), 0); File newStateFile = new File(newDir, TabPersistentStore.SAVED_STATE_FILE); File newTab4 = new File(newDir, TabState.SAVED_TAB_STATE_FILE_PREFIX + "4"); assertTrue("Could not create new tab 4 file", newTab4.createNewFile()); assertTrue("Could not create new state file", newStateFile.createNewFile()); // Build the TabPersistentStore which will try to move the files. MockTabModelSelector selector = new MockTabModelSelector(0, 0, null); TabPersistentStore store = new TabPersistentStore(selector, 0, getInstrumentation().getTargetContext(), null, null); TabPersistentStore.waitForMigrationToFinish(); assertTrue("Could not find new state file", newStateFile.exists()); assertTrue("Could not find new tab 4 file", newTab4.exists()); // Make sure the old files did not move File newTab0 = new File(newDir, TabState.SAVED_TAB_STATE_FILE_PREFIX + "0"); File newTab1 = new File(newDir, TabState.SAVED_TAB_STATE_FILE_PREFIX + "1"); File newTab2 = new File(newDir, TabState.SAVED_TAB_STATE_FILE_PREFIX_INCOGNITO + "2"); File newTab3 = new File(newDir, TabState.SAVED_TAB_STATE_FILE_PREFIX_INCOGNITO + "3"); assertFalse("Could find new tab 0 file", newTab0.exists()); assertFalse("Could find new tab 1 file", newTab1.exists()); assertFalse("Could find new tab 2 file", newTab2.exists()); assertFalse("Could find new tab 3 file", newTab3.exists()); ApplicationData.clearAppData(getInstrumentation().getTargetContext()); }
@SuppressWarnings(STR) @SuppressFBWarnings(STR) void function() throws IOException, InterruptedException, ExecutionException { ApplicationData.clearAppData(getInstrumentation().getTargetContext()); File filesDir = getInstrumentation().getTargetContext().getFilesDir(); File stateFile = new File(filesDir, TabPersistentStore.SAVED_STATE_FILE); File tab0 = new File(filesDir, TabState.SAVED_TAB_STATE_FILE_PREFIX + "0"); File tab1 = new File(filesDir, TabState.SAVED_TAB_STATE_FILE_PREFIX + "1"); File tab2 = new File(filesDir, TabState.SAVED_TAB_STATE_FILE_PREFIX_INCOGNITO + "2"); File tab3 = new File(filesDir, TabState.SAVED_TAB_STATE_FILE_PREFIX_INCOGNITO + "3"); assertTrue(STR, stateFile.createNewFile()); assertTrue(STR, tab0.createNewFile()); assertTrue(STR, tab1.createNewFile()); assertTrue(STR, tab2.createNewFile()); assertTrue(STR, tab3.createNewFile()); File newDir = TabPersistentStore.getStateDirectory(getInstrumentation().getTargetContext(), 0); File newStateFile = new File(newDir, TabPersistentStore.SAVED_STATE_FILE); File newTab4 = new File(newDir, TabState.SAVED_TAB_STATE_FILE_PREFIX + "4"); assertTrue(STR, newTab4.createNewFile()); assertTrue(STR, newStateFile.createNewFile()); MockTabModelSelector selector = new MockTabModelSelector(0, 0, null); TabPersistentStore store = new TabPersistentStore(selector, 0, getInstrumentation().getTargetContext(), null, null); TabPersistentStore.waitForMigrationToFinish(); assertTrue(STR, newStateFile.exists()); assertTrue(STR, newTab4.exists()); File newTab0 = new File(newDir, TabState.SAVED_TAB_STATE_FILE_PREFIX + "0"); File newTab1 = new File(newDir, TabState.SAVED_TAB_STATE_FILE_PREFIX + "1"); File newTab2 = new File(newDir, TabState.SAVED_TAB_STATE_FILE_PREFIX_INCOGNITO + "2"); File newTab3 = new File(newDir, TabState.SAVED_TAB_STATE_FILE_PREFIX_INCOGNITO + "3"); assertFalse(STR, newTab0.exists()); assertFalse(STR, newTab1.exists()); assertFalse(STR, newTab2.exists()); assertFalse(STR, newTab3.exists()); ApplicationData.clearAppData(getInstrumentation().getTargetContext()); }
/** * Test that migration skips if it already has files in the new folder. * @throws IOException * @throws InterruptedException * @throws ExecutionException */
Test that migration skips if it already has files in the new folder
testSkipMigrateData
{ "repo_name": "ds-hwang/chromium-crosswalk", "path": "chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/RestoreMigrateTest.java", "license": "bsd-3-clause", "size": 12956 }
[ "java.io.File", "java.io.IOException", "java.util.concurrent.ExecutionException", "org.chromium.base.annotations.SuppressFBWarnings", "org.chromium.chrome.browser.TabState", "org.chromium.chrome.test.util.ApplicationData", "org.chromium.chrome.test.util.browser.tabmodel.MockTabModelSelector" ]
import java.io.File; import java.io.IOException; import java.util.concurrent.ExecutionException; import org.chromium.base.annotations.SuppressFBWarnings; import org.chromium.chrome.browser.TabState; import org.chromium.chrome.test.util.ApplicationData; import org.chromium.chrome.test.util.browser.tabmodel.MockTabModelSelector;
import java.io.*; import java.util.concurrent.*; import org.chromium.base.annotations.*; import org.chromium.chrome.browser.*; import org.chromium.chrome.test.util.*; import org.chromium.chrome.test.util.browser.tabmodel.*;
[ "java.io", "java.util", "org.chromium.base", "org.chromium.chrome" ]
java.io; java.util; org.chromium.base; org.chromium.chrome;
1,480,538
public void freezeRotation() throws RemoteException { mAutomatorService.freezeRotation(true); }
void function() throws RemoteException { mAutomatorService.freezeRotation(true); }
/** * Disables the sensors and freezes the device rotation at its * current rotation state. * @throws RemoteException * @since API Level 16 */
Disables the sensors and freezes the device rotation at its current rotation state
freezeRotation
{ "repo_name": "lokeller/multiuiautomator", "path": "src/com/android/uiautomator/core/UiDevice.java", "license": "apache-2.0", "size": 22653 }
[ "android.os.RemoteException" ]
import android.os.RemoteException;
import android.os.*;
[ "android.os" ]
android.os;
853,157
XrefEntry addEntryIfAbsent(XrefEntry entry); /** * Adds the given xref entry to the {@link Xref}
XrefEntry addEntryIfAbsent(XrefEntry entry); /** * Adds the given xref entry to the {@link Xref}
/** * Adds the given xref entry to the {@link Xref} if absent * * @param entry * @return null if the entry was added. The current entry with the given object number and generation if the entry * was already present. * @see Xref#addIfAbsent(XrefEntry) */
Adds the given xref entry to the <code>Xref</code> if absent
addEntryIfAbsent
{ "repo_name": "torakiki/sambox", "path": "src/main/java/org/sejda/sambox/input/IndirectObjectsProvider.java", "license": "apache-2.0", "size": 3287 }
[ "org.sejda.sambox.xref.Xref", "org.sejda.sambox.xref.XrefEntry" ]
import org.sejda.sambox.xref.Xref; import org.sejda.sambox.xref.XrefEntry;
import org.sejda.sambox.xref.*;
[ "org.sejda.sambox" ]
org.sejda.sambox;
1,602,175
public String toString() { StringBuffer cp = new StringBuffer(1024); int cnt = elements.size(); if (cnt >= 1) cp.append(((File) (elements.elementAt(0))).getPath()); for (int i = 1; i < cnt; i++) { cp.append(File.pathSeparatorChar); cp.append(((File) (elements.elementAt(i))).getPath()); } return cp.toString(); }
String function() { StringBuffer cp = new StringBuffer(1024); int cnt = elements.size(); if (cnt >= 1) cp.append(((File) (elements.elementAt(0))).getPath()); for (int i = 1; i < cnt; i++) { cp.append(File.pathSeparatorChar); cp.append(((File) (elements.elementAt(i))).getPath()); } return cp.toString(); }
/** * Get string representation of the actual classpath. */
Get string representation of the actual classpath
toString
{ "repo_name": "stefandmn/AREasy", "path": "src/java/org/areasy/boot/Classpath.java", "license": "lgpl-3.0", "size": 5861 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
1,438,671
public Entity<T> removeMetadataComplete() { childNode.removeAttribute("metadata-complete"); return this; }
Entity<T> function() { childNode.removeAttribute(STR); return this; }
/** * Removes the <code>metadata-complete</code> attribute * @return the current instance of <code>Entity<T></code> */
Removes the <code>metadata-complete</code> attribute
removeMetadataComplete
{ "repo_name": "forge/javaee-descriptors", "path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/orm20/EntityImpl.java", "license": "epl-1.0", "size": 48316 }
[ "org.jboss.shrinkwrap.descriptor.api.orm20.Entity" ]
import org.jboss.shrinkwrap.descriptor.api.orm20.Entity;
import org.jboss.shrinkwrap.descriptor.api.orm20.*;
[ "org.jboss.shrinkwrap" ]
org.jboss.shrinkwrap;
2,411,511
DatePickerFragment dialog = new DatePickerFragment(); sContext = context; Bundle args = new Bundle(); args.putInt("title", titleResource); dialog.setArguments(args); return dialog; }
DatePickerFragment dialog = new DatePickerFragment(); sContext = context; Bundle args = new Bundle(); args.putInt("title", titleResource); dialog.setArguments(args); return dialog; }
/** * Returns the instance * @param context * @param titleResource * @return */
Returns the instance
newInstance
{ "repo_name": "rishirajrandive/dailywagers", "path": "app/src/main/java/com/rishi/dailywagers/util/DatePickerFragment.java", "license": "mit", "size": 2007 }
[ "android.os.Bundle" ]
import android.os.Bundle;
import android.os.*;
[ "android.os" ]
android.os;
1,097,745
public RuleConfiguredTargetBuilder addNativeDeclaredProvider(Info provider) { Provider constructor = provider.getProvider(); Preconditions.checkState(constructor.isExported()); providersBuilder.put(provider); return this; }
RuleConfiguredTargetBuilder function(Info provider) { Provider constructor = provider.getProvider(); Preconditions.checkState(constructor.isExported()); providersBuilder.put(provider); return this; }
/** * Adds a "declared provider" defined in native code to the rule. Use this method for declared * providers in definitions of native rules. * * <p>Use {@link #addStarlarkDeclaredProvider(Info)} for Starlark rule implementations. */
Adds a "declared provider" defined in native code to the rule. Use this method for declared providers in definitions of native rules. Use <code>#addStarlarkDeclaredProvider(Info)</code> for Starlark rule implementations
addNativeDeclaredProvider
{ "repo_name": "davidzchen/bazel", "path": "src/main/java/com/google/devtools/build/lib/analysis/RuleConfiguredTargetBuilder.java", "license": "apache-2.0", "size": 27974 }
[ "com.google.common.base.Preconditions", "com.google.devtools.build.lib.packages.Info", "com.google.devtools.build.lib.packages.Provider" ]
import com.google.common.base.Preconditions; import com.google.devtools.build.lib.packages.Info; import com.google.devtools.build.lib.packages.Provider;
import com.google.common.base.*; import com.google.devtools.build.lib.packages.*;
[ "com.google.common", "com.google.devtools" ]
com.google.common; com.google.devtools;
2,506,875
@ServiceMethod(returns = ReturnType.SINGLE) Mono<SecurityPartnerProviderInner> updateTagsAsync(String resourceGroupName, String securityPartnerProviderName);
@ServiceMethod(returns = ReturnType.SINGLE) Mono<SecurityPartnerProviderInner> updateTagsAsync(String resourceGroupName, String securityPartnerProviderName);
/** * Updates tags of a Security Partner Provider resource. * * @param resourceGroupName The name of the resource group. * @param securityPartnerProviderName The name of the Security Partner Provider. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return security Partner Provider resource. */
Updates tags of a Security Partner Provider resource
updateTagsAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/SecurityPartnerProvidersClient.java", "license": "mit", "size": 23918 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.network.fluent.models.SecurityPartnerProviderInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.network.fluent.models.SecurityPartnerProviderInner;
import com.azure.core.annotation.*; import com.azure.resourcemanager.network.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
2,094,635
private static boolean matchFilters(TimelineEntity entity, TimelineFilterList filters, TimelineEntityFiltersType entityFiltersType) throws IOException { if (filters == null || filters.getFilterList().isEmpty()) { return false; } TimelineFilterList.Operator operator = filters.getOperator(); for (TimelineFilter filter : filters.getFilterList()) { TimelineFilterType filterType = filter.getFilterType(); if (!entityFiltersType.isValidFilter(filterType)) { throw new IOException("Unsupported filter " + filterType); } boolean matched = false; switch (filterType) { case LIST: matched = matchFilters(entity, (TimelineFilterList)filter, entityFiltersType); break; case COMPARE: matched = matchCompareFilter(entity, (TimelineCompareFilter)filter, entityFiltersType); break; case EXISTS: matched = matchExistsFilter(entity, (TimelineExistsFilter)filter, entityFiltersType); break; case KEY_VALUE: matched = matchKeyValueFilter(entity, (TimelineKeyValueFilter)filter, entityFiltersType); break; case KEY_VALUES: matched = matchKeyValuesFilter(entity, (TimelineKeyValuesFilter)filter, entityFiltersType); break; default: throw new IOException("Unsupported filter " + filterType); } if (!matched) { if(operator == TimelineFilterList.Operator.AND) { return false; } } else { if(operator == TimelineFilterList.Operator.OR) { return true; } } } return operator == TimelineFilterList.Operator.AND; }
static boolean function(TimelineEntity entity, TimelineFilterList filters, TimelineEntityFiltersType entityFiltersType) throws IOException { if (filters == null filters.getFilterList().isEmpty()) { return false; } TimelineFilterList.Operator operator = filters.getOperator(); for (TimelineFilter filter : filters.getFilterList()) { TimelineFilterType filterType = filter.getFilterType(); if (!entityFiltersType.isValidFilter(filterType)) { throw new IOException(STR + filterType); } boolean matched = false; switch (filterType) { case LIST: matched = matchFilters(entity, (TimelineFilterList)filter, entityFiltersType); break; case COMPARE: matched = matchCompareFilter(entity, (TimelineCompareFilter)filter, entityFiltersType); break; case EXISTS: matched = matchExistsFilter(entity, (TimelineExistsFilter)filter, entityFiltersType); break; case KEY_VALUE: matched = matchKeyValueFilter(entity, (TimelineKeyValueFilter)filter, entityFiltersType); break; case KEY_VALUES: matched = matchKeyValuesFilter(entity, (TimelineKeyValuesFilter)filter, entityFiltersType); break; default: throw new IOException(STR + filterType); } if (!matched) { if(operator == TimelineFilterList.Operator.AND) { return false; } } else { if(operator == TimelineFilterList.Operator.OR) { return true; } } } return operator == TimelineFilterList.Operator.AND; }
/** * Common routine to match different filters. Iterates over a filter list and * calls routines based on filter type. * * @param entity Timeline entity. * @param filters filter list. * @param entityFiltersType type of filters which are being matched. * @return a boolean flag to indicate if filter matches. * @throws IOException if an unsupported filter for matching this specific * filter is being matched. */
Common routine to match different filters. Iterates over a filter list and calls routines based on filter type
matchFilters
{ "repo_name": "ronny-macmaster/hadoop", "path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/common/TimelineStorageUtils.java", "license": "apache-2.0", "size": 14198 }
[ "java.io.IOException", "org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity", "org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineCompareFilter", "org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineExistsFilter", "org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineFilter", "org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineFilterList", "org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineKeyValueFilter", "org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineKeyValuesFilter" ]
import java.io.IOException; import org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity; import org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineCompareFilter; import org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineExistsFilter; import org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineFilter; import org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineFilterList; import org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineKeyValueFilter; import org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineKeyValuesFilter;
import java.io.*; import org.apache.hadoop.yarn.api.records.timelineservice.*; import org.apache.hadoop.yarn.server.timelineservice.reader.filter.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
609,304
public java.util.List<fr.lip6.move.pnml.hlpn.partitions.hlapi.PartitionElementOfHLAPI> getSubterm_partitions_PartitionElementOfHLAPI(){ java.util.List<fr.lip6.move.pnml.hlpn.partitions.hlapi.PartitionElementOfHLAPI> retour = new ArrayList<fr.lip6.move.pnml.hlpn.partitions.hlapi.PartitionElementOfHLAPI>(); for (Term elemnt : getSubterm()) { if(elemnt.getClass().equals(fr.lip6.move.pnml.hlpn.partitions.impl.PartitionElementOfImpl.class)){ retour.add(new fr.lip6.move.pnml.hlpn.partitions.hlapi.PartitionElementOfHLAPI( (fr.lip6.move.pnml.hlpn.partitions.PartitionElementOf)elemnt )); } } return retour; }
java.util.List<fr.lip6.move.pnml.hlpn.partitions.hlapi.PartitionElementOfHLAPI> function(){ java.util.List<fr.lip6.move.pnml.hlpn.partitions.hlapi.PartitionElementOfHLAPI> retour = new ArrayList<fr.lip6.move.pnml.hlpn.partitions.hlapi.PartitionElementOfHLAPI>(); for (Term elemnt : getSubterm()) { if(elemnt.getClass().equals(fr.lip6.move.pnml.hlpn.partitions.impl.PartitionElementOfImpl.class)){ retour.add(new fr.lip6.move.pnml.hlpn.partitions.hlapi.PartitionElementOfHLAPI( (fr.lip6.move.pnml.hlpn.partitions.PartitionElementOf)elemnt )); } } return retour; }
/** * This accessor return a list of encapsulated subelement, only of PartitionElementOfHLAPI kind. * WARNING : this method can creates a lot of new object in memory. */
This accessor return a list of encapsulated subelement, only of PartitionElementOfHLAPI kind. WARNING : this method can creates a lot of new object in memory
getSubterm_partitions_PartitionElementOfHLAPI
{ "repo_name": "lhillah/pnmlframework", "path": "pnmlFw-HLPN/src/fr/lip6/move/pnml/hlpn/lists/hlapi/SublistHLAPI.java", "license": "epl-1.0", "size": 111755 }
[ "fr.lip6.move.pnml.hlpn.terms.Term", "java.util.ArrayList", "java.util.List" ]
import fr.lip6.move.pnml.hlpn.terms.Term; import java.util.ArrayList; import java.util.List;
import fr.lip6.move.pnml.hlpn.terms.*; import java.util.*;
[ "fr.lip6.move", "java.util" ]
fr.lip6.move; java.util;
283,811
protected void setSettings(List<DomainSettingName> value) { settings = value; }
void function(List<DomainSettingName> value) { settings = value; }
/** * Sets the settings. * * @param value the new settings */
Sets the settings
setSettings
{ "repo_name": "evpaassen/ews-java-api", "path": "src/main/java/microsoft/exchange/webservices/data/GetDomainSettingsRequest.java", "license": "mit", "size": 7819 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,769,846
public void test005RejectingToAuthorize2() { printDebugLog("[API:test05RejectingToAuthorize2] reject to Authorize and mTetheringOn is true."); String jniLogs[] = { "Req;0;false;initServiceNative;void;0", "Req;0;false;serverActivateReqNative;void;0", "Cb;1;true;callback_pan_handle_activate_cnf;void;1;1", "Cb;1;true;callback_pan_handle_connection_authorize_ind;void;2;0;00:15:83:52:83:17", "Req;0;false;serverDeactivateReqNative;void;0", "Cb;1;true;callback_pan_handle_deactivate_cnf;void;1;1", "Req;0;false;cleanServiceNative;void;0" }; ArrayList<String> checkLog = new ArrayList<String>(); checkLog.add("true"); checkLog.add("1:2"); checkLog.add("false"); mJniManager.setCaseLog(jniLogs, ";"); if (mJniManager.setCaseExpectedResults(checkLog)) { printDebugLog("[API:test05RejectingToAuthorize2] set expected result success"); } else { printDebugLog("[API:test05RejectingToAuthorize2] set expected result failed"); Assert.assertTrue(false); } mJniManager.setCleanUpInterface(this); mJniManager.addServiceCheckInterface(new AuthorizeStateCheck()); mJniManager.addServiceCheckInterface(new EnableDisableStateCheck()); sleep(500); if (mIsBluetoothOn) { this.startService(mStartIntent); mPanService = this.getService(); Assert.assertNotNull(mPanService); IBinder binder = this.bindService(mBindIntent); while (binder == null) { printDebugLog("binder is null"); } mTestServicePan = IBluetoothPan.Stub.asInterface(binder); Assert.assertNotNull(mTestServicePan); BluetoothDevice bd = mockBluetoothDevice("00:15:83:52:83:17"); try { mTestServicePan.connect(bd); } catch (RemoteException e) { printErrorLog("[API:test05RejectingToAuthorize2] RemoteException"); } this.setBluetoothTethering(true); sleep(2500); } else { printErrorLog("[API:test05RejectingToAuthorize2] mIsBluetoothOn is false"); Assert.assertTrue(mIsBluetoothOn); } }
void function() { printDebugLog(STR); String jniLogs[] = { STR, STR, STR, STR, STR, STR, STR }; ArrayList<String> checkLog = new ArrayList<String>(); checkLog.add("true"); checkLog.add("1:2"); checkLog.add("false"); mJniManager.setCaseLog(jniLogs, ";"); if (mJniManager.setCaseExpectedResults(checkLog)) { printDebugLog(STR); } else { printDebugLog(STR); Assert.assertTrue(false); } mJniManager.setCleanUpInterface(this); mJniManager.addServiceCheckInterface(new AuthorizeStateCheck()); mJniManager.addServiceCheckInterface(new EnableDisableStateCheck()); sleep(500); if (mIsBluetoothOn) { this.startService(mStartIntent); mPanService = this.getService(); Assert.assertNotNull(mPanService); IBinder binder = this.bindService(mBindIntent); while (binder == null) { printDebugLog(STR); } mTestServicePan = IBluetoothPan.Stub.asInterface(binder); Assert.assertNotNull(mTestServicePan); BluetoothDevice bd = mockBluetoothDevice(STR); try { mTestServicePan.connect(bd); } catch (RemoteException e) { printErrorLog(STR); } this.setBluetoothTethering(true); sleep(2500); } else { printErrorLog(STR); Assert.assertTrue(mIsBluetoothOn); } }
/** * This Function is to reject to authorize. * Notify user, but not accept the authorize * BluetoothDevice is not null * The mTetheringOn is true * The Pan role is NAP * Case description: * 1.start PanService * 2.bind PanService * 3.stop PanService * 4.unbind PanService * 5.receive callback_pan_handler_connection_authorize_ind * 6.stop the socket normally */
This Function is to reject to authorize. Notify user, but not accept the authorize BluetoothDevice is not null The mTetheringOn is true The Pan role is NAP Case description: 1.start PanService 2.bind PanService 3.stop PanService 4.unbind PanService 5.receive callback_pan_handler_connection_authorize_ind 6.stop the socket normally
test005RejectingToAuthorize2
{ "repo_name": "rex-xxx/mt6572_x201", "path": "mediatek/packages/apps/Bluetooth/tests/profiles/pan/src/com/mediatek/bluetooth/pan/PanServiceTestCase.java", "license": "gpl-2.0", "size": 69799 }
[ "android.bluetooth.BluetoothDevice", "android.bluetooth.IBluetoothPan", "android.os.IBinder", "android.os.RemoteException", "java.util.ArrayList", "junit.framework.Assert" ]
import android.bluetooth.BluetoothDevice; import android.bluetooth.IBluetoothPan; import android.os.IBinder; import android.os.RemoteException; import java.util.ArrayList; import junit.framework.Assert;
import android.bluetooth.*; import android.os.*; import java.util.*; import junit.framework.*;
[ "android.bluetooth", "android.os", "java.util", "junit.framework" ]
android.bluetooth; android.os; java.util; junit.framework;
2,607,197
public static FloatBuffer matrixToFloatBuffer(Matrix3f m, FloatBuffer fb) { fb.put(m.m00); fb.put(m.m10); fb.put(m.m20); fb.put(m.m01); fb.put(m.m11); fb.put(m.m21); fb.put(m.m02); fb.put(m.m12); fb.put(m.m22); fb.flip(); return fb; }
static FloatBuffer function(Matrix3f m, FloatBuffer fb) { fb.put(m.m00); fb.put(m.m10); fb.put(m.m20); fb.put(m.m01); fb.put(m.m11); fb.put(m.m21); fb.put(m.m02); fb.put(m.m12); fb.put(m.m22); fb.flip(); return fb; }
/** * Copies the given matrix into an existing FloatBuffer. * The order of the elements is column major (as used by OpenGL). * * @param m the matrix to copy * @param fb the float buffer to copy the matrix into * @return The provided float buffer. */
Copies the given matrix into an existing FloatBuffer. The order of the elements is column major (as used by OpenGL)
matrixToFloatBuffer
{ "repo_name": "leelib/Terasology", "path": "engine/src/main/java/org/terasology/math/MatrixUtils.java", "license": "apache-2.0", "size": 6780 }
[ "java.nio.FloatBuffer", "org.terasology.math.geom.Matrix3f" ]
import java.nio.FloatBuffer; import org.terasology.math.geom.Matrix3f;
import java.nio.*; import org.terasology.math.geom.*;
[ "java.nio", "org.terasology.math" ]
java.nio; org.terasology.math;
422,821
EReference getStatement_AssociatedAttribute(); /** * Returns the meta object for the containment reference list '{@link org.openhealthtools.mdht.cts2.statement.Statement#getSource <em>Source</em>}
EReference getStatement_AssociatedAttribute(); /** * Returns the meta object for the containment reference list '{@link org.openhealthtools.mdht.cts2.statement.Statement#getSource <em>Source</em>}
/** * Returns the meta object for the containment reference '{@link org.openhealthtools.mdht.cts2.statement.Statement#getAssociatedAttribute * <em>Associated Attribute</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @return the meta object for the containment reference '<em>Associated Attribute</em>'. * @see org.openhealthtools.mdht.cts2.statement.Statement#getAssociatedAttribute() * @see #getStatement() * @generated */
Returns the meta object for the containment reference '<code>org.openhealthtools.mdht.cts2.statement.Statement#getAssociatedAttribute Associated Attribute</code>'.
getStatement_AssociatedAttribute
{ "repo_name": "drbgfc/mdht", "path": "cts2/plugins/org.openhealthtools.mdht.cts2.core/src/org/openhealthtools/mdht/cts2/statement/StatementPackage.java", "license": "epl-1.0", "size": 51348 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,669,840
public XContentType xContentType() { return xContentType; }
XContentType function() { return xContentType; }
/** * Get the content type for the source */
Get the content type for the source
xContentType
{ "repo_name": "jmluy/elasticsearch", "path": "x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/watcher/PutWatchRequest.java", "license": "apache-2.0", "size": 7648 }
[ "org.elasticsearch.xcontent.XContentType" ]
import org.elasticsearch.xcontent.XContentType;
import org.elasticsearch.xcontent.*;
[ "org.elasticsearch.xcontent" ]
org.elasticsearch.xcontent;
1,807,652
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } return Objects.equals(this.value, ((US_Degrees90) obj).getValue()); }
boolean function(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } return Objects.equals(this.value, ((US_Degrees90) obj).getValue()); }
/** * Equality is based upon the value. * <p> * @param obj the other object to compare. * @return TRUE if the values match exactly. */
Equality is based upon the value.
equals
{ "repo_name": "KeyBridge/lib-openssrf", "path": "src/main/java/us/gov/dod/standard/ssrf/_3_1/metadata/domains/US_Degrees90.java", "license": "apache-2.0", "size": 4287 }
[ "java.util.Objects" ]
import java.util.Objects;
import java.util.*;
[ "java.util" ]
java.util;
502,917
@Override public boolean isFloppyDrive(final File dir) { return false; }
boolean function(final File dir) { return false; }
/** * Used by UI classes to decide whether to display a special icon for a floppy disk. Implies isDrive(dir). * * <p>The default implementation has no way of knowing, so always returns false.</p> * * @param dir a directory * * @return <code>false</code> always */
Used by UI classes to decide whether to display a special icon for a floppy disk. Implies isDrive(dir). The default implementation has no way of knowing, so always returns false
isFloppyDrive
{ "repo_name": "cismet/cismet-gui-commons", "path": "src/main/java/de/cismet/tools/gui/RestrictedFileSystemView.java", "license": "lgpl-3.0", "size": 14921 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
1,341,964
public static int getNavigationBarHeight(Resources resources) { int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android"); if (resourceId > 0) { return resources.getDimensionPixelSize(resourceId); } return 0; }
static int function(Resources resources) { int resourceId = resources.getIdentifier(STR, "dimen", STR); if (resourceId > 0) { return resources.getDimensionPixelSize(resourceId); } return 0; }
/** * Returns the height of the system's navigation bar * @param resources * @return */
Returns the height of the system's navigation bar
getNavigationBarHeight
{ "repo_name": "alexstyl/Touch-Control", "path": "app/src/main/java/com/alexstyl/touchcontrol/utils/Utils.java", "license": "mit", "size": 2887 }
[ "android.content.res.Resources" ]
import android.content.res.Resources;
import android.content.res.*;
[ "android.content" ]
android.content;
61,598
public Resolver getResolver() { return resolver; }
Resolver function() { return resolver; }
/** * Return the configured {@link Resolver} implementation used by BeanUtils. * <p> * The {@link Resolver} handles the <i>property name</i> expressions and the * implementation in use effectively controls the dialect of the * <i>expression language</i> that BeanUtils recongnises. * <p> * {@link DefaultResolver} is the default implementation used. * * @return resolver The property expression resolver. * @since 1.8.0 */
Return the configured <code>Resolver</code> implementation used by BeanUtils. The <code>Resolver</code> handles the property name expressions and the implementation in use effectively controls the dialect of the expression language that BeanUtils recongnises. <code>DefaultResolver</code> is the default implementation used
getResolver
{ "repo_name": "mypsycho/SwingAppFramework", "path": "src/main/java/org/mypsycho/beans/PropertyUtilsBean.java", "license": "lgpl-2.1", "size": 64821 }
[ "org.apache.commons.beanutils.expression.Resolver" ]
import org.apache.commons.beanutils.expression.Resolver;
import org.apache.commons.beanutils.expression.*;
[ "org.apache.commons" ]
org.apache.commons;
580,764
private void initErrorView(UserRequest ureq, WindowControl wControl, String errorString) { Panel p = new Panel("errorPanel"); columnLayoutCtr = new LayoutMain3ColsController(ureq, wControl, null, null, p, "cptestmain"); this.putInitialPanel(columnLayoutCtr.getInitialComponent()); }
void function(UserRequest ureq, WindowControl wControl, String errorString) { Panel p = new Panel(STR); columnLayoutCtr = new LayoutMain3ColsController(ureq, wControl, null, null, p, STR); this.putInitialPanel(columnLayoutCtr.getInitialComponent()); }
/** * initializes a special view, where the user is informed about errors. (while * loading cp) * * @param ureq * @param wControl * @param cp */
initializes a special view, where the user is informed about errors. (while loading cp)
initErrorView
{ "repo_name": "stevenhva/InfoLearn_OpenOLAT", "path": "src/main/java/org/olat/ims/cp/ui/CPEditMainController.java", "license": "apache-2.0", "size": 6970 }
[ "org.olat.core.commons.fullWebApp.LayoutMain3ColsController", "org.olat.core.gui.UserRequest", "org.olat.core.gui.components.panel.Panel", "org.olat.core.gui.control.WindowControl" ]
import org.olat.core.commons.fullWebApp.LayoutMain3ColsController; import org.olat.core.gui.UserRequest; import org.olat.core.gui.components.panel.Panel; import org.olat.core.gui.control.WindowControl;
import org.olat.core.commons.*; import org.olat.core.gui.*; import org.olat.core.gui.components.panel.*; import org.olat.core.gui.control.*;
[ "org.olat.core" ]
org.olat.core;
1,788,014
@Test @Ignore public void testDeleteFromHead() { CircularLinkedList<Integer> list = new CircularLinkedList<>(); list.insertAtBeginning(4); list.insertAtBeginning(7); list.insertAtBeginning(13); list.insertAtBeginning(19); list.insertAtBeginning(21); Assert.assertEquals("21", String.valueOf(list.searchByIndex(0).item)); list.deleteFromBeginning(); Assert.assertEquals("7", String.valueOf(list.searchByIndex(0).item)); list.deleteFromBeginning(); Assert.assertEquals("13", String.valueOf(list.searchByIndex(0).item)); Assert.assertTrue(list.size() == 3); }
void function() { CircularLinkedList<Integer> list = new CircularLinkedList<>(); list.insertAtBeginning(4); list.insertAtBeginning(7); list.insertAtBeginning(13); list.insertAtBeginning(19); list.insertAtBeginning(21); Assert.assertEquals("21", String.valueOf(list.searchByIndex(0).item)); list.deleteFromBeginning(); Assert.assertEquals("7", String.valueOf(list.searchByIndex(0).item)); list.deleteFromBeginning(); Assert.assertEquals("13", String.valueOf(list.searchByIndex(0).item)); Assert.assertTrue(list.size() == 3); }
/** * Test case to delete element from head */
Test case to delete element from head
testDeleteFromHead
{ "repo_name": "deepak-malik/Data-Structures-In-Java", "path": "test/com/deepak/data/structures/LinkedList/CircularLinkedListTest.java", "license": "mit", "size": 5904 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
2,824,123
public void testEquals() { // default instances XYBlockRenderer r1 = new XYBlockRenderer(); XYBlockRenderer r2 = new XYBlockRenderer(); assertTrue(r1.equals(r2)); assertTrue(r2.equals(r1)); // blockHeight r1.setBlockHeight(2.0); assertFalse(r1.equals(r2)); r2.setBlockHeight(2.0); assertTrue(r1.equals(r2)); // blockWidth r1.setBlockWidth(2.0); assertFalse(r1.equals(r2)); r2.setBlockWidth(2.0); assertTrue(r1.equals(r2)); // paintScale r1.setPaintScale(new GrayPaintScale(0.0, 1.0)); assertFalse(r1.equals(r2)); r2.setPaintScale(new GrayPaintScale(0.0, 1.0)); assertTrue(r1.equals(r2)); }
void function() { XYBlockRenderer r1 = new XYBlockRenderer(); XYBlockRenderer r2 = new XYBlockRenderer(); assertTrue(r1.equals(r2)); assertTrue(r2.equals(r1)); r1.setBlockHeight(2.0); assertFalse(r1.equals(r2)); r2.setBlockHeight(2.0); assertTrue(r1.equals(r2)); r1.setBlockWidth(2.0); assertFalse(r1.equals(r2)); r2.setBlockWidth(2.0); assertTrue(r1.equals(r2)); r1.setPaintScale(new GrayPaintScale(0.0, 1.0)); assertFalse(r1.equals(r2)); r2.setPaintScale(new GrayPaintScale(0.0, 1.0)); assertTrue(r1.equals(r2)); }
/** * Test that the equals() method distinguishes all fields. */
Test that the equals() method distinguishes all fields
testEquals
{ "repo_name": "JSansalone/JFreeChart", "path": "tests/org/jfree/chart/renderer/xy/junit/XYBlockRendererTests.java", "license": "lgpl-2.1", "size": 7882 }
[ "org.jfree.chart.renderer.GrayPaintScale", "org.jfree.chart.renderer.xy.XYBlockRenderer" ]
import org.jfree.chart.renderer.GrayPaintScale; import org.jfree.chart.renderer.xy.XYBlockRenderer;
import org.jfree.chart.renderer.*; import org.jfree.chart.renderer.xy.*;
[ "org.jfree.chart" ]
org.jfree.chart;
2,707,252
public int getKeyShoot2() { return Input.Keys.valueOf(getKeyShoot2Name()); }
int function() { return Input.Keys.valueOf(getKeyShoot2Name()); }
/** * Get the defined key for shooting the secondary weapon. * @return int The keycode as defined in Input.Keys */
Get the defined key for shooting the secondary weapon
getKeyShoot2
{ "repo_name": "askneller/DestinationSol", "path": "main/src/org/destinationsol/GameOptions.java", "license": "apache-2.0", "size": 27753 }
[ "com.badlogic.gdx.Input" ]
import com.badlogic.gdx.Input;
import com.badlogic.gdx.*;
[ "com.badlogic.gdx" ]
com.badlogic.gdx;
2,666,868
byte[] makeToKey(final byte[] fromKey, final byte[] tmp) { assert fromKey.length == SIZEOF_PREFIX_KEY; final byte[] toKey; if (tmp == null) { // Allocate a temporary buffer. toKey = new byte[SIZEOF_PREFIX_KEY]; } else if (tmp.length != SIZEOF_PREFIX_KEY) { // Caller's buffer is the wrong size. throw new IllegalArgumentException(); } else { // Use the caller's buffer. toKey = tmp; } // Copy the fromKey into the temporary buffer. System.arraycopy(fromKey, 0, toKey, 0, SIZEOF_PREFIX_KEY); // Form the successor (side-effect on the toKey buffer). SuccessorUtil.successor(toKey); // Return the successor of the fromKey. return tmp; }
byte[] makeToKey(final byte[] fromKey, final byte[] tmp) { assert fromKey.length == SIZEOF_PREFIX_KEY; final byte[] toKey; if (tmp == null) { toKey = new byte[SIZEOF_PREFIX_KEY]; } else if (tmp.length != SIZEOF_PREFIX_KEY) { throw new IllegalArgumentException(); } else { toKey = tmp; } System.arraycopy(fromKey, 0, toKey, 0, SIZEOF_PREFIX_KEY); SuccessorUtil.successor(toKey); return tmp; }
/** * Generate the successor of the fromKey. * * @param fromKey * The fromKey. * @param tmp * The buffer used to format the <i>toKey</i> (optional). A new * byte[] will be allocated if this is <code>null</code>, but the * same byte[] can be reused for multiple invocations. The buffer * MUST be dimensioned to * {@link BlobsIndexHelper#TERMS_INDEX_KEY_SIZE}. * * @return The toKey. */
Generate the successor of the fromKey
makeToKey
{ "repo_name": "rac021/blazegraph_1_5_3_cluster_2_nodes", "path": "bigdata-rdf/src/java/com/bigdata/rdf/lexicon/BlobsIndexHelper.java", "license": "gpl-2.0", "size": 24943 }
[ "com.bigdata.btree.keys.SuccessorUtil" ]
import com.bigdata.btree.keys.SuccessorUtil;
import com.bigdata.btree.keys.*;
[ "com.bigdata.btree" ]
com.bigdata.btree;
1,068,843
private boolean isExpired(File cachedFile) { int expirySecs = CACHE_EXPIRY; if (isImageFile(props)) { expirySecs = expirySecs * IMAGE_FACTOR; } return isExpired(cachedFile, expirySecs); }
boolean function(File cachedFile) { int expirySecs = CACHE_EXPIRY; if (isImageFile(props)) { expirySecs = expirySecs * IMAGE_FACTOR; } return isExpired(cachedFile, expirySecs); }
/** * Checks if is expired. * * @param cachedFile * the cached file * @return true, if is expired */
Checks if is expired
isExpired
{ "repo_name": "mlaggner/tinyMediaManager", "path": "src/org/tinymediamanager/scraper/util/CachedUrl.java", "license": "apache-2.0", "size": 12703 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
2,708,260
public void addSubToken(String stok, ArrayList<String> svals) { otuple.put(stok, svals); }
void function(String stok, ArrayList<String> svals) { otuple.put(stok, svals); }
/** * If you have multiple subtokens with same value, override and aggregate the values and then put * in the map * @param stok subtoken * @param svals subtoken val list */
If you have multiple subtokens with same value, override and aggregate the values and then put in the map
addSubToken
{ "repo_name": "ananthc/apex-malhar", "path": "library/src/main/java/org/apache/apex/malhar/lib/logs/LineToTokenHashMap.java", "license": "apache-2.0", "size": 4036 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
1,893,732
void setRootOrganisationUnitsParent( OrganisationUnit unit );
void setRootOrganisationUnitsParent( OrganisationUnit unit );
/** * Sets the roots of the selection tree by specifying the roots' parent. Any * selected organisation units will be unselected. The OrganisationUnit * doesn't have to be fetched within the current transaction. * * @param units * The root OrganisationUnit parent to set. * @throws IllegalArgumentException * if the argument is null */
Sets the roots of the selection tree by specifying the roots' parent. Any selected organisation units will be unselected. The OrganisationUnit doesn't have to be fetched within the current transaction
setRootOrganisationUnitsParent
{ "repo_name": "troyel/dhis2-core", "path": "dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/manager/OrganisationUnitSelectionManager.java", "license": "bsd-3-clause", "size": 5184 }
[ "org.hisp.dhis.organisationunit.OrganisationUnit" ]
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.organisationunit.*;
[ "org.hisp.dhis" ]
org.hisp.dhis;
2,470,008
private boolean copyFile(URI srcUri, URI dstUri) throws IOException { try { String encodedUrl = null; try { encodedUrl = URLEncoder.encode(srcUri.getHost() + srcUri.getPath(), StandardCharsets.UTF_8.toString()); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } String dstPath = sanitizePath(dstUri.getPath()); CopyObjectRequest copyReq = generateCopyObjectRequest(encodedUrl, dstUri, dstPath, null); CopyObjectResponse copyObjectResponse = _s3Client.copyObject(copyReq); return copyObjectResponse.sdkHttpResponse().isSuccessful(); } catch (S3Exception e) { throw new IOException(e); } }
boolean function(URI srcUri, URI dstUri) throws IOException { try { String encodedUrl = null; try { encodedUrl = URLEncoder.encode(srcUri.getHost() + srcUri.getPath(), StandardCharsets.UTF_8.toString()); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } String dstPath = sanitizePath(dstUri.getPath()); CopyObjectRequest copyReq = generateCopyObjectRequest(encodedUrl, dstUri, dstPath, null); CopyObjectResponse copyObjectResponse = _s3Client.copyObject(copyReq); return copyObjectResponse.sdkHttpResponse().isSuccessful(); } catch (S3Exception e) { throw new IOException(e); } }
/** * Method to copy file from source to destination. * @param srcUri source path * @param dstUri destination path * @return {@code true} if the copy operation succeeds, i.e., response code is 200 * {@code false} otherwise */
Method to copy file from source to destination
copyFile
{ "repo_name": "linkedin/pinot", "path": "pinot-plugins/pinot-file-system/pinot-s3/src/main/java/org/apache/pinot/plugin/filesystem/S3PinotFS.java", "license": "apache-2.0", "size": 23466 }
[ "java.io.IOException", "java.io.UnsupportedEncodingException", "java.net.URLEncoder", "java.nio.charset.StandardCharsets", "software.amazon.awssdk.services.s3.model.CopyObjectRequest", "software.amazon.awssdk.services.s3.model.CopyObjectResponse", "software.amazon.awssdk.services.s3.model.S3Exception" ]
import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import software.amazon.awssdk.services.s3.model.CopyObjectRequest; import software.amazon.awssdk.services.s3.model.CopyObjectResponse; import software.amazon.awssdk.services.s3.model.S3Exception;
import java.io.*; import java.net.*; import java.nio.charset.*; import software.amazon.awssdk.services.s3.model.*;
[ "java.io", "java.net", "java.nio", "software.amazon.awssdk" ]
java.io; java.net; java.nio; software.amazon.awssdk;
2,378,829
public static String getCacheRootPath(Context context) { return getCachePath(context, null); }
static String function(Context context) { return getCachePath(context, null); }
/** * Gets cache root path. * * @param context the context * @return the cache root path */
Gets cache root path
getCacheRootPath
{ "repo_name": "mainh/MainCalendar", "path": "app/src/main/java/com/jjforever/wgj/maincalendar/filepicker/util/StorageUtils.java", "license": "apache-2.0", "size": 6737 }
[ "android.content.Context" ]
import android.content.Context;
import android.content.*;
[ "android.content" ]
android.content;
2,357,139
@Override public DateTime getLastFixup() { // TODO Auto-generated method stub return null; }
DateTime function() { return null; }
/** * Not implemented yet. */
Not implemented yet
getLastFixup
{ "repo_name": "hyarthi/project-red", "path": "src/java/org.openntf.red.main/src/org/openntf/red/impl/Database.java", "license": "apache-2.0", "size": 36930 }
[ "org.openntf.red.DateTime" ]
import org.openntf.red.DateTime;
import org.openntf.red.*;
[ "org.openntf.red" ]
org.openntf.red;
2,729,950
@WebMethod @WebResult(name = "rval", targetNamespace = "https://www.google.com/apis/ads/publisher/v201405") @RequestWrapper(localName = "getContentByStatement", targetNamespace = "https://www.google.com/apis/ads/publisher/v201405", className = "com.google.api.ads.dfp.jaxws.v201405.ContentServiceInterfacegetContentByStatement") @ResponseWrapper(localName = "getContentByStatementResponse", targetNamespace = "https://www.google.com/apis/ads/publisher/v201405", className = "com.google.api.ads.dfp.jaxws.v201405.ContentServiceInterfacegetContentByStatementResponse") public ContentPage getContentByStatement( @WebParam(name = "statement", targetNamespace = "https://www.google.com/apis/ads/publisher/v201405") Statement statement) throws ApiException_Exception ;
@WebResult(name = "rval", targetNamespace = STRgetContentByStatementSTRhttps: @ResponseWrapper(localName = "getContentByStatementResponseSTRhttps: ContentPage function( @WebParam(name = "statementSTRhttps: Statement statement) throws ApiException_Exception ;
/** * * Gets a {@link ContentPage} of {@link Content} objects that satisfy the * given {@link Statement#query}. The following fields are supported for * filtering: * * <table> * <tr> * <th scope="col">PQL Property</th> <th scope="col">Object Property</th> * </tr> * <tr> * <td>{@code id}</td> * <td>{@link Content#id}</td> * </tr> * <tr> * <td>{@code status}</td> * <td>{@link Content#status}</td> * </tr> * <tr> * <td>{@code name}</td> * <td>{@link Content#name}</td> * </tr> * <tr> * <td>{@code lastModifiedDateTime}</td> * <td>{@link Content#lastModifiedDateTime}: Requires indexed content search to be enabled.</td> * </tr> * </table> * * @params filterStatement a Publisher Query Language statement used to * filter a set of content * @return the content that matches the given filter * * * @param statement * @return * returns com.google.api.ads.dfp.jaxws.v201405.ContentPage * @throws ApiException_Exception */
Gets a <code>ContentPage</code> of <code>Content</code> objects that satisfy the given <code>Statement#query</code>. The following fields are supported for filtering: PQL Property Object Property id <code>Content#id</code> status <code>Content#status</code> name <code>Content#name</code> lastModifiedDateTime <code>Content#lastModifiedDateTime</code>: Requires indexed content search to be enabled.
getContentByStatement
{ "repo_name": "nafae/developer", "path": "modules/dfp_appengine/src/main/java/com/google/api/ads/dfp/jaxws/v201405/ContentServiceInterface.java", "license": "apache-2.0", "size": 6584 }
[ "javax.jws.WebParam", "javax.jws.WebResult", "javax.xml.ws.ResponseWrapper" ]
import javax.jws.WebParam; import javax.jws.WebResult; import javax.xml.ws.ResponseWrapper;
import javax.jws.*; import javax.xml.ws.*;
[ "javax.jws", "javax.xml" ]
javax.jws; javax.xml;
2,811,670
public void closeQuietly( final HttpGet get, final CloseableHttpResponse resp ) { // Response needs to be closed HttpClientUtils.closeQuietly(resp); // Closing the request is not an absolute requirement if (get != null) get.releaseConnection(); }
void function( final HttpGet get, final CloseableHttpResponse resp ) { HttpClientUtils.closeQuietly(resp); if (get != null) get.releaseConnection(); }
/** * Helper to close HttpGet and its response * @param get Thing to be closed * @param resp Thing to be closed */
Helper to close HttpGet and its response
closeQuietly
{ "repo_name": "laverca/laverca", "path": "src/core/fi/laverca/util/LavercaHttpClient.java", "license": "apache-2.0", "size": 20121 }
[ "org.apache.http.client.methods.CloseableHttpResponse", "org.apache.http.client.methods.HttpGet", "org.apache.http.client.utils.HttpClientUtils" ]
import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.utils.HttpClientUtils;
import org.apache.http.client.methods.*; import org.apache.http.client.utils.*;
[ "org.apache.http" ]
org.apache.http;
2,888,097
public static ArrayList<Vertex[]> getDeepVertexArrayCopy(ArrayList<Vertex[]> vertices){ ArrayList<Vertex[]> returnList = new ArrayList<Vertex[]>(); for (Vertex[] vs : vertices){ Vertex[] copy = new Vertex[vs.length]; for (int i = 0; i < vs.length; i++) { Vertex vertex = vs[i]; copy[i] = (Vertex)vertex.getCopy(); } returnList.add(copy); } return returnList; }
static ArrayList<Vertex[]> function(ArrayList<Vertex[]> vertices){ ArrayList<Vertex[]> returnList = new ArrayList<Vertex[]>(); for (Vertex[] vs : vertices){ Vertex[] copy = new Vertex[vs.length]; for (int i = 0; i < vs.length; i++) { Vertex vertex = vs[i]; copy[i] = (Vertex)vertex.getCopy(); } returnList.add(copy); } return returnList; }
/** * Returns a list of exact copies of the provided vertices. * * @param vertices the vertices * * @return the deep vertex array copy */
Returns a list of exact copies of the provided vertices
getDeepVertexArrayCopy
{ "repo_name": "rjmarsan/GestureSound", "path": "src/org/mt4j/util/math/Vertex.java", "license": "gpl-2.0", "size": 12268 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
2,227,535
public static void setStreamPath(Configuration conf, URI path) { conf.set(STREAM_PATH, path.toString()); }
static void function(Configuration conf, URI path) { conf.set(STREAM_PATH, path.toString()); }
/** * Sets the base path to stream files. * * @param conf The conf to modify. * @param path The file path to stream base directory. */
Sets the base path to stream files
setStreamPath
{ "repo_name": "anthcp/cdap", "path": "cdap-data-fabric/src/main/java/co/cask/cdap/data/stream/StreamInputFormat.java", "license": "apache-2.0", "size": 13695 }
[ "org.apache.hadoop.conf.Configuration" ]
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,695,677
public List<String> getOutputKeys() throws ServerError { return env().getOutputKeys(getSessionId()); } // Helpers // =========================================================================
List<String> function() throws ServerError { return env().getOutputKeys(getSessionId()); }
/** * Returns a list of keys for all items in the "output" shared (session) * memory */
Returns a list of keys for all items in the "output" shared (session) memory
getOutputKeys
{ "repo_name": "jburel/openmicroscopy", "path": "components/blitz/src/omero/client.java", "license": "gpl-2.0", "size": 45326 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
935,299
public static Match match(List<String> lines, List<String> targets) { int numLines = lines.size(); int numTargets = targets.size(); int lineNo = 0; int targetNo = 0; while ( (lineNo < numLines) && (targetNo < numTargets) ) { String target = targets.get(targetNo); lineNo = match(lines, lineNo, target); if ( lineNo == numLines ) { // This target found no match. break; } else if ( targetNo == numTargets ) { // This target found a match, but there are no more targets. break; } else { // This target found a match, and there are more targets. lineNo++; targetNo++; } } // Will be either ( return new Match(lineNo, targetNo); }
static Match function(List<String> lines, List<String> targets) { int numLines = lines.size(); int numTargets = targets.size(); int lineNo = 0; int targetNo = 0; while ( (lineNo < numLines) && (targetNo < numTargets) ) { String target = targets.get(targetNo); lineNo = match(lines, lineNo, target); if ( lineNo == numLines ) { break; } else if ( targetNo == numTargets ) { break; } else { lineNo++; targetNo++; } } return new Match(lineNo, targetNo); }
/** * Match lines against targets. * * Search for the targets sequentially. * One target match per line is handled. * * Answer match data: The number of the last line which had * a match and the number of the last target which matched. */
Match lines against targets. Search for the targets sequentially. One target match per line is handled. Answer match data: The number of the last line which had a match and the number of the last target which matched
match
{ "repo_name": "OpenLiberty/open-liberty", "path": "dev/io.openliberty.opentracing.3.x_fat/fat/src/io/openliberty/opentracing/internal/test/FATUtilsServer.java", "license": "epl-1.0", "size": 9022 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,761,368
public static JCheckBox addCheckbox(Container component, String text, Icon icon, ActionListener listener, String actionCommand, String toolTip, boolean state) { return addCheckbox(component, text, icon, listener, actionCommand, 0, toolTip, state); }
static JCheckBox function(Container component, String text, Icon icon, ActionListener listener, String actionCommand, String toolTip, boolean state) { return addCheckbox(component, text, icon, listener, actionCommand, 0, toolTip, state); }
/** * * Add a new checkbox to given component * * @param component Component to add the checkbox to * @param text Checkbox' text * @param icon Checkbox' icon or null * @param listener Checkbox' listener or null * @param actionCommand Checkbox' action command or null * @param toolTip Checkbox' tool tip or null * @param state Checkbox' state * @return */
Add a new checkbox to given component
addCheckbox
{ "repo_name": "mzmine/mzmine3", "path": "src/main/java/io/github/mzmine/util/GUIUtils.java", "license": "gpl-2.0", "size": 19563 }
[ "java.awt.Container", "java.awt.event.ActionListener", "javax.swing.Icon", "javax.swing.JCheckBox" ]
import java.awt.Container; import java.awt.event.ActionListener; import javax.swing.Icon; import javax.swing.JCheckBox;
import java.awt.*; import java.awt.event.*; import javax.swing.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
2,378,371
public void removeStoredBlock(Block block, DatanodeDescriptor node) { if(blockLog.isDebugEnabled()) { blockLog.debug("BLOCK* removeStoredBlock: " + block + " from " + node); } assert (namesystem.hasWriteLock()); { if (!blocksMap.removeNode(block, node)) { if(blockLog.isDebugEnabled()) { blockLog.debug("BLOCK* removeStoredBlock: " + block + " has already been removed from node " + node); } return; } // // It's possible that the block was removed because of a datanode // failure. If the block is still valid, check if replication is // necessary. In that case, put block on a possibly-will- // be-replicated list. // BlockCollection bc = blocksMap.getBlockCollection(block); if (bc != null) { namesystem.decrementSafeBlockCount(block); updateNeededReplications(block, -1, 0); } // // We've removed a block from a node, so it's definitely no longer // in "excess" there. // LightWeightLinkedSet<Block> excessBlocks = excessReplicateMap.get(node .getDatanodeUuid()); if (excessBlocks != null) { if (excessBlocks.remove(block)) { excessBlocksCount.decrementAndGet(); if(blockLog.isDebugEnabled()) { blockLog.debug("BLOCK* removeStoredBlock: " + block + " is removed from excessBlocks"); } if (excessBlocks.size() == 0) { excessReplicateMap.remove(node.getDatanodeUuid()); } } } // Remove the replica from corruptReplicas corruptReplicas.removeFromCorruptReplicasMap(block, node); } }
void function(Block block, DatanodeDescriptor node) { if(blockLog.isDebugEnabled()) { blockLog.debug(STR + block + STR + node); } assert (namesystem.hasWriteLock()); { if (!blocksMap.removeNode(block, node)) { if(blockLog.isDebugEnabled()) { blockLog.debug(STR + block + STR + node); } return; } if (bc != null) { namesystem.decrementSafeBlockCount(block); updateNeededReplications(block, -1, 0); } .getDatanodeUuid()); if (excessBlocks != null) { if (excessBlocks.remove(block)) { excessBlocksCount.decrementAndGet(); if(blockLog.isDebugEnabled()) { blockLog.debug(STR + block + STR); } if (excessBlocks.size() == 0) { excessReplicateMap.remove(node.getDatanodeUuid()); } } } corruptReplicas.removeFromCorruptReplicasMap(block, node); } }
/** * Modify (block-->datanode) map. Possibly generate replication tasks, if the * removed block is still valid. */
Modify (block-->datanode) map. Possibly generate replication tasks, if the removed block is still valid
removeStoredBlock
{ "repo_name": "HazelChen/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java", "license": "apache-2.0", "size": 142814 }
[ "org.apache.hadoop.hdfs.protocol.Block" ]
import org.apache.hadoop.hdfs.protocol.Block;
import org.apache.hadoop.hdfs.protocol.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,893,892
public void sendMeetingResponse(final long messageId, final int response) { // Split here for target type (Service or MessagingController) IEmailService service = getServiceForMessage(messageId); if (service != null) { // Service implementation try { service.sendMeetingResponse(messageId, response); } catch (RemoteException e) { // TODO Change exception handling to be consistent with however // this method // is implemented for other protocols Log.e("onDownloadAttachment", "RemoteException", e); } } }
void function(final long messageId, final int response) { IEmailService service = getServiceForMessage(messageId); if (service != null) { try { service.sendMeetingResponse(messageId, response); } catch (RemoteException e) { Log.e(STR, STR, e); } } }
/** * Respond to a meeting invitation. * * @param messageId the id of the invitation being responded to * @param response the code representing the response to the invitation */
Respond to a meeting invitation
sendMeetingResponse
{ "repo_name": "rex-xxx/mt6572_x201", "path": "packages/apps/Email/src/com/android/email/Controller.java", "license": "gpl-2.0", "size": 126082 }
[ "android.os.RemoteException", "android.util.Log", "com.android.emailcommon.service.IEmailService" ]
import android.os.RemoteException; import android.util.Log; import com.android.emailcommon.service.IEmailService;
import android.os.*; import android.util.*; import com.android.emailcommon.service.*;
[ "android.os", "android.util", "com.android.emailcommon" ]
android.os; android.util; com.android.emailcommon;
630,976
this.mesh = new Mesh(m); this.decimate(this.mesh); }
this.mesh = new Mesh(m); this.decimate(this.mesh); }
/** * Builds a ground from a mesh, by computing the algorithms. * * @param m * the mesh to convert */
Builds a ground from a mesh, by computing the algorithms
buildFromMesh
{ "repo_name": "Nantes1900/Nantes-1900-Stage-D.Lefevre", "path": "src/fr/nantes1900/models/extended/Ground.java", "license": "gpl-3.0", "size": 1973 }
[ "fr.nantes1900.models.Mesh" ]
import fr.nantes1900.models.Mesh;
import fr.nantes1900.models.*;
[ "fr.nantes1900.models" ]
fr.nantes1900.models;
2,712,661
public WebPage afterSave();
WebPage function();
/** * Will be called directly after storing the data object (insert). Any return value is not yet supported. */
Will be called directly after storing the data object (insert). Any return value is not yet supported
afterSave
{ "repo_name": "micromata/projectforge", "path": "projectforge-wicket/src/main/java/org/projectforge/web/wicket/IEditPage.java", "license": "gpl-3.0", "size": 5205 }
[ "org.apache.wicket.markup.html.WebPage" ]
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.*;
[ "org.apache.wicket" ]
org.apache.wicket;
551,738
protected int getAvailableBalance(String token, String fromAcct) throws HttpServerErrorException { LOGGER.debug("Retrieving balance for transaction sender"); HttpHeaders headers = new HttpHeaders(); headers.set("Authorization", "Bearer " + token); HttpEntity entity = new HttpEntity(headers); String uri = balancesApiUri + "/" + fromAcct; ResponseEntity<Integer> response = restTemplate.exchange( uri, HttpMethod.GET, entity, Integer.class); Integer senderBalance = response.getBody(); return senderBalance.intValue(); }
int function(String token, String fromAcct) throws HttpServerErrorException { LOGGER.debug(STR); HttpHeaders headers = new HttpHeaders(); headers.set(STR, STR + token); HttpEntity entity = new HttpEntity(headers); String uri = balancesApiUri + "/" + fromAcct; ResponseEntity<Integer> response = restTemplate.exchange( uri, HttpMethod.GET, entity, Integer.class); Integer senderBalance = response.getBody(); return senderBalance.intValue(); }
/** * Retrieve the balance for the transaction's sender. * * @param token the token used to authenticate request * @param fromAcct sender account number * * @return available balance of the sender account * * @throws HttpServerErrorException if balance service returns 500 */
Retrieve the balance for the transaction's sender
getAvailableBalance
{ "repo_name": "GoogleCloudPlatform/bank-of-anthos", "path": "src/ledgerwriter/src/main/java/anthos/samples/bankofanthos/ledgerwriter/LedgerWriterController.java", "license": "apache-2.0", "size": 9175 }
[ "org.springframework.http.HttpEntity", "org.springframework.http.HttpHeaders", "org.springframework.http.HttpMethod", "org.springframework.http.ResponseEntity", "org.springframework.web.client.HttpServerErrorException" ]
import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; import org.springframework.web.client.HttpServerErrorException;
import org.springframework.http.*; import org.springframework.web.client.*;
[ "org.springframework.http", "org.springframework.web" ]
org.springframework.http; org.springframework.web;
1,931,838
EReference getGeneratingBid_StartUpCostCurve();
EReference getGeneratingBid_StartUpCostCurve();
/** * Returns the meta object for the reference '{@link CIM.IEC61970.Informative.MarketOperations.GeneratingBid#getStartUpCostCurve <em>Start Up Cost Curve</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the reference '<em>Start Up Cost Curve</em>'. * @see CIM.IEC61970.Informative.MarketOperations.GeneratingBid#getStartUpCostCurve() * @see #getGeneratingBid() * @generated */
Returns the meta object for the reference '<code>CIM.IEC61970.Informative.MarketOperations.GeneratingBid#getStartUpCostCurve Start Up Cost Curve</code>'.
getGeneratingBid_StartUpCostCurve
{ "repo_name": "georghinkel/ttc2017smartGrids", "path": "solutions/ModelJoin/src/main/java/CIM/IEC61970/Informative/MarketOperations/MarketOperationsPackage.java", "license": "mit", "size": 688294 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,431,786
public LibrarySet[] getActiveLibrarySets(final LinkerDef[] defaultProviders, final int index) { if (isReference()) { return ((LinkerDef) getCheckedRef(LinkerDef.class, "LinkerDef")) .getActiveUserLibrarySets(defaultProviders, index); } final Project p = getProject(); final Vector libsets = new Vector(); for (int i = index; i < defaultProviders.length; i++) { defaultProviders[i].addActiveUserLibrarySets(p, libsets); } addActiveUserLibrarySets(p, libsets); for (int i = index; i < defaultProviders.length; i++) { defaultProviders[i].addActiveSystemLibrarySets(p, libsets); } addActiveSystemLibrarySets(p, libsets); final LibrarySet[] sets = new LibrarySet[libsets.size()]; libsets.copyInto(sets); return sets; }
LibrarySet[] function(final LinkerDef[] defaultProviders, final int index) { if (isReference()) { return ((LinkerDef) getCheckedRef(LinkerDef.class, STR)) .getActiveUserLibrarySets(defaultProviders, index); } final Project p = getProject(); final Vector libsets = new Vector(); for (int i = index; i < defaultProviders.length; i++) { defaultProviders[i].addActiveUserLibrarySets(p, libsets); } addActiveUserLibrarySets(p, libsets); for (int i = index; i < defaultProviders.length; i++) { defaultProviders[i].addActiveSystemLibrarySets(p, libsets); } addActiveSystemLibrarySets(p, libsets); final LibrarySet[] sets = new LibrarySet[libsets.size()]; libsets.copyInto(sets); return sets; }
/** * Returns an array of active library sets for this linker definition. */
Returns an array of active library sets for this linker definition
getActiveLibrarySets
{ "repo_name": "Zetten/nar-maven-plugin", "path": "src/main/java/com/github/maven_nar/cpptasks/LinkerDef.java", "license": "apache-2.0", "size": 15421 }
[ "com.github.maven_nar.cpptasks.types.LibrarySet", "java.util.Vector", "org.apache.tools.ant.Project" ]
import com.github.maven_nar.cpptasks.types.LibrarySet; import java.util.Vector; import org.apache.tools.ant.Project;
import com.github.maven_nar.cpptasks.types.*; import java.util.*; import org.apache.tools.ant.*;
[ "com.github.maven_nar", "java.util", "org.apache.tools" ]
com.github.maven_nar; java.util; org.apache.tools;
1,037,866
public HttpSecurity regexMatcher(String pattern) { return requestMatcher(new RegexRequestMatcher(pattern, null)); } public final class RequestMatcherConfigurer extends AbstractRequestMatcherRegistry<RequestMatcherConfigurer> {
HttpSecurity function(String pattern) { return requestMatcher(new RegexRequestMatcher(pattern, null)); } public final class RequestMatcherConfigurer extends AbstractRequestMatcherRegistry<RequestMatcherConfigurer> {
/** * Allows configuring the {@link HttpSecurity} to only be invoked when * matching the provided regex pattern. If more advanced configuration is * necessary, consider using {@link #requestMatchers()} or * {@link #requestMatcher(RequestMatcher)}. * * <p> * Invoking {@link #regexMatcher(String)} will override previous invocations of * {@link #requestMatchers()}, {@link #antMatcher(String)}, {@link #regexMatcher(String)}, * and {@link #requestMatcher(RequestMatcher)}. * </p> * * @param pattern the Regular Expression to match on (i.e. "/admin/.+") * @return the {@link HttpSecurity} for further customizations * @see RegexRequestMatcher */
Allows configuring the <code>HttpSecurity</code> to only be invoked when matching the provided regex pattern. If more advanced configuration is necessary, consider using <code>#requestMatchers()</code> or <code>#requestMatcher(RequestMatcher)</code>. Invoking <code>#regexMatcher(String)</code> will override previous invocations of <code>#requestMatchers()</code>, <code>#antMatcher(String)</code>, <code>#regexMatcher(String)</code>, and <code>#requestMatcher(RequestMatcher)</code>.
regexMatcher
{ "repo_name": "vitorgv/spring-security", "path": "config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java", "license": "apache-2.0", "size": 55724 }
[ "org.springframework.security.config.annotation.web.AbstractRequestMatcherRegistry", "org.springframework.security.web.util.matcher.RegexRequestMatcher" ]
import org.springframework.security.config.annotation.web.AbstractRequestMatcherRegistry; import org.springframework.security.web.util.matcher.RegexRequestMatcher;
import org.springframework.security.config.annotation.web.*; import org.springframework.security.web.util.matcher.*;
[ "org.springframework.security" ]
org.springframework.security;
2,176,902
public void testPostInteractiveProxyAuthHostAuthConnKeepAlive() throws Exception { UsernamePasswordCredentials creds = new UsernamePasswordCredentials("testuser", "testpass"); this.client.getParams().setParameter(CredentialsProvider.PROVIDER, new GetItWrongThenGetItRight()); HttpRequestHandlerChain handlerchain = new HttpRequestHandlerChain(); handlerchain.appendHandler(new AuthRequestHandler(creds, "test", true)); handlerchain.appendHandler(new HttpServiceHandler(new FeedbackService())); this.server.setRequestHandler(handlerchain); this.proxy.requireAuthentication(creds, "test", true); PostMethod post = new PostMethod("/"); post.setRequestEntity(new StringRequestEntity("Like tons of stuff")); try { this.client.executeMethod(post); assertEquals(HttpStatus.SC_OK, post.getStatusCode()); assertNotNull(post.getResponseBodyAsString()); } finally { post.releaseConnection(); } }
void function() throws Exception { UsernamePasswordCredentials creds = new UsernamePasswordCredentials(STR, STR); this.client.getParams().setParameter(CredentialsProvider.PROVIDER, new GetItWrongThenGetItRight()); HttpRequestHandlerChain handlerchain = new HttpRequestHandlerChain(); handlerchain.appendHandler(new AuthRequestHandler(creds, "test", true)); handlerchain.appendHandler(new HttpServiceHandler(new FeedbackService())); this.server.setRequestHandler(handlerchain); this.proxy.requireAuthentication(creds, "test", true); PostMethod post = new PostMethod("/"); post.setRequestEntity(new StringRequestEntity(STR)); try { this.client.executeMethod(post); assertEquals(HttpStatus.SC_OK, post.getStatusCode()); assertNotNull(post.getResponseBodyAsString()); } finally { post.releaseConnection(); } }
/** * Tests POST via non-authenticating proxy + interactive host auth + connection keep-alive */
Tests POST via non-authenticating proxy + interactive host auth + connection keep-alive
testPostInteractiveProxyAuthHostAuthConnKeepAlive
{ "repo_name": "magneticmoon/httpclient3-ntml", "path": "src/test/org/apache/commons/httpclient/TestProxy.java", "license": "apache-2.0", "size": 30892 }
[ "org.apache.commons.httpclient.auth.CredentialsProvider", "org.apache.commons.httpclient.methods.PostMethod", "org.apache.commons.httpclient.methods.StringRequestEntity", "org.apache.commons.httpclient.server.AuthRequestHandler", "org.apache.commons.httpclient.server.HttpRequestHandlerChain", "org.apache.commons.httpclient.server.HttpServiceHandler" ]
import org.apache.commons.httpclient.auth.CredentialsProvider; import org.apache.commons.httpclient.methods.PostMethod; import org.apache.commons.httpclient.methods.StringRequestEntity; import org.apache.commons.httpclient.server.AuthRequestHandler; import org.apache.commons.httpclient.server.HttpRequestHandlerChain; import org.apache.commons.httpclient.server.HttpServiceHandler;
import org.apache.commons.httpclient.auth.*; import org.apache.commons.httpclient.methods.*; import org.apache.commons.httpclient.server.*;
[ "org.apache.commons" ]
org.apache.commons;
2,751,678
private int getIndexWithTypeCheck(String attrName, Type<?> type) { Integer index = ruleClass.getAttributeIndex(attrName); if (index == null) { throw new IllegalArgumentException("No such attribute " + attrName + " in rule " + ruleLabel.getName()); } Attribute attr = ruleClass.getAttribute(index); if (attr.getType() != type) { throw new IllegalArgumentException("Attribute " + attrName + " is of type " + attr.getType() + " and not of type " + type + " in rule " + ruleLabel); } return index; }
int function(String attrName, Type<?> type) { Integer index = ruleClass.getAttributeIndex(attrName); if (index == null) { throw new IllegalArgumentException(STR + attrName + STR + ruleLabel.getName()); } Attribute attr = ruleClass.getAttribute(index); if (attr.getType() != type) { throw new IllegalArgumentException(STR + attrName + STR + attr.getType() + STR + type + STR + ruleLabel); } return index; }
/** * Returns the index of the specified attribute, if its type is 'type'. Throws * an exception otherwise. */
Returns the index of the specified attribute, if its type is 'type'. Throws an exception otherwise
getIndexWithTypeCheck
{ "repo_name": "anupcshan/bazel", "path": "src/main/java/com/google/devtools/build/lib/packages/AbstractAttributeMapper.java", "license": "apache-2.0", "size": 8041 }
[ "com.google.devtools.build.lib.syntax.Type" ]
import com.google.devtools.build.lib.syntax.Type;
import com.google.devtools.build.lib.syntax.*;
[ "com.google.devtools" ]
com.google.devtools;
2,264,993
@CheckReturnValue public UnsignedLong dividedBy(UnsignedLong val) { return fromLongBits(UnsignedLongs.divide(value, checkNotNull(val).value)); }
UnsignedLong function(UnsignedLong val) { return fromLongBits(UnsignedLongs.divide(value, checkNotNull(val).value)); }
/** * Returns the result of dividing this by {@code val}. * * @since 14.0 */
Returns the result of dividing this by val
dividedBy
{ "repo_name": "ben-manes/guava", "path": "guava/src/com/google/common/primitives/UnsignedLong.java", "license": "apache-2.0", "size": 8497 }
[ "com.google.common.base.Preconditions" ]
import com.google.common.base.Preconditions;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
1,723,706
EList<Declaration> getDeclarations();
EList<Declaration> getDeclarations();
/** * Returns the value of the '<em><b>Declarations</b></em>' containment reference list. * The list contents are of type {@link org.xtextcon.xbase.smarthome.rules.Declaration}. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Declarations</em>' containment reference list isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Declarations</em>' containment reference list. * @see org.xtextcon.xbase.smarthome.rules.RulesPackage#getModel_Declarations() * @model containment="true" * @generated */
Returns the value of the 'Declarations' containment reference list. The list contents are of type <code>org.xtextcon.xbase.smarthome.rules.Declaration</code>. If the meaning of the 'Declarations' containment reference list isn't clear, there really should be more of a description here...
getDeclarations
{ "repo_name": "szarnekow/xtextcon-xbase-example", "path": "org.xtextcon.xbase.smarthome/src-gen/org/xtextcon/xbase/smarthome/rules/Model.java", "license": "epl-1.0", "size": 1251 }
[ "org.eclipse.emf.common.util.EList" ]
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
997,902
@ViewDebug.CapturedViewProperty public CharSequence getHint() { return mHint; }
@ViewDebug.CapturedViewProperty CharSequence function() { return mHint; }
/** * Returns the hint that is displayed when the text of the TextView * is empty. * * @attr ref android.R.styleable#TextView_hint */
Returns the hint that is displayed when the text of the TextView is empty
getHint
{ "repo_name": "JSDemos/android-sdk-20", "path": "src/android/widget/TextView.java", "license": "apache-2.0", "size": 343681 }
[ "android.view.ViewDebug" ]
import android.view.ViewDebug;
import android.view.*;
[ "android.view" ]
android.view;
655,774
@Override public void activate() { if (!isActive()) { super.activate(); TIMELINE_PREFERENCES.addPropertyChangeListener(this); TimelineViewer viewer = getViewer(); viewer.addPropertyChangeListener(listener); if (viewer.isAnimated()) { figure.addLayoutListener(LayoutAnimator.getDefault()); } ExpansionModel expansion = (ExpansionModel) getViewer().getProperty(ExpansionModel.ID); if (expansion != null) { expansion.addPropertyChangeListener(listener); } TreeTimelineContentProvider cp = getViewer().getTreeTimelineContentProvider(); if (cp != null) { cp.addListener(listener); } refreshVisuals(); } }
void function() { if (!isActive()) { super.activate(); TIMELINE_PREFERENCES.addPropertyChangeListener(this); TimelineViewer viewer = getViewer(); viewer.addPropertyChangeListener(listener); if (viewer.isAnimated()) { figure.addLayoutListener(LayoutAnimator.getDefault()); } ExpansionModel expansion = (ExpansionModel) getViewer().getProperty(ExpansionModel.ID); if (expansion != null) { expansion.addPropertyChangeListener(listener); } TreeTimelineContentProvider cp = getViewer().getTreeTimelineContentProvider(); if (cp != null) { cp.addListener(listener); } refreshVisuals(); } }
/** * Upon activation, attach to the model element as a property change listener. */
Upon activation, attach to the model element as a property change listener
activate
{ "repo_name": "nasa/OpenSPIFe", "path": "gov.nasa.arc.spife.ui.timeline/src/gov/nasa/arc/spife/ui/timeline/part/TreeTimelineDataEditPart.java", "license": "apache-2.0", "size": 10654 }
[ "gov.nasa.arc.spife.timeline.provider.TreeTimelineContentProvider", "gov.nasa.arc.spife.ui.timeline.TimelineViewer", "gov.nasa.arc.spife.ui.timeline.model.ExpansionModel", "org.eclipse.draw2d.LayoutAnimator" ]
import gov.nasa.arc.spife.timeline.provider.TreeTimelineContentProvider; import gov.nasa.arc.spife.ui.timeline.TimelineViewer; import gov.nasa.arc.spife.ui.timeline.model.ExpansionModel; import org.eclipse.draw2d.LayoutAnimator;
import gov.nasa.arc.spife.timeline.provider.*; import gov.nasa.arc.spife.ui.timeline.*; import gov.nasa.arc.spife.ui.timeline.model.*; import org.eclipse.draw2d.*;
[ "gov.nasa.arc", "org.eclipse.draw2d" ]
gov.nasa.arc; org.eclipse.draw2d;
1,369,852
private void attemptLogin() { // if (mAuthTask != null) { // return; // } // Reset errors. mUserNameView.setError(null); mPasswordView.setError(null); // Store values at the time of the login attempt. String userName = mUserNameView.getText().toString(); String password = mPasswordView.getText().toString(); boolean cancel = false; View focusView = null; // Check for a valid password, if the user entered one. if (!TextUtils.isEmpty(password) && !isPasswordValid(password)) { mPasswordView.setError(getString(R.string.error_invalid_password)); focusView = mPasswordView; cancel = true; } // Check for a valid userName if (TextUtils.isEmpty(userName)) { mUserNameView.setError(getString(R.string.error_field_required)); focusView = mUserNameView; cancel = true; } else if (!isUseerNameValid(userName)) { mUserNameView.setError(getString(R.string.error_invalid_user_name)); focusView = mUserNameView; cancel = true; }else { recordUserName(userName); }
void function() { mUserNameView.setError(null); mPasswordView.setError(null); String userName = mUserNameView.getText().toString(); String password = mPasswordView.getText().toString(); boolean cancel = false; View focusView = null; if (!TextUtils.isEmpty(password) && !isPasswordValid(password)) { mPasswordView.setError(getString(R.string.error_invalid_password)); focusView = mPasswordView; cancel = true; } if (TextUtils.isEmpty(userName)) { mUserNameView.setError(getString(R.string.error_field_required)); focusView = mUserNameView; cancel = true; } else if (!isUseerNameValid(userName)) { mUserNameView.setError(getString(R.string.error_invalid_user_name)); focusView = mUserNameView; cancel = true; }else { recordUserName(userName); }
/** * Attempts to sign in or register the account specified by the login form. * If there are form errors (invalid email, missing fields, etc.), the * errors are presented and no actual login attempt is made. */
Attempts to sign in or register the account specified by the login form. If there are form errors (invalid email, missing fields, etc.), the errors are presented and no actual login attempt is made
attemptLogin
{ "repo_name": "jiangwu45/booksharer", "path": "app/src/main/java/com/booksharer/view/LoginActivity.java", "license": "apache-2.0", "size": 9834 }
[ "android.text.TextUtils", "android.view.View" ]
import android.text.TextUtils; import android.view.View;
import android.text.*; import android.view.*;
[ "android.text", "android.view" ]
android.text; android.view;
2,478,494
public ProvenanceOptionsDTO getProvenanceSearchOptions() { final ProvenanceRepository provenanceRepository = flowController.getProvenanceRepository(); // create the search options dto final ProvenanceOptionsDTO searchOptions = new ProvenanceOptionsDTO(); final List<ProvenanceSearchableFieldDTO> searchableFieldNames = new ArrayList<>(); final List<SearchableField> fields = provenanceRepository.getSearchableFields(); for (final SearchableField field : fields) { // we exclude the Event Time because it is always searchable but don't want support querying it this way... // we prefer the user queries using startDate and endDate if (SearchableFields.EventTime.equals(field)) { continue; } final ProvenanceSearchableFieldDTO searchableField = new ProvenanceSearchableFieldDTO(); searchableField.setId(field.getIdentifier()); searchableField.setField(field.getSearchableFieldName()); searchableField.setLabel(field.getFriendlyName()); searchableField.setType(field.getFieldType().name()); searchableFieldNames.add(searchableField); } final List<SearchableField> searchableAttributes = provenanceRepository.getSearchableAttributes(); for (final SearchableField searchableAttr : searchableAttributes) { final ProvenanceSearchableFieldDTO searchableAttribute = new ProvenanceSearchableFieldDTO(); searchableAttribute.setId(searchableAttr.getIdentifier()); searchableAttribute.setField(searchableAttr.getSearchableFieldName()); searchableAttribute.setLabel(searchableAttr.getFriendlyName()); searchableAttribute.setType(searchableAttr.getFieldType().name()); searchableFieldNames.add(searchableAttribute); } searchOptions.setSearchableFields(searchableFieldNames); return searchOptions; }
ProvenanceOptionsDTO function() { final ProvenanceRepository provenanceRepository = flowController.getProvenanceRepository(); final ProvenanceOptionsDTO searchOptions = new ProvenanceOptionsDTO(); final List<ProvenanceSearchableFieldDTO> searchableFieldNames = new ArrayList<>(); final List<SearchableField> fields = provenanceRepository.getSearchableFields(); for (final SearchableField field : fields) { if (SearchableFields.EventTime.equals(field)) { continue; } final ProvenanceSearchableFieldDTO searchableField = new ProvenanceSearchableFieldDTO(); searchableField.setId(field.getIdentifier()); searchableField.setField(field.getSearchableFieldName()); searchableField.setLabel(field.getFriendlyName()); searchableField.setType(field.getFieldType().name()); searchableFieldNames.add(searchableField); } final List<SearchableField> searchableAttributes = provenanceRepository.getSearchableAttributes(); for (final SearchableField searchableAttr : searchableAttributes) { final ProvenanceSearchableFieldDTO searchableAttribute = new ProvenanceSearchableFieldDTO(); searchableAttribute.setId(searchableAttr.getIdentifier()); searchableAttribute.setField(searchableAttr.getSearchableFieldName()); searchableAttribute.setLabel(searchableAttr.getFriendlyName()); searchableAttribute.setType(searchableAttr.getFieldType().name()); searchableFieldNames.add(searchableAttribute); } searchOptions.setSearchableFields(searchableFieldNames); return searchOptions; }
/** * Gets the available options for searching provenance. * * @return the available options for searching provenance */
Gets the available options for searching provenance
getProvenanceSearchOptions
{ "repo_name": "InspurUSA/nifi", "path": "nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/ControllerFacade.java", "license": "apache-2.0", "size": 86923 }
[ "java.util.ArrayList", "java.util.List", "org.apache.nifi.provenance.ProvenanceRepository", "org.apache.nifi.provenance.SearchableFields", "org.apache.nifi.provenance.search.SearchableField", "org.apache.nifi.web.api.dto.provenance.ProvenanceOptionsDTO", "org.apache.nifi.web.api.dto.provenance.ProvenanceSearchableFieldDTO" ]
import java.util.ArrayList; import java.util.List; import org.apache.nifi.provenance.ProvenanceRepository; import org.apache.nifi.provenance.SearchableFields; import org.apache.nifi.provenance.search.SearchableField; import org.apache.nifi.web.api.dto.provenance.ProvenanceOptionsDTO; import org.apache.nifi.web.api.dto.provenance.ProvenanceSearchableFieldDTO;
import java.util.*; import org.apache.nifi.provenance.*; import org.apache.nifi.provenance.search.*; import org.apache.nifi.web.api.dto.provenance.*;
[ "java.util", "org.apache.nifi" ]
java.util; org.apache.nifi;
1,286,758
public void doSaveAs() throws IOException { FileDialog fileDialog = new FileDialog(this.canvas.getShell(), SWT.SAVE); String[] extensions = {"*.png"}; fileDialog.setFilterExtensions(extensions); String filename = fileDialog.open(); if (filename != null) { if (isEnforceFileExtensions()) { if (!filename.endsWith(".png")) { filename = filename + ".png"; } } //TODO replace getSize by getBounds ? ChartUtilities.saveChartAsPNG(new File(filename), this.chart, this.canvas.getSize().x, this.canvas.getSize().y); } }
void function() throws IOException { FileDialog fileDialog = new FileDialog(this.canvas.getShell(), SWT.SAVE); String[] extensions = {"*.png"}; fileDialog.setFilterExtensions(extensions); String filename = fileDialog.open(); if (filename != null) { if (isEnforceFileExtensions()) { if (!filename.endsWith(".png")) { filename = filename + ".png"; } } ChartUtilities.saveChartAsPNG(new File(filename), this.chart, this.canvas.getSize().x, this.canvas.getSize().y); } }
/** * Opens a file chooser and gives the user an opportunity to save the chart * in PNG format. * * @throws IOException if there is an I/O error. */
Opens a file chooser and gives the user an opportunity to save the chart in PNG format
doSaveAs
{ "repo_name": "raincs13/phd", "path": "swt/org/jfree/experimental/chart/swt/ChartComposite.java", "license": "lgpl-2.1", "size": 69511 }
[ "java.io.File", "java.io.IOException", "org.eclipse.swt.widgets.FileDialog", "org.jfree.chart.ChartUtilities" ]
import java.io.File; import java.io.IOException; import org.eclipse.swt.widgets.FileDialog; import org.jfree.chart.ChartUtilities;
import java.io.*; import org.eclipse.swt.widgets.*; import org.jfree.chart.*;
[ "java.io", "org.eclipse.swt", "org.jfree.chart" ]
java.io; org.eclipse.swt; org.jfree.chart;
1,964,933
public List<String> getTags() { List<String> tags = getRecord().getListField(InstanceConfigProperty.TAG_LIST.toString()); if (tags == null) { tags = new ArrayList<String>(0); } return tags; }
List<String> function() { List<String> tags = getRecord().getListField(InstanceConfigProperty.TAG_LIST.toString()); if (tags == null) { tags = new ArrayList<String>(0); } return tags; }
/** * Get arbitrary tags associated with the instance * @return a list of tags */
Get arbitrary tags associated with the instance
getTags
{ "repo_name": "apache/helix", "path": "helix-core/src/main/java/org/apache/helix/model/InstanceConfig.java", "license": "apache-2.0", "size": 23389 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
106,229
public void setBeginDate(Date beginDate) { this.beginDate = beginDate; }
void function(Date beginDate) { this.beginDate = beginDate; }
/** * Sets the begin date of calculation item. * * @param beginDate * the begin date of calculation item. */
Sets the begin date of calculation item
setBeginDate
{ "repo_name": "NASA-Tournament-Lab/CoECI-OPM-Service-Credit-Redeposit-Deposit-Application", "path": "Code/SCRD_BRE/src/java/core/gov/opm/scrd/entities/application/Calculation.java", "license": "apache-2.0", "size": 16511 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
1,525,524
public Set<String> getIndexNames() { if (indexes == null) return Collections.emptySet(); return indexes.keySet(); }
Set<String> function() { if (indexes == null) return Collections.emptySet(); return indexes.keySet(); }
/** * Get the names of the indexes defined in this configuration. * * @return the index names; never null but possibly empty * @see #getIndex(String) * @see #getRawIndex(String) */
Get the names of the indexes defined in this configuration
getIndexNames
{ "repo_name": "data-experts/modeshape", "path": "modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryConfiguration.java", "license": "apache-2.0", "size": 122566 }
[ "java.util.Collections", "java.util.Set" ]
import java.util.Collections; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
2,706,132
public boolean isKeyword(String word) { ANTLRHashString s = new ANTLRHashString(word, this); boolean res = literals.get(s) != null; Log.trace(this, "keyword " + word + ": " + res); return res; }
boolean function(String word) { ANTLRHashString s = new ANTLRHashString(word, this); boolean res = literals.get(s) != null; Log.trace(this, STR + word + STR + res); return res; }
/** * Returns true if word is a reserved keyword. */
Returns true if word is a reserved keyword
isKeyword
{ "repo_name": "stormymauldin/stuff", "path": "src/main/org/tzi/use/parser/MyLexer.java", "license": "gpl-2.0", "size": 3280 }
[ "org.tzi.use.util.Log" ]
import org.tzi.use.util.Log;
import org.tzi.use.util.*;
[ "org.tzi.use" ]
org.tzi.use;
2,042,303
public interface OnItemLongClickListener { boolean onItemLongClick(RecyclerView parent, View view, int position, long id); } private final RecyclerView mRecyclerView; private final TouchListener mTouchListener; private OnItemClickListener mItemClickListener; private OnItemLongClickListener mItemLongClickListener; private ItemClickSupport(RecyclerView recyclerView) { mRecyclerView = recyclerView; mTouchListener = new TouchListener(recyclerView); recyclerView.addOnItemTouchListener(mTouchListener); }
interface OnItemLongClickListener { boolean function(RecyclerView parent, View view, int position, long id); } private final RecyclerView mRecyclerView; private final TouchListener mTouchListener; private OnItemClickListener mItemClickListener; private OnItemLongClickListener mItemLongClickListener; private ItemClickSupport(RecyclerView recyclerView) { mRecyclerView = recyclerView; mTouchListener = new TouchListener(recyclerView); recyclerView.addOnItemTouchListener(mTouchListener); }
/** * Callback method to be invoked when an item in the RecyclerView * has been clicked and held. * * @param parent The RecyclerView where the click happened * @param view The view within the RecyclerView that was clicked * @param position The position of the view in the list * @param id The row id of the item that was clicked * * @return true if the callback consumed the long click, false otherwise */
Callback method to be invoked when an item in the RecyclerView has been clicked and held
onItemLongClick
{ "repo_name": "christoandrew/BaalaV2", "path": "core/src/main/java/org/lucasr/twowayview/ItemClickSupport.java", "license": "mit", "size": 4830 }
[ "android.support.v7.widget.RecyclerView", "android.view.View" ]
import android.support.v7.widget.RecyclerView; import android.view.View;
import android.support.v7.widget.*; import android.view.*;
[ "android.support", "android.view" ]
android.support; android.view;
522,035
public void deleteData() { FileSystemUtils.deleteRecursively(localDirectory); lastModifiedCache.delete(); }
void function() { FileSystemUtils.deleteRecursively(localDirectory); lastModifiedCache.delete(); }
/** * Deletes the data downloaded. */
Deletes the data downloaded
deleteData
{ "repo_name": "eschwert/DL-Learner", "path": "components-ext/src/main/java/org/dllearner/algorithms/isle/index/RemoteDataProvider.java", "license": "gpl-3.0", "size": 7438 }
[ "org.springframework.util.FileSystemUtils" ]
import org.springframework.util.FileSystemUtils;
import org.springframework.util.*;
[ "org.springframework.util" ]
org.springframework.util;
207,705
FeatureMap getMixed();
FeatureMap getMixed();
/** * Returns the value of the '<em><b>Mixed</b></em>' attribute list. * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Mixed</em>' attribute list isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Mixed</em>' attribute list. * @see org.casa.dsltesting.Qt48XmlschemaQwtEnhanced.Qt48XmlschemaQwtEnhancedPackage#getString_Mixed() * @model unique="false" dataType="org.eclipse.emf.ecore.EFeatureMapEntry" many="true" * extendedMetaData="kind='elementWildcard' name=':mixed'" * @generated */
Returns the value of the 'Mixed' attribute list. The list contents are of type <code>org.eclipse.emf.ecore.util.FeatureMap.Entry</code>. If the meaning of the 'Mixed' attribute list isn't clear, there really should be more of a description here...
getMixed
{ "repo_name": "pedromateo/tug_qt_unit_testing_fw", "path": "qt48_model/src/org/casa/dsltesting/Qt48XmlschemaQwtEnhanced/String.java", "license": "gpl-3.0", "size": 4781 }
[ "org.eclipse.emf.ecore.util.FeatureMap" ]
import org.eclipse.emf.ecore.util.FeatureMap;
import org.eclipse.emf.ecore.util.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,215,027
interface WithCreate extends Creatable<NetworkInterface>, Resource.DefinitionWithTags<WithCreate>, WithPrimaryPublicIpAddress, WithNetworkSecurityGroup, WithSecondaryIpConfiguration, WithLoadBalancer { WithCreate withIpForwarding();
interface WithCreate extends Creatable<NetworkInterface>, Resource.DefinitionWithTags<WithCreate>, WithPrimaryPublicIpAddress, WithNetworkSecurityGroup, WithSecondaryIpConfiguration, WithLoadBalancer { WithCreate withIpForwarding();
/** * Enable IP forwarding in the network interface. * * @return the next stage of the network interface definition */
Enable IP forwarding in the network interface
withIpForwarding
{ "repo_name": "herveyw/azure-sdk-for-java", "path": "azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NetworkInterface.java", "license": "mit", "size": 26048 }
[ "com.microsoft.azure.management.resources.fluentcore.arm.models.Resource", "com.microsoft.azure.management.resources.fluentcore.model.Creatable" ]
import com.microsoft.azure.management.resources.fluentcore.arm.models.Resource; import com.microsoft.azure.management.resources.fluentcore.model.Creatable;
import com.microsoft.azure.management.resources.fluentcore.arm.models.*; import com.microsoft.azure.management.resources.fluentcore.model.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
1,043,127
@NonNull private static Bitmap getExactBitmapForScreenshot(final int width, final int height) { synchronized (guardBitmaps) { for (final Bitmap bmp : weakBitmaps) { if (bmp.getWidth() == width && bmp.getHeight() == height) { weakBitmaps.remove(bmp); bmp.eraseColor(Color.TRANSPARENT); return bmp; } } } return Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); } //endregion //region Nested declarations @SuppressWarnings("WeakerAccess") public static class ReusableByteArrayOutputStream extends ByteArrayOutputStream { private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8; public ReusableByteArrayOutputStream(@NonNull final byte[] buffer) { super(0); this.buf = buffer; }
static Bitmap function(final int width, final int height) { synchronized (guardBitmaps) { for (final Bitmap bmp : weakBitmaps) { if (bmp.getWidth() == width && bmp.getHeight() == height) { weakBitmaps.remove(bmp); bmp.eraseColor(Color.TRANSPARENT); return bmp; } } } return Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); } @SuppressWarnings(STR) public static class ReusableByteArrayOutputStream extends ByteArrayOutputStream { private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8; public ReusableByteArrayOutputStream(@NonNull final byte[] buffer) { super(0); this.buf = buffer; }
/** * Try to find a bitmap with exact width and height for screenshot in reusable set and if * not found create a new one. */
Try to find a bitmap with exact width and height for screenshot in reusable set and if not found create a new one
getExactBitmapForScreenshot
{ "repo_name": "exponent/exponent", "path": "android/versioned-abis/expoview-abi38_0_0/src/main/java/abi38_0_0/host/exp/exponent/modules/api/viewshot/ViewShot.java", "license": "bsd-3-clause", "size": 19672 }
[ "android.graphics.Bitmap", "android.graphics.Color", "androidx.annotation.NonNull", "java.io.ByteArrayOutputStream" ]
import android.graphics.Bitmap; import android.graphics.Color; import androidx.annotation.NonNull; import java.io.ByteArrayOutputStream;
import android.graphics.*; import androidx.annotation.*; import java.io.*;
[ "android.graphics", "androidx.annotation", "java.io" ]
android.graphics; androidx.annotation; java.io;
1,077,987
public boolean onBlockStartBreak(ItemStack itemstack, BlockPos pos, EntityPlayer player) { return false; }
boolean function(ItemStack itemstack, BlockPos pos, EntityPlayer player) { return false; }
/** * Called before a block is broken. Return true to prevent default block harvesting. * * Note: In SMP, this is called on both client and server sides! * * @param itemstack The current ItemStack * @param pos Block's position in world * @param player The Player that is wielding the item * @return True to prevent harvesting, false to continue as normal */
Called before a block is broken. Return true to prevent default block harvesting. Note: In SMP, this is called on both client and server sides
onBlockStartBreak
{ "repo_name": "dogjaw2233/tiu-s-mod", "path": "build/tmp/recompileMc/sources/net/minecraft/item/Item.java", "license": "lgpl-2.1", "size": 80864 }
[ "net.minecraft.entity.player.EntityPlayer", "net.minecraft.util.BlockPos" ]
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.BlockPos;
import net.minecraft.entity.player.*; import net.minecraft.util.*;
[ "net.minecraft.entity", "net.minecraft.util" ]
net.minecraft.entity; net.minecraft.util;
2,462,224
public boolean isWarnEnabled(Marker marker) { return logger.isWarnEnabled(marker); }
boolean function(Marker marker) { return logger.isWarnEnabled(marker); }
/** * Delegate to the appropriate method of the underlying logger. */
Delegate to the appropriate method of the underlying logger
isWarnEnabled
{ "repo_name": "pallope17/AviaMe-Final", "path": "Librerias/hibernatejar/hibernatejar/slf4j-1.6.1/slf4j-1.6.1/slf4j-ext/src/main/java/org/slf4j/ext/LoggerWrapper.java", "license": "apache-2.0", "size": 25953 }
[ "org.slf4j.Marker" ]
import org.slf4j.Marker;
import org.slf4j.*;
[ "org.slf4j" ]
org.slf4j;
2,304,580
public static String entityIdForSecMgr(@Nonnull String configuredEntityId) { return configuredEntityId; }
static String function(@Nonnull String configuredEntityId) { return configuredEntityId; }
/** * This accessor codifies the entity ID that the GSA uses for the Security Manager. */
This accessor codifies the entity ID that the GSA uses for the Security Manager
entityIdForSecMgr
{ "repo_name": "googlegsa/secmgr", "path": "src/main/java/com/google/enterprise/util/C.java", "license": "apache-2.0", "size": 2465 }
[ "javax.annotation.Nonnull" ]
import javax.annotation.Nonnull;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
295,631
synchronized Message removeMessage() { if (!open) { throw new IllegalStateException("batch is not open"); } // our messages expired. if (isExpired()) { messages.clear(); return null; } if (messages.isEmpty()) return null; else return messages.remove(messages.size() - 1); }
synchronized Message removeMessage() { if (!open) { throw new IllegalStateException(STR); } if (isExpired()) { messages.clear(); return null; } if (messages.isEmpty()) return null; else return messages.remove(messages.size() - 1); }
/** * Returns a message if one is available. * <p> * The call adjusts the message count. * * @return a message or {@code null} if none is available */
Returns a message if one is available. The call adjusts the message count
removeMessage
{ "repo_name": "aws/aws-sdk-java", "path": "aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/ReceiveQueueBuffer.java", "license": "apache-2.0", "size": 25162 }
[ "com.amazonaws.services.sqs.model.Message" ]
import com.amazonaws.services.sqs.model.Message;
import com.amazonaws.services.sqs.model.*;
[ "com.amazonaws.services" ]
com.amazonaws.services;
2,806,191
public Script reduceScript() { return reduceScript; }
Script function() { return reduceScript; }
/** * Get the {@code reduce} script. */
Get the reduce script
reduceScript
{ "repo_name": "robin13/elasticsearch", "path": "server/src/main/java/org/elasticsearch/search/aggregations/metrics/ScriptedMetricAggregationBuilder.java", "license": "apache-2.0", "size": 10857 }
[ "org.elasticsearch.script.Script" ]
import org.elasticsearch.script.Script;
import org.elasticsearch.script.*;
[ "org.elasticsearch.script" ]
org.elasticsearch.script;
2,892,806
public DataSource getDataSource(CConnection connection) { if (m_ds != null) return m_ds; try { System.setProperty("com.mchange.v2.log.MLog", "com.mchange.v2.log.FallbackMLog"); //System.setProperty("com.mchange.v2.log.FallbackMLog.DEFAULT_CUTOFF_LEVEL", "ALL"); ComboPooledDataSource cpds = new ComboPooledDataSource(); cpds.setDataSourceName("AdempiereDS"); cpds.setDriverClass(DRIVER); //loads the jdbc driver cpds.setJdbcUrl(getConnectionURL(connection)); cpds.setUser(connection.getDbUid()); cpds.setPassword(connection.getDbPwd()); cpds.setPreferredTestQuery(DEFAULT_CONN_TEST_SQL); cpds.setIdleConnectionTestPeriod(1200); cpds.setAcquireRetryAttempts(2); //cpds.setTestConnectionOnCheckin(true); //cpds.setTestConnectionOnCheckout(true); //cpds.setCheckoutTimeout(60); if (Ini.isClient()) { cpds.setInitialPoolSize(1); cpds.setMinPoolSize(1); cpds.setMaxPoolSize(15); cpds.setMaxIdleTimeExcessConnections(1200); cpds.setMaxIdleTime(900); m_maxbusyconnections = 10; } else { cpds.setInitialPoolSize(10); cpds.setMinPoolSize(5); cpds.setMaxPoolSize(150); cpds.setMaxIdleTimeExcessConnections(1200); cpds.setMaxIdleTime(1200); m_maxbusyconnections = 120; } //the following sometimes kill active connection! //cpds.setUnreturnedConnectionTimeout(1200); //cpds.setDebugUnreturnedConnectionStackTraces(true); m_ds = cpds; } catch (Exception ex) { m_ds = null; //log might cause infinite loop since it will try to acquire database connection again //log.log(Level.SEVERE, "Could not initialise C3P0 Datasource", ex); System.err.println("Could not initialise C3P0 Datasource: " + ex.getLocalizedMessage()); } return m_ds; } // getDataSource
DataSource function(CConnection connection) { if (m_ds != null) return m_ds; try { System.setProperty(STR, STR); ComboPooledDataSource cpds = new ComboPooledDataSource(); cpds.setDataSourceName(STR); cpds.setDriverClass(DRIVER); cpds.setJdbcUrl(getConnectionURL(connection)); cpds.setUser(connection.getDbUid()); cpds.setPassword(connection.getDbPwd()); cpds.setPreferredTestQuery(DEFAULT_CONN_TEST_SQL); cpds.setIdleConnectionTestPeriod(1200); cpds.setAcquireRetryAttempts(2); if (Ini.isClient()) { cpds.setInitialPoolSize(1); cpds.setMinPoolSize(1); cpds.setMaxPoolSize(15); cpds.setMaxIdleTimeExcessConnections(1200); cpds.setMaxIdleTime(900); m_maxbusyconnections = 10; } else { cpds.setInitialPoolSize(10); cpds.setMinPoolSize(5); cpds.setMaxPoolSize(150); cpds.setMaxIdleTimeExcessConnections(1200); cpds.setMaxIdleTime(1200); m_maxbusyconnections = 120; } m_ds = cpds; } catch (Exception ex) { m_ds = null; System.err.println(STR + ex.getLocalizedMessage()); } return m_ds; }
/** * Create DataSource * @param connection connection * @return data dource */
Create DataSource
getDataSource
{ "repo_name": "erpcya/adempierePOS", "path": "base/src/org/compiere/db/DB_Oracle.java", "license": "gpl-2.0", "size": 38474 }
[ "com.mchange.v2.c3p0.ComboPooledDataSource", "javax.sql.DataSource", "org.compiere.util.Ini" ]
import com.mchange.v2.c3p0.ComboPooledDataSource; import javax.sql.DataSource; import org.compiere.util.Ini;
import com.mchange.v2.c3p0.*; import javax.sql.*; import org.compiere.util.*;
[ "com.mchange.v2", "javax.sql", "org.compiere.util" ]
com.mchange.v2; javax.sql; org.compiere.util;
1,756,841
@Override public String findValueByDate(int contextId, String key, Date date) { Query query = this.createNamedQuery(LookupEntity.FIND_VALUE_NO_JOIN); query.setParameter("contextId", contextId); query.setParameter("key", key); query.setParameter("today", date); String result = this.findSingle(query); if (result == null) { return this.findDefaultValue(contextId); } return result; }
String function(int contextId, String key, Date date) { Query query = this.createNamedQuery(LookupEntity.FIND_VALUE_NO_JOIN); query.setParameter(STR, contextId); query.setParameter("key", key); query.setParameter("today", date); String result = this.findSingle(query); if (result == null) { return this.findDefaultValue(contextId); } return result; }
/** * Finds the current value of a given key in the context on a specific date. * If the key does not exist then the default value will be returned. */
Finds the current value of a given key in the context on a specific date. If the key does not exist then the default value will be returned
findValueByDate
{ "repo_name": "KingsCollegeHospital/rassyeyanie", "path": "rassyeyanie-framework/src/main/java/uk/nhs/kch/rassyeyanie/framework/configuration/ConfigurationServiceImpl.java", "license": "apache-2.0", "size": 8933 }
[ "java.util.Date", "javax.persistence.Query" ]
import java.util.Date; import javax.persistence.Query;
import java.util.*; import javax.persistence.*;
[ "java.util", "javax.persistence" ]
java.util; javax.persistence;
349,714
public void process() throws IOException;
void function() throws IOException;
/** * Presumably any input streams, file to process, path to process, has been * handled separately ahead of time */
Presumably any input streams, file to process, path to process, has been handled separately ahead of time
process
{ "repo_name": "jennybrown8/codeanalyzer", "path": "src/main/java/com/codeforanyone/codeanalyzer/analyzers/Analyzer.java", "license": "apache-2.0", "size": 473 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,167,957
public void setRangeOfMeasuredValuesPaint(final Paint RANGE_OF_MEASURED_VALUES_PAINT) { rangeOfMeasuredValuesPaint = RANGE_OF_MEASURED_VALUES_PAINT; fireStateChanged(); }
void function(final Paint RANGE_OF_MEASURED_VALUES_PAINT) { rangeOfMeasuredValuesPaint = RANGE_OF_MEASURED_VALUES_PAINT; fireStateChanged(); }
/** * Sets the paint object that will be used to fill the area of measured values to the given paint object. * @param RANGE_OF_MEASURED_VALUES_PAINT */
Sets the paint object that will be used to fill the area of measured values to the given paint object
setRangeOfMeasuredValuesPaint
{ "repo_name": "mucar89/SteelSeries-Swing", "path": "src/main/java/eu/hansolo/steelseries/tools/Model.java", "license": "bsd-3-clause", "size": 98660 }
[ "java.awt.Paint" ]
import java.awt.Paint;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,440,822
@ServiceMethod(returns = ReturnType.SINGLE) Mono<ThroughputSettingsGetResultsInner> updateMongoDBDatabaseThroughputAsync( String resourceGroupName, String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters);
@ServiceMethod(returns = ReturnType.SINGLE) Mono<ThroughputSettingsGetResultsInner> updateMongoDBDatabaseThroughputAsync( String resourceGroupName, String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters);
/** * Update RUs per second of the an Azure Cosmos DB MongoDB database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB * database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Azure Cosmos DB resource throughput. */
Update RUs per second of the an Azure Cosmos DB MongoDB database
updateMongoDBDatabaseThroughputAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/MongoDBResourcesClient.java", "license": "mit", "size": 104176 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.cosmos.fluent.models.ThroughputSettingsGetResultsInner", "com.azure.resourcemanager.cosmos.models.ThroughputSettingsUpdateParameters" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.cosmos.fluent.models.ThroughputSettingsGetResultsInner; import com.azure.resourcemanager.cosmos.models.ThroughputSettingsUpdateParameters;
import com.azure.core.annotation.*; import com.azure.resourcemanager.cosmos.fluent.models.*; import com.azure.resourcemanager.cosmos.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,805,566
public void testRdnString() throws Exception { new Rdn("test=now+cn=mio+cn=mio2+ou=please+cn=mio3+ou=please2"); new Rdn("cn=mio+ou=please+cn=mio2+cn=mio3"); new Rdn("ou=please+test=now+cn=mio+cn=mio2+ou=please+cn=mio3+ou=please2+nueva=prueba"); new Rdn("au=please+d=d+b=now+cn=mio+cn=mio2+ou=please+cn=mio3+b=please2+na=prueba"); new Rdn("au=#00420ced"); new Rdn("au=\\#00420ced"); new Rdn("t=\\#0FA3TA"); new Rdn("t=\\4CM\\4E+u=Minombre\\40+a=\\4C\\0d"); new Rdn("v=a=a"); new Rdn("v=a=+a=+v=#0D8F"); new Rdn("v======="); new Rdn("v=<"); }
void function() throws Exception { new Rdn(STR); new Rdn(STR); new Rdn(STR); new Rdn(STR); new Rdn(STR); new Rdn(STR); new Rdn(STR); new Rdn(STR); new Rdn("v=a=a"); new Rdn(STR); new Rdn(STR); new Rdn("v=<"); }
/** * <p> * Test method for 'javax.naming.ldap.Rdn.Rdn(String)' * </p> * <p> * Here we are testing if the constructor can receive several multivalued * types. * </p> * <p> * The expected result is a not null instance. * </p> */
Test method for 'javax.naming.ldap.Rdn.Rdn(String)' Here we are testing if the constructor can receive several multivalued types. The expected result is a not null instance.
testRdnString
{ "repo_name": "freeVM/freeVM", "path": "enhanced/java/classlib/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/whitebox/TestRdnWhiteBoxDevelopment.java", "license": "apache-2.0", "size": 15229 }
[ "javax.naming.ldap.Rdn" ]
import javax.naming.ldap.Rdn;
import javax.naming.ldap.*;
[ "javax.naming" ]
javax.naming;
1,558,539
public void process(final WatchedEvent event) { LOG.debug("Got ZooKeeper event: {}", event); try { switch (event.getState()) { case SyncConnected: getRootRegion(); break; default: disconnectZK(); // Reconnect only if we're still trying to locate -ROOT-. synchronized (this) { if (deferred_rootregion != null) { LOG.warn("No longer connected to ZooKeeper, event=" + event); connectZK(); } } return; } } catch (Exception e) { LOG.error("Uncaught exception when handling event " + event, e); return; } LOG.debug("Done handling ZooKeeper event: {}", event); }
void function(final WatchedEvent event) { LOG.debug(STR, event); try { switch (event.getState()) { case SyncConnected: getRootRegion(); break; default: disconnectZK(); synchronized (this) { if (deferred_rootregion != null) { LOG.warn(STR + event); connectZK(); } } return; } } catch (Exception e) { LOG.error(STR + event, e); return; } LOG.debug(STR, event); }
/** * Processes a ZooKeeper event. * <p> * This method is called back by {@link ZooKeeper} from its main event * thread. So make sure you don't block. * @param event The event to process. */
Processes a ZooKeeper event. This method is called back by <code>ZooKeeper</code> from its main event thread. So make sure you don't block
process
{ "repo_name": "Flipboard/asynchbase", "path": "src/HBaseClient.java", "license": "bsd-3-clause", "size": 144376 }
[ "org.apache.zookeeper.WatchedEvent" ]
import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.*;
[ "org.apache.zookeeper" ]
org.apache.zookeeper;
2,502,602
public static void verifyFalse(boolean condition, String msg) { SeLionSoftAssert sa = (SeLionSoftAssert) Reporter.getCurrentTestResult().getAttribute( SeLionSoftAssert.SOFT_ASSERT_ATTRIBUTE_NAME); sa.assertFalse(condition, msg); }
static void function(boolean condition, String msg) { SeLionSoftAssert sa = (SeLionSoftAssert) Reporter.getCurrentTestResult().getAttribute( SeLionSoftAssert.SOFT_ASSERT_ATTRIBUTE_NAME); sa.assertFalse(condition, msg); }
/** * verifyFalse method is used to assert the condition based on boolean input and provide the Pass result for a FALSE * value.verifyFalse will Fail for a TRUE value and continue to run the test case. <br> * Sample Usage<br> * <code> * SeLionAsserts.verifyFalse(false,"Some Message"); * </code> * * @param condition * - A test condition to be validated for pass/fail * @param msg * - A descriptive text narrating a validation being done * */
verifyFalse method is used to assert the condition based on boolean input and provide the Pass result for a FALSE value.verifyFalse will Fail for a TRUE value and continue to run the test case. Sample Usage <code> SeLionAsserts.verifyFalse(false,"Some Message"); </code>
verifyFalse
{ "repo_name": "mengchen2/SeLion_Demo", "path": "client/src/main/java/com/paypal/selion/platform/asserts/SeLionAsserts.java", "license": "apache-2.0", "size": 19947 }
[ "org.testng.Reporter" ]
import org.testng.Reporter;
import org.testng.*;
[ "org.testng" ]
org.testng;
1,226,754
public Bundle get(String path, TryConsumer<? super Path, IOException> configurator) { return configure(get(path), configurator); }
Bundle function(String path, TryConsumer<? super Path, IOException> configurator) { return configure(get(path), configurator); }
/** * Process a file on the bundle. * @param path the relative path from the bundle root * @param configurator the file configurator * @return this */
Process a file on the bundle
get
{ "repo_name": "akirakw/asakusafw", "path": "utils-project/gradle-launcher/src/main/java/com/asakusafw/utils/gradle/Bundle.java", "license": "apache-2.0", "size": 12720 }
[ "java.io.IOException", "java.nio.file.Path" ]
import java.io.IOException; import java.nio.file.Path;
import java.io.*; import java.nio.file.*;
[ "java.io", "java.nio" ]
java.io; java.nio;
2,632,345
EAttribute getExJsonEnum_Values();
EAttribute getExJsonEnum_Values();
/** * Returns the meta object for the attribute list '{@link nl.sison.dsl.mobgen.jsonGen.ExJsonEnum#getValues <em>Values</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute list '<em>Values</em>'. * @see nl.sison.dsl.mobgen.jsonGen.ExJsonEnum#getValues() * @see #getExJsonEnum() * @generated */
Returns the meta object for the attribute list '<code>nl.sison.dsl.mobgen.jsonGen.ExJsonEnum#getValues Values</code>'.
getExJsonEnum_Values
{ "repo_name": "Buggaboo/xplatform", "path": "nl.sison.dsl.mobgen.JsonGen/src-gen/nl/sison/dsl/mobgen/jsonGen/JsonGenPackage.java", "license": "gpl-2.0", "size": 24320 }
[ "org.eclipse.emf.ecore.EAttribute" ]
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
69,309
public static IObjectStore unzipObjectStore(IObjectStore objectStore, String objectStoreName, byte[] zippedObjectStore) { // we create the zip file in our .sync folder ITreeStorageAdapter objectStoreStorageAdapter = objectStore.getObjectManager().getStorageAdapater(); try { // path is .sync/<ClientDevice> Path objectStorePath = Paths.get(objectStoreName); logger.trace("Creating object store directory in dir " + Paths.get(objectStore.getObjectManager().getStorageAdapater().getRootDir().getPath()).resolve(objectStoreName)); objectStoreStorageAdapter.persist(StorageType.DIRECTORY, new TreePathElement(objectStorePath.toString()), null); // create .sync folder in it objectStoreStorageAdapter.persist(StorageType.DIRECTORY, new TreePathElement(objectStorePath.resolve(".sync").toString()), null); // create storage adapter for object store ITreeStorageAdapter localStorageAdapter = new LocalStorageAdapter( Paths.get(objectStoreStorageAdapter.getRootDir().getPath()).resolve(objectStorePath).resolve(".sync") ); ByteArrayInputStream inputStream = new ByteArrayInputStream(zippedObjectStore); ZipInputStream zipInputStream = new ZipInputStream(new BufferedInputStream(inputStream)); // actually unzip unzip(zipInputStream, localStorageAdapter); return new ObjectStore(localStorageAdapter, "index.json", "object", localStorageAdapter); } catch (InputOutputException | IOException e) { logger.error("Could not write object store in dir " + objectStoreName + ". Message: " + e.getMessage()); return null; } }
static IObjectStore function(IObjectStore objectStore, String objectStoreName, byte[] zippedObjectStore) { ITreeStorageAdapter objectStoreStorageAdapter = objectStore.getObjectManager().getStorageAdapater(); try { Path objectStorePath = Paths.get(objectStoreName); logger.trace(STR + Paths.get(objectStore.getObjectManager().getStorageAdapater().getRootDir().getPath()).resolve(objectStoreName)); objectStoreStorageAdapter.persist(StorageType.DIRECTORY, new TreePathElement(objectStorePath.toString()), null); objectStoreStorageAdapter.persist(StorageType.DIRECTORY, new TreePathElement(objectStorePath.resolve(".sync").toString()), null); ITreeStorageAdapter localStorageAdapter = new LocalStorageAdapter( Paths.get(objectStoreStorageAdapter.getRootDir().getPath()).resolve(objectStorePath).resolve(".sync") ); ByteArrayInputStream inputStream = new ByteArrayInputStream(zippedObjectStore); ZipInputStream zipInputStream = new ZipInputStream(new BufferedInputStream(inputStream)); unzip(zipInputStream, localStorageAdapter); return new ObjectStore(localStorageAdapter, STR, STR, localStorageAdapter); } catch (InputOutputException IOException e) { logger.error(STR + objectStoreName + STR + e.getMessage()); return null; } }
/** * Unzips the given object store in the folder of the specified object store. * The folder in which the object store is unzipped is named after the given objectStoreName. * * @param objectStore The object store in which the given object store should be unzipped * @param objectStoreName The folder name in which the object store is unzipped * @param zippedObjectStore The zipped object store to unzip * * @return The unzipped object store */
Unzips the given object store in the folder of the specified object store. The folder in which the object store is unzipped is named after the given objectStoreName
unzipObjectStore
{ "repo_name": "p2p-sync/sync", "path": "src/main/java/org/rmatil/sync/core/Zip.java", "license": "apache-2.0", "size": 10132 }
[ "java.io.BufferedInputStream", "java.io.ByteArrayInputStream", "java.io.IOException", "java.nio.file.Path", "java.nio.file.Paths", "java.util.zip.ZipInputStream", "org.rmatil.sync.persistence.api.StorageType", "org.rmatil.sync.persistence.core.tree.ITreeStorageAdapter", "org.rmatil.sync.persistence.core.tree.TreePathElement", "org.rmatil.sync.persistence.core.tree.local.LocalStorageAdapter", "org.rmatil.sync.persistence.exceptions.InputOutputException", "org.rmatil.sync.version.api.IObjectStore", "org.rmatil.sync.version.core.ObjectStore" ]
import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.zip.ZipInputStream; import org.rmatil.sync.persistence.api.StorageType; import org.rmatil.sync.persistence.core.tree.ITreeStorageAdapter; import org.rmatil.sync.persistence.core.tree.TreePathElement; import org.rmatil.sync.persistence.core.tree.local.LocalStorageAdapter; import org.rmatil.sync.persistence.exceptions.InputOutputException; import org.rmatil.sync.version.api.IObjectStore; import org.rmatil.sync.version.core.ObjectStore;
import java.io.*; import java.nio.file.*; import java.util.zip.*; import org.rmatil.sync.persistence.api.*; import org.rmatil.sync.persistence.core.tree.*; import org.rmatil.sync.persistence.core.tree.local.*; import org.rmatil.sync.persistence.exceptions.*; import org.rmatil.sync.version.api.*; import org.rmatil.sync.version.core.*;
[ "java.io", "java.nio", "java.util", "org.rmatil.sync" ]
java.io; java.nio; java.util; org.rmatil.sync;
619,953
public DedicatedHostInner update(String resourceGroupName, String hostGroupName, String hostName, DedicatedHostUpdate parameters) { return updateWithServiceResponseAsync(resourceGroupName, hostGroupName, hostName, parameters).toBlocking().last().body(); }
DedicatedHostInner function(String resourceGroupName, String hostGroupName, String hostName, DedicatedHostUpdate parameters) { return updateWithServiceResponseAsync(resourceGroupName, hostGroupName, hostName, parameters).toBlocking().last().body(); }
/** * Update an dedicated host . * * @param resourceGroupName The name of the resource group. * @param hostGroupName The name of the dedicated host group. * @param hostName The name of the dedicated host . * @param parameters Parameters supplied to the Update Dedicated Host operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the DedicatedHostInner object if successful. */
Update an dedicated host
update
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/compute/mgmt-v2019_11_01/src/main/java/com/microsoft/azure/management/compute/v2019_11_01/implementation/DedicatedHostsInner.java", "license": "mit", "size": 62536 }
[ "com.microsoft.azure.management.compute.v2019_11_01.DedicatedHostUpdate" ]
import com.microsoft.azure.management.compute.v2019_11_01.DedicatedHostUpdate;
import com.microsoft.azure.management.compute.v2019_11_01.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
1,663,041
private void adjustFirstLineToJavadocIndent(DetailNode tree, int javadocColumnNumber) { if (tree.getLineNumber() == blockCommentLineNumber) { ((JavadocNodeImpl) tree).setColumnNumber(tree.getColumnNumber() + javadocColumnNumber); final DetailNode[] children = tree.getChildren(); for (DetailNode child : children) { adjustFirstLineToJavadocIndent(child, javadocColumnNumber); } } }
void function(DetailNode tree, int javadocColumnNumber) { if (tree.getLineNumber() == blockCommentLineNumber) { ((JavadocNodeImpl) tree).setColumnNumber(tree.getColumnNumber() + javadocColumnNumber); final DetailNode[] children = tree.getChildren(); for (DetailNode child : children) { adjustFirstLineToJavadocIndent(child, javadocColumnNumber); } } }
/** * Adjust first line nodes to javadoc indent. * @param tree DetailNode tree root * @param javadocColumnNumber javadoc indent */
Adjust first line nodes to javadoc indent
adjustFirstLineToJavadocIndent
{ "repo_name": "sabaka/checkstyle", "path": "src/main/java/com/puppycrawl/tools/checkstyle/JavadocDetailNodeParser.java", "license": "lgpl-2.1", "size": 25907 }
[ "com.puppycrawl.tools.checkstyle.api.DetailNode", "com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocNodeImpl" ]
import com.puppycrawl.tools.checkstyle.api.DetailNode; import com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocNodeImpl;
import com.puppycrawl.tools.checkstyle.api.*; import com.puppycrawl.tools.checkstyle.checks.javadoc.*;
[ "com.puppycrawl.tools" ]
com.puppycrawl.tools;
564,094
private void updateWithTarget() { // update text fields (should not fire actionPerformed()) xfield.setText(String.valueOf(target.x)); yfield.setText(String.valueOf(target.y)); wfield.setText(String.valueOf(target.width)); hfield.setText(String.valueOf(target.height)); // log the change (if during logging) FastEventManager.logMessage(MSG_TYPE_TARGET, toString()); }
void function() { xfield.setText(String.valueOf(target.x)); yfield.setText(String.valueOf(target.y)); wfield.setText(String.valueOf(target.width)); hfield.setText(String.valueOf(target.height)); FastEventManager.logMessage(MSG_TYPE_TARGET, toString()); }
/** * called whenever there is a change to the target. * intended for the hook to log the update, and updating the text fields. */
called whenever there is a change to the target. intended for the hook to log the update, and updating the text fields
updateWithTarget
{ "repo_name": "viktorbahr/jaer", "path": "src/de/cco/jaer/eval/target/RectangularTarget.java", "license": "lgpl-2.1", "size": 16577 }
[ "de.cco.jaer.eval.FastEventManager" ]
import de.cco.jaer.eval.FastEventManager;
import de.cco.jaer.eval.*;
[ "de.cco.jaer" ]
de.cco.jaer;
2,748,183
Integer timeToLive = null; if (historyTimeToLive != null && !historyTimeToLive.isEmpty()) { Matcher matISO = REGEX_TTL_ISO.matcher(historyTimeToLive); if (matISO.find()) { historyTimeToLive = matISO.group(1); } timeToLive = parseIntegerAttribute("historyTimeToLive", historyTimeToLive); } if (timeToLive != null && timeToLive < 0) { throw new NotValidException("Cannot parse historyTimeToLive: negative value is not allowed"); } return timeToLive; }
Integer timeToLive = null; if (historyTimeToLive != null && !historyTimeToLive.isEmpty()) { Matcher matISO = REGEX_TTL_ISO.matcher(historyTimeToLive); if (matISO.find()) { historyTimeToLive = matISO.group(1); } timeToLive = parseIntegerAttribute(STR, historyTimeToLive); } if (timeToLive != null && timeToLive < 0) { throw new NotValidException(STR); } return timeToLive; }
/** * Parse History Time To Live in ISO-8601 format to integer and set into the given entity * @param historyTimeToLive */
Parse History Time To Live in ISO-8601 format to integer and set into the given entity
parseHistoryTimeToLive
{ "repo_name": "camunda/camunda-bpm-platform", "path": "engine/src/main/java/org/camunda/bpm/engine/impl/util/ParseUtil.java", "license": "apache-2.0", "size": 5399 }
[ "java.util.regex.Matcher", "org.camunda.bpm.engine.exception.NotValidException" ]
import java.util.regex.Matcher; import org.camunda.bpm.engine.exception.NotValidException;
import java.util.regex.*; import org.camunda.bpm.engine.exception.*;
[ "java.util", "org.camunda.bpm" ]
java.util; org.camunda.bpm;
2,530,940
private boolean sameFile(final FileStatus inputStat, final FileStatus outputStat) { // Not matching length if (inputStat.getLen() != outputStat.getLen()) return false; // Mark files as equals, since user asked for no checksum verification if (!verifyChecksum) return true; // If checksums are not available, files are not the same. FileChecksum inChecksum = getFileChecksum(inputFs, inputStat.getPath()); if (inChecksum == null) return false; FileChecksum outChecksum = getFileChecksum(outputFs, outputStat.getPath()); if (outChecksum == null) return false; return inChecksum.equals(outChecksum); }
boolean function(final FileStatus inputStat, final FileStatus outputStat) { if (inputStat.getLen() != outputStat.getLen()) return false; if (!verifyChecksum) return true; FileChecksum inChecksum = getFileChecksum(inputFs, inputStat.getPath()); if (inChecksum == null) return false; FileChecksum outChecksum = getFileChecksum(outputFs, outputStat.getPath()); if (outChecksum == null) return false; return inChecksum.equals(outChecksum); }
/** * Check if the two files are equal by looking at the file length, * and at the checksum (if user has specified the verifyChecksum flag). */
Check if the two files are equal by looking at the file length, and at the checksum (if user has specified the verifyChecksum flag)
sameFile
{ "repo_name": "lilonglai/hbase-0.96.2", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java", "license": "apache-2.0", "size": 32444 }
[ "org.apache.hadoop.fs.FileChecksum", "org.apache.hadoop.fs.FileStatus" ]
import org.apache.hadoop.fs.FileChecksum; import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
204,925
private void dispatchMessage(OFMessage m) { this.switchManager.handleMessage(this.sw, m, null); }
void function(OFMessage m) { this.switchManager.handleMessage(this.sw, m, null); }
/** * Dispatches the message to the controller packet pipeline */
Dispatches the message to the controller packet pipeline
dispatchMessage
{ "repo_name": "cbarrin/EAGERFloodlight", "path": "src/main/java/net/floodlightcontroller/core/internal/OFSwitchHandshakeHandler.java", "license": "apache-2.0", "size": 63500 }
[ "org.projectfloodlight.openflow.protocol.OFMessage" ]
import org.projectfloodlight.openflow.protocol.OFMessage;
import org.projectfloodlight.openflow.protocol.*;
[ "org.projectfloodlight.openflow" ]
org.projectfloodlight.openflow;
1,428,972
public void testExpressionSubqueryWithIndexScan() { AbstractPlanNode pn; String sql; // INDEX on A, for sort order only sql = "SELECT A FROM R4 where A in (select A from R4 where A > 3) order by A;"; pn = compile(sql); pn = pn.getChild(0); assertTrue(pn instanceof IndexScanPlanNode); assertEquals(0, ((IndexScanPlanNode)pn).getSearchKeyExpressions().size()); assertNotNull(((IndexScanPlanNode)pn).getPredicate()); // INDEX on A, uniquely match A = 4, sql = "SELECT A FROM R4 where A = 4 and C in (select A from R4 where A > 3);"; pn = compile(sql); pn = pn.getChild(0); assertTrue(pn instanceof IndexScanPlanNode); assertEquals(1, ((IndexScanPlanNode)pn).getSearchKeyExpressions().size()); AbstractExpression comp = ((IndexScanPlanNode)pn).getSearchKeyExpressions().get(0); assertEquals(ExpressionType.VALUE_CONSTANT, comp.getExpressionType()); assertEquals("4", ((ConstantValueExpression)comp).getValue()); assertNotNull(((IndexScanPlanNode) pn).getPredicate()); }
void function() { AbstractPlanNode pn; String sql; sql = STR; pn = compile(sql); pn = pn.getChild(0); assertTrue(pn instanceof IndexScanPlanNode); assertEquals(0, ((IndexScanPlanNode)pn).getSearchKeyExpressions().size()); assertNotNull(((IndexScanPlanNode)pn).getPredicate()); sql = STR; pn = compile(sql); pn = pn.getChild(0); assertTrue(pn instanceof IndexScanPlanNode); assertEquals(1, ((IndexScanPlanNode)pn).getSearchKeyExpressions().size()); AbstractExpression comp = ((IndexScanPlanNode)pn).getSearchKeyExpressions().get(0); assertEquals(ExpressionType.VALUE_CONSTANT, comp.getExpressionType()); assertEquals("4", ((ConstantValueExpression)comp).getValue()); assertNotNull(((IndexScanPlanNode) pn).getPredicate()); }
/** * Expression subquery currently is not optimized to use any index. But this does not prevent the * parent query to use index for other purposes. */
Expression subquery currently is not optimized to use any index. But this does not prevent the parent query to use index for other purposes
testExpressionSubqueryWithIndexScan
{ "repo_name": "simonzhangsm/voltdb", "path": "tests/frontend/org/voltdb/planner/TestPlansSubQueries.java", "license": "agpl-3.0", "size": 120492 }
[ "org.voltdb.expressions.AbstractExpression", "org.voltdb.expressions.ConstantValueExpression", "org.voltdb.plannodes.AbstractPlanNode", "org.voltdb.plannodes.IndexScanPlanNode", "org.voltdb.types.ExpressionType" ]
import org.voltdb.expressions.AbstractExpression; import org.voltdb.expressions.ConstantValueExpression; import org.voltdb.plannodes.AbstractPlanNode; import org.voltdb.plannodes.IndexScanPlanNode; import org.voltdb.types.ExpressionType;
import org.voltdb.expressions.*; import org.voltdb.plannodes.*; import org.voltdb.types.*;
[ "org.voltdb.expressions", "org.voltdb.plannodes", "org.voltdb.types" ]
org.voltdb.expressions; org.voltdb.plannodes; org.voltdb.types;
1,082,083
public void indexArtifact(BlackboardArtifact artifact) throws TskCoreException;
void function(BlackboardArtifact artifact) throws TskCoreException;
/** * Takes a Blackboard artifact and adds all of its attributes to the keyword * search index. * * @param artifact * @throws org.sleuthkit.datamodel.TskCoreException */
Takes a Blackboard artifact and adds all of its attributes to the keyword search index
indexArtifact
{ "repo_name": "sidheshenator/autopsy", "path": "Core/src/org/sleuthkit/autopsy/keywordsearchservice/KeywordSearchService.java", "license": "apache-2.0", "size": 1222 }
[ "org.sleuthkit.datamodel.BlackboardArtifact", "org.sleuthkit.datamodel.TskCoreException" ]
import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.TskCoreException;
import org.sleuthkit.datamodel.*;
[ "org.sleuthkit.datamodel" ]
org.sleuthkit.datamodel;
2,081,837
public int getBurnTimeRemainingScaled(int id, int i) { if (this.burnTimeFresh[id] == 0) { return 0; } return this.burnTimeRemaining[id] * i / this.burnTimeFresh[id]; } private class ItemHandlerWrapperFurnace extends ItemHandlerWrapperSelectiveModifiable { public ItemHandlerWrapperFurnace(IItemHandlerModifiable baseHandler) { super(baseHandler); }
int function(int id, int i) { if (this.burnTimeFresh[id] == 0) { return 0; } return this.burnTimeRemaining[id] * i / this.burnTimeFresh[id]; } private class ItemHandlerWrapperFurnace extends ItemHandlerWrapperSelectiveModifiable { public ItemHandlerWrapperFurnace(IItemHandlerModifiable baseHandler) { super(baseHandler); }
/** * Returns an integer between 0 and the passed value representing how much burn time is left on the current fuel * item, where 0 means that the item is exhausted and the passed value means that the item is fresh */
Returns an integer between 0 and the passed value representing how much burn time is left on the current fuel item, where 0 means that the item is exhausted and the passed value means that the item is fresh
getBurnTimeRemainingScaled
{ "repo_name": "maruohon/enderutilities", "path": "src/main/java/fi/dy/masa/enderutilities/tileentity/TileEntityCreationStation.java", "license": "gpl-3.0", "size": 44775 }
[ "fi.dy.masa.enderutilities.inventory.wrapper.ItemHandlerWrapperSelectiveModifiable", "net.minecraftforge.items.IItemHandlerModifiable" ]
import fi.dy.masa.enderutilities.inventory.wrapper.ItemHandlerWrapperSelectiveModifiable; import net.minecraftforge.items.IItemHandlerModifiable;
import fi.dy.masa.enderutilities.inventory.wrapper.*; import net.minecraftforge.items.*;
[ "fi.dy.masa", "net.minecraftforge.items" ]
fi.dy.masa; net.minecraftforge.items;
1,292,711
public void testFillPaintLookup() { BarRenderer r = new BarRenderer(); assertEquals(Color.white, r.getBaseFillPaint()); // first check that autoPopulate==false works as expected r.setAutoPopulateSeriesFillPaint(false); assertEquals(Color.white, r.lookupSeriesFillPaint(0)); assertNull(r.getSeriesFillPaint(0)); // now check autoPopulate==true r.setAutoPopulateSeriesFillPaint(true); new CategoryPlot(null, new CategoryAxis( "Category"), new NumberAxis("Value"), r); assertEquals(DefaultDrawingSupplier.DEFAULT_FILL_PAINT_SEQUENCE[0], r.lookupSeriesFillPaint(0)); assertNotNull(r.getSeriesFillPaint(0)); }
void function() { BarRenderer r = new BarRenderer(); assertEquals(Color.white, r.getBaseFillPaint()); r.setAutoPopulateSeriesFillPaint(false); assertEquals(Color.white, r.lookupSeriesFillPaint(0)); assertNull(r.getSeriesFillPaint(0)); r.setAutoPopulateSeriesFillPaint(true); new CategoryPlot(null, new CategoryAxis( STR), new NumberAxis("Value"), r); assertEquals(DefaultDrawingSupplier.DEFAULT_FILL_PAINT_SEQUENCE[0], r.lookupSeriesFillPaint(0)); assertNotNull(r.getSeriesFillPaint(0)); }
/** * Some checks for the fill paint lookup mechanism. */
Some checks for the fill paint lookup mechanism
testFillPaintLookup
{ "repo_name": "ilyessou/jfreechart", "path": "tests/org/jfree/chart/renderer/junit/AbstractRendererTests.java", "license": "lgpl-2.1", "size": 31052 }
[ "java.awt.Color", "org.jfree.chart.axis.CategoryAxis", "org.jfree.chart.axis.NumberAxis", "org.jfree.chart.plot.CategoryPlot", "org.jfree.chart.plot.DefaultDrawingSupplier", "org.jfree.chart.renderer.category.BarRenderer" ]
import java.awt.Color; import org.jfree.chart.axis.CategoryAxis; import org.jfree.chart.axis.NumberAxis; import org.jfree.chart.plot.CategoryPlot; import org.jfree.chart.plot.DefaultDrawingSupplier; import org.jfree.chart.renderer.category.BarRenderer;
import java.awt.*; import org.jfree.chart.axis.*; import org.jfree.chart.plot.*; import org.jfree.chart.renderer.category.*;
[ "java.awt", "org.jfree.chart" ]
java.awt; org.jfree.chart;
2,739,647