method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public void connect(LocalSocketAddress endpoint) throws IOException { synchronized (this) { if (isConnected) { throw new IOException("already connected"); } implCreateIfNeeded(); impl.connect(endpoint, 0); isConnected = true; isBound = true; } }
void function(LocalSocketAddress endpoint) throws IOException { synchronized (this) { if (isConnected) { throw new IOException(STR); } implCreateIfNeeded(); impl.connect(endpoint, 0); isConnected = true; isBound = true; } }
/** * Connects this socket to an endpoint. May only be called on an instance * that has not yet been connected. * * @param endpoint endpoint address * @throws IOException if socket is in invalid state or the address does * not exist. */
Connects this socket to an endpoint. May only be called on an instance that has not yet been connected
connect
{ "repo_name": "szpaddy/android-4.1.2_r2-core", "path": "java/android/net/LocalSocket.java", "license": "apache-2.0", "size": 9399 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,038,666
public SubsystemBuilder remove(Module module) { modules.remove(module); changed = true; return this; }
SubsystemBuilder function(Module module) { modules.remove(module); changed = true; return this; }
/** * Removes a module from the subsystem. * * @param module module to remove from the subsystem * @return the current builder */
Removes a module from the subsystem
remove
{ "repo_name": "CalgaryCommunityTeams/2015RobotCode", "path": "src/edu/first/module/subsystems/SubsystemBuilder.java", "license": "gpl-3.0", "size": 2061 }
[ "edu.first.module.Module" ]
import edu.first.module.Module;
import edu.first.module.*;
[ "edu.first.module" ]
edu.first.module;
1,630,289
@Test public void testCreateDefaultEntityManager_Namespace() { if (TestUtils.isCI()) { // TODO return; } EntityManagerFactory emf = EntityManagerFactory.getInstance(); EntityManager em = emf.createDefaultEntityManager("junit"); DefaultEntityManager dem = (DefaultEntityManager) em; Datastore ds = dem.getDatastore(); assertTrue( ds.getOptions().getProjectId() != null && ds.getOptions().getProjectId().length() != 0 && ds.getOptions().getNamespace().equals("junit")); }
void function() { if (TestUtils.isCI()) { return; } EntityManagerFactory emf = EntityManagerFactory.getInstance(); EntityManager em = emf.createDefaultEntityManager("junit"); DefaultEntityManager dem = (DefaultEntityManager) em; Datastore ds = dem.getDatastore(); assertTrue( ds.getOptions().getProjectId() != null && ds.getOptions().getProjectId().length() != 0 && ds.getOptions().getNamespace().equals("junit")); }
/** * This Test requires default project/auth set up using gcloud. */
This Test requires default project/auth set up using gcloud
testCreateDefaultEntityManager_Namespace
{ "repo_name": "sai-pullabhotla/catatumbo", "path": "src/test/java/com/jmethods/catatumbo/EntityManagerFactoryTest.java", "license": "apache-2.0", "size": 13906 }
[ "com.google.cloud.datastore.Datastore", "com.jmethods.catatumbo.impl.DefaultEntityManager", "org.junit.Assert" ]
import com.google.cloud.datastore.Datastore; import com.jmethods.catatumbo.impl.DefaultEntityManager; import org.junit.Assert;
import com.google.cloud.datastore.*; import com.jmethods.catatumbo.impl.*; import org.junit.*;
[ "com.google.cloud", "com.jmethods.catatumbo", "org.junit" ]
com.google.cloud; com.jmethods.catatumbo; org.junit;
297,696
static private List<Waypoint> getWaypointForArtifact(BlackboardArtifact artifact, ARTIFACT_TYPE type) throws GeoLocationDataException { List<Waypoint> waypoints = new ArrayList<>(); switch (type) { case TSK_METADATA_EXIF: waypoints.add(new EXIFWaypoint(artifact)); break; case TSK_GPS_BOOKMARK: waypoints.add(new BookmarkWaypoint(artifact)); break; case TSK_GPS_TRACKPOINT: waypoints.add(new TrackpointWaypoint(artifact)); break; case TSK_GPS_SEARCH: waypoints.add(new SearchWaypoint(artifact)); break; case TSK_GPS_ROUTE: Route route = new Route(artifact); waypoints.addAll(route.getRoute()); break; case TSK_GPS_LAST_KNOWN_LOCATION: waypoints.add(new LastKnownWaypoint(artifact)); break; case TSK_GPS_TRACK: Track track = new Track(artifact); waypoints.addAll(track.getPath()); break; default: waypoints.add(new CustomArtifactWaypoint(artifact)); } return waypoints; }
static List<Waypoint> function(BlackboardArtifact artifact, ARTIFACT_TYPE type) throws GeoLocationDataException { List<Waypoint> waypoints = new ArrayList<>(); switch (type) { case TSK_METADATA_EXIF: waypoints.add(new EXIFWaypoint(artifact)); break; case TSK_GPS_BOOKMARK: waypoints.add(new BookmarkWaypoint(artifact)); break; case TSK_GPS_TRACKPOINT: waypoints.add(new TrackpointWaypoint(artifact)); break; case TSK_GPS_SEARCH: waypoints.add(new SearchWaypoint(artifact)); break; case TSK_GPS_ROUTE: Route route = new Route(artifact); waypoints.addAll(route.getRoute()); break; case TSK_GPS_LAST_KNOWN_LOCATION: waypoints.add(new LastKnownWaypoint(artifact)); break; case TSK_GPS_TRACK: Track track = new Track(artifact); waypoints.addAll(track.getPath()); break; default: waypoints.add(new CustomArtifactWaypoint(artifact)); } return waypoints; }
/** * Create a Waypoint object for the given Blackboard artifact. * * @param artifact The artifact to create the waypoint from * @param type The type of artifact * * @return A new waypoint object * * @throws GeoLocationDataException */
Create a Waypoint object for the given Blackboard artifact
getWaypointForArtifact
{ "repo_name": "esaunders/autopsy", "path": "Core/src/org/sleuthkit/autopsy/geolocation/datamodel/WaypointBuilder.java", "license": "apache-2.0", "size": 24911 }
[ "java.util.ArrayList", "java.util.List", "org.sleuthkit.datamodel.BlackboardArtifact" ]
import java.util.ArrayList; import java.util.List; import org.sleuthkit.datamodel.BlackboardArtifact;
import java.util.*; import org.sleuthkit.datamodel.*;
[ "java.util", "org.sleuthkit.datamodel" ]
java.util; org.sleuthkit.datamodel;
1,663,839
public static boolean isSpecialTime(Date date) { if (date == null) { return false; } return date.equals(Const.TIME_REPRESENTS_FOLLOW_OPENING) || date.equals(Const.TIME_REPRESENTS_FOLLOW_VISIBLE) || date.equals(Const.TIME_REPRESENTS_LATER) || date.equals(Const.TIME_REPRESENTS_NEVER) || date.equals(Const.TIME_REPRESENTS_NOW); }
static boolean function(Date date) { if (date == null) { return false; } return date.equals(Const.TIME_REPRESENTS_FOLLOW_OPENING) date.equals(Const.TIME_REPRESENTS_FOLLOW_VISIBLE) date.equals(Const.TIME_REPRESENTS_LATER) date.equals(Const.TIME_REPRESENTS_NEVER) date.equals(Const.TIME_REPRESENTS_NOW); }
/** * Returns whether the given date is being used as a special representation, * signifying it's face value should not be used without proper processing. * A null date is not a special time. */
Returns whether the given date is being used as a special representation, signifying it's face value should not be used without proper processing. A null date is not a special time
isSpecialTime
{ "repo_name": "karthikaacharya/teammates", "path": "src/main/java/teammates/common/util/TimeHelper.java", "license": "gpl-2.0", "size": 17599 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
1,085,485
public File getBlockFile(int dnIndex, ExtendedBlock block) { // Check for block file in the two storage directories of the datanode for (int i = 0; i <=1 ; i++) { File storageDir = getStorageDir(dnIndex, i); File blockFile = getBlockFile(storageDir, block); if (blockFile.exists()) { return blockFile; } } return null; }
File function(int dnIndex, ExtendedBlock block) { for (int i = 0; i <=1 ; i++) { File storageDir = getStorageDir(dnIndex, i); File blockFile = getBlockFile(storageDir, block); if (blockFile.exists()) { return blockFile; } } return null; }
/** * Get the block data file for a block from a given datanode * @param dnIndex Index of the datanode to get block files for * @param block block for which corresponding files are needed */
Get the block data file for a block from a given datanode
getBlockFile
{ "repo_name": "vlajos/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java", "license": "apache-2.0", "size": 105726 }
[ "java.io.File", "org.apache.hadoop.hdfs.protocol.ExtendedBlock" ]
import java.io.File; import org.apache.hadoop.hdfs.protocol.ExtendedBlock;
import java.io.*; import org.apache.hadoop.hdfs.protocol.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
952,954
public static List<TriggerDescriptor> for_(Item i) { List<TriggerDescriptor> r = new ArrayList<TriggerDescriptor>(); for (TriggerDescriptor t : all()) { if(!t.isApplicable(i)) continue; if (i instanceof TopLevelItem) {// ugly TopLevelItemDescriptor tld = ((TopLevelItem) i).getDescriptor(); // tld shouldn't be really null in contract, but we often write test Describables that // doesn't have a Descriptor. if(tld!=null && !tld.isApplicable(t)) continue; } r.add(t); } return r; }
static List<TriggerDescriptor> function(Item i) { List<TriggerDescriptor> r = new ArrayList<TriggerDescriptor>(); for (TriggerDescriptor t : all()) { if(!t.isApplicable(i)) continue; if (i instanceof TopLevelItem) { TopLevelItemDescriptor tld = ((TopLevelItem) i).getDescriptor(); if(tld!=null && !tld.isApplicable(t)) continue; } r.add(t); } return r; }
/** * Returns a subset of {@link TriggerDescriptor}s that applys to the given item. */
Returns a subset of <code>TriggerDescriptor</code>s that applys to the given item
for_
{ "repo_name": "sumitk1/jenkins", "path": "core/src/main/java/hudson/triggers/Trigger.java", "license": "mit", "size": 11512 }
[ "hudson.model.Item", "hudson.model.TopLevelItem", "hudson.model.TopLevelItemDescriptor", "java.util.ArrayList", "java.util.List" ]
import hudson.model.Item; import hudson.model.TopLevelItem; import hudson.model.TopLevelItemDescriptor; import java.util.ArrayList; import java.util.List;
import hudson.model.*; import java.util.*;
[ "hudson.model", "java.util" ]
hudson.model; java.util;
2,528,714
Collection<Section> getSectionsWithInvalidCategoryCombinations(); // ------------------------------------------------------------------------- // DataSet // -------------------------------------------------------------------------
Collection<Section> getSectionsWithInvalidCategoryCombinations();
/** * Gets all section with invalid category combinations. Invalid means that * the data elements in the sections don't have the same category combination. */
Gets all section with invalid category combinations. Invalid means that the data elements in the sections don't have the same category combination
getSectionsWithInvalidCategoryCombinations
{ "repo_name": "kakada/dhis2", "path": "dhis-api/src/main/java/org/hisp/dhis/dataintegrity/DataIntegrityService.java", "license": "bsd-3-clause", "size": 8150 }
[ "java.util.Collection", "org.hisp.dhis.dataset.Section" ]
import java.util.Collection; import org.hisp.dhis.dataset.Section;
import java.util.*; import org.hisp.dhis.dataset.*;
[ "java.util", "org.hisp.dhis" ]
java.util; org.hisp.dhis;
830,389
public XSComplexTypeDefinition getEnclosingCTDefinition() { return fEnclosingCT; }
XSComplexTypeDefinition function() { return fEnclosingCT; }
/** * Locally scoped declarations are available for use only within the * complex type definition identified by the <code>scope</code> * property. */
Locally scoped declarations are available for use only within the complex type definition identified by the <code>scope</code> property
getEnclosingCTDefinition
{ "repo_name": "openjdk/jdk8u", "path": "jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeDecl.java", "license": "gpl-2.0", "size": 6779 }
[ "com.sun.org.apache.xerces.internal.xs.XSComplexTypeDefinition" ]
import com.sun.org.apache.xerces.internal.xs.XSComplexTypeDefinition;
import com.sun.org.apache.xerces.internal.xs.*;
[ "com.sun.org" ]
com.sun.org;
470,988
@Override public void enterElementValuePair(@NotNull PJParser.ElementValuePairContext ctx) { }
@Override public void enterElementValuePair(@NotNull PJParser.ElementValuePairContext ctx) { }
/** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */
The default implementation does nothing
exitResource
{ "repo_name": "Diolor/PJ", "path": "src/main/java/com/lorentzos/pj/PJBaseListener.java", "license": "mit", "size": 73292 }
[ "org.antlr.v4.runtime.misc.NotNull" ]
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.misc.*;
[ "org.antlr.v4" ]
org.antlr.v4;
782,758
public CompletableFuture<QueueDescription> createQueueAsync(String queuePath) { return this.createQueueAsync(new QueueDescription(queuePath)); }
CompletableFuture<QueueDescription> function(String queuePath) { return this.createQueueAsync(new QueueDescription(queuePath)); }
/** * Creates a new queue in the service namespace with the given name. * See {@link QueueDescription} for default values of queue properties. * @param queuePath - The name of the queue relative to the service namespace base address. * @return {@link QueueDescription} of the newly created queue. * @throws IllegalArgumentException - Entity name is null, empty, too long or uses illegal characters. */
Creates a new queue in the service namespace with the given name. See <code>QueueDescription</code> for default values of queue properties
createQueueAsync
{ "repo_name": "navalev/azure-sdk-for-java", "path": "sdk/servicebus/microsoft-azure-servicebus/src/main/java/com/microsoft/azure/servicebus/management/ManagementClientAsync.java", "license": "mit", "size": 54215 }
[ "java.util.concurrent.CompletableFuture" ]
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,055,429
public Integer getGameSelectionFromAdmin(JSONObject JSONmethodcallParameters) { int gameNumber = game.getCurrentScreen().getGameSelectionFromAdmin(); return Integer.valueOf(gameNumber); }
Integer function(JSONObject JSONmethodcallParameters) { int gameNumber = game.getCurrentScreen().getGameSelectionFromAdmin(); return Integer.valueOf(gameNumber); }
/** * Inquires the selected game. This call is done only for the admin * * @return Number of the selected game */
Inquires the selected game. This call is done only for the admin
getGameSelectionFromAdmin
{ "repo_name": "nikkis/Apocalympics", "path": "ApocalympicsOrchestratorJSClient/src/com/bmge/zombiegame/RemoteMethodListener.java", "license": "mit", "size": 8310 }
[ "org.json.JSONObject" ]
import org.json.JSONObject;
import org.json.*;
[ "org.json" ]
org.json;
2,167,106
@Override public ScoreEvaluation getUserScoreEvaluation(final UserCourseEnvironment userCourseEnv) { Float score = null; Boolean passed = null; if (scoreCalculator == null) { // this is a not-computable course node at the moment (no scoring/passing rules defined) return null; } final String scoreExpressionStr = scoreCalculator.getScoreExpression(); final String passedExpressionStr = scoreCalculator.getPassedExpression(); final ConditionInterpreter ci = userCourseEnv.getConditionInterpreter(); userCourseEnv.getScoreAccounting().setEvaluatingCourseNode(this); if (scoreExpressionStr != null) { score = new Float(ci.evaluateCalculation(scoreExpressionStr)); } if (passedExpressionStr != null) { passed = new Boolean(ci.evaluateCondition(passedExpressionStr)); } final ScoreEvaluation se = new ScoreEvaluation(score, passed); return se; }
ScoreEvaluation function(final UserCourseEnvironment userCourseEnv) { Float score = null; Boolean passed = null; if (scoreCalculator == null) { return null; } final String scoreExpressionStr = scoreCalculator.getScoreExpression(); final String passedExpressionStr = scoreCalculator.getPassedExpression(); final ConditionInterpreter ci = userCourseEnv.getConditionInterpreter(); userCourseEnv.getScoreAccounting().setEvaluatingCourseNode(this); if (scoreExpressionStr != null) { score = new Float(ci.evaluateCalculation(scoreExpressionStr)); } if (passedExpressionStr != null) { passed = new Boolean(ci.evaluateCondition(passedExpressionStr)); } final ScoreEvaluation se = new ScoreEvaluation(score, passed); return se; }
/** * the structure node does not have a score itself, but calculates the score/passed info by evaluating the configured expression in the the (condition)interpreter. * */
the structure node does not have a score itself, but calculates the score/passed info by evaluating the configured expression in the the (condition)interpreter
getUserScoreEvaluation
{ "repo_name": "huihoo/olat", "path": "OLAT-LMS/src/main/java/org/olat/lms/course/nodes/STCourseNode.java", "license": "apache-2.0", "size": 26564 }
[ "org.olat.lms.course.condition.interpreter.ConditionInterpreter", "org.olat.lms.course.run.scoring.ScoreEvaluation", "org.olat.lms.course.run.userview.UserCourseEnvironment" ]
import org.olat.lms.course.condition.interpreter.ConditionInterpreter; import org.olat.lms.course.run.scoring.ScoreEvaluation; import org.olat.lms.course.run.userview.UserCourseEnvironment;
import org.olat.lms.course.condition.interpreter.*; import org.olat.lms.course.run.scoring.*; import org.olat.lms.course.run.userview.*;
[ "org.olat.lms" ]
org.olat.lms;
833,817
public IBlockState getStateFromMeta(int meta) { EnumFacing enumfacing = EnumFacing.getFront(meta); if (enumfacing.getAxis() == EnumFacing.Axis.Y) { enumfacing = EnumFacing.NORTH; } return this.getDefaultState().withProperty(FACING, enumfacing); }
IBlockState function(int meta) { EnumFacing enumfacing = EnumFacing.getFront(meta); if (enumfacing.getAxis() == EnumFacing.Axis.Y) { enumfacing = EnumFacing.NORTH; } return this.getDefaultState().withProperty(FACING, enumfacing); }
/** * Convert the given metadata into a BlockState for this Block */
Convert the given metadata into a BlockState for this Block
getStateFromMeta
{ "repo_name": "TechStack/TechStack-s-HeavyMachineryMod", "path": "src/main/java/com/projectreddog/machinemod/block/BlockMachineModBatteryBank.java", "license": "gpl-3.0", "size": 4677 }
[ "net.minecraft.block.state.IBlockState", "net.minecraft.util.EnumFacing" ]
import net.minecraft.block.state.IBlockState; import net.minecraft.util.EnumFacing;
import net.minecraft.block.state.*; import net.minecraft.util.*;
[ "net.minecraft.block", "net.minecraft.util" ]
net.minecraft.block; net.minecraft.util;
895,488
@InterfaceAudience.Public public Manager getManager() { return manager; }
@InterfaceAudience.Public Manager function() { return manager; }
/** * The database manager that owns this database. */
The database manager that owns this database
getManager
{ "repo_name": "couchbase/couchbase-lite-java-core", "path": "src/main/java/com/couchbase/lite/Database.java", "license": "apache-2.0", "size": 114145 }
[ "com.couchbase.lite.internal.InterfaceAudience" ]
import com.couchbase.lite.internal.InterfaceAudience;
import com.couchbase.lite.internal.*;
[ "com.couchbase.lite" ]
com.couchbase.lite;
327,058
protected Credentials getCredentials() { return credentials; }
Credentials function() { return credentials; }
/** * Get the {@link Credentials} for establishing the JCR repository connection * * @return the credentials */
Get the <code>Credentials</code> for establishing the JCR repository connection
getCredentials
{ "repo_name": "davidkarlsen/camel", "path": "components/camel-jcr/src/main/java/org/apache/camel/component/jcr/JcrEndpoint.java", "license": "apache-2.0", "size": 9540 }
[ "javax.jcr.Credentials" ]
import javax.jcr.Credentials;
import javax.jcr.*;
[ "javax.jcr" ]
javax.jcr;
2,467,172
@ServiceMethod(returns = ReturnType.SINGLE) public PrivateLinkResourceInner get(String resourceGroupName, String vaultName, String privateLinkResourceName) { return getAsync(resourceGroupName, vaultName, privateLinkResourceName).block(); }
@ServiceMethod(returns = ReturnType.SINGLE) PrivateLinkResourceInner function(String resourceGroupName, String vaultName, String privateLinkResourceName) { return getAsync(resourceGroupName, vaultName, privateLinkResourceName).block(); }
/** * Returns a specified private link resource that need to be created for Backup and SiteRecovery. * * @param resourceGroupName The name of the resource group where the recovery services vault is present. * @param vaultName The name of the recovery services vault. * @param privateLinkResourceName The privateLinkResourceName parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return information of the private link resource. */
Returns a specified private link resource that need to be created for Backup and SiteRecovery
get
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/PrivateLinkResourcesOperationsClientImpl.java", "license": "mit", "size": 26123 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.recoveryservices.fluent.models.PrivateLinkResourceInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.recoveryservices.fluent.models.PrivateLinkResourceInner;
import com.azure.core.annotation.*; import com.azure.resourcemanager.recoveryservices.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,310,579
public void setCapturedQualifiers(List<String> capturedQualifiers) { this.capturedQualifiers = capturedQualifiers; }
void function(List<String> capturedQualifiers) { this.capturedQualifiers = capturedQualifiers; }
/** * Sets captured qualifiers * * @param capturedQualifiers list of {@link String}s */
Sets captured qualifiers
setCapturedQualifiers
{ "repo_name": "esig/dss", "path": "dss-diagnostic-jaxb/src/main/java/eu/europa/esig/dss/diagnostic/TrustedServiceWrapper.java", "license": "lgpl-2.1", "size": 6382 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,561,741
private void handleChangeCleaningInterval(final HttpServletRequest req, final Map<String, Object> ret) { try { final long newInterval = getLongParam(req, STATS_MAP_CLEANINGINTERVAL); if (MetricReportManager.isAvailable()) { final MetricReportManager metricManager = MetricReportManager.getInstance(); final InMemoryMetricEmitter memoryEmitter = extractInMemoryMetricEmitter(metricManager); memoryEmitter.setReportingInterval(newInterval); ret.put(STATUS_PARAM, RESPONSE_SUCCESS); } else { ret.put(RESPONSE_ERROR, "MetricManager is not available"); } } catch (final Exception e) { logger.error(e); ret.put(RESPONSE_ERROR, e.getMessage()); } }
void function(final HttpServletRequest req, final Map<String, Object> ret) { try { final long newInterval = getLongParam(req, STATS_MAP_CLEANINGINTERVAL); if (MetricReportManager.isAvailable()) { final MetricReportManager metricManager = MetricReportManager.getInstance(); final InMemoryMetricEmitter memoryEmitter = extractInMemoryMetricEmitter(metricManager); memoryEmitter.setReportingInterval(newInterval); ret.put(STATUS_PARAM, RESPONSE_SUCCESS); } else { ret.put(RESPONSE_ERROR, STR); } } catch (final Exception e) { logger.error(e); ret.put(RESPONSE_ERROR, e.getMessage()); } }
/** * Update InMemoryMetricEmitter interval to maintain metric snapshots */
Update InMemoryMetricEmitter interval to maintain metric snapshots
handleChangeCleaningInterval
{ "repo_name": "reallocf/azkaban", "path": "azkaban-exec-server/src/main/java/azkaban/execapp/StatsServlet.java", "license": "apache-2.0", "size": 10360 }
[ "java.util.Map", "javax.servlet.http.HttpServletRequest" ]
import java.util.Map; import javax.servlet.http.HttpServletRequest;
import java.util.*; import javax.servlet.http.*;
[ "java.util", "javax.servlet" ]
java.util; javax.servlet;
1,541,948
private float updateRotation(float angle, float targetAngle, float maxIncrease) { float f = MathHelper.wrapDegrees(targetAngle - angle); if (f > maxIncrease) { f = maxIncrease; } if (f < -maxIncrease) { f = -maxIncrease; } return angle + f; }
float function(float angle, float targetAngle, float maxIncrease) { float f = MathHelper.wrapDegrees(targetAngle - angle); if (f > maxIncrease) { f = maxIncrease; } if (f < -maxIncrease) { f = -maxIncrease; } return angle + f; }
/** * Arguments: current rotation, intended rotation, max increment. */
Arguments: current rotation, intended rotation, max increment
updateRotation
{ "repo_name": "Severed-Infinity/technium", "path": "build/tmp/recompileMc/sources/net/minecraft/entity/EntityLiving.java", "license": "gpl-3.0", "size": 50613 }
[ "net.minecraft.util.math.MathHelper" ]
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.*;
[ "net.minecraft.util" ]
net.minecraft.util;
2,299,212
int getMembersCount(PerunSession sess, Vo vo, Status status) throws InternalErrorException;
int getMembersCount(PerunSession sess, Vo vo, Status status) throws InternalErrorException;
/** * Returns number of Vo members with defined status. * * @param sess * @param vo * @param status * @return number of members * @throws InternalErrorException */
Returns number of Vo members with defined status
getMembersCount
{ "repo_name": "stavamichal/perun", "path": "perun-core/src/main/java/cz/metacentrum/perun/core/bl/MembersManagerBl.java", "license": "bsd-2-clause", "size": 66169 }
[ "cz.metacentrum.perun.core.api.PerunSession", "cz.metacentrum.perun.core.api.Status", "cz.metacentrum.perun.core.api.Vo", "cz.metacentrum.perun.core.api.exceptions.InternalErrorException" ]
import cz.metacentrum.perun.core.api.PerunSession; import cz.metacentrum.perun.core.api.Status; import cz.metacentrum.perun.core.api.Vo; import cz.metacentrum.perun.core.api.exceptions.InternalErrorException;
import cz.metacentrum.perun.core.api.*; import cz.metacentrum.perun.core.api.exceptions.*;
[ "cz.metacentrum.perun" ]
cz.metacentrum.perun;
1,842,844
public Builder modules(DrawerModule... drawerItems) { if (this.mDrawerItems == null) { this.mDrawerItems = new ArrayList<>(); } if (drawerItems != null) { Collections.addAll(this.mDrawerItems, drawerItems); } return this; }
Builder function(DrawerModule... drawerItems) { if (this.mDrawerItems == null) { this.mDrawerItems = new ArrayList<>(); } if (drawerItems != null) { Collections.addAll(this.mDrawerItems, drawerItems); } return this; }
/** * Add a initial DrawerItem or a DrawerItem Array for the Drawer */
Add a initial DrawerItem or a DrawerItem Array for the Drawer
modules
{ "repo_name": "omegasoft7/DebugDrawer-1", "path": "debugdrawer/src/main/java/io/palaima/debugdrawer/DebugDrawer.java", "license": "apache-2.0", "size": 14584 }
[ "io.palaima.debugdrawer.module.DrawerModule", "java.util.ArrayList", "java.util.Collections" ]
import io.palaima.debugdrawer.module.DrawerModule; import java.util.ArrayList; import java.util.Collections;
import io.palaima.debugdrawer.module.*; import java.util.*;
[ "io.palaima.debugdrawer", "java.util" ]
io.palaima.debugdrawer; java.util;
2,396,190
private static List<String> getInheritedEntryPoints(IJavaProject javaProject, IModule module, Map<String, Set<IModule>> inheritedModulesCache, Map<String, List<String>> entryPointsCache) { List<String> entryPoints = new ArrayList<String>(); for (IModule m : getAllInheritedModules(javaProject, module, inheritedModulesCache)) { entryPoints.addAll(getEntryPoints(javaProject, m, entryPointsCache)); } return entryPoints; }
static List<String> function(IJavaProject javaProject, IModule module, Map<String, Set<IModule>> inheritedModulesCache, Map<String, List<String>> entryPointsCache) { List<String> entryPoints = new ArrayList<String>(); for (IModule m : getAllInheritedModules(javaProject, module, inheritedModulesCache)) { entryPoints.addAll(getEntryPoints(javaProject, m, entryPointsCache)); } return entryPoints; }
/** * Returns the list of entry points for a given module and all its * (transitively) inherited dependencies. * * @param javaProject the associated Java project * @param module the module to evaluate * @param inheritedModulesCache a cache for (module -> directly inherited * modules) mappings * @param entryPointsCache a cache for (module -> entry points) mappings * @return the list of entry point names */
Returns the list of entry points for a given module and all its (transitively) inherited dependencies
getInheritedEntryPoints
{ "repo_name": "briandealwis/gwt-eclipse-plugin", "path": "plugins/com.gwtplugins.gwt.eclipse.core/src/com/google/gwt/eclipse/core/properties/GWTProjectProperties.java", "license": "epl-1.0", "size": 10840 }
[ "com.google.gwt.eclipse.core.modules.IModule", "java.util.ArrayList", "java.util.List", "java.util.Map", "java.util.Set", "org.eclipse.jdt.core.IJavaProject" ]
import com.google.gwt.eclipse.core.modules.IModule; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Set; import org.eclipse.jdt.core.IJavaProject;
import com.google.gwt.eclipse.core.modules.*; import java.util.*; import org.eclipse.jdt.core.*;
[ "com.google.gwt", "java.util", "org.eclipse.jdt" ]
com.google.gwt; java.util; org.eclipse.jdt;
1,424,550
default InfinispanEndpointBuilder infinispan(String path) { class InfinispanEndpointBuilderImpl extends AbstractEndpointBuilder implements InfinispanEndpointBuilder, AdvancedInfinispanEndpointBuilder { public InfinispanEndpointBuilderImpl(String path) { super("infinispan", path); } } return new InfinispanEndpointBuilderImpl(path); }
default InfinispanEndpointBuilder infinispan(String path) { class InfinispanEndpointBuilderImpl extends AbstractEndpointBuilder implements InfinispanEndpointBuilder, AdvancedInfinispanEndpointBuilder { public InfinispanEndpointBuilderImpl(String path) { super(STR, path); } } return new InfinispanEndpointBuilderImpl(path); }
/** * Infinispan (camel-infinispan) * For reading/writing from/to Infinispan distributed key/value store and * data grid. * * Category: cache,datagrid,clustering * Available as of version: 2.13 * Maven coordinates: org.apache.camel:camel-infinispan * * Syntax: <code>infinispan:cacheName</code> * * Path parameter: cacheName (required) * The cache to use */
Infinispan (camel-infinispan) For reading/writing from/to Infinispan distributed key/value store and data grid. Category: cache,datagrid,clustering Available as of version: 2.13 Maven coordinates: org.apache.camel:camel-infinispan Syntax: <code>infinispan:cacheName</code> Path parameter: cacheName (required) The cache to use
infinispan
{ "repo_name": "Fabryprog/camel", "path": "core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/InfinispanEndpointBuilderFactory.java", "license": "apache-2.0", "size": 49609 }
[ "org.apache.camel.builder.endpoint.AbstractEndpointBuilder" ]
import org.apache.camel.builder.endpoint.AbstractEndpointBuilder;
import org.apache.camel.builder.endpoint.*;
[ "org.apache.camel" ]
org.apache.camel;
1,496,744
private Ponto buscarPonto(String nome){ Ponto ponto = null; Iterator<Ponto> it = listaDePontos.iterator(); while(it.hasNext()){ ponto = it.next(); if(ponto.getNome().equals(nome)) return ponto; } return null; }
Ponto function(String nome){ Ponto ponto = null; Iterator<Ponto> it = listaDePontos.iterator(); while(it.hasNext()){ ponto = it.next(); if(ponto.getNome().equals(nome)) return ponto; } return null; }
/** * Busca o ponto a partir do nome. * @param nome - Nome do ponto a ser buscado. * @return ponto - Ponto encontrado || null - Caso o ponto não exista. */
Busca o ponto a partir do nome
buscarPonto
{ "repo_name": "MrGustavo/DistRotas", "path": "src/applet/AppletDistRotas.java", "license": "gpl-3.0", "size": 22783 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
766,235
private Dop findExpandedOpcodeForInsn(DalvInsn insn) { Dop result = findOpcodeForInsn(insn.getLowRegVersion(), insn.getOpcode()); if (result == null) { throw new DexException("No expanded opcode for " + insn); } return result; }
Dop function(DalvInsn insn) { Dop result = findOpcodeForInsn(insn.getLowRegVersion(), insn.getOpcode()); if (result == null) { throw new DexException(STR + insn); } return result; }
/** * Finds the proper opcode for the given instruction, ignoring * register constraints. * * @param insn {@code non-null;} the instruction in question * @return {@code non-null;} the opcode that fits */
Finds the proper opcode for the given instruction, ignoring register constraints
findExpandedOpcodeForInsn
{ "repo_name": "mread/buck", "path": "third-party/java/dx-from-kitkat/src/com/android/dx/dex/code/OutputFinisher.java", "license": "apache-2.0", "size": 27505 }
[ "com.android.dex.DexException" ]
import com.android.dex.DexException;
import com.android.dex.*;
[ "com.android.dex" ]
com.android.dex;
2,394,974
public IdentityContext getIdentityContext() { return identityContext; }
IdentityContext function() { return identityContext; }
/** * Gets the identity context. * * @return the identity context. */
Gets the identity context
getIdentityContext
{ "repo_name": "quann169/MotownBlueCurrent", "path": "domain/core-api/src/main/java/io/motown/domain/api/chargingstation/SoftResetChargingStationRequestedEvent.java", "license": "apache-2.0", "size": 2479 }
[ "io.motown.domain.api.security.IdentityContext" ]
import io.motown.domain.api.security.IdentityContext;
import io.motown.domain.api.security.*;
[ "io.motown.domain" ]
io.motown.domain;
156,282
Collection<String> getColumnRefs();
Collection<String> getColumnRefs();
/** * Return the ordered list of column references to be sorted. * @return the ordered list. */
Return the ordered list of column references to be sorted
getColumnRefs
{ "repo_name": "qjafcunuas/jbromo", "path": "jbromo-webapp/jbromo-webapp-jsf/jbromo-webapp-jsf-lib/src/main/java/org/jbromo/webapp/jsf/component/datatable/IDataTableSortColumn.java", "license": "apache-2.0", "size": 2863 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
661,585
Map<String, String> configure( @Valid AgentClientMetadata agentClientMetadata ) throws ConfigureException;
Map<String, String> configure( @Valid AgentClientMetadata agentClientMetadata ) throws ConfigureException;
/** * Obtain server-provided configuration properties. * * @param agentClientMetadata metadata about the client making this request * @return a map of properties * @throws ConfigureException if the server properties cannot be obtained */
Obtain server-provided configuration properties
configure
{ "repo_name": "Netflix/genie", "path": "genie-agent/src/main/java/com/netflix/genie/agent/execution/services/AgentJobService.java", "license": "apache-2.0", "size": 7014 }
[ "com.netflix.genie.agent.execution.exceptions.ConfigureException", "com.netflix.genie.common.external.dtos.v4.AgentClientMetadata", "java.util.Map", "javax.validation.Valid" ]
import com.netflix.genie.agent.execution.exceptions.ConfigureException; import com.netflix.genie.common.external.dtos.v4.AgentClientMetadata; import java.util.Map; import javax.validation.Valid;
import com.netflix.genie.agent.execution.exceptions.*; import com.netflix.genie.common.external.dtos.v4.*; import java.util.*; import javax.validation.*;
[ "com.netflix.genie", "java.util", "javax.validation" ]
com.netflix.genie; java.util; javax.validation;
1,138,061
public static Path getMobFamilyPath(Configuration conf, TableName tableName, String familyName) { return new Path(getMobRegionPath(conf, tableName), familyName); }
static Path function(Configuration conf, TableName tableName, String familyName) { return new Path(getMobRegionPath(conf, tableName), familyName); }
/** * Gets the family dir of the mob files. * It's {HBASE_DIR}/mobdir/{namespace}/{tableName}/{regionEncodedName}/{columnFamilyName}. * @param conf The current configuration. * @param tableName The current table name. * @param familyName The current family name. * @return The family dir of the mob files. */
Gets the family dir of the mob files. It's {HBASE_DIR}/mobdir/{namespace}/{tableName}/{regionEncodedName}/{columnFamilyName}
getMobFamilyPath
{ "repo_name": "gustavoanatoly/hbase", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/mob/MobUtils.java", "license": "apache-2.0", "size": 39255 }
[ "org.apache.hadoop.conf.Configuration", "org.apache.hadoop.fs.Path", "org.apache.hadoop.hbase.TableName" ]
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.conf.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hbase.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,947,812
@Test public void testLFText() throws Exception { String input1 = "This is some text.\nWith a newline in it.\n"; String expected1 = "This is some text."; String expected2 = "With a newline in it."; Util.createInputFile(cluster, "testLFTest-input1.txt", new String[] {input1}); // check that loading the top level dir still reading the file a couple // of subdirs below LoadFunc text1 = new ReadToEndLoader(new TextLoader(), ConfigurationUtil. toConfiguration(cluster.getProperties()), "testLFTest-input1.txt", 0); Tuple f1 = text1.getNext(); Tuple f2 = text1.getNext(); Util.deleteFile(cluster, "testLFTest-input1.txt"); assertTrue(expected1.equals(f1.get(0).toString()) && expected2.equals(f2.get(0).toString())); Util.createInputFile(cluster, "testLFTest-input2.txt", new String[] {}); LoadFunc text2 = new ReadToEndLoader(new TextLoader(), ConfigurationUtil. toConfiguration(cluster.getProperties()), "testLFTest-input2.txt", 0); Tuple f3 = text2.getNext(); Util.deleteFile(cluster, "testLFTest-input2.txt"); assertTrue(f3 == null); }
void function() throws Exception { String input1 = STR; String expected1 = STR; String expected2 = STR; Util.createInputFile(cluster, STR, new String[] {input1}); LoadFunc text1 = new ReadToEndLoader(new TextLoader(), ConfigurationUtil. toConfiguration(cluster.getProperties()), STR, 0); Tuple f1 = text1.getNext(); Tuple f2 = text1.getNext(); Util.deleteFile(cluster, STR); assertTrue(expected1.equals(f1.get(0).toString()) && expected2.equals(f2.get(0).toString())); Util.createInputFile(cluster, STR, new String[] {}); LoadFunc text2 = new ReadToEndLoader(new TextLoader(), ConfigurationUtil. toConfiguration(cluster.getProperties()), STR, 0); Tuple f3 = text2.getNext(); Util.deleteFile(cluster, STR); assertTrue(f3 == null); }
/** * test {@link TextLoader} - this also tests that {@link TextLoader} is capable * of reading data a couple of dirs deep when the input specified is the top * level directory */
test <code>TextLoader</code> - this also tests that <code>TextLoader</code> is capable of reading data a couple of dirs deep when the input specified is the top level directory
testLFText
{ "repo_name": "hxquangnhat/PIG-ROLLUP-MRCUBE", "path": "test/org/apache/pig/test/TestBuiltin.java", "license": "apache-2.0", "size": 133185 }
[ "org.apache.pig.LoadFunc", "org.apache.pig.backend.hadoop.datastorage.ConfigurationUtil", "org.apache.pig.builtin.TextLoader", "org.apache.pig.data.Tuple", "org.apache.pig.impl.io.ReadToEndLoader", "org.junit.Assert" ]
import org.apache.pig.LoadFunc; import org.apache.pig.backend.hadoop.datastorage.ConfigurationUtil; import org.apache.pig.builtin.TextLoader; import org.apache.pig.data.Tuple; import org.apache.pig.impl.io.ReadToEndLoader; import org.junit.Assert;
import org.apache.pig.*; import org.apache.pig.backend.hadoop.datastorage.*; import org.apache.pig.builtin.*; import org.apache.pig.data.*; import org.apache.pig.impl.io.*; import org.junit.*;
[ "org.apache.pig", "org.junit" ]
org.apache.pig; org.junit;
1,544,157
void unregister(Object listener) { if (listener instanceof Subscriber) { Subscriber subscriber = (Subscriber) listener; CopyOnWriteArraySet<Subscriber> currentSubscribers = subscribers.get(subscriber.registryKey); if (currentSubscribers != null) { currentSubscribers.remove(subscriber); } } else { Map<Integer, List<Subscriber>> listenerMethods = findAllSubscribers(listener); for (Map.Entry<Integer, List<Subscriber>> entry : listenerMethods.entrySet()) { int hashCode = entry.getKey(); Collection<Subscriber> listenerMethodsForType = entry.getValue(); CopyOnWriteArraySet<Subscriber> currentSubscribers = subscribers.get(hashCode); if (currentSubscribers != null) { currentSubscribers.removeAll(listenerMethodsForType); } // don't try to remove the set if it's empty; that can't be done safely without a lock // anyway, if the set is empty it'll just be wrapping an array of length 0 } } }
void unregister(Object listener) { if (listener instanceof Subscriber) { Subscriber subscriber = (Subscriber) listener; CopyOnWriteArraySet<Subscriber> currentSubscribers = subscribers.get(subscriber.registryKey); if (currentSubscribers != null) { currentSubscribers.remove(subscriber); } } else { Map<Integer, List<Subscriber>> listenerMethods = findAllSubscribers(listener); for (Map.Entry<Integer, List<Subscriber>> entry : listenerMethods.entrySet()) { int hashCode = entry.getKey(); Collection<Subscriber> listenerMethodsForType = entry.getValue(); CopyOnWriteArraySet<Subscriber> currentSubscribers = subscribers.get(hashCode); if (currentSubscribers != null) { currentSubscribers.removeAll(listenerMethodsForType); } } } }
/** * Unregisters all subscribers on the given listener object. */
Unregisters all subscribers on the given listener object
unregister
{ "repo_name": "pustike/pustike-eventbus", "path": "src/main/java/io/github/pustike/eventbus/SubscriberRegistry.java", "license": "apache-2.0", "size": 8950 }
[ "java.util.Collection", "java.util.List", "java.util.Map", "java.util.concurrent.CopyOnWriteArraySet" ]
import java.util.Collection; import java.util.List; import java.util.Map; import java.util.concurrent.CopyOnWriteArraySet;
import java.util.*; import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,479,574
protected boolean isEncryptNameID(BaseSAML2ProfileRequestContext<?, ?, ?> requestContext) throws ProfileException { boolean nameIdEncRequiredByAuthnRequest = isRequestRequiresEncryptNameID(requestContext); SAMLMessageEncoder encoder = getOutboundMessageEncoder(requestContext); boolean nameIdEncRequiredByConfig = false; try { nameIdEncRequiredByConfig = requestContext.getProfileConfiguration().getEncryptNameID() == CryptoOperationRequirementLevel.always || (requestContext.getProfileConfiguration().getEncryptNameID() == CryptoOperationRequirementLevel.conditional && !encoder .providesMessageConfidentiality(requestContext)); } catch (MessageEncodingException e) { requestContext.setFailureStatus(buildStatus(StatusCode.RESPONDER_URI, null, "Unable to determine if NameID should be encrypted")); String msg = "Unable to determine if outbound encoding '" + encoder.getBindingURI() + "' provides message confidentiality protection"; log.error(msg); throw new ProfileException(msg); } return nameIdEncRequiredByAuthnRequest || nameIdEncRequiredByConfig; }
boolean function(BaseSAML2ProfileRequestContext<?, ?, ?> requestContext) throws ProfileException { boolean nameIdEncRequiredByAuthnRequest = isRequestRequiresEncryptNameID(requestContext); SAMLMessageEncoder encoder = getOutboundMessageEncoder(requestContext); boolean nameIdEncRequiredByConfig = false; try { nameIdEncRequiredByConfig = requestContext.getProfileConfiguration().getEncryptNameID() == CryptoOperationRequirementLevel.always (requestContext.getProfileConfiguration().getEncryptNameID() == CryptoOperationRequirementLevel.conditional && !encoder .providesMessageConfidentiality(requestContext)); } catch (MessageEncodingException e) { requestContext.setFailureStatus(buildStatus(StatusCode.RESPONDER_URI, null, STR)); String msg = STR + encoder.getBindingURI() + STR; log.error(msg); throw new ProfileException(msg); } return nameIdEncRequiredByAuthnRequest nameIdEncRequiredByConfig; }
/** * Determine whether NameID's should be encrypted. * * @param requestContext the current request context * @return true if NameID's should be encrypted, false otherwise * @throws edu.internet2.middleware.shibboleth.common.profile.ProfileException if there is a problem determining whether NameID's should be encrypted */
Determine whether NameID's should be encrypted
isEncryptNameID
{ "repo_name": "brainysmith/shibboleth-idp", "path": "src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/AbstractSAML2ProfileHandler.java", "license": "apache-2.0", "size": 51006 }
[ "edu.internet2.middleware.shibboleth.common.profile.ProfileException", "edu.internet2.middleware.shibboleth.common.relyingparty.provider.CryptoOperationRequirementLevel", "org.opensaml.common.binding.encoding.SAMLMessageEncoder", "org.opensaml.saml2.core.StatusCode", "org.opensaml.ws.message.encoder.MessageEncodingException" ]
import edu.internet2.middleware.shibboleth.common.profile.ProfileException; import edu.internet2.middleware.shibboleth.common.relyingparty.provider.CryptoOperationRequirementLevel; import org.opensaml.common.binding.encoding.SAMLMessageEncoder; import org.opensaml.saml2.core.StatusCode; import org.opensaml.ws.message.encoder.MessageEncodingException;
import edu.internet2.middleware.shibboleth.common.profile.*; import edu.internet2.middleware.shibboleth.common.relyingparty.provider.*; import org.opensaml.common.binding.encoding.*; import org.opensaml.saml2.core.*; import org.opensaml.ws.message.encoder.*;
[ "edu.internet2.middleware", "org.opensaml.common", "org.opensaml.saml2", "org.opensaml.ws" ]
edu.internet2.middleware; org.opensaml.common; org.opensaml.saml2; org.opensaml.ws;
2,476,491
public CourseRequest loadCourseRequest(Element requestEl, Student student, Map<Long, Offering> offeringTable, Map<Long, Course> courseTable) { List<Course> courses = new ArrayList<Course>(); courses.add(courseTable.get(Long.valueOf(requestEl.attributeValue("course")))); for (Iterator<?> k = requestEl.elementIterator("alternative"); k.hasNext();) courses.add(courseTable.get(Long.valueOf(((Element) k.next()).attributeValue("course")))); Long timeStamp = null; if (requestEl.attributeValue("timeStamp") != null) timeStamp = Long.valueOf(requestEl.attributeValue("timeStamp")); CourseRequest courseRequest = new CourseRequest( Long.parseLong(requestEl.attributeValue("id")), Integer.parseInt(requestEl.attributeValue("priority")), "true".equals(requestEl.attributeValue("alternative")), student, courses, "true".equals(requestEl.attributeValue("waitlist", "false")), RequestPriority.valueOf(requestEl.attributeValue("importance", "true".equals(requestEl.attributeValue("critical", "false")) ? RequestPriority.Critical.name() : RequestPriority.Normal.name())), timeStamp); if (iWaitlistCritical && RequestPriority.Critical.isCritical(courseRequest) && !courseRequest.isAlternative()) courseRequest.setWaitlist(true); if (requestEl.attributeValue("weight") != null) courseRequest.setWeight(Double.parseDouble(requestEl.attributeValue("weight"))); for (Iterator<?> k = requestEl.elementIterator("waitlisted"); k.hasNext();) { Element choiceEl = (Element) k.next(); courseRequest.getWaitlistedChoices().add( new Choice(offeringTable.get(Long.valueOf(choiceEl.attributeValue("offering"))), choiceEl.getText())); } for (Iterator<?> k = requestEl.elementIterator("selected"); k.hasNext();) { Element choiceEl = (Element) k.next(); courseRequest.getSelectedChoices().add( new Choice(offeringTable.get(Long.valueOf(choiceEl.attributeValue("offering"))), choiceEl.getText())); } for (Iterator<?> k = requestEl.elementIterator("required"); k.hasNext();) { Element choiceEl = (Element) k.next(); courseRequest.getRequiredChoices().add( new Choice(offeringTable.get(Long.valueOf(choiceEl.attributeValue("offering"))), choiceEl.getText())); } groups: for (Iterator<?> k = requestEl.elementIterator("group"); k.hasNext();) { Element groupEl = (Element) k.next(); long gid = Long.parseLong(groupEl.attributeValue("id")); String gname = groupEl.attributeValue("name", "g" + gid); Course course = courseTable.get(Long.valueOf(groupEl.attributeValue("course"))); for (RequestGroup g: course.getRequestGroups()) { if (g.getId() == gid) { courseRequest.addRequestGroup(g); continue groups; } } courseRequest.addRequestGroup(new RequestGroup(gid, gname, course)); } return courseRequest; }
CourseRequest function(Element requestEl, Student student, Map<Long, Offering> offeringTable, Map<Long, Course> courseTable) { List<Course> courses = new ArrayList<Course>(); courses.add(courseTable.get(Long.valueOf(requestEl.attributeValue(STR)))); for (Iterator<?> k = requestEl.elementIterator(STR); k.hasNext();) courses.add(courseTable.get(Long.valueOf(((Element) k.next()).attributeValue(STR)))); Long timeStamp = null; if (requestEl.attributeValue(STR) != null) timeStamp = Long.valueOf(requestEl.attributeValue(STR)); CourseRequest courseRequest = new CourseRequest( Long.parseLong(requestEl.attributeValue("id")), Integer.parseInt(requestEl.attributeValue(STR)), "true".equals(requestEl.attributeValue(STR)), student, courses, "true".equals(requestEl.attributeValue(STR, "false")), RequestPriority.valueOf(requestEl.attributeValue(STR, "true".equals(requestEl.attributeValue(STR, "false")) ? RequestPriority.Critical.name() : RequestPriority.Normal.name())), timeStamp); if (iWaitlistCritical && RequestPriority.Critical.isCritical(courseRequest) && !courseRequest.isAlternative()) courseRequest.setWaitlist(true); if (requestEl.attributeValue(STR) != null) courseRequest.setWeight(Double.parseDouble(requestEl.attributeValue(STR))); for (Iterator<?> k = requestEl.elementIterator(STR); k.hasNext();) { Element choiceEl = (Element) k.next(); courseRequest.getWaitlistedChoices().add( new Choice(offeringTable.get(Long.valueOf(choiceEl.attributeValue(STR))), choiceEl.getText())); } for (Iterator<?> k = requestEl.elementIterator(STR); k.hasNext();) { Element choiceEl = (Element) k.next(); courseRequest.getSelectedChoices().add( new Choice(offeringTable.get(Long.valueOf(choiceEl.attributeValue(STR))), choiceEl.getText())); } for (Iterator<?> k = requestEl.elementIterator(STR); k.hasNext();) { Element choiceEl = (Element) k.next(); courseRequest.getRequiredChoices().add( new Choice(offeringTable.get(Long.valueOf(choiceEl.attributeValue(STR))), choiceEl.getText())); } groups: for (Iterator<?> k = requestEl.elementIterator("group"); k.hasNext();) { Element groupEl = (Element) k.next(); long gid = Long.parseLong(groupEl.attributeValue("id")); String gname = groupEl.attributeValue("name", "g" + gid); Course course = courseTable.get(Long.valueOf(groupEl.attributeValue(STR))); for (RequestGroup g: course.getRequestGroups()) { if (g.getId() == gid) { courseRequest.addRequestGroup(g); continue groups; } } courseRequest.addRequestGroup(new RequestGroup(gid, gname, course)); } return courseRequest; }
/** * Load course request * @param requestEl request element * @param student parent student * @param offeringTable offering table * @param courseTable course table * @return loaded course request */
Load course request
loadCourseRequest
{ "repo_name": "UniTime/cpsolver", "path": "src/org/cpsolver/studentsct/StudentSectioningXMLLoader.java", "license": "lgpl-3.0", "size": 63607 }
[ "java.util.ArrayList", "java.util.Iterator", "java.util.List", "java.util.Map", "org.cpsolver.studentsct.model.Choice", "org.cpsolver.studentsct.model.Course", "org.cpsolver.studentsct.model.CourseRequest", "org.cpsolver.studentsct.model.Offering", "org.cpsolver.studentsct.model.Request", "org.cpsolver.studentsct.model.RequestGroup", "org.cpsolver.studentsct.model.Student", "org.dom4j.Element" ]
import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; import org.cpsolver.studentsct.model.Choice; import org.cpsolver.studentsct.model.Course; import org.cpsolver.studentsct.model.CourseRequest; import org.cpsolver.studentsct.model.Offering; import org.cpsolver.studentsct.model.Request; import org.cpsolver.studentsct.model.RequestGroup; import org.cpsolver.studentsct.model.Student; import org.dom4j.Element;
import java.util.*; import org.cpsolver.studentsct.model.*; import org.dom4j.*;
[ "java.util", "org.cpsolver.studentsct", "org.dom4j" ]
java.util; org.cpsolver.studentsct; org.dom4j;
293,251
public CalendarEventAttendeeNotificationBuilder to(final Attendee attendee) { this.recipients = Arrays.asList(attendee); return this; }
CalendarEventAttendeeNotificationBuilder function(final Attendee attendee) { this.recipients = Arrays.asList(attendee); return this; }
/** * Sets the single recipient of the user notification to build. * @param attendee the recipient for the notification. * @return itself. */
Sets the single recipient of the user notification to build
to
{ "repo_name": "auroreallibe/Silverpeas-Core", "path": "core-library/src/main/java/org/silverpeas/core/calendar/event/notification/CalendarEventAttendeeNotificationBuilder.java", "license": "agpl-3.0", "size": 8536 }
[ "java.util.Arrays", "org.silverpeas.core.calendar.event.Attendee" ]
import java.util.Arrays; import org.silverpeas.core.calendar.event.Attendee;
import java.util.*; import org.silverpeas.core.calendar.event.*;
[ "java.util", "org.silverpeas.core" ]
java.util; org.silverpeas.core;
343,184
public SkuDescription withLocations(List<String> locations) { this.locations = locations; return this; }
SkuDescription function(List<String> locations) { this.locations = locations; return this; }
/** * Set locations of the SKU. * * @param locations the locations value to set * @return the SkuDescription object itself. */
Set locations of the SKU
withLocations
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/appservice/mgmt-v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/SkuDescription.java", "license": "mit", "size": 5339 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,072,715
InputStream getInputStream() throws IOException;
InputStream getInputStream() throws IOException;
/** * Method to obtain the InputStream for this connection. * * @return the single InputStream for this connection * @throws IOException * if no InputStream is available or the connection is closed */
Method to obtain the InputStream for this connection
getInputStream
{ "repo_name": "mcpat/microjiac-public", "path": "microjiac-base-impl/src/main/java/de/jiac/micro/core/io/IStreamConnection.java", "license": "gpl-3.0", "size": 2599 }
[ "java.io.IOException", "java.io.InputStream" ]
import java.io.IOException; import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
1,783,049
public void setTargetBorder(BorderStyle targetBorder) { getState().targetBorder = targetBorder; }
void function(BorderStyle targetBorder) { getState().targetBorder = targetBorder; }
/** * Sets the border of the target window. * * @param targetBorder * the targetBorder to set. */
Sets the border of the target window
setTargetBorder
{ "repo_name": "jdahlstrom/vaadin.react", "path": "server/src/main/java/com/vaadin/ui/Link.java", "license": "apache-2.0", "size": 6845 }
[ "com.vaadin.shared.ui.BorderStyle" ]
import com.vaadin.shared.ui.BorderStyle;
import com.vaadin.shared.ui.*;
[ "com.vaadin.shared" ]
com.vaadin.shared;
1,382,301
if (value == null) { return null; } else if (type == Timestamp.class) { return convertToDate(type, value, DateUtil.getDateTimePattern()); } else if (type == Date.class) { return convertToDate(type, value, DateUtil.getDatePattern()); } else if (type == String.class) { return convertToString(value); } throw new ConversionException("Could not convert " + value.getClass().getName() + " to " + type.getName()); }
if (value == null) { return null; } else if (type == Timestamp.class) { return convertToDate(type, value, DateUtil.getDateTimePattern()); } else if (type == Date.class) { return convertToDate(type, value, DateUtil.getDatePattern()); } else if (type == String.class) { return convertToString(value); } throw new ConversionException(STR + value.getClass().getName() + STR + type.getName()); }
/** * Convert a date to a String and a String to a Date * @param type String, Date or Timestamp * @param value value to convert * @return Converted value for property population */
Convert a date to a String and a String to a Date
convert
{ "repo_name": "Axxis-computo/Control", "path": "src/main/java/com/axxiscomputo/util/DateConverter.java", "license": "apache-2.0", "size": 3246 }
[ "java.sql.Timestamp", "java.util.Date", "org.apache.commons.beanutils.ConversionException" ]
import java.sql.Timestamp; import java.util.Date; import org.apache.commons.beanutils.ConversionException;
import java.sql.*; import java.util.*; import org.apache.commons.beanutils.*;
[ "java.sql", "java.util", "org.apache.commons" ]
java.sql; java.util; org.apache.commons;
1,409,667
public static Path toTempPath(String orig) { return toTempPath(new Path(orig)); }
static Path function(String orig) { return toTempPath(new Path(orig)); }
/** * Given a path, convert to a temporary path. */
Given a path, convert to a temporary path
toTempPath
{ "repo_name": "wisgood/hive", "path": "ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java", "license": "apache-2.0", "size": 136381 }
[ "org.apache.hadoop.fs.Path" ]
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
257,442
public void clear() { Arrays.fill(mReceivedPointerDownX, 0); Arrays.fill(mReceivedPointerDownY, 0); Arrays.fill(mReceivedPointerDownTime, 0); mReceivedPointersDown = 0; mActivePointers = 0; mPrimaryActivePointerId = 0; mHasMovingActivePointer = false; mLastReceivedUpPointerDownTime = 0; mLastReceivedUpPointerId = 0; mLastReceivedUpPointerActive = false; mLastReceivedUpPointerDownX = 0; mLastReceivedUpPointerDownY = 0; }
void function() { Arrays.fill(mReceivedPointerDownX, 0); Arrays.fill(mReceivedPointerDownY, 0); Arrays.fill(mReceivedPointerDownTime, 0); mReceivedPointersDown = 0; mActivePointers = 0; mPrimaryActivePointerId = 0; mHasMovingActivePointer = false; mLastReceivedUpPointerDownTime = 0; mLastReceivedUpPointerId = 0; mLastReceivedUpPointerActive = false; mLastReceivedUpPointerDownX = 0; mLastReceivedUpPointerDownY = 0; }
/** * Clears the internals state. */
Clears the internals state
clear
{ "repo_name": "rex-xxx/mt6572_x201", "path": "frameworks/base/services/java/com/android/server/accessibility/TouchExplorer.java", "license": "gpl-2.0", "size": 93961 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
691,290
public final OperationsClient getOperationsClient() { return operationsClient; } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists Instances in a given location. * * <p>Sample code: * * <pre>{@code * try (CloudMemcacheClient cloudMemcacheClient = CloudMemcacheClient.create()) { * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); * for (Instance element : cloudMemcacheClient.listInstances(parent).iterateAll()) { * // doThingsWith(element); * } * }
final OperationsClient function() { return operationsClient; } /** * Lists Instances in a given location. * * <p>Sample code: * * <pre>{ * try (CloudMemcacheClient cloudMemcacheClient = CloudMemcacheClient.create()) { * LocationName parent = LocationName.of(STR, STR); * for (Instance element : cloudMemcacheClient.listInstances(parent).iterateAll()) { * * } * }
/** * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call
getOperationsClient
{ "repo_name": "googleapis/java-memcache", "path": "google-cloud-memcache/src/main/java/com/google/cloud/memcache/v1beta2/CloudMemcacheClient.java", "license": "apache-2.0", "size": 53069 }
[ "com.google.longrunning.OperationsClient" ]
import com.google.longrunning.OperationsClient;
import com.google.longrunning.*;
[ "com.google.longrunning" ]
com.google.longrunning;
204,922
public static <T> Set<T> toSet(Iterable<T> iterable) { return (Set<T>) toCollection(HashSet.class,iterable); }
static <T> Set<T> function(Iterable<T> iterable) { return (Set<T>) toCollection(HashSet.class,iterable); }
/** * Convert any iterable into a set * @param <T> * @param iterable * @return */
Convert any iterable into a set
toSet
{ "repo_name": "fregaham/KiWi", "path": "src/model/kiwi/util/KiWiCollections.java", "license": "bsd-3-clause", "size": 3069 }
[ "java.util.HashSet", "java.util.Set" ]
import java.util.HashSet; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
2,121,791
TbDeptLocation save(TbDeptLocation entity);
TbDeptLocation save(TbDeptLocation entity);
/** * Saves the given entity in the database (create or update) * @param entity * @return entity */
Saves the given entity in the database (create or update)
save
{ "repo_name": "abmindiarepomanager/ABMOpenMainet", "path": "Mainet1.0/MainetServiceParent/MainetServiceCommon/src/main/java/com/abm/mainet/common/master/service/DeptLocationService.java", "license": "gpl-3.0", "size": 2254 }
[ "com.abm.mainet.common.master.dto.TbDeptLocation" ]
import com.abm.mainet.common.master.dto.TbDeptLocation;
import com.abm.mainet.common.master.dto.*;
[ "com.abm.mainet" ]
com.abm.mainet;
1,273,585
protected Map<String, QB> getAlternateVersions() { return Collections.emptyMap(); } /** * Parses the query provided as string argument and compares it with the expected result provided as argument as a {@link QueryBuilder}
Map<String, QB> function() { return Collections.emptyMap(); } /** * Parses the query provided as string argument and compares it with the expected result provided as argument as a {@link QueryBuilder}
/** * Returns alternate string representation of the query that need to be tested as they are never used as output * of {@link QueryBuilder#toXContent(XContentBuilder, ToXContent.Params)}. By default there are no alternate versions. */
Returns alternate string representation of the query that need to be tested as they are never used as output of <code>QueryBuilder#toXContent(XContentBuilder, ToXContent.Params)</code>. By default there are no alternate versions
getAlternateVersions
{ "repo_name": "nomoa/elasticsearch", "path": "core/src/test/java/org/elasticsearch/index/query/AbstractQueryTestCase.java", "license": "apache-2.0", "size": 49333 }
[ "java.util.Collections", "java.util.Map" ]
import java.util.Collections; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
888,831
private void parse(Element diagramElement) { parseAttributes(diagramElement); parseElements(diagramElement); }
void function(Element diagramElement) { parseAttributes(diagramElement); parseElements(diagramElement); }
/** * Parses the attributes and child elements of the diagram element. * (see {@link #parseAttributes(Element)}, {@link #parseElements(Element)}). * * @param diagramElement The diagram element to parse. */
Parses the attributes and child elements of the diagram element. (see <code>#parseAttributes(Element)</code>, <code>#parseElements(Element)</code>)
parse
{ "repo_name": "grasscrm/gdesigner", "path": "editor/server/src/de/hpi/bpel4chor/parser/DiagramParser.java", "license": "apache-2.0", "size": 13948 }
[ "org.w3c.dom.Element" ]
import org.w3c.dom.Element;
import org.w3c.dom.*;
[ "org.w3c.dom" ]
org.w3c.dom;
934,082
protected static void initCreoleRepositories() { // the logic is: // get the list of know plugins from gate.xml // add all the installed plugins (if pluginsHome has been explicitly set) // get the list of loadable plugins // load loadable plugins Pattern mavenPluginPattern = Pattern.compile("\\[(.*?):(.*?):(.*?)]"); // process the known plugins list String knownPluginsPath = (String)getUserConfig().get(KNOWN_PLUGIN_PATH_KEY); if(knownPluginsPath != null) { knownPluginsPath = knownPluginsPath.trim(); } if(knownPluginsPath != null && knownPluginsPath.length() > 0) { StringTokenizer strTok = new StringTokenizer(knownPluginsPath, ";", false); while(strTok.hasMoreTokens()) { String aKnownPluginPath = strTok.nextToken().trim(); Matcher m = mavenPluginPattern.matcher(aKnownPluginPath); if(m.matches()) { // Maven coordinates [group:artifact:version] addKnownPlugin(new Plugin.Maven(m.group(1), m.group(2), m.group(3))); } else { // assume it's a URL to a directory plugin try { URL aPluginURL = new URL(aKnownPluginPath); addKnownPlugin(new Plugin.Directory(aPluginURL)); } catch(MalformedURLException mue) { log.error("Plugin error: " + aKnownPluginPath + " is an invalid URL!"); } } } } if(pluginsHome != null) { // add all the installed plugins (note pluginsHome will only be set // if there has been an explicit call to setPluginsHome, it is now // null by default) File[] dirs = pluginsHome.listFiles(); for(int i = 0; i < dirs.length; i++) { File creoleFile = new File(dirs[i], "creole.xml"); if(creoleFile.exists()) { try { URL pluginURL = dirs[i].toURI().toURL(); addKnownPlugin(new Plugin.Directory(pluginURL)); } catch(MalformedURLException mue) { // this should never happen throw new GateRuntimeException(mue); } } } } // process the autoload plugins String pluginPath = getUserConfig().getString(AUTOLOAD_PLUGIN_PATH_KEY); // can be overridden by system property String prop = System.getProperty(AUTOLOAD_PLUGIN_PATH_PROPERTY_NAME); if(prop != null && prop.length() > 0) pluginPath = prop; if(pluginPath != null) { pluginPath = pluginPath.trim(); } if(pluginPath == null || pluginPath.length() == 0) { // no plugin to load stop here return; } // load all loadable plugins StringTokenizer strTok = new StringTokenizer(pluginPath, ";", false); while(strTok.hasMoreTokens()) { String aDir = strTok.nextToken().trim(); Matcher m = mavenPluginPattern.matcher(aDir); if(m.matches()) { // Maven coordinates [group:artifact:version] addAutoloadPlugin(new Plugin.Maven(m.group(1), m.group(2), m.group(3))); } else { // assume it's a URL to a directory plugin try { URL aPluginURL = new URL(aDir); Plugin plugin = new Plugin.Directory(aPluginURL); addAutoloadPlugin(plugin); } catch(MalformedURLException mue) { log.error("Cannot load " + aDir + " CREOLE repository.", mue); } } try { Iterator<Plugin> loadPluginsIter = getAutoloadPlugins().iterator(); while(loadPluginsIter.hasNext()) { getCreoleRegister().registerPlugin(loadPluginsIter.next()); } } catch(GateException ge) { log.error("Cannot load " + aDir + " CREOLE repository.",ge); } } }
static void function() { Pattern mavenPluginPattern = Pattern.compile(STR); String knownPluginsPath = (String)getUserConfig().get(KNOWN_PLUGIN_PATH_KEY); if(knownPluginsPath != null) { knownPluginsPath = knownPluginsPath.trim(); } if(knownPluginsPath != null && knownPluginsPath.length() > 0) { StringTokenizer strTok = new StringTokenizer(knownPluginsPath, ";", false); while(strTok.hasMoreTokens()) { String aKnownPluginPath = strTok.nextToken().trim(); Matcher m = mavenPluginPattern.matcher(aKnownPluginPath); if(m.matches()) { addKnownPlugin(new Plugin.Maven(m.group(1), m.group(2), m.group(3))); } else { try { URL aPluginURL = new URL(aKnownPluginPath); addKnownPlugin(new Plugin.Directory(aPluginURL)); } catch(MalformedURLException mue) { log.error(STR + aKnownPluginPath + STR); } } } } if(pluginsHome != null) { File[] dirs = pluginsHome.listFiles(); for(int i = 0; i < dirs.length; i++) { File creoleFile = new File(dirs[i], STR); if(creoleFile.exists()) { try { URL pluginURL = dirs[i].toURI().toURL(); addKnownPlugin(new Plugin.Directory(pluginURL)); } catch(MalformedURLException mue) { throw new GateRuntimeException(mue); } } } } String pluginPath = getUserConfig().getString(AUTOLOAD_PLUGIN_PATH_KEY); String prop = System.getProperty(AUTOLOAD_PLUGIN_PATH_PROPERTY_NAME); if(prop != null && prop.length() > 0) pluginPath = prop; if(pluginPath != null) { pluginPath = pluginPath.trim(); } if(pluginPath == null pluginPath.length() == 0) { return; } StringTokenizer strTok = new StringTokenizer(pluginPath, ";", false); while(strTok.hasMoreTokens()) { String aDir = strTok.nextToken().trim(); Matcher m = mavenPluginPattern.matcher(aDir); if(m.matches()) { addAutoloadPlugin(new Plugin.Maven(m.group(1), m.group(2), m.group(3))); } else { try { URL aPluginURL = new URL(aDir); Plugin plugin = new Plugin.Directory(aPluginURL); addAutoloadPlugin(plugin); } catch(MalformedURLException mue) { log.error(STR + aDir + STR, mue); } } try { Iterator<Plugin> loadPluginsIter = getAutoloadPlugins().iterator(); while(loadPluginsIter.hasNext()) { getCreoleRegister().registerPlugin(loadPluginsIter.next()); } } catch(GateException ge) { log.error(STR + aDir + STR,ge); } } }
/** * Loads the CREOLE repositories (aka plugins) that the user has selected for * automatic loading. Loads the information about known plugins in memory. */
Loads the CREOLE repositories (aka plugins) that the user has selected for automatic loading. Loads the information about known plugins in memory
initCreoleRepositories
{ "repo_name": "GateNLP/gate-core", "path": "src/main/java/gate/Gate.java", "license": "lgpl-3.0", "size": 48530 }
[ "java.io.File", "java.net.MalformedURLException", "java.util.Iterator", "java.util.StringTokenizer", "java.util.regex.Matcher", "java.util.regex.Pattern" ]
import java.io.File; import java.net.MalformedURLException; import java.util.Iterator; import java.util.StringTokenizer; import java.util.regex.Matcher; import java.util.regex.Pattern;
import java.io.*; import java.net.*; import java.util.*; import java.util.regex.*;
[ "java.io", "java.net", "java.util" ]
java.io; java.net; java.util;
1,990,126
public ActionForward presentOther(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { MeetingFormBase meetingForm = (MeetingFormBase) form; MemberAbsentBean memberAbsentBean = meetingForm.getMeetingHelper().getMemberAbsentBeans().get(getLineToDelete(request)); MeetingHelperBase meetingHelper = ((MeetingFormBase) form).getMeetingHelper(); if (applyRules(new MeetingPresentOtherOrVotingEvent(Constants.EMPTY_STRING, getCommitteeDocument(meetingHelper .getCommitteeSchedule().getParentCommittee().getCommitteeDocument().getDocumentHeader().getDocumentNumber()), meetingHelper, memberAbsentBean, ErrorType.HARDERROR))) { getMeetingService().presentOther(meetingHelper, getLineToDelete(request)); } return mapping.findForward(Constants.MAPPING_BASIC); }
ActionForward function(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { MeetingFormBase meetingForm = (MeetingFormBase) form; MemberAbsentBean memberAbsentBean = meetingForm.getMeetingHelper().getMemberAbsentBeans().get(getLineToDelete(request)); MeetingHelperBase meetingHelper = ((MeetingFormBase) form).getMeetingHelper(); if (applyRules(new MeetingPresentOtherOrVotingEvent(Constants.EMPTY_STRING, getCommitteeDocument(meetingHelper .getCommitteeSchedule().getParentCommittee().getCommitteeDocument().getDocumentHeader().getDocumentNumber()), meetingHelper, memberAbsentBean, ErrorType.HARDERROR))) { getMeetingService().presentOther(meetingHelper, getLineToDelete(request)); } return mapping.findForward(Constants.MAPPING_BASIC); }
/** * * This method is to move member absent to other present. * * @param mapping * @param form * @param request * @param response * @return * @throws Exception */
This method is to move member absent to other present
presentOther
{ "repo_name": "geothomasp/kcmit", "path": "coeus-impl/src/main/java/org/kuali/coeus/common/committee/impl/meeting/MeetingManagementActionBase.java", "license": "agpl-3.0", "size": 23907 }
[ "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "org.apache.struts.action.ActionForm", "org.apache.struts.action.ActionForward", "org.apache.struts.action.ActionMapping", "org.kuali.coeus.common.committee.impl.meeting.MeetingEventBase", "org.kuali.kra.infrastructure.Constants" ]
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.kuali.coeus.common.committee.impl.meeting.MeetingEventBase; import org.kuali.kra.infrastructure.Constants;
import javax.servlet.http.*; import org.apache.struts.action.*; import org.kuali.coeus.common.committee.impl.meeting.*; import org.kuali.kra.infrastructure.*;
[ "javax.servlet", "org.apache.struts", "org.kuali.coeus", "org.kuali.kra" ]
javax.servlet; org.apache.struts; org.kuali.coeus; org.kuali.kra;
1,936,564
@Override protected void createTableViewer(Composite parent) { super.createTableViewer(parent);
void function(Composite parent) { super.createTableViewer(parent);
/** * This adds role column to table viewer. Using role column user can see and change role of a participant. * * @param parent parent */
This adds role column to table viewer. Using role column user can see and change role of a participant
createTableViewer
{ "repo_name": "edgarmueller/emfstore-rest", "path": "bundles/org.eclipse.emf.emfstore.client.ui/src/org/eclipse/emf/emfstore/internal/client/ui/views/emfstorebrowser/dialogs/admin/ProjectComposite.java", "license": "epl-1.0", "size": 11258 }
[ "org.eclipse.swt.widgets.Composite" ]
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.*;
[ "org.eclipse.swt" ]
org.eclipse.swt;
2,737,810
public DERObject toASN1Object() { return new DEROctetString(p.getEncoded()); }
DERObject function() { return new DEROctetString(p.getEncoded()); }
/** * Produce an object suitable for an ASN1OutputStream. * <pre> * ECPoint ::= OCTET STRING * </pre> * <p> * Octet string produced using ECPoint.getEncoded(). */
Produce an object suitable for an ASN1OutputStream. <code> ECPoint ::= OCTET STRING </code> Octet string produced using ECPoint.getEncoded()
toASN1Object
{ "repo_name": "barmstrong/bitcoin-android", "path": "src/com/google/bitcoin/bouncycastle/asn1/x9/X9ECPoint.java", "license": "apache-2.0", "size": 1102 }
[ "com.google.bitcoin.bouncycastle.asn1.DERObject", "com.google.bitcoin.bouncycastle.asn1.DEROctetString" ]
import com.google.bitcoin.bouncycastle.asn1.DERObject; import com.google.bitcoin.bouncycastle.asn1.DEROctetString;
import com.google.bitcoin.bouncycastle.asn1.*;
[ "com.google.bitcoin" ]
com.google.bitcoin;
468,152
public ZonedDateTime getDeletedAt() { return this.deletedAt; }
ZonedDateTime function() { return this.deletedAt; }
/** * Time when the quiz was deleted. */
Time when the quiz was deleted
getDeletedAt
{ "repo_name": "penzance/canvas-data-tools", "path": "data_client/src/main/java/edu/harvard/data/client/canvas/tables/QuizDim.java", "license": "mit", "size": 14757 }
[ "java.time.ZonedDateTime" ]
import java.time.ZonedDateTime;
import java.time.*;
[ "java.time" ]
java.time;
1,768,843
public DataNode setCoating_roughnessScalar(double coating_roughness);
DataNode function(double coating_roughness);
/** * TODO: documentation needed * <p> * <b>Type:</b> NX_FLOAT * <b>Units:</b> NX_LENGTH * <b>Dimensions:</b> 1: nsurf; * </p> * * @param coating_roughness the coating_roughness */
Type: NX_FLOAT Units: NX_LENGTH Dimensions: 1: nsurf;
setCoating_roughnessScalar
{ "repo_name": "jamesmudd/dawnsci", "path": "org.eclipse.dawnsci.nexus/autogen/org/eclipse/dawnsci/nexus/NXguide.java", "license": "epl-1.0", "size": 16534 }
[ "org.eclipse.dawnsci.analysis.api.tree.DataNode" ]
import org.eclipse.dawnsci.analysis.api.tree.DataNode;
import org.eclipse.dawnsci.analysis.api.tree.*;
[ "org.eclipse.dawnsci" ]
org.eclipse.dawnsci;
104,478
private PropertyState createInstance(Name propName, NodeId parentId) { PropertyState state = persistMgr.createNew(new PropertyId(parentId, propName)); state.setStatus(ItemState.STATUS_NEW); state.setContainer(this); return state; }
PropertyState function(Name propName, NodeId parentId) { PropertyState state = persistMgr.createNew(new PropertyId(parentId, propName)); state.setStatus(ItemState.STATUS_NEW); state.setContainer(this); return state; }
/** * Create a new property state instance * * @param propName property name * @param parentId parent Id * @return new property state instance */
Create a new property state instance
createInstance
{ "repo_name": "Overseas-Student-Living/jackrabbit", "path": "jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java", "license": "apache-2.0", "size": 75818 }
[ "org.apache.jackrabbit.core.id.NodeId", "org.apache.jackrabbit.core.id.PropertyId", "org.apache.jackrabbit.spi.Name" ]
import org.apache.jackrabbit.core.id.NodeId; import org.apache.jackrabbit.core.id.PropertyId; import org.apache.jackrabbit.spi.Name;
import org.apache.jackrabbit.core.id.*; import org.apache.jackrabbit.spi.*;
[ "org.apache.jackrabbit" ]
org.apache.jackrabbit;
1,982,405
@Inject @Optional public void getFocusOnInputPart(@UIEventTopic(TestEditorEventConstants.GET_FOCUS_ON_INPUT_PART) Object obj) { if (reactOnGetFocusOnInputPart) { if (obj == null || obj.toString().equalsIgnoreCase("")) { disableViews(); removeTestEditorController(); } cleanViewsAsynchron(); } }
void function(@UIEventTopic(TestEditorEventConstants.GET_FOCUS_ON_INPUT_PART) Object obj) { if (reactOnGetFocusOnInputPart) { if (obj == null obj.toString().equalsIgnoreCase("")) { disableViews(); removeTestEditorController(); } cleanViewsAsynchron(); } }
/** * will be called by the eventBroker, if a GET_FOCUS_ON_INPUT_PART-event is * sent. * * @param obj * Object */
will be called by the eventBroker, if a GET_FOCUS_ON_INPUT_PART-event is sent
getFocusOnInputPart
{ "repo_name": "franzbecker/test-editor", "path": "ui/org.testeditor.ui/src/org/testeditor/ui/parts/inputparts/AbstractTestEditorInputPartController.java", "license": "epl-1.0", "size": 2764 }
[ "org.eclipse.e4.ui.di.UIEventTopic", "org.testeditor.ui.constants.TestEditorEventConstants" ]
import org.eclipse.e4.ui.di.UIEventTopic; import org.testeditor.ui.constants.TestEditorEventConstants;
import org.eclipse.e4.ui.di.*; import org.testeditor.ui.constants.*;
[ "org.eclipse.e4", "org.testeditor.ui" ]
org.eclipse.e4; org.testeditor.ui;
1,767,020
@Test(timeout = 1000 * 90) public void testPredicateStringAttribute() { HazelcastInstance instance = createHazelcastInstance(getConfig()); IMap<Integer, Value> map = instance.getMap("testPredicateStringWithString"); testPredicateStringAttribute(map); }
@Test(timeout = 1000 * 90) void function() { HazelcastInstance instance = createHazelcastInstance(getConfig()); IMap<Integer, Value> map = instance.getMap(STR); testPredicateStringAttribute(map); }
/** * Github issues 98 and 131 */
Github issues 98 and 131
testPredicateStringAttribute
{ "repo_name": "mdogan/hazelcast", "path": "hazelcast/src/test/java/com/hazelcast/map/impl/query/QueryBasicTest.java", "license": "apache-2.0", "size": 44337 }
[ "com.hazelcast.core.HazelcastInstance", "com.hazelcast.map.IMap", "com.hazelcast.query.SampleTestObjects", "org.junit.Test" ]
import com.hazelcast.core.HazelcastInstance; import com.hazelcast.map.IMap; import com.hazelcast.query.SampleTestObjects; import org.junit.Test;
import com.hazelcast.core.*; import com.hazelcast.map.*; import com.hazelcast.query.*; import org.junit.*;
[ "com.hazelcast.core", "com.hazelcast.map", "com.hazelcast.query", "org.junit" ]
com.hazelcast.core; com.hazelcast.map; com.hazelcast.query; org.junit;
1,105,715
public void antialias (boolean flag) { if (Global.getParameter("font.smooth", true)) { IG.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, flag?RenderingHints.VALUE_TEXT_ANTIALIAS_ON :RenderingHints.VALUE_TEXT_ANTIALIAS_OFF); } }
void function (boolean flag) { if (Global.getParameter(STR, true)) { IG.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, flag?RenderingHints.VALUE_TEXT_ANTIALIAS_ON :RenderingHints.VALUE_TEXT_ANTIALIAS_OFF); } }
/** * Set Anti-Aliasing on or off, if in Java 1.2 or better and the Parameter * "font.smooth" is switched on. * * @param flag */
Set Anti-Aliasing on or off, if in Java 1.2 or better and the Parameter "font.smooth" is switched on
antialias
{ "repo_name": "Zenigata/jago", "path": "rene/viewer/TextDisplay.java", "license": "gpl-2.0", "size": 11604 }
[ "java.awt.RenderingHints" ]
import java.awt.RenderingHints;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,782,825
public int hashCode() { int result = 193; long temp = Double.doubleToLongBits(this.radius); result = 37 * result + (int) (temp ^ (temp >>> 32)); result = 37 * result + HashUtilities.hashCodeForPaint( this.backgroundPaint); result = 37 * result + HashUtilities.hashCodeForPaint( this.foregroundPaint); result = 37 * result + this.stroke.hashCode(); return result; }
int function() { int result = 193; long temp = Double.doubleToLongBits(this.radius); result = 37 * result + (int) (temp ^ (temp >>> 32)); result = 37 * result + HashUtilities.hashCodeForPaint( this.backgroundPaint); result = 37 * result + HashUtilities.hashCodeForPaint( this.foregroundPaint); result = 37 * result + this.stroke.hashCode(); return result; }
/** * Returns a hash code for this instance. * * @return The hash code. */
Returns a hash code for this instance
hashCode
{ "repo_name": "nologic/nabs", "path": "client/trunk/shared/libraries/jfreechart-1.0.5/experimental/org/jfree/experimental/chart/plot/dial/SimpleDialFrame.java", "license": "gpl-2.0", "size": 10533 }
[ "org.jfree.chart.HashUtilities" ]
import org.jfree.chart.HashUtilities;
import org.jfree.chart.*;
[ "org.jfree.chart" ]
org.jfree.chart;
1,026,465
@Override public String getText(Object object) { String label = ((Association)object).getName(); return label == null || label.length() == 0 ? getString("_UI_Association_type") : getString("_UI_Association_type") + " " + label; }
String function(Object object) { String label = ((Association)object).getName(); return label == null label.length() == 0 ? getString(STR) : getString(STR) + " " + label; }
/** * This returns the label text for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This returns the label text for the adapted class.
getText
{ "repo_name": "TemenosDS/LearningSirius", "path": "com.temenos.ds.learnsirius.uml.edit/src/com/temenos/ds/learnsirius/uml/provider/AssociationItemProvider.java", "license": "epl-1.0", "size": 5287 }
[ "com.temenos.ds.learnsirius.uml.Association" ]
import com.temenos.ds.learnsirius.uml.Association;
import com.temenos.ds.learnsirius.uml.*;
[ "com.temenos.ds" ]
com.temenos.ds;
1,115,021
public static EntryList getInvalidEntries(Division div, EntryList entries) { EntryList elist = new EntryList(); for (Entry e : entries) { Rating alt = getCompatibleRating(div.getSystem(), e.getBoat().getAllRatings(), true); if (alt != null && !div.contains(alt)) elist.add(e); } // now run through these invalid entries and see if they can convert to a valid entry return elist; }
static EntryList function(Division div, EntryList entries) { EntryList elist = new EntryList(); for (Entry e : entries) { Rating alt = getCompatibleRating(div.getSystem(), e.getBoat().getAllRatings(), true); if (alt != null && !div.contains(alt)) elist.add(e); } return elist; }
/** * given a list of entries, returns a list of all entries who's rating is NOT contained in this division * * @param allEntries * the initial list of entries * @return list of entries that are invalid for the division */
given a list of entries, returns a list of all entries who's rating is NOT contained in this division
getInvalidEntries
{ "repo_name": "sgrosven/gromurph", "path": "Javascore/src/main/java/org/gromurph/javascore/manager/RatingManager.java", "license": "gpl-2.0", "size": 11114 }
[ "org.gromurph.javascore.model.Division", "org.gromurph.javascore.model.Entry", "org.gromurph.javascore.model.EntryList", "org.gromurph.javascore.model.ratings.Rating" ]
import org.gromurph.javascore.model.Division; import org.gromurph.javascore.model.Entry; import org.gromurph.javascore.model.EntryList; import org.gromurph.javascore.model.ratings.Rating;
import org.gromurph.javascore.model.*; import org.gromurph.javascore.model.ratings.*;
[ "org.gromurph.javascore" ]
org.gromurph.javascore;
881,093
public static boolean isConnectionFast(int type, int subType) { if (type == ConnectivityManager.TYPE_WIFI) { return true; } else if (type == ConnectivityManager.TYPE_MOBILE) { switch (subType) { case TelephonyManager.NETWORK_TYPE_1xRTT: return false; // ~ 50-100 kbps case TelephonyManager.NETWORK_TYPE_CDMA: return false; // ~ 14-64 kbps case TelephonyManager.NETWORK_TYPE_EDGE: return false; // ~ 50-100 kbps case TelephonyManager.NETWORK_TYPE_EVDO_0: return true; // ~ 400-1000 kbps case TelephonyManager.NETWORK_TYPE_EVDO_A: return true; // ~ 600-1400 kbps case TelephonyManager.NETWORK_TYPE_GPRS: return false; // ~ 100 kbps case TelephonyManager.NETWORK_TYPE_HSDPA: return true; // ~ 2-14 Mbps case TelephonyManager.NETWORK_TYPE_HSPA: return true; // ~ 700-1700 kbps case TelephonyManager.NETWORK_TYPE_HSUPA: return true; // ~ 1-23 Mbps case TelephonyManager.NETWORK_TYPE_UMTS: return true; // ~ 400-7000 kbps case TelephonyManager.NETWORK_TYPE_EHRPD: // API level 11 return true; // ~ 1-2 Mbps case TelephonyManager.NETWORK_TYPE_EVDO_B: // API level 9 return true; // ~ 5 Mbps case TelephonyManager.NETWORK_TYPE_HSPAP: // API level 13 return true; // ~ 10-20 Mbps case TelephonyManager.NETWORK_TYPE_IDEN: // API level 8 return false; // ~25 kbps case TelephonyManager.NETWORK_TYPE_LTE: // API level 11 return true; // ~ 10+ Mbps // Unknown case TelephonyManager.NETWORK_TYPE_UNKNOWN: default: return false; } } else { return false; } }
static boolean function(int type, int subType) { if (type == ConnectivityManager.TYPE_WIFI) { return true; } else if (type == ConnectivityManager.TYPE_MOBILE) { switch (subType) { case TelephonyManager.NETWORK_TYPE_1xRTT: return false; case TelephonyManager.NETWORK_TYPE_CDMA: return false; case TelephonyManager.NETWORK_TYPE_EDGE: return false; case TelephonyManager.NETWORK_TYPE_EVDO_0: return true; case TelephonyManager.NETWORK_TYPE_EVDO_A: return true; case TelephonyManager.NETWORK_TYPE_GPRS: return false; case TelephonyManager.NETWORK_TYPE_HSDPA: return true; case TelephonyManager.NETWORK_TYPE_HSPA: return true; case TelephonyManager.NETWORK_TYPE_HSUPA: return true; case TelephonyManager.NETWORK_TYPE_UMTS: return true; case TelephonyManager.NETWORK_TYPE_EHRPD: return true; case TelephonyManager.NETWORK_TYPE_EVDO_B: return true; case TelephonyManager.NETWORK_TYPE_HSPAP: return true; case TelephonyManager.NETWORK_TYPE_IDEN: return false; case TelephonyManager.NETWORK_TYPE_LTE: return true; case TelephonyManager.NETWORK_TYPE_UNKNOWN: default: return false; } } else { return false; } }
/** * Check if the connection is fast */
Check if the connection is fast
isConnectionFast
{ "repo_name": "therajanmaurya/android-client-2.0", "path": "app/src/main/java/org/apache/fineract/utils/NetworkUtil.java", "license": "apache-2.0", "size": 4213 }
[ "android.net.ConnectivityManager", "android.telephony.TelephonyManager" ]
import android.net.ConnectivityManager; import android.telephony.TelephonyManager;
import android.net.*; import android.telephony.*;
[ "android.net", "android.telephony" ]
android.net; android.telephony;
2,433,512
public Collection<CmsGroup> getNotAnyGroups() { return m_notAnyGroups; }
Collection<CmsGroup> function() { return m_notAnyGroups; }
/** * Returns the groups whose users may not appear in the search results.<p> * * @return the groups whose users may not appear in the search results */
Returns the groups whose users may not appear in the search results
getNotAnyGroups
{ "repo_name": "ggiudetti/opencms-core", "path": "src/org/opencms/file/CmsUserSearchParameters.java", "license": "lgpl-2.1", "size": 12347 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
1,669,477
public Iterable<Map<String, String>> toMaps( String prefix ) { Map<Integer, Map<String, String>> configs = new HashMap<Integer, Map<String, String>>(); for( Map.Entry<Object, Object> entry : entrySet() ) { String key = entry.getKey().toString(); String[] parts = key.split( "\\.", 3 ); if( parts.length < 3 ) continue; String thePrefix = parts[0]; if( !prefix.equals( thePrefix ) ) continue; int index; try { index = Integer.parseInt( parts[1] ); } catch( NumberFormatException x ) { continue; } String name = parts[2]; Map<String, String> config = configs.get( index ); if( config == null ) { config = new HashMap<String, String>(); configs.put( index, config ); } config.put( name, entry.getValue().toString() ); } return Collections.unmodifiableCollection( configs.values() ); } // ////////////////////////////////////////////////////////////////////////// // Private private static final long serialVersionUID = 1L;
Iterable<Map<String, String>> function( String prefix ) { Map<Integer, Map<String, String>> configs = new HashMap<Integer, Map<String, String>>(); for( Map.Entry<Object, Object> entry : entrySet() ) { String key = entry.getKey().toString(); String[] parts = key.split( "\\.", 3 ); if( parts.length < 3 ) continue; String thePrefix = parts[0]; if( !prefix.equals( thePrefix ) ) continue; int index; try { index = Integer.parseInt( parts[1] ); } catch( NumberFormatException x ) { continue; } String name = parts[2]; Map<String, String> config = configs.get( index ); if( config == null ) { config = new HashMap<String, String>(); configs.put( index, config ); } config.put( name, entry.getValue().toString() ); } return Collections.unmodifiableCollection( configs.values() ); } private static final long serialVersionUID = 1L;
/** * Converts three-part dot notation properties to maps. * * @param prefix * The prefix * @return The maps for the prefix */
Converts three-part dot notation properties to maps
toMaps
{ "repo_name": "tliron/creel", "path": "components/creel/source/com/threecrickets/creel/util/MultiValueProperties.java", "license": "lgpl-3.0", "size": 3314 }
[ "java.util.Collections", "java.util.HashMap", "java.util.Map" ]
import java.util.Collections; import java.util.HashMap; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
604,047
private void putControllerToPanel(UserRequest ureq, WindowControl wControl, int ctrNr) { if (aftctrls.get(ctrNr) == null) return; actualCtrNr = ctrNr; wiz.setCurStep(ctrNr + 1); Map<String, Object> mapEntry = aftctrls.get(ctrNr); actualForceUser = false; if (mapEntry.containsKey(FORCEUSER_KEY)) { actualForceUser = Boolean.valueOf(mapEntry.get(FORCEUSER_KEY).toString()); } removeAsListenerAndDispose(actCtrl); actCtrl = (Controller)mapEntry.get(CONTROLLER); if (actCtrl == null) { return; } listenTo(actCtrl); if (mapEntry.containsKey(I18NINTRO_KEY)) { String[] introComb = ((String) mapEntry.get(I18NINTRO_KEY)).split(":"); vC.contextPut("introPkg", introComb[0]); vC.contextPut("introKey", introComb[1]); } actualPanel.setContent(actCtrl.getInitialComponent()); }
void function(UserRequest ureq, WindowControl wControl, int ctrNr) { if (aftctrls.get(ctrNr) == null) return; actualCtrNr = ctrNr; wiz.setCurStep(ctrNr + 1); Map<String, Object> mapEntry = aftctrls.get(ctrNr); actualForceUser = false; if (mapEntry.containsKey(FORCEUSER_KEY)) { actualForceUser = Boolean.valueOf(mapEntry.get(FORCEUSER_KEY).toString()); } removeAsListenerAndDispose(actCtrl); actCtrl = (Controller)mapEntry.get(CONTROLLER); if (actCtrl == null) { return; } listenTo(actCtrl); if (mapEntry.containsKey(I18NINTRO_KEY)) { String[] introComb = ((String) mapEntry.get(I18NINTRO_KEY)).split(":"); vC.contextPut(STR, introComb[0]); vC.contextPut(STR, introComb[1]); } actualPanel.setContent(actCtrl.getInitialComponent()); }
/** * refreshes modalPanel with n-th controller found in config sets actual * controller, controller-nr and force status * * @param ureq * @param wControl * @param ctrNr */
refreshes modalPanel with n-th controller found in config sets actual controller, controller-nr and force status
putControllerToPanel
{ "repo_name": "stevenhva/InfoLearn_OpenOLAT", "path": "src/main/java/org/olat/login/AfterLoginInterceptionController.java", "license": "apache-2.0", "size": 10125 }
[ "java.util.Map", "org.olat.core.gui.UserRequest", "org.olat.core.gui.control.Controller", "org.olat.core.gui.control.WindowControl" ]
import java.util.Map; import org.olat.core.gui.UserRequest; import org.olat.core.gui.control.Controller; import org.olat.core.gui.control.WindowControl;
import java.util.*; import org.olat.core.gui.*; import org.olat.core.gui.control.*;
[ "java.util", "org.olat.core" ]
java.util; org.olat.core;
2,294,771
public static final int getWord(InputStream is) throws IOException { return (is.read() << 8) + is.read(); }
static final int function(InputStream is) throws IOException { return (is.read() << 8) + is.read(); }
/** * Gets a <CODE>word</CODE> from an <CODE>InputStream</CODE>. * * @param is an <CODE>InputStream</CODE> * @return the value of an <CODE>int</CODE> */
Gets a <code>word</code> from an <code>InputStream</code>
getWord
{ "repo_name": "yogthos/itext", "path": "src/com/lowagie/text/pdf/codec/PngImage.java", "license": "lgpl-3.0", "size": 36105 }
[ "java.io.IOException", "java.io.InputStream" ]
import java.io.IOException; import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
754,320
@ApiModelProperty(value = "") public Long getTotalElements() { return totalElements; }
@ApiModelProperty(value = "") Long function() { return totalElements; }
/** * Get totalElements * @return totalElements **/
Get totalElements
getTotalElements
{ "repo_name": "knetikmedia/knetikcloud-java-client", "path": "src/main/java/com/knetikcloud/model/PageResourceCampaignResource.java", "license": "apache-2.0", "size": 7545 }
[ "io.swagger.annotations.ApiModelProperty" ]
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.*;
[ "io.swagger.annotations" ]
io.swagger.annotations;
2,580,674
@WebMethod @WebResult(name = "rval", targetNamespace = "https://www.google.com/apis/ads/publisher/v201411") @RequestWrapper(localName = "updateProposalLineItems", targetNamespace = "https://www.google.com/apis/ads/publisher/v201411", className = "com.google.api.ads.dfp.jaxws.v201411.ProposalLineItemServiceInterfaceupdateProposalLineItems") @ResponseWrapper(localName = "updateProposalLineItemsResponse", targetNamespace = "https://www.google.com/apis/ads/publisher/v201411", className = "com.google.api.ads.dfp.jaxws.v201411.ProposalLineItemServiceInterfaceupdateProposalLineItemsResponse") public List<ProposalLineItem> updateProposalLineItems( @WebParam(name = "proposalLineItems", targetNamespace = "https://www.google.com/apis/ads/publisher/v201411") List<ProposalLineItem> proposalLineItems) throws ApiException_Exception ;
@WebResult(name = "rval", targetNamespace = STRupdateProposalLineItemsSTRhttps: @ResponseWrapper(localName = "updateProposalLineItemsResponseSTRhttps: List<ProposalLineItem> function( @WebParam(name = "proposalLineItemsSTRhttps: List<ProposalLineItem> proposalLineItems) throws ApiException_Exception ;
/** * * Updates the specified {@link ProposalLineItem} objects. * * @param proposalLineItems the proposal line items to update * @return the updated proposal line items * * * @param proposalLineItems * @return * returns java.util.List<com.google.api.ads.dfp.jaxws.v201411.ProposalLineItem> * @throws ApiException_Exception */
Updates the specified <code>ProposalLineItem</code> objects
updateProposalLineItems
{ "repo_name": "stoksey69/googleads-java-lib", "path": "modules/dfp_appengine/src/main/java/com/google/api/ads/dfp/jaxws/v201411/ProposalLineItemServiceInterface.java", "license": "apache-2.0", "size": 8884 }
[ "java.util.List", "javax.jws.WebParam", "javax.jws.WebResult", "javax.xml.ws.ResponseWrapper" ]
import java.util.List; import javax.jws.WebParam; import javax.jws.WebResult; import javax.xml.ws.ResponseWrapper;
import java.util.*; import javax.jws.*; import javax.xml.ws.*;
[ "java.util", "javax.jws", "javax.xml" ]
java.util; javax.jws; javax.xml;
1,835,991
public void executeTest(String type) throws Exception { if (results.get(type) instanceof Failure) { try { Results res = os.execute((Query) queries.get(type), 2, true, true, true); Iterator iter = res.iterator(); while (iter.hasNext()) { iter.next(); } fail(type + " was expected to fail"); } catch (Exception e) { assertEquals(type + " was expected to produce a particular exception", results.get(type), new Failure(e)); } } else { Results res = os.execute((Query)queries.get(type), 2, true, true, true); List expected = (List) results.get(type); if ((expected != null) && (!expected.equals(res))) { Set a = new HashSet(expected); Set b = new HashSet(res); List la = resToNames(expected); List lb = resToNames(res); if (a.equals(b)) { assertEquals(type + " has failed - wrong order", la, lb); } fail(type + " has failed. Expected " + la + " but was " + lb); } //assertEquals(type + " has failed", results.get(type), res); } }
void function(String type) throws Exception { if (results.get(type) instanceof Failure) { try { Results res = os.execute((Query) queries.get(type), 2, true, true, true); Iterator iter = res.iterator(); while (iter.hasNext()) { iter.next(); } fail(type + STR); } catch (Exception e) { assertEquals(type + STR, results.get(type), new Failure(e)); } } else { Results res = os.execute((Query)queries.get(type), 2, true, true, true); List expected = (List) results.get(type); if ((expected != null) && (!expected.equals(res))) { Set a = new HashSet(expected); Set b = new HashSet(res); List la = resToNames(expected); List lb = resToNames(res); if (a.equals(b)) { assertEquals(type + STR, la, lb); } fail(type + STR + la + STR + lb); } } }
/** * Execute a test for a query. This should run the query and * contain an assert call to assert that the returned results are * those expected. * * @param type the type of query we are testing (ie. the key in the queries Map) * @throws Exception if type does not appear in the queries map */
Execute a test for a query. This should run the query and contain an assert call to assert that the returned results are those expected
executeTest
{ "repo_name": "joshkh/intermine", "path": "intermine/objectstore/test/src/org/intermine/objectstore/ObjectStoreTestCase.java", "license": "lgpl-2.1", "size": 60739 }
[ "java.util.HashSet", "java.util.Iterator", "java.util.List", "java.util.Set", "org.intermine.objectstore.query.Query", "org.intermine.objectstore.query.Results" ]
import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; import org.intermine.objectstore.query.Query; import org.intermine.objectstore.query.Results;
import java.util.*; import org.intermine.objectstore.query.*;
[ "java.util", "org.intermine.objectstore" ]
java.util; org.intermine.objectstore;
2,839,864
@Override @SuppressWarnings("empty-statement") public void emit(int indent, PrintWriter fp) { String delim; fp.println(); emitIndent(indent, fp); fp.println(" public static class Throw { private String name; private String comment; public Throw(String name) { if (name == null) { throw new NullPointerException("Throw name cannot be null"); } this.name = name.trim(); } public Throw(String name, String comment) { this(name); this.comment = comment.trim(); }
@SuppressWarnings(STR) void function(int indent, PrintWriter fp) { String delim; fp.println(); emitIndent(indent, fp); fp.println(STRThrow name cannot be null"); } this.name = name.trim(); } public Throw(String name, String comment) { this(name); this.comment = comment.trim(); }
/** * Write a method. * * @param indent * @param fp */
Write a method
emit
{ "repo_name": "umeding/fuzzer", "path": "src/main/java/com/uwemeding/fuzzer/java/Java.java", "license": "agpl-3.0", "size": 35562 }
[ "java.io.PrintWriter" ]
import java.io.PrintWriter;
import java.io.*;
[ "java.io" ]
java.io;
414,176
public boolean collidesFor(Bone boneOrObject, Point point) { return this.collidesFor(boneOrObject, point.x, point.y); }
boolean function(Bone boneOrObject, Point point) { return this.collidesFor(boneOrObject, point.x, point.y); }
/** * Returns whether the given point lies inside the box of the given bone or object. * * @param bone the bone or object * @param point the point * @return <code>true</code> if the point lies inside the box of the given bone or object * @throws NullPointerException if no object info for the given bone or object exists */
Returns whether the given point lies inside the box of the given bone or object
collidesFor
{ "repo_name": "soywiz/korge", "path": "@old/korge-spriter/reference/src/main/java/com/brashmonkey/spriter/Player.java", "license": "apache-2.0", "size": 38533 }
[ "com.brashmonkey.spriter.Timeline" ]
import com.brashmonkey.spriter.Timeline;
import com.brashmonkey.spriter.*;
[ "com.brashmonkey.spriter" ]
com.brashmonkey.spriter;
331,806
Mat returnImage = new Mat(); List<Mat> channels = new ArrayList<Mat>(); Core.split(inputImage, channels); int channelSize = channels.size(); if( channelSize == 3 || channelSize == 4 ){ double redValue = properties.get("Red").getValue(); double greenValue = properties.get("Green").getValue(); double blueValue = properties.get("Blue").getValue(); Core.multiply(channels.get(0), new Scalar(blueValue), channels.get(0)); Core.multiply(channels.get(1), new Scalar(greenValue), channels.get(1)); Core.multiply(channels.get(2), new Scalar(redValue), channels.get(2)); Core.merge(channels, returnImage); } else { returnImage = inputImage.clone(); } return returnImage; }
Mat returnImage = new Mat(); List<Mat> channels = new ArrayList<Mat>(); Core.split(inputImage, channels); int channelSize = channels.size(); if( channelSize == 3 channelSize == 4 ){ double redValue = properties.get("Red").getValue(); double greenValue = properties.get("Green").getValue(); double blueValue = properties.get("Blue").getValue(); Core.multiply(channels.get(0), new Scalar(blueValue), channels.get(0)); Core.multiply(channels.get(1), new Scalar(greenValue), channels.get(1)); Core.multiply(channels.get(2), new Scalar(redValue), channels.get(2)); Core.merge(channels, returnImage); } else { returnImage = inputImage.clone(); } return returnImage; }
/** * * Applies a scale to the each color channel based on the 'Red', 'Green', and * 'Blue' properties of the filter. Returns a copy of the image if it is not * a color image (if it has less than 3 channels.) * * @param inputImage the image that will have its color values scaled. */
Applies a scale to the each color channel based on the 'Red', 'Green', and 'Blue' properties of the filter. Returns a copy of the image if it is not a color image (if it has less than 3 channels.)
applyFilter
{ "repo_name": "bartushk/picle", "path": "src/main/java/net/bartushk/picle/Filter/ColorFilter.java", "license": "mit", "size": 2479 }
[ "java.util.ArrayList", "java.util.List", "org.opencv.core.Core", "org.opencv.core.Mat", "org.opencv.core.Scalar" ]
import java.util.ArrayList; import java.util.List; import org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.core.Scalar;
import java.util.*; import org.opencv.core.*;
[ "java.util", "org.opencv.core" ]
java.util; org.opencv.core;
1,204,313
if (originalTableName == null) return currentSchema; String[] tokens = originalTableName.split("\\."); if (tokens.length > 1) { return Optional.fromNullable(tokens[0]); } else { return currentSchema; } }
if (originalTableName == null) return currentSchema; String[] tokens = originalTableName.split("\\."); if (tokens.length > 1) { return Optional.fromNullable(tokens[0]); } else { return currentSchema; } }
/** * Returns an effective schema name of a table name specified in a query. For * instance, given "default.products", this method returns "default". * * @param originalTableName * @return */
Returns an effective schema name of a table name specified in a query. For instance, given "default.products", this method returns "default"
schemaOfTableName
{ "repo_name": "verdictdb/verdict", "path": "core/src/main/java/edu/umich/verdict/util/StringManipulations.java", "license": "apache-2.0", "size": 5234 }
[ "com.google.common.base.Optional" ]
import com.google.common.base.Optional;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
593,083
private void addOrRemoveLocation(File folder, boolean add) { addOrRemoveLocation(VarModel.INSTANCE, folder, add); addOrRemoveLocation(BuildModel.INSTANCE, folder, add); addOrRemoveLocation(TemplateModel.INSTANCE, folder, add); addOrRemoveLocation(RtVilModel.INSTANCE, folder, add); } /** * Removed or adds a (temporary) folder for loading models from this locations. * @param modelManagement {@link VarModel#INSTANCE}, {@link BuildModel#INSTANCE}, or {@link TemplateModel#INSTANCE}
void function(File folder, boolean add) { addOrRemoveLocation(VarModel.INSTANCE, folder, add); addOrRemoveLocation(BuildModel.INSTANCE, folder, add); addOrRemoveLocation(TemplateModel.INSTANCE, folder, add); addOrRemoveLocation(RtVilModel.INSTANCE, folder, add); } /** * Removed or adds a (temporary) folder for loading models from this locations. * @param modelManagement {@link VarModel#INSTANCE}, {@link BuildModel#INSTANCE}, or {@link TemplateModel#INSTANCE}
/** * Shortcut for {@link #addOrRemoveLocation(File, boolean)} to (un-)load all models an once. * @param folder The folder to (un-)register * @param add <tt>true</tt> the folder will be added as possible location for models, <tt>false</tt> the folder * will be removed. */
Shortcut for <code>#addOrRemoveLocation(File, boolean)</code> to (un-)load all models an once
addOrRemoveLocation
{ "repo_name": "QualiMaster/QM-EASyProducer", "path": "QualiMaster.Extension/src/eu/qualimaster/easy/extension/modelop/ModelModifier.java", "license": "apache-2.0", "size": 19258 }
[ "java.io.File", "net.ssehub.easy.instantiation.core.model.buildlangModel.BuildModel", "net.ssehub.easy.instantiation.core.model.templateModel.TemplateModel", "net.ssehub.easy.instantiation.rt.core.model.rtVil.RtVilModel", "net.ssehub.easy.varModel.management.VarModel" ]
import java.io.File; import net.ssehub.easy.instantiation.core.model.buildlangModel.BuildModel; import net.ssehub.easy.instantiation.core.model.templateModel.TemplateModel; import net.ssehub.easy.instantiation.rt.core.model.rtVil.RtVilModel; import net.ssehub.easy.varModel.management.VarModel;
import java.io.*; import net.ssehub.easy.*; import net.ssehub.easy.instantiation.core.model.*; import net.ssehub.easy.instantiation.rt.core.model.*;
[ "java.io", "net.ssehub.easy" ]
java.io; net.ssehub.easy;
2,602,809
public NFLoteConsultaRetorno consultaLote(final String numeroRecibo, final DFModelo modelo) throws Exception { return this.wsLoteConsulta.consultaLote(numeroRecibo, modelo); }
NFLoteConsultaRetorno function(final String numeroRecibo, final DFModelo modelo) throws Exception { return this.wsLoteConsulta.consultaLote(numeroRecibo, modelo); }
/** * Faz a consulta do lote na Sefaz (NF-e e NFC-e) * @param numeroRecibo numero do recibo do processamento * @param modelo modelo da nota (NF-e ou NFC-e) * @return dados de consulta de lote retornado pelo webservice * @throws Exception caso nao consiga gerar o xml ou problema de conexao com o sefaz */
Faz a consulta do lote na Sefaz (NF-e e NFC-e)
consultaLote
{ "repo_name": "jefperito/nfe", "path": "src/main/java/com/fincatto/documentofiscal/nfe310/webservices/WSFacade.java", "license": "apache-2.0", "size": 14488 }
[ "com.fincatto.documentofiscal.DFModelo", "com.fincatto.documentofiscal.nfe310.classes.lote.consulta.NFLoteConsultaRetorno" ]
import com.fincatto.documentofiscal.DFModelo; import com.fincatto.documentofiscal.nfe310.classes.lote.consulta.NFLoteConsultaRetorno;
import com.fincatto.documentofiscal.*; import com.fincatto.documentofiscal.nfe310.classes.lote.consulta.*;
[ "com.fincatto.documentofiscal" ]
com.fincatto.documentofiscal;
1,221,244
return result; } /** * Sets the value of the result property. * * @param value * allowed object is * {@link UserDetailsResult }
return result; } /** * Sets the value of the result property. * * @param value * allowed object is * {@link UserDetailsResult }
/** * Gets the value of the result property. * * @return * possible object is * {@link UserDetailsResult } * */
Gets the value of the result property
getResult
{ "repo_name": "dushmis/Oracle-Cloud", "path": "PaaS_SaaS_Accelerator_RESTFulFacade/Fusion_UserDetailsService/src/com/oracle/xmlns/apps/hcm/people/roles/userdetailsservicev2/types/FindUserDetailsByPersonNumberResponse.java", "license": "bsd-3-clause", "size": 1731 }
[ "com.oracle.xmlns.apps.hcm.people.roles.userdetailsservicev2.UserDetailsResult" ]
import com.oracle.xmlns.apps.hcm.people.roles.userdetailsservicev2.UserDetailsResult;
import com.oracle.xmlns.apps.hcm.people.roles.userdetailsservicev2.*;
[ "com.oracle.xmlns" ]
com.oracle.xmlns;
2,515,269
public String getNearestTypeName(QName name) { String[] all = new String[typeMap.size()]; int i=0; for (QName qn : typeMap.keySet()) { if(qn.getLocalPart().equals(name.getLocalPart())) return qn.toString(); // probably a match, as people often gets confused about namespace. all[i++] = qn.toString(); } String nearest = EditDistance.findNearest(name.toString(), all); if(EditDistance.editDistance(nearest,name.toString())>10) return null; // too far apart. return nearest; }
String function(QName name) { String[] all = new String[typeMap.size()]; int i=0; for (QName qn : typeMap.keySet()) { if(qn.getLocalPart().equals(name.getLocalPart())) return qn.toString(); all[i++] = qn.toString(); } String nearest = EditDistance.findNearest(name.toString(), all); if(EditDistance.editDistance(nearest,name.toString())>10) return null; return nearest; }
/** * Finds a type name that this context recognizes which is * "closest" to the given type name. * * <p> * This method is used for error recovery. */
Finds a type name that this context recognizes which is "closest" to the given type name. This method is used for error recovery
getNearestTypeName
{ "repo_name": "JetBrains/jdk8u_jaxws", "path": "src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java", "license": "gpl-2.0", "size": 40138 }
[ "com.sun.xml.internal.bind.v2.util.EditDistance", "javax.xml.namespace.QName" ]
import com.sun.xml.internal.bind.v2.util.EditDistance; import javax.xml.namespace.QName;
import com.sun.xml.internal.bind.v2.util.*; import javax.xml.namespace.*;
[ "com.sun.xml", "javax.xml" ]
com.sun.xml; javax.xml;
1,558,779
private void addToBaseRegionToCqNameMap(String regionName, String cqName) { synchronized (this.baseRegionToCqNameMap) { ArrayList<String> cqs = this.baseRegionToCqNameMap.get(regionName); if (cqs == null) { cqs = new ArrayList<>(); } cqs.add(cqName); this.baseRegionToCqNameMap.put(regionName, cqs); } }
void function(String regionName, String cqName) { synchronized (this.baseRegionToCqNameMap) { ArrayList<String> cqs = this.baseRegionToCqNameMap.get(regionName); if (cqs == null) { cqs = new ArrayList<>(); } cqs.add(cqName); this.baseRegionToCqNameMap.put(regionName, cqs); } }
/** * Manages the CQs created for the base region. This is managed here, instead of on the base * region; since the cq could be created on the base region, before base region is created (using * newCq()). */
Manages the CQs created for the base region. This is managed here, instead of on the base region; since the cq could be created on the base region, before base region is created (using newCq())
addToBaseRegionToCqNameMap
{ "repo_name": "pdxrunner/geode", "path": "geode-cq/src/main/java/org/apache/geode/cache/query/internal/cq/CqServiceImpl.java", "license": "apache-2.0", "size": 59842 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
2,776,864
public CommodityUnderlying getUnderlying() { return _underlying; }
CommodityUnderlying function() { return _underlying; }
/** * Gets the commodity underlying. * @return commodity underlying. */
Gets the commodity underlying
getUnderlying
{ "repo_name": "McLeodMoores/starling", "path": "projects/analytics/src/main/java/com/opengamma/analytics/financial/commodity/multicurvecommodity/definition/CouponCommodityDefinition.java", "license": "apache-2.0", "size": 5264 }
[ "com.opengamma.analytics.financial.commodity.multicurvecommodity.underlying.CommodityUnderlying" ]
import com.opengamma.analytics.financial.commodity.multicurvecommodity.underlying.CommodityUnderlying;
import com.opengamma.analytics.financial.commodity.multicurvecommodity.underlying.*;
[ "com.opengamma.analytics" ]
com.opengamma.analytics;
2,065,668
protected void writeString(String text) throws IOException { output.write(text); }
void function(String text) throws IOException { output.write(text); }
/** * Write a Java string to the output stream. * * @param text The text to write to the stream. * @throws IOException If there is an error when writing the text. */
Write a Java string to the output stream
writeString
{ "repo_name": "apache/pdfbox", "path": "pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripper.java", "license": "apache-2.0", "size": 75973 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
941,266
Geometry geom = null; try { if ((mimeType != null && mimeType.contains("gml/2")) || (schema != null && schema.contains("gml/2"))) { Parser par = new Parser(new org.geotools.gml2.GMLConfiguration()); geom = (Geometry)par.parse(input); } else { Parser par = new Parser(new org.geotools.gml3.GMLConfiguration()); geom = (Geometry)par.parse(input); } return new GeometryDataBinding(geom); } catch (ClassCastException e) { throw new IllegalArgumentException("GML not recognized as a Geometry", e); } catch (ParserConfigurationException e) { throw new IllegalArgumentException("Error while configuring GML parser", e); } catch(SAXException e) { throw new IllegalArgumentException("Error while parsing GML", e); } catch(IOException e) { throw new IllegalArgumentException("Error transfering GML", e); } }
Geometry geom = null; try { if ((mimeType != null && mimeType.contains("gml/2")) (schema != null && schema.contains("gml/2"))) { Parser par = new Parser(new org.geotools.gml2.GMLConfiguration()); geom = (Geometry)par.parse(input); } else { Parser par = new Parser(new org.geotools.gml3.GMLConfiguration()); geom = (Geometry)par.parse(input); } return new GeometryDataBinding(geom); } catch (ClassCastException e) { throw new IllegalArgumentException(STR, e); } catch (ParserConfigurationException e) { throw new IllegalArgumentException(STR, e); } catch(SAXException e) { throw new IllegalArgumentException(STR, e); } catch(IOException e) { throw new IllegalArgumentException(STR, e); } }
/** * Generates a {@link Geometry} from a GML stream. * * By default it will parse stream as GML3, unless mimeType or schema * parameters indicate explicitly to use GML2 parsing. */
Generates a <code>Geometry</code> from a GML stream. By default it will parse stream as GML3, unless mimeType or schema parameters indicate explicitly to use GML2 parsing
parse
{ "repo_name": "slms4redd/nfms-portal", "path": "src/main/java/org/fao/unredd/wps/GMLGeometryParser.java", "license": "gpl-3.0", "size": 2413 }
[ "com.vividsolutions.jts.geom.Geometry", "java.io.IOException", "javax.xml.parsers.ParserConfigurationException", "org.geotools.xml.Parser", "org.xml.sax.SAXException" ]
import com.vividsolutions.jts.geom.Geometry; import java.io.IOException; import javax.xml.parsers.ParserConfigurationException; import org.geotools.xml.Parser; import org.xml.sax.SAXException;
import com.vividsolutions.jts.geom.*; import java.io.*; import javax.xml.parsers.*; import org.geotools.xml.*; import org.xml.sax.*;
[ "com.vividsolutions.jts", "java.io", "javax.xml", "org.geotools.xml", "org.xml.sax" ]
com.vividsolutions.jts; java.io; javax.xml; org.geotools.xml; org.xml.sax;
190,506
public void addCookieInitializer(Consumer<ResponseCookie.ResponseCookieBuilder> initializer) { this.cookieInitializer = this.cookieInitializer != null ? this.cookieInitializer.andThen(initializer) : initializer; }
void function(Consumer<ResponseCookie.ResponseCookieBuilder> initializer) { this.cookieInitializer = this.cookieInitializer != null ? this.cookieInitializer.andThen(initializer) : initializer; }
/** * Add a {@link Consumer} for a {@code ResponseCookieBuilder} that will be invoked * for each cookie being built, just before the call to {@code build()}. * @param initializer consumer for a cookie builder * @since 5.1 */
Add a <code>Consumer</code> for a ResponseCookieBuilder that will be invoked for each cookie being built, just before the call to build()
addCookieInitializer
{ "repo_name": "spring-projects/spring-framework", "path": "spring-web/src/main/java/org/springframework/web/server/session/CookieWebSessionIdResolver.java", "license": "apache-2.0", "size": 4242 }
[ "java.util.function.Consumer", "org.springframework.http.ResponseCookie" ]
import java.util.function.Consumer; import org.springframework.http.ResponseCookie;
import java.util.function.*; import org.springframework.http.*;
[ "java.util", "org.springframework.http" ]
java.util; org.springframework.http;
223,448
private static String readPDFFile(File file) throws Exception { return null; }
static String function(File file) throws Exception { return null; }
/** * Reads the content of the passed PDF file. * * @param file The file to handle. * @return See above. */
Reads the content of the passed PDF file
readPDFFile
{ "repo_name": "tp81/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/util/file/IOUtil.java", "license": "gpl-2.0", "size": 12307 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
268,173
public List<RepositoryCommit> getCommits(IRepositoryIdProvider repository) throws IOException { return getCommits(repository, null, null); }
List<RepositoryCommit> function(IRepositoryIdProvider repository) throws IOException { return getCommits(repository, null, null); }
/** * Get all commits in given repository * * @param repository * @return non-null but possibly empty list of repository commits * @throws IOException */
Get all commits in given repository
getCommits
{ "repo_name": "edyesed/gh4a", "path": "github-api/src/main/java/org/eclipse/egit/github/core/service/CommitService.java", "license": "apache-2.0", "size": 15954 }
[ "java.io.IOException", "java.util.List", "org.eclipse.egit.github.core.IRepositoryIdProvider", "org.eclipse.egit.github.core.RepositoryCommit" ]
import java.io.IOException; import java.util.List; import org.eclipse.egit.github.core.IRepositoryIdProvider; import org.eclipse.egit.github.core.RepositoryCommit;
import java.io.*; import java.util.*; import org.eclipse.egit.github.core.*;
[ "java.io", "java.util", "org.eclipse.egit" ]
java.io; java.util; org.eclipse.egit;
613,500
public Float validate(String value, String pattern, Locale locale) { return (Float)parse(value, pattern, locale); }
Float function(String value, String pattern, Locale locale) { return (Float)parse(value, pattern, locale); }
/** * <p>Validate/convert a <code>Float</code> using the * specified pattern and/ or <code>Locale</code>. * * @param value The value validation is being performed on. * @param pattern The pattern used to validate the value against, or the * default for the <code>Locale</code> if <code>null</code>. * @param locale The locale to use for the date format, system default if null. * @return The parsed <code>Float</code> if valid or <code>null</code> if invalid. */
Validate/convert a <code>Float</code> using the specified pattern and/ or <code>Locale</code>
validate
{ "repo_name": "apache/commons-validator", "path": "src/main/java/org/apache/commons/validator/routines/FloatValidator.java", "license": "apache-2.0", "size": 10082 }
[ "java.util.Locale" ]
import java.util.Locale;
import java.util.*;
[ "java.util" ]
java.util;
474,849
private void addErrorCode(String errCode) { if (errCode == null) { return; } if (listError == null) { listError = new ArrayList<String>(); listError.add(errCode); } else { if (!listError.contains(errCode)) { listError.add(errCode); } } }
void function(String errCode) { if (errCode == null) { return; } if (listError == null) { listError = new ArrayList<String>(); listError.add(errCode); } else { if (!listError.contains(errCode)) { listError.add(errCode); } } }
/** * Add an error code to the client * * @param errCode The error code to add */
Add an error code to the client
addErrorCode
{ "repo_name": "eWAYPayment/eway-rapid-java", "path": "src/main/java/com/eway/payment/rapid/sdk/RapidClientImpl.java", "license": "mit", "size": 19852 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
835,291
public MemoryUsage heapMemoryUsage() { // Catch exception here to allow discovery proceed even if metrics are not available // java.lang.IllegalArgumentException: committed = 5274103808 should be < max = 5274095616 // at java.lang.management.MemoryUsage.<init>(Unknown Source) try { return mem.getHeapMemoryUsage(); } catch (IllegalArgumentException ignored) { return new MemoryUsage(0, 0, 0, 0); } }
MemoryUsage function() { try { return mem.getHeapMemoryUsage(); } catch (IllegalArgumentException ignored) { return new MemoryUsage(0, 0, 0, 0); } }
/** * Returns the current memory usage of the heap. * @return Memory usage or fake value with zero in case there was exception during take of metrics. */
Returns the current memory usage of the heap
heapMemoryUsage
{ "repo_name": "shroman/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/metric/GridMetricManager.java", "license": "apache-2.0", "size": 24475 }
[ "java.lang.management.MemoryUsage" ]
import java.lang.management.MemoryUsage;
import java.lang.management.*;
[ "java.lang" ]
java.lang;
2,612,844
@Override public void contributeToMenu(IMenuManager menuManager) { super.contributeToMenu(menuManager); IMenuManager submenuManager = new MenuManager(ApplicationEditPlugin.INSTANCE.getString("_UI_ApplicationEditor_menu"), "applicationMenuID"); menuManager.insertAfter("additions", submenuManager); submenuManager.add(new Separator("settings")); submenuManager.add(new Separator("actions")); submenuManager.add(new Separator("additions")); submenuManager.add(new Separator("additions-end")); // Prepare for CreateChild item addition or removal. // createChildMenuManager = new MenuManager(ApplicationEditPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); submenuManager.insertBefore("additions", createChildMenuManager); // Prepare for CreateSibling item addition or removal. // createSiblingMenuManager = new MenuManager(ApplicationEditPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); submenuManager.insertBefore("additions", createSiblingMenuManager);
void function(IMenuManager menuManager) { super.contributeToMenu(menuManager); IMenuManager submenuManager = new MenuManager(ApplicationEditPlugin.INSTANCE.getString(STR), STR); menuManager.insertAfter(STR, submenuManager); submenuManager.add(new Separator(STR)); submenuManager.add(new Separator(STR)); submenuManager.add(new Separator(STR)); submenuManager.add(new Separator(STR)); submenuManager.insertBefore(STR, createChildMenuManager); submenuManager.insertBefore(STR, createSiblingMenuManager);
/** * This adds to the menu bar a menu and some separators for editor additions, * as well as the sub-menus for object creation items. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This adds to the menu bar a menu and some separators for editor additions, as well as the sub-menus for object creation items.
contributeToMenu
{ "repo_name": "mdean77/Model-Driven-Decision-Support", "path": "edu.utah.dcc.e4.application.xcore.model/src/application/presentation/ApplicationActionBarContributor.java", "license": "epl-1.0", "size": 14893 }
[ "org.eclipse.jface.action.IMenuManager", "org.eclipse.jface.action.MenuManager", "org.eclipse.jface.action.Separator" ]
import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.action.MenuManager; import org.eclipse.jface.action.Separator;
import org.eclipse.jface.action.*;
[ "org.eclipse.jface" ]
org.eclipse.jface;
484,648
public void notifyInterestChanged(Channel channel) { if(channel.isWritable()){ synchronized (writeLock) { // Channel is writable again, write if there are any messages pending MessageBatch pending = batcher.drain(); flushMessages(channel, pending); } } } private class Connect implements TimerTask { private final InetSocketAddress address; public Connect(InetSocketAddress address) { this.address = address; }
void function(Channel channel) { if(channel.isWritable()){ synchronized (writeLock) { MessageBatch pending = batcher.drain(); flushMessages(channel, pending); } } } private class Connect implements TimerTask { private final InetSocketAddress address; public Connect(InetSocketAddress address) { this.address = address; }
/** * Called by Netty thread on change in channel interest * @param channel */
Called by Netty thread on change in channel interest
notifyInterestChanged
{ "repo_name": "raviperi/storm", "path": "storm-client/src/jvm/org/apache/storm/messaging/netty/Client.java", "license": "apache-2.0", "size": 23587 }
[ "java.net.InetSocketAddress", "org.jboss.netty.channel.Channel", "org.jboss.netty.util.TimerTask" ]
import java.net.InetSocketAddress; import org.jboss.netty.channel.Channel; import org.jboss.netty.util.TimerTask;
import java.net.*; import org.jboss.netty.channel.*; import org.jboss.netty.util.*;
[ "java.net", "org.jboss.netty" ]
java.net; org.jboss.netty;
631,508
private void closeResultSet() throws SQLException { if(resultSet != null ) { resultSet.close(); resultSet = null; } }
void function() throws SQLException { if(resultSet != null ) { resultSet.close(); resultSet = null; } }
/** * Closes the result Set. * @throws SQLException SQL exception */
Closes the result Set
closeResultSet
{ "repo_name": "NCIP/catissue-dao", "path": "src/edu/wustl/dao/AbstractJDBCDAOImpl.java", "license": "bsd-3-clause", "size": 26231 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,658,647
OffsetDateTime lastModifiedTime();
OffsetDateTime lastModifiedTime();
/** * Gets the lastModifiedTime property: Last time resource was modified, which only appears in the response. * * @return the lastModifiedTime value. */
Gets the lastModifiedTime property: Last time resource was modified, which only appears in the response
lastModifiedTime
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/automation/azure-resourcemanager-automation/src/main/java/com/azure/resourcemanager/automation/models/SoftwareUpdateConfiguration.java", "license": "mit", "size": 8017 }
[ "java.time.OffsetDateTime" ]
import java.time.OffsetDateTime;
import java.time.*;
[ "java.time" ]
java.time;
491,360
public static void matToBitmap(Mat mat, Bitmap bmp) { matToBitmap(mat, bmp, false); }
static void function(Mat mat, Bitmap bmp) { matToBitmap(mat, bmp, false); }
/** * Short form of the <b>matToBitmap(mat, bmp, premultiplyAlpha=false)</b> * @param mat is a valid input Mat object of the types 'CV_8UC1', 'CV_8UC3' or 'CV_8UC4'. * @param bmp is a valid Bitmap object of the same size as the Mat and of type 'ARGB_8888' or 'RGB_565'. */
Short form of the matToBitmap(mat, bmp, premultiplyAlpha=false)
matToBitmap
{ "repo_name": "vicmns/rinnegan-android", "path": "opencvandroid/src/main/java/org/opencv/android/Utils.java", "license": "apache-2.0", "size": 5818 }
[ "android.graphics.Bitmap", "org.opencv.core.Mat" ]
import android.graphics.Bitmap; import org.opencv.core.Mat;
import android.graphics.*; import org.opencv.core.*;
[ "android.graphics", "org.opencv.core" ]
android.graphics; org.opencv.core;
688,704
public void onCloseSystemDialogs(String reason) { } /** * Given a Drawable whose bounds have been set to draw into this view, * update a Region being computed for {@link #gatherTransparentRegion} so * that any non-transparent parts of the Drawable are removed from the * given transparent region. * * @param dr The Drawable whose transparency is to be applied to the region. * @param region A Region holding the current transparency information, * where any parts of the region that are set are considered to be * transparent. On return, this region will be modified to have the * transparency information reduced by the corresponding parts of the * Drawable that are not transparent. * {@hide}
void function(String reason) { } /** * Given a Drawable whose bounds have been set to draw into this view, * update a Region being computed for {@link #gatherTransparentRegion} so * that any non-transparent parts of the Drawable are removed from the * given transparent region. * * @param dr The Drawable whose transparency is to be applied to the region. * @param region A Region holding the current transparency information, * where any parts of the region that are set are considered to be * transparent. On return, this region will be modified to have the * transparency information reduced by the corresponding parts of the * Drawable that are not transparent. * {@hide}
/** * This needs to be a better API (NOT ON VIEW) before it is exposed. If * it is ever exposed at all. * @hide */
This needs to be a better API (NOT ON VIEW) before it is exposed. If it is ever exposed at all
onCloseSystemDialogs
{ "repo_name": "mateor/PDroidHistory", "path": "frameworks/base/core/java/android/view/View.java", "license": "gpl-3.0", "size": 347830 }
[ "android.graphics.Region", "android.graphics.drawable.Drawable" ]
import android.graphics.Region; import android.graphics.drawable.Drawable;
import android.graphics.*; import android.graphics.drawable.*;
[ "android.graphics" ]
android.graphics;
251,990
@Test public void test1Byte() throws SQLException { byte[] data = {(byte) 'a'}; readWriteBlob(data); }
void function() throws SQLException { byte[] data = {(byte) 'a'}; readWriteBlob(data); }
/** * Test the writing and reading of a single byte. * * @throws SQLException */
Test the writing and reading of a single byte
test1Byte
{ "repo_name": "frode-carlsen/pgjdbc-ng", "path": "src/test/java/com/impossibl/postgres/jdbc/BlobTest.java", "license": "bsd-3-clause", "size": 32415 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,617,286
RequestSpecification queryParams(Map<String, String> parametersMap);
RequestSpecification queryParams(Map<String, String> parametersMap);
/** * A slightly shorter version of {@link #queryParams(java.util.Map)}. * * @see #queryParams(java.util.Map) * @param parametersMap The Map containing the parameter names and their values to send with the request. * @return The request specification */
A slightly shorter version of <code>#queryParams(java.util.Map)</code>
queryParams
{ "repo_name": "VoldemarLeGrand/rest-assured", "path": "rest-assured/src/main/java/com/jayway/restassured/specification/RequestSpecification.java", "license": "apache-2.0", "size": 40725 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,021,158
public static StringBuilder formatTo(StringBuilder buf, float[] d, String sep, NumberFormat nf) { if(d == null) { return buf.append("null"); } if(d.length == 0) { return buf; } buf.append(nf.format(d[0])); for(int i = 1; i < d.length; i++) { buf.append(sep).append(nf.format(d[i])); } return buf; }
static StringBuilder function(StringBuilder buf, float[] d, String sep, NumberFormat nf) { if(d == null) { return buf.append("null"); } if(d.length == 0) { return buf; } buf.append(nf.format(d[0])); for(int i = 1; i < d.length; i++) { buf.append(sep).append(nf.format(d[i])); } return buf; }
/** * Formats the float array d with the specified number format. * * @param buf String builder to append to * @param d the float array to be formatted * @param sep separator between the single values of the array, e.g. ',' * @param nf the number format to be used for formatting * @return Output buffer buf */
Formats the float array d with the specified number format
formatTo
{ "repo_name": "elki-project/elki", "path": "elki-core-util/src/main/java/elki/utilities/io/FormatUtil.java", "license": "agpl-3.0", "size": 32650 }
[ "java.text.NumberFormat" ]
import java.text.NumberFormat;
import java.text.*;
[ "java.text" ]
java.text;
940,345
protected String getMediaType(HttpServletRequest req, HttpServletResponse res, PipelineEventReader<CharacterEventReader, CharacterEvent> pipelineEventReader) { final String mediaType = pipelineEventReader.getOutputProperty(OutputKeys.MEDIA_TYPE); if (mediaType != null) { return mediaType; } this.logger.warn("No mediaType was specified in the pipeline output properties, defaulting to " + DEFAULT_MEDIA_TYPE); return DEFAULT_MEDIA_TYPE; }
String function(HttpServletRequest req, HttpServletResponse res, PipelineEventReader<CharacterEventReader, CharacterEvent> pipelineEventReader) { final String mediaType = pipelineEventReader.getOutputProperty(OutputKeys.MEDIA_TYPE); if (mediaType != null) { return mediaType; } this.logger.warn(STR + DEFAULT_MEDIA_TYPE); return DEFAULT_MEDIA_TYPE; }
/** * Determine the media type to use for the response */
Determine the media type to use for the response
getMediaType
{ "repo_name": "apetro/uPortal", "path": "uportal-war/src/main/java/org/apereo/portal/rendering/DynamicRenderingPipeline.java", "license": "apache-2.0", "size": 5285 }
[ "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "javax.xml.transform.OutputKeys", "org.apereo.portal.character.stream.CharacterEventReader", "org.apereo.portal.character.stream.events.CharacterEvent" ]
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.xml.transform.OutputKeys; import org.apereo.portal.character.stream.CharacterEventReader; import org.apereo.portal.character.stream.events.CharacterEvent;
import javax.servlet.http.*; import javax.xml.transform.*; import org.apereo.portal.character.stream.*; import org.apereo.portal.character.stream.events.*;
[ "javax.servlet", "javax.xml", "org.apereo.portal" ]
javax.servlet; javax.xml; org.apereo.portal;
82,123
@Test @Ignore public void testPostRefreshModules_ReturnsEncodingUtf8_FIXME() throws Exception { mockMvc.perform(post(REST_MODULE_REFRESH_URI).accept(MediaType.APPLICATION_XML)) .andExpect(content().encoding("utf-8")); }
void function() throws Exception { mockMvc.perform(post(REST_MODULE_REFRESH_URI).accept(MediaType.APPLICATION_XML)) .andExpect(content().encoding("utf-8")); }
/** * Test that POST "Refresh Modules" service invocation returns encoding "utf-8". * * @throws Exception if test fails. */
Test that POST "Refresh Modules" service invocation returns encoding "utf-8"
testPostRefreshModules_ReturnsEncodingUtf8_FIXME
{ "repo_name": "athrane/pineapple", "path": "applications/pineapple-web-application/pineapple-web-application-war/src/test/java/com/alpha/pineapple/web/spring/rest/ModulesControllerIntegrationTest.java", "license": "gpl-3.0", "size": 24005 }
[ "org.springframework.http.MediaType" ]
import org.springframework.http.MediaType;
import org.springframework.http.*;
[ "org.springframework.http" ]
org.springframework.http;
2,754,613
public void changeStartPeriod(Calendar startPeriod) { this.startPeriod = startPeriod; build(); }
void function(Calendar startPeriod) { this.startPeriod = startPeriod; build(); }
/** * Change the period reference by the first month of period given. * @param startPeriod The first month of the chart period. */
Change the period reference by the first month of period given
changeStartPeriod
{ "repo_name": "emmanuel-florent/flowzr-android-black", "path": "src/main/java/com/flowzr/graph/Report2DChart.java", "license": "gpl-2.0", "size": 10943 }
[ "java.util.Calendar" ]
import java.util.Calendar;
import java.util.*;
[ "java.util" ]
java.util;
658,681
public static void rollbackTransaction() throws HibernateException { connectionManager.rollbackTransaction(); }
static void function() throws HibernateException { connectionManager.rollbackTransaction(); }
/** * Roll the transaction for the current session back. This method or * {@link #commitTransaction}can only be called once per session. * * @throws HibernateException if the commit fails */
Roll the transaction for the current session back. This method or <code>#commitTransaction</code>can only be called once per session
rollbackTransaction
{ "repo_name": "colloquium/spacewalk", "path": "java/code/src/com/redhat/rhn/common/hibernate/HibernateFactory.java", "license": "gpl-2.0", "size": 19375 }
[ "org.hibernate.HibernateException" ]
import org.hibernate.HibernateException;
import org.hibernate.*;
[ "org.hibernate" ]
org.hibernate;
1,724,189
protected void addRequiredRolePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_PCM_FunctionalityConnection_requiredRole_feature"), getString("_UI_PropertyDescriptor_description", "_UI_PCM_FunctionalityConnection_requiredRole_feature", "_UI_PCM_FunctionalityConnection_type"), PcmarchoptionsPackage.Literals.PCM_FUNCTIONALITY_CONNECTION__REQUIRED_ROLE, true, false, true, null, null, null)); }
void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), PcmarchoptionsPackage.Literals.PCM_FUNCTIONALITY_CONNECTION__REQUIRED_ROLE, true, false, true, null, null, null)); }
/** * This adds a property descriptor for the Required Role feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This adds a property descriptor for the Required Role feature.
addRequiredRolePropertyDescriptor
{ "repo_name": "KAMP-Research/KAMP", "path": "bundles/Toometa/toometa.pcmarchoptions.edit/src/pcmarchoptions/provider/PCM_FunctionalityConnectionItemProvider.java", "license": "apache-2.0", "size": 5285 }
[ "org.eclipse.emf.edit.provider.ComposeableAdapterFactory" ]
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
316,100
public void connectWiresToXY(Wire[] xWires, int xStartPos, Wire[] yWires, int yStartPos) { if (xStartPos + andBitWidth > xWires.length || yStartPos + andBitWidth > yWires.length) throw new RuntimeException("Unmatched number of wires."); for (int i = 0; i < andBitWidth; i++) { xWires[xStartPos+i].connectTo(inputWires, X(i)); yWires[yStartPos+i].connectTo(inputWires, Y(i)); } }
void function(Wire[] xWires, int xStartPos, Wire[] yWires, int yStartPos) { if (xStartPos + andBitWidth > xWires.length yStartPos + andBitWidth > yWires.length) throw new RuntimeException(STR); for (int i = 0; i < andBitWidth; i++) { xWires[xStartPos+i].connectTo(inputWires, X(i)); yWires[yStartPos+i].connectTo(inputWires, Y(i)); } }
/** * Connect xWires[xStartPos...xStartPos+L] to the wires representing bits of X; * yWires[yStartPos...yStartPos+L] to the wires representing bits of Y; */
Connect xWires[xStartPos...xStartPos+L] to the wires representing bits of X; yWires[yStartPos...yStartPos+L] to the wires representing bits of Y
connectWiresToXY
{ "repo_name": "factcenter/inchworm", "path": "src/main/java/org/factcenter/fastgc/inchworm/AND_2L_L.java", "license": "mit", "size": 1977 }
[ "org.factcenter.fastgc.YaoGC" ]
import org.factcenter.fastgc.YaoGC;
import org.factcenter.fastgc.*;
[ "org.factcenter.fastgc" ]
org.factcenter.fastgc;
2,723,985