method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public static List<AppdefResourceValue> buildAppdefResources(int sessionId, AppdefBoss boss, AppdefEntityID[] entities) throws ObjectNotFoundException, RemoteException, SessionTimeoutException, SessionNotFoundException, PermissionException { if (entities == null) return new ArrayList(); return boss.findByIds(sessionId, entities, PageControl.PAGE_ALL); }
static List<AppdefResourceValue> function(int sessionId, AppdefBoss boss, AppdefEntityID[] entities) throws ObjectNotFoundException, RemoteException, SessionTimeoutException, SessionNotFoundException, PermissionException { if (entities == null) return new ArrayList(); return boss.findByIds(sessionId, entities, PageControl.PAGE_ALL); }
/** * This method builds a list of AppdefResourceValue objects * from a list of AppdefEntityID. * * This function should be moved into bizapp layer if possible * later. I am leaving it until I have an api which provides * similar functionality. * * @return a list of AppdefResourceValue objects */
This method builds a list of AppdefResourceValue objects from a list of AppdefEntityID. This function should be moved into bizapp layer if possible later. I am leaving it until I have an api which provides similar functionality
buildAppdefResources
{ "repo_name": "cc14514/hq6", "path": "hq-web/src/main/java/org/hyperic/hq/ui/util/BizappUtils.java", "license": "unlicense", "size": 45701 }
[ "java.rmi.RemoteException", "java.util.ArrayList", "java.util.List", "org.hyperic.hq.appdef.shared.AppdefEntityID", "org.hyperic.hq.appdef.shared.AppdefResourceValue", "org.hyperic.hq.auth.shared.SessionNotFoundException", "org.hyperic.hq.auth.shared.SessionTimeoutException", "org.hyperic.hq.authz.shared.PermissionException", "org.hyperic.hq.bizapp.shared.AppdefBoss", "org.hyperic.hq.common.ObjectNotFoundException", "org.hyperic.util.pager.PageControl" ]
import java.rmi.RemoteException; import java.util.ArrayList; import java.util.List; import org.hyperic.hq.appdef.shared.AppdefEntityID; import org.hyperic.hq.appdef.shared.AppdefResourceValue; import org.hyperic.hq.auth.shared.SessionNotFoundException; import org.hyperic.hq.auth.shared.SessionTimeoutException; import org.hyperic.hq.authz.shared.PermissionException; import org.hyperic.hq.bizapp.shared.AppdefBoss; import org.hyperic.hq.common.ObjectNotFoundException; import org.hyperic.util.pager.PageControl;
import java.rmi.*; import java.util.*; import org.hyperic.hq.appdef.shared.*; import org.hyperic.hq.auth.shared.*; import org.hyperic.hq.authz.shared.*; import org.hyperic.hq.bizapp.shared.*; import org.hyperic.hq.common.*; import org.hyperic.util.pager.*;
[ "java.rmi", "java.util", "org.hyperic.hq", "org.hyperic.util" ]
java.rmi; java.util; org.hyperic.hq; org.hyperic.util;
2,666,466
protected void validationFailed(TableForm form, Object object) { logger.debug("Form validation failed"); }
void function(TableForm form, Object object) { logger.debug(STR); }
/** * Invoked when form validation fails. */
Invoked when form validation fails
validationFailed
{ "repo_name": "OldShatterhand77/Portofino", "path": "portofino-pageactions/src/main/java/com/manydesigns/portofino/pageactions/form/TableFormAction.java", "license": "lgpl-3.0", "size": 6504 }
[ "com.manydesigns.elements.forms.TableForm" ]
import com.manydesigns.elements.forms.TableForm;
import com.manydesigns.elements.forms.*;
[ "com.manydesigns.elements" ]
com.manydesigns.elements;
4,402
private static double transform( double value ) { return toDegrees(atan(value)); } /** * Estimate the gradient (p=f_{x}^{2}+f_{y}^{2}) with a finite difference formula: * * <pre> * p=&radic{f<sub>x</sub>&sup2;+f<sub>y</sub>&sup2;}
static double function( double value ) { return toDegrees(atan(value)); } /** * Estimate the gradient (p=f_{x}^{2}+f_{y}^{2}) with a finite difference formula: * * <pre> * p=&radic{f<sub>x</sub>&sup2;+f<sub>y</sub>&sup2;}
/** * Transform the gradient value into degrees. * * @param value the radiant based gradient. * @return the degree gradient. */
Transform the gradient value into degrees
transform
{ "repo_name": "silviafranceschi/jgrasstools", "path": "hortonmachine/src/main/java/org/jgrasstools/hortonmachine/modules/geomorphology/gradient/OmsGradient.java", "license": "gpl-3.0", "size": 13846 }
[ "java.lang.Math" ]
import java.lang.Math;
import java.lang.*;
[ "java.lang" ]
java.lang;
1,792,077
private static List<TypeDescriptor> getAcceptedTypeCombinations(List<List<TypeDescriptor>> acceptedLists) { List<List<TypeDescriptor>> typeLists = combinations(acceptedLists); List<TypeDescriptor> combinedTypes = Lists.newArrayList(); for (List<TypeDescriptor> types : typeLists) { // XXX need an intelligent way to combine tags here StringBuilder tag = new StringBuilder(); StringBuilder description = new StringBuilder(); for (int i = 0; i < types.size(); i++) { if (i > 0) { tag.append(", "); description.append(", "); } TypeDescriptor td = types.get(i); tag.append(td.getType().toString()); description.append(td.getTag()); } combinedTypes.add(new TypeDescriptor(tag + ": " + description)); } return combinedTypes; }
static List<TypeDescriptor> function(List<List<TypeDescriptor>> acceptedLists) { List<List<TypeDescriptor>> typeLists = combinations(acceptedLists); List<TypeDescriptor> combinedTypes = Lists.newArrayList(); for (List<TypeDescriptor> types : typeLists) { StringBuilder tag = new StringBuilder(); StringBuilder description = new StringBuilder(); for (int i = 0; i < types.size(); i++) { if (i > 0) { tag.append(STR); description.append(STR); } TypeDescriptor td = types.get(i); tag.append(td.getType().toString()); description.append(td.getTag()); } combinedTypes.add(new TypeDescriptor(tag + STR + description)); } return combinedTypes; }
/** * Get a list of accepted types given lists of types accepted for * each of a set of parameters. * @param acceptedLists * @return */
Get a list of accepted types given lists of types accepted for each of a set of parameters
getAcceptedTypeCombinations
{ "repo_name": "martinisgroup/jlabrad", "path": "JLabrad/src/org/labrad/SettingHandlers.java", "license": "gpl-2.0", "size": 16219 }
[ "com.google.common.collect.Lists", "java.util.List", "org.labrad.types.TypeDescriptor" ]
import com.google.common.collect.Lists; import java.util.List; import org.labrad.types.TypeDescriptor;
import com.google.common.collect.*; import java.util.*; import org.labrad.types.*;
[ "com.google.common", "java.util", "org.labrad.types" ]
com.google.common; java.util; org.labrad.types;
2,277,961
EClass getCorner();
EClass getCorner();
/** * Returns the meta object for class '{@link org.xtext.rollercoaster.dsl.coaster.Corner <em>Corner</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Corner</em>'. * @see org.xtext.rollercoaster.dsl.coaster.Corner * @generated */
Returns the meta object for class '<code>org.xtext.rollercoaster.dsl.coaster.Corner Corner</code>'.
getCorner
{ "repo_name": "bettsmatt/roller-coaster-dsl", "path": "org.xtext.rollercoaster.dsl/src-gen/org/xtext/rollercoaster/dsl/coaster/CoasterPackage.java", "license": "mit", "size": 28313 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
754,969
CriteriaBuilder getCriteriaBuilder();
CriteriaBuilder getCriteriaBuilder();
/** * Get a criteria builder for querying Permissions. * * @return the CriteriaBuilder. */
Get a criteria builder for querying Permissions
getCriteriaBuilder
{ "repo_name": "IISH/delivery", "path": "src/main/java/org/socialhistoryservices/delivery/permission/dao/PermissionDAO.java", "license": "gpl-3.0", "size": 2606 }
[ "javax.persistence.criteria.CriteriaBuilder" ]
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.*;
[ "javax.persistence" ]
javax.persistence;
2,215,080
@SuppressWarnings("deprecation") @Test public void testExpectedResultsInTableStateForBatchPuts() throws Exception { long ts = state.ts; // build up a list of puts to make, all on the same row Put p1 = new Put(row, ts); p1.add(family, qual, Bytes.toBytes("v1")); Put p2 = new Put(row, ts + 1); p2.add(family, qual, Bytes.toBytes("v2")); // setup all the verifiers we need. This is just the same as above, but will be called twice // since we need to iterate the batch. // get all the underlying kvs for the put final List<Cell> allKvs = new ArrayList<Cell>(2); allKvs.addAll(p2.getFamilyCellMap().get(family)); allKvs.addAll(p1.getFamilyCellMap().get(family)); // setup the verifier for the data we expect to write // both puts should be put into a single batch final ColumnReference familyRef = new ColumnReference(EndToEndCoveredColumnsIndexBuilderIT.family, ColumnReference.ALL_QUALIFIERS); VerifyingIndexCodec codec = state.codec; // no previous state in the table codec.verifiers.add(new ListMatchingVerifier("cleanup state 1", Collections .<Cell> emptyList(), familyRef)); codec.verifiers.add(new ListMatchingVerifier("put state 1", p1.getFamilyCellMap().get(family), familyRef)); codec.verifiers.add(new ListMatchingVerifier("cleanup state 2", p1.getFamilyCellMap().get(family), familyRef)); // kvs from both puts should be in the table now codec.verifiers.add(new ListMatchingVerifier("put state 2", allKvs, familyRef)); // do the actual put (no indexing will actually be done) HTable primary = state.table; primary.setAutoFlush(false); primary.put(Arrays.asList(p1, p2)); primary.flushCommits(); // cleanup after ourselves cleanup(state); }
@SuppressWarnings(STR) void function() throws Exception { long ts = state.ts; Put p1 = new Put(row, ts); p1.add(family, qual, Bytes.toBytes("v1")); Put p2 = new Put(row, ts + 1); p2.add(family, qual, Bytes.toBytes("v2")); final List<Cell> allKvs = new ArrayList<Cell>(2); allKvs.addAll(p2.getFamilyCellMap().get(family)); allKvs.addAll(p1.getFamilyCellMap().get(family)); final ColumnReference familyRef = new ColumnReference(EndToEndCoveredColumnsIndexBuilderIT.family, ColumnReference.ALL_QUALIFIERS); VerifyingIndexCodec codec = state.codec; codec.verifiers.add(new ListMatchingVerifier(STR, Collections .<Cell> emptyList(), familyRef)); codec.verifiers.add(new ListMatchingVerifier(STR, p1.getFamilyCellMap().get(family), familyRef)); codec.verifiers.add(new ListMatchingVerifier(STR, p1.getFamilyCellMap().get(family), familyRef)); codec.verifiers.add(new ListMatchingVerifier(STR, allKvs, familyRef)); HTable primary = state.table; primary.setAutoFlush(false); primary.put(Arrays.asList(p1, p2)); primary.flushCommits(); cleanup(state); }
/** * Similar to {@link #testExpectedResultsInTableStateForSinglePut()}, but against batches of puts. * Previous implementations managed batches by playing current state against each element in the * batch, rather than combining all the per-row updates into a single mutation for the batch. This * test ensures that we see the correct expected state. * @throws Exception on failure */
Similar to <code>#testExpectedResultsInTableStateForSinglePut()</code>, but against batches of puts. Previous implementations managed batches by playing current state against each element in the batch, rather than combining all the per-row updates into a single mutation for the batch. This test ensures that we see the correct expected state
testExpectedResultsInTableStateForBatchPuts
{ "repo_name": "cloudera-labs/phoenix", "path": "phoenix-core/src/it/java/org/apache/phoenix/hbase/index/covered/EndToEndCoveredColumnsIndexBuilderIT.java", "license": "apache-2.0", "size": 12536 }
[ "java.util.ArrayList", "java.util.Arrays", "java.util.Collections", "java.util.List", "org.apache.hadoop.hbase.Cell", "org.apache.hadoop.hbase.client.HTable", "org.apache.hadoop.hbase.client.Put", "org.apache.hadoop.hbase.util.Bytes", "org.apache.phoenix.hbase.index.covered.update.ColumnReference" ]
import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.client.HTable; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.util.Bytes; import org.apache.phoenix.hbase.index.covered.update.ColumnReference;
import java.util.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.util.*; import org.apache.phoenix.hbase.index.covered.update.*;
[ "java.util", "org.apache.hadoop", "org.apache.phoenix" ]
java.util; org.apache.hadoop; org.apache.phoenix;
739,349
@Basic( optional = false ) @Column( name = "modified_time", nullable = false ) public Date getModifiedTime() { return this.modifiedTime; }
@Basic( optional = false ) @Column( name = STR, nullable = false ) Date function() { return this.modifiedTime; }
/** * Return the value associated with the column: modifiedTime. * @return A Date object (this.modifiedTime) */
Return the value associated with the column: modifiedTime
getModifiedTime
{ "repo_name": "rpgm/mi15", "path": "rpgm/modules/repository/src/main/java/org/yarlithub/yschool/repository/model/obj/yschool/User.java", "license": "apache-2.0", "size": 9631 }
[ "java.util.Date", "javax.persistence.Basic", "javax.persistence.Column" ]
import java.util.Date; import javax.persistence.Basic; import javax.persistence.Column;
import java.util.*; import javax.persistence.*;
[ "java.util", "javax.persistence" ]
java.util; javax.persistence;
153,239
public Observable<Host> hostByIp(boolean history, boolean minify, String ip) { if (ip == null || ip.isEmpty()) { throw new IllegalArgumentException("Ip can't be null or empty"); } return apiService.hostByIp(ip, apiKey, history, minify); }
Observable<Host> function(boolean history, boolean minify, String ip) { if (ip == null ip.isEmpty()) { throw new IllegalArgumentException(STR); } return apiService.hostByIp(ip, apiKey, history, minify); }
/** * Returns all services that have been found on the given host IP. If the minify param is true * this method returns only the list of ports and the general host information, no banners. If the * history param is true and minify also, then the history not takes effect * * @param history True if all historical banners should be returned (default false) * @param minify True to only return the list of ports and the general host information, no * banners (default false) * @param ip Host IP address */
Returns all services that have been found on the given host IP. If the minify param is true this method returns only the list of ports and the general host information, no banners. If the history param is true and minify also, then the history not takes effect
hostByIp
{ "repo_name": "fooock/jshodan", "path": "src/main/java/com/fooock/shodan/ShodanRestApi.java", "license": "mit", "size": 17938 }
[ "com.fooock.shodan.model.host.Host", "io.reactivex.Observable" ]
import com.fooock.shodan.model.host.Host; import io.reactivex.Observable;
import com.fooock.shodan.model.host.*; import io.reactivex.*;
[ "com.fooock.shodan", "io.reactivex" ]
com.fooock.shodan; io.reactivex;
2,133,791
protected void addTransportVFSMoveAfterFailurePropertyDescriptor(Object object) { itemPropertyDescriptors.add(createItemPropertyDescriptor( ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_InboundEndpoint_transportVFSMoveAfterFailure_feature"), getString("_UI_PropertyDescriptor_description", "_UI_InboundEndpoint_transportVFSMoveAfterFailure_feature", "_UI_InboundEndpoint_type"), EsbPackage.Literals.INBOUND_ENDPOINT__TRANSPORT_VFS_MOVE_AFTER_FAILURE, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, "Parameters", null)); }
void function(Object object) { itemPropertyDescriptors.add(createItemPropertyDescriptor( ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), EsbPackage.Literals.INBOUND_ENDPOINT__TRANSPORT_VFS_MOVE_AFTER_FAILURE, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, STR, null)); }
/** * This adds a property descriptor for the Transport VFS Move After Failure * feature. <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated NOT */
This adds a property descriptor for the Transport VFS Move After Failure feature.
addTransportVFSMoveAfterFailurePropertyDescriptor
{ "repo_name": "nwnpallewela/devstudio-tooling-esb", "path": "plugins/org.wso2.developerstudio.eclipse.gmf.esb.edit/src/org/wso2/developerstudio/eclipse/gmf/esb/provider/InboundEndpointItemProvider.java", "license": "apache-2.0", "size": 165854 }
[ "org.eclipse.emf.edit.provider.ComposeableAdapterFactory", "org.eclipse.emf.edit.provider.ItemPropertyDescriptor", "org.wso2.developerstudio.eclipse.gmf.esb.EsbPackage" ]
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.wso2.developerstudio.eclipse.gmf.esb.EsbPackage;
import org.eclipse.emf.edit.provider.*; import org.wso2.developerstudio.eclipse.gmf.esb.*;
[ "org.eclipse.emf", "org.wso2.developerstudio" ]
org.eclipse.emf; org.wso2.developerstudio;
2,530,735
public Configuration addRule(final Rule rule) { Assert.assertNotNull("rule can not be null", rule); Assert.assertNotNull("rule id can not be null", rule.getId()); final String id = rule.getId(); Assert.assertFalse("rule id must not be empty", id.equals("")); final Collection<JPackage> packages = rule.getPackages(); Assert.assertNotNull("rule packages can not be null", packages); Assert.assertFalse("rule packages must not be empty", rule.getPackages().isEmpty()); Assert.assertFalse("rule violations must not be empty", rule.getViolations().isEmpty()); final boolean added = rules.add(rule); if (added) { super.onRuleAdded(rule); } else { log.warn(String.format("failed to add Rule %s to Configuration", id)); } return this; }
Configuration function(final Rule rule) { Assert.assertNotNull(STR, rule); Assert.assertNotNull(STR, rule.getId()); final String id = rule.getId(); Assert.assertFalse(STR, id.equals(STRrule packages can not be nullSTRrule packages must not be emptySTRrule violations must not be emptySTRfailed to add Rule %s to Configuration", id)); } return this; }
/** * <p>Add a new <code>Rule</code> to {@link #rules}</p> * * @param rule Rule to add * @return Configuration this <code>Configuration</code> to allow for method chaining. */
Add a new <code>Rule</code> to <code>#rules</code>
addRule
{ "repo_name": "AndyScherzinger/architecturerules", "path": "architecture-rules/src/main/java/org/architecturerules/configuration/Configuration.java", "license": "apache-2.0", "size": 13357 }
[ "junit.framework.Assert", "org.architecturerules.domain.Rule" ]
import junit.framework.Assert; import org.architecturerules.domain.Rule;
import junit.framework.*; import org.architecturerules.domain.*;
[ "junit.framework", "org.architecturerules.domain" ]
junit.framework; org.architecturerules.domain;
576,748
public void trainClassifier(Classifier classificationModel, File trainingSetFileName, File classifierSaveFile) throws Exception { try { if(trainingSet == null) { loadDataSetFromFile(trainingSetFileName); if(trainingSetFileName == null){ writeLog("No trainning file loaded."); throw new Exception("No trainning file loaded."); } } trainingSet.setClassIndex(trainingSet.numAttributes() - 1); classificationModel.buildClassifier(trainingSet); SerializationHelper.write(classifierSaveFile.getAbsolutePath() + ".save", classificationModel); writeLog("[trainClassifier]: Se ha guardado correctamente el clasificador de tipo " + classificationModel.getClass().getSimpleName() + " en el archivo " + classifierSaveFile.getName()+".save"); } catch (Exception e) { writeLog("[trainClassifier]: El clasificador entrenado no pudo ser guardado"); e.printStackTrace(); throw e; } }
void function(Classifier classificationModel, File trainingSetFileName, File classifierSaveFile) throws Exception { try { if(trainingSet == null) { loadDataSetFromFile(trainingSetFileName); if(trainingSetFileName == null){ writeLog(STR); throw new Exception(STR); } } trainingSet.setClassIndex(trainingSet.numAttributes() - 1); classificationModel.buildClassifier(trainingSet); SerializationHelper.write(classifierSaveFile.getAbsolutePath() + ".save", classificationModel); writeLog(STR + classificationModel.getClass().getSimpleName() + STR + classifierSaveFile.getName()+".save"); } catch (Exception e) { writeLog(STR); e.printStackTrace(); throw e; } }
/** * Train a classifier object given a training data set, and save the classifier to a file * in disk. * @param classificationModel, the model to be used to train the classifier. * @param trainingSetFileName, the name of the file containing the training set. * @param classifierSaveFileName, the name of the file to save the classifier into. * @throws Exception */
Train a classifier object given a training data set, and save the classifier to a file in disk
trainClassifier
{ "repo_name": "cjortegon/Fresificator", "path": "Next_Fruit/src/co/edu/icesi/nextfruit/modules/machinelearning/WekaClassifier.java", "license": "mit", "size": 9422 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
552,528
public static <T> T readFromFile(Path path, Type typeOfSrc, T clazz) throws IOException { JsonReader reader = reader(path); clazz = gson.fromJson(reader, typeOfSrc); reader.close(); return clazz; }
static <T> T function(Path path, Type typeOfSrc, T clazz) throws IOException { JsonReader reader = reader(path); clazz = gson.fromJson(reader, typeOfSrc); reader.close(); return clazz; }
/** * Read from file. * * @param <T> the type parameter * @param path the path * @param typeOfSrc the type of src * @param clazz the clazz * @return the t * @throws java.io.IOException the iO exception */
Read from file
readFromFile
{ "repo_name": "Relicum/Ipsum", "path": "src/main/java/com/relicum/ipsum/io/GsonRaw.java", "license": "gpl-3.0", "size": 3299 }
[ "java.io.IOException", "java.lang.reflect.Type", "java.nio.file.Path", "org.bukkit.craftbukkit.libs.com.google.gson.stream.JsonReader" ]
import java.io.IOException; import java.lang.reflect.Type; import java.nio.file.Path; import org.bukkit.craftbukkit.libs.com.google.gson.stream.JsonReader;
import java.io.*; import java.lang.reflect.*; import java.nio.file.*; import org.bukkit.craftbukkit.libs.com.google.gson.stream.*;
[ "java.io", "java.lang", "java.nio", "org.bukkit.craftbukkit" ]
java.io; java.lang; java.nio; org.bukkit.craftbukkit;
2,776,112
public void startElement(String namespace, String name, String qName, Attributes atts) throws SAXException { // Make sure is correct file type if (count == 0) if (!name.equals("classifications_file")&&!qName.equals("classifications_file")) throw new SAXException("\n\nIt is in reality of the type " + name + "."); count++; // Identify the type of tag tag_identifier = 0; if (name.equals("data_set")||qName.equals("data_set")) { // Create a new SegmentedClassification and add it to root_classifications. current_root_classification = new SegmentedClassification(); root_classifications.add(current_root_classification); } else if (name.equals("section")||qName.equals("section")) { // Create a new set of sub-sets of a SegmentedClassificaiton if // subset_classifications is null if (subset_classifications == null) subset_classifications = new LinkedList<SegmentedClassification>(); // Create a new sub-set SegmentedClassificaiton. Place this // SegmentedClassificaiton in the list of sub-set SegmentedClassificaitons.. current_subset_classification = new SegmentedClassification(); subset_classifications.add(current_subset_classification); } else if (name.equals("class")||qName.equals("class")) { // Create a new set of classes if classes is null if (classes == null) classes = new LinkedList<String>(); // Notify the characters method tag_identifier = 1; } else if (name.equals("misc_info")||qName.equals("misc_info")) { // Create a new set of meta_data_keys and meta_data_info // if meta_data_keys is null if (meta_data_keys == null) { meta_data_keys = new LinkedList<String>(); meta_data_info = new LinkedList<String>(); } // Extract the name of the meta-data key from the attribute // and store it meta_data_keys.add(atts.getValue(0)); // Notify the characters method tag_identifier = 2; } else if (name.equals("data_set_id")||qName.equals("data_set_id")) tag_identifier = 3; else if (name.equals("role")||qName.equals("role")) tag_identifier = 4; else if (name.equals("start")||qName.equals("start")) tag_identifier = 5; else if (name.equals("stop")||qName.equals("stop")) tag_identifier = 6; }
void function(String namespace, String name, String qName, Attributes atts) throws SAXException { if (count == 0) if (!name.equals(STR)&&!qName.equals(STR)) throw new SAXException(STR + name + "."); count++; tag_identifier = 0; if (name.equals(STR) qName.equals(STR)) { current_root_classification = new SegmentedClassification(); root_classifications.add(current_root_classification); } else if (name.equals(STR) qName.equals(STR)) { if (subset_classifications == null) subset_classifications = new LinkedList<SegmentedClassification>(); current_subset_classification = new SegmentedClassification(); subset_classifications.add(current_subset_classification); } else if (name.equals("class") qName.equals("class")) { if (classes == null) classes = new LinkedList<String>(); tag_identifier = 1; } else if (name.equals(STR) qName.equals(STR)) { if (meta_data_keys == null) { meta_data_keys = new LinkedList<String>(); meta_data_info = new LinkedList<String>(); } meta_data_keys.add(atts.getValue(0)); tag_identifier = 2; } else if (name.equals(STR) qName.equals(STR)) tag_identifier = 3; else if (name.equals("role") qName.equals("role")) tag_identifier = 4; else if (name.equals("start") qName.equals("start")) tag_identifier = 5; else if (name.equals("stop") qName.equals("stop")) tag_identifier = 6; }
/** * This method is called when the start of an XML element * is encountered. Instantiates new objects when necessary * and lets the characters method know what kind of action * to take. * * @param name Name of the element that is encountered. * @param atts The attributes encountered. * @throws org.xml.sax.SAXException Exception thrown if is wrong type of XML file. */
This method is called when the start of an XML element is encountered. Instantiates new objects when necessary and lets the characters method know what kind of action to take
startElement
{ "repo_name": "dmcennis/jAudioGIT", "path": "src/jAudioFeatureExtractor/ACE/XMLParsers/ParseClassificationsFileHandler.java", "license": "lgpl-2.1", "size": 9314 }
[ "java.util.LinkedList", "org.xml.sax.Attributes", "org.xml.sax.SAXException" ]
import java.util.LinkedList; import org.xml.sax.Attributes; import org.xml.sax.SAXException;
import java.util.*; import org.xml.sax.*;
[ "java.util", "org.xml.sax" ]
java.util; org.xml.sax;
1,240,601
public void testLoad() throws Exception { // Use simple insert statements to insert data. // currently only this form of load is present, once we have // different implementations, the loading mechanism will need // to be configurable taking an option from the command line // arguments. DataSource ds = JDBCDataSource.getDataSource(); Load loader = new ThreadInsert(ds); loader.setupLoad(getConnection(), scale); if (loaderThreads > 0) loader.setThreadCount(loaderThreads); loader.populateAllTables(); // Way to populate data is extensible. Any other implementation // of org.apache.derbyTesting.system.oe.client.Load can be used // to load data. configurable using the oe.load.insert property // that is defined in oe.properties // One extension would be to have an implementation that // uses bulkinsert vti to load data. }
void function() throws Exception { DataSource ds = JDBCDataSource.getDataSource(); Load loader = new ThreadInsert(ds); loader.setupLoad(getConnection(), scale); if (loaderThreads > 0) loader.setThreadCount(loaderThreads); loader.populateAllTables(); }
/** * test the initial database load * * @throws Exception */
test the initial database load
testLoad
{ "repo_name": "lpxz/grail-derby104", "path": "java/testing/org/apache/derbyTesting/system/oe/run/Populate.java", "license": "apache-2.0", "size": 7635 }
[ "javax.sql.DataSource", "org.apache.derbyTesting.junit.JDBCDataSource", "org.apache.derbyTesting.system.oe.client.Load", "org.apache.derbyTesting.system.oe.load.ThreadInsert" ]
import javax.sql.DataSource; import org.apache.derbyTesting.junit.JDBCDataSource; import org.apache.derbyTesting.system.oe.client.Load; import org.apache.derbyTesting.system.oe.load.ThreadInsert;
import javax.sql.*; import org.apache.*;
[ "javax.sql", "org.apache" ]
javax.sql; org.apache;
968,886
public void onActionBugReport(MenuItem item) { sendBugReport(); }
void function(MenuItem item) { sendBugReport(); }
/** * User clicked "Bug Report" menu option * * @param item the menu item */
User clicked "Bug Report" menu option
onActionBugReport
{ "repo_name": "rapidpro/surveyor", "path": "app/src/main/java/io/rapidpro/surveyor/activity/BaseActivity.java", "license": "isc", "size": 8729 }
[ "android.view.MenuItem" ]
import android.view.MenuItem;
import android.view.*;
[ "android.view" ]
android.view;
145,329
protected boolean isValidClass(Class<?> type) { // should skip non public classes if (!Modifier.isPublic(type.getModifiers())) { return false; } if (!Modifier.isAbstract(type.getModifiers()) && !type.isInterface()) { return true; } return false; }
boolean function(Class<?> type) { if (!Modifier.isPublic(type.getModifiers())) { return false; } if (!Modifier.isAbstract(type.getModifiers()) && !type.isInterface()) { return true; } return false; }
/** * Returns <tt>true</tt>if the class is a public, non-abstract class */
Returns trueif the class is a public, non-abstract class
isValidClass
{ "repo_name": "kevinearls/camel", "path": "components/camel-spring/src/main/java/org/apache/camel/spring/PackageScanRouteBuilderFinder.java", "license": "apache-2.0", "size": 4598 }
[ "java.lang.reflect.Modifier" ]
import java.lang.reflect.Modifier;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
1,918,529
protected void addBox(Box box) { super.addBox(box); updateAveragesForBox(box); }
void function(Box box) { super.addBox(box); updateAveragesForBox(box); }
/** * Adds a new box to the area and updates the area bounds. * @param box the new box to add */
Adds a new box to the area and updates the area bounds
addBox
{ "repo_name": "Michal27/dp_vips_fitlayout", "path": "src/main/java/org/fit/segm/grouping/AreaImpl.java", "license": "lgpl-3.0", "size": 29870 }
[ "org.fit.layout.model.Box" ]
import org.fit.layout.model.Box;
import org.fit.layout.model.*;
[ "org.fit.layout" ]
org.fit.layout;
1,488,069
@Override public void onClick(View view) { ImageView image = (ImageView) view; image.startAnimation(animFadein); presenter.onImageViewClicked(Integer.parseInt(view.getTag().toString())); }
void function(View view) { ImageView image = (ImageView) view; image.startAnimation(animFadein); presenter.onImageViewClicked(Integer.parseInt(view.getTag().toString())); }
/** * Imageview event click listeners * * @param view Imageview that was clicked */
Imageview event click listeners
onClick
{ "repo_name": "snappy46/GuitarixDroid", "path": "app/src/main/java/com/marcel/guitarixdroid/view/MainActivity.java", "license": "gpl-3.0", "size": 15901 }
[ "android.view.View", "android.widget.ImageView" ]
import android.view.View; import android.widget.ImageView;
import android.view.*; import android.widget.*;
[ "android.view", "android.widget" ]
android.view; android.widget;
1,317,957
// Always use the cache, if possible. if (cachedLocation != null) { return cachedLocation; } // We're using geo location by IP, because many headless Android devices don't return anything // useful through the usual location APIs. String response = Network.get(GEO_IP_URL); if (response == null) { Log.e(TAG, "Empty response."); return null; } // Parse the latitude and longitude from the response JSON. try { JSONObject responseJson = new JSONObject(response); double latitude = responseJson.getDouble("lat"); double longitude = responseJson.getDouble("lon"); Location location = new Location(""); location.setLatitude(latitude); location.setLongitude(longitude); Log.d(TAG, "Using location: " + location); // Populate the cache. cachedLocation = location; return location; } catch (JSONException e) { Log.e(TAG, "Failed to parse geo location JSON."); return null; } }
if (cachedLocation != null) { return cachedLocation; } String response = Network.get(GEO_IP_URL); if (response == null) { Log.e(TAG, STR); return null; } try { JSONObject responseJson = new JSONObject(response); double latitude = responseJson.getDouble("lat"); double longitude = responseJson.getDouble("lon"); Location location = new Location(STRUsing location: STRFailed to parse geo location JSON."); return null; } }
/** * Makes a request to the geo location API and returns the current location or {@code null} on * error. Uses an in memory cache after the first request. */
Makes a request to the geo location API and returns the current location or null on error. Uses an in memory cache after the first request
getLocation
{ "repo_name": "maxbbraun/mirror", "path": "app/src/main/java/net/maxbraun/mirror/GeoLocation.java", "license": "apache-2.0", "size": 1790 }
[ "android.location.Location", "android.util.Log", "org.json.JSONObject" ]
import android.location.Location; import android.util.Log; import org.json.JSONObject;
import android.location.*; import android.util.*; import org.json.*;
[ "android.location", "android.util", "org.json" ]
android.location; android.util; org.json;
571,874
public void sendNewSurveyAction(HttpServletRequest request) { String action = request.getParameter("Action"); if ("SendNewSurvey".equals(action)) { String title = request.getParameter("title"); String description = request.getParameter("description"); String beginDate = request.getParameter("beginDate"); String endDate = request.getParameter("endDate"); String nbQuestions = request.getParameter("nbQuestions"); String anonymousString = request.getParameter("anonymous"); String resultMode = request.getParameter("resultMode"); int resultModeInt = Integer.parseInt(resultMode); int resultView = QuestionContainerHeader.TWICE_DISPLAY_RESULTS; if (resultModeInt == QuestionContainerHeader.IMMEDIATE_RESULTS) { resultView = QuestionContainerHeader.TWICE_DISPLAY_RESULTS; } else if (resultModeInt == QuestionContainerHeader.DELAYED_RESULTS) { resultView = QuestionContainerHeader.NOTHING_DISPLAY_RESULTS; } // Anonymous mode -> force all the survey to be anonymous if (this.isAnonymousModeEnabled()) { anonymousString = "on"; } boolean anonymous = StringUtil.isDefined(anonymousString) && "on".equalsIgnoreCase(anonymousString); if (StringUtil.isDefined(beginDate)) { try { beginDate = DateUtil.date2SQLDate(beginDate, this.getLanguage()); } catch (ParseException e) { SilverTrace.error("Survey", "SurveySessionControler.sendNewSurveyAction", "root.EX_CANT_PARSE_DATE", "impossible to parse begin date, beginDate=" + beginDate, e); beginDate = null; } } if (StringUtil.isDefined(endDate)) { try { endDate = DateUtil.date2SQLDate(endDate, this.getLanguage()); } catch (ParseException e) { endDate = null; } } QuestionContainerHeader surveyHeader = new QuestionContainerHeader(null, title, description, null, null, beginDate, endDate, false, 0, Integer.parseInt(nbQuestions), anonymous, resultModeInt, resultView); QuestionContainerDetail surveyDetail = new QuestionContainerDetail(); surveyDetail.setHeader(surveyHeader); // create the positions of the new survey onto the PdC String positions = request.getParameter("Positions"); setNewSurveyPositionsFromJSON(positions); this.setSessionSurveyUnderConstruction(surveyDetail); } }
void function(HttpServletRequest request) { String action = request.getParameter(STR); if (STR.equals(action)) { String title = request.getParameter("title"); String description = request.getParameter(STR); String beginDate = request.getParameter(STR); String endDate = request.getParameter(STR); String nbQuestions = request.getParameter(STR); String anonymousString = request.getParameter(STR); String resultMode = request.getParameter(STR); int resultModeInt = Integer.parseInt(resultMode); int resultView = QuestionContainerHeader.TWICE_DISPLAY_RESULTS; if (resultModeInt == QuestionContainerHeader.IMMEDIATE_RESULTS) { resultView = QuestionContainerHeader.TWICE_DISPLAY_RESULTS; } else if (resultModeInt == QuestionContainerHeader.DELAYED_RESULTS) { resultView = QuestionContainerHeader.NOTHING_DISPLAY_RESULTS; } if (this.isAnonymousModeEnabled()) { anonymousString = "on"; } boolean anonymous = StringUtil.isDefined(anonymousString) && "on".equalsIgnoreCase(anonymousString); if (StringUtil.isDefined(beginDate)) { try { beginDate = DateUtil.date2SQLDate(beginDate, this.getLanguage()); } catch (ParseException e) { SilverTrace.error(STR, STR, STR, STR + beginDate, e); beginDate = null; } } if (StringUtil.isDefined(endDate)) { try { endDate = DateUtil.date2SQLDate(endDate, this.getLanguage()); } catch (ParseException e) { endDate = null; } } QuestionContainerHeader surveyHeader = new QuestionContainerHeader(null, title, description, null, null, beginDate, endDate, false, 0, Integer.parseInt(nbQuestions), anonymous, resultModeInt, resultView); QuestionContainerDetail surveyDetail = new QuestionContainerDetail(); surveyDetail.setHeader(surveyHeader); String positions = request.getParameter(STR); setNewSurveyPositionsFromJSON(positions); this.setSessionSurveyUnderConstruction(surveyDetail); } }
/** * Refactoring : get code from view JSP and add it inside controller * * @param request the HttpServletRequest which contains all the request parameter */
Refactoring : get code from view JSP and add it inside controller
sendNewSurveyAction
{ "repo_name": "CecileBONIN/Silverpeas-Components", "path": "survey/survey-war/src/main/java/com/stratelia/webactiv/survey/control/SurveySessionController.java", "license": "agpl-3.0", "size": 54356 }
[ "com.silverpeas.util.StringUtil", "com.stratelia.silverpeas.silvertrace.SilverTrace", "com.stratelia.webactiv.util.DateUtil", "com.stratelia.webactiv.util.questionContainer.model.QuestionContainerDetail", "com.stratelia.webactiv.util.questionContainer.model.QuestionContainerHeader", "java.text.ParseException", "javax.servlet.http.HttpServletRequest" ]
import com.silverpeas.util.StringUtil; import com.stratelia.silverpeas.silvertrace.SilverTrace; import com.stratelia.webactiv.util.DateUtil; import com.stratelia.webactiv.util.questionContainer.model.QuestionContainerDetail; import com.stratelia.webactiv.util.questionContainer.model.QuestionContainerHeader; import java.text.ParseException; import javax.servlet.http.HttpServletRequest;
import com.silverpeas.util.*; import com.stratelia.silverpeas.silvertrace.*; import com.stratelia.webactiv.util.*; import java.text.*; import javax.servlet.http.*;
[ "com.silverpeas.util", "com.stratelia.silverpeas", "com.stratelia.webactiv", "java.text", "javax.servlet" ]
com.silverpeas.util; com.stratelia.silverpeas; com.stratelia.webactiv; java.text; javax.servlet;
1,857,732
public void queueCommand(Command<M> command) { BlockingQueue<Command<M>> executionQueue = waitForCommandQueue(); executionQueue.add(command); }
void function(Command<M> command) { BlockingQueue<Command<M>> executionQueue = waitForCommandQueue(); executionQueue.add(command); }
/** * Adds the command to the execution queue, possibly waiting for the queue * to become available. * * @param command */
Adds the command to the execution queue, possibly waiting for the queue to become available
queueCommand
{ "repo_name": "VHAINNOVATIONS/Telepathology", "path": "Source/Java/ImagingCommon/main/src/java/gov/va/med/interactive/CommandProcessor.java", "license": "apache-2.0", "size": 6438 }
[ "java.util.concurrent.BlockingQueue" ]
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,042,619
public List<JobLog> findByJobTimerId(String jobTimerId) { return (List<JobLog>) this .getEntityManager() .createQuery( "select e from JobLog e where e.clientId = :clientId and e.jobTimer.id = :jobTimerId", JobLog.class) .setParameter("clientId", Session.user.get().getClient().getId()) .setParameter("jobTimerId", jobTimerId).getResultList(); }
List<JobLog> function(String jobTimerId) { return (List<JobLog>) this .getEntityManager() .createQuery( STR, JobLog.class) .setParameter(STR, Session.user.get().getClient().getId()) .setParameter(STR, jobTimerId).getResultList(); }
/** * Find by ID of reference: jobTimer.id */
Find by ID of reference: jobTimer.id
findByJobTimerId
{ "repo_name": "seava/seava.mod.ad", "path": "seava.mod.ad.business/src/main/java/seava/ad/business/impl/scheduler/JobLog_Service.java", "license": "apache-2.0", "size": 2906 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
92,981
@Override public ClusterSearchShardsRequest indices(String... indices) { Objects.requireNonNull(indices, "indices must not be null"); for (int i = 0; i < indices.length; i++) { Objects.requireNonNull(indices[i], "indices[" + i + "] must not be null"); } this.indices = indices; return this; }
ClusterSearchShardsRequest function(String... indices) { Objects.requireNonNull(indices, STR); for (int i = 0; i < indices.length; i++) { Objects.requireNonNull(indices[i], STR + i + STR); } this.indices = indices; return this; }
/** * Sets the indices the search will be executed on. */
Sets the indices the search will be executed on
indices
{ "repo_name": "GlenRSmith/elasticsearch", "path": "server/src/main/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsRequest.java", "license": "apache-2.0", "size": 4127 }
[ "java.util.Objects" ]
import java.util.Objects;
import java.util.*;
[ "java.util" ]
java.util;
20,796
void requestMac(IpAddress ip);
void requestMac(IpAddress ip);
/** * Requests the host service to resolve the MAC address for the given IP * address. This will trigger a notification to the host listeners if the MAC * address is found. * * @param ip IP address to find the MAC address for */
Requests the host service to resolve the MAC address for the given IP address. This will trigger a notification to the host listeners if the MAC address is found
requestMac
{ "repo_name": "sdnwiselab/onos", "path": "core/api/src/main/java/org/onosproject/net/host/HostService.java", "license": "apache-2.0", "size": 3707 }
[ "org.onlab.packet.IpAddress" ]
import org.onlab.packet.IpAddress;
import org.onlab.packet.*;
[ "org.onlab.packet" ]
org.onlab.packet;
1,763,835
private static Duration extractStepFromUri(String uriString) { try { Uri uri = Uri.create(uriString, Uri.RELAXED); return uri.query() .get("step") .map(Strings$.MODULE$::parseDuration) .orElse(DEFAULT_STEP); } catch (Exception e) { return DEFAULT_STEP; } }
static Duration function(String uriString) { try { Uri uri = Uri.create(uriString, Uri.RELAXED); return uri.query() .get("step") .map(Strings$.MODULE$::parseDuration) .orElse(DEFAULT_STEP); } catch (Exception e) { return DEFAULT_STEP; } }
/** * Try to extract the step size based on the URI query parameter. If this fails for any * reason or the parameter is not present, then use the default of 1 minute. */
Try to extract the step size based on the URI query parameter. If this fails for any reason or the parameter is not present, then use the default of 1 minute
extractStepFromUri
{ "repo_name": "brharrington/atlas", "path": "atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/Evaluator.java", "license": "apache-2.0", "size": 17479 }
[ "java.time.Duration" ]
import java.time.Duration;
import java.time.*;
[ "java.time" ]
java.time;
341,901
private boolean isMonitorReady() { return (state == MonitorStateEnum.RUNNING || state == MonitorStateEnum.NEW); }
boolean function() { return (state == MonitorStateEnum.RUNNING state == MonitorStateEnum.NEW); }
/** * Checks if is monitor ready. * * @return true, if is monitor is ready */
Checks if is monitor ready
isMonitorReady
{ "repo_name": "R-daneel-olivaw/gcRadar", "path": "src/com/gcr/monitors/SimpleObjectMonitor.java", "license": "lgpl-3.0", "size": 10594 }
[ "com.gcr.monitors.modules.monitoring.structs.MonitorStateEnum" ]
import com.gcr.monitors.modules.monitoring.structs.MonitorStateEnum;
import com.gcr.monitors.modules.monitoring.structs.*;
[ "com.gcr.monitors" ]
com.gcr.monitors;
1,764,782
@Override public BigInteger getAsBigInteger() { if (elements.size() == 1) { return elements.get(0).getAsBigInteger(); } throw new IllegalStateException(); }
BigInteger function() { if (elements.size() == 1) { return elements.get(0).getAsBigInteger(); } throw new IllegalStateException(); }
/** * convenience method to get this array as a {@link BigInteger} if it contains a single element. * * @return get this element as a {@link BigInteger} if it is single element array. * @throws ClassCastException if the element in the array is of not a {@link JsonPrimitive}. * @throws NumberFormatException if the element at index 0 is not a valid {@link BigInteger}. * @throws IllegalStateException if the array has more than one element. * @since 1.2 */
convenience method to get this array as a <code>BigInteger</code> if it contains a single element
getAsBigInteger
{ "repo_name": "oloflarsson/minecraft-ancient-gates", "path": "src/org/mcteam/ancientgates/gson/JsonArray.java", "license": "gpl-3.0", "size": 9803 }
[ "java.math.BigInteger" ]
import java.math.BigInteger;
import java.math.*;
[ "java.math" ]
java.math;
2,869,403
public AuditEvent getAuditEvent() { return this.auditEvent; }
AuditEvent function() { return this.auditEvent; }
/** * Get the audit event. * @return the audit event */
Get the audit event
getAuditEvent
{ "repo_name": "mdeinum/spring-boot", "path": "spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/listener/AuditApplicationEvent.java", "license": "apache-2.0", "size": 2822 }
[ "org.springframework.boot.actuate.audit.AuditEvent" ]
import org.springframework.boot.actuate.audit.AuditEvent;
import org.springframework.boot.actuate.audit.*;
[ "org.springframework.boot" ]
org.springframework.boot;
2,773,105
public static boolean getBoolean(String name, Map values, boolean defaultValue) { final Object raw = values.get( name ); final Boolean value = toBoolean( raw, defaultValue ); if ( value == null ) { throw new ConfigurationException( "Could not determine how to handle configuration raw [name=" + name + ", value=" + raw + "] as boolean" ); } return value; }
static boolean function(String name, Map values, boolean defaultValue) { final Object raw = values.get( name ); final Boolean value = toBoolean( raw, defaultValue ); if ( value == null ) { throw new ConfigurationException( STR + name + STR + raw + STR ); } return value; }
/** * Get the config value as a boolean. * * @param name The config setting name. * @param values The map of config values * @param defaultValue The default value to use if not found * * @return The value. */
Get the config value as a boolean
getBoolean
{ "repo_name": "lamsfoundation/lams", "path": "3rdParty_sources/hibernate-core/org/hibernate/internal/util/config/ConfigurationHelper.java", "license": "gpl-2.0", "size": 14400 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,073,555
@Override public void testUnknownField() throws IOException { try { parseQuery("{ \"" + WrapperQueryBuilder.NAME + "\" : {\"bogusField\" : \"someValue\"} }"); fail("ParsingException expected."); } catch (ParsingException e) { assertTrue(e.getMessage().contains("bogusField")); } }
void function() throws IOException { try { parseQuery(STRSTR\STRbogusField\STRsomeValue\STR); fail(STR); } catch (ParsingException e) { assertTrue(e.getMessage().contains(STR)); } }
/** * Replace the generic test from superclass, wrapper query only expects * to find `query` field with nested query and should throw exception for * anything else. */
Replace the generic test from superclass, wrapper query only expects to find `query` field with nested query and should throw exception for anything else
testUnknownField
{ "repo_name": "rhoml/elasticsearch", "path": "core/src/test/java/org/elasticsearch/index/query/WrapperQueryBuilderTests.java", "license": "apache-2.0", "size": 4967 }
[ "java.io.IOException", "org.elasticsearch.common.ParsingException" ]
import java.io.IOException; import org.elasticsearch.common.ParsingException;
import java.io.*; import org.elasticsearch.common.*;
[ "java.io", "org.elasticsearch.common" ]
java.io; org.elasticsearch.common;
750,296
@Override protected void createIdResolver() { if (resolver != null && resolver.hasTaxonAndClassName(taxonId, this.clsCol.iterator().next())) { return; } else { if (resolver == null) { if (clsCol.size() > 1) { resolver = new IdResolver(); } else { resolver = new IdResolver(clsCol.iterator().next()); } } } try { boolean isCachedIdResolverRestored = restoreFromFile(); if (!isCachedIdResolverRestored || (isCachedIdResolverRestored && !resolver.hasTaxonAndClassName(taxonId, this.clsCol.iterator().next()))) { String resolverFileRoot = PropertiesUtil.getProperties().getProperty(propKey); if (StringUtils.isBlank(resolverFileRoot)) { String message = "Resolver data file root path is not specified"; LOG.warn(message); return; } LOG.info("Creating id resolver from data file and caching it."); String resolverFileName = resolverFileRoot.trim() + resolverFileSymbo; File f = new File(resolverFileName); if (f.exists()) { createFromFile(f); resolver.writeToFile(new File(ID_RESOLVER_CACHED_FILE_NAME)); } else { LOG.warn("Resolver file not exists: " + resolverFileName); } } } catch (Exception e) { throw new RuntimeException(e); } }
void function() { if (resolver != null && resolver.hasTaxonAndClassName(taxonId, this.clsCol.iterator().next())) { return; } else { if (resolver == null) { if (clsCol.size() > 1) { resolver = new IdResolver(); } else { resolver = new IdResolver(clsCol.iterator().next()); } } } try { boolean isCachedIdResolverRestored = restoreFromFile(); if (!isCachedIdResolverRestored (isCachedIdResolverRestored && !resolver.hasTaxonAndClassName(taxonId, this.clsCol.iterator().next()))) { String resolverFileRoot = PropertiesUtil.getProperties().getProperty(propKey); if (StringUtils.isBlank(resolverFileRoot)) { String message = STR; LOG.warn(message); return; } LOG.info(STR); String resolverFileName = resolverFileRoot.trim() + resolverFileSymbo; File f = new File(resolverFileName); if (f.exists()) { createFromFile(f); resolver.writeToFile(new File(ID_RESOLVER_CACHED_FILE_NAME)); } else { LOG.warn(STR + resolverFileName); } } } catch (Exception e) { throw new RuntimeException(e); } }
/** * Build an IdResolver from Toxoplasma Gene toxoplasmagondii file * @return an IdResolver for Toxoplasma Gene */
Build an IdResolver from Toxoplasma Gene toxoplasmagondii file
createIdResolver
{ "repo_name": "drhee/toxoMine", "path": "bio/core/main/src/org/intermine/bio/dataconversion/ToxoIdentifiersResolverFactory.java", "license": "lgpl-2.1", "size": 4387 }
[ "java.io.File", "org.apache.commons.lang.StringUtils", "org.intermine.util.PropertiesUtil" ]
import java.io.File; import org.apache.commons.lang.StringUtils; import org.intermine.util.PropertiesUtil;
import java.io.*; import org.apache.commons.lang.*; import org.intermine.util.*;
[ "java.io", "org.apache.commons", "org.intermine.util" ]
java.io; org.apache.commons; org.intermine.util;
819,897
@Override public int getNbHtmlObjectsDisplayed(FieldTemplate template, PagesContext pagesContext) { return 2; }
int function(FieldTemplate template, PagesContext pagesContext) { return 2; }
/** * Method declaration * * @return */
Method declaration
getNbHtmlObjectsDisplayed
{ "repo_name": "CecileBONIN/Silverpeas-Core", "path": "lib-core/src/main/java/com/silverpeas/form/displayers/ImageFieldDisplayer.java", "license": "agpl-3.0", "size": 10617 }
[ "com.silverpeas.form.FieldTemplate", "com.silverpeas.form.PagesContext" ]
import com.silverpeas.form.FieldTemplate; import com.silverpeas.form.PagesContext;
import com.silverpeas.form.*;
[ "com.silverpeas.form" ]
com.silverpeas.form;
1,840,082
if (currentOffset < dataLength) { byte[] t = new byte[Math.min((int) (Integer.MAX_VALUE & (dataLength - currentOffset)), 32 * 1024)]; while (currentOffset < dataLength) { int n = read(t, 0, t.length); if (0 == n) { throw new EOFException("Could not validate checksum"); } } } in.close(); }
if (currentOffset < dataLength) { byte[] t = new byte[Math.min((int) (Integer.MAX_VALUE & (dataLength - currentOffset)), 32 * 1024)]; while (currentOffset < dataLength) { int n = read(t, 0, t.length); if (0 == n) { throw new EOFException(STR); } } } in.close(); }
/** * Close the input stream. Note that we need to read to the end of the * stream to validate the checksum. */
Close the input stream. Note that we need to read to the end of the stream to validate the checksum
close
{ "repo_name": "rekhajoshm/mapreduce-fork", "path": "src/java/org/apache/hadoop/mapred/IFileInputStream.java", "license": "apache-2.0", "size": 5908 }
[ "java.io.EOFException" ]
import java.io.EOFException;
import java.io.*;
[ "java.io" ]
java.io;
2,146,963
private Map<String, String> constructRootRelativePathsMap() { Map<String, String> rootRelativePathsMap = Maps.newLinkedHashMap(); for (String mapString : config.manifestMaps) { int colonIndex = mapString.indexOf(':'); Preconditions.checkState(colonIndex > 0); String execPath = mapString.substring(0, colonIndex); String rootRelativePath = mapString.substring(colonIndex + 1); Preconditions.checkState(rootRelativePath.indexOf(':') == -1); rootRelativePathsMap.put(execPath, rootRelativePath); } return rootRelativePathsMap; } private class RunTimeStats { private long bestRunTime = Long.MAX_VALUE; private long worstRunTime = Long.MIN_VALUE; private long lastStartTime = 0; private List<List<String>> loopedPassesInBestRun = null;
Map<String, String> function() { Map<String, String> rootRelativePathsMap = Maps.newLinkedHashMap(); for (String mapString : config.manifestMaps) { int colonIndex = mapString.indexOf(':'); Preconditions.checkState(colonIndex > 0); String execPath = mapString.substring(0, colonIndex); String rootRelativePath = mapString.substring(colonIndex + 1); Preconditions.checkState(rootRelativePath.indexOf(':') == -1); rootRelativePathsMap.put(execPath, rootRelativePath); } return rootRelativePathsMap; } private class RunTimeStats { private long bestRunTime = Long.MAX_VALUE; private long worstRunTime = Long.MIN_VALUE; private long lastStartTime = 0; private List<List<String>> loopedPassesInBestRun = null;
/** * Construct and return the input root path map. The key is the exec path of * each input file, and the value is the corresponding root relative path. */
Construct and return the input root path map. The key is the exec path of each input file, and the value is the corresponding root relative path
constructRootRelativePathsMap
{ "repo_name": "PengXing/closure-compiler", "path": "src/com/google/javascript/jscomp/AbstractCommandLineRunner.java", "license": "apache-2.0", "size": 66786 }
[ "com.google.common.base.Preconditions", "com.google.common.collect.Maps", "java.util.List", "java.util.Map" ]
import com.google.common.base.Preconditions; import com.google.common.collect.Maps; import java.util.List; import java.util.Map;
import com.google.common.base.*; import com.google.common.collect.*; import java.util.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
568,077
private static int loadShader( int shaderType, String shaderName, String shaderSource) { int shaderProg = GLES20.glCreateShader(shaderType); GLES20.glShaderSource(shaderProg, shaderSource); GLES20.glCompileShader(shaderProg); // Check for errors int[] status = new int[1]; GLES20.glGetShaderiv(shaderProg, GLES20.GL_COMPILE_STATUS, status, 0); if (status[0] == 0) { Log.e(TAG, "Could not compile shader " + shaderName + ":"); Log.e(TAG, GLES20.glGetShaderInfoLog(shaderProg)); GLES20.glDeleteShader(shaderProg); shaderProg = 0; } return shaderProg; }
static int function( int shaderType, String shaderName, String shaderSource) { int shaderProg = GLES20.glCreateShader(shaderType); GLES20.glShaderSource(shaderProg, shaderSource); GLES20.glCompileShader(shaderProg); int[] status = new int[1]; GLES20.glGetShaderiv(shaderProg, GLES20.GL_COMPILE_STATUS, status, 0); if (status[0] == 0) { Log.e(TAG, STR + shaderName + ":"); Log.e(TAG, GLES20.glGetShaderInfoLog(shaderProg)); GLES20.glDeleteShader(shaderProg); shaderProg = 0; } return shaderProg; }
/** * Loads a GLSL shader. * @return Returns the GLES shader handle */
Loads a GLSL shader
loadShader
{ "repo_name": "ykulbashian/LiquidSurface", "path": "liquidview/src/main/java/com/google/fpl/liquidfunpaint/shader/ShaderProgram.java", "license": "apache-2.0", "size": 9425 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
2,076,951
protected static String getLocation(Target target, boolean relative) { Location location = target.getLocation(); return relative ? location.print(target.getPackage().getPackageDirectory().asFragment(), target.getPackage().getNameFragment()) : location.print(); }
static String function(Target target, boolean relative) { Location location = target.getLocation(); return relative ? location.print(target.getPackage().getPackageDirectory().asFragment(), target.getPackage().getNameFragment()) : location.print(); }
/** * Returns the target location, eventually stripping out the workspace path to obtain a relative * target (stable across machines / workspaces). * * @param target The target to extract location from. * @param relative Whether to return a relative path or not. * @return the target location */
Returns the target location, eventually stripping out the workspace path to obtain a relative target (stable across machines / workspaces)
getLocation
{ "repo_name": "dhootha/bazel", "path": "src/main/java/com/google/devtools/build/lib/query2/output/OutputFormatter.java", "license": "apache-2.0", "size": 18761 }
[ "com.google.devtools.build.lib.events.Location", "com.google.devtools.build.lib.packages.Target" ]
import com.google.devtools.build.lib.events.Location; import com.google.devtools.build.lib.packages.Target;
import com.google.devtools.build.lib.events.*; import com.google.devtools.build.lib.packages.*;
[ "com.google.devtools" ]
com.google.devtools;
2,768,493
@Override() public java.lang.Class getJavaClass( ) { return net.sourceforge.gpstools.gpx.GpxExtensions.class; }
@Override() java.lang.Class function( ) { return net.sourceforge.gpstools.gpx.GpxExtensions.class; }
/** * Method getJavaClass. * * @return the Java class represented by this descriptor. */
Method getJavaClass
getJavaClass
{ "repo_name": "Emergya/gofleet", "path": "core/src/main/java/net/sourceforge/gpstools/gpx/descriptors/GpxExtensionsDescriptor.java", "license": "gpl-2.0", "size": 3671 }
[ "net.sourceforge.gpstools.gpx.GpxExtensions" ]
import net.sourceforge.gpstools.gpx.GpxExtensions;
import net.sourceforge.gpstools.gpx.*;
[ "net.sourceforge.gpstools" ]
net.sourceforge.gpstools;
1,529,071
private static boolean canJumpOffTop(final Material blockType) { // TODO: Test if this can be removed! return BlockProperties.isGround(blockType) || BlockProperties.isSolid(blockType); }
static boolean function(final Material blockType) { return BlockProperties.isGround(blockType) BlockProperties.isSolid(blockType); }
/** * Used for a workaround that resets the set-back for the case of jumping on just placed blocks. * @param id * @return */
Used for a workaround that resets the set-back for the case of jumping on just placed blocks
canJumpOffTop
{ "repo_name": "MyPictures/NoCheatPlus", "path": "NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java", "license": "gpl-3.0", "size": 63675 }
[ "fr.neatmonster.nocheatplus.utilities.BlockProperties", "org.bukkit.Material" ]
import fr.neatmonster.nocheatplus.utilities.BlockProperties; import org.bukkit.Material;
import fr.neatmonster.nocheatplus.utilities.*; import org.bukkit.*;
[ "fr.neatmonster.nocheatplus", "org.bukkit" ]
fr.neatmonster.nocheatplus; org.bukkit;
2,080,947
@Override public String getBeginTimeString() { //return DateTimeFormat.getShortDateFormat().format(beginTime); DefaultDateTimeFormatInfo info = new DefaultDateTimeFormatInfo(); DateTimeFormat dateTimeFormat = new DateTimeFormat("MM/dd/yyyy", info) {}; return dateTimeFormat.format(beginTime); }
String function() { DefaultDateTimeFormatInfo info = new DefaultDateTimeFormatInfo(); DateTimeFormat dateTimeFormat = new DateTimeFormat(STR, info) {}; return dateTimeFormat.format(beginTime); }
/** * Returns a string representation of the start of this Appointment. * @return A string representation of the start of this Appointment. */
Returns a string representation of the start of this Appointment
getBeginTimeString
{ "repo_name": "epaulson10/CS510J", "path": "apptbook-gwt/src/main/java/edu/pdx/cs410J/erik/client/Appointment.java", "license": "mit", "size": 5637 }
[ "com.google.gwt.i18n.shared.DateTimeFormat", "com.google.gwt.i18n.shared.DefaultDateTimeFormatInfo" ]
import com.google.gwt.i18n.shared.DateTimeFormat; import com.google.gwt.i18n.shared.DefaultDateTimeFormatInfo;
import com.google.gwt.i18n.shared.*;
[ "com.google.gwt" ]
com.google.gwt;
1,125,724
private void showNotification() { // The PendingIntent to launch our activity if the user selects this notification PendingIntent contentIntent = PendingIntent.getActivity(this, 0, new Intent(this, MeetingsList.class), 0); Notification.Builder builder = new Notification.Builder(NotifyService.this); builder.setAutoCancel(true); builder.setContentTitle(getString(R.string.notification_title)); builder.setContentText(notificationText); builder.setSmallIcon(R.drawable.ic_notification_icon); Bitmap bm = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher); builder.setLargeIcon(bm); builder.setContentIntent(contentIntent); builder.setOngoing(true); builder.build(); manager.notify(NOTIFICATION, builder.build()); // Stop the service when we are finished stopSelf(); }
void function() { PendingIntent contentIntent = PendingIntent.getActivity(this, 0, new Intent(this, MeetingsList.class), 0); Notification.Builder builder = new Notification.Builder(NotifyService.this); builder.setAutoCancel(true); builder.setContentTitle(getString(R.string.notification_title)); builder.setContentText(notificationText); builder.setSmallIcon(R.drawable.ic_notification_icon); Bitmap bm = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher); builder.setLargeIcon(bm); builder.setContentIntent(contentIntent); builder.setOngoing(true); builder.build(); manager.notify(NOTIFICATION, builder.build()); stopSelf(); }
/** * Creates a notification and shows it in the OS drag-down status bar */
Creates a notification and shows it in the OS drag-down status bar
showNotification
{ "repo_name": "LucasBousselet/Uniteam", "path": "app/src/main/java/unidev/uniteam/NotifyService.java", "license": "mit", "size": 2964 }
[ "android.app.Notification", "android.app.PendingIntent", "android.content.Intent", "android.graphics.Bitmap", "android.graphics.BitmapFactory" ]
import android.app.Notification; import android.app.PendingIntent; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory;
import android.app.*; import android.content.*; import android.graphics.*;
[ "android.app", "android.content", "android.graphics" ]
android.app; android.content; android.graphics;
222,867
public List<CompilerInput> getInputs() { return inputs; }
List<CompilerInput> function() { return inputs; }
/** * Gets this module's list of source code inputs. * * @return A list that may be empty but not null */
Gets this module's list of source code inputs
getInputs
{ "repo_name": "shantanusharma/closure-compiler", "path": "src/com/google/javascript/jscomp/JSModule.java", "license": "apache-2.0", "size": 9920 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
110,363
@OnWebSocketMessage public void streamMe(InputStream stream) { }
void function(InputStream stream) { }
/** * Second method */
Second method
streamMe
{ "repo_name": "sdw2330976/Research-jetty-9.2.5", "path": "jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/annotations/BadDuplicateBinarySocket.java", "license": "apache-2.0", "size": 1440 }
[ "java.io.InputStream" ]
import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
1,567,423
public static boolean isInManagedReadableStore(String topic) { for (ManagedZone zone : EnumSet.allOf(ManagedZone.class)) { if (topic.startsWith(zone.getTopicPrefix()) && zone.getPermission().isReadable()) { return true; } } return false; }
static boolean function(String topic) { for (ManagedZone zone : EnumSet.allOf(ManagedZone.class)) { if (topic.startsWith(zone.getTopicPrefix()) && zone.getPermission().isReadable()) { return true; } } return false; }
/** * Is topic identifier in a readable managed store area? * * @param topic String * @return true if topic is in readable managed store area */
Is topic identifier in a readable managed store area
isInManagedReadableStore
{ "repo_name": "lants1/moquette", "path": "fce/src/main/java/io/moquette/fce/common/util/ManagedZoneUtil.java", "license": "apache-2.0", "size": 3897 }
[ "io.moquette.fce.model.common.ManagedZone", "java.util.EnumSet" ]
import io.moquette.fce.model.common.ManagedZone; import java.util.EnumSet;
import io.moquette.fce.model.common.*; import java.util.*;
[ "io.moquette.fce", "java.util" ]
io.moquette.fce; java.util;
2,127,680
@Override public HttpRequestBase getFeatureInfoPost(String wmsUrl, String format, String layer, String srs, double westBoundLongitude, double southBoundLatitude, double eastBoundLongitude, double northBoundLatitude, int width, int height, double pointLng, double pointLat, int pointX, int pointY, String styles, String sldBody, String feature_count, List<NameValuePair> vendorParams) throws URISyntaxException { String bboxString = String.format("%1$s,%2$s,%3$s,%4$s", westBoundLongitude, southBoundLatitude, eastBoundLongitude, northBoundLatitude); if (feature_count.equals("0") || feature_count.isEmpty()) { feature_count = this.defaultFeature_count; } List<NameValuePair> existingParam = this.extractQueryParams(wmsUrl); //preserve any existing query params existingParam.add(new BasicNameValuePair("service", "WMS")); existingParam.add(new BasicNameValuePair("request", "GetFeatureInfo")); existingParam.add(new BasicNameValuePair("version", "1.1.1")); existingParam.add(new BasicNameValuePair("layers", layer)); existingParam.add(new BasicNameValuePair("layer", layer)); existingParam.add(new BasicNameValuePair("BBOX", bboxString)); existingParam.add(new BasicNameValuePair("QUERY_LAYERS", layer)); existingParam.add(new BasicNameValuePair("INFO_FORMAT", format)); existingParam.add(new BasicNameValuePair("feature_count", feature_count)); existingParam.add(new BasicNameValuePair("lng", Double.toString(pointLng))); existingParam.add(new BasicNameValuePair("lat", Double.toString(pointLat))); existingParam.add(new BasicNameValuePair("x", Integer.toString(pointX))); existingParam.add(new BasicNameValuePair("y", Integer.toString(pointY))); existingParam.add(new BasicNameValuePair("width", Integer.toString(width))); existingParam.add(new BasicNameValuePair("height", Integer.toString(height))); existingParam.add(new BasicNameValuePair("SRS", srs)); if (vendorParams != null) { existingParam.addAll(vendorParams); } if (sldBody != null && sldBody.trim().length() > 0) { existingParam.add(new BasicNameValuePair("SLD_BODY", sldBody)); } if (styles != null && styles.trim().length() > 0) { existingParam.add(new BasicNameValuePair("styles", styles.trim())); } HttpPost method = new HttpPost(wmsUrl); UrlEncodedFormEntity entity; try { entity = new UrlEncodedFormEntity(existingParam, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new URISyntaxException(e.getMessage(), "Error parsing UrlEncodedFormEntity"); } method.setEntity(entity); return method; } @Override
HttpRequestBase function(String wmsUrl, String format, String layer, String srs, double westBoundLongitude, double southBoundLatitude, double eastBoundLongitude, double northBoundLatitude, int width, int height, double pointLng, double pointLat, int pointX, int pointY, String styles, String sldBody, String feature_count, List<NameValuePair> vendorParams) throws URISyntaxException { String bboxString = String.format(STR, westBoundLongitude, southBoundLatitude, eastBoundLongitude, northBoundLatitude); if (feature_count.equals("0") feature_count.isEmpty()) { feature_count = this.defaultFeature_count; } List<NameValuePair> existingParam = this.extractQueryParams(wmsUrl); existingParam.add(new BasicNameValuePair(STR, "WMS")); existingParam.add(new BasicNameValuePair(STR, STR)); existingParam.add(new BasicNameValuePair(STR, "1.1.1")); existingParam.add(new BasicNameValuePair(STR, layer)); existingParam.add(new BasicNameValuePair("layer", layer)); existingParam.add(new BasicNameValuePair("BBOX", bboxString)); existingParam.add(new BasicNameValuePair(STR, layer)); existingParam.add(new BasicNameValuePair(STR, format)); existingParam.add(new BasicNameValuePair(STR, feature_count)); existingParam.add(new BasicNameValuePair("lng", Double.toString(pointLng))); existingParam.add(new BasicNameValuePair("lat", Double.toString(pointLat))); existingParam.add(new BasicNameValuePair("x", Integer.toString(pointX))); existingParam.add(new BasicNameValuePair("y", Integer.toString(pointY))); existingParam.add(new BasicNameValuePair("width", Integer.toString(width))); existingParam.add(new BasicNameValuePair(STR, Integer.toString(height))); existingParam.add(new BasicNameValuePair("SRS", srs)); if (vendorParams != null) { existingParam.addAll(vendorParams); } if (sldBody != null && sldBody.trim().length() > 0) { existingParam.add(new BasicNameValuePair(STR, sldBody)); } if (styles != null && styles.trim().length() > 0) { existingParam.add(new BasicNameValuePair(STR, styles.trim())); } HttpPost method = new HttpPost(wmsUrl); UrlEncodedFormEntity entity; try { entity = new UrlEncodedFormEntity(existingParam, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new URISyntaxException(e.getMessage(), STR); } method.setEntity(entity); return method; }
/** * Generates a WMS request for downloading information about a user click on a particular * GetMap request via the post method. * * @param wmsUrl The WMS endpoint (will have any existing query parameters preserved) * @param format The desired mime type of the response * @param layer The name of the layer to download * @param srs The spatial reference system for the bounding box * @param westBoundLongitude The west bound longitude of the bounding box * @param southBoundLatitude The south bound latitude of the bounding box * @param eastBoundLongitude The east bound longitude of the bounding box * @param northBoundLatitude The north bound latitude of the bounding box * @param width The desired output image width in pixels * @param height The desired output image height in pixels * @param styles [Optional] What style should be included * @param pointLng Where the user clicked (longitude) * @param pointLat Where the user clicked (latitude) * @param pointX Where the user clicked in pixel coordinates relative to the GetMap that was used (X direction) * @param pointY Where the user clicked in pixel coordinates relative to the GetMap that was used (Y direction) * @param vendorParams Non standard parameters that are used by a vendor specific service, eg GeoServer * @return * @throws URISyntaxException */
Generates a WMS request for downloading information about a user click on a particular * GetMap request via the post method
getFeatureInfoPost
{ "repo_name": "GeoscienceAustralia/Auscope-portal-core", "path": "src/main/java/org/auscope/portal/core/services/methodmakers/WMSMethodMaker.java", "license": "lgpl-3.0", "size": 25790 }
[ "java.io.UnsupportedEncodingException", "java.net.URISyntaxException", "java.util.List", "org.apache.http.NameValuePair", "org.apache.http.client.entity.UrlEncodedFormEntity", "org.apache.http.client.methods.HttpPost", "org.apache.http.client.methods.HttpRequestBase", "org.apache.http.message.BasicNameValuePair" ]
import java.io.UnsupportedEncodingException; import java.net.URISyntaxException; import java.util.List; import org.apache.http.NameValuePair; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpRequestBase; import org.apache.http.message.BasicNameValuePair;
import java.io.*; import java.net.*; import java.util.*; import org.apache.http.*; import org.apache.http.client.entity.*; import org.apache.http.client.methods.*; import org.apache.http.message.*;
[ "java.io", "java.net", "java.util", "org.apache.http" ]
java.io; java.net; java.util; org.apache.http;
2,458,467
private void copyClangReportsOutOfGeneratedSubFolder( FilePath reportsFolder, BuildListener listener ){ try{ List<FilePath> subFolders = reportsFolder.listDirectories(); if( subFolders.isEmpty() ){ listener.getLogger().println( "Could not locate a unique scan-build output folder in: " + reportsFolder ); return; } FilePath clangDateFolder = subFolders.get( 0 ); clangDateFolder.copyRecursiveTo( reportsFolder ); clangDateFolder.deleteRecursive(); }catch( Exception e ){ listener.fatalError( "Unable to copy Clan scan-build output to build archive folder." ); } }
void function( FilePath reportsFolder, BuildListener listener ){ try{ List<FilePath> subFolders = reportsFolder.listDirectories(); if( subFolders.isEmpty() ){ listener.getLogger().println( STR + reportsFolder ); return; } FilePath clangDateFolder = subFolders.get( 0 ); clangDateFolder.copyRecursiveTo( reportsFolder ); clangDateFolder.deleteRecursive(); }catch( Exception e ){ listener.fatalError( STR ); } }
/** * Clang always creates a subfolder within the specified output folder that has a unique name. * This method locates the first subfolder of the output folder and copies its contents * to the build archive folder. */
Clang always creates a subfolder within the specified output folder that has a unique name. This method locates the first subfolder of the output folder and copies its contents to the build archive folder
copyClangReportsOutOfGeneratedSubFolder
{ "repo_name": "jkennedy1980/clang-scanbuild-plugin", "path": "src/main/java/jenkins/plugins/clangscanbuild/publisher/ClangScanBuildPublisher.java", "license": "mit", "size": 10473 }
[ "hudson.model.BuildListener", "java.util.List" ]
import hudson.model.BuildListener; import java.util.List;
import hudson.model.*; import java.util.*;
[ "hudson.model", "java.util" ]
hudson.model; java.util;
2,388,097
private void setupProblem() { try { Class<?> problemClass = Class .forName(params.getProperty("problem")); this.problem = (Problem) problemClass.newInstance(); } catch (Exception e) { logger.fatal(e); System.exit(1); } }
void function() { try { Class<?> problemClass = Class .forName(params.getProperty(STR)); this.problem = (Problem) problemClass.newInstance(); } catch (Exception e) { logger.fatal(e); System.exit(1); } }
/** * Convenience method to setup the problem from the config file. */
Convenience method to setup the problem from the config file
setupProblem
{ "repo_name": "burks-pub/gecco2015", "path": "src/main/java/ec/research/gp/simple/util/Config.java", "license": "bsd-2-clause", "size": 34172 }
[ "ec.research.gp.simple.problem.Problem" ]
import ec.research.gp.simple.problem.Problem;
import ec.research.gp.simple.problem.*;
[ "ec.research.gp" ]
ec.research.gp;
1,054,422
public int avio_get_str16le(Pointer<AVIOContext > pb, int maxlen, Pointer<Byte > buf, int buflen) { return avio_get_str16le(Pointer.getPeer(pb), maxlen, Pointer.getPeer(buf), buflen); }
int function(Pointer<AVIOContext > pb, int maxlen, Pointer<Byte > buf, int buflen) { return avio_get_str16le(Pointer.getPeer(pb), maxlen, Pointer.getPeer(buf), buflen); }
/** * Read a UTF-16 string from pb and convert it to UTF-8.<br> * The reading will terminate when either a null or invalid character was<br> * encountered or maxlen bytes have been read.<br> * @return number of bytes read (is always <= maxlen)<br> * Original signature : <code>int avio_get_str16le(AVIOContext*, int, char*, int)</code><br> * <i>native declaration : ffmpeg_build/include/libavformat/avio.h:342</i> */
Read a UTF-16 string from pb and convert it to UTF-8. The reading will terminate when either a null or invalid character was encountered or maxlen bytes have been read
avio_get_str16le
{ "repo_name": "mutars/java_libav", "path": "wrapper/src/main/java/com/mutar/libav/bridge/avformat/AvformatLibrary.java", "license": "gpl-2.0", "size": 136321 }
[ "org.bridj.Pointer" ]
import org.bridj.Pointer;
import org.bridj.*;
[ "org.bridj" ]
org.bridj;
1,917,264
List<String> devices = new ArrayList<String>(); try { List<NetworkInterface> interfaces = Collections.list(NetworkInterface.getNetworkInterfaces()); for (NetworkInterface intf : interfaces) { List<InetAddress> addrs = Collections.list(intf.getInetAddresses()); for (InetAddress addr : addrs) { if (!addr.isLoopbackAddress()) { String sAddr = addr.getHostAddress().toUpperCase(); boolean isIPv4 = InetAddressUtils.isIPv4Address(sAddr); if (useIPv4) { if (isIPv4) devices.add(sAddr); } else { if (!isIPv4) { int delim = sAddr.indexOf('%'); // drop ip6 port suffix devices.add(delim < 0 ? sAddr : sAddr.substring(0, delim)); } } } } } } catch (SocketException ex) { // TODO properly log socket exception here } return devices; }
List<String> devices = new ArrayList<String>(); try { List<NetworkInterface> interfaces = Collections.list(NetworkInterface.getNetworkInterfaces()); for (NetworkInterface intf : interfaces) { List<InetAddress> addrs = Collections.list(intf.getInetAddresses()); for (InetAddress addr : addrs) { if (!addr.isLoopbackAddress()) { String sAddr = addr.getHostAddress().toUpperCase(); boolean isIPv4 = InetAddressUtils.isIPv4Address(sAddr); if (useIPv4) { if (isIPv4) devices.add(sAddr); } else { if (!isIPv4) { int delim = sAddr.indexOf('%'); devices.add(delim < 0 ? sAddr : sAddr.substring(0, delim)); } } } } } } catch (SocketException ex) { } return devices; }
/** * Get IP address from first non-localhost interface * * @param useIPv4 true=return ipv4, false=return ipv6 * @return address or empty string */
Get IP address from first non-localhost interface
getIpAddress
{ "repo_name": "Sefford/Kor-Sample", "path": "src/main/java/com/sefford/kor/samples/utils/NetworkUtils.java", "license": "apache-2.0", "size": 4353 }
[ "java.net.InetAddress", "java.net.NetworkInterface", "java.net.SocketException", "java.util.ArrayList", "java.util.Collections", "java.util.List", "org.apache.http.conn.util.InetAddressUtils" ]
import java.net.InetAddress; import java.net.NetworkInterface; import java.net.SocketException; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.apache.http.conn.util.InetAddressUtils;
import java.net.*; import java.util.*; import org.apache.http.conn.util.*;
[ "java.net", "java.util", "org.apache.http" ]
java.net; java.util; org.apache.http;
1,049,366
@ApiModelProperty(value = "Maximum purchase amount that can be requested by the customer.") @Valid public LedgerAmount getMaxAmount() { return maxAmount; }
@ApiModelProperty(value = STR) LedgerAmount function() { return maxAmount; }
/** * Maximum purchase amount that can be requested by the customer. * * @return maxAmount **/
Maximum purchase amount that can be requested by the customer
getMaxAmount
{ "repo_name": "electrumpayments/prepaidutility-service-interface", "path": "src/main/java/io/electrum/prepaidutility/model/MeterLookupResponse.java", "license": "apache-2.0", "size": 6392 }
[ "io.electrum.vas.model.LedgerAmount", "io.swagger.annotations.ApiModelProperty" ]
import io.electrum.vas.model.LedgerAmount; import io.swagger.annotations.ApiModelProperty;
import io.electrum.vas.model.*; import io.swagger.annotations.*;
[ "io.electrum.vas", "io.swagger.annotations" ]
io.electrum.vas; io.swagger.annotations;
387,134
@ServiceMethod(returns = ReturnType.SINGLE) Mono<LegalHoldInner> clearLegalHoldAsync( String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold);
@ServiceMethod(returns = ReturnType.SINGLE) Mono<LegalHoldInner> clearLegalHoldAsync( String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold);
/** * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold * clears out only the specified tags in the request. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case * insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names * must be between 3 and 24 characters in length and use numbers and lower-case letters only. * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every * dash (-) character must be immediately preceded and followed by a letter or number. * @param legalHold The LegalHold property that will be clear from a blob container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the LegalHold property of a blob container on successful completion of {@link Mono}. */
Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request
clearLegalHoldAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/BlobContainersClient.java", "license": "mit", "size": 104918 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.storage.fluent.models.LegalHoldInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.storage.fluent.models.LegalHoldInner;
import com.azure.core.annotation.*; import com.azure.resourcemanager.storage.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
32,778
public void encryptPayload(ConfidentialityAlgorithm confidentialityAlgorithm) throws InvalidKeyException { encryptedPayload = confidentialityAlgorithm.encrypt(getPayloadData()); }
void function(ConfidentialityAlgorithm confidentialityAlgorithm) throws InvalidKeyException { encryptedPayload = confidentialityAlgorithm.encrypt(getPayloadData()); }
/** * Encrypts {@link #getPayloadData()}. * * @param confidentialityAlgorithm * {@link ConfidentialityAlgorithm} to be used to encrypt payload * data. * @throws InvalidKeyException * - when confidentiality algorithm fails. * @see IpmiPayload#getEncryptedPayload() */
Encrypts <code>#getPayloadData()</code>
encryptPayload
{ "repo_name": "fbacchella/ipmilib", "path": "src/main/java/com/veraxsystems/vxipmi/coding/payload/IpmiPayload.java", "license": "gpl-3.0", "size": 1923 }
[ "com.veraxsystems.vxipmi.coding.security.ConfidentialityAlgorithm", "java.security.InvalidKeyException" ]
import com.veraxsystems.vxipmi.coding.security.ConfidentialityAlgorithm; import java.security.InvalidKeyException;
import com.veraxsystems.vxipmi.coding.security.*; import java.security.*;
[ "com.veraxsystems.vxipmi", "java.security" ]
com.veraxsystems.vxipmi; java.security;
1,405,356
public static <T> T doWithStopwatch(String name, Callable<T> callable) throws Exception { try (Split split = SimonManager.getStopwatch(name).start()) { return callable.call(); } }
static <T> T function(String name, Callable<T> callable) throws Exception { try (Split split = SimonManager.getStopwatch(name).start()) { return callable.call(); } }
/** * Calls a block of code with stopwatch around and returns result. * * @param name name of the Stopwatch * @param callable callable block of code * @param <T> return type * @return whatever block of code returns * @throws Exception whatever block of code throws * @since 3.0 */
Calls a block of code with stopwatch around and returns result
doWithStopwatch
{ "repo_name": "ferstl/javasimon", "path": "core/src/main/java/org/javasimon/utils/SimonUtils.java", "license": "bsd-3-clause", "size": 16823 }
[ "java.util.concurrent.Callable", "org.javasimon.SimonManager", "org.javasimon.Split" ]
import java.util.concurrent.Callable; import org.javasimon.SimonManager; import org.javasimon.Split;
import java.util.concurrent.*; import org.javasimon.*;
[ "java.util", "org.javasimon" ]
java.util; org.javasimon;
445,331
public void toggleSpeaker() { // TODO: Turning on the speaker seems to enable the mic // whether or not the "mute" feature is active! // Not sure if this is an feature of the telephony API // that I need to handle specially, or just a bug. boolean newSpeakerState = !PhoneUtils.isSpeakerOn(this); log("toggleSpeaker(): newSpeakerState = " + newSpeakerState); if (newSpeakerState && isBluetoothAvailable() && isBluetoothAudioConnected()) { disconnectBluetoothAudio(); } PhoneUtils.turnOnSpeaker(this, newSpeakerState, true); // And update the InCallTouchUi widget (since the "audio mode" // button might need to change its appearance based on the new // audio state.) updateInCallTouchUi(); if (FeatureOption.MTK_VT3G324M_SUPPORT) { if (Constants.VTScreenMode.VT_SCREEN_OPEN == mVTInCallScreen.getVTScreenMode()) { mVTInCallScreen.updateVTScreen(mVTInCallScreen.getVTScreenMode()); } } }
void function() { boolean newSpeakerState = !PhoneUtils.isSpeakerOn(this); log(STR + newSpeakerState); if (newSpeakerState && isBluetoothAvailable() && isBluetoothAudioConnected()) { disconnectBluetoothAudio(); } PhoneUtils.turnOnSpeaker(this, newSpeakerState, true); updateInCallTouchUi(); if (FeatureOption.MTK_VT3G324M_SUPPORT) { if (Constants.VTScreenMode.VT_SCREEN_OPEN == mVTInCallScreen.getVTScreenMode()) { mVTInCallScreen.updateVTScreen(mVTInCallScreen.getVTScreenMode()); } } }
/** * Toggles in-call audio between speaker and the built-in earpiece (or * wired headset.) */
Toggles in-call audio between speaker and the built-in earpiece (or wired headset.)
toggleSpeaker
{ "repo_name": "rex-xxx/mt6572_x201", "path": "packages/apps/Phone/src/com/android/phone/InCallScreen.java", "license": "gpl-2.0", "size": 367799 }
[ "com.mediatek.phone.PhoneFeatureConstants" ]
import com.mediatek.phone.PhoneFeatureConstants;
import com.mediatek.phone.*;
[ "com.mediatek.phone" ]
com.mediatek.phone;
249,918
public static <A> CollUpdateClause<A> update(Path<A> path, Iterable<A> col) { return new CollUpdateClause<A>(path, col); } private CollQueryFactory() { }
static <A> CollUpdateClause<A> function(Path<A> path, Iterable<A> col) { return new CollUpdateClause<A>(path, col); } private CollQueryFactory() { }
/** * Create a new update clause * * @param path source expression * @param col source collection * @return query */
Create a new update clause
update
{ "repo_name": "lpandzic/querydsl", "path": "querydsl-collections/src/main/java/com/querydsl/collections/CollQueryFactory.java", "license": "apache-2.0", "size": 2535 }
[ "com.querydsl.core.types.Path" ]
import com.querydsl.core.types.Path;
import com.querydsl.core.types.*;
[ "com.querydsl.core" ]
com.querydsl.core;
2,782,070
@Override public int getLevel() { return logLevels[LogCategory.ALL.getId()].getId(); }
int function() { return logLevels[LogCategory.ALL.getId()].getId(); }
/** * Get the logging level for the default logging category. * @return level Current logging level for default the default logging category. */
Get the logging level for the default logging category
getLevel
{ "repo_name": "RallySoftware/eclipselink.runtime", "path": "foundation/org.eclipse.persistence.extension/src/org/eclipse/persistence/logging/slf4j/SLF4JLogger.java", "license": "epl-1.0", "size": 11218 }
[ "org.eclipse.persistence.logging.LogCategory" ]
import org.eclipse.persistence.logging.LogCategory;
import org.eclipse.persistence.logging.*;
[ "org.eclipse.persistence" ]
org.eclipse.persistence;
1,750,149
public CBookmark getBookmark(final IAddress address) { Preconditions.checkNotNull(address, "IE00384: Bookmark address can not be null"); for (final CBookmark bookmark : m_bookmarks) { if (bookmark.getAddress().equals(address)) { return bookmark; } } return null; }
CBookmark function(final IAddress address) { Preconditions.checkNotNull(address, STR); for (final CBookmark bookmark : m_bookmarks) { if (bookmark.getAddress().equals(address)) { return bookmark; } } return null; }
/** * Returns the bookmark at the given address. * * @param address The address of the bookmark to search for. * * @return The bookmark at the given address or null if there is no such bookmark. */
Returns the bookmark at the given address
getBookmark
{ "repo_name": "chubbymaggie/binnavi", "path": "src/main/java/com/google/security/zynamics/binnavi/models/Bookmarks/memory/BookmarkManager.java", "license": "apache-2.0", "size": 4426 }
[ "com.google.common.base.Preconditions", "com.google.security.zynamics.zylib.disassembly.IAddress" ]
import com.google.common.base.Preconditions; import com.google.security.zynamics.zylib.disassembly.IAddress;
import com.google.common.base.*; import com.google.security.zynamics.zylib.disassembly.*;
[ "com.google.common", "com.google.security" ]
com.google.common; com.google.security;
2,241,529
private Object getFieldValue(Object object, GraphQLOutputType outputType) { try { Field field = object.getClass().getField(fieldName); return field.get(object); } catch (NoSuchFieldException e) { return null; } catch (IllegalAccessException e) { throw new RuntimeException(e); } }
Object function(Object object, GraphQLOutputType outputType) { try { Field field = object.getClass().getField(fieldName); return field.get(object); } catch (NoSuchFieldException e) { return null; } catch (IllegalAccessException e) { throw new RuntimeException(e); } }
/** * Uses introspection to get the field value. * * @param object The object being acted on. * @param outputType The output type; ignored in this case. * @return An object, or null. */
Uses introspection to get the field value
getFieldValue
{ "repo_name": "fderose/graphql-java", "path": "src/main/java/graphql/schema/FieldDataFetcher.java", "license": "mit", "size": 1377 }
[ "java.lang.reflect.Field" ]
import java.lang.reflect.Field;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
2,279,016
@JsonCreator public static IsmRecordCoder<?> of( @JsonProperty(PropertyNames.NUM_SHARD_CODERS) int numberOfShardCoders, @JsonProperty(PropertyNames.NUM_METADATA_SHARD_CODERS) int numberOfMetadataShardCoders, @JsonProperty(PropertyNames.COMPONENT_ENCODINGS) List<Coder<?>> components) { checkArgument(components.size() >= 2, "Expecting at least 2 components, got " + components.size()); return of( numberOfShardCoders, numberOfMetadataShardCoders, components.subList(0, components.size() - 1), components.get(components.size() - 1)); } private final int numberOfShardKeyCoders; private final int numberOfMetadataShardKeyCoders; private final List<Coder<?>> keyComponentCoders; private final Coder<V> valueCoder; private IsmRecordCoder( int numberOfShardKeyCoders, int numberOfMetadataShardKeyCoders, List<Coder<?>> keyComponentCoders, Coder<V> valueCoder) { this.numberOfShardKeyCoders = numberOfShardKeyCoders; this.numberOfMetadataShardKeyCoders = numberOfMetadataShardKeyCoders; this.keyComponentCoders = keyComponentCoders; this.valueCoder = valueCoder; }
static IsmRecordCoder<?> function( @JsonProperty(PropertyNames.NUM_SHARD_CODERS) int numberOfShardCoders, @JsonProperty(PropertyNames.NUM_METADATA_SHARD_CODERS) int numberOfMetadataShardCoders, @JsonProperty(PropertyNames.COMPONENT_ENCODINGS) List<Coder<?>> components) { checkArgument(components.size() >= 2, STR + components.size()); return of( numberOfShardCoders, numberOfMetadataShardCoders, components.subList(0, components.size() - 1), components.get(components.size() - 1)); } private final int numberOfShardKeyCoders; private final int numberOfMetadataShardKeyCoders; private final List<Coder<?>> keyComponentCoders; private final Coder<V> valueCoder; private IsmRecordCoder( int numberOfShardKeyCoders, int numberOfMetadataShardKeyCoders, List<Coder<?>> keyComponentCoders, Coder<V> valueCoder) { this.numberOfShardKeyCoders = numberOfShardKeyCoders; this.numberOfMetadataShardKeyCoders = numberOfMetadataShardKeyCoders; this.keyComponentCoders = keyComponentCoders; this.valueCoder = valueCoder; }
/** * Returns an IsmRecordCoder with the specified coders. Note that this method is not meant * to be called by users but used by Jackson when decoding this coder. */
Returns an IsmRecordCoder with the specified coders. Note that this method is not meant to be called by users but used by Jackson when decoding this coder
of
{ "repo_name": "yafengguo/Apache-beam", "path": "runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/internal/IsmFormat.java", "license": "apache-2.0", "size": 30162 }
[ "com.fasterxml.jackson.annotation.JsonProperty", "com.google.common.base.Preconditions", "java.util.List", "org.apache.beam.sdk.coders.Coder", "org.apache.beam.sdk.util.PropertyNames" ]
import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Preconditions; import java.util.List; import org.apache.beam.sdk.coders.Coder; import org.apache.beam.sdk.util.PropertyNames;
import com.fasterxml.jackson.annotation.*; import com.google.common.base.*; import java.util.*; import org.apache.beam.sdk.coders.*; import org.apache.beam.sdk.util.*;
[ "com.fasterxml.jackson", "com.google.common", "java.util", "org.apache.beam" ]
com.fasterxml.jackson; com.google.common; java.util; org.apache.beam;
328,147
public PDRange getDecodeForParameter(int paramNum) { PDRange retval = null; COSArray decodeValues = getDecodeValues(); if (decodeValues != null && decodeValues.size() >= paramNum * 2 + 1) { retval = new PDRange(decodeValues, paramNum); } return retval; }
PDRange function(int paramNum) { PDRange retval = null; COSArray decodeValues = getDecodeValues(); if (decodeValues != null && decodeValues.size() >= paramNum * 2 + 1) { retval = new PDRange(decodeValues, paramNum); } return retval; }
/** * Get the decode for the input parameter. * * @param paramNum the function parameter number * @return the decode parameter range or null if none is set */
Get the decode for the input parameter
getDecodeForParameter
{ "repo_name": "TomRoush/PdfBox-Android", "path": "library/src/main/java/com/tom_roush/pdfbox/pdmodel/graphics/shading/PDTriangleBasedShadingType.java", "license": "apache-2.0", "size": 3565 }
[ "com.tom_roush.pdfbox.cos.COSArray", "com.tom_roush.pdfbox.pdmodel.common.PDRange" ]
import com.tom_roush.pdfbox.cos.COSArray; import com.tom_roush.pdfbox.pdmodel.common.PDRange;
import com.tom_roush.pdfbox.cos.*; import com.tom_roush.pdfbox.pdmodel.common.*;
[ "com.tom_roush.pdfbox" ]
com.tom_roush.pdfbox;
58,142
public IgniteH2Indexing indexing();
IgniteH2Indexing function();
/** * Gets indexing. * * @return indexing. */
Gets indexing
indexing
{ "repo_name": "pperalta/ignite", "path": "modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2RowDescriptor.java", "license": "apache-2.0", "size": 5071 }
[ "org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing" ]
import org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing;
import org.apache.ignite.internal.processors.query.h2.*;
[ "org.apache.ignite" ]
org.apache.ignite;
1,723,257
public Builder listNumericInMap(Map<String, List<Integer>> listNumericInMap) { this.listNumericInMap = listNumericInMap; return this; }
Builder function(Map<String, List<Integer>> listNumericInMap) { this.listNumericInMap = listNumericInMap; return this; }
/** * Sets the listNumericInMap. * @param listNumericInMap the new value * @return this, for chaining, not null */
Sets the listNumericInMap
listNumericInMap
{ "repo_name": "JodaOrg/joda-beans", "path": "src/test/java/org/joda/beans/sample/SimpleJson.java", "license": "apache-2.0", "size": 64387 }
[ "java.util.List", "java.util.Map" ]
import java.util.List; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,727,055
private VisitScheduleItem loadVisitScheduleItemFromVisitScheduleItemOutVO(VisitScheduleItemOutVO visitScheduleItemOutVO) { VisitScheduleItem visitScheduleItem = this.load(visitScheduleItemOutVO.getId()); if (visitScheduleItem == null) { visitScheduleItem = VisitScheduleItem.Factory.newInstance(); } return visitScheduleItem; }
VisitScheduleItem function(VisitScheduleItemOutVO visitScheduleItemOutVO) { VisitScheduleItem visitScheduleItem = this.load(visitScheduleItemOutVO.getId()); if (visitScheduleItem == null) { visitScheduleItem = VisitScheduleItem.Factory.newInstance(); } return visitScheduleItem; }
/** * Retrieves the entity object that is associated with the specified value object * from the object store. If no such entity object exists in the object store, * a new, blank entity is created */
Retrieves the entity object that is associated with the specified value object from the object store. If no such entity object exists in the object store, a new, blank entity is created
loadVisitScheduleItemFromVisitScheduleItemOutVO
{ "repo_name": "phoenixctms/ctsms", "path": "core/src/main/java/org/phoenixctms/ctsms/domain/VisitScheduleItemDaoImpl.java", "license": "lgpl-2.1", "size": 51461 }
[ "org.phoenixctms.ctsms.vo.VisitScheduleItemOutVO" ]
import org.phoenixctms.ctsms.vo.VisitScheduleItemOutVO;
import org.phoenixctms.ctsms.vo.*;
[ "org.phoenixctms.ctsms" ]
org.phoenixctms.ctsms;
1,574,041
protected URL createPingUrl(String app, String version, long id, Map<String, String> extras) throws UnsupportedEncodingException, MalformedURLException { String osName = URLEncoder.encode(getOsName(), "UTF-8"); //$NON-NLS-1$ String osArch = URLEncoder.encode(getOsArch(), "UTF-8"); //$NON-NLS-1$ String jvmArch = URLEncoder.encode(getJvmInfo(), "UTF-8"); //$NON-NLS-1$ // Include the application's name as part of the as= value. // Share the user ID for all apps, to allow unified activity reports. String extraStr = ""; //$NON-NLS-1$ if (extras != null && !extras.isEmpty()) { StringBuilder sb = new StringBuilder(); for (Map.Entry<String, String> entry : extras.entrySet()) { sb.append('&').append(entry.getKey()).append('=').append(entry.getValue()); } extraStr = sb.toString(); } URL url = new URL( "http", //$NON-NLS-1$ "tools.google.com", //$NON-NLS-1$ "/service/update?as=androidsdk_" + app + //$NON-NLS-1$ "&id=" + Long.toHexString(id) + //$NON-NLS-1$ "&version=" + version + //$NON-NLS-1$ "&os=" + osName + //$NON-NLS-1$ "&osa=" + osArch + //$NON-NLS-1$ "&vma=" + jvmArch + //$NON-NLS-1$ extraStr); return url; }
URL function(String app, String version, long id, Map<String, String> extras) throws UnsupportedEncodingException, MalformedURLException { String osName = URLEncoder.encode(getOsName(), "UTF-8"); String osArch = URLEncoder.encode(getOsArch(), "UTF-8"); String jvmArch = URLEncoder.encode(getJvmInfo(), "UTF-8"); String extraStr = STRhttpSTRtools.google.comSTR/service/update?as=androidsdk_STR&id=STR&version=STR&os=STR&osa=STR&vma=" + jvmArch + extraStr); return url; }
/** * Compute the ping URL to send the data to the server. * * @param app The application name that reports the ping (e.g. "emulator" or "ddms".) * Valid characters are a-zA-Z0-9 only. * @param version The version string already formatted as a 4 dotted group (e.g. "1.2.3.4".) * @param id of the local installation * @param extras Extra key/value parameters to send. They are send as-is and must * already be well suited and escaped using {@link URLEncoder#encode(String, String)}. */
Compute the ping URL to send the data to the server
createPingUrl
{ "repo_name": "rex-xxx/mt6572_x201", "path": "sdk/sdkstats/src/com/android/sdkstats/SdkStatsService.java", "license": "gpl-2.0", "size": 21746 }
[ "java.io.UnsupportedEncodingException", "java.net.MalformedURLException", "java.net.URLEncoder", "java.util.Map" ]
import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; import java.net.URLEncoder; import java.util.Map;
import java.io.*; import java.net.*; import java.util.*;
[ "java.io", "java.net", "java.util" ]
java.io; java.net; java.util;
921,419
public void setSerialNumber(BigInteger serialNumber) { this.serialNumber = serialNumber; }
void function(BigInteger serialNumber) { this.serialNumber = serialNumber; }
/** * Sets the serial number the attribute certificate must have. If * <code>null</code> is given any will do. * * @param serialNumber The serialNumber to set. */
Sets the serial number the attribute certificate must have. If <code>null</code> is given any will do
setSerialNumber
{ "repo_name": "Skywalker-11/spongycastle", "path": "prov/src/main/java/org/spongycastle/x509/X509AttributeCertStoreSelector.java", "license": "mit", "size": 14996 }
[ "java.math.BigInteger" ]
import java.math.BigInteger;
import java.math.*;
[ "java.math" ]
java.math;
390,006
public static void runEventLogService(InetSocketAddress adbSockAddr, Device device, LogReceiver rcvr) throws TimeoutException, AdbCommandRejectedException, IOException { runLogService(adbSockAddr, device, "events", rcvr); //$NON-NLS-1$ }
static void function(InetSocketAddress adbSockAddr, Device device, LogReceiver rcvr) throws TimeoutException, AdbCommandRejectedException, IOException { runLogService(adbSockAddr, device, STR, rcvr); }
/** * Runs the Event log service on the {@link Device}, and provides its output to the * {@link LogReceiver}. * <p/>This call is blocking until {@link LogReceiver#isCancelled()} returns true. * @param adbSockAddr the socket address to connect to adb * @param device the Device on which to run the service * @param rcvr the {@link LogReceiver} to receive the log output * @throws TimeoutException in case of timeout on the connection. * @throws AdbCommandRejectedException if adb rejects the command * @throws IOException in case of I/O error on the connection. */
Runs the Event log service on the <code>Device</code>, and provides its output to the <code>LogReceiver</code>. This call is blocking until <code>LogReceiver#isCancelled()</code> returns true
runEventLogService
{ "repo_name": "consulo/consulo-android", "path": "tools-base/ddmlib/src/main/java/com/android/ddmlib/AdbHelper.java", "license": "apache-2.0", "size": 35214 }
[ "com.android.ddmlib.log.LogReceiver", "java.io.IOException", "java.net.InetSocketAddress" ]
import com.android.ddmlib.log.LogReceiver; import java.io.IOException; import java.net.InetSocketAddress;
import com.android.ddmlib.log.*; import java.io.*; import java.net.*;
[ "com.android.ddmlib", "java.io", "java.net" ]
com.android.ddmlib; java.io; java.net;
1,265,486
private List<String> getCorrespondingParts(String inputString, List<String> templateParts) { List<String> stringParts = new ArrayList<String>(); int counter = 0; while (StringUtils.isNotBlank(inputString) && counter < templateParts.size()) { String currentTemplatePart = templateParts.get(counter); int length = Math.min(getPatternsEffectiveLength(currentTemplatePart), inputString.length()); stringParts.add(inputString.substring(0, length)); inputString = inputString.substring(length); counter++; } if (StringUtils.isNotBlank(inputString)) { stringParts.add(inputString); } return stringParts; }
List<String> function(String inputString, List<String> templateParts) { List<String> stringParts = new ArrayList<String>(); int counter = 0; while (StringUtils.isNotBlank(inputString) && counter < templateParts.size()) { String currentTemplatePart = templateParts.get(counter); int length = Math.min(getPatternsEffectiveLength(currentTemplatePart), inputString.length()); stringParts.add(inputString.substring(0, length)); inputString = inputString.substring(length); counter++; } if (StringUtils.isNotBlank(inputString)) { stringParts.add(inputString); } return stringParts; }
/** * Divides a string into corresponding parts for the template to carry out comparison. * templateParts = [/data/cas/, ${YEAR}, /, ${MONTH}, /, ${DAY}] * inputString = /data/cas/2014/09/09 * returns [/data/cas/, 2014, /, 09, /, 09] * @param inputString normal string representing feed instance path * @param templateParts parts of feed's path template broken into regex and non-regex units. * @return a list of strings where each part of the list corresponds to a part in list of template parts. */
Divides a string into corresponding parts for the template to carry out comparison. templateParts = [/data/cas/, ${YEAR}, /, ${MONTH}, /, ${DAY}] inputString = /data/cas/2014/09/09 returns [/data/cas/, 2014, /, 09, /, 09]
getCorrespondingParts
{ "repo_name": "sriksun/falcon", "path": "common/src/main/java/org/apache/falcon/util/FalconRadixUtils.java", "license": "apache-2.0", "size": 13636 }
[ "java.util.ArrayList", "java.util.List", "org.apache.commons.lang3.StringUtils" ]
import java.util.ArrayList; import java.util.List; import org.apache.commons.lang3.StringUtils;
import java.util.*; import org.apache.commons.lang3.*;
[ "java.util", "org.apache.commons" ]
java.util; org.apache.commons;
2,117,281
EAttribute getILabResult_Date();
EAttribute getILabResult_Date();
/** * Returns the meta object for the attribute '{@link ch.elexis.core.model.ILabResult#getDate <em>Date</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Date</em>'. * @see ch.elexis.core.model.ILabResult#getDate() * @see #getILabResult() * @generated */
Returns the meta object for the attribute '<code>ch.elexis.core.model.ILabResult#getDate Date</code>'.
getILabResult_Date
{ "repo_name": "sazgin/elexis-3-core", "path": "ch.elexis.core/src-gen/ch/elexis/core/model/ModelPackage.java", "license": "epl-1.0", "size": 108231 }
[ "org.eclipse.emf.ecore.EAttribute" ]
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,368,566
public Collection<Validator<?>> newValidators(ValidateModel validateModel) { Collection<Validator<?>> validators = null; if (validateModel instanceof JavaValidateModel) { JavaValidateModel javaValidateModel = JavaValidateModel.class.cast(validateModel); String bean = javaValidateModel.getBean(); if (bean != null) { BeanManager beanManager = CDIUtil.lookupBeanManager(); if (beanManager == null) { throw ValidateMessages.MESSAGES.cdiBeanManagerNotFound(); } Object validator = null; Set<Bean<?>> beans = beanManager.getBeans(bean); if (beans != null && !beans.isEmpty()) { Bean<?> target = beans.iterator().next(); CreationalContext<?> context = beanManager.createCreationalContext(target); validator = beanManager.getReference(target, Object.class, context); _cdiCreationalContexts.add(context); } if (validator == null) { throw ValidateMessages.MESSAGES.validatorBeanNotFound(bean); } validators = ValidatorUtil.newValidators(validator, validateModel.getName()); } else { String className = ((JavaValidateModel) validateModel).getClazz(); if (className == null) { throw ValidateMessages.MESSAGES.beanOrClassRequired(); } try { Class<?> validateClass = Classes.forName(className, ValidatorUtil.class); validators = ValidatorUtil.newValidators(validateClass, validateModel.getName()); } catch (Exception e) { throw ValidateMessages.MESSAGES.errorConstructingValidator(className, e); } } } else { ValidatorFactory factory = newValidatorFactory(validateModel); validators = new ArrayList<Validator<?>>(); validators.add(factory.newValidator(validateModel)); } if (validators == null || validators.isEmpty()) { throw ValidateMessages.MESSAGES.unknownValidateModel(validateModel.getClass().getName()); } return validators; }
Collection<Validator<?>> function(ValidateModel validateModel) { Collection<Validator<?>> validators = null; if (validateModel instanceof JavaValidateModel) { JavaValidateModel javaValidateModel = JavaValidateModel.class.cast(validateModel); String bean = javaValidateModel.getBean(); if (bean != null) { BeanManager beanManager = CDIUtil.lookupBeanManager(); if (beanManager == null) { throw ValidateMessages.MESSAGES.cdiBeanManagerNotFound(); } Object validator = null; Set<Bean<?>> beans = beanManager.getBeans(bean); if (beans != null && !beans.isEmpty()) { Bean<?> target = beans.iterator().next(); CreationalContext<?> context = beanManager.createCreationalContext(target); validator = beanManager.getReference(target, Object.class, context); _cdiCreationalContexts.add(context); } if (validator == null) { throw ValidateMessages.MESSAGES.validatorBeanNotFound(bean); } validators = ValidatorUtil.newValidators(validator, validateModel.getName()); } else { String className = ((JavaValidateModel) validateModel).getClazz(); if (className == null) { throw ValidateMessages.MESSAGES.beanOrClassRequired(); } try { Class<?> validateClass = Classes.forName(className, ValidatorUtil.class); validators = ValidatorUtil.newValidators(validateClass, validateModel.getName()); } catch (Exception e) { throw ValidateMessages.MESSAGES.errorConstructingValidator(className, e); } } } else { ValidatorFactory factory = newValidatorFactory(validateModel); validators = new ArrayList<Validator<?>>(); validators.add(factory.newValidator(validateModel)); } if (validators == null validators.isEmpty()) { throw ValidateMessages.MESSAGES.unknownValidateModel(validateModel.getClass().getName()); } return validators; }
/** * Create a Collection of {@link Validator} instances from the supplied {@link ValidateModel} instance. * @param validateModel The ValidateModel instance. * @return The Validator instance. */
Create a Collection of <code>Validator</code> instances from the supplied <code>ValidateModel</code> instance
newValidators
{ "repo_name": "cunningt/switchyard", "path": "core/validate/src/main/java/org/switchyard/validate/internal/ValidatorRegistryLoader.java", "license": "apache-2.0", "size": 9603 }
[ "java.util.ArrayList", "java.util.Collection", "java.util.Set", "javax.enterprise.context.spi.CreationalContext", "javax.enterprise.inject.spi.Bean", "javax.enterprise.inject.spi.BeanManager", "org.switchyard.common.cdi.CDIUtil", "org.switchyard.common.type.Classes", "org.switchyard.config.model.validate.ValidateModel", "org.switchyard.validate.Validator", "org.switchyard.validate.config.model.JavaValidateModel" ]
import java.util.ArrayList; import java.util.Collection; import java.util.Set; import javax.enterprise.context.spi.CreationalContext; import javax.enterprise.inject.spi.Bean; import javax.enterprise.inject.spi.BeanManager; import org.switchyard.common.cdi.CDIUtil; import org.switchyard.common.type.Classes; import org.switchyard.config.model.validate.ValidateModel; import org.switchyard.validate.Validator; import org.switchyard.validate.config.model.JavaValidateModel;
import java.util.*; import javax.enterprise.context.spi.*; import javax.enterprise.inject.spi.*; import org.switchyard.common.cdi.*; import org.switchyard.common.type.*; import org.switchyard.config.model.validate.*; import org.switchyard.validate.*; import org.switchyard.validate.config.model.*;
[ "java.util", "javax.enterprise", "org.switchyard.common", "org.switchyard.config", "org.switchyard.validate" ]
java.util; javax.enterprise; org.switchyard.common; org.switchyard.config; org.switchyard.validate;
605,467
public List<KickstartIpRange> listIpRanges(User user) { return KickstartFactory.lookupRangeByOrg(user.getOrg()); }
List<KickstartIpRange> function(User user) { return KickstartFactory.lookupRangeByOrg(user.getOrg()); }
/** * returns a list of IP ranges accessible to the * user * @param user the current user needed for org information * @return the the list of ip ranges accessible to the user. */
returns a list of IP ranges accessible to the user
listIpRanges
{ "repo_name": "colloquium/spacewalk", "path": "java/code/src/com/redhat/rhn/manager/kickstart/KickstartManager.java", "license": "gpl-2.0", "size": 9043 }
[ "com.redhat.rhn.domain.kickstart.KickstartFactory", "com.redhat.rhn.domain.kickstart.KickstartIpRange", "com.redhat.rhn.domain.user.User", "java.util.List" ]
import com.redhat.rhn.domain.kickstart.KickstartFactory; import com.redhat.rhn.domain.kickstart.KickstartIpRange; import com.redhat.rhn.domain.user.User; import java.util.List;
import com.redhat.rhn.domain.kickstart.*; import com.redhat.rhn.domain.user.*; import java.util.*;
[ "com.redhat.rhn", "java.util" ]
com.redhat.rhn; java.util;
2,822,102
public InetSocketAddress getXferAddress() { return streamingAddr; }
InetSocketAddress function() { return streamingAddr; }
/** * NB: The datanode can perform data transfer on the streaming * address however clients are given the IPC IP address for data * transfer, and that may be a different address. * * @return socket address for data transfer */
address however clients are given the IPC IP address for data transfer, and that may be a different address
getXferAddress
{ "repo_name": "ZhangXFeng/hadoop", "path": "src/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java", "license": "apache-2.0", "size": 119397 }
[ "java.net.InetSocketAddress" ]
import java.net.InetSocketAddress;
import java.net.*;
[ "java.net" ]
java.net;
479,663
public static UTC parse(String text, String pattern) throws ParseException { Guardian.assertNotNullOrEmpty("text", text); Guardian.assertNotNullOrEmpty("pattern", pattern); final int dotPos = text.lastIndexOf("."); String noFractionString = text; long micros = 0; if (dotPos > 0) { noFractionString = text.substring(0, dotPos); final String fractionString = text.substring(dotPos + 1, text.length()); if (fractionString.length() > 6) { // max. 6 digits! throw new ParseException("Unparseable date:" + text, dotPos); } try { micros = Integer.parseInt(fractionString); } catch (NumberFormatException e) { throw new ParseException("Unparseable date:" + text, dotPos); } for (int i = fractionString.length(); i < 6; i++) { micros *= 10; } } final DateFormat dateFormat = createDateFormat(pattern); final Date date = dateFormat.parse(noFractionString); return create(date, micros); }
static UTC function(String text, String pattern) throws ParseException { Guardian.assertNotNullOrEmpty("text", text); Guardian.assertNotNullOrEmpty(STR, pattern); final int dotPos = text.lastIndexOf("."); String noFractionString = text; long micros = 0; if (dotPos > 0) { noFractionString = text.substring(0, dotPos); final String fractionString = text.substring(dotPos + 1, text.length()); if (fractionString.length() > 6) { throw new ParseException(STR + text, dotPos); } try { micros = Integer.parseInt(fractionString); } catch (NumberFormatException e) { throw new ParseException(STR + text, dotPos); } for (int i = fractionString.length(); i < 6; i++) { micros *= 10; } } final DateFormat dateFormat = createDateFormat(pattern); final Date date = dateFormat.parse(noFractionString); return create(date, micros); }
/** * Parses a UTC value given as text. The method also considers an optional * mircoseconds fraction at the end of the text string. The mircoseconds fraction * is a dot '.' followed by a maximum of 6 digits. * * @param text a UTC value given as text * @param pattern the date/time pattern * * @return the UTC value represented by the given text * * @throws ParseException * @see #createCalendar * @see #createDateFormat */
Parses a UTC value given as text. The method also considers an optional mircoseconds fraction at the end of the text string. The mircoseconds fraction is a dot '.' followed by a maximum of 6 digits
parse
{ "repo_name": "seadas/beam", "path": "beam-core/src/main/java/org/esa/beam/framework/datamodel/ProductData.java", "license": "gpl-3.0", "size": 100346 }
[ "java.text.DateFormat", "java.text.ParseException", "java.util.Date", "org.esa.beam.util.Guardian" ]
import java.text.DateFormat; import java.text.ParseException; import java.util.Date; import org.esa.beam.util.Guardian;
import java.text.*; import java.util.*; import org.esa.beam.util.*;
[ "java.text", "java.util", "org.esa.beam" ]
java.text; java.util; org.esa.beam;
2,682,753
GetRouteTableForSubnetResponse getRouteTableForSubnet(String vnetName, String subnetName) throws IOException, ServiceException, ParserConfigurationException, SAXException;
GetRouteTableForSubnetResponse getRouteTableForSubnet(String vnetName, String subnetName) throws IOException, ServiceException, ParserConfigurationException, SAXException;
/** * Get the specified route table for the provided subnet in the provided * virtual network in this subscription. * * @param vnetName Required. The name of the virtual network that contains * the provided subnet. * @param subnetName Required. The name of the subnet. * @throws IOException Signals that an I/O exception of some sort has * occurred. This class is the general class of exceptions produced by * failed or interrupted I/O operations. * @throws ServiceException Thrown if an unexpected response is found. * @throws ParserConfigurationException Thrown if there was a serious * configuration error with the document parser. * @throws SAXException Thrown if there was an error parsing the XML * response. * @return A standard service response including an HTTP status code and * request ID. */
Get the specified route table for the provided subnet in the provided virtual network in this subscription
getRouteTableForSubnet
{ "repo_name": "flydream2046/azure-sdk-for-java", "path": "service-management/azure-svc-mgmt-network/src/main/java/com/microsoft/windowsazure/management/network/RouteOperations.java", "license": "apache-2.0", "size": 37653 }
[ "com.microsoft.windowsazure.exception.ServiceException", "com.microsoft.windowsazure.management.network.models.GetRouteTableForSubnetResponse", "java.io.IOException", "javax.xml.parsers.ParserConfigurationException", "org.xml.sax.SAXException" ]
import com.microsoft.windowsazure.exception.ServiceException; import com.microsoft.windowsazure.management.network.models.GetRouteTableForSubnetResponse; import java.io.IOException; import javax.xml.parsers.ParserConfigurationException; import org.xml.sax.SAXException;
import com.microsoft.windowsazure.exception.*; import com.microsoft.windowsazure.management.network.models.*; import java.io.*; import javax.xml.parsers.*; import org.xml.sax.*;
[ "com.microsoft.windowsazure", "java.io", "javax.xml", "org.xml.sax" ]
com.microsoft.windowsazure; java.io; javax.xml; org.xml.sax;
1,324,670
private void updateCheckedFilesCopyAuthorization() { if(!hasCheckedFiles()) return; boolean allReadable = true; for(FileDto file : checkedFiles) { if(!allReadable) break; allReadable = file.getReadable(); } if(allReadable) { getView().getFileCopyAuthorizer().authorized(); } else { getView().getFileCopyAuthorizer().unauthorized(); } }
void function() { if(!hasCheckedFiles()) return; boolean allReadable = true; for(FileDto file : checkedFiles) { if(!allReadable) break; allReadable = file.getReadable(); } if(allReadable) { getView().getFileCopyAuthorizer().authorized(); } else { getView().getFileCopyAuthorizer().unauthorized(); } }
/** * Authorize copy if all that is selected can be downloaded. */
Authorize copy if all that is selected can be downloaded
updateCheckedFilesCopyAuthorization
{ "repo_name": "apruden/opal", "path": "opal-gwt-client/src/main/java/org/obiba/opal/web/gwt/app/client/fs/presenter/FileExplorerPresenter.java", "license": "gpl-3.0", "size": 13607 }
[ "org.obiba.opal.web.model.client.opal.FileDto" ]
import org.obiba.opal.web.model.client.opal.FileDto;
import org.obiba.opal.web.model.client.opal.*;
[ "org.obiba.opal" ]
org.obiba.opal;
1,079,638
public static void cargar(final MenuCarga menuCarga) throws NumberFormatException, IOException { int elementosCargados = 0; // Items setNoItem(ImageIO.read(new File("recursos//noItem.png"))); setMochila(ImageIO.read(new File("recursos//mochila.png"))); setMenu(ImageIO.read(new File("recursos//menu.png"))); setChat(ImageIO.read(new File("recursos//chat.png"))); // Inicio humano spriteHumano = new SpriteSheet( CargadorImagen.cargarImagen("/Humano.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); humanoIzq = new BufferedImage[CUATRO]; humanoArribaIzq = new BufferedImage[CUATRO]; humanoArriba = new BufferedImage[CUATRO]; humanoArribaDer = new BufferedImage[CUATRO]; humanoDer = new BufferedImage[CUATRO]; humanoAbajoDer = new BufferedImage[CUATRO]; humanoAbajo = new BufferedImage[CUATRO]; humanoAbajoIzq = new BufferedImage[CUATRO]; for (int i = 0; i < CUATRO; i++) { humanoIzq[i] = spriteHumano.getTile(ANCHO * i, 0, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { humanoArribaIzq[i] = spriteHumano.getTile(ANCHO * i, ALTO, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { humanoArriba[i] = spriteHumano.getTile(ANCHO * i, ALTO * 2, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { humanoArribaDer[i] = spriteHumano.getTile(ANCHO * i, ALTO * TRES, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { humanoDer[i] = spriteHumano.getTile(ANCHO * i, ALTO * CUATRO, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { humanoAbajoDer[i] = spriteHumano.getTile(ANCHO * i, ALTO * CINCO, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { humanoAbajo[i] = spriteHumano.getTile(ANCHO * i, ALTO * SEIS, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { humanoAbajoIzq[i] = spriteHumano.getTile(ANCHO * i, ALTO * SIETE, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); humano.add(humanoIzq); humano.add(humanoArribaIzq); humano.add(humanoArriba); humano.add(humanoArribaDer); humano.add(humanoDer); humano.add(humanoAbajoDer); humano.add(humanoAbajo); humano.add(humanoAbajoIzq); // Fin humano // Inicio Ogro spriteOgro = new SpriteSheet(CargadorImagen.cargarImagen("/Ogro.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); orcoIzq = new BufferedImage[CUATRO]; orcoArribaIzq = new BufferedImage[CUATRO]; orcoArriba = new BufferedImage[CUATRO]; orcoArribaDer = new BufferedImage[CUATRO]; orcoDer = new BufferedImage[CUATRO]; orcoAbajoDer = new BufferedImage[CUATRO]; orcoAbajo = new BufferedImage[CUATRO]; orcoAbajoIzq = new BufferedImage[CUATRO]; for (int i = 0; i < CUATRO; i++) { orcoIzq[i] = spriteOgro.getTile(ANCHO * i, 0, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { orcoArribaIzq[i] = spriteOgro.getTile(ANCHO * i, ALTO, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { orcoArriba[i] = spriteOgro.getTile(ANCHO * i, ALTO * 2, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { orcoArribaDer[i] = spriteOgro.getTile(ANCHO * i, ALTO * TRES, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { orcoDer[i] = spriteOgro.getTile(ANCHO * i, ALTO * CUATRO, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { orcoAbajoDer[i] = spriteOgro.getTile(ANCHO * i, ALTO * CINCO, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { orcoAbajo[i] = spriteOgro.getTile(ANCHO * i, ALTO * SEIS, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { orcoAbajoIzq[i] = spriteOgro.getTile(ANCHO * i, ALTO * SIETE, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); orco.add(orcoIzq); orco.add(orcoArribaIzq); orco.add(orcoArriba); orco.add(orcoArribaDer); orco.add(orcoDer); orco.add(orcoAbajoDer); orco.add(orcoAbajo); orco.add(orcoAbajoIzq); // Fin Ogro // Inicio Elfo spriteElfo = new SpriteSheet(CargadorImagen.cargarImagen("/elfo2.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); elfoIzq = new BufferedImage[CUATRO]; elfoArribaIzq = new BufferedImage[CUATRO]; elfoArriba = new BufferedImage[CUATRO]; elfoArribaDer = new BufferedImage[CUATRO]; elfoDer = new BufferedImage[CUATRO]; elfoAbajoDer = new BufferedImage[CUATRO]; elfoAbajo = new BufferedImage[CUATRO]; elfoAbajoIzq = new BufferedImage[CUATRO]; for (int i = 0; i < CUATRO; i++) { elfoIzq[i] = spriteElfo.getTile(ANCHO * i, 0, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { elfoArribaIzq[i] = spriteElfo.getTile(ANCHO * i, ALTO, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { elfoArriba[i] = spriteElfo.getTile(ANCHO * i, ALTO * 2, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { elfoArribaDer[i] = spriteElfo.getTile(ANCHO * i, ALTO * TRES, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { elfoDer[i] = spriteElfo.getTile(ANCHO * i, ALTO * CUATRO, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { elfoAbajoDer[i] = spriteElfo.getTile(ANCHO * i, ALTO * CINCO, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { elfoAbajo[i] = spriteElfo.getTile(ANCHO * i, ALTO * SEIS, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { elfoAbajoIzq[i] = spriteElfo.getTile(ANCHO * i, ALTO * SIETE, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); elfo.add(elfoIzq); elfo.add(elfoArribaIzq); elfo.add(elfoArriba); elfo.add(elfoArribaDer); elfo.add(elfoDer); elfo.add(elfoAbajoDer); elfo.add(elfoAbajo); elfo.add(elfoAbajoIzq); // Fin Elfo // Inicio ElBryan spriteElBryan = new SpriteSheet( CargadorImagen.cargarImagen("/ElBryan.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); elBryanIzq = new BufferedImage[CUATRO]; elBryanArribaIzq = new BufferedImage[CUATRO]; elBryanArriba = new BufferedImage[CUATRO]; elBryanArribaDer = new BufferedImage[CUATRO]; elBryanDer = new BufferedImage[CUATRO]; elBryanAbajoDer = new BufferedImage[CUATRO]; elBryanAbajo = new BufferedImage[CUATRO]; elBryanAbajoIzq = new BufferedImage[CUATRO]; for (int i = 0; i < CUATRO; i++) { elBryanIzq[i] = spriteElBryan.getTile(ANCHO * i, 0, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { elBryanArribaIzq[i] = spriteElBryan.getTile(ANCHO * i, ALTO, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { elBryanArriba[i] = spriteElBryan.getTile(ANCHO * i, ALTO * 2, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { elBryanArribaDer[i] = spriteElBryan.getTile(ANCHO * i, ALTO * TRES, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { elBryanDer[i] = spriteElBryan.getTile(ANCHO * i, ALTO * CUATRO, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { elBryanAbajoDer[i] = spriteElBryan.getTile(ANCHO * i, ALTO * CINCO, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { elBryanAbajo[i] = spriteElBryan.getTile(ANCHO * i, ALTO * SEIS, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { elBryanAbajoIzq[i] = spriteElBryan.getTile(ANCHO * i, ALTO * SIETE, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); elBryan.add(elBryanIzq); elBryan.add(elBryanArribaIzq); elBryan.add(elBryanArriba); elBryan.add(elBryanArribaDer); elBryan.add(elBryanDer); elBryan.add(elBryanAbajoDer); elBryan.add(elBryanAbajo); elBryan.add(elBryanAbajoIzq); // Fin ElBryan // Agrego los pj al hash personaje.put("Humano", humano); personaje.put("Orco", orco); personaje.put("Elfo", elfo); personaje.put("El Bryan", elBryan); // Inicio Entorno setCesped(CargadorImagen.cargarImagen("/Cesped.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); setRoca(CargadorImagen.cargarImagen("/rock.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); setBackground(CargadorImagen.cargarImagen("/background.jpg")); actualizarBarraDeCarga(++elementosCargados, menuCarga); setMarco(CargadorImagen.cargarImagen("/marco.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); setBotonMenu(CargadorImagen.cargarImagen("/botonMenu.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); setMenuEnemigo(CargadorImagen.cargarImagen("/MenuEnemigo.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); trees = new SpriteSheet(CargadorImagen.cargarImagen("/trees.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); setGreenTree(trees.getTile(0, 0, CUARENTAYDOS, CINCUENTA)); actualizarBarraDeCarga(++elementosCargados, menuCarga); setNievePiso1(CargadorImagen.cargarImagen("/nieve piso.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); setIceBlock(CargadorImagen.cargarImagen("/nieve cubo.png")); // Mapa if (MenuMapas.numberMap == 1) { SpriteSheet mapaAubenor = new SpriteSheet( CargadorImagen.cargarImagen("/Aubenor.png")); Tile.aubenor = new Tile[OCHENTAYUNO]; boolean[][] solidezAubenor = { {true, true, false, true, false, true, true, true, true, true}, {true, true, true, true, true, true, true, true, true, true}, {true, true, true, true, true, true, true, true, true, true}, {true, false, false, false, false, false, false, false, true, true}, {false, false, false, false, false, false, false, false, true, true}, {false, true, true, true, true, true, true, true, true, true}, {true, true, true, true, true, true, true, true, true, true}, {true, true, true, true, true, true, true, true, true, true}}; for (int y = 0; y < OCHO; y++) { for (int x = 0; x < DIEZ; x++) { Tile.aubenor[y * DIEZ + x + 1] = new Tile( mapaAubenor.getTile(x * SESENTAYCUATRO, y * SESENTAYCUATRO, SESENTAYCUATRO, SESENTAYCUATRO), y * DIEZ + x + 1, solidezAubenor[y][x], SESENTAYCUATRO, SESENTAYCUATRO); } } } else { SpriteSheet mapaAris = new SpriteSheet( CargadorImagen.cargarImagen("/Aris.png")); Tile.aris = new Tile[OCHENTAYUNO]; boolean[][] solidezAris = { {true, false, false, false, false, false, false, true, true, true}, {false, false, false, false, false, false, false, false, true, true}, {false, false, false, false, true, true, true, true, true, true}, {true, true, true, true, true, true, true, true, true, true}, {true, true, true, true, true, true, true, true, true, true}, {false, true, true, true, true, true, true, true, true, true}, {true, true, true, true, true, true, true, true, true, true}, {true, true, true, true, true, true, true, true, true, true}}; for (int y = 0; y < OCHO; y++) { for (int x = 0; x < DIEZ; x++) { Tile.aris[y * DIEZ + x + 1] = new Tile( mapaAris.getTile(x * SESENTAYCUATRO, y * SESENTAYCUATRO, SESENTAYCUATRO, SESENTAYCUATRO), y * DIEZ + x + 1, solidezAris[y][x], SESENTAYCUATRO, SESENTAYCUATRO); } } } // Fin Entorno // Inicio Batalla setBarraSpells(CargadorImagen.cargarImagen("/BarraSpells.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); setEstadoPersonaje(CargadorImagen.cargarImagen("/EstadoPersonaje.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); setBarraSalud(CargadorImagen.cargarImagen("/BarraDeSalud.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); setBarraEnergia(CargadorImagen.cargarImagen("/BarraDeEnergia.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); setBarraExperiencia( CargadorImagen.cargarImagen("/BarraDeExperiencia.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put("Golpe Level", CargadorImagen.cargarImagen("/Golpe Level.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put("Ataque Bosque", CargadorImagen.cargarImagen("/Ataque Bosque.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put("Golpe Defensa", CargadorImagen.cargarImagen("/Golpe Defensa.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put("Mordisco de Vida", CargadorImagen.cargarImagen("/Mordisco de Vida.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put("Incentivar", CargadorImagen.cargarImagen("/Incentivar.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put("Golpe Fatal", CargadorImagen.cargarImagen("/Golpe Fatal.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put("Ataque Doble", CargadorImagen.cargarImagen("/Ataque Doble.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put("Aumentar Defensa", CargadorImagen.cargarImagen("/Aumentar Defensa.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put("Ignorar Defensa", CargadorImagen.cargarImagen("/Ignorar Defensa.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put("Bola de Fuego", CargadorImagen.cargarImagen("/Bola de Fuego.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put("Curar Aliado", CargadorImagen.cargarImagen("/Curar Aliado.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put("Robar Energia y Salud", CargadorImagen.cargarImagen("/Robar Energia y Salud.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put("Golpe Critico", CargadorImagen.cargarImagen("/Golpe Critico.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put("Aumentar Evasion", CargadorImagen.cargarImagen("/Aumentar Evasion.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put("Robar", CargadorImagen.cargarImagen("/Robar.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put("Ser Energizado", CargadorImagen.cargarImagen("/Ser Energizado.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); setMenuBatalla(CargadorImagen.cargarImagen("/MenuBatalla.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); setMenuBatallaDeshabilitado( CargadorImagen.cargarImagen("/MenuBatallaDeshabilitado.png")); actualizarBarraDeCarga(++elementosCargados, menuCarga); // Fin Batalla }
static void function(final MenuCarga menuCarga) throws NumberFormatException, IOException { int elementosCargados = 0; setNoItem(ImageIO.read(new File(STRrecursos setMenu(ImageIO.read(new File(STRrecursos spriteHumano = new SpriteSheet( CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); humanoIzq = new BufferedImage[CUATRO]; humanoArribaIzq = new BufferedImage[CUATRO]; humanoArriba = new BufferedImage[CUATRO]; humanoArribaDer = new BufferedImage[CUATRO]; humanoDer = new BufferedImage[CUATRO]; humanoAbajoDer = new BufferedImage[CUATRO]; humanoAbajo = new BufferedImage[CUATRO]; humanoAbajoIzq = new BufferedImage[CUATRO]; for (int i = 0; i < CUATRO; i++) { humanoIzq[i] = spriteHumano.getTile(ANCHO * i, 0, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { humanoArribaIzq[i] = spriteHumano.getTile(ANCHO * i, ALTO, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { humanoArriba[i] = spriteHumano.getTile(ANCHO * i, ALTO * 2, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { humanoArribaDer[i] = spriteHumano.getTile(ANCHO * i, ALTO * TRES, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { humanoDer[i] = spriteHumano.getTile(ANCHO * i, ALTO * CUATRO, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { humanoAbajoDer[i] = spriteHumano.getTile(ANCHO * i, ALTO * CINCO, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { humanoAbajo[i] = spriteHumano.getTile(ANCHO * i, ALTO * SEIS, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { humanoAbajoIzq[i] = spriteHumano.getTile(ANCHO * i, ALTO * SIETE, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); humano.add(humanoIzq); humano.add(humanoArribaIzq); humano.add(humanoArriba); humano.add(humanoArribaDer); humano.add(humanoDer); humano.add(humanoAbajoDer); humano.add(humanoAbajo); humano.add(humanoAbajoIzq); spriteOgro = new SpriteSheet(CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); orcoIzq = new BufferedImage[CUATRO]; orcoArribaIzq = new BufferedImage[CUATRO]; orcoArriba = new BufferedImage[CUATRO]; orcoArribaDer = new BufferedImage[CUATRO]; orcoDer = new BufferedImage[CUATRO]; orcoAbajoDer = new BufferedImage[CUATRO]; orcoAbajo = new BufferedImage[CUATRO]; orcoAbajoIzq = new BufferedImage[CUATRO]; for (int i = 0; i < CUATRO; i++) { orcoIzq[i] = spriteOgro.getTile(ANCHO * i, 0, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { orcoArribaIzq[i] = spriteOgro.getTile(ANCHO * i, ALTO, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { orcoArriba[i] = spriteOgro.getTile(ANCHO * i, ALTO * 2, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { orcoArribaDer[i] = spriteOgro.getTile(ANCHO * i, ALTO * TRES, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { orcoDer[i] = spriteOgro.getTile(ANCHO * i, ALTO * CUATRO, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { orcoAbajoDer[i] = spriteOgro.getTile(ANCHO * i, ALTO * CINCO, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { orcoAbajo[i] = spriteOgro.getTile(ANCHO * i, ALTO * SEIS, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { orcoAbajoIzq[i] = spriteOgro.getTile(ANCHO * i, ALTO * SIETE, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); orco.add(orcoIzq); orco.add(orcoArribaIzq); orco.add(orcoArriba); orco.add(orcoArribaDer); orco.add(orcoDer); orco.add(orcoAbajoDer); orco.add(orcoAbajo); orco.add(orcoAbajoIzq); spriteElfo = new SpriteSheet(CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); elfoIzq = new BufferedImage[CUATRO]; elfoArribaIzq = new BufferedImage[CUATRO]; elfoArriba = new BufferedImage[CUATRO]; elfoArribaDer = new BufferedImage[CUATRO]; elfoDer = new BufferedImage[CUATRO]; elfoAbajoDer = new BufferedImage[CUATRO]; elfoAbajo = new BufferedImage[CUATRO]; elfoAbajoIzq = new BufferedImage[CUATRO]; for (int i = 0; i < CUATRO; i++) { elfoIzq[i] = spriteElfo.getTile(ANCHO * i, 0, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { elfoArribaIzq[i] = spriteElfo.getTile(ANCHO * i, ALTO, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { elfoArriba[i] = spriteElfo.getTile(ANCHO * i, ALTO * 2, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { elfoArribaDer[i] = spriteElfo.getTile(ANCHO * i, ALTO * TRES, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { elfoDer[i] = spriteElfo.getTile(ANCHO * i, ALTO * CUATRO, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { elfoAbajoDer[i] = spriteElfo.getTile(ANCHO * i, ALTO * CINCO, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { elfoAbajo[i] = spriteElfo.getTile(ANCHO * i, ALTO * SEIS, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { elfoAbajoIzq[i] = spriteElfo.getTile(ANCHO * i, ALTO * SIETE, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); elfo.add(elfoIzq); elfo.add(elfoArribaIzq); elfo.add(elfoArriba); elfo.add(elfoArribaDer); elfo.add(elfoDer); elfo.add(elfoAbajoDer); elfo.add(elfoAbajo); elfo.add(elfoAbajoIzq); spriteElBryan = new SpriteSheet( CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); elBryanIzq = new BufferedImage[CUATRO]; elBryanArribaIzq = new BufferedImage[CUATRO]; elBryanArriba = new BufferedImage[CUATRO]; elBryanArribaDer = new BufferedImage[CUATRO]; elBryanDer = new BufferedImage[CUATRO]; elBryanAbajoDer = new BufferedImage[CUATRO]; elBryanAbajo = new BufferedImage[CUATRO]; elBryanAbajoIzq = new BufferedImage[CUATRO]; for (int i = 0; i < CUATRO; i++) { elBryanIzq[i] = spriteElBryan.getTile(ANCHO * i, 0, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { elBryanArribaIzq[i] = spriteElBryan.getTile(ANCHO * i, ALTO, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { elBryanArriba[i] = spriteElBryan.getTile(ANCHO * i, ALTO * 2, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { elBryanArribaDer[i] = spriteElBryan.getTile(ANCHO * i, ALTO * TRES, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { elBryanDer[i] = spriteElBryan.getTile(ANCHO * i, ALTO * CUATRO, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { elBryanAbajoDer[i] = spriteElBryan.getTile(ANCHO * i, ALTO * CINCO, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { elBryanAbajo[i] = spriteElBryan.getTile(ANCHO * i, ALTO * SEIS, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); for (int i = 0; i < CUATRO; i++) { elBryanAbajoIzq[i] = spriteElBryan.getTile(ANCHO * i, ALTO * SIETE, ANCHO, ALTO); } actualizarBarraDeCarga(++elementosCargados, menuCarga); elBryan.add(elBryanIzq); elBryan.add(elBryanArribaIzq); elBryan.add(elBryanArriba); elBryan.add(elBryanArribaDer); elBryan.add(elBryanDer); elBryan.add(elBryanAbajoDer); elBryan.add(elBryanAbajo); elBryan.add(elBryanAbajoIzq); personaje.put(STR, humano); personaje.put("Orco", orco); personaje.put("Elfo", elfo); personaje.put(STR, elBryan); setCesped(CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); setRoca(CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); setBackground(CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); setMarco(CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); setBotonMenu(CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); setMenuEnemigo(CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); trees = new SpriteSheet(CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); setGreenTree(trees.getTile(0, 0, CUARENTAYDOS, CINCUENTA)); actualizarBarraDeCarga(++elementosCargados, menuCarga); setNievePiso1(CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); setIceBlock(CargadorImagen.cargarImagen(STR)); if (MenuMapas.numberMap == 1) { SpriteSheet mapaAubenor = new SpriteSheet( CargadorImagen.cargarImagen(STR)); Tile.aubenor = new Tile[OCHENTAYUNO]; boolean[][] solidezAubenor = { {true, true, false, true, false, true, true, true, true, true}, {true, true, true, true, true, true, true, true, true, true}, {true, true, true, true, true, true, true, true, true, true}, {true, false, false, false, false, false, false, false, true, true}, {false, false, false, false, false, false, false, false, true, true}, {false, true, true, true, true, true, true, true, true, true}, {true, true, true, true, true, true, true, true, true, true}, {true, true, true, true, true, true, true, true, true, true}}; for (int y = 0; y < OCHO; y++) { for (int x = 0; x < DIEZ; x++) { Tile.aubenor[y * DIEZ + x + 1] = new Tile( mapaAubenor.getTile(x * SESENTAYCUATRO, y * SESENTAYCUATRO, SESENTAYCUATRO, SESENTAYCUATRO), y * DIEZ + x + 1, solidezAubenor[y][x], SESENTAYCUATRO, SESENTAYCUATRO); } } } else { SpriteSheet mapaAris = new SpriteSheet( CargadorImagen.cargarImagen(STR)); Tile.aris = new Tile[OCHENTAYUNO]; boolean[][] solidezAris = { {true, false, false, false, false, false, false, true, true, true}, {false, false, false, false, false, false, false, false, true, true}, {false, false, false, false, true, true, true, true, true, true}, {true, true, true, true, true, true, true, true, true, true}, {true, true, true, true, true, true, true, true, true, true}, {false, true, true, true, true, true, true, true, true, true}, {true, true, true, true, true, true, true, true, true, true}, {true, true, true, true, true, true, true, true, true, true}}; for (int y = 0; y < OCHO; y++) { for (int x = 0; x < DIEZ; x++) { Tile.aris[y * DIEZ + x + 1] = new Tile( mapaAris.getTile(x * SESENTAYCUATRO, y * SESENTAYCUATRO, SESENTAYCUATRO, SESENTAYCUATRO), y * DIEZ + x + 1, solidezAris[y][x], SESENTAYCUATRO, SESENTAYCUATRO); } } } setBarraSpells(CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); setEstadoPersonaje(CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); setBarraSalud(CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); setBarraEnergia(CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); setBarraExperiencia( CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put(STR, CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put(STR, CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put(STR, CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put(STR, CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put(STR, CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put(STR, CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put(STR, CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put(STR, CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put(STR, CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put(STR, CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put(STR, CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put(STR, CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put(STR, CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put(STR, CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put("Robar", CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); habilidades.put(STR, CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); setMenuBatalla(CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); setMenuBatallaDeshabilitado( CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menuCarga); }
/** * Carga todos los recursos del juego. * <p> * <i><u>Nota</u>: Carga todos los recursos al empezar el juego. </i><br> * * @param menuCarga * Menú de carga. <br> * @throws NumberFormatException * Cantidad de objetos existentes diferente. <br> * @throws IOException * Path de archivo incorrecto. <br> */
Carga todos los recursos del juego. Nota: Carga todos los recursos al empezar el juego.
cargar
{ "repo_name": "JavaATR/jrpg-2017b-cliente", "path": "src/main/resources/recursos/Recursos.java", "license": "mit", "size": 38422 }
[ "java.awt.image.BufferedImage", "java.io.File", "java.io.IOException", "javax.imageio.ImageIO" ]
import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO;
import java.awt.image.*; import java.io.*; import javax.imageio.*;
[ "java.awt", "java.io", "javax.imageio" ]
java.awt; java.io; javax.imageio;
2,158,698
public static Resource H_invDB_locus() { return ResourceFactory.createResource("http://www.h-invitational.jp/hinv/spsoup/locus_view?hix_id="); }
static Resource function() { return ResourceFactory.createResource("http: }
/** * Returns the link-out URI for objects of "H-invitational Database". */
Returns the link-out URI for objects of "H-invitational Database"
H_invDB_locus
{ "repo_name": "BioInterchange/BioInterchange", "path": "supplemental/java/biointerchange/src/main/java/org/biointerchange/vocabulary/GOXRef.java", "license": "mit", "size": 41277 }
[ "com.hp.hpl.jena.rdf.model.Resource", "com.hp.hpl.jena.rdf.model.ResourceFactory" ]
import com.hp.hpl.jena.rdf.model.Resource; import com.hp.hpl.jena.rdf.model.ResourceFactory;
import com.hp.hpl.jena.rdf.model.*;
[ "com.hp.hpl" ]
com.hp.hpl;
2,193,379
protected void validateCovarianceData(double[][] x, double[][] covariance) { if (x.length != covariance.length) throw new CardinalityException(x.length, covariance.length); if (covariance.length > 0 && covariance.length != covariance[0].length) throw new NonSquareMatrixException(covariance.length, covariance[0].length); } /** * {@inheritDoc}
void function(double[][] x, double[][] covariance) { if (x.length != covariance.length) throw new CardinalityException(x.length, covariance.length); if (covariance.length > 0 && covariance.length != covariance[0].length) throw new NonSquareMatrixException(covariance.length, covariance[0].length); } /** * {@inheritDoc}
/** * Validates that the x data and covariance matrix have the same * number of rows and that the covariance matrix is square. * * @param x the [n,k] array representing the x sample * @param covariance the [n,n] array representing the covariance matrix * @throws CardinalityException if the number of rows in x is not equal to the number of rows in covariance * @throws NonSquareMatrixException if the covariance matrix is not square */
Validates that the x data and covariance matrix have the same number of rows and that the covariance matrix is square
validateCovarianceData
{ "repo_name": "a1vanov/ignite", "path": "modules/ml/src/main/java/org/apache/ignite/ml/regressions/AbstractMultipleLinearRegression.java", "license": "apache-2.0", "size": 13024 }
[ "org.apache.ignite.ml.math.exceptions.CardinalityException", "org.apache.ignite.ml.math.exceptions.NonSquareMatrixException" ]
import org.apache.ignite.ml.math.exceptions.CardinalityException; import org.apache.ignite.ml.math.exceptions.NonSquareMatrixException;
import org.apache.ignite.ml.math.exceptions.*;
[ "org.apache.ignite" ]
org.apache.ignite;
2,415,336
@GET @Produces(MediaType.APPLICATION_JSON) public Response getComponentConfigs() { ComponentConfigService service = get(ComponentConfigService.class); Set<String> components = service.getComponentNames(); ObjectNode root = mapper().createObjectNode(); components.forEach(c -> encodeConfigs(c, service.getProperties(c), root)); return ok(root).build(); }
@Produces(MediaType.APPLICATION_JSON) Response function() { ComponentConfigService service = get(ComponentConfigService.class); Set<String> components = service.getComponentNames(); ObjectNode root = mapper().createObjectNode(); components.forEach(c -> encodeConfigs(c, service.getProperties(c), root)); return ok(root).build(); }
/** * Gets all component configurations. * Returns collection of all registered component configurations. * * @return 200 OK with a collection of component configurations */
Gets all component configurations. Returns collection of all registered component configurations
getComponentConfigs
{ "repo_name": "donNewtonAlpha/onos", "path": "web/api/src/main/java/org/onosproject/rest/resources/ComponentConfigWebResource.java", "license": "apache-2.0", "size": 5075 }
[ "com.fasterxml.jackson.databind.node.ObjectNode", "java.util.Set", "javax.ws.rs.Produces", "javax.ws.rs.core.MediaType", "javax.ws.rs.core.Response", "org.onosproject.cfg.ComponentConfigService" ]
import com.fasterxml.jackson.databind.node.ObjectNode; import java.util.Set; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import org.onosproject.cfg.ComponentConfigService;
import com.fasterxml.jackson.databind.node.*; import java.util.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import org.onosproject.cfg.*;
[ "com.fasterxml.jackson", "java.util", "javax.ws", "org.onosproject.cfg" ]
com.fasterxml.jackson; java.util; javax.ws; org.onosproject.cfg;
1,541,561
public StringType getNetworkDisplayName(int networkIndex) throws DeviceNotFoundException;
StringType function(int networkIndex) throws DeviceNotFoundException;
/** * The description of the network. On some platforms, this is identical to the name. * * @param networkIndex - the index of the network * @throws DeviceNotFoundException */
The description of the network. On some platforms, this is identical to the name
getNetworkDisplayName
{ "repo_name": "ebisso/openhab2", "path": "addons/binding/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/model/SysteminfoInterface.java", "license": "epl-1.0", "size": 12415 }
[ "org.eclipse.smarthome.core.library.types.StringType" ]
import org.eclipse.smarthome.core.library.types.StringType;
import org.eclipse.smarthome.core.library.types.*;
[ "org.eclipse.smarthome" ]
org.eclipse.smarthome;
775,993
public Properties getNotificationAddress(int aNotificationAddressId, int aUserId) throws NotificationManagerException { NotifSchema schema = null; Properties p = null; try { schema = new NotifSchema(); NotificationParameters params = new NotificationParameters(); params.iMediaType = aNotificationAddressId; p = notifAddressRowToProperties(getNotifAddressRow(params, aUserId, schema), true, true, true, isDefaultAddress(aNotificationAddressId, aUserId, schema, false), schema); } catch (UtilException e) { throw new NotificationManagerException( "NotificationManager.getNotificationAddress()", SilverpeasException.ERROR, "notificationManager.EX_CANT_GET_NOTIF_ADDRESS", "UserId=" + Integer.toString(aUserId) + ",NotifAddId=" + Integer.toString(aNotificationAddressId), e); } finally { closeSchema(schema); } return p; }
Properties function(int aNotificationAddressId, int aUserId) throws NotificationManagerException { NotifSchema schema = null; Properties p = null; try { schema = new NotifSchema(); NotificationParameters params = new NotificationParameters(); params.iMediaType = aNotificationAddressId; p = notifAddressRowToProperties(getNotifAddressRow(params, aUserId, schema), true, true, true, isDefaultAddress(aNotificationAddressId, aUserId, schema, false), schema); } catch (UtilException e) { throw new NotificationManagerException( STR, SilverpeasException.ERROR, STR, STR + Integer.toString(aUserId) + STR + Integer.toString(aNotificationAddressId), e); } finally { closeSchema(schema); } return p; }
/** * Method declaration * @param aNotificationAddressId * @return * @throws NotificationManagerException * @see */
Method declaration
getNotificationAddress
{ "repo_name": "ebonnet/Silverpeas-Core", "path": "core-library/src/main/java/org/silverpeas/core/notification/user/client/NotificationManager.java", "license": "agpl-3.0", "size": 63926 }
[ "java.util.Properties", "org.silverpeas.core.exception.SilverpeasException", "org.silverpeas.core.exception.UtilException", "org.silverpeas.core.notification.user.client.model.NotifSchema" ]
import java.util.Properties; import org.silverpeas.core.exception.SilverpeasException; import org.silverpeas.core.exception.UtilException; import org.silverpeas.core.notification.user.client.model.NotifSchema;
import java.util.*; import org.silverpeas.core.exception.*; import org.silverpeas.core.notification.user.client.model.*;
[ "java.util", "org.silverpeas.core" ]
java.util; org.silverpeas.core;
1,213,970
public OnCompletionDefinition onCompletion() { // is only allowed at the top currently if (!getRouteCollection().getRoutes().isEmpty()) { throw new IllegalArgumentException("onCompletion must be defined before any routes in the RouteBuilder"); } getRouteCollection().setCamelContext(getContext()); return getRouteCollection().onCompletion(); }
OnCompletionDefinition function() { if (!getRouteCollection().getRoutes().isEmpty()) { throw new IllegalArgumentException(STR); } getRouteCollection().setCamelContext(getContext()); return getRouteCollection().onCompletion(); }
/** * <a href="http://camel.apache.org/oncompletion.html">On completion</a> * callback for doing custom routing when the {@link org.apache.camel.Exchange} is complete. * * @return the builder */
On completion callback for doing custom routing when the <code>org.apache.camel.Exchange</code> is complete
onCompletion
{ "repo_name": "koscejev/camel", "path": "camel-core/src/main/java/org/apache/camel/builder/RouteBuilder.java", "license": "apache-2.0", "size": 17049 }
[ "org.apache.camel.model.OnCompletionDefinition" ]
import org.apache.camel.model.OnCompletionDefinition;
import org.apache.camel.model.*;
[ "org.apache.camel" ]
org.apache.camel;
2,098,274
void onSourceInfoRefreshed(long durationUs, boolean isSeekable, boolean isLive); } private static final long DEFAULT_LAST_SAMPLE_DURATION_US = 10_000; private static final Map<String, String> ICY_METADATA_HEADERS = createIcyMetadataHeaders(); private static final Format ICY_FORMAT = new Format.Builder().setId("icy").setSampleMimeType(MimeTypes.APPLICATION_ICY).build(); private final Uri uri; private final DataSource dataSource; private final DrmSessionManager drmSessionManager; private final LoadErrorHandlingPolicy loadErrorHandlingPolicy; private final MediaSourceEventListener.EventDispatcher mediaSourceEventDispatcher; private final DrmSessionEventListener.EventDispatcher drmEventDispatcher; private final Listener listener; private final Allocator allocator; @Nullable private final String customCacheKey; private final long continueLoadingCheckIntervalBytes; private final Loader loader; private final ProgressiveMediaExtractor progressiveMediaExtractor; private final ConditionVariable loadCondition; private final Runnable maybeFinishPrepareRunnable; private final Runnable onContinueLoadingRequestedRunnable; private final Handler handler; @Nullable private Callback callback; @Nullable private IcyHeaders icyHeaders; private SampleQueue[] sampleQueues; private TrackId[] sampleQueueTrackIds; private boolean sampleQueuesBuilt; private boolean prepared; private boolean haveAudioVideoTracks; private @MonotonicNonNull TrackState trackState; private @MonotonicNonNull SeekMap seekMap; private long durationUs; private boolean isLive; private int dataType; private boolean seenFirstTrackSelection; private boolean notifyDiscontinuity; private int enabledTrackCount; private long length; private long lastSeekPositionUs; private long pendingResetPositionUs; private boolean pendingDeferredRetry; private int extractedSamplesCountAtStartOfLoad; private boolean loadingFinished; private boolean released; // maybeFinishPrepare is not posted to the handler until initialization completes. @SuppressWarnings({ "nullness:argument.type.incompatible", "nullness:methodref.receiver.bound.invalid" }) public ProgressiveMediaPeriod( Uri uri, DataSource dataSource, ExtractorsFactory extractorsFactory, DrmSessionManager drmSessionManager, DrmSessionEventListener.EventDispatcher drmEventDispatcher, LoadErrorHandlingPolicy loadErrorHandlingPolicy, MediaSourceEventListener.EventDispatcher mediaSourceEventDispatcher, Listener listener, Allocator allocator, @Nullable String customCacheKey, int continueLoadingCheckIntervalBytes) { this.uri = uri; this.dataSource = dataSource; this.drmSessionManager = drmSessionManager; this.drmEventDispatcher = drmEventDispatcher; this.loadErrorHandlingPolicy = loadErrorHandlingPolicy; this.mediaSourceEventDispatcher = mediaSourceEventDispatcher; this.listener = listener; this.allocator = allocator; this.customCacheKey = customCacheKey; this.continueLoadingCheckIntervalBytes = continueLoadingCheckIntervalBytes; loader = new Loader("Loader:ProgressiveMediaPeriod"); this.progressiveMediaExtractor = new BundledExtractorsAdapter(extractorsFactory); loadCondition = new ConditionVariable(); maybeFinishPrepareRunnable = this::maybeFinishPrepare; onContinueLoadingRequestedRunnable = () -> { if (!released) { Assertions.checkNotNull(callback) .onContinueLoadingRequested(ProgressiveMediaPeriod.this); } }; handler = Util.createHandlerForCurrentLooper(); sampleQueueTrackIds = new TrackId[0]; sampleQueues = new SampleQueue[0]; pendingResetPositionUs = C.TIME_UNSET; length = C.LENGTH_UNSET; durationUs = C.TIME_UNSET; dataType = C.DATA_TYPE_MEDIA; }
void onSourceInfoRefreshed(long durationUs, boolean isSeekable, boolean isLive); } private static final long DEFAULT_LAST_SAMPLE_DURATION_US = 10_000; private static final Map<String, String> ICY_METADATA_HEADERS = createIcyMetadataHeaders(); private static final Format ICY_FORMAT = new Format.Builder().setId("icy").setSampleMimeType(MimeTypes.APPLICATION_ICY).build(); private final Uri uri; private final DataSource dataSource; private final DrmSessionManager drmSessionManager; private final LoadErrorHandlingPolicy loadErrorHandlingPolicy; private final MediaSourceEventListener.EventDispatcher mediaSourceEventDispatcher; private final DrmSessionEventListener.EventDispatcher drmEventDispatcher; private final Listener listener; private final Allocator allocator; @Nullable private final String customCacheKey; private final long continueLoadingCheckIntervalBytes; private final Loader loader; private final ProgressiveMediaExtractor progressiveMediaExtractor; private final ConditionVariable loadCondition; private final Runnable maybeFinishPrepareRunnable; private final Runnable onContinueLoadingRequestedRunnable; private final Handler handler; @Nullable private Callback callback; @Nullable private IcyHeaders icyHeaders; private SampleQueue[] sampleQueues; private TrackId[] sampleQueueTrackIds; private boolean sampleQueuesBuilt; private boolean prepared; private boolean haveAudioVideoTracks; private @MonotonicNonNull TrackState trackState; private @MonotonicNonNull SeekMap seekMap; private long durationUs; private boolean isLive; private int dataType; private boolean seenFirstTrackSelection; private boolean notifyDiscontinuity; private int enabledTrackCount; private long length; private long lastSeekPositionUs; private long pendingResetPositionUs; private boolean pendingDeferredRetry; private int extractedSamplesCountAtStartOfLoad; private boolean loadingFinished; private boolean released; @SuppressWarnings({ STR, STR }) public ProgressiveMediaPeriod( Uri uri, DataSource dataSource, ExtractorsFactory extractorsFactory, DrmSessionManager drmSessionManager, DrmSessionEventListener.EventDispatcher drmEventDispatcher, LoadErrorHandlingPolicy loadErrorHandlingPolicy, MediaSourceEventListener.EventDispatcher mediaSourceEventDispatcher, Listener listener, Allocator allocator, @Nullable String customCacheKey, int continueLoadingCheckIntervalBytes) { this.uri = uri; this.dataSource = dataSource; this.drmSessionManager = drmSessionManager; this.drmEventDispatcher = drmEventDispatcher; this.loadErrorHandlingPolicy = loadErrorHandlingPolicy; this.mediaSourceEventDispatcher = mediaSourceEventDispatcher; this.listener = listener; this.allocator = allocator; this.customCacheKey = customCacheKey; this.continueLoadingCheckIntervalBytes = continueLoadingCheckIntervalBytes; loader = new Loader(STR); this.progressiveMediaExtractor = new BundledExtractorsAdapter(extractorsFactory); loadCondition = new ConditionVariable(); maybeFinishPrepareRunnable = this::maybeFinishPrepare; onContinueLoadingRequestedRunnable = () -> { if (!released) { Assertions.checkNotNull(callback) .onContinueLoadingRequested(ProgressiveMediaPeriod.this); } }; handler = Util.createHandlerForCurrentLooper(); sampleQueueTrackIds = new TrackId[0]; sampleQueues = new SampleQueue[0]; pendingResetPositionUs = C.TIME_UNSET; length = C.LENGTH_UNSET; durationUs = C.TIME_UNSET; dataType = C.DATA_TYPE_MEDIA; }
/** * Called when the duration, the ability to seek within the period, or the categorization as * live stream changes. * * @param durationUs The duration of the period, or {@link C#TIME_UNSET}. * @param isSeekable Whether the period is seekable. * @param isLive Whether the period is live. */
Called when the duration, the ability to seek within the period, or the categorization as live stream changes
onSourceInfoRefreshed
{ "repo_name": "amzn/exoplayer-amazon-port", "path": "library/core/src/main/java/com/google/android/exoplayer2/source/ProgressiveMediaPeriod.java", "license": "apache-2.0", "size": 43199 }
[ "android.net.Uri", "android.os.Handler", "androidx.annotation.Nullable", "com.google.android.exoplayer2.Format", "com.google.android.exoplayer2.drm.DrmSessionEventListener", "com.google.android.exoplayer2.drm.DrmSessionManager", "com.google.android.exoplayer2.extractor.ExtractorsFactory", "com.google.android.exoplayer2.extractor.SeekMap", "com.google.android.exoplayer2.metadata.icy.IcyHeaders", "com.google.android.exoplayer2.upstream.Allocator", "com.google.android.exoplayer2.upstream.DataSource", "com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy", "com.google.android.exoplayer2.upstream.Loader", "com.google.android.exoplayer2.util.Assertions", "com.google.android.exoplayer2.util.ConditionVariable", "com.google.android.exoplayer2.util.MimeTypes", "com.google.android.exoplayer2.util.Util", "java.util.Map", "org.checkerframework.checker.nullness.qual.MonotonicNonNull" ]
import android.net.Uri; import android.os.Handler; import androidx.annotation.Nullable; import com.google.android.exoplayer2.Format; import com.google.android.exoplayer2.drm.DrmSessionEventListener; import com.google.android.exoplayer2.drm.DrmSessionManager; import com.google.android.exoplayer2.extractor.ExtractorsFactory; import com.google.android.exoplayer2.extractor.SeekMap; import com.google.android.exoplayer2.metadata.icy.IcyHeaders; import com.google.android.exoplayer2.upstream.Allocator; import com.google.android.exoplayer2.upstream.DataSource; import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy; import com.google.android.exoplayer2.upstream.Loader; import com.google.android.exoplayer2.util.Assertions; import com.google.android.exoplayer2.util.ConditionVariable; import com.google.android.exoplayer2.util.MimeTypes; import com.google.android.exoplayer2.util.Util; import java.util.Map; import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
import android.net.*; import android.os.*; import androidx.annotation.*; import com.google.android.exoplayer2.*; import com.google.android.exoplayer2.drm.*; import com.google.android.exoplayer2.extractor.*; import com.google.android.exoplayer2.metadata.icy.*; import com.google.android.exoplayer2.upstream.*; import com.google.android.exoplayer2.util.*; import java.util.*; import org.checkerframework.checker.nullness.qual.*;
[ "android.net", "android.os", "androidx.annotation", "com.google.android", "java.util", "org.checkerframework.checker" ]
android.net; android.os; androidx.annotation; com.google.android; java.util; org.checkerframework.checker;
1,540,964
public void updateTransferDetails(Session session, Map<String, String> transferMetaData1, Map<String, String> metadata) { // Updating the target_file in monitor_transfer table if (System.getProperty("os.name").contains("Linux")) { session.execute("update monitor_transfer set target_file='" + transferMetaData1.get("destinationFile").replace("\\", "/") + "' " + "where transfer_id= '" + transferMetaData1.get("transferId") + "';"); } else if (System.getProperty("os.name").contains("Windows")) { session.execute("update monitor_transfer set target_file='" + transferMetaData1.get("destinationFile") + "' " + "where transfer_id= '" + transferMetaData1.get("transferId") + "';"); } session.close(); }
void function(Session session, Map<String, String> transferMetaData1, Map<String, String> metadata) { if (System.getProperty(STR).contains("Linux")) { session.execute(STR + transferMetaData1.get(STR).replace("\\", "/") + STR + STR + transferMetaData1.get(STR) + "';"); } else if (System.getProperty(STR).contains(STR)) { session.execute(STR + transferMetaData1.get(STR) + STR + STR + transferMetaData1.get(STR) + "';"); } session.close(); }
/** * This method updates the target file and transfer status values in monitor * transfer table based on transfer id * * @param session * @param transferMetaData1 * @param metadata */
This method updates the target file and transfer status values in monitor transfer table based on transfer id
updateTransferDetails
{ "repo_name": "MithunThadi/OFTE", "path": "SourceCode/TaskScheduler & CronJob code/com.ofte.services/CassandraInteracter.java", "license": "gpl-3.0", "size": 26612 }
[ "com.datastax.driver.core.Session", "java.util.Map" ]
import com.datastax.driver.core.Session; import java.util.Map;
import com.datastax.driver.core.*; import java.util.*;
[ "com.datastax.driver", "java.util" ]
com.datastax.driver; java.util;
1,160,196
@JavascriptInterface public SourceEditor setMarkdown(final boolean markdown) { this.markdown = markdown; return this; } /** * Bind content to current {@link WebView}
SourceEditor function(final boolean markdown) { this.markdown = markdown; return this; } /** * Bind content to current {@link WebView}
/** * Sets whether the content is a markdown file * * @param markdown * @return this editor */
Sets whether the content is a markdown file
setMarkdown
{ "repo_name": "lyghlqlxx/-git-osc-android", "path": "gitoscandroid/src/main/java/net/oschina/gitapp/util/SourceEditor.java", "license": "gpl-2.0", "size": 5248 }
[ "android.webkit.WebView" ]
import android.webkit.WebView;
import android.webkit.*;
[ "android.webkit" ]
android.webkit;
1,584,511
public static @NotNull DfType longRange(LongRangeSet range) { if (range.equals(LongRangeSet.all())) return LONG; if (range.isEmpty()) return DfType.BOTTOM; Long value = range.getConstantValue(); if (value != null) { return longValue(value); } return new DfLongRangeType(range, null); }
static @NotNull DfType function(LongRangeSet range) { if (range.equals(LongRangeSet.all())) return LONG; if (range.isEmpty()) return DfType.BOTTOM; Long value = range.getConstantValue(); if (value != null) { return longValue(value); } return new DfLongRangeType(range, null); }
/** * Creates a type that represents a subset of long values. * * @param range range of values. * @return resulting type. Might be {@link DfType#BOTTOM} if range is empty. */
Creates a type that represents a subset of long values
longRange
{ "repo_name": "smmribeiro/intellij-community", "path": "java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/types/DfTypes.java", "license": "apache-2.0", "size": 17430 }
[ "com.intellij.codeInspection.dataFlow.rangeSet.LongRangeSet", "org.jetbrains.annotations.NotNull" ]
import com.intellij.codeInspection.dataFlow.rangeSet.LongRangeSet; import org.jetbrains.annotations.NotNull;
import com.intellij.*; import org.jetbrains.annotations.*;
[ "com.intellij", "org.jetbrains.annotations" ]
com.intellij; org.jetbrains.annotations;
1,041,433
private static void initCopyContext (SessionState state) { logger.debug("ResourcesAction.initCopyContext()"); state.setAttribute (STATE_COPIED_IDS, new ArrayList ()); state.setAttribute (STATE_COPY_FLAG, Boolean.FALSE.toString()); } // initCopyContent
static void function (SessionState state) { logger.debug(STR); state.setAttribute (STATE_COPIED_IDS, new ArrayList ()); state.setAttribute (STATE_COPY_FLAG, Boolean.FALSE.toString()); }
/** * initialize the copy context */
initialize the copy context
initCopyContext
{ "repo_name": "noondaysun/sakai", "path": "content/content-tool/tool/src/java/org/sakaiproject/content/tool/ResourcesAction.java", "license": "apache-2.0", "size": 337685 }
[ "java.util.ArrayList", "org.sakaiproject.event.api.SessionState" ]
import java.util.ArrayList; import org.sakaiproject.event.api.SessionState;
import java.util.*; import org.sakaiproject.event.api.*;
[ "java.util", "org.sakaiproject.event" ]
java.util; org.sakaiproject.event;
2,312,224
Locale getDefaultLocale();
Locale getDefaultLocale();
/** * Gets the current default locale in the LocaleGroup. */
Gets the current default locale in the LocaleGroup
getDefaultLocale
{ "repo_name": "Guronzan/Apache-XmlGraphics", "path": "src/main/java/org/apache/xmlgraphics/util/i18n/ExtendedLocalizable.java", "license": "apache-2.0", "size": 2032 }
[ "java.util.Locale" ]
import java.util.Locale;
import java.util.*;
[ "java.util" ]
java.util;
1,500,728
public String generatExperimentId(){ return UUID.randomUUID().toString(); }
String function(){ return UUID.randomUUID().toString(); }
/** * Create a unique experiment Id.<br /> * <i><b>Note:</b> This will not be set as the experiment Id for the experiment. Users should use the * function </i><code><b>setCustomExperimentId(...)</b></code><i> to do so. * @return A string representing a unique id. */
Create a unique experiment Id. Note: This will not be set as the experiment Id for the experiment. Users should use the function <code>setCustomExperimentId(...)</code> to do so
generatExperimentId
{ "repo_name": "glahiru/airavata", "path": "modules/airavata-client/src/main/java/org/apache/airavata/client/api/ExperimentAdvanceOptions.java", "license": "apache-2.0", "size": 5224 }
[ "java.util.UUID" ]
import java.util.UUID;
import java.util.*;
[ "java.util" ]
java.util;
279,972
private void addContributors(Document doc, Element oaiDc, GenericItem item) { for(ItemContributor itemContributor : item.getContributors()) { if(itemContributor.getContributor() == null ) { throw new IllegalStateException("contributor null"); } if( itemContributor.getContributor().getContributorType() == null ) { throw new IllegalStateException("contributor Type null"); } ContributorTypeDublinCoreMapping dcMapping = contributorTypeDublinCoreMappingService.get(itemContributor.getContributor().getContributorType().getId()); Element creator = null; if( dcMapping != null ) { creator = doc.createElement("dcterms:" + dcMapping.getDublinCoreTerm().getName()); } else { creator = doc.createElement("dcterms:creator"); } Text data = doc.createTextNode( OaiUtil.removeInvalidXmlChars(nameFormatter.getNameFormatted(itemContributor.getContributor().getPersonName(), true)) ); creator.appendChild(data); oaiDc.appendChild(creator); } }
void function(Document doc, Element oaiDc, GenericItem item) { for(ItemContributor itemContributor : item.getContributors()) { if(itemContributor.getContributor() == null ) { throw new IllegalStateException(STR); } if( itemContributor.getContributor().getContributorType() == null ) { throw new IllegalStateException(STR); } ContributorTypeDublinCoreMapping dcMapping = contributorTypeDublinCoreMappingService.get(itemContributor.getContributor().getContributorType().getId()); Element creator = null; if( dcMapping != null ) { creator = doc.createElement(STR + dcMapping.getDublinCoreTerm().getName()); } else { creator = doc.createElement(STR); } Text data = doc.createTextNode( OaiUtil.removeInvalidXmlChars(nameFormatter.getNameFormatted(itemContributor.getContributor().getPersonName(), true)) ); creator.appendChild(data); oaiDc.appendChild(creator); } }
/** * Add contributor information. * * @param doc * @param oaiDc * @param item */
Add contributor information
addContributors
{ "repo_name": "nate-rcl/irplus", "path": "ir_service/src/edu/ur/ir/oai/metadata/provider/service/DefaultQualifiedDublinCoreMetadataProvider.java", "license": "apache-2.0", "size": 23750 }
[ "edu.ur.ir.item.GenericItem", "edu.ur.ir.item.ItemContributor", "edu.ur.ir.item.metadata.dc.ContributorTypeDublinCoreMapping", "edu.ur.ir.oai.OaiUtil", "org.w3c.dom.Document", "org.w3c.dom.Element", "org.w3c.dom.Text" ]
import edu.ur.ir.item.GenericItem; import edu.ur.ir.item.ItemContributor; import edu.ur.ir.item.metadata.dc.ContributorTypeDublinCoreMapping; import edu.ur.ir.oai.OaiUtil; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Text;
import edu.ur.ir.item.*; import edu.ur.ir.item.metadata.dc.*; import edu.ur.ir.oai.*; import org.w3c.dom.*;
[ "edu.ur.ir", "org.w3c.dom" ]
edu.ur.ir; org.w3c.dom;
47,053
@Override public World rename(Name name) { return new World(name, null); }
World function(Name name) { return new World(name, null); }
/** * Rename this table */
Rename this table
rename
{ "repo_name": "steveklabnik/FrameworkBenchmarks", "path": "frameworks/Java/play2-java/play2-java-jooq-hikaricp/app/models/tables/World.java", "license": "bsd-3-clause", "size": 3797 }
[ "org.jooq.Name" ]
import org.jooq.Name;
import org.jooq.*;
[ "org.jooq" ]
org.jooq;
394,725
static RenderedImage createRenderedImageWithRGBA() { // create a 4x4 image BufferedImage ri = new BufferedImage(4, 4, BufferedImage.TYPE_4BYTE_ABGR); for (int x = 0; x < 2; x++) { for (int y = 0; y < 2; y++) { Color c = new Color(128, 128, 128, 128); ri.setRGB(x, y, c.getRGB()); } } return ri; }
static RenderedImage createRenderedImageWithRGBA() { BufferedImage ri = new BufferedImage(4, 4, BufferedImage.TYPE_4BYTE_ABGR); for (int x = 0; x < 2; x++) { for (int y = 0; y < 2; y++) { Color c = new Color(128, 128, 128, 128); ri.setRGB(x, y, c.getRGB()); } } return ri; }
/** * creates a semi transparent 4x4 image in ABGR color space * * @return RenderedImage */
creates a semi transparent 4x4 image in ABGR color space
createRenderedImageWithRGBA
{ "repo_name": "chunlinyao/fop", "path": "fop-core/src/test/java/org/apache/fop/render/pdf/ImageRenderedAdapterTestCase.java", "license": "apache-2.0", "size": 7139 }
[ "java.awt.Color", "java.awt.image.BufferedImage", "java.awt.image.RenderedImage" ]
import java.awt.Color; import java.awt.image.BufferedImage; import java.awt.image.RenderedImage;
import java.awt.*; import java.awt.image.*;
[ "java.awt" ]
java.awt;
2,849,623
CassandraKeyspaceGetResults.DefinitionStages.Blank defineCassandraKeyspace(String name);
CassandraKeyspaceGetResults.DefinitionStages.Blank defineCassandraKeyspace(String name);
/** * Begins definition for a new CassandraKeyspace resource. * @param name resource name. * @return the first stage of the new CassandraKeyspace definition. */
Begins definition for a new CassandraKeyspace resource
defineCassandraKeyspace
{ "repo_name": "navalev/azure-sdk-for-java", "path": "sdk/cosmosdb/mgmt-v2019_08_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01/CassandraResources.java", "license": "mit", "size": 7202 }
[ "com.microsoft.azure.management.cosmosdb.v2019_08_01.CassandraKeyspaceGetResults" ]
import com.microsoft.azure.management.cosmosdb.v2019_08_01.CassandraKeyspaceGetResults;
import com.microsoft.azure.management.cosmosdb.v2019_08_01.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
2,689,053
public static YangJavaEnumeration getYangEnumerationNode(GeneratedLanguage targetLanguage) { switch (targetLanguage) { case JAVA_GENERATION: { return new YangJavaEnumeration(); } default: { throw new TranslatorException("Only YANG to Java is supported."); } } }
static YangJavaEnumeration function(GeneratedLanguage targetLanguage) { switch (targetLanguage) { case JAVA_GENERATION: { return new YangJavaEnumeration(); } default: { throw new TranslatorException(STR); } } }
/** * Returns based on the target language generate the inherited data model node. * * @param targetLanguage target language in which YANG mapping needs to be * generated * @return the corresponding inherited node based on the target language */
Returns based on the target language generate the inherited data model node
getYangEnumerationNode
{ "repo_name": "paradisecr/ONOS-OXP", "path": "utils/yangutils/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/YangDataModelFactory.java", "license": "apache-2.0", "size": 15453 }
[ "org.onosproject.yangutils.datamodel.utils.GeneratedLanguage", "org.onosproject.yangutils.translator.exception.TranslatorException", "org.onosproject.yangutils.translator.tojava.javamodel.YangJavaEnumeration" ]
import org.onosproject.yangutils.datamodel.utils.GeneratedLanguage; import org.onosproject.yangutils.translator.exception.TranslatorException; import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaEnumeration;
import org.onosproject.yangutils.datamodel.utils.*; import org.onosproject.yangutils.translator.exception.*; import org.onosproject.yangutils.translator.tojava.javamodel.*;
[ "org.onosproject.yangutils" ]
org.onosproject.yangutils;
1,754,047
void resumeTriggers(GroupMatcher<TriggerKey> matcher) throws SchedulerException;
void resumeTriggers(GroupMatcher<TriggerKey> matcher) throws SchedulerException;
/** * Resume (un-pause) all of the <code>{@link Trigger}s</code> in matching groups. * * <p> * If any <code>Trigger</code> missed one or more fire-times, then the * <code>Trigger</code>'s misfire instruction will be applied. * </p> * * @param matcher The matcher to evaluate against know paused groups * @throws SchedulerException On error * @see #pauseTriggers(org.quartz.impl.matchers.GroupMatcher) */
Resume (un-pause) all of the <code><code>Trigger</code>s</code> in matching groups. If any <code>Trigger</code> missed one or more fire-times, then the <code>Trigger</code>'s misfire instruction will be applied.
resumeTriggers
{ "repo_name": "AsuraTeam/asura", "path": "asura-quartz/src/main/java/org/quartz/Scheduler.java", "license": "apache-2.0", "size": 36373 }
[ "org.quartz.impl.matchers.GroupMatcher" ]
import org.quartz.impl.matchers.GroupMatcher;
import org.quartz.impl.matchers.*;
[ "org.quartz.impl" ]
org.quartz.impl;
2,562,324
public boolean supportsOuterJoins() throws SQLException { return true; }
boolean function() throws SQLException { return true; }
/** * Retrieves whether this database supports some form of outer join. <p> * * <!-- start release-specific documentation --> * <div class="ReleaseSpecificDocumentation"> * <h3>HSQLDB-Specific Information:</h3> <p> * * HSQLDB supports outer joins; this method always returns * <code>true</code>. * </div> * <!-- end release-specific documentation --> * * * @return <code>true</code> if so; <code>false</code> otherwise * @exception SQLException if a database access error occurs */
Retrieves whether this database supports some form of outer join. HSQLDB-Specific Information: HSQLDB supports outer joins; this method always returns <code>true</code>.
supportsOuterJoins
{ "repo_name": "minghao7896321/canyin", "path": "hsqldb/src/org/hsqldb/jdbc/jdbcDatabaseMetaData.java", "license": "apache-2.0", "size": 237705 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,608,152
InputStream openResource() throws IOException; }
InputStream openResource() throws IOException; }
/** * Returns the byte contents of the current item. * @return the input stream for obtaining the contents of the current item * @throws IOException if failed to open the resource */
Returns the byte contents of the current item
openResource
{ "repo_name": "cocoatomo/asakusafw", "path": "mapreduce/compiler/core/src/main/java/com/asakusafw/compiler/batch/ResourceRepository.java", "license": "apache-2.0", "size": 1969 }
[ "java.io.IOException", "java.io.InputStream" ]
import java.io.IOException; import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
595,016
protected Set<Event> resolveEventViaPrincipalAttribute(final Principal principal, final Collection<String> attributeNames, final RegisteredService service, final RequestContext context, final Collection<MultifactorAuthenticationProvider> providers, final Predicate<String> predicate) { if (attributeNames.isEmpty()) { LOGGER.debug("No attribute names are provided to trigger a multifactor authentication provider via [{}]", getName()); return null; } if (providers == null || providers.isEmpty()) { LOGGER.error("No multifactor authentication providers are available in the application context"); return null; } val attributes = getPrincipalAttributesForMultifactorAuthentication(principal); return resolveEventViaAttribute(principal, attributes, attributeNames, service, context, providers, predicate); }
Set<Event> function(final Principal principal, final Collection<String> attributeNames, final RegisteredService service, final RequestContext context, final Collection<MultifactorAuthenticationProvider> providers, final Predicate<String> predicate) { if (attributeNames.isEmpty()) { LOGGER.debug(STR, getName()); return null; } if (providers == null providers.isEmpty()) { LOGGER.error(STR); return null; } val attributes = getPrincipalAttributesForMultifactorAuthentication(principal); return resolveEventViaAttribute(principal, attributes, attributeNames, service, context, providers, predicate); }
/** * Resolve event via principal attribute set. * * @param principal the principal * @param attributeNames the attribute name * @param service the service * @param context the context * @param providers the providers * @param predicate the predicate * @return the set of resolved events */
Resolve event via principal attribute set
resolveEventViaPrincipalAttribute
{ "repo_name": "frett/cas", "path": "core/cas-server-core-webflow-mfa-api/src/main/java/org/apereo/cas/web/flow/resolver/impl/AbstractCasMultifactorAuthenticationWebflowEventResolver.java", "license": "apache-2.0", "size": 15343 }
[ "java.util.Collection", "java.util.Set", "java.util.function.Predicate", "org.apereo.cas.authentication.MultifactorAuthenticationProvider", "org.apereo.cas.authentication.principal.Principal", "org.apereo.cas.services.RegisteredService", "org.springframework.webflow.execution.Event", "org.springframework.webflow.execution.RequestContext" ]
import java.util.Collection; import java.util.Set; import java.util.function.Predicate; import org.apereo.cas.authentication.MultifactorAuthenticationProvider; import org.apereo.cas.authentication.principal.Principal; import org.apereo.cas.services.RegisteredService; import org.springframework.webflow.execution.Event; import org.springframework.webflow.execution.RequestContext;
import java.util.*; import java.util.function.*; import org.apereo.cas.authentication.*; import org.apereo.cas.authentication.principal.*; import org.apereo.cas.services.*; import org.springframework.webflow.execution.*;
[ "java.util", "org.apereo.cas", "org.springframework.webflow" ]
java.util; org.apereo.cas; org.springframework.webflow;
206,982
private String rhsNodeName(ResultSet rs) throws SQLException, SQLObjectException { List<String> colNames = new ArrayList<String>(); for (int i = 0; i < project.getSourceTableIndex().getChildCount(); i++) { colNames.add("CURRENT_CANDIDATE_2"+i); } return nodeName(rs, colNames); }
String function(ResultSet rs) throws SQLException, SQLObjectException { List<String> colNames = new ArrayList<String>(); for (int i = 0; i < project.getSourceTableIndex().getChildCount(); i++) { colNames.add(STR+i); } return nodeName(rs, colNames); }
/** * Calls nodeName() with the correct parameters to get the unique identifier * values of the right-hand-side record. */
Calls nodeName() with the correct parameters to get the unique identifier values of the right-hand-side record
rhsNodeName
{ "repo_name": "SQLPower/power-matchmaker", "path": "src/ca/sqlpower/matchmaker/graph/MatchPoolDotExport.java", "license": "gpl-3.0", "size": 12497 }
[ "ca.sqlpower.sqlobject.SQLObjectException", "java.sql.ResultSet", "java.sql.SQLException", "java.util.ArrayList", "java.util.List" ]
import ca.sqlpower.sqlobject.SQLObjectException; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List;
import ca.sqlpower.sqlobject.*; import java.sql.*; import java.util.*;
[ "ca.sqlpower.sqlobject", "java.sql", "java.util" ]
ca.sqlpower.sqlobject; java.sql; java.util;
596,767
public static SchemaLocation getSchemaLocationForSWE101() { return SCHEMA_LOCATION_SWE_101; }
static SchemaLocation function() { return SCHEMA_LOCATION_SWE_101; }
/** * SWECommon 1.0.1 schema location * * @return QName of schema location */
SWECommon 1.0.1 schema location
getSchemaLocationForSWE101
{ "repo_name": "nuest/SOS", "path": "core/api/src/main/java/org/n52/sos/util/N52XmlHelper.java", "license": "gpl-2.0", "size": 11340 }
[ "org.n52.sos.w3c.SchemaLocation" ]
import org.n52.sos.w3c.SchemaLocation;
import org.n52.sos.w3c.*;
[ "org.n52.sos" ]
org.n52.sos;
1,050,083
public boolean serviceStart() { if (GAEProxyService.isServiceStarted()) { try { stopService(new Intent(this, GAEProxyService.class)); } catch (Exception e) { // Nothing } return false; } SharedPreferences settings = PreferenceManager .getDefaultSharedPreferences(this); proxyType = settings.getString("proxyType", "GoAgent"); proxy = settings.getString("proxy", ""); if (isTextEmpty(proxy, getString(R.string.proxy_empty))) return false; if (proxy.contains("proxyofmax.appspot.com")) { final TextView message = new TextView(this); message.setPadding(10, 5, 10, 5); final SpannableString s = new SpannableString( getText(R.string.default_proxy_alert)); Linkify.addLinks(s, Linkify.WEB_URLS); message.setText(s); message.setMovementMethod(LinkMovementMethod.getInstance());
boolean function() { if (GAEProxyService.isServiceStarted()) { try { stopService(new Intent(this, GAEProxyService.class)); } catch (Exception e) { } return false; } SharedPreferences settings = PreferenceManager .getDefaultSharedPreferences(this); proxyType = settings.getString(STR, STR); proxy = settings.getString("proxy", STRproxyofmax.appspot.com")) { final TextView message = new TextView(this); message.setPadding(10, 5, 10, 5); final SpannableString s = new SpannableString( getText(R.string.default_proxy_alert)); Linkify.addLinks(s, Linkify.WEB_URLS); message.setText(s); message.setMovementMethod(LinkMovementMethod.getInstance());
/** * Called when connect button is clicked. * * @throws Exception */
Called when connect button is clicked
serviceStart
{ "repo_name": "miumok98/gaeproxy", "path": "src/org/gaeproxy/GAEProxy.java", "license": "gpl-3.0", "size": 25333 }
[ "android.content.Intent", "android.content.SharedPreferences", "android.preference.PreferenceManager", "android.text.SpannableString", "android.text.method.LinkMovementMethod", "android.text.util.Linkify", "android.widget.TextView" ]
import android.content.Intent; import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.text.SpannableString; import android.text.method.LinkMovementMethod; import android.text.util.Linkify; import android.widget.TextView;
import android.content.*; import android.preference.*; import android.text.*; import android.text.method.*; import android.text.util.*; import android.widget.*;
[ "android.content", "android.preference", "android.text", "android.widget" ]
android.content; android.preference; android.text; android.widget;
2,331,436