method
stringlengths 13
441k
| clean_method
stringlengths 7
313k
| doc
stringlengths 17
17.3k
| comment
stringlengths 3
1.42k
| method_name
stringlengths 1
273
| extra
dict | imports
list | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
list | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
|---|---|---|---|---|---|---|---|---|---|---|---|
public void setPhyloTreeService(PhyloTreeService pNewPhyloTreeService) {
mPhyloTreeService = pNewPhyloTreeService;
}
|
void function(PhyloTreeService pNewPhyloTreeService) { mPhyloTreeService = pNewPhyloTreeService; }
|
/**
* Set the PhyloTreeService
*/
|
Set the PhyloTreeService
|
setPhyloTreeService
|
{
"repo_name": "TreeBASE/treebasetest",
"path": "treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadATreeController.java",
"license": "bsd-3-clause",
"size": 4088
}
|
[
"org.cipres.treebase.domain.tree.PhyloTreeService"
] |
import org.cipres.treebase.domain.tree.PhyloTreeService;
|
import org.cipres.treebase.domain.tree.*;
|
[
"org.cipres.treebase"
] |
org.cipres.treebase;
| 1,482,710
|
@Override
public void destroy(T instance, CreationalContext<T> env)
{
}
|
void function(T instance, CreationalContext<T> env) { }
|
/**
* Call destroy
*/
|
Call destroy
|
destroy
|
{
"repo_name": "dlitz/resin",
"path": "modules/kernel/src/com/caucho/config/inject/AbstractIntrospectedBean.java",
"license": "gpl-2.0",
"size": 17702
}
|
[
"javax.enterprise.context.spi.CreationalContext"
] |
import javax.enterprise.context.spi.CreationalContext;
|
import javax.enterprise.context.spi.*;
|
[
"javax.enterprise"
] |
javax.enterprise;
| 451,561
|
public void valueBound(HttpSessionBindingEvent event) {
return;
}
|
void function(HttpSessionBindingEvent event) { return; }
|
/**
* Binding this object to the session has no additional effects.
*
* @param event the session bind event.
*/
|
Binding this object to the session has no additional effects
|
valueBound
|
{
"repo_name": "simeshev/parabuild-ci",
"path": "3rdparty/jfreechart-1.0.5/source/org/jfree/chart/servlet/ChartDeleter.java",
"license": "lgpl-3.0",
"size": 3919
}
|
[
"javax.servlet.http.HttpSessionBindingEvent"
] |
import javax.servlet.http.HttpSessionBindingEvent;
|
import javax.servlet.http.*;
|
[
"javax.servlet"
] |
javax.servlet;
| 1,403,337
|
public void setForegroundIconColorAnimated(final Color color, final int cycleCount) {
assert color != null;
stopForegroundIconColorFadeAnimation();
foregroundFadeIcon.setFill(color);
foregroundColorFadeAnimation = Animations.createFadeTransition(foregroundFadeIcon, JFXConstants.TRANSPARENCY_FULLY, JFXConstants.TRANSPARENCY_NONE, cycleCount, JFXConstants.ANIMATION_DURATION_FADE_DEFAULT);
foregroundColorFadeAnimation.setOnFinished(event -> {
foregroundFadeIcon.setFill(color);
foregroundFadeIcon.setOpacity(JFXConstants.TRANSPARENCY_FULLY);
});
foregroundColorFadeAnimation.play();
}
|
void function(final Color color, final int cycleCount) { assert color != null; stopForegroundIconColorFadeAnimation(); foregroundFadeIcon.setFill(color); foregroundColorFadeAnimation = Animations.createFadeTransition(foregroundFadeIcon, JFXConstants.TRANSPARENCY_FULLY, JFXConstants.TRANSPARENCY_NONE, cycleCount, JFXConstants.ANIMATION_DURATION_FADE_DEFAULT); foregroundColorFadeAnimation.setOnFinished(event -> { foregroundFadeIcon.setFill(color); foregroundFadeIcon.setOpacity(JFXConstants.TRANSPARENCY_FULLY); }); foregroundColorFadeAnimation.play(); }
|
/**
* Allows to set a new color to the foregroundIcon icon and setAnimation its change (by a FadeTransition).
*
* @param color the color for the foregroundIcon icon to be set
* @param cycleCount the number of times the animation should be played (use Animation.INDEFINITE for endless)
*/
|
Allows to set a new color to the foregroundIcon icon and setAnimation its change (by a FadeTransition)
|
setForegroundIconColorAnimated
|
{
"repo_name": "DivineCooperation/jul",
"path": "visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/svg/SVGIcon.java",
"license": "lgpl-3.0",
"size": 34073
}
|
[
"org.openbase.jul.visual.javafx.JFXConstants",
"org.openbase.jul.visual.javafx.animation.Animations"
] |
import org.openbase.jul.visual.javafx.JFXConstants; import org.openbase.jul.visual.javafx.animation.Animations;
|
import org.openbase.jul.visual.javafx.*; import org.openbase.jul.visual.javafx.animation.*;
|
[
"org.openbase.jul"
] |
org.openbase.jul;
| 1,495,631
|
public void setStackVoltageCallbackPeriod(long period) throws TimeoutException, NotConnectedException {
ByteBuffer bb = ipcon.createRequestPacket((byte)12, FUNCTION_SET_STACK_VOLTAGE_CALLBACK_PERIOD, this);
bb.putInt((int)period);
sendRequest(bb.array());
}
|
void function(long period) throws TimeoutException, NotConnectedException { ByteBuffer bb = ipcon.createRequestPacket((byte)12, FUNCTION_SET_STACK_VOLTAGE_CALLBACK_PERIOD, this); bb.putInt((int)period); sendRequest(bb.array()); }
|
/**
* Sets the period in ms with which the {@link BrickMaster.StackVoltageListener} listener is triggered
* periodically. A value of 0 turns the listener off.
*
* {@link BrickMaster.StackVoltageListener} is only triggered if the voltage has changed since the
* last triggering.
*
* The default value is 0.
*
* .. versionadded:: 2.0.5~(Firmware)
*/
|
Sets the period in ms with which the <code>BrickMaster.StackVoltageListener</code> listener is triggered periodically. A value of 0 turns the listener off. <code>BrickMaster.StackVoltageListener</code> is only triggered if the voltage has changed since the last triggering. The default value is 0. .. versionadded:: 2.0.5~(Firmware)
|
setStackVoltageCallbackPeriod
|
{
"repo_name": "jaggr2/ch.bfh.fbi.mobiComp.17herz",
"path": "com.tinkerforge/src/com/tinkerforge/BrickMaster.java",
"license": "apache-2.0",
"size": 85810
}
|
[
"java.nio.ByteBuffer"
] |
import java.nio.ByteBuffer;
|
import java.nio.*;
|
[
"java.nio"
] |
java.nio;
| 2,709,350
|
public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {
modelRenderer.rotateAngleX = x;
modelRenderer.rotateAngleY = y;
modelRenderer.rotateAngleZ = z;
}
|
void function(ModelRenderer modelRenderer, float x, float y, float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; }
|
/**
* This is a helper function from Tabula to set the rotation of model parts
*/
|
This is a helper function from Tabula to set the rotation of model parts
|
setRotateAngle
|
{
"repo_name": "Yunus1903/Pet-Rock",
"path": "src/main/java/com/YunusKayne/PetRock/client/models/ModelPetrockCrate.java",
"license": "gpl-3.0",
"size": 2596
}
|
[
"net.minecraft.client.model.ModelRenderer"
] |
import net.minecraft.client.model.ModelRenderer;
|
import net.minecraft.client.model.*;
|
[
"net.minecraft.client"
] |
net.minecraft.client;
| 1,924,269
|
public String[] getTaskDiagnostics(TaskAttemptID taskid) throws IOException;
|
String[] function(TaskAttemptID taskid) throws IOException;
|
/**
* Gets the diagnostic messages for a given task attempt.
* @param taskid
* @return the list of diagnostic messages for the task
* @throws IOException
*/
|
Gets the diagnostic messages for a given task attempt
|
getTaskDiagnostics
|
{
"repo_name": "apache/hadoop-common",
"path": "src/mapred/org/apache/hadoop/mapred/RunningJob.java",
"license": "apache-2.0",
"size": 5750
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 238,252
|
public boolean existRosterGroup(String rosterId)
{
boolean rv = false;
Collection<Group> groups = site.getGroups();
for(Group group:groups)
{
// check if there is one group with this roster id already
String groupWSetupCreated = group.getProperties().getProperty(Group.GROUP_PROP_WSETUP_CREATED);
if (groupWSetupCreated != null && groupWSetupCreated.equalsIgnoreCase(Boolean.TRUE.toString()))
{
if (group.getProviderGroupId() != null && group.getProviderGroupId().equals(rosterId))
{
rv = true;
break;
}
}
}
return rv;
}
|
boolean function(String rosterId) { boolean rv = false; Collection<Group> groups = site.getGroups(); for(Group group:groups) { String groupWSetupCreated = group.getProperties().getProperty(Group.GROUP_PROP_WSETUP_CREATED); if (groupWSetupCreated != null && groupWSetupCreated.equalsIgnoreCase(Boolean.TRUE.toString())) { if (group.getProviderGroupId() != null && group.getProviderGroupId().equals(rosterId)) { rv = true; break; } } } return rv; }
|
/**
* check whether there is already a group within the site containing the roster id
* @param rosterId
* @return
*/
|
check whether there is already a group within the site containing the roster id
|
existRosterGroup
|
{
"repo_name": "bkirschn/sakai",
"path": "site-manage/site-manage-group-section-role-helper/tool/src/java/org/sakaiproject/site/tool/helper/managegroupsectionrole/impl/SiteManageGroupSectionRoleHandler.java",
"license": "apache-2.0",
"size": 64638
}
|
[
"java.util.Collection",
"org.sakaiproject.site.api.Group"
] |
import java.util.Collection; import org.sakaiproject.site.api.Group;
|
import java.util.*; import org.sakaiproject.site.api.*;
|
[
"java.util",
"org.sakaiproject.site"
] |
java.util; org.sakaiproject.site;
| 2,168,799
|
void size(Handler<AsyncResult<Integer>> resultHandler);
|
void size(Handler<AsyncResult<Integer>> resultHandler);
|
/**
* Gets the current size of the map.
*
* @param resultHandler An asynchronous handler to be called with the result.
*/
|
Gets the current size of the map
|
size
|
{
"repo_name": "kuujo/vertigo",
"path": "core/src/main/java/net/kuujo/vertigo/cluster/data/AsyncMap.java",
"license": "apache-2.0",
"size": 3974
}
|
[
"org.vertx.java.core.AsyncResult",
"org.vertx.java.core.Handler"
] |
import org.vertx.java.core.AsyncResult; import org.vertx.java.core.Handler;
|
import org.vertx.java.core.*;
|
[
"org.vertx.java"
] |
org.vertx.java;
| 469,291
|
private void fillGridWithAggregatedDataMap( DataQueryParams params, Grid grid,
Map<String, Double> aggregatedDataMap )
{
for ( Map.Entry<String, Double> entry : aggregatedDataMap.entrySet() )
{
Double value = params.isSkipRounding() ? entry.getValue() : getRounded( entry.getValue() );
grid.addRow()
.addValues( entry.getKey().split( DIMENSION_SEP ) )
.addValue( value );
if ( params.isIncludeNumDen() )
{
grid.addNullValues( NUMERATOR_DENOMINATOR_PROPERTIES_COUNT );
}
}
}
|
void function( DataQueryParams params, Grid grid, Map<String, Double> aggregatedDataMap ) { for ( Map.Entry<String, Double> entry : aggregatedDataMap.entrySet() ) { Double value = params.isSkipRounding() ? entry.getValue() : getRounded( entry.getValue() ); grid.addRow() .addValues( entry.getKey().split( DIMENSION_SEP ) ) .addValue( value ); if ( params.isIncludeNumDen() ) { grid.addNullValues( NUMERATOR_DENOMINATOR_PROPERTIES_COUNT ); } } }
|
/**
* Fill grid with aggregated data map with key and value
*
* @param params the {@link DataQueryParams}.
* @param grid the grid
* @param aggregatedDataMap the aggregated data map
*/
|
Fill grid with aggregated data map with key and value
|
fillGridWithAggregatedDataMap
|
{
"repo_name": "dhis2/dhis2-core",
"path": "dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/handler/DataHandler.java",
"license": "bsd-3-clause",
"size": 50048
}
|
[
"java.util.Map",
"org.hisp.dhis.analytics.DataQueryParams",
"org.hisp.dhis.common.Grid",
"org.hisp.dhis.system.util.MathUtils"
] |
import java.util.Map; import org.hisp.dhis.analytics.DataQueryParams; import org.hisp.dhis.common.Grid; import org.hisp.dhis.system.util.MathUtils;
|
import java.util.*; import org.hisp.dhis.analytics.*; import org.hisp.dhis.common.*; import org.hisp.dhis.system.util.*;
|
[
"java.util",
"org.hisp.dhis"
] |
java.util; org.hisp.dhis;
| 139,411
|
public static XmlStringBuilder constructPrefXml(String key, String value) {
return XmlStringBuilder.createText("").wrap(
PREF_TAGNAME, KEY_ATTRIBUTE, key, VALUE_ATTRIBUTE, value);
}
|
static XmlStringBuilder function(String key, String value) { return XmlStringBuilder.createText("").wrap( PREF_TAGNAME, KEY_ATTRIBUTE, key, VALUE_ATTRIBUTE, value); }
|
/**
* Returns initialized XML string builder for a gadget user pref element.
*
* @param key the key
* @param value the value
* @return XML string builder for the state element
*/
|
Returns initialized XML string builder for a gadget user pref element
|
constructPrefXml
|
{
"repo_name": "vega113/incubator-wave",
"path": "wave/src/main/java/org/waveprotocol/wave/model/gadget/GadgetXmlUtil.java",
"license": "apache-2.0",
"size": 6170
}
|
[
"org.waveprotocol.wave.model.document.util.XmlStringBuilder"
] |
import org.waveprotocol.wave.model.document.util.XmlStringBuilder;
|
import org.waveprotocol.wave.model.document.util.*;
|
[
"org.waveprotocol.wave"
] |
org.waveprotocol.wave;
| 1,310,310
|
public static Calendar toCalendar(Object value, String format) throws ConversionException {
if (value instanceof Calendar) {
return (Calendar) value;
}
else if (value instanceof Date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime((Date) value);
return calendar;
}
else if (value instanceof String) {
try {
Calendar calendar = Calendar.getInstance();
calendar.setTime(new SimpleDateFormat(format).parse((String) value));
return calendar;
}
catch (ParseException e) {
throw new ConversionException("The value " + value + " can't be converted to a Calendar", e);
}
}
else {
throw new ConversionException("The value " + value + " can't be converted to a Calendar");
}
}
|
static Calendar function(Object value, String format) throws ConversionException { if (value instanceof Calendar) { return (Calendar) value; } else if (value instanceof Date) { Calendar calendar = Calendar.getInstance(); calendar.setTime((Date) value); return calendar; } else if (value instanceof String) { try { Calendar calendar = Calendar.getInstance(); calendar.setTime(new SimpleDateFormat(format).parse((String) value)); return calendar; } catch (ParseException e) { throw new ConversionException(STR + value + STR, e); } } else { throw new ConversionException(STR + value + STR); } }
|
/**
* Convert the specified object into a Calendar.
*
* @param value
* the value to convert
* @param format
* the DateFormat pattern to parse String values
* @return the converted value
* @throws ConversionException
* thrown if the value cannot be converted to a Calendar
*/
|
Convert the specified object into a Calendar
|
toCalendar
|
{
"repo_name": "yangchunke/wkrdb",
"path": "common/src/main/java/net/yck/wkrdb/common/shared/PropertyConverter.java",
"license": "apache-2.0",
"size": 25682
}
|
[
"java.text.ParseException",
"java.text.SimpleDateFormat",
"java.util.Calendar",
"java.util.Date",
"org.apache.commons.configuration2.ex.ConversionException"
] |
import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import org.apache.commons.configuration2.ex.ConversionException;
|
import java.text.*; import java.util.*; import org.apache.commons.configuration2.ex.*;
|
[
"java.text",
"java.util",
"org.apache.commons"
] |
java.text; java.util; org.apache.commons;
| 1,616,203
|
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException {
stream.defaultReadObject();
this.listenerList = new EventListenerList();
}
|
void function(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); this.listenerList = new EventListenerList(); }
|
/**
* Provides serialization support.
*
* @param stream the input stream.
*
* @throws IOException if there is an I/O error.
* @throws ClassNotFoundException if there is a classpath problem.
*/
|
Provides serialization support
|
readObject
|
{
"repo_name": "Mr-Steve/LTSpice_Library_Manager",
"path": "libs/jfreechart-1.0.16/source/org/jfree/chart/plot/dial/AbstractDialLayer.java",
"license": "gpl-2.0",
"size": 6823
}
|
[
"java.io.IOException",
"java.io.ObjectInputStream",
"javax.swing.event.EventListenerList"
] |
import java.io.IOException; import java.io.ObjectInputStream; import javax.swing.event.EventListenerList;
|
import java.io.*; import javax.swing.event.*;
|
[
"java.io",
"javax.swing"
] |
java.io; javax.swing;
| 1,833,258
|
@NotNull public Collection<QueryIndex> getIndexes() {
return idxs == null ? Collections.<QueryIndex>emptyList() : idxs;
}
|
@NotNull Collection<QueryIndex> function() { return idxs == null ? Collections.<QueryIndex>emptyList() : idxs; }
|
/**
* Gets a collection of index entities.
*
* @return Collection of index entities.
*/
|
Gets a collection of index entities
|
getIndexes
|
{
"repo_name": "amirakhmedov/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java",
"license": "apache-2.0",
"size": 31044
}
|
[
"java.util.Collection",
"java.util.Collections",
"org.jetbrains.annotations.NotNull"
] |
import java.util.Collection; import java.util.Collections; import org.jetbrains.annotations.NotNull;
|
import java.util.*; import org.jetbrains.annotations.*;
|
[
"java.util",
"org.jetbrains.annotations"
] |
java.util; org.jetbrains.annotations;
| 2,784,644
|
EClass getStartIgnFuelCurve();
|
EClass getStartIgnFuelCurve();
|
/**
* Returns the meta object for class '{@link CIM.IEC61970.Generation.Production.StartIgnFuelCurve <em>Start Ign Fuel Curve</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Start Ign Fuel Curve</em>'.
* @see CIM.IEC61970.Generation.Production.StartIgnFuelCurve
* @generated
*/
|
Returns the meta object for class '<code>CIM.IEC61970.Generation.Production.StartIgnFuelCurve Start Ign Fuel Curve</code>'.
|
getStartIgnFuelCurve
|
{
"repo_name": "georghinkel/ttc2017smartGrids",
"path": "solutions/ModelJoin/src/main/java/CIM/IEC61970/Generation/Production/ProductionPackage.java",
"license": "mit",
"size": 499866
}
|
[
"org.eclipse.emf.ecore.EClass"
] |
import org.eclipse.emf.ecore.EClass;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 806,622
|
@Test
public final void testParsePacketApiModeNonRecognizeFrameTypePayload() throws InvalidPacketException {
// Setup the resources for the test.
byte[] payload = new byte[] {0x13};
byte[] byteArray = new byte[payload.length + 4];
byteArray[0] = 0x7E;
byteArray[1] = 0x00;
byteArray[2] = 0x01;
System.arraycopy(payload, 0, byteArray, 3, payload.length);
byteArray[byteArray.length - 1] = (byte)0xEC;
// Real package: {0x7E, 0x00, 0x01, 0x13, (byte)0xEC};
// Call the method under test.
XBeePacket packet = packetParser.parsePacket(byteArray, OperatingMode.API);
// Verify the result.
assertThat("Packet must be an unknown packet", packet, is(instanceOf(UnknownXBeePacket.class)));
assertThat("Returned length is not the expected one", packet.getPacketLength(), is(equalTo(payload.length)));
assertThat("Returned data array is not the expected one", packet.getPacketData(), is(equalTo(payload)));
assertThat("Generated API array from packet is not the expected one", packet.generateByteArray(), is(equalTo(byteArray)));
}
|
final void function() throws InvalidPacketException { byte[] payload = new byte[] {0x13}; byte[] byteArray = new byte[payload.length + 4]; byteArray[0] = 0x7E; byteArray[1] = 0x00; byteArray[2] = 0x01; System.arraycopy(payload, 0, byteArray, 3, payload.length); byteArray[byteArray.length - 1] = (byte)0xEC; XBeePacket packet = packetParser.parsePacket(byteArray, OperatingMode.API); assertThat(STR, packet, is(instanceOf(UnknownXBeePacket.class))); assertThat(STR, packet.getPacketLength(), is(equalTo(payload.length))); assertThat(STR, packet.getPacketData(), is(equalTo(payload))); assertThat(STR, packet.generateByteArray(), is(equalTo(byteArray))); }
|
/**
* Test method for {@link com.digi.xbee.api.packet.XBeePacketParser#parsePacket(byte[], OperatingMode)}.
*
* <p>A valid API byte array with unknown frame type must result in a valid
* API packet of {@code UnknownXBeePacket.class} type.</p>
*
* @throws InvalidPacketException
*/
|
Test method for <code>com.digi.xbee.api.packet.XBeePacketParser#parsePacket(byte[], OperatingMode)</code>. A valid API byte array with unknown frame type must result in a valid API packet of UnknownXBeePacket.class type
|
testParsePacketApiModeNonRecognizeFrameTypePayload
|
{
"repo_name": "digidotcom/XBeeJavaLibrary",
"path": "library/src/test/java/com/digi/xbee/api/packet/XBeePacketParserFromByteArrayTest.java",
"license": "mpl-2.0",
"size": 90611
}
|
[
"com.digi.xbee.api.exceptions.InvalidPacketException",
"com.digi.xbee.api.models.OperatingMode",
"org.hamcrest.core.Is",
"org.junit.Assert"
] |
import com.digi.xbee.api.exceptions.InvalidPacketException; import com.digi.xbee.api.models.OperatingMode; import org.hamcrest.core.Is; import org.junit.Assert;
|
import com.digi.xbee.api.exceptions.*; import com.digi.xbee.api.models.*; import org.hamcrest.core.*; import org.junit.*;
|
[
"com.digi.xbee",
"org.hamcrest.core",
"org.junit"
] |
com.digi.xbee; org.hamcrest.core; org.junit;
| 2,596,199
|
public Map<Long, String> getArchiveDescriptionsForHarvestedDatasets(Set<Long> datasetIds){
if (datasetIds == null || datasetIds.size() < 1) {
return null;
}
String datasetIdStr = Strings.join(datasetIds, ", ");
String qstr = "SELECT d.id, h.archiveDescription FROM harvestingClient h, dataset d WHERE d.harvestingClient_id = h.id AND d.id IN (" + datasetIdStr + ")";
List<Object[]> searchResults = null;
try {
searchResults = em.createNativeQuery(qstr).getResultList();
} catch (Exception ex) {
searchResults = null;
}
if (searchResults == null) {
return null;
}
Map<Long, String> ret = new HashMap<>();
for (Object[] result : searchResults) {
Long dsId = null;
if (result[0] != null) {
try {
dsId = (Long)result[0];
} catch (Exception ex) {
dsId = null;
}
if (dsId == null) {
continue;
}
ret.put(dsId, (String)result[1]);
}
}
return ret;
}
|
Map<Long, String> function(Set<Long> datasetIds){ if (datasetIds == null datasetIds.size() < 1) { return null; } String datasetIdStr = Strings.join(datasetIds, STR); String qstr = STR + datasetIdStr + ")"; List<Object[]> searchResults = null; try { searchResults = em.createNativeQuery(qstr).getResultList(); } catch (Exception ex) { searchResults = null; } if (searchResults == null) { return null; } Map<Long, String> ret = new HashMap<>(); for (Object[] result : searchResults) { Long dsId = null; if (result[0] != null) { try { dsId = (Long)result[0]; } catch (Exception ex) { dsId = null; } if (dsId == null) { continue; } ret.put(dsId, (String)result[1]); } } return ret; }
|
/**
* Used to identify and properly display Harvested objects on the dataverse page.
*
* @return
*/
|
Used to identify and properly display Harvested objects on the dataverse page
|
getArchiveDescriptionsForHarvestedDatasets
|
{
"repo_name": "bmckinney/dataverse-canonical",
"path": "src/main/java/edu/harvard/iq/dataverse/DatasetServiceBean.java",
"license": "apache-2.0",
"size": 30936
}
|
[
"java.util.HashMap",
"java.util.List",
"java.util.Map",
"java.util.Set",
"org.ocpsoft.common.util.Strings"
] |
import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import org.ocpsoft.common.util.Strings;
|
import java.util.*; import org.ocpsoft.common.util.*;
|
[
"java.util",
"org.ocpsoft.common"
] |
java.util; org.ocpsoft.common;
| 2,720,580
|
public ForgeDirection[][] getCornerLights() {
return null;
}
|
ForgeDirection[][] function() { return null; }
|
/**
* Returns a double array. Each row has two ForgeDirections, accessed as
* [x][0] and [x][1]. There should be a corner lamp at the side that is
* between the two directions.
*
* @return A non-null, but potentially empty, array.
*/
|
Returns a double array. Each row has two ForgeDirections, accessed as [x][0] and [x][1]. There should be a corner lamp at the side that is between the two directions
|
getCornerLights
|
{
"repo_name": "TheNumenorean/FuturisticMaterials",
"path": "src/main/java/net/thenumenorean/futuristicmaterials/blocks/LightBarTileEntity.java",
"license": "lgpl-2.1",
"size": 2384
}
|
[
"net.minecraftforge.common.util.ForgeDirection"
] |
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.*;
|
[
"net.minecraftforge.common"
] |
net.minecraftforge.common;
| 845,381
|
Map<String, Cookie> getCookies();
|
Map<String, Cookie> getCookies();
|
/**
* See the {@link org.apache.commons.chain2.web.WebContext}'s Javadoc.
*
* @return Map of Cookies.
* @since Chain 1.1
*/
|
See the <code>org.apache.commons.chain2.web.WebContext</code>'s Javadoc
|
getCookies
|
{
"repo_name": "apache/commons-chain",
"path": "web/src/main/java/org/apache/commons/chain2/web/servlet/ServletWebContext.java",
"license": "apache-2.0",
"size": 4336
}
|
[
"java.util.Map",
"javax.servlet.http.Cookie"
] |
import java.util.Map; import javax.servlet.http.Cookie;
|
import java.util.*; import javax.servlet.http.*;
|
[
"java.util",
"javax.servlet"
] |
java.util; javax.servlet;
| 2,899,137
|
public Date getExpirationDate() {
return expirationDate;
}
|
Date function() { return expirationDate; }
|
/**
* Gets the expirationDate attribute.
* @return Returns the expirationDate.
*/
|
Gets the expirationDate attribute
|
getExpirationDate
|
{
"repo_name": "Ariah-Group/Finance",
"path": "af_webapp/src/main/java/org/kuali/kfs/integration/cg/dto/AccountParametersDTO.java",
"license": "apache-2.0",
"size": 9616
}
|
[
"java.util.Date"
] |
import java.util.Date;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,808,891
|
public void deleteFileRequest(FileRequest fileReq)
throws DBException {
// Indicate that the feature is not implemented
throw new DBException("Feature not implemented");
}
|
void function(FileRequest fileReq) throws DBException { throw new DBException(STR); }
|
/**
* Default implementation of the delete file request, throws an exception indicating that the
* feature is not implemented.
*
* @param fileReq FileRequest
* @throws DBException
*/
|
Default implementation of the delete file request, throws an exception indicating that the feature is not implemented
|
deleteFileRequest
|
{
"repo_name": "loftuxab/community-edition-old",
"path": "projects/alfresco-jlan/source/java/org/alfresco/jlan/server/filesys/db/JdbcDBInterface.java",
"license": "lgpl-3.0",
"size": 30984
}
|
[
"org.alfresco.jlan.server.filesys.loader.FileRequest"
] |
import org.alfresco.jlan.server.filesys.loader.FileRequest;
|
import org.alfresco.jlan.server.filesys.loader.*;
|
[
"org.alfresco.jlan"
] |
org.alfresco.jlan;
| 2,506,430
|
public NatRule withSourceAddresses(List<String> sourceAddresses) {
this.sourceAddresses = sourceAddresses;
return this;
}
|
NatRule function(List<String> sourceAddresses) { this.sourceAddresses = sourceAddresses; return this; }
|
/**
* Set list of source IP addresses for this rule.
*
* @param sourceAddresses the sourceAddresses value to set
* @return the NatRule object itself.
*/
|
Set list of source IP addresses for this rule
|
withSourceAddresses
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/network/v2020_06_01/NatRule.java",
"license": "mit",
"size": 5557
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,006,438
|
if (ruleID == null || actionID == null) {
throw new IllegalArgumentException("insert parameter null.");
}
ContentValues initialValues = new ContentValues();
initialValues.put(KEY_RULEID, ruleID);
initialValues.put(KEY_ACTIONID, actionID);
// Set null because don't use 'null column hack'.
return database.insert(DATABASE_TABLE, null, initialValues);
}
|
if (ruleID == null actionID == null) { throw new IllegalArgumentException(STR); } ContentValues initialValues = new ContentValues(); initialValues.put(KEY_RULEID, ruleID); initialValues.put(KEY_ACTIONID, actionID); return database.insert(DATABASE_TABLE, null, initialValues); }
|
/**
* Insert a new RuleAction record
*
* @param ruleID
* is id of the rule it belongs to
* @param actionID
* is id of its action type
* @return RuleActionID or -1 if creation failed.
* @throws IllegalArgumentException
* if there is null within parameters
*/
|
Insert a new RuleAction record
|
insert
|
{
"repo_name": "joelmap/omnidroid",
"path": "omnidroid/src/edu/nyu/cs/omnidroid/app/model/db/RuleActionDbAdapter.java",
"license": "apache-2.0",
"size": 6869
}
|
[
"android.content.ContentValues"
] |
import android.content.ContentValues;
|
import android.content.*;
|
[
"android.content"
] |
android.content;
| 2,542,303
|
@Override
protected void onPostExecute(Bitmap bitmap) {
if (isCancelled()) {
bitmap = null;
}
addBitmapToCache(url, bitmap);
if (imageViewReference != null) {
ImageView imageView = imageViewReference.get();
BitmapDownloaderTask bitmapDownloaderTask = getBitmapDownloaderTask(imageView);
// Change bitmap only if this process is still associated with it
// Or if we don't use any bitmap to task association
// (NO_DOWNLOADED_DRAWABLE mode)
if ((this == bitmapDownloaderTask) || (mode != Mode.CORRECT)) {
imageView.setImageBitmap(bitmap);
}
}
}
}
static class DownloadedDrawable extends ColorDrawable {
private final WeakReference<BitmapDownloaderTask> bitmapDownloaderTaskReference;
public DownloadedDrawable(BitmapDownloaderTask bitmapDownloaderTask) {
// super(Color.WHITE);
bitmapDownloaderTaskReference = new WeakReference<BitmapDownloaderTask>(bitmapDownloaderTask);
}
|
void function(Bitmap bitmap) { if (isCancelled()) { bitmap = null; } addBitmapToCache(url, bitmap); if (imageViewReference != null) { ImageView imageView = imageViewReference.get(); BitmapDownloaderTask bitmapDownloaderTask = getBitmapDownloaderTask(imageView); if ((this == bitmapDownloaderTask) (mode != Mode.CORRECT)) { imageView.setImageBitmap(bitmap); } } } } static class DownloadedDrawable extends ColorDrawable { private final WeakReference<BitmapDownloaderTask> bitmapDownloaderTaskReference; public DownloadedDrawable(BitmapDownloaderTask bitmapDownloaderTask) { bitmapDownloaderTaskReference = new WeakReference<BitmapDownloaderTask>(bitmapDownloaderTask); }
|
/**
* Once the image is downloaded, associates it to the imageView
*/
|
Once the image is downloaded, associates it to the imageView
|
onPostExecute
|
{
"repo_name": "zoozooll/MyExercise",
"path": "meep/MeepStore2/src/com/oregonscientific/meep/store2/adapter/ImageDownloader.java",
"license": "apache-2.0",
"size": 16831
}
|
[
"android.graphics.Bitmap",
"android.graphics.drawable.ColorDrawable",
"android.widget.ImageView",
"java.lang.ref.WeakReference"
] |
import android.graphics.Bitmap; import android.graphics.drawable.ColorDrawable; import android.widget.ImageView; import java.lang.ref.WeakReference;
|
import android.graphics.*; import android.graphics.drawable.*; import android.widget.*; import java.lang.ref.*;
|
[
"android.graphics",
"android.widget",
"java.lang"
] |
android.graphics; android.widget; java.lang;
| 1,282,747
|
@Adjacency(label = EJB_HOME, direction = Direction.OUT)
public JavaClassModel getEjbHome();
|
@Adjacency(label = EJB_HOME, direction = Direction.OUT) JavaClassModel function();
|
/**
* Contains the Session bean's home interface
*/
|
Contains the Session bean's home interface
|
getEjbHome
|
{
"repo_name": "mbriskar/windup",
"path": "rules-java-ee/addon/src/main/java/org/jboss/windup/rules/apps/javaee/model/EjbSessionBeanModel.java",
"license": "epl-1.0",
"size": 4871
}
|
[
"com.tinkerpop.blueprints.Direction",
"com.tinkerpop.frames.Adjacency",
"org.jboss.windup.rules.apps.java.model.JavaClassModel"
] |
import com.tinkerpop.blueprints.Direction; import com.tinkerpop.frames.Adjacency; import org.jboss.windup.rules.apps.java.model.JavaClassModel;
|
import com.tinkerpop.blueprints.*; import com.tinkerpop.frames.*; import org.jboss.windup.rules.apps.java.model.*;
|
[
"com.tinkerpop.blueprints",
"com.tinkerpop.frames",
"org.jboss.windup"
] |
com.tinkerpop.blueprints; com.tinkerpop.frames; org.jboss.windup;
| 1,331,148
|
public static NioCorsConfigBuilder forOrigins(final String... origins) {
return new NioCorsConfigBuilder(origins);
}
Optional<Set<String>> origins;
Optional<Pattern> pattern;
final boolean anyOrigin;
boolean allowNullOrigin;
boolean enabled = true;
boolean allowCredentials;
long maxAge;
final Set<HttpMethod> requestMethods = new HashSet<>();
final Set<String> requestHeaders = new HashSet<>();
final Map<CharSequence, Callable<?>> preflightHeaders = new HashMap<>();
private boolean noPreflightHeaders;
boolean shortCircuit;
NioCorsConfigBuilder(final String... origins) {
this.origins = Optional.of(new LinkedHashSet<>(Arrays.asList(origins)));
pattern = Optional.empty();
anyOrigin = false;
}
NioCorsConfigBuilder() {
anyOrigin = true;
origins = Optional.empty();
pattern = Optional.empty();
}
NioCorsConfigBuilder(final Pattern pattern) {
this.pattern = Optional.of(pattern);
origins = Optional.empty();
anyOrigin = false;
}
|
static NioCorsConfigBuilder function(final String... origins) { return new NioCorsConfigBuilder(origins); } Optional<Set<String>> origins; Optional<Pattern> pattern; final boolean anyOrigin; boolean allowNullOrigin; boolean enabled = true; boolean allowCredentials; long maxAge; final Set<HttpMethod> requestMethods = new HashSet<>(); final Set<String> requestHeaders = new HashSet<>(); final Map<CharSequence, Callable<?>> preflightHeaders = new HashMap<>(); private boolean noPreflightHeaders; boolean shortCircuit; NioCorsConfigBuilder(final String... origins) { this.origins = Optional.of(new LinkedHashSet<>(Arrays.asList(origins))); pattern = Optional.empty(); anyOrigin = false; } NioCorsConfigBuilder() { anyOrigin = true; origins = Optional.empty(); pattern = Optional.empty(); } NioCorsConfigBuilder(final Pattern pattern) { this.pattern = Optional.of(pattern); origins = Optional.empty(); anyOrigin = false; }
|
/**
* Creates a {@link NioCorsConfigBuilder} instance with the specified origins.
*
* @return {@link NioCorsConfigBuilder} to support method chaining.
*/
|
Creates a <code>NioCorsConfigBuilder</code> instance with the specified origins
|
forOrigins
|
{
"repo_name": "gfyoung/elasticsearch",
"path": "plugins/transport-nio/src/main/java/org/elasticsearch/http/nio/cors/NioCorsConfigBuilder.java",
"license": "apache-2.0",
"size": 13108
}
|
[
"io.netty.handler.codec.http.HttpMethod",
"java.util.Arrays",
"java.util.HashMap",
"java.util.HashSet",
"java.util.LinkedHashSet",
"java.util.Map",
"java.util.Optional",
"java.util.Set",
"java.util.concurrent.Callable",
"java.util.regex.Pattern"
] |
import io.netty.handler.codec.http.HttpMethod; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashSet; import java.util.Map; import java.util.Optional; import java.util.Set; import java.util.concurrent.Callable; import java.util.regex.Pattern;
|
import io.netty.handler.codec.http.*; import java.util.*; import java.util.concurrent.*; import java.util.regex.*;
|
[
"io.netty.handler",
"java.util"
] |
io.netty.handler; java.util;
| 247,351
|
public PostalCodeEbo getOrgRemitToZipCode() {
if ( StringUtils.isBlank(organizationRemitToZipCode) ) {
orgRemitToZipCode = null;
} else {
if ( orgRemitToZipCode == null || !StringUtils.equals( orgRemitToZipCode.getCode(),organizationRemitToZipCode) ) {
ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(PostalCodeEbo.class);
if ( moduleService != null ) {
Map<String,Object> keys = new HashMap<String, Object>(2);
keys.put(LocationConstants.PrimaryKeyConstants.COUNTRY_CODE, KFSConstants.COUNTRY_CODE_UNITED_STATES);
keys.put(LocationConstants.PrimaryKeyConstants.CODE, organizationRemitToZipCode);
orgRemitToZipCode = moduleService.getExternalizableBusinessObject(PostalCodeEbo.class, keys);
} else {
throw new RuntimeException( "CONFIGURATION ERROR: No responsible module found for EBO class. Unable to proceed." );
}
}
}
return orgRemitToZipCode;
}
|
PostalCodeEbo function() { if ( StringUtils.isBlank(organizationRemitToZipCode) ) { orgRemitToZipCode = null; } else { if ( orgRemitToZipCode == null !StringUtils.equals( orgRemitToZipCode.getCode(),organizationRemitToZipCode) ) { ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(PostalCodeEbo.class); if ( moduleService != null ) { Map<String,Object> keys = new HashMap<String, Object>(2); keys.put(LocationConstants.PrimaryKeyConstants.COUNTRY_CODE, KFSConstants.COUNTRY_CODE_UNITED_STATES); keys.put(LocationConstants.PrimaryKeyConstants.CODE, organizationRemitToZipCode); orgRemitToZipCode = moduleService.getExternalizableBusinessObject(PostalCodeEbo.class, keys); } else { throw new RuntimeException( STR ); } } } return orgRemitToZipCode; }
|
/**
* Gets the orgRemitToZipCode attribute.
* @return Returns the orgRemitToZipCode.
*/
|
Gets the orgRemitToZipCode attribute
|
getOrgRemitToZipCode
|
{
"repo_name": "Ariah-Group/Finance",
"path": "af_webapp/src/main/java/org/kuali/kfs/module/ar/businessobject/SystemInformation.java",
"license": "apache-2.0",
"size": 30893
}
|
[
"java.util.HashMap",
"java.util.Map",
"org.apache.commons.lang.StringUtils",
"org.kuali.kfs.sys.KFSConstants",
"org.kuali.kfs.sys.context.SpringContext",
"org.kuali.rice.krad.service.KualiModuleService",
"org.kuali.rice.krad.service.ModuleService",
"org.kuali.rice.location.api.LocationConstants",
"org.kuali.rice.location.framework.postalcode.PostalCodeEbo"
] |
import java.util.HashMap; import java.util.Map; import org.apache.commons.lang.StringUtils; import org.kuali.kfs.sys.KFSConstants; import org.kuali.kfs.sys.context.SpringContext; import org.kuali.rice.krad.service.KualiModuleService; import org.kuali.rice.krad.service.ModuleService; import org.kuali.rice.location.api.LocationConstants; import org.kuali.rice.location.framework.postalcode.PostalCodeEbo;
|
import java.util.*; import org.apache.commons.lang.*; import org.kuali.kfs.sys.*; import org.kuali.kfs.sys.context.*; import org.kuali.rice.krad.service.*; import org.kuali.rice.location.api.*; import org.kuali.rice.location.framework.postalcode.*;
|
[
"java.util",
"org.apache.commons",
"org.kuali.kfs",
"org.kuali.rice"
] |
java.util; org.apache.commons; org.kuali.kfs; org.kuali.rice;
| 1,187,480
|
@SuppressWarnings("unchecked")
public static <T> T[] toArray(Iterable<? extends T> list, Class<T> c) {
int size = -1;
if (list instanceof Collection<?>) {
@SuppressWarnings("rawtypes")
Collection coll = (Collection) list;
size = coll.size();
}
if (size < 0) {
size = 0;
// Ugly hack: Count it ourselves
for (@SuppressWarnings("unused") T element : list) {
size++;
}
}
T[] result = (T[]) Array.newInstance(c, size);
int i = 0;
for (T element : list) { // Assumes iteration order is consistent
result[i++] = element; // Assign array element at index THEN increment counter
}
return result;
}
|
@SuppressWarnings(STR) static <T> T[] function(Iterable<? extends T> list, Class<T> c) { int size = -1; if (list instanceof Collection<?>) { @SuppressWarnings(STR) Collection coll = (Collection) list; size = coll.size(); } if (size < 0) { size = 0; for (@SuppressWarnings(STR) T element : list) { size++; } } T[] result = (T[]) Array.newInstance(c, size); int i = 0; for (T element : list) { result[i++] = element; } return result; }
|
/**
* Converts an iterable element collection to an array of elements.
* The iteration order of the specified object will be used as the array element order.
*
* @param list The iterable of objects which will be converted to an array.
* @param c The type of the elements of the array.
* @return An array of elements in the specified iterable.
*/
|
Converts an iterable element collection to an array of elements. The iteration order of the specified object will be used as the array element order
|
toArray
|
{
"repo_name": "korotyx/VirtualEntity",
"path": "src/main/java/com/korotyx/virtualentity/json/ArrayWrapper.java",
"license": "mit",
"size": 2683
}
|
[
"java.lang.reflect.Array",
"java.util.Collection"
] |
import java.lang.reflect.Array; import java.util.Collection;
|
import java.lang.reflect.*; import java.util.*;
|
[
"java.lang",
"java.util"
] |
java.lang; java.util;
| 585,004
|
public final boolean compareAndSet(double expect, double update) {
return updater.compareAndSet(this, doubleToRawLongBits(expect), doubleToRawLongBits(update));
}
|
final boolean function(double expect, double update) { return updater.compareAndSet(this, doubleToRawLongBits(expect), doubleToRawLongBits(update)); }
|
/**
* Atomically sets the value to the given updated value if the current value is <a
* href="#bitEquals">bitwise equal</a> to the expected value.
*
* @param expect the expected value
* @param update the new value
* @return {@code true} if successful. False return indicates that the actual value was not
* bitwise equal to the expected value.
*/
|
Atomically sets the value to the given updated value if the current value is bitwise equal to the expected value
|
compareAndSet
|
{
"repo_name": "mosoft521/guava",
"path": "guava/src/com/google/common/util/concurrent/AtomicDouble.java",
"license": "apache-2.0",
"size": 9568
}
|
[
"java.lang.Double"
] |
import java.lang.Double;
|
import java.lang.*;
|
[
"java.lang"
] |
java.lang;
| 707,058
|
@VisibleForTesting
protected void restoreFileFromBackup( String backupFileName ) throws IOException {
copyFile( backupFileName, filename );
}
|
void function( String backupFileName ) throws IOException { copyFile( backupFileName, filename ); }
|
/**
* Call {@link #copyFile(String, String)} method to restore file from backup
*
* @param backupFileName
* @throws IOException
*/
|
Call <code>#copyFile(String, String)</code> method to restore file from backup
|
restoreFileFromBackup
|
{
"repo_name": "IvanNikolaychuk/pentaho-kettle",
"path": "engine/src/org/pentaho/di/shared/SharedObjects.java",
"license": "apache-2.0",
"size": 14327
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 472,964
|
private static String getLegacyCommand(String request) {
if (Command.isLegacyCommand(request)) {
return request;
}
return null;
}
|
static String function(String request) { if (Command.isLegacyCommand(request)) { return request; } return null; }
|
/**
* Check to see if this is a command we support from the legacy shutdown listener.
*/
|
Check to see if this is a command we support from the legacy shutdown listener
|
getLegacyCommand
|
{
"repo_name": "deleidos/digitaledge-platform",
"path": "commons-core/src/main/java/com/deleidos/rtws/commons/net/listener/executor/CommandExecutorFactory.java",
"license": "apache-2.0",
"size": 13823
}
|
[
"com.deleidos.rtws.commons.net.listener.Command"
] |
import com.deleidos.rtws.commons.net.listener.Command;
|
import com.deleidos.rtws.commons.net.listener.*;
|
[
"com.deleidos.rtws"
] |
com.deleidos.rtws;
| 2,473,500
|
public static Test suite()
{
TestSuite suite = new TestSuite();
suite.addTest(new JUnit4TestAdapter(SolrFacetQueriesDisplayHandlersTest.class));
suite.addTest(new JUnit4TestAdapter(SolrFacetServiceImplTest.class));
suite.addTest(new JUnit4TestAdapter(SolrFacetConfigTest.class));
suite.addTest(new JUnit4TestAdapter(SolrFacetComparatorTest.class));
return suite;
}
|
static Test function() { TestSuite suite = new TestSuite(); suite.addTest(new JUnit4TestAdapter(SolrFacetQueriesDisplayHandlersTest.class)); suite.addTest(new JUnit4TestAdapter(SolrFacetServiceImplTest.class)); suite.addTest(new JUnit4TestAdapter(SolrFacetConfigTest.class)); suite.addTest(new JUnit4TestAdapter(SolrFacetComparatorTest.class)); return suite; }
|
/**
* Creates the test suite
*
* @return the test suite
*/
|
Creates the test suite
|
suite
|
{
"repo_name": "Alfresco/alfresco-repository",
"path": "src/test/java/org/alfresco/repo/search/impl/solr/facet/SolrFacetTestSuite.java",
"license": "lgpl-3.0",
"size": 1819
}
|
[
"junit.framework.JUnit4TestAdapter",
"junit.framework.Test",
"junit.framework.TestSuite"
] |
import junit.framework.JUnit4TestAdapter; import junit.framework.Test; import junit.framework.TestSuite;
|
import junit.framework.*;
|
[
"junit.framework"
] |
junit.framework;
| 1,246,533
|
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable<DriveBitLockerKeyInner> list(String jobName, String resourceGroupName, Context context) {
return new PagedIterable<>(listAsync(jobName, resourceGroupName, context));
}
|
@ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable<DriveBitLockerKeyInner> function(String jobName, String resourceGroupName, Context context) { return new PagedIterable<>(listAsync(jobName, resourceGroupName, context)); }
|
/**
* Returns the BitLocker Keys for all drives in the specified job.
*
* @param jobName The name of the import/export job.
* @param resourceGroupName The resource group name uniquely identifies the resource group within the user
* subscription.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return getBitLockerKeys response.
*/
|
Returns the BitLocker Keys for all drives in the specified job
|
list
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/storageimportexport/azure-resourcemanager-storageimportexport/src/main/java/com/azure/resourcemanager/storageimportexport/implementation/BitLockerKeysClientImpl.java",
"license": "mit",
"size": 12066
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.PagedIterable",
"com.azure.core.util.Context",
"com.azure.resourcemanager.storageimportexport.fluent.models.DriveBitLockerKeyInner"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.resourcemanager.storageimportexport.fluent.models.DriveBitLockerKeyInner;
|
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.storageimportexport.fluent.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 1,518,168
|
public Observable<ServiceResponse<PolicyDescriptionCollectionInner>> listByServiceWithServiceResponseAsync(String resourceGroupName, String serviceName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (serviceName == null) {
throw new IllegalArgumentException("Parameter serviceName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
|
Observable<ServiceResponse<PolicyDescriptionCollectionInner>> function(String resourceGroupName, String serviceName) { if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (serviceName == null) { throw new IllegalArgumentException(STR); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException(STR); }
|
/**
* Lists all policy descriptions.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the API Management service.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PolicyDescriptionCollectionInner object
*/
|
Lists all policy descriptions
|
listByServiceWithServiceResponseAsync
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/apimanagement/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/apimanagement/v2019_12_01/implementation/PolicyDescriptionsInner.java",
"license": "mit",
"size": 12637
}
|
[
"com.microsoft.rest.ServiceResponse"
] |
import com.microsoft.rest.ServiceResponse;
|
import com.microsoft.rest.*;
|
[
"com.microsoft.rest"
] |
com.microsoft.rest;
| 2,465,681
|
Iterator<BOp> argIterator();
|
Iterator<BOp> argIterator();
|
/**
* An iterator visiting the operator's arguments.
*/
|
An iterator visiting the operator's arguments
|
argIterator
|
{
"repo_name": "smalyshev/blazegraph",
"path": "bigdata/src/java/com/bigdata/bop/BOp.java",
"license": "gpl-2.0",
"size": 9328
}
|
[
"java.util.Iterator"
] |
import java.util.Iterator;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 29,416
|
public static int binomialCoefficient(int n, int k) {
primes = new ArrayList<>();
counts = new ArrayList<>();
if (n - k < k) {
k = n - k;
}
solve(n - k + 1, n, 1);
solve(1, k, -1);
return calc();
}
|
static int function(int n, int k) { primes = new ArrayList<>(); counts = new ArrayList<>(); if (n - k < k) { k = n - k; } solve(n - k + 1, n, 1); solve(1, k, -1); return calc(); }
|
/**
* Calculates Binomial Coefficient using reducing factorization.
*
* @param n
* @param k
* @return
*/
|
Calculates Binomial Coefficient using reducing factorization
|
binomialCoefficient
|
{
"repo_name": "dzhemriza/fsola",
"path": "src/main/java/org/fsola/introduction/BinomialCoefficientFact.java",
"license": "apache-2.0",
"size": 2718
}
|
[
"java.util.ArrayList"
] |
import java.util.ArrayList;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,489,972
|
public static List<Map<String, String>> mapInput(List<String[]> list, List<ColumnModel> schema){
List<Map<String, String>> results = new LinkedList<>();
for(String[] array: list){
results.add(mapInput(array, schema));
}
return results;
}
|
static List<Map<String, String>> function(List<String[]> list, List<ColumnModel> schema){ List<Map<String, String>> results = new LinkedList<>(); for(String[] array: list){ results.add(mapInput(array, schema)); } return results; }
|
/**
* Helper to translate from value arrays to maps of values.
*
* @param list
* @param schema
* @return
*/
|
Helper to translate from value arrays to maps of values
|
mapInput
|
{
"repo_name": "hhu94/Synapse-Repository-Services",
"path": "lib/lib-test/src/main/java/org/sagebionetworks/repo/model/dbo/dao/table/TableModelTestUtils.java",
"license": "apache-2.0",
"size": 20325
}
|
[
"java.util.LinkedList",
"java.util.List",
"java.util.Map",
"org.sagebionetworks.repo.model.table.ColumnModel"
] |
import java.util.LinkedList; import java.util.List; import java.util.Map; import org.sagebionetworks.repo.model.table.ColumnModel;
|
import java.util.*; import org.sagebionetworks.repo.model.table.*;
|
[
"java.util",
"org.sagebionetworks.repo"
] |
java.util; org.sagebionetworks.repo;
| 1,971,320
|
public void write(byte [] bytes) throws IOException {
write(bytes, 0, bytes.length);
}
|
void function(byte [] bytes) throws IOException { write(bytes, 0, bytes.length); }
|
/**
* Writes a byte array.
* @see #write(byte[], int, int)
*/
|
Writes a byte array
|
write
|
{
"repo_name": "PATRIC3/p3_solr",
"path": "lucene/core/src/java/org/apache/lucene/util/OfflineSorter.java",
"license": "apache-2.0",
"size": 18765
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,904,049
|
public ExecutorService getExecutorService() {
return executorService;
}
|
ExecutorService function() { return executorService; }
|
/**
* Returns the current ExecutorService
* @return the current ExecutorService
*/
|
Returns the current ExecutorService
|
getExecutorService
|
{
"repo_name": "ColaMachine/MyBlock",
"path": "src/main/java/de/matthiasmann/twl/EditFieldAutoCompletionWindow.java",
"license": "bsd-2-clause",
"size": 15348
}
|
[
"java.util.concurrent.ExecutorService"
] |
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.*;
|
[
"java.util"
] |
java.util;
| 105,567
|
private ContextMenu createDateContextMenu() {
ContextMenu menu = new ContextMenu();
MenuItem menuItemRemove = new MenuItem();
menuItemRemove.setText(ResourceUtil.getString(ResourceConstants.MENU_DELETE_IMAGES));
|
ContextMenu function() { ContextMenu menu = new ContextMenu(); MenuItem menuItemRemove = new MenuItem(); menuItemRemove.setText(ResourceUtil.getString(ResourceConstants.MENU_DELETE_IMAGES));
|
/**
* Create the context menu for the date.
*
* @return the context menu.
*/
|
Create the context menu for the date
|
createDateContextMenu
|
{
"repo_name": "jeisfeld/Augendiagnose",
"path": "AugendiagnoseFX/src/de/eisfeldj/augendiagnosefx/fxelements/EyePhotoPairNode.java",
"license": "gpl-2.0",
"size": 7486
}
|
[
"de.eisfeldj.augendiagnosefx.util.ResourceConstants",
"de.eisfeldj.augendiagnosefx.util.ResourceUtil"
] |
import de.eisfeldj.augendiagnosefx.util.ResourceConstants; import de.eisfeldj.augendiagnosefx.util.ResourceUtil;
|
import de.eisfeldj.augendiagnosefx.util.*;
|
[
"de.eisfeldj.augendiagnosefx"
] |
de.eisfeldj.augendiagnosefx;
| 1,855,368
|
public void endBucketCreation(PersistentMemberID newId) {
synchronized(lock) {
if(!atomicCreation) {
if(traceOn()) {
trace(regionPath + " In endBucketCreation - already online, skipping (possible concurrent endBucketCreation");
}
return;
}
if(traceOn()) {
trace(regionPath + " In endBucketCreation - now persisting the id " + newId);
}
atomicCreation = false;
}
super.setOnline(false, true, newId);
}
|
void function(PersistentMemberID newId) { synchronized(lock) { if(!atomicCreation) { if(traceOn()) { trace(regionPath + STR); } return; } if(traceOn()) { trace(regionPath + STR + newId); } atomicCreation = false; } super.setOnline(false, true, newId); }
|
/** Finish the atomic creation of this bucket on multiple members
* This method is called with the proxy bucket synchronized.
*/
|
Finish the atomic creation of this bucket on multiple members This method is called with the proxy bucket synchronized
|
endBucketCreation
|
{
"repo_name": "gemxd/gemfirexd-oss",
"path": "gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/BucketPersistenceAdvisor.java",
"license": "apache-2.0",
"size": 16300
}
|
[
"com.gemstone.gemfire.internal.cache.persistence.PersistentMemberID"
] |
import com.gemstone.gemfire.internal.cache.persistence.PersistentMemberID;
|
import com.gemstone.gemfire.internal.cache.persistence.*;
|
[
"com.gemstone.gemfire"
] |
com.gemstone.gemfire;
| 2,896,909
|
public void saveFolder(
OCFile folder, Collection<OCFile> updatedFiles, Collection<OCFile> filesToRemove
) {
Log_OC.d(TAG, "Saving folder " + folder.getRemotePath() + " with " + updatedFiles.size()
+ " children and " + filesToRemove.size() + " files to remove");
ArrayList<ContentProviderOperation> operations =
new ArrayList<ContentProviderOperation>(updatedFiles.size());
// prepare operations to insert or update files to save in the given folder
for (OCFile file : updatedFiles) {
ContentValues cv = new ContentValues();
cv.put(ProviderTableMeta.FILE_MODIFIED, file.getModificationTimestamp());
cv.put(
ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA,
file.getModificationTimestampAtLastSyncForData()
);
cv.put(ProviderTableMeta.FILE_CREATION, file.getCreationTimestamp());
cv.put(ProviderTableMeta.FILE_CONTENT_LENGTH, file.getFileLength());
cv.put(ProviderTableMeta.FILE_CONTENT_TYPE, file.getMimetype());
cv.put(ProviderTableMeta.FILE_NAME, file.getFileName());
cv.put(ProviderTableMeta.FILE_PARENT, folder.getFileId());
cv.put(ProviderTableMeta.FILE_PATH, file.getRemotePath());
if (!file.isFolder()) {
cv.put(ProviderTableMeta.FILE_STORAGE_PATH, file.getStoragePath());
}
cv.put(ProviderTableMeta.FILE_ACCOUNT_OWNER, mAccount.name);
cv.put(ProviderTableMeta.FILE_LAST_SYNC_DATE, file.getLastSyncDateForProperties());
cv.put(ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA, file.getLastSyncDateForData());
cv.put(ProviderTableMeta.FILE_ETAG, file.getEtag());
cv.put(ProviderTableMeta.FILE_TREE_ETAG, file.getTreeEtag());
cv.put(ProviderTableMeta.FILE_SHARED_VIA_LINK, file.isSharedViaLink() ? 1 : 0);
cv.put(ProviderTableMeta.FILE_SHARED_WITH_SHAREE, file.isSharedWithSharee() ? 1 : 0);
cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, file.getPublicLink());
cv.put(ProviderTableMeta.FILE_PERMISSIONS, file.getPermissions());
cv.put(ProviderTableMeta.FILE_REMOTE_ID, file.getRemoteId());
cv.put(ProviderTableMeta.FILE_UPDATE_THUMBNAIL, file.needsUpdateThumbnail());
cv.put(ProviderTableMeta.FILE_IS_DOWNLOADING, file.isDownloading());
cv.put(ProviderTableMeta.FILE_ETAG_IN_CONFLICT, file.getEtagInConflict());
boolean existsByPath = fileExists(file.getRemotePath());
if (existsByPath || fileExists(file.getFileId())) {
// updating an existing file
operations.add(ContentProviderOperation.newUpdate(ProviderTableMeta.CONTENT_URI).
withValues(cv).
withSelection(ProviderTableMeta._ID + "=?",
new String[]{String.valueOf(file.getFileId())})
.build());
} else {
// adding a new file
setInitialAvailableOfflineStatus(file, cv);
operations.add(ContentProviderOperation.newInsert(ProviderTableMeta.CONTENT_URI).
withValues(cv).build());
}
}
// prepare operations to remove files in the given folder
String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?" + " AND " +
ProviderTableMeta.FILE_PATH + "=?";
String [] whereArgs = null;
for (OCFile file : filesToRemove) {
if (file.getParentId() == folder.getFileId()) {
whereArgs = new String[]{mAccount.name, file.getRemotePath()};
if (file.isFolder()) {
operations.add(ContentProviderOperation.newDelete(
ContentUris.withAppendedId(
ProviderTableMeta.CONTENT_URI_DIR, file.getFileId()
)
).withSelection(where, whereArgs).build());
File localFolder =
new File(FileStorageUtils.getDefaultSavePathFor(mAccount.name, file));
if (localFolder.exists()) {
removeLocalFolder(localFolder);
}
} else {
operations.add(ContentProviderOperation.newDelete(
ContentUris.withAppendedId(
ProviderTableMeta.CONTENT_URI_FILE, file.getFileId()
)
).withSelection(where, whereArgs).build());
if (file.isDown()) {
String path = file.getStoragePath();
new File(path).delete();
triggerMediaScan(path); // notify MediaScanner about removed file
}
}
}
}
// update metadata of folder
ContentValues cv = new ContentValues();
cv.put(ProviderTableMeta.FILE_MODIFIED, folder.getModificationTimestamp());
cv.put(
ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA,
folder.getModificationTimestampAtLastSyncForData()
);
cv.put(ProviderTableMeta.FILE_CREATION, folder.getCreationTimestamp());
cv.put(ProviderTableMeta.FILE_CONTENT_LENGTH, folder.getFileLength());
cv.put(ProviderTableMeta.FILE_CONTENT_TYPE, folder.getMimetype());
cv.put(ProviderTableMeta.FILE_NAME, folder.getFileName());
cv.put(ProviderTableMeta.FILE_PARENT, folder.getParentId());
cv.put(ProviderTableMeta.FILE_PATH, folder.getRemotePath());
cv.put(ProviderTableMeta.FILE_ACCOUNT_OWNER, mAccount.name);
cv.put(ProviderTableMeta.FILE_LAST_SYNC_DATE, folder.getLastSyncDateForProperties());
cv.put(ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA, folder.getLastSyncDateForData());
cv.put(ProviderTableMeta.FILE_ETAG, folder.getEtag());
cv.put(ProviderTableMeta.FILE_TREE_ETAG, folder.getTreeEtag());
cv.put(ProviderTableMeta.FILE_SHARED_VIA_LINK, folder.isSharedViaLink() ? 1 : 0);
cv.put(ProviderTableMeta.FILE_SHARED_WITH_SHAREE, folder.isSharedWithSharee() ? 1 : 0);
cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, folder.getPublicLink());
cv.put(ProviderTableMeta.FILE_PERMISSIONS, folder.getPermissions());
cv.put(ProviderTableMeta.FILE_REMOTE_ID, folder.getRemoteId());
operations.add(ContentProviderOperation.newUpdate(ProviderTableMeta.CONTENT_URI).
withValues(cv).
withSelection(ProviderTableMeta._ID + "=?",
new String[]{String.valueOf(folder.getFileId())})
.build());
// apply operations in batch
ContentProviderResult[] results = null;
Log_OC.d(TAG, "Sending " + operations.size() + " operations to FileContentProvider");
try {
if (getContentResolver() != null) {
results = getContentResolver().applyBatch(MainApp.getAuthority(), operations);
} else {
results = getContentProviderClient().applyBatch(operations);
}
} catch (OperationApplicationException e) {
Log_OC.e(TAG, "Exception in batch of operations " + e.getMessage());
} catch (RemoteException e) {
Log_OC.e(TAG, "Exception in batch of operations " + e.getMessage());
}
// update new id in file objects for insertions
if (results != null) {
long newId;
Iterator<OCFile> filesIt = updatedFiles.iterator();
OCFile file = null;
for (int i = 0; i < results.length; i++) {
if (filesIt.hasNext()) {
file = filesIt.next();
} else {
file = null;
}
if (results[i].uri != null) {
newId = Long.parseLong(results[i].uri.getPathSegments().get(1));
//updatedFiles.get(i).setFileId(newId);
if (file != null) {
file.setFileId(newId);
}
}
}
}
}
|
void function( OCFile folder, Collection<OCFile> updatedFiles, Collection<OCFile> filesToRemove ) { Log_OC.d(TAG, STR + folder.getRemotePath() + STR + updatedFiles.size() + STR + filesToRemove.size() + STR); ArrayList<ContentProviderOperation> operations = new ArrayList<ContentProviderOperation>(updatedFiles.size()); for (OCFile file : updatedFiles) { ContentValues cv = new ContentValues(); cv.put(ProviderTableMeta.FILE_MODIFIED, file.getModificationTimestamp()); cv.put( ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA, file.getModificationTimestampAtLastSyncForData() ); cv.put(ProviderTableMeta.FILE_CREATION, file.getCreationTimestamp()); cv.put(ProviderTableMeta.FILE_CONTENT_LENGTH, file.getFileLength()); cv.put(ProviderTableMeta.FILE_CONTENT_TYPE, file.getMimetype()); cv.put(ProviderTableMeta.FILE_NAME, file.getFileName()); cv.put(ProviderTableMeta.FILE_PARENT, folder.getFileId()); cv.put(ProviderTableMeta.FILE_PATH, file.getRemotePath()); if (!file.isFolder()) { cv.put(ProviderTableMeta.FILE_STORAGE_PATH, file.getStoragePath()); } cv.put(ProviderTableMeta.FILE_ACCOUNT_OWNER, mAccount.name); cv.put(ProviderTableMeta.FILE_LAST_SYNC_DATE, file.getLastSyncDateForProperties()); cv.put(ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA, file.getLastSyncDateForData()); cv.put(ProviderTableMeta.FILE_ETAG, file.getEtag()); cv.put(ProviderTableMeta.FILE_TREE_ETAG, file.getTreeEtag()); cv.put(ProviderTableMeta.FILE_SHARED_VIA_LINK, file.isSharedViaLink() ? 1 : 0); cv.put(ProviderTableMeta.FILE_SHARED_WITH_SHAREE, file.isSharedWithSharee() ? 1 : 0); cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, file.getPublicLink()); cv.put(ProviderTableMeta.FILE_PERMISSIONS, file.getPermissions()); cv.put(ProviderTableMeta.FILE_REMOTE_ID, file.getRemoteId()); cv.put(ProviderTableMeta.FILE_UPDATE_THUMBNAIL, file.needsUpdateThumbnail()); cv.put(ProviderTableMeta.FILE_IS_DOWNLOADING, file.isDownloading()); cv.put(ProviderTableMeta.FILE_ETAG_IN_CONFLICT, file.getEtagInConflict()); boolean existsByPath = fileExists(file.getRemotePath()); if (existsByPath fileExists(file.getFileId())) { operations.add(ContentProviderOperation.newUpdate(ProviderTableMeta.CONTENT_URI). withValues(cv). withSelection(ProviderTableMeta._ID + "=?", new String[]{String.valueOf(file.getFileId())}) .build()); } else { setInitialAvailableOfflineStatus(file, cv); operations.add(ContentProviderOperation.newInsert(ProviderTableMeta.CONTENT_URI). withValues(cv).build()); } } String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?" + STR + ProviderTableMeta.FILE_PATH + "=?"; String [] whereArgs = null; for (OCFile file : filesToRemove) { if (file.getParentId() == folder.getFileId()) { whereArgs = new String[]{mAccount.name, file.getRemotePath()}; if (file.isFolder()) { operations.add(ContentProviderOperation.newDelete( ContentUris.withAppendedId( ProviderTableMeta.CONTENT_URI_DIR, file.getFileId() ) ).withSelection(where, whereArgs).build()); File localFolder = new File(FileStorageUtils.getDefaultSavePathFor(mAccount.name, file)); if (localFolder.exists()) { removeLocalFolder(localFolder); } } else { operations.add(ContentProviderOperation.newDelete( ContentUris.withAppendedId( ProviderTableMeta.CONTENT_URI_FILE, file.getFileId() ) ).withSelection(where, whereArgs).build()); if (file.isDown()) { String path = file.getStoragePath(); new File(path).delete(); triggerMediaScan(path); } } } } ContentValues cv = new ContentValues(); cv.put(ProviderTableMeta.FILE_MODIFIED, folder.getModificationTimestamp()); cv.put( ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA, folder.getModificationTimestampAtLastSyncForData() ); cv.put(ProviderTableMeta.FILE_CREATION, folder.getCreationTimestamp()); cv.put(ProviderTableMeta.FILE_CONTENT_LENGTH, folder.getFileLength()); cv.put(ProviderTableMeta.FILE_CONTENT_TYPE, folder.getMimetype()); cv.put(ProviderTableMeta.FILE_NAME, folder.getFileName()); cv.put(ProviderTableMeta.FILE_PARENT, folder.getParentId()); cv.put(ProviderTableMeta.FILE_PATH, folder.getRemotePath()); cv.put(ProviderTableMeta.FILE_ACCOUNT_OWNER, mAccount.name); cv.put(ProviderTableMeta.FILE_LAST_SYNC_DATE, folder.getLastSyncDateForProperties()); cv.put(ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA, folder.getLastSyncDateForData()); cv.put(ProviderTableMeta.FILE_ETAG, folder.getEtag()); cv.put(ProviderTableMeta.FILE_TREE_ETAG, folder.getTreeEtag()); cv.put(ProviderTableMeta.FILE_SHARED_VIA_LINK, folder.isSharedViaLink() ? 1 : 0); cv.put(ProviderTableMeta.FILE_SHARED_WITH_SHAREE, folder.isSharedWithSharee() ? 1 : 0); cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, folder.getPublicLink()); cv.put(ProviderTableMeta.FILE_PERMISSIONS, folder.getPermissions()); cv.put(ProviderTableMeta.FILE_REMOTE_ID, folder.getRemoteId()); operations.add(ContentProviderOperation.newUpdate(ProviderTableMeta.CONTENT_URI). withValues(cv). withSelection(ProviderTableMeta._ID + "=?", new String[]{String.valueOf(folder.getFileId())}) .build()); ContentProviderResult[] results = null; Log_OC.d(TAG, STR + operations.size() + STR); try { if (getContentResolver() != null) { results = getContentResolver().applyBatch(MainApp.getAuthority(), operations); } else { results = getContentProviderClient().applyBatch(operations); } } catch (OperationApplicationException e) { Log_OC.e(TAG, STR + e.getMessage()); } catch (RemoteException e) { Log_OC.e(TAG, STR + e.getMessage()); } if (results != null) { long newId; Iterator<OCFile> filesIt = updatedFiles.iterator(); OCFile file = null; for (int i = 0; i < results.length; i++) { if (filesIt.hasNext()) { file = filesIt.next(); } else { file = null; } if (results[i].uri != null) { newId = Long.parseLong(results[i].uri.getPathSegments().get(1)); if (file != null) { file.setFileId(newId); } } } } }
|
/**
* Inserts or updates the list of files contained in a given folder.
* <p/>
* CALLER IS THE RESPONSIBLE FOR GRANTING RIGHT UPDATE OF INFORMATION, NOT THIS METHOD.
* HERE ONLY DATA CONSISTENCY SHOULD BE GRANTED
*
* @param folder
* @param updatedFiles
* @param filesToRemove
*/
|
Inserts or updates the list of files contained in a given folder. CALLER IS THE RESPONSIBLE FOR GRANTING RIGHT UPDATE OF INFORMATION, NOT THIS METHOD. HERE ONLY DATA CONSISTENCY SHOULD BE GRANTED
|
saveFolder
|
{
"repo_name": "PauloSantos13/android",
"path": "src/com/owncloud/android/datamodel/FileDataStorageManager.java",
"license": "gpl-2.0",
"size": 102959
}
|
[
"android.content.ContentProviderOperation",
"android.content.ContentProviderResult",
"android.content.ContentUris",
"android.content.ContentValues",
"android.content.OperationApplicationException",
"android.os.RemoteException",
"com.owncloud.android.MainApp",
"com.owncloud.android.db.ProviderMeta",
"com.owncloud.android.utils.FileStorageUtils",
"java.io.File",
"java.util.ArrayList",
"java.util.Collection",
"java.util.Iterator"
] |
import android.content.ContentProviderOperation; import android.content.ContentProviderResult; import android.content.ContentUris; import android.content.ContentValues; import android.content.OperationApplicationException; import android.os.RemoteException; import com.owncloud.android.MainApp; import com.owncloud.android.db.ProviderMeta; import com.owncloud.android.utils.FileStorageUtils; import java.io.File; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator;
|
import android.content.*; import android.os.*; import com.owncloud.android.*; import com.owncloud.android.db.*; import com.owncloud.android.utils.*; import java.io.*; import java.util.*;
|
[
"android.content",
"android.os",
"com.owncloud.android",
"java.io",
"java.util"
] |
android.content; android.os; com.owncloud.android; java.io; java.util;
| 1,994,519
|
private static void updateAPIWithCertificate(JsonElement certificate, APIProvider apiProvider, API importedApi,
int tenantId) {
String certificateContent = certificate.getAsJsonObject()
.get(APIImportExportConstants.CERTIFICATE_CONTENT_JSON_KEY).getAsString();
String alias = certificate.getAsJsonObject().get(APIImportExportConstants.ALIAS_JSON_KEY).getAsString();
String endpoint = certificate.getAsJsonObject().get(APIImportExportConstants.HOSTNAME_JSON_KEY)
.getAsString();
try {
if (apiProvider.isCertificatePresent(tenantId, alias)
|| (ResponseCode.ALIAS_EXISTS_IN_TRUST_STORE.getResponseCode() ==
(apiProvider.addCertificate(APIUtil.replaceEmailDomainBack(importedApi.getId().getProviderName()),
certificateContent, alias, endpoint)))) {
apiProvider.updateCertificate(certificateContent, alias);
}
} catch (APIManagementException e) {
String errorMessage = "Error while importing certificate endpoint [" + endpoint + " ]" + "alias ["
+ alias + " ] tenant user ["
+ APIUtil.replaceEmailDomainBack(importedApi.getId().getProviderName()) + "]";
log.error(errorMessage, e);
}
}
|
static void function(JsonElement certificate, APIProvider apiProvider, API importedApi, int tenantId) { String certificateContent = certificate.getAsJsonObject() .get(APIImportExportConstants.CERTIFICATE_CONTENT_JSON_KEY).getAsString(); String alias = certificate.getAsJsonObject().get(APIImportExportConstants.ALIAS_JSON_KEY).getAsString(); String endpoint = certificate.getAsJsonObject().get(APIImportExportConstants.HOSTNAME_JSON_KEY) .getAsString(); try { if (apiProvider.isCertificatePresent(tenantId, alias) (ResponseCode.ALIAS_EXISTS_IN_TRUST_STORE.getResponseCode() == (apiProvider.addCertificate(APIUtil.replaceEmailDomainBack(importedApi.getId().getProviderName()), certificateContent, alias, endpoint)))) { apiProvider.updateCertificate(certificateContent, alias); } } catch (APIManagementException e) { String errorMessage = STR + endpoint + STR + STR + alias + STR + APIUtil.replaceEmailDomainBack(importedApi.getId().getProviderName()) + "]"; log.error(errorMessage, e); } }
|
/**
* Update API with the certificate. If certificate alias is already exists for tenant, cert will be added and if
* the certificate is already exists is in trust store, this method will update the cert in trust store.
*
* @param certificate Certificate JSON element
* @param apiProvider API Provider
* @param importedApi API to import
* @param tenantId Tenant Id
*/
|
Update API with the certificate. If certificate alias is already exists for tenant, cert will be added and if the certificate is already exists is in trust store, this method will update the cert in trust store
|
updateAPIWithCertificate
|
{
"repo_name": "pubudu538/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/importexport/utils/APIImportUtil.java",
"license": "apache-2.0",
"size": 45409
}
|
[
"com.google.gson.JsonElement",
"org.wso2.carbon.apimgt.api.APIManagementException",
"org.wso2.carbon.apimgt.api.APIProvider",
"org.wso2.carbon.apimgt.impl.certificatemgt.ResponseCode",
"org.wso2.carbon.apimgt.impl.importexport.APIImportExportConstants",
"org.wso2.carbon.apimgt.impl.utils.APIUtil"
] |
import com.google.gson.JsonElement; import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.api.APIProvider; import org.wso2.carbon.apimgt.impl.certificatemgt.ResponseCode; import org.wso2.carbon.apimgt.impl.importexport.APIImportExportConstants; import org.wso2.carbon.apimgt.impl.utils.APIUtil;
|
import com.google.gson.*; import org.wso2.carbon.apimgt.api.*; import org.wso2.carbon.apimgt.impl.certificatemgt.*; import org.wso2.carbon.apimgt.impl.importexport.*; import org.wso2.carbon.apimgt.impl.utils.*;
|
[
"com.google.gson",
"org.wso2.carbon"
] |
com.google.gson; org.wso2.carbon;
| 1,591,196
|
public Cursor getAllAlarmClocks() {
SQLiteDatabase db = this.getReadableDatabase();
return db.rawQuery("SELECT * FROM " + AlarmClockTable.TABLE_NAME, null);
}
|
Cursor function() { SQLiteDatabase db = this.getReadableDatabase(); return db.rawQuery(STR + AlarmClockTable.TABLE_NAME, null); }
|
/**
* Returns a list of all alarm clocks currently in the database, active or not.
* @return A list of all alarm clocks currently existing in the database.
*/
|
Returns a list of all alarm clocks currently in the database, active or not
|
getAllAlarmClocks
|
{
"repo_name": "GedderAlarm/GedderAlarm",
"path": "app/src/main/java/com/gedder/gedderalarm/db/AlarmClockDBHelper.java",
"license": "apache-2.0",
"size": 9370
}
|
[
"android.database.Cursor",
"android.database.sqlite.SQLiteDatabase",
"com.gedder.gedderalarm.db.AlarmClockDBSchema"
] |
import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import com.gedder.gedderalarm.db.AlarmClockDBSchema;
|
import android.database.*; import android.database.sqlite.*; import com.gedder.gedderalarm.db.*;
|
[
"android.database",
"com.gedder.gedderalarm"
] |
android.database; com.gedder.gedderalarm;
| 947,255
|
@Test(expected = SetUpException.class)
public void testNotExistingPropertyFile() throws SetUpException {
new Configuration(new File("testdata/configs/not_existing.properties"));
}
|
@Test(expected = SetUpException.class) void function() throws SetUpException { new Configuration(new File(STR)); }
|
/**
* Tests if configuration fails if no valid properties file is passed to constructor.
*
* @throws SetUpException
* wanted.
*/
|
Tests if configuration fails if no valid properties file is passed to constructor
|
testNotExistingPropertyFile
|
{
"repo_name": "KernelHaven/KernelHaven",
"path": "test/net/ssehub/kernel_haven/config/OldConfigurationTest.java",
"license": "apache-2.0",
"size": 11781
}
|
[
"java.io.File",
"net.ssehub.kernel_haven.SetUpException",
"org.junit.Test"
] |
import java.io.File; import net.ssehub.kernel_haven.SetUpException; import org.junit.Test;
|
import java.io.*; import net.ssehub.kernel_haven.*; import org.junit.*;
|
[
"java.io",
"net.ssehub.kernel_haven",
"org.junit"
] |
java.io; net.ssehub.kernel_haven; org.junit;
| 731,518
|
@Override
public void setStartTime(Date value) {
set(1, value);
}
|
void function(Date value) { set(1, value); }
|
/**
* Setter for <code>cattle.process_instance.start_time</code>.
*/
|
Setter for <code>cattle.process_instance.start_time</code>
|
setStartTime
|
{
"repo_name": "rancherio/cattle",
"path": "modules/model/src/main/java/io/cattle/platform/core/model/tables/records/ProcessInstanceRecord.java",
"license": "apache-2.0",
"size": 20077
}
|
[
"java.util.Date"
] |
import java.util.Date;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,773,244
|
@Override
public void doTag() throws JspException, IOException {
parent = (DisclosureTag) getParent();
if (parent == null) {
throw new JspException(
"<disclosureHead> element can be only inside <disclosure> element");
}
JspWriter out = getJspContext().getOut();
out.write("<div");
printStyleAndClass(out);
out.write("><a href=\"");
out.write(getLink());
out.write("\">");
String imgSrc;
if (parent.getOpened()) {
imgSrc = "images/disclosed.gif";
} else {
imgSrc = "images/undisclosed.gif";
}
out.write("<img border=\"0\" src=\"" + imgSrc + "\" alt=\"-\" id=\""
+ parent.getId() + "Toggle\" />");
out.write("</a>");
getJspBody().invoke(null);
out.write("</div>");
}
|
void function() throws JspException, IOException { parent = (DisclosureTag) getParent(); if (parent == null) { throw new JspException( STR); } JspWriter out = getJspContext().getOut(); out.write("<div"); printStyleAndClass(out); out.write(STRSTR\">"); String imgSrc; if (parent.getOpened()) { imgSrc = STR; } else { imgSrc = STR; } out.write(STR0\STRSTR\STR-\STRSTRToggle\STR); out.write("</a>"); getJspBody().invoke(null); out.write(STR); }
|
/**
* Renders tag.
* @throws JspException if element is not inside <disclosure> element
* @throws IOException if error occurs during writing to stream output
*/
|
Renders tag
|
doTag
|
{
"repo_name": "JoeCarlson/intermine",
"path": "intermine/web/main/src/org/intermine/web/tags/disclosure/DisclosureHeadTag.java",
"license": "lgpl-2.1",
"size": 2099
}
|
[
"java.io.IOException",
"javax.servlet.jsp.JspException",
"javax.servlet.jsp.JspWriter"
] |
import java.io.IOException; import javax.servlet.jsp.JspException; import javax.servlet.jsp.JspWriter;
|
import java.io.*; import javax.servlet.jsp.*;
|
[
"java.io",
"javax.servlet"
] |
java.io; javax.servlet;
| 453,347
|
protected void initConfig() throws MalformedURLException {
int urlIndex = configName.indexOf("://");
PropertiesBuilderParameters params = new Parameters().properties();
if (urlIndex > 0) {
params.setURL(new URL(configName));
} else {
URL configResource = getClass().getResource("/" + configName);
if (configResource != null) {
params.setURL(configResource);
} else {
params.setFileName(configName);
}
}
if (refDelay > 0) {
params.setReloadingRefreshDelay(refDelay);
ReloadingFileBasedConfigurationBuilder<PropertiesConfiguration> builder = new ReloadingFileBasedConfigurationBuilder<>(PropertiesConfiguration.class);
builder.configure(params);
cfgReloadTrigger = new PeriodicReloadingTrigger(builder.getReloadingController(), null, refDelay, TimeUnit.MILLISECONDS);
config = builder;
} else {
config = new FileBasedConfigurationBuilder<>(PropertiesConfiguration.class);
config.configure(params);
}
}
|
void function() throws MalformedURLException { int urlIndex = configName.indexOf(STR/" + configName); if (configResource != null) { params.setURL(configResource); } else { params.setFileName(configName); } } if (refDelay > 0) { params.setReloadingRefreshDelay(refDelay); ReloadingFileBasedConfigurationBuilder<PropertiesConfiguration> builder = new ReloadingFileBasedConfigurationBuilder<>(PropertiesConfiguration.class); builder.configure(params); cfgReloadTrigger = new PeriodicReloadingTrigger(builder.getReloadingController(), null, refDelay, TimeUnit.MILLISECONDS); config = builder; } else { config = new FileBasedConfigurationBuilder<>(PropertiesConfiguration.class); config.configure(params); } }
|
/**
* Initialize property configuration based on a configured configuration file name. The method attempts to load it
* from URL if given config is URL, then load it from class path and then from file system.
*
* @throws MalformedURLException
* if malformed configuration file name
*/
|
Initialize property configuration based on a configured configuration file name. The method attempts to load it from URL if given config is URL, then load it from class path and then from file system
|
initConfig
|
{
"repo_name": "Nastel/TNT4J",
"path": "tnt4j-core/src/main/java/com/jkoolcloud/tnt4j/repository/FileTokenRepository.java",
"license": "apache-2.0",
"size": 12119
}
|
[
"java.net.MalformedURLException",
"java.util.concurrent.TimeUnit",
"org.apache.commons.configuration2.PropertiesConfiguration",
"org.apache.commons.configuration2.builder.FileBasedConfigurationBuilder",
"org.apache.commons.configuration2.builder.ReloadingFileBasedConfigurationBuilder",
"org.apache.commons.configuration2.reloading.PeriodicReloadingTrigger"
] |
import java.net.MalformedURLException; import java.util.concurrent.TimeUnit; import org.apache.commons.configuration2.PropertiesConfiguration; import org.apache.commons.configuration2.builder.FileBasedConfigurationBuilder; import org.apache.commons.configuration2.builder.ReloadingFileBasedConfigurationBuilder; import org.apache.commons.configuration2.reloading.PeriodicReloadingTrigger;
|
import java.net.*; import java.util.concurrent.*; import org.apache.commons.configuration2.*; import org.apache.commons.configuration2.builder.*; import org.apache.commons.configuration2.reloading.*;
|
[
"java.net",
"java.util",
"org.apache.commons"
] |
java.net; java.util; org.apache.commons;
| 647,587
|
void preMergeCommit(final ObserverContext<RegionServerCoprocessorEnvironment> ctx,
final HRegion regionA, final HRegion regionB,
@MetaMutationAnnotation List<Mutation> metaEntries) throws IOException;
|
void preMergeCommit(final ObserverContext<RegionServerCoprocessorEnvironment> ctx, final HRegion regionA, final HRegion regionB, @MetaMutationAnnotation List<Mutation> metaEntries) throws IOException;
|
/**
* This will be called before PONR step as part of regions merge transaction. Calling
* {@link org.apache.hadoop.hbase.coprocessor.ObserverContext#bypass()} rollback the merge
* @param ctx
* @param regionA
* @param regionB
* @param metaEntries mutations to execute on hbase:meta atomically with regions merge updates.
* Any puts or deletes to execute on hbase:meta can be added to the mutations.
* @throws IOException
*/
|
This will be called before PONR step as part of regions merge transaction. Calling <code>org.apache.hadoop.hbase.coprocessor.ObserverContext#bypass()</code> rollback the merge
|
preMergeCommit
|
{
"repo_name": "Jackygq1982/hbase_src",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionServerObserver.java",
"license": "apache-2.0",
"size": 4630
}
|
[
"java.io.IOException",
"java.util.List",
"org.apache.hadoop.hbase.MetaMutationAnnotation",
"org.apache.hadoop.hbase.client.Mutation",
"org.apache.hadoop.hbase.regionserver.HRegion"
] |
import java.io.IOException; import java.util.List; import org.apache.hadoop.hbase.MetaMutationAnnotation; import org.apache.hadoop.hbase.client.Mutation; import org.apache.hadoop.hbase.regionserver.HRegion;
|
import java.io.*; import java.util.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.regionserver.*;
|
[
"java.io",
"java.util",
"org.apache.hadoop"
] |
java.io; java.util; org.apache.hadoop;
| 1,797,060
|
private static DefaultMutableTreeNode getNodeFor_In(Object userObject, DefaultMutableTreeNode parent) {
// Loop through the parent's children
Enumeration<?> enumeration = parent.children();
while (enumeration.hasMoreElements()) {
DefaultMutableTreeNode eachNode = (DefaultMutableTreeNode)enumeration.nextElement();
if (eachNode.getUserObject() == userObject ||
userObject instanceof String && ((String) userObject).equals(eachNode.getUserObject()) )
return eachNode;
}
return null;
}
|
static DefaultMutableTreeNode function(Object userObject, DefaultMutableTreeNode parent) { Enumeration<?> enumeration = parent.children(); while (enumeration.hasMoreElements()) { DefaultMutableTreeNode eachNode = (DefaultMutableTreeNode)enumeration.nextElement(); if (eachNode.getUserObject() == userObject userObject instanceof String && ((String) userObject).equals(eachNode.getUserObject()) ) return eachNode; } return null; }
|
/**
* Returns a tree node for the specified userObject in the specified parent.
* If a node, already exists for this parent, it is returned. If it does
* not exist, then null is returned.
* @param userObject - object for the tree node.
* @param parent - object's parent
* @return tree node for the object.
*/
|
Returns a tree node for the specified userObject in the specified parent. If a node, already exists for this parent, it is returned. If it does not exist, then null is returned
|
getNodeFor_In
|
{
"repo_name": "jaamsim/jaamsim",
"path": "src/main/java/com/jaamsim/ui/ObjectSelector.java",
"license": "apache-2.0",
"size": 17989
}
|
[
"java.util.Enumeration",
"javax.swing.tree.DefaultMutableTreeNode"
] |
import java.util.Enumeration; import javax.swing.tree.DefaultMutableTreeNode;
|
import java.util.*; import javax.swing.tree.*;
|
[
"java.util",
"javax.swing"
] |
java.util; javax.swing;
| 2,163,464
|
private void myInitComponents(){
//set the favicon --> logo of app at top-left of window
setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("img/iconHead.png")));
if(!user_two.equals("(Group Chat)")) //group conversation
setTitle("Conversation of " + user_one + " with " + user_two);
else //one to one conversation
setTitle("Group conversation " + user_one);
loadConversationHistory(GuiHandler.getInstance().fetchTextConversationHistory(convID, getUserID(user_one)),GuiHandler.getInstance().fetchFileConversationHistory(convID, getUserID(user_one) ));
}
|
void function(){ setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(STR))); if(!user_two.equals(STR)) setTitle(STR + user_one + STR + user_two); else setTitle(STR + user_one); loadConversationHistory(GuiHandler.getInstance().fetchTextConversationHistory(convID, getUserID(user_one)),GuiHandler.getInstance().fetchFileConversationHistory(convID, getUserID(user_one) )); }
|
/**
* Provides modifications written by us.
*/
|
Provides modifications written by us
|
myInitComponents
|
{
"repo_name": "spapadop/LetsTalkClient",
"path": "src/se/bth/swatkats/letstalk/gui/CallRecords.java",
"license": "gpl-3.0",
"size": 16374
}
|
[
"java.awt.Toolkit",
"se.bth.swatkats.letstalk.connection.GuiHandler"
] |
import java.awt.Toolkit; import se.bth.swatkats.letstalk.connection.GuiHandler;
|
import java.awt.*; import se.bth.swatkats.letstalk.connection.*;
|
[
"java.awt",
"se.bth.swatkats"
] |
java.awt; se.bth.swatkats;
| 2,419,195
|
ArrayList<Route> routes = new ArrayList<>();
// turn the stream into a string
final String result = convertStreamToString(this.getInputStream());
if (result == null) return null;
try {
//Tranform the string into a json object
final JSONObject json = new JSONObject(result);
//Get the route object
JSONArray jsonRoutes = json.getJSONArray("routes");
for (int i = 0; i < jsonRoutes.length(); i++) {
Route route = new Route();
//Create an empty segment
Segment segment = new Segment();
JSONObject jsonRoute = jsonRoutes.getJSONObject(i);
//Get the bounds - northeast and southwest
final JSONObject jsonBounds = jsonRoute.getJSONObject("bounds");
final JSONObject jsonNortheast = jsonBounds.getJSONObject("northeast");
final JSONObject jsonSouthwest = jsonBounds.getJSONObject("southwest");
route.setLatLgnBounds(new LatLng(jsonNortheast.getDouble("lat"), jsonNortheast.getDouble("lng")), new LatLng(jsonSouthwest.getDouble("lat"), jsonSouthwest.getDouble("lng")));
//Get the leg, only one leg as we don't support waypoints
final JSONObject leg = jsonRoute.getJSONArray("legs").getJSONObject(0);
//Get the steps for this leg
final JSONArray steps = leg.getJSONArray("steps");
//Number of steps for use in for loop
final int numSteps = steps.length();
//Set the name of this route using the start & end addresses
route.setName(leg.getString("start_address") + " to " + leg.getString("end_address"));
//Get google's copyright notice (tos requirement)
route.setCopyright(jsonRoute.getString("copyrights"));
//Get distance and time estimation
route.setDurationText(leg.getJSONObject("duration").getString("text"));
route.setDurationValue(leg.getJSONObject("duration").getInt("value"));
route.setDistanceText(leg.getJSONObject("distance").getString("text"));
route.setDistanceValue(leg.getJSONObject("distance").getInt("value"));
route.setEndAddressText(leg.getString("end_address"));
//Get the total length of the route.
route.setLength(leg.getJSONObject("distance").getInt("value"));
//Get any warnings provided (tos requirement)
if (!jsonRoute.getJSONArray("warnings").isNull(0)) {
route.setWarning(jsonRoute.getJSONArray("warnings").getString(0));
}
for (int y = 0; y < numSteps; y++) {
//Get the individual step
final JSONObject step = steps.getJSONObject(y);
//Get the start position for this step and set it on the segment
final JSONObject start = step.getJSONObject("start_location");
final LatLng position = new LatLng(start.getDouble("lat"),
start.getDouble("lng"));
segment.setPoint(position);
//Set the length of this segment in metres
final int length = step.getJSONObject("distance").getInt("value");
distance += length;
segment.setLength(length);
segment.setDistance((double)distance / (double)1000);
//Strip html from google directions and set as turn instruction
segment.setInstruction(step.getString("html_instructions").replaceAll("<(.*?)*>", ""));
//Retrieve & decode this segment's polyline and add it to the route.
route.addPoints(decodePolyLine(step.getJSONObject("polyline").getString("points")));
//Push a copy of the segment to the route
route.addSegment(segment.copy());
}
routes.add(route);
}
} catch (JSONException e) {
Log.e("Routing Error", e.getMessage());
return null;
}
return routes;
}
|
ArrayList<Route> routes = new ArrayList<>(); final String result = convertStreamToString(this.getInputStream()); if (result == null) return null; try { final JSONObject json = new JSONObject(result); JSONArray jsonRoutes = json.getJSONArray(STR); for (int i = 0; i < jsonRoutes.length(); i++) { Route route = new Route(); Segment segment = new Segment(); JSONObject jsonRoute = jsonRoutes.getJSONObject(i); final JSONObject jsonBounds = jsonRoute.getJSONObject(STR); final JSONObject jsonNortheast = jsonBounds.getJSONObject(STR); final JSONObject jsonSouthwest = jsonBounds.getJSONObject(STR); route.setLatLgnBounds(new LatLng(jsonNortheast.getDouble("lat"), jsonNortheast.getDouble("lng")), new LatLng(jsonSouthwest.getDouble("lat"), jsonSouthwest.getDouble("lng"))); final JSONObject leg = jsonRoute.getJSONArray("legs").getJSONObject(0); final JSONArray steps = leg.getJSONArray("steps"); final int numSteps = steps.length(); route.setName(leg.getString(STR) + STR + leg.getString(STR)); route.setCopyright(jsonRoute.getString(STR)); route.setDurationText(leg.getJSONObject(STR).getString("text")); route.setDurationValue(leg.getJSONObject(STR).getInt("value")); route.setDistanceText(leg.getJSONObject(STR).getString("text")); route.setDistanceValue(leg.getJSONObject(STR).getInt("value")); route.setEndAddressText(leg.getString(STR)); route.setLength(leg.getJSONObject(STR).getInt("value")); if (!jsonRoute.getJSONArray(STR).isNull(0)) { route.setWarning(jsonRoute.getJSONArray(STR).getString(0)); } for (int y = 0; y < numSteps; y++) { final JSONObject step = steps.getJSONObject(y); final JSONObject start = step.getJSONObject(STR); final LatLng position = new LatLng(start.getDouble("lat"), start.getDouble("lng")); segment.setPoint(position); final int length = step.getJSONObject(STR).getInt("value"); distance += length; segment.setLength(length); segment.setDistance((double)distance / (double)1000); segment.setInstruction(step.getString(STR).replaceAll(STR, STRpolylineSTRpointsSTRRouting Error", e.getMessage()); return null; } return routes; }
|
/**
* Parses a url pointing to a Google JSON object to a Route object.
*
* @return a Route object based on the JSON object by Haseem Saheed
*/
|
Parses a url pointing to a Google JSON object to a Route object
|
parse
|
{
"repo_name": "fcduarte/Google-Directions-Android",
"path": "library/src/main/java/com/directions/route/GoogleParser.java",
"license": "mit",
"size": 7515
}
|
[
"com.google.android.gms.maps.model.LatLng",
"java.util.ArrayList",
"org.json.JSONArray",
"org.json.JSONObject"
] |
import com.google.android.gms.maps.model.LatLng; import java.util.ArrayList; import org.json.JSONArray; import org.json.JSONObject;
|
import com.google.android.gms.maps.model.*; import java.util.*; import org.json.*;
|
[
"com.google.android",
"java.util",
"org.json"
] |
com.google.android; java.util; org.json;
| 2,249,105
|
public static void redirect( String url )
{
try { response.sendRedirect( url ); }
catch (IOException e) { Reporter.error(e); }
}
|
static void function( String url ) { try { response.sendRedirect( url ); } catch (IOException e) { Reporter.error(e); } }
|
/**
* Redirects to the specified URL.
*
* @param url
* @throws IOException
*/
|
Redirects to the specified URL
|
redirect
|
{
"repo_name": "anjulgarg/wings-framework",
"path": "src/com/wings/framework/global/View.java",
"license": "mit",
"size": 3405
}
|
[
"com.wings.framework.internal.Reporter",
"java.io.IOException"
] |
import com.wings.framework.internal.Reporter; import java.io.IOException;
|
import com.wings.framework.internal.*; import java.io.*;
|
[
"com.wings.framework",
"java.io"
] |
com.wings.framework; java.io;
| 61,571
|
private void setUpListPreference(Preference preference, ContentSetting value) {
if (value == null) {
getPreferenceScreen().removePreference(preference);
return;
}
ListPreference listPreference = (ListPreference) preference;
int contentType = getContentSettingsTypeFromPreferenceKey(preference.getKey());
CharSequence[] keys = new String[2];
CharSequence[] descriptions = new String[2];
keys[0] = ContentSetting.ALLOW.toString();
keys[1] = ContentSetting.BLOCK.toString();
descriptions[0] = getResources().getString(
ContentSettingsResources.getSiteSummary(ContentSetting.ALLOW));
descriptions[1] = getResources().getString(
ContentSettingsResources.getSiteSummary(ContentSetting.BLOCK));
listPreference.setEntryValues(keys);
listPreference.setEntries(descriptions);
int index = (value == ContentSetting.ALLOW ? 0 : 1);
listPreference.setValueIndex(index);
int explanationResourceId = ContentSettingsResources.getExplanation(contentType);
if (explanationResourceId != 0) {
listPreference.setTitle(explanationResourceId);
}
if (listPreference.isEnabled()) {
SiteSettingsCategory category =
SiteSettingsCategory.fromContentSettingsType(contentType);
if (category != null && !category.enabledInAndroid(getActivity())) {
listPreference.setIcon(category.getDisabledInAndroidIcon(getActivity()));
listPreference.setEnabled(false);
} else {
listPreference.setIcon(ContentSettingsResources.getIcon(contentType));
}
} else {
listPreference.setIcon(
ContentSettingsResources.getDisabledIcon(contentType, getResources()));
}
preference.setSummary("%s");
listPreference.setOnPreferenceChangeListener(this);
}
|
void function(Preference preference, ContentSetting value) { if (value == null) { getPreferenceScreen().removePreference(preference); return; } ListPreference listPreference = (ListPreference) preference; int contentType = getContentSettingsTypeFromPreferenceKey(preference.getKey()); CharSequence[] keys = new String[2]; CharSequence[] descriptions = new String[2]; keys[0] = ContentSetting.ALLOW.toString(); keys[1] = ContentSetting.BLOCK.toString(); descriptions[0] = getResources().getString( ContentSettingsResources.getSiteSummary(ContentSetting.ALLOW)); descriptions[1] = getResources().getString( ContentSettingsResources.getSiteSummary(ContentSetting.BLOCK)); listPreference.setEntryValues(keys); listPreference.setEntries(descriptions); int index = (value == ContentSetting.ALLOW ? 0 : 1); listPreference.setValueIndex(index); int explanationResourceId = ContentSettingsResources.getExplanation(contentType); if (explanationResourceId != 0) { listPreference.setTitle(explanationResourceId); } if (listPreference.isEnabled()) { SiteSettingsCategory category = SiteSettingsCategory.fromContentSettingsType(contentType); if (category != null && !category.enabledInAndroid(getActivity())) { listPreference.setIcon(category.getDisabledInAndroidIcon(getActivity())); listPreference.setEnabled(false); } else { listPreference.setIcon(ContentSettingsResources.getIcon(contentType)); } } else { listPreference.setIcon( ContentSettingsResources.getDisabledIcon(contentType, getResources())); } preference.setSummary("%s"); listPreference.setOnPreferenceChangeListener(this); }
|
/**
* Initialize a ListPreference with a certain value.
* @param preference The ListPreference to initialize.
* @param value The value to initialize it to.
*/
|
Initialize a ListPreference with a certain value
|
setUpListPreference
|
{
"repo_name": "mogoweb/365browser",
"path": "app/src/main/java/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java",
"license": "apache-2.0",
"size": 36631
}
|
[
"android.preference.ListPreference",
"android.preference.Preference"
] |
import android.preference.ListPreference; import android.preference.Preference;
|
import android.preference.*;
|
[
"android.preference"
] |
android.preference;
| 1,502,961
|
EClass getBindingStat();
|
EClass getBindingStat();
|
/**
* Returns the meta object for class '{@link anatlyzer.atlext.ATL.BindingStat <em>Binding Stat</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Binding Stat</em>'.
* @see anatlyzer.atlext.ATL.BindingStat
* @generated
*/
|
Returns the meta object for class '<code>anatlyzer.atlext.ATL.BindingStat Binding Stat</code>'.
|
getBindingStat
|
{
"repo_name": "jesusc/anatlyzer",
"path": "plugins/anatlyzer.atl.typing/src-gen/anatlyzer/atlext/ATL/ATLPackage.java",
"license": "epl-1.0",
"size": 222096
}
|
[
"org.eclipse.emf.ecore.EClass"
] |
import org.eclipse.emf.ecore.EClass;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 570,096
|
boolean sqlMapDeleteByExampleElementGenerated(XmlElement element,
IntrospectedTable introspectedTable);
|
boolean sqlMapDeleteByExampleElementGenerated(XmlElement element, IntrospectedTable introspectedTable);
|
/**
* This method is called when the deleteByExample element is generated.
*
* @param element
* the generated <delete> element
* @param introspectedTable
* The class containing information about the table as
* introspected from the database
* @return true if the element should be generated, false if the generated
* element should be ignored. In the case of multiple plugins, the
* first plugin returning false will disable the calling of further
* plugins.
*/
|
This method is called when the deleteByExample element is generated
|
sqlMapDeleteByExampleElementGenerated
|
{
"repo_name": "li24361/mybatis-generator-core",
"path": "src/main/java/org/mybatis/generator/api/Plugin.java",
"license": "apache-2.0",
"size": 73078
}
|
[
"org.mybatis.generator.api.dom.xml.XmlElement"
] |
import org.mybatis.generator.api.dom.xml.XmlElement;
|
import org.mybatis.generator.api.dom.xml.*;
|
[
"org.mybatis.generator"
] |
org.mybatis.generator;
| 2,627,540
|
public Array<Vector2> path() {
return simplified;
}
|
Array<Vector2> function() { return simplified; }
|
/**
* Returns the simplified list of points representing this swipe.
*
* @return
*/
|
Returns the simplified list of points representing this swipe
|
path
|
{
"repo_name": "lycying/c2d-engine",
"path": "c2d-tests/src/main/java/info/u250/c2d/tests/mesh/FingerSwipeTest.java",
"license": "apache-2.0",
"size": 16754
}
|
[
"com.badlogic.gdx.math.Vector2",
"com.badlogic.gdx.utils.Array"
] |
import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.math.*; import com.badlogic.gdx.utils.*;
|
[
"com.badlogic.gdx"
] |
com.badlogic.gdx;
| 2,850,047
|
@Nonnull
@Restricted(NoExternalUse.class) // intended for use by Jelly EL only (plus hack in DelegatingComputerLauncher)
public final List<Descriptor<ComputerLauncher>> computerLauncherDescriptors(@CheckForNull Slave it) {
DescriptorExtensionList<ComputerLauncher, Descriptor<ComputerLauncher>> all =
Jenkins.get().<ComputerLauncher, Descriptor<ComputerLauncher>>getDescriptorList(
ComputerLauncher.class);
return it == null ? DescriptorVisibilityFilter.applyType(clazz, all)
: DescriptorVisibilityFilter.apply(it, all);
}
|
@Restricted(NoExternalUse.class) final List<Descriptor<ComputerLauncher>> function(@CheckForNull Slave it) { DescriptorExtensionList<ComputerLauncher, Descriptor<ComputerLauncher>> all = Jenkins.get().<ComputerLauncher, Descriptor<ComputerLauncher>>getDescriptorList( ComputerLauncher.class); return it == null ? DescriptorVisibilityFilter.applyType(clazz, all) : DescriptorVisibilityFilter.apply(it, all); }
|
/**
* Returns the list of {@link ComputerLauncher} descriptors appropriate to the supplied {@link Slave}.
*
* @param it the {@link Slave} or {@code null} to assume the slave is of type {@link #clazz}.
* @return the filtered list
* @since 2.12
*/
|
Returns the list of <code>ComputerLauncher</code> descriptors appropriate to the supplied <code>Slave</code>
|
computerLauncherDescriptors
|
{
"repo_name": "ErikVerheul/jenkins",
"path": "core/src/main/java/hudson/model/Slave.java",
"license": "mit",
"size": 28753
}
|
[
"hudson.slaves.ComputerLauncher",
"java.util.List",
"javax.annotation.CheckForNull",
"org.kohsuke.accmod.Restricted",
"org.kohsuke.accmod.restrictions.NoExternalUse"
] |
import hudson.slaves.ComputerLauncher; import java.util.List; import javax.annotation.CheckForNull; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.NoExternalUse;
|
import hudson.slaves.*; import java.util.*; import javax.annotation.*; import org.kohsuke.accmod.*; import org.kohsuke.accmod.restrictions.*;
|
[
"hudson.slaves",
"java.util",
"javax.annotation",
"org.kohsuke.accmod"
] |
hudson.slaves; java.util; javax.annotation; org.kohsuke.accmod;
| 111,832
|
public CacheMetrics metrics();
|
CacheMetrics function();
|
/**
* Gets whole cluster snapshot metrics (statistics) for this cache.
*
* @return Cache metrics.
*/
|
Gets whole cluster snapshot metrics (statistics) for this cache
|
metrics
|
{
"repo_name": "andrey-kuznetsov/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/IgniteCache.java",
"license": "apache-2.0",
"size": 77739
}
|
[
"org.apache.ignite.cache.CacheMetrics"
] |
import org.apache.ignite.cache.CacheMetrics;
|
import org.apache.ignite.cache.*;
|
[
"org.apache.ignite"
] |
org.apache.ignite;
| 2,790,987
|
protected X509Certificate findCertFromSubjectKeyIdentifier(List<X509Certificate> certs, List<X509SKI> skis) {
for (X509SKI ski : skis) {
if (! DatatypeHelper.isEmpty(ski.getValue())) {
byte[] xmlValue = Base64.decode(ski.getValue());
for (X509Certificate cert : certs) {
byte[] certValue = X509Util.getSubjectKeyIdentifier(cert);
if (certValue != null && Arrays.equals(xmlValue, certValue)) {
return cert;
}
}
}
}
return null;
}
|
X509Certificate function(List<X509Certificate> certs, List<X509SKI> skis) { for (X509SKI ski : skis) { if (! DatatypeHelper.isEmpty(ski.getValue())) { byte[] xmlValue = Base64.decode(ski.getValue()); for (X509Certificate cert : certs) { byte[] certValue = X509Util.getSubjectKeyIdentifier(cert); if (certValue != null && Arrays.equals(xmlValue, certValue)) { return cert; } } } } return null; }
|
/**
* Find the certificate from the chain that contains one of the specified subject key identifiers.
*
* @param certs list of certificates to evaluate
* @param skis X509 subject key identifiers to use as search criteria
* @return the matching certificate, or null
*/
|
Find the certificate from the chain that contains one of the specified subject key identifiers
|
findCertFromSubjectKeyIdentifier
|
{
"repo_name": "duck1123/java-xmltooling",
"path": "src/main/java/org/opensaml/xml/security/keyinfo/provider/InlineX509DataProvider.java",
"license": "apache-2.0",
"size": 14160
}
|
[
"java.security.cert.X509Certificate",
"java.util.Arrays",
"java.util.List",
"org.opensaml.xml.security.x509.X509Util",
"org.opensaml.xml.util.Base64",
"org.opensaml.xml.util.DatatypeHelper"
] |
import java.security.cert.X509Certificate; import java.util.Arrays; import java.util.List; import org.opensaml.xml.security.x509.X509Util; import org.opensaml.xml.util.Base64; import org.opensaml.xml.util.DatatypeHelper;
|
import java.security.cert.*; import java.util.*; import org.opensaml.xml.security.x509.*; import org.opensaml.xml.util.*;
|
[
"java.security",
"java.util",
"org.opensaml.xml"
] |
java.security; java.util; org.opensaml.xml;
| 10,494
|
Disqualification addDisqualification(Disqualification disqualification, String sessionId) throws ServiceException;
|
Disqualification addDisqualification(Disqualification disqualification, String sessionId) throws ServiceException;
|
/**
* Add disqualification
* @param disqualification to create
* @return created disqualification
* @throws ServiceException on error
*/
|
Add disqualification
|
addDisqualification
|
{
"repo_name": "PloughingAByteField/tiatus",
"path": "service/src/main/java/org/tiatus/service/DisqualificationService.java",
"license": "mit",
"size": 1154
}
|
[
"org.tiatus.entity.Disqualification"
] |
import org.tiatus.entity.Disqualification;
|
import org.tiatus.entity.*;
|
[
"org.tiatus.entity"
] |
org.tiatus.entity;
| 2,703,105
|
void save(Object object, long windowId) throws IOException;
|
void save(Object object, long windowId) throws IOException;
|
/**
* Save the state for a window id.
* @param object state
* @param windowId window id
* @throws IOException
*/
|
Save the state for a window id
|
save
|
{
"repo_name": "ananthc/apex-malhar",
"path": "library/src/main/java/org/apache/apex/malhar/lib/wal/WindowDataManager.java",
"license": "apache-2.0",
"size": 5317
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,886,849
|
@Test
public void testFailedAuthentication() throws Exception {
Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
WSSecHeader secHeader = new WSSecHeader(doc);
secHeader.insertSecurityHeader();
WSSecUsernameToken builder = new WSSecUsernameToken(secHeader);
builder.addCreated();
builder.addNonce();
builder.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
Document timestampedDoc = builder.build();
try {
verify(timestampedDoc);
fail("Failure expected on a bad password");
} catch (WSSecurityException ex) {
assertTrue(ex.getErrorCode() == WSSecurityException.ErrorCode.FAILED_AUTHENTICATION);
assertEquals("The security token could not be authenticated or authorized", ex.getMessage());
QName faultCode = new QName(WSConstants.WSSE_NS, "FailedAuthentication");
assertTrue(ex.getFaultCode().equals(faultCode));
}
}
|
void function() throws Exception { Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG); WSSecHeader secHeader = new WSSecHeader(doc); secHeader.insertSecurityHeader(); WSSecUsernameToken builder = new WSSecUsernameToken(secHeader); builder.addCreated(); builder.addNonce(); builder.setUserInfo(STR, STR); Document timestampedDoc = builder.build(); try { verify(timestampedDoc); fail(STR); } catch (WSSecurityException ex) { assertTrue(ex.getErrorCode() == WSSecurityException.ErrorCode.FAILED_AUTHENTICATION); assertEquals(STR, ex.getMessage()); QName faultCode = new QName(WSConstants.WSSE_NS, STR); assertTrue(ex.getFaultCode().equals(faultCode)); } }
|
/**
* Test for the wsse:FailedAuthentication faultcode. This will fail due to a bad password in
* the callback handler.
*/
|
Test for the wsse:FailedAuthentication faultcode. This will fail due to a bad password in the callback handler
|
testFailedAuthentication
|
{
"repo_name": "apache/wss4j",
"path": "ws-security-dom/src/test/java/org/apache/wss4j/dom/misc/FaultCodeTest.java",
"license": "apache-2.0",
"size": 9921
}
|
[
"javax.xml.namespace.QName",
"org.apache.wss4j.common.ext.WSSecurityException",
"org.apache.wss4j.dom.WSConstants",
"org.apache.wss4j.dom.common.SOAPUtil",
"org.apache.wss4j.dom.message.WSSecHeader",
"org.apache.wss4j.dom.message.WSSecUsernameToken",
"org.junit.jupiter.api.Assertions",
"org.w3c.dom.Document"
] |
import javax.xml.namespace.QName; import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.dom.WSConstants; import org.apache.wss4j.dom.common.SOAPUtil; import org.apache.wss4j.dom.message.WSSecHeader; import org.apache.wss4j.dom.message.WSSecUsernameToken; import org.junit.jupiter.api.Assertions; import org.w3c.dom.Document;
|
import javax.xml.namespace.*; import org.apache.wss4j.common.ext.*; import org.apache.wss4j.dom.*; import org.apache.wss4j.dom.common.*; import org.apache.wss4j.dom.message.*; import org.junit.jupiter.api.*; import org.w3c.dom.*;
|
[
"javax.xml",
"org.apache.wss4j",
"org.junit.jupiter",
"org.w3c.dom"
] |
javax.xml; org.apache.wss4j; org.junit.jupiter; org.w3c.dom;
| 2,423,990
|
public void end_instrument_list() throws SAXException;
|
void function() throws SAXException;
|
/**
*
* A container element end event handling method.
*/
|
A container element end event handling method
|
end_instrument_list
|
{
"repo_name": "3-mode/lumens",
"path": "lumens-engine/src/main/java/com/lumens/engine/serializer/parser/ProjectHandler.java",
"license": "lgpl-3.0",
"size": 6858
}
|
[
"org.xml.sax.SAXException"
] |
import org.xml.sax.SAXException;
|
import org.xml.sax.*;
|
[
"org.xml.sax"
] |
org.xml.sax;
| 1,278,955
|
Trace readNext();
|
Trace readNext();
|
/**
* Reads the next trace from the source. If the deserializer has reached the end of the stream,
* this method returns null.
*
* @return next {@link Trace} instance. If next trace is not available this method returns null.
*/
|
Reads the next trace from the source. If the deserializer has reached the end of the stream, this method returns null
|
readNext
|
{
"repo_name": "diagnoseIT/CTA",
"path": "cta/cta.default.impl/src/main/java/rocks/cta/dflt/impl/serialization/CTADeserializer.java",
"license": "agpl-3.0",
"size": 779
}
|
[
"rocks.cta.api.core.Trace"
] |
import rocks.cta.api.core.Trace;
|
import rocks.cta.api.core.*;
|
[
"rocks.cta.api"
] |
rocks.cta.api;
| 2,187,651
|
CreateTopicResult createTopic(TopicInfo topic) throws ServiceException;
|
CreateTopicResult createTopic(TopicInfo topic) throws ServiceException;
|
/**
* Creates a topic.
*
* @param topic
* A <code>Topic</code> object that represents the topic to
* create.
* @return A <code>CreateTopicResult</code> object that represents the
* result.
* @throws ServiceException
* If a service exception is encountered.
*/
|
Creates a topic
|
createTopic
|
{
"repo_name": "flydream2046/azure-sdk-for-java",
"path": "services/azure-servicebus/src/main/java/com/microsoft/windowsazure/services/servicebus/ServiceBusContract.java",
"license": "apache-2.0",
"size": 23765
}
|
[
"com.microsoft.windowsazure.exception.ServiceException",
"com.microsoft.windowsazure.services.servicebus.models.CreateTopicResult",
"com.microsoft.windowsazure.services.servicebus.models.TopicInfo"
] |
import com.microsoft.windowsazure.exception.ServiceException; import com.microsoft.windowsazure.services.servicebus.models.CreateTopicResult; import com.microsoft.windowsazure.services.servicebus.models.TopicInfo;
|
import com.microsoft.windowsazure.exception.*; import com.microsoft.windowsazure.services.servicebus.models.*;
|
[
"com.microsoft.windowsazure"
] |
com.microsoft.windowsazure;
| 330,674
|
@JsonProperty
public List<FieldInfo> fields() {
return fields;
}
|
List<FieldInfo> function() { return fields; }
|
/**
* Returns the metadata about the fields of the type.
*/
|
Returns the metadata about the fields of the type
|
fields
|
{
"repo_name": "line/armeria",
"path": "core/src/main/java/com/linecorp/armeria/server/docs/ExceptionInfo.java",
"license": "apache-2.0",
"size": 3061
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 579,796
|
public static <E extends Serializable> BerkeleyQueue<E> queue(String envHomePath, String queueName, Class<E> valueClass, int cacheSize) {
return env(envHomePath).queue(queueName, valueClass, cacheSize);
}
|
static <E extends Serializable> BerkeleyQueue<E> function(String envHomePath, String queueName, Class<E> valueClass, int cacheSize) { return env(envHomePath).queue(queueName, valueClass, cacheSize); }
|
/**
* Returns a new {@link BerkeleyQueue} instance with given cache size
* @param cacheSize Queue cache size - number of element operations it is allowed to loose in case of system crash.
* @see AbstractQueue
*/
|
Returns a new <code>BerkeleyQueue</code> instance with given cache size
|
queue
|
{
"repo_name": "jronrun/benayn",
"path": "benayn-berkeley/src/main/java/com/benayn/berkeley/Berkeley.java",
"license": "apache-2.0",
"size": 111590
}
|
[
"java.io.Serializable"
] |
import java.io.Serializable;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 162,011
|
public void setTransactionTimeout(int seconds) throws SystemException
{
getCurrent().setTransactionTimeout(seconds);
}
|
void function(int seconds) throws SystemException { getCurrent().setTransactionTimeout(seconds); }
|
/**
* sets the timeout for the transaction
*/
|
sets the timeout for the transaction
|
setTransactionTimeout
|
{
"repo_name": "CleverCloud/Quercus",
"path": "resin/src/main/java/com/caucho/transaction/TransactionManagerImpl.java",
"license": "gpl-2.0",
"size": 11506
}
|
[
"javax.transaction.SystemException"
] |
import javax.transaction.SystemException;
|
import javax.transaction.*;
|
[
"javax.transaction"
] |
javax.transaction;
| 2,858,479
|
protected Collection<RM> handleTimer(MessageCollector collector, TaskCoordinator coordinator) {
return Collections.emptyList();
}
|
Collection<RM> function(MessageCollector collector, TaskCoordinator coordinator) { return Collections.emptyList(); }
|
/**
* Handle the the timer tick for this operator and return the results to be propagated to registered operators.
* <p>
* Defaults to a no-op implementation.
*
* @param collector the {@link MessageCollector} in the context
* @param coordinator the {@link TaskCoordinator} in the context
* @return results of the timed operation
*/
|
Handle the the timer tick for this operator and return the results to be propagated to registered operators. Defaults to a no-op implementation
|
handleTimer
|
{
"repo_name": "bharathkk/samza",
"path": "samza-core/src/main/java/org/apache/samza/operators/impl/OperatorImpl.java",
"license": "apache-2.0",
"size": 21230
}
|
[
"java.util.Collection",
"java.util.Collections",
"org.apache.samza.task.MessageCollector",
"org.apache.samza.task.TaskCoordinator"
] |
import java.util.Collection; import java.util.Collections; import org.apache.samza.task.MessageCollector; import org.apache.samza.task.TaskCoordinator;
|
import java.util.*; import org.apache.samza.task.*;
|
[
"java.util",
"org.apache.samza"
] |
java.util; org.apache.samza;
| 92,755
|
default T get(final ConnectorRequestContext context, final QualifiedName name) {
throw new UnsupportedOperationException(UNSUPPORTED_MESSAGE);
}
|
default T get(final ConnectorRequestContext context, final QualifiedName name) { throw new UnsupportedOperationException(UNSUPPORTED_MESSAGE); }
|
/**
* Return a resource with the given name.
*
* @param context The request context
* @param name The qualified name of the resource to get
* @return The resource metadata.
* @throws UnsupportedOperationException If the connector doesn't implement this method
*/
|
Return a resource with the given name
|
get
|
{
"repo_name": "zhljen/metacat",
"path": "metacat-common-server/src/main/java/com/netflix/metacat/common/server/connectors/ConnectorBaseService.java",
"license": "apache-2.0",
"size": 6181
}
|
[
"com.netflix.metacat.common.QualifiedName"
] |
import com.netflix.metacat.common.QualifiedName;
|
import com.netflix.metacat.common.*;
|
[
"com.netflix.metacat"
] |
com.netflix.metacat;
| 1,452,956
|
ESModelElementQuery modelElementQuery(ESPrimaryVersionSpec source, ESModelElementId id,
int upper, int lower, boolean allVersions, boolean includeChangePackages);
|
ESModelElementQuery modelElementQuery(ESPrimaryVersionSpec source, ESModelElementId id, int upper, int lower, boolean allVersions, boolean includeChangePackages);
|
/**
* Factory method for creating a {@link ESModelElementQuery}.
*
* @param source
* the source version of the query
* @param id
* the ID of a model element
* @param upper
* the upper limit of the query
* @param lower
* the lower limit of the query
* @param allVersions
* whether to include all versions, from all branches
* @param includeChangePackages
* whether to include change packages
* @return query the constructed model element query
*/
|
Factory method for creating a <code>ESModelElementQuery</code>
|
modelElementQuery
|
{
"repo_name": "edgarmueller/emfstore-rest",
"path": "bundles/org.eclipse.emf.emfstore.server.model/src/org/eclipse/emf/emfstore/server/model/query/ESHistoryQueryFactory.java",
"license": "epl-1.0",
"size": 4255
}
|
[
"org.eclipse.emf.emfstore.common.model.ESModelElementId",
"org.eclipse.emf.emfstore.server.model.versionspec.ESPrimaryVersionSpec"
] |
import org.eclipse.emf.emfstore.common.model.ESModelElementId; import org.eclipse.emf.emfstore.server.model.versionspec.ESPrimaryVersionSpec;
|
import org.eclipse.emf.emfstore.common.model.*; import org.eclipse.emf.emfstore.server.model.versionspec.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 890,535
|
private static void decodeIs91ShortMessage(BearerData bData)
throws BitwiseInputStream.AccessException, CodingException
{
BitwiseInputStream inStream = new BitwiseInputStream(bData.userData.payload);
int dataLen = inStream.available() / 6; // 6-bit packed character encoding.
int numFields = bData.userData.numFields;
if ((dataLen > 14) || (dataLen < numFields)) {
throw new CodingException("IS-91 voicemail status decoding failed");
}
StringBuffer strbuf = new StringBuffer(dataLen);
for (int i = 0; i < numFields; i++) {
strbuf.append(UserData.ASCII_MAP[inStream.read(6)]);
}
bData.userData.payloadStr = strbuf.toString();
}
|
static void function(BearerData bData) throws BitwiseInputStream.AccessException, CodingException { BitwiseInputStream inStream = new BitwiseInputStream(bData.userData.payload); int dataLen = inStream.available() / 6; int numFields = bData.userData.numFields; if ((dataLen > 14) (dataLen < numFields)) { throw new CodingException(STR); } StringBuffer strbuf = new StringBuffer(dataLen); for (int i = 0; i < numFields; i++) { strbuf.append(UserData.ASCII_MAP[inStream.read(6)]); } bData.userData.payloadStr = strbuf.toString(); }
|
/**
* IS-91 Short Message decoding
* (See 3GPP2 C.S0015-A, Table 4.3.1.4.1-1)
* (For character encodings, see TIA/EIA/IS-91, Annex B)
*
* Protocol Summary: The user data payload may contain 1-14
* characters, which are treated as normal text user data payload.
* Note that the characters encoding is 6-bit packed.
*/
|
IS-91 Short Message decoding (See 3GPP2 C.S0015-A, Table 4.3.1.4.1-1) (For character encodings, see TIA/EIA/IS-91, Annex B) Protocol Summary: The user data payload may contain 1-14 characters, which are treated as normal text user data payload. Note that the characters encoding is 6-bit packed
|
decodeIs91ShortMessage
|
{
"repo_name": "lynnlyc/for-honeynet-reviewers",
"path": "CallbackDroid/android-environment/src/base/telephony/java/com/android/internal/telephony/cdma/sms/BearerData.java",
"license": "gpl-3.0",
"size": 71467
}
|
[
"com.android.internal.util.BitwiseInputStream"
] |
import com.android.internal.util.BitwiseInputStream;
|
import com.android.internal.util.*;
|
[
"com.android.internal"
] |
com.android.internal;
| 1,542,643
|
@Test
public void testExplicitFilesystem() throws IOException {
FrameworkUploader uploader = new FrameworkUploader();
Configuration conf = new Configuration();
uploader.setConf(conf);
boolean success = uploader.parseArguments(new String[]{
"-target",
"hdfs://namenode:555/usr/lib/mr-framework.tar.gz#mr-framework"
});
Assert.assertTrue("Expected to parse arguments", success);
Assert.assertEquals(
"Expected",
"hdfs://namenode:555/usr/lib/mr-framework.tar.gz#mr-framework",
uploader.target);
}
|
void function() throws IOException { FrameworkUploader uploader = new FrameworkUploader(); Configuration conf = new Configuration(); uploader.setConf(conf); boolean success = uploader.parseArguments(new String[]{ STR, STRExpected to parse argumentsSTRExpectedSTRhdfs: uploader.target); }
|
/**
* Test the explicit filesystem specification.
*/
|
Test the explicit filesystem specification
|
testExplicitFilesystem
|
{
"repo_name": "xiao-chen/hadoop",
"path": "hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-uploader/src/test/java/org/apache/hadoop/mapred/uploader/TestFrameworkUploader.java",
"license": "apache-2.0",
"size": 16420
}
|
[
"java.io.IOException",
"org.apache.hadoop.conf.Configuration"
] |
import java.io.IOException; import org.apache.hadoop.conf.Configuration;
|
import java.io.*; import org.apache.hadoop.conf.*;
|
[
"java.io",
"org.apache.hadoop"
] |
java.io; org.apache.hadoop;
| 2,209,376
|
@ApiOperation(value = "Search for applications", notes = "Returns a search result with that contains applications matching the request. A application is returned only if the connected user has at least one application role in [ APPLICATION_MANAGER | APPLICATION_USER | APPLICATION_DEVOPS | DEPLOYMENT_MANAGER ]")
@RequestMapping(value = "/search", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public RestResponse<FacetedSearchResult> search(@RequestBody SearchRequest searchRequest) {
FilterBuilder authorizationFilter = AuthorizationUtil.getResourceAuthorizationFilters();
FacetedSearchResult searchResult = alienDAO.facetedSearch(Application.class, searchRequest.getQuery(), searchRequest.getFilters(), authorizationFilter,
null, searchRequest.getFrom(), searchRequest.getSize());
return RestResponseBuilder.<FacetedSearchResult> builder().data(searchResult).build();
}
|
@ApiOperation(value = STR, notes = STR) @RequestMapping(value = STR, method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) RestResponse<FacetedSearchResult> function(@RequestBody SearchRequest searchRequest) { FilterBuilder authorizationFilter = AuthorizationUtil.getResourceAuthorizationFilters(); FacetedSearchResult searchResult = alienDAO.facetedSearch(Application.class, searchRequest.getQuery(), searchRequest.getFilters(), authorizationFilter, null, searchRequest.getFrom(), searchRequest.getSize()); return RestResponseBuilder.<FacetedSearchResult> builder().data(searchResult).build(); }
|
/**
* Search for an application.
*
* @param searchRequest The element that contains criterias for search operation.
* @return A rest response that contains a {@link FacetedSearchResult} containing applications.
*/
|
Search for an application
|
search
|
{
"repo_name": "loicalbertin/alien4cloud",
"path": "alien4cloud-rest-api/src/main/java/alien4cloud/rest/application/ApplicationController.java",
"license": "apache-2.0",
"size": 21946
}
|
[
"com.wordnik.swagger.annotations.ApiOperation",
"org.elasticsearch.index.query.FilterBuilder",
"org.springframework.http.MediaType",
"org.springframework.web.bind.annotation.RequestBody",
"org.springframework.web.bind.annotation.RequestMapping",
"org.springframework.web.bind.annotation.RequestMethod"
] |
import com.wordnik.swagger.annotations.ApiOperation; import org.elasticsearch.index.query.FilterBuilder; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod;
|
import com.wordnik.swagger.annotations.*; import org.elasticsearch.index.query.*; import org.springframework.http.*; import org.springframework.web.bind.annotation.*;
|
[
"com.wordnik.swagger",
"org.elasticsearch.index",
"org.springframework.http",
"org.springframework.web"
] |
com.wordnik.swagger; org.elasticsearch.index; org.springframework.http; org.springframework.web;
| 2,062,300
|
EClass getStatementSubject();
|
EClass getStatementSubject();
|
/**
* Returns the meta object for class '{@link org.openhealthtools.mdht.cts2.statement.StatementSubject <em>Subject</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @return the meta object for class '<em>Subject</em>'.
* @see org.openhealthtools.mdht.cts2.statement.StatementSubject
* @generated
*/
|
Returns the meta object for class '<code>org.openhealthtools.mdht.cts2.statement.StatementSubject Subject</code>'.
|
getStatementSubject
|
{
"repo_name": "drbgfc/mdht",
"path": "cts2/plugins/org.openhealthtools.mdht.cts2.core/src/org/openhealthtools/mdht/cts2/statement/StatementPackage.java",
"license": "epl-1.0",
"size": 51348
}
|
[
"org.eclipse.emf.ecore.EClass"
] |
import org.eclipse.emf.ecore.EClass;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 2,669,860
|
public void dumpCSV(SearchBean search, OutputStream out) throws IOException {
SpreadsheetBuilder builder = new SpreadsheetBuilder();
Set<Professorship> professorships = authorizationService.searchAuthorizations
(search).stream().flatMap(a -> getProfessorships(a.getTeacher().getPerson().getUser(),search.getPeriod()).stream())
.collect(Collectors.toSet());
builder.addSheet(getSheetName(search), new SheetData<Professorship>(professorships) {
|
void function(SearchBean search, OutputStream out) throws IOException { SpreadsheetBuilder builder = new SpreadsheetBuilder(); Set<Professorship> professorships = authorizationService.searchAuthorizations (search).stream().flatMap(a -> getProfessorships(a.getTeacher().getPerson().getUser(),search.getPeriod()).stream()) .collect(Collectors.toSet()); builder.addSheet(getSheetName(search), new SheetData<Professorship>(professorships) {
|
/***
* Write to outputstream csv file with {@link TeacherAuthorization} specified by the filter bean
*
* @param search filter bean
* @param out the outputstream to dump the CSV to
* @throws IOException if write to the outputstream fails
*/
|
Write to outputstream csv file with <code>TeacherAuthorization</code> specified by the filter bean
|
dumpCSV
|
{
"repo_name": "gil-l/fenix",
"path": "src/main/java/org/fenixedu/academic/ui/spring/controller/teacher/professorship/ProfessorshipService.java",
"license": "lgpl-3.0",
"size": 7628
}
|
[
"java.io.IOException",
"java.io.OutputStream",
"java.util.Set",
"java.util.stream.Collectors",
"org.fenixedu.academic.domain.Professorship",
"org.fenixedu.academic.ui.spring.controller.teacher.authorization.SearchBean",
"org.fenixedu.commons.spreadsheet.SheetData",
"org.fenixedu.commons.spreadsheet.SpreadsheetBuilder"
] |
import java.io.IOException; import java.io.OutputStream; import java.util.Set; import java.util.stream.Collectors; import org.fenixedu.academic.domain.Professorship; import org.fenixedu.academic.ui.spring.controller.teacher.authorization.SearchBean; import org.fenixedu.commons.spreadsheet.SheetData; import org.fenixedu.commons.spreadsheet.SpreadsheetBuilder;
|
import java.io.*; import java.util.*; import java.util.stream.*; import org.fenixedu.academic.domain.*; import org.fenixedu.academic.ui.spring.controller.teacher.authorization.*; import org.fenixedu.commons.spreadsheet.*;
|
[
"java.io",
"java.util",
"org.fenixedu.academic",
"org.fenixedu.commons"
] |
java.io; java.util; org.fenixedu.academic; org.fenixedu.commons;
| 751,927
|
@SideOnly(Side.CLIENT)
public boolean shouldRotateAroundWhenRendering()
{
return false;
}
|
@SideOnly(Side.CLIENT) boolean function() { return false; }
|
/**
* Returns true if this item should be rotated by 180 degrees around the Y axis when being held in an entities
* hands.
*/
|
Returns true if this item should be rotated by 180 degrees around the Y axis when being held in an entities hands
|
shouldRotateAroundWhenRendering
|
{
"repo_name": "Im-Jrotica/forge_latest",
"path": "build/tmp/recompileMc/sources/net/minecraft/item/Item.java",
"license": "lgpl-2.1",
"size": 82426
}
|
[
"net.minecraftforge.fml.relauncher.Side",
"net.minecraftforge.fml.relauncher.SideOnly"
] |
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.*;
|
[
"net.minecraftforge.fml"
] |
net.minecraftforge.fml;
| 2,820,078
|
private void createShapeList(Coord3D coord)
{
ShapeList shapeList;
shapeList = new ShapeList(coord);
coordMap.put(coord, shapeList);
}
|
void function(Coord3D coord) { ShapeList shapeList; shapeList = new ShapeList(coord); coordMap.put(coord, shapeList); }
|
/**
* Create the ROIShape list for the plane coord.
* @param coord the plane.
*/
|
Create the ROIShape list for the plane coord
|
createShapeList
|
{
"repo_name": "rleigh-dundee/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/util/roi/model/ROICoordMap.java",
"license": "gpl-2.0",
"size": 6039
}
|
[
"org.openmicroscopy.shoola.util.roi.model.ShapeList",
"org.openmicroscopy.shoola.util.roi.model.util.Coord3D"
] |
import org.openmicroscopy.shoola.util.roi.model.ShapeList; import org.openmicroscopy.shoola.util.roi.model.util.Coord3D;
|
import org.openmicroscopy.shoola.util.roi.model.*; import org.openmicroscopy.shoola.util.roi.model.util.*;
|
[
"org.openmicroscopy.shoola"
] |
org.openmicroscopy.shoola;
| 1,305,804
|
public TimelineDomain getDomain(String domainId,
UserGroupInformation callerUGI) throws YarnException, IOException {
long startTime = Time.monotonicNow();
metrics.incrGetDomainOps();
try {
return doGetDomain(domainId, callerUGI);
} finally {
metrics.addGetDomainTime(Time.monotonicNow() - startTime);
}
}
|
TimelineDomain function(String domainId, UserGroupInformation callerUGI) throws YarnException, IOException { long startTime = Time.monotonicNow(); metrics.incrGetDomainOps(); try { return doGetDomain(domainId, callerUGI); } finally { metrics.addGetDomainTime(Time.monotonicNow() - startTime); } }
|
/**
* Get a single domain of the particular ID. If callerUGI is not the owner
* or the admin of the domain, null will be returned.
*/
|
Get a single domain of the particular ID. If callerUGI is not the owner or the admin of the domain, null will be returned
|
getDomain
|
{
"repo_name": "apurtell/hadoop",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/timeline/TimelineDataManager.java",
"license": "apache-2.0",
"size": 17328
}
|
[
"java.io.IOException",
"org.apache.hadoop.security.UserGroupInformation",
"org.apache.hadoop.util.Time",
"org.apache.hadoop.yarn.api.records.timeline.TimelineDomain",
"org.apache.hadoop.yarn.exceptions.YarnException"
] |
import java.io.IOException; import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.util.Time; import org.apache.hadoop.yarn.api.records.timeline.TimelineDomain; import org.apache.hadoop.yarn.exceptions.YarnException;
|
import java.io.*; import org.apache.hadoop.security.*; import org.apache.hadoop.util.*; import org.apache.hadoop.yarn.api.records.timeline.*; import org.apache.hadoop.yarn.exceptions.*;
|
[
"java.io",
"org.apache.hadoop"
] |
java.io; org.apache.hadoop;
| 1,865,423
|
public void play() throws JavaLayerException
{
playFrames(0, frameCount);
}
|
void function() throws JavaLayerException { playFrames(0, frameCount); }
|
/**
* Play the whole file.
*/
|
Play the whole file
|
play
|
{
"repo_name": "peterhuerlimann/bluej-java-learning",
"path": "Kapitel11/Musikplayer/MusicFilePlayer.java",
"license": "gpl-3.0",
"size": 11325
}
|
[
"javazoom.jl.decoder.JavaLayerException"
] |
import javazoom.jl.decoder.JavaLayerException;
|
import javazoom.jl.decoder.*;
|
[
"javazoom.jl.decoder"
] |
javazoom.jl.decoder;
| 1,846,882
|
public void addExtension(
String oid,
boolean critical,
ASN1Encodable value)
{
this.addExtension(new ASN1ObjectIdentifier(oid), critical, value);
}
|
void function( String oid, boolean critical, ASN1Encodable value) { this.addExtension(new ASN1ObjectIdentifier(oid), critical, value); }
|
/**
* add a given extension field for the standard extensions tag (tag 3)
*/
|
add a given extension field for the standard extensions tag (tag 3)
|
addExtension
|
{
"repo_name": "Skywalker-11/spongycastle",
"path": "prov/src/main/jdk1.1/org/spongycastle/x509/X509V3CertificateGenerator.java",
"license": "mit",
"size": 15205
}
|
[
"org.spongycastle.asn1.ASN1Encodable",
"org.spongycastle.asn1.ASN1ObjectIdentifier"
] |
import org.spongycastle.asn1.ASN1Encodable; import org.spongycastle.asn1.ASN1ObjectIdentifier;
|
import org.spongycastle.asn1.*;
|
[
"org.spongycastle.asn1"
] |
org.spongycastle.asn1;
| 1,401,694
|
public synchronized SynchronizingStorageEngine register(String storeName,
Scope scope,
boolean persistent)
throws PersistException {
SynchronizingStorageEngine store =
localStores.get(storeName);
if (store != null) {
return store;
}
IStorageEngine<ByteArray, byte[]> dstore;
if (persistent) {
if (persistentDataSource == null)
persistentDataSource = JavaDBStorageEngine.getDataSource(dbPath, false);
dstore = new JavaDBStorageEngine(storeName, persistentDataSource);
} else {
dstore = new InMemoryStorageEngine<ByteArray, byte[]>(storeName);
}
store = new SynchronizingStorageEngine(dstore, syncManager,
syncManager.debugCounter,
scope);
localStores.put(storeName, store);
return store;
}
/**
* Get a collection containing all the currently-registered stores
* @return the {@link Collection<SynchronizingStorageEngine>}
|
synchronized SynchronizingStorageEngine function(String storeName, Scope scope, boolean persistent) throws PersistException { SynchronizingStorageEngine store = localStores.get(storeName); if (store != null) { return store; } IStorageEngine<ByteArray, byte[]> dstore; if (persistent) { if (persistentDataSource == null) persistentDataSource = JavaDBStorageEngine.getDataSource(dbPath, false); dstore = new JavaDBStorageEngine(storeName, persistentDataSource); } else { dstore = new InMemoryStorageEngine<ByteArray, byte[]>(storeName); } store = new SynchronizingStorageEngine(dstore, syncManager, syncManager.debugCounter, scope); localStores.put(storeName, store); return store; } /** * Get a collection containing all the currently-registered stores * @return the {@link Collection<SynchronizingStorageEngine>}
|
/**
* Register a new store with the given name, scope and persistence
* @param storeName the name of the store
* @param scope the scope for the store
* @param persistent whether the store should be persistent
* @return the newly-allocated store
* @throws PersistException
*/
|
Register a new store with the given name, scope and persistence
|
register
|
{
"repo_name": "alsmadi/CSCI-6617",
"path": "src/main/java/org/sdnplatform/sync/internal/StoreRegistry.java",
"license": "apache-2.0",
"size": 9519
}
|
[
"java.util.Collection",
"org.sdnplatform.sync.ISyncService",
"org.sdnplatform.sync.error.PersistException",
"org.sdnplatform.sync.internal.store.IStorageEngine",
"org.sdnplatform.sync.internal.store.InMemoryStorageEngine",
"org.sdnplatform.sync.internal.store.JavaDBStorageEngine",
"org.sdnplatform.sync.internal.store.SynchronizingStorageEngine",
"org.sdnplatform.sync.internal.util.ByteArray"
] |
import java.util.Collection; import org.sdnplatform.sync.ISyncService; import org.sdnplatform.sync.error.PersistException; import org.sdnplatform.sync.internal.store.IStorageEngine; import org.sdnplatform.sync.internal.store.InMemoryStorageEngine; import org.sdnplatform.sync.internal.store.JavaDBStorageEngine; import org.sdnplatform.sync.internal.store.SynchronizingStorageEngine; import org.sdnplatform.sync.internal.util.ByteArray;
|
import java.util.*; import org.sdnplatform.sync.*; import org.sdnplatform.sync.error.*; import org.sdnplatform.sync.internal.store.*; import org.sdnplatform.sync.internal.util.*;
|
[
"java.util",
"org.sdnplatform.sync"
] |
java.util; org.sdnplatform.sync;
| 2,242,377
|
EReference getOutPatternElement_Bindings();
|
EReference getOutPatternElement_Bindings();
|
/**
* Returns the meta object for the containment reference list '{@link anatlyzer.atlext.ATL.OutPatternElement#getBindings <em>Bindings</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference list '<em>Bindings</em>'.
* @see anatlyzer.atlext.ATL.OutPatternElement#getBindings()
* @see #getOutPatternElement()
* @generated
*/
|
Returns the meta object for the containment reference list '<code>anatlyzer.atlext.ATL.OutPatternElement#getBindings Bindings</code>'.
|
getOutPatternElement_Bindings
|
{
"repo_name": "jesusc/anatlyzer",
"path": "plugins/anatlyzer.atl.typing/src-gen/anatlyzer/atlext/ATL/ATLPackage.java",
"license": "epl-1.0",
"size": 222096
}
|
[
"org.eclipse.emf.ecore.EReference"
] |
import org.eclipse.emf.ecore.EReference;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 570,070
|
public Stack<IMove> solution() {
// no solution.
if (moveStack == null) {
return new Stack<IMove>();
}
return moveStack;
}
|
Stack<IMove> function() { if (moveStack == null) { return new Stack<IMove>(); } return moveStack; }
|
/**
* Combine all stacks into one move sequence.
* <p>
* If no solution, then empty stack returned.
*/
|
Combine all stacks into one move sequence. If no solution, then empty stack returned
|
solution
|
{
"repo_name": "heineman/algorithms-nutshell-2ed",
"path": "Blogs/src/algs/blog/graph/search/Result.java",
"license": "mit",
"size": 2008
}
|
[
"java.util.Stack"
] |
import java.util.Stack;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,610,846
|
public void setup() throws IOException {
setupPubsubTopic();
setupBigQueryTable();
}
|
void function() throws IOException { setupPubsubTopic(); setupBigQueryTable(); }
|
/**
* Sets up external resources that are required by the example,
* such as Pub/Sub topics and BigQuery tables.
*
* @throws IOException if there is a problem setting up the resources
*/
|
Sets up external resources that are required by the example, such as Pub/Sub topics and BigQuery tables
|
setup
|
{
"repo_name": "PieterDM/DataflowJavaSDK",
"path": "examples/src/main/java/com/google/cloud/dataflow/examples/common/DataflowExampleUtils.java",
"license": "apache-2.0",
"size": 16325
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,979,230
|
public Bundle getArguments() {
return mArguments;
}
|
Bundle function() { return mArguments; }
|
/**
* Get the Bundle object that contains the arguments passed to the instrumentation
*
* @return the Bundle object
* @hide
*/
|
Get the Bundle object that contains the arguments passed to the instrumentation
|
getArguments
|
{
"repo_name": "OrdonTeam/Hackathon3v2",
"path": "app/src/androidTest/java/android/support/test/runner/AndroidSpockRunner.java",
"license": "mit",
"size": 26770
}
|
[
"android.os.Bundle"
] |
import android.os.Bundle;
|
import android.os.*;
|
[
"android.os"
] |
android.os;
| 1,104,424
|
public void setCreateDate(Date createDate);
|
void function(Date createDate);
|
/**
* Sets the create date of this akismet m b message.
*
* @param createDate the create date of this akismet m b message
*/
|
Sets the create date of this akismet m b message
|
setCreateDate
|
{
"repo_name": "mikakoivisto/liferay-akismet-portlet",
"path": "liferay-akismet-portlet-service/src/main/java/fi/javaguru/akismet/mb/model/AkismetMBMessageModel.java",
"license": "gpl-3.0",
"size": 9558
}
|
[
"java.util.Date"
] |
import java.util.Date;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,662,091
|
protected void getConnection() throws MessagingException
{
try {
// do all of the non-protocol specific set up. This will get our socket established
// and ready use.
super.getConnection();
} catch (IOException e) {
throw new MessagingException("Unable to obtain a connection to the NNTP server", e);
}
// The NNTP protocol is inherently a string-based protocol, so we get
// string readers/writers for the connection streams. Note that we explicitly
// set the encoding to ensure that an inappropriate native encoding is not picked up.
try {
reader = new BufferedReader(new InputStreamReader(inputStream, "ISO8859-1"));
writer = new PrintWriter(new OutputStreamWriter(new BufferedOutputStream(outputStream), "ISO8859-1"));
} catch (UnsupportedEncodingException e) {
}
}
|
void function() throws MessagingException { try { super.getConnection(); } catch (IOException e) { throw new MessagingException(STR, e); } try { reader = new BufferedReader(new InputStreamReader(inputStream, STR)); writer = new PrintWriter(new OutputStreamWriter(new BufferedOutputStream(outputStream), STR)); } catch (UnsupportedEncodingException e) { } }
|
/**
* Create a transport connection object and connect it to the
* target server.
*
* @exception MessagingException
*/
|
Create a transport connection object and connect it to the target server
|
getConnection
|
{
"repo_name": "apache/geronimo-javamail",
"path": "geronimo-javamail_1.6/geronimo-javamail_1.6_provider/src/main/java/org/apache/geronimo/javamail/transport/nntp/NNTPConnection.java",
"license": "apache-2.0",
"size": 25570
}
|
[
"java.io.BufferedOutputStream",
"java.io.BufferedReader",
"java.io.IOException",
"java.io.InputStreamReader",
"java.io.OutputStreamWriter",
"java.io.PrintWriter",
"java.io.UnsupportedEncodingException",
"javax.mail.MessagingException"
] |
import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.UnsupportedEncodingException; import javax.mail.MessagingException;
|
import java.io.*; import javax.mail.*;
|
[
"java.io",
"javax.mail"
] |
java.io; javax.mail;
| 799,763
|
public Socket fork(ZThread.IAttachedRunnable runnable, Object... args)
{
return ZThread.fork(this, runnable, args);
}
|
Socket function(ZThread.IAttachedRunnable runnable, Object... args) { return ZThread.fork(this, runnable, args); }
|
/**
* Create an attached thread, An attached thread gets a ctx and a PAIR pipe back to its
* parent. It must monitor its pipe, and exit if the pipe becomes unreadable
*
* @param runnable attached thread
* @param args forked runnable args
* @return pipe or null if there was an error
*/
|
Create an attached thread, An attached thread gets a ctx and a PAIR pipe back to its parent. It must monitor its pipe, and exit if the pipe becomes unreadable
|
fork
|
{
"repo_name": "trevorbernard/jeromq",
"path": "src/main/java/org/zeromq/ZContext.java",
"license": "mpl-2.0",
"size": 9918
}
|
[
"org.zeromq.ZMQ"
] |
import org.zeromq.ZMQ;
|
import org.zeromq.*;
|
[
"org.zeromq"
] |
org.zeromq;
| 1,806,175
|
public static final String encodeCryptoBinaryFromBigInteger(BigInteger bigInt) {
// This code is really complicated, for now just use the Apache xmlsec lib code directly.
byte[] bigIntBytes = org.apache.xml.security.utils.Base64.encode(bigInt, bigInt.bitLength());
return Base64.encodeBytes(bigIntBytes);
}
/**
* Generates a public key from the given key spec.
*
* @param keySpec {@link KeySpec} specification for the key
* @param keyAlgorithm key generation algorithm, only DSA and RSA supported
*
* @return the generated {@link PublicKey}
|
static final String function(BigInteger bigInt) { byte[] bigIntBytes = org.apache.xml.security.utils.Base64.encode(bigInt, bigInt.bitLength()); return Base64.encodeBytes(bigIntBytes); } /** * Generates a public key from the given key spec. * * @param keySpec {@link KeySpec} specification for the key * @param keyAlgorithm key generation algorithm, only DSA and RSA supported * * @return the generated {@link PublicKey}
|
/**
* Encode a native Java BigInteger type to a base64-encoded ds:CryptoBinary value.
*
* @param bigInt the BigInteger value
* @return the encoded CryptoBinary value
*/
|
Encode a native Java BigInteger type to a base64-encoded ds:CryptoBinary value
|
encodeCryptoBinaryFromBigInteger
|
{
"repo_name": "duck1123/java-xmltooling",
"path": "src/main/java/org/opensaml/xml/security/keyinfo/KeyInfoHelper.java",
"license": "apache-2.0",
"size": 29397
}
|
[
"java.math.BigInteger",
"java.security.PublicKey",
"java.security.spec.KeySpec",
"org.opensaml.xml.util.Base64"
] |
import java.math.BigInteger; import java.security.PublicKey; import java.security.spec.KeySpec; import org.opensaml.xml.util.Base64;
|
import java.math.*; import java.security.*; import java.security.spec.*; import org.opensaml.xml.util.*;
|
[
"java.math",
"java.security",
"org.opensaml.xml"
] |
java.math; java.security; org.opensaml.xml;
| 2,419,562
|
public VirtualMachinePublicIpAddressConfiguration withDnsSettings(
VirtualMachinePublicIpAddressDnsSettingsConfiguration dnsSettings) {
if (this.innerProperties() == null) {
this.innerProperties = new VirtualMachinePublicIpAddressConfigurationProperties();
}
this.innerProperties().withDnsSettings(dnsSettings);
return this;
}
|
VirtualMachinePublicIpAddressConfiguration function( VirtualMachinePublicIpAddressDnsSettingsConfiguration dnsSettings) { if (this.innerProperties() == null) { this.innerProperties = new VirtualMachinePublicIpAddressConfigurationProperties(); } this.innerProperties().withDnsSettings(dnsSettings); return this; }
|
/**
* Set the dnsSettings property: The dns settings to be applied on the publicIP addresses .
*
* @param dnsSettings the dnsSettings value to set.
* @return the VirtualMachinePublicIpAddressConfiguration object itself.
*/
|
Set the dnsSettings property: The dns settings to be applied on the publicIP addresses
|
withDnsSettings
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachinePublicIpAddressConfiguration.java",
"license": "mit",
"size": 10337
}
|
[
"com.azure.resourcemanager.compute.fluent.models.VirtualMachinePublicIpAddressConfigurationProperties"
] |
import com.azure.resourcemanager.compute.fluent.models.VirtualMachinePublicIpAddressConfigurationProperties;
|
import com.azure.resourcemanager.compute.fluent.models.*;
|
[
"com.azure.resourcemanager"
] |
com.azure.resourcemanager;
| 640,498
|
@Test
public void testRemoveRdnAttributeValue() throws Exception
{
DirContext ctx = ( DirContext ) getWiredContext( getLdapServer() ).lookup( BASE );
// Create an entry
Attributes attrs = getPersonAttributes( "Bush", "Kate Bush" );
String rdn = "cn=Kate Bush";
ctx.createSubcontext( rdn, attrs );
// replace attribute cn with empty value (=> deletion)
Attribute attr = new BasicAttribute( "cn", "Kate Bush" );
ModificationItem item = new ModificationItem( DirContext.REMOVE_ATTRIBUTE, attr );
try
{
ctx.modifyAttributes( rdn, new ModificationItem[]
{ item } );
fail( "modify should fail" );
}
catch ( SchemaViolationException e )
{
// Expected behaviour
}
ctx.destroySubcontext( rdn );
}
|
void function() throws Exception { DirContext ctx = ( DirContext ) getWiredContext( getLdapServer() ).lookup( BASE ); Attributes attrs = getPersonAttributes( "Bush", STR ); String rdn = STR; ctx.createSubcontext( rdn, attrs ); Attribute attr = new BasicAttribute( "cn", STR ); ModificationItem item = new ModificationItem( DirContext.REMOVE_ATTRIBUTE, attr ); try { ctx.modifyAttributes( rdn, new ModificationItem[] { item } ); fail( STR ); } catch ( SchemaViolationException e ) { } ctx.destroySubcontext( rdn ); }
|
/**
* Create a person entry and try to remove an attribute from the Rdn
*/
|
Create a person entry and try to remove an attribute from the Rdn
|
testRemoveRdnAttributeValue
|
{
"repo_name": "lucastheisen/apache-directory-server",
"path": "server-integ/src/test/java/org/apache/directory/server/operations/modify/ModifyRemoveIT.java",
"license": "apache-2.0",
"size": 23240
}
|
[
"javax.naming.directory.Attribute",
"javax.naming.directory.Attributes",
"javax.naming.directory.BasicAttribute",
"javax.naming.directory.DirContext",
"javax.naming.directory.ModificationItem",
"javax.naming.directory.SchemaViolationException",
"org.apache.directory.server.integ.ServerIntegrationUtils",
"org.junit.Assert"
] |
import javax.naming.directory.Attribute; import javax.naming.directory.Attributes; import javax.naming.directory.BasicAttribute; import javax.naming.directory.DirContext; import javax.naming.directory.ModificationItem; import javax.naming.directory.SchemaViolationException; import org.apache.directory.server.integ.ServerIntegrationUtils; import org.junit.Assert;
|
import javax.naming.directory.*; import org.apache.directory.server.integ.*; import org.junit.*;
|
[
"javax.naming",
"org.apache.directory",
"org.junit"
] |
javax.naming; org.apache.directory; org.junit;
| 2,298,408
|
@ServiceMethod(returns = ReturnType.SINGLE)
Mono<CustomDomainInner> enableCustomHttpsAsync(
String resourceGroupName, String profileName, String endpointName, String customDomainName);
|
@ServiceMethod(returns = ReturnType.SINGLE) Mono<CustomDomainInner> enableCustomHttpsAsync( String resourceGroupName, String profileName, String endpointName, String customDomainName);
|
/**
* Enable https delivery of the custom domain.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName Name of the CDN profile which is unique within the resource group.
* @param endpointName Name of the endpoint under the profile which is unique globally.
* @param customDomainName Name of the custom domain within an endpoint.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response body on successful completion of {@link Mono}.
*/
|
Enable https delivery of the custom domain
|
enableCustomHttpsAsync
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/fluent/CustomDomainsClient.java",
"license": "mit",
"size": 34863
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.resourcemanager.cdn.fluent.models.CustomDomainInner"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.cdn.fluent.models.CustomDomainInner;
|
import com.azure.core.annotation.*; import com.azure.resourcemanager.cdn.fluent.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 2,011,901
|
public void trimValuesToNull()
{
if ( attributes != null )
{
for ( Attribute attribute : attributes )
{
attribute.setValue( StringUtils.trimToNull( attribute.getValue() ) );
}
}
}
|
void function() { if ( attributes != null ) { for ( Attribute attribute : attributes ) { attribute.setValue( StringUtils.trimToNull( attribute.getValue() ) ); } } }
|
/**
* Trims the value property of attribute values to null.
*/
|
Trims the value property of attribute values to null
|
trimValuesToNull
|
{
"repo_name": "troyel/dhis2-core",
"path": "dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/trackedentity/TrackedEntityInstance.java",
"license": "bsd-3-clause",
"size": 8477
}
|
[
"org.apache.commons.lang3.StringUtils"
] |
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.*;
|
[
"org.apache.commons"
] |
org.apache.commons;
| 2,211,475
|
public void readCharacteristic(BluetoothGattCharacteristic characteristic) {
if (mBluetoothAdapter == null || mBluetoothGatt == null) {
Log.w(TAG, "BluetoothAdapter not initialized");
return;
}
mBluetoothGatt.readCharacteristic(characteristic);
}
|
void function(BluetoothGattCharacteristic characteristic) { if (mBluetoothAdapter == null mBluetoothGatt == null) { Log.w(TAG, STR); return; } mBluetoothGatt.readCharacteristic(characteristic); }
|
/**
* Request a read on a given {@code BluetoothGattCharacteristic}.
* The read result is reported asynchronously through the
* {@code BluetoothGattCallback#
* onCharacteristicRead(android.bluetooth.BluetoothGatt, android.bluetooth.BluetoothGattCharacteristic, int)} callback.
* @param characteristic The characteristic to read from.
*/
|
Request a read on a given BluetoothGattCharacteristic. The read result is reported asynchronously through the BluetoothGattCallback# onCharacteristicRead(android.bluetooth.BluetoothGatt, android.bluetooth.BluetoothGattCharacteristic, int) callback
|
readCharacteristic
|
{
"repo_name": "h136799711/bluebao_android",
"path": "BlueBao/src/com/itboye/bluebao/ble/BluetoothLeService.java",
"license": "apache-2.0",
"size": 18845
}
|
[
"android.bluetooth.BluetoothGattCharacteristic",
"android.util.Log"
] |
import android.bluetooth.BluetoothGattCharacteristic; import android.util.Log;
|
import android.bluetooth.*; import android.util.*;
|
[
"android.bluetooth",
"android.util"
] |
android.bluetooth; android.util;
| 571,921
|
public void factoryReset() {
try {
mService.factoryReset();
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
|
void function() { try { mService.factoryReset(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } }
|
/**
* Resets all wifi manager settings back to factory defaults.
*
* @hide
*/
|
Resets all wifi manager settings back to factory defaults
|
factoryReset
|
{
"repo_name": "xorware/android_frameworks_base",
"path": "wifi/java/android/net/wifi/WifiManager.java",
"license": "apache-2.0",
"size": 97957
}
|
[
"android.os.RemoteException"
] |
import android.os.RemoteException;
|
import android.os.*;
|
[
"android.os"
] |
android.os;
| 1,051,474
|
private Promise<WorkspaceDto> getWorkspaceToStart() {
// get workspace from the given id
return this.workspaceServiceClient.getWorkspace(workspaceId);
}
|
Promise<WorkspaceDto> function() { return this.workspaceServiceClient.getWorkspace(workspaceId); }
|
/**
* Gets {@link Promise} of workspace according to workspace ID specified in parameter.
*/
|
Gets <code>Promise</code> of workspace according to workspace ID specified in parameter
|
getWorkspaceToStart
|
{
"repo_name": "kaloyan-raev/che",
"path": "ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/workspace/FactoryWorkspaceComponent.java",
"license": "epl-1.0",
"size": 8780
}
|
[
"org.eclipse.che.api.promises.client.Promise",
"org.eclipse.che.api.workspace.shared.dto.WorkspaceDto"
] |
import org.eclipse.che.api.promises.client.Promise; import org.eclipse.che.api.workspace.shared.dto.WorkspaceDto;
|
import org.eclipse.che.api.promises.client.*; import org.eclipse.che.api.workspace.shared.dto.*;
|
[
"org.eclipse.che"
] |
org.eclipse.che;
| 1,496,350
|
public Map<Integer, Symbol> getLocalObjectSymbols() {
return localObjectSymbols;
}
|
Map<Integer, Symbol> function() { return localObjectSymbols; }
|
/**
* Get the map of local object symbols.
*
* @return the map of local object symbols
*/
|
Get the map of local object symbols
|
getLocalObjectSymbols
|
{
"repo_name": "mcai/Archimulator",
"path": "src/main/java/archimulator/os/elf/ElfFile.java",
"license": "mit",
"size": 14227
}
|
[
"java.util.Map"
] |
import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 605,688
|
static public void prependAndModifyStartCode(MutableGCodeSource sourceGCode, MutableGCodeSource startGCode)
{
MutableGCodeSource newStart = new MutableGCodeSource();
///modify local copy of start code based on settings
int matched = 0;
for(String line : startGCode)
{
Pattern p = Pattern.compile("^M104\\s+S(\\d+)\\s+T(\\d)\\s+(.*)\\s*$");
Matcher m = p.matcher(line);
if(m.matches() ){
int newTemp = Base.preferences.getInt("replicatorg.skeinforge.printOMatic5D.printTemp", 220);
Base.logger.finer("new temp" + newTemp);
String newStr = "M104 S" + newTemp + " T"+ m.group(2);
if(m.groupCount() >= 3)
newStr = newStr + " " + m.group(3) ;
newStr = newStr + " (temp updated by printOMatic)";
Base.logger.finer("New Temp String: " + newStr);
matched++;
newStart.add(newStr);
}
else {
newStart.add(line);
}
}
sourceGCode.add(0, newStart);
Base.logger.finer("printTemp replace count : " + matched);
}
|
static void function(MutableGCodeSource sourceGCode, MutableGCodeSource startGCode) { MutableGCodeSource newStart = new MutableGCodeSource(); int matched = 0; for(String line : startGCode) { Pattern p = Pattern.compile(STR); Matcher m = p.matcher(line); if(m.matches() ){ int newTemp = Base.preferences.getInt(STR, 220); Base.logger.finer(STR + newTemp); String newStr = STR + newTemp + STR+ m.group(2); if(m.groupCount() >= 3) newStr = newStr + " " + m.group(3) ; newStr = newStr + STR; Base.logger.finer(STR + newStr); matched++; newStart.add(newStr); } else { newStart.add(line); } } sourceGCode.add(0, newStart); Base.logger.finer(STR + matched); }
|
/**
* prepends start code to the file, this may modify some start code data based on settings.
* @param sourceGCode code to append start to
* @param startGCode code to hack/verify/modify and append to the start of sourceGCode
*/
|
prepends start code to the file, this may modify some start code data based on settings
|
prependAndModifyStartCode
|
{
"repo_name": "makerbot/ReplicatorG",
"path": "src/replicatorg/plugin/toolpath/skeinforge/SkeinforgePostProcessor.java",
"license": "gpl-2.0",
"size": 13894
}
|
[
"java.util.regex.Matcher",
"java.util.regex.Pattern"
] |
import java.util.regex.Matcher; import java.util.regex.Pattern;
|
import java.util.regex.*;
|
[
"java.util"
] |
java.util;
| 224,020
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.