method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public static CacheHeader readHeader(InputStream is) throws IOException { CacheHeader entry = new CacheHeader(); int magic = readInt(is); if (magic != CACHE_MAGIC) { // don't bother deleting, it'll get pruned eventually throw new IOException();...
static CacheHeader function(InputStream is) throws IOException { CacheHeader entry = new CacheHeader(); int magic = readInt(is); if (magic != CACHE_MAGIC) { throw new IOException(); } entry.key = readString(is); entry.etag = readString(is); if (entry.etag.equals("")) { entry.etag = null; } entry.serverDate = readLong(i...
/** * Reads the header off of an InputStream and returns a CacheHeader object. * * @param is The InputStream to read from. * @throws IOException */
Reads the header off of an InputStream and returns a CacheHeader object
readHeader
{ "repo_name": "feimeizhan/PicS", "path": "android-volley-1.0.19/src/main/java/com/android/volley/toolbox/DiskBasedCache.java", "license": "apache-2.0", "size": 19014 }
[ "java.io.IOException", "java.io.InputStream" ]
import java.io.IOException; import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
1,530,372
public PointF getTrans(float x, float y) { ViewPortHandler vph = mChart.getViewPortHandler(); float xTrans = x - vph.offsetLeft(); float yTrans = 0f; // check if axis is inverted if (mChart.isAnyAxisInverted() && mClosestDataSetToTouch != null && mChart.isI...
PointF function(float x, float y) { ViewPortHandler vph = mChart.getViewPortHandler(); float xTrans = x - vph.offsetLeft(); float yTrans = 0f; if (mChart.isAnyAxisInverted() && mClosestDataSetToTouch != null && mChart.isInverted(mClosestDataSetToTouch.getAxisDependency())) { yTrans = -(y - vph.offsetTop()); } else { yT...
/** * returns the correct translation depending on the provided x and y touch * points * * @param x * @param y * @return */
returns the correct translation depending on the provided x and y touch points
getTrans
{ "repo_name": "Stonesjtu/HEMS", "path": "app/libs/mplib/src/com/github/mikephil/charting/listener/BarLineChartTouchListener.java", "license": "gpl-2.0", "size": 19841 }
[ "android.graphics.PointF", "com.github.mikephil.charting.utils.ViewPortHandler" ]
import android.graphics.PointF; import com.github.mikephil.charting.utils.ViewPortHandler;
import android.graphics.*; import com.github.mikephil.charting.utils.*;
[ "android.graphics", "com.github.mikephil" ]
android.graphics; com.github.mikephil;
2,440,259
@JsonProperty("hsts") public HstsBean getHsts() { return hsts; }
@JsonProperty("hsts") HstsBean function() { return hsts; }
/** * HTTP Strict Transport Security * <p> * Enforce transport security when using HTTP to mitigate a range of common web vulnerabilities. * * @return The hsts */
HTTP Strict Transport Security Enforce transport security when using HTTP to mitigate a range of common web vulnerabilities
getHsts
{ "repo_name": "kunallimaye/apiman-plugins", "path": "http-security-policy/src/main/java/io/apiman/plugins/httpsecuritypolicy/beans/HttpSecurityBean.java", "license": "apache-2.0", "size": 10251 }
[ "org.codehaus.jackson.annotate.JsonProperty" ]
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.annotate.*;
[ "org.codehaus.jackson" ]
org.codehaus.jackson;
1,279,328
private void writeWifis(final BufferedWriter bw) throws IOException { Log.i(TAG, "Writing wifi waypoints"); Cursor c = mDbHelper.getReadableDatabase().rawQuery(WIFI_POINTS_SQL_QUERY, new String[]{String.valueOf(mSession), String.valueOf(0)}); //Log.i(TAG, WIFI_POINTS_SQL_QUERY); final int colLatitude = c.ge...
void function(final BufferedWriter bw) throws IOException { Log.i(TAG, STR); Cursor c = mDbHelper.getReadableDatabase().rawQuery(WIFI_POINTS_SQL_QUERY, new String[]{String.valueOf(mSession), String.valueOf(0)}); final int colLatitude = c.getColumnIndex(Schema.COL_LATITUDE); final int colLongitude = c.getColumnIndex(Sch...
/** * Iterates on way points and write them. * @param bw Writer to the target file. * @param c Cursor to way points. * @throws IOException */
Iterates on way points and write them
writeWifis
{ "repo_name": "saintbyte/openbmap", "path": "android/app/src/main/java/org/openbmap/soapclient/GpxExporter.java", "license": "agpl-3.0", "size": 14559 }
[ "android.database.Cursor", "android.util.Log", "java.io.BufferedWriter", "java.io.IOException", "org.apache.commons.lang3.StringEscapeUtils", "org.openbmap.db.Schema" ]
import android.database.Cursor; import android.util.Log; import java.io.BufferedWriter; import java.io.IOException; import org.apache.commons.lang3.StringEscapeUtils; import org.openbmap.db.Schema;
import android.database.*; import android.util.*; import java.io.*; import org.apache.commons.lang3.*; import org.openbmap.db.*;
[ "android.database", "android.util", "java.io", "org.apache.commons", "org.openbmap.db" ]
android.database; android.util; java.io; org.apache.commons; org.openbmap.db;
1,257,043
protected void executeSqlScript(String sqlResourcePath, boolean continueOnError) throws DataAccessException { Resource resource = this.applicationContext.getResource(sqlResourcePath); SimpleJdbcTestUtils.executeSqlScript(this.simpleJdbcTemplate, new EncodedResource(resource, this.sq...
void function(String sqlResourcePath, boolean continueOnError) throws DataAccessException { Resource resource = this.applicationContext.getResource(sqlResourcePath); SimpleJdbcTestUtils.executeSqlScript(this.simpleJdbcTemplate, new EncodedResource(resource, this.sqlScriptEncoding), continueOnError); }
/** * Execute the given SQL script. Use with caution outside of a transaction! * <p> * The script will normally be loaded by classpath. There should be one * statement per line. Any semicolons will be removed. <b>Do not use this * method to execute DDL if you expect rollback.</b> * * ...
Execute the given SQL script. Use with caution outside of a transaction! The script will normally be loaded by classpath. There should be one statement per line. Any semicolons will be removed. Do not use this method to execute DDL if you expect rollback
executeSqlScript
{ "repo_name": "devacfr/capsicum", "path": "capsicum-testing/src/main/java/org/cfr/capsicum/test/AbstractCayenneJUnit4DbUnitSpringContextTests.java", "license": "apache-2.0", "size": 15781 }
[ "org.springframework.core.io.Resource", "org.springframework.core.io.support.EncodedResource", "org.springframework.dao.DataAccessException", "org.springframework.test.jdbc.SimpleJdbcTestUtils" ]
import org.springframework.core.io.Resource; import org.springframework.core.io.support.EncodedResource; import org.springframework.dao.DataAccessException; import org.springframework.test.jdbc.SimpleJdbcTestUtils;
import org.springframework.core.io.*; import org.springframework.core.io.support.*; import org.springframework.dao.*; import org.springframework.test.jdbc.*;
[ "org.springframework.core", "org.springframework.dao", "org.springframework.test" ]
org.springframework.core; org.springframework.dao; org.springframework.test;
1,454,351
public AdminobjectType<T> adminobjectClass(String adminobjectClass) { childNode.getOrCreate("adminobject-class").text(adminobjectClass); return this; }
AdminobjectType<T> function(String adminobjectClass) { childNode.getOrCreate(STR).text(adminobjectClass); return this; }
/** * Sets the <code>adminobject-class</code> element * @param adminobjectClass the value for the element <code>adminobject-class</code> * @return the current instance of <code>AdminobjectType<T></code> */
Sets the <code>adminobject-class</code> element
adminobjectClass
{ "repo_name": "forge/javaee-descriptors", "path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/connector16/AdminobjectTypeImpl.java", "license": "epl-1.0", "size": 7721 }
[ "org.jboss.shrinkwrap.descriptor.api.connector16.AdminobjectType" ]
import org.jboss.shrinkwrap.descriptor.api.connector16.AdminobjectType;
import org.jboss.shrinkwrap.descriptor.api.connector16.*;
[ "org.jboss.shrinkwrap" ]
org.jboss.shrinkwrap;
987,700
private synchronized void initialize() throws AtlasRServicesException { if (!isInitialized) { // create worker pool workerPool = new GenericObjectPool(new RWorkerObjectFactory()); workerPool.setMaxActive(32); workerPool.setMaxIdle(32); workerPool.s...
synchronized void function() throws AtlasRServicesException { if (!isInitialized) { workerPool = new GenericObjectPool(new RWorkerObjectFactory()); workerPool.setMaxActive(32); workerPool.setMaxIdle(32); workerPool.setTestOnBorrow(true); workerPool.setTestOnReturn(true); isInitialized = true; } } private class RWorkerO...
/** * Lazily initializes the worker pool when the first R service is requested * * @throws AtlasRServicesException if initialization failed */
Lazily initializes the worker pool when the first R service is requested
initialize
{ "repo_name": "gxa/gxa", "path": "atlas-analytics/src/main/java/uk/ac/ebi/gxa/R/BiocepAtlasRFactory.java", "license": "apache-2.0", "size": 14896 }
[ "org.apache.commons.pool.PoolableObjectFactory", "org.apache.commons.pool.impl.GenericObjectPool", "uk.ac.ebi.rcloud.rpf.ServantProvider", "uk.ac.ebi.rcloud.rpf.ServantProviderFactory" ]
import org.apache.commons.pool.PoolableObjectFactory; import org.apache.commons.pool.impl.GenericObjectPool; import uk.ac.ebi.rcloud.rpf.ServantProvider; import uk.ac.ebi.rcloud.rpf.ServantProviderFactory;
import org.apache.commons.pool.*; import org.apache.commons.pool.impl.*; import uk.ac.ebi.rcloud.rpf.*;
[ "org.apache.commons", "uk.ac.ebi" ]
org.apache.commons; uk.ac.ebi;
2,692,897
LazyGQuery<T> replaceWith(Element elem);
LazyGQuery<T> replaceWith(Element elem);
/** * Replaces all matched elements with the specified element. * * @return the GQuery element that was just replaced, which has been removed from the DOM and not * the new element that has replaced it. */
Replaces all matched elements with the specified element
replaceWith
{ "repo_name": "lucasam/gwtquery", "path": "gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java", "license": "mit", "size": 90576 }
[ "com.google.gwt.dom.client.Element" ]
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.*;
[ "com.google.gwt" ]
com.google.gwt;
1,459,768
public void removeItem(final Item item, final int n) { this.inventory.removeItem(item, n); }
void function(final Item item, final int n) { this.inventory.removeItem(item, n); }
/** * Removes the item. * * @param item * the item * @param n * the n */
Removes the item
removeItem
{ "repo_name": "Pierre-Demessence/IdleRPG", "path": "IdleRPG/src/fr/idlerpg/character/Hero.java", "license": "gpl-2.0", "size": 16125 }
[ "fr.idlerpg.item.Item" ]
import fr.idlerpg.item.Item;
import fr.idlerpg.item.*;
[ "fr.idlerpg.item" ]
fr.idlerpg.item;
2,550,254
public void setDateCompletePlan (Timestamp DateCompletePlan);
void function (Timestamp DateCompletePlan);
/** Set Complete Plan. * Planned Completion Date */
Set Complete Plan. Planned Completion Date
setDateCompletePlan
{ "repo_name": "geneos/adempiere", "path": "base/src/org/compiere/model/I_R_Request.java", "license": "gpl-2.0", "size": 23913 }
[ "java.sql.Timestamp" ]
import java.sql.Timestamp;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,322,017
@JsonProperty(K_ELEMENT) public FieldType getElementType() { return elementType; }
@JsonProperty(K_ELEMENT) FieldType function() { return elementType; }
/** * Returns the element type. * @return the element type */
Returns the element type
getElementType
{ "repo_name": "ashigeru/asakusafw", "path": "info/hive/src/main/java/com/asakusafw/info/hive/ArrayType.java", "license": "apache-2.0", "size": 2926 }
[ "com.fasterxml.jackson.annotation.JsonProperty" ]
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.*;
[ "com.fasterxml.jackson" ]
com.fasterxml.jackson;
2,685,196
public void testClientRetryWithFailover(final AtMostOnceOp op) throws Exception { final Map<String, Object> results = new HashMap<String, Object>(); op.prepare(); // set DummyRetryInvocationHandler#block to true DummyRetryInvocationHandler.block.set(true);
void function(final AtMostOnceOp op) throws Exception { final Map<String, Object> results = new HashMap<String, Object>(); op.prepare(); DummyRetryInvocationHandler.block.set(true);
/** * When NN failover happens, if the client did not receive the response and * send a retry request to the other NN, the same response should be recieved * based on the retry cache. */
When NN failover happens, if the client did not receive the response and send a retry request to the other NN, the same response should be recieved based on the retry cache
testClientRetryWithFailover
{ "repo_name": "NJUJYB/disYarn", "path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestRetryCacheWithHA.java", "license": "apache-2.0", "size": 45234 }
[ "java.util.HashMap", "java.util.Map" ]
import java.util.HashMap; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,737,383
public void setPathParameters(List<String> pathParameters) { this.pathParameters = pathParameters; }
void function(List<String> pathParameters) { this.pathParameters = pathParameters; }
/** * Set a map of dynamic parameters to be copied from the incoming URL to the target url, mapping * the parameter name in the incoming URL to the parameter name in the target URL. * * @param */
Set a map of dynamic parameters to be copied from the incoming URL to the target url, mapping the parameter name in the incoming URL to the parameter name in the target URL
setPathParameters
{ "repo_name": "phillips1021/uPortal", "path": "uPortal-url/src/main/java/org/apereo/portal/redirect/AbstractRedirectionUrl.java", "license": "apache-2.0", "size": 3682 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,930,473
protected void processSinkAdded(McastEvent event) { log.info("processSinkAdded {}", event); McastRouteInfo mcastRouteInfo = event.subject(); if (!mcastRouteInfo.isComplete()) { log.info("Incompleted McastRouteInfo. Abort."); return; } ConnectPoint sour...
void function(McastEvent event) { log.info(STR, event); McastRouteInfo mcastRouteInfo = event.subject(); if (!mcastRouteInfo.isComplete()) { log.info(STR); return; } ConnectPoint source = mcastRouteInfo.source().orElse(null); ConnectPoint sink = mcastRouteInfo.sink().orElse(null); IpAddress mcastIp = mcastRouteInfo.rou...
/** * Processes the SINK_ADDED event. * * @param event McastEvent with SINK_ADDED type */
Processes the SINK_ADDED event
processSinkAdded
{ "repo_name": "Shashikanth-Huawei/bmp", "path": "apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/McastHandler.java", "license": "apache-2.0", "size": 35116 }
[ "org.onlab.packet.IpAddress", "org.onosproject.net.ConnectPoint", "org.onosproject.net.mcast.McastEvent", "org.onosproject.net.mcast.McastRouteInfo" ]
import org.onlab.packet.IpAddress; import org.onosproject.net.ConnectPoint; import org.onosproject.net.mcast.McastEvent; import org.onosproject.net.mcast.McastRouteInfo;
import org.onlab.packet.*; import org.onosproject.net.*; import org.onosproject.net.mcast.*;
[ "org.onlab.packet", "org.onosproject.net" ]
org.onlab.packet; org.onosproject.net;
1,474,233
public static String formatSqlException(SQLException ex) { StringBuilder sb = new StringBuilder(); for (Throwable e : ex) { if (e instanceof SQLException) { sb.append("SQLState: " + ((SQLException) e).getSQLState() + "\n") .append("Error Code: " + ((SQLException) e).getErrorCode() + ...
static String function(SQLException ex) { StringBuilder sb = new StringBuilder(); for (Throwable e : ex) { if (e instanceof SQLException) { sb.append(STR + ((SQLException) e).getSQLState() + "\n") .append(STR + ((SQLException) e).getErrorCode() + "\n") .append(STR + e.getMessage() + "\n"); Throwable t = ex.getCause(); ...
/** * Formats the error message of a {@link java.sql.SQLException} for human consumption. * * @param ex SQLException * @return Formatted string with database-specific error code, error message, and SQLState */
Formats the error message of a <code>java.sql.SQLException</code> for human consumption
formatSqlException
{ "repo_name": "kiritbasu/datacollector", "path": "jdbc-lib/src/main/java/com/streamsets/pipeline/lib/jdbc/JdbcUtil.java", "license": "apache-2.0", "size": 7246 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,189,412
default void afterDeliver(ServerConsumer consumer, MessageReference reference) throws ActiveMQException { //by default call the old method for backwards compatibility this.afterDeliver(reference); } /** * Before a message is delivered to a client consumer * * @param reference * @th...
default void afterDeliver(ServerConsumer consumer, MessageReference reference) throws ActiveMQException { this.afterDeliver(reference); } /** * Before a message is delivered to a client consumer * * @param reference * @throws ActiveMQException * * @deprecated use throws ActiveMQException {@link #beforeDeliver(ServerCon...
/** * After a message is delivered to a client consumer * * @param consumer the consumer the message was delivered to * @param reference message reference * @throws ActiveMQException */
After a message is delivered to a client consumer
afterDeliver
{ "repo_name": "mnovak1/activemq-artemis", "path": "artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerPlugin.java", "license": "apache-2.0", "size": 16642 }
[ "org.apache.activemq.artemis.api.core.ActiveMQException", "org.apache.activemq.artemis.core.server.MessageReference", "org.apache.activemq.artemis.core.server.ServerConsumer" ]
import org.apache.activemq.artemis.api.core.ActiveMQException; import org.apache.activemq.artemis.core.server.MessageReference; import org.apache.activemq.artemis.core.server.ServerConsumer;
import org.apache.activemq.artemis.api.core.*; import org.apache.activemq.artemis.core.server.*;
[ "org.apache.activemq" ]
org.apache.activemq;
1,466,146
public List<VirtualMachineSizeInner> listAvailableSizes(String resourceGroupName, String availabilitySetName) { return listAvailableSizesWithServiceResponseAsync(resourceGroupName, availabilitySetName).toBlocking().single().body(); }
List<VirtualMachineSizeInner> function(String resourceGroupName, String availabilitySetName) { return listAvailableSizesWithServiceResponseAsync(resourceGroupName, availabilitySetName).toBlocking().single().body(); }
/** * Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. * * @param resourceGroupName The name of the resource group. * @param availabilitySetName The name of the availability set. * @throws IllegalArgumentException thrown...
Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set
listAvailableSizes
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/compute/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/compute/v2019_03_01/implementation/AvailabilitySetsInner.java", "license": "mit", "size": 63110 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
540,557
public void partNine(@Nonnull final File file) throws IOException { requireNonNull(file, "The file must not be null"); final List<String> lineList = ImmutableList.of(); try (final Stream<String> lines = Files.lines(file.toPath(), Charset.defaultCharset())) { lines.fo...
void function(@Nonnull final File file) throws IOException { requireNonNull(file, STR); final List<String> lineList = ImmutableList.of(); try (final Stream<String> lines = Files.lines(file.toPath(), Charset.defaultCharset())) { lines.forEach(lineList::add); } Collections.shuffle(lineList); lineList.stream().forEach(Sys...
/** * Read the entire input one line at a time and randomly permute the lines * before outputting them. * * @param file * @throws IOException */
Read the entire input one line at a time and randomly permute the lines before outputting them
partNine
{ "repo_name": "norrey/ods-solutions", "path": "chapter-one/src/main/java/com/norrey/chapter/one/Exercise1_1.java", "license": "gpl-3.0", "size": 8112 }
[ "com.google.common.collect.ImmutableList", "java.io.File", "java.io.IOException", "java.nio.charset.Charset", "java.nio.file.Files", "java.util.Collections", "java.util.Comparator", "java.util.List", "java.util.Objects", "java.util.stream.Stream", "javax.annotation.Nonnull" ]
import com.google.common.collect.ImmutableList; import java.io.File; import java.io.IOException; import java.nio.charset.Charset; import java.nio.file.Files; import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.Objects; import java.util.stream.Stream; import javax.annotatio...
import com.google.common.collect.*; import java.io.*; import java.nio.charset.*; import java.nio.file.*; import java.util.*; import java.util.stream.*; import javax.annotation.*;
[ "com.google.common", "java.io", "java.nio", "java.util", "javax.annotation" ]
com.google.common; java.io; java.nio; java.util; javax.annotation;
2,829,149
@Override public ImmutableList<V> get(@Nullable K key) { // This cast is safe as its type is known in constructor. ImmutableList<V> list = (ImmutableList<V>) map.get(key); return (list == null) ? ImmutableList.<V>of() : list; } private transient ImmutableListMultimap<V, K> inverse; /** * {@inhe...
@Override ImmutableList<V> function(@Nullable K key) { ImmutableList<V> list = (ImmutableList<V>) map.get(key); return (list == null) ? ImmutableList.<V>of() : list; } private transient ImmutableListMultimap<V, K> inverse; /** * {@inheritDoc}
/** * Returns an immutable list of the values for the given key. If no mappings * in the multimap have the provided key, an empty immutable list is * returned. The values are in the same order as the parameters used to build * this multimap. */
Returns an immutable list of the values for the given key. If no mappings in the multimap have the provided key, an empty immutable list is returned. The values are in the same order as the parameters used to build this multimap
get
{ "repo_name": "user234/setyon-guava-libraries-clone", "path": "guava/src/com/google/common/collect/ImmutableListMultimap.java", "license": "apache-2.0", "size": 12679 }
[ "javax.annotation.Nullable" ]
import javax.annotation.Nullable;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
387,546
private TextAreaVisibleArea getVisibleArea(boolean needUpdate) { if (needUpdate) { mTextAreaUtil.getCurrentVisibleArea(DiagTextArea.this, m_Ref_VisibleArea); } return m_Ref_VisibleArea; }
TextAreaVisibleArea function(boolean needUpdate) { if (needUpdate) { mTextAreaUtil.getCurrentVisibleArea(DiagTextArea.this, m_Ref_VisibleArea); } return m_Ref_VisibleArea; }
/** * * Returns text visible area * * @param needUpdate * When setText is done, to fix the number of characters and the * total number of lines displayed in the current textArea When * scrolling occurs in the textArea, there are changing values * (for example...
Returns text visible area
getVisibleArea
{ "repo_name": "hkonyaku/LLPAD", "path": "src/main/java/org/riversun/llpad/widget/component/DiagTextArea.java", "license": "mit", "size": 12981 }
[ "org.riversun.llpad.widget.component.JTextAreaHelper" ]
import org.riversun.llpad.widget.component.JTextAreaHelper;
import org.riversun.llpad.widget.component.*;
[ "org.riversun.llpad" ]
org.riversun.llpad;
2,661,774
public void paintLayeredHighlights(Graphics g, int p0, int p1, Shape viewBounds, JTextComponent editor, View view) { paintListLayered(g, p0,p1, viewBounds, editor, view, markedOccurrences); super.paintLayeredHighlights(g, p0, p1, viewBounds, editor, view); paintListLayered(g, p0,p1, viewBounds, edito...
void function(Graphics g, int p0, int p1, Shape viewBounds, JTextComponent editor, View view) { paintListLayered(g, p0,p1, viewBounds, editor, view, markedOccurrences); super.paintLayeredHighlights(g, p0, p1, viewBounds, editor, view); paintListLayered(g, p0,p1, viewBounds, editor, view, parserHighlights); }
/** * When leaf Views (such as LabelView) are rendering they should * call into this method. If a highlight is in the given region it will * be drawn immediately. * * @param g Graphics used to draw * @param p0 starting offset of view * @param p1 ending offset of view * @param viewBounds Bounds o...
When leaf Views (such as LabelView) are rendering they should call into this method. If a highlight is in the given region it will be drawn immediately
paintLayeredHighlights
{ "repo_name": "thomasgalvin/ThirdParty", "path": "RText/RText-Editor/src/main/java/org/fife/ui/rsyntaxtextarea/RSyntaxTextAreaHighlighter.java", "license": "apache-2.0", "size": 12746 }
[ "java.awt.Graphics", "java.awt.Shape", "javax.swing.text.JTextComponent", "javax.swing.text.View" ]
import java.awt.Graphics; import java.awt.Shape; import javax.swing.text.JTextComponent; import javax.swing.text.View;
import java.awt.*; import javax.swing.text.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
1,763,183
@Override public byte[] getRecord() { byte[] b = new byte[4]; System.arraycopy( ByteTools.shortToLEBytes( getOpcode() ), 0, b, 0, 2 ); System.arraycopy( ByteTools.shortToLEBytes( (short) getData().length ), 0, b, 2, 2 ); return ByteTools.append( getData(), b ); }
byte[] function() { byte[] b = new byte[4]; System.arraycopy( ByteTools.shortToLEBytes( getOpcode() ), 0, b, 0, 2 ); System.arraycopy( ByteTools.shortToLEBytes( (short) getData().length ), 0, b, 2, 2 ); return ByteTools.append( getData(), b ); }
/** * return the bytes describing this record, including the header * * @return */
return the bytes describing this record, including the header
getRecord
{ "repo_name": "Maxels88/openxls", "path": "src/main/java/org/openxls/formats/XLS/SXNum.java", "license": "gpl-3.0", "size": 2091 }
[ "org.openxls.toolkit.ByteTools" ]
import org.openxls.toolkit.ByteTools;
import org.openxls.toolkit.*;
[ "org.openxls.toolkit" ]
org.openxls.toolkit;
1,325,518
public static OffsetRange[] computeOffsetRanges( HashMap<TopicAndPartition, LeaderOffset> fromOffsetMap, HashMap<TopicAndPartition, LeaderOffset> toOffsetMap, long numEvents) { Comparator<OffsetRange> byPartition = Comparator.comparing(OffsetRange::partition); // Create initial...
static OffsetRange[] function( HashMap<TopicAndPartition, LeaderOffset> fromOffsetMap, HashMap<TopicAndPartition, LeaderOffset> toOffsetMap, long numEvents) { Comparator<OffsetRange> byPartition = Comparator.comparing(OffsetRange::partition); OffsetRange[] ranges = new OffsetRange[toOffsetMap.size()]; toOffsetMap.entry...
/** * Compute the offset ranges to read from Kafka, while handling newly added partitions, skews, event limits. * * @param fromOffsetMap offsets where we left off last time * @param toOffsetMap offsets of where each partitions is currently at * @param numEvents maximum number of events to read....
Compute the offset ranges to read from Kafka, while handling newly added partitions, skews, event limits
computeOffsetRanges
{ "repo_name": "vinothchandar/hoodie", "path": "hoodie-utilities/src/main/java/com/uber/hoodie/utilities/sources/helpers/KafkaOffsetGen.java", "license": "apache-2.0", "size": 9602 }
[ "java.util.Comparator", "java.util.HashMap", "java.util.HashSet", "java.util.stream.Collectors", "org.apache.spark.streaming.kafka.KafkaCluster", "org.apache.spark.streaming.kafka.OffsetRange" ]
import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.stream.Collectors; import org.apache.spark.streaming.kafka.KafkaCluster; import org.apache.spark.streaming.kafka.OffsetRange;
import java.util.*; import java.util.stream.*; import org.apache.spark.streaming.kafka.*;
[ "java.util", "org.apache.spark" ]
java.util; org.apache.spark;
1,929,290
private void createInstance() throws InvocationTargetException { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "createInstance"); ManagedObjectFactory<?> ejbManagedObjectFactory = home.beanMetaData.ivEnterprise...
void function() throws InvocationTargetException { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, STR); ManagedObjectFactory<?> ejbManagedObjectFactory = home.beanMetaData.ivEnterpriseBeanFactory; if (ejbManagedObjectFactory != null) { createInstanceUs...
/** * Creates the bean instance using either the ManagedObjectFactory or constructor. */
Creates the bean instance using either the ManagedObjectFactory or constructor
createInstance
{ "repo_name": "OpenLiberty/open-liberty", "path": "dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/ManagedBeanOBase.java", "license": "epl-1.0", "size": 19692 }
[ "com.ibm.websphere.ras.Tr", "com.ibm.websphere.ras.TraceComponent", "com.ibm.ws.managedobject.ManagedObjectFactory", "java.lang.reflect.InvocationTargetException" ]
import com.ibm.websphere.ras.Tr; import com.ibm.websphere.ras.TraceComponent; import com.ibm.ws.managedobject.ManagedObjectFactory; import java.lang.reflect.InvocationTargetException;
import com.ibm.websphere.ras.*; import com.ibm.ws.managedobject.*; import java.lang.reflect.*;
[ "com.ibm.websphere", "com.ibm.ws", "java.lang" ]
com.ibm.websphere; com.ibm.ws; java.lang;
1,735,152
@Idempotent long getPreferredBlockSize(String filename) throws IOException; /** * Enter, leave or get safe mode. * <p> * Safe mode is a name node state when it * <ol><li>does not accept changes to name space (read-only), and</li> * <li>does not replicate or delete blocks.</li></ol> * *...
long getPreferredBlockSize(String filename) throws IOException; /** * Enter, leave or get safe mode. * <p> * Safe mode is a name node state when it * <ol><li>does not accept changes to name space (read-only), and</li> * <li>does not replicate or delete blocks.</li></ol> * * <p> * Safe mode is entered automatically at n...
/** * Get the block size for the given file. * @param filename The name of the file * @return The number of bytes in each block * @throws IOException * @throws org.apache.hadoop.fs.UnresolvedLinkException if the path contains * a symlink. */
Get the block size for the given file
getPreferredBlockSize
{ "repo_name": "NJUJYB/disYarn", "path": "hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/ClientProtocol.java", "license": "apache-2.0", "size": 60058 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,903,869
public static void timeoutTask(CompletionService completionService) { if (completionService instanceof SubmitOrderedCompletionService) { ((SubmitOrderedCompletionService) completionService).timeoutTask(); } }
static void function(CompletionService completionService) { if (completionService instanceof SubmitOrderedCompletionService) { ((SubmitOrderedCompletionService) completionService).timeoutTask(); } }
/** * Timeout the completion service. * <p/> * This can be used to mark the completion service as timed out, allowing you to poll any already completed tasks. * This applies when using the {@link SubmitOrderedCompletionService}. * * @param completionService the completion service. */
Timeout the completion service. This can be used to mark the completion service as timed out, allowing you to poll any already completed tasks. This applies when using the <code>SubmitOrderedCompletionService</code>
timeoutTask
{ "repo_name": "kingargyle/turmeric-bot", "path": "camel-core/src/main/java/org/apache/camel/util/concurrent/ExecutorServiceHelper.java", "license": "apache-2.0", "size": 17396 }
[ "java.util.concurrent.CompletionService" ]
import java.util.concurrent.CompletionService;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,211,857
private static boolean isIterationConstruct(Element el) { // ui:repeat if(el.getLocalName().equals("repeat") && el.getNamespaceURI().equals("http://java.sun.com/jsf/facelets")) { return true; // rich:dataTable and other datatables } else if(el.getLocalName().equals("dataTable")) { return true; } e...
static boolean function(Element el) { if(el.getLocalName().equals(STR) && el.getNamespaceURI().equals(STRdataTableSTRforEachSTRhttp: return true; } else { return false; } }
/** * Check whether an element is an iteration construct or not. * @param el * @return */
Check whether an element is an iteration construct or not
isIterationConstruct
{ "repo_name": "fregaham/KiWi", "path": "src/action/kiwi/service/rdfa/JSFRDFaParser.java", "license": "bsd-3-clause", "size": 6342 }
[ "nu.xom.Element" ]
import nu.xom.Element;
import nu.xom.*;
[ "nu.xom" ]
nu.xom;
2,497,783
public static String format(Date date, String pattern, TimeZone timeZone, Locale locale) { FastDateFormat df = FastDateFormat.getInstance(pattern, timeZone, locale); return df.format(date); }
static String function(Date date, String pattern, TimeZone timeZone, Locale locale) { FastDateFormat df = FastDateFormat.getInstance(pattern, timeZone, locale); return df.format(date); }
/** * <p>Formats a date/time into a specific pattern in a time zone and locale.</p> * * @param date the date to format * @param pattern the pattern to use to format the date * @param timeZone the time zone to use, may be <code>null</code> * @param locale the locale to use, may be <c...
Formats a date/time into a specific pattern in a time zone and locale
format
{ "repo_name": "ganghuaChen/android-delayed", "path": "src/org/apache/commons/lang/time/DateFormatUtils.java", "license": "gpl-3.0", "size": 12189 }
[ "java.util.Date", "java.util.Locale", "java.util.TimeZone" ]
import java.util.Date; import java.util.Locale; import java.util.TimeZone;
import java.util.*;
[ "java.util" ]
java.util;
2,314,441
public static String compactPath(String path) { return compactPath(path, File.separatorChar); }
static String function(String path) { return compactPath(path, File.separatorChar); }
/** * Compacts a path by stacking it and reducing <tt>..</tt>, * and uses OS specific file separators (eg {@link java.io.File#separator}). */
Compacts a path by stacking it and reducing .., and uses OS specific file separators (eg <code>java.io.File#separator</code>)
compactPath
{ "repo_name": "YMartsynkevych/camel", "path": "camel-core/src/main/java/org/apache/camel/util/FileUtil.java", "license": "apache-2.0", "size": 19556 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
2,151,359
FileInfo createFile(AlluxioURI path, CreateFileContext context) throws AccessControlException, InvalidPathException, FileAlreadyExistsException, BlockInfoException, IOException, FileDoesNotExistException;
FileInfo createFile(AlluxioURI path, CreateFileContext context) throws AccessControlException, InvalidPathException, FileAlreadyExistsException, BlockInfoException, IOException, FileDoesNotExistException;
/** * Creates a file (not a directory) for a given path. * <p> * This operation requires WRITE permission on the parent of this path. * * @param path the file to create * @param context the method context * @return the file info of the created file * @throws InvalidPathException if an invalid pa...
Creates a file (not a directory) for a given path. This operation requires WRITE permission on the parent of this path
createFile
{ "repo_name": "maobaolong/alluxio", "path": "core/server/master/src/main/java/alluxio/master/file/FileSystemMaster.java", "license": "apache-2.0", "size": 25181 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,541,000
@Override public List getCommandAliases() { return aliases; }
List function() { return aliases; }
/** * Get alternative names for command */
Get alternative names for command
getCommandAliases
{ "repo_name": "aegf1/MCTest1", "path": "src/main/java/com/JosephB/maxwellcraft/commands/StartDataRecord.java", "license": "gpl-3.0", "size": 2246 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
617,349
@Test public void testGetHost_1() throws Exception { HDRequest fixture = new HDRequest(); fixture.setProtocol(""); fixture.setQueryString(new LinkedList()); fixture.setRequestHeaders(new LinkedList()); fixture.setMethod(""); fixture.setPostDatas(new Li...
void function() throws Exception { HDRequest fixture = new HDRequest(); fixture.setProtocol(STRSTRSTRSTRSTRSTRSTRSTRSTR", result); }
/** * Run the String getHost() method test. * * @throws Exception * * @generatedBy CodePro at 9/10/14 9:36 AM */
Run the String getHost() method test
testGetHost_1
{ "repo_name": "intuit/Tank", "path": "harness_data/src/test/java/com/intuit/tank/harness/data/HDRequestTest.java", "license": "epl-1.0", "size": 20107 }
[ "com.intuit.tank.harness.data.HDRequest" ]
import com.intuit.tank.harness.data.HDRequest;
import com.intuit.tank.harness.data.*;
[ "com.intuit.tank" ]
com.intuit.tank;
2,315,448
int deleteByAccount(@Param("account") AccAccount account);
int deleteByAccount(@Param(STR) AccAccount account);
/** * Removes mapping by given account * * @param account * @return */
Removes mapping by given account
deleteByAccount
{ "repo_name": "bcvsolutions/CzechIdMng", "path": "Realization/backend/acc/src/main/java/eu/bcvsolutions/idm/acc/repository/AccTreeAccountRepository.java", "license": "mit", "size": 586 }
[ "eu.bcvsolutions.idm.acc.entity.AccAccount", "org.springframework.data.repository.query.Param" ]
import eu.bcvsolutions.idm.acc.entity.AccAccount; import org.springframework.data.repository.query.Param;
import eu.bcvsolutions.idm.acc.entity.*; import org.springframework.data.repository.query.*;
[ "eu.bcvsolutions.idm", "org.springframework.data" ]
eu.bcvsolutions.idm; org.springframework.data;
1,941,843
public void connLCEngDisconnect(WindowEvent arg1) { try { getEngine().disconnect(); } catch (java.lang.Throwable ivjExc) { handleException(ivjExc); } }
void function(WindowEvent arg1) { try { getEngine().disconnect(); } catch (java.lang.Throwable ivjExc) { handleException(ivjExc); } }
/** * Disconnects the LCEngine. * @param arg1 java.awt.event.WindowEvent */
Disconnects the LCEngine
connLCEngDisconnect
{ "repo_name": "ACS-Community/ACS", "path": "LGPL/CommonSoftware/acsGUIs/jlog/src/com/cosylab/logging/LoggingClient.java", "license": "lgpl-2.1", "size": 66213 }
[ "java.awt.event.WindowEvent" ]
import java.awt.event.WindowEvent;
import java.awt.event.*;
[ "java.awt" ]
java.awt;
305,751
public synchronized ProxyAndInfo<?> getClient() { this.numThreads++; this.lastActiveTs = Time.monotonicNow(); return this.client; }
synchronized ProxyAndInfo<?> function() { this.numThreads++; this.lastActiveTs = Time.monotonicNow(); return this.client; }
/** * Get the connection client. * * @return Connection client. */
Get the connection client
getClient
{ "repo_name": "apurtell/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/ConnectionContext.java", "license": "apache-2.0", "size": 4862 }
[ "org.apache.hadoop.hdfs.NameNodeProxiesClient", "org.apache.hadoop.util.Time" ]
import org.apache.hadoop.hdfs.NameNodeProxiesClient; import org.apache.hadoop.util.Time;
import org.apache.hadoop.hdfs.*; import org.apache.hadoop.util.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,459,165
@Test public void testBuffer() { // NOPMD (assert missing) for (int i=0;i<ARRAY_LENGTH;i++) { // initialize ClassLoadingRecord record = new ClassLoadingRecord(LONG_VALUES.get(i % LONG_VALUES.size()), STRING_VALUES.get(i % STRING_VALUES.size()), STRING_VALUES.get(i % STRING_VALUES.size()), LONG_VALUES.get(i ...
void function() { for (int i=0;i<ARRAY_LENGTH;i++) { ClassLoadingRecord record = new ClassLoadingRecord(LONG_VALUES.get(i % LONG_VALUES.size()), STRING_VALUES.get(i % STRING_VALUES.size()), STRING_VALUES.get(i % STRING_VALUES.size()), LONG_VALUES.get(i % LONG_VALUES.size()), INT_VALUES.get(i % INT_VALUES.size()), LONG_...
/** * Tests {@link ClassLoadingRecord#TestClassLoadingRecord(long, string, string, long, int, long)}. */
Tests <code>ClassLoadingRecord#TestClassLoadingRecord(long, string, string, long, int, long)</code>
testBuffer
{ "repo_name": "leadwire-apm/leadwire-javaagent", "path": "leadwire-common/test-gen/kieker/test/common/junit/record/jvm/TestGeneratedClassLoadingRecord.java", "license": "apache-2.0", "size": 10905 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
1,747,044
public void testEquals() { OHLCItem item1 = new OHLCItem(new Year(2006), 2.0, 4.0, 1.0, 3.0); OHLCItem item2 = new OHLCItem(new Year(2006), 2.0, 4.0, 1.0, 3.0); assertTrue(item1.equals(item2)); assertTrue(item2.equals(item1)); // period item1 = new OHLCItem(new Year(...
void function() { OHLCItem item1 = new OHLCItem(new Year(2006), 2.0, 4.0, 1.0, 3.0); OHLCItem item2 = new OHLCItem(new Year(2006), 2.0, 4.0, 1.0, 3.0); assertTrue(item1.equals(item2)); assertTrue(item2.equals(item1)); item1 = new OHLCItem(new Year(2007), 2.0, 4.0, 1.0, 3.0); assertFalse(item1.equals(item2)); item2 = ne...
/** * Confirm that the equals method can distinguish all the required fields. */
Confirm that the equals method can distinguish all the required fields
testEquals
{ "repo_name": "nologic/nabs", "path": "client/trunk/shared/libraries/jfreechart-1.0.5/tests/org/jfree/data/time/ohlc/junit/OHLCItemTests.java", "license": "gpl-2.0", "size": 5776 }
[ "org.jfree.data.time.Year", "org.jfree.data.time.ohlc.OHLCItem" ]
import org.jfree.data.time.Year; import org.jfree.data.time.ohlc.OHLCItem;
import org.jfree.data.time.*; import org.jfree.data.time.ohlc.*;
[ "org.jfree.data" ]
org.jfree.data;
777,649
AuthorizationPolicy policy = (AuthorizationPolicy) message.get(AuthorizationPolicy.class); String username = policy.getUserName().trim(); String password = policy.getPassword().trim(); //sanity check if ((username == null) || (password == null) || username.equals("") || ...
AuthorizationPolicy policy = (AuthorizationPolicy) message.get(AuthorizationPolicy.class); String username = policy.getUserName().trim(); String password = policy.getPassword().trim(); if ((username == null) (password == null) username.equals(STRSTRusername or password is seen as null/empty values.STRWWW-AuthenticateST...
/** * Authenticate the user against the user store. Once authenticate, populate the {@link org.wso2.carbon.context.CarbonContext} * to be used by the downstream code. * @param message * @param classResourceInfo * @return */
Authenticate the user against the user store. Once authenticate, populate the <code>org.wso2.carbon.context.CarbonContext</code> to be used by the downstream code
handleRequest
{ "repo_name": "panelion/incubator-stratos", "path": "components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/handlers/StratosAuthenticationHandler.java", "license": "apache-2.0", "size": 5978 }
[ "org.apache.cxf.configuration.security.AuthorizationPolicy" ]
import org.apache.cxf.configuration.security.AuthorizationPolicy;
import org.apache.cxf.configuration.security.*;
[ "org.apache.cxf" ]
org.apache.cxf;
75,100
public ProcessManagerSessionController createComponentSessionController( MainSessionController mainSessionCtrl, ComponentContext componentContext) { SilverTrace.info("kmelia", "ProcessManagerRequestRouter.createComponentSessionController()", "root.MSG_GEN_ENTER_METHOD"); try { return ...
ProcessManagerSessionController function( MainSessionController mainSessionCtrl, ComponentContext componentContext) { SilverTrace.info(STR, STR, STR); try { return new ProcessManagerSessionController(mainSessionCtrl, componentContext); } catch (ProcessManagerException e) { return new ProcessManagerSessionController(mai...
/** * Return a new ProcessManagerSessionController wich will be used for each request made in the * given componentContext. Returns a ill session controler when the a fatal error occures. This * ill session controller can only display an error page. */
Return a new ProcessManagerSessionController wich will be used for each request made in the given componentContext. Returns a ill session controler when the a fatal error occures. This ill session controller can only display an error page
createComponentSessionController
{ "repo_name": "stephaneperry/Silverpeas-Components", "path": "process-manager/process-manager-war/src/main/java/com/silverpeas/processManager/servlets/ProcessManagerRequestRouter.java", "license": "agpl-3.0", "size": 59867 }
[ "com.silverpeas.processManager.ProcessManagerException", "com.silverpeas.processManager.ProcessManagerSessionController", "com.stratelia.silverpeas.peasCore.ComponentContext", "com.stratelia.silverpeas.peasCore.MainSessionController", "com.stratelia.silverpeas.silvertrace.SilverTrace" ]
import com.silverpeas.processManager.ProcessManagerException; import com.silverpeas.processManager.ProcessManagerSessionController; import com.stratelia.silverpeas.peasCore.ComponentContext; import com.stratelia.silverpeas.peasCore.MainSessionController; import com.stratelia.silverpeas.silvertrace.SilverTrace;
import com.silverpeas.*; import com.stratelia.silverpeas.*; import com.stratelia.silverpeas.silvertrace.*;
[ "com.silverpeas", "com.stratelia.silverpeas" ]
com.silverpeas; com.stratelia.silverpeas;
518,538
public static void startTabSwitchLatencyTiming(final TabSelectionType type) { sTabSwitchStartTime = SystemClock.uptimeMillis(); sTabSelectionType = type; sTabSwitchLatencyMetricRequired = false; sPerceivedTabSwitchLatencyMetricLogged = false; }
static void function(final TabSelectionType type) { sTabSwitchStartTime = SystemClock.uptimeMillis(); sTabSelectionType = type; sTabSwitchLatencyMetricRequired = false; sPerceivedTabSwitchLatencyMetricLogged = false; }
/** * Register the start of tab switch latency timing. Called when setIndex() indicates a tab * switch event. * @param type The type of action that triggered the tab selection. */
Register the start of tab switch latency timing. Called when setIndex() indicates a tab switch event
startTabSwitchLatencyTiming
{ "repo_name": "s20121035/rk3288_android5.1_repo", "path": "external/chromium_org/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelBase.java", "license": "gpl-3.0", "size": 25688 }
[ "android.os.SystemClock" ]
import android.os.SystemClock;
import android.os.*;
[ "android.os" ]
android.os;
1,502,114
public void testHavingWithoutGroupBy5920() throws Exception { Statement st = createStatement(); ResultSet rs = null; rs = st.executeQuery( " select avg(c) from t5920 having 1 < 2"); expColNames = new String [] {"1"}; JDBC.assertColumnNames(rs, expColNames); ...
void function() throws Exception { Statement st = createStatement(); ResultSet rs = null; rs = st.executeQuery( STR); expColNames = new String [] {"1"}; JDBC.assertColumnNames(rs, expColNames); expRS = new String [][] { {"2"} }; JDBC.assertFullResultSet(rs, expRS, true); rs = st.executeQuery( STR); expColNames = new St...
/** * bug 5920 test that HAVING without GROUPBY makes one group. * @throws Exception */
bug 5920 test that HAVING without GROUPBY makes one group
testHavingWithoutGroupBy5920
{ "repo_name": "trejkaz/derby", "path": "java/testing/org/apache/derbyTesting/functionTests/tests/lang/GroupByTest.java", "license": "apache-2.0", "size": 108453 }
[ "java.sql.ResultSet", "java.sql.Statement", "org.apache.derbyTesting.junit.JDBC" ]
import java.sql.ResultSet; import java.sql.Statement; import org.apache.derbyTesting.junit.JDBC;
import java.sql.*; import org.apache.*;
[ "java.sql", "org.apache" ]
java.sql; org.apache;
216,341
public String getStateFor(Project project, Identity identity, ProjectBrokerModuleConfiguration moduleConfig);
String function(Project project, Identity identity, ProjectBrokerModuleConfiguration moduleConfig);
/** * Get the state [STATE_ASSIGNED_ACCOUNT_MANAGER | STATE_NOT_ASSIGNED_ACCOUNT_MANAGER | * STATE_NOT_ASSIGNED_ACCOUNT_MANAGER_NO_CANDIDATE | STATE_FINAL_ENROLLED | * STATE_PROV_ENROLLED | STATE_COMPLETE | STATE_NOT_ASSIGNED | STATE_ENROLLED ] of a project * @param project * @param identity * @param module...
Get the state [STATE_ASSIGNED_ACCOUNT_MANAGER | STATE_NOT_ASSIGNED_ACCOUNT_MANAGER | STATE_NOT_ASSIGNED_ACCOUNT_MANAGER_NO_CANDIDATE | STATE_FINAL_ENROLLED | STATE_PROV_ENROLLED | STATE_COMPLETE | STATE_NOT_ASSIGNED | STATE_ENROLLED ] of a project
getStateFor
{ "repo_name": "stevenhva/InfoLearn_OpenOLAT", "path": "src/main/java/org/olat/course/nodes/projectbroker/service/ProjectBrokerManager.java", "license": "apache-2.0", "size": 8643 }
[ "org.olat.core.id.Identity", "org.olat.course.nodes.projectbroker.datamodel.Project" ]
import org.olat.core.id.Identity; import org.olat.course.nodes.projectbroker.datamodel.Project;
import org.olat.core.id.*; import org.olat.course.nodes.projectbroker.datamodel.*;
[ "org.olat.core", "org.olat.course" ]
org.olat.core; org.olat.course;
334,712
public void insertInMobileViewUrlList(String url) { ContentValues initialValues = new ContentValues(); initialValues.put(MOBILE_VIEW_URL_URL, url); mDb.insert(MOBILE_VIEW_DATABASE_TABLE, null, initialValues); }
void function(String url) { ContentValues initialValues = new ContentValues(); initialValues.put(MOBILE_VIEW_URL_URL, url); mDb.insert(MOBILE_VIEW_DATABASE_TABLE, null, initialValues); }
/** * Insert an url in the mobile view url list. * * @param url * The new url. */
Insert an url in the mobile view url list
insertInMobileViewUrlList
{ "repo_name": "talentprince/weyoungbrowser", "path": "src/org/weyoung/model/DbAdapter.java", "license": "gpl-3.0", "size": 14086 }
[ "android.content.ContentValues" ]
import android.content.ContentValues;
import android.content.*;
[ "android.content" ]
android.content;
2,325,204
public static Bug createNewUnpublishedBug(Long id, String summary) { return ErrataFactory.createUnpublishedBug(id, summary); }
static Bug function(Long id, String summary) { return ErrataFactory.createUnpublishedBug(id, summary); }
/** * Creates a new Unpublished Bug with the id and summary given. * @param id The id for the new bug. * @param summary The summary for the new bug. * @return Returns a Bug object. */
Creates a new Unpublished Bug with the id and summary given
createNewUnpublishedBug
{ "repo_name": "colloquium/spacewalk", "path": "java/code/src/com/redhat/rhn/manager/errata/ErrataManager.java", "license": "gpl-2.0", "size": 52839 }
[ "com.redhat.rhn.domain.errata.Bug", "com.redhat.rhn.domain.errata.ErrataFactory" ]
import com.redhat.rhn.domain.errata.Bug; import com.redhat.rhn.domain.errata.ErrataFactory;
import com.redhat.rhn.domain.errata.*;
[ "com.redhat.rhn" ]
com.redhat.rhn;
2,683,794
void writeLoaderClasses(String loaderJarResourceName) throws IOException;
void writeLoaderClasses(String loaderJarResourceName) throws IOException;
/** * Write custom required spring-boot-loader classes to the JAR. * @param loaderJarResourceName the name of the resource containing the loader classes * to be written * @throws IOException if the classes cannot be written */
Write custom required spring-boot-loader classes to the JAR
writeLoaderClasses
{ "repo_name": "deki/spring-boot", "path": "spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/LoaderClassesWriter.java", "license": "apache-2.0", "size": 1691 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,916,873
@Test public void testToString() throws Exception { assertThat(administrativeGroup.toString(), is(notNullValue())); }
void function() throws Exception { assertThat(administrativeGroup.toString(), is(notNullValue())); }
/** * Tests to string method. */
Tests to string method
testToString
{ "repo_name": "sonu283304/onos", "path": "protocols/ospf/protocol/src/test/java/org/onosproject/ospf/protocol/lsa/linksubtype/AdministrativeGroupTest.java", "license": "apache-2.0", "size": 3318 }
[ "org.hamcrest.MatcherAssert", "org.hamcrest.Matchers" ]
import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers;
import org.hamcrest.*;
[ "org.hamcrest" ]
org.hamcrest;
2,196,574
public YamlConfiguration freeze() { return new YamlConfiguration(); }
YamlConfiguration function() { return new YamlConfiguration(); }
/** * Freeze this object's state into a YamlConfiguration object. If you * override this method to freeze additional object fields, your * overridden method must call super.freeze() to get the frozen base * object state and augment & return that. * * @return a YamlConfiguration representi...
Freeze this object's state into a YamlConfiguration object. If you override this method to freeze additional object fields, your overridden method must call super.freeze() to get the frozen base object state and augment & return that
freeze
{ "repo_name": "desht/sensibletoolbox", "path": "src/main/java/me/desht/sensibletoolbox/api/items/BaseSTBItem.java", "license": "gpl-3.0", "size": 18547 }
[ "org.bukkit.configuration.file.YamlConfiguration" ]
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.configuration.file.*;
[ "org.bukkit.configuration" ]
org.bukkit.configuration;
1,774,053
@Deprecated public static <T> long convertId(@NonNull final T id) { return Ids.generate(id); }
static <T> long function(@NonNull final T id) { return Ids.generate(id); }
/** * Convert an arbitrary object to a long id. The arbitrary objects are kept in an internal mapping table, so use * simple immutable objects only to prevent leaking memory. * * @deprecated Since v3.11.0, use {@link Ids#generate(Object)} from gto-support-util instead. * @param id arbitrary ob...
Convert an arbitrary object to a long id. The arbitrary objects are kept in an internal mapping table, so use simple immutable objects only to prevent leaking memory
convertId
{ "repo_name": "CruGlobal/android-gto-support", "path": "gto-support-core/src/main/java/org/ccci/gto/android/common/support/v4/util/IdUtils.java", "license": "mit", "size": 1030 }
[ "androidx.annotation.NonNull", "org.ccci.gto.android.common.util.Ids" ]
import androidx.annotation.NonNull; import org.ccci.gto.android.common.util.Ids;
import androidx.annotation.*; import org.ccci.gto.android.common.util.*;
[ "androidx.annotation", "org.ccci.gto" ]
androidx.annotation; org.ccci.gto;
473,144
private boolean swapInputs( LoptMultiJoin multiJoin, LoptJoinTree left, LoptJoinTree right, boolean selfJoin) { boolean swap = false; if (selfJoin) { return !multiJoin.isLeftFactorInRemovableSelfJoin( ((LoptJoinTree.Leaf) left.getFactorTree()).getId()); } fina...
boolean function( LoptMultiJoin multiJoin, LoptJoinTree left, LoptJoinTree right, boolean selfJoin) { boolean swap = false; if (selfJoin) { return !multiJoin.isLeftFactorInRemovableSelfJoin( ((LoptJoinTree.Leaf) left.getFactorTree()).getId()); } final RelMetadataQuery mq = RelMetadataQuery.instance(); final Double left...
/** * Swaps the operands to a join, so the smaller input is on the right. Or, * if this is a removable self-join, swap so the factor that should be * preserved when the self-join is removed is put on the left. * * @param multiJoin join factors being optimized * @param left left side of join tree * ...
Swaps the operands to a join, so the smaller input is on the right. Or, if this is a removable self-join, swap so the factor that should be preserved when the self-join is removed is put on the left
swapInputs
{ "repo_name": "wanglan/calcite", "path": "core/src/main/java/org/apache/calcite/rel/rules/LoptOptimizeJoinRule.java", "license": "apache-2.0", "size": 73624 }
[ "org.apache.calcite.plan.RelOptUtil", "org.apache.calcite.rel.metadata.RelMetadataQuery" ]
import org.apache.calcite.plan.RelOptUtil; import org.apache.calcite.rel.metadata.RelMetadataQuery;
import org.apache.calcite.plan.*; import org.apache.calcite.rel.metadata.*;
[ "org.apache.calcite" ]
org.apache.calcite;
1,700,091
public RealTimeRiskTrustAnalysisEngine configureRt2ae( EventProcessor eventProcessor, RiskPolicy riskPolicy) { // TODO Auto-generated method stub return new RealTimeRiskTrustAnalysisEngine(eventProcessor, riskPolicy); }
RealTimeRiskTrustAnalysisEngine function( EventProcessor eventProcessor, RiskPolicy riskPolicy) { return new RealTimeRiskTrustAnalysisEngine(eventProcessor, riskPolicy); }
/** * Configure rt2ae. * * @param eventProcessor * the event processor * @param riskPolicy * the risk policy * @return the real time risk trust analysis engine */
Configure rt2ae
configureRt2ae
{ "repo_name": "jmseigneur/opprim-sim", "path": "Muses Sim/src/main/java/eu/muses/sim/test/SimUser.java", "license": "agpl-3.0", "size": 12692 }
[ "eu.muses.sim.RealTimeRiskTrustAnalysisEngine", "eu.muses.sim.riskman.RiskPolicy", "eu.muses.wp5.EventProcessor" ]
import eu.muses.sim.RealTimeRiskTrustAnalysisEngine; import eu.muses.sim.riskman.RiskPolicy; import eu.muses.wp5.EventProcessor;
import eu.muses.sim.*; import eu.muses.sim.riskman.*; import eu.muses.wp5.*;
[ "eu.muses.sim", "eu.muses.wp5" ]
eu.muses.sim; eu.muses.wp5;
768,543
@Messages({"GoogleTranslatorSettingsPanel.errorMessage.noFileSelected=A JSON file must be selected to provide your credentials for Google Translate.", "GoogleTranslatorSettingsPanel.errorMessage.unknownFailurePopulating=Failure populating list of supported languages with current credentials file."}) pri...
@Messages({STR, STR}) void function() { targetLanguageComboBox.removeItemListener(listener); try { if (!StringUtils.isBlank(credentialsPathField.getText())) { List<Language> listSupportedLanguages; Translate tempService = getTemporaryTranslationService(); if (tempService != null) { listSupportedLanguages = tempService....
/** * Populate the target language selection combo box */
Populate the target language selection combo box
populateTargetLanguageComboBox
{ "repo_name": "wschaeferB/autopsy", "path": "Core/src/org/sleuthkit/autopsy/texttranslation/translators/GoogleTranslatorSettingsPanel.java", "license": "apache-2.0", "size": 23571 }
[ "com.google.cloud.translate.Language", "com.google.cloud.translate.Translate", "java.util.ArrayList", "java.util.List", "java.util.logging.Level", "org.apache.commons.lang3.StringUtils", "org.openide.util.NbBundle" ]
import com.google.cloud.translate.Language; import com.google.cloud.translate.Translate; import java.util.ArrayList; import java.util.List; import java.util.logging.Level; import org.apache.commons.lang3.StringUtils; import org.openide.util.NbBundle;
import com.google.cloud.translate.*; import java.util.*; import java.util.logging.*; import org.apache.commons.lang3.*; import org.openide.util.*;
[ "com.google.cloud", "java.util", "org.apache.commons", "org.openide.util" ]
com.google.cloud; java.util; org.apache.commons; org.openide.util;
2,357,280
protected static <T extends Enum, S> void validateEvent(Event<T, S> event, T type, S subject, long time) { assertEquals("incorrect type", type, event.type()); assertEquals("incorrect subject", subject, event.subject()); assertEquals("incorrect time", time, event.time()); }
static <T extends Enum, S> void function(Event<T, S> event, T type, S subject, long time) { assertEquals(STR, type, event.type()); assertEquals(STR, subject, event.subject()); assertEquals(STR, time, event.time()); }
/** * Validates the base attributes of an event. * * @param event event to validate * @param type event type * @param subject event subject * @param time event time * @param <T> type of event * @param <S> type of subject */
Validates the base attributes of an event
validateEvent
{ "repo_name": "donNewtonAlpha/onos", "path": "core/api/src/test/java/org/onosproject/event/AbstractEventTest.java", "license": "apache-2.0", "size": 2653 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
651,131
@Test public void getAggregateResulTestMin_0_Test() throws KettleValueException { // data.agg[0] is not null - this is the default behavior step.setAllNullsAreZero( true ); Object[] row = step.getAggregateResult( aggregate ); Assert.assertEquals( "Default value is not corrupted", def, row[0] ); }
void function() throws KettleValueException { step.setAllNullsAreZero( true ); Object[] row = step.getAggregateResult( aggregate ); Assert.assertEquals( STR, def, row[0] ); }
/** * Set this variable to Y to return 0 when all values within an aggregate are NULL. Otherwise by default a NULL is * returned when all values are NULL. * * @throws KettleValueException */
Set this variable to Y to return 0 when all values within an aggregate are NULL. Otherwise by default a NULL is returned when all values are NULL
getAggregateResulTestMin_0_Test
{ "repo_name": "tkafalas/pentaho-kettle", "path": "engine/src/test/java/org/pentaho/di/trans/steps/memgroupby/MemoryGroupByAggregationNullsTest.java", "license": "apache-2.0", "size": 7582 }
[ "org.junit.Assert", "org.pentaho.di.core.exception.KettleValueException" ]
import org.junit.Assert; import org.pentaho.di.core.exception.KettleValueException;
import org.junit.*; import org.pentaho.di.core.exception.*;
[ "org.junit", "org.pentaho.di" ]
org.junit; org.pentaho.di;
2,498,662
@Nonnull public StageBuilder createStage(@Nonnull Class<?> controllerType) throws IllegalArgumentException, IllegalStateException { return new StageBuilder(this.createScene(controllerType)); }
StageBuilder function(@Nonnull Class<?> controllerType) throws IllegalArgumentException, IllegalStateException { return new StageBuilder(this.createScene(controllerType)); }
/** * Creates a new stage builder using the supplied JavaFX controller. * * @throws IllegalArgumentException when the supplied resource name does not actually exist * within the loader or the passed controller type is not * annot...
Creates a new stage builder using the supplied JavaFX controller
createStage
{ "repo_name": "dotStart/Pandemonium", "path": "fx/src/main/java/tv/dotstart/pandemonium/fx/FX.java", "license": "apache-2.0", "size": 18541 }
[ "javax.annotation.Nonnull" ]
import javax.annotation.Nonnull;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
176,049
@JsonProperty("listaMensagem") public List<Mensagem> getListaMensagem() { return listaMensagem; }
@JsonProperty(STR) List<Mensagem> function() { return listaMensagem; }
/** * Mensagens de alerta ou erro da consulta * @return listaMensagem **/
Mensagens de alerta ou erro da consulta
getListaMensagem
{ "repo_name": "samuelfac/portalunico.siscomex.gov.br", "path": "src/main/java/br/gov/siscomex/portalunico/cct_ext/model/ConsultaConteiner.java", "license": "mit", "size": 3040 }
[ "com.fasterxml.jackson.annotation.JsonProperty", "java.util.List" ]
import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List;
import com.fasterxml.jackson.annotation.*; import java.util.*;
[ "com.fasterxml.jackson", "java.util" ]
com.fasterxml.jackson; java.util;
2,846,669
@Override public void onMapReady(GoogleMap googleMap) { if (mMap != null) { //second call of onMapReady //it is called in onCreate and onResume, check if one call is enough 2018-02-11 //mMap is already set //maybe good time to reload markers? i...
void function(GoogleMap googleMap) { if (mMap != null) { if (ognService != null) { } return; } mMap = googleMap; mMap.getUiSettings().setRotateGesturesEnabled(false); mMap.setOnCameraIdleListener(this); mMap.setOnCameraMoveStartedListener(this); mMap.setOnMapLoadedCallback(this); setUpMap(); SharedPreferences sharedPre...
/** * Is called when orientation changed, not called when app was in background * @param googleMap GoogleMapsObject */
Is called when orientation changed, not called when app was in background
onMapReady
{ "repo_name": "Meisterschueler/ogn-viewer-android", "path": "app/src/main/java/com/meisterschueler/ognviewer/activity/MapsActivity.java", "license": "mit", "size": 65639 }
[ "android.content.SharedPreferences", "androidx.preference.PreferenceManager", "com.google.android.gms.maps.CameraUpdateFactory", "com.google.android.gms.maps.GoogleMap", "com.google.android.gms.maps.model.CameraPosition", "com.google.android.gms.maps.model.LatLng" ]
import android.content.SharedPreferences; import androidx.preference.PreferenceManager; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.model.CameraPosition; import com.google.android.gms.maps.model.LatLng;
import android.content.*; import androidx.preference.*; import com.google.android.gms.maps.*; import com.google.android.gms.maps.model.*;
[ "android.content", "androidx.preference", "com.google.android" ]
android.content; androidx.preference; com.google.android;
1,444,653
return findByUuid(uuid, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); }
return findByUuid(uuid, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); }
/** * Returns all the quxs where uuid = &#63;. * * @param uuid the uuid * @return the matching quxs */
Returns all the quxs where uuid = &#63;
findByUuid
{ "repo_name": "gamerson/liferay-blade-samples", "path": "maven/apps/workflow/asset/asset-service/src/main/java/com/liferay/blade/workflow/asset/service/persistence/impl/QuxPersistenceImpl.java", "license": "apache-2.0", "size": 63872 }
[ "com.liferay.portal.kernel.dao.orm.QueryUtil" ]
import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.dao.orm.*;
[ "com.liferay.portal" ]
com.liferay.portal;
300,937
public static IPersonAttributeDao newStubAttributeRepository(final PrincipalAttributesProperties p) { try { final NamedStubPersonAttributeDao dao = new NamedStubPersonAttributeDao(); final Map pdirMap = new HashMap<>(); p.getAttributes().entrySet().forEach(entry -> { ...
static IPersonAttributeDao function(final PrincipalAttributesProperties p) { try { final NamedStubPersonAttributeDao dao = new NamedStubPersonAttributeDao(); final Map pdirMap = new HashMap<>(); p.getAttributes().entrySet().forEach(entry -> { pdirMap.put(entry.getKey(), Lists.newArrayList(entry.getValue())); }); dao.se...
/** * New attribute repository person attribute dao. * * @param p the properties * @return the person attribute dao */
New attribute repository person attribute dao
newStubAttributeRepository
{ "repo_name": "zhoffice/cas", "path": "cas-server-core-configuration/src/main/java/org/apereo/cas/configuration/support/Beans.java", "license": "apache-2.0", "size": 18401 }
[ "com.google.common.base.Throwables", "com.google.common.collect.Lists", "java.util.HashMap", "java.util.Map", "org.apereo.cas.configuration.model.core.authentication.PrincipalAttributesProperties", "org.apereo.services.persondir.IPersonAttributeDao", "org.apereo.services.persondir.support.NamedStubPerso...
import com.google.common.base.Throwables; import com.google.common.collect.Lists; import java.util.HashMap; import java.util.Map; import org.apereo.cas.configuration.model.core.authentication.PrincipalAttributesProperties; import org.apereo.services.persondir.IPersonAttributeDao; import org.apereo.services.persondir.su...
import com.google.common.base.*; import com.google.common.collect.*; import java.util.*; import org.apereo.cas.configuration.model.core.authentication.*; import org.apereo.services.persondir.*; import org.apereo.services.persondir.support.*;
[ "com.google.common", "java.util", "org.apereo.cas", "org.apereo.services" ]
com.google.common; java.util; org.apereo.cas; org.apereo.services;
2,318,948
public void setVideoPath(String path) { setVideoURI(Uri.parse(path)); }
void function(String path) { setVideoURI(Uri.parse(path)); }
/** * Sets video path. * * @param path the path of the video. */
Sets video path
setVideoPath
{ "repo_name": "SethWen/GestureVideoView", "path": "app/src/main/java/com/shawn/videoview/media/GestureVideoView.java", "license": "mit", "size": 44101 }
[ "android.net.Uri" ]
import android.net.Uri;
import android.net.*;
[ "android.net" ]
android.net;
2,315,344
public static Object readObject(String processorType, String processorTag, Map<String, Object> configuration, String propertyName) { Object value = configuration.remove(propertyName); if (value == null) { throw newConfigurationException(processorType, ...
static Object function(String processorType, String processorTag, Map<String, Object> configuration, String propertyName) { Object value = configuration.remove(propertyName); if (value == null) { throw newConfigurationException(processorType, processorTag, propertyName, STR); } return value; }
/** * Returns and removes the specified property as an {@link Object} from the specified configuration map. */
Returns and removes the specified property as an <code>Object</code> from the specified configuration map
readObject
{ "repo_name": "sreeramjayan/elasticsearch", "path": "core/src/main/java/org/elasticsearch/ingest/ConfigurationUtils.java", "license": "apache-2.0", "size": 13104 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,469,193
public void updateAccumulators(AccumulatorSnapshot accumulatorSnapshot) { Map<String, Accumulator<?, ?>> userAccumulators; try { userAccumulators = accumulatorSnapshot.deserializeUserAccumulators(userClassLoader); ExecutionAttemptID execID = accumulatorSnapshot.getExecutionAttemptID(); Execution execut...
void function(AccumulatorSnapshot accumulatorSnapshot) { Map<String, Accumulator<?, ?>> userAccumulators; try { userAccumulators = accumulatorSnapshot.deserializeUserAccumulators(userClassLoader); ExecutionAttemptID execID = accumulatorSnapshot.getExecutionAttemptID(); Execution execution = currentExecutions.get(execID...
/** * Updates the accumulators during the runtime of a job. Final accumulator results are transferred * through the UpdateTaskExecutionState message. * @param accumulatorSnapshot The serialized flink and user-defined accumulators */
Updates the accumulators during the runtime of a job. Final accumulator results are transferred through the UpdateTaskExecutionState message
updateAccumulators
{ "repo_name": "ueshin/apache-flink", "path": "flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java", "license": "apache-2.0", "size": 67080 }
[ "java.util.Map", "org.apache.flink.api.common.accumulators.Accumulator", "org.apache.flink.runtime.accumulators.AccumulatorSnapshot" ]
import java.util.Map; import org.apache.flink.api.common.accumulators.Accumulator; import org.apache.flink.runtime.accumulators.AccumulatorSnapshot;
import java.util.*; import org.apache.flink.api.common.accumulators.*; import org.apache.flink.runtime.accumulators.*;
[ "java.util", "org.apache.flink" ]
java.util; org.apache.flink;
1,790,432
@Test public void testGetDocumentProperty() { System.out.println("GetDocumentProperty"); String name = "test_multi_pages.docx"; String propertyName = "Author"; String storage = ""; String folder = ""; try { DocumentPropertyResponse result = wordsApi.GetDocumentProperty(name, propertyName, storage, fo...
void function() { System.out.println(STR); String name = STR; String propertyName = STR; String storage = STRSTRexp:" + apiException.getMessage()); assertNull(apiException); } }
/** * Test of GetDocumentProperty method, of class WordsApi. */
Test of GetDocumentProperty method, of class WordsApi
testGetDocumentProperty
{ "repo_name": "farooqsheikhpk/Aspose_Words_Cloud", "path": "SDKs/Aspose.Words-Cloud-SDK-for-Android/aspose-cloud-words-android/src/test/java/com/aspose/words/WordsApiTest.java", "license": "mit", "size": 42545 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
415,828
public static List<SessionOutput> getTerminalLogsForSession(Long sessionId, Integer instanceId) { //get db connection Connection con = DBUtils.getConn(); List<SessionOutput> outputList = null; try { outputList = getTerminalLogsForSession(con, sessionId, instanceId); ...
static List<SessionOutput> function(Long sessionId, Integer instanceId) { Connection con = DBUtils.getConn(); List<SessionOutput> outputList = null; try { outputList = getTerminalLogsForSession(con, sessionId, instanceId); } catch (Exception e) { e.printStackTrace(); } DBUtils.closeConn(con); return outputList; }
/** * returns terminal logs for user session for host system * * @param sessionId session id * @param instanceId instance id for terminal session * @return session output for session */
returns terminal logs for user session for host system
getTerminalLogsForSession
{ "repo_name": "enascimento/KeyBox", "path": "src/main/java/com/keybox/manage/db/SessionAuditDB.java", "license": "apache-2.0", "size": 12572 }
[ "com.keybox.manage.model.SessionOutput", "com.keybox.manage.util.DBUtils", "java.sql.Connection", "java.util.List" ]
import com.keybox.manage.model.SessionOutput; import com.keybox.manage.util.DBUtils; import java.sql.Connection; import java.util.List;
import com.keybox.manage.model.*; import com.keybox.manage.util.*; import java.sql.*; import java.util.*;
[ "com.keybox.manage", "java.sql", "java.util" ]
com.keybox.manage; java.sql; java.util;
1,761,555
protected void buildTree(XMLStreamReader r, Document doc) throws XMLStreamException { checkReaderSettings(r); Node current = doc; // At top level main_loop: while (true) { int evtType = r.next(); Node child; switch (evtType) { c...
void function(XMLStreamReader r, Document doc) throws XMLStreamException { checkReaderSettings(r); Node current = doc; main_loop: while (true) { int evtType = r.next(); Node child; switch (evtType) { case XMLStreamConstants.CDATA: child = doc.createCDATASection(r.getText()); break; case XMLStreamConstants.SPACE: if (mC...
/** * This method takes a <code>XMLStreamReader</code> and builds up a JDOM tree. Recursion has been eliminated by using nodes' parent/child relationship; this improves performance somewhat (classic recursion-by-iteration-and-explicit stack transformation) * * @param r * Stream reader to...
This method takes a <code>XMLStreamReader</code> and builds up a JDOM tree. Recursion has been eliminated by using nodes' parent/child relationship; this improves performance somewhat (classic recursion-by-iteration-and-explicit stack transformation)
buildTree
{ "repo_name": "Red5/red5-io", "path": "src/main/java/org/red5/io/utils/Stax2DomBuilder.java", "license": "apache-2.0", "size": 11339 }
[ "javax.xml.stream.XMLStreamConstants", "javax.xml.stream.XMLStreamException", "javax.xml.stream.XMLStreamReader", "org.w3c.dom.Attr", "org.w3c.dom.Document", "org.w3c.dom.Element", "org.w3c.dom.Node" ]
import javax.xml.stream.XMLStreamConstants; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node;
import javax.xml.stream.*; import org.w3c.dom.*;
[ "javax.xml", "org.w3c.dom" ]
javax.xml; org.w3c.dom;
864,739
private JButton createTitleButton() { JButton button = new JButton(); button.setFocusPainted(false); button.setFocusable(false); button.setOpaque(true); return button; }
JButton function() { JButton button = new JButton(); button.setFocusPainted(false); button.setFocusable(false); button.setOpaque(true); return button; }
/** * Returns a <code>JButton</code> appropriate for placement on the * TitlePane. */
Returns a <code>JButton</code> appropriate for placement on the TitlePane
createTitleButton
{ "repo_name": "toxeh/ExecuteQuery", "path": "java/src/org/underworldlabs/swing/plaf/bumpygradient/BumpyGradientTitlePane.java", "license": "gpl-3.0", "size": 33951 }
[ "javax.swing.JButton" ]
import javax.swing.JButton;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
2,299,254
final EngineCallback callback = Engine.getEngineCallback();
final EngineCallback callback = Engine.getEngineCallback();
/** * This command only run on desktop . Add this , you can export the project * into a jar to run it */
This command only run on desktop . Add this , you can export the project into a jar to run it
process
{ "repo_name": "shiguang1120/c2d-engine", "path": "c2d/src/info/u250/c2d/engine/cmd/JarExportableCmd.java", "license": "apache-2.0", "size": 2564 }
[ "info.u250.c2d.engine.Engine", "info.u250.c2d.engine.EngineCallback" ]
import info.u250.c2d.engine.Engine; import info.u250.c2d.engine.EngineCallback;
import info.u250.c2d.engine.*;
[ "info.u250.c2d" ]
info.u250.c2d;
979,973
private static String stringLiteral(byte arr[]) { CharBuffer cb = Charset.forName("ISO-8859-1").decode(ByteBuffer.wrap(arr)); StringBuilder sb = new StringBuilder(); sb.append('\''); for (int i = 0; i < cb.length(); i++) { char c = cb.get(i); switch (c) { case '\'': sb.ap...
static String function(byte arr[]) { CharBuffer cb = Charset.forName(STR).decode(ByteBuffer.wrap(arr)); StringBuilder sb = new StringBuilder(); sb.append('\''); for (int i = 0; i < cb.length(); i++) { char c = cb.get(i); switch (c) { case '\'': sb.append("\\'"); break; case '\\': sb.append("\\\\"); break; case '\0': sb...
/** * Convert a byte array into a valid mysql string literal, assuming that * it will be inserted into a column with latin-1 encoding. * Based on information at * http://dev.mysql.com/doc/refman/5.1/en/string-literals.html * @param arr * @return */
Convert a byte array into a valid mysql string literal, assuming that it will be inserted into a column with latin-1 encoding. Based on information at HREF
stringLiteral
{ "repo_name": "blendlabs/linkbench", "path": "src/main/java/com/facebook/LinkBench/LinkStoreMysql.java", "license": "apache-2.0", "size": 33592 }
[ "java.nio.ByteBuffer", "java.nio.CharBuffer", "java.nio.charset.Charset" ]
import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset;
import java.nio.*; import java.nio.charset.*;
[ "java.nio" ]
java.nio;
129,974
public Collection<Token<? extends TokenIdentifier>> getAllTokens() { return tokenMap.values(); }
Collection<Token<? extends TokenIdentifier>> function() { return tokenMap.values(); }
/** * Return all the tokens in the in-memory map */
Return all the tokens in the in-memory map
getAllTokens
{ "repo_name": "vierja/hadoop-per-mare", "path": "src/core/org/apache/hadoop/security/Credentials.java", "license": "apache-2.0", "size": 7301 }
[ "java.util.Collection", "org.apache.hadoop.security.token.Token", "org.apache.hadoop.security.token.TokenIdentifier" ]
import java.util.Collection; import org.apache.hadoop.security.token.Token; import org.apache.hadoop.security.token.TokenIdentifier;
import java.util.*; import org.apache.hadoop.security.token.*;
[ "java.util", "org.apache.hadoop" ]
java.util; org.apache.hadoop;
2,113,721
public static AudioInputStream GetCarCrashSound() { return GetStream(SharedResources.SND_CarCrash_FilenameWithPath); }
static AudioInputStream function() { return GetStream(SharedResources.SND_CarCrash_FilenameWithPath); }
/** * Loads in the sound effect played when two cars crash into each other. * @return AudioInputStream of the car crash sound file. */
Loads in the sound effect played when two cars crash into each other
GetCarCrashSound
{ "repo_name": "MaximilianMihaldinecz/dscars-game-local", "path": "src/ModelLayer/FileLoaders/AudioFileLoader.java", "license": "mit", "size": 2359 }
[ "javax.sound.sampled.AudioInputStream" ]
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.*;
[ "javax.sound" ]
javax.sound;
2,195,858
public BigDecimal chargesBilledSeparately() { return this.innerProperties() == null ? null : this.innerProperties().chargesBilledSeparately(); }
BigDecimal function() { return this.innerProperties() == null ? null : this.innerProperties().chargesBilledSeparately(); }
/** * Get the chargesBilledSeparately property: Charges Billed Separately. * * @return the chargesBilledSeparately value. */
Get the chargesBilledSeparately property: Charges Billed Separately
chargesBilledSeparately
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ManagementGroupAggregatedCostResultInner.java", "license": "mit", "size": 7315 }
[ "java.math.BigDecimal" ]
import java.math.BigDecimal;
import java.math.*;
[ "java.math" ]
java.math;
1,736,032
public void testBiggest() throws IOException { try (BucketedSort sort = new BucketedSort.ForFloats(bigArrays(), SortOrder.DESC, DocValueFormat.RAW, BucketedSort.ForFloats.MAX_BUCKET_SIZE, BucketedSort.NOOP_EXTRA_DATA) { @Override public boolean needsScores() { return ...
void function() throws IOException { try (BucketedSort sort = new BucketedSort.ForFloats(bigArrays(), SortOrder.DESC, DocValueFormat.RAW, BucketedSort.ForFloats.MAX_BUCKET_SIZE, BucketedSort.NOOP_EXTRA_DATA) { public boolean needsScores() { return false; }
/** * Check that we can store the largest bucket theoretically possible. */
Check that we can store the largest bucket theoretically possible
testBiggest
{ "repo_name": "robin13/elasticsearch", "path": "server/src/test/java/org/elasticsearch/search/sort/BucketedSortForFloatsTests.java", "license": "apache-2.0", "size": 6252 }
[ "java.io.IOException", "org.elasticsearch.search.DocValueFormat" ]
import java.io.IOException; import org.elasticsearch.search.DocValueFormat;
import java.io.*; import org.elasticsearch.search.*;
[ "java.io", "org.elasticsearch.search" ]
java.io; org.elasticsearch.search;
87,144
@Override public void visitErrorNode(ErrorNode node) { }
@Override public void visitErrorNode(ErrorNode node) { }
/** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */
The default implementation does nothing
visitTerminal
{ "repo_name": "AbnerZheng/cs652", "path": "parrt-vtable-grammar/target/generated-sources/antlr4/cs652/j/parser/JBaseListener.java", "license": "bsd-3-clause", "size": 7556 }
[ "org.antlr.v4.runtime.tree.ErrorNode" ]
import org.antlr.v4.runtime.tree.ErrorNode;
import org.antlr.v4.runtime.tree.*;
[ "org.antlr.v4" ]
org.antlr.v4;
2,497,772
static <A, B, R, X extends Exception> BiFunction<A, B, R> throwingRuntime(ThrowingBiFunction<A, B, R, X> f) { return (a, b) -> { try { return f.apply(a, b); } catch (Exception ex) { throw new RuntimeException(ex); ...
static <A, B, R, X extends Exception> BiFunction<A, B, R> throwingRuntime(ThrowingBiFunction<A, B, R, X> f) { return (a, b) -> { try { return f.apply(a, b); } catch (Exception ex) { throw new RuntimeException(ex); } }; } }
/** * Converts the provided bifunction into a regular BiFunction, where any thrown exceptions * are wrapped in a RuntimeException */
Converts the provided bifunction into a regular BiFunction, where any thrown exceptions are wrapped in a RuntimeException
throwingRuntime
{ "repo_name": "unruly/control", "path": "src/main/java/co/unruly/control/ThrowingLambdas.java", "license": "mit", "size": 4139 }
[ "java.util.function.BiFunction" ]
import java.util.function.BiFunction;
import java.util.function.*;
[ "java.util" ]
java.util;
279,242
public StatelessKieSession getStateless() { if (this.isStateful()) { throw new IllegalStateException("This session is not stateless"); } return (StatelessKieSession) session; }
StatelessKieSession function() { if (this.isStateful()) { throw new IllegalStateException(STR); } return (StatelessKieSession) session; }
/** * Casts this session to StatelessKieSession * * @throws IllegalArgumentException * - when this session is not stateless * @return StatelessKieSession from within this session */
Casts this session to StatelessKieSession
getStateless
{ "repo_name": "droolsjbpm/drools", "path": "drools-test-coverage/test-suite/src/test/java/org/drools/testcoverage/common/util/Session.java", "license": "apache-2.0", "size": 5772 }
[ "org.kie.api.runtime.StatelessKieSession" ]
import org.kie.api.runtime.StatelessKieSession;
import org.kie.api.runtime.*;
[ "org.kie.api" ]
org.kie.api;
1,570,902
private void initRegistry() { componentTreeViewer = this.gui.getComponentSelector(); try { this.componentRegistry = new SystemComponentRegistry(); // This does not take time, so we can do it in the same thread. this.systemComponentTree = ComponentController.getCo...
void function() { componentTreeViewer = this.gui.getComponentSelector(); try { this.componentRegistry = new SystemComponentRegistry(); this.systemComponentTree = ComponentController.getComponentTree(this.componentRegistry); componentTreeViewer.addComponentTree(0, this.systemComponentTree); componentTreeViewer.addCompon...
/** * Initializes registris. */
Initializes registris
initRegistry
{ "repo_name": "gouravshenoy/airavata", "path": "modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java", "license": "apache-2.0", "size": 6170 }
[ "java.util.List", "org.apache.airavata.workflow.model.component.ComponentRegistryException", "org.apache.airavata.workflow.model.component.amazon.AmazonComponentRegistry", "org.apache.airavata.workflow.model.component.local.LocalComponentRegistry", "org.apache.airavata.workflow.model.component.system.System...
import java.util.List; import org.apache.airavata.workflow.model.component.ComponentRegistryException; import org.apache.airavata.workflow.model.component.amazon.AmazonComponentRegistry; import org.apache.airavata.workflow.model.component.local.LocalComponentRegistry; import org.apache.airavata.workflow.model.component...
import java.util.*; import org.apache.airavata.workflow.model.component.*; import org.apache.airavata.workflow.model.component.amazon.*; import org.apache.airavata.workflow.model.component.local.*; import org.apache.airavata.workflow.model.component.system.*; import org.apache.airavata.xbaya.component.registry.*; impor...
[ "java.util", "org.apache.airavata" ]
java.util; org.apache.airavata;
786,908
public boolean isChannelRed(int index) { return model.isColorComponent(Renderer.RED_BAND, index); }
boolean function(int index) { return model.isColorComponent(Renderer.RED_BAND, index); }
/** * Implemented as specified by the {@link ImViewer} interface. * @see ImViewer#isChannelRed(int) */
Implemented as specified by the <code>ImViewer</code> interface
isChannelRed
{ "repo_name": "tp81/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerComponent.java", "license": "gpl-2.0", "size": 96726 }
[ "org.openmicroscopy.shoola.agents.metadata.rnd.Renderer" ]
import org.openmicroscopy.shoola.agents.metadata.rnd.Renderer;
import org.openmicroscopy.shoola.agents.metadata.rnd.*;
[ "org.openmicroscopy.shoola" ]
org.openmicroscopy.shoola;
2,103,328
protected void addRotationYPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Pipe_rotationY_feature"), getString("_UI_PropertyDescriptor...
void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), GeometryPackage.Literals.PIPE__ROTATION_Y, true, false, false, ItemPropertyDescriptor.REAL_VALUE_...
/** * This adds a property descriptor for the Rotation Y feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This adds a property descriptor for the Rotation Y feature.
addRotationYPropertyDescriptor
{ "repo_name": "jarrah42/eavp", "path": "org.eclipse.january.geometry.model.edit/src/org/eclipse/january/geometry/provider/PipeItemProvider.java", "license": "epl-1.0", "size": 7740 }
[ "org.eclipse.emf.edit.provider.ComposeableAdapterFactory", "org.eclipse.emf.edit.provider.ItemPropertyDescriptor", "org.eclipse.january.geometry.GeometryPackage" ]
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.eclipse.january.geometry.GeometryPackage;
import org.eclipse.emf.edit.provider.*; import org.eclipse.january.geometry.*;
[ "org.eclipse.emf", "org.eclipse.january" ]
org.eclipse.emf; org.eclipse.january;
154,856
public void bind(String name, Object obj) throws NamingException { bind(nameParser.parse(name), obj); } public void close() throws NamingException {}
void function(String name, Object obj) throws NamingException { bind(nameParser.parse(name), obj); } public void close() throws NamingException {}
/** * Binds object to name in this context. * * @param name * name of the object to add * @param obj object to bind * @throws NamingException if naming error occurs * */
Binds object to name in this context
bind
{ "repo_name": "pivotal-amurmann/geode", "path": "geode-core/src/main/java/org/apache/geode/internal/jndi/ContextImpl.java", "license": "apache-2.0", "size": 29126 }
[ "javax.naming.NamingException" ]
import javax.naming.NamingException;
import javax.naming.*;
[ "javax.naming" ]
javax.naming;
2,422,621
public List<JCAnnotation> transformAnnotations(OutputElement target, Tree.Declaration annotated) { EnumSet<OutputElement> outputs; if (annotated instanceof Tree.AnyClass) { outputs = AnnotationUtil.outputs((Tree.AnyClass)annotated); } else if (annotated instanceof Tr...
List<JCAnnotation> function(OutputElement target, Tree.Declaration annotated) { EnumSet<OutputElement> outputs; if (annotated instanceof Tree.AnyClass) { outputs = AnnotationUtil.outputs((Tree.AnyClass)annotated); } else if (annotated instanceof Tree.AnyInterface) { outputs = AnnotationUtil.outputs((Tree.AnyInterface)a...
/** * Transform the annotations on the given annotated declaration for * inclusion on the given target element type */
Transform the annotations on the given annotated declaration for inclusion on the given target element type
transformAnnotations
{ "repo_name": "gijsleussink/ceylon", "path": "compiler-java/src/com/redhat/ceylon/compiler/java/codegen/ExpressionTransformer.java", "license": "apache-2.0", "size": 383425 }
[ "com.redhat.ceylon.compiler.typechecker.tree.Tree", "com.redhat.ceylon.langtools.tools.javac.tree.JCTree", "com.redhat.ceylon.langtools.tools.javac.util.List", "com.redhat.ceylon.model.loader.model.OutputElement", "com.redhat.ceylon.model.typechecker.model.Constructor", "com.redhat.ceylon.model.typechecke...
import com.redhat.ceylon.compiler.typechecker.tree.Tree; import com.redhat.ceylon.langtools.tools.javac.tree.JCTree; import com.redhat.ceylon.langtools.tools.javac.util.List; import com.redhat.ceylon.model.loader.model.OutputElement; import com.redhat.ceylon.model.typechecker.model.Constructor; import com.redhat.ceylon...
import com.redhat.ceylon.compiler.typechecker.tree.*; import com.redhat.ceylon.langtools.tools.javac.tree.*; import com.redhat.ceylon.langtools.tools.javac.util.*; import com.redhat.ceylon.model.loader.model.*; import com.redhat.ceylon.model.typechecker.model.*; import java.util.*;
[ "com.redhat.ceylon", "java.util" ]
com.redhat.ceylon; java.util;
1,992,978
interface WithSku { WithCreate withSku(Sku sku); } interface WithCreate extends Creatable<Application>, Resource.DefinitionWithTags<WithCreate>, DefinitionStages.WithApplicationDefinitionId, DefinitionStages.WithIdentity, DefinitionStages.WithJitAccessPolicy, D...
interface WithSku { WithCreate withSku(Sku sku); } interface WithCreate extends Creatable<Application>, Resource.DefinitionWithTags<WithCreate>, DefinitionStages.WithApplicationDefinitionId, DefinitionStages.WithIdentity, DefinitionStages.WithJitAccessPolicy, DefinitionStages.WithManagedBy, DefinitionStages.WithManaged...
/** * Specifies sku. * @param sku The SKU of the resource * @return the next definition stage */
Specifies sku
withSku
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/managedapplications/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/managedapplications/v2019_07_01/Application.java", "license": "mit", "size": 12164 }
[ "com.microsoft.azure.arm.model.Appliable", "com.microsoft.azure.arm.model.Creatable", "com.microsoft.azure.arm.resources.models.Resource" ]
import com.microsoft.azure.arm.model.Appliable; import com.microsoft.azure.arm.model.Creatable; import com.microsoft.azure.arm.resources.models.Resource;
import com.microsoft.azure.arm.model.*; import com.microsoft.azure.arm.resources.models.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
1,419,127
@Override protected void baitInitParams() { Utils.begin_track("baitInitParams: using harmonic initializer"); DMVParams counts = newParams(); params = newParams(); params.setUniform(1); Collection<BatchBaitInit> list = new ArrayList(examples.size()); fo...
void function() { Utils.begin_track(STR); DMVParams counts = newParams(); params = newParams(); params.setUniform(1); Collection<BatchBaitInit> list = new ArrayList(examples.size()); for(int i = 0; i < examples.size(); i++) { list.add(new BatchBaitInit(i, examples.get(i), counts)); } Utils.parallelForeach(opts.numThrea...
/** * Initialise with an E-step which puts a uniform distribution over z * This works for models with natural asymmetries such as word alignment and DMV, * but not for cluster-based models such as GMMs, PMMMs, HMMs, * where random initialisation is preferred (need noise) */
Initialise with an E-step which puts a uniform distribution over z This works for models with natural asymmetries such as word alignment and DMV, but not for cluster-based models such as GMMs, PMMMs, HMMs, where random initialisation is preferred (need noise)
baitInitParams
{ "repo_name": "sinantie/Generator", "path": "src/induction/problem/dmv/generative/GenerativeDMVModel.java", "license": "gpl-3.0", "size": 26751 }
[ "java.util.ArrayList", "java.util.Collection" ]
import java.util.ArrayList; import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
403,080
public static StringBuilder readUTF(File file, long offset) throws FileNotFoundException, IOException { StringBuilder result = new StringBuilder(); FileInputStream fis = null; BufferedInputStream bis = null; InputStreamReader isr = null; try { fis = new FileInputStream(file); skipFully(fis, offset); ...
static StringBuilder function(File file, long offset) throws FileNotFoundException, IOException { StringBuilder result = new StringBuilder(); FileInputStream fis = null; BufferedInputStream bis = null; InputStreamReader isr = null; try { fis = new FileInputStream(file); skipFully(fis, offset); bis = new BufferedInputSt...
/** * Reads the content of a file as UTF-8, starting at a specified offset, and returns it. * @param file The file to read * @param offset The point in <code>file</code> at which to start reading * @return The content of <code>file</code>, starting at <code>offset</code> * @throws FileNotFoundE...
Reads the content of a file as UTF-8, starting at a specified offset, and returns it
readUTF
{ "repo_name": "xor-freenet/fred-staging", "path": "src/freenet/support/io/FileUtil.java", "license": "gpl-2.0", "size": 29418 }
[ "java.io.BufferedInputStream", "java.io.File", "java.io.FileInputStream", "java.io.FileNotFoundException", "java.io.IOException", "java.io.InputStreamReader" ]
import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStreamReader;
import java.io.*;
[ "java.io" ]
java.io;
139,959
private Element updateXmlByXpath(Element xmlElement, String xPathExpression, String value, Document referanceDoc) throws XPathExpressionException { if (xPathExpression.length() > 0) { //Evaluate XPath XPath xPath = XPathFactory.newInst...
Element function(Element xmlElement, String xPathExpression, String value, Document referanceDoc) throws XPathExpressionException { if (xPathExpression.length() > 0) { XPath xPath = XPathFactory.newInstance().newXPath(); NamespaceResolver nsResolver = new NamespaceResolver(referanceDoc); xPath.setNamespaceContext(nsRes...
/** * Function to update xml DOM element according to the xpath expression with given string value * * @param xmlElement DOM element representing the xml * @param xPathExpression xpath expression * @param value string that need to replace in the xml * @param referanceDoc reference Document...
Function to update xml DOM element according to the xpath expression with given string value
updateXmlByXpath
{ "repo_name": "isurusuranga/carbon-business-process", "path": "components/humantask/org.wso2.carbon.humantask/src/main/java/org/wso2/carbon/humantask/core/api/rendering/HTRenderingApiImpl.java", "license": "apache-2.0", "size": 31449 }
[ "javax.xml.xpath.XPath", "javax.xml.xpath.XPathConstants", "javax.xml.xpath.XPathExpressionException", "javax.xml.xpath.XPathFactory", "org.w3c.dom.Document", "org.w3c.dom.Element", "org.w3c.dom.Node" ]
import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node;
import javax.xml.xpath.*; import org.w3c.dom.*;
[ "javax.xml", "org.w3c.dom" ]
javax.xml; org.w3c.dom;
1,722,703
Collection<? extends Component> getComponents();
Collection<? extends Component> getComponents();
/** * Returns an unmodifiable collection of all components added to this target * * @return unmodifiable collection of all components added to this target */
Returns an unmodifiable collection of all components added to this target
getComponents
{ "repo_name": "mafulafunk/wicket", "path": "wicket-core/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java", "license": "apache-2.0", "size": 9016 }
[ "java.util.Collection", "org.apache.wicket.Component" ]
import java.util.Collection; import org.apache.wicket.Component;
import java.util.*; import org.apache.wicket.*;
[ "java.util", "org.apache.wicket" ]
java.util; org.apache.wicket;
215,633
private void saveLanguage(Object node, Language language) { Object taggedValue = Model.getFacade().getTaggedValue(node, SOURCE_LANGUAGE_TAG); if (taggedValue != null) { String savedLang = Model.getFacade().getValueOfTag(taggedValue); if (!language.getName...
void function(Object node, Language language) { Object taggedValue = Model.getFacade().getTaggedValue(node, SOURCE_LANGUAGE_TAG); if (taggedValue != null) { String savedLang = Model.getFacade().getValueOfTag(taggedValue); if (!language.getName().equals(savedLang)) { Model.getExtensionMechanismsHelper().setValueOfTag( t...
/** * Save the source language in the model. * * TODO: Support multiple languages now that we have UML 1.4 * tagged values. * @param node * @param language */
Save the source language in the model. tagged values
saveLanguage
{ "repo_name": "kopl/misc", "path": "JaMoPP Performance Test/testcode/argouml-usecase-variant/src/org/argouml/uml/generator/ui/ClassGenerationDialog.java", "license": "epl-1.0", "size": 26220 }
[ "org.argouml.model.Model", "org.argouml.uml.generator.Language" ]
import org.argouml.model.Model; import org.argouml.uml.generator.Language;
import org.argouml.model.*; import org.argouml.uml.generator.*;
[ "org.argouml.model", "org.argouml.uml" ]
org.argouml.model; org.argouml.uml;
2,308,340
public static void writeBytes(ByteBuffer bytes, String file, int position) { FileChannel channel = getFileChannel(file); try { channel.position(position); channel.write(bytes); channel.force(true); } catch (IOException e) { throw Throwa...
static void function(ByteBuffer bytes, String file, int position) { FileChannel channel = getFileChannel(file); try { channel.position(position); channel.write(bytes); channel.force(true); } catch (IOException e) { throw Throwables.propagate(e); } finally { closeFileChannel(channel); } } private FileSystem() {}
/** * Write the {@code bytes} to {@code file} starting {@code position}. This * method will perform an fsync. * * @param bytes * @param file * @param position */
Write the bytes to file starting position. This method will perform an fsync
writeBytes
{ "repo_name": "bigtreeljc/concourse", "path": "concourse-server/src/main/java/org/cinchapi/concourse/server/io/FileSystem.java", "license": "apache-2.0", "size": 14630 }
[ "com.google.common.base.Throwables", "java.io.IOException", "java.nio.ByteBuffer", "java.nio.channels.FileChannel" ]
import com.google.common.base.Throwables; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.FileChannel;
import com.google.common.base.*; import java.io.*; import java.nio.*; import java.nio.channels.*;
[ "com.google.common", "java.io", "java.nio" ]
com.google.common; java.io; java.nio;
479,836
@Override protected void fill(Map<ConfigKey<?>, Object> template) { super.fill(template); template.put(Population.SIZE, 100); List<TerminationCriteria> criteria = new ArrayList<TerminationCriteria>(); criteria.add(new TerminationFitness(new DoubleFitness.Minimise(0.0))); criteri...
void function(Map<ConfigKey<?>, Object> template) { super.fill(template); template.put(Population.SIZE, 100); List<TerminationCriteria> criteria = new ArrayList<TerminationCriteria>(); criteria.add(new TerminationFitness(new DoubleFitness.Minimise(0.0))); criteria.add(new MaximumGenerations()); template.put(Evolutionar...
/** * Sets up the given template with the benchmark config settings * * @param template a map to be filled with the template config */
Sets up the given template with the benchmark config settings
fill
{ "repo_name": "sfrancis1970/EpochX", "path": "ge/src/main/java/org/epochx/ge/benchmark/ant/GELosAltosHillsTrail.java", "license": "gpl-3.0", "size": 9797 }
[ "java.util.ArrayList", "java.util.List", "java.util.Map", "org.epochx.Breeder", "org.epochx.Config", "org.epochx.EvolutionaryStrategy", "org.epochx.FitnessEvaluator", "org.epochx.Initialiser", "org.epochx.MaximumGenerations", "org.epochx.Operator", "org.epochx.Population", "org.epochx.RandomSe...
import java.util.ArrayList; import java.util.List; import java.util.Map; import org.epochx.Breeder; import org.epochx.Config; import org.epochx.EvolutionaryStrategy; import org.epochx.FitnessEvaluator; import org.epochx.Initialiser; import org.epochx.MaximumGenerations; import org.epochx.Operator; import org.epochx.Pop...
import java.util.*; import org.epochx.*; import org.epochx.fitness.*; import org.epochx.ge.*; import org.epochx.ge.fitness.*; import org.epochx.ge.init.*; import org.epochx.ge.map.*; import org.epochx.ge.operator.*; import org.epochx.grammar.*; import org.epochx.interpret.*; import org.epochx.random.*; import org.epoch...
[ "java.util", "org.epochx", "org.epochx.fitness", "org.epochx.ge", "org.epochx.grammar", "org.epochx.interpret", "org.epochx.random", "org.epochx.selection", "org.epochx.tools" ]
java.util; org.epochx; org.epochx.fitness; org.epochx.ge; org.epochx.grammar; org.epochx.interpret; org.epochx.random; org.epochx.selection; org.epochx.tools;
2,094,835
@Test public void testExplicitConnectionPool() throws Exception { getSystem(); CacheCreation cache = new CacheCreation(); PoolFactory f = cache.createPoolFactory(); f.addServer(ALIAS2, 3777).addServer(ALIAS1, 3888); f.setFreeConnectionTimeout(12345).setLoadConditioningInterval(12345).setSocketBu...
void function() throws Exception { getSystem(); CacheCreation cache = new CacheCreation(); PoolFactory f = cache.createPoolFactory(); f.addServer(ALIAS2, 3777).addServer(ALIAS1, 3888); f.setFreeConnectionTimeout(12345).setLoadConditioningInterval(12345).setSocketBufferSize(12345) .setThreadLocalConnections(true).setPRS...
/** * test for enabling PRsingleHop feature. Test for enabling multiuser-authentication attribute. */
test for enabling PRsingleHop feature. Test for enabling multiuser-authentication attribute
testExplicitConnectionPool
{ "repo_name": "deepakddixit/incubator-geode", "path": "geode-core/src/distributedTest/java/org/apache/geode/cache30/CacheXml66DUnitTest.java", "license": "apache-2.0", "size": 167383 }
[ "org.apache.geode.cache.Cache", "org.apache.geode.cache.DataPolicy", "org.apache.geode.cache.Region", "org.apache.geode.cache.client.Pool", "org.apache.geode.cache.client.PoolFactory", "org.apache.geode.cache.client.PoolManager", "org.apache.geode.internal.cache.xmlcache.CacheCreation", "org.apache.ge...
import org.apache.geode.cache.Cache; import org.apache.geode.cache.DataPolicy; import org.apache.geode.cache.Region; import org.apache.geode.cache.client.Pool; import org.apache.geode.cache.client.PoolFactory; import org.apache.geode.cache.client.PoolManager; import org.apache.geode.internal.cache.xmlcache.CacheCreatio...
import org.apache.geode.cache.*; import org.apache.geode.cache.client.*; import org.apache.geode.internal.cache.xmlcache.*; import org.apache.geode.test.dunit.*; import org.junit.*;
[ "org.apache.geode", "org.junit" ]
org.apache.geode; org.junit;
1,443,278
public void setMasterAccountBalance(BigDecimal masterAccountBalance) { this.masterAccountBalance = masterAccountBalance; }
void function(BigDecimal masterAccountBalance) { this.masterAccountBalance = masterAccountBalance; }
/** * Sets the balance of master account of the payment. * * @param masterAccountBalance * the balance of master account of the payment. */
Sets the balance of master account of the payment
setMasterAccountBalance
{ "repo_name": "NASA-Tournament-Lab/CoECI-OPM-Service-Credit-Redeposit-Deposit-Application", "path": "Code/SCRD_BRE/src/java/core/gov/opm/scrd/entities/application/Payment.java", "license": "apache-2.0", "size": 36712 }
[ "java.math.BigDecimal" ]
import java.math.BigDecimal;
import java.math.*;
[ "java.math" ]
java.math;
709,434
public void setConstraintMappings( ConstraintMapping[] constraintMappings ) { setConstraintMappings( Arrays.asList(constraintMappings), null); }
void function( ConstraintMapping[] constraintMappings ) { setConstraintMappings( Arrays.asList(constraintMappings), null); }
/** * Process the constraints following the combining rules in Servlet 3.0 EA * spec section 13.7.1 Note that much of the logic is in the RoleInfo class. * * @param constraintMappings * The constraintMappings to set as array, from which the set of known roles * is det...
Process the constraints following the combining rules in Servlet 3.0 EA spec section 13.7.1 Note that much of the logic is in the RoleInfo class
setConstraintMappings
{ "repo_name": "thomasbecker/jetty-7", "path": "jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java", "license": "apache-2.0", "size": 15392 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
1,591,052
protected Entity findPlayerToAttack() { EntityPlayer var1 = this.worldObj.getClosestVulnerablePlayerToEntity(this, 64.0D); if (var1 != null) { if (this.shouldAttackPlayer(var1)) { this.isAggressive = true; if (this.stareTimer == 0...
Entity function() { EntityPlayer var1 = this.worldObj.getClosestVulnerablePlayerToEntity(this, 64.0D); if (var1 != null) { if (this.shouldAttackPlayer(var1)) { this.isAggressive = true; if (this.stareTimer == 0) { this.worldObj.playSoundEffect(var1.posX, var1.posY, var1.posZ, STR, 1.0F, 1.0F); } if (this.stareTimer++ =...
/** * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking * (Animals, Spiders at day, peaceful PigZombies). */
Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking (Animals, Spiders at day, peaceful PigZombies)
findPlayerToAttack
{ "repo_name": "Myrninvollo/Server", "path": "src/net/minecraft/entity/monster/EntityEnderman.java", "license": "gpl-2.0", "size": 17969 }
[ "net.minecraft.entity.Entity", "net.minecraft.entity.player.EntityPlayer" ]
import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.*; import net.minecraft.entity.player.*;
[ "net.minecraft.entity" ]
net.minecraft.entity;
147,311
public SPDXPackage clone(SPDXDocument docToCloneTo, String packageUri) throws InvalidSPDXAnalysisException { if (docToCloneTo.getExtractedLicenseInfos() != null && docToCloneTo.getExtractedLicenseInfos().length > 0) { throw(new InvalidSPDXAnalysisException("Can not clone a package to an SPDX document with e...
SPDXPackage function(SPDXDocument docToCloneTo, String packageUri) throws InvalidSPDXAnalysisException { if (docToCloneTo.getExtractedLicenseInfos() != null && docToCloneTo.getExtractedLicenseInfos().length > 0) { throw(new InvalidSPDXAnalysisException(STR)); } if (docToCloneTo.getFileReferences()!= null && docToCloneT...
/** * Clones a deep copy of all fields to a new SPDXPackage contained in the docToCloneTo SPDXDocument. * NOTE: This will overwrite any existing SPDXPackages contained within the SPDXDocument and the SPDXDocument must not contain any extracted licenses * @param docToCloneTo SPDX Document to contain the result...
Clones a deep copy of all fields to a new SPDXPackage contained in the docToCloneTo SPDXDocument
clone
{ "repo_name": "rtgdk/tools", "path": "src/org/spdx/rdfparser/SPDXDocument.java", "license": "apache-2.0", "size": 71164 }
[ "org.spdx.rdfparser.license.AnyLicenseInfo", "org.spdx.rdfparser.license.ExtractedLicenseInfo" ]
import org.spdx.rdfparser.license.AnyLicenseInfo; import org.spdx.rdfparser.license.ExtractedLicenseInfo;
import org.spdx.rdfparser.license.*;
[ "org.spdx.rdfparser" ]
org.spdx.rdfparser;
68,328
public static View horizontalButtonSlots(Context context, int desiredHeight, Slot... slots) { final LinearLayout ll = new LinearLayout(context); ll.setOrientation(LinearLayout.HORIZONTAL); final LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(0, desiredHeight);...
static View function(Context context, int desiredHeight, Slot... slots) { final LinearLayout ll = new LinearLayout(context); ll.setOrientation(LinearLayout.HORIZONTAL); final LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(0, desiredHeight); lp.setMargins(10, 0, 10, 0); lp.weight = 0.33f; boolean left = fa...
/** * Create a horizontal linear layout divided into thirds (with some margins * separating the thirds), filled with buttons into some slots. * @param context The context. * @param desiredHeight The height of the LL. * @param slots Which slots to fill with buttons. * @return The linear lay...
Create a horizontal linear layout divided into thirds (with some margins separating the thirds), filled with buttons into some slots
horizontalButtonSlots
{ "repo_name": "rex-xxx/mt6572_x201", "path": "mediatek/frameworks/base/tests/view/src/com/mediatek/common/view/tests/util/ListItemFactory.java", "license": "gpl-2.0", "size": 10100 }
[ "android.content.Context", "android.view.View", "android.widget.Button", "android.widget.LinearLayout" ]
import android.content.Context; import android.view.View; import android.widget.Button; import android.widget.LinearLayout;
import android.content.*; import android.view.*; import android.widget.*;
[ "android.content", "android.view", "android.widget" ]
android.content; android.view; android.widget;
1,072,134
@Nonnull public MessageReplyAllRequest buildRequest(@Nonnull final java.util.List<? extends com.microsoft.graph.options.Option> requestOptions) { final MessageReplyAllRequest request = new MessageReplyAllRequest( getRequestUrl(), getClient(), requestOption...
MessageReplyAllRequest function(@Nonnull final java.util.List<? extends com.microsoft.graph.options.Option> requestOptions) { final MessageReplyAllRequest request = new MessageReplyAllRequest( getRequestUrl(), getClient(), requestOptions); request.body = this.body; return request; }
/** * Creates the MessageReplyAllRequest with specific requestOptions instead of the existing requestOptions * * @param requestOptions the options for the request * @return the MessageReplyAllRequest instance */
Creates the MessageReplyAllRequest with specific requestOptions instead of the existing requestOptions
buildRequest
{ "repo_name": "microsoftgraph/msgraph-sdk-java", "path": "src/main/java/com/microsoft/graph/requests/MessageReplyAllRequestBuilder.java", "license": "mit", "size": 3244 }
[ "com.microsoft.graph.requests.MessageReplyAllRequest", "javax.annotation.Nonnull" ]
import com.microsoft.graph.requests.MessageReplyAllRequest; import javax.annotation.Nonnull;
import com.microsoft.graph.requests.*; import javax.annotation.*;
[ "com.microsoft.graph", "javax.annotation" ]
com.microsoft.graph; javax.annotation;
2,542,969
Doctor doctor = new Doctor("Lecter", 45, true); Engeneer engeneer = new Engeneer("Bob", 34, true); String expected = "The doctor Lecter treats Bob"; String result = doctor.cure(engeneer); assertThat(result, is(expected)); }
Doctor doctor = new Doctor(STR, 45, true); Engeneer engeneer = new Engeneer("Bob", 34, true); String expected = STR; String result = doctor.cure(engeneer); assertThat(result, is(expected)); }
/** *Test. Dcotor class. */
Test. Dcotor class
doctorTest
{ "repo_name": "Malamut54/dbobrov", "path": "chapter_002/src/test/java/ru/job4j/proffesions/DoctorTest.java", "license": "apache-2.0", "size": 623 }
[ "org.hamcrest.core.Is", "org.junit.Assert" ]
import org.hamcrest.core.Is; import org.junit.Assert;
import org.hamcrest.core.*; import org.junit.*;
[ "org.hamcrest.core", "org.junit" ]
org.hamcrest.core; org.junit;
2,400,737
boolean seek(KeyValue key) throws IOException;
boolean seek(KeyValue key) throws IOException;
/** * Seek the scanner at or after the specified KeyValue. * @param key seek value * @return true if scanner has values left, false if end of scanner */
Seek the scanner at or after the specified KeyValue
seek
{ "repo_name": "Jackygq1982/hbase_src", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueScanner.java", "license": "apache-2.0", "size": 5976 }
[ "java.io.IOException", "org.apache.hadoop.hbase.KeyValue" ]
import java.io.IOException; import org.apache.hadoop.hbase.KeyValue;
import java.io.*; import org.apache.hadoop.hbase.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
1,825,847
private void setCallerInfo(CallerInfo callerInfo, int token) { Trace.beginSection("setCallerInfo"); Preconditions.checkNotNull(callerInfo); if (mQueryToken == token) { mCallerInfo = callerInfo; Log.i(this, "CallerInfo received for %s: %s", Log.piiHandle(mHandle), cal...
void function(CallerInfo callerInfo, int token) { Trace.beginSection(STR); Preconditions.checkNotNull(callerInfo); if (mQueryToken == token) { mCallerInfo = callerInfo; Log.i(this, STR, Log.piiHandle(mHandle), callerInfo); if (mCallerInfo.contactDisplayPhotoUri != null) { Log.d(this, STR, mCallerInfo.contactDisplayPhot...
/** * Saves the specified caller info if the specified token matches that of the last query * that was made. * * @param callerInfo The new caller information to set. * @param token The token used with this query. */
Saves the specified caller info if the specified token matches that of the last query that was made
setCallerInfo
{ "repo_name": "s20121035/rk3288_android5.1_repo", "path": "packages/services/Telecomm/src/com/android/server/telecom/Call.java", "license": "gpl-3.0", "size": 54064 }
[ "android.os.Trace", "com.android.internal.telephony.CallerInfo", "com.android.internal.util.Preconditions" ]
import android.os.Trace; import com.android.internal.telephony.CallerInfo; import com.android.internal.util.Preconditions;
import android.os.*; import com.android.internal.telephony.*; import com.android.internal.util.*;
[ "android.os", "com.android.internal" ]
android.os; com.android.internal;
1,958,276
public List<CollectorDetail> getCollectorDetails() { return collectorDetails; }
List<CollectorDetail> function() { return collectorDetails; }
/** * Gets the idBillings attribute. */
Gets the idBillings attribute
getCollectorDetails
{ "repo_name": "kuali/kfs", "path": "kfs-core/src/main/java/org/kuali/kfs/gl/batch/CollectorBatch.java", "license": "agpl-3.0", "size": 26781 }
[ "java.util.List", "org.kuali.kfs.gl.businessobject.CollectorDetail" ]
import java.util.List; import org.kuali.kfs.gl.businessobject.CollectorDetail;
import java.util.*; import org.kuali.kfs.gl.businessobject.*;
[ "java.util", "org.kuali.kfs" ]
java.util; org.kuali.kfs;
2,377,818
public void setSecurityService(SecurityService securityService) { this.securityService = securityService; }
void function(SecurityService securityService) { this.securityService = securityService; }
/** * Sets the securityService. * * @param securityService */
Sets the securityService
setSecurityService
{ "repo_name": "ua-eas/ua-kfs-5.3", "path": "work/src/org/kuali/kfs/module/endow/document/service/impl/UpdateTaxLotsBasedOnAccMethodAndTransSubtypeServiceImpl.java", "license": "agpl-3.0", "size": 36433 }
[ "org.kuali.kfs.module.endow.document.service.SecurityService" ]
import org.kuali.kfs.module.endow.document.service.SecurityService;
import org.kuali.kfs.module.endow.document.service.*;
[ "org.kuali.kfs" ]
org.kuali.kfs;
2,311,072
public static boolean hasJellyBean() { return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN; }
static boolean function() { return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN; }
/** * >= 4.1 16 * * @return */
>= 4.1 16
hasJellyBean
{ "repo_name": "mabeijianxi/small-video-record", "path": "SmallVideoRecord1/SmallVideoLib/src/main/java/mabeijianxi/camera/util/DeviceUtils.java", "license": "apache-2.0", "size": 6262 }
[ "android.os.Build" ]
import android.os.Build;
import android.os.*;
[ "android.os" ]
android.os;
1,640,951