method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
sequence
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
sequence
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public SizeInt getSize() { return glprovider.getClientAreaSize(); }
SizeInt function() { return glprovider.getClientAreaSize(); }
/** * Get the client area size. * @return */
Get the client area size
getSize
{ "repo_name": "qgears/opensource-utils", "path": "commons/hu.qgears.opengl.commons/src/hu/qgears/opengl/commons/AbstractOpenglApplication2.java", "license": "epl-1.0", "size": 9788 }
[ "hu.qgears.images.SizeInt" ]
import hu.qgears.images.SizeInt;
import hu.qgears.images.*;
[ "hu.qgears.images" ]
hu.qgears.images;
971,639
void store() { forModule(MavenPanel.class).put(DN_VERTX_VERSION, defaultVersionText.getText()); forModule(MavenPanel.class).put(DN_MVN_ARTIFACT_ID, artifactIDTextField.getText()); forModule(MavenPanel.class).put(DN_MVN_GROUP_ID, groupIDTextField.getText()); }
void store() { forModule(MavenPanel.class).put(DN_VERTX_VERSION, defaultVersionText.getText()); forModule(MavenPanel.class).put(DN_MVN_ARTIFACT_ID, artifactIDTextField.getText()); forModule(MavenPanel.class).put(DN_MVN_GROUP_ID, groupIDTextField.getText()); }
/** * Store the option values. */
Store the option values
store
{ "repo_name": "fafischer/te2m.de-netbeans", "path": "de.te2m.tools.netbeans.vertx/src/main/java/de/te2m/tools/netbeans/vertx/options/MavenPanel.java", "license": "gpl-2.0", "size": 7913 }
[ "org.openide.util.NbPreferences" ]
import org.openide.util.NbPreferences;
import org.openide.util.*;
[ "org.openide.util" ]
org.openide.util;
2,893,205
public boolean cmakeInstall(String buildFolder, String runFolder, String buildType, Object console) { boolean ret_val = false; try { switch (this.CURR_OS) { case WINDOWS: ret_val = this.winCmd.cmakeInstall(buildFolder, runFolder, buildType, console); break; case UNIX: ret_val = this.unixCmd.cmakeInstall(buildFolder, runFolder, console); break; case MACOS: break; default: ret_val = false; break; } } catch (IOException | ExecutionException | InterruptedException ex) { return false; } return ret_val; }
boolean function(String buildFolder, String runFolder, String buildType, Object console) { boolean ret_val = false; try { switch (this.CURR_OS) { case WINDOWS: ret_val = this.winCmd.cmakeInstall(buildFolder, runFolder, buildType, console); break; case UNIX: ret_val = this.unixCmd.cmakeInstall(buildFolder, runFolder, console); break; case MACOS: break; default: ret_val = false; break; } } catch (IOException ExecutionException InterruptedException ex) { return false; } return ret_val; }
/** * Compile the configured cmake project from buildFolder.<br /> * NOTE: In GUI mode for Windows operating systems, the compiled binary * need to be copied into installation folder separately * * @param buildFolder The String path to cmake build folder * @param runFolder The String path to binari installation folder * @param buildType The String typology of build (Debug/Release) for ONLY * WINDOWS operating systems * @param console The JTextPane object to be used for output in swing GUI * @return True if cmake compile suceeded, false if Object console is not * null, false otherwise */
Compile the configured cmake project from buildFolder. need to be copied into installation folder separately
cmakeInstall
{ "repo_name": "Corsol/MaNGOSUI-Dev", "path": "src/mangosui/CommandManager.java", "license": "gpl-2.0", "size": 73261 }
[ "java.io.IOException", "java.util.concurrent.ExecutionException" ]
import java.io.IOException; import java.util.concurrent.ExecutionException;
import java.io.*; import java.util.concurrent.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,533,873
static private byte[] mapToByteArray(double v) { ByteBuffer bb = ByteBuffer.allocate(8); bb.putDouble(v); return bb.array(); }
static byte[] function(double v) { ByteBuffer bb = ByteBuffer.allocate(8); bb.putDouble(v); return bb.array(); }
/** * Map the byte data to a byte value * @param v see above. * @return see above. */
Map the byte data to a byte value
mapToByteArray
{ "repo_name": "joshmoore/openmicroscopy", "path": "components/tools/OmeroJava/src/omerojava/util/GatewayUtils.java", "license": "gpl-2.0", "size": 15192 }
[ "java.nio.ByteBuffer" ]
import java.nio.ByteBuffer;
import java.nio.*;
[ "java.nio" ]
java.nio;
2,188,771
@Test public void trainEcho() { final NeuralNetwork network = testData.createNeuralNetworkEcho(); network.randomizeWeights(0.1); final List<Example> examples = testData.createExamplesEcho(); // Train final double beta = 1.0; final double alpha = 0.3; final NeuralNetworkTrainer trainer = new NeuralNetworkBatchTrainer(network, examples, IS_VERBOSE, alpha, beta); final double maxError = 0.01; final int maxCount = 100; final int printFrequency = maxCount / 100; final double error = trainer.runTrainingLoop(maxError, maxCount, printFrequency); if (IS_VERBOSE) { System.out.println(); testNetwork(network, examples); System.out.println(); printMinMaxWeights("connector01", network.getConnector(0, 1)); printMinMaxWeights("connector12", network.getConnector(1, 2)); } assertTrue(String.valueOf(error), error < maxError); }
void function() { final NeuralNetwork network = testData.createNeuralNetworkEcho(); network.randomizeWeights(0.1); final List<Example> examples = testData.createExamplesEcho(); final double beta = 1.0; final double alpha = 0.3; final NeuralNetworkTrainer trainer = new NeuralNetworkBatchTrainer(network, examples, IS_VERBOSE, alpha, beta); final double maxError = 0.01; final int maxCount = 100; final int printFrequency = maxCount / 100; final double error = trainer.runTrainingLoop(maxError, maxCount, printFrequency); if (IS_VERBOSE) { System.out.println(); testNetwork(network, examples); System.out.println(); printMinMaxWeights(STR, network.getConnector(0, 1)); printMinMaxWeights(STR, network.getConnector(1, 2)); } assertTrue(String.valueOf(error), error < maxError); }
/** * Test the <code>train()</code> method. */
Test the <code>train()</code> method
trainEcho
{ "repo_name": "jmthompson2015/vizzini", "path": "ai/src/test/java/org/vizzini/ai/neuralnetwork/NeuralNetworkBatchTrainerTest.java", "license": "mit", "size": 15019 }
[ "java.util.List", "org.junit.Assert", "org.vizzini.ai.neuralnetwork.Example", "org.vizzini.ai.neuralnetwork.NeuralNetwork", "org.vizzini.ai.neuralnetwork.NeuralNetworkBatchTrainer", "org.vizzini.ai.neuralnetwork.NeuralNetworkTrainer" ]
import java.util.List; import org.junit.Assert; import org.vizzini.ai.neuralnetwork.Example; import org.vizzini.ai.neuralnetwork.NeuralNetwork; import org.vizzini.ai.neuralnetwork.NeuralNetworkBatchTrainer; import org.vizzini.ai.neuralnetwork.NeuralNetworkTrainer;
import java.util.*; import org.junit.*; import org.vizzini.ai.neuralnetwork.*;
[ "java.util", "org.junit", "org.vizzini.ai" ]
java.util; org.junit; org.vizzini.ai;
465,434
public void validate(final NXroot root) throws NexusValidationException;
void function(final NXroot root) throws NexusValidationException;
/** * Validate the given nexus tree. * @param root * @throws NexusValidationException */
Validate the given nexus tree
validate
{ "repo_name": "belkassaby/dawnsci", "path": "org.eclipse.dawnsci.nexus/src/org/eclipse/dawnsci/nexus/validation/NexusApplicationValidator.java", "license": "epl-1.0", "size": 1556 }
[ "org.eclipse.dawnsci.nexus.NXroot" ]
import org.eclipse.dawnsci.nexus.NXroot;
import org.eclipse.dawnsci.nexus.*;
[ "org.eclipse.dawnsci" ]
org.eclipse.dawnsci;
156,200
protected void resetFollowDistance(LivingEntity entity, MobType mobType) { AttributeInstance attribute = entity.getAttribute(Attribute.GENERIC_FOLLOW_RANGE); attribute.setBaseValue(mobType.getDefaultFollowDistance()); }
void function(LivingEntity entity, MobType mobType) { AttributeInstance attribute = entity.getAttribute(Attribute.GENERIC_FOLLOW_RANGE); attribute.setBaseValue(mobType.getDefaultFollowDistance()); }
/** * Resets the follow distance of the given EntityInsentient back * to its default follow distance. * @param entity the entity whose follow distance you * want to reset. * @param mobType the mob type of the entity */
Resets the follow distance of the given EntityInsentient back to its default follow distance
resetFollowDistance
{ "repo_name": "siege1313/DynamicDifficulty", "path": "src/com/cjmcguire/bukkit/dynamic/controller/MobControllerListener.java", "license": "gpl-3.0", "size": 12986 }
[ "com.cjmcguire.bukkit.dynamic.playerdata.MobType", "org.bukkit.attribute.Attribute", "org.bukkit.attribute.AttributeInstance", "org.bukkit.entity.LivingEntity" ]
import com.cjmcguire.bukkit.dynamic.playerdata.MobType; import org.bukkit.attribute.Attribute; import org.bukkit.attribute.AttributeInstance; import org.bukkit.entity.LivingEntity;
import com.cjmcguire.bukkit.dynamic.playerdata.*; import org.bukkit.attribute.*; import org.bukkit.entity.*;
[ "com.cjmcguire.bukkit", "org.bukkit.attribute", "org.bukkit.entity" ]
com.cjmcguire.bukkit; org.bukkit.attribute; org.bukkit.entity;
532,549
StringBuffer buf = new StringBuffer(); for (Enumeration e = this.propertyNames(); e.hasMoreElements(); ) { process(buf, e.nextElement()); } return buf.toString(); }
StringBuffer buf = new StringBuffer(); for (Enumeration e = this.propertyNames(); e.hasMoreElements(); ) { process(buf, e.nextElement()); } return buf.toString(); }
/** * The String representation of the contents. * @return a String representation. */
The String representation of the contents
toString
{ "repo_name": "bullda/DroidText", "path": "src/core/com/lowagie/text/xml/xmp/XmpSchema.java", "license": "lgpl-3.0", "size": 5143 }
[ "java.util.Enumeration" ]
import java.util.Enumeration;
import java.util.*;
[ "java.util" ]
java.util;
1,265,666
@Test public void tagRouterRuleParseTest(){ String tagRouterRuleConfig = "---\n" + "force: false\n" + "runtime: true\n" + "enabled: false\n" + "priority: 1\n" + "key: demo-provider\n" + "tags:\n" + " - name: tag1\n" + " addresses: null\n" + " - name: tag2\n" + " addresses: [\"30.5.120.37:20880\"]\n" + " - name: tag3\n" + " addresses: []\n" + " - name: tag4\n" + " addresses: ~\n" + "..."; TagRouterRule tagRouterRule = TagRuleParser.parse(tagRouterRuleConfig); // assert tags assert tagRouterRule.getTagNames().contains("tag1"); assert tagRouterRule.getTagNames().contains("tag2"); assert tagRouterRule.getTagNames().contains("tag3"); assert tagRouterRule.getTagNames().contains("tag4"); // assert addresses assert tagRouterRule.getAddresses().contains("30.5.120.37:20880"); assert tagRouterRule.getTagnameToAddresses().get("tag1")==null; assert tagRouterRule.getTagnameToAddresses().get("tag2").size()==1; assert tagRouterRule.getTagnameToAddresses().get("tag3")==null; assert tagRouterRule.getTagnameToAddresses().get("tag4")==null; assert tagRouterRule.getAddresses().size()==1; }
void function(){ String tagRouterRuleConfig = "---\n" + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR30.5.120.37:20880\"]\n" + STR + STR + STR + STR + "..."; TagRouterRule tagRouterRule = TagRuleParser.parse(tagRouterRuleConfig); assert tagRouterRule.getTagNames().contains("tag1"); assert tagRouterRule.getTagNames().contains("tag2"); assert tagRouterRule.getTagNames().contains("tag3"); assert tagRouterRule.getTagNames().contains("tag4"); assert tagRouterRule.getAddresses().contains(STR); assert tagRouterRule.getTagnameToAddresses().get("tag1")==null; assert tagRouterRule.getTagnameToAddresses().get("tag2").size()==1; assert tagRouterRule.getTagnameToAddresses().get("tag3")==null; assert tagRouterRule.getTagnameToAddresses().get("tag4")==null; assert tagRouterRule.getAddresses().size()==1; }
/** * TagRouterRule parse test when the tags addresses is null * * <pre> * ~ -> null * null -> null * </pre> */
TagRouterRule parse test when the tags addresses is null <code> ~ -> null null -> null </code>
tagRouterRuleParseTest
{ "repo_name": "qtvbwfn/dubbo", "path": "dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/router/TagRouterTest.java", "license": "apache-2.0", "size": 4301 }
[ "org.apache.dubbo.rpc.cluster.router.tag.model.TagRouterRule", "org.apache.dubbo.rpc.cluster.router.tag.model.TagRuleParser" ]
import org.apache.dubbo.rpc.cluster.router.tag.model.TagRouterRule; import org.apache.dubbo.rpc.cluster.router.tag.model.TagRuleParser;
import org.apache.dubbo.rpc.cluster.router.tag.model.*;
[ "org.apache.dubbo" ]
org.apache.dubbo;
1,301,076
List<LogEntry> getLogEntries(String partitionCode, String identifier) throws ServiceException;
List<LogEntry> getLogEntries(String partitionCode, String identifier) throws ServiceException;
/** * Get a list of log entries for a particular identifier across domains and types. * * @param partitionCode The partition code. * @param identifier * */
Get a list of log entries for a particular identifier across domains and types
getLogEntries
{ "repo_name": "sudduth/Aardin", "path": "Logging/LoggingAPI/src/main/java/org/aardin/logging/api/ILoggingService.java", "license": "agpl-3.0", "size": 4625 }
[ "java.util.List", "org.aardin.common.exceptions.ServiceException", "org.aardin.logging.model.LogEntry" ]
import java.util.List; import org.aardin.common.exceptions.ServiceException; import org.aardin.logging.model.LogEntry;
import java.util.*; import org.aardin.common.exceptions.*; import org.aardin.logging.model.*;
[ "java.util", "org.aardin.common", "org.aardin.logging" ]
java.util; org.aardin.common; org.aardin.logging;
2,790,658
@Override public void enterPinst(@NotNull PoCoParser.PinstContext ctx) { }
@Override public void enterPinst(@NotNull PoCoParser.PinstContext ctx) { }
/** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */
The default implementation does nothing
exitPimports
{ "repo_name": "Corjuh/PoCo-Compiler", "path": "Parser/gen/PoCoParserBaseListener.java", "license": "lgpl-2.1", "size": 18482 }
[ "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;
706,457
public void setTile(Tile tile, boolean done) { if (model.getState() == DISCARDED) return; model.getBrowser().getUI().repaint(); view.removeComponentListener(controller); if (done) { view.addComponentListener(controller); model.setState(READY); fireStateChange(); } }
void function(Tile tile, boolean done) { if (model.getState() == DISCARDED) return; model.getBrowser().getUI().repaint(); view.removeComponentListener(controller); if (done) { view.addComponentListener(controller); model.setState(READY); fireStateChange(); } }
/** * Implemented as specified by the {@link ImViewer} interface. * @see ImViewer#setTile(Tile, boolean) */
Implemented as specified by the <code>ImViewer</code> interface
setTile
{ "repo_name": "chris-allan/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerComponent.java", "license": "gpl-2.0", "size": 95777 }
[ "org.openmicroscopy.shoola.env.rnd.data.Tile" ]
import org.openmicroscopy.shoola.env.rnd.data.Tile;
import org.openmicroscopy.shoola.env.rnd.data.*;
[ "org.openmicroscopy.shoola" ]
org.openmicroscopy.shoola;
2,259,183
protected void doExpiry(ConsumerWorkingSet workingSet) { long expiryTime = getExpiryBorder(); List<PartitionKey> expiredPartitions = new ArrayList<>(); List<PartitionKey> discardedPartitions = new ArrayList<>(); for (ConsumablePartition partition : workingSet.getPartitions()) { if (partition.getProcessState() == ProcessState.IN_PROGRESS && partition.getTimestamp() < expiryTime) { // either reset its processState, or remove it from the workingSet, depending on how many tries it already has if (partition.getNumFailures() < getConfiguration().getMaxRetries()) { partition.retry(); } else { partition.discard(); } expiredPartitions.add(partition.getPartitionKey()); } } if (!expiredPartitions.isEmpty()) { LOG.warn("Expiring in progress partitions: {}", expiredPartitions); if (!discardedPartitions.isEmpty()) { LOG.warn("Discarded keys due to being retried {} times: {}", getConfiguration().getMaxRetries(), discardedPartitions); } } }
void function(ConsumerWorkingSet workingSet) { long expiryTime = getExpiryBorder(); List<PartitionKey> expiredPartitions = new ArrayList<>(); List<PartitionKey> discardedPartitions = new ArrayList<>(); for (ConsumablePartition partition : workingSet.getPartitions()) { if (partition.getProcessState() == ProcessState.IN_PROGRESS && partition.getTimestamp() < expiryTime) { if (partition.getNumFailures() < getConfiguration().getMaxRetries()) { partition.retry(); } else { partition.discard(); } expiredPartitions.add(partition.getPartitionKey()); } } if (!expiredPartitions.isEmpty()) { LOG.warn(STR, expiredPartitions); if (!discardedPartitions.isEmpty()) { LOG.warn(STR, getConfiguration().getMaxRetries(), discardedPartitions); } } }
/** * Goes through all partitions. If any IN_PROGRESS partition is older than the configured timeout, reset its state * to AVAILABLE, unless it has already been retried the configured number of times, in which case it is discarded. */
Goes through all partitions. If any IN_PROGRESS partition is older than the configured timeout, reset its state to AVAILABLE, unless it has already been retried the configured number of times, in which case it is discarded
doExpiry
{ "repo_name": "caskdata/cdap", "path": "cdap-api/src/main/java/co/cask/cdap/api/dataset/lib/partitioned/ConcurrentPartitionConsumer.java", "license": "apache-2.0", "size": 8422 }
[ "co.cask.cdap.api.dataset.lib.PartitionKey", "java.util.ArrayList", "java.util.List" ]
import co.cask.cdap.api.dataset.lib.PartitionKey; import java.util.ArrayList; import java.util.List;
import co.cask.cdap.api.dataset.lib.*; import java.util.*;
[ "co.cask.cdap", "java.util" ]
co.cask.cdap; java.util;
2,134,636
protected void stopService() throws Exception { stopScheduler(scheduleMediaListenerID, scheduleMediaListener); stopScheduler(updateMediaStatusListenerID, updateMediaStatusListener); stopScheduler(burnMediaListenerID, burnMediaListener); JMSDelegate.stopListening(QUEUE); super.stopService(); }
void function() throws Exception { stopScheduler(scheduleMediaListenerID, scheduleMediaListener); stopScheduler(updateMediaStatusListenerID, updateMediaStatusListener); stopScheduler(burnMediaListenerID, burnMediaListener); JMSDelegate.stopListening(QUEUE); super.stopService(); }
/** * Stop listening to the JMS queue deined in <code>QUEUE</code> * */
Stop listening to the JMS queue deined in <code>QUEUE</code>
stopService
{ "repo_name": "medicayun/medicayundicom", "path": "dcm4jboss-all/tags/DCM4JBOSS_2_2_1/dcm4jboss-sar/src/java/org/dcm4chex/archive/dcm/mcmscu/MCMScuService.java", "license": "apache-2.0", "size": 37924 }
[ "org.dcm4chex.archive.util.JMSDelegate" ]
import org.dcm4chex.archive.util.JMSDelegate;
import org.dcm4chex.archive.util.*;
[ "org.dcm4chex.archive" ]
org.dcm4chex.archive;
2,823,505
this.job = job; //disable the auto increment of the counter. For pipes, no of processed //records could be different(equal or less) than the no of records input. SkipBadRecords.setAutoIncrMapperProcCount(job, false); }
this.job = job; SkipBadRecords.setAutoIncrMapperProcCount(job, false); }
/** * Get the new configuration. * @param job the job's configuration */
Get the new configuration
configure
{ "repo_name": "koichi626/hadoop-gpu", "path": "hadoop-gpu-0.20.1/src/mapred/org/apache/hadoop/mapred/pipes/PipesGPUMapRunner.java", "license": "apache-2.0", "size": 4165 }
[ "org.apache.hadoop.mapred.SkipBadRecords" ]
import org.apache.hadoop.mapred.SkipBadRecords;
import org.apache.hadoop.mapred.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,236,508
@Override public void render(OrthographicCamera camera, float deltaTime) { batch.setProjectionMatrix(camera.combined); batch.begin(); screenSprite.draw(batch); batch.end(); }
void function(OrthographicCamera camera, float deltaTime) { batch.setProjectionMatrix(camera.combined); batch.begin(); screenSprite.draw(batch); batch.end(); }
/** * Zeigt den Splashscreen an. * * @param camera die aktuelle Kamera * @param deltaTime die vergangene Zeit seit dem letztem Frame */
Zeigt den Splashscreen an
render
{ "repo_name": "Entwicklerpages/school-game", "path": "core/src/de/entwicklerpages/java/schoolgame/menu/Splashscreen.java", "license": "gpl-3.0", "size": 3129 }
[ "com.badlogic.gdx.graphics.OrthographicCamera" ]
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.*;
[ "com.badlogic.gdx" ]
com.badlogic.gdx;
1,764,535
public void setOrientation(final HierarchicOrientation value) { Preconditions.checkNotNull(value, "IE00879: Orientation argument can't be null"); if (value == getOrientation()) { return; } if (m_type == null) { m_orientation = value; } else { m_type.setHierarchicOrientation(value.ordinal()); } }
void function(final HierarchicOrientation value) { Preconditions.checkNotNull(value, STR); if (value == getOrientation()) { return; } if (m_type == null) { m_orientation = value; } else { m_type.setHierarchicOrientation(value.ordinal()); } }
/** * Changes the current hierarchic orientation setting. * * @param value The new value of the hierarchic orientation setting. */
Changes the current hierarchic orientation setting
setOrientation
{ "repo_name": "google/binnavi", "path": "src/main/java/com/google/security/zynamics/binnavi/ZyGraph/Settings/ZyGraphHierarchicalSettings.java", "license": "apache-2.0", "size": 8891 }
[ "com.google.common.base.Preconditions", "com.google.security.zynamics.zylib.gui.zygraph.layouters.HierarchicOrientation" ]
import com.google.common.base.Preconditions; import com.google.security.zynamics.zylib.gui.zygraph.layouters.HierarchicOrientation;
import com.google.common.base.*; import com.google.security.zynamics.zylib.gui.zygraph.layouters.*;
[ "com.google.common", "com.google.security" ]
com.google.common; com.google.security;
1,418,440
EAttribute getMultiplicity__Bound_1();
EAttribute getMultiplicity__Bound_1();
/** * Returns the meta object for the attribute '{@link cruise.umple.umple.Multiplicity_#getBound_1 <em>Bound 1</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Bound 1</em>'. * @see cruise.umple.umple.Multiplicity_#getBound_1() * @see #getMultiplicity_() * @generated */
Returns the meta object for the attribute '<code>cruise.umple.umple.Multiplicity_#getBound_1 Bound 1</code>'.
getMultiplicity__Bound_1
{ "repo_name": "ahmedvc/umple", "path": "cruise.umple.xtext/src-gen/cruise/umple/umple/UmplePackage.java", "license": "mit", "size": 485842 }
[ "org.eclipse.emf.ecore.EAttribute" ]
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
392,129
int updateByExampleSelective(@Param("record") Actvhh record, @Param("example") ActvhhExample example);
int updateByExampleSelective(@Param(STR) Actvhh record, @Param(STR) ActvhhExample example);
/** * This method was generated by MyBatis Generator. * This method corresponds to the database table ACTVHH * * @mbggenerated Wed Nov 12 10:29:21 CST 2014 */
This method was generated by MyBatis Generator. This method corresponds to the database table ACTVHH
updateByExampleSelective
{ "repo_name": "rongshang/fbi-cbs2", "path": "common/main/java/cbs/repository/account/maininfo/dao/ActvhhMapper.java", "license": "unlicense", "size": 3524 }
[ "org.apache.ibatis.annotations.Param" ]
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.*;
[ "org.apache.ibatis" ]
org.apache.ibatis;
97,002
Iterable<T> findAll(Sort sort);
Iterable<T> findAll(Sort sort);
/** * Returns all entities sorted by the given options. * * @param sort * @return all entities sorted by the given options */
Returns all entities sorted by the given options
findAll
{ "repo_name": "jianghouwei/SunDay", "path": "root-framework/src/main/java/com/org/framework/data/BaseService.java", "license": "mit", "size": 2434 }
[ "org.springframework.data.domain.Sort" ]
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.*;
[ "org.springframework.data" ]
org.springframework.data;
2,159,514
protected void copy(CacheEntry cacheEntry, ServletOutputStream ostream, Iterator ranges, String contentType) throws IOException { IOException exception = null; while ( (exception == null) && (ranges.hasNext()) ) { InputStream resourceInputStream = cacheEntry.resource.streamContent(); InputStream istream = new BufferedInputStream(resourceInputStream, input); Range currentRange = (Range) ranges.next(); // Writing MIME header. ostream.println(); ostream.println("--" + mimeSeparation); if (contentType != null) ostream.println("Content-Type: " + contentType); ostream.println("Content-Range: bytes " + currentRange.start + "-" + currentRange.end + "/" + currentRange.length); ostream.println(); // Printing content exception = copyRange(istream, ostream, currentRange.start, currentRange.end); istream.close(); } ostream.println(); ostream.print("--" + mimeSeparation + "--"); // Rethrow any exception that has occurred if (exception != null) throw exception; }
void function(CacheEntry cacheEntry, ServletOutputStream ostream, Iterator ranges, String contentType) throws IOException { IOException exception = null; while ( (exception == null) && (ranges.hasNext()) ) { InputStream resourceInputStream = cacheEntry.resource.streamContent(); InputStream istream = new BufferedInputStream(resourceInputStream, input); Range currentRange = (Range) ranges.next(); ostream.println(); ostream.println("--" + mimeSeparation); if (contentType != null) ostream.println(STR + contentType); ostream.println(STR + currentRange.start + "-" + currentRange.end + "/" + currentRange.length); ostream.println(); exception = copyRange(istream, ostream, currentRange.start, currentRange.end); istream.close(); } ostream.println(); ostream.print("--" + mimeSeparation + "--"); if (exception != null) throw exception; }
/** * Copy the contents of the specified input stream to the specified * output stream, and ensure that both streams are closed before returning * (even in the face of an exception). * * @param cacheEntry Cached version of requested resource * @param ostream The output stream to write to * @param ranges Enumeration of the ranges the client wanted to retrieve * @param contentType Content type of the resource * @exception IOException if an input/output error occurs */
Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception)
copy
{ "repo_name": "plumer/codana", "path": "tomcat_files/6.0.43/DefaultServlet.java", "license": "mit", "size": 83061 }
[ "java.io.BufferedInputStream", "java.io.IOException", "java.io.InputStream", "java.util.Iterator", "javax.servlet.ServletOutputStream", "org.apache.naming.resources.CacheEntry" ]
import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; import java.util.Iterator; import javax.servlet.ServletOutputStream; import org.apache.naming.resources.CacheEntry;
import java.io.*; import java.util.*; import javax.servlet.*; import org.apache.naming.resources.*;
[ "java.io", "java.util", "javax.servlet", "org.apache.naming" ]
java.io; java.util; javax.servlet; org.apache.naming;
1,176,031
@Override public void createPartControl(Composite parent) { // Create the tool bar buttons for the view. createActions(); // Initialize the ListViewer. Disable multi-selection by specifying the // default style bits except for SWT.MULTI. fileTreeViewer = new TreeViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); fileTreeViewer.addSelectionChangedListener(this); // Create content and label providers. initializeTreeViewer(fileTreeViewer); // Register this view's ListViewer as a SelectionProvider. getSite().setSelectionProvider(fileTreeViewer); return; }
void function(Composite parent) { createActions(); fileTreeViewer = new TreeViewer(parent, SWT.H_SCROLL SWT.V_SCROLL SWT.BORDER); fileTreeViewer.addSelectionChangedListener(this); initializeTreeViewer(fileTreeViewer); getSite().setSelectionProvider(fileTreeViewer); return; }
/** * Creates the widgets and controls for the VizFileViewer. This includes * {@link #fileTreeViewer}. * * @param parent * The parent Composite that will contain this VizFileViewer. */
Creates the widgets and controls for the VizFileViewer. This includes <code>#fileTreeViewer</code>
createPartControl
{ "repo_name": "eclipse/eavp", "path": "org.eclipse.eavp.viz/src/org/eclipse/eavp/viz/VizFileViewer.java", "license": "epl-1.0", "size": 17606 }
[ "org.eclipse.jface.viewers.TreeViewer", "org.eclipse.swt.widgets.Composite" ]
import org.eclipse.jface.viewers.TreeViewer; import org.eclipse.swt.widgets.Composite;
import org.eclipse.jface.viewers.*; import org.eclipse.swt.widgets.*;
[ "org.eclipse.jface", "org.eclipse.swt" ]
org.eclipse.jface; org.eclipse.swt;
1,745,211
private HttpNegotiateAuthenticator createWithoutNative(String accountType) { HttpNegotiateAuthenticator authenticator = spy(HttpNegotiateAuthenticator.create(accountType)); doNothing().when(authenticator).nativeSetResult(anyLong(), anyInt(), anyString()); doReturn(false) .when(authenticator) .lacksPermission(any(Context.class), anyString(), anyBoolean()); return authenticator; }
HttpNegotiateAuthenticator function(String accountType) { HttpNegotiateAuthenticator authenticator = spy(HttpNegotiateAuthenticator.create(accountType)); doNothing().when(authenticator).nativeSetResult(anyLong(), anyInt(), anyString()); doReturn(false) .when(authenticator) .lacksPermission(any(Context.class), anyString(), anyBoolean()); return authenticator; }
/** * Returns a new authenticator as a spy so that we can override and intercept the native method * calls. */
Returns a new authenticator as a spy so that we can override and intercept the native method calls
createWithoutNative
{ "repo_name": "axinging/chromium-crosswalk", "path": "net/android/junit/src/org/chromium/net/HttpNegotiateAuthenticatorTest.java", "license": "bsd-3-clause", "size": 20022 }
[ "android.content.Context", "org.mockito.Matchers", "org.mockito.Mockito" ]
import android.content.Context; import org.mockito.Matchers; import org.mockito.Mockito;
import android.content.*; import org.mockito.*;
[ "android.content", "org.mockito" ]
android.content; org.mockito;
244,806
@Override public void setByteProperty(final String name, final byte value) throws JMSException { if (ActiveMQRAMessage.trace) { ActiveMQRALogger.LOGGER.trace("setByteProperty(" + name + ", " + value + ")"); } message.setByteProperty(name, value); }
void function(final String name, final byte value) throws JMSException { if (ActiveMQRAMessage.trace) { ActiveMQRALogger.LOGGER.trace(STR + name + STR + value + ")"); } message.setByteProperty(name, value); }
/** * Set property * * @param name The name * @param value The value * @throws JMSException Thrown if an error occurs */
Set property
setByteProperty
{ "repo_name": "franz1981/activemq-artemis", "path": "artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMessage.java", "license": "apache-2.0", "size": 21145 }
[ "javax.jms.JMSException" ]
import javax.jms.JMSException;
import javax.jms.*;
[ "javax.jms" ]
javax.jms;
681,817
@ServiceMethod(returns = ReturnType.SINGLE) private Mono<Response<PrivateLinkResourceInner>> getWithResponseAsync( String resourceGroupName, String serverName, String groupName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } if (groupName == null) { return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2018-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), resourceGroupName, serverName, groupName, this.client.getSubscriptionId(), apiVersion, accept, context); }
@ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<PrivateLinkResourceInner>> function( String resourceGroupName, String serverName, String groupName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (serverName == null) { return Mono.error(new IllegalArgumentException(STR)); } if (groupName == null) { return Mono.error(new IllegalArgumentException(STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( STR)); } final String apiVersion = STR; final String accept = STR; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), resourceGroupName, serverName, groupName, this.client.getSubscriptionId(), apiVersion, accept, context); }
/** * Gets a private link resource for PostgreSQL server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param groupName The name of the private link resource. * @param context The context to associate with this operation. * @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 a private link resource for PostgreSQL server along with {@link Response} on successful completion of * {@link Mono}. */
Gets a private link resource for PostgreSQL server
getWithResponseAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/PrivateLinkResourcesClientImpl.java", "license": "mit", "size": 25601 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "com.azure.core.util.Context", "com.azure.resourcemanager.postgresql.fluent.models.PrivateLinkResourceInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.postgresql.fluent.models.PrivateLinkResourceInner;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.postgresql.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,346,227
public double[] getSortedValues() { double[] sort = getValues(); Arrays.sort(sort); return sort; }
double[] function() { double[] sort = getValues(); Arrays.sort(sort); return sort; }
/** * Returns the current set of values in an array of double primitives, * sorted in ascending order. The returned array is a fresh * copy of the underlying data -- i.e., it is not a reference to the * stored data. * @return returns the current set of * numbers sorted in ascending order */
Returns the current set of values in an array of double primitives, sorted in ascending order. The returned array is a fresh copy of the underlying data -- i.e., it is not a reference to the stored data
getSortedValues
{ "repo_name": "cacheonix/cacheonix-core", "path": "3rdparty/commons-math-1.2-src/src/java/org/apache/commons/math/stat/descriptive/DescriptiveStatistics.java", "license": "lgpl-2.1", "size": 23222 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
2,475,663
public okhttp3.Call createNamespacedIngressAsync( String namespace, V1Ingress body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback<V1Ingress> _callback) throws ApiException { okhttp3.Call localVarCall = createNamespacedIngressValidateBeforeCall( namespace, body, pretty, dryRun, fieldManager, fieldValidation, _callback); Type localVarReturnType = new TypeToken<V1Ingress>() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; }
okhttp3.Call function( String namespace, V1Ingress body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback<V1Ingress> _callback) throws ApiException { okhttp3.Call localVarCall = createNamespacedIngressValidateBeforeCall( namespace, body, pretty, dryRun, fieldManager, fieldValidation, _callback); Type localVarReturnType = new TypeToken<V1Ingress>() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; }
/** * (asynchronously) create an Ingress * * @param namespace object name and auth scope, such as for teams and projects (required) * @param body (required) * @param pretty If &#39;true&#39;, then the output is pretty printed. (optional) * @param dryRun When present, indicates that modifications should not be persisted. An invalid or * unrecognized dryRun directive will result in an error response and no further processing of * the request. Valid values are: - All: all dry run stages will be processed (optional) * @param fieldManager fieldManager is a name associated with the actor or entity that is making * these changes. The value must be less than or 128 characters long, and only contain * printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) * @param fieldValidation fieldValidation determines how the server should respond to * unknown/duplicate fields in the object in the request. Introduced as alpha in 1.23, older * servers or servers with the &#x60;ServerSideFieldValidation&#x60; feature disabled will * discard valid values specified in this param and not perform any server side field * validation. Valid values are: - Ignore: ignores unknown/duplicate fields. - Warn: responds * with a warning for each unknown/duplicate field, but successfully serves the request. - * Strict: fails the request on unknown/duplicate fields. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details * <table summary="Response Details" border="1"> * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> * <tr><td> 200 </td><td> OK </td><td> - </td></tr> * <tr><td> 201 </td><td> Created </td><td> - </td></tr> * <tr><td> 202 </td><td> Accepted </td><td> - </td></tr> * <tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr> * </table> */
(asynchronously) create an Ingress
createNamespacedIngressAsync
{ "repo_name": "kubernetes-client/java", "path": "kubernetes/src/main/java/io/kubernetes/client/openapi/apis/NetworkingV1Api.java", "license": "apache-2.0", "size": 477939 }
[ "com.google.gson.reflect.TypeToken", "io.kubernetes.client.openapi.ApiCallback", "io.kubernetes.client.openapi.ApiException", "io.kubernetes.client.openapi.models.V1Ingress", "java.lang.reflect.Type" ]
import com.google.gson.reflect.TypeToken; import io.kubernetes.client.openapi.ApiCallback; import io.kubernetes.client.openapi.ApiException; import io.kubernetes.client.openapi.models.V1Ingress; import java.lang.reflect.Type;
import com.google.gson.reflect.*; import io.kubernetes.client.openapi.*; import io.kubernetes.client.openapi.models.*; import java.lang.reflect.*;
[ "com.google.gson", "io.kubernetes.client", "java.lang" ]
com.google.gson; io.kubernetes.client; java.lang;
852,402
return (queue instanceof SynchronizedQueue) ? queue : new SynchronizedQueue<E>(queue, mutex); } private static class SynchronizedObject implements Serializable { private static final long serialVersionUID = -4408866092364554628L; final Object delegate; final Object mutex; SynchronizedObject(Object delegate, @Nullable Object mutex) { this.delegate = Preconditions.checkNotNull(delegate); this.mutex = (mutex == null) ? this : mutex; }
return (queue instanceof SynchronizedQueue) ? queue : new SynchronizedQueue<E>(queue, mutex); } private static class SynchronizedObject implements Serializable { private static final long serialVersionUID = -4408866092364554628L; final Object delegate; final Object mutex; SynchronizedObject(Object delegate, @Nullable Object mutex) { this.delegate = Preconditions.checkNotNull(delegate); this.mutex = (mutex == null) ? this : mutex; }
/** * Create a synchronized wrapper for the given queue. * <p> * This wrapper cannot synchronize the iterator(). Callers are expected * to synchronize iterators manually. * @param queue - the queue to synchronize. * @param mutex - synchronization mutex, or NULL to use the queue. * @return A synchronization wrapper. */
Create a synchronized wrapper for the given queue. This wrapper cannot synchronize the iterator(). Callers are expected to synchronize iterators manually
queue
{ "repo_name": "aadnk/ProtocolLib", "path": "src/main/java/com/comphenix/protocol/async/Synchronization.java", "license": "gpl-2.0", "size": 5103 }
[ "com.google.common.base.Preconditions", "java.io.Serializable", "javax.annotation.Nullable" ]
import com.google.common.base.Preconditions; import java.io.Serializable; import javax.annotation.Nullable;
import com.google.common.base.*; import java.io.*; import javax.annotation.*;
[ "com.google.common", "java.io", "javax.annotation" ]
com.google.common; java.io; javax.annotation;
251,862
public List<Integer> getInNeighbors(int v) { List<Integer> inNeighbors = new ArrayList<Integer>(); for (int i = 0; i < getNumVertices(); i++) { for (int j = 0; j < adjMatrix[i][v]; j++) { inNeighbors.add(i); } } return inNeighbors; }
List<Integer> function(int v) { List<Integer> inNeighbors = new ArrayList<Integer>(); for (int i = 0; i < getNumVertices(); i++) { for (int j = 0; j < adjMatrix[i][v]; j++) { inNeighbors.add(i); } } return inNeighbors; }
/** * Implement the abstract method for finding all in-neighbors of a vertex. * If there are multiple edges from another vertex to this one, the neighbor * appears once in the list for each of these edges. * * @param v the index of vertex. * @return List<Integer> a list of indices of vertices. */
Implement the abstract method for finding all in-neighbors of a vertex. If there are multiple edges from another vertex to this one, the neighbor appears once in the list for each of these edges
getInNeighbors
{ "repo_name": "imdaz/UCSDGraphs", "path": "src/basicgraph/GraphAdjMatrix.java", "license": "apache-2.0", "size": 5295 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
599,910
private QuadrantAnalysis computeQa(FitResult fitResult, Rectangle regionBounds, final double[] residuals) { if (residuals == null) { final QuadrantAnalysis qa = new QuadrantAnalysis(); qa.score = -1; // Set so that any residuals threshold will be ignored. return qa; } final double[] params = fitResult.getParameters(); final int width = regionBounds.width; final int height = regionBounds.height; // Use rounding since the fit coords are not yet offset by 0.5 pixel to centre them final int cx = (int) Math.round(params[Gaussian2DFunction.X_POSITION]); final int cy = (int) Math.round(params[Gaussian2DFunction.Y_POSITION]); // Q. The primary candidate may have drifted. Should we check it is reasonably centred in the // region?. final QuadrantAnalysis qa = new QuadrantAnalysis(); qa.quadrantAnalysis(residuals, width, height, cx, cy); if (logger != null) { LoggerUtils.log(logger, Level.INFO, "Residue analysis = %f (%d,%d)", qa.score, qa.vector[0], qa.vector[1]); } return qa; }
QuadrantAnalysis function(FitResult fitResult, Rectangle regionBounds, final double[] residuals) { if (residuals == null) { final QuadrantAnalysis qa = new QuadrantAnalysis(); qa.score = -1; return qa; } final double[] params = fitResult.getParameters(); final int width = regionBounds.width; final int height = regionBounds.height; final int cx = (int) Math.round(params[Gaussian2DFunction.X_POSITION]); final int cy = (int) Math.round(params[Gaussian2DFunction.Y_POSITION]); final QuadrantAnalysis qa = new QuadrantAnalysis(); qa.quadrantAnalysis(residuals, width, height, cx, cy); if (logger != null) { LoggerUtils.log(logger, Level.INFO, STR, qa.score, qa.vector[0], qa.vector[1]); } return qa; }
/** * Perform quadrant analysis on the residuals. * * <p>Perform quadrant analysis as per rapidSTORM to analyse if the residuals of the the fit are * skewed around the single fit centre. This may indicate the result is actually two spots (a * doublet). * * @param fitResult the fit result * @param regionBounds the region bounds * @param residuals the residuals * @return the quadrant analysis */
Perform quadrant analysis on the residuals. Perform quadrant analysis as per rapidSTORM to analyse if the residuals of the the fit are skewed around the single fit centre. This may indicate the result is actually two spots (a doublet)
computeQa
{ "repo_name": "aherbert/GDSC-SMLM", "path": "src/main/java/uk/ac/sussex/gdsc/smlm/engine/FitWorker.java", "license": "gpl-3.0", "size": 191121 }
[ "java.awt.Rectangle", "java.util.logging.Level", "uk.ac.sussex.gdsc.core.logging.LoggerUtils", "uk.ac.sussex.gdsc.smlm.fitting.FitResult", "uk.ac.sussex.gdsc.smlm.function.gaussian.Gaussian2DFunction" ]
import java.awt.Rectangle; import java.util.logging.Level; import uk.ac.sussex.gdsc.core.logging.LoggerUtils; import uk.ac.sussex.gdsc.smlm.fitting.FitResult; import uk.ac.sussex.gdsc.smlm.function.gaussian.Gaussian2DFunction;
import java.awt.*; import java.util.logging.*; import uk.ac.sussex.gdsc.core.logging.*; import uk.ac.sussex.gdsc.smlm.fitting.*; import uk.ac.sussex.gdsc.smlm.function.gaussian.*;
[ "java.awt", "java.util", "uk.ac.sussex" ]
java.awt; java.util; uk.ac.sussex;
1,729,553
Collection<File> getFolders();
Collection<File> getFolders();
/** * This method returns the {@link java.util.Collection} of Folders * * @return a list of contained Folders */
This method returns the <code>java.util.Collection</code> of Folders
getFolders
{ "repo_name": "OpenLiberty/open-liberty", "path": "dev/com.ibm.ws.classloading/src/com/ibm/wsspi/library/Library.java", "license": "epl-1.0", "size": 2207 }
[ "java.io.File", "java.util.Collection" ]
import java.io.File; import java.util.Collection;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,716,060
public Builder setDeviceLostModeDate(Date deviceLostModeDate) { this.deviceLostModeDate = deviceLostModeDate; return this; }
Builder function(Date deviceLostModeDate) { this.deviceLostModeDate = deviceLostModeDate; return this; }
/** * Date this device was reported lost or stolen. Don't send if you don't have it. * * @param deviceLostModeDate time in ISO 8601 format "yyyy-MM-dd'T'HH:mm:ss.SSSZ" * @return this */
Date this device was reported lost or stolen. Don't send if you don't have it
setDeviceLostModeDate
{ "repo_name": "fitpay/fitpay-android-sdk", "path": "fitpay/src/main/java/com/fitpay/android/webview/models/IdVerification.java", "license": "mit", "size": 16757 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
453,906
void enterModifier(@NotNull JavaParser.ModifierContext ctx); void exitModifier(@NotNull JavaParser.ModifierContext ctx);
void enterModifier(@NotNull JavaParser.ModifierContext ctx); void exitModifier(@NotNull JavaParser.ModifierContext ctx);
/** * Exit a parse tree produced by {@link JavaParser#modifier}. * @param ctx the parse tree */
Exit a parse tree produced by <code>JavaParser#modifier</code>
exitModifier
{ "repo_name": "zmughal/oop-analysis", "path": "src/generated-sources/JavaListener.java", "license": "apache-2.0", "size": 38949 }
[ "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;
798,783
@NotNull public static PsiClassType getJavaLangThrowable(@NotNull PsiManager manager, @NotNull GlobalSearchScope resolveScope) { return getTypeByName(CommonClassNames.JAVA_LANG_THROWABLE, manager.getProject(), resolveScope); }
static PsiClassType function(@NotNull PsiManager manager, @NotNull GlobalSearchScope resolveScope) { return getTypeByName(CommonClassNames.JAVA_LANG_THROWABLE, manager.getProject(), resolveScope); }
/** * Returns the class type for the java.lang.Throwable class. * * @param manager the PSI manager used to create the class type. * @param resolveScope the scope in which the class is searched. * @return the class instance. */
Returns the class type for the java.lang.Throwable class
getJavaLangThrowable
{ "repo_name": "michaelgallacher/intellij-community", "path": "java/java-psi-api/src/com/intellij/psi/PsiType.java", "license": "apache-2.0", "size": 12834 }
[ "com.intellij.psi.search.GlobalSearchScope", "org.jetbrains.annotations.NotNull" ]
import com.intellij.psi.search.GlobalSearchScope; import org.jetbrains.annotations.NotNull;
import com.intellij.psi.search.*; import org.jetbrains.annotations.*;
[ "com.intellij.psi", "org.jetbrains.annotations" ]
com.intellij.psi; org.jetbrains.annotations;
45,435
public void setFqeService(final FqeService fqeService) { this.fqeService = fqeService; }
void function(final FqeService fqeService) { this.fqeService = fqeService; }
/** * Set a new value for the fqeService property. * * @param fqeService * the fqeService to set */
Set a new value for the fqeService property
setFqeService
{ "repo_name": "openfurther/further-open-core", "path": "fqe/fqe-ws/src/main/java/edu/utah/further/fqe/ws/FqeServiceRestImpl.java", "license": "apache-2.0", "size": 28626 }
[ "edu.utah.further.fqe.api.service.route.FqeService" ]
import edu.utah.further.fqe.api.service.route.FqeService;
import edu.utah.further.fqe.api.service.route.*;
[ "edu.utah.further" ]
edu.utah.further;
585,827
WaterDisconnectionResponseDTO getConnectionsAvailableForDisConnection( WaterDeconnectionRequestDTO requestDTO);
WaterDisconnectionResponseDTO getConnectionsAvailableForDisConnection( WaterDeconnectionRequestDTO requestDTO);
/** * Gets the connection details. * * @param requestDTO the request dto * @return the connection details */
Gets the connection details
getConnectionsAvailableForDisConnection
{ "repo_name": "abmindiarepomanager/ABMOpenMainet", "path": "Mainet1.1/MainetServiceParent/MainetServiceWater/src/main/java/com/abm/mainet/water/service/WaterDisconnectionService.java", "license": "gpl-3.0", "size": 2796 }
[ "com.abm.mainet.water.dto.WaterDeconnectionRequestDTO", "com.abm.mainet.water.dto.WaterDisconnectionResponseDTO" ]
import com.abm.mainet.water.dto.WaterDeconnectionRequestDTO; import com.abm.mainet.water.dto.WaterDisconnectionResponseDTO;
import com.abm.mainet.water.dto.*;
[ "com.abm.mainet" ]
com.abm.mainet;
2,780,522
@Override public List<String> listHosts() { try { // TODO (dano): only return hosts whose agents completed registration (i.e. has id nodes) return provider.get("listHosts").getChildren(Paths.configHosts()); } catch (KeeperException.NoNodeException e) { return emptyList(); } catch (KeeperException e) { throw new HeliosRuntimeException("listing hosts failed", e); } }
List<String> function() { try { return provider.get(STR).getChildren(Paths.configHosts()); } catch (KeeperException.NoNodeException e) { return emptyList(); } catch (KeeperException e) { throw new HeliosRuntimeException(STR, e); } }
/** * Returns a list of the hosts/agents that have been registered. */
Returns a list of the hosts/agents that have been registered
listHosts
{ "repo_name": "molindo/helios", "path": "helios-services/src/main/java/com/spotify/helios/master/ZooKeeperMasterModel.java", "license": "apache-2.0", "size": 67415 }
[ "com.spotify.helios.common.HeliosRuntimeException", "com.spotify.helios.servicescommon.coordination.Paths", "java.util.Collections", "java.util.List", "org.apache.zookeeper.KeeperException" ]
import com.spotify.helios.common.HeliosRuntimeException; import com.spotify.helios.servicescommon.coordination.Paths; import java.util.Collections; import java.util.List; import org.apache.zookeeper.KeeperException;
import com.spotify.helios.common.*; import com.spotify.helios.servicescommon.coordination.*; import java.util.*; import org.apache.zookeeper.*;
[ "com.spotify.helios", "java.util", "org.apache.zookeeper" ]
com.spotify.helios; java.util; org.apache.zookeeper;
1,458,983
DependencyConstraint platform(Object notation, Action<? super DependencyConstraint> configureAction);
DependencyConstraint platform(Object notation, Action<? super DependencyConstraint> configureAction);
/** * Declares a constraint on a platform. If the target coordinates represent multiple * potential components, the platform component will be selected, instead of the library. * * @param notation the coordinates of the platform * @param configureAction the dependency configuration block * * @since 5.0 */
Declares a constraint on a platform. If the target coordinates represent multiple potential components, the platform component will be selected, instead of the library
platform
{ "repo_name": "robinverduijn/gradle", "path": "subprojects/core-api/src/main/java/org/gradle/api/artifacts/dsl/DependencyConstraintHandler.java", "license": "apache-2.0", "size": 4384 }
[ "org.gradle.api.Action", "org.gradle.api.artifacts.DependencyConstraint" ]
import org.gradle.api.Action; import org.gradle.api.artifacts.DependencyConstraint;
import org.gradle.api.*; import org.gradle.api.artifacts.*;
[ "org.gradle.api" ]
org.gradle.api;
2,407,569
@SmallTest public void testDidDeferAfterResponseStartedCalled() throws Throwable { ContentShellActivity activity = launchContentShellWithUrl(URL_1); waitForActiveShellToBeDoneLoading(); ContentViewCore contentViewCore = activity.getActiveContentViewCore(); TestCallbackHelperContainer testCallbackHelperContainer = new TestCallbackHelperContainer(contentViewCore); contentViewCore.getWebContents().setHasPendingNavigationTransitionForTesting(); TestNavigationTransitionDelegate delegate = new TestNavigationTransitionDelegate( contentViewCore, true); contentViewCore.getWebContents().setNavigationTransitionDelegate(delegate); loadUrl(contentViewCore, testCallbackHelperContainer, new LoadUrlParams(URL_1)); assertTrue("didDeferAfterResponseStarted called.", delegate.getDidCallDefer()); }
void function() throws Throwable { ContentShellActivity activity = launchContentShellWithUrl(URL_1); waitForActiveShellToBeDoneLoading(); ContentViewCore contentViewCore = activity.getActiveContentViewCore(); TestCallbackHelperContainer testCallbackHelperContainer = new TestCallbackHelperContainer(contentViewCore); contentViewCore.getWebContents().setHasPendingNavigationTransitionForTesting(); TestNavigationTransitionDelegate delegate = new TestNavigationTransitionDelegate( contentViewCore, true); contentViewCore.getWebContents().setNavigationTransitionDelegate(delegate); loadUrl(contentViewCore, testCallbackHelperContainer, new LoadUrlParams(URL_1)); assertTrue(STR, delegate.getDidCallDefer()); }
/** * Tests that the listener recieves DidDeferAfterResponseStarted if we specify that * the transition is handled. */
Tests that the listener recieves DidDeferAfterResponseStarted if we specify that the transition is handled
testDidDeferAfterResponseStartedCalled
{ "repo_name": "hgl888/chromium-crosswalk-efl", "path": "content/public/android/javatests/src/org/chromium/content/browser/TransitionTest.java", "license": "bsd-3-clause", "size": 13207 }
[ "org.chromium.content.browser.test.util.TestCallbackHelperContainer", "org.chromium.content_public.browser.LoadUrlParams", "org.chromium.content_shell_apk.ContentShellActivity" ]
import org.chromium.content.browser.test.util.TestCallbackHelperContainer; import org.chromium.content_public.browser.LoadUrlParams; import org.chromium.content_shell_apk.ContentShellActivity;
import org.chromium.content.browser.test.util.*; import org.chromium.content_public.browser.*; import org.chromium.content_shell_apk.*;
[ "org.chromium.content", "org.chromium.content_public", "org.chromium.content_shell_apk" ]
org.chromium.content; org.chromium.content_public; org.chromium.content_shell_apk;
676,803
// begin method onAccountCreated private static void onAccountCreated( Account newAccount, Activity activity ) { Log.d( LOG_TAG, "onAccountCreated() called with: newAccount = [" + newAccount + "], activity = [" + activity + "]" ); // 0. configure the periodic sync // 1. enable the periodic sync // 2. kick off a sync to get things started // 0. configure the periodic sync MoviesSyncAdapter.configurePeriodicSync( activity, SYNC_INTERVAL, SYNC_FLEXTIME ); // 1. enable the periodic sync // setSyncAutomatically - Set whether or not the provider is synced // when it receives a network tickle. // a tickle tells the app that there is some new data. // the app then decides whether or not to fetch that data. // http://android-developers.blogspot.co.ke/2010/05/android-cloud-to-device-messaging.html ContentResolver.setSyncAutomatically( newAccount, activity.getString( R.string.movies_provider_content_authority ), true ); // 2. kick off a sync to get things started MoviesSyncAdapter.syncImmediately( activity ); } // end method onAccountCreated /** * Helper method to schedule the sync adapter's periodic execution. * * @param activity The {@link Activity} we will be working in * @param syncInterval The time interval in seconds between successive syncs * @param flexTime The amount of flex time in seconds before {@param syncInterval}
static void function( Account newAccount, Activity activity ) { Log.d( LOG_TAG, STR + newAccount + STR + activity + "]" ); MoviesSyncAdapter.configurePeriodicSync( activity, SYNC_INTERVAL, SYNC_FLEXTIME ); ContentResolver.setSyncAutomatically( newAccount, activity.getString( R.string.movies_provider_content_authority ), true ); MoviesSyncAdapter.syncImmediately( activity ); } /** * Helper method to schedule the sync adapter's periodic execution. * * @param activity The {@link Activity} we will be working in * @param syncInterval The time interval in seconds between successive syncs * @param flexTime The amount of flex time in seconds before {@param syncInterval}
/** * Handles some things that need to be done after an account has been created. * * More specifically, after an account is created, * a periodic sync should be configured, enabled, and started. * * @param newAccount The newly-created {@link Account}. * @param activity The {@link Activity} where this method is running. * */
Handles some things that need to be done after an account has been created. More specifically, after an account is created, a periodic sync should be configured, enabled, and started
onAccountCreated
{ "repo_name": "joshua-kairu/popmov-stage-2", "path": "app/src/main/java/com/joslittho/popmov/sync/MoviesSyncAdapter.java", "license": "gpl-3.0", "size": 32877 }
[ "android.accounts.Account", "android.app.Activity", "android.content.ContentResolver", "android.util.Log" ]
import android.accounts.Account; import android.app.Activity; import android.content.ContentResolver; import android.util.Log;
import android.accounts.*; import android.app.*; import android.content.*; import android.util.*;
[ "android.accounts", "android.app", "android.content", "android.util" ]
android.accounts; android.app; android.content; android.util;
2,536,213
@javax.annotation.Nullable @ApiModelProperty( value = "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") public String getKind() { return kind; }
@javax.annotation.Nullable @ApiModelProperty( value = "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https: String function() { return kind; }
/** * Kind is a string value representing the REST resource this object represents. Servers may infer * this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More * info: * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds * * @return kind */
Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: HREF
getKind
{ "repo_name": "kubernetes-client/java", "path": "kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1LimitRange.java", "license": "apache-2.0", "size": 5717 }
[ "io.swagger.annotations.ApiModelProperty" ]
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.*;
[ "io.swagger.annotations" ]
io.swagger.annotations;
2,537,007
void sendGlobalEvent(String event, GeckoBundle data);
void sendGlobalEvent(String event, GeckoBundle data);
/** * Sends an event to the global EventDispatcher instance. * * @param event The event type * @param data Data associated with the event */
Sends an event to the global EventDispatcher instance
sendGlobalEvent
{ "repo_name": "Yukarumya/Yukarum-Redfoxes", "path": "mobile/android/tests/browser/robocop/src/org/mozilla/gecko/Actions.java", "license": "mpl-2.0", "size": 5977 }
[ "org.mozilla.gecko.util.GeckoBundle" ]
import org.mozilla.gecko.util.GeckoBundle;
import org.mozilla.gecko.util.*;
[ "org.mozilla.gecko" ]
org.mozilla.gecko;
649,555
public Date getUpdated() { return _updated; }
Date function() { return _updated; }
/** * Returns the updated * <p> * @return Returns the updated. * @since Atom 1.0 */
Returns the updated
getUpdated
{ "repo_name": "Norkart/NK-VirtualGlobe", "path": "georss/rome-0.9/src/java/com/sun/syndication/feed/atom/Feed.java", "license": "gpl-2.0", "size": 12470 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
2,251,950
CassandraDriverConnection getConnection() throws ResourceException;
CassandraDriverConnection getConnection() throws ResourceException;
/** * Get connection from factory * * @return CassandraDriverConnection instance * @exception ResourceException Thrown if a connection can't be obtained */
Get connection from factory
getConnection
{ "repo_name": "jpkrohling/cassandra-driver-ra", "path": "resource-adapter/src/main/java/org/jboss/cassandra/ra/CassandraDriverConnectionFactory.java", "license": "apache-2.0", "size": 1595 }
[ "javax.resource.ResourceException" ]
import javax.resource.ResourceException;
import javax.resource.*;
[ "javax.resource" ]
javax.resource;
340,913
public void testSetSubjectPublicKeyAlgID() throws Exception { String pkaid1 = "1.2.840.113549.1.1.1"; // RSA (source: http://asn1.elibel.tm.fr) String pkaid2 = "1.2.840.10040.4.1"; // DSA (source: http://asn1.elibel.tm.fr) PublicKey pkey1 = new TestKeyPair("RSA").getPublic(); PublicKey pkey2 = new TestKeyPair("DSA").getPublic(); TestCert cert_1 = new TestCert(pkey1); TestCert cert_2 = new TestCert(pkey2); X509CertSelector selector = new X509CertSelector(); selector.setSubjectPublicKeyAlgID(null); assertTrue("Any certificate should match in the case of null " + "subjectPublicKeyAlgID criteria.", selector.match(cert_1) && selector.match(cert_2)); selector.setSubjectPublicKeyAlgID(pkaid1); assertTrue("The certificate should match the selection criteria.", selector.match(cert_1)); assertFalse("The certificate should not match the selection criteria.", selector.match(cert_2)); selector.setSubjectPublicKeyAlgID(pkaid2); assertTrue("The certificate should match the selection criteria.", selector.match(cert_2)); }
void function() throws Exception { String pkaid1 = STR; String pkaid2 = STR; PublicKey pkey1 = new TestKeyPair("RSA").getPublic(); PublicKey pkey2 = new TestKeyPair("DSA").getPublic(); TestCert cert_1 = new TestCert(pkey1); TestCert cert_2 = new TestCert(pkey2); X509CertSelector selector = new X509CertSelector(); selector.setSubjectPublicKeyAlgID(null); assertTrue(STR + STR, selector.match(cert_1) && selector.match(cert_2)); selector.setSubjectPublicKeyAlgID(pkaid1); assertTrue(STR, selector.match(cert_1)); assertFalse(STR, selector.match(cert_2)); selector.setSubjectPublicKeyAlgID(pkaid2); assertTrue(STR, selector.match(cert_2)); }
/** * setSubjectPublicKeyAlgID(String oid) method testing. * Tests if any certificates match in the case of null criteria, * if [not]proper certificates [do not]match */
setSubjectPublicKeyAlgID(String oid) method testing. Tests if any certificates match in the case of null criteria, if [not]proper certificates [do not]match
testSetSubjectPublicKeyAlgID
{ "repo_name": "freeVM/freeVM", "path": "enhanced/java/classlib/modules/security/src/test/impl/java.injected/java/security/cert/X509CertSelectorTest.java", "license": "apache-2.0", "size": 133766 }
[ "java.security.PublicKey", "org.apache.harmony.security.tests.support.TestKeyPair" ]
import java.security.PublicKey; import org.apache.harmony.security.tests.support.TestKeyPair;
import java.security.*; import org.apache.harmony.security.tests.support.*;
[ "java.security", "org.apache.harmony" ]
java.security; org.apache.harmony;
2,637,228
@JsonProperty("uri") public void setUri(final String uri) { this.uri = uri; }
@JsonProperty("uri") void function(final String uri) { this.uri = uri; }
/** * Linked spending information * <p> * A URI pointing directly to a machine-readable record about this spending transaction. * * @param uri * The uri */
Linked spending information A URI pointing directly to a machine-readable record about this spending transaction
setUri
{ "repo_name": "devgateway/ocvn", "path": "persistence-mongodb/src/main/java/org/devgateway/ocds/persistence/mongo/Transaction.java", "license": "mit", "size": 8164 }
[ "com.fasterxml.jackson.annotation.JsonProperty" ]
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.*;
[ "com.fasterxml.jackson" ]
com.fasterxml.jackson;
1,662,044
public void loadContent() { // HUD: create the text content of the hud fontTimeHUD = graphicDevice.createSpriteFont(null, 14); // font size of the time texts: 14px; fontStartHUD = graphicDevice.createSpriteFont(null, 28); // font size of the start texts: 24px: fontAccident = graphicDevice.createSpriteFont(null, 24); // font size of the accident texts: 24px; fontCrashHUD = graphicDevice.createSpriteFont(null, 18); // font size of the crash texts: 20px; // TIMER HUD // create text buffer for all time elements textTimeHUD = new TextBuffer[] { // create textbuffer object graphicDevice.createTextBuffer(fontTimeHUD, 16), // space for INHALT "00:" graphicDevice.createTextBuffer(fontTimeHUD, 10) // space for INHALT "TIME ELAPSED" }; // define time strings textTimeHUD[0].setText("00:"); // Text: "00:" textTimeHUD[1].setText("00:00"); // Text: time elapsed // START HUD // create text buffer for all start strings textStartHUD = new TextBuffer[] { graphicDevice.createTextBuffer(fontStartHUD, 8), // space for INHALT "READY?" graphicDevice.createTextBuffer(fontStartHUD, 5), // space for INHALT "SET!" graphicDevice.createTextBuffer(fontStartHUD, 5) // space for INAHLT "GO!" }; // start strings textStartHUD[0].setText("Ready?"); textStartHUD[1].setText("Set"); textStartHUD[2].setText("GO!!"); // CRASH HUD // text buffer for all crash elements in the hud textCrashHUD = new TextBuffer[] { graphicDevice.createTextBuffer(fontAccident, 10), // space for Inhalt "CRASH!" graphicDevice.createTextBuffer(fontCrashHUD, 8), // space for INHALT "Time:" graphicDevice.createTextBuffer(fontCrashHUD, 8), // space for INHALT "<timeElapsed>" graphicDevice.createTextBuffer(fontCrashHUD, 12), // space for INHALT "Best Time:" graphicDevice.createTextBuffer(fontCrashHUD, 8), // space for INHALT "RESTART" - Button graphicDevice.createTextBuffer(fontCrashHUD, 5) // space for INHALT "Menu" - Button }; // extra buffer for best time textCrashHUDBest = new TextBuffer[] { graphicDevice.createTextBuffer(fontCrashHUD, 8) }; // define crash strings textCrashHUD[0].setText("ACCIDENT"); textCrashHUD[1].setText("Time:"); textCrashHUD[2].setText(""); textCrashHUD[3].setText("Best Time:"); textCrashHUD[4].setText("Restart"); textCrashHUD[5].setText("Menu"); }
void function() { fontTimeHUD = graphicDevice.createSpriteFont(null, 14); fontStartHUD = graphicDevice.createSpriteFont(null, 28); fontAccident = graphicDevice.createSpriteFont(null, 24); fontCrashHUD = graphicDevice.createSpriteFont(null, 18); textTimeHUD = new TextBuffer[] { graphicDevice.createTextBuffer(fontTimeHUD, 16), graphicDevice.createTextBuffer(fontTimeHUD, 10) }; textTimeHUD[0].setText("00:"); textTimeHUD[1].setText("00:00"); textStartHUD = new TextBuffer[] { graphicDevice.createTextBuffer(fontStartHUD, 8), graphicDevice.createTextBuffer(fontStartHUD, 5), graphicDevice.createTextBuffer(fontStartHUD, 5) }; textStartHUD[0].setText(STR); textStartHUD[1].setText("Set"); textStartHUD[2].setText("GO!!"); textCrashHUD = new TextBuffer[] { graphicDevice.createTextBuffer(fontAccident, 10), graphicDevice.createTextBuffer(fontCrashHUD, 8), graphicDevice.createTextBuffer(fontCrashHUD, 8), graphicDevice.createTextBuffer(fontCrashHUD, 12), graphicDevice.createTextBuffer(fontCrashHUD, 8), graphicDevice.createTextBuffer(fontCrashHUD, 5) }; textCrashHUDBest = new TextBuffer[] { graphicDevice.createTextBuffer(fontCrashHUD, 8) }; textCrashHUD[0].setText(STR); textCrashHUD[1].setText("Time:"); textCrashHUD[2].setText(STRBest Time:STRRestartSTRMenu"); }
/** * This method loads the required content of all kinds of huds in the game. */
This method loads the required content of all kinds of huds in the game
loadContent
{ "repo_name": "Anntex/aCARdeRUN", "path": "aCARdeRun/src/de/hdm/mib/dg041/game/HUD.java", "license": "apache-2.0", "size": 15416 }
[ "de.hdm.mib.dg041.graphics.TextBuffer" ]
import de.hdm.mib.dg041.graphics.TextBuffer;
import de.hdm.mib.dg041.graphics.*;
[ "de.hdm.mib" ]
de.hdm.mib;
119,089
Optional<Fluid> drain(boolean doDrain);
Optional<Fluid> drain(boolean doDrain);
/** * Attempt to drain the block. This method should be called by devices such as pumps. * * NOTE: The block is intended to handle its own state changes. * * @param doDrain If false, the drain will only be simulated. * @return */
Attempt to drain the block. This method should be called by devices such as pumps
drain
{ "repo_name": "halvors/NOVA-Fluid", "path": "src/main/java/nova/fluid/FluidBlock.java", "license": "lgpl-3.0", "size": 540 }
[ "java.util.Optional" ]
import java.util.Optional;
import java.util.*;
[ "java.util" ]
java.util;
1,490,460
public ProcessTerminator getOCRTimeoutTerminator() { return ocrTimedTerminator; }
ProcessTerminator function() { return ocrTimedTerminator; }
/** * Returns a ProcessTerminator for timing out the OCR process. * * @return ProcessTerminator instance. */
Returns a ProcessTerminator for timing out the OCR process
getOCRTimeoutTerminator
{ "repo_name": "eugene7646/autopsy", "path": "Core/src/org/sleuthkit/autopsy/textextractors/configs/ImageConfig.java", "license": "apache-2.0", "size": 2587 }
[ "org.sleuthkit.autopsy.coreutils.ExecUtil" ]
import org.sleuthkit.autopsy.coreutils.ExecUtil;
import org.sleuthkit.autopsy.coreutils.*;
[ "org.sleuthkit.autopsy" ]
org.sleuthkit.autopsy;
449,687
@Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest httpRequest = (HttpServletRequest) request; HttpServletResponse httpResponse = (HttpServletResponse) response; // Retrieve "username" session attribute final Object usernameAtt = httpRequest.getSession().getAttribute(USERNAME_SESSION_ATT); // Authenticated if (usernameAtt != null && usernameAtt instanceof String) // Redirect to next requested chain element chain.doFilter(request, response); else // Redirect to login page httpResponse.sendRedirect(httpRequest.getContextPath() + LOGIN_SERVLET); }
void function(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest httpRequest = (HttpServletRequest) request; HttpServletResponse httpResponse = (HttpServletResponse) response; final Object usernameAtt = httpRequest.getSession().getAttribute(USERNAME_SESSION_ATT); if (usernameAtt != null && usernameAtt instanceof String) chain.doFilter(request, response); else httpResponse.sendRedirect(httpRequest.getContextPath() + LOGIN_SERVLET); }
/** * Filter requested url bind on /auth/*... * * @param request * servlet request * @param response * servlet response * @throws ServletException * if a servlet-specific error occurs * @throws IOException * if an I/O error occurs * @see Filter#doFilter(ServletRequest, ServletResponse, FilterChain) */
Filter requested url bind on /auth/*..
doFilter
{ "repo_name": "MrLowkos/3JVA-SupCommerce-3-4", "path": "src/com/supinfo/supcommerce/filter/AuthenticateFilter.java", "license": "mit", "size": 2212 }
[ "java.io.IOException", "javax.servlet.FilterChain", "javax.servlet.ServletException", "javax.servlet.ServletRequest", "javax.servlet.ServletResponse", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse" ]
import java.io.IOException; import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
import java.io.*; import javax.servlet.*; import javax.servlet.http.*;
[ "java.io", "javax.servlet" ]
java.io; javax.servlet;
916,531
EReference getModelTurbsimtbs_WrADFF();
EReference getModelTurbsimtbs_WrADFF();
/** * Returns the meta object for the containment reference '{@link sc.ndt.editor.turbsimtbs.ModelTurbsimtbs#getWrADFF <em>Wr ADFF</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the containment reference '<em>Wr ADFF</em>'. * @see sc.ndt.editor.turbsimtbs.ModelTurbsimtbs#getWrADFF() * @see #getModelTurbsimtbs() * @generated */
Returns the meta object for the containment reference '<code>sc.ndt.editor.turbsimtbs.ModelTurbsimtbs#getWrADFF Wr ADFF</code>'.
getModelTurbsimtbs_WrADFF
{ "repo_name": "cooked/NDT", "path": "sc.ndt.editor.turbsim.tbs/src-gen/sc/ndt/editor/turbsimtbs/TurbsimtbsPackage.java", "license": "gpl-3.0", "size": 204585 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
786,061
public Vertex addVertex(final Object id) { final Vertex vertex = this.baseGraph.addVertex(id); if (vertex == null) { return null; } else { this.onVertexAdded(vertex); return new EventVertex(vertex, this); } }
Vertex function(final Object id) { final Vertex vertex = this.baseGraph.addVertex(id); if (vertex == null) { return null; } else { this.onVertexAdded(vertex); return new EventVertex(vertex, this); } }
/** * Raises a vertexAdded event. */
Raises a vertexAdded event
addVertex
{ "repo_name": "OpenNTF/org.openntf.domino", "path": "domino/externals/tinkerpop/src/main/java/com/tinkerpop/blueprints/util/wrappers/event/EventGraph.java", "license": "apache-2.0", "size": 7475 }
[ "com.tinkerpop.blueprints.Vertex" ]
import com.tinkerpop.blueprints.Vertex;
import com.tinkerpop.blueprints.*;
[ "com.tinkerpop.blueprints" ]
com.tinkerpop.blueprints;
1,496,010
@Test public void testMsSqlServer3() { Assert.assertEquals("A500", this.getStringEncoder().encode("Ann")); Assert.assertEquals("A536", this.getStringEncoder().encode("Andrew")); Assert.assertEquals("J530", this.getStringEncoder().encode("Janet")); Assert.assertEquals("M626", this.getStringEncoder().encode("Margaret")); Assert.assertEquals("S315", this.getStringEncoder().encode("Steven")); Assert.assertEquals("M240", this.getStringEncoder().encode("Michael")); Assert.assertEquals("R163", this.getStringEncoder().encode("Robert")); Assert.assertEquals("L600", this.getStringEncoder().encode("Laura")); Assert.assertEquals("A500", this.getStringEncoder().encode("Anne")); }
void function() { Assert.assertEquals("A500", this.getStringEncoder().encode("Ann")); Assert.assertEquals("A536", this.getStringEncoder().encode(STR)); Assert.assertEquals("J530", this.getStringEncoder().encode("Janet")); Assert.assertEquals("M626", this.getStringEncoder().encode(STR)); Assert.assertEquals("S315", this.getStringEncoder().encode(STR)); Assert.assertEquals("M240", this.getStringEncoder().encode(STR)); Assert.assertEquals("R163", this.getStringEncoder().encode(STR)); Assert.assertEquals("L600", this.getStringEncoder().encode("Laura")); Assert.assertEquals("A500", this.getStringEncoder().encode("Anne")); }
/** * Examples for MS SQLServer from http://databases.about.com/library/weekly/aa042901a.htm */
Examples for MS SQLServer from HREF
testMsSqlServer3
{ "repo_name": "886rs/commons-codec-1.10-src", "path": "src/test/java/org/apache/commons/codec/language/SoundexTest.java", "license": "apache-2.0", "size": 15372 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
105,496
public Iterable<Artifact> getAdditionalHdrs() { return additionalHdrs; }
Iterable<Artifact> function() { return additionalHdrs; }
/** * Returns the public headers that aren't included in the hdrs attribute. */
Returns the public headers that aren't included in the hdrs attribute
getAdditionalHdrs
{ "repo_name": "Digas29/bazel", "path": "src/main/java/com/google/devtools/build/lib/rules/objc/CompilationArtifacts.java", "license": "apache-2.0", "size": 5574 }
[ "com.google.devtools.build.lib.actions.Artifact" ]
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.actions.*;
[ "com.google.devtools" ]
com.google.devtools;
2,714,435
public static LazyBinaryPrimitive<?, ?> createLazyBinaryPrimitiveClass( PrimitiveObjectInspector oi) { PrimitiveCategory p = oi.getPrimitiveCategory(); switch (p) { case BOOLEAN: return new LazyBinaryBoolean((WritableBooleanObjectInspector) oi); case BYTE: return new LazyBinaryByte((WritableByteObjectInspector) oi); case SHORT: return new LazyBinaryShort((WritableShortObjectInspector) oi); case INT: return new LazyBinaryInteger((WritableIntObjectInspector) oi); case LONG: return new LazyBinaryLong((WritableLongObjectInspector) oi); case FLOAT: return new LazyBinaryFloat((WritableFloatObjectInspector) oi); case DOUBLE: return new LazyBinaryDouble((WritableDoubleObjectInspector) oi); case STRING: return new LazyBinaryString((WritableStringObjectInspector) oi); case CHAR: return new LazyBinaryHiveChar((WritableHiveCharObjectInspector) oi); case VARCHAR: return new LazyBinaryHiveVarchar((WritableHiveVarcharObjectInspector) oi); case VOID: // for NULL return new LazyBinaryVoid((WritableVoidObjectInspector) oi); case DATE: return new LazyBinaryDate((WritableDateObjectInspector) oi); case TIMESTAMP: return new LazyBinaryTimestamp((WritableTimestampObjectInspector) oi); case BINARY: return new LazyBinaryBinary((WritableBinaryObjectInspector) oi); case DECIMAL: return new LazyBinaryHiveDecimal((WritableHiveDecimalObjectInspector) oi); default: throw new RuntimeException("Internal error: no LazyBinaryObject for " + p); } }
static LazyBinaryPrimitive<?, ?> function( PrimitiveObjectInspector oi) { PrimitiveCategory p = oi.getPrimitiveCategory(); switch (p) { case BOOLEAN: return new LazyBinaryBoolean((WritableBooleanObjectInspector) oi); case BYTE: return new LazyBinaryByte((WritableByteObjectInspector) oi); case SHORT: return new LazyBinaryShort((WritableShortObjectInspector) oi); case INT: return new LazyBinaryInteger((WritableIntObjectInspector) oi); case LONG: return new LazyBinaryLong((WritableLongObjectInspector) oi); case FLOAT: return new LazyBinaryFloat((WritableFloatObjectInspector) oi); case DOUBLE: return new LazyBinaryDouble((WritableDoubleObjectInspector) oi); case STRING: return new LazyBinaryString((WritableStringObjectInspector) oi); case CHAR: return new LazyBinaryHiveChar((WritableHiveCharObjectInspector) oi); case VARCHAR: return new LazyBinaryHiveVarchar((WritableHiveVarcharObjectInspector) oi); case VOID: return new LazyBinaryVoid((WritableVoidObjectInspector) oi); case DATE: return new LazyBinaryDate((WritableDateObjectInspector) oi); case TIMESTAMP: return new LazyBinaryTimestamp((WritableTimestampObjectInspector) oi); case BINARY: return new LazyBinaryBinary((WritableBinaryObjectInspector) oi); case DECIMAL: return new LazyBinaryHiveDecimal((WritableHiveDecimalObjectInspector) oi); default: throw new RuntimeException(STR + p); } }
/** * Create a lazy binary primitive class given the type name. */
Create a lazy binary primitive class given the type name
createLazyBinaryPrimitiveClass
{ "repo_name": "winningsix/hive", "path": "serde/src/java/org/apache/hadoop/hive/serde2/lazybinary/LazyBinaryFactory.java", "license": "apache-2.0", "size": 6213 }
[ "org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector", "org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableBinaryObjectInspector", "org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableBooleanObjectInspector", "org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableByteObjectInspector", "org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableDateObjectInspector", "org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableDoubleObjectInspector", "org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableFloatObjectInspector", "org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableHiveCharObjectInspector", "org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableHiveDecimalObjectInspector", "org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableHiveVarcharObjectInspector", "org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableIntObjectInspector", "org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableLongObjectInspector", "org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableShortObjectInspector", "org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableStringObjectInspector", "org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableTimestampObjectInspector", "org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableVoidObjectInspector" ]
import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableBinaryObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableBooleanObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableByteObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableDateObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableDoubleObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableFloatObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableHiveCharObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableHiveDecimalObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableHiveVarcharObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableIntObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableLongObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableShortObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableStringObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableTimestampObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableVoidObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.*; import org.apache.hadoop.hive.serde2.objectinspector.primitive.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,670,096
public Map<String, Cvss> cvss() { return this.cvss; }
Map<String, Cvss> function() { return this.cvss; }
/** * Get the cvss property: Dictionary from cvss version to cvss details object. * * @return the cvss value. */
Get the cvss property: Dictionary from cvss version to cvss details object
cvss
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityProperties.java", "license": "mit", "size": 4323 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
480,129
@SuppressWarnings("unchecked") public List<PersonalFile> getRootFiles(Long userId) { Query q = hbCrudDAO.getSessionFactory().getCurrentSession().getNamedQuery("getRootFiles"); q.setParameter("userId", userId); return q.list(); }
@SuppressWarnings(STR) List<PersonalFile> function(Long userId) { Query q = hbCrudDAO.getSessionFactory().getCurrentSession().getNamedQuery(STR); q.setParameter(STR, userId); return q.list(); }
/** * Get the root files - at the user level * * @param userId - id of the user to get the root files for * * @return the found files at the root user level */
Get the root files - at the user level
getRootFiles
{ "repo_name": "nate-rcl/irplus", "path": "ir_hibernate/src/edu/ur/hibernate/ir/user/db/HbPersonalFileDAO.java", "license": "apache-2.0", "size": 7275 }
[ "edu.ur.ir.user.PersonalFile", "java.util.List", "org.hibernate.Query" ]
import edu.ur.ir.user.PersonalFile; import java.util.List; import org.hibernate.Query;
import edu.ur.ir.user.*; import java.util.*; import org.hibernate.*;
[ "edu.ur.ir", "java.util", "org.hibernate" ]
edu.ur.ir; java.util; org.hibernate;
2,613,155
@Test public void moveToWaitDescriptionStatReply() throws Exception { moveToWaitConfigReply(); connection.clearMessages(); OFGetConfigReply cr = factory.buildGetConfigReply() .setMissSendLen(0xFFFF) .build(); switchHandler.processOFMessage(cr); OFMessage msg = connection.retrieveMessage(); assertEquals(OFType.STATS_REQUEST, msg.getType()); OFStatsRequest<?> sr = (OFStatsRequest<?>)msg; assertEquals(OFStatsType.DESC, sr.getStatsType()); verifyUniqueXids(msg); assertThat(switchHandler.getStateForTesting(), CoreMatchers.instanceOf(OFSwitchHandshakeHandler.WaitDescriptionStatReplyState.class)); }
void function() throws Exception { moveToWaitConfigReply(); connection.clearMessages(); OFGetConfigReply cr = factory.buildGetConfigReply() .setMissSendLen(0xFFFF) .build(); switchHandler.processOFMessage(cr); OFMessage msg = connection.retrieveMessage(); assertEquals(OFType.STATS_REQUEST, msg.getType()); OFStatsRequest<?> sr = (OFStatsRequest<?>)msg; assertEquals(OFStatsType.DESC, sr.getStatsType()); verifyUniqueXids(msg); assertThat(switchHandler.getStateForTesting(), CoreMatchers.instanceOf(OFSwitchHandshakeHandler.WaitDescriptionStatReplyState.class)); }
/** Move the channel from scratch to WAIT_DESCRIPTION_STAT_REPLY state * Builds on moveToWaitConfigReply() * adds testing for WAIT_CONFIG_REPLY state */
Move the channel from scratch to WAIT_DESCRIPTION_STAT_REPLY state Builds on moveToWaitConfigReply() adds testing for WAIT_CONFIG_REPLY state
moveToWaitDescriptionStatReply
{ "repo_name": "rizard/floodlight", "path": "src/test/java/net/floodlightcontroller/core/internal/OFSwitchHandlerTestBase.java", "license": "apache-2.0", "size": 43149 }
[ "org.hamcrest.CoreMatchers", "org.junit.Assert", "org.projectfloodlight.openflow.protocol.OFGetConfigReply", "org.projectfloodlight.openflow.protocol.OFMessage", "org.projectfloodlight.openflow.protocol.OFStatsRequest", "org.projectfloodlight.openflow.protocol.OFStatsType", "org.projectfloodlight.openflow.protocol.OFType" ]
import org.hamcrest.CoreMatchers; import org.junit.Assert; import org.projectfloodlight.openflow.protocol.OFGetConfigReply; import org.projectfloodlight.openflow.protocol.OFMessage; import org.projectfloodlight.openflow.protocol.OFStatsRequest; import org.projectfloodlight.openflow.protocol.OFStatsType; import org.projectfloodlight.openflow.protocol.OFType;
import org.hamcrest.*; import org.junit.*; import org.projectfloodlight.openflow.protocol.*;
[ "org.hamcrest", "org.junit", "org.projectfloodlight.openflow" ]
org.hamcrest; org.junit; org.projectfloodlight.openflow;
1,993,824
public static SecretKey generateAesKey() { try { return generateKey(AES_CIPHER_ALGORITHM); } catch (NoSuchAlgorithmException e) { // Should NEVER happen throw new IllegalStateException("JVM doesn't support " + AES_CIPHER_ALGORITHM, e); } }
static SecretKey function() { try { return generateKey(AES_CIPHER_ALGORITHM); } catch (NoSuchAlgorithmException e) { throw new IllegalStateException(STR + AES_CIPHER_ALGORITHM, e); } }
/** * Generates a random AES encryption key. * * @return the generated key */
Generates a random AES encryption key
generateAesKey
{ "repo_name": "dejan-brkic/commons", "path": "utilities/src/main/java/org/craftercms/commons/crypto/CryptoUtils.java", "license": "gpl-3.0", "size": 4814 }
[ "java.security.NoSuchAlgorithmException", "javax.crypto.SecretKey" ]
import java.security.NoSuchAlgorithmException; import javax.crypto.SecretKey;
import java.security.*; import javax.crypto.*;
[ "java.security", "javax.crypto" ]
java.security; javax.crypto;
1,441,508
public CompiledModel compile(TextureManager textureManager, String assetsRoot) { HashMap<String, TextureEntry> texturesImages = m_resolvedTextures; if (texturesImages == null) { HashMap<String, String> textures = getTextures(); texturesImages = TextureResolver.resolveTextures(m_name, m_mod, assetsRoot, textureManager, textures); synchronized (m_mutex) { m_resolvedTextures = texturesImages; } } CompiledModel result = m_compiledModel; if (result == null) { final List<AssetsCube> elements = getElements(); final List<CompiledCube> cubes = new ArrayList<CompiledCube>(); for (AssetsCube aCube : elements) { CompiledCube cCube = aCube.compile(texturesImages); if (cCube != null) { cubes.add(cCube); } } if (!cubes.isEmpty()) { result = new CompiledModel(cubes.toArray(new CompiledCube[0])); synchronized (m_mutex) { m_compiledModel = result; } } } return result; }
CompiledModel function(TextureManager textureManager, String assetsRoot) { HashMap<String, TextureEntry> texturesImages = m_resolvedTextures; if (texturesImages == null) { HashMap<String, String> textures = getTextures(); texturesImages = TextureResolver.resolveTextures(m_name, m_mod, assetsRoot, textureManager, textures); synchronized (m_mutex) { m_resolvedTextures = texturesImages; } } CompiledModel result = m_compiledModel; if (result == null) { final List<AssetsCube> elements = getElements(); final List<CompiledCube> cubes = new ArrayList<CompiledCube>(); for (AssetsCube aCube : elements) { CompiledCube cCube = aCube.compile(texturesImages); if (cCube != null) { cubes.add(cCube); } } if (!cubes.isEmpty()) { result = new CompiledModel(cubes.toArray(new CompiledCube[0])); synchronized (m_mutex) { m_compiledModel = result; } } } return result; }
/** * Render the model * * @param textureManager * @param assetsRoot * @return */
Render the model
compile
{ "repo_name": "Techcable/MCPainter", "path": "scrap/assets/assets/AssetsModel.java", "license": "mit", "size": 7311 }
[ "java.util.ArrayList", "java.util.HashMap", "java.util.List" ]
import java.util.ArrayList; import java.util.HashMap; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
213,028
public static long getDefaultBlockSize(final FileSystem fs, final Path path) throws IOException { Method m = null; Class<? extends FileSystem> cls = fs.getClass(); try { m = cls.getMethod("getDefaultBlockSize", new Class<?>[] { Path.class }); } catch (NoSuchMethodException e) { LOG.info("FileSystem doesn't support getDefaultBlockSize"); } catch (SecurityException e) { LOG.info("Doesn't have access to getDefaultBlockSize on FileSystems", e); m = null; // could happen on setAccessible() } if (m == null) { return fs.getDefaultBlockSize(); } else { try { Object ret = m.invoke(fs, path); return ((Long)ret).longValue(); } catch (Exception e) { throw new IOException(e); } } }
static long function(final FileSystem fs, final Path path) throws IOException { Method m = null; Class<? extends FileSystem> cls = fs.getClass(); try { m = cls.getMethod(STR, new Class<?>[] { Path.class }); } catch (NoSuchMethodException e) { LOG.info(STR); } catch (SecurityException e) { LOG.info(STR, e); m = null; } if (m == null) { return fs.getDefaultBlockSize(); } else { try { Object ret = m.invoke(fs, path); return ((Long)ret).longValue(); } catch (Exception e) { throw new IOException(e); } } }
/** * Return the number of bytes that large input files should be optimally * be split into to minimize i/o time. * * use reflection to search for getDefaultBlockSize(Path f) * if the method doesn't exist, fall back to using getDefaultBlockSize() * * @param fs filesystem object * @return the default block size for the path's filesystem * @throws IOException e */
Return the number of bytes that large input files should be optimally be split into to minimize i/o time. use reflection to search for getDefaultBlockSize(Path f) if the method doesn't exist, fall back to using getDefaultBlockSize()
getDefaultBlockSize
{ "repo_name": "cloud-software-foundation/c5", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java", "license": "apache-2.0", "size": 67483 }
[ "java.io.IOException", "java.lang.reflect.Method", "org.apache.hadoop.fs.FileSystem", "org.apache.hadoop.fs.Path" ]
import java.io.IOException; import java.lang.reflect.Method; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path;
import java.io.*; import java.lang.reflect.*; import org.apache.hadoop.fs.*;
[ "java.io", "java.lang", "org.apache.hadoop" ]
java.io; java.lang; org.apache.hadoop;
124,547
public static void performWorldGenSpawning(World worldIn, BiomeGenBase biomeIn, int p_77191_2_, int p_77191_3_, int p_77191_4_, int p_77191_5_, Random randomIn) { List<BiomeGenBase.SpawnListEntry> list = biomeIn.getSpawnableList(EnumCreatureType.CREATURE); if (!list.isEmpty()) { while (randomIn.nextFloat() < biomeIn.getSpawningChance()) { BiomeGenBase.SpawnListEntry biomegenbase$spawnlistentry = (BiomeGenBase.SpawnListEntry)WeightedRandom.getRandomItem(worldIn.rand, list); int i = biomegenbase$spawnlistentry.minGroupCount + randomIn.nextInt(1 + biomegenbase$spawnlistentry.maxGroupCount - biomegenbase$spawnlistentry.minGroupCount); IEntityLivingData ientitylivingdata = null; int j = p_77191_2_ + randomIn.nextInt(p_77191_4_); int k = p_77191_3_ + randomIn.nextInt(p_77191_5_); int l = j; int i1 = k; for (int j1 = 0; j1 < i; ++j1) { boolean flag = false; for (int k1 = 0; !flag && k1 < 4; ++k1) { BlockPos blockpos = worldIn.getTopSolidOrLiquidBlock(new BlockPos(j, 0, k)); if (canCreatureTypeSpawnAtLocation(EntityLiving.SpawnPlacementType.ON_GROUND, worldIn, blockpos)) { EntityLiving entityliving; try { entityliving = (EntityLiving)biomegenbase$spawnlistentry.entityClass.getConstructor(new Class[] {World.class}).newInstance(new Object[] {worldIn}); } catch (Exception exception) { exception.printStackTrace(); continue; } entityliving.setLocationAndAngles((double)((float)j + 0.5F), (double)blockpos.getY(), (double)((float)k + 0.5F), randomIn.nextFloat() * 360.0F, 0.0F); worldIn.spawnEntityInWorld(entityliving); ientitylivingdata = entityliving.onInitialSpawn(worldIn.getDifficultyForLocation(new BlockPos(entityliving)), ientitylivingdata); flag = true; } j += randomIn.nextInt(5) - randomIn.nextInt(5); for (k += randomIn.nextInt(5) - randomIn.nextInt(5); j < p_77191_2_ || j >= p_77191_2_ + p_77191_4_ || k < p_77191_3_ || k >= p_77191_3_ + p_77191_4_; k = i1 + randomIn.nextInt(5) - randomIn.nextInt(5)) { j = l + randomIn.nextInt(5) - randomIn.nextInt(5); } } } } } }
static void function(World worldIn, BiomeGenBase biomeIn, int p_77191_2_, int p_77191_3_, int p_77191_4_, int p_77191_5_, Random randomIn) { List<BiomeGenBase.SpawnListEntry> list = biomeIn.getSpawnableList(EnumCreatureType.CREATURE); if (!list.isEmpty()) { while (randomIn.nextFloat() < biomeIn.getSpawningChance()) { BiomeGenBase.SpawnListEntry biomegenbase$spawnlistentry = (BiomeGenBase.SpawnListEntry)WeightedRandom.getRandomItem(worldIn.rand, list); int i = biomegenbase$spawnlistentry.minGroupCount + randomIn.nextInt(1 + biomegenbase$spawnlistentry.maxGroupCount - biomegenbase$spawnlistentry.minGroupCount); IEntityLivingData ientitylivingdata = null; int j = p_77191_2_ + randomIn.nextInt(p_77191_4_); int k = p_77191_3_ + randomIn.nextInt(p_77191_5_); int l = j; int i1 = k; for (int j1 = 0; j1 < i; ++j1) { boolean flag = false; for (int k1 = 0; !flag && k1 < 4; ++k1) { BlockPos blockpos = worldIn.getTopSolidOrLiquidBlock(new BlockPos(j, 0, k)); if (canCreatureTypeSpawnAtLocation(EntityLiving.SpawnPlacementType.ON_GROUND, worldIn, blockpos)) { EntityLiving entityliving; try { entityliving = (EntityLiving)biomegenbase$spawnlistentry.entityClass.getConstructor(new Class[] {World.class}).newInstance(new Object[] {worldIn}); } catch (Exception exception) { exception.printStackTrace(); continue; } entityliving.setLocationAndAngles((double)((float)j + 0.5F), (double)blockpos.getY(), (double)((float)k + 0.5F), randomIn.nextFloat() * 360.0F, 0.0F); worldIn.spawnEntityInWorld(entityliving); ientitylivingdata = entityliving.onInitialSpawn(worldIn.getDifficultyForLocation(new BlockPos(entityliving)), ientitylivingdata); flag = true; } j += randomIn.nextInt(5) - randomIn.nextInt(5); for (k += randomIn.nextInt(5) - randomIn.nextInt(5); j < p_77191_2_ j >= p_77191_2_ + p_77191_4_ k < p_77191_3_ k >= p_77191_3_ + p_77191_4_; k = i1 + randomIn.nextInt(5) - randomIn.nextInt(5)) { j = l + randomIn.nextInt(5) - randomIn.nextInt(5); } } } } } }
/** * Called during chunk generation to spawn initial creatures. * * @param biomeIn The biome to use for the weighted entity list * @param randomIn The random to use for mob spawning */
Called during chunk generation to spawn initial creatures
performWorldGenSpawning
{ "repo_name": "dogjaw2233/tiu-s-mod", "path": "build/tmp/recompileMc/sources/net/minecraft/world/SpawnerAnimals.java", "license": "lgpl-2.1", "size": 14374 }
[ "java.util.List", "java.util.Random", "net.minecraft.entity.EntityLiving", "net.minecraft.entity.EnumCreatureType", "net.minecraft.entity.IEntityLivingData", "net.minecraft.util.BlockPos", "net.minecraft.util.WeightedRandom", "net.minecraft.world.biome.BiomeGenBase" ]
import java.util.List; import java.util.Random; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EnumCreatureType; import net.minecraft.entity.IEntityLivingData; import net.minecraft.util.BlockPos; import net.minecraft.util.WeightedRandom; import net.minecraft.world.biome.BiomeGenBase;
import java.util.*; import net.minecraft.entity.*; import net.minecraft.util.*; import net.minecraft.world.biome.*;
[ "java.util", "net.minecraft.entity", "net.minecraft.util", "net.minecraft.world" ]
java.util; net.minecraft.entity; net.minecraft.util; net.minecraft.world;
872,450
public final TextEdit getResultingEdit() { return fEdit; }
final TextEdit function() { return fEdit; }
/** * Returns the resulting text edit. * * @return the resulting text edit */
Returns the resulting text edit
getResultingEdit
{ "repo_name": "riuvshin/che-plugins", "path": "plugin-java/che-plugin-java-ext-java/src/main/java/org/eclipse/che/ide/ext/java/jdt/internal/corext/codemanipulation/AddGetterSetterOperation.java", "license": "epl-1.0", "size": 19693 }
[ "org.eclipse.che.ide.ext.java.jdt.text.edits.TextEdit" ]
import org.eclipse.che.ide.ext.java.jdt.text.edits.TextEdit;
import org.eclipse.che.ide.ext.java.jdt.text.edits.*;
[ "org.eclipse.che" ]
org.eclipse.che;
420,449
@Test public void testAngleToValue() { StandardDialScale s = new StandardDialScale(); assertEquals(0.0, s.angleToValue(175.0), EPSILON); assertEquals(50.0, s.angleToValue(90.0), EPSILON); assertEquals(100.0, s.angleToValue(5.0), EPSILON); assertEquals(-10.0, s.angleToValue(192.0), EPSILON); assertEquals(110.0, s.angleToValue(-12.0), EPSILON); s = new StandardDialScale(0, 20, 180, -180.0, 10, 3); assertEquals(0.0, s.angleToValue(180.0), EPSILON); assertEquals(10.0, s.angleToValue(90.0), EPSILON); assertEquals(20.0, s.angleToValue(0.0), EPSILON); }
void function() { StandardDialScale s = new StandardDialScale(); assertEquals(0.0, s.angleToValue(175.0), EPSILON); assertEquals(50.0, s.angleToValue(90.0), EPSILON); assertEquals(100.0, s.angleToValue(5.0), EPSILON); assertEquals(-10.0, s.angleToValue(192.0), EPSILON); assertEquals(110.0, s.angleToValue(-12.0), EPSILON); s = new StandardDialScale(0, 20, 180, -180.0, 10, 3); assertEquals(0.0, s.angleToValue(180.0), EPSILON); assertEquals(10.0, s.angleToValue(90.0), EPSILON); assertEquals(20.0, s.angleToValue(0.0), EPSILON); }
/** * Some checks for the angleToValue() method. */
Some checks for the angleToValue() method
testAngleToValue
{ "repo_name": "aaronc/jfreechart", "path": "tests/org/jfree/chart/plot/dial/StandardDialScaleTest.java", "license": "lgpl-2.1", "size": 9407 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
821,519
@Nullable public PropertyEditor findEditor(Class<?> valueClass) { return (this.bindingResult != null ? this.bindingResult.findEditor(this.expression, valueClass) : null); }
PropertyEditor function(Class<?> valueClass) { return (this.bindingResult != null ? this.bindingResult.findEditor(this.expression, valueClass) : null); }
/** * Find a PropertyEditor for the given value class, associated with * the property that this bound status is currently bound to. * @param valueClass the value class that an editor is needed for * @return the associated PropertyEditor, or {@code null} if none */
Find a PropertyEditor for the given value class, associated with the property that this bound status is currently bound to
findEditor
{ "repo_name": "spring-projects/spring-framework", "path": "spring-webmvc/src/main/java/org/springframework/web/servlet/support/BindStatus.java", "license": "apache-2.0", "size": 11232 }
[ "java.beans.PropertyEditor" ]
import java.beans.PropertyEditor;
import java.beans.*;
[ "java.beans" ]
java.beans;
1,153,945
@Basic @Column(name = "RANK", precision = 20) public long getRank() { return rank; }
@Column(name = "RANK", precision = 20) long function() { return rank; }
/** * Gets the value of the rank property. * */
Gets the value of the rank property
getRank
{ "repo_name": "Hack23/cia", "path": "model.internal.application.user.impl/src/main/java/com/hack23/cia/model/internal/application/data/impl/ViewApplicationActionEventPageElementWeeklySummary.java", "license": "apache-2.0", "size": 6264 }
[ "javax.persistence.Column" ]
import javax.persistence.Column;
import javax.persistence.*;
[ "javax.persistence" ]
javax.persistence;
2,064,765
Set<K8sTunnelBridge> tunBridges();
Set<K8sTunnelBridge> tunBridges();
/** * Returns the set of tunnel bridges belong to the host. * * @return a set of tunnel bridges */
Returns the set of tunnel bridges belong to the host
tunBridges
{ "repo_name": "gkatsikas/onos", "path": "apps/k8s-node/api/src/main/java/org/onosproject/k8snode/api/K8sHost.java", "license": "apache-2.0", "size": 3667 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
499,326
public static String getSpnegoKeytabKey(Configuration conf, String defaultKey) { String value = conf.get(DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY); return (value == null || value.isEmpty()) ? defaultKey : DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY; }
static String function(Configuration conf, String defaultKey) { String value = conf.get(DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY); return (value == null value.isEmpty()) ? defaultKey : DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY; }
/** * Get SPNEGO keytab Key from configuration * * @param conf Configuration * @param defaultKey default key to be used for config lookup * @return DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY if the key is not empty * else return defaultKey */
Get SPNEGO keytab Key from configuration
getSpnegoKeytabKey
{ "repo_name": "an3m0na/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java", "license": "apache-2.0", "size": 70338 }
[ "org.apache.hadoop.conf.Configuration" ]
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
927,471
public static boolean isEqualsMethod(@Nullable Method method) { if (method == null) { return false; } if (method.getParameterCount() != 1) { return false; } if (!method.getName().equals("equals")) { return false; } return method.getParameterTypes()[0] == Object.class; }
static boolean function(@Nullable Method method) { if (method == null) { return false; } if (method.getParameterCount() != 1) { return false; } if (!method.getName().equals(STR)) { return false; } return method.getParameterTypes()[0] == Object.class; }
/** * Determine whether the given method is an "equals" method. * @see java.lang.Object#equals(Object) */
Determine whether the given method is an "equals" method
isEqualsMethod
{ "repo_name": "spring-projects/spring-framework", "path": "spring-core/src/main/java/org/springframework/util/ReflectionUtils.java", "license": "apache-2.0", "size": 31556 }
[ "java.lang.reflect.Method", "org.springframework.lang.Nullable" ]
import java.lang.reflect.Method; import org.springframework.lang.Nullable;
import java.lang.reflect.*; import org.springframework.lang.*;
[ "java.lang", "org.springframework.lang" ]
java.lang; org.springframework.lang;
2,872,649
public static void notifyDefineClass(RVMType type) { // NOTE: will need synchronization if allowing unregistering if (!defineClassEnabled) return; defineClassEnabled = false; if (TRACE_DEFINECLASS) { //VM.sysWrite(getThread(), false); //VM.sysWrite(": "); VM.sysWrite("invoking defineclass monitors: "); VM.sysWrite(type.getDescriptor()); VM.sysWrite("\n"); //printStack("From: "); } for (CallbackList l = defineClassCallbacks; l != null; l = l.next) { if (TRACE_DEFINECLASS) { VM.sysWrite(" "); VM.sysWrite(getClass(l.callback)); VM.sysWrite("\n"); } ((DefineClassMonitor) l.callback).notifyDefineClass(type); } defineClassEnabled = true; }
static void function(RVMType type) { if (!defineClassEnabled) return; defineClassEnabled = false; if (TRACE_DEFINECLASS) { VM.sysWrite(STR); VM.sysWrite(type.getDescriptor()); VM.sysWrite("\n"); } for (CallbackList l = defineClassCallbacks; l != null; l = l.next) { if (TRACE_DEFINECLASS) { VM.sysWrite(" "); VM.sysWrite(getClass(l.callback)); VM.sysWrite("\n"); } ((DefineClassMonitor) l.callback).notifyDefineClass(type); } defineClassEnabled = true; }
/** * Notify the monitor that java.lang.Class.defineclass was called. * @param type the type that will be returned */
Notify the monitor that java.lang.Class.defineclass was called
notifyDefineClass
{ "repo_name": "ut-osa/laminar", "path": "jikesrvm-3.0.0/rvm/src/org/jikesrvm/Callbacks.java", "license": "bsd-3-clause", "size": 37714 }
[ "org.jikesrvm.classloader.RVMType" ]
import org.jikesrvm.classloader.RVMType;
import org.jikesrvm.classloader.*;
[ "org.jikesrvm.classloader" ]
org.jikesrvm.classloader;
1,735,064
public TResult queryInForChunk(boolean distinct, String[] columns, String nestedSQL, String[] nestedArgs, Map<String, Object> fieldValues, String orderBy, int limit, long offset) { return queryInForChunk(distinct, columns, nestedSQL, nestedArgs, fieldValues, null, null, orderBy, limit, offset); }
TResult function(boolean distinct, String[] columns, String nestedSQL, String[] nestedArgs, Map<String, Object> fieldValues, String orderBy, int limit, long offset) { return queryInForChunk(distinct, columns, nestedSQL, nestedArgs, fieldValues, null, null, orderBy, limit, offset); }
/** * Query for ordered rows by ids in the nested SQL query, starting at the * offset and returning no more than the limit. * * @param distinct * distinct rows * @param columns * columns * @param nestedSQL * nested SQL * @param nestedArgs * nested SQL args * @param fieldValues * field values * @param orderBy * order by * @param limit * chunk limit * @param offset * chunk query offset * @return result * @since 6.2.0 */
Query for ordered rows by ids in the nested SQL query, starting at the offset and returning no more than the limit
queryInForChunk
{ "repo_name": "ngageoint/geopackage-core-java", "path": "src/main/java/mil/nga/geopackage/user/UserCoreDao.java", "license": "mit", "size": 287160 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,794,782
@Override public IngestModuleIngestJobSettings getSettings() { return new SampleModuleIngestJobSettings(skipKnownFilesCheckBox.isSelected()); }
IngestModuleIngestJobSettings function() { return new SampleModuleIngestJobSettings(skipKnownFilesCheckBox.isSelected()); }
/** * Gets the ingest job settings for an ingest module. * * @return The ingest settings. */
Gets the ingest job settings for an ingest module
getSettings
{ "repo_name": "millmanorama/autopsy", "path": "Core/src/org/sleuthkit/autopsy/examples/SampleIngestModuleIngestJobSettingsPanel.java", "license": "apache-2.0", "size": 4273 }
[ "org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings" ]
import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings;
import org.sleuthkit.autopsy.ingest.*;
[ "org.sleuthkit.autopsy" ]
org.sleuthkit.autopsy;
2,883,399
public ServiceFuture<EventHubResourceInner> createOrUpdateAsync(String resourceGroupName, String namespaceName, String eventHubName, EventHubCreateOrUpdateParametersInner parameters, final ServiceCallback<EventHubResourceInner> serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, parameters), serviceCallback); }
ServiceFuture<EventHubResourceInner> function(String resourceGroupName, String namespaceName, String eventHubName, EventHubCreateOrUpdateParametersInner parameters, final ServiceCallback<EventHubResourceInner> serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, parameters), serviceCallback); }
/** * Creates or updates a new Event Hub as a nested resource within a Namespace. * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @param eventHubName The Event Hub name * @param parameters Parameters supplied to create an Event Hub resource. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */
Creates or updates a new Event Hub as a nested resource within a Namespace
createOrUpdateAsync
{ "repo_name": "martinsawicki/azure-sdk-for-java", "path": "azure-mgmt-eventhub/src/main/java/com/microsoft/azure/management/eventhub/implementation/EventHubsInner.java", "license": "mit", "size": 94388 }
[ "com.microsoft.rest.ServiceCallback", "com.microsoft.rest.ServiceFuture" ]
import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
452,860
public static DXWorkflow getInstanceWithEnvironment(String workflowId, DXEnvironment env) { return new DXWorkflow(workflowId, Preconditions.checkNotNull(env, "env may not be null")); }
static DXWorkflow function(String workflowId, DXEnvironment env) { return new DXWorkflow(workflowId, Preconditions.checkNotNull(env, STR)); }
/** * Returns a {@code DXWorkflow} associated with an existing workflow using the specified * environment. * * @throws NullPointerException If {@code workflowId} is null */
Returns a DXWorkflow associated with an existing workflow using the specified environment
getInstanceWithEnvironment
{ "repo_name": "andyshinn/dx-toolkit", "path": "src/java/src/main/java/com/dnanexus/DXWorkflow.java", "license": "apache-2.0", "size": 7841 }
[ "com.google.common.base.Preconditions" ]
import com.google.common.base.Preconditions;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
1,391,375
public boolean hitEntity(ItemStack p_77644_1_, EntityLivingBase p_77644_2_, EntityLivingBase p_77644_3_) { p_77644_1_.damageItem(1, p_77644_3_); return true; }
boolean function(ItemStack p_77644_1_, EntityLivingBase p_77644_2_, EntityLivingBase p_77644_3_) { p_77644_1_.damageItem(1, p_77644_3_); return true; }
/** * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise * the damage on the stack. */
Current implementations of this method in child classes do not use the entry argument beside ev. They just raise the damage on the stack
hitEntity
{ "repo_name": "TheHecticByte/BananaJ1.7.10Beta", "path": "src/net/minecraft/Server1_7_10/item/ItemSword.java", "license": "gpl-3.0", "size": 4287 }
[ "net.minecraft.Server1_7_10" ]
import net.minecraft.Server1_7_10;
import net.minecraft.*;
[ "net.minecraft" ]
net.minecraft;
28,246
public static Stroke createStroke( Color color, double width ) { return createStroke( color, width, "round", "square" ); }
static Stroke function( Color color, double width ) { return createStroke( color, width, "round", STR ); }
/** * create a stroke with the passed width and color * * @param color * the color of the line * @param width * the width of the line * * @return the created stroke */
create a stroke with the passed width and color
createStroke
{ "repo_name": "lat-lon/deegree2-base", "path": "deegree2-core/src/main/java/org/deegree/graphics/sld/StyleFactory.java", "license": "lgpl-2.1", "size": 72348 }
[ "java.awt.Color" ]
import java.awt.Color;
import java.awt.*;
[ "java.awt" ]
java.awt;
1,016,126
@RequestProcessing(value = "/apis/metaweblog", method = HTTPRequestMethod.POST) public void metaWeblog(final HttpServletRequest request, final HttpServletResponse response, final HTTPRequestContext context) { final TextXMLRenderer renderer = new TextXMLRenderer(); context.setRenderer(renderer); String responseContent = null; try { final ServletInputStream inputStream = request.getInputStream(); final String xml = IOUtils.toString(inputStream, "UTF-8"); final JSONObject requestJSONObject = XML.toJSONObject(xml); final JSONObject methodCall = requestJSONObject.getJSONObject(METHOD_CALL); final String methodName = methodCall.getString(METHOD_NAME); LOGGER.log(Level.INFO, "MetaWeblog[methodName={0}]", methodName); final JSONArray params = methodCall.getJSONObject("params"). getJSONArray("param"); if (METHOD_DELETE_POST.equals(methodName)) { params.remove(0); // Removes the first argument "appkey" } final String userEmail = params.getJSONObject(INDEX_USER_EMAIL). getJSONObject( "value").getString("string"); final JSONObject user = userQueryService.getUserByEmail(userEmail); if (null == user) { throw new Exception("No user[email=" + userEmail + "]"); } final String userPwd = params.getJSONObject(INDEX_USER_PWD). getJSONObject("value").getString("string"); if (!user.getString(User.USER_PASSWORD).equals(userPwd)) { throw new Exception("Wrong password"); } if (METHOD_GET_USERS_BLOGS.equals(methodName)) { responseContent = getUsersBlogs(); } else if (METHOD_GET_CATEGORIES.equals(methodName)) { responseContent = getCategories(); } else if (METHOD_GET_RECENT_POSTS.equals(methodName)) { final int numOfPosts = params.getJSONObject(INDEX_NUM_OF_POSTS).getJSONObject("value").getInt("int"); responseContent = getRecentPosts(numOfPosts); } else if (METHOD_NEW_POST.equals(methodName)) { final JSONObject article = parsetPost(methodCall); article.put(Article.ARTICLE_AUTHOR_EMAIL, userEmail); addArticle(article); final StringBuilder stringBuilder = new StringBuilder("<?xml version=\"1.0\" encoding=\"UTF-8\"?><methodResponse><params><param><value><string>"). append(article.getString(Keys.OBJECT_ID)).append("</string></value></param></params></methodResponse>"); responseContent = stringBuilder.toString(); } else if (METHOD_GET_POST.equals(methodName)) { final String postId = params.getJSONObject(INDEX_POST_ID). getJSONObject("value").getString("string"); responseContent = getPost(postId); } else if (METHOD_EDIT_POST.equals(methodName)) { final JSONObject article = parsetPost(methodCall); final String postId = params.getJSONObject(INDEX_POST_ID).getJSONObject("value").getString("string"); article.put(Keys.OBJECT_ID, postId); article.put(Article.ARTICLE_AUTHOR_EMAIL, userEmail); final JSONObject updateArticleRequest = new JSONObject(); updateArticleRequest.put(Article.ARTICLE, article); articleMgmtService.updateArticle(updateArticleRequest); final StringBuilder stringBuilder = new StringBuilder( "<?xml version=\"1.0\" encoding=\"UTF-8\"?><methodResponse><params><param><value><string>").append(postId). append("</string></value></param></params></methodResponse>"); responseContent = stringBuilder.toString(); } else if (METHOD_DELETE_POST.equals(methodName)) { final String postId = params.getJSONObject(INDEX_POST_ID). getJSONObject("value").getString("string"); articleMgmtService.removeArticle(postId); final StringBuilder stringBuilder = new StringBuilder( "<?xml version=\"1.0\" encoding=\"UTF-8\"?><methodResponse><params><param><value><boolean>").append(true).append( "</boolean></value></param></params></methodResponse>"); responseContent = stringBuilder.toString(); } else { throw new UnsupportedOperationException("Unsupported method[name=" + methodName + "]"); } } catch (final Exception e) { LOGGER.log(Level.SEVERE, e.getMessage(), e); responseContent = ""; final StringBuilder stringBuilder = new StringBuilder( "<?xml version=\"1.0\" encoding=\"UTF-8\"?><methodResponse><fault><value><struct>").append( "<member><name>faultCode</name><value><int>500</int></value></member>"). append("<member><name>faultString</name><value><string>"). append(e.getMessage()).append( "</string></value></member></struct></value></fault></methodResponse>"); responseContent = stringBuilder.toString(); } renderer.setContent(responseContent); }
@RequestProcessing(value = STR, method = HTTPRequestMethod.POST) void function(final HttpServletRequest request, final HttpServletResponse response, final HTTPRequestContext context) { final TextXMLRenderer renderer = new TextXMLRenderer(); context.setRenderer(renderer); String responseContent = null; try { final ServletInputStream inputStream = request.getInputStream(); final String xml = IOUtils.toString(inputStream, "UTF-8"); final JSONObject requestJSONObject = XML.toJSONObject(xml); final JSONObject methodCall = requestJSONObject.getJSONObject(METHOD_CALL); final String methodName = methodCall.getString(METHOD_NAME); LOGGER.log(Level.INFO, STR, methodName); final JSONArray params = methodCall.getJSONObject(STR). getJSONArray("param"); if (METHOD_DELETE_POST.equals(methodName)) { params.remove(0); } final String userEmail = params.getJSONObject(INDEX_USER_EMAIL). getJSONObject( "value").getString(STR); final JSONObject user = userQueryService.getUserByEmail(userEmail); if (null == user) { throw new Exception(STR + userEmail + "]"); } final String userPwd = params.getJSONObject(INDEX_USER_PWD). getJSONObject("value").getString(STR); if (!user.getString(User.USER_PASSWORD).equals(userPwd)) { throw new Exception(STR); } if (METHOD_GET_USERS_BLOGS.equals(methodName)) { responseContent = getUsersBlogs(); } else if (METHOD_GET_CATEGORIES.equals(methodName)) { responseContent = getCategories(); } else if (METHOD_GET_RECENT_POSTS.equals(methodName)) { final int numOfPosts = params.getJSONObject(INDEX_NUM_OF_POSTS).getJSONObject("value").getInt("int"); responseContent = getRecentPosts(numOfPosts); } else if (METHOD_NEW_POST.equals(methodName)) { final JSONObject article = parsetPost(methodCall); article.put(Article.ARTICLE_AUTHOR_EMAIL, userEmail); addArticle(article); final StringBuilder stringBuilder = new StringBuilder(STR1.0\STRUTF-8\STR). append(article.getString(Keys.OBJECT_ID)).append(STR); responseContent = stringBuilder.toString(); } else if (METHOD_GET_POST.equals(methodName)) { final String postId = params.getJSONObject(INDEX_POST_ID). getJSONObject("value").getString(STR); responseContent = getPost(postId); } else if (METHOD_EDIT_POST.equals(methodName)) { final JSONObject article = parsetPost(methodCall); final String postId = params.getJSONObject(INDEX_POST_ID).getJSONObject("value").getString(STR); article.put(Keys.OBJECT_ID, postId); article.put(Article.ARTICLE_AUTHOR_EMAIL, userEmail); final JSONObject updateArticleRequest = new JSONObject(); updateArticleRequest.put(Article.ARTICLE, article); articleMgmtService.updateArticle(updateArticleRequest); final StringBuilder stringBuilder = new StringBuilder( STR1.0\STRUTF-8\STR).append(postId). append(STR); responseContent = stringBuilder.toString(); } else if (METHOD_DELETE_POST.equals(methodName)) { final String postId = params.getJSONObject(INDEX_POST_ID). getJSONObject("value").getString(STR); articleMgmtService.removeArticle(postId); final StringBuilder stringBuilder = new StringBuilder( STR1.0\STRUTF-8\STR).append(true).append( STR); responseContent = stringBuilder.toString(); } else { throw new UnsupportedOperationException(STR + methodName + "]"); } } catch (final Exception e) { LOGGER.log(Level.SEVERE, e.getMessage(), e); responseContent = ""; final StringBuilder stringBuilder = new StringBuilder( STR1.0\STRUTF-8\"?><methodResponse><fault><value><struct>STR<member><name>faultCode</name><value><int>500</int></value></member>STR<member><name>faultString</name><value><string>STR</string></value></member></struct></value></fault></methodResponse>"); responseContent = stringBuilder.toString(); } renderer.setContent(responseContent); }
/** * MetaWeblog requests processing. * * @param request the specified http servlet request * @param response the specified http servlet response * @param context the specified http request context */
MetaWeblog requests processing
metaWeblog
{ "repo_name": "cgm1521/b3log-solo", "path": "core/src/main/java/org/b3log/solo/api/metaweblog/MetaWeblogAPI.java", "license": "apache-2.0", "size": 27177 }
[ "java.util.logging.Level", "javax.servlet.ServletInputStream", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "org.apache.commons.io.IOUtils", "org.b3log.latke.Keys", "org.b3log.latke.model.User", "org.b3log.latke.servlet.HTTPRequestContext", "org.b3log.latke.servlet.HTTPRequestMethod", "org.b3log.latke.servlet.annotation.RequestProcessing", "org.b3log.latke.servlet.renderer.TextXMLRenderer", "org.b3log.solo.model.Article", "org.json.JSONArray", "org.json.JSONObject", "org.json.XML" ]
import java.util.logging.Level; import javax.servlet.ServletInputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.io.IOUtils; import org.b3log.latke.Keys; import org.b3log.latke.model.User; import org.b3log.latke.servlet.HTTPRequestContext; import org.b3log.latke.servlet.HTTPRequestMethod; import org.b3log.latke.servlet.annotation.RequestProcessing; import org.b3log.latke.servlet.renderer.TextXMLRenderer; import org.b3log.solo.model.Article; import org.json.JSONArray; import org.json.JSONObject; import org.json.XML;
import java.util.logging.*; import javax.servlet.*; import javax.servlet.http.*; import org.apache.commons.io.*; import org.b3log.latke.*; import org.b3log.latke.model.*; import org.b3log.latke.servlet.*; import org.b3log.latke.servlet.annotation.*; import org.b3log.latke.servlet.renderer.*; import org.b3log.solo.model.*; import org.json.*;
[ "java.util", "javax.servlet", "org.apache.commons", "org.b3log.latke", "org.b3log.solo", "org.json" ]
java.util; javax.servlet; org.apache.commons; org.b3log.latke; org.b3log.solo; org.json;
2,386,293
public static final <T> String coll2string(final Collection<T> coll) { return coll2string(coll, coll.size()); } /** * Converts a string of elements separated by comma to {@code Collection}
static final <T> String function(final Collection<T> coll) { return coll2string(coll, coll.size()); } /** * Converts a string of elements separated by comma to {@code Collection}
/** * Converts the {@code Collection} of objects to string, where each * collection element is separated by comma. * * @param coll * the collection of objects which need to be converted to * string. * @return the string representation of the collection. */
Converts the Collection of objects to string, where each collection element is separated by comma
coll2string
{ "repo_name": "SHAF-WORK/shaf", "path": "core/src/main/java/org/shaf/core/util/StringUtils.java", "license": "apache-2.0", "size": 6711 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
1,995,173
public T hl7(boolean validate) { HL7DataFormat hl7 = new HL7DataFormat(); hl7.setValidate(validate); return dataFormat(hl7); }
T function(boolean validate) { HL7DataFormat hl7 = new HL7DataFormat(); hl7.setValidate(validate); return dataFormat(hl7); }
/** * Uses the HL7 data format */
Uses the HL7 data format
hl7
{ "repo_name": "kingargyle/turmeric-bot", "path": "camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java", "license": "apache-2.0", "size": 11182 }
[ "org.apache.camel.model.dataformat.HL7DataFormat" ]
import org.apache.camel.model.dataformat.HL7DataFormat;
import org.apache.camel.model.dataformat.*;
[ "org.apache.camel" ]
org.apache.camel;
1,314,180
RelationalDatabaseFactory getRelationalDatabaseFactory(); interface Literals { EClass NAMED_ELEMENT = eINSTANCE.getNamedElement(); EAttribute NAMED_ELEMENT__NAME = eINSTANCE.getNamedElement_Name(); EAttribute NAMED_ELEMENT__DOCUMENTATION = eINSTANCE.getNamedElement_Documentation(); EClass DATABASE_MODEL = eINSTANCE.getDatabaseModel(); EReference DATABASE_MODEL__TABLES = eINSTANCE.getDatabaseModel_Tables(); EReference DATABASE_MODEL__DATA_TYPES = eINSTANCE.getDatabaseModel_DataTypes(); EReference DATABASE_MODEL__TAGS = eINSTANCE.getDatabaseModel_Tags(); EReference DATABASE_MODEL__CONFIGURATION = eINSTANCE.getDatabaseModel_Configuration(); EClass TABLE = eINSTANCE.getTable(); EReference TABLE__COLUMNS = eINSTANCE.getTable_Columns(); EReference TABLE__FOREIGN_KEYS = eINSTANCE.getTable_ForeignKeys(); EClass COLUMN = eINSTANCE.getColumn(); EAttribute COLUMN__NULLABLE = eINSTANCE.getColumn_Nullable(); EAttribute COLUMN__PRIMARY_KEY = eINSTANCE.getColumn_PrimaryKey(); EReference COLUMN__DATA_TYPE = eINSTANCE.getColumn_DataType(); EAttribute COLUMN__SIZE = eINSTANCE.getColumn_Size(); EAttribute COLUMN__SCALE = eINSTANCE.getColumn_Scale(); EAttribute COLUMN__ARRAY_DIMENSIONS = eINSTANCE.getColumn_ArrayDimensions(); EAttribute COLUMN__UNIQUE = eINSTANCE.getColumn_Unique(); EClass FOREIGN_KEY = eINSTANCE.getForeignKey(); EReference FOREIGN_KEY__SOURCE_COLUMNS = eINSTANCE.getForeignKey_SourceColumns(); EReference FOREIGN_KEY__TARGET_COLUMNS = eINSTANCE.getForeignKey_TargetColumns(); EReference FOREIGN_KEY__TARGET_TABLE = eINSTANCE.getForeignKey_TargetTable(); EAttribute FOREIGN_KEY__SOURCE_LOWER_BOUNDARY = eINSTANCE.getForeignKey_SourceLowerBoundary(); EAttribute FOREIGN_KEY__SOURCE_UPPER_BOUNDARY = eINSTANCE.getForeignKey_SourceUpperBoundary(); EAttribute FOREIGN_KEY__TARGET_LOWER_BOUNDARY = eINSTANCE.getForeignKey_TargetLowerBoundary(); EAttribute FOREIGN_KEY__TARGET_UPPER_BOUNDARY = eINSTANCE.getForeignKey_TargetUpperBoundary(); EClass DATA_TYPE = eINSTANCE.getDataType(); EClass TAG = eINSTANCE.getTag(); EAttribute TAG__NAME = eINSTANCE.getTag_Name(); EAttribute TAG__DOCUMENTATION = eINSTANCE.getTag_Documentation(); EClass TAGGABLE = eINSTANCE.getTaggable(); EReference TAGGABLE__TAG = eINSTANCE.getTaggable_Tag(); EClass CONFIGURATION = eINSTANCE.getConfiguration(); }
RelationalDatabaseFactory getRelationalDatabaseFactory(); interface Literals { EClass NAMED_ELEMENT = eINSTANCE.getNamedElement(); EAttribute NAMED_ELEMENT__NAME = eINSTANCE.getNamedElement_Name(); EAttribute NAMED_ELEMENT__DOCUMENTATION = eINSTANCE.getNamedElement_Documentation(); EClass DATABASE_MODEL = eINSTANCE.getDatabaseModel(); EReference DATABASE_MODEL__TABLES = eINSTANCE.getDatabaseModel_Tables(); EReference DATABASE_MODEL__DATA_TYPES = eINSTANCE.getDatabaseModel_DataTypes(); EReference DATABASE_MODEL__TAGS = eINSTANCE.getDatabaseModel_Tags(); EReference DATABASE_MODEL__CONFIGURATION = eINSTANCE.getDatabaseModel_Configuration(); EClass TABLE = eINSTANCE.getTable(); EReference TABLE__COLUMNS = eINSTANCE.getTable_Columns(); EReference TABLE__FOREIGN_KEYS = eINSTANCE.getTable_ForeignKeys(); EClass COLUMN = eINSTANCE.getColumn(); EAttribute COLUMN__NULLABLE = eINSTANCE.getColumn_Nullable(); EAttribute COLUMN__PRIMARY_KEY = eINSTANCE.getColumn_PrimaryKey(); EReference COLUMN__DATA_TYPE = eINSTANCE.getColumn_DataType(); EAttribute COLUMN__SIZE = eINSTANCE.getColumn_Size(); EAttribute COLUMN__SCALE = eINSTANCE.getColumn_Scale(); EAttribute COLUMN__ARRAY_DIMENSIONS = eINSTANCE.getColumn_ArrayDimensions(); EAttribute COLUMN__UNIQUE = eINSTANCE.getColumn_Unique(); EClass FOREIGN_KEY = eINSTANCE.getForeignKey(); EReference FOREIGN_KEY__SOURCE_COLUMNS = eINSTANCE.getForeignKey_SourceColumns(); EReference FOREIGN_KEY__TARGET_COLUMNS = eINSTANCE.getForeignKey_TargetColumns(); EReference FOREIGN_KEY__TARGET_TABLE = eINSTANCE.getForeignKey_TargetTable(); EAttribute FOREIGN_KEY__SOURCE_LOWER_BOUNDARY = eINSTANCE.getForeignKey_SourceLowerBoundary(); EAttribute FOREIGN_KEY__SOURCE_UPPER_BOUNDARY = eINSTANCE.getForeignKey_SourceUpperBoundary(); EAttribute FOREIGN_KEY__TARGET_LOWER_BOUNDARY = eINSTANCE.getForeignKey_TargetLowerBoundary(); EAttribute FOREIGN_KEY__TARGET_UPPER_BOUNDARY = eINSTANCE.getForeignKey_TargetUpperBoundary(); EClass DATA_TYPE = eINSTANCE.getDataType(); EClass TAG = eINSTANCE.getTag(); EAttribute TAG__NAME = eINSTANCE.getTag_Name(); EAttribute TAG__DOCUMENTATION = eINSTANCE.getTag_Documentation(); EClass TAGGABLE = eINSTANCE.getTaggable(); EReference TAGGABLE__TAG = eINSTANCE.getTaggable_Tag(); EClass CONFIGURATION = eINSTANCE.getConfiguration(); }
/** * Returns the factory that creates the instances of the model. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the factory that creates the instances of the model. * @generated */
Returns the factory that creates the instances of the model.
getRelationalDatabaseFactory
{ "repo_name": "cadorca/rdb-designer", "path": "com.dbdesigner.design/src/com/dbdesigner/model/relationaldatabase/RelationalDatabasePackage.java", "license": "mit", "size": 40573 }
[ "org.eclipse.emf.ecore.EAttribute", "org.eclipse.emf.ecore.EClass", "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,208,887
private void build_districts() { images_district.clear(); Card c; JLabel card; String card_info; List<PlayCard> dist = model.get_game().get_districts(); for(int i = 0; i < dist.size() ; i++) { c = dist.get(i); ImageIcon image = new ImageIcon(cards.get_image_rotated(c.get_name()).getScaledInstance(table_cards_rotated_X, table_cards_rotated_Y, Image.SCALE_SMOOTH)); card = new JLabel(image); card_info = "<html><b>Carta de Distrito<br />Nome: </b>" + c.get_name() + "<br /><b>Naipes: </b>"; for (String s : c.get_suits()) { card_info += s + " "; } card_info += "</html>"; card.setToolTipText(card_info); images_district.put(i, card); } }
void function() { images_district.clear(); Card c; JLabel card; String card_info; List<PlayCard> dist = model.get_game().get_districts(); for(int i = 0; i < dist.size() ; i++) { c = dist.get(i); ImageIcon image = new ImageIcon(cards.get_image_rotated(c.get_name()).getScaledInstance(table_cards_rotated_X, table_cards_rotated_Y, Image.SCALE_SMOOTH)); card = new JLabel(image); card_info = STR + c.get_name() + STR; for (String s : c.get_suits()) { card_info += s + " "; } card_info += STR; card.setToolTipText(card_info); images_district.put(i, card); } }
/** * Builds the hashmap with the image of the district and the index. */
Builds the hashmap with the image of the district and the index
build_districts
{ "repo_name": "Tenza/Decktet-Magnate", "path": "Decktet - Magnate/src/magnate/ui/graphics/Table.java", "license": "gpl-3.0", "size": 29302 }
[ "java.awt.Image", "java.util.List", "javax.swing.ImageIcon", "javax.swing.JLabel" ]
import java.awt.Image; import java.util.List; import javax.swing.ImageIcon; import javax.swing.JLabel;
import java.awt.*; import java.util.*; import javax.swing.*;
[ "java.awt", "java.util", "javax.swing" ]
java.awt; java.util; javax.swing;
1,509,232
public void testDifferentModulesWithTheSamePath_Loop() throws Exception { final Module module1 = module("foo"); final Module module2 = module("bar"); final Module module3 = module("bar"); final Module module4 = module("bar"); final Module module5 = module("flux"); module3.setDependencies(new Module[]{module1, module2}); module2.setDependencies(new Module[]{module4}); module4.setDependencies(new Module[]{module5}); module5.setDependencies(new Module[]{module2}); try { resolver.init(Arrays.asList(module1, module2, module3, module4)); fail(); } catch (CyclicDependenciesDetectedException ex) { assertTrue(ex.getMessage(), Pattern.matches("Cyclic dependencies detected: (?:" + Pattern.quote("[->bar->bar->flux->]") + '|' + Pattern.quote("[->flux->bar->bar->]") + '|' + Pattern.quote("[->bar->flux->bar->]") + ")\\.", ex.getMessage())); } }
void function() throws Exception { final Module module1 = module("foo"); final Module module2 = module("bar"); final Module module3 = module("bar"); final Module module4 = module("bar"); final Module module5 = module("flux"); module3.setDependencies(new Module[]{module1, module2}); module2.setDependencies(new Module[]{module4}); module4.setDependencies(new Module[]{module5}); module5.setDependencies(new Module[]{module2}); try { resolver.init(Arrays.asList(module1, module2, module3, module4)); fail(); } catch (CyclicDependenciesDetectedException ex) { assertTrue(ex.getMessage(), Pattern.matches(STR + Pattern.quote(STR) + ' ' + Pattern.quote(STR) + ' ' + Pattern.quote(STR) + ")\\.", ex.getMessage())); } }
/** * <p>Test description: though discouraged using different instances of Module with the same path is allowed. * SerialDependencyResolver must treat them as different modules.</p> */
Test description: though discouraged using different instances of Module with the same path is allowed. SerialDependencyResolver must treat them as different modules
testDifferentModulesWithTheSamePath_Loop
{ "repo_name": "dzidzitop/ant_modular", "path": "test/java/afc/ant/modular/ParallelDependencyResolver_SerialUse_ValidUseCasesTest.java", "license": "bsd-2-clause", "size": 30892 }
[ "java.util.Arrays", "java.util.regex.Pattern" ]
import java.util.Arrays; import java.util.regex.Pattern;
import java.util.*; import java.util.regex.*;
[ "java.util" ]
java.util;
1,028,272
BigInteger getBigInteger (String name);
BigInteger getBigInteger (String name);
/** * Returns the named value as a BigInteger. * * @param name the validation name * @return the BigInteger value or null */
Returns the named value as a BigInteger
getBigInteger
{ "repo_name": "leohinterlang/valFace", "path": "src/main/java/com/fidelis/valface/ValFace.java", "license": "apache-2.0", "size": 1779 }
[ "java.math.BigInteger" ]
import java.math.BigInteger;
import java.math.*;
[ "java.math" ]
java.math;
593,078
public SyncBeanDef<Activity> getActivity( final String id ) { return activitiesById.get( id ); }
SyncBeanDef<Activity> function( final String id ) { return activitiesById.get( id ); }
/** * Returns the activity with the given CDI bean name from this cache, or null if there is no such activity or the * activity with the given name is not an activated bean. * * @param id * the CDI name of the bean (see {@link Named}), or in the case of runtime plugins, the name the activity * was registered under. */
Returns the activity with the given CDI bean name from this cache, or null if there is no such activity or the activity with the given name is not an activated bean
getActivity
{ "repo_name": "kiereleaseuser/uberfire", "path": "uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/mvp/ActivityBeansCache.java", "license": "apache-2.0", "size": 10082 }
[ "org.jboss.errai.ioc.client.container.SyncBeanDef" ]
import org.jboss.errai.ioc.client.container.SyncBeanDef;
import org.jboss.errai.ioc.client.container.*;
[ "org.jboss.errai" ]
org.jboss.errai;
753,926
public void setMethodInvocationExceptionTranslator(final InvocationExceptionTranslator invocationExceptionTranslator) { this.invocationExceptionTranslator = invocationExceptionTranslator; }
void function(final InvocationExceptionTranslator invocationExceptionTranslator) { this.invocationExceptionTranslator = invocationExceptionTranslator; }
/** * Sets the exception translator that should be used to translate exceptions that occur duing method invocations. * * @param invocationExceptionTranslator the exception translator. * * @since 2.1 */
Sets the exception translator that should be used to translate exceptions that occur duing method invocations
setMethodInvocationExceptionTranslator
{ "repo_name": "tolo/JServer", "path": "src/java/com/teletalk/jserver/tcp/messaging/rpc/RpcHandler.java", "license": "apache-2.0", "size": 23520 }
[ "com.teletalk.jserver.util.exception.InvocationExceptionTranslator" ]
import com.teletalk.jserver.util.exception.InvocationExceptionTranslator;
import com.teletalk.jserver.util.exception.*;
[ "com.teletalk.jserver" ]
com.teletalk.jserver;
1,133,249
public boolean createUser(String username, String email) { ArrayList<String> users = null; Deserializer deserializer = new Deserializer(); ElasticsearchController.GetUserByNameTask getUserByNameTask = new ElasticsearchController.GetUserByNameTask(); getUserByNameTask.execute(username); try { users = getUserByNameTask.get(); } catch (InterruptedException e) { e.printStackTrace(); } catch (ExecutionException e) { e.printStackTrace(); } for (int i = 0; i < users.size(); i++) { User user = deserializer.deserializeUser(users.get(i)); if (user.getName().matches(username)) { return false; } } ElasticsearchController.CreateUserTask createUserTask = new ElasticsearchController.CreateUserTask(); createUserTask.execute(new User(username, email)); return true; }
boolean function(String username, String email) { ArrayList<String> users = null; Deserializer deserializer = new Deserializer(); ElasticsearchController.GetUserByNameTask getUserByNameTask = new ElasticsearchController.GetUserByNameTask(); getUserByNameTask.execute(username); try { users = getUserByNameTask.get(); } catch (InterruptedException e) { e.printStackTrace(); } catch (ExecutionException e) { e.printStackTrace(); } for (int i = 0; i < users.size(); i++) { User user = deserializer.deserializeUser(users.get(i)); if (user.getName().matches(username)) { return false; } } ElasticsearchController.CreateUserTask createUserTask = new ElasticsearchController.CreateUserTask(); createUserTask.execute(new User(username, email)); return true; }
/** * Attempts to create a <code>User</code> with the supplied username and email * * @param username the username of the user * @param email the email of the user * @return true if created, or false if username already in use * @see User */
Attempts to create a <code>User</code> with the supplied username and email
createUser
{ "repo_name": "CMPUT301W16T08/scaling-pancake", "path": "app/src/main/java/cmput301w16t08/scaling_pancake/controllers/Controller.java", "license": "apache-2.0", "size": 40858 }
[ "java.util.ArrayList", "java.util.concurrent.ExecutionException" ]
import java.util.ArrayList; import java.util.concurrent.ExecutionException;
import java.util.*; import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,999,493
public final Property<FxIndexRates> fxIndexRates() { return metaBean().fxIndexRates().createProperty(this); }
final Property<FxIndexRates> function() { return metaBean().fxIndexRates().createProperty(this); }
/** * Gets the the {@code fxIndexRates} property. * @return the property, not null */
Gets the the fxIndexRates property
fxIndexRates
{ "repo_name": "nssales/Strata", "path": "modules/pricer/src/test/java/com/opengamma/strata/pricer/rate/SimpleRatesProvider.java", "license": "apache-2.0", "size": 21778 }
[ "com.opengamma.strata.market.value.FxIndexRates", "org.joda.beans.Property" ]
import com.opengamma.strata.market.value.FxIndexRates; import org.joda.beans.Property;
import com.opengamma.strata.market.value.*; import org.joda.beans.*;
[ "com.opengamma.strata", "org.joda.beans" ]
com.opengamma.strata; org.joda.beans;
706,938
public static <K, V> Multimap<K, V> prune(Multimap<K, V> map, Predicate<? super Collection<V>> filterRule) { Preconditions.checkNotNull(map); Preconditions.checkNotNull(filterRule); Multimap<K, V> pruned = ArrayListMultimap.create(); Iterator<Map.Entry<K, Collection<V>>> asMapItr = map.asMap().entrySet().iterator(); while (asMapItr.hasNext()) { Map.Entry<K, Collection<V>> asMapEntry = asMapItr.next(); if (!filterRule.apply(asMapEntry.getValue())) { pruned.putAll(asMapEntry.getKey(), asMapEntry.getValue()); asMapItr.remove(); } } return pruned; } private static final class AtLeastSize implements Predicate<Collection<?>> { private final int minSize; AtLeastSize(int minSize) { Preconditions.checkArgument(minSize >= 0); this.minSize = minSize; }
static <K, V> Multimap<K, V> function(Multimap<K, V> map, Predicate<? super Collection<V>> filterRule) { Preconditions.checkNotNull(map); Preconditions.checkNotNull(filterRule); Multimap<K, V> pruned = ArrayListMultimap.create(); Iterator<Map.Entry<K, Collection<V>>> asMapItr = map.asMap().entrySet().iterator(); while (asMapItr.hasNext()) { Map.Entry<K, Collection<V>> asMapEntry = asMapItr.next(); if (!filterRule.apply(asMapEntry.getValue())) { pruned.putAll(asMapEntry.getKey(), asMapEntry.getValue()); asMapItr.remove(); } } return pruned; } private static final class AtLeastSize implements Predicate<Collection<?>> { private final int minSize; AtLeastSize(int minSize) { Preconditions.checkArgument(minSize >= 0); this.minSize = minSize; }
/** * Prunes a multimap based on a predicate, returning the pruned values. The input map will be * modified. * * @param map The multimap to prune. * @param filterRule The pruning rule. When the predicate returns {@code false} for an entry, it * will be pruned, otherwise it will be retained. * @param <K> The key type in the multimap. * @param <V> The value type in the multimap. * @return A new multimap, containing the pruned keys/values. */
Prunes a multimap based on a predicate, returning the pruned values. The input map will be modified
prune
{ "repo_name": "Yasumoto/commons", "path": "src/java/com/twitter/common/collections/Multimaps.java", "license": "apache-2.0", "size": 5150 }
[ "com.google.common.base.Preconditions", "com.google.common.base.Predicate", "com.google.common.collect.ArrayListMultimap", "com.google.common.collect.Multimap", "java.util.Collection", "java.util.Iterator", "java.util.Map" ]
import com.google.common.base.Preconditions; import com.google.common.base.Predicate; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Multimap; import java.util.Collection; import java.util.Iterator; import java.util.Map;
import com.google.common.base.*; import com.google.common.collect.*; import java.util.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
1,110,126
public TableGenerator<T> valueColumnName(String valueColumnName) { childNode.attribute("value-column-name", valueColumnName); return this; }
TableGenerator<T> function(String valueColumnName) { childNode.attribute(STR, valueColumnName); return this; }
/** * Sets the <code>value-column-name</code> attribute * @param valueColumnName the value for the attribute <code>value-column-name</code> * @return the current instance of <code>TableGenerator<T></code> */
Sets the <code>value-column-name</code> attribute
valueColumnName
{ "repo_name": "forge/javaee-descriptors", "path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/orm21/TableGeneratorImpl.java", "license": "epl-1.0", "size": 18732 }
[ "org.jboss.shrinkwrap.descriptor.api.orm21.TableGenerator" ]
import org.jboss.shrinkwrap.descriptor.api.orm21.TableGenerator;
import org.jboss.shrinkwrap.descriptor.api.orm21.*;
[ "org.jboss.shrinkwrap" ]
org.jboss.shrinkwrap;
2,425,450
public AzureFirewallNetworkRule withProtocols(List<AzureFirewallNetworkRuleProtocol> protocols) { this.protocols = protocols; return this; }
AzureFirewallNetworkRule function(List<AzureFirewallNetworkRuleProtocol> protocols) { this.protocols = protocols; return this; }
/** * Set array of AzureFirewallNetworkRuleProtocols. * * @param protocols the protocols value to set * @return the AzureFirewallNetworkRule object itself. */
Set array of AzureFirewallNetworkRuleProtocols
withProtocols
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/network/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/network/v2019_04_01/AzureFirewallNetworkRule.java", "license": "mit", "size": 4494 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
300,476
public MBeanNotificationInfo[] getNotificationInfo() { return new MBeanNotificationInfo[] { new MBeanNotificationInfo( new String[] { AttributeChangeNotification.ATTRIBUTE_CHANGE }, AttributeChangeNotification.class.getName(), "This notification is emitted when the reset() method is called.") }; } private String state = "initial state"; private int nbChanges = 0; private int nbResets = 0;
MBeanNotificationInfo[] function() { return new MBeanNotificationInfo[] { new MBeanNotificationInfo( new String[] { AttributeChangeNotification.ATTRIBUTE_CHANGE }, AttributeChangeNotification.class.getName(), STR) }; } private String state = STR; private int nbChanges = 0; private int nbResets = 0;
/** * Returns an array indicating, for each notification this MBean * may send, the name of the Java class of the notification and * the notification type.</p> * * @return the array of possible notifications. */
Returns an array indicating, for each notification this MBean may send, the name of the Java class of the notification and the notification type
getNotificationInfo
{ "repo_name": "linewx/Derecho", "path": "jmx/src/main/java/com/cloudrain/dercho/jmx/Basic/SimpleStandard.java", "license": "apache-2.0", "size": 6300 }
[ "javax.management.AttributeChangeNotification", "javax.management.MBeanNotificationInfo" ]
import javax.management.AttributeChangeNotification; import javax.management.MBeanNotificationInfo;
import javax.management.*;
[ "javax.management" ]
javax.management;
729,656
public PointF mapImageToView(PointF imagePoint) { float[] points = mTempValues; points[0] = imagePoint.x; points[1] = imagePoint.y; mapRelativeToAbsolute(points, points, 1); mActiveTransform.mapPoints(points, 0, points, 0, 1); return new PointF(points[0], points[1]); }
PointF function(PointF imagePoint) { float[] points = mTempValues; points[0] = imagePoint.x; points[1] = imagePoint.y; mapRelativeToAbsolute(points, points, 1); mActiveTransform.mapPoints(points, 0, points, 0, 1); return new PointF(points[0], points[1]); }
/** * Maps point from image-relative to view-absolute coordinates. This takes into account the * zoomable transformation. */
Maps point from image-relative to view-absolute coordinates. This takes into account the zoomable transformation
mapImageToView
{ "repo_name": "commons-app/apps-android-commons", "path": "app/src/main/java/fr/free/nrw/commons/media/zoomControllers/zoomable/DefaultZoomableController.java", "license": "apache-2.0", "size": 23912 }
[ "android.graphics.PointF" ]
import android.graphics.PointF;
import android.graphics.*;
[ "android.graphics" ]
android.graphics;
137,474
public final String getMixOutputFolder() { if (this.getSpec() != null) { if (this.getSpec().has(VerifierFields.VotePackingVerifierSpec.MIX_OUTPUT)) { try { return this.getSpec().getString(VerifierFields.VotePackingVerifierSpec.MIX_OUTPUT); } catch (JSONException e) { logger.error("There was a problem when getting the MIX_OUTPUT file from the spec object"); } } } return null; }
final String function() { if (this.getSpec() != null) { if (this.getSpec().has(VerifierFields.VotePackingVerifierSpec.MIX_OUTPUT)) { try { return this.getSpec().getString(VerifierFields.VotePackingVerifierSpec.MIX_OUTPUT); } catch (JSONException e) { logger.error(STR); } } } return null; }
/** * Getter for the location of the vote packing mix output folder * * @return spec.getString(MIX_OUTPUT) */
Getter for the location of the vote packing mix output folder
getMixOutputFolder
{ "repo_name": "jerumble/vVoteVerifier", "path": "src/com/vvote/verifier/component/votePacking/VotePackingVerifierSpec.java", "license": "gpl-3.0", "size": 4577 }
[ "com.vvote.thirdparty.json.orgjson.JSONException", "com.vvote.verifier.fields.VerifierFields" ]
import com.vvote.thirdparty.json.orgjson.JSONException; import com.vvote.verifier.fields.VerifierFields;
import com.vvote.thirdparty.json.orgjson.*; import com.vvote.verifier.fields.*;
[ "com.vvote.thirdparty", "com.vvote.verifier" ]
com.vvote.thirdparty; com.vvote.verifier;
1,447,190
@WebMethod @Path("/checkForUserInAuthzGroup") @Produces("text/plain") @GET public boolean checkForUserInAuthzGroup( @WebParam(name = "sessionid", partName = "sessionid") @QueryParam("sessionid") String sessionid, @WebParam(name = "authzgroupid", partName = "authzgroupid") @QueryParam("authzgroupid") String authzgroupid, @WebParam(name = "eid", partName = "eid") @QueryParam("eid") String eid) { Session s = establishSession(sessionid); if (ADMIN_SITE_REALM.equalsIgnoreCase(authzgroupid) && !securityService.isSuperUser(s.getUserId())) { LOG.warn("WS checkForUserInAuthzGroup(): Permission denied. Restricted to super users."); throw new RuntimeException("WS checkForUserInAuthzGroup(): Permission denied. Restricted to super users."); } try { AuthzGroup azg = authzGroupService.getAuthzGroup(authzgroupid); for (Iterator i = azg.getUsers().iterator(); i.hasNext(); ) { String id = (String) i.next(); User user = userDirectoryService.getUser(id); if (user.getEid().equals(eid)) { return true; } } return false; } catch (Exception e) { LOG.error("WS checkForUserInAuthzGroup(): " + e.getClass().getName() + " : " + e.getMessage()); return false; } }
@Path(STR) @Produces(STR) boolean function( @WebParam(name = STR, partName = STR) @QueryParam(STR) String sessionid, @WebParam(name = STR, partName = STR) @QueryParam(STR) String authzgroupid, @WebParam(name = "eid", partName = "eid") @QueryParam("eid") String eid) { Session s = establishSession(sessionid); if (ADMIN_SITE_REALM.equalsIgnoreCase(authzgroupid) && !securityService.isSuperUser(s.getUserId())) { LOG.warn(STR); throw new RuntimeException(STR); } try { AuthzGroup azg = authzGroupService.getAuthzGroup(authzgroupid); for (Iterator i = azg.getUsers().iterator(); i.hasNext(); ) { String id = (String) i.next(); User user = userDirectoryService.getUser(id); if (user.getEid().equals(eid)) { return true; } } return false; } catch (Exception e) { LOG.error(STR + e.getClass().getName() + STR + e.getMessage()); return false; } }
/** * Check if a user is in a particular authzgroup * * @param sessionid the id of a valid session, generally the admin user * @param authzgroupid the id of the authzgroup or site you want to check (if site: /site/SITEID) * @param eid the userid of the person you want to check * @return true if in site, false if not or error. * @throws RuntimeException */
Check if a user is in a particular authzgroup
checkForUserInAuthzGroup
{ "repo_name": "rodriguezdevera/sakai", "path": "webservices/cxf/src/java/org/sakaiproject/webservices/SakaiScript.java", "license": "apache-2.0", "size": 213282 }
[ "java.util.Iterator", "javax.jws.WebParam", "javax.ws.rs.Path", "javax.ws.rs.Produces", "javax.ws.rs.QueryParam", "org.sakaiproject.authz.api.AuthzGroup", "org.sakaiproject.tool.api.Session", "org.sakaiproject.user.api.User" ]
import java.util.Iterator; import javax.jws.WebParam; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import org.sakaiproject.authz.api.AuthzGroup; import org.sakaiproject.tool.api.Session; import org.sakaiproject.user.api.User;
import java.util.*; import javax.jws.*; import javax.ws.rs.*; import org.sakaiproject.authz.api.*; import org.sakaiproject.tool.api.*; import org.sakaiproject.user.api.*;
[ "java.util", "javax.jws", "javax.ws", "org.sakaiproject.authz", "org.sakaiproject.tool", "org.sakaiproject.user" ]
java.util; javax.jws; javax.ws; org.sakaiproject.authz; org.sakaiproject.tool; org.sakaiproject.user;
2,016,063
@Override @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-09-19T03:09:21-06:00", comment = "JAXB RI v2.2.6") public String toString() { return ToStringBuilder.reflectionToString(this, JAXBToStringStyle.MULTI_LINE_STYLE); }
@Generated(value = STR, date = STR, comment = STR) String function() { return ToStringBuilder.reflectionToString(this, JAXBToStringStyle.MULTI_LINE_STYLE); }
/** * Generates a String representation of the contents of this type. * This is an extension method, produced by the 'ts' xjc plugin * */
Generates a String representation of the contents of this type. This is an extension method, produced by the 'ts' xjc plugin
toString
{ "repo_name": "angecab10/travelport-uapi-tutorial", "path": "src/com/travelport/schema/common_v28_0/IndustryStandardSSR.java", "license": "gpl-3.0", "size": 3166 }
[ "javax.annotation.Generated", "org.apache.commons.lang.builder.ToStringBuilder", "org.apache.cxf.xjc.runtime.JAXBToStringStyle" ]
import javax.annotation.Generated; import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.cxf.xjc.runtime.JAXBToStringStyle;
import javax.annotation.*; import org.apache.commons.lang.builder.*; import org.apache.cxf.xjc.runtime.*;
[ "javax.annotation", "org.apache.commons", "org.apache.cxf" ]
javax.annotation; org.apache.commons; org.apache.cxf;
1,665,577
public void setOrganization(String organization) { if ((this.organization == null)) { if ((organization == null)) { return; } this.organization = new Name(); } this.organization.setValue(organization); }
void function(String organization) { if ((this.organization == null)) { if ((organization == null)) { return; } this.organization = new Name(); } this.organization.setValue(organization); }
/** * Missing description at method setOrganization. * * @param organization the String. */
Missing description at method setOrganization
setOrganization
{ "repo_name": "NABUCCO/org.nabucco.business.provision", "path": "org.nabucco.business.provision.facade.datatype/src/main/gen/org/nabucco/business/provision/facade/datatype/WorkExperience.java", "license": "epl-1.0", "size": 25378 }
[ "org.nabucco.framework.base.facade.datatype.Name" ]
import org.nabucco.framework.base.facade.datatype.Name;
import org.nabucco.framework.base.facade.datatype.*;
[ "org.nabucco.framework" ]
org.nabucco.framework;
1,271,265
public void descheduleFile(File file) { fileTaskCollector.removeFile(file); }
void function(File file) { fileTaskCollector.removeFile(file); }
/** * Removes a {@link File} instance previously scheduled with the * {@link Scheduler#scheduleFile(File)} method. * * @param file * The {@link File} instance. */
Removes a <code>File</code> instance previously scheduled with the <code>Scheduler#scheduleFile(File)</code> method
descheduleFile
{ "repo_name": "ieure/cron4j", "path": "src/main/java/it/sauronsoftware/cron4j/Scheduler.java", "license": "lgpl-2.1", "size": 22883 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
1,010,823
public ServiceFuture<PolicyDefinitionInner> getBuiltInAsync(String policyDefinitionName, final ServiceCallback<PolicyDefinitionInner> serviceCallback) { return ServiceFuture.fromResponse(getBuiltInWithServiceResponseAsync(policyDefinitionName), serviceCallback); }
ServiceFuture<PolicyDefinitionInner> function(String policyDefinitionName, final ServiceCallback<PolicyDefinitionInner> serviceCallback) { return ServiceFuture.fromResponse(getBuiltInWithServiceResponseAsync(policyDefinitionName), serviceCallback); }
/** * Retrieves a built-in policy definition. * This operation retrieves the built-in policy definition with the given name. * * @param policyDefinitionName The name of the built-in policy definition to get. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */
Retrieves a built-in policy definition. This operation retrieves the built-in policy definition with the given name
getBuiltInAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/policy/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/policy/v2019_09_01/implementation/PolicyDefinitionsInner.java", "license": "mit", "size": 83227 }
[ "com.microsoft.rest.ServiceCallback", "com.microsoft.rest.ServiceFuture" ]
import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
2,194,857
private boolean filter(IonType ion, IonModification mod) { IonModification add = ion.getAdduct(); // specific filters boolean bad = (add.contains(IonModification.NH4) && mod.contains(IonModification.NH3)); return !bad; }
boolean function(IonType ion, IonModification mod) { IonModification add = ion.getAdduct(); boolean bad = (add.contains(IonModification.NH4) && mod.contains(IonModification.NH3)); return !bad; }
/** * Only true if no filter is negative. Filter out -NH3+NH4 * * @param ion * @param mod * @return */
Only true if no filter is negative. Filter out -NH3+NH4
filter
{ "repo_name": "mzmine/mzmine3", "path": "src/main/java/io/github/mzmine/modules/dataprocessing/id_ion_identity_networking/ionidnetworking/IonNetworkLibrary.java", "license": "gpl-2.0", "size": 13871 }
[ "io.github.mzmine.datamodel.identities.iontype.IonModification", "io.github.mzmine.datamodel.identities.iontype.IonType" ]
import io.github.mzmine.datamodel.identities.iontype.IonModification; import io.github.mzmine.datamodel.identities.iontype.IonType;
import io.github.mzmine.datamodel.identities.iontype.*;
[ "io.github.mzmine" ]
io.github.mzmine;
1,721,941
public void ignorableWhitespace(char ch[], int start, int len) throws SAXException { super.contentHandler.ignorableWhitespace(ch, start, len); this.serializer.ignorableWhitespace(ch, start, len); }
void function(char ch[], int start, int len) throws SAXException { super.contentHandler.ignorableWhitespace(ch, start, len); this.serializer.ignorableWhitespace(ch, start, len); }
/** * Receive notification of ignorable whitespace in element content. */
Receive notification of ignorable whitespace in element content
ignorableWhitespace
{ "repo_name": "apache/cocoon", "path": "core/cocoon-pipeline/cocoon-pipeline-components/src/main/java/org/apache/cocoon/transformation/TeeTransformer.java", "license": "apache-2.0", "size": 11647 }
[ "org.xml.sax.SAXException" ]
import org.xml.sax.SAXException;
import org.xml.sax.*;
[ "org.xml.sax" ]
org.xml.sax;
632,261