method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public Map<Part, Integer> getParts() { return Collections.unmodifiableMap(parts); }
Map<Part, Integer> function() { return Collections.unmodifiableMap(parts); }
/** * Gets a map of parts and numbers. * * @return map. */
Gets a map of parts and numbers
getParts
{ "repo_name": "mars-sim/mars-sim", "path": "mars-sim-core/src/main/java/org/mars_sim/msp/core/structure/SettlementTemplate.java", "license": "gpl-3.0", "size": 6117 }
[ "java.util.Collections", "java.util.Map", "org.mars_sim.msp.core.resource.Part" ]
import java.util.Collections; import java.util.Map; import org.mars_sim.msp.core.resource.Part;
import java.util.*; import org.mars_sim.msp.core.resource.*;
[ "java.util", "org.mars_sim.msp" ]
java.util; org.mars_sim.msp;
2,629,067
@Test @Category(NeedsRunner.class) public void testExpandShardedWrite() throws IOException { runShardedWrite( Arrays.asList("one", "two", "three", "four", "five", "six"), IDENTITY_MAP, getBaseOutputFilename(), Optional.of(20)); }
@Category(NeedsRunner.class) void function() throws IOException { runShardedWrite( Arrays.asList("one", "two", "three", "four", "five", "six"), IDENTITY_MAP, getBaseOutputFilename(), Optional.of(20)); }
/** * Test that WriteFiles with a configured number of shards produces the desired number of shard * even when there are too few elements. */
Test that WriteFiles with a configured number of shards produces the desired number of shard even when there are too few elements
testExpandShardedWrite
{ "repo_name": "dhalperi/beam", "path": "sdks/java/core/src/test/java/org/apache/beam/sdk/io/WriteFilesTest.java", "license": "apache-2.0", "size": 17254 }
[ "com.google.common.base.Optional", "java.io.IOException", "java.util.Arrays", "org.apache.beam.sdk.testing.NeedsRunner", "org.junit.experimental.categories.Category" ]
import com.google.common.base.Optional; import java.io.IOException; import java.util.Arrays; import org.apache.beam.sdk.testing.NeedsRunner; import org.junit.experimental.categories.Category;
import com.google.common.base.*; import java.io.*; import java.util.*; import org.apache.beam.sdk.testing.*; import org.junit.experimental.categories.*;
[ "com.google.common", "java.io", "java.util", "org.apache.beam", "org.junit.experimental" ]
com.google.common; java.io; java.util; org.apache.beam; org.junit.experimental;
2,032,069
public static byte[] sha1Hash(byte[] input) { byte[] out; try { MessageDigest sDigest = MessageDigest.getInstance("SHA-1"); out = sDigest.digest(input); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); // Cannot happen } return out; }
static byte[] function(byte[] input) { byte[] out; try { MessageDigest sDigest = MessageDigest.getInstance("SHA-1"); out = sDigest.digest(input); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); } return out; }
/** * Calculate the SHA-1 hash of the input * * @param input The byte array to be hashed * @return The hashed result */
Calculate the SHA-1 hash of the input
sha1Hash
{ "repo_name": "Toporin/BitcoinCore", "path": "src/main/java/org/ScripterRon/BitcoinCore/Utils.java", "license": "apache-2.0", "size": 20671 }
[ "java.security.MessageDigest", "java.security.NoSuchAlgorithmException" ]
import java.security.MessageDigest; import java.security.NoSuchAlgorithmException;
import java.security.*;
[ "java.security" ]
java.security;
518,731
private void drawCursorVertical(int p_146188_1_, int p_146188_2_, int p_146188_3_, int p_146188_4_) { int var5; if(p_146188_1_ < p_146188_3_) { var5 = p_146188_1_; p_146188_1_ = p_146188_3_; p_146188_3_ = var5; } if(p_146188_2_ < p_146188_4_) { var5 = p_146188_2_; p_146188_2_ = p_146188_4_; p_146188_4_ = var5; } if(p_146188_3_ > xPosition + width) p_146188_3_ = xPosition + width; if(p_146188_1_ > xPosition + width) p_146188_1_ = xPosition + width; Tessellator var7 = Tessellator.getInstance(); WorldRenderer var6 = var7.getWorldRenderer(); GlStateManager.color(0.0F, 0.0F, 255.0F, 255.0F); GlStateManager.func_179090_x(); GlStateManager.enableColorLogic(); GlStateManager.colorLogicOp(5387); var6.startDrawingQuads(); var6.addVertex(p_146188_1_, p_146188_4_, 0.0D); var6.addVertex(p_146188_3_, p_146188_4_, 0.0D); var6.addVertex(p_146188_3_, p_146188_2_, 0.0D); var6.addVertex(p_146188_1_, p_146188_2_, 0.0D); var7.draw(); GlStateManager.disableColorLogic(); GlStateManager.func_179098_w(); }
void function(int p_146188_1_, int p_146188_2_, int p_146188_3_, int p_146188_4_) { int var5; if(p_146188_1_ < p_146188_3_) { var5 = p_146188_1_; p_146188_1_ = p_146188_3_; p_146188_3_ = var5; } if(p_146188_2_ < p_146188_4_) { var5 = p_146188_2_; p_146188_2_ = p_146188_4_; p_146188_4_ = var5; } if(p_146188_3_ > xPosition + width) p_146188_3_ = xPosition + width; if(p_146188_1_ > xPosition + width) p_146188_1_ = xPosition + width; Tessellator var7 = Tessellator.getInstance(); WorldRenderer var6 = var7.getWorldRenderer(); GlStateManager.color(0.0F, 0.0F, 255.0F, 255.0F); GlStateManager.func_179090_x(); GlStateManager.enableColorLogic(); GlStateManager.colorLogicOp(5387); var6.startDrawingQuads(); var6.addVertex(p_146188_1_, p_146188_4_, 0.0D); var6.addVertex(p_146188_3_, p_146188_4_, 0.0D); var6.addVertex(p_146188_3_, p_146188_2_, 0.0D); var6.addVertex(p_146188_1_, p_146188_2_, 0.0D); var7.draw(); GlStateManager.disableColorLogic(); GlStateManager.func_179098_w(); }
/** * draws the vertical line cursor in the textbox */
draws the vertical line cursor in the textbox
drawCursorVertical
{ "repo_name": "Elviond/Wurst-Client", "path": "Wurst Client/src/tk/wurst_client/gui/alts/GuiEmailField.java", "license": "mpl-2.0", "size": 16948 }
[ "net.minecraft.client.renderer.GlStateManager", "net.minecraft.client.renderer.Tessellator", "net.minecraft.client.renderer.WorldRenderer" ]
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.renderer.*;
[ "net.minecraft.client" ]
net.minecraft.client;
2,368,991
public HTTPRequest writeRequest(GHttpEndpoint endpoint, Exchange exchange, HTTPRequest request) throws Exception { HTTPRequest answer = new HTTPRequest( getRequestUrl(endpoint, exchange), getRequestMethod(endpoint, exchange)); writeRequestHeaders(endpoint, exchange, answer); writeRequestBody(endpoint, exchange, answer); return answer; } // ---------------------------------------------------------------- // Inbound binding // ----------------------------------------------------------------
HTTPRequest function(GHttpEndpoint endpoint, Exchange exchange, HTTPRequest request) throws Exception { HTTPRequest answer = new HTTPRequest( getRequestUrl(endpoint, exchange), getRequestMethod(endpoint, exchange)); writeRequestHeaders(endpoint, exchange, answer); writeRequestBody(endpoint, exchange, answer); return answer; }
/** * Reads data from <code>exchange</code> and writes it to a newly created * {@link HTTPRequest} instance. The <code>request</code> parameter is * ignored. * * @param endpoint * @param exchange * @param request * ignored. * @return a newly created {@link HTTPRequest} instance containing data from * <code>exchange</code>. */
Reads data from <code>exchange</code> and writes it to a newly created <code>HTTPRequest</code> instance. The <code>request</code> parameter is ignored
writeRequest
{ "repo_name": "everttigchelaar/camel-svn", "path": "components/camel-gae/src/main/java/org/apache/camel/component/gae/http/GHttpBinding.java", "license": "apache-2.0", "size": 8662 }
[ "com.google.appengine.api.urlfetch.HTTPRequest", "org.apache.camel.Exchange" ]
import com.google.appengine.api.urlfetch.HTTPRequest; import org.apache.camel.Exchange;
import com.google.appengine.api.urlfetch.*; import org.apache.camel.*;
[ "com.google.appengine", "org.apache.camel" ]
com.google.appengine; org.apache.camel;
426,465
public CompletableFuture<Result> delete(String address, int timeout) { return doNetwork(HttpMethod.DELETE, address, null, timeout); }
CompletableFuture<Result> function(String address, int timeout) { return doNetwork(HttpMethod.DELETE, address, null, timeout); }
/** * Perform a DELETE request * * @param address The address * @param timeout A timeout * @return The result * @throws IOException Any IO exception in an error case. */
Perform a DELETE request
delete
{ "repo_name": "clinique/openhab2", "path": "bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/netutils/AsyncHttpClient.java", "license": "epl-1.0", "size": 4652 }
[ "java.util.concurrent.CompletableFuture" ]
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
2,775,355
public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) { if (super.mousePressed(mc, mouseX, mouseY)) { this.field_175216_o = !this.field_175216_o; this.displayString = this.buildDisplayString(); this.guiResponder.func_175321_a(this.id, this.field_175216_o); return true; } else { return false; } }
boolean function(Minecraft mc, int mouseX, int mouseY) { if (super.mousePressed(mc, mouseX, mouseY)) { this.field_175216_o = !this.field_175216_o; this.displayString = this.buildDisplayString(); this.guiResponder.func_175321_a(this.id, this.field_175216_o); return true; } else { return false; } }
/** * Returns true if the mouse has been pressed on this control. Equivalent of MouseListener.mousePressed(MouseEvent * e). */
Returns true if the mouse has been pressed on this control. Equivalent of MouseListener.mousePressed(MouseEvent e)
mousePressed
{ "repo_name": "tomtomtom09/CampCraft", "path": "build/tmp/recompileMc/sources/net/minecraft/client/gui/GuiListButton.java", "license": "gpl-3.0", "size": 2059 }
[ "net.minecraft.client.Minecraft" ]
import net.minecraft.client.Minecraft;
import net.minecraft.client.*;
[ "net.minecraft.client" ]
net.minecraft.client;
1,786,886
public void unregisterWAR(String contextPath) throws Exception { Context context = this.host.map(contextPath); if (context != null) { this.embedded.removeContext(context); } else { throw new Exception("Context does not exist for named path : " + contextPath); } }
void function(String contextPath) throws Exception { Context context = this.host.map(contextPath); if (context != null) { this.embedded.removeContext(context); } else { throw new Exception(STR + contextPath); } }
/** * Unregisters a WAR from the web server. * * @param contextPath * - the context path to be removed */
Unregisters a WAR from the web server
unregisterWAR
{ "repo_name": "halayudha/bearded-octo-bugfixes", "path": "BestPeerDevelop/sg/edu/nus/webgui/Tomcat55.java", "license": "gpl-3.0", "size": 6462 }
[ "org.apache.catalina.Context" ]
import org.apache.catalina.Context;
import org.apache.catalina.*;
[ "org.apache.catalina" ]
org.apache.catalina;
2,274,383
@NotNull public static String getFileNameEncoding() { // TODO the best guess is that the default encoding is used. return Charset.defaultCharset().name(); }
static String function() { return Charset.defaultCharset().name(); }
/** * Get encoding that GIT uses for file names. */
Get encoding that GIT uses for file names
getFileNameEncoding
{ "repo_name": "leafclick/intellij-community", "path": "plugins/git4idea/src/git4idea/config/GitConfigUtil.java", "license": "apache-2.0", "size": 5926 }
[ "java.nio.charset.Charset" ]
import java.nio.charset.Charset;
import java.nio.charset.*;
[ "java.nio" ]
java.nio;
510,061
private void createPlayer() { debugLog("+++ createPlayer +++"); if (mPlayer == null) { mPlayer = new MediaPlayer();
void function() { debugLog(STR); if (mPlayer == null) { mPlayer = new MediaPlayer();
/** * Creates a media player for sound playback, with initial volume of 0. */
Creates a media player for sound playback, with initial volume of 0
createPlayer
{ "repo_name": "Sillson/roundware-android", "path": "rwservice/src/main/java/org/roundware/service/RWService.java", "license": "gpl-3.0", "size": 83769 }
[ "android.media.MediaPlayer" ]
import android.media.MediaPlayer;
import android.media.*;
[ "android.media" ]
android.media;
2,000,982
public static void checkScript(String text) { if (containsScript(text)) { throw new BotException("For security reasons, script and iframe tags are not allowed"); } }
static void function(String text) { if (containsScript(text)) { throw new BotException(STR); } }
/** * Check if the text contains a script. */
Check if the text contains a script
checkScript
{ "repo_name": "BOTlibre/BOTlibre", "path": "ai-engine/source/org/botlibre/util/Utils.java", "license": "epl-1.0", "size": 57729 }
[ "org.botlibre.BotException" ]
import org.botlibre.BotException;
import org.botlibre.*;
[ "org.botlibre" ]
org.botlibre;
2,707,748
private void skipVolume(DiskBalancerVolumeSet currentSet, DiskBalancerVolume volume) { if (LOG.isDebugEnabled()) { String message = String.format( "Skipping volume. Volume : %s " + "Type : %s Target " + "Number of bytes : %f lowVolume dfsUsed : %d. Skipping this " + "volume from all future balancing calls.", volume.getPath(), volume.getStorageType(), currentSet.getIdealUsed() * volume.getCapacity(), volume.getUsed()); LOG.debug(message); } volume.setSkip(true); }
void function(DiskBalancerVolumeSet currentSet, DiskBalancerVolume volume) { if (LOG.isDebugEnabled()) { String message = String.format( STR + STR + STR + STR, volume.getPath(), volume.getStorageType(), currentSet.getIdealUsed() * volume.getCapacity(), volume.getUsed()); LOG.debug(message); } volume.setSkip(true); }
/** * Skips this volume if needed. * * @param currentSet - Current Disk set * @param volume - Volume */
Skips this volume if needed
skipVolume
{ "repo_name": "nandakumar131/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/diskbalancer/planner/GreedyPlanner.java", "license": "apache-2.0", "size": 9542 }
[ "org.apache.hadoop.hdfs.server.diskbalancer.datamodel.DiskBalancerVolume" ]
import org.apache.hadoop.hdfs.server.diskbalancer.datamodel.DiskBalancerVolume;
import org.apache.hadoop.hdfs.server.diskbalancer.datamodel.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,653,243
public PredictionTree getChild(Item target) { for(PredictionTree child : Children) { if(child.Item.val.equals(target.val)) return child; } return null; }
PredictionTree function(Item target) { for(PredictionTree child : Children) { if(child.Item.val.equals(target.val)) return child; } return null; }
/** * Returns the prediction tree associated with the given child of this node */
Returns the prediction tree associated with the given child of this node
getChild
{ "repo_name": "ArneBinder/LanguageAnalyzer", "path": "src/main/java/ca/pfv/spmf/algorithms/sequenceprediction/ipredict/predictor/CPT/CPTPlus/PredictionTree.java", "license": "gpl-3.0", "size": 2520 }
[ "ca.pfv.spmf.algorithms.sequenceprediction.ipredict.database.Item" ]
import ca.pfv.spmf.algorithms.sequenceprediction.ipredict.database.Item;
import ca.pfv.spmf.algorithms.sequenceprediction.ipredict.database.*;
[ "ca.pfv.spmf" ]
ca.pfv.spmf;
378,370
public void setEventHeader(EventHeader eventHeader) { this.eventHeader = eventHeader; }
void function(EventHeader eventHeader) { this.eventHeader = eventHeader; }
/** * A custom Header object containing event details. Must implement the type javax.sip.header.EventHeader */
A custom Header object containing event details. Must implement the type javax.sip.header.EventHeader
setEventHeader
{ "repo_name": "DariusX/camel", "path": "components/camel-sip/src/main/java/org/apache/camel/component/sip/SipConfiguration.java", "license": "apache-2.0", "size": 30227 }
[ "javax.sip.header.EventHeader" ]
import javax.sip.header.EventHeader;
import javax.sip.header.*;
[ "javax.sip" ]
javax.sip;
2,500,027
private List<String> createAllModelTypeNames() { ToolboxLogger.log.config("Scanning simulation directories..."); int counter = 1; int stepSize = 25; List<String> modelTypeNameList = new ArrayList<>(); allDirs = new ArrayList<>(); for (Node node : projectSetting.getNode()) { File[] dirs = node.getPath().listFiles(f -> f.isDirectory()); for (File file : dirs) { allDirs.add(file); counter++; String name; String[] tokenValue = file.getName().split(RegEx.MODEL_TYPE_REG_EX.getName()); name = tokenValue[0]; if (!modelTypeNameList.contains(name) && name.length() > 0) { modelTypeNameList.add(name); } if (counter % stepSize == 0) { ToolboxLogger.log.config("Scanned " + counter + " files so far."); } } } ToolboxLogger.log.info("Found " + allDirs.size() + " directories and " + modelTypeNameList.size() + " models."); return modelTypeNameList; }
List<String> function() { ToolboxLogger.log.config(STR); int counter = 1; int stepSize = 25; List<String> modelTypeNameList = new ArrayList<>(); allDirs = new ArrayList<>(); for (Node node : projectSetting.getNode()) { File[] dirs = node.getPath().listFiles(f -> f.isDirectory()); for (File file : dirs) { allDirs.add(file); counter++; String name; String[] tokenValue = file.getName().split(RegEx.MODEL_TYPE_REG_EX.getName()); name = tokenValue[0]; if (!modelTypeNameList.contains(name) && name.length() > 0) { modelTypeNameList.add(name); } if (counter % stepSize == 0) { ToolboxLogger.log.config(STR + counter + STR); } } } ToolboxLogger.log.info(STR + allDirs.size() + STR + modelTypeNameList.size() + STR); return modelTypeNameList; }
/** * Create List with modeltype name. * * @return */
Create List with modeltype name
createAllModelTypeNames
{ "repo_name": "informatik-mannheim/Moduro-Toolbox", "path": "src/main/java/de/hs/mannheim/modUro/model/Project.java", "license": "apache-2.0", "size": 4391 }
[ "de.hs.mannheim.modUro.config.RegEx", "de.hs.mannheim.modUro.config.ToolboxLogger", "java.io.File", "java.util.ArrayList", "java.util.List" ]
import de.hs.mannheim.modUro.config.RegEx; import de.hs.mannheim.modUro.config.ToolboxLogger; import java.io.File; import java.util.ArrayList; import java.util.List;
import de.hs.mannheim.*; import java.io.*; import java.util.*;
[ "de.hs.mannheim", "java.io", "java.util" ]
de.hs.mannheim; java.io; java.util;
613,839
@Test public void testGetConnectionUrlValidParams() throws Exception { StringBuilder builder = new StringBuilder(); String expectedUrl = builder.append("jdbc:snowflake://").append(ACCOUNT).append(".").append("snowflakecomputing.com/") .append("?").append("warehouse=").append(WAREHOUSE).append("&").append("db=").append(DB).append("&") .append("schema=").append(SCHEMA).append("&").append("role=").append(ROLE) .append("&").append("application=Talend-").append(TALEND_PRODUCT_VERSION) .toString(); String resultUrl = snowflakeConnectionProperties.getConnectionUrl(); LOGGER.debug("result url: " + resultUrl); Assert.assertEquals(expectedUrl, resultUrl); }
void function() throws Exception { StringBuilder builder = new StringBuilder(); String expectedUrl = builder.append(STR?STRwarehouse=STR&STRdb=STR&STRschema=STR&STRrole=STR&STRapplication=Talend-STRresult url: " + resultUrl); Assert.assertEquals(expectedUrl, resultUrl); }
/** * Checks {@link SnowflakeConnectionProperties#getConnectionUrl()} returns {@link java.lang.String} snowflake url * when all params are valid */
Checks <code>SnowflakeConnectionProperties#getConnectionUrl()</code> returns <code>java.lang.String</code> snowflake url when all params are valid
testGetConnectionUrlValidParams
{ "repo_name": "Talend/components", "path": "components/components-snowflake/components-snowflake-definition/src/test/java/org/talend/components/snowflake/SnowflakeConnectionPropertiesTest.java", "license": "apache-2.0", "size": 19244 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
1,663,846
public Collection<String> getMultiValues() { if (isMultiValueSelected()) { return ((PathConstraintMultiValue) con).getValues(); } return null; }
Collection<String> function() { if (isMultiValueSelected()) { return ((PathConstraintMultiValue) con).getValues(); } return null; }
/** * Returns the value collection if the constraint is a multivalue, otherwise return null. * * @return a Collection of Strings */
Returns the value collection if the constraint is a multivalue, otherwise return null
getMultiValues
{ "repo_name": "drhee/toxoMine", "path": "intermine/web/main/src/org/intermine/web/logic/query/DisplayConstraint.java", "license": "lgpl-2.1", "size": 33874 }
[ "java.util.Collection", "org.intermine.pathquery.PathConstraintMultiValue" ]
import java.util.Collection; import org.intermine.pathquery.PathConstraintMultiValue;
import java.util.*; import org.intermine.pathquery.*;
[ "java.util", "org.intermine.pathquery" ]
java.util; org.intermine.pathquery;
1,143,473
public CppLinkActionBuilder setToolchainLibrariesSolibDir( PathFragment toolchainLibrariesSolibDir) { this.toolchainLibrariesSolibDir = toolchainLibrariesSolibDir; return this; }
CppLinkActionBuilder function( PathFragment toolchainLibrariesSolibDir) { this.toolchainLibrariesSolibDir = toolchainLibrariesSolibDir; return this; }
/** * Sets the name of the directory where the solib symlinks for the dynamic runtime libraries live. * This is usually automatically set from the cc_toolchain. */
Sets the name of the directory where the solib symlinks for the dynamic runtime libraries live. This is usually automatically set from the cc_toolchain
setToolchainLibrariesSolibDir
{ "repo_name": "dropbox/bazel", "path": "src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java", "license": "apache-2.0", "size": 62785 }
[ "com.google.devtools.build.lib.vfs.PathFragment" ]
import com.google.devtools.build.lib.vfs.PathFragment;
import com.google.devtools.build.lib.vfs.*;
[ "com.google.devtools" ]
com.google.devtools;
1,576,367
public ColorImage replaceHSIHuePlane(MonoImage plane) throws NIVisionException { return replaceFirstColorPlane(NIVision.ColorMode.HSI, plane); }
ColorImage function(MonoImage plane) throws NIVisionException { return replaceFirstColorPlane(NIVision.ColorMode.HSI, plane); }
/** * Set the hue color plane from the image when represented in HSI color space. * This does not create a new image, but modifies this one instead. Create a * copy before hand if you need to continue using the original. * * @param plane The MonoImage representing the new color plane. * @return The resulting image. */
Set the hue color plane from the image when represented in HSI color space. This does not create a new image, but modifies this one instead. Create a copy before hand if you need to continue using the original
replaceHSIHuePlane
{ "repo_name": "trc492/Frc2015RecycleRush", "path": "code/WPILibJ/image/ColorImage.java", "license": "mit", "size": 17214 }
[ "com.ni.vision.NIVision" ]
import com.ni.vision.NIVision;
import com.ni.vision.*;
[ "com.ni.vision" ]
com.ni.vision;
2,063,714
@ObjectiveCName("onDownloading:") void onDownloading(float progress);
@ObjectiveCName(STR) void onDownloading(float progress);
/** * On file started download * * @param progress progress in [0..1] */
On file started download
onDownloading
{ "repo_name": "EaglesoftZJ/actor-platform", "path": "actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/viewmodel/FileVMCallback.java", "license": "agpl-3.0", "size": 811 }
[ "com.google.j2objc.annotations.ObjectiveCName" ]
import com.google.j2objc.annotations.ObjectiveCName;
import com.google.j2objc.annotations.*;
[ "com.google.j2objc" ]
com.google.j2objc;
1,076,623
private Object resolvedCachedArgument(String beanName, Object cachedArgument) { if (cachedArgument instanceof DependencyDescriptor) { DependencyDescriptor descriptor = (DependencyDescriptor) cachedArgument; return this.beanFactory.resolveDependency(descriptor, beanName, null, null); } else if (cachedArgument instanceof RuntimeBeanReference) { return this.beanFactory.getBean(((RuntimeBeanReference) cachedArgument).getBeanName()); } else { return cachedArgument; } } private class AutowiredFieldElement extends InjectionMetadata.InjectedElement { private final boolean required; private volatile boolean cached = false; private volatile Object cachedFieldValue; public AutowiredFieldElement(Field field, boolean required) { super(field, null); this.required = required; }
Object function(String beanName, Object cachedArgument) { if (cachedArgument instanceof DependencyDescriptor) { DependencyDescriptor descriptor = (DependencyDescriptor) cachedArgument; return this.beanFactory.resolveDependency(descriptor, beanName, null, null); } else if (cachedArgument instanceof RuntimeBeanReference) { return this.beanFactory.getBean(((RuntimeBeanReference) cachedArgument).getBeanName()); } else { return cachedArgument; } } private class AutowiredFieldElement extends InjectionMetadata.InjectedElement { private final boolean required; private volatile boolean cached = false; private volatile Object cachedFieldValue; public AutowiredFieldElement(Field field, boolean required) { super(field, null); this.required = required; }
/** * Resolve the specified cached method argument or field value. */
Resolve the specified cached method argument or field value
resolvedCachedArgument
{ "repo_name": "sunpy1106/SpringBeanLifeCycle", "path": "src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java", "license": "apache-2.0", "size": 23986 }
[ "java.lang.reflect.Field", "org.springframework.beans.factory.config.DependencyDescriptor", "org.springframework.beans.factory.config.RuntimeBeanReference" ]
import java.lang.reflect.Field; import org.springframework.beans.factory.config.DependencyDescriptor; import org.springframework.beans.factory.config.RuntimeBeanReference;
import java.lang.reflect.*; import org.springframework.beans.factory.config.*;
[ "java.lang", "org.springframework.beans" ]
java.lang; org.springframework.beans;
2,029,109
public @Nullable PollTask getPollTask();
@Nullable PollTask function();
/** * Return {@link PollTask} represented by this thing. * * Note that the poll task might be <code>null</code> in case initialization is not complete. * * @return poll task represented by this poller */
Return <code>PollTask</code> represented by this thing. Note that the poll task might be <code>null</code> in case initialization is not complete
getPollTask
{ "repo_name": "aogorek/openhab2-addons", "path": "addons/binding/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/handler/ModbusPollerThingHandler.java", "license": "epl-1.0", "size": 1274 }
[ "org.eclipse.jdt.annotation.Nullable", "org.openhab.io.transport.modbus.PollTask" ]
import org.eclipse.jdt.annotation.Nullable; import org.openhab.io.transport.modbus.PollTask;
import org.eclipse.jdt.annotation.*; import org.openhab.io.transport.modbus.*;
[ "org.eclipse.jdt", "org.openhab.io" ]
org.eclipse.jdt; org.openhab.io;
2,802,485
public void setForcePersistence(boolean value) { this.forcePersistence = value; } /** * Gets the value of the any property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the any property. * * <p> * For example, to add a new item, do as follows: * <pre> * getAny().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Element } * {@link Object }
void function(boolean value) { this.forcePersistence = value; } /** * Gets the value of the any property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the any property. * * <p> * For example, to add a new item, do as follows: * <pre> * getAny().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Element } * {@link Object }
/** * Sets the value of the forcePersistence property. * */
Sets the value of the forcePersistence property
setForcePersistence
{ "repo_name": "fpompermaier/onvif", "path": "onvif-ws-client/src/main/java/org/onvif/ver10/deviceio/wsdl/SetAudioOutputConfiguration.java", "license": "apache-2.0", "size": 3914 }
[ "org.w3c.dom.Element" ]
import org.w3c.dom.Element;
import org.w3c.dom.*;
[ "org.w3c.dom" ]
org.w3c.dom;
1,590,949
PType<T> getType();
PType<T> getType();
/** * Returns the {@code PType} for this source. */
Returns the PType for this source
getType
{ "repo_name": "curryhuang/CBCrunch", "path": "crunch/src/main/java/org/apache/crunch/Source.java", "license": "apache-2.0", "size": 1773 }
[ "org.apache.crunch.types.PType" ]
import org.apache.crunch.types.PType;
import org.apache.crunch.types.*;
[ "org.apache.crunch" ]
org.apache.crunch;
2,174,437
Log.d(LOG_TAG, "onProgressData(byte[]) was not overriden, but callback was received"); }
Log.d(LOG_TAG, STR); }
/** * Fired when the request progress, override to handle in your own code * * @param responseBody response body received so far */
Fired when the request progress, override to handle in your own code
onProgressData
{ "repo_name": "silen85/shujutongji", "path": "android-async-http-master/library/src/main/java/com/loopj/android/http/DataAsyncHttpResponseHandler.java", "license": "gpl-2.0", "size": 5899 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
414,929
public static StandardClockModelElementV12 fromPerAligned(byte[] encodedBytes) { StandardClockModelElementV12 result = new StandardClockModelElementV12(); result.decodePerAligned(new BitStreamReader(encodedBytes)); return result; }
static StandardClockModelElementV12 function(byte[] encodedBytes) { StandardClockModelElementV12 result = new StandardClockModelElementV12(); result.decodePerAligned(new BitStreamReader(encodedBytes)); return result; }
/** * Creates a new StandardClockModelElementV12 from encoded stream. */
Creates a new StandardClockModelElementV12 from encoded stream
fromPerAligned
{ "repo_name": "google/supl-client", "path": "src/main/java/com/google/location/suplclient/asn1/supl2/rrlp_components/StandardClockModelElementV12.java", "license": "apache-2.0", "size": 27908 }
[ "com.google.location.suplclient.asn1.base.BitStreamReader" ]
import com.google.location.suplclient.asn1.base.BitStreamReader;
import com.google.location.suplclient.asn1.base.*;
[ "com.google.location" ]
com.google.location;
1,306,840
public static <M> ListTMonadZero<M> monadZero(Monad<M> mMonad) { return () -> mMonad; }
static <M> ListTMonadZero<M> function(Monad<M> mMonad) { return () -> mMonad; }
/** * The {@link MonadZero} instance of {@link ListT}. * * @param mMonad the {@link Monad} instance * @param <M> nested monadic type * @return the monadZero instance */
The <code>MonadZero</code> instance of <code>ListT</code>
monadZero
{ "repo_name": "highj/highj", "path": "src/main/java/org/highj/data/transformer/ListT.java", "license": "mit", "size": 30748 }
[ "org.highj.data.transformer.list.ListTMonadZero", "org.highj.typeclass1.monad.Monad" ]
import org.highj.data.transformer.list.ListTMonadZero; import org.highj.typeclass1.monad.Monad;
import org.highj.data.transformer.list.*; import org.highj.typeclass1.monad.*;
[ "org.highj.data", "org.highj.typeclass1" ]
org.highj.data; org.highj.typeclass1;
1,558,941
public String getDefaultUser() { String user = this.properties.get(PropertyDefinitions.PNAME_user); return isNullOrEmpty(user) ? "" : user; }
String function() { String user = this.properties.get(PropertyDefinitions.PNAME_user); return isNullOrEmpty(user) ? "" : user; }
/** * Returns the default user. Usually the one provided in the method {@link DriverManager#getConnection(String, String, String)} or as connection argument. * * @return the default user */
Returns the default user. Usually the one provided in the method <code>DriverManager#getConnection(String, String, String)</code> or as connection argument
getDefaultUser
{ "repo_name": "lamsfoundation/lams", "path": "3rdParty_sources/mysql-connector/com/mysql/cj/conf/ConnectionUrl.java", "license": "gpl-2.0", "size": 31953 }
[ "com.mysql.cj.util.StringUtils" ]
import com.mysql.cj.util.StringUtils;
import com.mysql.cj.util.*;
[ "com.mysql.cj" ]
com.mysql.cj;
682,410
private ExternalIntegrationInfo getDefaultExternalIntegrationInfo(String userUuid) { ExternalIntegrationInfo info = new ExternalIntegrationInfo(); info.setUserUuid(userUuid); return info; } @Setter private ProfileDao dao; @Setter private SakaiProxy sakaiProxy;
ExternalIntegrationInfo function(String userUuid) { ExternalIntegrationInfo info = new ExternalIntegrationInfo(); info.setUserUuid(userUuid); return info; } private ProfileDao dao; private SakaiProxy sakaiProxy;
/** * Get a default record, will only contain the userUuid * @param userUuid * @return */
Get a default record, will only contain the userUuid
getDefaultExternalIntegrationInfo
{ "repo_name": "ouit0408/sakai", "path": "profile2/impl/src/java/org/sakaiproject/profile2/logic/ProfileExternalIntegrationLogicImpl.java", "license": "apache-2.0", "size": 7200 }
[ "org.sakaiproject.profile2.dao.ProfileDao", "org.sakaiproject.profile2.model.ExternalIntegrationInfo" ]
import org.sakaiproject.profile2.dao.ProfileDao; import org.sakaiproject.profile2.model.ExternalIntegrationInfo;
import org.sakaiproject.profile2.dao.*; import org.sakaiproject.profile2.model.*;
[ "org.sakaiproject.profile2" ]
org.sakaiproject.profile2;
1,610,469
public int getRangeAxisCount() { return this.rangeAxes.size(); } /** * Clears the range axes from the plot and sends a {@link PlotChangeEvent}
int function() { return this.rangeAxes.size(); } /** * Clears the range axes from the plot and sends a {@link PlotChangeEvent}
/** * Returns the number of range axes. * * @return The axis count. * * @see #getDomainAxisCount() */
Returns the number of range axes
getRangeAxisCount
{ "repo_name": "GitoMat/jfreechart", "path": "src/main/java/org/jfree/chart/plot/XYPlot.java", "license": "lgpl-2.1", "size": 197216 }
[ "org.jfree.chart.event.PlotChangeEvent" ]
import org.jfree.chart.event.PlotChangeEvent;
import org.jfree.chart.event.*;
[ "org.jfree.chart" ]
org.jfree.chart;
1,415,349
private List<OrganisationalEntity> getOrganisationalEntityList(final List itemList) { final List<OrganisationalEntity> entryList = new ArrayList<OrganisationalEntity>(); final Iterator itemIterator = itemList.iterator(); while (itemIterator.hasNext()) { final Object item = itemIterator.next(); if (item instanceof BusinessGroup) { final BusinessGroup group = (BusinessGroup) item; entryList.add(new OrganisationalEntity(group.getKey(), group.getName())); } else if (item instanceof BGArea) { final BGArea area = (BGArea) item; entryList.add(new OrganisationalEntity(area.getKey(), area.getName())); } } return entryList; } private class OrganisationalEntityRole { private Long entityKey; private String roleInGroup; public OrganisationalEntityRole(final Long entityKey, final String roleInGroup) { super(); this.entityKey = entityKey; this.roleInGroup = roleInGroup; }
List<OrganisationalEntity> function(final List itemList) { final List<OrganisationalEntity> entryList = new ArrayList<OrganisationalEntity>(); final Iterator itemIterator = itemList.iterator(); while (itemIterator.hasNext()) { final Object item = itemIterator.next(); if (item instanceof BusinessGroup) { final BusinessGroup group = (BusinessGroup) item; entryList.add(new OrganisationalEntity(group.getKey(), group.getName())); } else if (item instanceof BGArea) { final BGArea area = (BGArea) item; entryList.add(new OrganisationalEntity(area.getKey(), area.getName())); } } return entryList; } private class OrganisationalEntityRole { private Long entityKey; private String roleInGroup; public OrganisationalEntityRole(final Long entityKey, final String roleInGroup) { super(); this.entityKey = entityKey; this.roleInGroup = roleInGroup; }
/** * Converts a list of items of a certain type (BusinessGroup,BGArea) in a list of OrganisationalEntitys. * * @param itemList * @return */
Converts a list of items of a certain type (BusinessGroup,BGArea) in a list of OrganisationalEntitys
getOrganisationalEntityList
{ "repo_name": "RLDevOps/Demo", "path": "src/main/java/org/olat/group/BusinessGroupArchiver.java", "license": "apache-2.0", "size": 37817 }
[ "java.util.ArrayList", "java.util.Iterator", "java.util.List", "org.olat.group.area.BGArea" ]
import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.olat.group.area.BGArea;
import java.util.*; import org.olat.group.area.*;
[ "java.util", "org.olat.group" ]
java.util; org.olat.group;
1,393,870
CubicInterpolationMode getCubicInterpolationMode();
CubicInterpolationMode getCubicInterpolationMode();
/** * Returns algorithm used to interpolate a smooth curve from the discrete data points. * * @return algorithm used to interpolate a smooth curve from the discrete data points. */
Returns algorithm used to interpolate a smooth curve from the discrete data points
getCubicInterpolationMode
{ "repo_name": "pepstock-org/Charba", "path": "src/org/pepstock/charba/client/defaults/IsDefaultLine.java", "license": "apache-2.0", "size": 2698 }
[ "org.pepstock.charba.client.enums.CubicInterpolationMode" ]
import org.pepstock.charba.client.enums.CubicInterpolationMode;
import org.pepstock.charba.client.enums.*;
[ "org.pepstock.charba" ]
org.pepstock.charba;
1,143,860
@Override public Date getModifiedDate();
Date function();
/** * Returns the modified date of this foo. * * @return the modified date of this foo */
Returns the modified date of this foo
getModifiedDate
{ "repo_name": "dcortes92/liferay-document-and-media-treeview", "path": "liferay7/plugins-sdk/portlets/test-service-builder-portlet/docroot/WEB-INF/service/com/liferay/sample/model/FooModel.java", "license": "gpl-3.0", "size": 7036 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
94,538
@Test public void test_toString() { assertNotNull(a.toString()); }
void function() { assertNotNull(a.toString()); }
/** * Check {@link Article#toString()}. */
Check <code>Article#toString()</code>
test_toString
{ "repo_name": "toastkidjp/Yobidashi", "path": "src/test/java/jp/toastkid/article/models/ArticleTest.java", "license": "epl-1.0", "size": 4137 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
2,315,442
@Override public void update(File file) throws Exception { if (templates.containsKey(file.getAbsolutePath())) { uninstall(file); install(file); } }
void function(File file) throws Exception { if (templates.containsKey(file.getAbsolutePath())) { uninstall(file); install(file); } }
/** * Update a pool template * <p/> * This method performs no actions if there is no pool registered for this file */
Update a pool template This method performs no actions if there is no pool registered for this file
update
{ "repo_name": "axemblr/axemblr-provisionr", "path": "core/src/main/java/com/axemblr/provisionr/core/templates/PoolTemplateInstaller.java", "license": "apache-2.0", "size": 3770 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
2,743,266
public void startReplicationMaster(String dbmaster, String host, int port, String replicationMode) throws StandardException { if (isReadOnly()) { throw StandardException.newException( SQLState.LOGMODULE_DOES_NOT_SUPPORT_REPLICATION); } RawTransaction t = xactFactory.findUserTransaction( this, ContextService.getFactory().getCurrentContextManager(), AccessFactoryGlobals.USER_TRANS_NAME); //back up blocking operations are unlogged operations. //Check if any unlogged operations are active and if //yes do not allow replication to start. if (t.isBlockingBackup()) { throw StandardException.newException( SQLState.REPLICATION_UNLOGGED_OPERATIONS_IN_PROGRESS); } Properties replicationProps = new Properties(); replicationProps.setProperty(MasterFactory.REPLICATION_MODE, replicationMode); MasterFactory masterFactory = (MasterFactory) Monitor.bootServiceModule(true, this, getMasterFactoryModule(), replicationProps); masterFactory.startMaster(this, dataFactory, logFactory, host, port, dbmaster); }
void function(String dbmaster, String host, int port, String replicationMode) throws StandardException { if (isReadOnly()) { throw StandardException.newException( SQLState.LOGMODULE_DOES_NOT_SUPPORT_REPLICATION); } RawTransaction t = xactFactory.findUserTransaction( this, ContextService.getFactory().getCurrentContextManager(), AccessFactoryGlobals.USER_TRANS_NAME); if (t.isBlockingBackup()) { throw StandardException.newException( SQLState.REPLICATION_UNLOGGED_OPERATIONS_IN_PROGRESS); } Properties replicationProps = new Properties(); replicationProps.setProperty(MasterFactory.REPLICATION_MODE, replicationMode); MasterFactory masterFactory = (MasterFactory) Monitor.bootServiceModule(true, this, getMasterFactoryModule(), replicationProps); masterFactory.startMaster(this, dataFactory, logFactory, host, port, dbmaster); }
/** * Start the replication master role for this database * @param dbmaster The master database that is being replicated. * @param host The hostname for the slave * @param port The port the slave is listening on * @param replicationMode The type of replication contract. * Currently only asynchronous replication is supported, but * 1-safe/2-safe/very-safe modes may be added later. * @exception StandardException 1) If replication is started on a read-only * database * 2) If replication is started when unlogged * operations are running * 3) If an error occurs while trying to boot * the master. */
Start the replication master role for this database
startReplicationMaster
{ "repo_name": "lpxz/grail-derby104", "path": "java/engine/org/apache/derby/impl/store/raw/RawStore.java", "license": "apache-2.0", "size": 100476 }
[ "java.util.Properties", "org.apache.derby.iapi.error.StandardException", "org.apache.derby.iapi.reference.SQLState", "org.apache.derby.iapi.services.context.ContextService", "org.apache.derby.iapi.services.monitor.Monitor", "org.apache.derby.iapi.store.access.AccessFactoryGlobals", "org.apache.derby.iapi.store.raw.xact.RawTransaction", "org.apache.derby.iapi.store.replication.master.MasterFactory" ]
import java.util.Properties; import org.apache.derby.iapi.error.StandardException; import org.apache.derby.iapi.reference.SQLState; import org.apache.derby.iapi.services.context.ContextService; import org.apache.derby.iapi.services.monitor.Monitor; import org.apache.derby.iapi.store.access.AccessFactoryGlobals; import org.apache.derby.iapi.store.raw.xact.RawTransaction; import org.apache.derby.iapi.store.replication.master.MasterFactory;
import java.util.*; import org.apache.derby.iapi.error.*; import org.apache.derby.iapi.reference.*; import org.apache.derby.iapi.services.context.*; import org.apache.derby.iapi.services.monitor.*; import org.apache.derby.iapi.store.access.*; import org.apache.derby.iapi.store.raw.xact.*; import org.apache.derby.iapi.store.replication.master.*;
[ "java.util", "org.apache.derby" ]
java.util; org.apache.derby;
1,368,692
public static Set<SocketOption<?>> serverSocketOptions() { return getInstance().options0(SOCK_STREAM, true); }
static Set<SocketOption<?>> function() { return getInstance().options0(SOCK_STREAM, true); }
/** * Returns the (possibly empty) set of extended socket options for * stream-oriented listening sockets. */
Returns the (possibly empty) set of extended socket options for stream-oriented listening sockets
serverSocketOptions
{ "repo_name": "mirkosertic/Bytecoder", "path": "classlib/java.base/src/main/resources/META-INF/modules/java.base/classes/sun/net/ext/ExtendedSocketOptions.java", "license": "apache-2.0", "size": 8213 }
[ "java.net.SocketOption", "java.util.Set" ]
import java.net.SocketOption; import java.util.Set;
import java.net.*; import java.util.*;
[ "java.net", "java.util" ]
java.net; java.util;
1,667,408
public Matrix3f getInterpolatedPhysicsRotation(Matrix3f rotation) { if (rotation == null) { rotation = new Matrix3f(); } rBody.getInterpolationWorldTransform(tempTrans); return Converter.convert(tempTrans.basis, rotation); }
Matrix3f function(Matrix3f rotation) { if (rotation == null) { rotation = new Matrix3f(); } rBody.getInterpolationWorldTransform(tempTrans); return Converter.convert(tempTrans.basis, rotation); }
/** * Gets the physics object rotation * @param rotation the rotation of the actual physics object is stored in this Matrix3f */
Gets the physics object rotation
getInterpolatedPhysicsRotation
{ "repo_name": "zzuegg/jmonkeyengine", "path": "jme3-jbullet/src/main/java/com/jme3/bullet/objects/PhysicsRigidBody.java", "license": "bsd-3-clause", "size": 25258 }
[ "com.jme3.bullet.util.Converter", "com.jme3.math.Matrix3f" ]
import com.jme3.bullet.util.Converter; import com.jme3.math.Matrix3f;
import com.jme3.bullet.util.*; import com.jme3.math.*;
[ "com.jme3.bullet", "com.jme3.math" ]
com.jme3.bullet; com.jme3.math;
1,732,509
protected static Filter createFilterQueueManager(String resourceId) throws InvalidSyntaxException { Properties properties = new Properties(); properties.setProperty(ResourceDescriptorConstants.CAPABILITY, "queue"); properties.setProperty(ResourceDescriptorConstants.CAPABILITY_NAME, resourceId); return createServiceFilter(IQueueManagerCapability.class.getName(), properties); }
static Filter function(String resourceId) throws InvalidSyntaxException { Properties properties = new Properties(); properties.setProperty(ResourceDescriptorConstants.CAPABILITY, "queue"); properties.setProperty(ResourceDescriptorConstants.CAPABILITY_NAME, resourceId); return createServiceFilter(IQueueManagerCapability.class.getName(), properties); }
/** * Necessary to get some capability type * * @param resourceId * @return Filter * @throws InvalidSyntaxException */
Necessary to get some capability type
createFilterQueueManager
{ "repo_name": "dana-i2cat/opennaas", "path": "extensions/bundles/router.capability.ospfv3/src/main/java/org/opennaas/extensions/router/capability/ospfv3/Activator.java", "license": "lgpl-3.0", "size": 4083 }
[ "java.util.Properties", "org.opennaas.core.resources.descriptor.ResourceDescriptorConstants", "org.opennaas.extensions.queuemanager.IQueueManagerCapability", "org.osgi.framework.Filter", "org.osgi.framework.InvalidSyntaxException" ]
import java.util.Properties; import org.opennaas.core.resources.descriptor.ResourceDescriptorConstants; import org.opennaas.extensions.queuemanager.IQueueManagerCapability; import org.osgi.framework.Filter; import org.osgi.framework.InvalidSyntaxException;
import java.util.*; import org.opennaas.core.resources.descriptor.*; import org.opennaas.extensions.queuemanager.*; import org.osgi.framework.*;
[ "java.util", "org.opennaas.core", "org.opennaas.extensions", "org.osgi.framework" ]
java.util; org.opennaas.core; org.opennaas.extensions; org.osgi.framework;
2,750,803
ServiceResponse<Void> putResourceCollection() throws ErrorException, IOException;
ServiceResponse<Void> putResourceCollection() throws ErrorException, IOException;
/** * Put External Resource as a ResourceCollection. * * @throws ErrorException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @return the {@link ServiceResponse} object if successful. */
Put External Resource as a ResourceCollection
putResourceCollection
{ "repo_name": "stankovski/AutoRest", "path": "AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/modelflattening/AutoRestResourceFlatteningTestService.java", "license": "mit", "size": 16224 }
[ "com.microsoft.rest.ServiceResponse", "java.io.IOException" ]
import com.microsoft.rest.ServiceResponse; import java.io.IOException;
import com.microsoft.rest.*; import java.io.*;
[ "com.microsoft.rest", "java.io" ]
com.microsoft.rest; java.io;
1,891,768
private void readRatingFile() throws DataLoaderException { try (final BufferedReader reader = new BufferedReader( new FileReader(Globals.RATING_FILE_PATH));) { String line; line = reader.readLine(); while (line.contains("user")) { line = reader.readLine(); } String[] tokens; int maxUserId = -1; int maxItemId = -1; float maxRating = -1; float minRating = 10000000; while (line != null) { if (line.trim().startsWith("//")) { line = reader.readLine(); continue; } tokens = line.split(Globals.RATING_FILE_SEPERATOR); final float rating = Float.parseFloat(tokens[2]); final int userId = Integer.parseInt(tokens[0]); if (userId > maxUserId) { maxUserId = userId; } final int itemId = Integer.parseInt(tokens[1]); if(doNotAddList.contains(itemId)){ line = reader.readLine(); continue; } if (itemId > maxItemId) { maxItemId = itemId; } if (rating > maxRating) { maxRating = rating; Globals.setMaxRating(maxRating); } if (rating < minRating) { minRating = rating; Globals.setMinRating(minRating); } if (this.dataModel.getUser(userId) != null) { this.dataModel.getUser(userId).addItemRating(itemId, rating); } else { final User user = new User(userId); user.addItemRating(itemId, rating); this.dataModel.addUser(user); } if (this.dataModel.getItem(itemId) != null) { this.dataModel.getItem(itemId).addUserRating(userId, rating); } else { final Item item = new Item(itemId); item.addUserRating(userId, rating); this.dataModel.addItem(item); } this.dataModel.addRating(new Rating(userId, itemId, rating)); line = reader.readLine(); } Globals.setMaxNumberOfUsers(maxUserId); Globals.setMaxNumberOfItems(maxItemId); reader.close(); if(!alreadyReduced){ LOG.info("Rating Data loaded from "+Globals.RATING_FILE_PATH); } } catch (final Exception exception) { throw new DataLoaderException("Can not load rating file: " + Globals.RATING_FILE_PATH, exception); } }
void function() throws DataLoaderException { try (final BufferedReader reader = new BufferedReader( new FileReader(Globals.RATING_FILE_PATH));) { String line; line = reader.readLine(); while (line.contains("user")) { line = reader.readLine(); } String[] tokens; int maxUserId = -1; int maxItemId = -1; float maxRating = -1; float minRating = 10000000; while (line != null) { if (line.trim().startsWith(STRRating Data loaded from STRCan not load rating file: " + Globals.RATING_FILE_PATH, exception); } }
/** * Reads rating files. * @throws DataLoaderException */
Reads rating files
readRatingFile
{ "repo_name": "fmoghaddam/RecommendationEngine", "path": "src/main/java/controller/DataLoader.java", "license": "mit", "size": 15475 }
[ "java.io.BufferedReader", "java.io.FileReader" ]
import java.io.BufferedReader; import java.io.FileReader;
import java.io.*;
[ "java.io" ]
java.io;
700,630
public static Test suite() { //NetworkServerTestSetup.setWaitTime( 10000L ); TestSuite suite = new TestSuite("SecureServerTest"); // Server booting requires that we run from the jar files if ( !TestConfiguration.loadingFromJars() ) { return suite; } // Need derbynet.jar in the classpath! if (!Derby.hasServer()) return suite; // O = Overriden // A = Authenticated // C = Custom properties // W = Wildcard host // // .addTest( decorateTest( O, A, C, W, Outcome ) ); // suite.addTest( decorateTest( false, false, null, null, RUNNING_SECURITY_BOOTED ) ); suite.addTest( decorateTest( false, false, BASIC, null, RUNNING_SECURITY_BOOTED ) ); suite.addTest( decorateTest( false, true, null, null, RUNNING_SECURITY_BOOTED ) ); suite.addTest( decorateTest( false, true, null, HOSTW, RUNNING_SECURITY_BOOTED ) ); suite.addTest( decorateTest( false, true, null, ALTW, RUNNING_SECURITY_BOOTED ) ); // this wildcard port is rejected by the server right now //suite.addTest( decorateTest( false, true, null, IPV6W, RUNNING_SECURITY_BOOTED ) ); suite.addTest( decorateTest( true, false, null, null, RUNNING_SECURITY_NOT_BOOTED ) ); suite.addTest( decorateTest( true, true, null, null, RUNNING_SECURITY_NOT_BOOTED ) ); return suite; } /////////////////////////////////////////////////////////////////////////////////// // // TEST DECORATION // ///////////////////////////////////////////////////////////////////////////////////
static Test function() { TestSuite suite = new TestSuite(STR); if ( !TestConfiguration.loadingFromJars() ) { return suite; } if (!Derby.hasServer()) return suite; suite.addTest( decorateTest( false, false, null, null, RUNNING_SECURITY_BOOTED ) ); suite.addTest( decorateTest( false, false, BASIC, null, RUNNING_SECURITY_BOOTED ) ); suite.addTest( decorateTest( false, true, null, null, RUNNING_SECURITY_BOOTED ) ); suite.addTest( decorateTest( false, true, null, HOSTW, RUNNING_SECURITY_BOOTED ) ); suite.addTest( decorateTest( false, true, null, ALTW, RUNNING_SECURITY_BOOTED ) ); suite.addTest( decorateTest( true, false, null, null, RUNNING_SECURITY_NOT_BOOTED ) ); suite.addTest( decorateTest( true, true, null, null, RUNNING_SECURITY_NOT_BOOTED ) ); return suite; }
/** * Tests to run. */
Tests to run
suite
{ "repo_name": "scnakandala/derby", "path": "java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SecureServerTest.java", "license": "apache-2.0", "size": 17001 }
[ "junit.framework.Test", "junit.framework.TestSuite", "org.apache.derbyTesting.junit.Derby", "org.apache.derbyTesting.junit.TestConfiguration" ]
import junit.framework.Test; import junit.framework.TestSuite; import org.apache.derbyTesting.junit.Derby; import org.apache.derbyTesting.junit.TestConfiguration;
import junit.framework.*; import org.apache.*;
[ "junit.framework", "org.apache" ]
junit.framework; org.apache;
1,855,793
public DeweyNumber addStage() { int[] newDeweyNumber = Arrays.copyOf(deweyNumber, deweyNumber.length + 1); return new DeweyNumber(newDeweyNumber); }
DeweyNumber function() { int[] newDeweyNumber = Arrays.copyOf(deweyNumber, deweyNumber.length + 1); return new DeweyNumber(newDeweyNumber); }
/** * Creates a new dewey number from this such that a 0 is appended as new last digit. * * @return A new dewey number which contains this as a prefix and has 0 as last digit */
Creates a new dewey number from this such that a 0 is appended as new last digit
addStage
{ "repo_name": "jinglining/flink", "path": "flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/DeweyNumber.java", "license": "apache-2.0", "size": 8145 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
2,633,028
Configuration.set(PropertyKey.USER_BLOCK_SIZE_BYTES_DEFAULT, "64MB"); CreateFileOptions options = CreateFileOptions.defaults(); Assert.assertEquals(64 * Constants.MB, options.getBlockSizeBytes()); Assert.assertEquals("", options.getOwner()); Assert.assertEquals("", options.getGroup()); Assert.assertEquals(Mode.defaults().applyFileUMask(), options.getMode()); Assert.assertFalse(options.isPersisted()); Assert.assertFalse(options.isRecursive()); Assert.assertEquals(Constants.NO_TTL, options.getTtl()); Assert.assertEquals(TtlAction.DELETE, options.getTtlAction()); ConfigurationTestUtils.resetConfiguration(); }
Configuration.set(PropertyKey.USER_BLOCK_SIZE_BYTES_DEFAULT, "64MB"); CreateFileOptions options = CreateFileOptions.defaults(); Assert.assertEquals(64 * Constants.MB, options.getBlockSizeBytes()); Assert.assertEquals(STR", options.getGroup()); Assert.assertEquals(Mode.defaults().applyFileUMask(), options.getMode()); Assert.assertFalse(options.isPersisted()); Assert.assertFalse(options.isRecursive()); Assert.assertEquals(Constants.NO_TTL, options.getTtl()); Assert.assertEquals(TtlAction.DELETE, options.getTtlAction()); ConfigurationTestUtils.resetConfiguration(); }
/** * Tests the {@link CreateFileOptions#defaults()} method. */
Tests the <code>CreateFileOptions#defaults()</code> method
defaults
{ "repo_name": "yuluo-ding/alluxio", "path": "core/server/master/src/test/java/alluxio/master/file/options/CreateFileOptionsTest.java", "license": "apache-2.0", "size": 3414 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
2,684,517
boolean decode(ImmutableBytesWritable ptr, int index);
boolean decode(ImmutableBytesWritable ptr, int index);
/** * sets the ptr to the column value at the given index * @return false if the column value is absent (used to support DEFAULT expressions) or else true */
sets the ptr to the column value at the given index
decode
{ "repo_name": "shehzaadn/phoenix", "path": "phoenix-core/src/main/java/org/apache/phoenix/schema/ColumnValueDecoder.java", "license": "apache-2.0", "size": 1250 }
[ "org.apache.hadoop.hbase.io.ImmutableBytesWritable" ]
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
import org.apache.hadoop.hbase.io.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,476,697
public SSLSocketFactory getAuthenticatedModeSSLSocketFactory() { return authenticatedModeSSLSocketFactory; }
SSLSocketFactory function() { return authenticatedModeSSLSocketFactory; }
/** * Returns the SSLSocketFactory that gets used when connecting to * CouchDB over a <code>https</code> URL, when SSL authentication is * enabled. * * @return An SSLSocketFactory, or <code>null</code>, which stands for * the default SSLSocketFactory of the JRE. * @see #setAuthenticatedModeSSLSocketFactory(javax.net.ssl.SSLSocketFactory) */
Returns the SSLSocketFactory that gets used when connecting to CouchDB over a <code>https</code> URL, when SSL authentication is enabled
getAuthenticatedModeSSLSocketFactory
{ "repo_name": "digitalheir/dutch-case-law-to-couchdb", "path": "src/main/java/com/cloudant/client/org/lightcouch/CouchDbProperties.java", "license": "mit", "size": 6365 }
[ "javax.net.ssl.SSLSocketFactory" ]
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.*;
[ "javax.net" ]
javax.net;
1,875,515
@Test public void checkAirportStats (TestContext context) { System.out.println(this.getClass().getSimpleName() + " | test 3 | checkAirportStats on port " + port); Async async = context.async(); vertx.createHttpClient().getNow(port, "localhost", "/api/stats/airports", response -> { context.assertEquals(response.statusCode(), 200); response.bodyHandler(body -> { JsonObject jsonResponse = new JsonObject(body.toString()); JsonObject byRegionObject = jsonResponse.getJsonObject("byRegionMap"); context.assertEquals(153, jsonResponse.getInteger("totalUsedAirports")); context.assertEquals(122, jsonResponse.getInteger("northernAirports")); context.assertEquals(31, jsonResponse.getInteger("southernAirports")); context.assertEquals(31, byRegionObject.getInteger("Asia")); context.assertEquals(6, byRegionObject.getInteger("Pacific")); context.assertEquals(54, byRegionObject.getInteger("Europe")); context.assertEquals(40, byRegionObject.getInteger("America")); context.assertEquals(10, byRegionObject.getInteger("Africa")); async.complete(); }); }); }
void function (TestContext context) { System.out.println(this.getClass().getSimpleName() + STR + port); Async async = context.async(); vertx.createHttpClient().getNow(port, STR, STR, response -> { context.assertEquals(response.statusCode(), 200); response.bodyHandler(body -> { JsonObject jsonResponse = new JsonObject(body.toString()); JsonObject byRegionObject = jsonResponse.getJsonObject(STR); context.assertEquals(153, jsonResponse.getInteger(STR)); context.assertEquals(122, jsonResponse.getInteger(STR)); context.assertEquals(31, jsonResponse.getInteger(STR)); context.assertEquals(31, byRegionObject.getInteger("Asia")); context.assertEquals(6, byRegionObject.getInteger(STR)); context.assertEquals(54, byRegionObject.getInteger(STR)); context.assertEquals(40, byRegionObject.getInteger(STR)); context.assertEquals(10, byRegionObject.getInteger(STR)); async.complete(); }); }); }
/** * Check that Application returns airport stats */
Check that Application returns airport stats
checkAirportStats
{ "repo_name": "sasa-radovanovic/ff-flight-diary", "path": "src/test/java/frequentFlyer/flight_diary/FlightDiaryApplicationTest.java", "license": "mit", "size": 15967 }
[ "io.vertx.core.json.JsonObject", "io.vertx.ext.unit.Async", "io.vertx.ext.unit.TestContext" ]
import io.vertx.core.json.JsonObject; import io.vertx.ext.unit.Async; import io.vertx.ext.unit.TestContext;
import io.vertx.core.json.*; import io.vertx.ext.unit.*;
[ "io.vertx.core", "io.vertx.ext" ]
io.vertx.core; io.vertx.ext;
978,297
void removeInvalid(String cacheName) { try { List<Ignite> nodes = nodes(); assertFalse(nodes.isEmpty()); for (Ignite node : nodes) node.cache(cacheName).remove(KEY_VAL); fail("Topology validation broken"); } catch (CacheException ex) { assert ex.getCause() instanceof IgniteCheckedException && ex.getCause().getMessage().contains("cache topology is not valid"); } }
void removeInvalid(String cacheName) { try { List<Ignite> nodes = nodes(); assertFalse(nodes.isEmpty()); for (Ignite node : nodes) node.cache(cacheName).remove(KEY_VAL); fail(STR); } catch (CacheException ex) { assert ex.getCause() instanceof IgniteCheckedException && ex.getCause().getMessage().contains(STR); } }
/** * Remove when topology is invalid. * * @param cacheName cache name. */
Remove when topology is invalid
removeInvalid
{ "repo_name": "irudyak/ignite", "path": "modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTopologyValidatorAbstractCacheTest.java", "license": "apache-2.0", "size": 8274 }
[ "java.util.List", "javax.cache.CacheException", "org.apache.ignite.Ignite", "org.apache.ignite.IgniteCheckedException" ]
import java.util.List; import javax.cache.CacheException; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCheckedException;
import java.util.*; import javax.cache.*; import org.apache.ignite.*;
[ "java.util", "javax.cache", "org.apache.ignite" ]
java.util; javax.cache; org.apache.ignite;
2,752,044
public ClassifierGuide getGuide() { return parsingAlgorithm.getGuide(); }
ClassifierGuide function() { return parsingAlgorithm.getGuide(); }
/** * Returns the guide * * @return the guide */
Returns the guide
getGuide
{ "repo_name": "jhamalt/maltparser", "path": "src/org/maltparser/parser/SingleMalt.java", "license": "bsd-3-clause", "size": 21901 }
[ "org.maltparser.parser.guide.ClassifierGuide" ]
import org.maltparser.parser.guide.ClassifierGuide;
import org.maltparser.parser.guide.*;
[ "org.maltparser.parser" ]
org.maltparser.parser;
267,043
private void jLabel2MouseClicked(final MouseEvent evt) { //GEN-FIRST:event_jLabel2MouseClicked cardLayout.show(panMainCard, "arbeitsstand"); updateFooterControls(); } //GEN-LAST:event_jLabel2MouseClicked
void function(final MouseEvent evt) { cardLayout.show(panMainCard, STR); updateFooterControls(); }
/** * DOCUMENT ME! * * @param evt DOCUMENT ME! */
DOCUMENT ME
jLabel2MouseClicked
{ "repo_name": "cismet/cids-custom-wuppertal", "path": "src/main/java/de/cismet/cids/custom/objecteditors/wunda_blau/AlboFlaecheEditor.java", "license": "lgpl-3.0", "size": 33562 }
[ "java.awt.event.MouseEvent" ]
import java.awt.event.MouseEvent;
import java.awt.event.*;
[ "java.awt" ]
java.awt;
852,307
void startRMIRegistry() throws RemoteException;
void startRMIRegistry() throws RemoteException;
/** * Start RMI registry with the PORT specified. * * @throws RemoteException when fail */
Start RMI registry with the PORT specified
startRMIRegistry
{ "repo_name": "FrancescoSantagati/java-agent-middleware", "path": "jam/src/main/java/it/francescosantagati/jam/ADSL.java", "license": "mit", "size": 2605 }
[ "java.rmi.RemoteException" ]
import java.rmi.RemoteException;
import java.rmi.*;
[ "java.rmi" ]
java.rmi;
815,886
public int getUnreadNotificationsCount() { return getDriver().findElementsWithoutWaiting(By.cssSelector( "li#tmNotifications div.notification-event-unread")).size(); }
int function() { return getDriver().findElementsWithoutWaiting(By.cssSelector( STR)).size(); }
/** * Get the number of unread notifications. * * @return number of unread notifications */
Get the number of unread notifications
getUnreadNotificationsCount
{ "repo_name": "xwiki/xwiki-platform", "path": "xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-test/xwiki-platform-notifications-test-pageobjects/src/main/java/org/xwiki/platform/notifications/test/po/NotificationsTrayPage.java", "license": "lgpl-2.1", "size": 18180 }
[ "org.openqa.selenium.By" ]
import org.openqa.selenium.By;
import org.openqa.selenium.*;
[ "org.openqa.selenium" ]
org.openqa.selenium;
724,545
protected boolean handleFailure(Throwable failure) throws Throwable { return fail(failure); } /** * Attempts to apply the provided resultValue as the result of this {@link Future}. * * @return {@code true} if the provided result was applied to the associated {@link Future} (and will thus be * returned from calls to {@link #get}); * <p> * {@code false} if the Future was already completed by an earlier call to {@link #succeed}, {@link #fail}, * or {@link #cancel}
boolean function(Throwable failure) throws Throwable { return fail(failure); } /** * Attempts to apply the provided resultValue as the result of this {@link Future}. * * @return {@code true} if the provided result was applied to the associated {@link Future} (and will thus be * returned from calls to {@link #get}); * <p> * {@code false} if the Future was already completed by an earlier call to {@link #succeed}, {@link #fail}, * or {@link #cancel}
/** * Invoked by the public {@link #setFailure} to handle application of the given error. Overridable to intercept and * impose custom handling upon a failed outcome. Implementations should generally lead to an invocation of either * {@link #succeed} or {@link #fail}. * * @return {@code true} if the provided failure was applied to the associated {@link Future} (and will thus be * thrown from calls to {@link #get}); usually the result of calling {@link #fail}(failure). */
Invoked by the public <code>#setFailure</code> to handle application of the given error. Overridable to intercept and impose custom handling upon a failed outcome. Implementations should generally lead to an invocation of either <code>#succeed</code> or <code>#fail</code>
handleFailure
{ "repo_name": "joshng/papaya", "path": "papaya/src/main/java/com/joshng/util/concurrent/Promise.java", "license": "bsd-2-clause", "size": 9567 }
[ "java.util.concurrent.Future" ]
import java.util.concurrent.Future;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,192,033
@Test public void testUpdateLayerStyles() { GeoServerClient client = new GeoServerClient(); assertFalse(client.updateLayerStyles(null)); }
void function() { GeoServerClient client = new GeoServerClient(); assertFalse(client.updateLayerStyles(null)); }
/** * Test method for {@link * com.sldeditor.extension.filesystem.geoserver.client.GeoServerClient#updateLayerStyles(com.sldeditor.common.data.GeoServerLayer, * com.sldeditor.common.data.StyleWrapper)}. */
Test method for <code>com.sldeditor.extension.filesystem.geoserver.client.GeoServerClient#updateLayerStyles(com.sldeditor.common.data.GeoServerLayer, com.sldeditor.common.data.StyleWrapper)</code>
testUpdateLayerStyles
{ "repo_name": "robward-scisys/sldeditor", "path": "modules/application/src/test/java/com/sldeditor/test/unit/extension/filesystem/geoserver/client/GeoServerClientTest.java", "license": "gpl-3.0", "size": 15355 }
[ "com.sldeditor.extension.filesystem.geoserver.client.GeoServerClient", "org.junit.jupiter.api.Assertions" ]
import com.sldeditor.extension.filesystem.geoserver.client.GeoServerClient; import org.junit.jupiter.api.Assertions;
import com.sldeditor.extension.filesystem.geoserver.client.*; import org.junit.jupiter.api.*;
[ "com.sldeditor.extension", "org.junit.jupiter" ]
com.sldeditor.extension; org.junit.jupiter;
2,092,640
@Override public String getDatabaseProductName() throws SQLException { return "PostgreSQL"; }
String function() throws SQLException { return STR; }
/** * Retrieves the name of this database product. We hope that it is PostgreSQL, so we return that * explicitly. * * @return "PostgreSQL" */
Retrieves the name of this database product. We hope that it is PostgreSQL, so we return that explicitly
getDatabaseProductName
{ "repo_name": "zapov/pgjdbc", "path": "pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java", "license": "bsd-2-clause", "size": 96932 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,832,426
EList<AndType> getAnd();
EList<AndType> getAnd();
/** * Returns the value of the '<em><b>And</b></em>' containment reference list. * The list contents are of type {@link org.liquibase.xml.ns.dbchangelog.AndType}. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>And</em>' containment reference list isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>And</em>' containment reference list. * @see org.liquibase.xml.ns.dbchangelog.DbchangelogPackage#getOrType_And() * @model containment="true" transient="true" volatile="true" derived="true" * extendedMetaData="kind='element' name='and' namespace='##targetNamespace' group='#group:0'" * @generated */
Returns the value of the 'And' containment reference list. The list contents are of type <code>org.liquibase.xml.ns.dbchangelog.AndType</code>. If the meaning of the 'And' containment reference list isn't clear, there really should be more of a description here...
getAnd
{ "repo_name": "dzonekl/LiquibaseEditor", "path": "plugins/org.liquidbase.model/src/org/liquibase/xml/ns/dbchangelog/OrType.java", "license": "mit", "size": 19957 }
[ "org.eclipse.emf.common.util.EList" ]
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
152,255
public static void testCreate(GeoPackage geoPackage) throws SQLException { SpatialReferenceSystemDao srsDao = geoPackage .getSpatialReferenceSystemDao(); ContentsDao contentsDao = geoPackage.getContentsDao(); DataColumnsDao dao = geoPackage.getDataColumnsDao(); DataColumnConstraintsDao dataColumnConstraintsDao = geoPackage .getDataColumnConstraintsDao(); if (dao.isTableExists()) { // Get current count long count = dao.countOf(); // Retrieve a random srs List<SpatialReferenceSystem> results = srsDao.queryForAll(); SpatialReferenceSystem srs = null; if (!results.isEmpty()) { int random = (int) (Math.random() * results.size()); srs = results.get(random); } // Create a new contents Contents tileContents = new Contents(); tileContents.setTableName("tile_contents"); tileContents.setDataType(ContentsDataType.TILES); tileContents.setIdentifier("tile_contents"); tileContents.setDescription(""); tileContents.setLastChange(new Date()); tileContents.setMinX(-180.0); tileContents.setMinY(-90.0); tileContents.setMaxX(180.0); tileContents.setMaxY(90.0); tileContents.setSrs(srs); // Create the user tile table geoPackage.createTileTable(TestUtils.buildTileTable(tileContents .getTableName())); contentsDao.create(tileContents); // Create new data column String columnName = TileTable.COLUMN_TILE_DATA; String name = columnName + " NAME"; String title = columnName + " TITLE"; String description = columnName + " DESCRIPTION"; String mimeType = "image/" + TestConstants.TILE_FILE_NAME_EXTENSION; DataColumns dataColumns = new DataColumns(); dataColumns.setContents(tileContents); dataColumns.setColumnName(columnName); dataColumns.setName(name); dataColumns.setTitle(title); dataColumns.setDescription(description); dataColumns.setMimeType(mimeType); dao.create(dataColumns); // Verify count long newCount = dao.countOf(); TestCase.assertEquals(count + 1, newCount); // Verify saved data contents DataColumns queryDataColumns = dao.queryForId(dataColumns.getId()); TestCase.assertEquals(tileContents.getId(), queryDataColumns.getTableName()); TestCase.assertEquals(columnName, queryDataColumns.getColumnName()); TestCase.assertEquals(name, queryDataColumns.getName()); TestCase.assertEquals(title, queryDataColumns.getTitle()); TestCase.assertEquals(description, queryDataColumns.getDescription()); TestCase.assertEquals(mimeType, queryDataColumns.getMimeType()); TestCase.assertEquals(tileContents.getId(), queryDataColumns .getContents().getId()); // Get current count count = dao.countOf(); // Create a new contents Contents featureContents = new Contents(); featureContents.setTableName("feature_contents"); featureContents.setDataType(ContentsDataType.FEATURES); featureContents.setIdentifier("feature_contents"); featureContents.setDescription(""); featureContents.setLastChange(new Date()); featureContents.setMinX(-180.0); featureContents.setMinY(-90.0); featureContents.setMaxX(180.0); featureContents.setMaxY(90.0); featureContents.setSrs(srs); // Create the feature table geoPackage.createFeatureTable(TestUtils.buildFeatureTable( featureContents.getTableName(), "geom", GeometryType.GEOMETRY)); contentsDao.create(featureContents); // Create constraints String constraintName = "TestConstraintName"; DataColumnConstraints sampleEnum1 = new DataColumnConstraints(); sampleEnum1.setConstraintName(constraintName); sampleEnum1.setConstraintType(DataColumnConstraintType.ENUM); sampleEnum1.setValue("ONE"); dataColumnConstraintsDao.create(sampleEnum1); DataColumnConstraints sampleEnum2 = new DataColumnConstraints(); sampleEnum2.setConstraintName(constraintName); sampleEnum2.setConstraintType(DataColumnConstraintType.ENUM); sampleEnum2.setValue("TWO"); dataColumnConstraintsDao.create(sampleEnum2); // Create new data column columnName = TestUtils.TEST_INTEGER_COLUMN; name = columnName + " NAME"; title = columnName + " TITLE"; description = columnName + " DESCRIPTION"; dataColumns = new DataColumns(); dataColumns.setContents(tileContents); dataColumns.setColumnName(columnName); dataColumns.setName(name); dataColumns.setTitle(title); dataColumns.setDescription(description); dataColumns.setConstraint(dataColumnConstraintsDao .queryByConstraintName(constraintName).get(0)); dao.create(dataColumns); // Verify count newCount = dao.countOf(); TestCase.assertEquals(count + 1, newCount); // Verify saved matrix tile queryDataColumns = dao.queryForId(dataColumns.getId()); TestCase.assertEquals(tileContents.getId(), queryDataColumns.getTableName()); TestCase.assertEquals(columnName, queryDataColumns.getColumnName()); TestCase.assertEquals(name, queryDataColumns.getName()); TestCase.assertEquals(title, queryDataColumns.getTitle()); TestCase.assertEquals(description, queryDataColumns.getDescription()); TestCase.assertNull(queryDataColumns.getMimeType()); TestCase.assertEquals(tileContents.getId(), queryDataColumns .getContents().getId()); List<DataColumnConstraints> constraints = queryDataColumns .getConstraints(dataColumnConstraintsDao); TestCase.assertTrue(constraints.size() > 1); for (DataColumnConstraints constraint : constraints) { TestCase.assertEquals(constraintName, constraint.getConstraintName()); TestCase.assertEquals(DataColumnConstraintType.ENUM, constraint.getConstraintType()); } } }
static void function(GeoPackage geoPackage) throws SQLException { SpatialReferenceSystemDao srsDao = geoPackage .getSpatialReferenceSystemDao(); ContentsDao contentsDao = geoPackage.getContentsDao(); DataColumnsDao dao = geoPackage.getDataColumnsDao(); DataColumnConstraintsDao dataColumnConstraintsDao = geoPackage .getDataColumnConstraintsDao(); if (dao.isTableExists()) { long count = dao.countOf(); List<SpatialReferenceSystem> results = srsDao.queryForAll(); SpatialReferenceSystem srs = null; if (!results.isEmpty()) { int random = (int) (Math.random() * results.size()); srs = results.get(random); } Contents tileContents = new Contents(); tileContents.setTableName(STR); tileContents.setDataType(ContentsDataType.TILES); tileContents.setIdentifier(STR); tileContents.setDescription(STR NAMESTR TITLESTR DESCRIPTIONSTRimage/STRfeature_contentsSTRfeature_contentsSTRSTRgeomSTRTestConstraintNameSTRONESTRTWOSTR NAMESTR TITLESTR DESCRIPTION"; dataColumns = new DataColumns(); dataColumns.setContents(tileContents); dataColumns.setColumnName(columnName); dataColumns.setName(name); dataColumns.setTitle(title); dataColumns.setDescription(description); dataColumns.setConstraint(dataColumnConstraintsDao .queryByConstraintName(constraintName).get(0)); dao.create(dataColumns); newCount = dao.countOf(); TestCase.assertEquals(count + 1, newCount); queryDataColumns = dao.queryForId(dataColumns.getId()); TestCase.assertEquals(tileContents.getId(), queryDataColumns.getTableName()); TestCase.assertEquals(columnName, queryDataColumns.getColumnName()); TestCase.assertEquals(name, queryDataColumns.getName()); TestCase.assertEquals(title, queryDataColumns.getTitle()); TestCase.assertEquals(description, queryDataColumns.getDescription()); TestCase.assertNull(queryDataColumns.getMimeType()); TestCase.assertEquals(tileContents.getId(), queryDataColumns .getContents().getId()); List<DataColumnConstraints> constraints = queryDataColumns .getConstraints(dataColumnConstraintsDao); TestCase.assertTrue(constraints.size() > 1); for (DataColumnConstraints constraint : constraints) { TestCase.assertEquals(constraintName, constraint.getConstraintName()); TestCase.assertEquals(DataColumnConstraintType.ENUM, constraint.getConstraintType()); } } }
/** * Test create * * @param geoPackage * @throws SQLException */
Test create
testCreate
{ "repo_name": "boundlessgeo/geopackage-java", "path": "src/test/java/mil/nga/geopackage/test/schema/columns/DataColumnsUtils.java", "license": "mit", "size": 14562 }
[ "java.sql.SQLException", "java.util.List", "junit.framework.TestCase", "mil.nga.geopackage.GeoPackage", "mil.nga.geopackage.core.contents.Contents", "mil.nga.geopackage.core.contents.ContentsDao", "mil.nga.geopackage.core.contents.ContentsDataType", "mil.nga.geopackage.core.srs.SpatialReferenceSystem", "mil.nga.geopackage.core.srs.SpatialReferenceSystemDao", "mil.nga.geopackage.schema.columns.DataColumns", "mil.nga.geopackage.schema.columns.DataColumnsDao", "mil.nga.geopackage.schema.constraints.DataColumnConstraintType", "mil.nga.geopackage.schema.constraints.DataColumnConstraints", "mil.nga.geopackage.schema.constraints.DataColumnConstraintsDao" ]
import java.sql.SQLException; import java.util.List; import junit.framework.TestCase; import mil.nga.geopackage.GeoPackage; import mil.nga.geopackage.core.contents.Contents; import mil.nga.geopackage.core.contents.ContentsDao; import mil.nga.geopackage.core.contents.ContentsDataType; import mil.nga.geopackage.core.srs.SpatialReferenceSystem; import mil.nga.geopackage.core.srs.SpatialReferenceSystemDao; import mil.nga.geopackage.schema.columns.DataColumns; import mil.nga.geopackage.schema.columns.DataColumnsDao; import mil.nga.geopackage.schema.constraints.DataColumnConstraintType; import mil.nga.geopackage.schema.constraints.DataColumnConstraints; import mil.nga.geopackage.schema.constraints.DataColumnConstraintsDao;
import java.sql.*; import java.util.*; import junit.framework.*; import mil.nga.geopackage.*; import mil.nga.geopackage.core.contents.*; import mil.nga.geopackage.core.srs.*; import mil.nga.geopackage.schema.columns.*; import mil.nga.geopackage.schema.constraints.*;
[ "java.sql", "java.util", "junit.framework", "mil.nga.geopackage" ]
java.sql; java.util; junit.framework; mil.nga.geopackage;
106,981
public boolean hasLocalEdge(Pair<IBoundedItem,IBoundedItem> edge);
boolean function(Pair<IBoundedItem,IBoundedItem> edge);
/** * Return true if the graph already holds a rendering edge that is equal to the input edge. */
Return true if the graph already holds a rendering edge that is equal to the input edge
hasLocalEdge
{ "repo_name": "datagr4m/org.datagr4m", "path": "datagr4m-drawing/src/main/java/org/datagr4m/drawing/model/items/hierarchical/graph/IHierarchicalGraphModel.java", "license": "bsd-3-clause", "size": 1877 }
[ "org.datagr4m.datastructures.pairs.Pair", "org.datagr4m.drawing.model.items.IBoundedItem" ]
import org.datagr4m.datastructures.pairs.Pair; import org.datagr4m.drawing.model.items.IBoundedItem;
import org.datagr4m.datastructures.pairs.*; import org.datagr4m.drawing.model.items.*;
[ "org.datagr4m.datastructures", "org.datagr4m.drawing" ]
org.datagr4m.datastructures; org.datagr4m.drawing;
1,856,359
public Matrix replaceRegex(Ret returnType, String search, String replacement);
Matrix function(Ret returnType, String search, String replacement);
/** * Replaces matching text in every entry of the matrix. * * @param returnType * Select whether a new or a linked Matrix is returned, or if the * operation is performed on the original Matrix * @param search * Regular expression to search for * @param replacement * Replacement String * @return matrix with modified entries */
Replaces matching text in every entry of the matrix
replaceRegex
{ "repo_name": "ujmp/universal-java-matrix-package", "path": "ujmp-core/src/main/java/org/ujmp/core/stringmatrix/calculation/StringCalculations.java", "license": "lgpl-3.0", "size": 2623 }
[ "org.ujmp.core.Matrix", "org.ujmp.core.calculation.Calculation" ]
import org.ujmp.core.Matrix; import org.ujmp.core.calculation.Calculation;
import org.ujmp.core.*; import org.ujmp.core.calculation.*;
[ "org.ujmp.core" ]
org.ujmp.core;
2,762,409
private static FrameDescriptor handleBaseNamespaceEnv(Frame frame) { return frame == null ? null : frame instanceof NSBaseMaterializedFrame ? ((NSBaseMaterializedFrame) frame).getMarkerFrameDescriptor() : frame.getFrameDescriptor(); }
static FrameDescriptor function(Frame frame) { return frame == null ? null : frame instanceof NSBaseMaterializedFrame ? ((NSBaseMaterializedFrame) frame).getMarkerFrameDescriptor() : frame.getFrameDescriptor(); }
/** * Special handling (return a marker frame descriptor) for the namespace:base environment. */
Special handling (return a marker frame descriptor) for the namespace:base environment
handleBaseNamespaceEnv
{ "repo_name": "akunft/fastr", "path": "com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/env/frame/FrameSlotChangeMonitor.java", "license": "gpl-2.0", "size": 47222 }
[ "com.oracle.truffle.api.frame.Frame", "com.oracle.truffle.api.frame.FrameDescriptor" ]
import com.oracle.truffle.api.frame.Frame; import com.oracle.truffle.api.frame.FrameDescriptor;
import com.oracle.truffle.api.frame.*;
[ "com.oracle.truffle" ]
com.oracle.truffle;
1,048,358
public static void writeBytesCollection(DataOutput out, Collection<byte[]> bytes) throws IOException { if (bytes != null) { out.writeInt(bytes.size()); for (byte[] b : bytes) writeByteArray(out, b); } else out.writeInt(-1); }
static void function(DataOutput out, Collection<byte[]> bytes) throws IOException { if (bytes != null) { out.writeInt(bytes.size()); for (byte[] b : bytes) writeByteArray(out, b); } else out.writeInt(-1); }
/** * Writes collection of byte arrays to data output. * * @param out Output to write to. * @param bytes Collection with byte arrays. * @throws java.io.IOException If write failed. */
Writes collection of byte arrays to data output
writeBytesCollection
{ "repo_name": "SomeFire/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java", "license": "apache-2.0", "size": 374177 }
[ "java.io.DataOutput", "java.io.IOException", "java.util.Collection" ]
import java.io.DataOutput; import java.io.IOException; import java.util.Collection;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
211,287
public boolean open() throws IOException;
boolean function() throws IOException;
/** * This opens the object by performing any required initialization steps. If * this method returns <code>false</code>, then subsequent calls to * {@link #isOpen()} will return <code>false</code>. * * @return <code>true</code> if there were no errors in initialization; * <code>false</code> otherwise. * @throws IOException * if there was IO error while performing initializataion * @since JWI 2.2.0 */
This opens the object by performing any required initialization steps. If this method returns <code>false</code>, then subsequent calls to <code>#isOpen()</code> will return <code>false</code>
open
{ "repo_name": "DigitalPerson/SMAZ", "path": "Implementation/RulesCreator/src/edu/mit/jwi/data/IHasLifecycle.java", "license": "cc0-1.0", "size": 4542 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
985,535
static ClassLoader getThreadContextClassLoader() { return AccessController.doPrivileged(GetTcclAction.INSTANCE); }
static ClassLoader getThreadContextClassLoader() { return AccessController.doPrivileged(GetTcclAction.INSTANCE); }
/** * Obtains the Thread Context ClassLoader */
Obtains the Thread Context ClassLoader
getThreadContextClassLoader
{ "repo_name": "bartoszmajsak/arquillian-extension-persistence", "path": "core/src/main/java/org/jboss/arquillian/persistence/util/SecurityActions.java", "license": "apache-2.0", "size": 12031 }
[ "java.security.AccessController" ]
import java.security.AccessController;
import java.security.*;
[ "java.security" ]
java.security;
2,612,961
public void writeCertainIFCategories(final Graphmaster graph, final String file) { if (MagicBooleans.trace_mode) { System.out.println("writeCertainIFCaegories " + file + " size= " + graph.getCategories().size()); } writeIFCategories(graph.getCategories(), file + MagicStrings.aimlif_file_suffix); final File dir = new File(aimlif_path); dir.setLastModified(new Date().getTime()); }
void function(final Graphmaster graph, final String file) { if (MagicBooleans.trace_mode) { System.out.println(STR + file + STR + graph.getCategories().size()); } writeIFCategories(graph.getCategories(), file + MagicStrings.aimlif_file_suffix); final File dir = new File(aimlif_path); dir.setLastModified(new Date().getTime()); }
/** * write certain specified categories as AIMLIF files * * @param graph * the Graphmaster containing the categories to write * @param file * the destination AIMLIF file */
write certain specified categories as AIMLIF files
writeCertainIFCategories
{ "repo_name": "BobbyFoster/alice-program-ab", "path": "src/org/alicebot/ab/Bot.java", "license": "lgpl-3.0", "size": 24755 }
[ "java.io.File", "java.util.Date" ]
import java.io.File; import java.util.Date;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,032,994
public Date getAcceptanceDate() { return acceptanceDate; }
Date function() { return acceptanceDate; }
/** * get date of relationShip * @return date */
get date of relationShip
getAcceptanceDate
{ "repo_name": "ebonnet/Silverpeas-Core", "path": "core-library/src/main/java/org/silverpeas/core/socialnetwork/relationShip/RelationShip.java", "license": "agpl-3.0", "size": 4736 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
1,353,305
public static TransmitStatusPacket createPacket(byte[] payload) { if (payload == null) throw new NullPointerException("Transmit Status packet payload cannot be null."); // 1 (Frame type) + 1 (frame ID) + 2 (16-bit address) + 1 (retry count) + 1 (delivery status) + 1 (discovery status) if (payload.length < MIN_API_PAYLOAD_LENGTH) throw new IllegalArgumentException("Incomplete Transmit Status packet."); if ((payload[0] & 0xFF) != APIFrameType.TRANSMIT_STATUS.getValue()) throw new IllegalArgumentException("Payload is not a Transmit Status packet."); // payload[0] is the frame type. int index = 1; // Frame ID byte. int frameID = payload[index] & 0xFF; index = index + 1; // 2 bytes of 16-bit address. XBee16BitAddress address = new XBee16BitAddress(payload[index] & 0xFF, payload[index + 1] & 0xFF); index = index + 2; // Retry count byte. int retryCount = payload[index] & 0xFF; index = index + 1; // Delivery status byte. int deliveryStatus = payload[index] & 0xFF; index = index + 1; // Discovery status byte. int discoveryStatus = payload[index] & 0xFF; // TODO if XBeeTransmitStatus is unknown???? return new TransmitStatusPacket(frameID, address, retryCount, XBeeTransmitStatus.get(deliveryStatus), XBeeDiscoveryStatus.get(discoveryStatus)); } public TransmitStatusPacket(int frameID, XBee16BitAddress destAddress16, int tranmistRetryCount, XBeeTransmitStatus transmitStatus, XBeeDiscoveryStatus discoveryStatus) { super(APIFrameType.TRANSMIT_STATUS); if (destAddress16 == null) throw new NullPointerException("16-bit destination address cannot be null."); if (transmitStatus == null) throw new NullPointerException("Delivery status cannot be null."); if (discoveryStatus == null) throw new NullPointerException("Discovery status cannot be null."); if (frameID < 0 || frameID > 255) throw new IllegalArgumentException("Frame ID must be between 0 and 255."); if (tranmistRetryCount < 0 || tranmistRetryCount > 255) throw new IllegalArgumentException("Transmit retry count must be between 0 and 255."); this.frameID = frameID; this.destAddress16 = destAddress16; this.tranmistRetryCount = tranmistRetryCount; this.transmitStatus = transmitStatus; this.discoveryStatus = discoveryStatus; this.logger = LoggerFactory.getLogger(TransmitStatusPacket.class); }
static TransmitStatusPacket function(byte[] payload) { if (payload == null) throw new NullPointerException(STR); if (payload.length < MIN_API_PAYLOAD_LENGTH) throw new IllegalArgumentException(STR); if ((payload[0] & 0xFF) != APIFrameType.TRANSMIT_STATUS.getValue()) throw new IllegalArgumentException(STR); int index = 1; int frameID = payload[index] & 0xFF; index = index + 1; XBee16BitAddress address = new XBee16BitAddress(payload[index] & 0xFF, payload[index + 1] & 0xFF); index = index + 2; int retryCount = payload[index] & 0xFF; index = index + 1; int deliveryStatus = payload[index] & 0xFF; index = index + 1; int discoveryStatus = payload[index] & 0xFF; return new TransmitStatusPacket(frameID, address, retryCount, XBeeTransmitStatus.get(deliveryStatus), XBeeDiscoveryStatus.get(discoveryStatus)); } public TransmitStatusPacket(int frameID, XBee16BitAddress destAddress16, int tranmistRetryCount, XBeeTransmitStatus transmitStatus, XBeeDiscoveryStatus discoveryStatus) { super(APIFrameType.TRANSMIT_STATUS); if (destAddress16 == null) throw new NullPointerException(STR); if (transmitStatus == null) throw new NullPointerException(STR); if (discoveryStatus == null) throw new NullPointerException(STR); if (frameID < 0 frameID > 255) throw new IllegalArgumentException(STR); if (tranmistRetryCount < 0 tranmistRetryCount > 255) throw new IllegalArgumentException(STR); this.frameID = frameID; this.destAddress16 = destAddress16; this.tranmistRetryCount = tranmistRetryCount; this.transmitStatus = transmitStatus; this.discoveryStatus = discoveryStatus; this.logger = LoggerFactory.getLogger(TransmitStatusPacket.class); }
/** * Creates a new {@code TransmitStatusPacket} object from the given payload. * * @param payload The API frame payload. It must start with the frame type * corresponding to a Transmit Status packet ({@code 0x8B}). * The byte array must be in {@code OperatingMode.API} mode. * * @return Parsed Transmit Status packet. * * @throws IllegalArgumentException if {@code payload[0] != APIFrameType.TRANSMIT_STATUS.getValue()} or * if {@code payload.length < }{@value #MIN_API_PAYLOAD_LENGTH} or * if {@code frameID < 0} or * if {@code frameID > 255} or * if {@code tranmistRetryCount < 0} or * if {@code tranmistRetryCount > 255}. * @throws NullPointerException if {@code payload == null}. */
Creates a new TransmitStatusPacket object from the given payload
createPacket
{ "repo_name": "GUBotDev/XBeeJavaLibrary", "path": "library/src/main/java/com/digi/xbee/api/packet/common/TransmitStatusPacket.java", "license": "mpl-2.0", "size": 8828 }
[ "com.digi.xbee.api.models.XBee16BitAddress", "com.digi.xbee.api.models.XBeeDiscoveryStatus", "com.digi.xbee.api.models.XBeeTransmitStatus", "com.digi.xbee.api.packet.APIFrameType", "org.slf4j.LoggerFactory" ]
import com.digi.xbee.api.models.XBee16BitAddress; import com.digi.xbee.api.models.XBeeDiscoveryStatus; import com.digi.xbee.api.models.XBeeTransmitStatus; import com.digi.xbee.api.packet.APIFrameType; import org.slf4j.LoggerFactory;
import com.digi.xbee.api.models.*; import com.digi.xbee.api.packet.*; import org.slf4j.*;
[ "com.digi.xbee", "org.slf4j" ]
com.digi.xbee; org.slf4j;
1,614,671
public static int geoHashLevelsForPrecision(String distance) { return geoHashLevelsForPrecision(DistanceUnit.METERS.parse(distance, DistanceUnit.DEFAULT)); }
static int function(String distance) { return geoHashLevelsForPrecision(DistanceUnit.METERS.parse(distance, DistanceUnit.DEFAULT)); }
/** * Calculate the number of levels needed for a specific precision. GeoHash * cells will not exceed the specified size (diagonal) of the precision. * @param distance Maximum size of cells as unit string (must greater or equal to zero) * @return levels need to achieve precision */
Calculate the number of levels needed for a specific precision. GeoHash cells will not exceed the specified size (diagonal) of the precision
geoHashLevelsForPrecision
{ "repo_name": "weipinghe/elasticsearch", "path": "core/src/main/java/org/elasticsearch/common/geo/GeoUtils.java", "license": "apache-2.0", "size": 18984 }
[ "org.elasticsearch.common.unit.DistanceUnit" ]
import org.elasticsearch.common.unit.DistanceUnit;
import org.elasticsearch.common.unit.*;
[ "org.elasticsearch.common" ]
org.elasticsearch.common;
132,394
public Session getInternalSession(final String workspace) throws RepositoryException { return repo.login(workspace); }
Session function(final String workspace) throws RepositoryException { return repo.login(workspace); }
/** * Get a new JCR session in the given workspace * * @param workspace * @return * @throws RepositoryException */
Get a new JCR session in the given workspace
getInternalSession
{ "repo_name": "mikedurbin/fcrepo4", "path": "fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/session/SessionFactory.java", "license": "apache-2.0", "size": 7936 }
[ "javax.jcr.RepositoryException", "javax.jcr.Session" ]
import javax.jcr.RepositoryException; import javax.jcr.Session;
import javax.jcr.*;
[ "javax.jcr" ]
javax.jcr;
256,046
void writeLine(String s) throws IOException;
void writeLine(String s) throws IOException;
/** * Writes characters from the specified string followed by a line delimiter * to this session buffer. * <p> * The choice of a char encoding and line delimiter sequence is up to the * specific implementations of this interface. * * @param s the line. * @exception IOException if an I/O error occurs. */
Writes characters from the specified string followed by a line delimiter to this session buffer. The choice of a char encoding and line delimiter sequence is up to the specific implementations of this interface
writeLine
{ "repo_name": "alinvasile/httpcore", "path": "httpcore/src/main/java/org/apache/http/io/SessionOutputBuffer.java", "license": "apache-2.0", "size": 4436 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,051,295
public void buildDependencyGraph(AbstractProject owner, DependencyGraph graph) { for (Object o : this) { if (o instanceof DependecyDeclarer) { DependecyDeclarer dd = (DependecyDeclarer) o; dd.buildDependencyGraph(owner, graph); } } }
void function(AbstractProject owner, DependencyGraph graph) { for (Object o : this) { if (o instanceof DependecyDeclarer) { DependecyDeclarer dd = (DependecyDeclarer) o; dd.buildDependencyGraph(owner, graph); } } }
/** * Picks up {@link DependecyDeclarer}s and allow it to build dependencies. */
Picks up <code>DependecyDeclarer</code>s and allow it to build dependencies
buildDependencyGraph
{ "repo_name": "eclipse/hudson.core", "path": "hudson-core/src/main/java/hudson/util/DescribableList.java", "license": "apache-2.0", "size": 8594 }
[ "hudson.model.AbstractProject", "hudson.model.DependecyDeclarer", "hudson.model.DependencyGraph" ]
import hudson.model.AbstractProject; import hudson.model.DependecyDeclarer; import hudson.model.DependencyGraph;
import hudson.model.*;
[ "hudson.model" ]
hudson.model;
836,297
public Collection<BinaryType> types() throws BinaryObjectException;
Collection<BinaryType> function() throws BinaryObjectException;
/** * Gets metadata for all known types. * * @return Metadata. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */
Gets metadata for all known types
types
{ "repo_name": "ascherbakoff/ignite", "path": "modules/core/src/main/java/org/apache/ignite/IgniteBinary.java", "license": "apache-2.0", "size": 18693 }
[ "java.util.Collection", "org.apache.ignite.binary.BinaryObjectException", "org.apache.ignite.binary.BinaryType" ]
import java.util.Collection; import org.apache.ignite.binary.BinaryObjectException; import org.apache.ignite.binary.BinaryType;
import java.util.*; import org.apache.ignite.binary.*;
[ "java.util", "org.apache.ignite" ]
java.util; org.apache.ignite;
1,386,906
public static void set(Long timeAllowed) { long time = nanoTime() + TimeUnit.NANOSECONDS.convert(timeAllowed, TimeUnit.MILLISECONDS); timeoutAt.set(time); }
static void function(Long timeAllowed) { long time = nanoTime() + TimeUnit.NANOSECONDS.convert(timeAllowed, TimeUnit.MILLISECONDS); timeoutAt.set(time); }
/** * Method to set the time at which the timeOut should happen. * @param timeAllowed set the time at which this thread should timeout. */
Method to set the time at which the timeOut should happen
set
{ "repo_name": "PATRIC3/p3_solr", "path": "solr/core/src/java/org/apache/solr/search/SolrQueryTimeoutImpl.java", "license": "apache-2.0", "size": 2573 }
[ "java.lang.System", "java.util.concurrent.TimeUnit" ]
import java.lang.System; import java.util.concurrent.TimeUnit;
import java.lang.*; import java.util.concurrent.*;
[ "java.lang", "java.util" ]
java.lang; java.util;
1,823,787
public synchronized void decreaseChannel(int decrement) { if (decrement < 0) { return; } if (!hasRunningActions()) { // increase channel value value = DmxUtil.capDmxValue(value - DmxUtil.getByteFromPercentType(new PercentType(decrement))); } else { // decrease channel actions output for (BaseAction a : actions) { a.decrease(decrement); } } }
synchronized void function(int decrement) { if (decrement < 0) { return; } if (!hasRunningActions()) { value = DmxUtil.capDmxValue(value - DmxUtil.getByteFromPercentType(new PercentType(decrement))); } else { for (BaseAction a : actions) { a.decrease(decrement); } } }
/** * Decrease channel value level. * * @param decrement * % to decrease. */
Decrease channel value level
decreaseChannel
{ "repo_name": "openhab/openhab", "path": "bundles/binding/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/core/DmxChannel.java", "license": "epl-1.0", "size": 8131 }
[ "org.openhab.binding.dmx.internal.action.BaseAction", "org.openhab.core.library.types.PercentType" ]
import org.openhab.binding.dmx.internal.action.BaseAction; import org.openhab.core.library.types.PercentType;
import org.openhab.binding.dmx.internal.action.*; import org.openhab.core.library.types.*;
[ "org.openhab.binding", "org.openhab.core" ]
org.openhab.binding; org.openhab.core;
2,440,162
public static void save() { // Inform: SagaLogger.info("Saving sieges."); try { WriterReader.write(Directory.SIEGES, instance); } catch (IOException e) { SagaLogger.severe(SiegeManager.class, "write failed"); SagaLogger.info("Write failure cause:" + e.getClass().getSimpleName() + ":" + e.getMessage()); } }
static void function() { SagaLogger.info(STR); try { WriterReader.write(Directory.SIEGES, instance); } catch (IOException e) { SagaLogger.severe(SiegeManager.class, STR); SagaLogger.info(STR + e.getClass().getSimpleName() + ":" + e.getMessage()); } }
/** * Saves the manager. * */
Saves the manager
save
{ "repo_name": "Olyol95/Saga", "path": "src/org/saga/factions/SiegeManager.java", "license": "gpl-3.0", "size": 28485 }
[ "java.io.IOException", "org.saga.SagaLogger", "org.saga.saveload.Directory", "org.saga.saveload.WriterReader" ]
import java.io.IOException; import org.saga.SagaLogger; import org.saga.saveload.Directory; import org.saga.saveload.WriterReader;
import java.io.*; import org.saga.*; import org.saga.saveload.*;
[ "java.io", "org.saga", "org.saga.saveload" ]
java.io; org.saga; org.saga.saveload;
2,282,523
void initialize( ConnectionSpec connectionSpec, RelationalDatabaseSpec relationalDatabaseSpec, RelationalDbDataSourceBackend backend);
void initialize( ConnectionSpec connectionSpec, RelationalDatabaseSpec relationalDatabaseSpec, RelationalDbDataSourceBackend backend);
/** * Initializes the generator with schema mapping information * (@link RelationalDatabaseSpec}), a {@link ConnectionSpec} for * connecting to the database, and the relational database data source * backend that is calling this generator. This method should only be * called after {@link #loadDriverIfNeeded()} and * {@link #checkCompatibility(java.sql.Connection)}. * * @param connectionSpec a {@link ConnectionSpec}. * @param backend a {@link RelationalDatabaseDataSourceBackend}. */
Initializes the generator with schema mapping information (@link RelationalDatabaseSpec}), a <code>ConnectionSpec</code> for connecting to the database, and the relational database data source backend that is calling this generator. This method should only be called after <code>#loadDriverIfNeeded()</code> and <code>#checkCompatibility(java.sql.Connection)</code>
initialize
{ "repo_name": "eurekaclinical/protempa", "path": "protempa-dsb-relationaldb/src/main/java/org/protempa/backend/dsb/relationaldb/SQLGenerator.java", "license": "apache-2.0", "size": 3937 }
[ "org.arp.javautil.sql.ConnectionSpec" ]
import org.arp.javautil.sql.ConnectionSpec;
import org.arp.javautil.sql.*;
[ "org.arp.javautil" ]
org.arp.javautil;
2,089,276
@JsonAnyGetter public Map<String, Object> additionalProperties() { return this.additionalProperties; }
Map<String, Object> function() { return this.additionalProperties; }
/** * Get the additionalProperties property: Credential reference type. * * @return the additionalProperties value. */
Get the additionalProperties property: Credential reference type
additionalProperties
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/CredentialReference.java", "license": "mit", "size": 3655 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,470,367
public void writeMessages() { try { Protos.FluidNexusMessages.Builder messagesBuilder = Protos.FluidNexusMessages.newBuilder(); for (String currentHash: hashesToSend) { Protos.FluidNexusMessage.Builder messageBuilder = Protos.FluidNexusMessage.newBuilder(); Cursor localCursor = messagesProviderHelper.returnItemBasedOnHash(currentHash); String title = localCursor.getString(localCursor.getColumnIndexOrThrow(MessagesProviderHelper.KEY_TITLE)); String content = localCursor.getString(localCursor.getColumnIndexOrThrow(MessagesProviderHelper.KEY_CONTENT)); Float timestamp = localCursor.getFloat(localCursor.getColumnIndexOrThrow(MessagesProviderHelper.KEY_TIME)); Float received_timestamp = localCursor.getFloat(localCursor.getColumnIndexOrThrow(MessagesProviderHelper.KEY_RECEIVED_TIME)); String attachmentPath = localCursor.getString(localCursor.getColumnIndexOrThrow(MessagesProviderHelper.KEY_ATTACHMENT_PATH)); String attachmentOriginalFilename = localCursor.getString(localCursor.getColumnIndexOrThrow(MessagesProviderHelper.KEY_ATTACHMENT_ORIGINAL_FILENAME)); boolean publicMessage = (localCursor.getInt(localCursor.getColumnIndexOrThrow(MessagesProviderHelper.KEY_PUBLIC)) != 0); Integer ttl = localCursor.getInt(localCursor.getColumnIndexOrThrow(MessagesProviderHelper.KEY_TTL)); Integer message_type = localCursor.getInt(localCursor.getColumnIndexOrThrow(MessagesProviderHelper.KEY_TYPE)); Integer message_priority = localCursor.getInt(localCursor.getColumnIndexOrThrow(MessagesProviderHelper.KEY_PRIORITY)); localCursor.close(); messageBuilder.setMessageTitle(title); messageBuilder.setMessageContent(content); messageBuilder.setMessageTimestamp(timestamp); messageBuilder.setMessageReceivedTimestamp(received_timestamp); messageBuilder.setMessagePublic(publicMessage); messageBuilder.setMessageTtl(ttl); messageBuilder.setMessageType(Protos.FluidNexusMessage.MessageType.valueOf(message_type)); messageBuilder.setMessagePriority(Protos.FluidNexusMessage.MessagePriority.valueOf(message_priority)); if (!(attachmentPath.equals(""))) { File file = new File(attachmentPath); // Ensure that any files are smaller than our bluetooth filesize if (((this.threadType == (TYPE_BLUETOOTH)) && (file.length() <= MAX_BLUETOOTH_FILESIZE)) || (this.threadType == TYPE_ZEROCONF) || (this.threadType == TYPE_NEXUS)) { FileInputStream fin = new FileInputStream(file); BufferedInputStream bin = new BufferedInputStream(fin); int length = (int) file.length(); // TODO // Is there a better way of doing this, other than reading everything in at once? byte[] data = new byte[length]; bin.read(data, 0, length); com.google.protobuf.ByteString bs = com.google.protobuf.ByteString.copyFrom(data); messageBuilder.setMessageAttachmentOriginalFilename(attachmentOriginalFilename); messageBuilder.setMessageAttachment(bs); } } Protos.FluidNexusMessage message = messageBuilder.build(); messagesBuilder.addMessage(message); } Protos.FluidNexusMessages messages = messagesBuilder.build(); byte[] messagesSerialized = messages.toByteArray(); int messagesSerializedLength = messagesSerialized.length; log.debug("Writing messages length of: " + messagesSerializedLength); writeCommand(MESSAGES); outputStream.writeInt(messagesSerializedLength); outputStream.flush(); // TODO // Write this out via chunks, update progress bar in intent outputStream.write(messagesSerialized, 0, messagesSerializedLength); outputStream.flush(); setConnectedState(STATE_READ_SWITCH); } catch (IOException e) { log.error("Error writing messages to output stream: " + e); cleanupConnection(); } }
void function() { try { Protos.FluidNexusMessages.Builder messagesBuilder = Protos.FluidNexusMessages.newBuilder(); for (String currentHash: hashesToSend) { Protos.FluidNexusMessage.Builder messageBuilder = Protos.FluidNexusMessage.newBuilder(); Cursor localCursor = messagesProviderHelper.returnItemBasedOnHash(currentHash); String title = localCursor.getString(localCursor.getColumnIndexOrThrow(MessagesProviderHelper.KEY_TITLE)); String content = localCursor.getString(localCursor.getColumnIndexOrThrow(MessagesProviderHelper.KEY_CONTENT)); Float timestamp = localCursor.getFloat(localCursor.getColumnIndexOrThrow(MessagesProviderHelper.KEY_TIME)); Float received_timestamp = localCursor.getFloat(localCursor.getColumnIndexOrThrow(MessagesProviderHelper.KEY_RECEIVED_TIME)); String attachmentPath = localCursor.getString(localCursor.getColumnIndexOrThrow(MessagesProviderHelper.KEY_ATTACHMENT_PATH)); String attachmentOriginalFilename = localCursor.getString(localCursor.getColumnIndexOrThrow(MessagesProviderHelper.KEY_ATTACHMENT_ORIGINAL_FILENAME)); boolean publicMessage = (localCursor.getInt(localCursor.getColumnIndexOrThrow(MessagesProviderHelper.KEY_PUBLIC)) != 0); Integer ttl = localCursor.getInt(localCursor.getColumnIndexOrThrow(MessagesProviderHelper.KEY_TTL)); Integer message_type = localCursor.getInt(localCursor.getColumnIndexOrThrow(MessagesProviderHelper.KEY_TYPE)); Integer message_priority = localCursor.getInt(localCursor.getColumnIndexOrThrow(MessagesProviderHelper.KEY_PRIORITY)); localCursor.close(); messageBuilder.setMessageTitle(title); messageBuilder.setMessageContent(content); messageBuilder.setMessageTimestamp(timestamp); messageBuilder.setMessageReceivedTimestamp(received_timestamp); messageBuilder.setMessagePublic(publicMessage); messageBuilder.setMessageTtl(ttl); messageBuilder.setMessageType(Protos.FluidNexusMessage.MessageType.valueOf(message_type)); messageBuilder.setMessagePriority(Protos.FluidNexusMessage.MessagePriority.valueOf(message_priority)); if (!(attachmentPath.equals(STRWriting messages length of: STRError writing messages to output stream: " + e); cleanupConnection(); } }
/** * Write our messages to the server based on the hashes that the server doesn't have */
Write our messages to the server based on the hashes that the server doesn't have
writeMessages
{ "repo_name": "zeitkunst/FluidNexusAndroid", "path": "src/net/fluidnexus/FluidNexusAndroid/services/ProtocolThread.java", "license": "gpl-3.0", "size": 22635 }
[ "android.database.Cursor", "net.fluidnexus.FluidNexusAndroid" ]
import android.database.Cursor; import net.fluidnexus.FluidNexusAndroid;
import android.database.*; import net.fluidnexus.*;
[ "android.database", "net.fluidnexus" ]
android.database; net.fluidnexus;
1,419,901
public static boolean isUnauthorized(final Exception e) { if (e instanceof RequestException) return ((RequestException) e).getStatus() == HTTP_UNAUTHORIZED; String message = null; if (e instanceof IOException) message = e.getMessage(); final Throwable cause = e.getCause(); if (cause instanceof IOException) { String causeMessage = cause.getMessage(); if (!TextUtils.isEmpty(causeMessage)) message = causeMessage; } if (TextUtils.isEmpty(message)) return false; if ("Received authentication challenge is null".equals(message)) return true; if ("No authentication challenges found".equals(message)) return true; return false; }
static boolean function(final Exception e) { if (e instanceof RequestException) return ((RequestException) e).getStatus() == HTTP_UNAUTHORIZED; String message = null; if (e instanceof IOException) message = e.getMessage(); final Throwable cause = e.getCause(); if (cause instanceof IOException) { String causeMessage = cause.getMessage(); if (!TextUtils.isEmpty(causeMessage)) message = causeMessage; } if (TextUtils.isEmpty(message)) return false; if (STR.equals(message)) return true; if (STR.equals(message)) return true; return false; }
/** * Is the given {@link Exception} due to a 401 Unauthorized API response? * * @param e * @return true if 401, false otherwise */
Is the given <code>Exception</code> due to a 401 Unauthorized API response
isUnauthorized
{ "repo_name": "Yifei0727/GitHub-Client-md", "path": "app/src/main/java/com/github/mobile/accounts/AccountUtils.java", "license": "apache-2.0", "size": 12249 }
[ "android.text.TextUtils", "java.io.IOException", "org.eclipse.egit.github.core.client.RequestException" ]
import android.text.TextUtils; import java.io.IOException; import org.eclipse.egit.github.core.client.RequestException;
import android.text.*; import java.io.*; import org.eclipse.egit.github.core.client.*;
[ "android.text", "java.io", "org.eclipse.egit" ]
android.text; java.io; org.eclipse.egit;
1,077,784
public boolean isMusicOn() { return SoundStore.get().musicOn(); }
boolean function() { return SoundStore.get().musicOn(); }
/** * Check if music is enabled * * @return True if music is enabled */
Check if music is enabled
isMusicOn
{ "repo_name": "yugecin/opsu", "path": "src/org/newdawn/slick/GameContainer.java", "license": "gpl-3.0", "size": 24426 }
[ "org.newdawn.slick.openal.SoundStore" ]
import org.newdawn.slick.openal.SoundStore;
import org.newdawn.slick.openal.*;
[ "org.newdawn.slick" ]
org.newdawn.slick;
1,501,929
public static String repeat(String string, int count) { checkNotNull(string); // eager for GWT. if (count <= 1) { checkArgument(count >= 0, "invalid count: %s", count); return (count == 0) ? "" : string; } // IF YOU MODIFY THE CODE HERE, you must update StringsRepeatBenchmark final int len = string.length(); final long longSize = (long) len * (long) count; final int size = (int) longSize; if (size != longSize) { throw new ArrayIndexOutOfBoundsException("Required array size too large: " + String.valueOf(longSize)); } final char[] array = new char[size]; string.getChars(0, len, array, 0); int n; for (n = len; n < size - n; n <<= 1) { System.arraycopy(array, 0, array, n, n); } System.arraycopy(array, 0, array, n, size - n); return new String(array); }
static String function(String string, int count) { checkNotNull(string); if (count <= 1) { checkArgument(count >= 0, STR, count); return (count == 0) ? STRRequired array size too large: " + String.valueOf(longSize)); } final char[] array = new char[size]; string.getChars(0, len, array, 0); int n; for (n = len; n < size - n; n <<= 1) { System.arraycopy(array, 0, array, n, n); } System.arraycopy(array, 0, array, n, size - n); return new String(array); }
/** * Returns a string consisting of a specific number of concatenated copies of * an input string. For example, {@code repeat("hey", 3)} returns the string * {@code "heyheyhey"}. * * @param string any non-null string * @param count the number of times to repeat it; a nonnegative integer * @return a string containing {@code string} repeated {@code count} times * (the empty string if {@code count} is zero) * @throws IllegalArgumentException if {@code count} is negative */
Returns a string consisting of a specific number of concatenated copies of an input string. For example, repeat("hey", 3) returns the string "heyheyhey"
repeat
{ "repo_name": "pauljohnson75/android_external_guava", "path": "guava/src/com/google/common/base/Strings.java", "license": "apache-2.0", "size": 8457 }
[ "com.google.common.base.Preconditions" ]
import com.google.common.base.Preconditions;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
1,180,606
public void errorLog(String javaFile, String errorMessage) { Log.e(javaFile, errorMessage); }
void function(String javaFile, String errorMessage) { Log.e(javaFile, errorMessage); }
/** * Error log formats the message and displays it for the * debugging purposes. */
Error log formats the message and displays it for the debugging purposes
errorLog
{ "repo_name": "ridethepenguin/coursera", "path": "POSA-14/W5-A4-Android/peers/AndroidPlatformStrategyStudent3.java", "license": "gpl-2.0", "size": 2901 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
1,394,751
public SearchSourceBuilder scriptField(String name, Script script, boolean ignoreFailure) { if (scriptFields == null) { scriptFields = new ArrayList<>(); } scriptFields.add(new ScriptField(name, script, ignoreFailure)); return this; }
SearchSourceBuilder function(String name, Script script, boolean ignoreFailure) { if (scriptFields == null) { scriptFields = new ArrayList<>(); } scriptFields.add(new ScriptField(name, script, ignoreFailure)); return this; }
/** * Adds a script field under the given name with the provided script. * * @param name * The name of the field * @param script * The script */
Adds a script field under the given name with the provided script
scriptField
{ "repo_name": "drewr/elasticsearch", "path": "core/src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java", "license": "apache-2.0", "size": 54962 }
[ "java.util.ArrayList", "org.elasticsearch.script.Script" ]
import java.util.ArrayList; import org.elasticsearch.script.Script;
import java.util.*; import org.elasticsearch.script.*;
[ "java.util", "org.elasticsearch.script" ]
java.util; org.elasticsearch.script;
2,691,535
private DataSet<CCSGraph> preProcessCategories(DataSet<CCSGraph> graphs) { DataSet<String> frequentVertexLabels = graphs .flatMap(new CategoryVertexLabels()) .groupBy(0, 1) .sum(2) .filter(new CategoryFrequent()) .withBroadcastSet(categoryMinFrequencies, DIMSpanConstants.MIN_FREQUENCY) .map(new LabelOnly()) .distinct(); graphs = graphs .map(new WithoutInfrequentVertexLabels<CCSGraph>()) .withBroadcastSet( frequentVertexLabels, TFSMConstants.FREQUENT_VERTEX_LABELS); DataSet<String> frequentEdgeLabels = graphs .flatMap(new CategoryEdgeLabels()) .groupBy(0, 1) .sum(2) .filter(new CategoryFrequent()) .withBroadcastSet(categoryMinFrequencies, DIMSpanConstants.MIN_FREQUENCY) .map(new LabelOnly()) .distinct(); graphs = graphs .map(new WithoutInfrequentEdgeLabels<CCSGraph>()) .withBroadcastSet(frequentEdgeLabels, TFSMConstants.FREQUENT_EDGE_LABELS); return graphs; }
DataSet<CCSGraph> function(DataSet<CCSGraph> graphs) { DataSet<String> frequentVertexLabels = graphs .flatMap(new CategoryVertexLabels()) .groupBy(0, 1) .sum(2) .filter(new CategoryFrequent()) .withBroadcastSet(categoryMinFrequencies, DIMSpanConstants.MIN_FREQUENCY) .map(new LabelOnly()) .distinct(); graphs = graphs .map(new WithoutInfrequentVertexLabels<CCSGraph>()) .withBroadcastSet( frequentVertexLabels, TFSMConstants.FREQUENT_VERTEX_LABELS); DataSet<String> frequentEdgeLabels = graphs .flatMap(new CategoryEdgeLabels()) .groupBy(0, 1) .sum(2) .filter(new CategoryFrequent()) .withBroadcastSet(categoryMinFrequencies, DIMSpanConstants.MIN_FREQUENCY) .map(new LabelOnly()) .distinct(); graphs = graphs .map(new WithoutInfrequentEdgeLabels<CCSGraph>()) .withBroadcastSet(frequentEdgeLabels, TFSMConstants.FREQUENT_EDGE_LABELS); return graphs; }
/** * Removes vertices and edges showing labels that are infrequent in all * categories. * * @param graphs graph collection * @return processed graph collection */
Removes vertices and edges showing labels that are infrequent in all categories
preProcessCategories
{ "repo_name": "smee/gradoop", "path": "gradoop-flink/src/main/java/org/gradoop/flink/algorithms/fsm/transactional/CategoryCharacteristicSubgraphs.java", "license": "apache-2.0", "size": 9204 }
[ "org.apache.flink.api.java.DataSet", "org.gradoop.flink.algorithms.fsm.dimspan.config.DIMSpanConstants", "org.gradoop.flink.algorithms.fsm.transactional.common.TFSMConstants", "org.gradoop.flink.algorithms.fsm.transactional.tle.functions.CategoryEdgeLabels", "org.gradoop.flink.algorithms.fsm.transactional.tle.functions.CategoryFrequent", "org.gradoop.flink.algorithms.fsm.transactional.tle.functions.CategoryVertexLabels", "org.gradoop.flink.algorithms.fsm.transactional.tle.functions.LabelOnly", "org.gradoop.flink.algorithms.fsm.transactional.tle.functions.WithoutInfrequentEdgeLabels", "org.gradoop.flink.algorithms.fsm.transactional.tle.functions.WithoutInfrequentVertexLabels", "org.gradoop.flink.algorithms.fsm.transactional.tle.pojos.CCSGraph" ]
import org.apache.flink.api.java.DataSet; import org.gradoop.flink.algorithms.fsm.dimspan.config.DIMSpanConstants; import org.gradoop.flink.algorithms.fsm.transactional.common.TFSMConstants; import org.gradoop.flink.algorithms.fsm.transactional.tle.functions.CategoryEdgeLabels; import org.gradoop.flink.algorithms.fsm.transactional.tle.functions.CategoryFrequent; import org.gradoop.flink.algorithms.fsm.transactional.tle.functions.CategoryVertexLabels; import org.gradoop.flink.algorithms.fsm.transactional.tle.functions.LabelOnly; import org.gradoop.flink.algorithms.fsm.transactional.tle.functions.WithoutInfrequentEdgeLabels; import org.gradoop.flink.algorithms.fsm.transactional.tle.functions.WithoutInfrequentVertexLabels; import org.gradoop.flink.algorithms.fsm.transactional.tle.pojos.CCSGraph;
import org.apache.flink.api.java.*; import org.gradoop.flink.algorithms.fsm.dimspan.config.*; import org.gradoop.flink.algorithms.fsm.transactional.common.*; import org.gradoop.flink.algorithms.fsm.transactional.tle.functions.*; import org.gradoop.flink.algorithms.fsm.transactional.tle.pojos.*;
[ "org.apache.flink", "org.gradoop.flink" ]
org.apache.flink; org.gradoop.flink;
93,538
super.configure(element); inputVal.setText(((ForeachController) element).getInputValString()); startIndex.setText(((ForeachController) element).getStartIndexAsString()); endIndex.setText(((ForeachController) element).getEndIndexAsString()); returnVal.setText(((ForeachController) element).getReturnValString()); useSeparator.setSelected(((ForeachController) element).getUseSeparator()); }
super.configure(element); inputVal.setText(((ForeachController) element).getInputValString()); startIndex.setText(((ForeachController) element).getStartIndexAsString()); endIndex.setText(((ForeachController) element).getEndIndexAsString()); returnVal.setText(((ForeachController) element).getReturnValString()); useSeparator.setSelected(((ForeachController) element).getUseSeparator()); }
/** * A newly created component can be initialized with the contents of a Test * Element object by calling this method. The component is responsible for * querying the Test Element object for the relevant information to display * in its GUI. * * @param element * the TestElement to configure */
A newly created component can be initialized with the contents of a Test Element object by calling this method. The component is responsible for querying the Test Element object for the relevant information to display in its GUI
configure
{ "repo_name": "yuyupapa/OpenSource", "path": "apache-jmeter-3.0/src/components/org/apache/jmeter/control/gui/ForeachControlPanel.java", "license": "apache-2.0", "size": 9628 }
[ "org.apache.jmeter.control.ForeachController" ]
import org.apache.jmeter.control.ForeachController;
import org.apache.jmeter.control.*;
[ "org.apache.jmeter" ]
org.apache.jmeter;
1,801,363
Map<String, ClassReader> findDeps(Map<String, ClassReader> zipClasses, Map<String, ClassReader> inOutKeepClasses) { TreeMap<String, ClassReader> deps = new TreeMap<>(); TreeMap<String, ClassReader> new_deps = new TreeMap<>(); TreeMap<String, ClassReader> new_keep = new TreeMap<>(); TreeMap<String, ClassReader> temp = new TreeMap<>(); DependencyVisitor visitor = getVisitor(zipClasses, inOutKeepClasses, new_keep, deps, new_deps); for (ClassReader cr : inOutKeepClasses.values()) { visitor.setClassName(cr.getClassName()); cr.accept(visitor, 0 ); } while (new_deps.size() > 0 || new_keep.size() > 0) { deps.putAll(new_deps); inOutKeepClasses.putAll(new_keep); temp.clear(); temp.putAll(new_deps); temp.putAll(new_keep); new_deps.clear(); new_keep.clear(); mLog.debug("Found %1$d to keep, %2$d dependencies.", inOutKeepClasses.size(), deps.size()); for (ClassReader cr : temp.values()) { visitor.setClassName(cr.getClassName()); cr.accept(visitor, 0 ); } } mLog.info("Found %1$d classes to keep, %2$d class dependencies.", inOutKeepClasses.size(), deps.size()); return deps; }
Map<String, ClassReader> findDeps(Map<String, ClassReader> zipClasses, Map<String, ClassReader> inOutKeepClasses) { TreeMap<String, ClassReader> deps = new TreeMap<>(); TreeMap<String, ClassReader> new_deps = new TreeMap<>(); TreeMap<String, ClassReader> new_keep = new TreeMap<>(); TreeMap<String, ClassReader> temp = new TreeMap<>(); DependencyVisitor visitor = getVisitor(zipClasses, inOutKeepClasses, new_keep, deps, new_deps); for (ClassReader cr : inOutKeepClasses.values()) { visitor.setClassName(cr.getClassName()); cr.accept(visitor, 0 ); } while (new_deps.size() > 0 new_keep.size() > 0) { deps.putAll(new_deps); inOutKeepClasses.putAll(new_keep); temp.clear(); temp.putAll(new_deps); temp.putAll(new_keep); new_deps.clear(); new_keep.clear(); mLog.debug(STR, inOutKeepClasses.size(), deps.size()); for (ClassReader cr : temp.values()) { visitor.setClassName(cr.getClassName()); cr.accept(visitor, 0 ); } } mLog.info(STR, inOutKeepClasses.size(), deps.size()); return deps; }
/** * Finds all dependencies for all classes in keepClasses which are also * listed in zipClasses. Returns a map of all the dependencies found. */
Finds all dependencies for all classes in keepClasses which are also listed in zipClasses. Returns a map of all the dependencies found
findDeps
{ "repo_name": "xorware/android_frameworks_base", "path": "tools/layoutlib/create/src/com/android/tools/layoutlib/create/AsmAnalyzer.java", "license": "apache-2.0", "size": 32821 }
[ "java.util.Map", "java.util.TreeMap", "org.objectweb.asm.ClassReader" ]
import java.util.Map; import java.util.TreeMap; import org.objectweb.asm.ClassReader;
import java.util.*; import org.objectweb.asm.*;
[ "java.util", "org.objectweb.asm" ]
java.util; org.objectweb.asm;
2,132,380
@Override protected boolean validatePage() { if (super.validatePage()) { String extension = new Path(getFileName()).getFileExtension(); if (extension == null || !FILE_EXTENSIONS.contains(extension)) { String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension"; //$NON-NLS-1$ //$NON-NLS-2$ setErrorMessage(SpaceWireEditorPlugin.INSTANCE.getString(key, new Object [] { FORMATTED_FILE_EXTENSIONS })); return false; } return true; } return false; }
boolean function() { if (super.validatePage()) { String extension = new Path(getFileName()).getFileExtension(); if (extension == null !FILE_EXTENSIONS.contains(extension)) { String key = FILE_EXTENSIONS.size() > 1 ? STR : STR; setErrorMessage(SpaceWireEditorPlugin.INSTANCE.getString(key, new Object [] { FORMATTED_FILE_EXTENSIONS })); return false; } return true; } return false; }
/** * The framework calls this to see if the file is correct. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
The framework calls this to see if the file is correct.
validatePage
{ "repo_name": "SpaceWireOS-Modeler/MetaModel", "path": "jp.pizzafactory.model.spacewireos.editor/src/jp/pizzafactory/model/spacewireos/networkTopology/presentation/NetworkTopologyModelWizard.java", "license": "epl-1.0", "size": 19317 }
[ "jp.pizzafactory.model.spacewireos.presentation.SpaceWireEditorPlugin", "org.eclipse.core.runtime.Path" ]
import jp.pizzafactory.model.spacewireos.presentation.SpaceWireEditorPlugin; import org.eclipse.core.runtime.Path;
import jp.pizzafactory.model.spacewireos.presentation.*; import org.eclipse.core.runtime.*;
[ "jp.pizzafactory.model", "org.eclipse.core" ]
jp.pizzafactory.model; org.eclipse.core;
1,677,197
EClass getFinalNode();
EClass getFinalNode();
/** * Returns the meta object for class '{@link org.gemoc.activitydiagram.concurrent.xactivitydiagrammt.activitydiagram.FinalNode <em>Final Node</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Final Node</em>'. * @see org.gemoc.activitydiagram.concurrent.xactivitydiagrammt.activitydiagram.FinalNode * @generated */
Returns the meta object for class '<code>org.gemoc.activitydiagram.concurrent.xactivitydiagrammt.activitydiagram.FinalNode Final Node</code>'.
getFinalNode
{ "repo_name": "gemoc/activitydiagram", "path": "dev/gemoc_concurrent/language_workbench/org.gemoc.activitydiagram.concurrent/src-gen/org/gemoc/activitydiagram/concurrent/xactivitydiagrammt/activitydiagram/ActivitydiagramPackage.java", "license": "epl-1.0", "size": 147901 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
544,015
public double DoubleSelectShieldWhere(String _tabla, String _campo, String _condicion){ double intRetorno = -1; abrir(); try{ Cursor c = nBD.rawQuery("SELECT " + _campo + " FROM " + _tabla + " WHERE " + _condicion, null); for(c.moveToFirst();!c.isAfterLast();c.moveToNext()){ intRetorno = c.getDouble(0); } } catch(Exception e){ intRetorno = -1; } cerrar(); return intRetorno; }
double function(String _tabla, String _campo, String _condicion){ double intRetorno = -1; abrir(); try{ Cursor c = nBD.rawQuery(STR + _campo + STR + _tabla + STR + _condicion, null); for(c.moveToFirst();!c.isAfterLast();c.moveToNext()){ intRetorno = c.getDouble(0); } } catch(Exception e){ intRetorno = -1; } cerrar(); return intRetorno; }
/**Funcion que consulta un campo de una tabla segun la condicion recibida y retorna el resultado como un double * @param _tabla ->Tabla sobre la cual se va a trabajar * @param _campo ->Campo que se quiere consultar * @param _condicion ->Condicion para filtro de la consulta * @return */
Funcion que consulta un campo de una tabla segun la condicion recibida y retorna el resultado como un double
DoubleSelectShieldWhere
{ "repo_name": "JulianPoveda/AndroidData", "path": "src/miscelanea/SQLite.java", "license": "gpl-2.0", "size": 151459 }
[ "android.database.Cursor" ]
import android.database.Cursor;
import android.database.*;
[ "android.database" ]
android.database;
1,597,204
ManagedIdentitySqlControlSettingsModelInner innerModel();
ManagedIdentitySqlControlSettingsModelInner innerModel();
/** * Gets the inner com.azure.resourcemanager.synapse.fluent.models.ManagedIdentitySqlControlSettingsModelInner * object. * * @return the inner object. */
Gets the inner com.azure.resourcemanager.synapse.fluent.models.ManagedIdentitySqlControlSettingsModelInner object
innerModel
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIdentitySqlControlSettingsModel.java", "license": "mit", "size": 1415 }
[ "com.azure.resourcemanager.synapse.fluent.models.ManagedIdentitySqlControlSettingsModelInner" ]
import com.azure.resourcemanager.synapse.fluent.models.ManagedIdentitySqlControlSettingsModelInner;
import com.azure.resourcemanager.synapse.fluent.models.*;
[ "com.azure.resourcemanager" ]
com.azure.resourcemanager;
1,004,097
public void remoteHintRead(RemoteHint hint); } public interface VisualizationListener {
void function(RemoteHint hint); } public interface VisualizationListener {
/** * a log entry containing PA_REMOTE_CONNECTION was read * * @param hint the log entry, must be parsed */
a log entry containing PA_REMOTE_CONNECTION was read
remoteHintRead
{ "repo_name": "ow2-proactive/scheduling-portal", "path": "scheduler-portal/src/main/java/org/ow2/proactive_grid_cloud_portal/scheduler/client/SchedulerListeners.java", "license": "agpl-3.0", "size": 8875 }
[ "org.ow2.proactive_grid_cloud_portal.scheduler.client.model.TasksModel" ]
import org.ow2.proactive_grid_cloud_portal.scheduler.client.model.TasksModel;
import org.ow2.proactive_grid_cloud_portal.scheduler.client.model.*;
[ "org.ow2.proactive_grid_cloud_portal" ]
org.ow2.proactive_grid_cloud_portal;
2,827,009
protected ZeroXInstanceKeys makeInstanceKeys(IClassHierarchy cha, AnalysisOptions options, SSAContextInterpreter contextInterpreter, int instancePolicy) { ZeroXInstanceKeys zik = new ZeroXInstanceKeys(options, cha, contextInterpreter, instancePolicy); return zik; }
ZeroXInstanceKeys function(IClassHierarchy cha, AnalysisOptions options, SSAContextInterpreter contextInterpreter, int instancePolicy) { ZeroXInstanceKeys zik = new ZeroXInstanceKeys(options, cha, contextInterpreter, instancePolicy); return zik; }
/** * subclasses can override as desired */
subclasses can override as desired
makeInstanceKeys
{ "repo_name": "nithinvnath/PAVProject", "path": "com.ibm.wala.core/src/com/ibm/wala/ipa/callgraph/propagation/cfa/ZeroXCFABuilder.java", "license": "mit", "size": 4425 }
[ "com.ibm.wala.ipa.callgraph.AnalysisOptions", "com.ibm.wala.ipa.callgraph.propagation.SSAContextInterpreter", "com.ibm.wala.ipa.cha.IClassHierarchy" ]
import com.ibm.wala.ipa.callgraph.AnalysisOptions; import com.ibm.wala.ipa.callgraph.propagation.SSAContextInterpreter; import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.ipa.callgraph.*; import com.ibm.wala.ipa.callgraph.propagation.*; import com.ibm.wala.ipa.cha.*;
[ "com.ibm.wala" ]
com.ibm.wala;
2,122,003
protected static byte[] buildNPCConversationMessage(Player player, String sConversationSTFFile, String sConversationStringInSTF, int SpokenNumericArgument, String sSpokenString, String sSpokenArgumentSTFFile, String aSpokenArgumentSTFName, boolean bShowDialog) throws IOException { SOEOutputStream dOut = new SOEOutputStream(new ByteArrayOutputStream()); dOut.setOpcode(Constants.SOE_CHL_DATA_A); dOut.setSequence(0); dOut.setUpdateType(Constants.OBJECT_UPDATE); dOut.writeInt(Constants.ObjControllerMessage); dOut.writeInt(11); dOut.writeInt(Constants.NpcConversationMessage); dOut.writeLong(player.getID()); dOut.writeInt(0); if (sSpokenString.length() != 0) { dOut.writeUTF16(sSpokenString); dOut.writeInt(0); } else { dOut.writeInt(sConversationSTFFile.length() + sConversationStringInSTF.length() + sSpokenArgumentSTFFile.length() + aSpokenArgumentSTFName.length() + 48); // /((0x56 + // sConversationSTFFile.length() // + // sConversationStringInSTF.length() // + // (bShowDialog // ? 1 : 0)) / // 2); dOut.writeInt(0); dOut.writeBoolean(bShowDialog); dOut.writeInt(-1); // 0xFFFFFFFF dOut.writeUTF(sConversationSTFFile); dOut.writeInt(0); dOut.writeUTF(sConversationStringInSTF); dOut.write(new byte[48]); dOut.writeUTF(sSpokenArgumentSTFFile); dOut.writeInt(0); dOut.writeUTF(aSpokenArgumentSTFName); dOut.writeInt(0); dOut.writeInt(SpokenNumericArgument); // BC 02 00 00 / dOut.writeInt(0); dOut.writeShort(0); } dOut.flush(); return dOut.getBuffer(); }
static byte[] function(Player player, String sConversationSTFFile, String sConversationStringInSTF, int SpokenNumericArgument, String sSpokenString, String sSpokenArgumentSTFFile, String aSpokenArgumentSTFName, boolean bShowDialog) throws IOException { SOEOutputStream dOut = new SOEOutputStream(new ByteArrayOutputStream()); dOut.setOpcode(Constants.SOE_CHL_DATA_A); dOut.setSequence(0); dOut.setUpdateType(Constants.OBJECT_UPDATE); dOut.writeInt(Constants.ObjControllerMessage); dOut.writeInt(11); dOut.writeInt(Constants.NpcConversationMessage); dOut.writeLong(player.getID()); dOut.writeInt(0); if (sSpokenString.length() != 0) { dOut.writeUTF16(sSpokenString); dOut.writeInt(0); } else { dOut.writeInt(sConversationSTFFile.length() + sConversationStringInSTF.length() + sSpokenArgumentSTFFile.length() + aSpokenArgumentSTFName.length() + 48); dOut.writeInt(0); dOut.writeBoolean(bShowDialog); dOut.writeInt(-1); dOut.writeUTF(sConversationSTFFile); dOut.writeInt(0); dOut.writeUTF(sConversationStringInSTF); dOut.write(new byte[48]); dOut.writeUTF(sSpokenArgumentSTFFile); dOut.writeInt(0); dOut.writeUTF(aSpokenArgumentSTFName); dOut.writeInt(0); dOut.writeInt(SpokenNumericArgument); dOut.writeInt(0); dOut.writeShort(0); } dOut.flush(); return dOut.getBuffer(); }
/** * This is the NPC Conversation Packet. This will begin a dialog and prompt * with the appropriate STF File name or a custom string. * * @param player * - Player Object Receiving the Dialog * @param sConversationSTFFile * - If using STF Strings this is the file location I/E * 'skill_teacher' do not add the @ sign nor the : * @param sConversationStringInSTF * - If using STF Strings this is the string name to be sent I/E * 'msg1_1' * @param SpokenNumericArgument * - If the message to prompr includes a cost or numeric argument * to be spoken it goes here normally its 0 if there is no cost * or if its not going to be spoken * @param sSpokenString * - If using this option do not use the STF Strings since this * is the only text the npc will speak * @param sSpokenArgumentSTFFile * - If using STF Strings this is the STF location of any * argument that the first string used needs I/E 'skl_n' do not * add the @ sign nor the : * @param aSpokenArgumentSTFName * - If using STF Strings this is the name of the STF String to * be used I/E 'crafting_artisan' * @param bShowDialog * - This makes the dialog dissapear, looks like SOE wanted a way * to turn a dialog off wihtout changin the way it was sent. * @return * @throws java.io.IOException */
This is the NPC Conversation Packet. This will begin a dialog and prompt with the appropriate STF File name or a custom string
buildNPCConversationMessage
{ "repo_name": "oswin06082/SwgAnh1.0a", "path": "SWGCombined/src/PacketFactory.java", "license": "gpl-3.0", "size": 353841 }
[ "java.io.ByteArrayOutputStream", "java.io.IOException" ]
import java.io.ByteArrayOutputStream; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,103,635
@Override public boolean isFurtherBatchPossible(Graph g) { return true; }
boolean function(Graph g) { return true; }
/** * <b>Note: returns always true!</b> If no further batch is possible, * because there is no other event to read, {@link #generate(Graph)} returns * an empty batch. */
Note: returns always true! If no further batch is possible, because there is no other event to read, <code>#generate(Graph)</code> returns an empty batch
isFurtherBatchPossible
{ "repo_name": "timgrube/DNA", "path": "src/dna/updates/generators/zalando/ZalandoBatchGenerator.java", "license": "gpl-3.0", "size": 27267 }
[ "dna.graph.Graph" ]
import dna.graph.Graph;
import dna.graph.*;
[ "dna.graph" ]
dna.graph;
311,335
public static void removeRegionReplicasFromMeta(Set<byte[]> metaRows, int replicaIndexToDeleteFrom, int numReplicasToRemove, Connection connection) throws IOException { int absoluteIndex = replicaIndexToDeleteFrom + numReplicasToRemove; for (byte[] row : metaRows) { long now = EnvironmentEdgeManager.currentTime(); Delete deleteReplicaLocations = new Delete(row); for (int i = replicaIndexToDeleteFrom; i < absoluteIndex; i++) { deleteReplicaLocations.addColumns(getCatalogFamily(), getServerColumn(i), now); deleteReplicaLocations.addColumns(getCatalogFamily(), getSeqNumColumn(i), now); deleteReplicaLocations.addColumns(getCatalogFamily(), getStartCodeColumn(i), now); } deleteFromMetaTable(connection, deleteReplicaLocations); } }
static void function(Set<byte[]> metaRows, int replicaIndexToDeleteFrom, int numReplicasToRemove, Connection connection) throws IOException { int absoluteIndex = replicaIndexToDeleteFrom + numReplicasToRemove; for (byte[] row : metaRows) { long now = EnvironmentEdgeManager.currentTime(); Delete deleteReplicaLocations = new Delete(row); for (int i = replicaIndexToDeleteFrom; i < absoluteIndex; i++) { deleteReplicaLocations.addColumns(getCatalogFamily(), getServerColumn(i), now); deleteReplicaLocations.addColumns(getCatalogFamily(), getSeqNumColumn(i), now); deleteReplicaLocations.addColumns(getCatalogFamily(), getStartCodeColumn(i), now); } deleteFromMetaTable(connection, deleteReplicaLocations); } }
/** * Deletes some replica columns corresponding to replicas for the passed rows * @param metaRows rows in hbase:meta * @param replicaIndexToDeleteFrom the replica ID we would start deleting from * @param numReplicasToRemove how many replicas to remove * @param connection connection we're using to access meta table * @throws IOException */
Deletes some replica columns corresponding to replicas for the passed rows
removeRegionReplicasFromMeta
{ "repo_name": "Guavus/hbase", "path": "hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java", "license": "apache-2.0", "size": 72646 }
[ "java.io.IOException", "java.util.Set", "org.apache.hadoop.hbase.client.Connection", "org.apache.hadoop.hbase.client.Delete", "org.apache.hadoop.hbase.util.EnvironmentEdgeManager" ]
import java.io.IOException; import java.util.Set; import org.apache.hadoop.hbase.client.Connection; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
import java.io.*; import java.util.*; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.util.*;
[ "java.io", "java.util", "org.apache.hadoop" ]
java.io; java.util; org.apache.hadoop;
1,969,855
public List<SplitTransition<BuildOptions>> getPotentialSplitTransitions() { return ImmutableList.of(); }
List<SplitTransition<BuildOptions>> function() { return ImmutableList.of(); }
/** * Returns a list of potential split configuration transitions for this fragment. Split * configurations usually need to be explicitly enabled by passing in an option. */
Returns a list of potential split configuration transitions for this fragment. Split configurations usually need to be explicitly enabled by passing in an option
getPotentialSplitTransitions
{ "repo_name": "xindaya/bazel", "path": "src/main/java/com/google/devtools/build/lib/analysis/config/FragmentOptions.java", "license": "apache-2.0", "size": 4423 }
[ "com.google.common.collect.ImmutableList", "com.google.devtools.build.lib.packages.Attribute", "java.util.List" ]
import com.google.common.collect.ImmutableList; import com.google.devtools.build.lib.packages.Attribute; import java.util.List;
import com.google.common.collect.*; import com.google.devtools.build.lib.packages.*; import java.util.*;
[ "com.google.common", "com.google.devtools", "java.util" ]
com.google.common; com.google.devtools; java.util;
645,990
@JsonIgnore public TypeReference<ZoozServerResponse<AuthorizeResponse>> getResponseTypeReference() { return new TypeReference<ZoozServerResponse<AuthorizeResponse>>() { }; }
TypeReference<ZoozServerResponse<AuthorizeResponse>> function() { return new TypeReference<ZoozServerResponse<AuthorizeResponse>>() { }; }
/** * Used to return the response type corresponding to the request. * * @return the corresponding response type. */
Used to return the response type corresponding to the request
getResponseTypeReference
{ "repo_name": "Zooz/Zooz-Java", "path": "src/main/java/com/zooz/common/client/ecomm/beans/requests/authorize/requests/ThreeDSecureAuthorizeRequest.java", "license": "apache-2.0", "size": 5740 }
[ "com.fasterxml.jackson.core.type.TypeReference", "com.zooz.common.client.ecomm.beans.responses.AuthorizeResponse", "com.zooz.common.client.ecomm.beans.server.response.ZoozServerResponse" ]
import com.fasterxml.jackson.core.type.TypeReference; import com.zooz.common.client.ecomm.beans.responses.AuthorizeResponse; import com.zooz.common.client.ecomm.beans.server.response.ZoozServerResponse;
import com.fasterxml.jackson.core.type.*; import com.zooz.common.client.ecomm.beans.responses.*; import com.zooz.common.client.ecomm.beans.server.response.*;
[ "com.fasterxml.jackson", "com.zooz.common" ]
com.fasterxml.jackson; com.zooz.common;
2,636,816
public boolean is_unique_rel(BloomFilter<String> bf, Long from, String rel, Long to) { String key = "" + from + to + rel; if (bf.mightContain(key)) { return false; } else { bf.put(key); return true; } }
boolean function(BloomFilter<String> bf, Long from, String rel, Long to) { String key = "" + from + to + rel; if (bf.mightContain(key)) { return false; } else { bf.put(key); return true; } }
/** * Checks to see if the relationship is unique, and if it is, adds it to the * bloom filter. * * @param from * @param to * @param rel * @return */
Checks to see if the relationship is unique, and if it is, adds it to the bloom filter
is_unique_rel
{ "repo_name": "codeaudit/graphene", "path": "graphene-parent/graphene-ingest/src/main/java/graphene/ingest/batchoptimizers/BasicBatchOptimizer.java", "license": "apache-2.0", "size": 520 }
[ "com.google.common.hash.BloomFilter" ]
import com.google.common.hash.BloomFilter;
import com.google.common.hash.*;
[ "com.google.common" ]
com.google.common;
1,099,540
void applyTransformForChildAtIndex(View child, int relativeIndex) { }
void applyTransformForChildAtIndex(View child, int relativeIndex) { }
/** * Apply any necessary tranforms for the child that is being added. */
Apply any necessary tranforms for the child that is being added
applyTransformForChildAtIndex
{ "repo_name": "mateor/pdroid", "path": "android-4.0.3_r1/trunk/frameworks/base/core/java/android/widget/StackView.java", "license": "gpl-3.0", "size": 53664 }
[ "android.view.View" ]
import android.view.View;
import android.view.*;
[ "android.view" ]
android.view;
1,162,551
void setViewPager(ViewPager view);
void setViewPager(ViewPager view);
/** * Bind the indicator to a ViewPager. * * @param view */
Bind the indicator to a ViewPager
setViewPager
{ "repo_name": "ericwhs/android-app", "path": "source/src/cn/eoe/app/indicator/PageIndicator.java", "license": "gpl-3.0", "size": 1829 }
[ "android.support.v4.view.ViewPager" ]
import android.support.v4.view.ViewPager;
import android.support.v4.view.*;
[ "android.support" ]
android.support;
15,704
public int get(DateTimeField field) { if (field == null) { throw new IllegalArgumentException("The DateTimeField must not be null"); } return field.get(getMillis()); }
int function(DateTimeField field) { if (field == null) { throw new IllegalArgumentException(STR); } return field.get(getMillis()); }
/** * Get the value of one of the fields of a datetime. * <p> * This could be used to get a field using a different Chronology. * For example: * <pre> * Instant dt = new Instant(); * int gjYear = dt.get(Chronology.getCoptic().year()); * </pre> * * @param field the DateTimeField to use, not null * @return the value * @throws IllegalArgumentException if the field is null */
Get the value of one of the fields of a datetime. This could be used to get a field using a different Chronology. For example: <code> Instant dt = new Instant(); int gjYear = dt.get(Chronology.getCoptic().year()); </code>
get
{ "repo_name": "0359xiaodong/joda-time-android", "path": "library/src/org/joda/time/base/AbstractInstant.java", "license": "apache-2.0", "size": 15006 }
[ "org.joda.time.DateTimeField" ]
import org.joda.time.DateTimeField;
import org.joda.time.*;
[ "org.joda.time" ]
org.joda.time;
1,252,895