method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public void setPerson(Integer v) throws TorqueException { if (!ObjectUtils.equals(this.person, v)) { this.person = v; setModified(true); } if (aTPerson != null && !ObjectUtils.equals(aTPerson.getObjectID(), v)) { aTPerson = null; } }
void function(Integer v) throws TorqueException { if (!ObjectUtils.equals(this.person, v)) { this.person = v; setModified(true); } if (aTPerson != null && !ObjectUtils.equals(aTPerson.getObjectID(), v)) { aTPerson = null; } }
/** * Set the value of Person * * @param v new value */
Set the value of Person
setPerson
{ "repo_name": "trackplus/Genji", "path": "src/main/java/com/aurel/track/persist/BaseTScheduler.java", "license": "gpl-3.0", "size": 27698 }
[ "org.apache.commons.lang.ObjectUtils", "org.apache.torque.TorqueException" ]
import org.apache.commons.lang.ObjectUtils; import org.apache.torque.TorqueException;
import org.apache.commons.lang.*; import org.apache.torque.*;
[ "org.apache.commons", "org.apache.torque" ]
org.apache.commons; org.apache.torque;
1,417,034
protected static String extractPEARFile(String pearFileLocation, File installationDir, InstallationController controller, boolean cleanTarget) throws IOException { return extractFilesFromPEARFile(pearFileLocation, null, installationDir, controller, cleanTarget); }
static String function(String pearFileLocation, File installationDir, InstallationController controller, boolean cleanTarget) throws IOException { return extractFilesFromPEARFile(pearFileLocation, null, installationDir, controller, cleanTarget); }
/** * Internal implementation of the <code>extractPEARFile</code> method, which allows sending * messages to the OUT and ERR queues. * * @param pearFileLocation * The given PEAR file location. * @param installationDir * The given target directory. * @param controller * The instance of the <code>InstallationController</code> class that provides OUT and * ERR message routing, or <code>null</code>. * @param cleanTarget * If true, the target directory is cleaned before the PEAR file is installed to it. * @return The path to the new component root directory. * @throws IOException * if any I/O exception occurred. */
Internal implementation of the <code>extractPEARFile</code> method, which allows sending messages to the OUT and ERR queues
extractPEARFile
{ "repo_name": "apache/uima-uimaj", "path": "uimaj-core/src/main/java/org/apache/uima/pear/tools/InstallationController.java", "license": "apache-2.0", "size": 85779 }
[ "java.io.File", "java.io.IOException" ]
import java.io.File; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
289,549
public void initializeFromConfigurationElement( MarkerSupportRegistry registry) { IConfigurationElement[] elements = configurationElement.getChildren(MARKER_FIELD_REFERENCE); Collection<MarkerField> allFieldList = new ArrayList<>(); Collection<MarkerField> initialVisibleList = new ArrayList<>(); for (int i = 0; i < elements.length; i++) { MarkerField field = registry.getField(elements[i].getAttribute(MarkerSupportInternalUtilities.ATTRIBUTE_ID)); if (field == null) { continue; } allFieldList.add(field); if (!MarkerSupportInternalUtilities.VALUE_FALSE.equals(elements[i].getAttribute(ATTRIBUTE_VISIBLE))) { initialVisibleList.add(field); } } allFields = new MarkerField[allFieldList.size()]; allFieldList.toArray(allFields); initialVisible = new MarkerField[initialVisibleList.size()]; initialVisibleList.toArray(initialVisible); }
void function( MarkerSupportRegistry registry) { IConfigurationElement[] elements = configurationElement.getChildren(MARKER_FIELD_REFERENCE); Collection<MarkerField> allFieldList = new ArrayList<>(); Collection<MarkerField> initialVisibleList = new ArrayList<>(); for (int i = 0; i < elements.length; i++) { MarkerField field = registry.getField(elements[i].getAttribute(MarkerSupportInternalUtilities.ATTRIBUTE_ID)); if (field == null) { continue; } allFieldList.add(field); if (!MarkerSupportInternalUtilities.VALUE_FALSE.equals(elements[i].getAttribute(ATTRIBUTE_VISIBLE))) { initialVisibleList.add(field); } } allFields = new MarkerField[allFieldList.size()]; allFieldList.toArray(allFields); initialVisible = new MarkerField[initialVisibleList.size()]; initialVisibleList.toArray(initialVisible); }
/** * Initialise the receiver from the configuration element. This is done as a * post processing step. * * @param registry * the MarkerSupportRegistry being used to initialise the * receiver. */
Initialise the receiver from the configuration element. This is done as a post processing step
initializeFromConfigurationElement
{ "repo_name": "elucash/eclipse-oxygen", "path": "org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/internal/ContentGeneratorDescriptor.java", "license": "epl-1.0", "size": 9271 }
[ "java.util.ArrayList", "java.util.Collection", "org.eclipse.core.runtime.IConfigurationElement", "org.eclipse.ui.internal.views.markers.MarkerSupportInternalUtilities", "org.eclipse.ui.views.markers.MarkerField" ]
import java.util.ArrayList; import java.util.Collection; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.ui.internal.views.markers.MarkerSupportInternalUtilities; import org.eclipse.ui.views.markers.MarkerField;
import java.util.*; import org.eclipse.core.runtime.*; import org.eclipse.ui.internal.views.markers.*; import org.eclipse.ui.views.markers.*;
[ "java.util", "org.eclipse.core", "org.eclipse.ui" ]
java.util; org.eclipse.core; org.eclipse.ui;
2,484,885
void setContext(ServiceMessageContext context);
void setContext(ServiceMessageContext context);
/** * Setter for the service context * * @param context * the service context to set */
Setter for the service context
setContext
{ "repo_name": "NABUCCO/org.nabucco.framework.base", "path": "org.nabucco.framework.base.impl.service/src/main/man/org/nabucco/framework/base/impl/service/ServiceHandler.java", "license": "epl-1.0", "size": 1608 }
[ "org.nabucco.framework.base.facade.message.context.ServiceMessageContext" ]
import org.nabucco.framework.base.facade.message.context.ServiceMessageContext;
import org.nabucco.framework.base.facade.message.context.*;
[ "org.nabucco.framework" ]
org.nabucco.framework;
738,021
public static int dispatchMana(ItemStack stack, EntityPlayer player, int manaToSend, boolean add) { if(stack == null) return 0; IInventory mainInv = player.inventory; IInventory baublesInv = BotaniaAPI.internalHandler.getBaublesInventory(player); int invSize = mainInv.getSizeInventory(); int size = invSize; if(baublesInv != null) size += baublesInv.getSizeInventory(); for(int i = 0; i < size; i++) { boolean useBaubles = i >= invSize; IInventory inv = useBaubles ? baublesInv : mainInv; ItemStack stackInSlot = inv.getStackInSlot(i - (useBaubles ? invSize : 0)); if(stackInSlot == stack) continue; if(stackInSlot != null && stackInSlot.getItem() instanceof IManaItem) { IManaItem manaItemSlot = (IManaItem) stackInSlot.getItem(); if(manaItemSlot.canReceiveManaFromItem(stackInSlot, stack)) { if(stack.getItem() instanceof IManaItem && !((IManaItem) stack.getItem()).canExportManaToItem(stack, stackInSlot)) continue; int received = 0; if(manaItemSlot.getMana(stackInSlot) + manaToSend <= manaItemSlot.getMaxMana(stackInSlot)) received = manaToSend; else received = manaToSend - (manaItemSlot.getMana(stackInSlot) + manaToSend - manaItemSlot.getMaxMana(stackInSlot)); if(add) manaItemSlot.addMana(stackInSlot, manaToSend); return received; } } } return 0; }
static int function(ItemStack stack, EntityPlayer player, int manaToSend, boolean add) { if(stack == null) return 0; IInventory mainInv = player.inventory; IInventory baublesInv = BotaniaAPI.internalHandler.getBaublesInventory(player); int invSize = mainInv.getSizeInventory(); int size = invSize; if(baublesInv != null) size += baublesInv.getSizeInventory(); for(int i = 0; i < size; i++) { boolean useBaubles = i >= invSize; IInventory inv = useBaubles ? baublesInv : mainInv; ItemStack stackInSlot = inv.getStackInSlot(i - (useBaubles ? invSize : 0)); if(stackInSlot == stack) continue; if(stackInSlot != null && stackInSlot.getItem() instanceof IManaItem) { IManaItem manaItemSlot = (IManaItem) stackInSlot.getItem(); if(manaItemSlot.canReceiveManaFromItem(stackInSlot, stack)) { if(stack.getItem() instanceof IManaItem && !((IManaItem) stack.getItem()).canExportManaToItem(stack, stackInSlot)) continue; int received = 0; if(manaItemSlot.getMana(stackInSlot) + manaToSend <= manaItemSlot.getMaxMana(stackInSlot)) received = manaToSend; else received = manaToSend - (manaItemSlot.getMana(stackInSlot) + manaToSend - manaItemSlot.getMaxMana(stackInSlot)); if(add) manaItemSlot.addMana(stackInSlot, manaToSend); return received; } } } return 0; }
/** * Dispatches mana to items in a given player's inventory. Note that this method * does not automatically remove mana from the item which is exporting. * @param manaToSend How much mana is to be sent. * @param remove If true, the mana will be added from the target item. Set to false to just check. * @return The amount of mana actually sent. */
Dispatches mana to items in a given player's inventory. Note that this method does not automatically remove mana from the item which is exporting
dispatchMana
{ "repo_name": "goldenapple3/CopperTools", "path": "src/api/vazkii/botania/api/mana/ManaItemHandler.java", "license": "mit", "size": 9180 }
[ "net.minecraft.entity.player.EntityPlayer", "net.minecraft.inventory.IInventory", "net.minecraft.item.ItemStack" ]
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack;
import net.minecraft.entity.player.*; import net.minecraft.inventory.*; import net.minecraft.item.*;
[ "net.minecraft.entity", "net.minecraft.inventory", "net.minecraft.item" ]
net.minecraft.entity; net.minecraft.inventory; net.minecraft.item;
1,478,425
return dataLine -> { try { return new IntegerCopyNumberState(dataLine.getInt(GermlineCNVNamingConstants.BASELINE_COPY_NUMBER_TABLE_COLUMN)); } catch (final IllegalArgumentException ex) { throw new UserException.BadInput( String.format("Error parsing baseline copy-number file (%s) at line %d.", inputFile.getAbsolutePath(), dataLine.getLineNumber())); } }; }
return dataLine -> { try { return new IntegerCopyNumberState(dataLine.getInt(GermlineCNVNamingConstants.BASELINE_COPY_NUMBER_TABLE_COLUMN)); } catch (final IllegalArgumentException ex) { throw new UserException.BadInput( String.format(STR, inputFile.getAbsolutePath(), dataLine.getLineNumber())); } }; }
/** * Generates an instance of {@link IntegerCopyNumberState} from a {@link DataLine} entry read from * a baseline copy-number file generated by `gcnvkernel`. */
Generates an instance of <code>IntegerCopyNumberState</code> from a <code>DataLine</code> entry read from a baseline copy-number file generated by `gcnvkernel`
getBaselineCopyNumberRecordFromDataLineDecoder
{ "repo_name": "broadinstitute/hellbender", "path": "src/main/java/org/broadinstitute/hellbender/tools/copynumber/formats/collections/BaselineCopyNumberCollection.java", "license": "bsd-3-clause", "size": 2323 }
[ "org.broadinstitute.hellbender.exceptions.UserException", "org.broadinstitute.hellbender.tools.copynumber.gcnv.GermlineCNVNamingConstants", "org.broadinstitute.hellbender.tools.copynumber.gcnv.IntegerCopyNumberState" ]
import org.broadinstitute.hellbender.exceptions.UserException; import org.broadinstitute.hellbender.tools.copynumber.gcnv.GermlineCNVNamingConstants; import org.broadinstitute.hellbender.tools.copynumber.gcnv.IntegerCopyNumberState;
import org.broadinstitute.hellbender.exceptions.*; import org.broadinstitute.hellbender.tools.copynumber.gcnv.*;
[ "org.broadinstitute.hellbender" ]
org.broadinstitute.hellbender;
1,705,228
WithStandardAttach<ParentT> withContentTypesToCompress(Set<String> contentTypesToCompress);
WithStandardAttach<ParentT> withContentTypesToCompress(Set<String> contentTypesToCompress);
/** * Specifies the content types to compress. * * @param contentTypesToCompress content types to compress to set * @return the next stage of the definition */
Specifies the content types to compress
withContentTypesToCompress
{ "repo_name": "jianghaolu/azure-sdk-for-java", "path": "azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/CdnEndpoint.java", "license": "mit", "size": 38532 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
2,310,012
public static void prepareAggregation(Exchange oldExchange, Exchange newExchange) { // move body/header from OUT to IN if (oldExchange != null) { if (oldExchange.hasOut()) { oldExchange.setIn(oldExchange.getOut()); oldExchange.setOut(null); } } if (newExchange != null) { if (newExchange.hasOut()) { newExchange.setIn(newExchange.getOut()); newExchange.setOut(null); } } }
static void function(Exchange oldExchange, Exchange newExchange) { if (oldExchange != null) { if (oldExchange.hasOut()) { oldExchange.setIn(oldExchange.getOut()); oldExchange.setOut(null); } } if (newExchange != null) { if (newExchange.hasOut()) { newExchange.setIn(newExchange.getOut()); newExchange.setOut(null); } } }
/** * Prepares the exchanges for aggregation. * <p/> * This implementation will copy the OUT body to the IN body so when you do * aggregation the body is <b>only</b> in the IN body to avoid confusing end users. * * @param oldExchange the old exchange * @param newExchange the new exchange */
Prepares the exchanges for aggregation. This implementation will copy the OUT body to the IN body so when you do aggregation the body is only in the IN body to avoid confusing end users
prepareAggregation
{ "repo_name": "engagepoint/camel", "path": "camel-core/src/main/java/org/apache/camel/util/ExchangeHelper.java", "license": "apache-2.0", "size": 32834 }
[ "org.apache.camel.Exchange" ]
import org.apache.camel.Exchange;
import org.apache.camel.*;
[ "org.apache.camel" ]
org.apache.camel;
1,388,304
private void handleBlockCloseRequest(final ChannelHandlerContext ctx, final Protocol.LocalBlockCloseRequest request) { RpcUtils.nettyRPCAndLog(LOG, new RpcUtils.NettyRPCCallable<Void>() {
void function(final ChannelHandlerContext ctx, final Protocol.LocalBlockCloseRequest request) { RpcUtils.nettyRPCAndLog(LOG, new RpcUtils.NettyRPCCallable<Void>() {
/** * Handles {@link Protocol.LocalBlockCloseRequest}. No exceptions should be thrown. * * @param ctx the channel handler context * @param request the local block close request */
Handles <code>Protocol.LocalBlockCloseRequest</code>. No exceptions should be thrown
handleBlockCloseRequest
{ "repo_name": "Reidddddd/mo-alluxio", "path": "core/server/worker/src/main/java/alluxio/worker/netty/DataServerShortCircuitReadHandler.java", "license": "apache-2.0", "size": 8030 }
[ "io.netty.channel.ChannelHandlerContext" ]
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.*;
[ "io.netty.channel" ]
io.netty.channel;
1,964,099
public List getComponents() { return components; }
List function() { return components; }
/** * returns a list of all components * * @return all components */
returns a list of all components
getComponents
{ "repo_name": "exxcellent/wings3", "path": "wings/src/java/org/wings/SBoxLayout.java", "license": "lgpl-2.1", "size": 5239 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
849,801
@Test public final void testValidateValid() { // Setup the resources for the test. byte[] array = new byte[] {2, 6, 1}; XBeeChecksum c = new XBeeChecksum(); c.add(array); int generatedChecksum = c.generate(); c.add(generatedChecksum); // Call the method under test. boolean isValid = c.validate(); // Verify the result. assertThat("Returned result is not the expected one", isValid, is(equalTo(true))); }
final void function() { byte[] array = new byte[] {2, 6, 1}; XBeeChecksum c = new XBeeChecksum(); c.add(array); int generatedChecksum = c.generate(); c.add(generatedChecksum); boolean isValid = c.validate(); assertThat(STR, isValid, is(equalTo(true))); }
/** * Test method for {@link com.digi.xbee.api.packet.XBeeChecksum#validate()}. */
Test method for <code>com.digi.xbee.api.packet.XBeeChecksum#validate()</code>
testValidateValid
{ "repo_name": "digidotcom/XBeeJavaLibrary", "path": "library/src/test/java/com/digi/xbee/api/packet/XBeeChecksumTest.java", "license": "mpl-2.0", "size": 5310 }
[ "org.hamcrest.core.Is", "org.junit.Assert" ]
import org.hamcrest.core.Is; import org.junit.Assert;
import org.hamcrest.core.*; import org.junit.*;
[ "org.hamcrest.core", "org.junit" ]
org.hamcrest.core; org.junit;
1,518,538
Engineer eng = new Engineer("Феофилакт", "Программист", "ГУАП"); String app = "Tracker"; String result = "Инженер разрабатывает Tracker"; assertThat(eng.develop(app), is(result)); }
Engineer eng = new Engineer(STR, STR, "ГУАП"); String app = STR; String result = STR; assertThat(eng.develop(app), is(result)); }
/** *Test develop. */
Test develop
whenInputApplicationThenPrintWichAppWillDevelop
{ "repo_name": "AlxKonstantin/kalekseev", "path": "chapter_002/src/test/java/ru/job4j/EngineerTest.java", "license": "apache-2.0", "size": 658 }
[ "org.hamcrest.core.Is", "org.junit.Assert" ]
import org.hamcrest.core.Is; import org.junit.Assert;
import org.hamcrest.core.*; import org.junit.*;
[ "org.hamcrest.core", "org.junit" ]
org.hamcrest.core; org.junit;
2,022,312
public Optional<String> stop() { final LinkedList<String> uuids = context.get(); if (!uuids.isEmpty()) { return Optional.of(uuids.pop()); } return Optional.empty(); }
Optional<String> function() { final LinkedList<String> uuids = context.get(); if (!uuids.isEmpty()) { return Optional.of(uuids.pop()); } return Optional.empty(); }
/** * Removes latest added uuid. Ignores empty context. * * @return removed uuid. */
Removes latest added uuid. Ignores empty context
stop
{ "repo_name": "allure-framework/allure-java", "path": "allure-java-commons/src/main/java/io/qameta/allure/internal/AllureThreadContext.java", "license": "apache-2.0", "size": 2611 }
[ "java.util.LinkedList", "java.util.Optional" ]
import java.util.LinkedList; import java.util.Optional;
import java.util.*;
[ "java.util" ]
java.util;
131,601
public static EntityBareJid entityBareFromUrlEncoded(CharSequence cs) throws XmppStringprepException { String decoded = urlDecode(cs); return entityBareFrom(decoded); } /** * Like {@link #entityFullFrom(CharSequence)} but does throw an unchecked {@link IllegalArgumentException} instead of a * {@link XmppStringprepException}. * * @param cs the character sequence which should be transformed to a {@link EntityFullJid}
static EntityBareJid function(CharSequence cs) throws XmppStringprepException { String decoded = urlDecode(cs); return entityBareFrom(decoded); } /** * Like {@link #entityFullFrom(CharSequence)} but does throw an unchecked {@link IllegalArgumentException} instead of a * {@link XmppStringprepException}. * * @param cs the character sequence which should be transformed to a {@link EntityFullJid}
/** * Get a {@link EntityBareJid} from an URL encoded CharSequence. * * @param cs a CharSequence representing an URL encoded entity bare JID. * @return an entity bare JID * @throws XmppStringprepException if an error occurs. * @see URLDecoder */
Get a <code>EntityBareJid</code> from an URL encoded CharSequence
entityBareFromUrlEncoded
{ "repo_name": "Flowdalic/jxmpp", "path": "jxmpp-jid/src/main/java/org/jxmpp/jid/impl/JidCreate.java", "license": "apache-2.0", "size": 48033 }
[ "org.jxmpp.jid.EntityBareJid", "org.jxmpp.jid.EntityFullJid", "org.jxmpp.stringprep.XmppStringprepException" ]
import org.jxmpp.jid.EntityBareJid; import org.jxmpp.jid.EntityFullJid; import org.jxmpp.stringprep.XmppStringprepException;
import org.jxmpp.jid.*; import org.jxmpp.stringprep.*;
[ "org.jxmpp.jid", "org.jxmpp.stringprep" ]
org.jxmpp.jid; org.jxmpp.stringprep;
68,196
return ServiceLocator.instance().getService(PropertyManagement.class); }
return ServiceLocator.instance().getService(PropertyManagement.class); }
/** * Getter for the {@link PropertyManagement} * * @return the {@link PropertyManagement} */
Getter for the <code>PropertyManagement</code>
getPropertyManagement
{ "repo_name": "Communote/communote-server", "path": "communote/plugins/rest-api/1.3/implementation/src/main/java/com/communote/plugins/api/rest/resource/topic/property/PropertyResourceHandler.java", "license": "apache-2.0", "size": 8143 }
[ "com.communote.server.api.ServiceLocator", "com.communote.server.api.core.property.PropertyManagement" ]
import com.communote.server.api.ServiceLocator; import com.communote.server.api.core.property.PropertyManagement;
import com.communote.server.api.*; import com.communote.server.api.core.property.*;
[ "com.communote.server" ]
com.communote.server;
2,524,112
@Incubating Collection<Attribute<?>> getAttributeDisambiguationPrecedence();
Collection<Attribute<?>> getAttributeDisambiguationPrecedence();
/** * Returns the order that attributes should be considered when resolving ambiguity. * * @return attributes in precedence order * @since 7.5 */
Returns the order that attributes should be considered when resolving ambiguity
getAttributeDisambiguationPrecedence
{ "repo_name": "gradle/gradle", "path": "subprojects/core-api/src/main/java/org/gradle/api/attributes/AttributesSchema.java", "license": "apache-2.0", "size": 3899 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
572,519
protected MapEntryUpdateResult<String, byte[]> replaceValue(Commit<? extends ReplaceValue> commit) { MapEntryValue value = new MapEntryValue(MapEntryValue.Type.VALUE, commit.index(), commit.value().newValue()); return replaceIf(commit.index(), commit.value().key(), value, v -> valuesEqual(v.value(), commit.value().oldValue())); }
MapEntryUpdateResult<String, byte[]> function(Commit<? extends ReplaceValue> commit) { MapEntryValue value = new MapEntryValue(MapEntryValue.Type.VALUE, commit.index(), commit.value().newValue()); return replaceIf(commit.index(), commit.value().key(), value, v -> valuesEqual(v.value(), commit.value().oldValue())); }
/** * Handles a replaceValue commit. * * @param commit replaceValue commit * @return map entry update result */
Handles a replaceValue commit
replaceValue
{ "repo_name": "osinstom/onos", "path": "core/store/primitives/src/main/java/org/onosproject/store/primitives/resources/impl/AtomixConsistentMapService.java", "license": "apache-2.0", "size": 44039 }
[ "io.atomix.protocols.raft.service.Commit", "org.onosproject.store.primitives.resources.impl.AtomixConsistentMapOperations" ]
import io.atomix.protocols.raft.service.Commit; import org.onosproject.store.primitives.resources.impl.AtomixConsistentMapOperations;
import io.atomix.protocols.raft.service.*; import org.onosproject.store.primitives.resources.impl.*;
[ "io.atomix.protocols", "org.onosproject.store" ]
io.atomix.protocols; org.onosproject.store;
1,976,327
public void setDirectory(Directory directory) { this.directory = directory; }
void function(Directory directory) { this.directory = directory; }
/** * set lucene directory * @param directory * directory */
set lucene directory
setDirectory
{ "repo_name": "joshkh/intermine", "path": "intermine/api/main/src/org/intermine/api/lucene/LuceneIndexContainer.java", "license": "lgpl-2.1", "size": 2719 }
[ "org.apache.lucene.store.Directory" ]
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.*;
[ "org.apache.lucene" ]
org.apache.lucene;
1,612,839
public static IMetaStoreClient newSynchronizedClient( IMetaStoreClient client) { return (IMetaStoreClient) Proxy.newProxyInstance( HiveMetaStoreClient.class.getClassLoader(), new Class [] { IMetaStoreClient.class }, new SynchronizedHandler(client)); } private static class SynchronizedHandler implements InvocationHandler { private final IMetaStoreClient client; private static final Object lock = SynchronizedHandler.class; SynchronizedHandler(IMetaStoreClient client) { this.client = client; }
static IMetaStoreClient function( IMetaStoreClient client) { return (IMetaStoreClient) Proxy.newProxyInstance( HiveMetaStoreClient.class.getClassLoader(), new Class [] { IMetaStoreClient.class }, new SynchronizedHandler(client)); } private static class SynchronizedHandler implements InvocationHandler { private final IMetaStoreClient client; private static final Object lock = SynchronizedHandler.class; SynchronizedHandler(IMetaStoreClient client) { this.client = client; }
/** * Creates a synchronized wrapper for any {@link IMetaStoreClient}. * This may be used by multi-threaded applications until we have * fixed all reentrancy bugs. * * @param client unsynchronized client * * @return synchronized client */
Creates a synchronized wrapper for any <code>IMetaStoreClient</code>. This may be used by multi-threaded applications until we have fixed all reentrancy bugs
newSynchronizedClient
{ "repo_name": "mapr/impala", "path": "thirdparty/hive-0.12.0-cdh5.1.2/src/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java", "license": "apache-2.0", "size": 52327 }
[ "java.lang.reflect.InvocationHandler", "java.lang.reflect.Proxy" ]
import java.lang.reflect.InvocationHandler; import java.lang.reflect.Proxy;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
2,364,795
private static Iterable<Artifact> getPlatformBasedToolchainJars(RuleContext ruleContext) { if (!ruleContext .getConfiguration() .getFragment(AndroidConfiguration.class) .incompatibleUseToolchainResolution()) { // Legacy toolchains: toolchain .jars are dexed by propagating the aspect down the // ":android_sdk" attribute. That makes them transitive deps, so no special logic is needed // in the parent target to process them. return ImmutableList.of(); } else if (!ruleContext.attributes().has(":android_sdk")) { // If we're dexing a non-Android target (like a java_library), there's no Android toolchain to // include. return ImmutableList.of(); } AndroidSdkProvider androidSdk = AndroidSdkProvider.fromRuleContext(ruleContext); if (androidSdk == null || androidSdk.getAidlLib() == null) { // If the Android SDK is null, we don't have a valid toolchain. Expect a rule error reported // from AndroidSdkProvider. return ImmutableList.of(); } return ImmutableList.copyOf( JavaInfo.getJavaInfo(androidSdk.getAidlLib()).getDirectRuntimeJars()); }
static Iterable<Artifact> function(RuleContext ruleContext) { if (!ruleContext .getConfiguration() .getFragment(AndroidConfiguration.class) .incompatibleUseToolchainResolution()) { return ImmutableList.of(); } else if (!ruleContext.attributes().has(STR)) { return ImmutableList.of(); } AndroidSdkProvider androidSdk = AndroidSdkProvider.fromRuleContext(ruleContext); if (androidSdk == null androidSdk.getAidlLib() == null) { return ImmutableList.of(); } return ImmutableList.copyOf( JavaInfo.getJavaInfo(androidSdk.getAidlLib()).getDirectRuntimeJars()); }
/** * Returns toolchain .jars that need dexing for platform-based toolchains. * * <p>Legacy toolchains handle these .jars recursively by propagating the aspect down the * ":android_sdk" attribute. So they don't need this method. */
Returns toolchain .jars that need dexing for platform-based toolchains. Legacy toolchains handle these .jars recursively by propagating the aspect down the ":android_sdk" attribute. So they don't need this method
getPlatformBasedToolchainJars
{ "repo_name": "twitter-forks/bazel", "path": "src/main/java/com/google/devtools/build/lib/rules/android/DexArchiveAspect.java", "license": "apache-2.0", "size": 31763 }
[ "com.google.common.collect.ImmutableList", "com.google.devtools.build.lib.actions.Artifact", "com.google.devtools.build.lib.analysis.RuleContext", "com.google.devtools.build.lib.rules.java.JavaInfo" ]
import com.google.common.collect.ImmutableList; import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.analysis.RuleContext; import com.google.devtools.build.lib.rules.java.JavaInfo;
import com.google.common.collect.*; import com.google.devtools.build.lib.actions.*; import com.google.devtools.build.lib.analysis.*; import com.google.devtools.build.lib.rules.java.*;
[ "com.google.common", "com.google.devtools" ]
com.google.common; com.google.devtools;
2,561,964
@Schema(description = "Set 'true' to reset 'password' for Upload Share.") public Boolean isResetPassword() { return resetPassword; }
@Schema(description = STR) Boolean function() { return resetPassword; }
/** * Set &#x27;true&#x27; to reset &#x27;password&#x27; for Upload Share. * @return resetPassword **/
Set &#x27;true&#x27; to reset &#x27;password&#x27; for Upload Share
isResetPassword
{ "repo_name": "iterate-ch/cyberduck", "path": "dracoon/src/main/java/ch/cyberduck/core/sds/io/swagger/client/model/UpdateUploadShareRequest.java", "license": "gpl-3.0", "size": 16391 }
[ "io.swagger.v3.oas.annotations.media.Schema" ]
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.*;
[ "io.swagger.v3" ]
io.swagger.v3;
25,880
AuthorizationPolicy getAuthPolicy();
AuthorizationPolicy getAuthPolicy();
/** * Get the authorization policy. This acts as a repository of authorization * metadata. */
Get the authorization policy. This acts as a repository of authorization metadata
getAuthPolicy
{ "repo_name": "cloudera/Impala", "path": "fe/src/main/java/org/apache/impala/catalog/local/MetaProvider.java", "license": "apache-2.0", "size": 4904 }
[ "org.apache.impala.catalog.AuthorizationPolicy" ]
import org.apache.impala.catalog.AuthorizationPolicy;
import org.apache.impala.catalog.*;
[ "org.apache.impala" ]
org.apache.impala;
131,447
public void setSubFundTotalRevenueReqAmount(KualiInteger subFundTotalRevenueReqAmount) { this.subFundTotalRevenueReqAmount = subFundTotalRevenueReqAmount; }
void function(KualiInteger subFundTotalRevenueReqAmount) { this.subFundTotalRevenueReqAmount = subFundTotalRevenueReqAmount; }
/** * Sets the subFundTotalRevenueReqAmount * * @param subFundTotalRevenueReqAmount The subFundTotalRevenueReqAmount to set. */
Sets the subFundTotalRevenueReqAmount
setSubFundTotalRevenueReqAmount
{ "repo_name": "ua-eas/ua-kfs-5.3", "path": "work/src/org/kuali/kfs/module/bc/businessobject/BudgetConstructionOrgSubFundSummaryReport.java", "license": "agpl-3.0", "size": 27198 }
[ "org.kuali.rice.core.api.util.type.KualiInteger" ]
import org.kuali.rice.core.api.util.type.KualiInteger;
import org.kuali.rice.core.api.util.type.*;
[ "org.kuali.rice" ]
org.kuali.rice;
2,151,936
void drawMesh(Mesh mesh, Material material, Rect2i region, Quat4f rotation, Vector3f offset, float scale);
void drawMesh(Mesh mesh, Material material, Rect2i region, Quat4f rotation, Vector3f offset, float scale);
/** * Draws a mesh centered on the given screen position. * * @param mesh The mesh to draw * @param material The material to draw the mesh with * @param region The screen area to draw the mesh * @param rotation The rotation of the mesh * @param offset Offset, in object space, for the mesh * @param scale A relative scale for drawing the mesh */
Draws a mesh centered on the given screen position
drawMesh
{ "repo_name": "frankpunx/Terasology", "path": "engine/src/main/java/org/terasology/rendering/nui/Canvas.java", "license": "apache-2.0", "size": 24043 }
[ "org.terasology.math.geom.Quat4f", "org.terasology.math.geom.Rect2i", "org.terasology.math.geom.Vector3f", "org.terasology.rendering.assets.material.Material", "org.terasology.rendering.assets.mesh.Mesh" ]
import org.terasology.math.geom.Quat4f; import org.terasology.math.geom.Rect2i; import org.terasology.math.geom.Vector3f; import org.terasology.rendering.assets.material.Material; import org.terasology.rendering.assets.mesh.Mesh;
import org.terasology.math.geom.*; import org.terasology.rendering.assets.material.*; import org.terasology.rendering.assets.mesh.*;
[ "org.terasology.math", "org.terasology.rendering" ]
org.terasology.math; org.terasology.rendering;
655,656
EClass getRefinement();
EClass getRefinement();
/** * Returns the meta object for class '{@link com.b2international.snowowl.snomed.ecl.ecl.Refinement <em>Refinement</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Refinement</em>'. * @see com.b2international.snowowl.snomed.ecl.ecl.Refinement * @generated */
Returns the meta object for class '<code>com.b2international.snowowl.snomed.ecl.ecl.Refinement Refinement</code>'.
getRefinement
{ "repo_name": "IHTSDO/snow-owl", "path": "snomed/com.b2international.snowowl.snomed.ecl/src-gen/com/b2international/snowowl/snomed/ecl/ecl/EclPackage.java", "license": "apache-2.0", "size": 121411 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
578,923
private static double[] setOverlapThresholdSequence(Collection<Cluster> clusters) { double[] result; if (assignThresholdSequence.length == 3) { logger.logAndStderr("Overlap threshold not set. Setting automatically to: "); double meanLength = getClusterMeanSequenceLength(clusters); if (relativeHHScore) { result = new double[]{meanLength * 0.09, meanLength * 0.075, 0.0}; } else { result = new double[]{meanLength * 0.7, meanLength * 0.4, 0.0}; } for (int i = 0; i < result.length; i++) { result[i] = (double) Math.round(result[i] * 100) / 100; } } else { logger.logAndStderr("Overlap threshold not set. Setting automatically on the basis of assign threshold sequence to: "); result = new double[assignThresholdSequence.length]; for (int i = 0; i < assignThresholdSequence.length; i++) { result[i] = assignThresholdSequence[i] * 0.75; } result[assignThresholdSequence.length - 1] = 0.0; //last zero for full clustering } logger.logAndStderr(formatDoubleSequence(result).toString()); return result; }
static double[] function(Collection<Cluster> clusters) { double[] result; if (assignThresholdSequence.length == 3) { logger.logAndStderr(STR); double meanLength = getClusterMeanSequenceLength(clusters); if (relativeHHScore) { result = new double[]{meanLength * 0.09, meanLength * 0.075, 0.0}; } else { result = new double[]{meanLength * 0.7, meanLength * 0.4, 0.0}; } for (int i = 0; i < result.length; i++) { result[i] = (double) Math.round(result[i] * 100) / 100; } } else { logger.logAndStderr(STR); result = new double[assignThresholdSequence.length]; for (int i = 0; i < assignThresholdSequence.length; i++) { result[i] = assignThresholdSequence[i] * 0.75; } result[assignThresholdSequence.length - 1] = 0.0; } logger.logAndStderr(formatDoubleSequence(result).toString()); return result; }
/** * Sets default values for overlap threshold sequence * * @param clusters * @return */
Sets default values for overlap threshold sequence
setOverlapThresholdSequence
{ "repo_name": "hammock-dev/hammock", "path": "src/cz/krejciadam/hammock/Hammock.java", "license": "gpl-3.0", "size": 79499 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
1,878,204
protected ResponseMessage sendLoginMessage() throws IOException, MessageTooLargeException { ResponseMessage temp = this.sendMessage(generateLoginMessage(), 5000); return temp; }
ResponseMessage function() throws IOException, MessageTooLargeException { ResponseMessage temp = this.sendMessage(generateLoginMessage(), 5000); return temp; }
/** * Sends a Login message to the server; may be overridden by subclasses that need to add * additional information to the Login message. * * @throws MessageTooLargeException * */
Sends a Login message to the server; may be overridden by subclasses that need to add additional information to the Login message
sendLoginMessage
{ "repo_name": "ecologylab/ecologylabAuthentication", "path": "src/ecologylab/authentication/nio/NIOAuthClient.java", "license": "lgpl-3.0", "size": 6916 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,282,885
BridgeHandlerManager getClrHandlers(final String portNumber, final EvaluatorRequestorBridge evaluatorRequestorBridge);
BridgeHandlerManager getClrHandlers(final String portNumber, final EvaluatorRequestorBridge evaluatorRequestorBridge);
/** * Returns the set of CLR handles. */
Returns the set of CLR handles
getClrHandlers
{ "repo_name": "yunseong/reef", "path": "lang/java/reef-bridge-java/src/main/java/org/apache/reef/javabridge/generic/ClrHandlersInitializer.java", "license": "apache-2.0", "size": 1459 }
[ "org.apache.reef.javabridge.BridgeHandlerManager", "org.apache.reef.javabridge.EvaluatorRequestorBridge" ]
import org.apache.reef.javabridge.BridgeHandlerManager; import org.apache.reef.javabridge.EvaluatorRequestorBridge;
import org.apache.reef.javabridge.*;
[ "org.apache.reef" ]
org.apache.reef;
2,281,876
default Input getInput(UUID inputId){ return getInputs().get(inputId); }
default Input getInput(UUID inputId){ return getInputs().get(inputId); }
/** * Get Input module by id * @param inputId * @return */
Get Input module by id
getInput
{ "repo_name": "ibcn-cloudlet/dianne", "path": "be.iminds.iot.dianne.api/src/be/iminds/iot/dianne/api/nn/NeuralNetwork.java", "license": "agpl-3.0", "size": 12647 }
[ "be.iminds.iot.dianne.api.nn.module.Input" ]
import be.iminds.iot.dianne.api.nn.module.Input;
import be.iminds.iot.dianne.api.nn.module.*;
[ "be.iminds.iot" ]
be.iminds.iot;
304,574
public static String formatForSelection(final Kost2DO kost2) { if (kost2 == null) { return ""; } final StringBuffer buf = new StringBuffer(); buf.append(format(kost2)); if (kost2.getProjekt() != null) { buf.append(" - ").append(kost2.getKost2Art().getName()); if (kost2.getKost2Art().isFakturiert() == false) { buf.append(" (nf)"); } } else { buf.append(" - ").append(kost2.getDescription()); } return buf.toString(); }
static String function(final Kost2DO kost2) { if (kost2 == null) { return STR - STR (nf)STR - ").append(kost2.getDescription()); } return buf.toString(); }
/** * Format for using in e. g. combo boxes for selection: * <ul> * <li>Project is given: #.###.##.## - [kost2Art.name];</li> * <li>Project is not given: #.###.##.## - [description]</li> * </ul> * @return */
Format for using in e. g. combo boxes for selection: Project is given: #.###.##.## - [kost2Art.name]; Project is not given: #.###.##.## - [description]
formatForSelection
{ "repo_name": "micromata/projectforge-webapp", "path": "src/main/java/org/projectforge/fibu/KostFormatter.java", "license": "gpl-3.0", "size": 12521 }
[ "org.projectforge.fibu.kost.Kost2DO" ]
import org.projectforge.fibu.kost.Kost2DO;
import org.projectforge.fibu.kost.*;
[ "org.projectforge.fibu" ]
org.projectforge.fibu;
1,896,634
public Principal getPrincipal() { return (userPrincipal); }
Principal function() { return (userPrincipal); }
/** * Return the principal that has been authenticated for this Request. */
Return the principal that has been authenticated for this Request
getPrincipal
{ "repo_name": "johnaoahra80/JBOSSWEB_7_5_0_FINAL", "path": "src/main/java/org/apache/catalina/connector/Request.java", "license": "apache-2.0", "size": 102726 }
[ "java.security.Principal" ]
import java.security.Principal;
import java.security.*;
[ "java.security" ]
java.security;
260,224
public BigDecimal getMovementQty () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_MovementQty); if (bd == null) return Env.ZERO; return bd; }
BigDecimal function () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_MovementQty); if (bd == null) return Env.ZERO; return bd; }
/** Get Movement Quantity. @return Quantity of a product moved. */
Get Movement Quantity
getMovementQty
{ "repo_name": "armenrz/adempiere", "path": "base/src/org/compiere/model/X_M_MovementLineMA.java", "license": "gpl-2.0", "size": 5106 }
[ "java.math.BigDecimal", "org.compiere.util.Env" ]
import java.math.BigDecimal; import org.compiere.util.Env;
import java.math.*; import org.compiere.util.*;
[ "java.math", "org.compiere.util" ]
java.math; org.compiere.util;
2,770,200
public static String gensalt(int log_rounds, SecureRandom random) { StringBuffer rs = new StringBuffer(); byte rnd[] = new byte[BCRYPT_SALT_LEN]; random.nextBytes(rnd); rs.append("$2a$"); if (log_rounds < 10) rs.append("0"); rs.append(Integer.toString(log_rounds)); rs.append("$"); rs.append(encode_base64(rnd, rnd.length)); return rs.toString(); }
static String function(int log_rounds, SecureRandom random) { StringBuffer rs = new StringBuffer(); byte rnd[] = new byte[BCRYPT_SALT_LEN]; random.nextBytes(rnd); rs.append("$2a$"); if (log_rounds < 10) rs.append("0"); rs.append(Integer.toString(log_rounds)); rs.append("$"); rs.append(encode_base64(rnd, rnd.length)); return rs.toString(); }
/** * Generate a salt for use with the BCrypt.hashpw() method * @param log_rounds the log2 of the number of rounds of * hashing to apply - the work factor therefore increases as * 2**log_rounds. * @param random an instance of SecureRandom to use * @return an encoded salt value */
Generate a salt for use with the BCrypt.hashpw() method
gensalt
{ "repo_name": "h44z/Sprinternet-Device-Manager", "path": "odm/src/at/sprinternet/odm/misc/BCrypt.java", "license": "gpl-2.0", "size": 27236 }
[ "java.security.SecureRandom" ]
import java.security.SecureRandom;
import java.security.*;
[ "java.security" ]
java.security;
2,337,884
public void testNonExistentProperty() throws Exception { Properties prop = PropertyUtils.loadPropertyFile( propertyFile, true, true ); validationProp.putAll( System.getProperties() ); assertNotNull( prop ); assertNull( prop.getProperty( "does_not_exist" ) ); }
void function() throws Exception { Properties prop = PropertyUtils.loadPropertyFile( propertyFile, true, true ); validationProp.putAll( System.getProperties() ); assertNotNull( prop ); assertNull( prop.getProperty( STR ) ); }
/** * load property test case can be adjusted by modifying the basic.properties and basic_validation properties * * @throws Exception */
load property test case can be adjusted by modifying the basic.properties and basic_validation properties
testNonExistentProperty
{ "repo_name": "apache/maven-plugins", "path": "maven-resources-plugin/src/test/java/org/apache/maven/plugins/resources/BasicPropertyUtilsTest.java", "license": "apache-2.0", "size": 3545 }
[ "java.util.Properties", "org.apache.maven.shared.filtering.PropertyUtils" ]
import java.util.Properties; import org.apache.maven.shared.filtering.PropertyUtils;
import java.util.*; import org.apache.maven.shared.filtering.*;
[ "java.util", "org.apache.maven" ]
java.util; org.apache.maven;
1,471,917
@Test void decodeMode() { var marker = new AztecCode(); var found = new AztecCode(); var alg = new AztecMessageModeCodec(); var original = new PackedBits8(); // Go through different structures because the code is slightly different for (var structure : AztecCode.Structure.values()) { // Create the error free message marker.structure = structure; marker.dataLayers = 2; marker.messageWordCount = 10; alg.encodeMode(marker, original); // Decode it and see if it extracted the correct values found.structure = structure; assertTrue(alg.decodeMode(original, found)); assertEquals(marker.dataLayers, found.dataLayers); assertEquals(marker.messageWordCount, found.messageWordCount); } }
@Test void decodeMode() { var marker = new AztecCode(); var found = new AztecCode(); var alg = new AztecMessageModeCodec(); var original = new PackedBits8(); for (var structure : AztecCode.Structure.values()) { marker.structure = structure; marker.dataLayers = 2; marker.messageWordCount = 10; alg.encodeMode(marker, original); found.structure = structure; assertTrue(alg.decodeMode(original, found)); assertEquals(marker.dataLayers, found.dataLayers); assertEquals(marker.messageWordCount, found.messageWordCount); } }
/** * Simple test to see if it decodes the original mode correctly. */
Simple test to see if it decodes the original mode correctly
decodeMode
{ "repo_name": "lessthanoptimal/BoofCV", "path": "main/boofcv-recognition/src/test/java/boofcv/alg/fiducial/aztec/TestAztecMessageModeCodec.java", "license": "apache-2.0", "size": 3760 }
[ "org.junit.jupiter.api.Assertions", "org.junit.jupiter.api.Test" ]
import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.*;
[ "org.junit.jupiter" ]
org.junit.jupiter;
814,715
@Test public void testComplement6() { List<Integer> expected = Lists.newArrayList(); final int length = 1001; ConciseSet set = new ConciseSet(); for (int i = 65; i <= 100; i++) { set.add(i); } for (int i = 0; i < length; i++) { if (i < 65 || i > 100) { expected.add(i); } } ImmutableConciseSet testSet = ImmutableConciseSet.newImmutableFromMutable(set); verifyComplement(expected, testSet, length); }
void function() { List<Integer> expected = Lists.newArrayList(); final int length = 1001; ConciseSet set = new ConciseSet(); for (int i = 65; i <= 100; i++) { set.add(i); } for (int i = 0; i < length; i++) { if (i < 65 i > 100) { expected.add(i); } } ImmutableConciseSet testSet = ImmutableConciseSet.newImmutableFromMutable(set); verifyComplement(expected, testSet, length); }
/** * Complement of words with a length set to create a one fill */
Complement of words with a length set to create a one fill
testComplement6
{ "repo_name": "b-slim/druid", "path": "extendedset/src/test/java/io/druid/extendedset/intset/ImmutableConciseSetTest.java", "license": "apache-2.0", "size": 38403 }
[ "com.google.common.collect.Lists", "java.util.List" ]
import com.google.common.collect.Lists; import java.util.List;
import com.google.common.collect.*; import java.util.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
87,092
public void add(String name, Document doc) { Document document = getDocument(name); if (document == null) documents.put(name, doc); else merge(document, document.getDocumentElement(), doc.getDocumentElement().getChildNodes(), true); }
void function(String name, Document doc) { Document document = getDocument(name); if (document == null) documents.put(name, doc); else merge(document, document.getDocumentElement(), doc.getDocumentElement().getChildNodes(), true); }
/** * Adds the document under the specified name or merges <code>doc</code> * into an existing document for <code>name</code>. * * @param name * The name under which the document should be added. * @param doc * The document to add. */
Adds the document under the specified name or merges <code>doc</code> into an existing document for <code>name</code>
add
{ "repo_name": "harryho/demo-r-java-statistics-prototype", "path": "rm/rm/src/com/rm/app/ui/tool/RMAppDocumentBuilder.java", "license": "mit", "size": 17393 }
[ "org.w3c.dom.Document" ]
import org.w3c.dom.Document;
import org.w3c.dom.*;
[ "org.w3c.dom" ]
org.w3c.dom;
1,449,052
public void setTargetType(String targetType) throws BuildException { targetType = targetType.toLowerCase(); if (targetType.equals("exe") || targetType.equals("library") || targetType.equals("module") || targetType.equals("winexe")) { targetType = targetType; } else { throw new BuildException("targetType " + targetType + " is not a valid type"); } }
void function(String targetType) throws BuildException { targetType = targetType.toLowerCase(); if (targetType.equals("exe") targetType.equals(STR) targetType.equals(STR) targetType.equals(STR)) { targetType = targetType; } else { throw new BuildException(STR + targetType + STR); } }
/** * define the target * *@param targetType The new TargetType value *@exception BuildException if target is not one of * exe|library|module|winexe */
define the target
setTargetType
{ "repo_name": "codinuum/cca", "path": "samples/java/1/CSharp.java", "license": "apache-2.0", "size": 28555 }
[ "org.apache.tools.ant.BuildException" ]
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.*;
[ "org.apache.tools" ]
org.apache.tools;
396,409
@Nullable MaterialAndData getItemDisabledMaterial(MageController controller);
MaterialAndData getItemDisabledMaterial(MageController controller);
/** * Automatically get the URL, legacy or modern version of this icon, depending on icon and server settings */
Automatically get the URL, legacy or modern version of this icon, depending on icon and server settings
getItemDisabledMaterial
{ "repo_name": "elBukkit/MagicPlugin", "path": "MagicAPI/src/main/java/com/elmakers/mine/bukkit/api/item/Icon.java", "license": "mit", "size": 970 }
[ "com.elmakers.mine.bukkit.api.block.MaterialAndData", "com.elmakers.mine.bukkit.api.magic.MageController" ]
import com.elmakers.mine.bukkit.api.block.MaterialAndData; import com.elmakers.mine.bukkit.api.magic.MageController;
import com.elmakers.mine.bukkit.api.block.*; import com.elmakers.mine.bukkit.api.magic.*;
[ "com.elmakers.mine" ]
com.elmakers.mine;
1,871,089
public static double doubleThat(Matcher<Double> matcher) { reportMatcher(matcher); return 0; }
static double function(Matcher<Double> matcher) { reportMatcher(matcher); return 0; }
/** * Enables integrating hamcrest matchers that match primitive <code>double</code> arguments. * Note that {@link #argThat} will not work with primitive <code>double</code> matchers due to <code>NullPointerException</code> auto-unboxing caveat. * <p/> * * See examples in javadoc for {@link MockitoHamcrest} class * * @param matcher decides whether argument matches * @return <code>0</code>. */
Enables integrating hamcrest matchers that match primitive <code>double</code> arguments. Note that <code>#argThat</code> will not work with primitive <code>double</code> matchers due to <code>NullPointerException</code> auto-unboxing caveat. See examples in javadoc for <code>MockitoHamcrest</code> class
doubleThat
{ "repo_name": "mockito/mockito", "path": "src/main/java/org/mockito/hamcrest/MockitoHamcrest.java", "license": "mit", "size": 7374 }
[ "org.hamcrest.Matcher" ]
import org.hamcrest.Matcher;
import org.hamcrest.*;
[ "org.hamcrest" ]
org.hamcrest;
780,213
private void copyUcs2ReadBuffer(int count, int shift1, int shift2) throws SAXException { int j = readBufferPos; if (count > 0 && (count % 2) != 0) { encodingError("odd number of bytes in UCS-2 encoding", -1, count); } // The loops are faster with less internal brancing; hence two if (shift1 == 0) { // "UTF-16-LE" for (int i = 0; i < count; i += 2) { char c = (char) (rawReadBuffer[i + 1] << 8); c |= 0xff & rawReadBuffer[i]; readBuffer[j++] = c; if (c == '\r') { sawCR = true; } } } else { // "UTF-16-BE" for (int i = 0; i < count; i += 2) { char c = (char) (rawReadBuffer[i] << 8); c |= 0xff & rawReadBuffer[i + 1]; readBuffer[j++] = c; if (c == '\r') { sawCR = true; } } } readBufferLength = j; }
void function(int count, int shift1, int shift2) throws SAXException { int j = readBufferPos; if (count > 0 && (count % 2) != 0) { encodingError(STR, -1, count); } if (shift1 == 0) { for (int i = 0; i < count; i += 2) { char c = (char) (rawReadBuffer[i + 1] << 8); c = 0xff & rawReadBuffer[i]; readBuffer[j++] = c; if (c == '\r') { sawCR = true; } } } else { for (int i = 0; i < count; i += 2) { char c = (char) (rawReadBuffer[i] << 8); c = 0xff & rawReadBuffer[i + 1]; readBuffer[j++] = c; if (c == '\r') { sawCR = true; } } } readBufferLength = j; }
/** * Convert a buffer of UCS-2-encoded bytes into UTF-16 characters * (as used in Java string manipulation). * * <p>When readDataChunk () calls this method, the raw bytes are in * rawReadBuffer, and the final characters will appear in * readBuffer. * @param count The number of bytes to convert. * @param shift1 The number of bits to shift byte 1. * @param shift2 The number of bits to shift byte 2 * @see #readDataChunk * @see #rawReadBuffer * @see #readBuffer */
Convert a buffer of UCS-2-encoded bytes into UTF-16 characters (as used in Java string manipulation). When readDataChunk () calls this method, the raw bytes are in rawReadBuffer, and the final characters will appear in readBuffer
copyUcs2ReadBuffer
{ "repo_name": "shaotuanchen/sunflower_exp", "path": "tools/source/gcc-4.2.4/libjava/classpath/gnu/xml/aelfred2/XmlParser.java", "license": "bsd-3-clause", "size": 164976 }
[ "org.xml.sax.SAXException" ]
import org.xml.sax.SAXException;
import org.xml.sax.*;
[ "org.xml.sax" ]
org.xml.sax;
973,819
@CalledByNative public void notifySetupDone() { Log.v(TAG, "setupDone()"); assert mNativeSyncSetupFlow != 0; mListener.setupDone(); }
void function() { Log.v(TAG, STR); assert mNativeSyncSetupFlow != 0; mListener.setupDone(); }
/** * Called from native code when the sync setup is complete. */
Called from native code when the sync setup is complete
notifySetupDone
{ "repo_name": "paul99/clank", "path": "clank/java/apps/chrome/src/com/google/android/apps/chrome/sync/SyncSetupFlowAdapter.java", "license": "bsd-3-clause", "size": 8674 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
417,539
void drop(SingleResultCallback<Void> callback);
void drop(SingleResultCallback<Void> callback);
/** * Drops this collection from the Database. * * @param callback the callback that is completed once the collection has been dropped * @mongodb.driver.manual reference/command/drop/ Drop Collection */
Drops this collection from the Database
drop
{ "repo_name": "jsonking/mongo-java-driver", "path": "driver-async/src/main/com/mongodb/async/client/MongoCollection.java", "license": "apache-2.0", "size": 31868 }
[ "com.mongodb.async.SingleResultCallback" ]
import com.mongodb.async.SingleResultCallback;
import com.mongodb.async.*;
[ "com.mongodb.async" ]
com.mongodb.async;
1,756,411
public boolean compare(Document doc1, Document doc2, String tableName, String[] primaryKeyFields) { // Remove errors of previous calls errorsList.clear(); // Iterator all the Row List<HashMap<String, String>> doc1Hash = createRowsHashMap(doc1, tableName); List<HashMap<String, String>> doc2Hash = createRowsHashMap(doc2, tableName); for (HashMap<String, String> hash1 : doc1Hash) { //System.out.println(hash1.toString()); boolean found = false; for (HashMap<String, String> hash2 : doc2Hash) { int i = 0; while (i < primaryKeyFields.length) { String key = primaryKeyFields[i]; if (!hash2.containsKey(key)) { // Error the primary key field is not present! errorsList.add("Error the primary key field is not present!"); } String value1 = hash1.get(key); String value2 = hash2.get(key); if (value1.equals(value2)) { //System.out.println("One part is found!"); } else { //System.out.println("not the row"); break; } i++; } found = (i == primaryKeyFields.length); if (found) { //System.out.println("The primary key is found!"); // The matching row is found, check the content of all fields for (String key : hash1.keySet()) { String value1 = hash1.get(key); String value2 = hash2.get(key); if (!value1.equals(value2)) { errorsList.add( "Expected to get " + value1 + " for the field " + key + " but got " + value2 + " for row" + getPrimaryKeysExtraDetails(hash1, primaryKeyFields)); } } break; } } // The row with the primary key is not found if (!found) { errorsList.add("Cannot find row " + getPrimaryKeysExtraDetails(hash1, primaryKeyFields)); } } return (errorsList.size() == 0); }
boolean function(Document doc1, Document doc2, String tableName, String[] primaryKeyFields) { errorsList.clear(); List<HashMap<String, String>> doc1Hash = createRowsHashMap(doc1, tableName); List<HashMap<String, String>> doc2Hash = createRowsHashMap(doc2, tableName); for (HashMap<String, String> hash1 : doc1Hash) { boolean found = false; for (HashMap<String, String> hash2 : doc2Hash) { int i = 0; while (i < primaryKeyFields.length) { String key = primaryKeyFields[i]; if (!hash2.containsKey(key)) { errorsList.add(STR); } String value1 = hash1.get(key); String value2 = hash2.get(key); if (value1.equals(value2)) { } else { break; } i++; } found = (i == primaryKeyFields.length); if (found) { for (String key : hash1.keySet()) { String value1 = hash1.get(key); String value2 = hash2.get(key); if (!value1.equals(value2)) { errorsList.add( STR + value1 + STR + key + STR + value2 + STR + getPrimaryKeysExtraDetails(hash1, primaryKeyFields)); } } break; } } if (!found) { errorsList.add(STR + getPrimaryKeysExtraDetails(hash1, primaryKeyFields)); } } return (errorsList.size() == 0); }
/** * Check that all the rows and elements defined in the doc1 are included in doc2 * * @param doc1 The source document * @param doc2 The checked document * @param primaryKeyFields A String array containing all the field names composing the primary key * @return True if all the elements defined in the doc1 exists in the doc2 */
Check that all the rows and elements defined in the doc1 are included in doc2
compare
{ "repo_name": "qspin/qtaste", "path": "kernel/src/main/java/com/qspin/qtaste/tcom/db/impl/XMLComparator.java", "license": "lgpl-3.0", "size": 11167 }
[ "java.util.HashMap", "java.util.List", "org.w3c.dom.Document" ]
import java.util.HashMap; import java.util.List; import org.w3c.dom.Document;
import java.util.*; import org.w3c.dom.*;
[ "java.util", "org.w3c.dom" ]
java.util; org.w3c.dom;
1,623,049
public static Object restorePartValueFromType(String valStr, LogicalType type) { if (valStr == null) { return null; } LogicalTypeRoot typeRoot = type.getTypeRoot(); switch (typeRoot) { case CHAR: case VARCHAR: return valStr; case BOOLEAN: return Boolean.parseBoolean(valStr); case TINYINT: return Integer.valueOf(valStr).byteValue(); case SMALLINT: return Short.valueOf(valStr); case INTEGER: return Integer.valueOf(valStr); case BIGINT: return Long.valueOf(valStr); case FLOAT: return Float.valueOf(valStr); case DOUBLE: return Double.valueOf(valStr); case DATE: return LocalDate.parse(valStr); case TIMESTAMP_WITHOUT_TIME_ZONE: return LocalDateTime.parse(valStr); case DECIMAL: return new BigDecimal(valStr); default: throw new RuntimeException( String.format( "Can not convert %s to type %s for partition value", valStr, type)); } }
static Object function(String valStr, LogicalType type) { if (valStr == null) { return null; } LogicalTypeRoot typeRoot = type.getTypeRoot(); switch (typeRoot) { case CHAR: case VARCHAR: return valStr; case BOOLEAN: return Boolean.parseBoolean(valStr); case TINYINT: return Integer.valueOf(valStr).byteValue(); case SMALLINT: return Short.valueOf(valStr); case INTEGER: return Integer.valueOf(valStr); case BIGINT: return Long.valueOf(valStr); case FLOAT: return Float.valueOf(valStr); case DOUBLE: return Double.valueOf(valStr); case DATE: return LocalDate.parse(valStr); case TIMESTAMP_WITHOUT_TIME_ZONE: return LocalDateTime.parse(valStr); case DECIMAL: return new BigDecimal(valStr); default: throw new RuntimeException( String.format( STR, valStr, type)); } }
/** * Restore partition value from string and type. This method is the opposite of method {@link * #generatePartValues}. * * @param valStr string partition value. * @param type type of partition field. * @return partition value. */
Restore partition value from string and type. This method is the opposite of method <code>#generatePartValues</code>
restorePartValueFromType
{ "repo_name": "apache/flink", "path": "flink-connectors/flink-connector-files/src/main/java/org/apache/flink/connector/file/table/RowPartitionComputer.java", "license": "apache-2.0", "size": 4980 }
[ "java.math.BigDecimal", "java.time.LocalDate", "java.time.LocalDateTime", "org.apache.flink.table.types.logical.LogicalType", "org.apache.flink.table.types.logical.LogicalTypeRoot" ]
import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; import org.apache.flink.table.types.logical.LogicalType; import org.apache.flink.table.types.logical.LogicalTypeRoot;
import java.math.*; import java.time.*; import org.apache.flink.table.types.logical.*;
[ "java.math", "java.time", "org.apache.flink" ]
java.math; java.time; org.apache.flink;
183,104
public List<Gsc001OrganizationEntity> getOrganizations(String query);
List<Gsc001OrganizationEntity> function(String query);
/** * Load organizations using native query * @param query native query * @return list of organizations */
Load organizations using native query
getOrganizations
{ "repo_name": "GeoSmartCity-CIP/gsc-datacatalogue", "path": "server/src/main/java/it/sinergis/datacatalogue/persistence/services/Gsc001OrganizationPersistence.java", "license": "mit", "size": 3000 }
[ "it.sinergis.datacatalogue.bean.jpa.Gsc001OrganizationEntity", "java.util.List" ]
import it.sinergis.datacatalogue.bean.jpa.Gsc001OrganizationEntity; import java.util.List;
import it.sinergis.datacatalogue.bean.jpa.*; import java.util.*;
[ "it.sinergis.datacatalogue", "java.util" ]
it.sinergis.datacatalogue; java.util;
617,127
public static void configurePreBuilder(IProject project) throws CoreException { // get the builder list IProjectDescription desc = project.getDescription(); ICommand[] commands = desc.getBuildSpec(); // look for the builder in case it's already there. for (int i = 0; i < commands.length; ++i) { if (PreCompilerBuilder.ID.equals(commands[i].getBuilderName())) { return; } } // we need to add it after the resource manager builder. // Let's look for it int index = -1; for (int i = 0; i < commands.length; ++i) { if (ResourceManagerBuilder.ID.equals(commands[i].getBuilderName())) { index = i; break; } } // we're inserting after index++; // do the insertion // copy the builders before. ICommand[] newCommands = new ICommand[commands.length + 1]; System.arraycopy(commands, 0, newCommands, 0, index); // insert the new builder ICommand command = desc.newCommand(); command.setBuilderName(PreCompilerBuilder.ID); newCommands[index] = command; // copy the builder after System.arraycopy(commands, index, newCommands, index + 1, commands.length-index); // set the new builders in the project desc.setBuildSpec(newCommands); project.setDescription(desc, null); }
static void function(IProject project) throws CoreException { IProjectDescription desc = project.getDescription(); ICommand[] commands = desc.getBuildSpec(); for (int i = 0; i < commands.length; ++i) { if (PreCompilerBuilder.ID.equals(commands[i].getBuilderName())) { return; } } int index = -1; for (int i = 0; i < commands.length; ++i) { if (ResourceManagerBuilder.ID.equals(commands[i].getBuilderName())) { index = i; break; } } index++; ICommand[] newCommands = new ICommand[commands.length + 1]; System.arraycopy(commands, 0, newCommands, 0, index); ICommand command = desc.newCommand(); command.setBuilderName(PreCompilerBuilder.ID); newCommands[index] = command; System.arraycopy(commands, index, newCommands, index + 1, commands.length-index); desc.setBuildSpec(newCommands); project.setDescription(desc, null); }
/** * Adds the PreCompilerBuilder if its not already there. It'll check for * presence of the ResourceManager and insert itself right after. * @param project * @throws CoreException */
Adds the PreCompilerBuilder if its not already there. It'll check for presence of the ResourceManager and insert itself right after
configurePreBuilder
{ "repo_name": "rex-xxx/mt6572_x201", "path": "sdk/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidNature.java", "license": "gpl-2.0", "size": 11759 }
[ "com.android.ide.eclipse.adt.internal.build.builders.PreCompilerBuilder", "com.android.ide.eclipse.adt.internal.build.builders.ResourceManagerBuilder", "org.eclipse.core.resources.ICommand", "org.eclipse.core.resources.IProject", "org.eclipse.core.resources.IProjectDescription", "org.eclipse.core.runtime.CoreException" ]
import com.android.ide.eclipse.adt.internal.build.builders.PreCompilerBuilder; import com.android.ide.eclipse.adt.internal.build.builders.ResourceManagerBuilder; import org.eclipse.core.resources.ICommand; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProjectDescription; import org.eclipse.core.runtime.CoreException;
import com.android.ide.eclipse.adt.internal.build.builders.*; import org.eclipse.core.resources.*; import org.eclipse.core.runtime.*;
[ "com.android.ide", "org.eclipse.core" ]
com.android.ide; org.eclipse.core;
509,082
public static List<GeoTimeSerie> chunk(GeoTimeSerie gts, long lastchunk, long chunkwidth, long chunkcount, String chunklabel, boolean keepempty) throws WarpScriptException { return chunk(gts, lastchunk, chunkwidth, chunkcount, chunklabel, keepempty, 0L); }
static List<GeoTimeSerie> function(GeoTimeSerie gts, long lastchunk, long chunkwidth, long chunkcount, String chunklabel, boolean keepempty) throws WarpScriptException { return chunk(gts, lastchunk, chunkwidth, chunkcount, chunklabel, keepempty, 0L); }
/** * Splits a GTS in 'chunks' of equal time length. * * @param gts * @param lastchunk End timestamp of the most recent chunk. Use 0 to adjust automatically on 'chunkwidth' boundary * @param chunkwidth Width of each chunk in time units * @param chunkcount Number of chunks to generate. Use 0 to generate as many chunks as needed to cover the GTS * @param chunklabel Name of the label to use for storing the chunkid * @param keepempty Should we keed empty chunks * @return a List of GeoTimeSerie, each GTS covering one chunk. * * @throws WarpScriptException if parameters are invalid. */
Splits a GTS in 'chunks' of equal time length
chunk
{ "repo_name": "StevenLeRoux/warp10-platform", "path": "warp10/src/main/java/io/warp10/continuum/gts/GTSHelper.java", "license": "apache-2.0", "size": 304137 }
[ "io.warp10.script.WarpScriptException", "java.util.List" ]
import io.warp10.script.WarpScriptException; import java.util.List;
import io.warp10.script.*; import java.util.*;
[ "io.warp10.script", "java.util" ]
io.warp10.script; java.util;
1,425,756
@Test public void testActionConflictMarksTargetInvalid() throws Exception { scratch.file("conflict/BUILD", "cc_library(name='x', srcs=['foo.cc'])", "cc_binary(name='_objs/x/conflict/foo.pic.o', srcs=['bar.cc'])"); reporter.removeHandler(failFastHandler); // expect errors update(defaultFlags().with(Flag.KEEP_GOING), "//conflict:x", "//conflict:_objs/x/conflict/foo.pic.o"); ConfiguredTarget a = getConfiguredTarget("//conflict:x"); ConfiguredTarget b = getConfiguredTarget("//conflict:_objs/x/conflict/foo.pic.o"); assertTrue(hasTopLevelAnalysisError(a) ^ hasTopLevelAnalysisError(b)); }
void function() throws Exception { scratch.file(STR, STR, STR); reporter.removeHandler(failFastHandler); update(defaultFlags().with(Flag.KEEP_GOING), STR ConfiguredTarget b = getConfiguredTarget(" assertTrue(hasTopLevelAnalysisError(a) ^ hasTopLevelAnalysisError(b)); }
/** * The current action conflict detection code will only mark one of the targets as having an * error, and with multi-threaded analysis it is not deterministic which one that will be. */
The current action conflict detection code will only mark one of the targets as having an error, and with multi-threaded analysis it is not deterministic which one that will be
testActionConflictMarksTargetInvalid
{ "repo_name": "anupcshan/bazel", "path": "src/test/java/com/google/devtools/build/lib/analysis/AnalysisCachingTest.java", "license": "apache-2.0", "size": 22042 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
1,083,377
public void addDataSink(GenericDataSinkBase<?> sink) { checkNotNull(sink, "The data sink must not be null."); if (!this.sinks.contains(sink)) { this.sinks.add(sink); } }
void function(GenericDataSinkBase<?> sink) { checkNotNull(sink, STR); if (!this.sinks.contains(sink)) { this.sinks.add(sink); } }
/** * Adds a data sink to the set of sinks in this program. * * @param sink The data sink to add. */
Adds a data sink to the set of sinks in this program
addDataSink
{ "repo_name": "jinglining/flink", "path": "flink-core/src/main/java/org/apache/flink/api/common/Plan.java", "license": "apache-2.0", "size": 12504 }
[ "org.apache.flink.api.common.operators.GenericDataSinkBase", "org.apache.flink.util.Preconditions" ]
import org.apache.flink.api.common.operators.GenericDataSinkBase; import org.apache.flink.util.Preconditions;
import org.apache.flink.api.common.operators.*; import org.apache.flink.util.*;
[ "org.apache.flink" ]
org.apache.flink;
2,149,201
private boolean isSelectedPathVersion(){ return ((DefaultMutableTreeNode)selectedPath.get(selectedPath.size()-1)).getUserObject() instanceof DVersion; }
boolean function(){ return ((DefaultMutableTreeNode)selectedPath.get(selectedPath.size()-1)).getUserObject() instanceof DVersion; }
/** * Determines, whether the selected item in the graphical view of server </br> * database is a version of a file. * @return */
Determines, whether the selected item in the graphical view of server database is a version of a file
isSelectedPathVersion
{ "repo_name": "filipekt/save-the-world", "path": "src/main/java/cz/filipekt/GUIclient.java", "license": "mit", "size": 32585 }
[ "javax.swing.tree.DefaultMutableTreeNode" ]
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.*;
[ "javax.swing" ]
javax.swing;
270,109
public int getDefaultFlags() { // if (getMode() == CmsProjectType.MODE_PROJECT_WORKFLOW.getMode()) { // return PROJECT_FLAG_HIDDEN; // } return PROJECT_FLAG_NONE; } } public static final String ONLINE_PROJECT_NAME = "Online"; public static final CmsUUID ONLINE_PROJECT_ID = CmsUUID.getConstantUUID(ONLINE_PROJECT_NAME); public static final int PROJECT_FLAG_HIDDEN = 4; public static final int PROJECT_FLAG_NONE = 0; public static final CmsProjectType PROJECT_TYPE_NORMAL = CmsProjectType.MODE_PROJECT_NORMAL; public static final CmsProjectType PROJECT_TYPE_WORKFLOW = CmsProjectType.MODE_PROJECT_WORKFLOW; public static final CmsProjectType PROJECT_TYPE_TEMPORARY = CmsProjectType.MODE_PROJECT_TEMPORARY; private long m_dateCreated; private String m_description; private int m_flags; private CmsUUID m_groupManagersId; private CmsUUID m_groupUsersId; private CmsUUID m_id; private String m_name; private CmsUUID m_ownerId; private CmsProjectType m_type; public CmsProject() { // empty } public CmsProject( CmsUUID projectId, String projectFqn, String description, CmsUUID ownerId, CmsUUID groupId, CmsUUID managerGroupId, int flags, long dateCreated, CmsProjectType type) { m_id = projectId; m_name = projectFqn; m_description = description; m_ownerId = ownerId; m_groupUsersId = groupId; m_groupManagersId = managerGroupId; m_flags = flags; m_type = type; m_dateCreated = dateCreated; }
int function() { return PROJECT_FLAG_NONE; } } public static final String ONLINE_PROJECT_NAME = STR; public static final CmsUUID ONLINE_PROJECT_ID = CmsUUID.getConstantUUID(ONLINE_PROJECT_NAME); public static final int PROJECT_FLAG_HIDDEN = 4; public static final int PROJECT_FLAG_NONE = 0; public static final CmsProjectType PROJECT_TYPE_NORMAL = CmsProjectType.MODE_PROJECT_NORMAL; public static final CmsProjectType PROJECT_TYPE_WORKFLOW = CmsProjectType.MODE_PROJECT_WORKFLOW; public static final CmsProjectType PROJECT_TYPE_TEMPORARY = CmsProjectType.MODE_PROJECT_TEMPORARY; private long m_dateCreated; private String m_description; private int m_flags; private CmsUUID m_groupManagersId; private CmsUUID m_groupUsersId; private CmsUUID m_id; private String m_name; private CmsUUID m_ownerId; private CmsProjectType m_type; public CmsProject() { } public CmsProject( CmsUUID projectId, String projectFqn, String description, CmsUUID ownerId, CmsUUID groupId, CmsUUID managerGroupId, int flags, long dateCreated, CmsProjectType type) { m_id = projectId; m_name = projectFqn; m_description = description; m_ownerId = ownerId; m_groupUsersId = groupId; m_groupManagersId = managerGroupId; m_flags = flags; m_type = type; m_dateCreated = dateCreated; }
/** * Returns the default flags which should be set when a new project of this type is created.<p> * * @return the default flags for the project type */
Returns the default flags which should be set when a new project of this type is created
getDefaultFlags
{ "repo_name": "it-tavis/opencms-core", "path": "src/org/opencms/file/CmsProject.java", "license": "lgpl-2.1", "size": 15728 }
[ "org.opencms.util.CmsUUID" ]
import org.opencms.util.CmsUUID;
import org.opencms.util.*;
[ "org.opencms.util" ]
org.opencms.util;
310,228
// check if the property exists if (!jmsMessage.propertyExists(name)) { return null; } Object answer = null; // store the properties we want to keep in a temporary map // as the JMS API is a bit strict as we are not allowed to // clear a single property, but must clear them all and redo // the properties Map<String, Object> map = new LinkedHashMap<>(); Enumeration<?> en = jmsMessage.getPropertyNames(); while (en.hasMoreElements()) { String key = (String) en.nextElement(); if (name.equals(key)) { answer = key; } else { map.put(key, getProperty(jmsMessage, key)); } } // redo the properties to keep jmsMessage.clearProperties(); for (Entry<String, Object> entry : map.entrySet()) { jmsMessage.setObjectProperty(entry.getKey(), entry.getValue()); } return answer; }
if (!jmsMessage.propertyExists(name)) { return null; } Object answer = null; Map<String, Object> map = new LinkedHashMap<>(); Enumeration<?> en = jmsMessage.getPropertyNames(); while (en.hasMoreElements()) { String key = (String) en.nextElement(); if (name.equals(key)) { answer = key; } else { map.put(key, getProperty(jmsMessage, key)); } } jmsMessage.clearProperties(); for (Entry<String, Object> entry : map.entrySet()) { jmsMessage.setObjectProperty(entry.getKey(), entry.getValue()); } return answer; }
/** * Removes the property from the JMS message. * * @param jmsMessage the JMS message * @param name name of the property to remove * @return the old value of the property or <tt>null</tt> if not exists * @throws JMSException can be thrown */
Removes the property from the JMS message
removeJmsProperty
{ "repo_name": "onders86/camel", "path": "components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessageHelper.java", "license": "apache-2.0", "size": 16011 }
[ "java.util.Enumeration", "java.util.LinkedHashMap", "java.util.Map" ]
import java.util.Enumeration; import java.util.LinkedHashMap; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,993,544
private Global getGlobal(Network net) { Netlist netlist = net.getNetlist(); for (int i=0; i<netlist.getGlobals().size(); i++) { Global g = netlist.getGlobals().get(i); if (netlist.getNetwork(g) == net) return g; } return null; }
Global function(Network net) { Netlist netlist = net.getNetlist(); for (int i=0; i<netlist.getGlobals().size(); i++) { Global g = netlist.getGlobals().get(i); if (netlist.getNetwork(g) == net) return g; } return null; }
/** * Get the global associated with this net. Returns null if net is * not a global. * @param net * @return global associated with this net, or null if not global */
Get the global associated with this net. Returns null if net is not a global
getGlobal
{ "repo_name": "imr/Electric8", "path": "com/sun/electric/tool/io/output/Spice.java", "license": "gpl-3.0", "size": 141736 }
[ "com.sun.electric.database.network.Global", "com.sun.electric.database.network.Netlist", "com.sun.electric.database.network.Network" ]
import com.sun.electric.database.network.Global; import com.sun.electric.database.network.Netlist; import com.sun.electric.database.network.Network;
import com.sun.electric.database.network.*;
[ "com.sun.electric" ]
com.sun.electric;
1,411,987
public void removeSourceFolderFromIndex(JavaProject javaProject, IPath sourceFolder, char[][] inclusionPatterns, char[][] exclusionPatterns) { IProject project = javaProject.getProject(); if (this.jobEnd > this.jobStart) { // skip it if a job to index the project is already in the queue IndexRequest request = new IndexAllProject(project, this); if (isJobWaiting(request)) return; } request(new RemoveFolderFromIndex(sourceFolder, inclusionPatterns, exclusionPatterns, project, this)); }
void function(JavaProject javaProject, IPath sourceFolder, char[][] inclusionPatterns, char[][] exclusionPatterns) { IProject project = javaProject.getProject(); if (this.jobEnd > this.jobStart) { IndexRequest request = new IndexAllProject(project, this); if (isJobWaiting(request)) return; } request(new RemoveFolderFromIndex(sourceFolder, inclusionPatterns, exclusionPatterns, project, this)); }
/** * Remove the content of the given source folder from the index. */
Remove the content of the given source folder from the index
removeSourceFolderFromIndex
{ "repo_name": "alexVengrovsk/che", "path": "plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/core/search/indexing/IndexManager.java", "license": "epl-1.0", "size": 60067 }
[ "org.eclipse.core.resources.IProject", "org.eclipse.core.runtime.IPath", "org.eclipse.jdt.internal.core.JavaProject" ]
import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.IPath; import org.eclipse.jdt.internal.core.JavaProject;
import org.eclipse.core.resources.*; import org.eclipse.core.runtime.*; import org.eclipse.jdt.internal.core.*;
[ "org.eclipse.core", "org.eclipse.jdt" ]
org.eclipse.core; org.eclipse.jdt;
1,850,553
public void addLog(final byte iOperation, final int iTxId, final int iClusterId, final long iPosition, final int iDataId, final long iDataOffset, final int iRecordVersion) throws IOException { acquireExclusiveLock(); try { int offset = file.allocateSpace(RECORD_SIZE); file.writeByte(offset, STATUS_COMMITTING); offset += OConstants.SIZE_BYTE; file.writeByte(offset, iOperation); offset += OConstants.SIZE_BYTE; file.writeInt(offset, iTxId); offset += OConstants.SIZE_INT; file.writeShort(offset, (short) iClusterId); offset += OConstants.SIZE_SHORT; file.writeLong(offset, iPosition); offset += OConstants.SIZE_LONG; file.writeInt(offset, iDataId); offset += OConstants.SIZE_INT; file.writeLong(offset, iDataOffset); offset += OConstants.SIZE_LONG; file.writeInt(offset, iRecordVersion); synchRecord(); } finally { releaseExclusiveLock(); } }
void function(final byte iOperation, final int iTxId, final int iClusterId, final long iPosition, final int iDataId, final long iDataOffset, final int iRecordVersion) throws IOException { acquireExclusiveLock(); try { int offset = file.allocateSpace(RECORD_SIZE); file.writeByte(offset, STATUS_COMMITTING); offset += OConstants.SIZE_BYTE; file.writeByte(offset, iOperation); offset += OConstants.SIZE_BYTE; file.writeInt(offset, iTxId); offset += OConstants.SIZE_INT; file.writeShort(offset, (short) iClusterId); offset += OConstants.SIZE_SHORT; file.writeLong(offset, iPosition); offset += OConstants.SIZE_LONG; file.writeInt(offset, iDataId); offset += OConstants.SIZE_INT; file.writeLong(offset, iDataOffset); offset += OConstants.SIZE_LONG; file.writeInt(offset, iRecordVersion); synchRecord(); } finally { releaseExclusiveLock(); } }
/** * Append a log entry * * @param iReqId * The id of requester * @param iTxId * The id of transaction * * @throws IOException */
Append a log entry
addLog
{ "repo_name": "cloudsmith/orientdb", "path": "core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OTxSegment.java", "license": "apache-2.0", "size": 14413 }
[ "com.orientechnologies.orient.core.OConstants", "java.io.IOException" ]
import com.orientechnologies.orient.core.OConstants; import java.io.IOException;
import com.orientechnologies.orient.core.*; import java.io.*;
[ "com.orientechnologies.orient", "java.io" ]
com.orientechnologies.orient; java.io;
1,466,095
public JSONObject getConfigs() { return configsJson; }
JSONObject function() { return configsJson; }
/** * Returns the FRC configs. * * <p>The returned {@link JSONObject} must not be modified. */
Returns the FRC configs. The returned <code>JSONObject</code> must not be modified
getConfigs
{ "repo_name": "firebase/firebase-android-sdk", "path": "firebase-config/src/main/java/com/google/firebase/remoteconfig/internal/ConfigContainer.java", "license": "apache-2.0", "size": 7668 }
[ "org.json.JSONObject" ]
import org.json.JSONObject;
import org.json.*;
[ "org.json" ]
org.json;
983,830
public Collection getSubExprs() { return Collections.singletonList(sent); }
Collection function() { return Collections.singletonList(sent); }
/** * Returns a singleton collection containing the term in this atomic formula. */
Returns a singleton collection containing the term in this atomic formula
getSubExprs
{ "repo_name": "BayesianLogic/blog", "path": "src/main/java/blog/model/AtomicFormula.java", "license": "bsd-3-clause", "size": 5685 }
[ "java.util.Collection", "java.util.Collections" ]
import java.util.Collection; import java.util.Collections;
import java.util.*;
[ "java.util" ]
java.util;
1,285,318
public static JobId testJobSubmission(SchedulerTHelper schedulerHelper, Job jobToSubmit, List<String> skip) throws Exception { JobId id = schedulerHelper.submitJob(jobToSubmit); log("Job submitted, id " + id.toString()); log("Waiting for jobSubmitted"); JobState receivedstate = schedulerHelper.waitForEventJobSubmitted(id); Assert.assertEquals(id, receivedstate.getId()); log("Waiting for job running"); JobInfo jInfo = schedulerHelper.waitForEventJobRunning(id); Assert.assertEquals(jInfo.getJobId(), id); Assert.assertEquals(JobStatus.RUNNING, jInfo.getStatus()); if (jobToSubmit instanceof TaskFlowJob) { for (Task t : ((TaskFlowJob) jobToSubmit).getTasks()) { if (skip != null && skip.contains(t.getName())) { continue; } TaskInfo ti = schedulerHelper.waitForEventTaskRunning(id, t.getName()); Assert.assertEquals(t.getName(), ti.getTaskId().getReadableName()); Assert.assertEquals(TaskStatus.RUNNING, ti.getStatus()); } for (Task t : ((TaskFlowJob) jobToSubmit).getTasks()) { if (skip != null && skip.contains(t.getName())) { continue; } TaskInfo ti = schedulerHelper.waitForEventTaskFinished(id, t.getName()); Assert.assertEquals(t.getName(), ti.getTaskId().getReadableName()); Assert.assertTrue(TaskStatus.FINISHED.equals(ti.getStatus())); } } log("Waiting for job finished"); jInfo = schedulerHelper.waitForEventJobFinished(id); Assert.assertEquals(JobStatus.FINISHED, jInfo.getStatus()); log("Job finished"); return id; }
static JobId function(SchedulerTHelper schedulerHelper, Job jobToSubmit, List<String> skip) throws Exception { JobId id = schedulerHelper.submitJob(jobToSubmit); log(STR + id.toString()); log(STR); JobState receivedstate = schedulerHelper.waitForEventJobSubmitted(id); Assert.assertEquals(id, receivedstate.getId()); log(STR); JobInfo jInfo = schedulerHelper.waitForEventJobRunning(id); Assert.assertEquals(jInfo.getJobId(), id); Assert.assertEquals(JobStatus.RUNNING, jInfo.getStatus()); if (jobToSubmit instanceof TaskFlowJob) { for (Task t : ((TaskFlowJob) jobToSubmit).getTasks()) { if (skip != null && skip.contains(t.getName())) { continue; } TaskInfo ti = schedulerHelper.waitForEventTaskRunning(id, t.getName()); Assert.assertEquals(t.getName(), ti.getTaskId().getReadableName()); Assert.assertEquals(TaskStatus.RUNNING, ti.getStatus()); } for (Task t : ((TaskFlowJob) jobToSubmit).getTasks()) { if (skip != null && skip.contains(t.getName())) { continue; } TaskInfo ti = schedulerHelper.waitForEventTaskFinished(id, t.getName()); Assert.assertEquals(t.getName(), ti.getTaskId().getReadableName()); Assert.assertTrue(TaskStatus.FINISHED.equals(ti.getStatus())); } } log(STR); jInfo = schedulerHelper.waitForEventJobFinished(id); Assert.assertEquals(JobStatus.FINISHED, jInfo.getStatus()); log(STR); return id; }
/** * See @{link {@link SchedulerTHelper#testJobSubmission(Job)}; does about the same, * but skips the part that expects the initial submitted task set to be identical to * the finished task set. * * @param jobToSubmit * @param skip tasks that will be skipped due to {@link FlowActionType#IF}, do not wait for their completion * @return * @throws Exception */
See @{link <code>SchedulerTHelper#testJobSubmission(Job)</code>; does about the same, but skips the part that expects the initial submitted task set to be identical to the finished task set
testJobSubmission
{ "repo_name": "sandrineBeauche/scheduling", "path": "scheduler/scheduler-server/src/test/java/functionaltests/workflow/TWorkflowJobs.java", "license": "agpl-3.0", "size": 13188 }
[ "java.util.List", "org.junit.Assert", "org.ow2.proactive.scheduler.common.job.Job", "org.ow2.proactive.scheduler.common.job.JobId", "org.ow2.proactive.scheduler.common.job.JobInfo", "org.ow2.proactive.scheduler.common.job.JobState", "org.ow2.proactive.scheduler.common.job.JobStatus", "org.ow2.proactive.scheduler.common.job.TaskFlowJob", "org.ow2.proactive.scheduler.common.task.Task", "org.ow2.proactive.scheduler.common.task.TaskInfo", "org.ow2.proactive.scheduler.common.task.TaskStatus" ]
import java.util.List; import org.junit.Assert; import org.ow2.proactive.scheduler.common.job.Job; import org.ow2.proactive.scheduler.common.job.JobId; import org.ow2.proactive.scheduler.common.job.JobInfo; import org.ow2.proactive.scheduler.common.job.JobState; import org.ow2.proactive.scheduler.common.job.JobStatus; import org.ow2.proactive.scheduler.common.job.TaskFlowJob; import org.ow2.proactive.scheduler.common.task.Task; import org.ow2.proactive.scheduler.common.task.TaskInfo; import org.ow2.proactive.scheduler.common.task.TaskStatus;
import java.util.*; import org.junit.*; import org.ow2.proactive.scheduler.common.job.*; import org.ow2.proactive.scheduler.common.task.*;
[ "java.util", "org.junit", "org.ow2.proactive" ]
java.util; org.junit; org.ow2.proactive;
147,115
public PivotingStrategyInterface getPivotingStrategy() { return kthSelector.getPivotingStrategy(); }
PivotingStrategyInterface function() { return kthSelector.getPivotingStrategy(); }
/** * Get the {@link PivotingStrategyInterface} used in KthSelector for computation. * @return the pivoting strategy set */
Get the <code>PivotingStrategyInterface</code> used in KthSelector for computation
getPivotingStrategy
{ "repo_name": "happyjack27/autoredistrict", "path": "src/org/apache/commons/math3/stat/descriptive/rank/Percentile.java", "license": "gpl-3.0", "size": 45576 }
[ "org.apache.commons.math3.util.PivotingStrategyInterface" ]
import org.apache.commons.math3.util.PivotingStrategyInterface;
import org.apache.commons.math3.util.*;
[ "org.apache.commons" ]
org.apache.commons;
2,379
public ResultSet select ( Query sparqlSelect, QuerySolutionMap params ) { var qx = getQueryExecutor ( sparqlSelect, params ); return qx.execSelect (); }
ResultSet function ( Query sparqlSelect, QuerySolutionMap params ) { var qx = getQueryExecutor ( sparqlSelect, params ); return qx.execSelect (); }
/** * Just runs a SPARQL SELECT query against the current endpoint. */
Just runs a SPARQL SELECT query against the current endpoint
select
{ "repo_name": "marco-brandizi/rdfutils", "path": "rdfutils-jena/src/main/java/info/marcobrandizi/rdfutils/jena/SparqlEndPointHelper.java", "license": "lgpl-3.0", "size": 9768 }
[ "org.apache.jena.query.Query", "org.apache.jena.query.QuerySolutionMap", "org.apache.jena.query.ResultSet" ]
import org.apache.jena.query.Query; import org.apache.jena.query.QuerySolutionMap; import org.apache.jena.query.ResultSet;
import org.apache.jena.query.*;
[ "org.apache.jena" ]
org.apache.jena;
722,536
public void displayPopUp(MouseEvent e, JPopupMenu popup) { displayPopUp((Component) e.getSource(), e, popup); }
void function(MouseEvent e, JPopupMenu popup) { displayPopUp((Component) e.getSource(), e, popup); }
/** * Display the specified popup menu with the source component and location * from the specified mouse event. * * @param e * the mouse event causing this popup to be displayed * @param popup * the popup menu to display */
Display the specified popup menu with the source component and location from the specified mouse event
displayPopUp
{ "repo_name": "max3163/jmeter", "path": "src/core/org/apache/jmeter/gui/GuiPackage.java", "license": "apache-2.0", "size": 32883 }
[ "java.awt.Component", "java.awt.event.MouseEvent", "javax.swing.JPopupMenu" ]
import java.awt.Component; import java.awt.event.MouseEvent; import javax.swing.JPopupMenu;
import java.awt.*; import java.awt.event.*; import javax.swing.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
2,194,687
public X509Certificate[] getCertificateChain(String s) { return original.getCertificateChain(s); }
X509Certificate[] function(String s) { return original.getCertificateChain(s); }
/** * Falls back to the original KeyManager. * * @param s * @return */
Falls back to the original KeyManager
getCertificateChain
{ "repo_name": "scholzj/AliasKeyManager", "path": "src/main/java/cz/scholz/aliaskeymanager/AliasKeyManager.java", "license": "apache-2.0", "size": 3389 }
[ "java.security.cert.X509Certificate" ]
import java.security.cert.X509Certificate;
import java.security.cert.*;
[ "java.security" ]
java.security;
2,311,633
public Path getShortestPath(SQLTable src, SQLTable dest) { return Path.create(src, DijkstraShortestPath.findPathBetween(this.getGraph(), src, dest)); }
Path function(SQLTable src, SQLTable dest) { return Path.create(src, DijkstraShortestPath.findPathBetween(this.getGraph(), src, dest)); }
/** * Renvoie le plus court chemin entre 2 tables. * * @param src la table de départ. * @param dest la table d'arrivée. * @return un Path du départ à l'arrivée. */
Renvoie le plus court chemin entre 2 tables
getShortestPath
{ "repo_name": "eric-lemesre/OpenConcerto", "path": "OpenConcerto/src/org/openconcerto/sql/model/graph/GraFFF.java", "license": "gpl-3.0", "size": 5194 }
[ "org.jgrapht.alg.DijkstraShortestPath", "org.openconcerto.sql.model.SQLTable" ]
import org.jgrapht.alg.DijkstraShortestPath; import org.openconcerto.sql.model.SQLTable;
import org.jgrapht.alg.*; import org.openconcerto.sql.model.*;
[ "org.jgrapht.alg", "org.openconcerto.sql" ]
org.jgrapht.alg; org.openconcerto.sql;
1,275,801
public MultiOutput<InputT, OutputT> withOutputTags( TupleTag<OutputT> mainOutputTag, TupleTagList additionalOutputTags) { return new MultiOutput<>(fn, sideInputs, mainOutputTag, additionalOutputTags, fnDisplayData); }
MultiOutput<InputT, OutputT> function( TupleTag<OutputT> mainOutputTag, TupleTagList additionalOutputTags) { return new MultiOutput<>(fn, sideInputs, mainOutputTag, additionalOutputTags, fnDisplayData); }
/** * Returns a new multi-output {@link ParDo} {@link PTransform} that's like this {@link * PTransform} but with the specified output tags. Does not modify this {@link * PTransform}. * * <p>See the discussion of Additional Outputs above for more explanation. */
Returns a new multi-output <code>ParDo</code> <code>PTransform</code> that's like this <code>PTransform</code> but with the specified output tags. Does not modify this <code>PTransform</code>. See the discussion of Additional Outputs above for more explanation
withOutputTags
{ "repo_name": "staslev/beam", "path": "sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/ParDo.java", "license": "apache-2.0", "size": 36819 }
[ "org.apache.beam.sdk.values.TupleTag", "org.apache.beam.sdk.values.TupleTagList" ]
import org.apache.beam.sdk.values.TupleTag; import org.apache.beam.sdk.values.TupleTagList;
import org.apache.beam.sdk.values.*;
[ "org.apache.beam" ]
org.apache.beam;
676,970
public String getTerminologyId(LanguageRefSetMember member) throws Exception;
String function(LanguageRefSetMember member) throws Exception;
/** * Returns the terminology id. * * @param member the member * @return the string * @throws Exception the exception */
Returns the terminology id
getTerminologyId
{ "repo_name": "WestCoastInformatics/SNOMED-Terminology-Server", "path": "services/src/main/java/org/ihtsdo/otf/ts/services/handlers/IdentifierAssignmentHandler.java", "license": "apache-2.0", "size": 4900 }
[ "org.ihtsdo.otf.ts.rf2.LanguageRefSetMember" ]
import org.ihtsdo.otf.ts.rf2.LanguageRefSetMember;
import org.ihtsdo.otf.ts.rf2.*;
[ "org.ihtsdo.otf" ]
org.ihtsdo.otf;
1,794,602
@Override public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); } return itemPropertyDescriptors; }
List<IItemPropertyDescriptor> function(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); } return itemPropertyDescriptors; }
/** * This returns the property descriptors for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This returns the property descriptors for the adapted class.
getPropertyDescriptors
{ "repo_name": "markus1978/citygml4emf", "path": "de.hub.citygml.emf.ecore.edit/src/net/opengis/gml/provider/MultiGeometryTypeItemProvider.java", "license": "apache-2.0", "size": 6793 }
[ "java.util.List", "org.eclipse.emf.edit.provider.IItemPropertyDescriptor" ]
import java.util.List; import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import java.util.*; import org.eclipse.emf.edit.provider.*;
[ "java.util", "org.eclipse.emf" ]
java.util; org.eclipse.emf;
749,585
public List modifiers() { // more efficient than just calling unsupportedIn2() to check if (this.modifiers == null) { unsupportedIn2(); } return this.modifiers; }
List function() { if (this.modifiers == null) { unsupportedIn2(); } return this.modifiers; }
/** * Returns the live ordered list of modifiers and annotations * of this declaration (added in JLS3 API). * <p> * Note that the final modifier is the only meaningful modifier for local * variable declarations. * </p> * * @return the live list of modifiers and annotations * (element type: {@link IExtendedModifier}) * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @since 3.1 */
Returns the live ordered list of modifiers and annotations of this declaration (added in JLS3 API). Note that the final modifier is the only meaningful modifier for local variable declarations.
modifiers
{ "repo_name": "Niky4000/UsefulUtils", "path": "projects/others/eclipse-platform-parent/eclipse.jdt.core-master/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableDeclarationExpression.java", "license": "gpl-3.0", "size": 12839 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,406,084
private void registerListeners() { try { for (ClassPath.ClassInfo classInfo : ClassPath.from(this.getClassLoader()).getTopLevelClasses(this.getClass().getPackage().getName() + ".listeners")) { Class clazz = Class.forName(classInfo.getName()); if (Listener.class.isAssignableFrom(clazz)) { getServer().getPluginManager().registerEvents((Listener) clazz.newInstance(), this); } } for (ClassPath.ClassInfo classInfo : ClassPath.from(this.getClassLoader()).getTopLevelClasses(this.getClass().getPackage().getName() + ".listeners.blocked")) { Class clazz = Class.forName(classInfo.getName()); if (Listener.class.isAssignableFrom(clazz)) { getServer().getPluginManager().registerEvents((Listener) clazz.newInstance(), this); } } } catch (IOException | ClassNotFoundException | InstantiationException | IllegalAccessException e) { this.getLogger().log(Level.SEVERE, null, e); } }
void function() { try { for (ClassPath.ClassInfo classInfo : ClassPath.from(this.getClassLoader()).getTopLevelClasses(this.getClass().getPackage().getName() + STR)) { Class clazz = Class.forName(classInfo.getName()); if (Listener.class.isAssignableFrom(clazz)) { getServer().getPluginManager().registerEvents((Listener) clazz.newInstance(), this); } } for (ClassPath.ClassInfo classInfo : ClassPath.from(this.getClassLoader()).getTopLevelClasses(this.getClass().getPackage().getName() + STR)) { Class clazz = Class.forName(classInfo.getName()); if (Listener.class.isAssignableFrom(clazz)) { getServer().getPluginManager().registerEvents((Listener) clazz.newInstance(), this); } } } catch (IOException ClassNotFoundException InstantiationException IllegalAccessException e) { this.getLogger().log(Level.SEVERE, null, e); } }
/*** * Register all listeners */
Register all listeners
registerListeners
{ "repo_name": "ZargorNET/RegisterP", "path": "src/main/java/de/zargornet/registerp/RegisterP.java", "license": "gpl-3.0", "size": 5495 }
[ "com.google.common.reflect.ClassPath", "java.io.IOException", "java.util.logging.Level", "org.bukkit.event.Listener" ]
import com.google.common.reflect.ClassPath; import java.io.IOException; import java.util.logging.Level; import org.bukkit.event.Listener;
import com.google.common.reflect.*; import java.io.*; import java.util.logging.*; import org.bukkit.event.*;
[ "com.google.common", "java.io", "java.util", "org.bukkit.event" ]
com.google.common; java.io; java.util; org.bukkit.event;
2,411,680
boolean isValid = true; String appdUsername = getPropertyOrEnv("com.signalfx.appd.username", "APPD_USERNAME"); if (StringUtils.isEmpty(appdUsername)) { log.error("AppDynamics username not specified."); isValid = false; } String appdPassword = getPropertyOrEnv("com.signalfx.appd.password", "APPD_PASSWORD"); if (StringUtils.isEmpty(appdPassword)) { log.error("AppDynamics password not specified."); isValid = false; } String appdURL = getPropertyOrEnv("com.signalfx.appd.host", "APPD_HOST"); if (StringUtils.isEmpty(appdURL)) { log.error("AppDynamics host not specified."); isValid = false; } String fxToken = getPropertyOrEnv("com.signalfx.api.token", "SIGNALFX_TOKEN"); if (StringUtils.isEmpty(fxToken)) { log.error("SignalFx token not specified."); isValid = false; } if (isValid) { return new ConnectionConfig(appdUsername, appdPassword, appdURL, fxToken); } else { return null; } }
boolean isValid = true; String appdUsername = getPropertyOrEnv(STR, STR); if (StringUtils.isEmpty(appdUsername)) { log.error(STR); isValid = false; } String appdPassword = getPropertyOrEnv(STR, STR); if (StringUtils.isEmpty(appdPassword)) { log.error(STR); isValid = false; } String appdURL = getPropertyOrEnv(STR, STR); if (StringUtils.isEmpty(appdURL)) { log.error(STR); isValid = false; } String fxToken = getPropertyOrEnv(STR, STR); if (StringUtils.isEmpty(fxToken)) { log.error(STR); isValid = false; } if (isValid) { return new ConnectionConfig(appdUsername, appdPassword, appdURL, fxToken); } else { return null; } }
/** * Retrieve configurations by looking up in property param first then environment variable. * * @return ConnectionConfig containing AppDynamics URL, Username,Password and SignalFx Token. */
Retrieve configurations by looking up in property param first then environment variable
getConnectionConfig
{ "repo_name": "signalfx/appd-integration", "path": "appd-report-standalone/src/main/java/com/signalfx/appd/report/config/Config.java", "license": "apache-2.0", "size": 4135 }
[ "org.apache.commons.lang3.StringUtils" ]
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.*;
[ "org.apache.commons" ]
org.apache.commons;
2,325,970
public void setTcpNoDelay(boolean on) throws SocketException { _socket_.setTcpNoDelay(on); }
void function(boolean on) throws SocketException { _socket_.setTcpNoDelay(on); }
/** * Enables or disables the Nagle's algorithm (TCP_NODELAY) on the * currently opened socket. * <p> * @param on True if Nagle's algorithm is to be enabled, false if not. * @exception SocketException If the operation fails. * @throws NullPointerException if the socket is not currently open */
Enables or disables the Nagle's algorithm (TCP_NODELAY) on the currently opened socket.
setTcpNoDelay
{ "repo_name": "codolutions/commons-net", "path": "src/main/java/org/apache/commons/net/SocketClient.java", "license": "apache-2.0", "size": 29595 }
[ "java.net.SocketException" ]
import java.net.SocketException;
import java.net.*;
[ "java.net" ]
java.net;
1,204,943
Assert.notNull(payload, "payload object cannot be null."); if (payload instanceof byte[]) { return MimeTypeUtils.APPLICATION_OCTET_STREAM; } if (payload instanceof String) { return MimeTypeUtils.APPLICATION_JSON_VALUE.equals(originalContentType) ? MimeTypeUtils.APPLICATION_JSON : MimeTypeUtils.TEXT_PLAIN; } String className = payload.getClass().getName(); MimeType mimeType = mimeTypesCache.get(className); if (mimeType == null) { String modifiedClassName = className; if (payload.getClass().isArray()) { // Need to remove trailing ';' for an object array, e.g. // "[Ljava.lang.String;" or multi-dimensional // "[[[Ljava.lang.String;" if (modifiedClassName.endsWith(";")) { modifiedClassName = modifiedClassName.substring(0, modifiedClassName.length() - 1); } // Wrap in quotes to handle the illegal '[' character modifiedClassName = "\"" + modifiedClassName + "\""; } mimeType = MimeType.valueOf("application/x-java-object;type=" + modifiedClassName); mimeTypesCache.put(className, mimeType); } return mimeType; }
Assert.notNull(payload, STR); if (payload instanceof byte[]) { return MimeTypeUtils.APPLICATION_OCTET_STREAM; } if (payload instanceof String) { return MimeTypeUtils.APPLICATION_JSON_VALUE.equals(originalContentType) ? MimeTypeUtils.APPLICATION_JSON : MimeTypeUtils.TEXT_PLAIN; } String className = payload.getClass().getName(); MimeType mimeType = mimeTypesCache.get(className); if (mimeType == null) { String modifiedClassName = className; if (payload.getClass().isArray()) { if (modifiedClassName.endsWith(";")) { modifiedClassName = modifiedClassName.substring(0, modifiedClassName.length() - 1); } modifiedClassName = "\"STR\STRapplication/x-java-object;type=" + modifiedClassName); mimeTypesCache.put(className, mimeType); } return mimeType; }
/** * Convert payload to {@link MimeType} based on the content type on the message. * * @param payload the payload to convert * @param originalContentType content type on the message * @return converted {@link MimeType} */
Convert payload to <code>MimeType</code> based on the content type on the message
mimeTypeFromObject
{ "repo_name": "garyrussell/spring-cloud-stream", "path": "spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/JavaClassMimeTypeUtils.java", "license": "apache-2.0", "size": 3268 }
[ "org.springframework.util.Assert", "org.springframework.util.MimeType", "org.springframework.util.MimeTypeUtils" ]
import org.springframework.util.Assert; import org.springframework.util.MimeType; import org.springframework.util.MimeTypeUtils;
import org.springframework.util.*;
[ "org.springframework.util" ]
org.springframework.util;
1,326,853
@Metadata(label = "security", secret = true) public void setOauthClientId(String oauthClientId) { configuration.setOauthClientId(oauthClientId); }
@Metadata(label = STR, secret = true) void function(String oauthClientId) { configuration.setOauthClientId(oauthClientId); }
/** * OAuth2 ClientID */
OAuth2 ClientID
setOauthClientId
{ "repo_name": "kevinearls/camel", "path": "components/camel-servicenow/camel-servicenow-component/src/main/java/org/apache/camel/component/servicenow/ServiceNowComponent.java", "license": "apache-2.0", "size": 8815 }
[ "org.apache.camel.spi.Metadata" ]
import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.*;
[ "org.apache.camel" ]
org.apache.camel;
33,761
public static Map<String, Object> getPartyFromPartyGroup(DispatchContext dctx, Map<String, ? extends Object> context) { Map<String, Object> result = new HashMap<String, Object>(); Delegator delegator = dctx.getDelegator(); Collection<Map<String, GenericValue>> parties = new LinkedList<Map<String,GenericValue>>(); String groupName = (String) context.get("groupName"); Locale locale = (Locale) context.get("locale"); if (groupName.length() == 0) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "PartyCannotGetPartyFromPartyGroup", locale)); } try { Collection<GenericValue> pc = EntityQuery.use(delegator).from("PartyGroup") .where(EntityCondition.makeCondition(EntityFunction.UPPER_FIELD("groupName"), EntityOperator.LIKE, EntityFunction.UPPER("%" + groupName.toUpperCase() + "%"))) .orderBy("groupName", "partyId") .queryList(); if (Debug.infoOn()) Debug.logInfo("PartyFromGroup number found: " + pc.size(), module); if (pc != null) { for (GenericValue group: pc) { GenericValue party = delegator.makeValue("Party", UtilMisc.toMap("partyId", group.get("partyId"), "partyTypeId", "PARTY_GROUP")); parties.add(UtilMisc.<String, GenericValue>toMap("partyGroup", group, "party", party)); } } } catch (GenericEntityException e) { return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, "partyservices.cannot_get_party_entities_read", UtilMisc.toMap("errMessage", e.getMessage()), locale)); } if (parties.size() > 0) { result.put("parties", parties); } return result; }
static Map<String, Object> function(DispatchContext dctx, Map<String, ? extends Object> context) { Map<String, Object> result = new HashMap<String, Object>(); Delegator delegator = dctx.getDelegator(); Collection<Map<String, GenericValue>> parties = new LinkedList<Map<String,GenericValue>>(); String groupName = (String) context.get(STR); Locale locale = (Locale) context.get(STR); if (groupName.length() == 0) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, STR, locale)); } try { Collection<GenericValue> pc = EntityQuery.use(delegator).from(STR) .where(EntityCondition.makeCondition(EntityFunction.UPPER_FIELD(STR), EntityOperator.LIKE, EntityFunction.UPPER("%" + groupName.toUpperCase() + "%"))) .orderBy(STR, STR) .queryList(); if (Debug.infoOn()) Debug.logInfo(STR + pc.size(), module); if (pc != null) { for (GenericValue group: pc) { GenericValue party = delegator.makeValue("Party", UtilMisc.toMap(STR, group.get(STR), STR, STR)); parties.add(UtilMisc.<String, GenericValue>toMap(STR, group, "party", party)); } } } catch (GenericEntityException e) { return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, STR, UtilMisc.toMap(STR, e.getMessage()), locale)); } if (parties.size() > 0) { result.put(STR, parties); } return result; }
/** * Get the party object(s) from party group name. * @param dctx The DispatchContext that this service is operating in. * @param context Map containing the input parameters. * @return Map with the result of the service, the output parameters. */
Get the party object(s) from party group name
getPartyFromPartyGroup
{ "repo_name": "yuri0x7c1/ofbiz-explorer", "path": "src/test/resources/apache-ofbiz-16.11.03/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyServices.java", "license": "apache-2.0", "size": 134976 }
[ "java.util.Collection", "java.util.HashMap", "java.util.LinkedList", "java.util.Locale", "java.util.Map", "org.apache.ofbiz.base.util.Debug", "org.apache.ofbiz.base.util.UtilMisc", "org.apache.ofbiz.base.util.UtilProperties", "org.apache.ofbiz.entity.Delegator", "org.apache.ofbiz.entity.GenericEntityException", "org.apache.ofbiz.entity.GenericValue", "org.apache.ofbiz.entity.condition.EntityCondition", "org.apache.ofbiz.entity.condition.EntityFunction", "org.apache.ofbiz.entity.condition.EntityOperator", "org.apache.ofbiz.entity.util.EntityQuery", "org.apache.ofbiz.service.DispatchContext", "org.apache.ofbiz.service.ServiceUtil" ]
import java.util.Collection; import java.util.HashMap; import java.util.LinkedList; import java.util.Locale; import java.util.Map; import org.apache.ofbiz.base.util.Debug; import org.apache.ofbiz.base.util.UtilMisc; import org.apache.ofbiz.base.util.UtilProperties; import org.apache.ofbiz.entity.Delegator; import org.apache.ofbiz.entity.GenericEntityException; import org.apache.ofbiz.entity.GenericValue; import org.apache.ofbiz.entity.condition.EntityCondition; import org.apache.ofbiz.entity.condition.EntityFunction; import org.apache.ofbiz.entity.condition.EntityOperator; import org.apache.ofbiz.entity.util.EntityQuery; import org.apache.ofbiz.service.DispatchContext; import org.apache.ofbiz.service.ServiceUtil;
import java.util.*; import org.apache.ofbiz.base.util.*; import org.apache.ofbiz.entity.*; import org.apache.ofbiz.entity.condition.*; import org.apache.ofbiz.entity.util.*; import org.apache.ofbiz.service.*;
[ "java.util", "org.apache.ofbiz" ]
java.util; org.apache.ofbiz;
703,242
public Metric getMetric() { return metric; }
Metric function() { return metric; }
/** * Gets metric definition * * @return metric definition */
Gets metric definition
getMetric
{ "repo_name": "turn/camino", "path": "src/main/java/com/turn/camino/MetricDatum.java", "license": "apache-2.0", "size": 1724 }
[ "com.turn.camino.config.Metric" ]
import com.turn.camino.config.Metric;
import com.turn.camino.config.*;
[ "com.turn.camino" ]
com.turn.camino;
1,500,818
public IntegrationRuntimeSsisCatalogInfo withAdditionalProperties(Map<String, Object> additionalProperties) { this.additionalProperties = additionalProperties; return this; }
IntegrationRuntimeSsisCatalogInfo function(Map<String, Object> additionalProperties) { this.additionalProperties = additionalProperties; return this; }
/** * Set the additionalProperties property: Catalog information for managed dedicated integration runtime. * * @param additionalProperties the additionalProperties value to set. * @return the IntegrationRuntimeSsisCatalogInfo object itself. */
Set the additionalProperties property: Catalog information for managed dedicated integration runtime
withAdditionalProperties
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/IntegrationRuntimeSsisCatalogInfo.java", "license": "mit", "size": 7157 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,998,389
public void setSurface(Surface sur) { mRS.validate(); if ((mUsage & USAGE_IO_OUTPUT) == 0) { throw new RSInvalidStateException("Allocation is not USAGE_IO_OUTPUT."); } mRS.nAllocationSetSurface(getID(mRS), sur); }
void function(Surface sur) { mRS.validate(); if ((mUsage & USAGE_IO_OUTPUT) == 0) { throw new RSInvalidStateException(STR); } mRS.nAllocationSetSurface(getID(mRS), sur); }
/** * Associate a {@link android.view.Surface} with this Allocation. This * operation is only valid for Allocations with {@link #USAGE_IO_OUTPUT}. * * @param sur Surface to associate with allocation */
Associate a <code>android.view.Surface</code> with this Allocation. This operation is only valid for Allocations with <code>#USAGE_IO_OUTPUT</code>
setSurface
{ "repo_name": "xorware/android_frameworks_base", "path": "rs/java/android/renderscript/Allocation.java", "license": "apache-2.0", "size": 146811 }
[ "android.view.Surface" ]
import android.view.Surface;
import android.view.*;
[ "android.view" ]
android.view;
2,271,931
public void setReasonCode(String reasonCode) throws ParseException;
void function(String reasonCode) throws ParseException;
/** * Sets the reason code value of the SubscriptionStateHeader. * * @param reasonCode - the new reason code string value of the SubscriptionStateHeader. * @throws ParseException which signals that an error has been reached * unexpectedly while parsing the reason code. */
Sets the reason code value of the SubscriptionStateHeader
setReasonCode
{ "repo_name": "fhg-fokus-nubomedia/signaling-plane", "path": "modules/lib-sip/src/main/java/javax/sip/header/SubscriptionStateHeader.java", "license": "apache-2.0", "size": 8432 }
[ "java.text.ParseException" ]
import java.text.ParseException;
import java.text.*;
[ "java.text" ]
java.text;
24,456
public Map<String, MapServerConnection> getSavedConnections(); /** * Returns the {@link GraphService} for a given {@link Connection}. * * @param connectionName name of the {@link Connection} * @return the {@link GraphService} for a given {@link Connection}
Map<String, MapServerConnection> function(); /** * Returns the {@link GraphService} for a given {@link Connection}. * * @param connectionName name of the {@link Connection} * @return the {@link GraphService} for a given {@link Connection}
/** * Returns all saved connections as a String {@link Map}. * * @return a Map<String, MapServerConnection> with all saved subscriptions. */
Returns all saved connections as a String <code>Map</code>
getSavedConnections
{ "repo_name": "MReichenbach/visitmeta", "path": "common/src/main/java/de/hshannover/f4/trust/visitmeta/interfaces/ifmap/ConnectionManager.java", "license": "apache-2.0", "size": 7920 }
[ "de.hshannover.f4.trust.visitmeta.interfaces.GraphService", "de.hshannover.f4.trust.visitmeta.interfaces.connections.MapServerConnection", "java.util.Map" ]
import de.hshannover.f4.trust.visitmeta.interfaces.GraphService; import de.hshannover.f4.trust.visitmeta.interfaces.connections.MapServerConnection; import java.util.Map;
import de.hshannover.f4.trust.visitmeta.interfaces.*; import de.hshannover.f4.trust.visitmeta.interfaces.connections.*; import java.util.*;
[ "de.hshannover.f4", "java.util" ]
de.hshannover.f4; java.util;
1,135,001
BSMedia setMediaBody(Div mediaBody);
BSMedia setMediaBody(Div mediaBody);
/** * Sets the media body and adds it to this object * * @param mediaBody * * @return */
Sets the media body and adds it to this object
setMediaBody
{ "repo_name": "GedMarc/JWebSwing-BootstrapPlugin", "path": "src/main/java/com/jwebmp/plugins/bootstrap/media/IBSMedia.java", "license": "gpl-3.0", "size": 2065 }
[ "com.jwebmp.core.base.html.Div" ]
import com.jwebmp.core.base.html.Div;
import com.jwebmp.core.base.html.*;
[ "com.jwebmp.core" ]
com.jwebmp.core;
418,799
this.orderBook = map; for (Map.Entry<Integer, Book> elements : this.orderBook.entrySet()) { Book book = elements.getValue(); if (FOR_BUY.equals(book.getOperation()) && BOOK_FOR_ORDERS_ONE.equals(book.getBook())) { Book book1 = this.book; this.buyBook.put(book.getPrice(), book); if (book1 != null) { int volume = book1.getVolume(); int finalVolume = this.buyBook.get(book.getPrice()).getVolume() + volume; this.buyBook.get(book.getPrice()).setVolume(finalVolume); } } if (FOR_SELL.equals(book.getOperation()) && BOOK_FOR_ORDERS_ONE.equals(book.getBook())) { Book book1 = this.book; this.sellBook.put(book.getPrice(), book); if (book1 != null) { int volume = book1.getVolume(); int finalVolume = this.sellBook.get(book.getPrice()).getVolume() + volume; this.sellBook.get(book.getPrice()).setVolume(finalVolume); } } } }
this.orderBook = map; for (Map.Entry<Integer, Book> elements : this.orderBook.entrySet()) { Book book = elements.getValue(); if (FOR_BUY.equals(book.getOperation()) && BOOK_FOR_ORDERS_ONE.equals(book.getBook())) { Book book1 = this.book; this.buyBook.put(book.getPrice(), book); if (book1 != null) { int volume = book1.getVolume(); int finalVolume = this.buyBook.get(book.getPrice()).getVolume() + volume; this.buyBook.get(book.getPrice()).setVolume(finalVolume); } } if (FOR_SELL.equals(book.getOperation()) && BOOK_FOR_ORDERS_ONE.equals(book.getBook())) { Book book1 = this.book; this.sellBook.put(book.getPrice(), book); if (book1 != null) { int volume = book1.getVolume(); int finalVolume = this.sellBook.get(book.getPrice()).getVolume() + volume; this.sellBook.get(book.getPrice()).setVolume(finalVolume); } } } }
/** * The method add element in map. * @param map - map. */
The method add element in map
addElementsInMap
{ "repo_name": "1Evgeny/java-a-to-z", "path": "chapter_005_Pro/src/main/java/by/vorokhobko/controlq/Model/BookOrders.java", "license": "apache-2.0", "size": 2513 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,583,966
// authenticate the viewer user authToken = securityService.authenticate(adminUser, adminPassword).getAuthToken(); // ensure there is a concept associated with the project ProjectList projects = projectService.findProjects(null, null, authToken); assertTrue(projects.size() > 0); project = projects.getObjects().get(0); // verify terminology and branch are expected values assertTrue(project.getTerminology().equals(umlsTerminology)); // assertTrue(project.getBranch().equals(Branch.ROOT)); // Copy existing concept to avoid messing with actual database data. concept = new ConceptJpa(contentService.getConcept("C0000294", umlsTerminology, umlsVersion, null, authToken), false); concept.setId(null); concept.setWorkflowStatus(WorkflowStatus.READY_FOR_PUBLICATION); concept = (ConceptJpa) testService.addConcept(concept, authToken); }
authToken = securityService.authenticate(adminUser, adminPassword).getAuthToken(); ProjectList projects = projectService.findProjects(null, null, authToken); assertTrue(projects.size() > 0); project = projects.getObjects().get(0); assertTrue(project.getTerminology().equals(umlsTerminology)); concept = new ConceptJpa(contentService.getConcept(STR, umlsTerminology, umlsVersion, null, authToken), false); concept.setId(null); concept.setWorkflowStatus(WorkflowStatus.READY_FOR_PUBLICATION); concept = (ConceptJpa) testService.addConcept(concept, authToken); }
/** * Create test fixtures per test. * * @throws Exception the exception */
Create test fixtures per test
setup
{ "repo_name": "WestCoastInformatics/UMLS-Terminology-Server", "path": "integration-test/src/test/java/com/wci/umls/server/test/rest/MetaEditingServiceRestEdgeCasesTest.java", "license": "apache-2.0", "size": 6794 }
[ "com.wci.umls.server.helpers.ProjectList", "com.wci.umls.server.jpa.content.ConceptJpa", "com.wci.umls.server.model.workflow.WorkflowStatus", "org.junit.Assert" ]
import com.wci.umls.server.helpers.ProjectList; import com.wci.umls.server.jpa.content.ConceptJpa; import com.wci.umls.server.model.workflow.WorkflowStatus; import org.junit.Assert;
import com.wci.umls.server.helpers.*; import com.wci.umls.server.jpa.content.*; import com.wci.umls.server.model.workflow.*; import org.junit.*;
[ "com.wci.umls", "org.junit" ]
com.wci.umls; org.junit;
81,568
private static boolean isRedirectToCommonErrorPage(OAuth2Parameters params, String redirectURL) { // Verifying whether the error is redirecting to the redirect url by checking whether the constructed redirect // url contains the redirect url from the request if the params from request is not null and params from // request contains redirect url. return !(params != null && StringUtils.isNotBlank(params.getRedirectURI()) && StringUtils.startsWith(redirectURL, params.getRedirectURI())); }
static boolean function(OAuth2Parameters params, String redirectURL) { return !(params != null && StringUtils.isNotBlank(params.getRedirectURI()) && StringUtils.startsWith(redirectURL, params.getRedirectURI())); }
/** * Method to check whether the error is redirected to the common error page. * * @param params OAuth2Parameters * @param redirectURL Constructed redirect URL * @return Whether the error is redirected to the common error page (true or false) */
Method to check whether the error is redirected to the common error page
isRedirectToCommonErrorPage
{ "repo_name": "wso2-extensions/identity-inbound-auth-oauth", "path": "components/org.wso2.carbon.identity.oauth.endpoint/src/main/java/org/wso2/carbon/identity/oauth/endpoint/util/EndpointUtil.java", "license": "apache-2.0", "size": 70657 }
[ "org.apache.commons.lang.StringUtils", "org.wso2.carbon.identity.oauth2.model.OAuth2Parameters" ]
import org.apache.commons.lang.StringUtils; import org.wso2.carbon.identity.oauth2.model.OAuth2Parameters;
import org.apache.commons.lang.*; import org.wso2.carbon.identity.oauth2.model.*;
[ "org.apache.commons", "org.wso2.carbon" ]
org.apache.commons; org.wso2.carbon;
2,575,626
public static <T> RxListener<T> onValueOnTerminate(Consumer<T> onValue, Consumer<Optional<Throwable>> onTerminate) { return new RxListener<T>(onValue, onTerminate); }
static <T> RxListener<T> function(Consumer<T> onValue, Consumer<Optional<Throwable>> onTerminate) { return new RxListener<T>(onValue, onTerminate); }
/** * Creates an Rx instance which will call onValue whenever a value is received, * is received, and onTerminate when the future or observable completes, whether with an error or not. */
Creates an Rx instance which will call onValue whenever a value is received, is received, and onTerminate when the future or observable completes, whether with an error or not
onValueOnTerminate
{ "repo_name": "diffplug/durian-rx", "path": "src/main/java/com/diffplug/common/rx/Rx.java", "license": "apache-2.0", "size": 17321 }
[ "java.util.Optional", "java.util.function.Consumer" ]
import java.util.Optional; import java.util.function.Consumer;
import java.util.*; import java.util.function.*;
[ "java.util" ]
java.util;
2,658,498
public void updateScreen() { super.updateScreen(); GuiButton var2; if (--this.ticksUntilEnable == 0) { for (Iterator var1 = this.buttonList.iterator(); var1.hasNext(); var2.enabled = true) { var2 = (GuiButton) var1.next(); } } }
void function() { super.updateScreen(); GuiButton var2; if (--this.ticksUntilEnable == 0) { for (Iterator var1 = this.buttonList.iterator(); var1.hasNext(); var2.enabled = true) { var2 = (GuiButton) var1.next(); } } }
/** * Called from the main game loop to update the screen. */
Called from the main game loop to update the screen
updateScreen
{ "repo_name": "KubaKaszycki/FreeCraft", "path": "src/main/java/kk/freecraft/client/gui/GuiYesNo.java", "license": "gpl-3.0", "size": 3488 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
223,149
@SuppressWarnings("static-method") public boolean initializeConversions(Map<String, String> result, IExtraLanguageGeneratorContext context) { return false; } }
@SuppressWarnings(STR) boolean function(Map<String, String> result, IExtraLanguageGeneratorContext context) { return false; } }
/** initialize the conversions mapping. * * @param result the result. * @param context the generation context. * @return {@code true} if rules are read. */
initialize the conversions mapping
initializeConversions
{ "repo_name": "sarl/sarl", "path": "main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/compiler/ExtraLanguageTypeConverter.java", "license": "apache-2.0", "size": 5770 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,696,874
public List<T> queryForList(String query) { return queryForList(query, FIRST_COLUMN_MAPPER, null); }
List<T> function(String query) { return queryForList(query, FIRST_COLUMN_MAPPER, null); }
/** * EXPERIMENTAL: Runs the query, and returns a the single value in * each row. */
each row
queryForList
{ "repo_name": "ontopia/ontopia", "path": "ontopoly-editor/src/main/java/ontopoly/model/QueryMapper.java", "license": "apache-2.0", "size": 6853 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,066,151
public void writeAll() throws IOException { this.layoutVersion = getServiceLayoutVersion(); for (Iterator<StorageDirectory> it = storageDirs.iterator(); it.hasNext();) { writeProperties(it.next()); } }
void function() throws IOException { this.layoutVersion = getServiceLayoutVersion(); for (Iterator<StorageDirectory> it = storageDirs.iterator(); it.hasNext();) { writeProperties(it.next()); } }
/** * Write all data storage files. * @throws IOException */
Write all data storage files
writeAll
{ "repo_name": "messi49/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/Storage.java", "license": "apache-2.0", "size": 40355 }
[ "java.io.IOException", "java.util.Iterator" ]
import java.io.IOException; import java.util.Iterator;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,681,094
@Test(timeout=300000) public void test2772() throws Exception { LOG.info("START************ test2772"); HRegionServer rs = TEST_UTIL.getRSForFirstRegionInTable(TABLE_NAME); Scan scan = new Scan(); // Set a very high timeout, we want to test what happens when a RS // fails but the region is recovered before the lease times out. // Since the RS is already created, this conf is client-side only for // this new table Configuration conf = new Configuration(TEST_UTIL.getConfiguration()); conf.setInt(HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD, SCANNER_TIMEOUT * 100); Connection connection = ConnectionFactory.createConnection(conf); Table higherScanTimeoutTable = connection.getTable(TABLE_NAME); ResultScanner r = higherScanTimeoutTable.getScanner(scan); // This takes way less than SCANNER_TIMEOUT*100 rs.abort("die!"); Result[] results = r.next(NB_ROWS); assertEquals(NB_ROWS, results.length); r.close(); higherScanTimeoutTable.close(); connection.close(); LOG.info("END ************ test2772"); }
@Test(timeout=300000) void function() throws Exception { LOG.info(STR); HRegionServer rs = TEST_UTIL.getRSForFirstRegionInTable(TABLE_NAME); Scan scan = new Scan(); Configuration conf = new Configuration(TEST_UTIL.getConfiguration()); conf.setInt(HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD, SCANNER_TIMEOUT * 100); Connection connection = ConnectionFactory.createConnection(conf); Table higherScanTimeoutTable = connection.getTable(TABLE_NAME); ResultScanner r = higherScanTimeoutTable.getScanner(scan); rs.abort("die!"); Result[] results = r.next(NB_ROWS); assertEquals(NB_ROWS, results.length); r.close(); higherScanTimeoutTable.close(); connection.close(); LOG.info(STR); }
/** * Test that scanner can continue even if the region server it was reading * from failed. Before 2772, it reused the same scanner id. * @throws Exception */
Test that scanner can continue even if the region server it was reading from failed. Before 2772, it reused the same scanner id
test2772
{ "repo_name": "gustavoanatoly/hbase", "path": "hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannerTimeout.java", "license": "apache-2.0", "size": 7742 }
[ "org.apache.hadoop.conf.Configuration", "org.apache.hadoop.hbase.HConstants", "org.apache.hadoop.hbase.regionserver.HRegionServer", "org.junit.Assert", "org.junit.Test" ]
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.regionserver.HRegionServer; import org.junit.Assert; import org.junit.Test;
import org.apache.hadoop.conf.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.regionserver.*; import org.junit.*;
[ "org.apache.hadoop", "org.junit" ]
org.apache.hadoop; org.junit;
1,403,735
public Node getXblPreviousSibling(Node n) { Node p = getXblParentNode(n); if (p == null || getRecord(p).childNodes == null) { return n.getPreviousSibling(); } XBLRecord rec = getRecord(n); if (!rec.linksValid) { updateLinks(n); } return rec.previousSibling; }
Node function(Node n) { Node p = getXblParentNode(n); if (p == null getRecord(p).childNodes == null) { return n.getPreviousSibling(); } XBLRecord rec = getRecord(n); if (!rec.linksValid) { updateLinks(n); } return rec.previousSibling; }
/** * Get the node which directly precedes a node in the xblParentNode's * xblChildNodes list. */
Get the node which directly precedes a node in the xblParentNode's xblChildNodes list
getXblPreviousSibling
{ "repo_name": "git-moss/Push2Display", "path": "lib/batik-1.8/sources/org/apache/batik/bridge/svg12/DefaultXBLManager.java", "license": "lgpl-3.0", "size": 70498 }
[ "org.w3c.dom.Node" ]
import org.w3c.dom.Node;
import org.w3c.dom.*;
[ "org.w3c.dom" ]
org.w3c.dom;
2,830,311
@Test @WithJwtAuthenticationToken(roles = "ROLE_USER") void getProtected() throws Exception { mvc.perform(get("/protected")) .andExpect(status().isOk()) .andExpect(content().string("protected")); }
@WithJwtAuthenticationToken(roles = STR) void getProtected() throws Exception { mvc.perform(get(STR)) .andExpect(status().isOk()) .andExpect(content().string(STR)); }
/** * Gets protected. * * @throws Exception the exception */
Gets protected
getProtected
{ "repo_name": "bremersee/common", "path": "common-base-actuator-autoconfigure/src/test/java/org/bremersee/actuator/security/authentication/resourceserver/servlet/JwtTest.java", "license": "apache-2.0", "size": 5822 }
[ "org.bremersee.test.security.authentication.WithJwtAuthenticationToken" ]
import org.bremersee.test.security.authentication.WithJwtAuthenticationToken;
import org.bremersee.test.security.authentication.*;
[ "org.bremersee.test" ]
org.bremersee.test;
1,832,524
@ServiceMethod(returns = ReturnType.SINGLE) SubscriptionResourceInner createOrUpdate( String resourceGroupName, String namespaceName, String topicName, String subscriptionName, SubscriptionCreateOrUpdateParameters parameters);
@ServiceMethod(returns = ReturnType.SINGLE) SubscriptionResourceInner createOrUpdate( String resourceGroupName, String namespaceName, String topicName, String subscriptionName, SubscriptionCreateOrUpdateParameters parameters);
/** * Creates a topic subscription. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name. * @param topicName The topic name. * @param subscriptionName The subscription name. * @param parameters Parameters supplied to the Create Or Update Subscription operation. * @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 description of subscription resource. */
Creates a topic subscription
createOrUpdate
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-servicebus/src/main/java/com/azure/resourcemanager/servicebus/fluent/SubscriptionsClient.java", "license": "mit", "size": 14449 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.servicebus.fluent.models.SubscriptionResourceInner", "com.azure.resourcemanager.servicebus.models.SubscriptionCreateOrUpdateParameters" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.servicebus.fluent.models.SubscriptionResourceInner; import com.azure.resourcemanager.servicebus.models.SubscriptionCreateOrUpdateParameters;
import com.azure.core.annotation.*; import com.azure.resourcemanager.servicebus.fluent.models.*; import com.azure.resourcemanager.servicebus.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,561,117
Set<String> getDescriptionLanguageCodes();
Set<String> getDescriptionLanguageCodes();
/** * Get available description language codes */
Get available description language codes
getDescriptionLanguageCodes
{ "repo_name": "erwinwinder/molgenis", "path": "molgenis-data/src/main/java/org/molgenis/data/EntityMetaData.java", "license": "lgpl-3.0", "size": 4585 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
1,747,601
public long getMissingBlocksCount() throws IOException { return namenode.getStats()[ClientProtocol.GET_STATS_MISSING_BLOCKS_IDX]; }
long function() throws IOException { return namenode.getStats()[ClientProtocol.GET_STATS_MISSING_BLOCKS_IDX]; }
/** * Returns count of blocks with no good replicas left. Normally should be * zero. * @throws IOException */
Returns count of blocks with no good replicas left. Normally should be zero
getMissingBlocksCount
{ "repo_name": "cumulusyebl/cumulus", "path": "src/java/org/apache/hadoop/hdfs/DFSClient.java", "license": "apache-2.0", "size": 57376 }
[ "java.io.IOException", "org.apache.hadoop.hdfs.protocol.ClientProtocol" ]
import java.io.IOException; import org.apache.hadoop.hdfs.protocol.ClientProtocol;
import java.io.*; import org.apache.hadoop.hdfs.protocol.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
2,349,790
EClass getValueSetConstraint();
EClass getValueSetConstraint();
/** * Returns the meta object for class '{@link org.openhealthtools.mdht.uml.cda.core.profile.ValueSetConstraint <em>Value Set Constraint</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Value Set Constraint</em>'. * @see org.openhealthtools.mdht.uml.cda.core.profile.ValueSetConstraint * @generated */
Returns the meta object for class '<code>org.openhealthtools.mdht.uml.cda.core.profile.ValueSetConstraint Value Set Constraint</code>'.
getValueSetConstraint
{ "repo_name": "sarpkayanehta/mdht", "path": "cda/plugins/org.openhealthtools.mdht.uml.cda.core/src/org/openhealthtools/mdht/uml/cda/core/profile/CDAPackage.java", "license": "epl-1.0", "size": 105536 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,684,001
public Value insert_id(Env env) { try { JdbcConnectionResource connV = validateConnection(); Connection conn = connV.getConnection(env); if (conn == null) return BooleanValue.FALSE; Statement stmt = null; try { stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery("SELECT @@identity"); if (rs.next()) return LongValue.create(rs.getLong(1)); else return BooleanValue.FALSE; } finally { if (stmt != null) stmt.close(); } } catch (SQLException e) { log.log(Level.FINE, e.toString(), e); return BooleanValue.FALSE; } }
Value function(Env env) { try { JdbcConnectionResource connV = validateConnection(); Connection conn = connV.getConnection(env); if (conn == null) return BooleanValue.FALSE; Statement stmt = null; try { stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(STR); if (rs.next()) return LongValue.create(rs.getLong(1)); else return BooleanValue.FALSE; } finally { if (stmt != null) stmt.close(); } } catch (SQLException e) { log.log(Level.FINE, e.toString(), e); return BooleanValue.FALSE; } }
/** * returns ID generated for an AUTO_INCREMENT column by the previous * INSERT query on success, 0 if the previous query does not generate * an AUTO_INCREMENT value, or FALSE if no MySQL connection was established * */
returns ID generated for an AUTO_INCREMENT column by the previous INSERT query on success, 0 if the previous query does not generate an AUTO_INCREMENT value, or FALSE if no MySQL connection was established
insert_id
{ "repo_name": "dlitz/resin", "path": "modules/quercus/src/com/caucho/quercus/lib/db/Mysqli.java", "license": "gpl-2.0", "size": 42236 }
[ "com.caucho.quercus.env.BooleanValue", "com.caucho.quercus.env.Env", "com.caucho.quercus.env.LongValue", "com.caucho.quercus.env.Value", "java.sql.Connection", "java.sql.ResultSet", "java.sql.SQLException", "java.sql.Statement", "java.util.logging.Level" ]
import com.caucho.quercus.env.BooleanValue; import com.caucho.quercus.env.Env; import com.caucho.quercus.env.LongValue; import com.caucho.quercus.env.Value; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.logging.Level;
import com.caucho.quercus.env.*; import java.sql.*; import java.util.logging.*;
[ "com.caucho.quercus", "java.sql", "java.util" ]
com.caucho.quercus; java.sql; java.util;
451,522
default void preSnapshot(final ObserverContext<MasterCoprocessorEnvironment> ctx, final SnapshotDescription snapshot, final TableDescriptor tableDescriptor) throws IOException {}
default void preSnapshot(final ObserverContext<MasterCoprocessorEnvironment> ctx, final SnapshotDescription snapshot, final TableDescriptor tableDescriptor) throws IOException {}
/** * Called before a new snapshot is taken. * Called as part of snapshot RPC call. * @param ctx the environment to interact with the framework and master * @param snapshot the SnapshotDescriptor for the snapshot * @param tableDescriptor the TableDescriptor of the table to snapshot */
Called before a new snapshot is taken. Called as part of snapshot RPC call
preSnapshot
{ "repo_name": "apurtell/hbase", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/MasterObserver.java", "license": "apache-2.0", "size": 74501 }
[ "java.io.IOException", "org.apache.hadoop.hbase.client.SnapshotDescription", "org.apache.hadoop.hbase.client.TableDescriptor" ]
import java.io.IOException; import org.apache.hadoop.hbase.client.SnapshotDescription; import org.apache.hadoop.hbase.client.TableDescriptor;
import java.io.*; import org.apache.hadoop.hbase.client.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
923,075
public Map<String,String> getParams() { return params; }
Map<String,String> function() { return params; }
/** * Get any additional parameters for the prefer tag * @return additional parameters for the prefer tag */
Get any additional parameters for the prefer tag
getParams
{ "repo_name": "nianma/fcrepo4", "path": "fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/domain/PreferTag.java", "license": "apache-2.0", "size": 4625 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,567,421
public void setDeactivated(Script deactivated) { this.deactivated = deactivated; }
void function(Script deactivated) { this.deactivated = deactivated; }
/** * Sets the Script to be executed when the window is deactivated. */
Sets the Script to be executed when the window is deactivated
setDeactivated
{ "repo_name": "hudson3-plugins/commons-jelly", "path": "jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/WindowListenerTag.java", "license": "apache-2.0", "size": 5584 }
[ "org.apache.commons.jelly.Script" ]
import org.apache.commons.jelly.Script;
import org.apache.commons.jelly.*;
[ "org.apache.commons" ]
org.apache.commons;
267,331
public static List<String> splitKeepEmpty(String string, char toSplit) { int len = string.length(); if (len == 0) { return new ArrayList<>(0); } ArrayList<String> ret = new ArrayList<String>(); int last = -1; char c = 0; for (int i = 0; i < len; i++) { c = string.charAt(i); if (c == toSplit) { ret.add(string.substring(last + 1, i)); last = i; } } if (c != toSplit) { ret.add(string.substring(last + 1, len)); } else { ret.add(""); } return ret; }
static List<String> function(String string, char toSplit) { int len = string.length(); if (len == 0) { return new ArrayList<>(0); } ArrayList<String> ret = new ArrayList<String>(); int last = -1; char c = 0; for (int i = 0; i < len; i++) { c = string.charAt(i); if (c == toSplit) { ret.add(string.substring(last + 1, i)); last = i; } } if (c != toSplit) { ret.add(string.substring(last + 1, len)); } else { ret.add(""); } return ret; }
/** * Splits keeping empty partitions. * * Notes: * If ending with the char to split, adds an empty partition to the end. * * I.e.: * aaa| will give "aaa", "" */
Splits keeping empty partitions. Notes: If ending with the char to split, adds an empty partition to the end. I.e.: aaa| will give "aaa", ""
splitKeepEmpty
{ "repo_name": "RandallDW/Aruba_plugin", "path": "plugins/org.python.pydev.shared_core/src/org/python/pydev/shared_core/string/StringUtils.java", "license": "epl-1.0", "size": 55521 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
876,322