method
stringlengths 13
441k
| clean_method
stringlengths 7
313k
| doc
stringlengths 17
17.3k
| comment
stringlengths 3
1.42k
| method_name
stringlengths 1
273
| extra
dict | imports
list | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
list | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
|---|---|---|---|---|---|---|---|---|---|---|---|
public static Tuple testTuple(List<Object> values) {
return testTuple(values, new MkTupleParam());
}
|
static Tuple function(List<Object> values) { return testTuple(values, new MkTupleParam()); }
|
/**
* Create a {@link org.apache.storm.tuple.Tuple} for use with testing.
* @param values the values to appear in the tuple
*/
|
Create a <code>org.apache.storm.tuple.Tuple</code> for use with testing
|
testTuple
|
{
"repo_name": "kishorvpatil/incubator-storm",
"path": "storm-server/src/main/java/org/apache/storm/Testing.java",
"license": "apache-2.0",
"size": 26799
}
|
[
"java.util.List",
"org.apache.storm.testing.MkTupleParam",
"org.apache.storm.tuple.Tuple"
] |
import java.util.List; import org.apache.storm.testing.MkTupleParam; import org.apache.storm.tuple.Tuple;
|
import java.util.*; import org.apache.storm.testing.*; import org.apache.storm.tuple.*;
|
[
"java.util",
"org.apache.storm"
] |
java.util; org.apache.storm;
| 1,546,376
|
public Set<Plot> getPlots(PlotArea area, UUID uuid) {
ArrayList<Plot> myplots = new ArrayList<>();
for (Plot plot : getPlots(area)) {
if (plot.hasOwner()) {
if (plot.isOwnerAbs(uuid)) {
myplots.add(plot);
}
}
}
return new HashSet<>(myplots);
}
|
Set<Plot> function(PlotArea area, UUID uuid) { ArrayList<Plot> myplots = new ArrayList<>(); for (Plot plot : getPlots(area)) { if (plot.hasOwner()) { if (plot.isOwnerAbs(uuid)) { myplots.add(plot); } } } return new HashSet<>(myplots); }
|
/**
* Get all plots by a UUID in an area.
* @param area
* @param uuid
* @return Set of plot
*/
|
Get all plots by a UUID in an area
|
getPlots
|
{
"repo_name": "SynergyMC/PlotSquared",
"path": "Core/src/main/java/com/intellectualcrafters/plot/PS.java",
"license": "gpl-3.0",
"size": 93631
}
|
[
"com.intellectualcrafters.plot.object.Plot",
"com.intellectualcrafters.plot.object.PlotArea",
"java.util.ArrayList",
"java.util.HashSet",
"java.util.Set"
] |
import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.PlotArea; import java.util.ArrayList; import java.util.HashSet; import java.util.Set;
|
import com.intellectualcrafters.plot.object.*; import java.util.*;
|
[
"com.intellectualcrafters.plot",
"java.util"
] |
com.intellectualcrafters.plot; java.util;
| 617,380
|
public static <T extends TBase> T detectAndDeserialize(final byte[] bytes, final T thriftObj) throws TException
{
Preconditions.checkNotNull(thriftObj);
try {
final byte[] src = decodeB64IfNeeded(bytes);
final TProtocolFactory protocolFactory = TProtocolUtil.guessProtocolFactory(src, null);
Preconditions.checkNotNull(protocolFactory);
if (protocolFactory instanceof TCompactProtocol.Factory) {
DESERIALIZER_COMPACT.get().deserialize(thriftObj, src);
} else if (protocolFactory instanceof TBinaryProtocol.Factory) {
DESERIALIZER_BINARY.get().deserialize(thriftObj, src);
} else {
DESERIALIZER_JSON.get().deserialize(thriftObj, src);
}
}
catch (final IllegalArgumentException e) {
throw new TException(e);
}
return thriftObj;
}
|
static <T extends TBase> T function(final byte[] bytes, final T thriftObj) throws TException { Preconditions.checkNotNull(thriftObj); try { final byte[] src = decodeB64IfNeeded(bytes); final TProtocolFactory protocolFactory = TProtocolUtil.guessProtocolFactory(src, null); Preconditions.checkNotNull(protocolFactory); if (protocolFactory instanceof TCompactProtocol.Factory) { DESERIALIZER_COMPACT.get().deserialize(thriftObj, src); } else if (protocolFactory instanceof TBinaryProtocol.Factory) { DESERIALIZER_BINARY.get().deserialize(thriftObj, src); } else { DESERIALIZER_JSON.get().deserialize(thriftObj, src); } } catch (final IllegalArgumentException e) { throw new TException(e); } return thriftObj; }
|
/**
* Deserializes byte-array into thrift object.
* <p>
* Supporting binary, compact and json protocols,
* and the byte array could be or not be encoded by Base64.
*
* @param bytes the byte-array to deserialize
* @param thriftObj the output thrift object
*
* @return the output thrift object, or null if error occurs
*/
|
Deserializes byte-array into thrift object. Supporting binary, compact and json protocols, and the byte array could be or not be encoded by Base64
|
detectAndDeserialize
|
{
"repo_name": "nishantmonu51/druid",
"path": "extensions-contrib/thrift-extensions/src/main/java/org/apache/druid/data/input/thrift/ThriftDeserialization.java",
"license": "apache-2.0",
"size": 4138
}
|
[
"com.google.common.base.Preconditions",
"org.apache.thrift.TBase",
"org.apache.thrift.TException",
"org.apache.thrift.protocol.TBinaryProtocol",
"org.apache.thrift.protocol.TCompactProtocol",
"org.apache.thrift.protocol.TProtocolFactory",
"org.apache.thrift.protocol.TProtocolUtil"
] |
import com.google.common.base.Preconditions; import org.apache.thrift.TBase; import org.apache.thrift.TException; import org.apache.thrift.protocol.TBinaryProtocol; import org.apache.thrift.protocol.TCompactProtocol; import org.apache.thrift.protocol.TProtocolFactory; import org.apache.thrift.protocol.TProtocolUtil;
|
import com.google.common.base.*; import org.apache.thrift.*; import org.apache.thrift.protocol.*;
|
[
"com.google.common",
"org.apache.thrift"
] |
com.google.common; org.apache.thrift;
| 2,337,516
|
public ColorSpace getColorSpace() {
return this.cm.getColorSpace();
}
|
ColorSpace function() { return this.cm.getColorSpace(); }
|
/**
* Returns the image's color space.
* @return the color space
*/
|
Returns the image's color space
|
getColorSpace
|
{
"repo_name": "apache/xml-graphics-commons",
"path": "src/main/java/org/apache/xmlgraphics/image/loader/impl/ImageRawPNG.java",
"license": "apache-2.0",
"size": 4985
}
|
[
"java.awt.color.ColorSpace"
] |
import java.awt.color.ColorSpace;
|
import java.awt.color.*;
|
[
"java.awt"
] |
java.awt;
| 387,392
|
@Test
public void testViewWithFilesAndTables() throws Exception{
// use the default columns for this type.
defaultSchema = tableManagerSupport.getDefaultTableViewColumns(ViewType.file_and_table);
// Add a table to the project
TableEntity table = new TableEntity();
table.setName("someTable");
table.setParentId(project.getId());
String childTableId = entityManager.createEntity(adminUserInfo, table, null);
table = entityManager.getEntity(adminUserInfo, childTableId, TableEntity.class);
// create the view that includes both files and tables.
ViewType type = ViewType.file_and_table;
List<String> scope = Lists.newArrayList(project.getId());
fileViewId = createView(type, scope);
// wait for the view.
waitForEntityReplication(fileViewId, childTableId);
// Query for the values as strings.
Query query = new Query();
query.setSql("select * from "+fileViewId);
query.setIncludeEntityEtag(true);
int rowCount = 4;
QueryResultBundle resuls = waitForConsistentQuery(adminUserInfo, query, rowCount);
List<Row> rows = extractRows(resuls);
assertEquals(4, rows.size());
// The last row should be the table
Row last = rows.get(3);
assertEquals(KeyFactory.stringToKey(table.getId()), last.getRowId());
assertEquals(table.getEtag(), last.getEtag());
}
|
void function() throws Exception{ defaultSchema = tableManagerSupport.getDefaultTableViewColumns(ViewType.file_and_table); TableEntity table = new TableEntity(); table.setName(STR); table.setParentId(project.getId()); String childTableId = entityManager.createEntity(adminUserInfo, table, null); table = entityManager.getEntity(adminUserInfo, childTableId, TableEntity.class); ViewType type = ViewType.file_and_table; List<String> scope = Lists.newArrayList(project.getId()); fileViewId = createView(type, scope); waitForEntityReplication(fileViewId, childTableId); Query query = new Query(); query.setSql(STR+fileViewId); query.setIncludeEntityEtag(true); int rowCount = 4; QueryResultBundle resuls = waitForConsistentQuery(adminUserInfo, query, rowCount); List<Row> rows = extractRows(resuls); assertEquals(4, rows.size()); Row last = rows.get(3); assertEquals(KeyFactory.stringToKey(table.getId()), last.getRowId()); assertEquals(table.getEtag(), last.getEtag()); }
|
/**
* PLFM-4270 is request to add support views with both files and tables.
* @throws Exception
*/
|
PLFM-4270 is request to add support views with both files and tables
|
testViewWithFilesAndTables
|
{
"repo_name": "hhu94/Synapse-Repository-Services",
"path": "services/workers/src/test/java/org/sagebionetworks/table/worker/TableViewIntegrationTest.java",
"license": "apache-2.0",
"size": 52421
}
|
[
"com.google.common.collect.Lists",
"java.util.List",
"org.junit.Assert",
"org.sagebionetworks.repo.model.jdo.KeyFactory",
"org.sagebionetworks.repo.model.table.Query",
"org.sagebionetworks.repo.model.table.QueryResultBundle",
"org.sagebionetworks.repo.model.table.Row",
"org.sagebionetworks.repo.model.table.TableEntity",
"org.sagebionetworks.repo.model.table.ViewType"
] |
import com.google.common.collect.Lists; import java.util.List; import org.junit.Assert; import org.sagebionetworks.repo.model.jdo.KeyFactory; import org.sagebionetworks.repo.model.table.Query; import org.sagebionetworks.repo.model.table.QueryResultBundle; import org.sagebionetworks.repo.model.table.Row; import org.sagebionetworks.repo.model.table.TableEntity; import org.sagebionetworks.repo.model.table.ViewType;
|
import com.google.common.collect.*; import java.util.*; import org.junit.*; import org.sagebionetworks.repo.model.jdo.*; import org.sagebionetworks.repo.model.table.*;
|
[
"com.google.common",
"java.util",
"org.junit",
"org.sagebionetworks.repo"
] |
com.google.common; java.util; org.junit; org.sagebionetworks.repo;
| 476,547
|
protected boolean filterOutObject(PhysicalObject object) {
return false;
}
|
boolean function(PhysicalObject object) { return false; }
|
/**
* Decide whether to filter out a given PhysicalObject instance due to some state changing in
* the object being observed.
* @param object an object in the fixture list
* @return true if the object should be ignored
*/
|
Decide whether to filter out a given PhysicalObject instance due to some state changing in the object being observed
|
filterOutObject
|
{
"repo_name": "not-my-name/AAMAS_Conference",
"path": "src/main/java/za/redbridge/simulator/sensor/AgentSensor.java",
"license": "apache-2.0",
"size": 15177
}
|
[
"za.redbridge.simulator.object.PhysicalObject"
] |
import za.redbridge.simulator.object.PhysicalObject;
|
import za.redbridge.simulator.object.*;
|
[
"za.redbridge.simulator"
] |
za.redbridge.simulator;
| 1,847,922
|
private void parseTransitions(SubProcess subProcess, Node transitionsNode) {
NodeList transitionNodes = transitionsNode.getChildNodes();
ConnectionsParser parser = new ConnectionsParser(this.diagram, this.output);
for (int i = 0; i < transitionNodes.getLength(); i++) {
Node transitionNode = transitionNodes.item(i);
if ((transitionNode.getLocalName() != null) &&
transitionNode.getLocalName().equals("Transition")) {
Transition transition =
parser.parseTransition(transitionNodes.item(i));
subProcess.addTransition(transition);
this.diagram.putObject(transition.getId(), transition);
}
}
}
|
void function(SubProcess subProcess, Node transitionsNode) { NodeList transitionNodes = transitionsNode.getChildNodes(); ConnectionsParser parser = new ConnectionsParser(this.diagram, this.output); for (int i = 0; i < transitionNodes.getLength(); i++) { Node transitionNode = transitionNodes.item(i); if ((transitionNode.getLocalName() != null) && transitionNode.getLocalName().equals(STR)) { Transition transition = parser.parseTransition(transitionNodes.item(i)); subProcess.addTransition(transition); this.diagram.putObject(transition.getId(), transition); } } }
|
/**
* Parses the transition nodes contained in the given transitions node.
* It creates a transition for each transition node and adds this transition
* to the sub-process transitions and to the diagram.
*
* @param subProcess The sub-process to add the transitions to.
* @param transitionsNode The transitions node to be parse.
*/
|
Parses the transition nodes contained in the given transitions node. It creates a transition for each transition node and adds this transition to the sub-process transitions and to the diagram
|
parseTransitions
|
{
"repo_name": "grasscrm/gdesigner",
"path": "editor/server/src/de/hpi/bpel4chor/parser/SubProcessParser.java",
"license": "apache-2.0",
"size": 7199
}
|
[
"de.hpi.bpel4chor.model.SubProcess",
"de.hpi.bpel4chor.model.connections.Transition",
"org.w3c.dom.Node",
"org.w3c.dom.NodeList"
] |
import de.hpi.bpel4chor.model.SubProcess; import de.hpi.bpel4chor.model.connections.Transition; import org.w3c.dom.Node; import org.w3c.dom.NodeList;
|
import de.hpi.bpel4chor.model.*; import de.hpi.bpel4chor.model.connections.*; import org.w3c.dom.*;
|
[
"de.hpi.bpel4chor",
"org.w3c.dom"
] |
de.hpi.bpel4chor; org.w3c.dom;
| 757,329
|
void renderOverlays(Map<Long, Integer> overlays)
{
PlaneDef pDef = new PlaneDef();
pDef.t = getDefaultT();
pDef.z = getDefaultZ();
pDef.slice = omero.romio.XY.value;
state = ImViewer.LOADING_IMAGE;
OverlaysRenderer loader = new OverlaysRenderer(component, ctx,
getPixelsID(), pDef, overlayTableID, overlays);
loader.load();
}
double getOriginalRatio() { return originalRatio; }
|
void renderOverlays(Map<Long, Integer> overlays) { PlaneDef pDef = new PlaneDef(); pDef.t = getDefaultT(); pDef.z = getDefaultZ(); pDef.slice = omero.romio.XY.value; state = ImViewer.LOADING_IMAGE; OverlaysRenderer loader = new OverlaysRenderer(component, ctx, getPixelsID(), pDef, overlayTableID, overlays); loader.load(); } double getOriginalRatio() { return originalRatio; }
|
/**
* Renders the overlays.
*
* @param overlays
*/
|
Renders the overlays
|
renderOverlays
|
{
"repo_name": "MontpellierRessourcesImagerie/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerModel.java",
"license": "gpl-2.0",
"size": 85080
}
|
[
"java.util.Map",
"org.openmicroscopy.shoola.agents.imviewer.OverlaysRenderer"
] |
import java.util.Map; import org.openmicroscopy.shoola.agents.imviewer.OverlaysRenderer;
|
import java.util.*; import org.openmicroscopy.shoola.agents.imviewer.*;
|
[
"java.util",
"org.openmicroscopy.shoola"
] |
java.util; org.openmicroscopy.shoola;
| 2,881,919
|
List<MessageDescriptor> getWarnings();
|
List<MessageDescriptor> getWarnings();
|
/**
* Gets warnings.
*
* @return the warnings
*/
|
Gets warnings
|
getWarnings
|
{
"repo_name": "creamer/cas",
"path": "api/cas-server-core-api-authentication/src/main/java/org/apereo/cas/authentication/HandlerResult.java",
"license": "apache-2.0",
"size": 963
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 616,912
|
@Override
public void onRequestCard(Context context) {
if (!NetUtils.isConnected(context)) {
return;
}
// Get station for current campus
LocationManager locMan = new LocationManager(context);
String station = locMan.getStation();
if (station == null) {
return;
}
List<Departure> cur = getDeparturesFromExternal(context, station);
if (cur == null) {
return;
}
MVVCard card = new MVVCard(context);
card.setStation(new Pair<>(station, station));
card.setDepartures(cur);
card.apply();
}
|
void function(Context context) { if (!NetUtils.isConnected(context)) { return; } LocationManager locMan = new LocationManager(context); String station = locMan.getStation(); if (station == null) { return; } List<Departure> cur = getDeparturesFromExternal(context, station); if (cur == null) { return; } MVVCard card = new MVVCard(context); card.setStation(new Pair<>(station, station)); card.setDepartures(cur); card.apply(); }
|
/**
* Inserts a MVV card for the nearest public transport station
*
* @param context Context
*/
|
Inserts a MVV card for the nearest public transport station
|
onRequestCard
|
{
"repo_name": "brdvlps/TumCampusApp",
"path": "app/src/main/java/de/tum/in/tumcampusapp/models/managers/TransportManager.java",
"license": "gpl-2.0",
"size": 12046
}
|
[
"android.content.Context",
"android.util.Pair",
"de.tum.in.tumcampusapp.auxiliary.NetUtils",
"de.tum.in.tumcampusapp.cards.MVVCard",
"java.util.List"
] |
import android.content.Context; import android.util.Pair; import de.tum.in.tumcampusapp.auxiliary.NetUtils; import de.tum.in.tumcampusapp.cards.MVVCard; import java.util.List;
|
import android.content.*; import android.util.*; import de.tum.in.tumcampusapp.auxiliary.*; import de.tum.in.tumcampusapp.cards.*; import java.util.*;
|
[
"android.content",
"android.util",
"de.tum.in",
"java.util"
] |
android.content; android.util; de.tum.in; java.util;
| 940,097
|
public void authorize(Privilege[] readRequiredPriv,
Privilege[] writeRequiredPriv) throws HiveException,
AuthorizationException;
|
void function(Privilege[] readRequiredPriv, Privilege[] writeRequiredPriv) throws HiveException, AuthorizationException;
|
/**
* Authorization user level privileges.
*
* @param readRequiredPriv
* a list of privileges needed for inputs.
* @param writeRequiredPriv
* a list of privileges needed for outputs.
* @throws HiveException
* @throws AuthorizationException
*/
|
Authorization user level privileges
|
authorize
|
{
"repo_name": "vergilchiu/hive",
"path": "ql/src/java/org/apache/hadoop/hive/ql/security/authorization/HiveAuthorizationProvider.java",
"license": "apache-2.0",
"size": 4401
}
|
[
"org.apache.hadoop.hive.ql.metadata.AuthorizationException",
"org.apache.hadoop.hive.ql.metadata.HiveException"
] |
import org.apache.hadoop.hive.ql.metadata.AuthorizationException; import org.apache.hadoop.hive.ql.metadata.HiveException;
|
import org.apache.hadoop.hive.ql.metadata.*;
|
[
"org.apache.hadoop"
] |
org.apache.hadoop;
| 2,647,521
|
protected org.springframework.core.io.ResourceLoader getResourceLoader(Class<?> testClass) {
return new ResourceLoader(testClass);
}
public static class ResourceLoader extends ClassRelativeResourceLoader {
private static final String COLON = ":";
private static final String SETUP_META = GIVEN + COLON;
private static final String VERIFICATION_META = THEN + COLON;
public ResourceLoader(Class<?> clazz) {
super(clazz);
}
|
org.springframework.core.io.ResourceLoader function(Class<?> testClass) { return new ResourceLoader(testClass); } public static class ResourceLoader extends ClassRelativeResourceLoader { private static final String COLON = ":"; private static final String SETUP_META = GIVEN + COLON; private static final String VERIFICATION_META = THEN + COLON; public ResourceLoader(Class<?> clazz) { super(clazz); }
|
/**
* Gets the {@link org.springframework.core.io.ResourceLoader} that will be used to load the dataset {@link Resource}s.
*
* @param testClass The class under test
* @return a resource loader
*/
|
Gets the <code>org.springframework.core.io.ResourceLoader</code> that will be used to load the dataset <code>Resource</code>s
|
getResourceLoader
|
{
"repo_name": "Hippoom/spring-test-dbunit-template",
"path": "lib/src/main/java/com/github/hippoom/springtestdbunit/dataset/GivenWhenThenFlatXmlDataSetLoader.java",
"license": "mit",
"size": 11040
}
|
[
"org.springframework.core.io.ClassRelativeResourceLoader"
] |
import org.springframework.core.io.ClassRelativeResourceLoader;
|
import org.springframework.core.io.*;
|
[
"org.springframework.core"
] |
org.springframework.core;
| 646,435
|
@Test
public void checkSetTimestep() {
// Set the times reported by the fake ParaView web client.
fakeClient.setTimes(1.0, 2.0);
// Attempting to set the timestep with no connection should return
// false.
try {
assertFalse(proxy.setTimestep(1).get());
} catch (InterruptedException | ExecutionException e) {
fail("AbstractParaViewProxyTester error: "
+ "Exception thrown while setting the timestep.");
}
// Set the connection.
try {
proxy.open(connection).get();
} catch (InterruptedException | ExecutionException e) {
fail("AbstractParaViewProxyTester error: "
+ "Failed to set the connection.");
}
// Setting a valid timestep the first time should return true. The
// second time it should also return true, as the timestep is currently
// set to that value.
try {
assertTrue(proxy.setTimestep(1).get());
assertFalse(proxy.setTimestep(1).get());
} catch (InterruptedException | ExecutionException e) {
fail("AbstractParaViewProxyTester error: "
+ "Exception thrown while setting the timestep.");
}
// Attempting to set an invalid property always false.
try {
assertFalse(proxy.setTimestep(-1).get());
assertFalse(proxy.setTimestep(2).get());
} catch (InterruptedException | ExecutionException e) {
fail("AbstractParaViewProxyTester error: "
+ "Exception thrown while setting an invalid timestep.");
}
return;
}
|
void function() { fakeClient.setTimes(1.0, 2.0); try { assertFalse(proxy.setTimestep(1).get()); } catch (InterruptedException ExecutionException e) { fail(STR + STR); } try { proxy.open(connection).get(); } catch (InterruptedException ExecutionException e) { fail(STR + STR); } try { assertTrue(proxy.setTimestep(1).get()); assertFalse(proxy.setTimestep(1).get()); } catch (InterruptedException ExecutionException e) { fail(STR + STR); } try { assertFalse(proxy.setTimestep(-1).get()); assertFalse(proxy.setTimestep(2).get()); } catch (InterruptedException ExecutionException e) { fail(STR + STR); } return; }
|
/**
* Checks that the timestep for the proxy can be set and the return value of
* the operation.
*/
|
Checks that the timestep for the proxy can be set and the return value of the operation
|
checkSetTimestep
|
{
"repo_name": "jarrah42/eavp",
"path": "org.eclipse.eavp.viz.service.paraview.test/src/org/eclipse/eavp/viz/service/paraview/proxy/test/AbstractParaViewProxyTester.java",
"license": "epl-1.0",
"size": 24215
}
|
[
"java.util.concurrent.ExecutionException",
"org.junit.Assert"
] |
import java.util.concurrent.ExecutionException; import org.junit.Assert;
|
import java.util.concurrent.*; import org.junit.*;
|
[
"java.util",
"org.junit"
] |
java.util; org.junit;
| 319,437
|
void onFailure(String reason) throws ChannelException;
|
void onFailure(String reason) throws ChannelException;
|
/**
* Called when submission fails due to network or channel failure.
*
* @param reason indicates reason for failure
* @throws ChannelException if the channel fails when processing the failure
*/
|
Called when submission fails due to network or channel failure
|
onFailure
|
{
"repo_name": "vega113/incubator-wave",
"path": "wave/src/main/java/org/waveprotocol/wave/concurrencycontrol/channel/SubmitCallback.java",
"license": "apache-2.0",
"size": 2001
}
|
[
"org.waveprotocol.wave.concurrencycontrol.common.ChannelException"
] |
import org.waveprotocol.wave.concurrencycontrol.common.ChannelException;
|
import org.waveprotocol.wave.concurrencycontrol.common.*;
|
[
"org.waveprotocol.wave"
] |
org.waveprotocol.wave;
| 2,663,493
|
public void replaceCard(Card card) {
mForceReplaceInnerLayout=true;
refreshCard(card);
mForceReplaceInnerLayout=false;
}
//--------------------------------------------------------------------------
// Setup methods
//--------------------------------------------------------------------------
|
void function(Card card) { mForceReplaceInnerLayout=true; refreshCard(card); mForceReplaceInnerLayout=false; }
|
/**
* Refreshes the card content and replaces the inner layout elements (it inflates layouts again!)
*
* @param card
*/
|
Refreshes the card content and replaces the inner layout elements (it inflates layouts again!)
|
replaceCard
|
{
"repo_name": "tajchert/CEEHack",
"path": "cardslib/library/src/main/src/it/gmariotti/cardslib/library/view/CardView.java",
"license": "apache-2.0",
"size": 31590
}
|
[
"it.gmariotti.cardslib.library.internal.Card"
] |
import it.gmariotti.cardslib.library.internal.Card;
|
import it.gmariotti.cardslib.library.internal.*;
|
[
"it.gmariotti.cardslib"
] |
it.gmariotti.cardslib;
| 1,757,689
|
public boolean ensureSomeNonStoppedRegionServersAvailable(final int num)
throws IOException {
boolean startedServer = ensureSomeRegionServersAvailable(num);
int nonStoppedServers = 0;
for (JVMClusterUtil.RegionServerThread rst :
getMiniHBaseCluster().getRegionServerThreads()) {
HRegionServer hrs = rst.getRegionServer();
if (hrs.isStopping() || hrs.isStopped()) {
LOG.info("A region server is stopped or stopping:"+hrs);
} else {
nonStoppedServers++;
}
}
for (int i=nonStoppedServers; i<num; ++i) {
LOG.info("Started new server=" + getMiniHBaseCluster().startRegionServer());
startedServer = true;
}
return startedServer;
}
|
boolean function(final int num) throws IOException { boolean startedServer = ensureSomeRegionServersAvailable(num); int nonStoppedServers = 0; for (JVMClusterUtil.RegionServerThread rst : getMiniHBaseCluster().getRegionServerThreads()) { HRegionServer hrs = rst.getRegionServer(); if (hrs.isStopping() hrs.isStopped()) { LOG.info(STR+hrs); } else { nonStoppedServers++; } } for (int i=nonStoppedServers; i<num; ++i) { LOG.info(STR + getMiniHBaseCluster().startRegionServer()); startedServer = true; } return startedServer; }
|
/**
* Make sure that at least the specified number of region servers
* are running. We don't count the ones that are currently stopping or are
* stopped.
* @param num minimum number of region servers that should be running
* @return true if we started some servers
* @throws IOException
*/
|
Make sure that at least the specified number of region servers are running. We don't count the ones that are currently stopping or are stopped
|
ensureSomeNonStoppedRegionServersAvailable
|
{
"repo_name": "apurtell/hbase",
"path": "hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseTestingUtility.java",
"license": "apache-2.0",
"size": 169342
}
|
[
"java.io.IOException",
"org.apache.hadoop.hbase.regionserver.HRegionServer",
"org.apache.hadoop.hbase.util.JVMClusterUtil"
] |
import java.io.IOException; import org.apache.hadoop.hbase.regionserver.HRegionServer; import org.apache.hadoop.hbase.util.JVMClusterUtil;
|
import java.io.*; import org.apache.hadoop.hbase.regionserver.*; import org.apache.hadoop.hbase.util.*;
|
[
"java.io",
"org.apache.hadoop"
] |
java.io; org.apache.hadoop;
| 2,074,920
|
public AUID getDataEssenceCoding()
throws PropertyNotPresentException;
|
AUID function() throws PropertyNotPresentException;
|
/**
* <p>Returns the data essence coding property of this data essence descriptor.</p>
*
* @return Data essence coding property of this data essence descriptor.
*
* @throws PropertyNotPresentException The optional data essence coding property
* is not present in this data essence descriptor.
*/
|
Returns the data essence coding property of this data essence descriptor
|
getDataEssenceCoding
|
{
"repo_name": "AMWA-TV/maj",
"path": "src/main/java/tv/amwa/maj/model/DataEssenceDescriptor.java",
"license": "apache-2.0",
"size": 2839
}
|
[
"tv.amwa.maj.exception.PropertyNotPresentException"
] |
import tv.amwa.maj.exception.PropertyNotPresentException;
|
import tv.amwa.maj.exception.*;
|
[
"tv.amwa.maj"
] |
tv.amwa.maj;
| 1,788,054
|
@Named("securityGroup:create")
@POST
@Path("/os-security-group-rules")
@SelectJson("security_group_rule")
@Produces(MediaType.APPLICATION_JSON)
@MapBinder(BindSecurityGroupRuleToJsonPayload.class)
@Fallback(NullOnNotFoundOr404.class)
@Nullable
SecurityGroupRule createRuleAllowingCidrBlock(
@PayloadParam("parent_group_id") String parentGroup, Ingress ip_protocol,
@PayloadParam("cidr") String sourceCidr);
|
@Named(STR) @Path(STR) @SelectJson(STR) @Produces(MediaType.APPLICATION_JSON) @MapBinder(BindSecurityGroupRuleToJsonPayload.class) @Fallback(NullOnNotFoundOr404.class) SecurityGroupRule createRuleAllowingCidrBlock( @PayloadParam(STR) String parentGroup, Ingress ip_protocol, @PayloadParam("cidr") String sourceCidr);
|
/**
* Create a Security Group Rule.
*
* @return a new Security Group Rule
*/
|
Create a Security Group Rule
|
createRuleAllowingCidrBlock
|
{
"repo_name": "yanzhijun/jclouds-aliyun",
"path": "apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/SecurityGroupApi.java",
"license": "apache-2.0",
"size": 5151
}
|
[
"javax.inject.Named",
"javax.ws.rs.Path",
"javax.ws.rs.Produces",
"javax.ws.rs.core.MediaType",
"org.jclouds.Fallbacks",
"org.jclouds.openstack.nova.v2_0.binders.BindSecurityGroupRuleToJsonPayload",
"org.jclouds.openstack.nova.v2_0.domain.Ingress",
"org.jclouds.openstack.nova.v2_0.domain.SecurityGroupRule",
"org.jclouds.rest.annotations.Fallback",
"org.jclouds.rest.annotations.MapBinder",
"org.jclouds.rest.annotations.PayloadParam",
"org.jclouds.rest.annotations.SelectJson"
] |
import javax.inject.Named; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import org.jclouds.Fallbacks; import org.jclouds.openstack.nova.v2_0.binders.BindSecurityGroupRuleToJsonPayload; import org.jclouds.openstack.nova.v2_0.domain.Ingress; import org.jclouds.openstack.nova.v2_0.domain.SecurityGroupRule; import org.jclouds.rest.annotations.Fallback; import org.jclouds.rest.annotations.MapBinder; import org.jclouds.rest.annotations.PayloadParam; import org.jclouds.rest.annotations.SelectJson;
|
import javax.inject.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import org.jclouds.*; import org.jclouds.openstack.nova.v2_0.binders.*; import org.jclouds.openstack.nova.v2_0.domain.*; import org.jclouds.rest.annotations.*;
|
[
"javax.inject",
"javax.ws",
"org.jclouds",
"org.jclouds.openstack",
"org.jclouds.rest"
] |
javax.inject; javax.ws; org.jclouds; org.jclouds.openstack; org.jclouds.rest;
| 1,393,233
|
private short getTypeFromXObject(XObject object) {
switch (object.getType()) {
case XObject.CLASS_BOOLEAN: return BOOLEAN_TYPE;
case XObject.CLASS_NODESET: return UNORDERED_NODE_ITERATOR_TYPE;
case XObject.CLASS_NUMBER: return NUMBER_TYPE;
case XObject.CLASS_STRING: return STRING_TYPE;
// XPath 2.0 types
// case XObject.CLASS_DATE:
// case XObject.CLASS_DATETIME:
// case XObject.CLASS_DTDURATION:
// case XObject.CLASS_GDAY:
// case XObject.CLASS_GMONTH:
// case XObject.CLASS_GMONTHDAY:
// case XObject.CLASS_GYEAR:
// case XObject.CLASS_GYEARMONTH:
// case XObject.CLASS_TIME:
// case XObject.CLASS_YMDURATION: return STRING_TYPE; // treat all date types as strings?
case XObject.CLASS_RTREEFRAG: return UNORDERED_NODE_ITERATOR_TYPE;
case XObject.CLASS_NULL: return ANY_TYPE; // throw exception ?
default: return ANY_TYPE; // throw exception ?
}
}
|
short function(XObject object) { switch (object.getType()) { case XObject.CLASS_BOOLEAN: return BOOLEAN_TYPE; case XObject.CLASS_NODESET: return UNORDERED_NODE_ITERATOR_TYPE; case XObject.CLASS_NUMBER: return NUMBER_TYPE; case XObject.CLASS_STRING: return STRING_TYPE; case XObject.CLASS_RTREEFRAG: return UNORDERED_NODE_ITERATOR_TYPE; case XObject.CLASS_NULL: return ANY_TYPE; default: return ANY_TYPE; } }
|
/**
* Given an XObject, determine the corresponding DOM XPath type
*
* @return type string
*/
|
Given an XObject, determine the corresponding DOM XPath type
|
getTypeFromXObject
|
{
"repo_name": "itgeeker/jdk",
"path": "src/com/sun/org/apache/xpath/internal/domapi/XPathResultImpl.java",
"license": "apache-2.0",
"size": 21853
}
|
[
"com.sun.org.apache.xpath.internal.objects.XObject"
] |
import com.sun.org.apache.xpath.internal.objects.XObject;
|
import com.sun.org.apache.xpath.internal.objects.*;
|
[
"com.sun.org"
] |
com.sun.org;
| 2,870,178
|
public RubyMethod findOwnPublicMethod(RubyID mid) {
String methodName = mid.toString();
if(methodName == null) {
return null;
}
if (methodName.equals(NEW_METHOD)) {
return new FakeInitMethod();
}
RubyClass klass = this;
while(klass != null){
if(klass instanceof JavaClass){
if(((JavaClass)klass).methodMap.containsKey(methodName)){
return new FakeMethod(methodName);
}
if(((JavaClass)klass).fieldNames.keySet().contains(methodName)){
return new FakeInstanceVarMethod(methodName);
}
}else{
return klass.findOwnPublicMethod(mid);
}
klass = klass.getSuperClass();
}
return null;
}
|
RubyMethod function(RubyID mid) { String methodName = mid.toString(); if(methodName == null) { return null; } if (methodName.equals(NEW_METHOD)) { return new FakeInitMethod(); } RubyClass klass = this; while(klass != null){ if(klass instanceof JavaClass){ if(((JavaClass)klass).methodMap.containsKey(methodName)){ return new FakeMethod(methodName); } if(((JavaClass)klass).fieldNames.keySet().contains(methodName)){ return new FakeInstanceVarMethod(methodName); } }else{ return klass.findOwnPublicMethod(mid); } klass = klass.getSuperClass(); } return null; }
|
/**
* Find method according to given method, if it's "new"
* return an "init" fake method
*
* @param mid method's RubyID
* @return wrapper of the method, otherwise null
*/
|
Find method according to given method, if it's "new" return an "init" fake method
|
findOwnPublicMethod
|
{
"repo_name": "rzel/xruby",
"path": "src/com/xruby/runtime/javasupport/JavaClass.java",
"license": "apache-2.0",
"size": 15911
}
|
[
"com.xruby.runtime.lang.RubyClass",
"com.xruby.runtime.lang.RubyID",
"com.xruby.runtime.lang.RubyMethod"
] |
import com.xruby.runtime.lang.RubyClass; import com.xruby.runtime.lang.RubyID; import com.xruby.runtime.lang.RubyMethod;
|
import com.xruby.runtime.lang.*;
|
[
"com.xruby.runtime"
] |
com.xruby.runtime;
| 1,491,560
|
public void setLink(StringProperty link) {
this.link = link;
}
|
void function(StringProperty link) { this.link = link; }
|
/**
* The link for the image
*
* @param link the StringProperty.
*/
|
The link for the image
|
setLink
|
{
"repo_name": "NABUCCO/org.nabucco.framework.base",
"path": "org.nabucco.framework.base.facade.datatype/src/main/gen/org/nabucco/framework/base/facade/datatype/extension/schema/ui/widget/ImageWidgetExtension.java",
"license": "epl-1.0",
"size": 10327
}
|
[
"org.nabucco.framework.base.facade.datatype.extension.property.StringProperty"
] |
import org.nabucco.framework.base.facade.datatype.extension.property.StringProperty;
|
import org.nabucco.framework.base.facade.datatype.extension.property.*;
|
[
"org.nabucco.framework"
] |
org.nabucco.framework;
| 2,361,000
|
public Set<String> keySet() {
return mValues.keySet();
}
|
Set<String> function() { return mValues.keySet(); }
|
/**
* Returns a set of all of the keys
*
* @return a set of all of the keys
*/
|
Returns a set of all of the keys
|
keySet
|
{
"repo_name": "netsense-sas/couchbase-lite-java-core",
"path": "src/main/java/com/couchbase/lite/storage/ContentValues.java",
"license": "apache-2.0",
"size": 13439
}
|
[
"java.util.Set"
] |
import java.util.Set;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 510,927
|
private String getTemplatePipelineDefinitionJson() throws IOException {
return IOUtils.toString(
this.getClass().getResource("/com/streamsets/datacollector/restapi/connection/rawDynamicPreviewTemplate.json"),
Charsets.UTF_8
);
}
|
String function() throws IOException { return IOUtils.toString( this.getClass().getResource(STR), Charsets.UTF_8 ); }
|
/**
* Load the pipeline template raw JSON
*
* @return The pipeline template raw JSON
* @throws IOException if the pipeline template file cannot be loaded
*/
|
Load the pipeline template raw JSON
|
getTemplatePipelineDefinitionJson
|
{
"repo_name": "streamsets/datacollector",
"path": "container/src/main/java/com/streamsets/datacollector/restapi/connection/ConnectionVerifierDynamicPreviewHelper.java",
"license": "apache-2.0",
"size": 13550
}
|
[
"java.io.IOException",
"org.apache.commons.io.Charsets",
"org.apache.commons.io.IOUtils"
] |
import java.io.IOException; import org.apache.commons.io.Charsets; import org.apache.commons.io.IOUtils;
|
import java.io.*; import org.apache.commons.io.*;
|
[
"java.io",
"org.apache.commons"
] |
java.io; org.apache.commons;
| 51,935
|
@Override
public PolarPlot getPlot() {
return this.plot;
}
|
PolarPlot function() { return this.plot; }
|
/**
* Return the plot associated with this renderer.
*
* @return The plot.
*
* @see #setPlot(PolarPlot)
*/
|
Return the plot associated with this renderer
|
getPlot
|
{
"repo_name": "akardapolov/ASH-Viewer",
"path": "jfreechart-fse/src/main/java/org/jfree/chart/renderer/DefaultPolarItemRenderer.java",
"license": "gpl-3.0",
"size": 32725
}
|
[
"org.jfree.chart.plot.PolarPlot"
] |
import org.jfree.chart.plot.PolarPlot;
|
import org.jfree.chart.plot.*;
|
[
"org.jfree.chart"
] |
org.jfree.chart;
| 1,186,681
|
private Path createMobStoreFile(String family) throws IOException {
return createMobStoreFile(HBaseConfiguration.create(), family);
}
|
Path function(String family) throws IOException { return createMobStoreFile(HBaseConfiguration.create(), family); }
|
/**
* Create the mob store file.
*/
|
Create the mob store file
|
createMobStoreFile
|
{
"repo_name": "gustavoanatoly/hbase",
"path": "hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFileCache.java",
"license": "apache-2.0",
"size": 8559
}
|
[
"java.io.IOException",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.hbase.HBaseConfiguration"
] |
import java.io.IOException; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseConfiguration;
|
import java.io.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hbase.*;
|
[
"java.io",
"org.apache.hadoop"
] |
java.io; org.apache.hadoop;
| 618,715
|
@Test()
public void testStringPassword()
throws Exception
{
RegisterYubiKeyOTPDeviceExtendedRequest r =
new RegisterYubiKeyOTPDeviceExtendedRequest("u:authid", "password",
"YubiKeyOTP", new Control("1.2.3.4"), new Control("5.6.7.8"));
r = r.duplicate();
assertNotNull(r);
r = new RegisterYubiKeyOTPDeviceExtendedRequest(r);
assertNotNull(r);
assertNotNull(r.getOID());
assertEquals(r.getOID(), "1.3.6.1.4.1.30221.2.6.54");
assertNotNull(r.getAuthenticationID());
assertEquals(r.getAuthenticationID(), "u:authid");
assertNotNull(r.getStaticPasswordString());
assertEquals(r.getStaticPasswordString(), "password");
assertNotNull(r.getStaticPasswordBytes());
assertEquals(r.getStaticPasswordBytes(), "password".getBytes("UTF-8"));
assertNotNull(r.getYubiKeyOTP());
assertEquals(r.getYubiKeyOTP(), "YubiKeyOTP");
assertNotNull(r.getExtendedRequestName());
assertNotNull(r.getControls());
assertEquals(r.getControls().length, 2);
assertNotNull(r.toString());
}
|
@Test() void function() throws Exception { RegisterYubiKeyOTPDeviceExtendedRequest r = new RegisterYubiKeyOTPDeviceExtendedRequest(STR, STR, STR, new Control(STR), new Control(STR)); r = r.duplicate(); assertNotNull(r); r = new RegisterYubiKeyOTPDeviceExtendedRequest(r); assertNotNull(r); assertNotNull(r.getOID()); assertEquals(r.getOID(), STR); assertNotNull(r.getAuthenticationID()); assertEquals(r.getAuthenticationID(), STR); assertNotNull(r.getStaticPasswordString()); assertEquals(r.getStaticPasswordString(), STR); assertNotNull(r.getStaticPasswordBytes()); assertEquals(r.getStaticPasswordBytes(), STR.getBytes("UTF-8")); assertNotNull(r.getYubiKeyOTP()); assertEquals(r.getYubiKeyOTP(), STR); assertNotNull(r.getExtendedRequestName()); assertNotNull(r.getControls()); assertEquals(r.getControls().length, 2); assertNotNull(r.toString()); }
|
/**
* Tests the behavior of the extended request when provided with the static
* password as a string.
*
* @throws Exception If an unexpected problem occurs.
*/
|
Tests the behavior of the extended request when provided with the static password as a string
|
testStringPassword
|
{
"repo_name": "UnboundID/ldapsdk",
"path": "tests/unit/src/com/unboundid/ldap/sdk/unboundidds/extensions/RegisterYubiKeyOTPDeviceExtendedRequestTestCase.java",
"license": "gpl-2.0",
"size": 8822
}
|
[
"com.unboundid.ldap.sdk.Control",
"org.testng.annotations.Test"
] |
import com.unboundid.ldap.sdk.Control; import org.testng.annotations.Test;
|
import com.unboundid.ldap.sdk.*; import org.testng.annotations.*;
|
[
"com.unboundid.ldap",
"org.testng.annotations"
] |
com.unboundid.ldap; org.testng.annotations;
| 1,119,231
|
public long sizeInBytes() throws IOException {
if (sizeInBytes == -1) {
long sum = 0;
for (final String fileName : files()) {
sum += info.dir.fileLength(fileName);
}
sizeInBytes = sum;
}
return sizeInBytes;
}
|
long function() throws IOException { if (sizeInBytes == -1) { long sum = 0; for (final String fileName : files()) { sum += info.dir.fileLength(fileName); } sizeInBytes = sum; } return sizeInBytes; }
|
/** Returns total size in bytes of all files for this
* segment.
* <p><b>NOTE:</b> This value is not correct for 3.0 segments
* that have shared docstores. To get the correct value, upgrade! */
|
Returns total size in bytes of all files for this segment
|
sizeInBytes
|
{
"repo_name": "terrancesnyder/solr-analytics",
"path": "lucene/core/src/java/org/apache/lucene/index/SegmentInfoPerCommit.java",
"license": "apache-2.0",
"size": 4534
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 444,352
|
String valueToReturn = defaultValue;
if (TranslationConsiderationContext.hasTranslation()) {
TranslationService translationService = TranslationConsiderationContext.getTranslationService();
Locale locale = BroadleafRequestContext.getBroadleafRequestContext().getJavaLocale();
String translatedValue = translationService.getTranslatedValue(obj, field, locale);
if (StringUtils.isNotBlank(translatedValue)) {
valueToReturn = translatedValue;
} else {
valueToReturn = translationService.getDefaultTranslationValue(obj, field, locale, defaultValue);
}
}
return valueToReturn;
}
|
String valueToReturn = defaultValue; if (TranslationConsiderationContext.hasTranslation()) { TranslationService translationService = TranslationConsiderationContext.getTranslationService(); Locale locale = BroadleafRequestContext.getBroadleafRequestContext().getJavaLocale(); String translatedValue = translationService.getTranslatedValue(obj, field, locale); if (StringUtils.isNotBlank(translatedValue)) { valueToReturn = translatedValue; } else { valueToReturn = translationService.getDefaultTranslationValue(obj, field, locale, defaultValue); } } return valueToReturn; }
|
/**
* If translations are enabled, this method will look for a translation for the specified field. If translations are
* disabled or if this particular field did not have a translation, it will return back the defaultValue.
*
* @param obj
* @param field
* @param defaultValue
* @return the translated value
*/
|
If translations are enabled, this method will look for a translation for the specified field. If translations are disabled or if this particular field did not have a translation, it will return back the defaultValue
|
getValue
|
{
"repo_name": "cengizhanozcan/BroadleafCommerce",
"path": "common/src/main/java/org/broadleafcommerce/common/i18n/service/DynamicTranslationProvider.java",
"license": "apache-2.0",
"size": 2222
}
|
[
"java.util.Locale",
"org.apache.commons.lang3.StringUtils",
"org.broadleafcommerce.common.web.BroadleafRequestContext"
] |
import java.util.Locale; import org.apache.commons.lang3.StringUtils; import org.broadleafcommerce.common.web.BroadleafRequestContext;
|
import java.util.*; import org.apache.commons.lang3.*; import org.broadleafcommerce.common.web.*;
|
[
"java.util",
"org.apache.commons",
"org.broadleafcommerce.common"
] |
java.util; org.apache.commons; org.broadleafcommerce.common;
| 1,411,265
|
private static List<BucketCol> getNewBucketCols(List<BucketCol> bucketCols,
List<ColumnInfo> colInfos) {
List<BucketCol> newBucketCols = new ArrayList<BucketCol>(bucketCols.size());
for (int i = 0; i < bucketCols.size(); i++) {
BucketCol bucketCol = new BucketCol();
for (Integer index : bucketCols.get(i).getIndexes()) {
// The only time this condition should be false is in the case of dynamic partitioning
// where the data is bucketed on a dynamic partitioning column and the FileSinkOperator is
// being processed. In this case, the dynamic partition column will not appear in
// colInfos, and due to the limitations of dynamic partitioning, they will appear at the
// end of the input schema. Since the order of the columns hasn't changed, and no new
// columns have been added/removed, it is safe to assume that these will have indexes
// greater than or equal to colInfos.size().
if (index < colInfos.size()) {
bucketCol.addAlias(colInfos.get(index).getInternalName(), index);
} else {
return null;
}
}
newBucketCols.add(bucketCol);
}
return newBucketCols;
}
|
static List<BucketCol> function(List<BucketCol> bucketCols, List<ColumnInfo> colInfos) { List<BucketCol> newBucketCols = new ArrayList<BucketCol>(bucketCols.size()); for (int i = 0; i < bucketCols.size(); i++) { BucketCol bucketCol = new BucketCol(); for (Integer index : bucketCols.get(i).getIndexes()) { if (index < colInfos.size()) { bucketCol.addAlias(colInfos.get(index).getInternalName(), index); } else { return null; } } newBucketCols.add(bucketCol); } return newBucketCols; }
|
/**
* This is used to construct new lists of bucketed columns where the order of the columns
* hasn't changed, only possibly the name
* @param bucketCols - input bucketed columns
* @param colInfos - List of column infos
* @return output bucketed columns
*/
|
This is used to construct new lists of bucketed columns where the order of the columns hasn't changed, only possibly the name
|
getNewBucketCols
|
{
"repo_name": "alanfgates/hive",
"path": "ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/BucketingSortingOpProcFactory.java",
"license": "apache-2.0",
"size": 28796
}
|
[
"java.util.ArrayList",
"java.util.List",
"org.apache.hadoop.hive.ql.exec.ColumnInfo",
"org.apache.hadoop.hive.ql.optimizer.physical.BucketingSortingCtx"
] |
import java.util.ArrayList; import java.util.List; import org.apache.hadoop.hive.ql.exec.ColumnInfo; import org.apache.hadoop.hive.ql.optimizer.physical.BucketingSortingCtx;
|
import java.util.*; import org.apache.hadoop.hive.ql.exec.*; import org.apache.hadoop.hive.ql.optimizer.physical.*;
|
[
"java.util",
"org.apache.hadoop"
] |
java.util; org.apache.hadoop;
| 2,064,554
|
private boolean isEmpty(Literal geometry) {
boolean result = false;
if(geometry != null) {
Geometry g = geometry.evaluate(null, Geometry.class);
result = g == null || g.isEmpty();
}
return result;
}
|
boolean function(Literal geometry) { boolean result = false; if(geometry != null) { Geometry g = geometry.evaluate(null, Geometry.class); result = g == null g.isEmpty(); } return result; }
|
/**
* Returns true if the geometry is fully empty
* @param geometry Geometry
* @return Flag indicating whether geometry is empty
*/
|
Returns true if the geometry is fully empty
|
isEmpty
|
{
"repo_name": "ngageoint/elasticgeo",
"path": "gt-elasticsearch/src/main/java/mil/nga/giat/data/elasticsearch/FilterToElasticHelper.java",
"license": "gpl-3.0",
"size": 13068
}
|
[
"org.locationtech.jts.geom.Geometry",
"org.opengis.filter.expression.Literal"
] |
import org.locationtech.jts.geom.Geometry; import org.opengis.filter.expression.Literal;
|
import org.locationtech.jts.geom.*; import org.opengis.filter.expression.*;
|
[
"org.locationtech.jts",
"org.opengis.filter"
] |
org.locationtech.jts; org.opengis.filter;
| 218,214
|
public final void xmlRequestWriteRawDataOnSystemOut() throws IOException
{
FormattedWriter writer = new FormattedWriter(new OutputStreamWriter(System.out));
xmlWriteRawOn(writer, false);
writer.flush();
}
public void xmlWriteRawOn(FormattedWriter writer, boolean callBackToItem) throws IOException {}
|
final void function() throws IOException { FormattedWriter writer = new FormattedWriter(new OutputStreamWriter(System.out)); xmlWriteRawOn(writer, false); writer.flush(); } public void xmlWriteRawOn(FormattedWriter writer, boolean callBackToItem) throws IOException {}
|
/**
* Request that the receiver prints an xml representation of the
* persistent data (recursively) onto standard out.
*
* @throws IOException
*/
|
Request that the receiver prints an xml representation of the persistent data (recursively) onto standard out
|
xmlRequestWriteRawDataOnSystemOut
|
{
"repo_name": "kgibm/open-liberty",
"path": "dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/MessageStore.java",
"license": "epl-1.0",
"size": 13378
}
|
[
"com.ibm.ws.sib.utils.ras.FormattedWriter",
"java.io.IOException",
"java.io.OutputStreamWriter"
] |
import com.ibm.ws.sib.utils.ras.FormattedWriter; import java.io.IOException; import java.io.OutputStreamWriter;
|
import com.ibm.ws.sib.utils.ras.*; import java.io.*;
|
[
"com.ibm.ws",
"java.io"
] |
com.ibm.ws; java.io;
| 755,154
|
@Test
public void testGetSize() throws URISyntaxException, RepositoryException {
SampleResourceImpl sampleRes = createSampleResource();
File attachment = new File(resourceDir, "TestAttachment.txt");
sampleRes.addContent(attachment);
uploadResource(sampleRes);
long size = sampleRes.getAttachment("TestAttachment.txt").getSize();
assertEquals(size, attachment.length());
}
|
void function() throws URISyntaxException, RepositoryException { SampleResourceImpl sampleRes = createSampleResource(); File attachment = new File(resourceDir, STR); sampleRes.addContent(attachment); uploadResource(sampleRes); long size = sampleRes.getAttachment(STR).getSize(); assertEquals(size, attachment.length()); }
|
/**
* This method checks that the size value on an attachment is equal to the
* size of the attachment payload
*/
|
This method checks that the size value on an attachment is equal to the size of the attachment payload
|
testGetSize
|
{
"repo_name": "ashleyrobertson/tool.lars",
"path": "client-lib-tests/src/fat/java/com/ibm/ws/repository/test/ResourceTest.java",
"license": "apache-2.0",
"size": 67928
}
|
[
"com.ibm.ws.repository.exceptions.RepositoryException",
"com.ibm.ws.repository.resources.internal.SampleResourceImpl",
"java.io.File",
"java.net.URISyntaxException",
"org.junit.Assert"
] |
import com.ibm.ws.repository.exceptions.RepositoryException; import com.ibm.ws.repository.resources.internal.SampleResourceImpl; import java.io.File; import java.net.URISyntaxException; import org.junit.Assert;
|
import com.ibm.ws.repository.exceptions.*; import com.ibm.ws.repository.resources.internal.*; import java.io.*; import java.net.*; import org.junit.*;
|
[
"com.ibm.ws",
"java.io",
"java.net",
"org.junit"
] |
com.ibm.ws; java.io; java.net; org.junit;
| 841,097
|
public HudsonUpgradeJob getHudsonJob() {
List<UpdateCenterJob> jobList = getJobs();
Collections.reverse(jobList);
for (UpdateCenterJob job : jobList)
if (job instanceof HudsonUpgradeJob)
return (HudsonUpgradeJob)job;
return null;
}
|
HudsonUpgradeJob function() { List<UpdateCenterJob> jobList = getJobs(); Collections.reverse(jobList); for (UpdateCenterJob job : jobList) if (job instanceof HudsonUpgradeJob) return (HudsonUpgradeJob)job; return null; }
|
/**
* Returns latest Jenkins upgrade job.
* @return HudsonUpgradeJob or null if not found
*/
|
Returns latest Jenkins upgrade job
|
getHudsonJob
|
{
"repo_name": "stephenc/jenkins",
"path": "core/src/main/java/hudson/model/UpdateCenter.java",
"license": "mit",
"size": 92950
}
|
[
"java.util.Collections",
"java.util.List"
] |
import java.util.Collections; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,901,625
|
public String getURLDecoding(DatabaseWiki wiki, int fileVersion)
throws org.dbwiki.exception.WikiException {
if (fileVersion == RelConfigFileColFileVersionValUnknown) {
return "";
} else {
return this.readConfigFile(wiki.id(),
RelConfigFileColFileTypeValURLDecoding, fileVersion);
}
}
|
String function(DatabaseWiki wiki, int fileVersion) throws org.dbwiki.exception.WikiException { if (fileVersion == RelConfigFileColFileVersionValUnknown) { return ""; } else { return this.readConfigFile(wiki.id(), RelConfigFileColFileTypeValURLDecoding, fileVersion); } }
|
/**
* Depending on the file version of the requested
* URL-decoding-rules-definition-file this method either returns an empty
* string (for ValUnknown) or it reads the information from the database (->
* readConfigFile()).
*/
|
Depending on the file version of the requested URL-decoding-rules-definition-file this method either returns an empty string (for ValUnknown) or it reads the information from the database (-> readConfigFile())
|
getURLDecoding
|
{
"repo_name": "jamescheney/database-wiki",
"path": "src/org/dbwiki/web/server/WikiServer.java",
"license": "gpl-3.0",
"size": 56766
}
|
[
"org.dbwiki.exception.WikiException"
] |
import org.dbwiki.exception.WikiException;
|
import org.dbwiki.exception.*;
|
[
"org.dbwiki.exception"
] |
org.dbwiki.exception;
| 359,761
|
public AttributeCondition createIdCondition(String value)
throws CSSException {
return new CSSIdCondition(idNamespaceURI, idLocalName, value);
}
|
AttributeCondition function(String value) throws CSSException { return new CSSIdCondition(idNamespaceURI, idLocalName, value); }
|
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.ConditionFactory#createIdCondition(String)}.
*/
|
SAC: Implements <code>org.w3c.css.sac.ConditionFactory#createIdCondition(String)</code>
|
createIdCondition
|
{
"repo_name": "shyamalschandra/flex-sdk",
"path": "modules/thirdparty/batik/sources/org/apache/flex/forks/batik/css/engine/sac/CSSConditionFactory.java",
"license": "apache-2.0",
"size": 7476
}
|
[
"org.w3c.css.sac.AttributeCondition",
"org.w3c.css.sac.CSSException"
] |
import org.w3c.css.sac.AttributeCondition; import org.w3c.css.sac.CSSException;
|
import org.w3c.css.sac.*;
|
[
"org.w3c.css"
] |
org.w3c.css;
| 2,882,599
|
@Override
public Artifact getDerivedArtifact(PathFragment rootRelativePath, Root root) {
Preconditions.checkState(rootRelativePath.startsWith(getPackageDirectory()),
"Output artifact '%s' not under package directory '%s' for target '%s'",
rootRelativePath, getPackageDirectory(), getLabel());
return getAnalysisEnvironment().getDerivedArtifact(rootRelativePath, root);
}
|
Artifact function(PathFragment rootRelativePath, Root root) { Preconditions.checkState(rootRelativePath.startsWith(getPackageDirectory()), STR, rootRelativePath, getPackageDirectory(), getLabel()); return getAnalysisEnvironment().getDerivedArtifact(rootRelativePath, root); }
|
/**
* Creates an artifact under a given root with the given root-relative path.
*
* <p>Verifies that it is in the root-relative directory corresponding to the package of the rule,
* thus ensuring that it doesn't clash with other artifacts generated by other rules using this
* method.
*/
|
Creates an artifact under a given root with the given root-relative path. Verifies that it is in the root-relative directory corresponding to the package of the rule, thus ensuring that it doesn't clash with other artifacts generated by other rules using this method
|
getDerivedArtifact
|
{
"repo_name": "mrdomino/bazel",
"path": "src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java",
"license": "apache-2.0",
"size": 82752
}
|
[
"com.google.devtools.build.lib.actions.Artifact",
"com.google.devtools.build.lib.actions.Root",
"com.google.devtools.build.lib.util.Preconditions",
"com.google.devtools.build.lib.vfs.PathFragment"
] |
import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.actions.Root; import com.google.devtools.build.lib.util.Preconditions; import com.google.devtools.build.lib.vfs.PathFragment;
|
import com.google.devtools.build.lib.actions.*; import com.google.devtools.build.lib.util.*; import com.google.devtools.build.lib.vfs.*;
|
[
"com.google.devtools"
] |
com.google.devtools;
| 1,018,831
|
public static void showDataBaseOnGui() {
Statement statement=null;
ResultSet rs=null;
try{
statement = connection.createStatement();
String s = "select * from machines;";
rs = statement.executeQuery(s);
ResultSetMetaData rsmt = rs.getMetaData();
int c = rsmt.getColumnCount();
Vector<String> column = new Vector<String>(c);
for(int i = 1; i <= c; i++){
column.add(rsmt.getColumnName(i));
}
Vector<Vector<String>> data = new Vector<Vector<String>>();
Vector<String> row = new Vector<String>();
while(rs.next()){
row = new Vector<String>(c);
for(int i = 1; i <= c; i++){
row.add(rs.getString(i));
}
data.add(row);
}
|
static void function() { Statement statement=null; ResultSet rs=null; try{ statement = connection.createStatement(); String s = STR; rs = statement.executeQuery(s); ResultSetMetaData rsmt = rs.getMetaData(); int c = rsmt.getColumnCount(); Vector<String> column = new Vector<String>(c); for(int i = 1; i <= c; i++){ column.add(rsmt.getColumnName(i)); } Vector<Vector<String>> data = new Vector<Vector<String>>(); Vector<String> row = new Vector<String>(); while(rs.next()){ row = new Vector<String>(c); for(int i = 1; i <= c; i++){ row.add(rs.getString(i)); } data.add(row); }
|
/**
*
* Shows the database content in a JTable.
*
*/
|
Shows the database content in a JTable
|
showDataBaseOnGui
|
{
"repo_name": "soli1411/ProductionWatchdog",
"path": "src/dev/soli/productionWatchdog/database/SuiteOneDataBaseHandler.java",
"license": "gpl-3.0",
"size": 5691
}
|
[
"java.sql.ResultSet",
"java.sql.ResultSetMetaData",
"java.sql.Statement",
"java.util.Vector"
] |
import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.Statement; import java.util.Vector;
|
import java.sql.*; import java.util.*;
|
[
"java.sql",
"java.util"
] |
java.sql; java.util;
| 2,600,422
|
public static InputStream getAssetFileStream(Context testContext,
String assetPath) throws IOException {
return testContext.getAssets().open(assetPath);
}
|
static InputStream function(Context testContext, String assetPath) throws IOException { return testContext.getAssets().open(assetPath); }
|
/**
* Get the asset file input stream
*
* @param testContext
* @param assetPath
* @return
* @throws IOException
*/
|
Get the asset file input stream
|
getAssetFileStream
|
{
"repo_name": "boundlessgeo/geopackage-android",
"path": "geopackage-sdk/src/androidTest/java/mil/nga/geopackage/test/TestUtils.java",
"license": "mit",
"size": 16456
}
|
[
"android.content.Context",
"java.io.IOException",
"java.io.InputStream"
] |
import android.content.Context; import java.io.IOException; import java.io.InputStream;
|
import android.content.*; import java.io.*;
|
[
"android.content",
"java.io"
] |
android.content; java.io;
| 2,842,272
|
public Collection<ConnectedToNotSymmetric.Match> getAllMatches(final Segment pS1, final Segment pS2) {
return rawStreamAllMatches(new Object[]{pS1, pS2}).collect(Collectors.toSet());
}
|
Collection<ConnectedToNotSymmetric.Match> function(final Segment pS1, final Segment pS2) { return rawStreamAllMatches(new Object[]{pS1, pS2}).collect(Collectors.toSet()); }
|
/**
* Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
* @param pS1 the fixed value of pattern parameter S1, or null if not bound.
* @param pS2 the fixed value of pattern parameter S2, or null if not bound.
* @return matches represented as a Match object.
*
*/
|
Returns the set of all matches of the pattern that conform to the given fixed values of some parameters
|
getAllMatches
|
{
"repo_name": "viatra/VIATRA-Generator",
"path": "Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/ConnectedToNotSymmetric.java",
"license": "epl-1.0",
"size": 29235
}
|
[
"java.util.Collection",
"java.util.stream.Collectors"
] |
import java.util.Collection; import java.util.stream.Collectors;
|
import java.util.*; import java.util.stream.*;
|
[
"java.util"
] |
java.util;
| 21,050
|
private RelNode aggregateCorrelatorOutput(
Correlate correlate,
LogicalProject project,
Set<Integer> isCount) {
final RelNode left = correlate.getLeft();
final JoinRelType joinType = correlate.getJoinType();
// now create the new project
final List<Pair<RexNode, String>> newProjects = new ArrayList<>();
// Project everything from the LHS and then those from the original
// project
final List<RelDataTypeField> leftInputFields =
left.getRowType().getFieldList();
for (int i = 0; i < leftInputFields.size(); i++) {
newProjects.add(RexInputRef.of2(i, leftInputFields));
}
// Marked where the projected expr is coming from so that the types will
// become nullable for the original projections which are now coming out
// of the nullable side of the OJ.
boolean projectPulledAboveLeftCorrelator =
joinType.generatesNullsOnRight();
for (Pair<RexNode, String> pair : project.getNamedProjects()) {
RexNode newProjExpr =
removeCorrelationExpr(
pair.left,
projectPulledAboveLeftCorrelator,
isCount);
newProjects.add(Pair.of(newProjExpr, pair.right));
}
return relBuilder.push(correlate)
.projectNamed(Pair.left(newProjects), Pair.right(newProjects), true)
.build();
}
|
RelNode function( Correlate correlate, LogicalProject project, Set<Integer> isCount) { final RelNode left = correlate.getLeft(); final JoinRelType joinType = correlate.getJoinType(); final List<Pair<RexNode, String>> newProjects = new ArrayList<>(); final List<RelDataTypeField> leftInputFields = left.getRowType().getFieldList(); for (int i = 0; i < leftInputFields.size(); i++) { newProjects.add(RexInputRef.of2(i, leftInputFields)); } boolean projectPulledAboveLeftCorrelator = joinType.generatesNullsOnRight(); for (Pair<RexNode, String> pair : project.getNamedProjects()) { RexNode newProjExpr = removeCorrelationExpr( pair.left, projectPulledAboveLeftCorrelator, isCount); newProjects.add(Pair.of(newProjExpr, pair.right)); } return relBuilder.push(correlate) .projectNamed(Pair.left(newProjects), Pair.right(newProjects), true) .build(); }
|
/**
* Pulls a {@link Project} above a {@link Correlate} from its RHS input.
* Enforces nullability for join output.
*
* @param correlate Correlate
* @param project the original project as the RHS input of the join
* @param isCount Positions which are calls to the <code>COUNT</code>
* aggregation function
* @return the subtree with the new Project at the root
*/
|
Pulls a <code>Project</code> above a <code>Correlate</code> from its RHS input. Enforces nullability for join output
|
aggregateCorrelatorOutput
|
{
"repo_name": "fhueske/flink",
"path": "flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql2rel/RelDecorrelator.java",
"license": "apache-2.0",
"size": 101624
}
|
[
"java.util.ArrayList",
"java.util.List",
"java.util.Set",
"org.apache.calcite.rel.RelNode",
"org.apache.calcite.rel.core.Correlate",
"org.apache.calcite.rel.core.JoinRelType",
"org.apache.calcite.rel.logical.LogicalProject",
"org.apache.calcite.rel.type.RelDataTypeField",
"org.apache.calcite.rex.RexInputRef",
"org.apache.calcite.rex.RexNode",
"org.apache.calcite.util.Pair"
] |
import java.util.ArrayList; import java.util.List; import java.util.Set; import org.apache.calcite.rel.RelNode; import org.apache.calcite.rel.core.Correlate; import org.apache.calcite.rel.core.JoinRelType; import org.apache.calcite.rel.logical.LogicalProject; import org.apache.calcite.rel.type.RelDataTypeField; import org.apache.calcite.rex.RexInputRef; import org.apache.calcite.rex.RexNode; import org.apache.calcite.util.Pair;
|
import java.util.*; import org.apache.calcite.rel.*; import org.apache.calcite.rel.core.*; import org.apache.calcite.rel.logical.*; import org.apache.calcite.rel.type.*; import org.apache.calcite.rex.*; import org.apache.calcite.util.*;
|
[
"java.util",
"org.apache.calcite"
] |
java.util; org.apache.calcite;
| 106,176
|
public Query build() {
StringBuilder builder = new StringBuilder();
if (filter != null) {// NOSONAR - false-positive from clover; if-expression is correct
try{
ensureQueryParamIsSeparated(builder);
builder.append("filter=")
.append(URLEncoder.encode(filter, Charsets.UTF_8.name()));
}catch(UnsupportedEncodingException e) {
throw new RuntimeException(e); // NOSONAR - The UnsupportedEncodingException will in real time "never" happen and if yes a runtime exception will catch the problem
}
}
if (sortBy != null) { // NOSONAR - false-positive from clover; if-expression is correct
ensureQueryParamIsSeparated(builder);
builder.append("sortBy=")
.append(sortBy);
}
if (sortOrder != null) { // NOSONAR - false-positive from clover; if-expression is correct
ensureQueryParamIsSeparated(builder);
builder.append("sortOrder=")
.append(sortOrder);
}
if (countPerPage != DEFAULT_COUNT) { // NOSONAR - false-positive from clover; if-expression is correct
ensureQueryParamIsSeparated(builder);
builder.append("count=")
.append(countPerPage);
}
if (startIndex != DEFAULT_INDEX) { // NOSONAR - false-positive from clover; if-expression is correct
ensureQueryParamIsSeparated(builder);
builder.append("startIndex=")
.append(startIndex);
}
return new Query(builder.toString());
}
|
Query function() { StringBuilder builder = new StringBuilder(); if (filter != null) { try{ ensureQueryParamIsSeparated(builder); builder.append(STR) .append(URLEncoder.encode(filter, Charsets.UTF_8.name())); }catch(UnsupportedEncodingException e) { throw new RuntimeException(e); } } if (sortBy != null) { ensureQueryParamIsSeparated(builder); builder.append(STR) .append(sortBy); } if (sortOrder != null) { ensureQueryParamIsSeparated(builder); builder.append(STR) .append(sortOrder); } if (countPerPage != DEFAULT_COUNT) { ensureQueryParamIsSeparated(builder); builder.append(STR) .append(countPerPage); } if (startIndex != DEFAULT_INDEX) { ensureQueryParamIsSeparated(builder); builder.append(STR) .append(startIndex); } return new Query(builder.toString()); }
|
/**
* Build the query String to use against OSIAM.
*
* @return The query as a String
*/
|
Build the query String to use against OSIAM
|
build
|
{
"repo_name": "wallner/connector4java",
"path": "src/main/java/org/osiam/client/query/Query.java",
"license": "mit",
"size": 15512
}
|
[
"java.io.UnsupportedEncodingException",
"java.net.URLEncoder",
"org.apache.commons.io.Charsets"
] |
import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import org.apache.commons.io.Charsets;
|
import java.io.*; import java.net.*; import org.apache.commons.io.*;
|
[
"java.io",
"java.net",
"org.apache.commons"
] |
java.io; java.net; org.apache.commons;
| 1,305,987
|
private Multimap<String, ExtraActionSpec> computeMnemonicsToExtraActionMap() {
// We copy the multimap here every time. This could be expensive.
Multimap<String, ExtraActionSpec> mnemonicToExtraActionMap = HashMultimap.create();
for (TransitiveInfoCollection actionListener :
ruleContext.getPrerequisites(":action_listener", Mode.HOST)) {
ExtraActionMapProvider provider = actionListener.getProvider(ExtraActionMapProvider.class);
if (provider == null) {
ruleContext.ruleError(String.format(
"Unable to match experimental_action_listeners to this rule. "
+ "Specified target %s is not an action_listener rule",
actionListener.getLabel().toString()));
} else {
mnemonicToExtraActionMap.putAll(provider.getExtraActionMap());
}
}
return mnemonicToExtraActionMap;
}
|
Multimap<String, ExtraActionSpec> function() { Multimap<String, ExtraActionSpec> mnemonicToExtraActionMap = HashMultimap.create(); for (TransitiveInfoCollection actionListener : ruleContext.getPrerequisites(STR, Mode.HOST)) { ExtraActionMapProvider provider = actionListener.getProvider(ExtraActionMapProvider.class); if (provider == null) { ruleContext.ruleError(String.format( STR + STR, actionListener.getLabel().toString())); } else { mnemonicToExtraActionMap.putAll(provider.getExtraActionMap()); } } return mnemonicToExtraActionMap; }
|
/**
* Populates the configuration specific mnemonicToExtraActionMap
* based on all action_listers selected by the user (via the blaze option
* {@code --experimental_action_listener=<target>}).
*/
|
Populates the configuration specific mnemonicToExtraActionMap based on all action_listers selected by the user (via the blaze option --experimental_action_listener=)
|
computeMnemonicsToExtraActionMap
|
{
"repo_name": "asarazan/bazel",
"path": "src/main/java/com/google/devtools/build/lib/analysis/RuleConfiguredTargetBuilder.java",
"license": "apache-2.0",
"size": 20499
}
|
[
"com.google.common.collect.HashMultimap",
"com.google.common.collect.Multimap",
"com.google.devtools.build.lib.analysis.RuleConfiguredTarget",
"com.google.devtools.build.lib.rules.extra.ExtraActionMapProvider",
"com.google.devtools.build.lib.rules.extra.ExtraActionSpec"
] |
import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; import com.google.devtools.build.lib.analysis.RuleConfiguredTarget; import com.google.devtools.build.lib.rules.extra.ExtraActionMapProvider; import com.google.devtools.build.lib.rules.extra.ExtraActionSpec;
|
import com.google.common.collect.*; import com.google.devtools.build.lib.analysis.*; import com.google.devtools.build.lib.rules.extra.*;
|
[
"com.google.common",
"com.google.devtools"
] |
com.google.common; com.google.devtools;
| 2,678,774
|
public List<String> getChildCategories(String categoryName) throws MediaWikiAPIException {
if (XPATH_CATEGORIES == null) {
// should never happen
throw new MediaWikiAPIException("XPath expression for getting categories not initialized");
}
//http://wiki.eclipse.org/index.php?action=ajax
StringBuilder buf = new StringBuilder(ajaxURL);
buf.append("&rs=efCategoryTreeAjaxWrapper&rsargs[]=");
try {
buf.append(URLEncoder.encode(categoryName.replace(' ', '_'), "UTF-8"));
} catch (UnsupportedEncodingException e) {
throw new MediaWikiAPIException("The UTF-8 character encoding is not supported on this platform.", e);
}
buf.append("&rsargs[]=0"); // mode = 0 (no parent categories, no pages).
HttpGet httpGet = new HttpGet(buf.toString());
HttpResponse response;
try {
response = http.execute(httpGet);
} catch (ClientProtocolException e) {
throw new MediaWikiAPIException("Could not execute HTTP call to MediaWiki API", e);
} catch (IOException e) {
throw new MediaWikiAPIException("Could not execute HTTP call to MediaWiki API", e);
}
InputStream content;
try {
content = response.getEntity().getContent();
} catch (IllegalStateException e) {
throw new MediaWikiAPIException("Could not process response from call to MediaWiki API", e);
} catch (IOException e) {
throw new MediaWikiAPIException("Could not process response from call to MediaWiki API", e);
}
StringWriter out;
try {
BufferedReader in = new BufferedReader(new InputStreamReader(content));
out = new StringWriter();
String line;
while((line = in.readLine()) != null) {
out.write(line + "\n");
}
} catch (IOException e) {
throw new MediaWikiAPIException("Could not read response", e);
}
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<categories>\n" + out.toString() + "\n</categories>";
Document doc;
try {
doc = documentBuilder.parse(new StringInputStream(xml));
} catch (SAXException e) {
throw new MediaWikiAPIException("Error parsing xml document", e);
} catch (IOException e) {
throw new MediaWikiAPIException("Errror reading xml document", e);
}
NodeList childCategoryNodes;
try {
childCategoryNodes = (NodeList)XPATH_CATEGORIES.evaluate(doc, XPathConstants.NODESET);
} catch (XPathExpressionException e) {
throw new MediaWikiAPIException("Could not evaluate XPath expression " + XPATH_CATEGORIES + " on result of category name query for category " + categoryName);
}
ArrayList<String> childCategories = new ArrayList<String>();
int length = childCategoryNodes.getLength();
for (int i = 0; i < length; i++) {
Node childCategoryNode = childCategoryNodes.item(i);
String childCategoryName = childCategoryNode.getTextContent().trim();
childCategories.add(childCategoryName);
}
return childCategories;
}
|
List<String> function(String categoryName) throws MediaWikiAPIException { if (XPATH_CATEGORIES == null) { throw new MediaWikiAPIException(STR); } StringBuilder buf = new StringBuilder(ajaxURL); buf.append(STR); try { buf.append(URLEncoder.encode(categoryName.replace(' ', '_'), "UTF-8")); } catch (UnsupportedEncodingException e) { throw new MediaWikiAPIException(STR, e); } buf.append(STR); HttpGet httpGet = new HttpGet(buf.toString()); HttpResponse response; try { response = http.execute(httpGet); } catch (ClientProtocolException e) { throw new MediaWikiAPIException(STR, e); } catch (IOException e) { throw new MediaWikiAPIException(STR, e); } InputStream content; try { content = response.getEntity().getContent(); } catch (IllegalStateException e) { throw new MediaWikiAPIException(STR, e); } catch (IOException e) { throw new MediaWikiAPIException(STR, e); } StringWriter out; try { BufferedReader in = new BufferedReader(new InputStreamReader(content)); out = new StringWriter(); String line; while((line = in.readLine()) != null) { out.write(line + "\n"); } } catch (IOException e) { throw new MediaWikiAPIException(STR, e); } String xml = STR1.0\STRUTF-8\STR + out.toString() + STR; Document doc; try { doc = documentBuilder.parse(new StringInputStream(xml)); } catch (SAXException e) { throw new MediaWikiAPIException(STR, e); } catch (IOException e) { throw new MediaWikiAPIException(STR, e); } NodeList childCategoryNodes; try { childCategoryNodes = (NodeList)XPATH_CATEGORIES.evaluate(doc, XPathConstants.NODESET); } catch (XPathExpressionException e) { throw new MediaWikiAPIException(STR + XPATH_CATEGORIES + STR + categoryName); } ArrayList<String> childCategories = new ArrayList<String>(); int length = childCategoryNodes.getLength(); for (int i = 0; i < length; i++) { Node childCategoryNode = childCategoryNodes.item(i); String childCategoryName = childCategoryNode.getTextContent().trim(); childCategories.add(childCategoryName); } return childCategories; }
|
/**
* Returns all child categories of the given category.
* Works only for MediaWiki installations with the CategoryTree
* extension installed (most of the public MediaWikis should have it
* installed).
* @param category
* @return
*/
|
Returns all child categories of the given category. Works only for MediaWiki installations with the CategoryTree extension installed (most of the public MediaWikis should have it installed)
|
getChildCategories
|
{
"repo_name": "ag-csw/ExpertFinder",
"path": "src-mediawiki/de/csw/expertfinder/mediawiki/api/MediaWikiAPI.java",
"license": "lgpl-3.0",
"size": 34668
}
|
[
"java.io.BufferedReader",
"java.io.IOException",
"java.io.InputStream",
"java.io.InputStreamReader",
"java.io.StringWriter",
"java.io.UnsupportedEncodingException",
"java.net.URLEncoder",
"java.util.ArrayList",
"java.util.List",
"javax.xml.xpath.XPathConstants",
"javax.xml.xpath.XPathExpressionException",
"org.apache.http.HttpResponse",
"org.apache.http.client.ClientProtocolException",
"org.apache.http.client.methods.HttpGet",
"org.apache.tools.ant.filters.StringInputStream",
"org.w3c.dom.Document",
"org.w3c.dom.Node",
"org.w3c.dom.NodeList",
"org.xml.sax.SAXException"
] |
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.StringWriter; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.ArrayList; import java.util.List; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.methods.HttpGet; import org.apache.tools.ant.filters.StringInputStream; import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.SAXException;
|
import java.io.*; import java.net.*; import java.util.*; import javax.xml.xpath.*; import org.apache.http.*; import org.apache.http.client.*; import org.apache.http.client.methods.*; import org.apache.tools.ant.filters.*; import org.w3c.dom.*; import org.xml.sax.*;
|
[
"java.io",
"java.net",
"java.util",
"javax.xml",
"org.apache.http",
"org.apache.tools",
"org.w3c.dom",
"org.xml.sax"
] |
java.io; java.net; java.util; javax.xml; org.apache.http; org.apache.tools; org.w3c.dom; org.xml.sax;
| 1,588,301
|
@Test
public void validation() throws IOException, DocumentGenerationException {
final ValidationMessageLevel validationLevel = M2DocUtils.validate(documentTemplate, queryEnvironment, types);
final File expectedValidationFile = getExpectedValidatedFile(new File(testFolderPath));
final File tempFile;
if (expectedValidationFile.exists()) {
tempFile = File.createTempFile(expectedValidationFile.getAbsolutePath(), "validation-test.docx");
if (validationLevel != ValidationMessageLevel.OK) {
M2DocUtils.serializeValidatedDocumentTemplate(documentTemplate,
URI.createFileURI(tempFile.getAbsolutePath()));
}
} else {
tempFile = getActualValidatedFile(new File(testFolderPath));
tempFile.createNewFile();
if (validationLevel != ValidationMessageLevel.OK) {
M2DocUtils.serializeValidatedDocumentTemplate(documentTemplate,
URI.createFileURI(tempFile.getAbsolutePath()));
}
fail(expectedValidationFile.getAbsolutePath() + " doesn't exists.");
}
if (tempFile.length() != 0) {
M2DocTestUtils.assertDocx(expectedValidationFile.getAbsolutePath(), tempFile.getAbsolutePath());
} else {
assertEquals(ValidationMessageLevel.OK, validationLevel);
assertTrue(expectedValidationFile.exists());
assertEquals(0, expectedValidationFile.length());
}
tempFile.delete();
}
|
void function() throws IOException, DocumentGenerationException { final ValidationMessageLevel validationLevel = M2DocUtils.validate(documentTemplate, queryEnvironment, types); final File expectedValidationFile = getExpectedValidatedFile(new File(testFolderPath)); final File tempFile; if (expectedValidationFile.exists()) { tempFile = File.createTempFile(expectedValidationFile.getAbsolutePath(), STR); if (validationLevel != ValidationMessageLevel.OK) { M2DocUtils.serializeValidatedDocumentTemplate(documentTemplate, URI.createFileURI(tempFile.getAbsolutePath())); } } else { tempFile = getActualValidatedFile(new File(testFolderPath)); tempFile.createNewFile(); if (validationLevel != ValidationMessageLevel.OK) { M2DocUtils.serializeValidatedDocumentTemplate(documentTemplate, URI.createFileURI(tempFile.getAbsolutePath())); } fail(expectedValidationFile.getAbsolutePath() + STR); } if (tempFile.length() != 0) { M2DocTestUtils.assertDocx(expectedValidationFile.getAbsolutePath(), tempFile.getAbsolutePath()); } else { assertEquals(ValidationMessageLevel.OK, validationLevel); assertTrue(expectedValidationFile.exists()); assertEquals(0, expectedValidationFile.length()); } tempFile.delete(); }
|
/**
* Tests the parsing by comparing the validated template.
*
* @throws IOException
* if the validation template can't be generated
* @throws DocumentGenerationException
* if the validation template can't be generated
*/
|
Tests the parsing by comparing the validated template
|
validation
|
{
"repo_name": "ldelaigue/M2Doc",
"path": "tests/org.obeonetwork.m2doc.tests/src/org/obeonetwork/m2doc/test/AbstractTemplatesTestSuite.java",
"license": "epl-1.0",
"size": 19047
}
|
[
"java.io.File",
"java.io.IOException",
"org.eclipse.emf.common.util.URI",
"org.junit.Assert",
"org.obeonetwork.m2doc.generator.DocumentGenerationException",
"org.obeonetwork.m2doc.parser.ValidationMessageLevel",
"org.obeonetwork.m2doc.util.M2DocUtils"
] |
import java.io.File; import java.io.IOException; import org.eclipse.emf.common.util.URI; import org.junit.Assert; import org.obeonetwork.m2doc.generator.DocumentGenerationException; import org.obeonetwork.m2doc.parser.ValidationMessageLevel; import org.obeonetwork.m2doc.util.M2DocUtils;
|
import java.io.*; import org.eclipse.emf.common.util.*; import org.junit.*; import org.obeonetwork.m2doc.generator.*; import org.obeonetwork.m2doc.parser.*; import org.obeonetwork.m2doc.util.*;
|
[
"java.io",
"org.eclipse.emf",
"org.junit",
"org.obeonetwork.m2doc"
] |
java.io; org.eclipse.emf; org.junit; org.obeonetwork.m2doc;
| 1,520,477
|
void setTarget(List<String> value);
|
void setTarget(List<String> value);
|
/**
* Sets the value of the '{@link org.w3._2005._07.scxml.ScxmlTransitionType#getTarget <em>Target</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Target</em>' attribute.
* @see #getTarget()
* @generated
*/
|
Sets the value of the '<code>org.w3._2005._07.scxml.ScxmlTransitionType#getTarget Target</code>' attribute.
|
setTarget
|
{
"repo_name": "glefur/scxml-designer",
"path": "plugins/org.w3c.scxml/src-gen/org/w3/_2005/_07/scxml/ScxmlTransitionType.java",
"license": "epl-1.0",
"size": 15323
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 730,979
|
public Color getBackground(Object element) {
if (this.styledLabelProvider instanceof IColorProvider) {
return ((IColorProvider) this.styledLabelProvider)
.getBackground(element);
}
return null;
}
|
Color function(Object element) { if (this.styledLabelProvider instanceof IColorProvider) { return ((IColorProvider) this.styledLabelProvider) .getBackground(element); } return null; }
|
/**
* Provides a background color for the given element.
*
* @param element
* the element
* @return the background color for the element, or <code>null</code> to
* use the default background color
*/
|
Provides a background color for the given element
|
getBackground
|
{
"repo_name": "ghillairet/gef-gwt",
"path": "src/main/java/org/eclipse/jface/viewers/DelegatingStyledCellLabelProvider.java",
"license": "epl-1.0",
"size": 7096
}
|
[
"org.eclipse.swt.graphics.Color"
] |
import org.eclipse.swt.graphics.Color;
|
import org.eclipse.swt.graphics.*;
|
[
"org.eclipse.swt"
] |
org.eclipse.swt;
| 323,160
|
public Input getInput(JHOVE2 jhove2, ByteOrder order)
throws IOException;
|
Input function(JHOVE2 jhove2, ByteOrder order) throws IOException;
|
/**
* Get {@link org.jhove2.core.io.Input} for the source unit with the
* buffer size and type specified by the {@link org.jhove2.core.Invocation}.
* If this method is called explicitly, then the corresponding
* Input.close() method must be called to avoid a resource leak.
* @param jhove2 JHOVE2 framework
* @param order Byte order
* @return Input for the source unit, or null if a Clump, Directory, or
* FileSet source
*/
|
Get <code>org.jhove2.core.io.Input</code> for the source unit with the buffer size and type specified by the <code>org.jhove2.core.Invocation</code>. If this method is called explicitly, then the corresponding Input.close() method must be called to avoid a resource leak
|
getInput
|
{
"repo_name": "opf-labs/jhove2",
"path": "src/main/java/org/jhove2/core/source/Source.java",
"license": "bsd-2-clause",
"size": 15326
}
|
[
"java.io.IOException",
"java.nio.ByteOrder",
"org.jhove2.core.io.Input"
] |
import java.io.IOException; import java.nio.ByteOrder; import org.jhove2.core.io.Input;
|
import java.io.*; import java.nio.*; import org.jhove2.core.io.*;
|
[
"java.io",
"java.nio",
"org.jhove2.core"
] |
java.io; java.nio; org.jhove2.core;
| 2,680,340
|
private void checkExpressionOperands(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue,
final IReferenceChain referenceChain) {
checkExpressionDynamicPart(expectedValue, OPERATIONNAME, false, true, false);
}
|
void function(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue, final IReferenceChain referenceChain) { checkExpressionDynamicPart(expectedValue, OPERATIONNAME, false, true, false); }
|
/**
* Checks the parameters of the expression and if they are valid in
* their position in the expression or not.
*
* @param timestamp
* the timestamp of the actual semantic check cycle.
* @param expectedValue
* the kind of value expected.
* @param referenceChain
* a reference chain to detect cyclic references.
* */
|
Checks the parameters of the expression and if they are valid in their position in the expression or not
|
checkExpressionOperands
|
{
"repo_name": "alovassy/titan.EclipsePlug-ins",
"path": "org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/expressions/AllComponentRunningExpression.java",
"license": "epl-1.0",
"size": 3149
}
|
[
"org.eclipse.titan.designer.AST",
"org.eclipse.titan.designer.parsers.CompilationTimeStamp"
] |
import org.eclipse.titan.designer.AST; import org.eclipse.titan.designer.parsers.CompilationTimeStamp;
|
import org.eclipse.titan.designer.*; import org.eclipse.titan.designer.parsers.*;
|
[
"org.eclipse.titan"
] |
org.eclipse.titan;
| 2,382,914
|
protected void emit_nPrecone_SL_COMMENTTerminalRuleCall_5_q(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {
acceptNodes(transition, nodes);
}
|
void function(EObject semanticObject, ISynNavigable transition, List<INode> nodes) { acceptNodes(transition, nodes); }
|
/**
* Syntax:
* SL_COMMENT?
*/
|
Syntax: SL_COMMENT
|
emit_nPrecone_SL_COMMENTTerminalRuleCall_5_q
|
{
"repo_name": "cooked/NDT",
"path": "sc.ndt.editor.bmodes.bmi/src-gen/sc/ndt/editor/bmodes/serializer/BmodesbmiSyntacticSequencer.java",
"license": "gpl-3.0",
"size": 75631
}
|
[
"java.util.List",
"org.eclipse.emf.ecore.EObject",
"org.eclipse.xtext.nodemodel.INode",
"org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider"
] |
import java.util.List; import org.eclipse.emf.ecore.EObject; import org.eclipse.xtext.nodemodel.INode; import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider;
|
import java.util.*; import org.eclipse.emf.ecore.*; import org.eclipse.xtext.nodemodel.*; import org.eclipse.xtext.serializer.analysis.*;
|
[
"java.util",
"org.eclipse.emf",
"org.eclipse.xtext"
] |
java.util; org.eclipse.emf; org.eclipse.xtext;
| 2,356,614
|
@SuppressWarnings("ALL") public static Kvantum newStandaloneServer(final Object... classes)
throws ServerStartFailureException {
final ServerContext kvantumContext =
ServerContext.builder().coreFolder(new File("./kvantum"))
.router(RequestManager.builder().build())
.standalone(true).serverSupplier(SimpleServer::new).build();
final Optional<Kvantum> kvantumOptional = kvantumContext.create();
if (!kvantumOptional.isPresent()) {
throw new ServerStartFailureException(
new IllegalStateException("Failed to create server instance"));
}
final Kvantum kvantum = kvantumOptional.get();
for (final Object object : classes) {
if (object == null) {
throw new NullPointerException("Passed object is null. Not suitable for routing.");
}
if (object instanceof RequestHandler) {
kvantum.getRouter().add((RequestHandler) object);
} else {
final Collection<? extends RequestHandler> added =
kvantum.getRouter().scanAndAdd(object);
if (added.isEmpty()) {
throw new IllegalArgumentException("No views declarations found in " + object);
}
}
}
return kvantum;
}
public static final class ServerStartFailureException extends RuntimeException {
ServerStartFailureException(final Exception e) {
super(e);
}
ServerStartFailureException() {
super();
}
}
|
@SuppressWarnings("ALL") static Kvantum function(final Object... classes) throws ServerStartFailureException { final ServerContext kvantumContext = ServerContext.builder().coreFolder(new File(STR)) .router(RequestManager.builder().build()) .standalone(true).serverSupplier(SimpleServer::new).build(); final Optional<Kvantum> kvantumOptional = kvantumContext.create(); if (!kvantumOptional.isPresent()) { throw new ServerStartFailureException( new IllegalStateException(STR)); } final Kvantum kvantum = kvantumOptional.get(); for (final Object object : classes) { if (object == null) { throw new NullPointerException(STR); } if (object instanceof RequestHandler) { kvantum.getRouter().add((RequestHandler) object); } else { final Collection<? extends RequestHandler> added = kvantum.getRouter().scanAndAdd(object); if (added.isEmpty()) { throw new IllegalArgumentException(STR + object); } } } return kvantum; } public static final class ServerStartFailureException extends RuntimeException { ServerStartFailureException(final Exception e) { super(e); } ServerStartFailureException() { super(); } }
|
/**
* Utility method that creates a new simple server instance. It will register any request handlers passed as
* arguments, and scan for annotations in the case that non request handler objects are passed
*
* @param classes Request handlers to register in the router
* @return Created instance
*/
|
Utility method that creates a new simple server instance. It will register any request handlers passed as arguments, and scan for annotations in the case that non request handler objects are passed
|
newStandaloneServer
|
{
"repo_name": "IntellectualSites/IntellectualServer",
"path": "Implementation/src/main/java/xyz/kvantum/server/implementation/QuickStart.java",
"license": "gpl-2.0",
"size": 3221
}
|
[
"java.io.File",
"java.util.Collection",
"java.util.Optional",
"xyz.kvantum.server.api.core.Kvantum",
"xyz.kvantum.server.api.util.RequestManager",
"xyz.kvantum.server.api.views.RequestHandler"
] |
import java.io.File; import java.util.Collection; import java.util.Optional; import xyz.kvantum.server.api.core.Kvantum; import xyz.kvantum.server.api.util.RequestManager; import xyz.kvantum.server.api.views.RequestHandler;
|
import java.io.*; import java.util.*; import xyz.kvantum.server.api.core.*; import xyz.kvantum.server.api.util.*; import xyz.kvantum.server.api.views.*;
|
[
"java.io",
"java.util",
"xyz.kvantum.server"
] |
java.io; java.util; xyz.kvantum.server;
| 1,620,188
|
public DateTime toDate(char c, TimeZone tz);
|
DateTime function(char c, TimeZone tz);
|
/**
* cast a char to a DateTime Object
*
* @param c char to cast
* @param tz
* @return casted DateTime Object
*/
|
cast a char to a DateTime Object
|
toDate
|
{
"repo_name": "jzuijlek/Lucee",
"path": "loader/src/main/java/lucee/runtime/util/Cast.java",
"license": "lgpl-2.1",
"size": 42080
}
|
[
"java.util.TimeZone"
] |
import java.util.TimeZone;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,313,560
|
protected boolean requiresAuthentication(final HttpServletRequest request,
final HttpServletResponse response) {
final boolean serviceTicketRequest = serviceTicketRequest(request, response);
final boolean result = serviceTicketRequest || proxyReceptorRequest(request)
|| (proxyTicketRequest(serviceTicketRequest, request));
if (logger.isDebugEnabled()) {
logger.debug("requiresAuthentication = " + result);
}
return result;
}
|
boolean function(final HttpServletRequest request, final HttpServletResponse response) { final boolean serviceTicketRequest = serviceTicketRequest(request, response); final boolean result = serviceTicketRequest proxyReceptorRequest(request) (proxyTicketRequest(serviceTicketRequest, request)); if (logger.isDebugEnabled()) { logger.debug(STR + result); } return result; }
|
/**
* Overridden to provide proxying capabilities.
*/
|
Overridden to provide proxying capabilities
|
requiresAuthentication
|
{
"repo_name": "zshift/spring-security",
"path": "cas/src/main/java/org/springframework/security/cas/web/CasAuthenticationFilter.java",
"license": "apache-2.0",
"size": 18997
}
|
[
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse"
] |
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.*;
|
[
"javax.servlet"
] |
javax.servlet;
| 422,894
|
public NodeKey getOldParent() {
return oldParent;
}
|
NodeKey function() { return oldParent; }
|
/**
* Get the parent under which the node formerly appeared.
*
* @return the old parent; never null
*/
|
Get the parent under which the node formerly appeared
|
getOldParent
|
{
"repo_name": "flownclouds/modeshape",
"path": "modeshape-jcr/src/main/java/org/modeshape/jcr/cache/change/NodeMoved.java",
"license": "apache-2.0",
"size": 2758
}
|
[
"org.modeshape.jcr.cache.NodeKey"
] |
import org.modeshape.jcr.cache.NodeKey;
|
import org.modeshape.jcr.cache.*;
|
[
"org.modeshape.jcr"
] |
org.modeshape.jcr;
| 1,562,838
|
EAttribute getCDOResourceNode_Name();
|
EAttribute getCDOResourceNode_Name();
|
/**
* Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.eresource.CDOResourceNode#getName
* <em>Name</em>}'. <!-- begin-user-doc -->
*
* @since 2.0<!-- end-user-doc -->
* @return the meta object for the attribute '<em>Name</em>'.
* @see org.eclipse.emf.cdo.eresource.CDOResourceNode#getName()
* @see #getCDOResourceNode()
* @generated
*/
|
Returns the meta object for the attribute '<code>org.eclipse.emf.cdo.eresource.CDOResourceNode#getName Name</code>'.
|
getCDOResourceNode_Name
|
{
"repo_name": "IHTSDO/snow-owl",
"path": "dependencies/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/EresourcePackage.java",
"license": "apache-2.0",
"size": 34776
}
|
[
"org.eclipse.emf.ecore.EAttribute"
] |
import org.eclipse.emf.ecore.EAttribute;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 332,443
|
public boolean setcolor(String fstype, String colorspace,
double c1,
@Optional double c2,
@Optional double c3,
@Optional double c4)
{
return _stream.setcolor(fstype, colorspace, c1, c2, c3, c4);
}
|
boolean function(String fstype, String colorspace, double c1, @Optional double c2, @Optional double c3, @Optional double c4) { return _stream.setcolor(fstype, colorspace, c1, c2, c3, c4); }
|
/**
* Sets the color
*/
|
Sets the color
|
setcolor
|
{
"repo_name": "christianchristensen/resin",
"path": "modules/resin/src/com/caucho/quercus/lib/pdf/PDF.java",
"license": "gpl-2.0",
"size": 20638
}
|
[
"com.caucho.quercus.annotation.Optional"
] |
import com.caucho.quercus.annotation.Optional;
|
import com.caucho.quercus.annotation.*;
|
[
"com.caucho.quercus"
] |
com.caucho.quercus;
| 1,708,335
|
@Override
public void onModuleLoad() {
Tracking.trackPageview();
|
void function() { Tracking.trackPageview();
|
/**
* Main entry point for Ode. Setting up the UI and the web service
* connections.
*/
|
Main entry point for Ode. Setting up the UI and the web service connections
|
onModuleLoad
|
{
"repo_name": "farxinu/appinventor-sources",
"path": "appinventor/appengine/src/com/google/appinventor/client/Ode.java",
"license": "apache-2.0",
"size": 89453
}
|
[
"com.google.appinventor.client.tracking.Tracking"
] |
import com.google.appinventor.client.tracking.Tracking;
|
import com.google.appinventor.client.tracking.*;
|
[
"com.google.appinventor"
] |
com.google.appinventor;
| 2,585,406
|
private static List<DictionaryColumnUniqueIdentifier> getDictionaryColumnUniqueIdentifierList(
List<String> dictionaryColumnIdList, CarbonTableIdentifier carbonTableIdentifier) {
CarbonTable carbonTable =
CarbonMetadata.getInstance().getCarbonTable(carbonTableIdentifier.getTableUniqueName());
List<DictionaryColumnUniqueIdentifier> dictionaryColumnUniqueIdentifiers =
new ArrayList<>(dictionaryColumnIdList.size());
for (String columnId : dictionaryColumnIdList) {
CarbonDimension dimension = CarbonMetadata.getInstance()
.getCarbonDimensionBasedOnColIdentifier(carbonTable, columnId);
if (dimension != null) {
dictionaryColumnUniqueIdentifiers.add(
new DictionaryColumnUniqueIdentifier(
carbonTableIdentifier,
dimension.getColumnIdentifier(),
dimension.getDataType()
)
);
}
}
return dictionaryColumnUniqueIdentifiers;
}
|
static List<DictionaryColumnUniqueIdentifier> function( List<String> dictionaryColumnIdList, CarbonTableIdentifier carbonTableIdentifier) { CarbonTable carbonTable = CarbonMetadata.getInstance().getCarbonTable(carbonTableIdentifier.getTableUniqueName()); List<DictionaryColumnUniqueIdentifier> dictionaryColumnUniqueIdentifiers = new ArrayList<>(dictionaryColumnIdList.size()); for (String columnId : dictionaryColumnIdList) { CarbonDimension dimension = CarbonMetadata.getInstance() .getCarbonDimensionBasedOnColIdentifier(carbonTable, columnId); if (dimension != null) { dictionaryColumnUniqueIdentifiers.add( new DictionaryColumnUniqueIdentifier( carbonTableIdentifier, dimension.getColumnIdentifier(), dimension.getDataType() ) ); } } return dictionaryColumnUniqueIdentifiers; }
|
/**
* Below method will be used to get the dictionary column unique identifier
*
* @param dictionaryColumnIdList dictionary
* @param carbonTableIdentifier
* @return
*/
|
Below method will be used to get the dictionary column unique identifier
|
getDictionaryColumnUniqueIdentifierList
|
{
"repo_name": "mayunSaicmotor/incubator-carbondata",
"path": "core/src/main/java/org/apache/carbondata/core/scan/executor/util/QueryUtil.java",
"license": "apache-2.0",
"size": 40568
}
|
[
"java.util.ArrayList",
"java.util.List",
"org.apache.carbondata.core.cache.dictionary.DictionaryColumnUniqueIdentifier",
"org.apache.carbondata.core.metadata.CarbonMetadata",
"org.apache.carbondata.core.metadata.CarbonTableIdentifier",
"org.apache.carbondata.core.metadata.schema.table.CarbonTable",
"org.apache.carbondata.core.metadata.schema.table.column.CarbonDimension"
] |
import java.util.ArrayList; import java.util.List; import org.apache.carbondata.core.cache.dictionary.DictionaryColumnUniqueIdentifier; import org.apache.carbondata.core.metadata.CarbonMetadata; import org.apache.carbondata.core.metadata.CarbonTableIdentifier; import org.apache.carbondata.core.metadata.schema.table.CarbonTable; import org.apache.carbondata.core.metadata.schema.table.column.CarbonDimension;
|
import java.util.*; import org.apache.carbondata.core.cache.dictionary.*; import org.apache.carbondata.core.metadata.*; import org.apache.carbondata.core.metadata.schema.table.*; import org.apache.carbondata.core.metadata.schema.table.column.*;
|
[
"java.util",
"org.apache.carbondata"
] |
java.util; org.apache.carbondata;
| 922,314
|
public List<SecurityRuleInner> defaultSecurityRules() {
return this.defaultSecurityRules;
}
|
List<SecurityRuleInner> function() { return this.defaultSecurityRules; }
|
/**
* Get the defaultSecurityRules property: The default security rules of network security group.
*
* @return the defaultSecurityRules value.
*/
|
Get the defaultSecurityRules property: The default security rules of network security group
|
defaultSecurityRules
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkSecurityGroupPropertiesFormat.java",
"license": "mit",
"size": 5795
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,957,778
|
boolean mExternalStorageAvailable = false;
String state = Environment.getExternalStorageState();
if (Environment.MEDIA_MOUNTED.equals(state)) {
// We can read and write the media
mExternalStorageAvailable = true;
} else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
// We can only read the media
mExternalStorageAvailable = true;
} else {
// Something else is wrong. It may be one of many other states,
// but all we need
// to know is we can neither read nor write
mExternalStorageAvailable = false;
}
return mExternalStorageAvailable;
}
|
boolean mExternalStorageAvailable = false; String state = Environment.getExternalStorageState(); if (Environment.MEDIA_MOUNTED.equals(state)) { mExternalStorageAvailable = true; } else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) { mExternalStorageAvailable = true; } else { mExternalStorageAvailable = false; } return mExternalStorageAvailable; }
|
/**
* Check if the SD Card is Available
*
* @return true if the sd card is available and false if it is not
*/
|
Check if the SD Card is Available
|
isSDCardAvailable
|
{
"repo_name": "yongbeam/AirQuickUtils",
"path": "airquickutils/src/main/java/yongbeom/utils/airquickutils/core/AirSdcard.java",
"license": "apache-2.0",
"size": 23915
}
|
[
"android.os.Environment"
] |
import android.os.Environment;
|
import android.os.*;
|
[
"android.os"
] |
android.os;
| 128,826
|
@Test(expectedExceptions = { LDAPException.class })
public void testConstructor6WrongPassword()
throws Exception
{
if (! isDirectoryInstanceAvailable())
{
throw new LDAPException(ResultCode.CONNECT_ERROR);
}
String password;
if (getTestBindPassword().equals("wrong"))
{
password = "nogright";
}
else
{
password = "wrong";
}
new LDAPConnection(getTestHost(), getTestPort(), getTestBindDN(),
password);
}
|
@Test(expectedExceptions = { LDAPException.class }) void function() throws Exception { if (! isDirectoryInstanceAvailable()) { throw new LDAPException(ResultCode.CONNECT_ERROR); } String password; if (getTestBindPassword().equals("wrong")) { password = STR; } else { password = "wrong"; } new LDAPConnection(getTestHost(), getTestPort(), getTestBindDN(), password); }
|
/**
* Tests the sixth constructor, which takes a directory server host, port,
* bind DN, and password, using an incorrect password.
* <BR><BR>
* Access to a Directory Server instance is required for complete processing.
*
* @throws Exception If an unexpected problem occurs.
*/
|
Tests the sixth constructor, which takes a directory server host, port, bind DN, and password, using an incorrect password. Access to a Directory Server instance is required for complete processing
|
testConstructor6WrongPassword
|
{
"repo_name": "UnboundID/ldapsdk",
"path": "tests/unit/src/com/unboundid/ldap/sdk/LDAPConnectionTestCase.java",
"license": "gpl-2.0",
"size": 157011
}
|
[
"org.testng.annotations.Test"
] |
import org.testng.annotations.Test;
|
import org.testng.annotations.*;
|
[
"org.testng.annotations"
] |
org.testng.annotations;
| 2,454,859
|
@SuppressWarnings("rawtypes")
private static Object findFirstNonNull(Iterator it) {
Object result = null;
while(it.hasNext()) {
result = it.next();
if(result != null) {
break;
}
}
return result;
}
|
@SuppressWarnings(STR) static Object function(Iterator it) { Object result = null; while(it.hasNext()) { result = it.next(); if(result != null) { break; } } return result; }
|
/**
* Finds first non <code>null</code> value in an iterator, does return <code>null</code> if
* no non <code>null</code> values are found.
* @param it
* @return
*/
|
Finds first non <code>null</code> value in an iterator, does return <code>null</code> if no non <code>null</code> values are found
|
findFirstNonNull
|
{
"repo_name": "jaxad0127/siren4j",
"path": "src/main/java/com/google/code/siren4j/util/ReflectionUtils.java",
"license": "mit",
"size": 22355
}
|
[
"java.util.Iterator"
] |
import java.util.Iterator;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,383,393
|
public static String makeListBucketingDirName(List<String> lbCols, List<String> vals) {
StringBuilder name = new StringBuilder();
for (int i = 0; i < lbCols.size(); i++) {
if (i > 0) {
name.append(Path.SEPARATOR);
}
name.append(escapePathName((lbCols.get(i)).toLowerCase()));
name.append('=');
name.append(escapePathName(vals.get(i)));
}
return name.toString();
}
// NOTE: This is for generating the internal path name for partitions. Users
// should always use the MetaStore API to get the path name for a partition.
// Users should not directly take partition values and turn it into a path
// name by themselves, because the logic below may change in the future.
//
// In the future, it's OK to add new chars to the escape list, and old data
// won't be corrupt, because the full path name in metastore is stored.
// In that case, Hive will continue to read the old data, but when it creates
// new partitions, it will use new names.
// edit : There are some use cases for which adding new chars does not seem
// to be backward compatible - Eg. if partition was created with name having
// a special char that you want to start escaping, and then you try dropping
// the partition with a hive version that now escapes the special char using
// the list below, then the drop partition fails to work.
static BitSet charToEscape = new BitSet(128);
static {
for (char c = 0; c < ' '; c++) {
charToEscape.set(c);
}
char[] clist = new char[] {'\u0001', '\u0002', '\u0003', '\u0004',
'\u0005', '\u0006', '\u0007', '\u0008', '\u0009', '\n', '\u000B',
'\u000C', '\r', '\u000E', '\u000F', '\u0010', '\u0011', '\u0012',
'\u0013', '\u0014', '\u0015', '\u0016', '\u0017', '\u0018', '\u0019',
'\u001A', '\u001B', '\u001C', '\u001D', '\u001E', '\u001F',
'"', '#', '%', '\'', '*', '/', ':', '=', '?', '\\', '\u007F', '{',
'[', ']', '^'};
for (char c : clist) {
charToEscape.set(c);
}
}
|
static String function(List<String> lbCols, List<String> vals) { StringBuilder name = new StringBuilder(); for (int i = 0; i < lbCols.size(); i++) { if (i > 0) { name.append(Path.SEPARATOR); } name.append(escapePathName((lbCols.get(i)).toLowerCase())); name.append('='); name.append(escapePathName(vals.get(i))); } return name.toString(); } static BitSet charToEscape = new BitSet(128); static { for (char c = 0; c < ' '; c++) { charToEscape.set(c); } char[] clist = new char[] {'\u0001', '\u0002', '\u0003', '\u0004', '\u0005', '\u0006', '\u0007', '\u0008', '\u0009', '\n', '\u000B', '\u000C', '\r', '\u000E', '\u000F', '\u0010', '\u0011', '\u0012', '\u0013', '\u0014', '\u0015', '\u0016', '\u0017', '\u0018', '\u0019', '\u001A', '\u001B', '\u001C', '\u001D', '\u001E', '\u001F', '"', '#', '%', '\'', '*', '/', ':', '=', '?', '\\', '\u007F', '{', '[', ']', '^'}; for (char c : clist) { charToEscape.set(c); } }
|
/**
* Makes a valid list bucketing directory name.
* @param lbCols The skewed keys' names
* @param vals The skewed values
* @return An escaped, valid list bucketing directory name.
*/
|
Makes a valid list bucketing directory name
|
makeListBucketingDirName
|
{
"repo_name": "b-slim/hive",
"path": "common/src/java/org/apache/hadoop/hive/common/FileUtils.java",
"license": "apache-2.0",
"size": 38403
}
|
[
"java.util.BitSet",
"java.util.List",
"org.apache.hadoop.fs.Path"
] |
import java.util.BitSet; import java.util.List; import org.apache.hadoop.fs.Path;
|
import java.util.*; import org.apache.hadoop.fs.*;
|
[
"java.util",
"org.apache.hadoop"
] |
java.util; org.apache.hadoop;
| 1,952,545
|
public Set<String> getDensities() {
Set<String> result = Sets.newHashSet();
for (Density density : densities) {
result.add(density.getResourceValue());
}
return result;
}
|
Set<String> function() { Set<String> result = Sets.newHashSet(); for (Density density : densities) { result.add(density.getResourceValue()); } return result; }
|
/**
* Set of screen densities for which PNG files should be generated based on vector drawable
* resource files.
* <p>
* <p>Default to {@code ["mdpi", "hdpi", "xhdpi", "xxhdpi"]}.
*/
|
Set of screen densities for which PNG files should be generated based on vector drawable resource files. Default to ["mdpi", "hdpi", "xhdpi", "xxhdpi"]
|
getDensities
|
{
"repo_name": "tranleduy2000/javaide",
"path": "aosp/gradle/src/main/java/com/android/build/gradle/internal/dsl/PreprocessingOptions.java",
"license": "gpl-3.0",
"size": 2897
}
|
[
"com.android.resources.Density",
"com.google.common.collect.Sets",
"java.util.Set"
] |
import com.android.resources.Density; import com.google.common.collect.Sets; import java.util.Set;
|
import com.android.resources.*; import com.google.common.collect.*; import java.util.*;
|
[
"com.android.resources",
"com.google.common",
"java.util"
] |
com.android.resources; com.google.common; java.util;
| 2,907,310
|
public void xdrDecode(XdrDecodingStream xdr)
throws OncRpcException, IOException
{
value = xdr.xdrDecodeBoolean();
}
private boolean value;
}
|
void function(XdrDecodingStream xdr) throws OncRpcException, IOException { value = xdr.xdrDecodeBoolean(); } private boolean value; }
|
/**
* Decodes -- that is: deserializes -- a XDR boolean from a XDR stream in
* compliance to RFC 1832.
*
* @throws OncRpcException if an ONC/RPC error occurs.
* @throws IOException if an I/O error occurs.
*/
|
Decodes -- that is: deserializes -- a XDR boolean from a XDR stream in compliance to RFC 1832
|
xdrDecode
|
{
"repo_name": "j-hoppe/BlinkenBone",
"path": "projects/3rdparty/remotetea/src/org/acplt/oncrpc/XdrBoolean.java",
"license": "mit",
"size": 3352
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,140,788
|
private void adjustCrcFilePosition() throws IOException {
if (out != null) {
out.flush();
}
if (checksumOut != null) {
checksumOut.flush();
}
// rollback the position of the meta file
datanode.data.adjustCrcChannelPosition(block, streams, checksumSize);
}
|
void function() throws IOException { if (out != null) { out.flush(); } if (checksumOut != null) { checksumOut.flush(); } datanode.data.adjustCrcChannelPosition(block, streams, checksumSize); }
|
/**
* Adjust the file pointer in the local meta file so that the last checksum
* will be overwritten.
*/
|
Adjust the file pointer in the local meta file so that the last checksum will be overwritten
|
adjustCrcFilePosition
|
{
"repo_name": "zhe-thoughts/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java",
"license": "apache-2.0",
"size": 55228
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,224,070
|
public ClassificationEstimator test(ArrayList<Integer> indexes,
Object dataType, int[] testLabelArray, int numClasses)
throws Exception;
|
ClassificationEstimator function(ArrayList<Integer> indexes, Object dataType, int[] testLabelArray, int numClasses) throws Exception;
|
/**
* This method tests and evaluates the classifier.
*
* @param indexes ArrayList<Integer> of test data indexes.
* @param dataType Object that is the test data context. It can correspond
* to dense and sparse DataSet objects, as well as a DiscretizedDataSet data
* context.
* @param testLabelArray int[] representing the separate test data label
* array.
* @param numClasses Integer that is the number of classes in the data.
* @return ClassificationEstimator containing the resulting classification
* quality measures.
* @throws Exception
*/
|
This method tests and evaluates the classifier
|
test
|
{
"repo_name": "datapoet/hubminer",
"path": "src/main/java/learning/supervised/evaluation/ValidateableInterface.java",
"license": "gpl-3.0",
"size": 24601
}
|
[
"java.util.ArrayList"
] |
import java.util.ArrayList;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,200,811
|
public java.awt.Graphics2D createPrinterGraphics(float width, float height, FontMapper fontMapper, boolean convertImagesToJPEG, float quality, PrinterJob printerJob) {
return new PdfPrinterGraphics2D(this, width, height, fontMapper, false, convertImagesToJPEG, quality, printerJob);
}
|
java.awt.Graphics2D function(float width, float height, FontMapper fontMapper, boolean convertImagesToJPEG, float quality, PrinterJob printerJob) { return new PdfPrinterGraphics2D(this, width, height, fontMapper, false, convertImagesToJPEG, quality, printerJob); }
|
/** Gets a <CODE>Graphics2D</CODE> to print on. The graphics
* are translated to PDF commands.
* @param width the width of the panel
* @param height the height of the panel
* @param fontMapper the mapping from awt fonts to <CODE>BaseFont</CODE>
* @param convertImagesToJPEG converts awt images to jpeg before inserting in pdf
* @param quality the quality of the jpeg
* @param printerJob a printer job
* @return a <CODE>Graphics2D</CODE>
*/
|
Gets a <code>Graphics2D</code> to print on. The graphics are translated to PDF commands
|
createPrinterGraphics
|
{
"repo_name": "shitalm/jsignpdf2",
"path": "src/main/java/com/lowagie/text/pdf/PdfContentByte.java",
"license": "gpl-2.0",
"size": 115262
}
|
[
"java.awt.print.PrinterJob"
] |
import java.awt.print.PrinterJob;
|
import java.awt.print.*;
|
[
"java.awt"
] |
java.awt;
| 551,540
|
public String withdrawRequestAction(ProtocolForm protocolForm) throws Exception;
|
String function(ProtocolForm protocolForm) throws Exception;
|
/**
* This method is to withdraw a previously submitted "request to" action
* @param protocolForm
* @param taskName
* @return
* @throws Exception
*/
|
This method is to withdraw a previously submitted "request to" action
|
withdrawRequestAction
|
{
"repo_name": "vivantech/kc_fixes",
"path": "src/main/java/org/kuali/kra/irb/actions/IrbProtocolActionRequestService.java",
"license": "apache-2.0",
"size": 17752
}
|
[
"org.kuali.kra.irb.ProtocolForm"
] |
import org.kuali.kra.irb.ProtocolForm;
|
import org.kuali.kra.irb.*;
|
[
"org.kuali.kra"
] |
org.kuali.kra;
| 2,654,114
|
protected void addSourceFolderPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_EcoreCodeGeneratorConfiguration_sourceFolder_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_EcoreCodeGeneratorConfiguration_sourceFolder_feature", "_UI_EcoreCodeGeneratorConfiguration_type"),
EcorePackage.Literals.ECORE_CODE_GENERATOR_CONFIGURATION__SOURCE_FOLDER,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
|
void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), EcorePackage.Literals.ECORE_CODE_GENERATOR_CONFIGURATION__SOURCE_FOLDER, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); }
|
/**
* This adds a property descriptor for the Source Folder feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
|
This adds a property descriptor for the Source Folder feature.
|
addSourceFolderPropertyDescriptor
|
{
"repo_name": "Nasdanika/codegen-ecore",
"path": "org.nasdanika.codegen.ecore.edit/src/org/nasdanika/codegen/ecore/provider/EcoreCodeGeneratorConfigurationItemProvider.java",
"license": "epl-1.0",
"size": 7894
}
|
[
"org.eclipse.emf.edit.provider.ComposeableAdapterFactory",
"org.eclipse.emf.edit.provider.ItemPropertyDescriptor",
"org.nasdanika.codegen.ecore.EcorePackage"
] |
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.nasdanika.codegen.ecore.EcorePackage;
|
import org.eclipse.emf.edit.provider.*; import org.nasdanika.codegen.ecore.*;
|
[
"org.eclipse.emf",
"org.nasdanika.codegen"
] |
org.eclipse.emf; org.nasdanika.codegen;
| 2,584,031
|
public Timestamp getGuaranteeDate();
public static final String COLUMNNAME_IsActive = "IsActive";
|
Timestamp function(); public static final String COLUMNNAME_IsActive = STR;
|
/** Get Guarantee Date.
* Date when guarantee expires
*/
|
Get Guarantee Date. Date when guarantee expires
|
getGuaranteeDate
|
{
"repo_name": "armenrz/adempiere",
"path": "base/src/org/compiere/model/I_M_AttributeSetInstance.java",
"license": "gpl-2.0",
"size": 5926
}
|
[
"java.sql.Timestamp"
] |
import java.sql.Timestamp;
|
import java.sql.*;
|
[
"java.sql"
] |
java.sql;
| 1,850,444
|
public List<IQHandler> getIQHandlers() {
List<IQHandler> answer = new ArrayList<IQHandler>();
for (Module module : modules.values()) {
if (module instanceof IQHandler) {
answer.add((IQHandler) module);
}
}
return answer;
}
|
List<IQHandler> function() { List<IQHandler> answer = new ArrayList<IQHandler>(); for (Module module : modules.values()) { if (module instanceof IQHandler) { answer.add((IQHandler) module); } } return answer; }
|
/**
* Returns a list with all the modules registered with the server that inherit from IQHandler.
*
* @return a list with all the modules registered with the server that inherit from IQHandler.
*/
|
Returns a list with all the modules registered with the server that inherit from IQHandler
|
getIQHandlers
|
{
"repo_name": "coodeer/g3server",
"path": "src/java/org/jivesoftware/openfire/XMPPServer.java",
"license": "apache-2.0",
"size": 58703
}
|
[
"java.util.ArrayList",
"java.util.List",
"org.jivesoftware.openfire.container.Module",
"org.jivesoftware.openfire.handler.IQHandler"
] |
import java.util.ArrayList; import java.util.List; import org.jivesoftware.openfire.container.Module; import org.jivesoftware.openfire.handler.IQHandler;
|
import java.util.*; import org.jivesoftware.openfire.container.*; import org.jivesoftware.openfire.handler.*;
|
[
"java.util",
"org.jivesoftware.openfire"
] |
java.util; org.jivesoftware.openfire;
| 1,307,407
|
List<Object[]> findConsumedMedicationsDiary(Long patientId,
Date startDate, Date endDate)
throws IllegalArgumentException;
|
List<Object[]> findConsumedMedicationsDiary(Long patientId, Date startDate, Date endDate) throws IllegalArgumentException;
|
/**
* Computes patient's consumed madications diary based on date
*
* @param patientId
* @param startDate
* @param endDate
* @return {@link Date}, {@link Medication} and amount ({@link Integer}) of
* given medication in given day (count of medication's standard
* unit size)
* @throws IllegalArgumentException
* if <li>patientId == null</li> <li>
* startDate == null</li> <li>endDate == null</li>
*/
|
Computes patient's consumed madications diary based on date
|
findConsumedMedicationsDiary
|
{
"repo_name": "MobileManAG/Project-H-Backend",
"path": "src/main/java/com/mobileman/projecth/business/PatientMedicationService.java",
"license": "apache-2.0",
"size": 5536
}
|
[
"java.util.Date",
"java.util.List"
] |
import java.util.Date; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 428,915
|
TrackGroupArray getCurrentTrackGroups();
|
TrackGroupArray getCurrentTrackGroups();
|
/**
* Returns the available track groups.
*/
|
Returns the available track groups
|
getCurrentTrackGroups
|
{
"repo_name": "superbderrick/ExoPlayer",
"path": "library/core/src/main/java/com/google/android/exoplayer2/Player.java",
"license": "apache-2.0",
"size": 38907
}
|
[
"com.google.android.exoplayer2.source.TrackGroupArray"
] |
import com.google.android.exoplayer2.source.TrackGroupArray;
|
import com.google.android.exoplayer2.source.*;
|
[
"com.google.android"
] |
com.google.android;
| 2,134,360
|
public BodyConsumer createResourceBodyConsumer(final Account account,
final ResourceType resourceType,
final String name,
final HttpResponder responder) throws IOException {
final ZKInterProcessReentrantLock lock = getResourceLock(account, resourceType, name);
lock.acquire();
try {
PluginResourceTypeView view = metaStoreService.getResourceTypeView(account, resourceType);
// ok to do versioning this way since we have a lock
final int version = view.getHighestVersion(name) + 1;
final ResourceMeta resourceMeta = new ResourceMeta(name, version);
LOG.debug("getting output stream for version {} of resource {} of type {} for account {}",
version, name, resourceType, account);
// output stream is used to stream resource contents to the plugin store
final OutputStream os = pluginStore.getResourceOutputStream(account, resourceType, name, version);
// we write metadata here before the data completes streaming because we are guaranteed the
// version will never be used again, and because we need to increment the highest version in case another
// upload of the same name is started while this one is still going. It is deleted if the upload fails.
metaStoreService.getResourceTypeView(account, resourceType).add(resourceMeta);
|
BodyConsumer function(final Account account, final ResourceType resourceType, final String name, final HttpResponder responder) throws IOException { final ZKInterProcessReentrantLock lock = getResourceLock(account, resourceType, name); lock.acquire(); try { PluginResourceTypeView view = metaStoreService.getResourceTypeView(account, resourceType); final int version = view.getHighestVersion(name) + 1; final ResourceMeta resourceMeta = new ResourceMeta(name, version); LOG.debug(STR, version, name, resourceType, account); final OutputStream os = pluginStore.getResourceOutputStream(account, resourceType, name, version); metaStoreService.getResourceTypeView(account, resourceType).add(resourceMeta);
|
/**
* Create a body consumer for streaming resource contents into the persistent store.
*
* @param account Account that is uploading the resource
* @param resourceType Type of resource to upload
* @param name Name of resource to upload
* @param responder Responder for responding to the upload request
* @return BodyConsumer for consuming the resource contents and streaming them to the persistent store
* @throws IOException if there was an error getting the output stream for writing to the persistent store or writing
* the plugin metadata
*/
|
Create a body consumer for streaming resource contents into the persistent store
|
createResourceBodyConsumer
|
{
"repo_name": "quantiply-fork/coopr",
"path": "coopr-server/src/main/java/co/cask/coopr/provisioner/plugin/ResourceService.java",
"license": "apache-2.0",
"size": 22569
}
|
[
"co.cask.coopr.account.Account",
"co.cask.coopr.common.zookeeper.lib.ZKInterProcessReentrantLock",
"co.cask.coopr.store.provisioner.PluginResourceTypeView",
"co.cask.http.BodyConsumer",
"co.cask.http.HttpResponder",
"java.io.IOException",
"java.io.OutputStream"
] |
import co.cask.coopr.account.Account; import co.cask.coopr.common.zookeeper.lib.ZKInterProcessReentrantLock; import co.cask.coopr.store.provisioner.PluginResourceTypeView; import co.cask.http.BodyConsumer; import co.cask.http.HttpResponder; import java.io.IOException; import java.io.OutputStream;
|
import co.cask.coopr.account.*; import co.cask.coopr.common.zookeeper.lib.*; import co.cask.coopr.store.provisioner.*; import co.cask.http.*; import java.io.*;
|
[
"co.cask.coopr",
"co.cask.http",
"java.io"
] |
co.cask.coopr; co.cask.http; java.io;
| 900,985
|
private static String getDefaultOutputPath(CompilationUnit unit) {
String path = unit.getMainTypeName();
if (path.equals(NameTable.PACKAGE_INFO_MAIN_TYPE)) {
path = NameTable.PACKAGE_INFO_FILE_NAME;
}
PackageDeclaration pkg = unit.getPackage();
if (Options.usePackageDirectories() && !pkg.isDefaultPackage()) {
path = pkg.getName().getFullyQualifiedName().replace('.', File.separatorChar)
+ File.separatorChar + path;
}
return path;
}
|
static String function(CompilationUnit unit) { String path = unit.getMainTypeName(); if (path.equals(NameTable.PACKAGE_INFO_MAIN_TYPE)) { path = NameTable.PACKAGE_INFO_FILE_NAME; } PackageDeclaration pkg = unit.getPackage(); if (Options.usePackageDirectories() && !pkg.isDefaultPackage()) { path = pkg.getName().getFullyQualifiedName().replace('.', File.separatorChar) + File.separatorChar + path; } return path; }
|
/**
* Gets the output path if there isn't one already.
* For example, foo/bar/Mumble.java translates to $(OUTPUT_DIR)/foo/bar/Mumble.
* If --no-package-directories is specified, though, the output file is $(OUTPUT_DIR)/Mumble.
*/
|
Gets the output path if there isn't one already. For example, foo/bar/Mumble.java translates to $(OUTPUT_DIR)/foo/bar/Mumble. If --no-package-directories is specified, though, the output file is $(OUTPUT_DIR)/Mumble
|
getDefaultOutputPath
|
{
"repo_name": "zhakui/j2objc",
"path": "translator/src/main/java/com/google/devtools/j2objc/gen/GenerationUnit.java",
"license": "apache-2.0",
"size": 6565
}
|
[
"com.google.devtools.j2objc.Options",
"com.google.devtools.j2objc.ast.CompilationUnit",
"com.google.devtools.j2objc.ast.PackageDeclaration",
"com.google.devtools.j2objc.util.NameTable",
"java.io.File"
] |
import com.google.devtools.j2objc.Options; import com.google.devtools.j2objc.ast.CompilationUnit; import com.google.devtools.j2objc.ast.PackageDeclaration; import com.google.devtools.j2objc.util.NameTable; import java.io.File;
|
import com.google.devtools.j2objc.*; import com.google.devtools.j2objc.ast.*; import com.google.devtools.j2objc.util.*; import java.io.*;
|
[
"com.google.devtools",
"java.io"
] |
com.google.devtools; java.io;
| 340,052
|
super.start(context);
DisplayFormatUtils.startDisplayFormat(getBundle());
}
|
super.start(context); DisplayFormatUtils.startDisplayFormat(getBundle()); }
|
/**
* Called when the Plugin is started.
*
* @param context The BundleContext
* @throws Exception Thrown if an error occurs
*/
|
Called when the Plugin is started
|
start
|
{
"repo_name": "debabratahazra/DS",
"path": "designstudio/components/page/core/com.odcgroup.page.metamodel/src/main/java/com/odcgroup/page/metamodel/PageMetamodelActivator.java",
"license": "epl-1.0",
"size": 1221
}
|
[
"com.odcgroup.page.metamodel.display.DisplayFormatUtils"
] |
import com.odcgroup.page.metamodel.display.DisplayFormatUtils;
|
import com.odcgroup.page.metamodel.display.*;
|
[
"com.odcgroup.page"
] |
com.odcgroup.page;
| 615,115
|
public MockedUnboundedTable addRows(Duration duration, Object... args) {
List<Row> rows = TestUtils.buildRows(getSchema(), Arrays.asList(args));
// record the watermark + rows
this.timestampedRows.add(Pair.of(duration, rows));
return this;
}
|
MockedUnboundedTable function(Duration duration, Object... args) { List<Row> rows = TestUtils.buildRows(getSchema(), Arrays.asList(args)); this.timestampedRows.add(Pair.of(duration, rows)); return this; }
|
/**
* Add rows to the builder.
*
* <p>Sample usage:
*
* <pre>{@code
* addRows(
* duration, -- duration which stands for the corresponding watermark instant
* 1, 3, "james", -- first row
* 2, 5, "bond" -- second row
* ...
* )
* }</pre>
*/
|
Add rows to the builder. Sample usage: <code>addRows( duration, -- duration which stands for the corresponding watermark instant 1, 3, "james", -- first row 2, 5, "bond" -- second row ... ) </code>
|
addRows
|
{
"repo_name": "axbaretto/beam",
"path": "sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/mock/MockedUnboundedTable.java",
"license": "apache-2.0",
"size": 3814
}
|
[
"java.util.Arrays",
"java.util.List",
"org.apache.beam.sdk.extensions.sql.TestUtils",
"org.apache.beam.sdk.values.Row",
"org.apache.calcite.util.Pair",
"org.joda.time.Duration"
] |
import java.util.Arrays; import java.util.List; import org.apache.beam.sdk.extensions.sql.TestUtils; import org.apache.beam.sdk.values.Row; import org.apache.calcite.util.Pair; import org.joda.time.Duration;
|
import java.util.*; import org.apache.beam.sdk.extensions.sql.*; import org.apache.beam.sdk.values.*; import org.apache.calcite.util.*; import org.joda.time.*;
|
[
"java.util",
"org.apache.beam",
"org.apache.calcite",
"org.joda.time"
] |
java.util; org.apache.beam; org.apache.calcite; org.joda.time;
| 177,283
|
public User getUser(String id) {
return connector.getUser(id, sessionData.getAccessToken());
}
|
User function(String id) { return connector.getUser(id, sessionData.getAccessToken()); }
|
/**
* Returns the user with the given ID.
*
* @param id
* the user ID
* @return the requested user
*/
|
Returns the user with the given ID
|
getUser
|
{
"repo_name": "dacrome/addon-administration",
"path": "src/main/java/org/osiam/addons/administration/service/UserService.java",
"license": "mit",
"size": 5981
}
|
[
"org.osiam.resources.scim.User"
] |
import org.osiam.resources.scim.User;
|
import org.osiam.resources.scim.*;
|
[
"org.osiam.resources"
] |
org.osiam.resources;
| 1,995,439
|
Single<Map<String, Map<StreamMessageId, Map<K, V>>>> read(int count, StreamMessageId id, String name2, StreamMessageId id2);
|
Single<Map<String, Map<StreamMessageId, Map<K, V>>>> read(int count, StreamMessageId id, String name2, StreamMessageId id2);
|
/**
* Read stream data by specified stream name including this stream.
*
* @param count - stream data size limit
* @param id - id of this stream
* @param name2 - name of second stream
* @param id2 - id of second stream
* @return stream data mapped by key and Stream ID
*/
|
Read stream data by specified stream name including this stream
|
read
|
{
"repo_name": "mrniko/redisson",
"path": "redisson/src/main/java/org/redisson/api/RStreamRx.java",
"license": "apache-2.0",
"size": 32410
}
|
[
"io.reactivex.rxjava3.core.Single",
"java.util.Map"
] |
import io.reactivex.rxjava3.core.Single; import java.util.Map;
|
import io.reactivex.rxjava3.core.*; import java.util.*;
|
[
"io.reactivex.rxjava3",
"java.util"
] |
io.reactivex.rxjava3; java.util;
| 1,505,144
|
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<OrganizationResourceInner>, OrganizationResourceInner> beginCreate(
String resourceGroupName, String organizationName, OrganizationResourceInner body);
|
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller<PollResult<OrganizationResourceInner>, OrganizationResourceInner> beginCreate( String resourceGroupName, String organizationName, OrganizationResourceInner body);
|
/**
* Create Organization resource.
*
* @param resourceGroupName Resource group name.
* @param organizationName Organization resource name.
* @param body Organization resource model.
* @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 organization resource.
*/
|
Create Organization resource
|
beginCreate
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/OrganizationsClient.java",
"license": "mit",
"size": 12908
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.management.polling.PollResult",
"com.azure.core.util.polling.SyncPoller",
"com.azure.resourcemanager.confluent.fluent.models.OrganizationResourceInner"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.management.polling.PollResult; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.confluent.fluent.models.OrganizationResourceInner;
|
import com.azure.core.annotation.*; import com.azure.core.management.polling.*; import com.azure.core.util.polling.*; import com.azure.resourcemanager.confluent.fluent.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 1,396,995
|
public final void onInstallFragment(Fragment fragment) {
if (Logging.DEBUG_LIFECYCLE && Email.DEBUG) {
Log.d(Logging.LOG_TAG, this + " onInstallFragment fragment=" + fragment);
}
if (fragment instanceof MailboxListFragment) {
installMailboxListFragment((MailboxListFragment) fragment);
} else if (fragment instanceof MessageListFragment) {
installMessageListFragment((MessageListFragment) fragment);
} else if (fragment instanceof MessageViewFragment) {
installMessageViewFragment((MessageViewFragment) fragment);
} else {
throw new IllegalArgumentException("Tried to install unknown fragment");
}
}
|
final void function(Fragment fragment) { if (Logging.DEBUG_LIFECYCLE && Email.DEBUG) { Log.d(Logging.LOG_TAG, this + STR + fragment); } if (fragment instanceof MailboxListFragment) { installMailboxListFragment((MailboxListFragment) fragment); } else if (fragment instanceof MessageListFragment) { installMessageListFragment((MessageListFragment) fragment); } else if (fragment instanceof MessageViewFragment) { installMessageViewFragment((MessageViewFragment) fragment); } else { throw new IllegalArgumentException(STR); } }
|
/**
* Install a fragment. Must be caleld from the host activity's
* {@link FragmentInstallable#onInstallFragment}.
*/
|
Install a fragment. Must be caleld from the host activity's <code>FragmentInstallable#onInstallFragment</code>
|
onInstallFragment
|
{
"repo_name": "rex-xxx/mt6572_x201",
"path": "packages/apps/Email/src/com/android/email/activity/UIControllerBase.java",
"license": "gpl-2.0",
"size": 51677
}
|
[
"android.app.Fragment",
"android.util.Log",
"com.android.email.Email",
"com.android.emailcommon.Logging"
] |
import android.app.Fragment; import android.util.Log; import com.android.email.Email; import com.android.emailcommon.Logging;
|
import android.app.*; import android.util.*; import com.android.email.*; import com.android.emailcommon.*;
|
[
"android.app",
"android.util",
"com.android.email",
"com.android.emailcommon"
] |
android.app; android.util; com.android.email; com.android.emailcommon;
| 1,180,926
|
private Collection<D> andFilter( Collection<D> list ) throws FilterException
{
Collection<D> results = list;
for( IFilter<D> filter: this.filterChain ){
if( results.size() == 0 )
break;
results = filter.doFilter( results );
}
return results;
}
|
Collection<D> function( Collection<D> list ) throws FilterException { Collection<D> results = list; for( IFilter<D> filter: this.filterChain ){ if( results.size() == 0 ) break; results = filter.doFilter( results ); } return results; }
|
/**
* Perform a logical AND on the filter chain. This means traversing all
* the filters one by one and providing the result from one one filter
* to the next in the chain;
*
* @param list List
* @return List
* @throws FilterException
*/
|
Perform a logical AND on the filter chain. This means traversing all the filters one by one and providing the result from one one filter to the next in the chain
|
andFilter
|
{
"repo_name": "condast/AieonF",
"path": "Workspace/org.aieonf.commons/src/org/aieonf/commons/filter/FilterChain.java",
"license": "apache-2.0",
"size": 5498
}
|
[
"java.util.Collection"
] |
import java.util.Collection;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,543,657
|
DataTruncation exc = ExceptionUtils.findExceptionOfType(t, DataTruncation.class);
if (exc == null) {
return null;
}
String msg = exc.getMessage();
if (!msg.contains("too long")) {
return null;
}
String[] params = msg.split("\'");
if (params.length < 2) {
return null;
}
String fieldName = params[1];
// Ok now convert it to camel case if needed
if (fieldName.contains("_")) {
fieldName = JdbcUtils.convertUnderscoreNameToPropertyName(fieldName);
}
return fieldName;
}
|
DataTruncation exc = ExceptionUtils.findExceptionOfType(t, DataTruncation.class); if (exc == null) { return null; } String msg = exc.getMessage(); if (!msg.contains(STR)) { return null; } String[] params = msg.split("\'"); if (params.length < 2) { return null; } String fieldName = params[1]; if (fieldName.contains("_")) { fieldName = JdbcUtils.convertUnderscoreNameToPropertyName(fieldName); } return fieldName; }
|
/**
* Find a name of the field which was truncated
*
* @param t
* exception received from Spring JDBC
* @return field name if any, otherwize null
* @deprecated this is mysql-specific impl, should be OCP'ed and moved to
* {@link DaoExceptionToFveTranslator}
*/
|
Find a name of the field which was truncated
|
findTruncatedFieldNameIfAny
|
{
"repo_name": "skarpushin/summerb",
"path": "summerb-easycrud/src/main/java/org/summerb/easycrud/common/DaoExceptionUtils.java",
"license": "apache-2.0",
"size": 1929
}
|
[
"java.sql.DataTruncation",
"org.springframework.jdbc.support.JdbcUtils",
"org.summerb.utils.exceptions.ExceptionUtils"
] |
import java.sql.DataTruncation; import org.springframework.jdbc.support.JdbcUtils; import org.summerb.utils.exceptions.ExceptionUtils;
|
import java.sql.*; import org.springframework.jdbc.support.*; import org.summerb.utils.exceptions.*;
|
[
"java.sql",
"org.springframework.jdbc",
"org.summerb.utils"
] |
java.sql; org.springframework.jdbc; org.summerb.utils;
| 1,888,010
|
public void loadResource(Resource... resources) {
for (Resource res : resources) {
String path = FileUtils.toPath(res.getType().toString(), res.getFilePath());
assetManager.load(path, res.getType().getTarget());
pathMap.get(res.getType()).add(path);
}
}
|
void function(Resource... resources) { for (Resource res : resources) { String path = FileUtils.toPath(res.getType().toString(), res.getFilePath()); assetManager.load(path, res.getType().getTarget()); pathMap.get(res.getType()).add(path); } }
|
/**
* Load given resources.
*
* @param resources resources to be loaded
*/
|
Load given resources
|
loadResource
|
{
"repo_name": "VeryGame/gdx-surface",
"path": "gdx-surface/src/main/java/de/verygame/surface/resource/ResourceHandler.java",
"license": "mit",
"size": 16326
}
|
[
"de.verygame.surface.util.FileUtils"
] |
import de.verygame.surface.util.FileUtils;
|
import de.verygame.surface.util.*;
|
[
"de.verygame.surface"
] |
de.verygame.surface;
| 895,051
|
public void setDouble(long address, double value) {
Address.fromLong(address).store(value);
}
|
void function(long address, double value) { Address.fromLong(address).store(value); }
|
/**
* Sets the value of the IEEE754-format eight-byte float store in platform
* byte order at the given address.
* <p>
* The behavior is unspecified if <code>(address ... address + 8)</code>
* is not wholly within the range that was previously allocated using
* <code>malloc()</code>.
* </p>
*
* @param address
* the platform address of the start of the eight-byte value.
* @param value
* the value of the eight-byte float as a Java
* <code>double</code>.
*/
|
Sets the value of the IEEE754-format eight-byte float store in platform byte order at the given address. The behavior is unspecified if <code>(address ... address + 8)</code> is not wholly within the range that was previously allocated using <code>malloc()</code>.
|
setDouble
|
{
"repo_name": "CodeOffloading/JikesRVM-CCO",
"path": "jikesrvm-3.1.3/libraryInterface/Harmony/ASF/src/org/apache/harmony/luni/platform/OSMemory.java",
"license": "epl-1.0",
"size": 21457
}
|
[
"org.vmmagic.unboxed.Address"
] |
import org.vmmagic.unboxed.Address;
|
import org.vmmagic.unboxed.*;
|
[
"org.vmmagic.unboxed"
] |
org.vmmagic.unboxed;
| 1,358,004
|
private JournalManager createJournal(URI uri) {
Class<? extends JournalManager> clazz
= getJournalClass(conf, uri.getScheme());
try {
Constructor<? extends JournalManager> cons
= clazz.getConstructor(Configuration.class, URI.class,
NamespaceInfo.class);
return cons.newInstance(conf, uri, storage.getNamespaceInfo());
} catch (Exception e) {
throw new IllegalArgumentException("Unable to construct journal, "
+ uri, e);
}
}
|
JournalManager function(URI uri) { Class<? extends JournalManager> clazz = getJournalClass(conf, uri.getScheme()); try { Constructor<? extends JournalManager> cons = clazz.getConstructor(Configuration.class, URI.class, NamespaceInfo.class); return cons.newInstance(conf, uri, storage.getNamespaceInfo()); } catch (Exception e) { throw new IllegalArgumentException(STR + uri, e); } }
|
/**
* Construct a custom journal manager.
* The class to construct is taken from the configuration.
* @param uri Uri to construct
* @return The constructed journal manager
* @throws IllegalArgumentException if no class is configured for uri
*/
|
Construct a custom journal manager. The class to construct is taken from the configuration
|
createJournal
|
{
"repo_name": "tseen/Federated-HDFS",
"path": "tseenliu/FedHDFS-hadoop-src/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java",
"license": "apache-2.0",
"size": 50974
}
|
[
"java.lang.reflect.Constructor",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.hdfs.server.protocol.NamespaceInfo"
] |
import java.lang.reflect.Constructor; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hdfs.server.protocol.NamespaceInfo;
|
import java.lang.reflect.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.hdfs.server.protocol.*;
|
[
"java.lang",
"org.apache.hadoop"
] |
java.lang; org.apache.hadoop;
| 1,376,022
|
public Point[] getPoints(String text) {
FAName fn = getFAName(text);
if (fn != null) {
return fn.points;
}
ArrayList<Point> points = new ArrayList<Point>();
int x = 0;
for (int i=0; i<text.length(); i++) {
FALetter fl = getLetter(text.charAt(i));
for (int j=0; j<fl.points.length; j++) {
Point p = fl.points[j];
points.add(new Point(p.x + x, p.y));
}
x += fl.advance;
}
return points.toArray(new Point[0]);
}
|
Point[] function(String text) { FAName fn = getFAName(text); if (fn != null) { return fn.points; } ArrayList<Point> points = new ArrayList<Point>(); int x = 0; for (int i=0; i<text.length(); i++) { FALetter fl = getLetter(text.charAt(i)); for (int j=0; j<fl.points.length; j++) { Point p = fl.points[j]; points.add(new Point(p.x + x, p.y)); } x += fl.advance; } return points.toArray(new Point[0]); }
|
/**
* Gets the points to display the given text as an
* animation.
*
* @param text The text to get the points for.
* @return The points in the order in which they
* should be drawn.
*/
|
Gets the points to display the given text as an animation
|
getPoints
|
{
"repo_name": "tectronics/reformationofeurope",
"path": "src/net/sf/freecol/client/gui/FAFile.java",
"license": "gpl-2.0",
"size": 8228
}
|
[
"java.awt.Point",
"java.util.ArrayList"
] |
import java.awt.Point; import java.util.ArrayList;
|
import java.awt.*; import java.util.*;
|
[
"java.awt",
"java.util"
] |
java.awt; java.util;
| 2,047,876
|
public static int mcrypt_module_get_algo_block_size(Env env,
String cipher,
@Optional String libDir)
{
try {
Mcrypt mcrypt = new Mcrypt(env, cipher, "cbc");
return mcrypt.get_block_size();
} catch (Exception e) {
env.error(e);
return -1;
}
}
|
static int function(Env env, String cipher, @Optional String libDir) { try { Mcrypt mcrypt = new Mcrypt(env, cipher, "cbc"); return mcrypt.get_block_size(); } catch (Exception e) { env.error(e); return -1; } }
|
/**
* Returns the block size for an algorithm.
*/
|
Returns the block size for an algorithm
|
mcrypt_module_get_algo_block_size
|
{
"repo_name": "christianchristensen/resin",
"path": "modules/quercus/src/com/caucho/quercus/lib/mcrypt/McryptModule.java",
"license": "gpl-2.0",
"size": 17158
}
|
[
"com.caucho.quercus.annotation.Optional",
"com.caucho.quercus.env.Env"
] |
import com.caucho.quercus.annotation.Optional; import com.caucho.quercus.env.Env;
|
import com.caucho.quercus.annotation.*; import com.caucho.quercus.env.*;
|
[
"com.caucho.quercus"
] |
com.caucho.quercus;
| 2,017,082
|
@Override
public void removeItemSetChangeListener(
Container.ItemSetChangeListener listener) {
if (itemSetEventListeners != null) {
itemSetEventListeners.remove(listener);
if (itemSetEventListeners.isEmpty()) {
itemSetEventListeners = null;
}
}
}
/**
* @deprecated As of 7.0, replaced by
* {@link #removeItemSetChangeListener(com.vaadin.data.Container.ItemSetChangeListener)}
|
void function( Container.ItemSetChangeListener listener) { if (itemSetEventListeners != null) { itemSetEventListeners.remove(listener); if (itemSetEventListeners.isEmpty()) { itemSetEventListeners = null; } } } /** * @deprecated As of 7.0, replaced by * {@link #removeItemSetChangeListener(com.vaadin.data.Container.ItemSetChangeListener)}
|
/**
* Removes the Item set change listener from the object.
*
* @see com.vaadin.data.Container.ItemSetChangeNotifier#removeListener(com.vaadin.data.Container.ItemSetChangeListener)
*/
|
Removes the Item set change listener from the object
|
removeItemSetChangeListener
|
{
"repo_name": "shahrzadmn/vaadin",
"path": "server/src/com/vaadin/ui/AbstractSelect.java",
"license": "apache-2.0",
"size": 76691
}
|
[
"com.vaadin.data.Container"
] |
import com.vaadin.data.Container;
|
import com.vaadin.data.*;
|
[
"com.vaadin.data"
] |
com.vaadin.data;
| 2,806,147
|
void initializeAssignableTags(final List<ProxyTag> assignableTags) {
allAssignableTags.addAll(assignableTags);
assignableTagsComboBox.getDataProvider().refreshAll();
}
|
void initializeAssignableTags(final List<ProxyTag> assignableTags) { allAssignableTags.addAll(assignableTags); assignableTagsComboBox.getDataProvider().refreshAll(); }
|
/**
* Initializes the Combobox with all assignable tags.
*
* @param assignableTags
* assignable tags
*/
|
Initializes the Combobox with all assignable tags
|
initializeAssignableTags
|
{
"repo_name": "eclipse/hawkbit",
"path": "hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/TagAssignementComboBox.java",
"license": "epl-1.0",
"size": 6274
}
|
[
"java.util.List",
"org.eclipse.hawkbit.ui.common.data.proxies.ProxyTag"
] |
import java.util.List; import org.eclipse.hawkbit.ui.common.data.proxies.ProxyTag;
|
import java.util.*; import org.eclipse.hawkbit.ui.common.data.proxies.*;
|
[
"java.util",
"org.eclipse.hawkbit"
] |
java.util; org.eclipse.hawkbit;
| 1,285,384
|
ServiceCall<Error> delete505Async(final ServiceCallback<Error> serviceCallback);
|
ServiceCall<Error> delete505Async(final ServiceCallback<Error> serviceCallback);
|
/**
* Return 505 status code - should be represented in the client as an error.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
|
Return 505 status code - should be represented in the client as an error
|
delete505Async
|
{
"repo_name": "yugangw-msft/autorest",
"path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/http/HttpServerFailures.java",
"license": "mit",
"size": 6842
}
|
[
"com.microsoft.rest.ServiceCall",
"com.microsoft.rest.ServiceCallback"
] |
import com.microsoft.rest.ServiceCall; import com.microsoft.rest.ServiceCallback;
|
import com.microsoft.rest.*;
|
[
"com.microsoft.rest"
] |
com.microsoft.rest;
| 66,163
|
public void testMultipleSequentialGroups() {
ToolbarView group1 = toolbar.addGroup();
ToolbarView group2 = toolbar.addGroup();
ToolbarView group3 = toolbar.addGroup();
ToolbarButtonView button11 = group1.addClickButton();
ToolbarButtonView button12 = group1.addToggleButton();
ToolbarButtonView button13 = group1.addSubmenu();
ToolbarButtonView button21 = group2.addClickButton();
ToolbarButtonView button22 = group2.addToggleButton();
ToolbarButtonView button23 = group2.addSubmenu();
ToolbarButtonView button31 = group3.addClickButton();
ToolbarButtonView button32 = group3.addToggleButton();
ToolbarButtonView button33 = group3.addSubmenu();
assertEquals(toolbar.getDisplayedItems(), ImmutableList.of(
button11,
button12,
button13,
button21,
button22,
button23,
button31,
button32,
button33));
}
|
void function() { ToolbarView group1 = toolbar.addGroup(); ToolbarView group2 = toolbar.addGroup(); ToolbarView group3 = toolbar.addGroup(); ToolbarButtonView button11 = group1.addClickButton(); ToolbarButtonView button12 = group1.addToggleButton(); ToolbarButtonView button13 = group1.addSubmenu(); ToolbarButtonView button21 = group2.addClickButton(); ToolbarButtonView button22 = group2.addToggleButton(); ToolbarButtonView button23 = group2.addSubmenu(); ToolbarButtonView button31 = group3.addClickButton(); ToolbarButtonView button32 = group3.addToggleButton(); ToolbarButtonView button33 = group3.addSubmenu(); assertEquals(toolbar.getDisplayedItems(), ImmutableList.of( button11, button12, button13, button21, button22, button23, button31, button32, button33)); }
|
/**
* Tests that multiple adjacent groups have the buttons in the correct order
* when populated sequentially.
*/
|
Tests that multiple adjacent groups have the buttons in the correct order when populated sequentially
|
testMultipleSequentialGroups
|
{
"repo_name": "JaredMiller/Wave",
"path": "test/org/waveprotocol/wave/client/widget/toolbar/GroupingToolbarTest.java",
"license": "apache-2.0",
"size": 7227
}
|
[
"com.google.common.collect.ImmutableList",
"org.waveprotocol.wave.client.widget.toolbar.buttons.ToolbarButtonView"
] |
import com.google.common.collect.ImmutableList; import org.waveprotocol.wave.client.widget.toolbar.buttons.ToolbarButtonView;
|
import com.google.common.collect.*; import org.waveprotocol.wave.client.widget.toolbar.buttons.*;
|
[
"com.google.common",
"org.waveprotocol.wave"
] |
com.google.common; org.waveprotocol.wave;
| 1,418,850
|
public int compareTo(@NotNull Version ov, boolean ignoreDev) {
if (make != ov.make) return Integer.compare(make, ov.make);
if (major != ov.major) return Integer.compare(major, ov.major);
if (minor != ov.minor) return Integer.compare(minor, ov.minor);
if (!ignoreDev) {
if (dev != ov.dev) {
if (dev == 0) return 1; //0 is the last "dev" version, as it is not a dev.
if (ov.dev == 0) return -1;
return Integer.compare(dev, ov.dev);
}
}
return 0; // The versions are equal.
}
@Override
public String toString() { return make + "." + major + "." + minor + (dev == 0 ? "" : "-dev" + dev); }
|
int function(@NotNull Version ov, boolean ignoreDev) { if (make != ov.make) return Integer.compare(make, ov.make); if (major != ov.major) return Integer.compare(major, ov.major); if (minor != ov.minor) return Integer.compare(minor, ov.minor); if (!ignoreDev) { if (dev != ov.dev) { if (dev == 0) return 1; if (ov.dev == 0) return -1; return Integer.compare(dev, ov.dev); } } return 0; } public String toString() { return make + "." + major + "." + minor + (dev == 0 ? STR-dev" + dev); }
|
/**
* The returned value of this method (-1, 0, or 1) is determined by whether this object is less than, equal to, or greater than the specified object, ov.
* (this.compareTo(new Version("1.0.0") < 0 is the same as this < 1.0.0)
* @param ov The version to compare to.
* @param ignoreDev If we should ignore dev versions in this comparison.
*/
|
The returned value of this method (-1, 0, or 1) is determined by whether this object is less than, equal to, or greater than the specified object, ov. (this.compareTo(new Version("1.0.0") < 0 is the same as this < 1.0.0)
|
compareTo
|
{
"repo_name": "chrisj42/minicraft-plus-revived",
"path": "src/main/java/minicraft/saveload/Version.java",
"license": "gpl-3.0",
"size": 2678
}
|
[
"org.jetbrains.annotations.NotNull"
] |
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.*;
|
[
"org.jetbrains.annotations"
] |
org.jetbrains.annotations;
| 1,306,223
|
public void start(WindmillStateReader stateReader, Instant inputDataWatermark) {
boolean useStateFamilies = !stateNameMap.isEmpty();
this.stateInternals =
new WindmillStateInternals(
prefix, useStateFamilies, stateReader, scopedReadStateSupplier);
this.timerInternals = new WindmillTimerInternals(
stateFamily, Preconditions.checkNotNull(inputDataWatermark));
}
|
void function(WindmillStateReader stateReader, Instant inputDataWatermark) { boolean useStateFamilies = !stateNameMap.isEmpty(); this.stateInternals = new WindmillStateInternals( prefix, useStateFamilies, stateReader, scopedReadStateSupplier); this.timerInternals = new WindmillTimerInternals( stateFamily, Preconditions.checkNotNull(inputDataWatermark)); }
|
/**
* Update the {@code stateReader} used by this {@code StepContext}.
*/
|
Update the stateReader used by this StepContext
|
start
|
{
"repo_name": "tyagihas/DataflowJavaSDK",
"path": "sdk/src/main/java/com/google/cloud/dataflow/sdk/runners/worker/StreamingModeExecutionContext.java",
"license": "apache-2.0",
"size": 18577
}
|
[
"com.google.common.base.Preconditions",
"org.joda.time.Instant"
] |
import com.google.common.base.Preconditions; import org.joda.time.Instant;
|
import com.google.common.base.*; import org.joda.time.*;
|
[
"com.google.common",
"org.joda.time"
] |
com.google.common; org.joda.time;
| 2,585,442
|
private void connectUsingAnonymousCredentials(final URI uri)
throws StorageException, IOException, URISyntaxException {
// Use an HTTP scheme since the URI specifies a publicly accessible
// container. Explicitly create a storage URI corresponding to the URI
// parameter for use in creating the service client.
String accountName = getAccountFromAuthority(uri);
URI storageUri = new URI(getHTTPScheme() + ":" + PATH_DELIMITER
+ PATH_DELIMITER + accountName);
// Create the service client with anonymous credentials.
String containerName = getContainerFromAuthority(uri);
storageInteractionLayer.createBlobClient(storageUri);
suppressRetryPolicyInClientIfNeeded();
// Capture the container reference.
container = storageInteractionLayer.getContainerReference(containerName);
rootDirectory = container.getDirectoryReference("");
// Check for container existence, and our ability to access it.
try {
if (!container.exists(getInstrumentedContext())) {
throw new AzureException("Container " + containerName + " in account "
+ accountName + " not found, and we can't create"
+ " it using anoynomous credentials, and no credentials found for them"
+ " in the configuration.");
}
} catch (StorageException ex) {
throw new AzureException("Unable to access container " + containerName
+ " in account " + accountName
+ " using anonymous credentials, and no credentials found for them "
+ " in the configuration.", ex);
}
// Accessing the storage server unauthenticated using
// anonymous credentials.
isAnonymousCredentials = true;
// Configure Azure storage session.
configureAzureStorageSession();
}
|
void function(final URI uri) throws StorageException, IOException, URISyntaxException { String accountName = getAccountFromAuthority(uri); URI storageUri = new URI(getHTTPScheme() + ":" + PATH_DELIMITER + PATH_DELIMITER + accountName); String containerName = getContainerFromAuthority(uri); storageInteractionLayer.createBlobClient(storageUri); suppressRetryPolicyInClientIfNeeded(); container = storageInteractionLayer.getContainerReference(containerName); rootDirectory = container.getDirectoryReference(STRContainer STR in account STR not found, and we can't createSTR it using anoynomous credentials, and no credentials found for themSTR in the configuration.STRUnable to access container STR in account STR using anonymous credentials, and no credentials found for them STR in the configuration.", ex); } isAnonymousCredentials = true; configureAzureStorageSession(); }
|
/**
* Connect to Azure storage using anonymous credentials.
*
* @param uri
* - URI to target blob (R/O access to public blob)
*
* @throws StorageException
* raised on errors communicating with Azure storage.
* @throws IOException
* raised on errors performing I/O or setting up the session.
* @throws URISyntaxException
* raised on creating mal-formed URI's.
*/
|
Connect to Azure storage using anonymous credentials
|
connectUsingAnonymousCredentials
|
{
"repo_name": "legend-hua/hadoop",
"path": "hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/AzureNativeFileSystemStore.java",
"license": "apache-2.0",
"size": 107808
}
|
[
"com.microsoft.azure.storage.StorageException",
"java.io.IOException",
"java.net.URISyntaxException"
] |
import com.microsoft.azure.storage.StorageException; import java.io.IOException; import java.net.URISyntaxException;
|
import com.microsoft.azure.storage.*; import java.io.*; import java.net.*;
|
[
"com.microsoft.azure",
"java.io",
"java.net"
] |
com.microsoft.azure; java.io; java.net;
| 2,376,358
|
int write(ChannelBuffer bb) throws PcepParseException;
interface Builder {
|
int write(ChannelBuffer bb) throws PcepParseException; interface Builder {
|
/**
* Writes the Label Object into channel buffer.
*
* @param bb channel buffer
* @return Returns the writerIndex of this buffer
* @throws PcepParseException while writing LABEL object into Channel Buffer.
*/
|
Writes the Label Object into channel buffer
|
write
|
{
"repo_name": "planoAccess/clonedONOS",
"path": "protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepLabelObject.java",
"license": "apache-2.0",
"size": 4534
}
|
[
"org.jboss.netty.buffer.ChannelBuffer",
"org.onosproject.pcepio.exceptions.PcepParseException"
] |
import org.jboss.netty.buffer.ChannelBuffer; import org.onosproject.pcepio.exceptions.PcepParseException;
|
import org.jboss.netty.buffer.*; import org.onosproject.pcepio.exceptions.*;
|
[
"org.jboss.netty",
"org.onosproject.pcepio"
] |
org.jboss.netty; org.onosproject.pcepio;
| 418,303
|
private FList<TextRange> doMatchFragments(String name,
int patternIndex,
int nameIndex,
MatchingState matchingState) {
if (!isFirstCharMatching(name, nameIndex, patternIndex)) {
return null;
}
// exact middle matches have to be at least of length 3, to prevent too many irrelevant matches
int minFragment = isPatternChar(patternIndex - 1, '*') && !isWildcard(patternIndex + 1) &&
Character.isLetterOrDigit(name.charAt(nameIndex)) && !NameUtil.isWordStart(name, nameIndex)
? 3 : 1;
int i = 1;
boolean ignoreCase = myOptions != NameUtil.MatchingCaseSensitivity.ALL;
while (nameIndex + i < name.length() &&
patternIndex + i < myPattern.length &&
charEquals(myPattern[patternIndex+i], patternIndex+i, name.charAt(nameIndex + i), ignoreCase)) {
if (isUppercasePatternVsLowercaseNameChar(name, patternIndex + i, nameIndex + i)) {
FList<TextRange> ranges = i < minFragment ? null : findUppercaseMatchFurther(name, patternIndex + i, nameIndex + i, matchingState);
if (ranges != null) {
return prependRange(ranges, nameIndex, i);
}
if (shouldProhibitCaseMismatch(name, patternIndex + i, nameIndex + i)) {
return null;
}
}
i++;
}
// we've found the longest fragment matching pattern and name
if (patternIndex + i >= myPattern.length) {
return FList.<TextRange>emptyList().prepend(TextRange.from(nameIndex, i));
}
// try to match the remainder of pattern with the remainder of name
// it may not succeed with the longest matching fragment, then try shorter matches
while (i >= minFragment || isWildcard(patternIndex + i)) {
FList<TextRange> ranges = isWildcard(patternIndex + i) ?
matchWildcards(name, patternIndex + i, nameIndex + i, matchingState) :
matchSkippingWords(name, patternIndex + i, nameIndex + i, false, matchingState);
if (ranges != null) {
return prependRange(ranges, nameIndex, i);
}
i--;
}
return null;
}
|
FList<TextRange> function(String name, int patternIndex, int nameIndex, MatchingState matchingState) { if (!isFirstCharMatching(name, nameIndex, patternIndex)) { return null; } int minFragment = isPatternChar(patternIndex - 1, '*') && !isWildcard(patternIndex + 1) && Character.isLetterOrDigit(name.charAt(nameIndex)) && !NameUtil.isWordStart(name, nameIndex) ? 3 : 1; int i = 1; boolean ignoreCase = myOptions != NameUtil.MatchingCaseSensitivity.ALL; while (nameIndex + i < name.length() && patternIndex + i < myPattern.length && charEquals(myPattern[patternIndex+i], patternIndex+i, name.charAt(nameIndex + i), ignoreCase)) { if (isUppercasePatternVsLowercaseNameChar(name, patternIndex + i, nameIndex + i)) { FList<TextRange> ranges = i < minFragment ? null : findUppercaseMatchFurther(name, patternIndex + i, nameIndex + i, matchingState); if (ranges != null) { return prependRange(ranges, nameIndex, i); } if (shouldProhibitCaseMismatch(name, patternIndex + i, nameIndex + i)) { return null; } } i++; } if (patternIndex + i >= myPattern.length) { return FList.<TextRange>emptyList().prepend(TextRange.from(nameIndex, i)); } while (i >= minFragment isWildcard(patternIndex + i)) { FList<TextRange> ranges = isWildcard(patternIndex + i) ? matchWildcards(name, patternIndex + i, nameIndex + i, matchingState) : matchSkippingWords(name, patternIndex + i, nameIndex + i, false, matchingState); if (ranges != null) { return prependRange(ranges, nameIndex, i); } i--; } return null; }
|
/**
* Attempts to match an alphanumeric sequence of pattern (starting at patternIndex)
* to some continuous substring of name, starting from nameIndex.
*/
|
Attempts to match an alphanumeric sequence of pattern (starting at patternIndex) to some continuous substring of name, starting from nameIndex
|
doMatchFragments
|
{
"repo_name": "ThiagoGarciaAlves/intellij-community",
"path": "platform/util/src/com/intellij/psi/codeStyle/MinusculeMatcher.java",
"license": "apache-2.0",
"size": 21589
}
|
[
"com.intellij.openapi.util.TextRange",
"com.intellij.util.containers.FList"
] |
import com.intellij.openapi.util.TextRange; import com.intellij.util.containers.FList;
|
import com.intellij.openapi.util.*; import com.intellij.util.containers.*;
|
[
"com.intellij.openapi",
"com.intellij.util"
] |
com.intellij.openapi; com.intellij.util;
| 1,786,739
|
MeterRegistry meterRegistry();
|
MeterRegistry meterRegistry();
|
/**
* Returns the {@link MeterRegistry} that collects various stats.
*/
|
Returns the <code>MeterRegistry</code> that collects various stats
|
meterRegistry
|
{
"repo_name": "minwoox/armeria",
"path": "core/src/main/java/com/linecorp/armeria/client/ClientFactory.java",
"license": "apache-2.0",
"size": 14027
}
|
[
"io.micrometer.core.instrument.MeterRegistry"
] |
import io.micrometer.core.instrument.MeterRegistry;
|
import io.micrometer.core.instrument.*;
|
[
"io.micrometer.core"
] |
io.micrometer.core;
| 1,037,899
|
public Shape getUpArrow() {
return this.upArrow;
}
|
Shape function() { return this.upArrow; }
|
/**
* Returns a shape that can be displayed as an arrow pointing upwards at
* the end of an axis line.
*
* @return A shape (never <code>null</code>).
*
* @see #setUpArrow(Shape)
*/
|
Returns a shape that can be displayed as an arrow pointing upwards at the end of an axis line
|
getUpArrow
|
{
"repo_name": "hongliangpan/manydesigns.cn",
"path": "trunk/portofino-chart/jfreechat.src/org/jfree/chart/axis/ValueAxis.java",
"license": "lgpl-3.0",
"size": 58355
}
|
[
"java.awt.Shape"
] |
import java.awt.Shape;
|
import java.awt.*;
|
[
"java.awt"
] |
java.awt;
| 2,371,326
|
public static void add(Context context, String key, String value) {
context.getSharedPreferences(EASE_PREF_NAME, Context.MODE_PRIVATE)
.edit().putString(String.valueOf(key.hashCode()), value)
.apply();
} // add
|
static void function(Context context, String key, String value) { context.getSharedPreferences(EASE_PREF_NAME, Context.MODE_PRIVATE) .edit().putString(String.valueOf(key.hashCode()), value) .apply(); }
|
/**
* Add value to shared prefs
*
* @param context context for shared prefs
* @param key key
* @param value value for given key
*/
|
Add value to shared prefs
|
add
|
{
"repo_name": "allaudin/ease-volley-wrapper-v2",
"path": "src/main/java/allaudin/github/io/ease/EaseCacheManager.java",
"license": "apache-2.0",
"size": 3298
}
|
[
"android.content.Context"
] |
import android.content.Context;
|
import android.content.*;
|
[
"android.content"
] |
android.content;
| 2,724,587
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.