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
sequence
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
sequence
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public static final PrintService[] lookupPrintServices(DocFlavor flavor, AttributeSet attributes) { ArrayList list = getServices(flavor, attributes); return (PrintService[])(list.toArray(new PrintService[list.size()])); }
static final PrintService[] function(DocFlavor flavor, AttributeSet attributes) { ArrayList list = getServices(flavor, attributes); return (PrintService[])(list.toArray(new PrintService[list.size()])); }
/** * Locates print services capable of printing the specified * {@link DocFlavor}. * * @param flavor the flavor to print. If null, this constraint is not * used. * @param attributes attributes that the print service must support. * If null this constraint is not used. * * @return array of matching <code>PrintService</code> objects * representing print services that support the specified flavor * attributes. If no services match, the array is zero-length. */
Locates print services capable of printing the specified <code>DocFlavor</code>
lookupPrintServices
{ "repo_name": "shun634501730/java_source_cn", "path": "src_en/javax/print/PrintServiceLookup.java", "license": "apache-2.0", "size": 18728 }
[ "java.util.ArrayList", "javax.print.attribute.AttributeSet" ]
import java.util.ArrayList; import javax.print.attribute.AttributeSet;
import java.util.*; import javax.print.attribute.*;
[ "java.util", "javax.print" ]
java.util; javax.print;
2,911,403
public void selectObjects(List<? extends SPObject> selections) throws SQLObjectException { if (ignoreTreeSelection) return; ignoreTreeSelection = true; logger.debug("selecting: " + selections); //$NON-NLS-1$ DBTree tree = session.getDBTree(); // tables to add to select because of column selection List<SPObject> colTables = new ArrayList<SPObject>(); // objects that were already selected, only used for debugging List<SPObject> ignoredObjs = new ArrayList<SPObject>(); for (SPObject obj : selections) { if (obj instanceof SQLColumn){ //Since we cannot directly select a SQLColumn directly //from the playpen, there is a special case for it SQLColumn col = (SQLColumn) obj; SQLTable table = col.getParent(); TablePane tablePane = findTablePane(table); if (tablePane != null) { colTables.add(table); // select the parent table if (!tablePane.isSelected()) { tablePane.setSelected(true,SelectionEvent.SINGLE_SELECT); } // ensures the table is selected on the dbTree TreePath tp = tree.getTreePathForNode(table); if (!tree.isPathSelected(tp)) { tree.addSelectionPath(tp); tree.clearNonPlayPenSelections(); // ensures column tree path is selected after the table TreePath colPath = tree.getTreePathForNode(col); tree.removeSelectionPath(colPath); tree.addSelectionPath(colPath); } // finally select the actual column int index = table.getColumnIndex(col); if (!tablePane.isItemSelected(index)) { tablePane.selectItem(index); } else { ignoredObjs.add(col); } } else { ignoredObjs.add(col); ignoredObjs.add(table); } } else if (obj instanceof SQLTable) { TablePane tp = findTablePane((SQLTable) obj); if (tp != null && !tp.isSelected()) { tp.setSelected(true,SelectionEvent.SINGLE_SELECT); } else { ignoredObjs.add(obj); } } else if (obj instanceof SQLRelationship) { Relationship r = findRelationship((SQLRelationship) obj); if (r != null && !r.isSelected()) { r.setSelected(true,SelectionEvent.SINGLE_SELECT); } else { ignoredObjs.add(obj); } tree.clearNonPlayPenSelections(); } } logger.debug("selectObjects ignoring: " + ignoredObjs); //$NON-NLS-1$ logger.debug("selectObjects adding tables selections: " + colTables); //$NON-NLS-1$ // deselects all other playpen components for (PlayPenComponent comp : getSelectedItems()) { if (comp instanceof TablePane) { TablePane tablePane = (TablePane) comp; if (!selections.contains(tablePane.getModel()) && !colTables.contains(tablePane.getModel())) { tablePane.setSelected(false, SelectionEvent.SINGLE_SELECT); } // cannot deselect columns while going through the selected columns List<Integer> indices = new ArrayList<Integer>(); for (SQLColumn col : tablePane.getSelectedItems()) { if (!selections.contains(col) && col.getParent() != null) { indices.add(col.getParent().getColumnIndex(col)); } } for (int index : indices) { tablePane.deselectItem(index); } } else if (comp instanceof Relationship) { Relationship relationship = (Relationship) comp; if (!selections.contains(relationship.getModel())) { relationship.setSelected(false, SelectionEvent.SINGLE_SELECT); } } } ignoreTreeSelection = false; }
void function(List<? extends SPObject> selections) throws SQLObjectException { if (ignoreTreeSelection) return; ignoreTreeSelection = true; logger.debug(STR + selections); DBTree tree = session.getDBTree(); List<SPObject> colTables = new ArrayList<SPObject>(); List<SPObject> ignoredObjs = new ArrayList<SPObject>(); for (SPObject obj : selections) { if (obj instanceof SQLColumn){ SQLColumn col = (SQLColumn) obj; SQLTable table = col.getParent(); TablePane tablePane = findTablePane(table); if (tablePane != null) { colTables.add(table); if (!tablePane.isSelected()) { tablePane.setSelected(true,SelectionEvent.SINGLE_SELECT); } TreePath tp = tree.getTreePathForNode(table); if (!tree.isPathSelected(tp)) { tree.addSelectionPath(tp); tree.clearNonPlayPenSelections(); TreePath colPath = tree.getTreePathForNode(col); tree.removeSelectionPath(colPath); tree.addSelectionPath(colPath); } int index = table.getColumnIndex(col); if (!tablePane.isItemSelected(index)) { tablePane.selectItem(index); } else { ignoredObjs.add(col); } } else { ignoredObjs.add(col); ignoredObjs.add(table); } } else if (obj instanceof SQLTable) { TablePane tp = findTablePane((SQLTable) obj); if (tp != null && !tp.isSelected()) { tp.setSelected(true,SelectionEvent.SINGLE_SELECT); } else { ignoredObjs.add(obj); } } else if (obj instanceof SQLRelationship) { Relationship r = findRelationship((SQLRelationship) obj); if (r != null && !r.isSelected()) { r.setSelected(true,SelectionEvent.SINGLE_SELECT); } else { ignoredObjs.add(obj); } tree.clearNonPlayPenSelections(); } } logger.debug(STR + ignoredObjs); logger.debug(STR + colTables); for (PlayPenComponent comp : getSelectedItems()) { if (comp instanceof TablePane) { TablePane tablePane = (TablePane) comp; if (!selections.contains(tablePane.getModel()) && !colTables.contains(tablePane.getModel())) { tablePane.setSelected(false, SelectionEvent.SINGLE_SELECT); } List<Integer> indices = new ArrayList<Integer>(); for (SQLColumn col : tablePane.getSelectedItems()) { if (!selections.contains(col) && col.getParent() != null) { indices.add(col.getParent().getColumnIndex(col)); } } for (int index : indices) { tablePane.deselectItem(index); } } else if (comp instanceof Relationship) { Relationship relationship = (Relationship) comp; if (!selections.contains(relationship.getModel())) { relationship.setSelected(false, SelectionEvent.SINGLE_SELECT); } } } ignoreTreeSelection = false; }
/** * Selects the playpen component that represents the given SQLObject. * If the given SQL Object isn't in the playpen, this method has no effect. * * @param selection A list of SQLObjects, should only have SQLColumn, SQLTable or SQLRelationship. * @throws SQLObjectException */
Selects the playpen component that represents the given SQLObject. If the given SQL Object isn't in the playpen, this method has no effect
selectObjects
{ "repo_name": "ptrptr/power-architect", "path": "src/main/java/ca/sqlpower/architect/swingui/PlayPen.java", "license": "gpl-3.0", "size": 137696 }
[ "ca.sqlpower.architect.swingui.event.SelectionEvent", "ca.sqlpower.object.SPObject", "ca.sqlpower.sqlobject.SQLColumn", "ca.sqlpower.sqlobject.SQLObjectException", "ca.sqlpower.sqlobject.SQLRelationship", "ca.sqlpower.sqlobject.SQLTable", "java.util.ArrayList", "java.util.List", "javax.swing.tree.TreePath" ]
import ca.sqlpower.architect.swingui.event.SelectionEvent; import ca.sqlpower.object.SPObject; import ca.sqlpower.sqlobject.SQLColumn; import ca.sqlpower.sqlobject.SQLObjectException; import ca.sqlpower.sqlobject.SQLRelationship; import ca.sqlpower.sqlobject.SQLTable; import java.util.ArrayList; import java.util.List; import javax.swing.tree.TreePath;
import ca.sqlpower.architect.swingui.event.*; import ca.sqlpower.object.*; import ca.sqlpower.sqlobject.*; import java.util.*; import javax.swing.tree.*;
[ "ca.sqlpower.architect", "ca.sqlpower.object", "ca.sqlpower.sqlobject", "java.util", "javax.swing" ]
ca.sqlpower.architect; ca.sqlpower.object; ca.sqlpower.sqlobject; java.util; javax.swing;
1,456,470
public void defineOptions() { super.defineOptions(); m_OptionManager.add( "color", "colors", new Color[]{ Color.BLUE, Color.CYAN, Color.GREEN, Color.MAGENTA, Color.ORANGE, Color.PINK, Color.RED }); m_OptionManager.add( "darkening", "allowDarkening", false); }
void function() { super.defineOptions(); m_OptionManager.add( "color", STR, new Color[]{ Color.BLUE, Color.CYAN, Color.GREEN, Color.MAGENTA, Color.ORANGE, Color.PINK, Color.RED }); m_OptionManager.add( STR, STR, false); }
/** * Adds options to the internal list of options. */
Adds options to the internal list of options
defineOptions
{ "repo_name": "automenta/adams-core", "path": "src/main/java/adams/gui/visualization/core/CustomColorProvider.java", "license": "gpl-3.0", "size": 3844 }
[ "java.awt.Color" ]
import java.awt.Color;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,743,040
@Test @InSequence(1) public void callGetList() throws Exception { Client client = ClientBuilder.newClient().register(ResteasyJackson2Provider.class); @SuppressWarnings("unchecked") List<JsonArtisttype> response = client.target(TestConstants.SERVER_ROOT + APP_NAME + svc_root) .request(MediaType.APPLICATION_JSON) .header(Constants.HTTP_HEADER_TOKEN, TestConstants.USER_TOKEN) .get(List.class); assertFalse("No artisttype found", response.isEmpty()); }
@InSequence(1) void function() throws Exception { Client client = ClientBuilder.newClient().register(ResteasyJackson2Provider.class); @SuppressWarnings(STR) List<JsonArtisttype> response = client.target(TestConstants.SERVER_ROOT + APP_NAME + svc_root) .request(MediaType.APPLICATION_JSON) .header(Constants.HTTP_HEADER_TOKEN, TestConstants.USER_TOKEN) .get(List.class); assertFalse(STR, response.isEmpty()); }
/** * Test for /services/artisttypes GET Test OK * * @throws Exception */
Test for /services/artisttypes GET Test OK
callGetList
{ "repo_name": "msansm1/medek-server", "path": "src/test/java/bzh/medek/server/rest/ArtistTypeServiceTest.java", "license": "mit", "size": 5937 }
[ "java.util.List", "javax.ws.rs.client.Client", "javax.ws.rs.client.ClientBuilder", "javax.ws.rs.core.MediaType", "org.jboss.arquillian.junit.InSequence", "org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider", "org.junit.Assert" ]
import java.util.List; import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; import javax.ws.rs.core.MediaType; import org.jboss.arquillian.junit.InSequence; import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider; import org.junit.Assert;
import java.util.*; import javax.ws.rs.client.*; import javax.ws.rs.core.*; import org.jboss.arquillian.junit.*; import org.jboss.resteasy.plugins.providers.jackson.*; import org.junit.*;
[ "java.util", "javax.ws", "org.jboss.arquillian", "org.jboss.resteasy", "org.junit" ]
java.util; javax.ws; org.jboss.arquillian; org.jboss.resteasy; org.junit;
85,048
public static final StepMeta findStep( List<StepMeta> steps, String stepname ) { if ( steps == null ) { return null; } for ( StepMeta stepMeta : steps ) { if ( stepMeta.getName().equalsIgnoreCase( stepname ) ) { return stepMeta; } } return null; }
static final StepMeta function( List<StepMeta> steps, String stepname ) { if ( steps == null ) { return null; } for ( StepMeta stepMeta : steps ) { if ( stepMeta.getName().equalsIgnoreCase( stepname ) ) { return stepMeta; } } return null; }
/** * Find a step with its name in a given ArrayList of steps * * @param steps * The List of steps to search * @param stepname * The name of the step * @return The step if it was found, null if nothing was found */
Find a step with its name in a given ArrayList of steps
findStep
{ "repo_name": "pavel-sakun/pentaho-kettle", "path": "engine/src/main/java/org/pentaho/di/trans/step/StepMeta.java", "license": "apache-2.0", "size": 35822 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,098,073
public HRegion createLocalHRegion(TableDescriptor desc, byte [] startKey, byte [] endKey) throws IOException { HRegionInfo hri = new HRegionInfo(desc.getTableName(), startKey, endKey); return createLocalHRegion(hri, desc); }
HRegion function(TableDescriptor desc, byte [] startKey, byte [] endKey) throws IOException { HRegionInfo hri = new HRegionInfo(desc.getTableName(), startKey, endKey); return createLocalHRegion(hri, desc); }
/** * Create an HRegion that writes to the local tmp dirs * @param desc a table descriptor indicating which table the region belongs to * @param startKey the start boundary of the region * @param endKey the end boundary of the region * @return a region that writes to local dir for testing * @throws IOException */
Create an HRegion that writes to the local tmp dirs
createLocalHRegion
{ "repo_name": "HubSpot/hbase", "path": "hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java", "license": "apache-2.0", "size": 173926 }
[ "java.io.IOException", "org.apache.hadoop.hbase.client.TableDescriptor", "org.apache.hadoop.hbase.regionserver.HRegion" ]
import java.io.IOException; import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.regionserver.HRegion;
import java.io.*; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.regionserver.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
2,069,423
private void deployUnDeployDataSources(boolean deploy, List<Artifact> artifacts) throws DeploymentException { for (Artifact artifact : artifacts) { if (DATA_SOURCE_TYPE.equals(artifact.getType())) { List<CappFile> files = artifact.getFiles(); if (files == null || files.isEmpty()) { throw new DeploymentException("DataSourceCappDeployer::deployUnDeployDataSources --> " + "Error No data sources found in the artifact to deploy"); } for (CappFile cappFile : files) { String fileName = cappFile.getName(); String dataSourceConfigPath = artifact.getExtractedPath() + File.separator + fileName; File file = new File(dataSourceConfigPath); if (!file.exists()) { throw new DeploymentException("DataSourceCappDeployer::deployUnDeployDataSources --> " + "Error Data source file cannot be found in artifact, " + "file name - " + fileName); } DataSourceMetaInfo dataSourceMetaInfo = readDataSourceFile(file); if (deploy) { try { if (DataSourceManager.getInstance().getDataSourceRepository().getDataSource( dataSourceMetaInfo.getName()) != null) { artifact.setDeploymentStatus(AppDeployerConstants.DEPLOYMENT_STATUS_FAILED); throw new DeploymentException("DataSourceCappDeployer::deployUnDeployDataSources --> " + "Error in deploying data source: data source " + "with same name already exist, " + "data source name - " + dataSourceMetaInfo.getName()); } dataSourceMetaInfo.setCarbonApplicationDeployed(true); DataSourceManager.getInstance().getDataSourceRepository().addDataSource(dataSourceMetaInfo); artifact.setDeploymentStatus(AppDeployerConstants.DEPLOYMENT_STATUS_DEPLOYED); } catch (DataSourceException e) { throw new DeploymentException("DataSourceCappDeployer::deployUnDeployDataSources --> " + "Error in deploying data source: " + e.getMessage(), e); } } else { try { if (DataSourceManager.getInstance().getDataSourceRepository().getDataSource( dataSourceMetaInfo.getName()) != null && artifact.getDeploymentStatus().equals( AppDeployerConstants.DEPLOYMENT_STATUS_DEPLOYED)) { DataSourceManager.getInstance().getDataSourceRepository().deleteDataSource( dataSourceMetaInfo.getName()); } } catch (DataSourceException e) { throw new DeploymentException("DataSourceCappDeployer::deployUnDeployDataSources --> " + "Error in undeploying data source: " + e.getMessage(), e); } } } } } }
void function(boolean deploy, List<Artifact> artifacts) throws DeploymentException { for (Artifact artifact : artifacts) { if (DATA_SOURCE_TYPE.equals(artifact.getType())) { List<CappFile> files = artifact.getFiles(); if (files == null files.isEmpty()) { throw new DeploymentException(STR + STR); } for (CappFile cappFile : files) { String fileName = cappFile.getName(); String dataSourceConfigPath = artifact.getExtractedPath() + File.separator + fileName; File file = new File(dataSourceConfigPath); if (!file.exists()) { throw new DeploymentException(STR + STR + STR + fileName); } DataSourceMetaInfo dataSourceMetaInfo = readDataSourceFile(file); if (deploy) { try { if (DataSourceManager.getInstance().getDataSourceRepository().getDataSource( dataSourceMetaInfo.getName()) != null) { artifact.setDeploymentStatus(AppDeployerConstants.DEPLOYMENT_STATUS_FAILED); throw new DeploymentException(STR + STR + STR + STR + dataSourceMetaInfo.getName()); } dataSourceMetaInfo.setCarbonApplicationDeployed(true); DataSourceManager.getInstance().getDataSourceRepository().addDataSource(dataSourceMetaInfo); artifact.setDeploymentStatus(AppDeployerConstants.DEPLOYMENT_STATUS_DEPLOYED); } catch (DataSourceException e) { throw new DeploymentException(STR + STR + e.getMessage(), e); } } else { try { if (DataSourceManager.getInstance().getDataSourceRepository().getDataSource( dataSourceMetaInfo.getName()) != null && artifact.getDeploymentStatus().equals( AppDeployerConstants.DEPLOYMENT_STATUS_DEPLOYED)) { DataSourceManager.getInstance().getDataSourceRepository().deleteDataSource( dataSourceMetaInfo.getName()); } } catch (DataSourceException e) { throw new DeploymentException(STR + STR + e.getMessage(), e); } } } } } }
/** * Deploy or un-deploy data sources. if deploying, adding the data source to the data sources and if undeploying, * removing the data source from data sources. there can be multiple data sources as separate xml files. * * @param deploy - identify whether deployment process or un-deployment process. * @param artifacts - list of artifacts to be deployed. */
Deploy or un-deploy data sources. if deploying, adding the data source to the data sources and if undeploying, removing the data source from data sources. there can be multiple data sources as separate xml files
deployUnDeployDataSources
{ "repo_name": "madhawa-gunasekara/carbon-commons", "path": "components/ndatasource/org.wso2.carbon.ndatasource.capp.deployer/src/main/java/org/wso2/carbon/ndatasource/capp/deployer/DataSourceCappDeployer.java", "license": "apache-2.0", "size": 10658 }
[ "java.io.File", "java.util.List", "org.apache.axis2.deployment.DeploymentException", "org.wso2.carbon.application.deployer.AppDeployerConstants", "org.wso2.carbon.application.deployer.config.Artifact", "org.wso2.carbon.application.deployer.config.CappFile", "org.wso2.carbon.ndatasource.common.DataSourceException", "org.wso2.carbon.ndatasource.core.DataSourceManager", "org.wso2.carbon.ndatasource.core.DataSourceMetaInfo" ]
import java.io.File; import java.util.List; import org.apache.axis2.deployment.DeploymentException; import org.wso2.carbon.application.deployer.AppDeployerConstants; import org.wso2.carbon.application.deployer.config.Artifact; import org.wso2.carbon.application.deployer.config.CappFile; import org.wso2.carbon.ndatasource.common.DataSourceException; import org.wso2.carbon.ndatasource.core.DataSourceManager; import org.wso2.carbon.ndatasource.core.DataSourceMetaInfo;
import java.io.*; import java.util.*; import org.apache.axis2.deployment.*; import org.wso2.carbon.application.deployer.*; import org.wso2.carbon.application.deployer.config.*; import org.wso2.carbon.ndatasource.common.*; import org.wso2.carbon.ndatasource.core.*;
[ "java.io", "java.util", "org.apache.axis2", "org.wso2.carbon" ]
java.io; java.util; org.apache.axis2; org.wso2.carbon;
2,882,634
public void addCompoundUniqueConstraint(List<MColumn> columns, boolean oneToOne, String constraintName) { String[] cols = new String[columns.size()]; for (int i = 0; i < columns.size(); i++) { cols[i] = columns.get(i).getName(); } addCompoundUniqueConstraint(cols, oneToOne, constraintName); }
void function(List<MColumn> columns, boolean oneToOne, String constraintName) { String[] cols = new String[columns.size()]; for (int i = 0; i < columns.size(); i++) { cols[i] = columns.get(i).getName(); } addCompoundUniqueConstraint(cols, oneToOne, constraintName); }
/** * Add a compound unique constraint. */
Add a compound unique constraint
addCompoundUniqueConstraint
{ "repo_name": "gzwfdy/meetime", "path": "src/main/java/com/avaje/ebean/dbmigration/model/MTable.java", "license": "apache-2.0", "size": 13118 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,028,886
public void actionPerformed(ActionEvent e) { if (EDIT.equals(e.getActionCommand())) { //The user has clicked the cell, so //bring up the dialog. colorButton.setForeground(currentColor); colorChooser.setColor(currentColor); ETRC.setFont(dialog); dialog.setVisible(true); //Make the renderer reappear. fireEditingStopped(); } else { //User pressed dialog's "OK" button. currentColor = colorChooser.getColor(); } }
void function(ActionEvent e) { if (EDIT.equals(e.getActionCommand())) { colorButton.setForeground(currentColor); colorChooser.setColor(currentColor); ETRC.setFont(dialog); dialog.setVisible(true); fireEditingStopped(); } else { currentColor = colorChooser.getColor(); } }
/** * Handles events from the editor button and from * the dialog's OK button. */
Handles events from the editor button and from the dialog's OK button
actionPerformed
{ "repo_name": "zearon/train-graph", "path": "ETRC/src/org/paradise/etrc/view/alltrains/TrainListView.java", "license": "gpl-2.0", "size": 16238 }
[ "java.awt.event.ActionEvent", "org.paradise.etrc.ETRC" ]
import java.awt.event.ActionEvent; import org.paradise.etrc.ETRC;
import java.awt.event.*; import org.paradise.etrc.*;
[ "java.awt", "org.paradise.etrc" ]
java.awt; org.paradise.etrc;
2,325,077
public IDataset getBeamline_distance();
IDataset function();
/** * define position of beamline element relative to production target * <p> * <b>Type:</b> NX_FLOAT * <b>Units:</b> NX_LENGTH * </p> * * @return the value. */
define position of beamline element relative to production target Type: NX_FLOAT Units: NX_LENGTH
getBeamline_distance
{ "repo_name": "jamesmudd/dawnsci", "path": "org.eclipse.dawnsci.nexus/autogen/org/eclipse/dawnsci/nexus/NXelectrostatic_kicker.java", "license": "epl-1.0", "size": 6005 }
[ "org.eclipse.january.dataset.IDataset" ]
import org.eclipse.january.dataset.IDataset;
import org.eclipse.january.dataset.*;
[ "org.eclipse.january" ]
org.eclipse.january;
2,388,149
protected synchronized PersistenceManagerFactory getPMF() { Properties props = new Properties(); try { props.load(ClassLoaderTest.class.getResourceAsStream("/org/jpox/persistence/ClassLoaderTest.properties")); } catch (IOException e) { throw new RuntimeException(e); } return getPMF(props); }
synchronized PersistenceManagerFactory function() { Properties props = new Properties(); try { props.load(ClassLoaderTest.class.getResourceAsStream(STR)); } catch (IOException e) { throw new RuntimeException(e); } return getPMF(props); }
/** * Method to obtain the PMF to use. * Creates a new PMF on each call. * @return The PMF (also stored in the local "pmf" variable) */
Method to obtain the PMF to use. Creates a new PMF on each call
getPMF
{ "repo_name": "hopecee/texsts", "path": "jdo/general/src/test/org/datanucleus/tests/ClassLoaderTest.java", "license": "apache-2.0", "size": 41009 }
[ "java.io.IOException", "java.util.Properties", "javax.jdo.PersistenceManagerFactory" ]
import java.io.IOException; import java.util.Properties; import javax.jdo.PersistenceManagerFactory;
import java.io.*; import java.util.*; import javax.jdo.*;
[ "java.io", "java.util", "javax.jdo" ]
java.io; java.util; javax.jdo;
1,068,169
public Element selectElement(String expr, Element context) { return (Element) select(expr, context, XPathConstants.NODE); }
Element function(String expr, Element context) { return (Element) select(expr, context, XPathConstants.NODE); }
/** * Evaluates an XPath expression on context element. This assumes that the * XPath expression is valid and raises an {@link AssertionError} otherwise. */
Evaluates an XPath expression on context element. This assumes that the XPath expression is valid and raises an <code>AssertionError</code> otherwise
selectElement
{ "repo_name": "vimaier/conqat", "path": "org.conqat.engine.core/external/commons-src/org/conqat/lib/commons/xml/XPathEvaluator.java", "license": "apache-2.0", "size": 6635 }
[ "javax.xml.xpath.XPathConstants", "org.w3c.dom.Element" ]
import javax.xml.xpath.XPathConstants; import org.w3c.dom.Element;
import javax.xml.xpath.*; import org.w3c.dom.*;
[ "javax.xml", "org.w3c.dom" ]
javax.xml; org.w3c.dom;
812,121
public Vector<Individual> breedAndMutate() throws CloneNotSupportedException { int fillSize = context.getConfig().getPopSize() - 1; // Temporary place-holder for the newly-bred individuals. Vector<Individual> tmpNewPopulation = new Vector<Individual>(); // Fill the population, leaving one extra spot. while (tmpNewPopulation.size() < fillSize) { // Determine whether to do random mating & crossover or replication if (context.nextBool(context.getConfig().getCrossProbability())) { doRandomMating(tmpNewPopulation, fillSize); } else { doReplication(tmpNewPopulation, fillSize); } } // Probabilistically mutate the individuals doMutation(tmpNewPopulation, context); return tmpNewPopulation; }
Vector<Individual> function() throws CloneNotSupportedException { int fillSize = context.getConfig().getPopSize() - 1; Vector<Individual> tmpNewPopulation = new Vector<Individual>(); while (tmpNewPopulation.size() < fillSize) { if (context.nextBool(context.getConfig().getCrossProbability())) { doRandomMating(tmpNewPopulation, fillSize); } else { doReplication(tmpNewPopulation, fillSize); } } doMutation(tmpNewPopulation, context); return tmpNewPopulation; }
/** * Convenience method to breed and mutate the current population to create * the temporary new population. * * @return a newly bred (and possibly mutated) population * @throws CloneNotSupportedException */
Convenience method to breed and mutate the current population to create the temporary new population
breedAndMutate
{ "repo_name": "burks-pub/gecco2015", "path": "src/main/java/ec/research/gp/pareto/ParetoGP.java", "license": "bsd-2-clause", "size": 12880 }
[ "ec.research.gp.simple.representation.Individual", "java.util.Vector" ]
import ec.research.gp.simple.representation.Individual; import java.util.Vector;
import ec.research.gp.simple.representation.*; import java.util.*;
[ "ec.research.gp", "java.util" ]
ec.research.gp; java.util;
2,530,315
public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { this.extraParams = new HashMap<>(); } this.extraParams.put(key, value); return this; }
Builder function(String key, Object value) { if (this.extraParams == null) { this.extraParams = new HashMap<>(); } this.extraParams.put(key, value); return this; }
/** * Add a key/value pair to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original * map. See {@link * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Bancontact#extraParams} for * the field documentation. */
Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. See <code>InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Bancontact#extraParams</code> for the field documentation
putExtraParam
{ "repo_name": "stripe/stripe-java", "path": "src/main/java/com/stripe/param/InvoiceUpdateParams.java", "license": "mit", "size": 72503 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
2,063,678
public static Map<GenomicRegion, Query> createRegionListQueries( Collection<GenomicRegion> genomicRegions, int extension, Map<String, ChromosomeInfo> chromInfo, String organismName, Set<Class<?>> featureTypes) { return createRegionQueries(genomicRegions, extension, organismName, featureTypes, true); }
static Map<GenomicRegion, Query> function( Collection<GenomicRegion> genomicRegions, int extension, Map<String, ChromosomeInfo> chromInfo, String organismName, Set<Class<?>> featureTypes) { return createRegionQueries(genomicRegions, extension, organismName, featureTypes, true); }
/** * Create a list of queries from user regions. * * @param genomicRegions list of gr * @param extension the flanking * @param chromInfo chr info map * @param organismName org short name * @param featureTypes ft * @return map of gr-query */
Create a list of queries from user regions
createRegionListQueries
{ "repo_name": "julie-sullivan/phytomine", "path": "bio/webapp/src/org/intermine/bio/web/logic/GenomicRegionSearchUtil.java", "license": "lgpl-2.1", "size": 23223 }
[ "java.util.Collection", "java.util.Map", "java.util.Set", "org.intermine.bio.web.model.ChromosomeInfo", "org.intermine.bio.web.model.GenomicRegion", "org.intermine.objectstore.query.Query" ]
import java.util.Collection; import java.util.Map; import java.util.Set; import org.intermine.bio.web.model.ChromosomeInfo; import org.intermine.bio.web.model.GenomicRegion; import org.intermine.objectstore.query.Query;
import java.util.*; import org.intermine.bio.web.model.*; import org.intermine.objectstore.query.*;
[ "java.util", "org.intermine.bio", "org.intermine.objectstore" ]
java.util; org.intermine.bio; org.intermine.objectstore;
1,431,936
private Amostra executarTarefa(final Future<Amostra> tarefa) throws HappyEyeBallsException { try { if (tarefa == null) { throw new IllegalArgumentException(Mensagens.HAPPYEYEBALLS_10); } else { return tarefa.get(); } } catch (InterruptedException exce) { throw new HappyEyeBallsException(Mensagens.HAPPYEYEBALLS_11, exce); } catch (ExecutionException exce) { throw new HappyEyeBallsException(Mensagens.HAPPYEYEBALLS_12, exce); } }
Amostra function(final Future<Amostra> tarefa) throws HappyEyeBallsException { try { if (tarefa == null) { throw new IllegalArgumentException(Mensagens.HAPPYEYEBALLS_10); } else { return tarefa.get(); } } catch (InterruptedException exce) { throw new HappyEyeBallsException(Mensagens.HAPPYEYEBALLS_11, exce); } catch (ExecutionException exce) { throw new HappyEyeBallsException(Mensagens.HAPPYEYEBALLS_12, exce); } }
/** * Executa a tarefa e retorna a Amosta. * * @param tarefa tarefa para buscar o tempo de execução * @return amostra do tempo de conexão * @throws HappyEyeBallsException caso ocorra algum problema. */
Executa a tarefa e retorna a Amosta
executarTarefa
{ "repo_name": "guinamen/Java-Happy-Eyeballs", "path": "src/br/gov/pbh/prodabel/happyeyeballs/HappyEyeballsImpl.java", "license": "lgpl-3.0", "size": 7941 }
[ "java.util.concurrent.ExecutionException", "java.util.concurrent.Future" ]
import java.util.concurrent.ExecutionException; import java.util.concurrent.Future;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,128,379
Set<String> getAllUser(final HttpServletRequest httpServletRequest);
Set<String> getAllUser(final HttpServletRequest httpServletRequest);
/** * Gets all the users available in the configured authentication type. * * <p> * It also saves the fetched result in the session for further use. * * @param httpServletRequest {@link HttpServletRequest} request attribute used to save the fetched result in session. * @return <code>NULL</code> in case of errors otherwise set of users. */
Gets all the users available in the configured authentication type. It also saves the fetched result in the session for further use
getAllUser
{ "repo_name": "ungerik/ephesoft", "path": "Ephesoft_Community_Release_4.0.2.0/source/gxt/gxt-core/src/main/java/com/ephesoft/gxt/core/server/security/service/AuthorizationService.java", "license": "agpl-3.0", "size": 5722 }
[ "java.util.Set", "javax.servlet.http.HttpServletRequest" ]
import java.util.Set; import javax.servlet.http.HttpServletRequest;
import java.util.*; import javax.servlet.http.*;
[ "java.util", "javax.servlet" ]
java.util; javax.servlet;
2,521,300
List<ResolutionLevel> getResolutionDescriptions() throws RenderingServiceException, DSOutOfServiceException { if (rndControl == null) return null; return rndControl.getResolutionDescriptions(); }
List<ResolutionLevel> getResolutionDescriptions() throws RenderingServiceException, DSOutOfServiceException { if (rndControl == null) return null; return rndControl.getResolutionDescriptions(); }
/** * Returns the list of the levels. * * @return See above. * @throws RenderingServiceException If an error occurred. * @throws DSOutOfServiceException If the connection is broken. */
Returns the list of the levels
getResolutionDescriptions
{ "repo_name": "knabar/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/rnd/RendererModel.java", "license": "gpl-2.0", "size": 50413 }
[ "java.util.List", "org.openmicroscopy.shoola.env.rnd.data.ResolutionLevel" ]
import java.util.List; import org.openmicroscopy.shoola.env.rnd.data.ResolutionLevel;
import java.util.*; import org.openmicroscopy.shoola.env.rnd.data.*;
[ "java.util", "org.openmicroscopy.shoola" ]
java.util; org.openmicroscopy.shoola;
1,986,446
FormTemplate formTemplate = new FormTemplate(); Object jsonObject = JsonPath.read(json, "$"); String html = JsonPath.read(jsonObject, "$['html']"); formTemplate.setHtml(html); String metaJson = JsonPath.read(jsonObject, "$['metaJson']"); formTemplate.setMetaJson(metaJson); String modelXml = JsonPath.read(jsonObject, "$['modelXml']"); formTemplate.setModelXml(modelXml); String modelJson = JsonPath.read(jsonObject, "$['modelJson']"); formTemplate.setModelJson(modelJson); String uuid = JsonPath.read(jsonObject, "$['uuid']"); formTemplate.setUuid(uuid); return formTemplate; }
FormTemplate formTemplate = new FormTemplate(); Object jsonObject = JsonPath.read(json, "$"); String html = JsonPath.read(jsonObject, STR); formTemplate.setHtml(html); String metaJson = JsonPath.read(jsonObject, STR); formTemplate.setMetaJson(metaJson); String modelXml = JsonPath.read(jsonObject, STR); formTemplate.setModelXml(modelXml); String modelJson = JsonPath.read(jsonObject, STR); formTemplate.setModelJson(modelJson); String uuid = JsonPath.read(jsonObject, STR); formTemplate.setUuid(uuid); return formTemplate; }
/** * Implementation of this method will define how the object will be serialized from the String representation. * * @param json the string representation * @return the concrete object */
Implementation of this method will define how the object will be serialized from the String representation
deserialize
{ "repo_name": "sthaiya/muzima-api", "path": "src/main/java/com/muzima/api/model/algorithm/FormTemplateAlgorithm.java", "license": "mpl-2.0", "size": 2488 }
[ "com.jayway.jsonpath.JsonPath", "com.muzima.api.model.FormTemplate" ]
import com.jayway.jsonpath.JsonPath; import com.muzima.api.model.FormTemplate;
import com.jayway.jsonpath.*; import com.muzima.api.model.*;
[ "com.jayway.jsonpath", "com.muzima.api" ]
com.jayway.jsonpath; com.muzima.api;
1,590,681
private boolean navigate(WebElement dateBox, Calendar date) throws ParseException { click(dateBox); Calendar selectedDate = Calendar.getInstance(); String month = date.getDisplayName(Calendar.MONTH, Calendar.LONG, Locale.ENGLISH); String year = Integer.toString(date.get(Calendar.YEAR)); SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy"); selectedDate.setTime(dateFormat.parse(dateBox.getAttribute("value"))); if (selectedDate.after(date)) { while (!getDatepickerMonth().equals(month) || !getDatepickerYear().equals(year)) { WebElement previousButton = browser.driver.findElement(By.className("ui-datepicker-prev")); if (previousButton.getAttribute("class").contains("ui-state-disabled")) { return false; } click(previousButton); } } else { while (!getDatepickerMonth().equals(month) || !getDatepickerYear().equals(year)) { WebElement nextButton = browser.driver.findElement(By.className("ui-datepicker-next")); if (nextButton.getAttribute("class").contains("ui-state-disabled")) { return false; } click(nextButton); } } return true; }
boolean function(WebElement dateBox, Calendar date) throws ParseException { click(dateBox); Calendar selectedDate = Calendar.getInstance(); String month = date.getDisplayName(Calendar.MONTH, Calendar.LONG, Locale.ENGLISH); String year = Integer.toString(date.get(Calendar.YEAR)); SimpleDateFormat dateFormat = new SimpleDateFormat(STR); selectedDate.setTime(dateFormat.parse(dateBox.getAttribute("value"))); if (selectedDate.after(date)) { while (!getDatepickerMonth().equals(month) !getDatepickerYear().equals(year)) { WebElement previousButton = browser.driver.findElement(By.className(STR)); if (previousButton.getAttribute("class").contains(STR)) { return false; } click(previousButton); } } else { while (!getDatepickerMonth().equals(month) !getDatepickerYear().equals(year)) { WebElement nextButton = browser.driver.findElement(By.className(STR)); if (nextButton.getAttribute("class").contains(STR)) { return false; } click(nextButton); } } return true; }
/** * Navigate the datepicker associated with {@code dateBox} to the specified {@code date}. * * @param dateBox is a {@link WebElement} that triggers a datepicker * @param date is a {@link Calendar} that specifies the date that needs to be navigated to * @return true if navigated to the {@code date} successfully, otherwise * false * @throws ParseException if the string in {@code dateBox} cannot be parsed */
Navigate the datepicker associated with dateBox to the specified date
navigate
{ "repo_name": "LimeTheCoder/teammates", "path": "src/test/java/teammates/test/pageobjects/InstructorFeedbackEditPage.java", "license": "gpl-2.0", "size": 75690 }
[ "java.text.ParseException", "java.text.SimpleDateFormat", "java.util.Calendar", "java.util.Locale", "org.openqa.selenium.By", "org.openqa.selenium.WebElement" ]
import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Locale; import org.openqa.selenium.By; import org.openqa.selenium.WebElement;
import java.text.*; import java.util.*; import org.openqa.selenium.*;
[ "java.text", "java.util", "org.openqa.selenium" ]
java.text; java.util; org.openqa.selenium;
2,120,242
public void setHost(String p_host) throws MalformedURIException { if (p_host == null || p_host.trim().length() == 0) { m_host = p_host; m_userinfo = null; m_port = -1; } else if (!isWellFormedAddress(p_host)) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_HOST_ADDRESS_NOT_WELLFORMED, null)); //"Host is not a well formed address!"); } m_host = p_host; }
void function(String p_host) throws MalformedURIException { if (p_host == null p_host.trim().length() == 0) { m_host = p_host; m_userinfo = null; m_port = -1; } else if (!isWellFormedAddress(p_host)) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_HOST_ADDRESS_NOT_WELLFORMED, null)); } m_host = p_host; }
/** * Set the host for this URI. If null is passed in, the userinfo * field is also set to null and the port is set to -1. * * @param p_host the host for this URI * * @throws MalformedURIException if p_host is not a valid IP * address or DNS hostname. */
Set the host for this URI. If null is passed in, the userinfo field is also set to null and the port is set to -1
setHost
{ "repo_name": "mirego/j2objc", "path": "xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/URI.java", "license": "apache-2.0", "size": 47266 }
[ "org.apache.xml.res.XMLErrorResources", "org.apache.xml.res.XMLMessages" ]
import org.apache.xml.res.XMLErrorResources; import org.apache.xml.res.XMLMessages;
import org.apache.xml.res.*;
[ "org.apache.xml" ]
org.apache.xml;
1,877,684
public static NetworkModel descriptorToModel(ResourceDescriptor descriptor) throws ResourceException { NetworkModel model = new NetworkModel(); if (descriptor.getNetworkTopology() != null) { // load topology model = descriptorToModel(descriptor.getNetworkTopology()); } // load references if (descriptor.getResourceReferences() != null) { ResourcesReferences references = new ResourcesReferences(); references.putAll(descriptor.getResourceReferences()); model.setResourceReferences(references); } return model; }
static NetworkModel function(ResourceDescriptor descriptor) throws ResourceException { NetworkModel model = new NetworkModel(); if (descriptor.getNetworkTopology() != null) { model = descriptorToModel(descriptor.getNetworkTopology()); } if (descriptor.getResourceReferences() != null) { ResourcesReferences references = new ResourcesReferences(); references.putAll(descriptor.getResourceReferences()); model.setResourceReferences(references); } return model; }
/** * Loads information from the descriptor to a NetworkModel. Loaded information includes topology and resource references * * @param descriptor * @return * @throws ResourceException */
Loads information from the descriptor to a NetworkModel. Loaded information includes topology and resource references
descriptorToModel
{ "repo_name": "dana-i2cat/opennaas-routing-nfv", "path": "extensions/bundles/network.repository/src/main/java/org/opennaas/extensions/network/repository/NetworkMapperDescriptorToModel.java", "license": "lgpl-3.0", "size": 11035 }
[ "org.opennaas.core.resources.ResourceException", "org.opennaas.core.resources.descriptor.ResourceDescriptor", "org.opennaas.extensions.network.model.NetworkModel", "org.opennaas.extensions.network.model.ResourcesReferences" ]
import org.opennaas.core.resources.ResourceException; import org.opennaas.core.resources.descriptor.ResourceDescriptor; import org.opennaas.extensions.network.model.NetworkModel; import org.opennaas.extensions.network.model.ResourcesReferences;
import org.opennaas.core.resources.*; import org.opennaas.core.resources.descriptor.*; import org.opennaas.extensions.network.model.*;
[ "org.opennaas.core", "org.opennaas.extensions" ]
org.opennaas.core; org.opennaas.extensions;
796,173
public boolean recreateDirsIfExist() { File dirParent = new File(SharedData.SD_PATH + SharedData.SD_FOLDER_PATH_PARENT); File dirMain = new File(SharedData.SD_PATH + SharedData.SD_FOLDER_PATH); File dirCSV = new File(SharedData.SD_PATH + SharedData.SD_FOLDER_PATH_CSV); if(dirCSV.exists()) deleteRecursive(dirCSV); File dirLogs = new File(SharedData.SD_PATH + SharedData.SD_FOLDER_PATH_LOGS); if(dirLogs.exists()) deleteRecursive(dirLogs); try { if(!dirParent.exists()) dirParent.mkdir(); if(!dirMain.exists()) dirMain.mkdir(); if(!dirCSV.exists()) dirCSV.mkdir(); if(!dirLogs.exists()) dirLogs.mkdir(); } catch(Exception e) { if(activityContext != null) ((BindingActivity) activityContext).showToast("Unable to create Directories !"); e.printStackTrace(); return false; } return true; }
boolean function() { File dirParent = new File(SharedData.SD_PATH + SharedData.SD_FOLDER_PATH_PARENT); File dirMain = new File(SharedData.SD_PATH + SharedData.SD_FOLDER_PATH); File dirCSV = new File(SharedData.SD_PATH + SharedData.SD_FOLDER_PATH_CSV); if(dirCSV.exists()) deleteRecursive(dirCSV); File dirLogs = new File(SharedData.SD_PATH + SharedData.SD_FOLDER_PATH_LOGS); if(dirLogs.exists()) deleteRecursive(dirLogs); try { if(!dirParent.exists()) dirParent.mkdir(); if(!dirMain.exists()) dirMain.mkdir(); if(!dirCSV.exists()) dirCSV.mkdir(); if(!dirLogs.exists()) dirLogs.mkdir(); } catch(Exception e) { if(activityContext != null) ((BindingActivity) activityContext).showToast(STR); e.printStackTrace(); return false; } return true; }
/** * To check if Logs Dir exist or if not then create it */
To check if Logs Dir exist or if not then create it
recreateDirsIfExist
{ "repo_name": "wahibhaq/android-speaker-audioanalysis", "path": "Android/VoiceRecognizerSP/src/com/example/voicerecognizersp/FileOperations.java", "license": "mit", "size": 12837 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
715,238
public LanguageService getLanguageService() { return languageService; }
LanguageService function() { return languageService; }
/** * Returns the language remote service. * * @return the language remote service */
Returns the language remote service
getLanguageService
{ "repo_name": "fraunhoferfokus/govapps", "path": "data-portlet/src/main/java/de/fraunhofer/fokus/movepla/service/base/EntitlementLocalServiceBaseImpl.java", "license": "bsd-3-clause", "size": 42460 }
[ "de.fraunhofer.fokus.movepla.service.LanguageService" ]
import de.fraunhofer.fokus.movepla.service.LanguageService;
import de.fraunhofer.fokus.movepla.service.*;
[ "de.fraunhofer.fokus" ]
de.fraunhofer.fokus;
2,476,696
@Transactional(readOnly = true) public Post findOne(Long id) { log.debug("Request to get Post : {}", id); return postRepository.findOne(id); }
@Transactional(readOnly = true) Post function(Long id) { log.debug(STR, id); return postRepository.findOne(id); }
/** * Get one post by id. * * @param id the id of the entity * @return the entity */
Get one post by id
findOne
{ "repo_name": "cfaddict/jhipster-course", "path": "jblog/src/main/java/com/therealdanvega/service/PostService.java", "license": "apache-2.0", "size": 1683 }
[ "com.therealdanvega.domain.Post", "org.springframework.transaction.annotation.Transactional" ]
import com.therealdanvega.domain.Post; import org.springframework.transaction.annotation.Transactional;
import com.therealdanvega.domain.*; import org.springframework.transaction.annotation.*;
[ "com.therealdanvega.domain", "org.springframework.transaction" ]
com.therealdanvega.domain; org.springframework.transaction;
2,031,344
public List<PerunFormItem> getPerunFormItems() { return Collections.unmodifiableList(items); }
List<PerunFormItem> function() { return Collections.unmodifiableList(items); }
/** * Get form items of form. * * @return unmodifiable list of PerunFormItems */
Get form items of form
getPerunFormItems
{ "repo_name": "zlamalp/perun-wui", "path": "perun-wui-registrar/src/main/java/cz/metacentrum/perun/wui/registrar/widgets/PerunForm.java", "license": "bsd-2-clause", "size": 17770 }
[ "cz.metacentrum.perun.wui.registrar.widgets.items.PerunFormItem", "java.util.Collections", "java.util.List" ]
import cz.metacentrum.perun.wui.registrar.widgets.items.PerunFormItem; import java.util.Collections; import java.util.List;
import cz.metacentrum.perun.wui.registrar.widgets.items.*; import java.util.*;
[ "cz.metacentrum.perun", "java.util" ]
cz.metacentrum.perun; java.util;
764,689
public static List<Version> allUnreleasedVersions() { return UNRELEASED_VERSIONS; }
static List<Version> function() { return UNRELEASED_VERSIONS; }
/** * Returns an immutable, sorted list containing all unreleased versions. */
Returns an immutable, sorted list containing all unreleased versions
allUnreleasedVersions
{ "repo_name": "wangtuo/elasticsearch", "path": "test/framework/src/main/java/org/elasticsearch/test/VersionUtils.java", "license": "apache-2.0", "size": 10774 }
[ "java.util.List", "org.elasticsearch.Version" ]
import java.util.List; import org.elasticsearch.Version;
import java.util.*; import org.elasticsearch.*;
[ "java.util", "org.elasticsearch" ]
java.util; org.elasticsearch;
2,312,600
public boolean getCompilation() { return Dispatch.get(this, "Compilation").toBoolean(); }
boolean function() { return Dispatch.get(this, STR).toBoolean(); }
/** * Wrapper for calling the ActiveX-Method with input-parameter(s). * * @return the result is of type boolean */
Wrapper for calling the ActiveX-Method with input-parameter(s)
getCompilation
{ "repo_name": "cpesch/MetaMusic", "path": "itunes-com-library/src/main/java/slash/metamusic/itunes/com/binding/IITTrack.java", "license": "gpl-2.0", "size": 19298 }
[ "com.jacob.com.Dispatch" ]
import com.jacob.com.Dispatch;
import com.jacob.com.*;
[ "com.jacob.com" ]
com.jacob.com;
229,927
@Test void testProgrammaticSecurityNone(@Mocked final IWindowsIdentity identity) throws ServletException { this.authenticator.setAuth(new MockWindowsAuthProvider()); final SimpleHttpRequest request = new SimpleHttpRequest(); request.getMappingData().context = (Context) this.authenticator.getContainer(); request.login(WindowsAccountImpl.getCurrentUsername(), ""); request.setUserPrincipal(new GenericWindowsPrincipal(identity, PrincipalFormat.NONE, PrincipalFormat.NONE)); Assertions.assertTrue(request.getUserPrincipal() instanceof GenericWindowsPrincipal); final GenericWindowsPrincipal windowsPrincipal = (GenericWindowsPrincipal) request.getUserPrincipal(); Assertions.assertNull(windowsPrincipal.getSidString()); }
void testProgrammaticSecurityNone(@Mocked final IWindowsIdentity identity) throws ServletException { this.authenticator.setAuth(new MockWindowsAuthProvider()); final SimpleHttpRequest request = new SimpleHttpRequest(); request.getMappingData().context = (Context) this.authenticator.getContainer(); request.login(WindowsAccountImpl.getCurrentUsername(), ""); request.setUserPrincipal(new GenericWindowsPrincipal(identity, PrincipalFormat.NONE, PrincipalFormat.NONE)); Assertions.assertTrue(request.getUserPrincipal() instanceof GenericWindowsPrincipal); final GenericWindowsPrincipal windowsPrincipal = (GenericWindowsPrincipal) request.getUserPrincipal(); Assertions.assertNull(windowsPrincipal.getSidString()); }
/** * Test programmatic security NONE. * * @param identity * the identity * @throws ServletException * the servlet exception */
Test programmatic security NONE
testProgrammaticSecurityNone
{ "repo_name": "hazendaz/waffle", "path": "Source/JNA/waffle-tomcat10/src/test/java/waffle/apache/MixedAuthenticatorTest.java", "license": "mit", "size": 16087 }
[ "jakarta.servlet.ServletException", "org.apache.catalina.Context", "org.junit.jupiter.api.Assertions" ]
import jakarta.servlet.ServletException; import org.apache.catalina.Context; import org.junit.jupiter.api.Assertions;
import jakarta.servlet.*; import org.apache.catalina.*; import org.junit.jupiter.api.*;
[ "jakarta.servlet", "org.apache.catalina", "org.junit.jupiter" ]
jakarta.servlet; org.apache.catalina; org.junit.jupiter;
2,252,972
final String CREATE_TABLE = "CREATE TABLE " + FavoriteEntry.TABLE_NAME + " (" + FavoriteEntry._ID + " INTEGER PRIMARY KEY, " + FavoriteEntry.COLUMN_TITLE + " TEXT NOT NULL, " + FavoriteEntry.COLUMN_TMDB_CACHED_DATA + " TEXT NOT NULL, " + FavoriteEntry.COLUMN_TMDB_POSTER_URL + " TEXT NOT NULL, " + FavoriteEntry.COLUMN_TMDB_ID + " INTEGER NOT NULL, " + FavoriteEntry.COLUMN_CREATED_TIMESTAMP + " DATETIME DEFAULT CURRENT_TIMESTAMP, " + " UNIQUE (" + FavoriteEntry.COLUMN_TMDB_ID + ") ON CONFLICT REPLACE);"; db.execSQL(CREATE_TABLE); }
final String CREATE_TABLE = STR + FavoriteEntry.TABLE_NAME + STR + FavoriteEntry._ID + STR + FavoriteEntry.COLUMN_TITLE + STR + FavoriteEntry.COLUMN_TMDB_CACHED_DATA + STR + FavoriteEntry.COLUMN_TMDB_POSTER_URL + STR + FavoriteEntry.COLUMN_TMDB_ID + STR + FavoriteEntry.COLUMN_CREATED_TIMESTAMP + STR + STR + FavoriteEntry.COLUMN_TMDB_ID + STR; db.execSQL(CREATE_TABLE); }
/** * Executes the table creation SQL statement; */
Executes the table creation SQL statement
onCreate
{ "repo_name": "baisong/popularmovies", "path": "app/src/main/java/com/example/android/popularmovies/data/FavoriteDbHelper.java", "license": "apache-2.0", "size": 2520 }
[ "com.example.android.popularmovies.data.FavoriteContract" ]
import com.example.android.popularmovies.data.FavoriteContract;
import com.example.android.popularmovies.data.*;
[ "com.example.android" ]
com.example.android;
2,631,669
@Override protected boolean parseUnknownField( final CodedInputStream input, final UnknownFieldSet.Builder unknownFields, final ExtensionRegistryLite extensionRegistry, final int tag) throws IOException { return MessageReflection.mergeFieldFrom( input, unknownFields, extensionRegistry, getDescriptorForType(), new MessageReflection.BuilderAdapter(this), tag); } // --------------------------------------------------------------- // Reflection
boolean function( final CodedInputStream input, final UnknownFieldSet.Builder unknownFields, final ExtensionRegistryLite extensionRegistry, final int tag) throws IOException { return MessageReflection.mergeFieldFrom( input, unknownFields, extensionRegistry, getDescriptorForType(), new MessageReflection.BuilderAdapter(this), tag); }
/** * Called by subclasses to parse an unknown field or an extension. * @return {@code true} unless the tag is an end-group tag. */
Called by subclasses to parse an unknown field or an extension
parseUnknownField
{ "repo_name": "Kinetic/kinetic-c", "path": "vendor/protobuf-2.6.0/java/src/main/java/com/google/protobuf/GeneratedMessage.java", "license": "mpl-2.0", "size": 82166 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,344,229
private void writeToChannel(CharBuffer characters, final Charset charset, CharSequence debugLine) throws IOException { if (!charset.canEncode()) { Log.get().log(Level.SEVERE, "FATAL: Charset {0} cannot encode!", charset); return; } // Write characters to output buffers LineEncoder lenc = new LineEncoder(characters, charset); lenc.encode(lineBuffers); //enableWriteEvents(debugLine); }
void function(CharBuffer characters, final Charset charset, CharSequence debugLine) throws IOException { if (!charset.canEncode()) { Log.get().log(Level.SEVERE, STR, charset); return; } LineEncoder lenc = new LineEncoder(characters, charset); lenc.encode(lineBuffers); }
/** * Encodes the given CharBuffer using the given Charset to a bunch of * ByteBuffers (each 512 bytes large) and enqueues them for writing at the * connected SocketChannel. * * @throws java.io.IOException */
Encodes the given CharBuffer using the given Charset to a bunch of ByteBuffers (each 512 bytes large) and enqueues them for writing at the connected SocketChannel
writeToChannel
{ "repo_name": "cli/sonews", "path": "sonews-modules/core-nio2/src/main/java/org/sonews/daemon/async/AsynchronousNNTPConnection.java", "license": "gpl-3.0", "size": 7313 }
[ "java.io.IOException", "java.nio.CharBuffer", "java.nio.charset.Charset", "java.util.logging.Level", "org.sonews.daemon.LineEncoder", "org.sonews.util.Log" ]
import java.io.IOException; import java.nio.CharBuffer; import java.nio.charset.Charset; import java.util.logging.Level; import org.sonews.daemon.LineEncoder; import org.sonews.util.Log;
import java.io.*; import java.nio.*; import java.nio.charset.*; import java.util.logging.*; import org.sonews.daemon.*; import org.sonews.util.*;
[ "java.io", "java.nio", "java.util", "org.sonews.daemon", "org.sonews.util" ]
java.io; java.nio; java.util; org.sonews.daemon; org.sonews.util;
1,532,010
private void initEvents() { openProject.addActionListener((evt) -> { new Http().get(metadata.getProjectUrl()).thenAccept((result) -> { VISNode.get().getController().open(result.asString()); try { BufferedImage image = ImageIO.read(getClass().getResourceAsStream("/visnode/pdi/process/image/Lenna.png")); File file = new File(System.getProperty("user.home") + "/.visnode/" + System.getProperty("user.name") + "Lenna.png"); ImageExporter.exportBufferedImage(ImageFactory.buildRGBImage(image), file); VISNode.get().getModel().getNetwork(). setInput(new MultiFileInput(new File[]{file})); } catch (Exception e) { ExceptionHandler.get().handle(e); } SwingUtilities.getWindowAncestor(ProcessInformationPane.this).dispose(); }); }); }
void function() { openProject.addActionListener((evt) -> { new Http().get(metadata.getProjectUrl()).thenAccept((result) -> { VISNode.get().getController().open(result.asString()); try { BufferedImage image = ImageIO.read(getClass().getResourceAsStream(STR)); File file = new File(System.getProperty(STR) + STR + System.getProperty(STR) + STR); ImageExporter.exportBufferedImage(ImageFactory.buildRGBImage(image), file); VISNode.get().getModel().getNetwork(). setInput(new MultiFileInput(new File[]{file})); } catch (Exception e) { ExceptionHandler.get().handle(e); } SwingUtilities.getWindowAncestor(ProcessInformationPane.this).dispose(); }); }); }
/** * Initializes the events */
Initializes the events
initEvents
{ "repo_name": "VISNode/VISNode", "path": "src/main/java/visnode/gui/ProcessInformationPane.java", "license": "apache-2.0", "size": 5212 }
[ "java.awt.image.BufferedImage", "java.io.File", "javax.imageio.ImageIO", "javax.swing.SwingUtilities", "org.paim.commons.ImageExporter", "org.paim.commons.ImageFactory" ]
import java.awt.image.BufferedImage; import java.io.File; import javax.imageio.ImageIO; import javax.swing.SwingUtilities; import org.paim.commons.ImageExporter; import org.paim.commons.ImageFactory;
import java.awt.image.*; import java.io.*; import javax.imageio.*; import javax.swing.*; import org.paim.commons.*;
[ "java.awt", "java.io", "javax.imageio", "javax.swing", "org.paim.commons" ]
java.awt; java.io; javax.imageio; javax.swing; org.paim.commons;
1,557,739
private boolean save; public static IAssertion valueOf(final String name, final String description, final int severity, final SearchAdapter adapter) { final Assertion assertion = new Assertion(); assertion.setDescription(description); assertion.setName(name); assertion.setSeverity(severity); assertion.adapter = adapter; return assertion; } /** * {@inheritDoc}
boolean save; public static IAssertion function(final String name, final String description, final int severity, final SearchAdapter adapter) { final Assertion assertion = new Assertion(); assertion.setDescription(description); assertion.setName(name); assertion.setSeverity(severity); assertion.adapter = adapter; return assertion; } /** * {@inheritDoc}
/** * Creates a new IAssertion representing the specified name, description, * severity and adapter values. * * @param adapter * the adapter * @param severity * the severity * @param description * the description * @param name * the name * * @return the IAssertion */
Creates a new IAssertion representing the specified name, description, severity and adapter values
valueOf
{ "repo_name": "debabratahazra/OptimaLA", "path": "LogAnalyzer/com.zealcore.se.core/src/com/zealcore/se/core/ifw/assertions/Assertion.java", "license": "epl-1.0", "size": 4846 }
[ "com.zealcore.se.core.SearchAdapter" ]
import com.zealcore.se.core.SearchAdapter;
import com.zealcore.se.core.*;
[ "com.zealcore.se" ]
com.zealcore.se;
275,318
public Builder setSettlementValue( final Money settlementValue ) { Utils.checkNull( settlementValue, "settlementValue" ); this.settlementValue = settlementValue; return this; }
Builder function( final Money settlementValue ) { Utils.checkNull( settlementValue, STR ); this.settlementValue = settlementValue; return this; }
/** * The total value of orders that is settled in this settlement report * @param settlementValue the settlementValue to set * @return this */
The total value of orders that is settled in this settlement report
setSettlementValue
{ "repo_name": "SheepGuru/aerodrome-for-jet", "path": "src/main/java/com/buffalokiwi/aerodrome/jet/settlement/SettlementRec.java", "license": "apache-2.0", "size": 14154 }
[ "com.buffalokiwi.aerodrome.jet.Utils", "com.buffalokiwi.utils.Money" ]
import com.buffalokiwi.aerodrome.jet.Utils; import com.buffalokiwi.utils.Money;
import com.buffalokiwi.aerodrome.jet.*; import com.buffalokiwi.utils.*;
[ "com.buffalokiwi.aerodrome", "com.buffalokiwi.utils" ]
com.buffalokiwi.aerodrome; com.buffalokiwi.utils;
894,402
protected List getImmutableResources() { if (m_immutables == null) { // get list of immutable resources m_immutables = OpenCms.getImportExportManager().getImmutableResources(); if (m_immutables == null) { m_immutables = Collections.EMPTY_LIST; } if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key( Messages.LOG_IMPORTEXPORT_IMMUTABLE_RESOURCES_SIZE_1, Integer.toString(m_immutables.size()))); } } return m_immutables; }
List function() { if (m_immutables == null) { m_immutables = OpenCms.getImportExportManager().getImmutableResources(); if (m_immutables == null) { m_immutables = Collections.EMPTY_LIST; } if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key( Messages.LOG_IMPORTEXPORT_IMMUTABLE_RESOURCES_SIZE_1, Integer.toString(m_immutables.size()))); } } return m_immutables; }
/** * Returns the list of immutable resources.<p> * * @return the list of immutable resources */
Returns the list of immutable resources
getImmutableResources
{ "repo_name": "serrapos/opencms-core", "path": "src/org/opencms/importexport/CmsImportVersion7.java", "license": "lgpl-2.1", "size": 108392 }
[ "java.util.Collections", "java.util.List", "org.opencms.main.OpenCms" ]
import java.util.Collections; import java.util.List; import org.opencms.main.OpenCms;
import java.util.*; import org.opencms.main.*;
[ "java.util", "org.opencms.main" ]
java.util; org.opencms.main;
2,478,168
protected void reduceAfConstraints(final AnnotatedTypeFactory typeFactory, final Set<AFConstraint> outgoing, final Queue<AFConstraint> toProcess, final Set<TypeVariable> targets) { final Set<AFConstraint> visited = new HashSet<>(); List<AFReducer> reducers = new ArrayList<>(); reducers.add(new A2FReducer(typeFactory)); reducers.add(new F2AReducer(typeFactory)); reducers.add(new FIsAReducer(typeFactory)); Set<AFConstraint> newConstraints = new HashSet<>(10); while (!toProcess.isEmpty()) { newConstraints.clear(); AFConstraint constraint = toProcess.remove(); if (!visited.contains(constraint)) { if (constraint.isIrreducible(targets)) { outgoing.add(constraint); } else { final Iterator<AFReducer> reducerIterator = reducers.iterator(); boolean handled = false; while (!handled && reducerIterator.hasNext()) { handled = reducerIterator.next().reduce(constraint, newConstraints); } if (!handled) { ErrorReporter.errorAbort("Unhandled constraint type: " + constraint.toString()); } toProcess.addAll(newConstraints); } visited.add(constraint); } } }
void function(final AnnotatedTypeFactory typeFactory, final Set<AFConstraint> outgoing, final Queue<AFConstraint> toProcess, final Set<TypeVariable> targets) { final Set<AFConstraint> visited = new HashSet<>(); List<AFReducer> reducers = new ArrayList<>(); reducers.add(new A2FReducer(typeFactory)); reducers.add(new F2AReducer(typeFactory)); reducers.add(new FIsAReducer(typeFactory)); Set<AFConstraint> newConstraints = new HashSet<>(10); while (!toProcess.isEmpty()) { newConstraints.clear(); AFConstraint constraint = toProcess.remove(); if (!visited.contains(constraint)) { if (constraint.isIrreducible(targets)) { outgoing.add(constraint); } else { final Iterator<AFReducer> reducerIterator = reducers.iterator(); boolean handled = false; while (!handled && reducerIterator.hasNext()) { handled = reducerIterator.next().reduce(constraint, newConstraints); } if (!handled) { ErrorReporter.errorAbort(STR + constraint.toString()); } toProcess.addAll(newConstraints); } visited.add(constraint); } } }
/** * Given a set of AFConstraints, remove all constraints that are not relevant to inference and return * a set of AFConstraints in which the F is a use of one of the type parameters to infer. */
Given a set of AFConstraints, remove all constraints that are not relevant to inference and return a set of AFConstraints in which the F is a use of one of the type parameters to infer
reduceAfConstraints
{ "repo_name": "renatoathaydes/checker-framework", "path": "framework/src/org/checkerframework/framework/util/typeinference/DefaultTypeArgumentInference.java", "license": "gpl-2.0", "size": 35601 }
[ "java.util.ArrayList", "java.util.HashSet", "java.util.Iterator", "java.util.List", "java.util.Queue", "java.util.Set", "javax.lang.model.type.TypeVariable", "org.checkerframework.framework.type.AnnotatedTypeFactory", "org.checkerframework.framework.util.typeinference.constraint.A2FReducer", "org.checkerframework.framework.util.typeinference.constraint.AFConstraint", "org.checkerframework.framework.util.typeinference.constraint.AFReducer", "org.checkerframework.framework.util.typeinference.constraint.F2AReducer", "org.checkerframework.framework.util.typeinference.constraint.FIsAReducer", "org.checkerframework.javacutil.ErrorReporter" ]
import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Queue; import java.util.Set; import javax.lang.model.type.TypeVariable; import org.checkerframework.framework.type.AnnotatedTypeFactory; import org.checkerframework.framework.util.typeinference.constraint.A2FReducer; import org.checkerframework.framework.util.typeinference.constraint.AFConstraint; import org.checkerframework.framework.util.typeinference.constraint.AFReducer; import org.checkerframework.framework.util.typeinference.constraint.F2AReducer; import org.checkerframework.framework.util.typeinference.constraint.FIsAReducer; import org.checkerframework.javacutil.ErrorReporter;
import java.util.*; import javax.lang.model.type.*; import org.checkerframework.framework.type.*; import org.checkerframework.framework.util.typeinference.constraint.*; import org.checkerframework.javacutil.*;
[ "java.util", "javax.lang", "org.checkerframework.framework", "org.checkerframework.javacutil" ]
java.util; javax.lang; org.checkerframework.framework; org.checkerframework.javacutil;
1,613,509
@Override public void onCancel(String callerTag) { ComponentsGetter cg = (ComponentsGetter)getActivity(); cg.getFileOperationsHelper().removeFile(mTargetFile, true); }
void function(String callerTag) { ComponentsGetter cg = (ComponentsGetter)getActivity(); cg.getFileOperationsHelper().removeFile(mTargetFile, true); }
/** * Performs the removal of the local copy of the target file */
Performs the removal of the local copy of the target file
onCancel
{ "repo_name": "gdieleman/android", "path": "src/com/owncloud/android/ui/dialog/RemoveFileDialogFragment.java", "license": "gpl-2.0", "size": 3837 }
[ "com.owncloud.android.ui.activity.ComponentsGetter" ]
import com.owncloud.android.ui.activity.ComponentsGetter;
import com.owncloud.android.ui.activity.*;
[ "com.owncloud.android" ]
com.owncloud.android;
1,666,997
void unregisterWifiSocketHandlerByThing(final Thing thing);
void unregisterWifiSocketHandlerByThing(final Thing thing);
/** * Unregisters a {@link SilvercrestWifiSocketHandler} by the corresponding {@link Thing}. * * @param thing the {@link Thing}. */
Unregisters a <code>SilvercrestWifiSocketHandler</code> by the corresponding <code>Thing</code>
unregisterWifiSocketHandlerByThing
{ "repo_name": "paulianttila/openhab2", "path": "bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/handler/SilvercrestWifiSocketMediator.java", "license": "epl-1.0", "size": 2345 }
[ "org.openhab.core.thing.Thing" ]
import org.openhab.core.thing.Thing;
import org.openhab.core.thing.*;
[ "org.openhab.core" ]
org.openhab.core;
1,005,593
public boolean invalidSetMethod(Context context, String leftreference, String rightreference, Info info);
boolean function(Context context, String leftreference, String rightreference, Info info);
/** * Called when object is null or there is no setter for the given * property. invalidSetMethod() will be called in sequence for * each link in the chain until a true value is returned. It's * recommended that false be returned as a default to allow * for easy chaining. * * @param context the context when the reference was found invalid * @param leftreference left reference being assigned to * @param rightreference invalid reference on the right * @param info contains info on template, line, col * * @return if true then stop calling invalidSetMethod along the * chain. */
Called when object is null or there is no setter for the given property. invalidSetMethod() will be called in sequence for each link in the chain until a true value is returned. It's recommended that false be returned as a default to allow for easy chaining
invalidSetMethod
{ "repo_name": "VISTALL/apache.velocity-engine", "path": "velocity-engine-core/src/main/java/org/apache/velocity/app/event/InvalidReferenceEventHandler.java", "license": "apache-2.0", "size": 8097 }
[ "org.apache.velocity.context.Context", "org.apache.velocity.util.introspection.Info" ]
import org.apache.velocity.context.Context; import org.apache.velocity.util.introspection.Info;
import org.apache.velocity.context.*; import org.apache.velocity.util.introspection.*;
[ "org.apache.velocity" ]
org.apache.velocity;
452,343
Multimap<String, KafkaStream<byte[], byte[]>> createMessageStreams(Map<String, Integer> topicCountMap);
Multimap<String, KafkaStream<byte[], byte[]>> createMessageStreams(Map<String, Integer> topicCountMap);
/** * Create a list of MessageStreams for each topic. * * @param topicCountMap a map of (topic, #streams) pair * @return a map of (topic, list of KafkaStream) pairs. * The number of items in the list is #streams. Each stream supports * an iterator over message/metadata pairs. */
Create a list of MessageStreams for each topic
createMessageStreams
{ "repo_name": "lemonJun/TakinMQ", "path": "takinmq-jkafka/src/main/java/kafka/consumer/ConsumerConnector.java", "license": "apache-2.0", "size": 2300 }
[ "com.google.common.collect.Multimap", "java.util.Map" ]
import com.google.common.collect.Multimap; import java.util.Map;
import com.google.common.collect.*; import java.util.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
1,840,281
@JsonSetter public SearchIndexerSkillset setSkills(List<SearchIndexerSkill> skills) { this.skills = skills; return this; }
SearchIndexerSkillset function(List<SearchIndexerSkill> skills) { this.skills = skills; return this; }
/** * Set the skills property: A list of skills in the skillset. * * @param skills the skills value to set. * @return the SearchIndexerSkillset object itself. */
Set the skills property: A list of skills in the skillset
setSkills
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerSkillset.java", "license": "mit", "size": 4751 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,443,243
public SortedMap<TimeTool, String> getTerms(){ TreeMap<TimeTool, String> ret = new TreeMap<TimeTool, String>(); String raw = (String) getExtInfoStoredObjectByKey(FLD_EXT_TERMS); if (raw != null) { String[] terms = raw.split(StringTool.flattenSeparator); for (String term : terms) { if (term.length() > 0) { String[] flds = term.split(StringConstants.DOUBLECOLON); if (flds != null && flds.length > 0) { TimeTool date = new TimeTool(flds[0]); String dose = "n/a"; if (flds.length > 1) { dose = flds[1]; } ret.put(date, dose); } } } } ret.put(new TimeTool(get(FLD_DATE_FROM)), get(FLD_DOSAGE)); return ret; }
SortedMap<TimeTool, String> function(){ TreeMap<TimeTool, String> ret = new TreeMap<TimeTool, String>(); String raw = (String) getExtInfoStoredObjectByKey(FLD_EXT_TERMS); if (raw != null) { String[] terms = raw.split(StringTool.flattenSeparator); for (String term : terms) { if (term.length() > 0) { String[] flds = term.split(StringConstants.DOUBLECOLON); if (flds != null && flds.length > 0) { TimeTool date = new TimeTool(flds[0]); String dose = "n/a"; if (flds.length > 1) { dose = flds[1]; } ret.put(date, dose); } } } } ret.put(new TimeTool(get(FLD_DATE_FROM)), get(FLD_DOSAGE)); return ret; }
/** * A listing of all administration periods of this prescription. This is to retrieve later when * and how the article was prescribed * * @return a Map of TimeTools and Doses (Sorted by date) */
A listing of all administration periods of this prescription. This is to retrieve later when and how the article was prescribed
getTerms
{ "repo_name": "elexis/elexis-3-core", "path": "bundles/ch.elexis.core.data/src/ch/elexis/data/Prescription.java", "license": "epl-1.0", "size": 24437 }
[ "ch.elexis.core.constants.StringConstants", "ch.rgw.tools.StringTool", "ch.rgw.tools.TimeTool", "java.util.SortedMap", "java.util.TreeMap" ]
import ch.elexis.core.constants.StringConstants; import ch.rgw.tools.StringTool; import ch.rgw.tools.TimeTool; import java.util.SortedMap; import java.util.TreeMap;
import ch.elexis.core.constants.*; import ch.rgw.tools.*; import java.util.*;
[ "ch.elexis.core", "ch.rgw.tools", "java.util" ]
ch.elexis.core; ch.rgw.tools; java.util;
299,541
private String toString(List processSubtree, int tablevel) { StringBuffer sb = new StringBuffer(); for (Iterator i=processSubtree.iterator(); i.hasNext();) { Process p = (Process)i.next(); for (int j=0; j<tablevel; j++) { sb.append(" "); } sb.append(p.pid + " " + p.cmd + " " + TIME_FORMAT.format(p.startTime) + " " + p.duration + "\n"); sb.append(toString(p.childList, tablevel + 1)); } return sb.toString(); }
String function(List processSubtree, int tablevel) { StringBuffer sb = new StringBuffer(); for (Iterator i=processSubtree.iterator(); i.hasNext();) { Process p = (Process)i.next(); for (int j=0; j<tablevel; j++) { sb.append(" "); } sb.append(p.pid + " " + p.cmd + " " + TIME_FORMAT.format(p.startTime) + " " + p.duration + "\n"); sb.append(toString(p.childList, tablevel + 1)); } return sb.toString(); }
/** * Recursively returns a string representation of the process tree. * * @param processSubtree the process subtree to print * @param tablevel current tab level * @return a string representation of the process tree */
Recursively returns a string representation of the process tree
toString
{ "repo_name": "steed717/bootchart-0.9", "path": "src/org/bootchart/common/ProcessTree.java", "license": "gpl-2.0", "size": 19033 }
[ "java.util.Iterator", "java.util.List" ]
import java.util.Iterator; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,948,793
public void doNextStep() { Step nextstep = controller.doNextStep(); if (nextstep == null) setForwardControlButton(false); else { modconn.setSaveStatus(SaveStatus.CHANGES_TO_SAVE); setAllControlButton(true); if (controller.getPhase() == 1) { if (nextstep instanceof P1BeginForStep) { if (((P1BeginForStep)nextstep).isLastForStep()) { phaseonescreen.phaseoneinputPane.setBtGoOnVisible(true); setForwardControlButton(false); } } phaseonescreen.phaseoneshowPane.update(nextstep); phaseonescreen.infotabbedPane.setKMPHighlighter(nextstep.getKMPHighlighter()); phaseonescreen.infotabbedPane.setDescription(nextstep.getDescriptionText(),true); phaseonescreen.updateUI(); } if (controller.getPhase() == 2) { if (nextstep instanceof P2EndStep) { setForwardControlButton(false); phasetwoscreen.phasetwoinputPane.setLabelResultVisible(true,((P2EndStep)nextstep).isPatternFound()); } phasetwoscreen.phasetwoshowPane.update(nextstep,true); phasetwoscreen.infotabbedPane.setKMPHighlighter(nextstep.getKMPHighlighter()); int start = ((P2Step)nextstep).getTextPos() - nextstep.getPatPos(); phasetwoscreen.infotabbedPane.setSearchTextHighlighter(start, start + controller.getPattern().getPattern().length()); phasetwoscreen.infotabbedPane.setDescription(nextstep.getDescriptionText(),true); phasetwoscreen.updateUI(); } } }
void function() { Step nextstep = controller.doNextStep(); if (nextstep == null) setForwardControlButton(false); else { modconn.setSaveStatus(SaveStatus.CHANGES_TO_SAVE); setAllControlButton(true); if (controller.getPhase() == 1) { if (nextstep instanceof P1BeginForStep) { if (((P1BeginForStep)nextstep).isLastForStep()) { phaseonescreen.phaseoneinputPane.setBtGoOnVisible(true); setForwardControlButton(false); } } phaseonescreen.phaseoneshowPane.update(nextstep); phaseonescreen.infotabbedPane.setKMPHighlighter(nextstep.getKMPHighlighter()); phaseonescreen.infotabbedPane.setDescription(nextstep.getDescriptionText(),true); phaseonescreen.updateUI(); } if (controller.getPhase() == 2) { if (nextstep instanceof P2EndStep) { setForwardControlButton(false); phasetwoscreen.phasetwoinputPane.setLabelResultVisible(true,((P2EndStep)nextstep).isPatternFound()); } phasetwoscreen.phasetwoshowPane.update(nextstep,true); phasetwoscreen.infotabbedPane.setKMPHighlighter(nextstep.getKMPHighlighter()); int start = ((P2Step)nextstep).getTextPos() - nextstep.getPatPos(); phasetwoscreen.infotabbedPane.setSearchTextHighlighter(start, start + controller.getPattern().getPattern().length()); phasetwoscreen.infotabbedPane.setDescription(nextstep.getDescriptionText(),true); phasetwoscreen.updateUI(); } } }
/** * The method is called when the next step should be performed. * */
The method is called when the next step should be performed
doNextStep
{ "repo_name": "jurkov/j-algo-mod", "path": "src/org/jalgo/module/kmp/gui/GUIController.java", "license": "gpl-2.0", "size": 30041 }
[ "org.jalgo.main.AbstractModuleConnector", "org.jalgo.module.kmp.algorithm.Step", "org.jalgo.module.kmp.algorithm.phaseone.P1BeginForStep", "org.jalgo.module.kmp.algorithm.phasetwo.P2EndStep", "org.jalgo.module.kmp.algorithm.phasetwo.P2Step" ]
import org.jalgo.main.AbstractModuleConnector; import org.jalgo.module.kmp.algorithm.Step; import org.jalgo.module.kmp.algorithm.phaseone.P1BeginForStep; import org.jalgo.module.kmp.algorithm.phasetwo.P2EndStep; import org.jalgo.module.kmp.algorithm.phasetwo.P2Step;
import org.jalgo.main.*; import org.jalgo.module.kmp.algorithm.*; import org.jalgo.module.kmp.algorithm.phaseone.*; import org.jalgo.module.kmp.algorithm.phasetwo.*;
[ "org.jalgo.main", "org.jalgo.module" ]
org.jalgo.main; org.jalgo.module;
1,277,615
public static Properties getProperties() { return sProperties; }
static Properties function() { return sProperties; }
/** * Gets the contents of the warworlds.properties as a \c Properties. These are the static * properties that govern things like which server to connect to and so on. */
Gets the contents of the warworlds.properties as a \c Properties. These are the static properties that govern things like which server to connect to and so on
getProperties
{ "repo_name": "jife94/wwmmo", "path": "client/src/main/java/au/com/codeka/warworlds/Util.java", "license": "mit", "size": 3469 }
[ "java.util.Properties" ]
import java.util.Properties;
import java.util.*;
[ "java.util" ]
java.util;
182,770
public static boolean isExecutableJarFile(MainFrame mainFrame) { try { URL url = mainFrame.getClass().getResource("version.txt"); if (url != null) { return url.getProtocol().toLowerCase().trim().equals("jar"); } } catch (Exception ex) { ex.printStackTrace(); } return false; }
static boolean function(MainFrame mainFrame) { try { URL url = mainFrame.getClass().getResource(STR); if (url != null) { return url.getProtocol().toLowerCase().trim().equals("jar"); } } catch (Exception ex) { ex.printStackTrace(); } return false; }
/** * Check executed by executable jar file. * * @param mainFrame * @return */
Check executed by executable jar file
isExecutableJarFile
{ "repo_name": "gootara-org/ios-image-util", "path": "ios-image-util/src/org/gootara/ios/image/util/IOSImageUtil.java", "license": "mit", "size": 21696 }
[ "org.gootara.ios.image.util.ui.MainFrame" ]
import org.gootara.ios.image.util.ui.MainFrame;
import org.gootara.ios.image.util.ui.*;
[ "org.gootara.ios" ]
org.gootara.ios;
2,375,649
public static void get(Context context, String urlStr, Map<String, String> queryParams, HttpListener listener) { Uri.Builder uriBuilder = Uri.parse(urlStr).buildUpon(); if (queryParams != null) { Set<String> paramNames = queryParams.keySet(); for (String paramName : paramNames) { uriBuilder.appendQueryParameter(paramName, queryParams.get(paramName)); } } new GetRequestTask(context, listener) .execute(uriBuilder.build().toString()); } private static class GetRequestTask extends AsyncTask<String, Void, String> { private final Context context; private final HttpListener listener; private String requestUrl; public GetRequestTask(Context context, HttpListener listener) { this.context = context; this.listener = listener; }
static void function(Context context, String urlStr, Map<String, String> queryParams, HttpListener listener) { Uri.Builder uriBuilder = Uri.parse(urlStr).buildUpon(); if (queryParams != null) { Set<String> paramNames = queryParams.keySet(); for (String paramName : paramNames) { uriBuilder.appendQueryParameter(paramName, queryParams.get(paramName)); } } new GetRequestTask(context, listener) .execute(uriBuilder.build().toString()); } private static class GetRequestTask extends AsyncTask<String, Void, String> { private final Context context; private final HttpListener listener; private String requestUrl; public GetRequestTask(Context context, HttpListener listener) { this.context = context; this.listener = listener; }
/** * Obtains a url content of a get request in an async task and notifies the listener on response. * * @param context context calling the get request. * @param urlStr base url for request. * @param queryParams query params. * @param listener {@link HttpListener} for result. */
Obtains a url content of a get request in an async task and notifies the listener on response
get
{ "repo_name": "miche-atucha/weatherer", "path": "app/src/main/java/com/touwolf/weatherer/http/Http.java", "license": "apache-2.0", "size": 4519 }
[ "android.content.Context", "android.net.Uri", "android.os.AsyncTask", "java.util.Map", "java.util.Set" ]
import android.content.Context; import android.net.Uri; import android.os.AsyncTask; import java.util.Map; import java.util.Set;
import android.content.*; import android.net.*; import android.os.*; import java.util.*;
[ "android.content", "android.net", "android.os", "java.util" ]
android.content; android.net; android.os; java.util;
24,206
Map<String, String> conf = configuration.getValByRegex(downSamplerConfigPrefix + "*"); List<String> metricPatterns = new ArrayList<>(); Set<String> keys = conf.keySet(); for (String key : keys) { if (key.endsWith(downSamplerMetricPatternsConfig)) { String patternString = conf.get(key); String[] patterns = StringUtils.split(patternString, ","); for (String pattern : patterns) { if (StringUtils.isNotEmpty(pattern)) { String trimmedPattern = pattern.trim(); metricPatterns.add(trimmedPattern); } } } } return metricPatterns; } /** * Get the list of downsamplers that are configured in ams-site * Sample config <name>timeline.metrics.downsampler.topn.metric.patterns</name> <value>dfs.NNTopUserOpCounts.windowMs=60000.op%,dfs.NNTopUserOpCounts.windowMs=300000.op%</value> <name>timeline.metrics.downsampler.topn.value</name> <value>10</value>
Map<String, String> conf = configuration.getValByRegex(downSamplerConfigPrefix + "*"); List<String> metricPatterns = new ArrayList<>(); Set<String> keys = conf.keySet(); for (String key : keys) { if (key.endsWith(downSamplerMetricPatternsConfig)) { String patternString = conf.get(key); String[] patterns = StringUtils.split(patternString, ","); for (String pattern : patterns) { if (StringUtils.isNotEmpty(pattern)) { String trimmedPattern = pattern.trim(); metricPatterns.add(trimmedPattern); } } } } return metricPatterns; } /** * Get the list of downsamplers that are configured in ams-site * Sample config <name>timeline.metrics.downsampler.topn.metric.patterns</name> <value>dfs.NNTopUserOpCounts.windowMs=60000.op%,dfs.NNTopUserOpCounts.windowMs=300000.op%</value> <name>timeline.metrics.downsampler.topn.value</name> <value>10</value>
/** * Get the list of metrics that are requested to be downsampled. * @param configuration * @return List of metric patterns/names that are to be downsampled. */
Get the list of metrics that are requested to be downsampled
getDownsampleMetricPatterns
{ "repo_name": "radicalbit/ambari", "path": "ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/DownSamplerUtils.java", "license": "apache-2.0", "size": 4250 }
[ "java.util.ArrayList", "java.util.List", "java.util.Map", "java.util.Set", "org.apache.commons.lang.StringUtils" ]
import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Set; import org.apache.commons.lang.StringUtils;
import java.util.*; import org.apache.commons.lang.*;
[ "java.util", "org.apache.commons" ]
java.util; org.apache.commons;
1,881,499
public DateFormat getDateFormat();
DateFormat function();
/** * Gets the DateFormat used to format the cell. This will normally be * the format specified in the excel spreadsheet, but in the event of any * difficulty parsing this, it will revert to the default date/time format. * * @return the DateFormat object used to format the date in the original * excel cell */
Gets the DateFormat used to format the cell. This will normally be the format specified in the excel spreadsheet, but in the event of any difficulty parsing this, it will revert to the default date/time format
getDateFormat
{ "repo_name": "stefandmn/AREasy", "path": "src/java/org/areasy/common/parser/excel/DateCell.java", "license": "lgpl-3.0", "size": 1549 }
[ "java.text.DateFormat" ]
import java.text.DateFormat;
import java.text.*;
[ "java.text" ]
java.text;
635,895
List<ViewOtherAction> getApplicationActions() { List<ApplicationData> applications = view.getApplications(); if (applications == null || applications.size() == 0) return null; Iterator<ApplicationData> i = applications.iterator(); List<ViewOtherAction> actions = new ArrayList<ViewOtherAction>(); while (i.hasNext()) { actions.add(new ViewOtherAction(model, i.next())); } return actions; } void viewDisplay(ImageDisplay node) { model.viewDisplay(node, false); }
List<ViewOtherAction> getApplicationActions() { List<ApplicationData> applications = view.getApplications(); if (applications == null applications.size() == 0) return null; Iterator<ApplicationData> i = applications.iterator(); List<ViewOtherAction> actions = new ArrayList<ViewOtherAction>(); while (i.hasNext()) { actions.add(new ViewOtherAction(model, i.next())); } return actions; } void viewDisplay(ImageDisplay node) { model.viewDisplay(node, false); }
/** * Returns the external application previously used to open * the selected document. * * @return See above. */
Returns the external application previously used to open the selected document
getApplicationActions
{ "repo_name": "rleigh-dundee/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/dataBrowser/view/DataBrowserControl.java", "license": "gpl-2.0", "size": 20398 }
[ "java.util.ArrayList", "java.util.Iterator", "java.util.List", "org.openmicroscopy.shoola.agents.dataBrowser.actions.ViewOtherAction", "org.openmicroscopy.shoola.agents.dataBrowser.browser.ImageDisplay", "org.openmicroscopy.shoola.env.data.model.ApplicationData" ]
import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.openmicroscopy.shoola.agents.dataBrowser.actions.ViewOtherAction; import org.openmicroscopy.shoola.agents.dataBrowser.browser.ImageDisplay; import org.openmicroscopy.shoola.env.data.model.ApplicationData;
import java.util.*; import org.openmicroscopy.shoola.agents.*; import org.openmicroscopy.shoola.env.data.model.*;
[ "java.util", "org.openmicroscopy.shoola" ]
java.util; org.openmicroscopy.shoola;
1,501,211
public Iterator<PDField> getFieldIterator() { return new PDFieldTree(this).iterator(); }
Iterator<PDField> function() { return new PDFieldTree(this).iterator(); }
/** * Returns an iterator which walks all fields in the field tree, in order. */
Returns an iterator which walks all fields in the field tree, in order
getFieldIterator
{ "repo_name": "mathieufortin01/pdfbox", "path": "pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDAcroForm.java", "license": "apache-2.0", "size": 18508 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
2,741,397
public List<GenPolynomial<C>> normalform(List<GenPolynomial<C>> Pp, List<GenPolynomial<C>> Ap);
List<GenPolynomial<C>> function(List<GenPolynomial<C>> Pp, List<GenPolynomial<C>> Ap);
/** * Normalform Set. * @param Ap polynomial list. * @param Pp polynomial list. * @return list of nf(a) with respect to Pp for all a in Ap. */
Normalform Set
normalform
{ "repo_name": "breandan/java-algebra-system", "path": "src/edu/jas/gb/Reduction.java", "license": "gpl-2.0", "size": 5206 }
[ "edu.jas.poly.GenPolynomial", "java.util.List" ]
import edu.jas.poly.GenPolynomial; import java.util.List;
import edu.jas.poly.*; import java.util.*;
[ "edu.jas.poly", "java.util" ]
edu.jas.poly; java.util;
1,718,801
public static byte[] encode( byte[] data) { int len = (data.length + 2) / 3 * 4; ByteArrayOutputStream bOut = new ByteArrayOutputStream(len); try { encoder.encode(data, 0, data.length, bOut); } catch (IOException e) { throw new RuntimeException("exception encoding base64 string: " + e); } return bOut.toByteArray(); }
static byte[] function( byte[] data) { int len = (data.length + 2) / 3 * 4; ByteArrayOutputStream bOut = new ByteArrayOutputStream(len); try { encoder.encode(data, 0, data.length, bOut); } catch (IOException e) { throw new RuntimeException(STR + e); } return bOut.toByteArray(); }
/** * encode the input data producing a base 64 encoded byte array. * * @return a byte array containing the base 64 encoded data. */
encode the input data producing a base 64 encoded byte array
encode
{ "repo_name": "Z-Shang/onscripter-gbk", "path": "svn/onscripter-read-only/src/org/bouncycastle/util/encoders/Base64.java", "license": "gpl-2.0", "size": 3198 }
[ "java.io.ByteArrayOutputStream", "java.io.IOException" ]
import java.io.ByteArrayOutputStream; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,219,971
@ResourceOperation( name="set_polymorphic_structure", path="GET | POST : set_polymorphic_structure") public PolymorphicStructure setPolymorphicStructure( @RequestParam( name="value" )PolymorphicStructure theValue ) { return theValue; }
@ResourceOperation( name=STR, path=STR) PolymorphicStructure function( @RequestParam( name="value" )PolymorphicStructure theValue ) { return theValue; }
/** * Receives a polymorphc structure. */
Receives a polymorphc structure
setPolymorphicStructure
{ "repo_name": "Talvish/Tales-Samples", "path": "complex_service/src/main/java/com/talvish/tales/samples/complexservice/DataStructureResource.java", "license": "apache-2.0", "size": 7005 }
[ "com.talvish.tales.contracts.services.http.RequestParam", "com.talvish.tales.contracts.services.http.ResourceOperation" ]
import com.talvish.tales.contracts.services.http.RequestParam; import com.talvish.tales.contracts.services.http.ResourceOperation;
import com.talvish.tales.contracts.services.http.*;
[ "com.talvish.tales" ]
com.talvish.tales;
1,096,483
boolean clientSelectAllMethodGenerated(Method method, Interface interfaze, IntrospectedTable introspectedTable);
boolean clientSelectAllMethodGenerated(Method method, Interface interfaze, IntrospectedTable introspectedTable);
/** * This method is called when the selectAll method has been * generated in the client interface. This method is only generated by * the simple runtime. * * @param method * the generated selectAll method * @param interfaze * the partially implemented client interface. You can add * additional imported classes to the interface if * necessary. * @param introspectedTable * The class containing information about the table as * introspected from the database * @return true if the method should be generated, false if the generated * method should be ignored. In the case of multiple plugins, the * first plugin returning false will disable the calling of further * plugins. */
This method is called when the selectAll method has been generated in the client interface. This method is only generated by the simple runtime
clientSelectAllMethodGenerated
{ "repo_name": "NanYoMy/mybatis-generator", "path": "src/main/java/org/mybatis/generator/api/Plugin.java", "license": "mit", "size": 72792 }
[ "org.mybatis.generator.api.dom.java.Interface", "org.mybatis.generator.api.dom.java.Method" ]
import org.mybatis.generator.api.dom.java.Interface; import org.mybatis.generator.api.dom.java.Method;
import org.mybatis.generator.api.dom.java.*;
[ "org.mybatis.generator" ]
org.mybatis.generator;
2,749,844
public void writeEntityToNBT(NBTTagCompound compound) { compound.setByte("Facing", (byte)this.facingDirection.getHorizontalIndex()); BlockPos blockpos = this.getHangingPosition(); compound.setInteger("TileX", blockpos.getX()); compound.setInteger("TileY", blockpos.getY()); compound.setInteger("TileZ", blockpos.getZ()); }
void function(NBTTagCompound compound) { compound.setByte(STR, (byte)this.facingDirection.getHorizontalIndex()); BlockPos blockpos = this.getHangingPosition(); compound.setInteger("TileX", blockpos.getX()); compound.setInteger("TileY", blockpos.getY()); compound.setInteger("TileZ", blockpos.getZ()); }
/** * (abstract) Protected helper method to write subclass entity data to NBT. */
(abstract) Protected helper method to write subclass entity data to NBT
writeEntityToNBT
{ "repo_name": "TheGreatAndPowerfulWeegee/wipunknown", "path": "build/tmp/recompileMc/sources/net/minecraft/entity/EntityHanging.java", "license": "gpl-3.0", "size": 11406 }
[ "net.minecraft.nbt.NBTTagCompound", "net.minecraft.util.math.BlockPos" ]
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.math.BlockPos;
import net.minecraft.nbt.*; import net.minecraft.util.math.*;
[ "net.minecraft.nbt", "net.minecraft.util" ]
net.minecraft.nbt; net.minecraft.util;
431,473
@Test public void verifyFT69() throws IOException, InterruptedException { // languageLocationCode missing HttpPost httpPost = createSubscriptionHttpPost("1234567890", "A", "AP", "123456789012545", null, "childPack"); String expectedJsonResponse = createFailureResponseJson("<languageLocationCode: Not Present>"); HttpResponse response = SimpleHttpClient.httpRequestAndResponse( httpPost, ADMIN_USERNAME, ADMIN_PASSWORD); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusLine() .getStatusCode()); assertEquals(expectedJsonResponse, EntityUtils.toString(response.getEntity())); }
void function() throws IOException, InterruptedException { HttpPost httpPost = createSubscriptionHttpPost(STR, "A", "AP", STR, null, STR); String expectedJsonResponse = createFailureResponseJson(STR); HttpResponse response = SimpleHttpClient.httpRequestAndResponse( httpPost, ADMIN_USERNAME, ADMIN_PASSWORD); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusLine() .getStatusCode()); assertEquals(expectedJsonResponse, EntityUtils.toString(response.getEntity())); }
/** * To verify the behavior of Create Subscription Request API if a mandatory * parameter : languageLocationCode is missing from the API request. */
To verify the behavior of Create Subscription Request API if a mandatory parameter : languageLocationCode is missing from the API request
verifyFT69
{ "repo_name": "ngraczewski/mim", "path": "testing/src/test/java/org/motechproject/nms/testing/it/api/KilkariControllerBundleIT.java", "license": "bsd-3-clause", "size": 193191 }
[ "java.io.IOException", "org.apache.commons.httpclient.HttpStatus", "org.apache.http.HttpResponse", "org.apache.http.client.methods.HttpPost", "org.apache.http.util.EntityUtils", "org.junit.Assert", "org.motechproject.testing.osgi.http.SimpleHttpClient" ]
import java.io.IOException; import org.apache.commons.httpclient.HttpStatus; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.util.EntityUtils; import org.junit.Assert; import org.motechproject.testing.osgi.http.SimpleHttpClient;
import java.io.*; import org.apache.commons.httpclient.*; import org.apache.http.*; import org.apache.http.client.methods.*; import org.apache.http.util.*; import org.junit.*; import org.motechproject.testing.osgi.http.*;
[ "java.io", "org.apache.commons", "org.apache.http", "org.junit", "org.motechproject.testing" ]
java.io; org.apache.commons; org.apache.http; org.junit; org.motechproject.testing;
2,469,303
public static void loadRep(Object object, Repository rep, ObjectId id_job, List<DatabaseMeta> databases, List<SlaveServer> slaveServers) throws KettleException { try { String xml = rep.getJobEntryAttributeString(id_job, "job-xml"); ByteArrayInputStream bais = new ByteArrayInputStream(xml.getBytes()); Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(bais); read(object, doc.getDocumentElement()); } catch (ParserConfigurationException ex) { throw new KettleException(ex.getMessage(), ex); } catch (SAXException ex) { throw new KettleException(ex.getMessage(), ex); } catch (IOException ex) { throw new KettleException(ex.getMessage(), ex); } }
static void function(Object object, Repository rep, ObjectId id_job, List<DatabaseMeta> databases, List<SlaveServer> slaveServers) throws KettleException { try { String xml = rep.getJobEntryAttributeString(id_job, STR); ByteArrayInputStream bais = new ByteArrayInputStream(xml.getBytes()); Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(bais); read(object, doc.getDocumentElement()); } catch (ParserConfigurationException ex) { throw new KettleException(ex.getMessage(), ex); } catch (SAXException ex) { throw new KettleException(ex.getMessage(), ex); } catch (IOException ex) { throw new KettleException(ex.getMessage(), ex); } }
/** * Handle reading of the input (object) from the kettle repository by getting the xml from the repository attribute string * and then re-hydrate the object with our already existing read method. * * @param object * @param rep * @param id_job * @param databases * @param slaveServers * @throws KettleException */
Handle reading of the input (object) from the kettle repository by getting the xml from the repository attribute string and then re-hydrate the object with our already existing read method
loadRep
{ "repo_name": "mtseu/big-data-plugin", "path": "src/org/pentaho/di/job/JobEntrySerializationHelper.java", "license": "apache-2.0", "size": 21250 }
[ "java.io.ByteArrayInputStream", "java.io.IOException", "java.util.List", "javax.xml.parsers.DocumentBuilderFactory", "javax.xml.parsers.ParserConfigurationException", "org.pentaho.di.cluster.SlaveServer", "org.pentaho.di.core.database.DatabaseMeta", "org.pentaho.di.core.exception.KettleException", "org.pentaho.di.repository.ObjectId", "org.pentaho.di.repository.Repository", "org.w3c.dom.Document", "org.xml.sax.SAXException" ]
import java.io.ByteArrayInputStream; import java.io.IOException; import java.util.List; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.pentaho.di.cluster.SlaveServer; import org.pentaho.di.core.database.DatabaseMeta; import org.pentaho.di.core.exception.KettleException; import org.pentaho.di.repository.ObjectId; import org.pentaho.di.repository.Repository; import org.w3c.dom.Document; import org.xml.sax.SAXException;
import java.io.*; import java.util.*; import javax.xml.parsers.*; import org.pentaho.di.cluster.*; import org.pentaho.di.core.database.*; import org.pentaho.di.core.exception.*; import org.pentaho.di.repository.*; import org.w3c.dom.*; import org.xml.sax.*;
[ "java.io", "java.util", "javax.xml", "org.pentaho.di", "org.w3c.dom", "org.xml.sax" ]
java.io; java.util; javax.xml; org.pentaho.di; org.w3c.dom; org.xml.sax;
1,091,997
String name = reference.getName(); if (inputs.containsKey(name)) { throw new IllegalStateException(MessageFormat.format( "external input is already declared in this jobflow: \"{0}\" ({1})", name, reference.getDescriptionClass().getClassName())); } inputs.put(name, reference); }
String name = reference.getName(); if (inputs.containsKey(name)) { throw new IllegalStateException(MessageFormat.format( STR{0}\STR, name, reference.getDescriptionClass().getClassName())); } inputs.put(name, reference); }
/** * Adds an external input to this container. * @param reference the external input reference */
Adds an external input to this container
addInput
{ "repo_name": "akirakw/asakusafw-compiler", "path": "compiler-project/api/src/main/java/com/asakusafw/lang/compiler/api/basic/ExternalPortContainer.java", "license": "apache-2.0", "size": 3945 }
[ "java.text.MessageFormat" ]
import java.text.MessageFormat;
import java.text.*;
[ "java.text" ]
java.text;
2,487,745
UserNamespaceAuthorization updateUserNamespaceAuthorization(UserNamespaceAuthorizationKey key, UserNamespaceAuthorizationUpdateRequest request);
UserNamespaceAuthorization updateUserNamespaceAuthorization(UserNamespaceAuthorizationKey key, UserNamespaceAuthorizationUpdateRequest request);
/** * Updates an existing user namespace authorization by key. * * @param key the user namespace authorization key * @param request the information needed to update the user namespace authorization * * @return the updated user namespace authorization */
Updates an existing user namespace authorization by key
updateUserNamespaceAuthorization
{ "repo_name": "FINRAOS/herd", "path": "herd-code/herd-service/src/main/java/org/finra/herd/service/UserNamespaceAuthorizationService.java", "license": "apache-2.0", "size": 3366 }
[ "org.finra.herd.model.api.xml.UserNamespaceAuthorization", "org.finra.herd.model.api.xml.UserNamespaceAuthorizationKey", "org.finra.herd.model.api.xml.UserNamespaceAuthorizationUpdateRequest" ]
import org.finra.herd.model.api.xml.UserNamespaceAuthorization; import org.finra.herd.model.api.xml.UserNamespaceAuthorizationKey; import org.finra.herd.model.api.xml.UserNamespaceAuthorizationUpdateRequest;
import org.finra.herd.model.api.xml.*;
[ "org.finra.herd" ]
org.finra.herd;
439,745
try (FileInputStream fis = new FileInputStream(TEST_FILE)) { StreamSource streamSource = new StreamSource(fis); assertNotNull(SAXSource.sourceToInputSource(streamSource)); } }
try (FileInputStream fis = new FileInputStream(TEST_FILE)) { StreamSource streamSource = new StreamSource(fis); assertNotNull(SAXSource.sourceToInputSource(streamSource)); } }
/** * Test obtaining a SAX InputSource object from a Source object. * * @throws IOException reading file error. */
Test obtaining a SAX InputSource object from a Source object
source2inputsource01
{ "repo_name": "FauxFaux/jdk9-jaxp", "path": "test/javax/xml/jaxp/functional/javax/xml/transform/ptests/SAXSourceTest.java", "license": "gpl-2.0", "size": 3849 }
[ "java.io.FileInputStream", "javax.xml.transform.sax.SAXSource", "javax.xml.transform.stream.StreamSource", "org.testng.Assert" ]
import java.io.FileInputStream; import javax.xml.transform.sax.SAXSource; import javax.xml.transform.stream.StreamSource; import org.testng.Assert;
import java.io.*; import javax.xml.transform.sax.*; import javax.xml.transform.stream.*; import org.testng.*;
[ "java.io", "javax.xml", "org.testng" ]
java.io; javax.xml; org.testng;
2,149,581
public void checkClientTrusted(X509Certificate[] chain, String authType) { }
void function(X509Certificate[] chain, String authType) { }
/** * Always trust for client SSL chain peer certificate chain with any * authType authentication types. * * @param chain * the peer certificate chain. * @param authType * the authentication type based on the client certificate. */
Always trust for client SSL chain peer certificate chain with any authType authentication types
checkClientTrusted
{ "repo_name": "groboclown/p4ic4idea", "path": "p4java/src/main/java/com/perforce/p4java/impl/mapbased/rpc/stream/RpcSSLSocketFactory.java", "license": "apache-2.0", "size": 7718 }
[ "java.security.cert.X509Certificate" ]
import java.security.cert.X509Certificate;
import java.security.cert.*;
[ "java.security" ]
java.security;
1,317,178
private static void addRestItems(List<ReportBean> reportBeansFlat, List<ReportBean> reportBeansFirstLevel) { // check all items from the hashtable for (Iterator<ReportBean> iterator = reportBeansFlat.iterator(); iterator.hasNext();) { ReportBean reportBean = iterator.next(); if (!reportBean.isInReportList()) { // item has no parents in the hastable -> add it reportBeansFirstLevel.add(reportBean); reportBean.setInReportList(true); // mark as added reportBean.setLevel(0); // in level 0 reportBean.setHasSons(false); iterator.remove(); LOGGER.debug("Build tree: add item " + reportBean.getWorkItemBean().getObjectID() + " to level 0 (rest)"); } } }
static void function(List<ReportBean> reportBeansFlat, List<ReportBean> reportBeansFirstLevel) { for (Iterator<ReportBean> iterator = reportBeansFlat.iterator(); iterator.hasNext();) { ReportBean reportBean = iterator.next(); if (!reportBean.isInReportList()) { reportBeansFirstLevel.add(reportBean); reportBean.setInReportList(true); reportBean.setLevel(0); reportBean.setHasSons(false); iterator.remove(); LOGGER.debug(STR + reportBean.getWorkItemBean().getObjectID() + STR); } } }
/** * Add all currently not added items as flat items * They are in the hierarchy lower as the maximal allowed level * or they have circular dependences in which case * the lowest level should be limited to avoid infinite circles */
Add all currently not added items as flat items They are in the hierarchy lower as the maximal allowed level or they have circular dependences in which case the lowest level should be limited to avoid infinite circles
addRestItems
{ "repo_name": "trackplus/Genji", "path": "src/main/java/com/aurel/track/report/execute/ReportBeansBL.java", "license": "gpl-3.0", "size": 17140 }
[ "java.util.Iterator", "java.util.List" ]
import java.util.Iterator; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
44,025
@SuppressForbidden(reason = "proper use of URL, hack around a JDK bug") static FileSystem getFileSystem() throws IOException { // REST suite handling is currently complicated, with lots of filtering and so on // For now, to work embedded in a jar, return a ZipFileSystem over the jar contents. URL codeLocation = FileUtils.class.getProtectionDomain().getCodeSource().getLocation(); boolean loadPackaged = RandomizedTest.systemPropertyAsBoolean(REST_LOAD_PACKAGED_TESTS, true); if (codeLocation.getFile().endsWith(".jar") && loadPackaged) { try { // hack around a bug in the zipfilesystem implementation before java 9, // its checkWritable was incorrect and it won't work without write permissions. // if we add the permission, it will open jars r/w, which is too scary! so copy to a safe r-w location. Path tmp = Files.createTempFile(null, ".jar"); try (InputStream in = codeLocation.openStream()) { Files.copy(in, tmp, StandardCopyOption.REPLACE_EXISTING); } return FileSystems.newFileSystem(new URI("jar:" + tmp.toUri()), Collections.<String,Object>emptyMap()); } catch (URISyntaxException e) { throw new IOException("couldn't open zipfilesystem: ", e); } } else { return null; } }
@SuppressForbidden(reason = STR) static FileSystem getFileSystem() throws IOException { URL codeLocation = FileUtils.class.getProtectionDomain().getCodeSource().getLocation(); boolean loadPackaged = RandomizedTest.systemPropertyAsBoolean(REST_LOAD_PACKAGED_TESTS, true); if (codeLocation.getFile().endsWith(".jar") && loadPackaged) { try { Path tmp = Files.createTempFile(null, ".jar"); try (InputStream in = codeLocation.openStream()) { Files.copy(in, tmp, StandardCopyOption.REPLACE_EXISTING); } return FileSystems.newFileSystem(new URI("jar:" + tmp.toUri()), Collections.<String,Object>emptyMap()); } catch (URISyntaxException e) { throw new IOException(STR, e); } } else { return null; } }
/** * Returns a new FileSystem to read REST resources, or null if they * are available from classpath. */
Returns a new FileSystem to read REST resources, or null if they are available from classpath
getFileSystem
{ "repo_name": "PhaedrusTheGreek/elasticsearch", "path": "test-framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java", "license": "apache-2.0", "size": 16888 }
[ "com.carrotsearch.randomizedtesting.RandomizedTest", "java.io.IOException", "java.io.InputStream", "java.net.URISyntaxException", "java.nio.file.FileSystem", "java.nio.file.FileSystems", "java.nio.file.Files", "java.nio.file.Path", "java.nio.file.StandardCopyOption", "java.util.Collections", "org.elasticsearch.common.SuppressForbidden", "org.elasticsearch.test.rest.support.FileUtils" ]
import com.carrotsearch.randomizedtesting.RandomizedTest; import java.io.IOException; import java.io.InputStream; import java.net.URISyntaxException; import java.nio.file.FileSystem; import java.nio.file.FileSystems; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; import java.util.Collections; import org.elasticsearch.common.SuppressForbidden; import org.elasticsearch.test.rest.support.FileUtils;
import com.carrotsearch.randomizedtesting.*; import java.io.*; import java.net.*; import java.nio.file.*; import java.util.*; import org.elasticsearch.common.*; import org.elasticsearch.test.rest.support.*;
[ "com.carrotsearch.randomizedtesting", "java.io", "java.net", "java.nio", "java.util", "org.elasticsearch.common", "org.elasticsearch.test" ]
com.carrotsearch.randomizedtesting; java.io; java.net; java.nio; java.util; org.elasticsearch.common; org.elasticsearch.test;
1,444,405
private boolean changeMapSource(@NonNull final MapSource newSource) { final MapSource oldSource = Settings.getMapSource(); final boolean restartRequired = oldSource == null || !MapProviderFactory.isSameActivity(oldSource, newSource); Settings.setMapSource(newSource); currentSourceId = newSource.getNumericalId(); if (restartRequired) { mapRestart(); } else if (mapView != null) { // changeMapSource can be called by onCreate() mapOptions.mapState = currentMapState(); mapView.setMapSource(); // re-center the map centered = false; centerMap(mapOptions.geocode, mapOptions.searchResult, mapOptions.coords, mapOptions.mapState); // re-build menues ActivityMixin.invalidateOptionsMenu(activity); } mapSource = newSource; final int mapAttributionViewId = mapSource.getMapProvider().getMapAttributionViewId(); if (mapAttributionViewId > 0) { final View mapAttributionView = activity.findViewById(mapAttributionViewId); if (mapAttributionView != null) { mapAttributionView.setOnClickListener( new NewMap.MapAttributionDisplayHandler(() -> this.mapSource.calculateMapAttribution(mapAttributionView.getContext()))); } } return restartRequired; }
boolean function(@NonNull final MapSource newSource) { final MapSource oldSource = Settings.getMapSource(); final boolean restartRequired = oldSource == null !MapProviderFactory.isSameActivity(oldSource, newSource); Settings.setMapSource(newSource); currentSourceId = newSource.getNumericalId(); if (restartRequired) { mapRestart(); } else if (mapView != null) { mapOptions.mapState = currentMapState(); mapView.setMapSource(); centered = false; centerMap(mapOptions.geocode, mapOptions.searchResult, mapOptions.coords, mapOptions.mapState); ActivityMixin.invalidateOptionsMenu(activity); } mapSource = newSource; final int mapAttributionViewId = mapSource.getMapProvider().getMapAttributionViewId(); if (mapAttributionViewId > 0) { final View mapAttributionView = activity.findViewById(mapAttributionViewId); if (mapAttributionView != null) { mapAttributionView.setOnClickListener( new NewMap.MapAttributionDisplayHandler(() -> this.mapSource.calculateMapAttribution(mapAttributionView.getContext()))); } } return restartRequired; }
/** * Restart the current activity if the map provider has changed, or change the map source if needed. * * @param newSource the new map source, which can be the same as the current one * @return true if a restart is needed, false otherwise */
Restart the current activity if the map provider has changed, or change the map source if needed
changeMapSource
{ "repo_name": "S-Bartfast/cgeo", "path": "main/src/cgeo/geocaching/maps/CGeoMap.java", "license": "apache-2.0", "size": 74633 }
[ "android.view.View", "androidx.annotation.NonNull" ]
import android.view.View; import androidx.annotation.NonNull;
import android.view.*; import androidx.annotation.*;
[ "android.view", "androidx.annotation" ]
android.view; androidx.annotation;
1,668,987
public static HashMap<String, String> getPossibleConfig() { HashMap<String, String> possibleConfig = new HashMap<String, String>(); possibleConfig.put("NTP_SERVER", ""); possibleConfig.put("XTRA_SERVER_1", ""); possibleConfig.put("XTRA_SERVER_2", ""); possibleConfig.put("XTRA_SERVER_3", ""); possibleConfig.put("XTRA_SERVER_4", ""); possibleConfig.put("XTRA_SERVER_5", ""); possibleConfig.put("DEBUG_LEVEL", ""); possibleConfig.put("INTERMEDIATE_POS", ""); possibleConfig.put("ACCURACY_THRES", ""); possibleConfig.put("REPORT_POSITION_USE_SUPL_REFLOC", ""); possibleConfig.put("ENABLE_WIPER", ""); possibleConfig.put("SUPL_HOST", ""); possibleConfig.put("SUPL_PORT", ""); possibleConfig.put("SUPL_NO_SECURE_PORT", ""); possibleConfig.put("SUPL_SECURE_PORT", ""); possibleConfig.put("C2K_HOST", ""); possibleConfig.put("C2K_PORT", ""); possibleConfig.put("CURRENT_CARRIER", ""); possibleConfig.put("DEFAULT_AGPS_ENABLE", ""); possibleConfig.put("DEFAULT_SSL_ENABLE", ""); possibleConfig.put("DEFAULT_USER_PLANE", ""); return possibleConfig; }
static HashMap<String, String> function() { HashMap<String, String> possibleConfig = new HashMap<String, String>(); possibleConfig.put(STR, STRXTRA_SERVER_1", STRXTRA_SERVER_2", STRXTRA_SERVER_3", STRXTRA_SERVER_4", STRXTRA_SERVER_5", STRDEBUG_LEVEL", STRINTERMEDIATE_POS", STRACCURACY_THRES", STRREPORT_POSITION_USE_SUPL_REFLOC", STRENABLE_WIPER", STRSUPL_HOST", STRSUPL_PORT", STRSUPL_NO_SECURE_PORT", STRSUPL_SECURE_PORT", STRC2K_HOST", STRC2K_PORT", STRCURRENT_CARRIER", STRDEFAULT_AGPS_ENABLE", STRDEFAULT_SSL_ENABLE", STRDEFAULT_USER_PLANESTR"); return possibleConfig; }
/** * Returns HashMap with possible keys seen in many gps.conf files * * @return possible keys as HashMap */
Returns HashMap with possible keys seen in many gps.conf files
getPossibleConfig
{ "repo_name": "aceqott/HCTControl", "path": "app/src/main/java/com/hctrom/romcontrol/fastergps/util/Utils.java", "license": "apache-2.0", "size": 15134 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
617,853
public List<LogPickupSchedule> queryByRange(String jpqlStmt, int firstResult, int maxResults);
List<LogPickupSchedule> function(String jpqlStmt, int firstResult, int maxResults);
/** * queryByRange - allows querying by range/block * * @param jpqlStmt * @param firstResult * @param maxResults * @return a list of LogPickupSchedule */
queryByRange - allows querying by range/block
queryByRange
{ "repo_name": "yauritux/venice-legacy", "path": "Venice/Venice-Interface-Model/src/main/java/com/gdn/venice/facade/LogPickupScheduleSessionEJBRemote.java", "license": "apache-2.0", "size": 2718 }
[ "com.gdn.venice.persistence.LogPickupSchedule", "java.util.List" ]
import com.gdn.venice.persistence.LogPickupSchedule; import java.util.List;
import com.gdn.venice.persistence.*; import java.util.*;
[ "com.gdn.venice", "java.util" ]
com.gdn.venice; java.util;
2,163,496
public final void setHeight(int cooked) throws AccessPoemException, ValidationPoemException { setHeight(new Integer(cooked)); }
final void function(int cooked) throws AccessPoemException, ValidationPoemException { setHeight(new Integer(cooked)); }
/** * Sets the <code>Height</code> value, with checking, for this * <code>ValueInfo</code> <code>Persistent</code>. * Field description: * A sensible height for text boxes used for entering the field, where * appropriate * * * Generated by org.melati.poem.prepro.IntegerFieldDef#generateBaseMethods * @param cooked a validated <code>int</code> * @throws AccessPoemException * if the current <code>AccessToken</code> * does not confer write access rights * @throws ValidationPoemException * if the value is not valid */
Sets the <code>Height</code> value, with checking, for this <code>ValueInfo</code> <code>Persistent</code>. Field description: A sensible height for text boxes used for entering the field, where appropriate Generated by org.melati.poem.prepro.IntegerFieldDef#generateBaseMethods
setHeight
{ "repo_name": "timp21337/melati-old", "path": "poem/src/main/java/org/melati/poem/generated/ValueInfoBase.java", "license": "gpl-2.0", "size": 44733 }
[ "org.melati.poem.AccessPoemException", "org.melati.poem.ValidationPoemException" ]
import org.melati.poem.AccessPoemException; import org.melati.poem.ValidationPoemException;
import org.melati.poem.*;
[ "org.melati.poem" ]
org.melati.poem;
2,017,054
public Principal principal() { if (_subject == null) return null; Set<Principal> princs = _subject.getPrincipals(); if (princs.size()==0) return null; return (Principal) (princs.toArray()[0]); }
Principal function() { if (_subject == null) return null; Set<Principal> princs = _subject.getPrincipals(); if (princs.size()==0) return null; return (Principal) (princs.toArray()[0]); }
/** * The primary principal associated current subject */
The primary principal associated current subject
principal
{ "repo_name": "pho-coder/magpie", "path": "magpie-client/magpie-client-java/src/main/java/com/jd/bdp/magpie/auth/ReqContext.java", "license": "epl-1.0", "size": 2453 }
[ "java.security.Principal", "java.util.Set" ]
import java.security.Principal; import java.util.Set;
import java.security.*; import java.util.*;
[ "java.security", "java.util" ]
java.security; java.util;
1,467,505
private Result pVariableLength(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk3) yyColumn.chunk3 = new Chunk3(); if (null == yyColumn.chunk3.fVariableLength) yyColumn.chunk3.fVariableLength = pVariableLength$1(yyStart); return yyColumn.chunk3.fVariableLength; }
Result function(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk3) yyColumn.chunk3 = new Chunk3(); if (null == yyColumn.chunk3.fVariableLength) yyColumn.chunk3.fVariableLength = pVariableLength$1(yyStart); return yyColumn.chunk3.fVariableLength; }
/** * Parse nonterminal xtc.lang.jeannie.JeannieC.VariableLength. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */
Parse nonterminal xtc.lang.jeannie.JeannieC.VariableLength
pVariableLength
{ "repo_name": "wandoulabs/xtc-rats", "path": "xtc-core/src/main/java/xtc/lang/jeannie/JeannieParser.java", "license": "lgpl-2.1", "size": 647687 }
[ "java.io.IOException", "xtc.parser.Result" ]
import java.io.IOException; import xtc.parser.Result;
import java.io.*; import xtc.parser.*;
[ "java.io", "xtc.parser" ]
java.io; xtc.parser;
2,001,436
private void confirmExit() { String msg = "Are You Sure You Want to Exit the Game?" ; int result = JOptionPane.showConfirmDialog(this, msg, "Alert", JOptionPane.OK_CANCEL_OPTION); if(result==0){ System.exit(0); dispose(); } }
void function() { String msg = STR ; int result = JOptionPane.showConfirmDialog(this, msg, "Alert", JOptionPane.OK_CANCEL_OPTION); if(result==0){ System.exit(0); dispose(); } }
/** * Displays dialog asking if user wants to exit the game */
Displays dialog asking if user wants to exit the game
confirmExit
{ "repo_name": "patevs/SWEN222-cluedo-gui", "path": "src/cluedo/control/CluedoFrame.java", "license": "mit", "size": 21851 }
[ "javax.swing.JOptionPane" ]
import javax.swing.JOptionPane;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
2,679,253
private void cloneEquipmentExpenses(Company cloneCompany, Project cloneProj, Project originalProj, Map<Long, Staff> oldIdToNewStaff) { String pattern = EquipmentExpense.constructPattern(originalProj); Set<String> keys = this.equipmentExpenseValueRepo.keys(pattern); List<EquipmentExpense> originalEquipExps = this.equipmentExpenseValueRepo.multiGet(keys); for (EquipmentExpense originalEquipExp : originalEquipExps) { Staff newStaff = oldIdToNewStaff.get(originalEquipExp.getStaff().getId()); EquipmentExpense cloneEquipExp = originalEquipExp.clone(); cloneEquipExp.setUuid(UUID.randomUUID()); cloneEquipExp.setProject(cloneProj); cloneEquipExp.setCompany(cloneCompany); cloneEquipExp.setStaff(newStaff); this.equipmentExpenseValueRepo.set(cloneEquipExp); } }
void function(Company cloneCompany, Project cloneProj, Project originalProj, Map<Long, Staff> oldIdToNewStaff) { String pattern = EquipmentExpense.constructPattern(originalProj); Set<String> keys = this.equipmentExpenseValueRepo.keys(pattern); List<EquipmentExpense> originalEquipExps = this.equipmentExpenseValueRepo.multiGet(keys); for (EquipmentExpense originalEquipExp : originalEquipExps) { Staff newStaff = oldIdToNewStaff.get(originalEquipExp.getStaff().getId()); EquipmentExpense cloneEquipExp = originalEquipExp.clone(); cloneEquipExp.setUuid(UUID.randomUUID()); cloneEquipExp.setProject(cloneProj); cloneEquipExp.setCompany(cloneCompany); cloneEquipExp.setStaff(newStaff); this.equipmentExpenseValueRepo.set(cloneEquipExp); } }
/** * Clone equipment expenses. * * @param cloneCompany * @param cloneProj * @param originalProj * @param oldIdToNewStaff */
Clone equipment expenses
cloneEquipmentExpenses
{ "repo_name": "VicCebedo/PracticeRepo", "path": "mod-webapp-codebase/src/main/java/com/cebedo/pmsys/service/impl/CompanyServiceImpl.java", "license": "apache-2.0", "size": 37726 }
[ "com.cebedo.pmsys.domain.EquipmentExpense", "com.cebedo.pmsys.model.Company", "com.cebedo.pmsys.model.Project", "com.cebedo.pmsys.model.Staff", "java.util.List", "java.util.Map", "java.util.Set", "java.util.UUID" ]
import com.cebedo.pmsys.domain.EquipmentExpense; import com.cebedo.pmsys.model.Company; import com.cebedo.pmsys.model.Project; import com.cebedo.pmsys.model.Staff; import java.util.List; import java.util.Map; import java.util.Set; import java.util.UUID;
import com.cebedo.pmsys.domain.*; import com.cebedo.pmsys.model.*; import java.util.*;
[ "com.cebedo.pmsys", "java.util" ]
com.cebedo.pmsys; java.util;
567,239
public void init(IWorkbench workbench, IStructuredSelection selection) { this.workbench = workbench; this.selection = selection; setWindowTitle(East_adlEditorPlugin.INSTANCE.getString("_UI_Wizard_label")); setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(East_adlEditorPlugin.INSTANCE.getImage("full/wizban/NewVariant_handling"))); }
void function(IWorkbench workbench, IStructuredSelection selection) { this.workbench = workbench; this.selection = selection; setWindowTitle(East_adlEditorPlugin.INSTANCE.getString(STR)); setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(East_adlEditorPlugin.INSTANCE.getImage(STR))); }
/** * This just records the information. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This just records the information.
init
{ "repo_name": "ObeoNetwork/EAST-ADL-Designer", "path": "plugins/org.obeonetwork.dsl.eastadl.editor/src/org/obeonetwork/dsl/east_adl/variant_handling/presentation/Variant_handlingModelWizard.java", "license": "epl-1.0", "size": 18193 }
[ "org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry", "org.eclipse.jface.viewers.IStructuredSelection", "org.eclipse.ui.IWorkbench" ]
import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.ui.IWorkbench;
import org.eclipse.emf.edit.ui.provider.*; import org.eclipse.jface.viewers.*; import org.eclipse.ui.*;
[ "org.eclipse.emf", "org.eclipse.jface", "org.eclipse.ui" ]
org.eclipse.emf; org.eclipse.jface; org.eclipse.ui;
145,730
public boolean isEqual(Heaper other) { return (other instanceof EmptyMapping); }
boolean function(Heaper other) { return (other instanceof EmptyMapping); }
/** * This, and the CompositeMapping version, don't check CoordinateSpaces. Should they? */
This, and the CompositeMapping version, don't check CoordinateSpaces. Should they
isEqual
{ "repo_name": "jonesd/abora-white", "path": "src/main/java/info/dgjones/abora/white/spaces/EmptyMapping.java", "license": "mit", "size": 10225 }
[ "info.dgjones.abora.white.xpp.basic.Heaper" ]
import info.dgjones.abora.white.xpp.basic.Heaper;
import info.dgjones.abora.white.xpp.basic.*;
[ "info.dgjones.abora" ]
info.dgjones.abora;
2,819,759
@Deprecated @GwtIncompatible // com.google.common.math.DoubleUtils public static double mean(Iterable<? extends Number> values) { return mean(values.iterator()); }
@GwtIncompatible static double function(Iterable<? extends Number> values) { return mean(values.iterator()); }
/** * Returns the <a href="http://en.wikipedia.org/wiki/Arithmetic_mean">arithmetic mean</a> of * {@code values}. * * <p>If these values are a sample drawn from a population, this is also an unbiased estimator of * the arithmetic mean of the population. * * @param values a nonempty series of values, which will be converted to {@code double} values * (this may cause loss of precision) * @throws IllegalArgumentException if {@code values} is empty or contains any non-finite value * @deprecated Use {@link Stats#meanOf} instead, noting the less strict handling of non-finite * values. This method will be removed in February 2018. */
Returns the arithmetic mean of values. If these values are a sample drawn from a population, this is also an unbiased estimator of the arithmetic mean of the population
mean
{ "repo_name": "aiyanbo/guava", "path": "guava/src/com/google/common/math/DoubleMath.java", "license": "apache-2.0", "size": 19257 }
[ "com.google.common.annotations.GwtIncompatible" ]
import com.google.common.annotations.GwtIncompatible;
import com.google.common.annotations.*;
[ "com.google.common" ]
com.google.common;
1,205,217
private void createISICModel(String version, boolean withNotes) throws Exception { logger.debug("Construction of the Jena model for ISIC version " + version); logger.debug("Preparing to read the divisions to sections mapping from table " + ISIC_STRUCTURE_ACCESS_TABLE.get(version) + " in database " + INPUT_FOLDER + ISIC_ACCESS_FILE.get(version)); try { Table table = DatabaseBuilder.open(new File(INPUT_FOLDER + ISIC_ACCESS_FILE.get(version))).getTable(ISIC_STRUCTURE_ACCESS_TABLE.get(version)); Cursor cursor = CursorBuilder.createCursor(table); for (Row row : cursor.newIterable().addMatchPattern("CodeLevel", 2)) divisionsToSections.put(row.getString("Level2"), row.getString("Level1")); } catch (IOException e) { logger.fatal("Error reading the database", e); return; } // Init the Jena model for the given version of the classification initModel(version); // Open a cursor on the main table and iterate through all the records Table table = DatabaseBuilder.open(new File(INPUT_FOLDER + ISIC_ACCESS_FILE.get(version))).getTable(ISIC_ACCESS_TABLE.get(version)); Cursor cursor = CursorBuilder.createCursor(table); logger.debug("Cursor defined on table " + ISIC_ACCESS_TABLE.get(version)); for (Row row : cursor.newIterable()) { String itemCode = row.getString("Code"); Resource itemResource = isicModel.createResource(Names.getItemURI(itemCode, "ISIC", version), SKOS.Concept); itemResource.addProperty(SKOS.notation, isicModel.createLiteral(itemCode)); itemResource.addProperty(SKOS.prefLabel, isicModel.createLiteral(row.getString("Description"), "en")); // Add explanatory notes if requested if (withNotes) { String note = row.getString("ExplanatoryNoteInclusion"); if ((note != null) && (note.length() > 0)) itemResource.addProperty(XKOS.inclusionNote, isicModel.createLiteral(note, "en")); note = row.getString("ExplanatoryNoteExclusion"); if ((note != null) && (note.length() > 0)) itemResource.addProperty(XKOS.exclusionNote, isicModel.createLiteral(note, "en")); } // Create the SKOS hierarchical properties for the item itemResource.addProperty(SKOS.inScheme, scheme); String parentCode = getParentCode(itemCode); if (parentCode == null) { scheme.addProperty(SKOS.hasTopConcept, itemResource); itemResource.addProperty(SKOS.topConceptOf, scheme); } else { Resource parentResource = isicModel.createResource(Names.getItemURI(parentCode, "ISIC", version), SKOS.Concept); parentResource.addProperty(SKOS.narrower, itemResource); itemResource.addProperty(SKOS.broader, parentResource); } // Add the item as a member of its level Resource level = levels.get(itemCode.length() - 1); level.addProperty(SKOS.member, itemResource); } logger.debug("Finished reading table " + ISIC_ACCESS_TABLE.get(version)); // Addition of French and Spanish labels if (ISIC_FRENCH_LABELS_FILE.get(version) != null) this.addLabels(INPUT_FOLDER + ISIC_FRENCH_LABELS_FILE.get(version), version, "fr"); if (ISIC_SPANISH_LABELS_FILE.get(version) != null) this.addLabels(INPUT_FOLDER + ISIC_SPANISH_LABELS_FILE.get(version), version, "es"); // Write the Turtle file and clear the model String turtleFileName = OUTPUT_FOLDER + Names.getCSContext("ISIC", version) + ".ttl"; isicModel.write(new FileOutputStream(turtleFileName), "TTL"); logger.info("The Jena model for ISIC Rev." + version + " has been written to " + turtleFileName); isicModel.close(); }
void function(String version, boolean withNotes) throws Exception { logger.debug(STR + version); logger.debug(STR + ISIC_STRUCTURE_ACCESS_TABLE.get(version) + STR + INPUT_FOLDER + ISIC_ACCESS_FILE.get(version)); try { Table table = DatabaseBuilder.open(new File(INPUT_FOLDER + ISIC_ACCESS_FILE.get(version))).getTable(ISIC_STRUCTURE_ACCESS_TABLE.get(version)); Cursor cursor = CursorBuilder.createCursor(table); for (Row row : cursor.newIterable().addMatchPattern(STR, 2)) divisionsToSections.put(row.getString(STR), row.getString(STR)); } catch (IOException e) { logger.fatal(STR, e); return; } initModel(version); Table table = DatabaseBuilder.open(new File(INPUT_FOLDER + ISIC_ACCESS_FILE.get(version))).getTable(ISIC_ACCESS_TABLE.get(version)); Cursor cursor = CursorBuilder.createCursor(table); logger.debug(STR + ISIC_ACCESS_TABLE.get(version)); for (Row row : cursor.newIterable()) { String itemCode = row.getString("Code"); Resource itemResource = isicModel.createResource(Names.getItemURI(itemCode, "ISIC", version), SKOS.Concept); itemResource.addProperty(SKOS.notation, isicModel.createLiteral(itemCode)); itemResource.addProperty(SKOS.prefLabel, isicModel.createLiteral(row.getString(STR), "en")); if (withNotes) { String note = row.getString(STR); if ((note != null) && (note.length() > 0)) itemResource.addProperty(XKOS.inclusionNote, isicModel.createLiteral(note, "en")); note = row.getString(STR); if ((note != null) && (note.length() > 0)) itemResource.addProperty(XKOS.exclusionNote, isicModel.createLiteral(note, "en")); } itemResource.addProperty(SKOS.inScheme, scheme); String parentCode = getParentCode(itemCode); if (parentCode == null) { scheme.addProperty(SKOS.hasTopConcept, itemResource); itemResource.addProperty(SKOS.topConceptOf, scheme); } else { Resource parentResource = isicModel.createResource(Names.getItemURI(parentCode, "ISIC", version), SKOS.Concept); parentResource.addProperty(SKOS.narrower, itemResource); itemResource.addProperty(SKOS.broader, parentResource); } Resource level = levels.get(itemCode.length() - 1); level.addProperty(SKOS.member, itemResource); } logger.debug(STR + ISIC_ACCESS_TABLE.get(version)); if (ISIC_FRENCH_LABELS_FILE.get(version) != null) this.addLabels(INPUT_FOLDER + ISIC_FRENCH_LABELS_FILE.get(version), version, "fr"); if (ISIC_SPANISH_LABELS_FILE.get(version) != null) this.addLabels(INPUT_FOLDER + ISIC_SPANISH_LABELS_FILE.get(version), version, "es"); String turtleFileName = OUTPUT_FOLDER + Names.getCSContext("ISIC", version) + ".ttl"; isicModel.write(new FileOutputStream(turtleFileName), "TTL"); logger.info(STR + version + STR + turtleFileName); isicModel.close(); }
/** * Creates an Jena model corresponding to a version of ISIC and saves it to a Turtle file. * * @param version Version of the classification ("3.1", "4"). * @param withNotes Boolean indicating if the explanatory notes must be produced in the model. * @throws Exception In case of problem getting the data or creating the file. */
Creates an Jena model corresponding to a version of ISIC and saves it to a Turtle file
createISICModel
{ "repo_name": "FranckCo/Stamina", "path": "src/main/java/fr/insee/stamina/unsd/ISICModelMaker.java", "license": "mit", "size": 16957 }
[ "com.healthmarketscience.jackcess.Cursor", "com.healthmarketscience.jackcess.CursorBuilder", "com.healthmarketscience.jackcess.DatabaseBuilder", "com.healthmarketscience.jackcess.Row", "com.healthmarketscience.jackcess.Table", "fr.insee.stamina.utils.Names", "java.io.File", "java.io.FileOutputStream", "java.io.IOException", "org.apache.jena.rdf.model.Resource" ]
import com.healthmarketscience.jackcess.Cursor; import com.healthmarketscience.jackcess.CursorBuilder; import com.healthmarketscience.jackcess.DatabaseBuilder; import com.healthmarketscience.jackcess.Row; import com.healthmarketscience.jackcess.Table; import fr.insee.stamina.utils.Names; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import org.apache.jena.rdf.model.Resource;
import com.healthmarketscience.jackcess.*; import fr.insee.stamina.utils.*; import java.io.*; import org.apache.jena.rdf.model.*;
[ "com.healthmarketscience.jackcess", "fr.insee.stamina", "java.io", "org.apache.jena" ]
com.healthmarketscience.jackcess; fr.insee.stamina; java.io; org.apache.jena;
363,909
public void enableBottomToolbar() { if (TabUiFeatureUtilities.isDuetTabStripIntegrationAndroidEnabled() && BottomToolbarConfiguration.isBottomToolbarEnabled()) { mTabGroupPopUiParentSupplier = new ObservableSupplierImpl<>(); mTabGroupPopupUi = TabManagementModuleProvider.getDelegate().createTabGroupPopUi( mAppThemeColorProvider, mTabGroupPopUiParentSupplier); } mBottomControlsCoordinator = new BottomControlsCoordinator(mFullscreenManager, mActivity.findViewById(R.id.bottom_controls_stub), mActivityTabProvider, mTabGroupPopupUi != null ? mTabGroupPopupUi.getLongClickListenerForTriggering() : BottomTabSwitcherActionMenuCoordinator.createOnLongClickListener( id -> mActivity.onOptionsItemSelected(id, null)), mAppThemeColorProvider, mShareDelegateSupplier, mShowStartSurfaceSupplier, mToolbarTabController::openHomepage, (reason) -> setUrlBarFocus(true, reason)); boolean isBottomToolbarVisible = BottomToolbarConfiguration.isBottomToolbarEnabled() && (!BottomToolbarConfiguration.isAdaptiveToolbarEnabled() || mActivity.getResources().getConfiguration().orientation != Configuration.ORIENTATION_LANDSCAPE); setBottomToolbarVisible(isBottomToolbarVisible); }
void function() { if (TabUiFeatureUtilities.isDuetTabStripIntegrationAndroidEnabled() && BottomToolbarConfiguration.isBottomToolbarEnabled()) { mTabGroupPopUiParentSupplier = new ObservableSupplierImpl<>(); mTabGroupPopupUi = TabManagementModuleProvider.getDelegate().createTabGroupPopUi( mAppThemeColorProvider, mTabGroupPopUiParentSupplier); } mBottomControlsCoordinator = new BottomControlsCoordinator(mFullscreenManager, mActivity.findViewById(R.id.bottom_controls_stub), mActivityTabProvider, mTabGroupPopupUi != null ? mTabGroupPopupUi.getLongClickListenerForTriggering() : BottomTabSwitcherActionMenuCoordinator.createOnLongClickListener( id -> mActivity.onOptionsItemSelected(id, null)), mAppThemeColorProvider, mShareDelegateSupplier, mShowStartSurfaceSupplier, mToolbarTabController::openHomepage, (reason) -> setUrlBarFocus(true, reason)); boolean isBottomToolbarVisible = BottomToolbarConfiguration.isBottomToolbarEnabled() && (!BottomToolbarConfiguration.isAdaptiveToolbarEnabled() mActivity.getResources().getConfiguration().orientation != Configuration.ORIENTATION_LANDSCAPE); setBottomToolbarVisible(isBottomToolbarVisible); }
/** * Enable the bottom toolbar. */
Enable the bottom toolbar
enableBottomToolbar
{ "repo_name": "endlessm/chromium-browser", "path": "chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java", "license": "bsd-3-clause", "size": 71970 }
[ "android.content.res.Configuration", "org.chromium.base.supplier.ObservableSupplierImpl", "org.chromium.chrome.browser.tasks.tab_management.TabManagementModuleProvider", "org.chromium.chrome.browser.tasks.tab_management.TabUiFeatureUtilities", "org.chromium.chrome.browser.toolbar.bottom.BottomControlsCoordinator", "org.chromium.chrome.browser.toolbar.bottom.BottomTabSwitcherActionMenuCoordinator", "org.chromium.chrome.browser.toolbar.bottom.BottomToolbarConfiguration" ]
import android.content.res.Configuration; import org.chromium.base.supplier.ObservableSupplierImpl; import org.chromium.chrome.browser.tasks.tab_management.TabManagementModuleProvider; import org.chromium.chrome.browser.tasks.tab_management.TabUiFeatureUtilities; import org.chromium.chrome.browser.toolbar.bottom.BottomControlsCoordinator; import org.chromium.chrome.browser.toolbar.bottom.BottomTabSwitcherActionMenuCoordinator; import org.chromium.chrome.browser.toolbar.bottom.BottomToolbarConfiguration;
import android.content.res.*; import org.chromium.base.supplier.*; import org.chromium.chrome.browser.tasks.tab_management.*; import org.chromium.chrome.browser.toolbar.bottom.*;
[ "android.content", "org.chromium.base", "org.chromium.chrome" ]
android.content; org.chromium.base; org.chromium.chrome;
1,245,965
@Override public void addPanel(PanelDefinition panel, WorkbenchPanelView<?> view, Position position) { throw new UnsupportedOperationException("This panel does not support child panels"); }
void function(PanelDefinition panel, WorkbenchPanelView<?> view, Position position) { throw new UnsupportedOperationException(STR); }
/** * Throws {@code UnsupportedOperationException} when called. Subclasses that wish to support child panels should * override this and {@link #removePanel(WorkbenchPanelView)}. */
Throws UnsupportedOperationException when called. Subclasses that wish to support child panels should override this and <code>#removePanel(WorkbenchPanelView)</code>
addPanel
{ "repo_name": "karreiro/uberfire", "path": "uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/panels/impl/AbstractWorkbenchPanelView.java", "license": "apache-2.0", "size": 4529 }
[ "org.uberfire.client.workbench.panels.WorkbenchPanelView", "org.uberfire.workbench.model.PanelDefinition", "org.uberfire.workbench.model.Position" ]
import org.uberfire.client.workbench.panels.WorkbenchPanelView; import org.uberfire.workbench.model.PanelDefinition; import org.uberfire.workbench.model.Position;
import org.uberfire.client.workbench.panels.*; import org.uberfire.workbench.model.*;
[ "org.uberfire.client", "org.uberfire.workbench" ]
org.uberfire.client; org.uberfire.workbench;
2,644,877
private void createOtherMenuItem(final Menu menu) { final IFileStore file = getFileResource(); if (file == null) { return; }
void function(final Menu menu) { final IFileStore file = getFileResource(); if (file == null) { return; }
/** * Creates the Other... menu item * * @param menu the menu to add the item to */
Creates the Other... menu item
createOtherMenuItem
{ "repo_name": "HossainKhademian/Studio3", "path": "plugins/com.aptana.ui.io.epl/src/com/aptana/ui/io/epl/OpenWithMenu.java", "license": "gpl-3.0", "size": 13810 }
[ "org.eclipse.core.filesystem.IFileStore", "org.eclipse.swt.widgets.Menu" ]
import org.eclipse.core.filesystem.IFileStore; import org.eclipse.swt.widgets.Menu;
import org.eclipse.core.filesystem.*; import org.eclipse.swt.widgets.*;
[ "org.eclipse.core", "org.eclipse.swt" ]
org.eclipse.core; org.eclipse.swt;
941,641
public ClusterType getClusterType();
ClusterType function();
/** * Returns the type of cluster the connection factory connects to. * * @return The type of cluster the connection factory connects to. */
Returns the type of cluster the connection factory connects to
getClusterType
{ "repo_name": "allanbank/mongodb-async-driver", "path": "src/main/java/com/allanbank/mongodb/client/connection/ConnectionFactory.java", "license": "apache-2.0", "size": 3628 }
[ "com.allanbank.mongodb.client.ClusterType" ]
import com.allanbank.mongodb.client.ClusterType;
import com.allanbank.mongodb.client.*;
[ "com.allanbank.mongodb" ]
com.allanbank.mongodb;
1,657,117
this.listeners.clear(); this.listeners.addAll(listeners); if (trainingMaster != null) trainingMaster.setListeners(this.listeners); } /** * This method allows you to specify IterationListeners for this model. Note that for listeners * like StatsListener (that have state that will be sent somewhere), consider instead using {@link * #setListeners(StatsStorageRouter, Collection)}
this.listeners.clear(); this.listeners.addAll(listeners); if (trainingMaster != null) trainingMaster.setListeners(this.listeners); } /** * This method allows you to specify IterationListeners for this model. Note that for listeners * like StatsListener (that have state that will be sent somewhere), consider instead using { * #setListeners(StatsStorageRouter, Collection)}
/** * This method allows you to specify IterationListeners for this model. * * @param listeners Iteration listeners */
This method allows you to specify IterationListeners for this model
setListeners
{ "repo_name": "shuodata/deeplearning4j", "path": "deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/SparkListenable.java", "license": "apache-2.0", "size": 4647 }
[ "java.util.Collection", "org.deeplearning4j.api.storage.StatsStorageRouter" ]
import java.util.Collection; import org.deeplearning4j.api.storage.StatsStorageRouter;
import java.util.*; import org.deeplearning4j.api.storage.*;
[ "java.util", "org.deeplearning4j.api" ]
java.util; org.deeplearning4j.api;
808,782
public void addSPSDescriptor ( SPSDescriptor descriptor, TransactionController tc ) throws StandardException;
void function ( SPSDescriptor descriptor, TransactionController tc ) throws StandardException;
/** * Adds the given SPSDescriptor to the data dictionary, * associated with the given table and constraint type. * * @param descriptor The descriptor to add * @param tc The transaction controller * * @exception StandardException Thrown on error */
Adds the given SPSDescriptor to the data dictionary, associated with the given table and constraint type
addSPSDescriptor
{ "repo_name": "kavin256/Derby", "path": "java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java", "license": "apache-2.0", "size": 79425 }
[ "org.apache.derby.iapi.error.StandardException", "org.apache.derby.iapi.store.access.TransactionController" ]
import org.apache.derby.iapi.error.StandardException; import org.apache.derby.iapi.store.access.TransactionController;
import org.apache.derby.iapi.error.*; import org.apache.derby.iapi.store.access.*;
[ "org.apache.derby" ]
org.apache.derby;
2,336,103
void updateSubmittablesFromCertificates(ProcessingCertificateEnvelope processingCertificateEnvelope);
void updateSubmittablesFromCertificates(ProcessingCertificateEnvelope processingCertificateEnvelope);
/** * update accessions + statuses using information in a processingCertificateEnvelop * @param processingCertificateEnvelope */
update accessions + statuses using information in a processingCertificateEnvelop
updateSubmittablesFromCertificates
{ "repo_name": "EMBL-EBI-SUBS/subs", "path": "subs-progress-monitor/src/main/java/uk/ac/ebi/subs/progressmonitor/MonitorService.java", "license": "apache-2.0", "size": 735 }
[ "uk.ac.ebi.subs.processing.ProcessingCertificateEnvelope" ]
import uk.ac.ebi.subs.processing.ProcessingCertificateEnvelope;
import uk.ac.ebi.subs.processing.*;
[ "uk.ac.ebi" ]
uk.ac.ebi;
2,364,742
private void hideAdditionalHeaders() { mAdditionalHeadersView.setVisibility(View.GONE); mAdditionalHeadersView.setText(""); } /** * Set up and then show the additional headers view. Called by * {@link #onShowAdditionalHeaders()}
void function() { mAdditionalHeadersView.setVisibility(View.GONE); mAdditionalHeadersView.setText(""); } /** * Set up and then show the additional headers view. Called by * {@link #onShowAdditionalHeaders()}
/** * Clear the text field for the additional headers display if they are * not shown, to save UI resources. */
Clear the text field for the additional headers display if they are not shown, to save UI resources
hideAdditionalHeaders
{ "repo_name": "imaeses/k-9", "path": "src/com/fsck/k9/view/MessageHeader.java", "license": "bsd-3-clause", "size": 16576 }
[ "android.view.View", "java.util.Set" ]
import android.view.View; import java.util.Set;
import android.view.*; import java.util.*;
[ "android.view", "java.util" ]
android.view; java.util;
305,313
public void setBaseNegativeItemLabelPosition(ItemLabelPosition position, boolean notify) { if (position == null) { throw new IllegalArgumentException("Null 'position' argument."); } this.baseNegativeItemLabelPosition = position; if (notify) { fireChangeEvent(); } }
void function(ItemLabelPosition position, boolean notify) { if (position == null) { throw new IllegalArgumentException(STR); } this.baseNegativeItemLabelPosition = position; if (notify) { fireChangeEvent(); } }
/** * Sets the base negative item label position and, if requested, sends a * {@link RendererChangeEvent} to all registered listeners. * * @param position the position (<code>null</code> not permitted). * @param notify notify registered listeners? * * @see #getBaseNegativeItemLabelPosition() */
Sets the base negative item label position and, if requested, sends a <code>RendererChangeEvent</code> to all registered listeners
setBaseNegativeItemLabelPosition
{ "repo_name": "ibestvina/multithread-centiscape", "path": "CentiScaPe2.1/src/main/java/org/jfree/chart/renderer/AbstractRenderer.java", "license": "mit", "size": 126056 }
[ "org.jfree.chart.labels.ItemLabelPosition" ]
import org.jfree.chart.labels.ItemLabelPosition;
import org.jfree.chart.labels.*;
[ "org.jfree.chart" ]
org.jfree.chart;
1,564,993
EClass getDynamicDemand();
EClass getDynamicDemand();
/** * Returns the meta object for class '{@link CIM.IEC61968.Metering.DynamicDemand <em>Dynamic Demand</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Dynamic Demand</em>'. * @see CIM.IEC61968.Metering.DynamicDemand * @generated */
Returns the meta object for class '<code>CIM.IEC61968.Metering.DynamicDemand Dynamic Demand</code>'.
getDynamicDemand
{ "repo_name": "georghinkel/ttc2017smartGrids", "path": "solutions/ModelJoin/src/main/java/CIM/IEC61968/Metering/MeteringPackage.java", "license": "mit", "size": 264485 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
660,808
@Bean @Scope(value = WebApplicationContext.SCOPE_REQUEST) RequestResponseContextHolder requestResponseContextHolder() { return new RequestResponseContextHolder(); }
@Scope(value = WebApplicationContext.SCOPE_REQUEST) RequestResponseContextHolder requestResponseContextHolder() { return new RequestResponseContextHolder(); }
/** * Create factory bean for {@link HttpServletResponse}. */
Create factory bean for <code>HttpServletResponse</code>
requestResponseContextHolder
{ "repo_name": "bsinno/hawkbit", "path": "hawkbit-rest/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/RestConfiguration.java", "license": "epl-1.0", "size": 3404 }
[ "org.eclipse.hawkbit.rest.util.RequestResponseContextHolder", "org.springframework.context.annotation.Scope", "org.springframework.web.context.WebApplicationContext" ]
import org.eclipse.hawkbit.rest.util.RequestResponseContextHolder; import org.springframework.context.annotation.Scope; import org.springframework.web.context.WebApplicationContext;
import org.eclipse.hawkbit.rest.util.*; import org.springframework.context.annotation.*; import org.springframework.web.context.*;
[ "org.eclipse.hawkbit", "org.springframework.context", "org.springframework.web" ]
org.eclipse.hawkbit; org.springframework.context; org.springframework.web;
769,517
public List<Language> getAvailable() { return mAvailable; }
List<Language> function() { return mAvailable; }
/** * Returns the list of available languages. You must call loadLanguages() * prior to calling this method. * * @return the list of available languages */
Returns the list of available languages. You must call loadLanguages() prior to calling this method
getAvailable
{ "repo_name": "winlqvin/AdTranslator-with-textfairy", "path": "tess-two/eyes-two/src/com/googlecode/eyesfree/ocr/service/LanguageManager.java", "license": "apache-2.0", "size": 4971 }
[ "com.googlecode.eyesfree.ocr.client.Language", "java.util.List" ]
import com.googlecode.eyesfree.ocr.client.Language; import java.util.List;
import com.googlecode.eyesfree.ocr.client.*; import java.util.*;
[ "com.googlecode.eyesfree", "java.util" ]
com.googlecode.eyesfree; java.util;
91,855
private void findBestWithoutFirst(List<DatanodeDescriptor> listOfNodes, DatanodeDescriptor[] result) { readLock(); try { for (int in2 = 0; in2 < listOfNodes.size(); in2++) { DatanodeDescriptor n2 = listOfNodes.get(in2); for (int in3 = in2 + 1; in3 < listOfNodes.size(); in3++) { DatanodeDescriptor n3 = listOfNodes.get(in3); if (n2.getNetworkLocation().equals(n3.getNetworkLocation())) { RackRingInfo rackInfo = racksMap.get(n2.getNetworkLocation()); assert (rackInfo != null); final int rackSize = rackInfo.rackNodes.size(); final Integer idN2 = rackInfo.findNode(n2); final Integer idN3 = rackInfo.findNode(n3); if (idN2 != null && idN3 != null) { int dist = (idN3 - idN2 + rackSize) % rackSize; if (dist >= machineWindow) { dist = rackSize - dist; // try n2 - n3 } if (dist < machineWindow) { result[0] = null; result[1] = n2; result[2] = n3; return; } } } } } } finally { readUnlock(); } }
void function(List<DatanodeDescriptor> listOfNodes, DatanodeDescriptor[] result) { readLock(); try { for (int in2 = 0; in2 < listOfNodes.size(); in2++) { DatanodeDescriptor n2 = listOfNodes.get(in2); for (int in3 = in2 + 1; in3 < listOfNodes.size(); in3++) { DatanodeDescriptor n3 = listOfNodes.get(in3); if (n2.getNetworkLocation().equals(n3.getNetworkLocation())) { RackRingInfo rackInfo = racksMap.get(n2.getNetworkLocation()); assert (rackInfo != null); final int rackSize = rackInfo.rackNodes.size(); final Integer idN2 = rackInfo.findNode(n2); final Integer idN3 = rackInfo.findNode(n3); if (idN2 != null && idN3 != null) { int dist = (idN3 - idN2 + rackSize) % rackSize; if (dist >= machineWindow) { dist = rackSize - dist; } if (dist < machineWindow) { result[0] = null; result[1] = n2; result[2] = n3; return; } } } } } } finally { readUnlock(); } }
/** * Finds best match considering only the remote nodes. * @param listOfNodes Datanodes to choose from * @param result Array containing results */
Finds best match considering only the remote nodes
findBestWithoutFirst
{ "repo_name": "iVCE/RDFS", "path": "src/hdfs/org/apache/hadoop/hdfs/server/namenode/BlockPlacementPolicyConfigurable.java", "license": "apache-2.0", "size": 28185 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
131,439
AuthenticationBuilder addFailures(Map<String, Throwable> failures);
AuthenticationBuilder addFailures(Map<String, Throwable> failures);
/** * Adds failures. * * @param failures the failures * @return the failures * @since 4.2.0 */
Adds failures
addFailures
{ "repo_name": "rrenomeron/cas", "path": "api/cas-server-core-api-authentication/src/main/java/org/apereo/cas/authentication/AuthenticationBuilder.java", "license": "apache-2.0", "size": 6202 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,370,601
public void processToSAX(String uri, Object viewData, ContentHandler handler) throws SAXException, IOException, ProcessingException { final Map objectModel = getObjectModel(); final ObjectModel newObjectModel = getNewObjectModel(); final SourceResolver resolver = getSourceResolver(); Object oldViewData = FlowHelper.getContextObject(objectModel); FlowHelper.setContextObject(objectModel, newObjectModel, JavaScriptFlowHelper.unwrap(viewData)); Source src = null; try { src = resolver.resolveURI("cocoon:/" + uri); SourceUtil.toSAX(src, handler); } finally { FlowHelper.setContextObject(objectModel, newObjectModel, oldViewData); resolver.release(src); } }
void function(String uri, Object viewData, ContentHandler handler) throws SAXException, IOException, ProcessingException { final Map objectModel = getObjectModel(); final ObjectModel newObjectModel = getNewObjectModel(); final SourceResolver resolver = getSourceResolver(); Object oldViewData = FlowHelper.getContextObject(objectModel); FlowHelper.setContextObject(objectModel, newObjectModel, JavaScriptFlowHelper.unwrap(viewData)); Source src = null; try { src = resolver.resolveURI(STR + uri); SourceUtil.toSAX(src, handler); } finally { FlowHelper.setContextObject(objectModel, newObjectModel, oldViewData); resolver.release(src); } }
/** * Process a pipeline to a SAX <code>ContentHandler</code> * * @param uri the pipeline URI * @param viewData the view data object * @param handler where the pipeline should be streamed to. */
Process a pipeline to a SAX <code>ContentHandler</code>
processToSAX
{ "repo_name": "apache/cocoon", "path": "blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/util/PipelineUtil.java", "license": "apache-2.0", "size": 6339 }
[ "java.io.IOException", "java.util.Map", "org.apache.cocoon.ProcessingException", "org.apache.cocoon.components.flow.FlowHelper", "org.apache.cocoon.components.flow.javascript.JavaScriptFlowHelper", "org.apache.cocoon.components.source.SourceUtil", "org.apache.cocoon.el.objectmodel.ObjectModel", "org.apache.excalibur.source.Source", "org.apache.excalibur.source.SourceResolver", "org.xml.sax.ContentHandler", "org.xml.sax.SAXException" ]
import java.io.IOException; import java.util.Map; import org.apache.cocoon.ProcessingException; import org.apache.cocoon.components.flow.FlowHelper; import org.apache.cocoon.components.flow.javascript.JavaScriptFlowHelper; import org.apache.cocoon.components.source.SourceUtil; import org.apache.cocoon.el.objectmodel.ObjectModel; import org.apache.excalibur.source.Source; import org.apache.excalibur.source.SourceResolver; import org.xml.sax.ContentHandler; import org.xml.sax.SAXException;
import java.io.*; import java.util.*; import org.apache.cocoon.*; import org.apache.cocoon.components.flow.*; import org.apache.cocoon.components.flow.javascript.*; import org.apache.cocoon.components.source.*; import org.apache.cocoon.el.objectmodel.*; import org.apache.excalibur.source.*; import org.xml.sax.*;
[ "java.io", "java.util", "org.apache.cocoon", "org.apache.excalibur", "org.xml.sax" ]
java.io; java.util; org.apache.cocoon; org.apache.excalibur; org.xml.sax;
1,799,906
@Beta protected SortedMap<K, V> standardSubMap(K fromKey, K toKey) { checkArgument(unsafeCompare(fromKey, toKey) <= 0, "fromKey must be <= toKey"); return tailMap(fromKey).headMap(toKey); }
SortedMap<K, V> function(K fromKey, K toKey) { checkArgument(unsafeCompare(fromKey, toKey) <= 0, STR); return tailMap(fromKey).headMap(toKey); }
/** * A sensible default implementation of {@link #subMap(Object, Object)} in * terms of {@link #headMap(Object)} and {@link #tailMap(Object)}. In some * situations, you may wish to override {@link #subMap(Object, Object)} to * forward to this implementation. * * @since 7.0 */
A sensible default implementation of <code>#subMap(Object, Object)</code> in terms of <code>#headMap(Object)</code> and <code>#tailMap(Object)</code>. In some situations, you may wish to override <code>#subMap(Object, Object)</code> to forward to this implementation
standardSubMap
{ "repo_name": "migue/voltdb", "path": "third_party/java/src/com/google_voltpatches/common/collect/ForwardingSortedMap.java", "license": "agpl-3.0", "size": 5523 }
[ "com.google_voltpatches.common.base.Preconditions", "java.util.SortedMap" ]
import com.google_voltpatches.common.base.Preconditions; import java.util.SortedMap;
import com.google_voltpatches.common.base.*; import java.util.*;
[ "com.google_voltpatches.common", "java.util" ]
com.google_voltpatches.common; java.util;
1,336,085
private TextBox createTextBox(Text n, BoxTreeCreationStatus stat) { //TODO: in some whitespace processing modes, multiple boxes may be created TextBox text = new TextBox(n, (Graphics2D) stat.parent.getGraphics().create(), stat.parent.getVisualContext().create()); text.setOrder(next_order++); text.setContainingBlock(stat.contbox); text.setClipBlock(stat.clipbox); text.setViewport(viewport); text.setBase(baseurl); text.setParent(stat.parent); return text; }
TextBox function(Text n, BoxTreeCreationStatus stat) { TextBox text = new TextBox(n, (Graphics2D) stat.parent.getGraphics().create(), stat.parent.getVisualContext().create()); text.setOrder(next_order++); text.setContainingBlock(stat.contbox); text.setClipBlock(stat.clipbox); text.setViewport(viewport); text.setBase(baseurl); text.setParent(stat.parent); return text; }
/** * Creates a new box for a text node and sets the containing boxes accordingly. * @param n The element node * @param stat Current box tree creation status for obtaining the containing boxes * @return the newly created text box */
Creates a new box for a text node and sets the containing boxes accordingly
createTextBox
{ "repo_name": "mantlik/swingbox-javahelp-viewer", "path": "src/main/java/org/fit/cssbox/layout/BoxFactory.java", "license": "lgpl-3.0", "size": 37974 }
[ "java.awt.Graphics2D", "org.w3c.dom.Text" ]
import java.awt.Graphics2D; import org.w3c.dom.Text;
import java.awt.*; import org.w3c.dom.*;
[ "java.awt", "org.w3c.dom" ]
java.awt; org.w3c.dom;
836,055
@Override public String getOASDefinitionForStore(APIProduct product, String oasDefinition, Map<String, String> hostsWithSchemes) { OpenAPI openAPI = getOpenAPI(oasDefinition); updateOperations(openAPI); updateEndpoints(product, hostsWithSchemes, openAPI); return updateSwaggerSecurityDefinitionForStore(openAPI, new SwaggerData(product), hostsWithSchemes); }
String function(APIProduct product, String oasDefinition, Map<String, String> hostsWithSchemes) { OpenAPI openAPI = getOpenAPI(oasDefinition); updateOperations(openAPI); updateEndpoints(product, hostsWithSchemes, openAPI); return updateSwaggerSecurityDefinitionForStore(openAPI, new SwaggerData(product), hostsWithSchemes); }
/** * Update OAS definition for store * * @param product APIProduct * @param oasDefinition OAS definition * @param hostsWithSchemes host addresses with protocol mapping * @return OAS definition */
Update OAS definition for store
getOASDefinitionForStore
{ "repo_name": "nuwand/carbon-apimgt", "path": "components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/definitions/OAS3Parser.java", "license": "apache-2.0", "size": 75509 }
[ "io.swagger.v3.oas.models.OpenAPI", "java.util.Map", "org.wso2.carbon.apimgt.api.model.APIProduct", "org.wso2.carbon.apimgt.api.model.SwaggerData" ]
import io.swagger.v3.oas.models.OpenAPI; import java.util.Map; import org.wso2.carbon.apimgt.api.model.APIProduct; import org.wso2.carbon.apimgt.api.model.SwaggerData;
import io.swagger.v3.oas.models.*; import java.util.*; import org.wso2.carbon.apimgt.api.model.*;
[ "io.swagger.v3", "java.util", "org.wso2.carbon" ]
io.swagger.v3; java.util; org.wso2.carbon;
2,570,720
public CallableStatement wrapStatement(CallableStatement cs, String sql) throws SQLException { EmbedCallableStatement cs_ = (EmbedCallableStatement)cs; cs_.setBrokeredConnectionControl(this); return (CallableStatement)cs_; }
CallableStatement function(CallableStatement cs, String sql) throws SQLException { EmbedCallableStatement cs_ = (EmbedCallableStatement)cs; cs_.setBrokeredConnectionControl(this); return (CallableStatement)cs_; }
/** * Call the setBrokeredConnectionControl method inside the * EmbedCallableStatement class to set the BrokeredConnectionControl * variable to this instance of EmbedPooledConnection * This will then be used to call the onStatementErrorOccurred * and onStatementClose events when the corresponding events * occur on the CallableStatement * * @param cs CallableStatment to be wrapped * @param sql String * @return returns the wrapped CallableStatement * @throws java.sql.SQLException */
Call the setBrokeredConnectionControl method inside the EmbedCallableStatement class to set the BrokeredConnectionControl variable to this instance of EmbedPooledConnection This will then be used to call the onStatementErrorOccurred and onStatementClose events when the corresponding events occur on the CallableStatement
wrapStatement
{ "repo_name": "scnakandala/derby", "path": "java/engine/org/apache/derby/jdbc/EmbedPooledConnection.java", "license": "apache-2.0", "size": 20783 }
[ "java.sql.CallableStatement", "java.sql.SQLException", "org.apache.derby.impl.jdbc.EmbedCallableStatement" ]
import java.sql.CallableStatement; import java.sql.SQLException; import org.apache.derby.impl.jdbc.EmbedCallableStatement;
import java.sql.*; import org.apache.derby.impl.jdbc.*;
[ "java.sql", "org.apache.derby" ]
java.sql; org.apache.derby;
237,293
public void setOutputHLAPI( SortHLAPI elem){ if(elem!=null) item.setOutput((Sort)elem.getContainedItem()); }
void function( SortHLAPI elem){ if(elem!=null) item.setOutput((Sort)elem.getContainedItem()); }
/** * set Output */
set Output
setOutputHLAPI
{ "repo_name": "lhillah/pnmlframework", "path": "pnmlFw-HLPN/src/fr/lip6/move/pnml/hlpn/strings/hlapi/SubstringHLAPI.java", "license": "epl-1.0", "size": 111893 }
[ "fr.lip6.move.pnml.hlpn.terms.Sort", "fr.lip6.move.pnml.hlpn.terms.hlapi.SortHLAPI" ]
import fr.lip6.move.pnml.hlpn.terms.Sort; import fr.lip6.move.pnml.hlpn.terms.hlapi.SortHLAPI;
import fr.lip6.move.pnml.hlpn.terms.*; import fr.lip6.move.pnml.hlpn.terms.hlapi.*;
[ "fr.lip6.move" ]
fr.lip6.move;
1,719,612
private List<IonizationType> partAdInfo(PolarityType polarity) { List<IonizationType> returnAdInfo = new ArrayList<>(); if (polarity.equals(PolarityType.POSITIVE)) { // Separate them in adducts with charge >1, // adducts with nmol >1 && charge ==1, // and adducts with charge and nmol = 1 List<IonizationType> chargeAd = new ArrayList<>(); EnumSet.allOf(IonizationType.class) .forEach(ion -> { if (ion.getCharge() > 1 && ion.getPolarity().equals(polarity)) { chargeAd.add(ion); } }); Collections.sort(chargeAd, Comparator.comparingDouble(IonizationType::getAddedMass)); List<IonizationType> numMolAd = new ArrayList<>(); EnumSet.allOf(IonizationType.class) .forEach(ion -> { if (ion.getNumMol() > 1 && ion.getPolarity().equals(polarity)) { numMolAd.add(ion); } }); Collections.sort(numMolAd, Comparator.comparingDouble(IonizationType::getAddedMass)); List<IonizationType> normalAd = new ArrayList<>(); EnumSet.allOf(IonizationType.class) .forEach(ion -> { if (ion.getCharge() == 1 && ion.getNumMol() == 1 && ion.getPolarity() .equals(polarity)) { normalAd.add(ion); } }); // Sort them from adducts with charge >1, // normal and adducts with nummol > 1, // trying to virtually sort all adducts from smaller massDiff to bigger returnAdInfo.addAll(chargeAd); returnAdInfo.addAll(normalAd); returnAdInfo.addAll(numMolAd); } else if (polarity.equals(PolarityType.NEGATIVE)) { // Separate them in adducts with charge < -1, // adducts with nmol >1 && charge == -1 // and adducts with charge and nmol = 1 List<IonizationType> chargeAd = new ArrayList<>(); EnumSet.allOf(IonizationType.class) .forEach(ion -> { if (ion.getCharge() < -1 && ion.getPolarity().equals(polarity)) { chargeAd.add(ion); } }); Collections.sort(chargeAd, Comparator.comparingDouble(IonizationType::getAddedMass)); List<IonizationType> numMolAd = new ArrayList<>(); EnumSet.allOf(IonizationType.class) .forEach(ion -> { if (ion.getNumMol() > 1 && ion.getPolarity().equals(polarity)) { numMolAd.add(ion); } }); Collections.sort(numMolAd, Comparator.comparingDouble(IonizationType::getAddedMass)); List<IonizationType> normalAd = new ArrayList<>(); EnumSet.allOf(IonizationType.class) .forEach(ion -> { if (ion.getCharge() == -1 && ion.getNumMol() == 1 && ion.getPolarity() .equals(polarity)) { normalAd.add(ion); } }); // Sort them from adducts with charge >1 // normal and adducts with nummol > 1 // trying to virtually sort all adducts from smaller massDiff to bigger returnAdInfo.addAll(chargeAd); returnAdInfo.addAll(normalAd); returnAdInfo.addAll(numMolAd); } else { driverTask.setErrorMessage("Polarity must be \"positive\" or \"negative\" only."); driverTask.setStatus(TaskStatus.ERROR); } return returnAdInfo; }
List<IonizationType> function(PolarityType polarity) { List<IonizationType> returnAdInfo = new ArrayList<>(); if (polarity.equals(PolarityType.POSITIVE)) { List<IonizationType> chargeAd = new ArrayList<>(); EnumSet.allOf(IonizationType.class) .forEach(ion -> { if (ion.getCharge() > 1 && ion.getPolarity().equals(polarity)) { chargeAd.add(ion); } }); Collections.sort(chargeAd, Comparator.comparingDouble(IonizationType::getAddedMass)); List<IonizationType> numMolAd = new ArrayList<>(); EnumSet.allOf(IonizationType.class) .forEach(ion -> { if (ion.getNumMol() > 1 && ion.getPolarity().equals(polarity)) { numMolAd.add(ion); } }); Collections.sort(numMolAd, Comparator.comparingDouble(IonizationType::getAddedMass)); List<IonizationType> normalAd = new ArrayList<>(); EnumSet.allOf(IonizationType.class) .forEach(ion -> { if (ion.getCharge() == 1 && ion.getNumMol() == 1 && ion.getPolarity() .equals(polarity)) { normalAd.add(ion); } }); returnAdInfo.addAll(chargeAd); returnAdInfo.addAll(normalAd); returnAdInfo.addAll(numMolAd); } else if (polarity.equals(PolarityType.NEGATIVE)) { List<IonizationType> chargeAd = new ArrayList<>(); EnumSet.allOf(IonizationType.class) .forEach(ion -> { if (ion.getCharge() < -1 && ion.getPolarity().equals(polarity)) { chargeAd.add(ion); } }); Collections.sort(chargeAd, Comparator.comparingDouble(IonizationType::getAddedMass)); List<IonizationType> numMolAd = new ArrayList<>(); EnumSet.allOf(IonizationType.class) .forEach(ion -> { if (ion.getNumMol() > 1 && ion.getPolarity().equals(polarity)) { numMolAd.add(ion); } }); Collections.sort(numMolAd, Comparator.comparingDouble(IonizationType::getAddedMass)); List<IonizationType> normalAd = new ArrayList<>(); EnumSet.allOf(IonizationType.class) .forEach(ion -> { if (ion.getCharge() == -1 && ion.getNumMol() == 1 && ion.getPolarity() .equals(polarity)) { normalAd.add(ion); } }); returnAdInfo.addAll(chargeAd); returnAdInfo.addAll(normalAd); returnAdInfo.addAll(numMolAd); } else { driverTask.setErrorMessage(STRpositive\STRnegative\STR); driverTask.setStatus(TaskStatus.ERROR); } return returnAdInfo; }
/** * function to compute ions of polarity type 'polarity' * * @param polarity polarity positive or negative * @return returns IonizationType of polarity type 'polarity' */
function to compute ions of polarity type 'polarity'
partAdInfo
{ "repo_name": "mzmine/mzmine3", "path": "src/main/java/io/github/mzmine/modules/dataprocessing/id_cliquems/cliquemsimplementation/ComputeAdduct.java", "license": "gpl-2.0", "size": 12280 }
[ "io.github.mzmine.datamodel.IonizationType", "io.github.mzmine.datamodel.PolarityType", "io.github.mzmine.taskcontrol.TaskStatus", "java.util.ArrayList", "java.util.Collections", "java.util.Comparator", "java.util.EnumSet", "java.util.List" ]
import io.github.mzmine.datamodel.IonizationType; import io.github.mzmine.datamodel.PolarityType; import io.github.mzmine.taskcontrol.TaskStatus; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.EnumSet; import java.util.List;
import io.github.mzmine.datamodel.*; import io.github.mzmine.taskcontrol.*; import java.util.*;
[ "io.github.mzmine", "java.util" ]
io.github.mzmine; java.util;
703,813
private void findRemovableSelfJoins(RelMetadataQuery mq, LoptMultiJoin multiJoin) { // Candidates for self-joins must be simple factors Map<Integer, RelOptTable> simpleFactors = getSimpleFactors(mq, multiJoin); // See if a simple factor is repeated and therefore potentially is // part of a self-join. Restrict each factor to at most one // self-join. final List<RelOptTable> repeatedTables = new ArrayList<>(); final TreeSet<Integer> sortedFactors = new TreeSet<>(); sortedFactors.addAll(simpleFactors.keySet()); final Map<Integer, Integer> selfJoinPairs = new HashMap<>(); Integer [] factors = sortedFactors.toArray(new Integer[0]); for (int i = 0; i < factors.length; i++) { if (repeatedTables.contains(simpleFactors.get(factors[i]))) { continue; } for (int j = i + 1; j < factors.length; j++) { int leftFactor = factors[i]; int rightFactor = factors[j]; if (simpleFactors.get(leftFactor).getQualifiedName().equals( simpleFactors.get(rightFactor).getQualifiedName())) { selfJoinPairs.put(leftFactor, rightFactor); repeatedTables.add(simpleFactors.get(leftFactor)); break; } } } // From the candidate self-join pairs, determine if there is // the appropriate join condition between the two factors that will // allow the join to be removed. for (Integer factor1 : selfJoinPairs.keySet()) { final int factor2 = selfJoinPairs.get(factor1); final List<RexNode> selfJoinFilters = new ArrayList<>(); for (RexNode filter : multiJoin.getJoinFilters()) { ImmutableBitSet joinFactors = multiJoin.getFactorsRefByJoinFilter(filter); if ((joinFactors.cardinality() == 2) && joinFactors.get(factor1) && joinFactors.get(factor2)) { selfJoinFilters.add(filter); } } if ((selfJoinFilters.size() > 0) && isSelfJoinFilterUnique( mq, multiJoin, factor1, factor2, selfJoinFilters)) { multiJoin.addRemovableSelfJoinPair(factor1, factor2); } } }
void function(RelMetadataQuery mq, LoptMultiJoin multiJoin) { Map<Integer, RelOptTable> simpleFactors = getSimpleFactors(mq, multiJoin); final List<RelOptTable> repeatedTables = new ArrayList<>(); final TreeSet<Integer> sortedFactors = new TreeSet<>(); sortedFactors.addAll(simpleFactors.keySet()); final Map<Integer, Integer> selfJoinPairs = new HashMap<>(); Integer [] factors = sortedFactors.toArray(new Integer[0]); for (int i = 0; i < factors.length; i++) { if (repeatedTables.contains(simpleFactors.get(factors[i]))) { continue; } for (int j = i + 1; j < factors.length; j++) { int leftFactor = factors[i]; int rightFactor = factors[j]; if (simpleFactors.get(leftFactor).getQualifiedName().equals( simpleFactors.get(rightFactor).getQualifiedName())) { selfJoinPairs.put(leftFactor, rightFactor); repeatedTables.add(simpleFactors.get(leftFactor)); break; } } } for (Integer factor1 : selfJoinPairs.keySet()) { final int factor2 = selfJoinPairs.get(factor1); final List<RexNode> selfJoinFilters = new ArrayList<>(); for (RexNode filter : multiJoin.getJoinFilters()) { ImmutableBitSet joinFactors = multiJoin.getFactorsRefByJoinFilter(filter); if ((joinFactors.cardinality() == 2) && joinFactors.get(factor1) && joinFactors.get(factor2)) { selfJoinFilters.add(filter); } } if ((selfJoinFilters.size() > 0) && isSelfJoinFilterUnique( mq, multiJoin, factor1, factor2, selfJoinFilters)) { multiJoin.addRemovableSelfJoinPair(factor1, factor2); } } }
/** * Locates pairs of joins that are self-joins where the join can be removed * because the join condition between the two factors is an equality join on * unique keys. * * @param multiJoin join factors being optimized */
Locates pairs of joins that are self-joins where the join can be removed because the join condition between the two factors is an equality join on unique keys
findRemovableSelfJoins
{ "repo_name": "dindin5258/calcite", "path": "core/src/main/java/org/apache/calcite/rel/rules/LoptOptimizeJoinRule.java", "license": "apache-2.0", "size": 73849 }
[ "java.util.ArrayList", "java.util.HashMap", "java.util.List", "java.util.Map", "java.util.TreeSet", "org.apache.calcite.plan.RelOptTable", "org.apache.calcite.rel.metadata.RelMetadataQuery", "org.apache.calcite.rex.RexNode", "org.apache.calcite.util.ImmutableBitSet" ]
import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.TreeSet; import org.apache.calcite.plan.RelOptTable; import org.apache.calcite.rel.metadata.RelMetadataQuery; import org.apache.calcite.rex.RexNode; import org.apache.calcite.util.ImmutableBitSet;
import java.util.*; import org.apache.calcite.plan.*; import org.apache.calcite.rel.metadata.*; import org.apache.calcite.rex.*; import org.apache.calcite.util.*;
[ "java.util", "org.apache.calcite" ]
java.util; org.apache.calcite;
579,640
public Drawable getFolderIconDrawable(final ArrayList<View> items, final int position) { return null; } public void bindFinished() { }
Drawable function(final ArrayList<View> items, final int position) { return null; } public void bindFinished() { }
/** * Get a drawable for the supplied item in the folder icon preview. * @param items list of views in the folder. * @param position index of icon to retreive. * @return an icon to draw in the folder preview. */
Get a drawable for the supplied item in the folder icon preview
getFolderIconDrawable
{ "repo_name": "bojanvu23/android_packages_apps_Trebuchet_Gradle", "path": "Trebuchet/src/main/java/com/lite/android/launcher3/RemoteFolderManager.java", "license": "apache-2.0", "size": 5053 }
[ "android.graphics.drawable.Drawable", "android.view.View", "java.util.ArrayList" ]
import android.graphics.drawable.Drawable; import android.view.View; import java.util.ArrayList;
import android.graphics.drawable.*; import android.view.*; import java.util.*;
[ "android.graphics", "android.view", "java.util" ]
android.graphics; android.view; java.util;
1,040,600