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
sequence
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
sequence
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public String getSiteEffectiveId(Site site) { if (SiteService.isUserSite(site.getId())) { try { String userId = SiteService.getSiteUserId(site.getId()); String eid = UserDirectoryService.getUserEid(userId); // SAK-31889: if your EID has special chars, much easier to just use your uid if (StringUtils.isAlphanumeric(eid)) { return SiteService.getUserSiteId(eid); } } catch (UserNotDefinedException e) { log.warn("getSiteEffectiveId: user eid not found for user site: " + site.getId()); } } else { String displayId = portal.getSiteNeighbourhoodService().lookupSiteAlias(site.getReference(), null); if (displayId != null) { return displayId; } } return site.getId(); }
String function(Site site) { if (SiteService.isUserSite(site.getId())) { try { String userId = SiteService.getSiteUserId(site.getId()); String eid = UserDirectoryService.getUserEid(userId); if (StringUtils.isAlphanumeric(eid)) { return SiteService.getUserSiteId(eid); } } catch (UserNotDefinedException e) { log.warn(STR + site.getId()); } } else { String displayId = portal.getSiteNeighbourhoodService().lookupSiteAlias(site.getReference(), null); if (displayId != null) { return displayId; } } return site.getId(); }
/** * If this is a user site, return an id based on the user EID, otherwise * just return the site id. * * @param site * The site. * @return The effective site id. */
If this is a user site, return an id based on the user EID, otherwise just return the site id
getSiteEffectiveId
{ "repo_name": "OpenCollabZA/sakai", "path": "portal/portal-impl/impl/src/java/org/sakaiproject/portal/charon/site/PortalSiteHelperImpl.java", "license": "apache-2.0", "size": 45708 }
[ "org.apache.commons.lang3.StringUtils", "org.sakaiproject.site.api.Site", "org.sakaiproject.site.cover.SiteService", "org.sakaiproject.user.api.UserNotDefinedException", "org.sakaiproject.user.cover.UserDirectoryService" ]
import org.apache.commons.lang3.StringUtils; import org.sakaiproject.site.api.Site; import org.sakaiproject.site.cover.SiteService; import org.sakaiproject.user.api.UserNotDefinedException; import org.sakaiproject.user.cover.UserDirectoryService;
import org.apache.commons.lang3.*; import org.sakaiproject.site.api.*; import org.sakaiproject.site.cover.*; import org.sakaiproject.user.api.*; import org.sakaiproject.user.cover.*;
[ "org.apache.commons", "org.sakaiproject.site", "org.sakaiproject.user" ]
org.apache.commons; org.sakaiproject.site; org.sakaiproject.user;
2,324,307
public static List<CompraDTO> getInstancias(String cadenaXmlObjetos) throws Exception { try { SAXBuilder builder = new SAXBuilder(); Document documento = builder.build(new StringReader(cadenaXmlObjetos)); return getInstancias(documento); } catch (Exception e) { throw new Exception(e); } }
static List<CompraDTO> function(String cadenaXmlObjetos) throws Exception { try { SAXBuilder builder = new SAXBuilder(); Document documento = builder.build(new StringReader(cadenaXmlObjetos)); return getInstancias(documento); } catch (Exception e) { throw new Exception(e); } }
/** * Convierte una cadena que representa un XML en una coleccion de instancias * de * <code>CompraDTO</code>. * * @return La colecciοΏ½n de instancias de <code>CompraDTO</code>. */
Convierte una cadena que representa un XML en una coleccion de instancias de <code>CompraDTO</code>
getInstancias
{ "repo_name": "parracuartas/bvcmovil", "path": "3-Desarrollo/Backend/BvcUtil/src/com/bvc/helper/CompraHelper.java", "license": "mit", "size": 7102 }
[ "com.bvc.dto.CompraDTO", "java.io.StringReader", "java.util.List", "org.jdom.Document", "org.jdom.input.SAXBuilder" ]
import com.bvc.dto.CompraDTO; import java.io.StringReader; import java.util.List; import org.jdom.Document; import org.jdom.input.SAXBuilder;
import com.bvc.dto.*; import java.io.*; import java.util.*; import org.jdom.*; import org.jdom.input.*;
[ "com.bvc.dto", "java.io", "java.util", "org.jdom", "org.jdom.input" ]
com.bvc.dto; java.io; java.util; org.jdom; org.jdom.input;
1,836,392
public void openGui(Object mod, int modGuiId, World world, int x, int y, int z) { net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(this, mod, modGuiId, world, x, y, z); }
void function(Object mod, int modGuiId, World world, int x, int y, int z) { net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(this, mod, modGuiId, world, x, y, z); }
/** * Opens a GUI with this player, uses FML's IGuiHandler system. * Allows for extension by modders. * * @param mod The mod trying to open a GUI * @param modGuiId GUI ID * @param world Current World * @param x Passed directly to IGuiHandler, data meaningless Typically world X position * @param y Passed directly to IGuiHandler, data meaningless Typically world Y position * @param z Passed directly to IGuiHandler, data meaningless Typically world Z position */
Opens a GUI with this player, uses FML's IGuiHandler system. Allows for extension by modders
openGui
{ "repo_name": "boredherobrine13/morefuelsmod-1.10", "path": "build/tmp/recompileMc/sources/net/minecraft/entity/player/EntityPlayer.java", "license": "lgpl-2.1", "size": 99358 }
[ "net.minecraft.world.World" ]
import net.minecraft.world.World;
import net.minecraft.world.*;
[ "net.minecraft.world" ]
net.minecraft.world;
1,161,214
if (!isValid()) { return false; } try { IIcon sprite = item.getIconFromDamage(meta); return sprite != null && sprite.getIconName() != null && !sprite.getIconName().equalsIgnoreCase("") && !sprite.getIconName().equalsIgnoreCase("missingno"); } catch (Throwable ignored) { return false; } }
if (!isValid()) { return false; } try { IIcon sprite = item.getIconFromDamage(meta); return sprite != null && sprite.getIconName() != null && !sprite.getIconName().equalsIgnoreCase(STRmissingno"); } catch (Throwable ignored) { return false; } }
/** * Resolve item state validity * @param meta Item metadata * @return Is item state valid */
Resolve item state validity
isValidItemState
{ "repo_name": "ternsip/StructPro", "path": "builds/1.7.10/src/main/java/com/ternsip/structpro/universe/items/UItem.java", "license": "mit", "size": 2585 }
[ "net.minecraft.util.IIcon" ]
import net.minecraft.util.IIcon;
import net.minecraft.util.*;
[ "net.minecraft.util" ]
net.minecraft.util;
272,539
public void setNavBarColor(int color) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { getWindow().setNavigationBarColor(getResources().getColor(color)); } }
void function(int color) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { getWindow().setNavigationBarColor(getResources().getColor(color)); } }
/** * Allows the user to set the nav bar color of their app intro * * @param color int form of color. pass your color resource to here (R.color.your_color) */
Allows the user to set the nav bar color of their app intro
setNavBarColor
{ "repo_name": "danluong/AppIntro", "path": "library/src/main/java/com/github/paolorotolo/appintro/AppIntro.java", "license": "apache-2.0", "size": 20991 }
[ "android.os.Build" ]
import android.os.Build;
import android.os.*;
[ "android.os" ]
android.os;
2,699,797
public int getMaxThreads() throws Exception { String val =serverImpl.getCurrentProperties().getProperty(Property.DRDA_PROP_MAXTHREADS); return Integer.parseInt(val); }
int function() throws Exception { String val =serverImpl.getCurrentProperties().getProperty(Property.DRDA_PROP_MAXTHREADS); return Integer.parseInt(val); }
/** Returns the current maxThreads setting for the running Network Server * * @return maxThreads setting * @exception Exception throws an exception if an error occurs * @see #setMaxThreads */
Returns the current maxThreads setting for the running Network Server
getMaxThreads
{ "repo_name": "kavin256/Derby", "path": "java/drda/org/apache/derby/drda/NetworkServerControl.java", "license": "apache-2.0", "size": 27065 }
[ "org.apache.derby.iapi.reference.Property" ]
import org.apache.derby.iapi.reference.Property;
import org.apache.derby.iapi.reference.*;
[ "org.apache.derby" ]
org.apache.derby;
1,614,151
public void testClientReconnectMultithreaded() throws Exception { final ConcurrentLinkedQueue<FileSystem> q = new ConcurrentLinkedQueue<>(); Configuration cfg = new Configuration(); for (Map.Entry<String, String> entry : primaryFsCfg) cfg.set(entry.getKey(), entry.getValue()); cfg.setBoolean("fs.igfs.impl.disable.cache", true); final int nClients = 16; // Initialize clients. for (int i = 0; i < nClients; i++) q.add(FileSystem.get(primaryFsUri, cfg)); G.stopAll(true); // Stop the server. startNodes(); // Start server again.
void function() throws Exception { final ConcurrentLinkedQueue<FileSystem> q = new ConcurrentLinkedQueue<>(); Configuration cfg = new Configuration(); for (Map.Entry<String, String> entry : primaryFsCfg) cfg.set(entry.getKey(), entry.getValue()); cfg.setBoolean(STR, true); final int nClients = 16; for (int i = 0; i < nClients; i++) q.add(FileSystem.get(primaryFsUri, cfg)); G.stopAll(true); startNodes();
/** * Verifies that client reconnects after connection to the server has been lost (multithreaded mode). * * @throws Exception If error occurs. */
Verifies that client reconnects after connection to the server has been lost (multithreaded mode)
testClientReconnectMultithreaded
{ "repo_name": "gargvish/ignite", "path": "modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java", "license": "apache-2.0", "size": 67942 }
[ "java.util.Map", "java.util.concurrent.ConcurrentLinkedQueue", "org.apache.hadoop.conf.Configuration", "org.apache.hadoop.fs.FileSystem", "org.apache.ignite.internal.util.typedef.G" ]
import java.util.Map; import java.util.concurrent.ConcurrentLinkedQueue; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.ignite.internal.util.typedef.G;
import java.util.*; import java.util.concurrent.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.fs.*; import org.apache.ignite.internal.util.typedef.*;
[ "java.util", "org.apache.hadoop", "org.apache.ignite" ]
java.util; org.apache.hadoop; org.apache.ignite;
314,923
public void scheduleAutoSave(ProjectSettings projectSettings) { // Add the project settings to the dirtyProjectSettings list. dirtyProjectSettings.add(projectSettings); scheduleAutoSaveTimer(); }
void function(ProjectSettings projectSettings) { dirtyProjectSettings.add(projectSettings); scheduleAutoSaveTimer(); }
/** * Schedules auto-save of the given project settings. * This method can be called often, as the user is modifying project settings. * * @param projectSettings the project settings for which to schedule auto-save */
Schedules auto-save of the given project settings. This method can be called often, as the user is modifying project settings
scheduleAutoSave
{ "repo_name": "kkashi01/appinventor-sources", "path": "appinventor/appengine/src/com/google/appinventor/client/editor/EditorManager.java", "license": "apache-2.0", "size": 16762 }
[ "com.google.appinventor.client.settings.project.ProjectSettings" ]
import com.google.appinventor.client.settings.project.ProjectSettings;
import com.google.appinventor.client.settings.project.*;
[ "com.google.appinventor" ]
com.google.appinventor;
413,481
@Deprecated public Builder withKeyTemplate(com.google.crypto.tink.proto.KeyTemplate val) { keyTemplate = KeyTemplate.create( val.getTypeUrl(), val.getValue().toByteArray(), fromProto(val.getOutputPrefixType())); return this; }
Builder function(com.google.crypto.tink.proto.KeyTemplate val) { keyTemplate = KeyTemplate.create( val.getTypeUrl(), val.getValue().toByteArray(), fromProto(val.getOutputPrefixType())); return this; }
/** * If the keyset is not found or valid, generates a new one using {@code val}. * * @deprecated This method takes a KeyTemplate proto, which is an internal implementation * detail. Please use the withKeyTemplate method that takes a {@link KeyTemplate} POJO. */
If the keyset is not found or valid, generates a new one using val
withKeyTemplate
{ "repo_name": "google/tink", "path": "java_src/src/main/java/com/google/crypto/tink/integration/android/AndroidKeysetManager.java", "license": "apache-2.0", "size": 19197 }
[ "com.google.crypto.tink.KeyTemplate" ]
import com.google.crypto.tink.KeyTemplate;
import com.google.crypto.tink.*;
[ "com.google.crypto" ]
com.google.crypto;
1,047,593
public static Edge createConnectionEdge( final Id sourceEntityId, final String connectionType, final Id targetEntityId ) { final String edgeType = getEdgeTypeFromConnectionType( connectionType ); // create graph edge connection from head entity to member entity return new SimpleEdge( sourceEntityId, edgeType, targetEntityId, createGraphOperationTimestamp() ); }
static Edge function( final Id sourceEntityId, final String connectionType, final Id targetEntityId ) { final String edgeType = getEdgeTypeFromConnectionType( connectionType ); return new SimpleEdge( sourceEntityId, edgeType, targetEntityId, createGraphOperationTimestamp() ); }
/** * Create a new connection edge from the source node with the given connection type and target id */
Create a new connection edge from the source node with the given connection type and target id
createConnectionEdge
{ "repo_name": "mdunker/usergrid", "path": "stack/core/src/main/java/org/apache/usergrid/corepersistence/util/CpNamingUtils.java", "license": "apache-2.0", "size": 12519 }
[ "org.apache.usergrid.persistence.graph.Edge", "org.apache.usergrid.persistence.graph.impl.SimpleEdge", "org.apache.usergrid.persistence.model.entity.Id" ]
import org.apache.usergrid.persistence.graph.Edge; import org.apache.usergrid.persistence.graph.impl.SimpleEdge; import org.apache.usergrid.persistence.model.entity.Id;
import org.apache.usergrid.persistence.graph.*; import org.apache.usergrid.persistence.graph.impl.*; import org.apache.usergrid.persistence.model.entity.*;
[ "org.apache.usergrid" ]
org.apache.usergrid;
330,251
@Override public boolean isCompactionNeeded() { return result == Result.FLUSHED_COMPACTION_NEEDED; }
boolean function() { return result == Result.FLUSHED_COMPACTION_NEEDED; }
/** * Convenience method, the equivalent of checking if result is FLUSHED_COMPACTION_NEEDED. * @return True if the flush requested a compaction, else false (doesn't even mean it flushed). */
Convenience method, the equivalent of checking if result is FLUSHED_COMPACTION_NEEDED
isCompactionNeeded
{ "repo_name": "gustavoanatoly/hbase", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java", "license": "apache-2.0", "size": 328407 }
[ "org.apache.hadoop.hbase.client.Result" ]
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,503,232
public static Map<? extends Enum<? extends EntityColumn>, Column> getColumns () { return columns; }
static Map<? extends Enum<? extends EntityColumn>, Column> function () { return columns; }
/** * Return the list of the columns of the table entry member party. * @return the columns. */
Return the list of the columns of the table entry member party
getColumns
{ "repo_name": "Club-Rock-ISEN/EntryManager", "path": "src/main/java/org/clubrockisen/entities/EntryMemberParty.java", "license": "bsd-3-clause", "size": 6107 }
[ "com.alexrnl.commons.database.structure.Column", "com.alexrnl.commons.database.structure.EntityColumn", "java.util.Map" ]
import com.alexrnl.commons.database.structure.Column; import com.alexrnl.commons.database.structure.EntityColumn; import java.util.Map;
import com.alexrnl.commons.database.structure.*; import java.util.*;
[ "com.alexrnl.commons", "java.util" ]
com.alexrnl.commons; java.util;
1,229,566
public void registerIntent(Plugin plugin) { Preconditions.checkState( !fired.get(), "Event %s has already been fired", this ); Preconditions.checkState( !intents.contains( plugin ), "Plugin %s already registered intent for event %s", plugin, this ); intents.add( plugin ); latch.incrementAndGet(); }
void function(Plugin plugin) { Preconditions.checkState( !fired.get(), STR, this ); Preconditions.checkState( !intents.contains( plugin ), STR, plugin, this ); intents.add( plugin ); latch.incrementAndGet(); }
/** * Register an intent that this plugin will continue to perform work on a * background task, and wishes to let the event proceed once the registered * background task has completed. * * @param plugin the plugin registering this intent */
Register an intent that this plugin will continue to perform work on a background task, and wishes to let the event proceed once the registered background task has completed
registerIntent
{ "repo_name": "BlueAnanas/BungeeCord", "path": "api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java", "license": "bsd-3-clause", "size": 2529 }
[ "com.google.common.base.Preconditions", "net.md_5.bungee.api.plugin.Plugin" ]
import com.google.common.base.Preconditions; import net.md_5.bungee.api.plugin.Plugin;
import com.google.common.base.*; import net.md_5.bungee.api.plugin.*;
[ "com.google.common", "net.md_5.bungee" ]
com.google.common; net.md_5.bungee;
1,324,681
public Future<VoiceChannel> createVoiceChannel(String name, FutureCallback<VoiceChannel> callback);
Future<VoiceChannel> function(String name, FutureCallback<VoiceChannel> callback);
/** * Creates a new voice channel. * * @param name The name of the voice channel. * @param callback The callback which will be informed when the channel was created. * @return The created voice channel. */
Creates a new voice channel
createVoiceChannel
{ "repo_name": "dksgusals99/Javacord", "path": "src/main/java/de/btobastian/javacord/entities/Server.java", "license": "lgpl-3.0", "size": 13531 }
[ "com.google.common.util.concurrent.FutureCallback", "java.util.concurrent.Future" ]
import com.google.common.util.concurrent.FutureCallback; import java.util.concurrent.Future;
import com.google.common.util.concurrent.*; import java.util.concurrent.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
619,660
public void load() { lock.lock(); try { try { // Clear items, for the benefit of reloading. waitingList.clear(); blockedProjects.clear(); buildables.clear(); pendings.clear(); // first try the old format File queueFile = getQueueFile(); if (queueFile.exists()) { try (BufferedReader in = new BufferedReader(new InputStreamReader(Files.newInputStream(queueFile.toPath())))) { String line; while ((line = in.readLine()) != null) { AbstractProject j = Jenkins.getInstance().getItemByFullName(line, AbstractProject.class); if (j != null) j.scheduleBuild(); } } catch (InvalidPathException e) { throw new IOException(e); } // discard the queue file now that we are done queueFile.delete(); } else { queueFile = getXMLQueueFile(); if (queueFile.exists()) { Object unmarshaledObj = new XmlFile(XSTREAM, queueFile).read(); List items; if (unmarshaledObj instanceof State) { State state = (State) unmarshaledObj; items = state.items; WaitingItem.COUNTER.set(state.counter); } else { // backward compatibility - it's an old List queue.xml items = (List) unmarshaledObj; long maxId = 0; for (Object o : items) { if (o instanceof Item) { maxId = Math.max(maxId, ((Item)o).id); } } WaitingItem.COUNTER.set(maxId); } for (Object o : items) { if (o instanceof Task) { // backward compatibility schedule((Task)o, 0); } else if (o instanceof Item) { Item item = (Item)o; if (item.task == null) { continue; // botched persistence. throw this one away } if (item instanceof WaitingItem) { item.enter(this); } else if (item instanceof BlockedItem) { item.enter(this); } else if (item instanceof BuildableItem) { item.enter(this); } else { throw new IllegalStateException("Unknown item type! " + item); } } } // I just had an incident where all the executors are dead at AbstractProject._getRuns() // because runs is null. Debugger revealed that this is caused by a MatrixConfiguration // object that doesn't appear to be de-serialized properly. // I don't know how this problem happened, but to diagnose this problem better // when it happens again, save the old queue file for introspection. File bk = new File(queueFile.getPath() + ".bak"); bk.delete(); queueFile.renameTo(bk); queueFile.delete(); } } } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to load the queue file " + getXMLQueueFile(), e); } finally { updateSnapshot(); } } finally { lock.unlock(); } }
void function() { lock.lock(); try { try { waitingList.clear(); blockedProjects.clear(); buildables.clear(); pendings.clear(); File queueFile = getQueueFile(); if (queueFile.exists()) { try (BufferedReader in = new BufferedReader(new InputStreamReader(Files.newInputStream(queueFile.toPath())))) { String line; while ((line = in.readLine()) != null) { AbstractProject j = Jenkins.getInstance().getItemByFullName(line, AbstractProject.class); if (j != null) j.scheduleBuild(); } } catch (InvalidPathException e) { throw new IOException(e); } queueFile.delete(); } else { queueFile = getXMLQueueFile(); if (queueFile.exists()) { Object unmarshaledObj = new XmlFile(XSTREAM, queueFile).read(); List items; if (unmarshaledObj instanceof State) { State state = (State) unmarshaledObj; items = state.items; WaitingItem.COUNTER.set(state.counter); } else { items = (List) unmarshaledObj; long maxId = 0; for (Object o : items) { if (o instanceof Item) { maxId = Math.max(maxId, ((Item)o).id); } } WaitingItem.COUNTER.set(maxId); } for (Object o : items) { if (o instanceof Task) { schedule((Task)o, 0); } else if (o instanceof Item) { Item item = (Item)o; if (item.task == null) { continue; } if (item instanceof WaitingItem) { item.enter(this); } else if (item instanceof BlockedItem) { item.enter(this); } else if (item instanceof BuildableItem) { item.enter(this); } else { throw new IllegalStateException(STR + item); } } } File bk = new File(queueFile.getPath() + ".bak"); bk.delete(); queueFile.renameTo(bk); queueFile.delete(); } } } catch (IOException e) { LOGGER.log(Level.WARNING, STR + getXMLQueueFile(), e); } finally { updateSnapshot(); } } finally { lock.unlock(); } }
/** * Loads the queue contents that was {@link #save() saved}. */
Loads the queue contents that was <code>#save() saved</code>
load
{ "repo_name": "escoem/jenkins", "path": "core/src/main/java/hudson/model/Queue.java", "license": "mit", "size": 111723 }
[ "java.io.BufferedReader", "java.io.File", "java.io.IOException", "java.io.InputStreamReader", "java.nio.file.Files", "java.nio.file.InvalidPathException", "java.util.List", "java.util.logging.Level" ]
import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStreamReader; import java.nio.file.Files; import java.nio.file.InvalidPathException; import java.util.List; import java.util.logging.Level;
import java.io.*; import java.nio.file.*; import java.util.*; import java.util.logging.*;
[ "java.io", "java.nio", "java.util" ]
java.io; java.nio; java.util;
1,264,187
public FacesConfigType<T> removeAllValidator() { childNode.removeChildren("validator"); return this; } // --------------------------------------------------------------------------------------------------------|| // ClassName: FacesConfigType ElementName: javaee:faces-config-behaviorType ElementType : behavior // MaxOccurs: -unbounded isGeneric: true isAttribute: false isEnum: false isDataType: false // --------------------------------------------------------------------------------------------------------||
FacesConfigType<T> function() { childNode.removeChildren(STR); return this; }
/** * Removes all <code>validator</code> elements * @return the current instance of <code>FacesConfigValidatorType<FacesConfigType<T>></code> */
Removes all <code>validator</code> elements
removeAllValidator
{ "repo_name": "forge/javaee-descriptors", "path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/facesconfig21/FacesConfigTypeImpl.java", "license": "epl-1.0", "size": 40579 }
[ "org.jboss.shrinkwrap.descriptor.api.facesconfig21.FacesConfigType" ]
import org.jboss.shrinkwrap.descriptor.api.facesconfig21.FacesConfigType;
import org.jboss.shrinkwrap.descriptor.api.facesconfig21.*;
[ "org.jboss.shrinkwrap" ]
org.jboss.shrinkwrap;
266,040
public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list) { for (BlockSandStone.EnumType blocksandstone$enumtype : BlockSandStone.EnumType.values()) { list.add(new ItemStack(itemIn, 1, blocksandstone$enumtype.getMetadata())); } }
void function(Item itemIn, CreativeTabs tab, List<ItemStack> list) { for (BlockSandStone.EnumType blocksandstone$enumtype : BlockSandStone.EnumType.values()) { list.add(new ItemStack(itemIn, 1, blocksandstone$enumtype.getMetadata())); } }
/** * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) */
returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
getSubBlocks
{ "repo_name": "scribblemaniac/AwakenDreamsClient", "path": "mcp/src/minecraft/net/minecraft/block/BlockSandStone.java", "license": "gpl-3.0", "size": 3989 }
[ "java.util.List", "net.minecraft.creativetab.CreativeTabs", "net.minecraft.item.Item", "net.minecraft.item.ItemStack" ]
import java.util.List; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack;
import java.util.*; import net.minecraft.creativetab.*; import net.minecraft.item.*;
[ "java.util", "net.minecraft.creativetab", "net.minecraft.item" ]
java.util; net.minecraft.creativetab; net.minecraft.item;
2,209,097
@Test public void testFilter0004() { LSParser parser = createLSParser(); if (parser == null) { Assert.fail("Unable to create LSParser!"); }
void function() { LSParser parser = createLSParser(); if (parser == null) { Assert.fail(STR); }
/** * Equivalence class partitioning with state, input and output values * orientation for public Document parse(LSInput is), <br> * <b>pre-conditions</b>: set filter that accepts all, <br> * <b>is</b>: xml1 <br> * <b>output</b>: full XML document. */
Equivalence class partitioning with state, input and output values orientation for public Document parse(LSInput is), pre-conditions: set filter that accepts all, is: xml1 output: full XML document
testFilter0004
{ "repo_name": "lostdj/Jaklin-OpenJDK-JAXP", "path": "test/javax/xml/jaxp/unittest/org/w3c/dom/ls/LSParserTCKTest.java", "license": "gpl-2.0", "size": 20273 }
[ "org.testng.Assert" ]
import org.testng.Assert;
import org.testng.*;
[ "org.testng" ]
org.testng;
1,265,537
X500Principal certIssuer = cert.getIssuerX500Principal(); X509CRLSelector crlSelector = new X509CRLSelector(); crlSelector.addIssuer(certIssuer); Collection<? extends CRL> crls; if (crlsList != null) { crls = crlsList.getCRLs(crlSelector); } else { try { crls = this.certStore.getCRLs(crlSelector); } catch (CertStoreException e) { throw new CertPathValidatorException( "Error accessing CRL from certificate store: " + e.getMessage(), e); } } if (crls.size() < 1) { return; } // Get CA certificate for these CRLs X509CertSelector certSelector = new X509CertSelector(); certSelector.setSubject(certIssuer); Collection<? extends Certificate> caCerts; try { caCerts = KeyStoreUtil .getTrustedCertificates(this.keyStore, certSelector); } catch (KeyStoreException e) { throw new CertPathValidatorException( "Error accessing CA certificate from certificate store for CRL validation", e); } if (caCerts.size() < 1) { // if there is no trusted certs from that CA, then // the chain cannot contain a cert from that CA, // which implies not checking this CRL should be fine. return; } Certificate caCert = caCerts.iterator().next(); for (CRL o : crls) { X509CRL crl = (X509CRL) o; // if expired, will throw error. if (checkDateValidity) { checkCRLDateValidity(crl); } // validate CRL verifyCRL(caCert, crl); if (crl.isRevoked(cert)) { throw new CertPathValidatorException( "Certificate " + cert.getSubjectDN() + " has been revoked"); } } }
X500Principal certIssuer = cert.getIssuerX500Principal(); X509CRLSelector crlSelector = new X509CRLSelector(); crlSelector.addIssuer(certIssuer); Collection<? extends CRL> crls; if (crlsList != null) { crls = crlsList.getCRLs(crlSelector); } else { try { crls = this.certStore.getCRLs(crlSelector); } catch (CertStoreException e) { throw new CertPathValidatorException( STR + e.getMessage(), e); } } if (crls.size() < 1) { return; } X509CertSelector certSelector = new X509CertSelector(); certSelector.setSubject(certIssuer); Collection<? extends Certificate> caCerts; try { caCerts = KeyStoreUtil .getTrustedCertificates(this.keyStore, certSelector); } catch (KeyStoreException e) { throw new CertPathValidatorException( STR, e); } if (caCerts.size() < 1) { return; } Certificate caCert = caCerts.iterator().next(); for (CRL o : crls) { X509CRL crl = (X509CRL) o; if (checkDateValidity) { checkCRLDateValidity(crl); } verifyCRL(caCert, crl); if (crl.isRevoked(cert)) { throw new CertPathValidatorException( STR + cert.getSubjectDN() + STR); } } }
/** * Method that checks the if the certificate is in a CRL, if CRL is * available If no CRL is found, then no error is thrown If an expired CRL * is found, an error is thrown * * @throws CertPathValidatorException If CRL or CA certificate could not be * loaded from store, CRL is not valid or * expired, certificate is revoked. */
Method that checks the if the certificate is in a CRL, if CRL is available If no CRL is found, then no error is thrown If an expired CRL is found, an error is thrown
invoke
{ "repo_name": "ellert/JGlobus", "path": "ssl-proxies/src/main/java/org/globus/gsi/trustmanager/CRLChecker.java", "license": "apache-2.0", "size": 7116 }
[ "java.security.KeyStoreException", "java.security.cert.CertPathValidatorException", "java.security.cert.CertStoreException", "java.security.cert.Certificate", "java.security.cert.X509CRLSelector", "java.security.cert.X509CertSelector", "java.util.Collection", "javax.security.auth.x500.X500Principal", "org.globus.gsi.util.KeyStoreUtil" ]
import java.security.KeyStoreException; import java.security.cert.CertPathValidatorException; import java.security.cert.CertStoreException; import java.security.cert.Certificate; import java.security.cert.X509CRLSelector; import java.security.cert.X509CertSelector; import java.util.Collection; import javax.security.auth.x500.X500Principal; import org.globus.gsi.util.KeyStoreUtil;
import java.security.*; import java.security.cert.*; import java.util.*; import javax.security.auth.x500.*; import org.globus.gsi.util.*;
[ "java.security", "java.util", "javax.security", "org.globus.gsi" ]
java.security; java.util; javax.security; org.globus.gsi;
294,418
private void initialize() { frame = new JFrame(); frame.setBounds(100, 100, 600, 600); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frame.addWindowListener(this); frame.getContentPane().setLayout(new CardLayout(0, 0)); // main tabbed pane tabbedPane = new JTabbedPane(JTabbedPane.TOP); frame.getContentPane().add(tabbedPane, "name_5266296004328937"); // 1st tab Signals and Log JSplitPane splitPane = new JSplitPane(); splitPane.setResizeWeight(1.0); splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT); tabbedPane.addTab("Signals and Log", null, splitPane, null);
void function() { frame = new JFrame(); frame.setBounds(100, 100, 600, 600); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frame.addWindowListener(this); frame.getContentPane().setLayout(new CardLayout(0, 0)); tabbedPane = new JTabbedPane(JTabbedPane.TOP); frame.getContentPane().add(tabbedPane, STR); JSplitPane splitPane = new JSplitPane(); splitPane.setResizeWeight(1.0); splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT); tabbedPane.addTab(STR, null, splitPane, null);
/** * Initialize the contents of the frame. */
Initialize the contents of the frame
initialize
{ "repo_name": "salinsalins/LoggerPlotter", "path": "src/binp/nbi/tango/adc/LoggerPlotter.java", "license": "gpl-3.0", "size": 30811 }
[ "java.awt.CardLayout", "javax.swing.JFrame", "javax.swing.JSplitPane", "javax.swing.JTabbedPane" ]
import java.awt.CardLayout; import javax.swing.JFrame; import javax.swing.JSplitPane; import javax.swing.JTabbedPane;
import java.awt.*; import javax.swing.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
2,487,378
public List<com.nerv.server.database.gen.jooq.tables.pojos.AlarmObjectType> fetchByTypeName(String... values) { return fetch(AlarmObjectType.ALARM_OBJECT_TYPE.TYPE_NAME, values); }
List<com.nerv.server.database.gen.jooq.tables.pojos.AlarmObjectType> function(String... values) { return fetch(AlarmObjectType.ALARM_OBJECT_TYPE.TYPE_NAME, values); }
/** * Fetch records that have <code>type_name IN (values)</code> */
Fetch records that have <code>type_name IN (values)</code>
fetchByTypeName
{ "repo_name": "CamW/nerv-server", "path": "src/main/java/com/nerv/server/database/gen/jooq/tables/daos/AlarmObjectTypeDao.java", "license": "apache-2.0", "size": 2417 }
[ "com.nerv.server.database.gen.jooq.tables.AlarmObjectType", "java.util.List" ]
import com.nerv.server.database.gen.jooq.tables.AlarmObjectType; import java.util.List;
import com.nerv.server.database.gen.jooq.tables.*; import java.util.*;
[ "com.nerv.server", "java.util" ]
com.nerv.server; java.util;
2,903,395
public static CSaveProgress saveAs(final Window parent, final ZyGraph graph, final IViewContainer container) { Preconditions.checkNotNull(parent, "IE01754: Parent argument can not be null"); Preconditions.checkNotNull(graph, "IE01755: Graph argument can not be null"); final INaviView view = graph.getRawView(); final CViewCommentDialog dlg = new CViewCommentDialog(parent, "Save", view.getName(), view.getConfiguration() .getDescription()); dlg.setVisible(true); if (dlg.wasCancelled()) { return new CSaveProgress(true); } final String newName = dlg.getName(); final String newDescription = dlg.getComment(); final CSaveProgress progress = new CSaveProgress(false);
static CSaveProgress function(final Window parent, final ZyGraph graph, final IViewContainer container) { Preconditions.checkNotNull(parent, STR); Preconditions.checkNotNull(graph, STR); final INaviView view = graph.getRawView(); final CViewCommentDialog dlg = new CViewCommentDialog(parent, "Save", view.getName(), view.getConfiguration() .getDescription()); dlg.setVisible(true); if (dlg.wasCancelled()) { return new CSaveProgress(true); } final String newName = dlg.getName(); final String newDescription = dlg.getComment(); final CSaveProgress progress = new CSaveProgress(false);
/** * Prompts the user for a new graph description and stores a copy of the graph in the database. * * @param parent Parent window used to display dialogs. * @param graph Graph to be written to the database. * @param container View container the graph is written to. * * @return Information about the save progress. */
Prompts the user for a new graph description and stores a copy of the graph in the database
saveAs
{ "repo_name": "Spacular/binnavi", "path": "src/main/java/com/google/security/zynamics/binnavi/Gui/GraphWindows/Implementations/CGraphSaver.java", "license": "apache-2.0", "size": 9545 }
[ "com.google.common.base.Preconditions", "com.google.security.zynamics.binnavi.Gui", "com.google.security.zynamics.binnavi.disassembly.views.INaviView", "com.google.security.zynamics.binnavi.disassembly.views.IViewContainer", "com.google.security.zynamics.binnavi.yfileswrap.zygraph.ZyGraph", "java.awt.Window" ]
import com.google.common.base.Preconditions; import com.google.security.zynamics.binnavi.Gui; import com.google.security.zynamics.binnavi.disassembly.views.INaviView; import com.google.security.zynamics.binnavi.disassembly.views.IViewContainer; import com.google.security.zynamics.binnavi.yfileswrap.zygraph.ZyGraph; import java.awt.Window;
import com.google.common.base.*; import com.google.security.zynamics.binnavi.*; import com.google.security.zynamics.binnavi.disassembly.views.*; import com.google.security.zynamics.binnavi.yfileswrap.zygraph.*; import java.awt.*;
[ "com.google.common", "com.google.security", "java.awt" ]
com.google.common; com.google.security; java.awt;
2,346,858
private static Integer compareNullDates(final Date date1, final Date date2) { Integer result = null; if (date1 == null && date2 == null) { result = 0; } else if (date1 == null) { result = -1; } else if (date2 == null) { result = 1; } return result; }
static Integer function(final Date date1, final Date date2) { Integer result = null; if (date1 == null && date2 == null) { result = 0; } else if (date1 == null) { result = -1; } else if (date2 == null) { result = 1; } return result; }
/** * Method compare null dates * * @param date1 * Date * @param date2 * Date * @return Integer */
Method compare null dates
compareNullDates
{ "repo_name": "AWNICS/mm-api", "path": "MM/mm-tools/src/main/java/com/awn/common/process/utils/DateUtils.java", "license": "apache-2.0", "size": 15884 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
2,575,881
public String shapeToString(Shape shape) { return shapeWriter.toString(shape); }
String function(Shape shape) { return shapeWriter.toString(shape); }
/** * Returns a String version of a shape to be used for the stored value. * * <p>The format can be selected using the initParam <code>format={WKT|GeoJSON}</code> */
Returns a String version of a shape to be used for the stored value. The format can be selected using the initParam <code>format={WKT|GeoJSON}</code>
shapeToString
{ "repo_name": "apache/solr", "path": "solr/core/src/java/org/apache/solr/schema/AbstractSpatialFieldType.java", "license": "apache-2.0", "size": 17916 }
[ "org.locationtech.spatial4j.shape.Shape" ]
import org.locationtech.spatial4j.shape.Shape;
import org.locationtech.spatial4j.shape.*;
[ "org.locationtech.spatial4j" ]
org.locationtech.spatial4j;
782,963
protected PurApAccountingLine getPreqAccountingLine() { return preqAccountingLine; }
PurApAccountingLine function() { return preqAccountingLine; }
/** * Gets the preqAccountingLine attribute. * @return Returns the preqAccountingLine. */
Gets the preqAccountingLine attribute
getPreqAccountingLine
{ "repo_name": "ua-eas/ua-kfs-5.3", "path": "work/src/org/kuali/kfs/module/purap/document/validation/impl/PaymentRequestProcessItemValidation.java", "license": "agpl-3.0", "size": 16495 }
[ "org.kuali.kfs.module.purap.businessobject.PurApAccountingLine" ]
import org.kuali.kfs.module.purap.businessobject.PurApAccountingLine;
import org.kuali.kfs.module.purap.businessobject.*;
[ "org.kuali.kfs" ]
org.kuali.kfs;
1,202,388
private Runnable createPoll(String sourceId, YamlFileConfig fileConfig) { File file = new File(fileConfig.getFile()); if (file.isFile()) { return new FilePoll(sourceId, file, getEventBus()); } else { return new DirectoryPoll(sourceId, file, getEventBus()); } }
Runnable function(String sourceId, YamlFileConfig fileConfig) { File file = new File(fileConfig.getFile()); if (file.isFile()) { return new FilePoll(sourceId, file, getEventBus()); } else { return new DirectoryPoll(sourceId, file, getEventBus()); } }
/** * Creates the runnable appropriate for the given file config. */
Creates the runnable appropriate for the given file config
createPoll
{ "repo_name": "alanbuttars/commons-java", "path": "commons-config/src/main/java/com/alanbuttars/commons/config/stub/Watch.java", "license": "apache-2.0", "size": 11835 }
[ "com.alanbuttars.commons.config.master.YamlFileConfig", "com.alanbuttars.commons.config.poll.DirectoryPoll", "com.alanbuttars.commons.config.poll.FilePoll", "java.io.File" ]
import com.alanbuttars.commons.config.master.YamlFileConfig; import com.alanbuttars.commons.config.poll.DirectoryPoll; import com.alanbuttars.commons.config.poll.FilePoll; import java.io.File;
import com.alanbuttars.commons.config.master.*; import com.alanbuttars.commons.config.poll.*; import java.io.*;
[ "com.alanbuttars.commons", "java.io" ]
com.alanbuttars.commons; java.io;
1,082,617
public BigInteger getN() { return n; }
BigInteger function() { return n; }
/** * return the order N of G * @return the order */
return the order N of G
getN
{ "repo_name": "Qingbao/PasswdManagerAndroid", "path": "src/noconflict/org/bouncycastle/jce/spec/ECParameterSpec.java", "license": "lgpl-2.1", "size": 2493 }
[ "java.math.BigInteger" ]
import java.math.BigInteger;
import java.math.*;
[ "java.math" ]
java.math;
97,923
public void triangulate( List<Triangulatable> list ) { _triangulations.clear(); _triangulations.addAll( list ); start(); }
void function( List<Triangulatable> list ) { _triangulations.clear(); _triangulations.addAll( list ); start(); }
/** * Triangulate a List of Triangulatables * * @param ps */
Triangulate a List of Triangulatables
triangulate
{ "repo_name": "Anarchid/zkgbai", "path": "src/org/poly2tri/triangulation/TriangulationProcess.java", "license": "gpl-2.0", "size": 9463 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,557,075
public void testTriggerFailsGetNextRunTimeAfterTaskRuns(HttpServletRequest request, PrintWriter out) throws Exception { Callable<Long> task = new SharedCounterTask(); FailingTrigger trigger = new FailingTrigger(); trigger.allowFirstGetNextRunTime = true; TaskStatus<Long> status = scheduler.schedule(task, trigger); for (long start = System.nanoTime(); !status.hasResult() && System.nanoTime() - start < TIMEOUT_NS; Thread.sleep(POLL_INTERVAL)) status = scheduler.getStatus(status.getTaskId()); if (!status.isDone() || status.isCancelled()) throw new Exception("Task did not complete. " + status); try { Long result = status.get(); throw new Exception("Expecting all attempts to roll back. Instead result is: " + result); } catch (ExecutionException x) { if (!(x.getCause() instanceof ArithmeticException)) throw x; } }
void function(HttpServletRequest request, PrintWriter out) throws Exception { Callable<Long> task = new SharedCounterTask(); FailingTrigger trigger = new FailingTrigger(); trigger.allowFirstGetNextRunTime = true; TaskStatus<Long> status = scheduler.schedule(task, trigger); for (long start = System.nanoTime(); !status.hasResult() && System.nanoTime() - start < TIMEOUT_NS; Thread.sleep(POLL_INTERVAL)) status = scheduler.getStatus(status.getTaskId()); if (!status.isDone() status.isCancelled()) throw new Exception(STR + status); try { Long result = status.get(); throw new Exception(STR + result); } catch (ExecutionException x) { if (!(x.getCause() instanceof ArithmeticException)) throw x; } }
/** * When Trigger.getNextRunTime fails after a task runs, the execution must be rolled back and retried until the failure is reported. */
When Trigger.getNextRunTime fails after a task runs, the execution must be rolled back and retried until the failure is reported
testTriggerFailsGetNextRunTimeAfterTaskRuns
{ "repo_name": "kgibm/open-liberty", "path": "dev/com.ibm.ws.concurrent.persistent_fat_errorpaths/test-applications/persistenterrtest/src/web/PersistentErrorTestServlet.java", "license": "epl-1.0", "size": 67054 }
[ "com.ibm.websphere.concurrent.persistent.TaskStatus", "java.io.PrintWriter", "java.util.concurrent.Callable", "java.util.concurrent.ExecutionException", "javax.servlet.http.HttpServletRequest" ]
import com.ibm.websphere.concurrent.persistent.TaskStatus; import java.io.PrintWriter; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import javax.servlet.http.HttpServletRequest;
import com.ibm.websphere.concurrent.persistent.*; import java.io.*; import java.util.concurrent.*; import javax.servlet.http.*;
[ "com.ibm.websphere", "java.io", "java.util", "javax.servlet" ]
com.ibm.websphere; java.io; java.util; javax.servlet;
2,193,816
@SideOnly(Side.CLIENT) public int colorMultiplier(IBlockAccess b, int x, int y, int z) { return 16777215; }
@SideOnly(Side.CLIENT) int function(IBlockAccess b, int x, int y, int z) { return 16777215; }
/** * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called * when first determining what to render. */
Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called when first determining what to render
colorMultiplier
{ "repo_name": "Alex-the-666/It-s-About-Time-Minecraft-Mod", "path": "src/main/java/iat/blocks/BlockHorseTail.java", "license": "lgpl-2.1", "size": 3995 }
[ "net.minecraft.world.IBlockAccess" ]
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.*;
[ "net.minecraft.world" ]
net.minecraft.world;
796,155
public void invokeConstructor(final Type type, final Method method) { invokeInsn(Opcodes.INVOKESPECIAL, type, method); }
void function(final Type type, final Method method) { invokeInsn(Opcodes.INVOKESPECIAL, type, method); }
/** * Generates the instruction to invoke a constructor. * * @param type * the class in which the constructor is defined. * @param method * the constructor to be invoked. */
Generates the instruction to invoke a constructor
invokeConstructor
{ "repo_name": "llbit/ow2-asm", "path": "src/org/objectweb/asm/commons/GeneratorAdapter.java", "license": "bsd-3-clause", "size": 50594 }
[ "org.objectweb.asm.Opcodes", "org.objectweb.asm.Type" ]
import org.objectweb.asm.Opcodes; import org.objectweb.asm.Type;
import org.objectweb.asm.*;
[ "org.objectweb.asm" ]
org.objectweb.asm;
929,303
public Set<Entry<String, Object>> getAttrsEntrySet() { return attrs.entrySet(); }
Set<Entry<String, Object>> function() { return attrs.entrySet(); }
/** * Return attribute Set. */
Return attribute Set
getAttrsEntrySet
{ "repo_name": "WhatAKitty/spark-project", "path": "spark-activerecord/src/main/java/com/whatakitty/Model.java", "license": "mit", "size": 19082 }
[ "java.util.Map", "java.util.Set" ]
import java.util.Map; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
381,225
EReference getSarlBehavior_Extends();
EReference getSarlBehavior_Extends();
/** * Returns the meta object for the containment reference '{@link io.sarl.lang.sarl.SarlBehavior#getExtends <em>Extends</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the containment reference '<em>Extends</em>'. * @see io.sarl.lang.sarl.SarlBehavior#getExtends() * @see #getSarlBehavior() * @generated */
Returns the meta object for the containment reference '<code>io.sarl.lang.sarl.SarlBehavior#getExtends Extends</code>'.
getSarlBehavior_Extends
{ "repo_name": "sarl/sarl", "path": "main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/sarl/SarlPackage.java", "license": "apache-2.0", "size": 83913 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,695,075
public void setContainerDataSource(Container newDataSource, Collection<?> visibleIds) { disableContentRefreshing(); if (newDataSource == null) { newDataSource = new IndexedContainer(); } if (visibleIds == null) { visibleIds = new ArrayList<Object>(); } // Retain propertyValueConverters if their corresponding ids are // properties of the new // data source and are of a compatible type if (propertyValueConverters != null) { Collection<?> newPropertyIds = newDataSource .getContainerPropertyIds(); LinkedList<Object> retainableValueConverters = new LinkedList<Object>(); for (Object propertyId : newPropertyIds) { Converter<String, ?> converter = getConverter(propertyId); if (converter != null) { if (typeIsCompatible(converter.getModelType(), newDataSource.getType(propertyId))) { retainableValueConverters.add(propertyId); } } } propertyValueConverters.keySet().retainAll( retainableValueConverters); } // Assures that the data source is ordered by making unordered // containers ordered by wrapping them if (newDataSource instanceof Container.Ordered) { super.setContainerDataSource(newDataSource); } else { super.setContainerDataSource(new ContainerOrderedWrapper( newDataSource)); } // Resets page position currentPageFirstItemId = null; currentPageFirstItemIndex = 0; // Resets column properties if (collapsedColumns != null) { collapsedColumns.clear(); } // don't add the same id twice Collection<Object> col = new LinkedList<Object>(); for (Iterator<?> it = visibleIds.iterator(); it.hasNext();) { Object id = it.next(); if (!col.contains(id)) { col.add(id); } } setVisibleColumns(col.toArray()); // Assure visual refresh resetPageBuffer(); enableContentRefreshing(true); }
void function(Container newDataSource, Collection<?> visibleIds) { disableContentRefreshing(); if (newDataSource == null) { newDataSource = new IndexedContainer(); } if (visibleIds == null) { visibleIds = new ArrayList<Object>(); } if (propertyValueConverters != null) { Collection<?> newPropertyIds = newDataSource .getContainerPropertyIds(); LinkedList<Object> retainableValueConverters = new LinkedList<Object>(); for (Object propertyId : newPropertyIds) { Converter<String, ?> converter = getConverter(propertyId); if (converter != null) { if (typeIsCompatible(converter.getModelType(), newDataSource.getType(propertyId))) { retainableValueConverters.add(propertyId); } } } propertyValueConverters.keySet().retainAll( retainableValueConverters); } if (newDataSource instanceof Container.Ordered) { super.setContainerDataSource(newDataSource); } else { super.setContainerDataSource(new ContainerOrderedWrapper( newDataSource)); } currentPageFirstItemId = null; currentPageFirstItemIndex = 0; if (collapsedColumns != null) { collapsedColumns.clear(); } Collection<Object> col = new LinkedList<Object>(); for (Iterator<?> it = visibleIds.iterator(); it.hasNext();) { Object id = it.next(); if (!col.contains(id)) { col.add(id); } } setVisibleColumns(col.toArray()); resetPageBuffer(); enableContentRefreshing(true); }
/** * Sets the container data source and the columns that will be visible. * Columns are shown in the collection's iteration order. * <p> * Keeps propertyValueConverters if the corresponding id exists in the new * data source and is of a compatible type. * </p> * * @see Table#setContainerDataSource(Container) * @see Table#setVisibleColumns(Object[]) * @see Table#setConverter(Object, Converter<String, ?>) * * @param newDataSource * the new data source. * @param visibleIds * IDs of the visible columns */
Sets the container data source and the columns that will be visible. Columns are shown in the collection's iteration order. Keeps propertyValueConverters if the corresponding id exists in the new data source and is of a compatible type.
setContainerDataSource
{ "repo_name": "jdahlstrom/vaadin.react", "path": "server/src/main/java/com/vaadin/ui/Table.java", "license": "apache-2.0", "size": 223299 }
[ "com.vaadin.data.Container", "com.vaadin.data.util.ContainerOrderedWrapper", "com.vaadin.data.util.IndexedContainer", "com.vaadin.data.util.converter.Converter", "java.util.ArrayList", "java.util.Collection", "java.util.Iterator", "java.util.LinkedList" ]
import com.vaadin.data.Container; import com.vaadin.data.util.ContainerOrderedWrapper; import com.vaadin.data.util.IndexedContainer; import com.vaadin.data.util.converter.Converter; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.LinkedList;
import com.vaadin.data.*; import com.vaadin.data.util.*; import com.vaadin.data.util.converter.*; import java.util.*;
[ "com.vaadin.data", "java.util" ]
com.vaadin.data; java.util;
755,776
SimpleString getManagementAddress();
SimpleString getManagementAddress();
/** * Returns the management address of this server. <br> * Clients can send management messages to this address to manage this server. <br> * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_MANAGEMENT_ADDRESS}. */
Returns the management address of this server. Clients can send management messages to this address to manage this server. Default value is <code>org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_MANAGEMENT_ADDRESS</code>
getManagementAddress
{ "repo_name": "okalmanRH/jboss-activemq-artemis", "path": "artemis-server/src/main/java/org/apache/activemq/artemis/core/config/Configuration.java", "license": "apache-2.0", "size": 36647 }
[ "org.apache.activemq.artemis.api.core.SimpleString" ]
import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.api.core.*;
[ "org.apache.activemq" ]
org.apache.activemq;
805,838
public void setFocusedWindow(Activity activity) { setFocusedWindow(activity.getWindow().getDecorView()); }
void function(Activity activity) { setFocusedWindow(activity.getWindow().getDecorView()); }
/** * Invoke this method to change the currently focused window. * * @param activity The activity whose view hierarchy/window hasfocus, * or null to remove focus */
Invoke this method to change the currently focused window
setFocusedWindow
{ "repo_name": "nbonnec/Redface", "path": "app/src/main/java/com/ayuget/redface/util/ViewServer.java", "license": "apache-2.0", "size": 26299 }
[ "android.app.Activity" ]
import android.app.Activity;
import android.app.*;
[ "android.app" ]
android.app;
1,219,380
public void deployArtifacts(List<Artifact> artifactsToDeploy) { artifactsToDeploy.forEach(artifactToDeploy -> { LifecycleEvent lifecycleEvent = new LifecycleEvent(artifactToDeploy, new Date(), LifecycleEvent.STATE.BEFORE_START_EVENT); try { fireLifecycleEvent(lifecycleEvent); Deployer deployer = getDeployer(artifactToDeploy.getType()); if (deployer != null) { logger.debug("Deploying artifact {} using {} deployer", artifactToDeploy.getName(), deployer.getClass().getName()); Object artifactKey = deployer.deploy(artifactToDeploy); if (artifactKey != null) { artifactToDeploy.setKey(artifactKey); addToDeployedArtifacts(artifactToDeploy); } else { throw new CarbonDeploymentException("Deployed artifact key is null for : " + artifactToDeploy.getName()); } } else { throw new CarbonDeploymentException("Deployer instance cannot be found for the type : " + artifactToDeploy.getType()); } } catch (CarbonDeploymentException e) { logger.error("Error while deploying artifacts", e); addToFaultyArtifacts(artifactToDeploy); StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); lifecycleEvent.setTraceContent("Error while deploying artifact. \n" + sw.toString()); lifecycleEvent.setDeploymentResult(LifecycleEvent.RESULT.FAILED); } //reuse the previously created object lifecycleEvent.setState(LifecycleEvent.STATE.AFTER_START_EVENT); fireLifecycleEvent(lifecycleEvent); }); }
void function(List<Artifact> artifactsToDeploy) { artifactsToDeploy.forEach(artifactToDeploy -> { LifecycleEvent lifecycleEvent = new LifecycleEvent(artifactToDeploy, new Date(), LifecycleEvent.STATE.BEFORE_START_EVENT); try { fireLifecycleEvent(lifecycleEvent); Deployer deployer = getDeployer(artifactToDeploy.getType()); if (deployer != null) { logger.debug(STR, artifactToDeploy.getName(), deployer.getClass().getName()); Object artifactKey = deployer.deploy(artifactToDeploy); if (artifactKey != null) { artifactToDeploy.setKey(artifactKey); addToDeployedArtifacts(artifactToDeploy); } else { throw new CarbonDeploymentException(STR + artifactToDeploy.getName()); } } else { throw new CarbonDeploymentException(STR + artifactToDeploy.getType()); } } catch (CarbonDeploymentException e) { logger.error(STR, e); addToFaultyArtifacts(artifactToDeploy); StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); lifecycleEvent.setTraceContent(STR + sw.toString()); lifecycleEvent.setDeploymentResult(LifecycleEvent.RESULT.FAILED); } lifecycleEvent.setState(LifecycleEvent.STATE.AFTER_START_EVENT); fireLifecycleEvent(lifecycleEvent); }); }
/** * Deploy the artifacts found in the artifacts to deploy list. * * @param artifactsToDeploy list of artifacts to deploy */
Deploy the artifacts found in the artifacts to deploy list
deployArtifacts
{ "repo_name": "Shakila/carbon-deployment", "path": "components/org.wso2.carbon.deployment.engine/src/main/java/org/wso2/carbon/deployment/engine/internal/DeploymentEngine.java", "license": "apache-2.0", "size": 18276 }
[ "java.io.PrintWriter", "java.io.StringWriter", "java.util.Date", "java.util.List", "org.wso2.carbon.deployment.engine.Artifact", "org.wso2.carbon.deployment.engine.Deployer", "org.wso2.carbon.deployment.engine.LifecycleEvent", "org.wso2.carbon.deployment.engine.exception.CarbonDeploymentException" ]
import java.io.PrintWriter; import java.io.StringWriter; import java.util.Date; import java.util.List; import org.wso2.carbon.deployment.engine.Artifact; import org.wso2.carbon.deployment.engine.Deployer; import org.wso2.carbon.deployment.engine.LifecycleEvent; import org.wso2.carbon.deployment.engine.exception.CarbonDeploymentException;
import java.io.*; import java.util.*; import org.wso2.carbon.deployment.engine.*; import org.wso2.carbon.deployment.engine.exception.*;
[ "java.io", "java.util", "org.wso2.carbon" ]
java.io; java.util; org.wso2.carbon;
32,222
public void setHighlight(Color highlight) { super.setHighlight(highlight); WellSampleNode node; Iterator i = samples.iterator(); while (i.hasNext()) { node = (WellSampleNode) i.next(); node.setHighlight(highlight); } }
void function(Color highlight) { super.setHighlight(highlight); WellSampleNode node; Iterator i = samples.iterator(); while (i.hasNext()) { node = (WellSampleNode) i.next(); node.setHighlight(highlight); } }
/** * Overridden to make sure that the default color is set. * @see ImageSet#setHighlight(Color) */
Overridden to make sure that the default color is set
setHighlight
{ "repo_name": "rleigh-dundee/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/dataBrowser/browser/WellImageSet.java", "license": "gpl-2.0", "size": 10286 }
[ "java.awt.Color", "java.util.Iterator" ]
import java.awt.Color; import java.util.Iterator;
import java.awt.*; import java.util.*;
[ "java.awt", "java.util" ]
java.awt; java.util;
2,469,769
private List<Provider> getProviderList() { List<Provider> providerList = new ArrayList<Provider>(); XCN[] xcns = pv1.getAttendingDoctor(); for(XCN xcn: xcns){ Provider provider = new Provider(); provider.setProviderId(xcn.getIDNumber().getValue()); provider.setProvNameFirst(xcn.getGivenName().getValue()); provider.setProvNameLast(xcn.getFamilyLastName().getName()); provider.setProvNameMiddle(xcn.getMiddleInitialOrName().getValue()); provider.setProvNameSuffix(xcn.getSuffixEgJRorIII().getValue()); provider.setProvNameTitle(xcn.getPrefixEgDR().getValue()); providerList.add(provider); } return providerList; }
List<Provider> function() { List<Provider> providerList = new ArrayList<Provider>(); XCN[] xcns = pv1.getAttendingDoctor(); for(XCN xcn: xcns){ Provider provider = new Provider(); provider.setProviderId(xcn.getIDNumber().getValue()); provider.setProvNameFirst(xcn.getGivenName().getValue()); provider.setProvNameLast(xcn.getFamilyLastName().getName()); provider.setProvNameMiddle(xcn.getMiddleInitialOrName().getValue()); provider.setProvNameSuffix(xcn.getSuffixEgJRorIII().getValue()); provider.setProvNameTitle(xcn.getPrefixEgDR().getValue()); providerList.add(provider); } return providerList; }
/** * Gets the ProviderList from the PID segment for a particular patient * @return List<Provider> */
Gets the ProviderList from the PID segment for a particular patient
getProviderList
{ "repo_name": "jembi/openxds", "path": "openxds-core/src/main/java/org/openhealthtools/openxds/registry/HL7v231ToBaseConvertor.java", "license": "apache-2.0", "size": 27333 }
[ "com.misyshealthcare.connect.base.clinicaldata.Provider", "java.util.ArrayList", "java.util.List" ]
import com.misyshealthcare.connect.base.clinicaldata.Provider; import java.util.ArrayList; import java.util.List;
import com.misyshealthcare.connect.base.clinicaldata.*; import java.util.*;
[ "com.misyshealthcare.connect", "java.util" ]
com.misyshealthcare.connect; java.util;
1,904,085
public String formatMessage(String key, Object... params) { return Tr.formatMessage(tc, key, params); }
String function(String key, Object... params) { return Tr.formatMessage(tc, key, params); }
/** * Format a message. * * @param key message key for the application manager messages file. * @param params message parameters. * @return the translated message. */
Format a message
formatMessage
{ "repo_name": "OpenLiberty/open-liberty", "path": "dev/com.ibm.ws.app.manager/src/com/ibm/ws/app/manager/AppMessageHelper.java", "license": "epl-1.0", "size": 3128 }
[ "com.ibm.websphere.ras.Tr" ]
import com.ibm.websphere.ras.Tr;
import com.ibm.websphere.ras.*;
[ "com.ibm.websphere" ]
com.ibm.websphere;
1,945,753
EClass getIntegerDefinition();
EClass getIntegerDefinition();
/** * Returns the meta object for class '{@link org.obeonetwork.m2doc.genconf.IntegerDefinition <em>Integer Definition</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @return the meta object for class '<em>Integer Definition</em>'. * @see org.obeonetwork.m2doc.genconf.IntegerDefinition * @generated */
Returns the meta object for class '<code>org.obeonetwork.m2doc.genconf.IntegerDefinition Integer Definition</code>'.
getIntegerDefinition
{ "repo_name": "ObeoNetwork/M2Doc", "path": "plugins/org.obeonetwork.m2doc.genconf/src-gen/org/obeonetwork/m2doc/genconf/GenconfPackage.java", "license": "epl-1.0", "size": 31401 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,360,667
private ImmutablePair<RhythmVerificationActivity.Cluster, Long> searchClosestPoint(final long centerMean1, final long centerMean2) { assert centerMean1 >= 0; assert centerMean2 >= 0; Long closestPoint = null; long distance = Long.MAX_VALUE; RhythmVerificationActivity.Cluster targetCluster = null; for (final Long interval : this.intervals) { final long dist1 = interval - centerMean1; if (dist1 < distance) { closestPoint = interval; distance = dist1; targetCluster = RhythmVerificationActivity.Cluster.SHORT; } final long dist2 = centerMean2 - interval; if (dist2 < distance) { closestPoint = interval; distance = dist2; targetCluster = RhythmVerificationActivity.Cluster.LONG; } } return new ImmutablePair<>(targetCluster, closestPoint); }
ImmutablePair<RhythmVerificationActivity.Cluster, Long> function(final long centerMean1, final long centerMean2) { assert centerMean1 >= 0; assert centerMean2 >= 0; Long closestPoint = null; long distance = Long.MAX_VALUE; RhythmVerificationActivity.Cluster targetCluster = null; for (final Long interval : this.intervals) { final long dist1 = interval - centerMean1; if (dist1 < distance) { closestPoint = interval; distance = dist1; targetCluster = RhythmVerificationActivity.Cluster.SHORT; } final long dist2 = centerMean2 - interval; if (dist2 < distance) { closestPoint = interval; distance = dist2; targetCluster = RhythmVerificationActivity.Cluster.LONG; } } return new ImmutablePair<>(targetCluster, closestPoint); }
/** * Returns the interval whose length is closest to the "Short" or "Long" cluster to the "Short" or "Long" cluster * * @param centerMean1 The mean of the length of the intervals in the "Short" cluster * @param centerMean2 The mean of the length of the intervals in the "Long" cluster * @return A pair of which the left value denotes the cluster the interval belongs to and the right value denotes the length of the cluster */
Returns the interval whose length is closest to the "Short" or "Long" cluster to the "Short" or "Long" cluster
searchClosestPoint
{ "repo_name": "ericcornelissen/NervousFish", "path": "app/src/main/java/com/nervousfish/nervousfish/activities/RhythmVerificationActivity.java", "license": "lgpl-3.0", "size": 17998 }
[ "org.apache.commons.lang3.tuple.ImmutablePair" ]
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.*;
[ "org.apache.commons" ]
org.apache.commons;
2,275,667
private static int getPosition() { return TestData.getInt(); }
static int function() { return TestData.getInt(); }
/** * Return a random position. * * @return the position */
Return a random position
getPosition
{ "repo_name": "dubex/concourse", "path": "concourse-server/src/test/java/com/cinchapi/concourse/util/LongBitSetTest.java", "license": "apache-2.0", "size": 2835 }
[ "com.cinchapi.concourse.util.TestData" ]
import com.cinchapi.concourse.util.TestData;
import com.cinchapi.concourse.util.*;
[ "com.cinchapi.concourse" ]
com.cinchapi.concourse;
2,763,555
public Criterion getWhereCriterion() { return whereCriterion; }
Criterion function() { return whereCriterion; }
/** * Gets the where criteria. * * @return the where criteria */
Gets the where criteria
getWhereCriterion
{ "repo_name": "badgerwithagun/morf", "path": "morf-core/src/main/java/org/alfasoftware/morf/sql/AbstractSelectStatement.java", "license": "apache-2.0", "size": 22708 }
[ "org.alfasoftware.morf.sql.element.Criterion" ]
import org.alfasoftware.morf.sql.element.Criterion;
import org.alfasoftware.morf.sql.element.*;
[ "org.alfasoftware.morf" ]
org.alfasoftware.morf;
1,047,339
public InputStream newInputStream(int index) throws IOException { synchronized (DiskLruCache.this) { if (entry.currentEditor != this) { throw new IllegalStateException(); } if (!entry.readable) { return null; } return new FileInputStream(entry.getCleanFile(index)); } }
InputStream function(int index) throws IOException { synchronized (DiskLruCache.this) { if (entry.currentEditor != this) { throw new IllegalStateException(); } if (!entry.readable) { return null; } return new FileInputStream(entry.getCleanFile(index)); } }
/** * Returns an unbuffered input stream to read the last committed value, * or null if no value has been committed. */
Returns an unbuffered input stream to read the last committed value, or null if no value has been committed
newInputStream
{ "repo_name": "tinyvampirepudge/Android_Basis_Demo", "path": "Android_Basis_Demo/app/src/main/java/com/tiny/demo/firstlinecode/kfysts/chapter12/ryg/DiskLruCache.java", "license": "apache-2.0", "size": 33936 }
[ "java.io.FileInputStream", "java.io.IOException", "java.io.InputStream" ]
import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
1,912,790
StructureGenerator sg = new StructureGenerator(); String[] args = new String[]{"-maxDepth", "2", "-minWidth", "1", "-maxWidth", "2", "-numOfFiles", "2", "-avgFileSize", "1", "-outDir", OUT_DIR, "-seed", "1"}; final int MAX_DEPTH = 1; final int MIN_WIDTH = 3; final int MAX_WIDTH = 5; final int NUM_OF_FILES = 7; final int AVG_FILE_SIZE = 9; final int SEED = 13; try { // successful case assertEquals(0, sg.run(args)); BufferedReader in = new BufferedReader(new FileReader(DIR_STRUCTURE_FILE)); assertEquals(DIR_STRUCTURE_FIRST_LINE, in.readLine()); assertEquals(DIR_STRUCTURE_SECOND_LINE, in.readLine()); assertEquals(null, in.readLine()); in.close(); in = new BufferedReader(new FileReader(FILE_STRUCTURE_FILE)); assertEquals(FILE_STRUCTURE_FIRST_LINE, in.readLine()); assertEquals(FILE_STRUCTURE_SECOND_LINE, in.readLine()); assertEquals(null, in.readLine()); in.close(); String oldArg = args[MAX_DEPTH]; args[MAX_DEPTH] = "0"; assertEquals(-1, sg.run(args)); args[MAX_DEPTH] = oldArg; oldArg = args[MIN_WIDTH]; args[MIN_WIDTH] = "-1"; assertEquals(-1, sg.run(args)); args[MIN_WIDTH] = oldArg; oldArg = args[MAX_WIDTH]; args[MAX_WIDTH] = "-1"; assertEquals(-1, sg.run(args)); args[MAX_WIDTH] = oldArg; oldArg = args[NUM_OF_FILES]; args[NUM_OF_FILES] = "-1"; assertEquals(-1, sg.run(args)); args[NUM_OF_FILES] = oldArg; oldArg = args[NUM_OF_FILES]; args[NUM_OF_FILES] = "-1"; assertEquals(-1, sg.run(args)); args[NUM_OF_FILES] = oldArg; oldArg = args[AVG_FILE_SIZE]; args[AVG_FILE_SIZE] = "-1"; assertEquals(-1, sg.run(args)); args[AVG_FILE_SIZE] = oldArg; oldArg = args[SEED]; args[SEED] = "34.d4"; assertEquals(-1, sg.run(args)); args[SEED] = oldArg; } finally { DIR_STRUCTURE_FILE.delete(); FILE_STRUCTURE_FILE.delete(); } }
StructureGenerator sg = new StructureGenerator(); String[] args = new String[]{STR, "2", STR, "1", STR, "2", STR, "2", STR, "1", STR, OUT_DIR, "-seed", "1"}; final int MAX_DEPTH = 1; final int MIN_WIDTH = 3; final int MAX_WIDTH = 5; final int NUM_OF_FILES = 7; final int AVG_FILE_SIZE = 9; final int SEED = 13; try { assertEquals(0, sg.run(args)); BufferedReader in = new BufferedReader(new FileReader(DIR_STRUCTURE_FILE)); assertEquals(DIR_STRUCTURE_FIRST_LINE, in.readLine()); assertEquals(DIR_STRUCTURE_SECOND_LINE, in.readLine()); assertEquals(null, in.readLine()); in.close(); in = new BufferedReader(new FileReader(FILE_STRUCTURE_FILE)); assertEquals(FILE_STRUCTURE_FIRST_LINE, in.readLine()); assertEquals(FILE_STRUCTURE_SECOND_LINE, in.readLine()); assertEquals(null, in.readLine()); in.close(); String oldArg = args[MAX_DEPTH]; args[MAX_DEPTH] = "0"; assertEquals(-1, sg.run(args)); args[MAX_DEPTH] = oldArg; oldArg = args[MIN_WIDTH]; args[MIN_WIDTH] = "-1"; assertEquals(-1, sg.run(args)); args[MIN_WIDTH] = oldArg; oldArg = args[MAX_WIDTH]; args[MAX_WIDTH] = "-1"; assertEquals(-1, sg.run(args)); args[MAX_WIDTH] = oldArg; oldArg = args[NUM_OF_FILES]; args[NUM_OF_FILES] = "-1"; assertEquals(-1, sg.run(args)); args[NUM_OF_FILES] = oldArg; oldArg = args[NUM_OF_FILES]; args[NUM_OF_FILES] = "-1"; assertEquals(-1, sg.run(args)); args[NUM_OF_FILES] = oldArg; oldArg = args[AVG_FILE_SIZE]; args[AVG_FILE_SIZE] = "-1"; assertEquals(-1, sg.run(args)); args[AVG_FILE_SIZE] = oldArg; oldArg = args[SEED]; args[SEED] = "34.d4"; assertEquals(-1, sg.run(args)); args[SEED] = oldArg; } finally { DIR_STRUCTURE_FILE.delete(); FILE_STRUCTURE_FILE.delete(); } }
/** * Test if the structure generator works fine */
Test if the structure generator works fine
testStructureGenerator
{ "repo_name": "robzor92/hops", "path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/loadGenerator/TestLoadGenerator.java", "license": "apache-2.0", "size": 9321 }
[ "java.io.BufferedReader", "java.io.FileReader", "org.junit.Assert" ]
import java.io.BufferedReader; import java.io.FileReader; import org.junit.Assert;
import java.io.*; import org.junit.*;
[ "java.io", "org.junit" ]
java.io; org.junit;
875,831
return all; } /** * Sets the value of the all property. * * @param value * allowed object is * {@link Marker }
return all; } /** * Sets the value of the all property. * * @param value * allowed object is * {@link Marker }
/** * Gets the value of the all property. * * @return * possible object is * {@link Marker } * */
Gets the value of the all property
getAll
{ "repo_name": "dvbu-test/PDTool", "path": "CISAdminApi7.0.0/src/com/compositesw/services/system/admin/archive/ArchiveDomainList.java", "license": "bsd-3-clause", "size": 2131 }
[ "com.compositesw.services.system.util.common.Marker" ]
import com.compositesw.services.system.util.common.Marker;
import com.compositesw.services.system.util.common.*;
[ "com.compositesw.services" ]
com.compositesw.services;
2,153,112
public ExpressionClause<ProcessorDefinition<Type>> setHeader(String name) { ExpressionClause<ProcessorDefinition<Type>> clause = new ExpressionClause<ProcessorDefinition<Type>>(this); SetHeaderDefinition answer = new SetHeaderDefinition(name, clause); addOutput(answer); return clause; }
ExpressionClause<ProcessorDefinition<Type>> function(String name) { ExpressionClause<ProcessorDefinition<Type>> clause = new ExpressionClause<ProcessorDefinition<Type>>(this); SetHeaderDefinition answer = new SetHeaderDefinition(name, clause); addOutput(answer); return clause; }
/** * Adds a processor which sets the header on the IN message * * @param name the header name * @return a expression builder clause to set the header */
Adds a processor which sets the header on the IN message
setHeader
{ "repo_name": "gilfernandes/camel", "path": "camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java", "license": "apache-2.0", "size": 165071 }
[ "org.apache.camel.builder.ExpressionClause" ]
import org.apache.camel.builder.ExpressionClause;
import org.apache.camel.builder.*;
[ "org.apache.camel" ]
org.apache.camel;
2,369,481
@ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String factoryName, String integrationRuntimeName, String nodeName);
@ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String factoryName, String integrationRuntimeName, String nodeName);
/** * Deletes a self-hosted integration runtime node. * * @param resourceGroupName The resource group name. * @param factoryName The factory name. * @param integrationRuntimeName The integration runtime name. * @param nodeName The integration runtime node name. * @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. */
Deletes a self-hosted integration runtime node
delete
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/IntegrationRuntimeNodesClient.java", "license": "mit", "size": 8593 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.*;
[ "com.azure.core" ]
com.azure.core;
1,831,573
public E sample(Random rand) { double total = totalCount(); if (total <= 0.0) { throw new RuntimeException(String.format("Attempting to sample() with totalCount() %.3f\n", total)); } double sum = 0.0; double r = rand.nextDouble(); for (Map.Entry<E, Double> entry : entries.entrySet()) { double count = entry.getValue(); double frac = count / total; sum += frac; if (r < sum) { return entry.getKey(); } } throw new IllegalStateException("Shoudl've have returned a sample by now...."); }
E function(Random rand) { double total = totalCount(); if (total <= 0.0) { throw new RuntimeException(String.format(STR, total)); } double sum = 0.0; double r = rand.nextDouble(); for (Map.Entry<E, Double> entry : entries.entrySet()) { double count = entry.getValue(); double frac = count / total; sum += frac; if (r < sum) { return entry.getKey(); } } throw new IllegalStateException(STR); }
/** * Will return a sample from the counter, will throw exception if any of the * counts are < 0.0 or if the totalCount() <= 0.0 * * @return * * @author aria42 */
Will return a sample from the counter, will throw exception if any of the counts are < 0.0 or if the totalCount() <= 0.0
sample
{ "repo_name": "tberg12/murphy", "path": "src/tberg/murphy/counter/Counter.java", "license": "apache-2.0", "size": 15303 }
[ "java.util.Map", "java.util.Random" ]
import java.util.Map; import java.util.Random;
import java.util.*;
[ "java.util" ]
java.util;
2,857,206
public void endElement (QName element, Augmentations augs) throws XNIException { if (DEBUG_EVENTS) { System.out.println ("==>endElement ("+element.rawname+")"); } if (!fDeferNodeExpansion) { // REVISIT: Should this happen after we call the filter? if (augs != null && fDocumentImpl != null && (fNamespaceAware || fStorePSVI)) { ElementPSVI elementPSVI = (ElementPSVI) augs.getItem(Constants.ELEMENT_PSVI); if (elementPSVI != null) { // Updating TypeInfo. If the declared type is a union the // [member type definition] will only be available at the // end of an element. if (fNamespaceAware) { XSTypeDefinition type = elementPSVI.getMemberTypeDefinition(); if (type == null) { type = elementPSVI.getTypeDefinition(); } ((ElementNSImpl)fCurrentNode).setType(type); } if (fStorePSVI) { ((PSVIElementNSImpl)fCurrentNode).setPSVI (elementPSVI); } } } if (fDOMFilter != null) { if (fFilterReject) { if (fRejectedElementDepth-- == 0) { fFilterReject = false; } return; } if (!fSkippedElemStack.isEmpty()) { if (fSkippedElemStack.pop() == Boolean.TRUE) { return; } } setCharacterData (false); if ((fCurrentNode != fRoot) && !fInEntityRef && (fDOMFilter.getWhatToShow () & NodeFilter.SHOW_ELEMENT)!=0) { short code = fDOMFilter.acceptNode (fCurrentNode); switch (code) { case LSParserFilter.FILTER_INTERRUPT:{ throw Abort.INSTANCE; } case LSParserFilter.FILTER_REJECT:{ Node parent = fCurrentNode.getParentNode (); parent.removeChild (fCurrentNode); fCurrentNode = parent; return; } case LSParserFilter.FILTER_SKIP: { // make sure that if any char data is available // the fFirstChunk is true, so that if the next event // is characters(), and the last node is text, we will copy // the value already in the text node to fStringBuffer // (not to lose it). fFirstChunk = true; // replace children Node parent = fCurrentNode.getParentNode (); NodeList ls = fCurrentNode.getChildNodes (); int length = ls.getLength (); for (int i=0;i<length;i++) { parent.appendChild (ls.item (0)); } parent.removeChild (fCurrentNode); fCurrentNode = parent; return; } default: { } } } fCurrentNode = fCurrentNode.getParentNode (); } // end-if DOMFilter else { setCharacterData (false); fCurrentNode = fCurrentNode.getParentNode (); } } else { if (augs != null) { ElementPSVI elementPSVI = (ElementPSVI) augs.getItem(Constants.ELEMENT_PSVI); if (elementPSVI != null) { // Setting TypeInfo. If the declared type is a union the // [member type definition] will only be available at the // end of an element. XSTypeDefinition type = elementPSVI.getMemberTypeDefinition(); if (type == null) { type = elementPSVI.getTypeDefinition(); } fDeferredDocumentImpl.setTypeInfo(fCurrentNodeIndex, type); } } fCurrentNodeIndex = fDeferredDocumentImpl.getParentNode (fCurrentNodeIndex, false); } } // endElement(QName)
void function (QName element, Augmentations augs) throws XNIException { if (DEBUG_EVENTS) { System.out.println (STR+element.rawname+")"); } if (!fDeferNodeExpansion) { if (augs != null && fDocumentImpl != null && (fNamespaceAware fStorePSVI)) { ElementPSVI elementPSVI = (ElementPSVI) augs.getItem(Constants.ELEMENT_PSVI); if (elementPSVI != null) { if (fNamespaceAware) { XSTypeDefinition type = elementPSVI.getMemberTypeDefinition(); if (type == null) { type = elementPSVI.getTypeDefinition(); } ((ElementNSImpl)fCurrentNode).setType(type); } if (fStorePSVI) { ((PSVIElementNSImpl)fCurrentNode).setPSVI (elementPSVI); } } } if (fDOMFilter != null) { if (fFilterReject) { if (fRejectedElementDepth-- == 0) { fFilterReject = false; } return; } if (!fSkippedElemStack.isEmpty()) { if (fSkippedElemStack.pop() == Boolean.TRUE) { return; } } setCharacterData (false); if ((fCurrentNode != fRoot) && !fInEntityRef && (fDOMFilter.getWhatToShow () & NodeFilter.SHOW_ELEMENT)!=0) { short code = fDOMFilter.acceptNode (fCurrentNode); switch (code) { case LSParserFilter.FILTER_INTERRUPT:{ throw Abort.INSTANCE; } case LSParserFilter.FILTER_REJECT:{ Node parent = fCurrentNode.getParentNode (); parent.removeChild (fCurrentNode); fCurrentNode = parent; return; } case LSParserFilter.FILTER_SKIP: { fFirstChunk = true; Node parent = fCurrentNode.getParentNode (); NodeList ls = fCurrentNode.getChildNodes (); int length = ls.getLength (); for (int i=0;i<length;i++) { parent.appendChild (ls.item (0)); } parent.removeChild (fCurrentNode); fCurrentNode = parent; return; } default: { } } } fCurrentNode = fCurrentNode.getParentNode (); } else { setCharacterData (false); fCurrentNode = fCurrentNode.getParentNode (); } } else { if (augs != null) { ElementPSVI elementPSVI = (ElementPSVI) augs.getItem(Constants.ELEMENT_PSVI); if (elementPSVI != null) { XSTypeDefinition type = elementPSVI.getMemberTypeDefinition(); if (type == null) { type = elementPSVI.getTypeDefinition(); } fDeferredDocumentImpl.setTypeInfo(fCurrentNodeIndex, type); } } fCurrentNodeIndex = fDeferredDocumentImpl.getParentNode (fCurrentNodeIndex, false); } }
/** * The end of an element. * * @param element The name of the element. * @param augs Additional information that may include infoset augmentations * * @throws XNIException Thrown by handler to signal an error. */
The end of an element
endElement
{ "repo_name": "AaronZhangL/SplitCharater", "path": "xerces-2_11_0/src/org/apache/xerces/parsers/AbstractDOMParser.java", "license": "gpl-2.0", "size": 108450 }
[ "org.apache.xerces.dom.ElementNSImpl", "org.apache.xerces.dom.PSVIElementNSImpl", "org.apache.xerces.impl.Constants", "org.apache.xerces.xni.Augmentations", "org.apache.xerces.xni.QName", "org.apache.xerces.xni.XNIException", "org.apache.xerces.xs.ElementPSVI", "org.apache.xerces.xs.XSTypeDefinition", "org.w3c.dom.Node", "org.w3c.dom.NodeList", "org.w3c.dom.ls.LSParserFilter", "org.w3c.dom.traversal.NodeFilter" ]
import org.apache.xerces.dom.ElementNSImpl; import org.apache.xerces.dom.PSVIElementNSImpl; import org.apache.xerces.impl.Constants; import org.apache.xerces.xni.Augmentations; import org.apache.xerces.xni.QName; import org.apache.xerces.xni.XNIException; import org.apache.xerces.xs.ElementPSVI; import org.apache.xerces.xs.XSTypeDefinition; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.w3c.dom.ls.LSParserFilter; import org.w3c.dom.traversal.NodeFilter;
import org.apache.xerces.dom.*; import org.apache.xerces.impl.*; import org.apache.xerces.xni.*; import org.apache.xerces.xs.*; import org.w3c.dom.*; import org.w3c.dom.ls.*; import org.w3c.dom.traversal.*;
[ "org.apache.xerces", "org.w3c.dom" ]
org.apache.xerces; org.w3c.dom;
118,512
public StepActionDto createInfo(final String message1, final String message2, final String message3, final boolean autoLog, final boolean takeSnapShot) { return info(message1, message2, message3, autoLog, takeSnapShot, create()); }
StepActionDto function(final String message1, final String message2, final String message3, final boolean autoLog, final boolean takeSnapShot) { return info(message1, message2, message3, autoLog, takeSnapShot, create()); }
/** * Create info step action dto. * * @param message1 the message 1 * @param message2 the message 2 * @param message3 the message 3 * @param autoLog the auto log * @param takeSnapShot the take snap shot * @return the step action dto */
Create info step action dto
createInfo
{ "repo_name": "c3riley/Testah", "path": "testah-junit/src/main/java/org/testah/framework/dto/StepActionHelper.java", "license": "mit", "size": 15543 }
[ "org.testah.client.dto.StepActionDto" ]
import org.testah.client.dto.StepActionDto;
import org.testah.client.dto.*;
[ "org.testah.client" ]
org.testah.client;
2,647,696
void gracefulShutdown( final BluetoothServerListener bluetoothServerListener) { if (!shutdown.get()) { shutdown.set(true); Collection<BluetoothStreamReaderThread> connectionMapValues = connectionMap .values(); for (BluetoothStreamReaderThread bluetoothStreamReaderThread : connectionMapValues) { bluetoothStreamReaderThread.closeConnection(); } System.out.println("Number of open connections at shutdown: " + connectionMap.size()); if (bluetoothServerListener != null) { bluetoothServerListener.shutdown(); } } }
void gracefulShutdown( final BluetoothServerListener bluetoothServerListener) { if (!shutdown.get()) { shutdown.set(true); Collection<BluetoothStreamReaderThread> connectionMapValues = connectionMap .values(); for (BluetoothStreamReaderThread bluetoothStreamReaderThread : connectionMapValues) { bluetoothStreamReaderThread.closeConnection(); } System.out.println(STR + connectionMap.size()); if (bluetoothServerListener != null) { bluetoothServerListener.shutdown(); } } }
/** * When the [STOP] command is sent, the server will gracefully shut down. * This means it will loop through the connectionList and shut down all * active connections before taking down the Bluetooth server. * * @param bluetoothServerListener */
When the [STOP] command is sent, the server will gracefully shut down. This means it will loop through the connectionList and shut down all active connections before taking down the Bluetooth server
gracefulShutdown
{ "repo_name": "yuuhhe/microlog", "path": "net/sf/microlog/midp/bluetooth/server/BluetoothConnectionHandler.java", "license": "apache-2.0", "size": 2327 }
[ "java.util.Collection", "net.sf.microlog.midp.bluetooth.BluetoothServerListener" ]
import java.util.Collection; import net.sf.microlog.midp.bluetooth.BluetoothServerListener;
import java.util.*; import net.sf.microlog.midp.bluetooth.*;
[ "java.util", "net.sf.microlog" ]
java.util; net.sf.microlog;
592,693
static Multipart wrapRelatedParts(final String htmlContent, final Map<String, BodyPart> images) throws MessagingException { final Multipart multiPart = new MimeMultipart("related"); multiPart.addBodyPart(wrapHtmlBodyPart(htmlContent)); for (final String key : images.keySet()) { if (htmlContent.contains("cid:" + key)) multiPart.addBodyPart(images.get(key)); } return multiPart; }
static Multipart wrapRelatedParts(final String htmlContent, final Map<String, BodyPart> images) throws MessagingException { final Multipart multiPart = new MimeMultipart(STR); multiPart.addBodyPart(wrapHtmlBodyPart(htmlContent)); for (final String key : images.keySet()) { if (htmlContent.contains("cid:" + key)) multiPart.addBodyPart(images.get(key)); } return multiPart; }
/** * Wraps the HTML content and images in a MultiPart as far as the images are mentioned in the * HTML content. * * @param htmlContent will be wrapped in a BodyPart before it is added to the MultiPart * @param images for each key mentioned as "<code>cid:<i>key</i></code>" in htmlContent, * the value is added to the MultiPart * @return a MultiPart with HTML and zero or more images * @throws MessagingException */
Wraps the HTML content and images in a MultiPart as far as the images are mentioned in the HTML content
wrapRelatedParts
{ "repo_name": "DANS-KNAW/dccd-legacy-libs", "path": "lang/src/main/java/nl/knaw/dans/common/lang/mail/MessageWrapper.java", "license": "apache-2.0", "size": 4022 }
[ "java.util.Map", "javax.mail.BodyPart", "javax.mail.MessagingException", "javax.mail.Multipart", "javax.mail.internet.MimeMultipart" ]
import java.util.Map; import javax.mail.BodyPart; import javax.mail.MessagingException; import javax.mail.Multipart; import javax.mail.internet.MimeMultipart;
import java.util.*; import javax.mail.*; import javax.mail.internet.*;
[ "java.util", "javax.mail" ]
java.util; javax.mail;
1,296,034
List<String> descriptors = new ArrayList<>(); addDescriptor(descriptors, BigtableTableAdminGrpc.getServiceDescriptor()); addDescriptor(descriptors, BigtableGrpc.getServiceDescriptor()); Tracing.getExportComponent().getSampledSpanStore().registerSpanNamesForCollection(descriptors); }
List<String> descriptors = new ArrayList<>(); addDescriptor(descriptors, BigtableTableAdminGrpc.getServiceDescriptor()); addDescriptor(descriptors, BigtableGrpc.getServiceDescriptor()); Tracing.getExportComponent().getSampledSpanStore().registerSpanNamesForCollection(descriptors); }
/** * This is a one time setup for grpcz pages. This adds all of the methods to the Tracing * environment required to show a consistent set of methods relating to Cloud Bigtable on the * grpcz page. If HBase artifacts are present, this will add tracing metadata for HBase methods. */
This is a one time setup for grpcz pages. This adds all of the methods to the Tracing environment required to show a consistent set of methods relating to Cloud Bigtable on the grpcz page. If HBase artifacts are present, this will add tracing metadata for HBase methods
setupTracingConfig
{ "repo_name": "sduskis/cloud-bigtable-client", "path": "bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/util/TracingUtilities.java", "license": "apache-2.0", "size": 3248 }
[ "com.google.bigtable.admin.v2.BigtableTableAdminGrpc", "com.google.bigtable.v2.BigtableGrpc", "io.opencensus.trace.Tracing", "java.util.ArrayList", "java.util.List" ]
import com.google.bigtable.admin.v2.BigtableTableAdminGrpc; import com.google.bigtable.v2.BigtableGrpc; import io.opencensus.trace.Tracing; import java.util.ArrayList; import java.util.List;
import com.google.bigtable.admin.v2.*; import com.google.bigtable.v2.*; import io.opencensus.trace.*; import java.util.*;
[ "com.google.bigtable", "io.opencensus.trace", "java.util" ]
com.google.bigtable; io.opencensus.trace; java.util;
408,369
public Object isRegistered(ObjectName objectName) throws IOException;
Object function(ObjectName objectName) throws IOException;
/** * Checks whether the given ObjectName identifies an MBean registered in this MBeanServer. * * @param objectName The ObjectName to be checked. * @return True if an MBean with the specified ObjectName is already registered in the MBeanServer. * @throws IOException If a communication problem occurred. */
Checks whether the given ObjectName identifies an MBean registered in this MBeanServer
isRegistered
{ "repo_name": "xien777/yajsw", "path": "yajsw/ahessian/src/main/java/org/rzo/netty/ahessian/application/jmx/remote/service/AsyncMBeanServerConnection.java", "license": "lgpl-2.1", "size": 23146 }
[ "java.io.IOException", "javax.management.ObjectName" ]
import java.io.IOException; import javax.management.ObjectName;
import java.io.*; import javax.management.*;
[ "java.io", "javax.management" ]
java.io; javax.management;
1,443,178
public TransHopMeta findTransHop( StepMeta from, StepMeta to, boolean disabledToo ) { for ( int i = 0; i < nrTransHops(); i++ ) { TransHopMeta hi = getTransHop( i ); if ( hi.isEnabled() || disabledToo ) { if ( hi.getFromStep() != null && hi.getToStep() != null && hi.getFromStep().equals( from ) && hi.getToStep() .equals( to ) ) { return hi; } } } return null; }
TransHopMeta function( StepMeta from, StepMeta to, boolean disabledToo ) { for ( int i = 0; i < nrTransHops(); i++ ) { TransHopMeta hi = getTransHop( i ); if ( hi.isEnabled() disabledToo ) { if ( hi.getFromStep() != null && hi.getToStep() != null && hi.getFromStep().equals( from ) && hi.getToStep() .equals( to ) ) { return hi; } } } return null; }
/** * Search all hops for a hop where a certain step is at the start and another is at the end. * * @param from * The step at the start of the hop. * @param to * The step at the end of the hop. * @param disabledToo * the disabled too * @return The hop or null if no hop was found. */
Search all hops for a hop where a certain step is at the start and another is at the end
findTransHop
{ "repo_name": "eayoungs/pentaho-kettle", "path": "engine/src/org/pentaho/di/trans/TransMeta.java", "license": "apache-2.0", "size": 221441 }
[ "org.pentaho.di.trans.step.StepMeta" ]
import org.pentaho.di.trans.step.StepMeta;
import org.pentaho.di.trans.step.*;
[ "org.pentaho.di" ]
org.pentaho.di;
2,316,523
@Nonnull public static <T> NumberBinding mapToNumberThenReduce(@Nonnull final ObservableSet<T> items, @Nonnull final Supplier<Number> supplier, @Nonnull final Function<? super T, Number> mapper, @Nonnull final BinaryOperator<Number> reducer) { requireNonNull(items, ERROR_ITEMS_NULL); requireNonNull(reducer, ERROR_REDUCER_NULL); requireNonNull(supplier, ERROR_SUPPLIER_NULL); requireNonNull(mapper, ERROR_MAPPER_NULL); return createDoubleBinding(() -> items.stream().map(mapper).reduce(reducer).orElseGet(supplier).doubleValue(), items); }
static <T> NumberBinding function(@Nonnull final ObservableSet<T> items, @Nonnull final Supplier<Number> supplier, @Nonnull final Function<? super T, Number> mapper, @Nonnull final BinaryOperator<Number> reducer) { requireNonNull(items, ERROR_ITEMS_NULL); requireNonNull(reducer, ERROR_REDUCER_NULL); requireNonNull(supplier, ERROR_SUPPLIER_NULL); requireNonNull(mapper, ERROR_MAPPER_NULL); return createDoubleBinding(() -> items.stream().map(mapper).reduce(reducer).orElseGet(supplier).doubleValue(), items); }
/** * Returns a number binding whose value is the reduction of all elements in the set. The mapper function is applied to each element before reduction. * * @param items the observable set of elements. * @param supplier a {@code Supplier} whose result is returned if no value is present. * @param mapper a non-interfering, stateless function to apply to each element. * @param reducer an associative, non-interfering, stateless function for combining two values. * * @return a number binding */
Returns a number binding whose value is the reduction of all elements in the set. The mapper function is applied to each element before reduction
mapToNumberThenReduce
{ "repo_name": "griffon/griffon", "path": "subprojects/griffon-javafx/src/main/java/griffon/javafx/beans/binding/ReducingBindings.java", "license": "apache-2.0", "size": 249342 }
[ "java.util.Objects", "java.util.function.BinaryOperator", "java.util.function.Function", "java.util.function.Supplier" ]
import java.util.Objects; import java.util.function.BinaryOperator; import java.util.function.Function; import java.util.function.Supplier;
import java.util.*; import java.util.function.*;
[ "java.util" ]
java.util;
509,792
@ColorInt public static int getTabGridDialogUngroupBarBackgroundColor( Context context, boolean isIncognito) { return getTabGridDialogUngroupBarBackgroundColor(context, isIncognito, false); }
static int function( Context context, boolean isIncognito) { return getTabGridDialogUngroupBarBackgroundColor(context, isIncognito, false); }
/** * Returns the color used for the ungroup bar text in tab grid dialog. * * @param context {@link Context} used to retrieve color. * @param isIncognito Whether the color is used for incognito mode. * @return The color for the ungroup bar text in tab grid dialog. */
Returns the color used for the ungroup bar text in tab grid dialog
getTabGridDialogUngroupBarBackgroundColor
{ "repo_name": "scheib/chromium", "path": "chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabUiThemeProvider.java", "license": "bsd-3-clause", "size": 30707 }
[ "android.content.Context" ]
import android.content.Context;
import android.content.*;
[ "android.content" ]
android.content;
1,977,443
@Before public void setUp() { instance1 = DefaultKubevirtInstance.builder() .uid(UID_1) .name(NAME_1) .ports(ImmutableSet.of(PORT_1)) .build(); sameAsInstance1 = DefaultKubevirtInstance.builder() .uid(UID_1) .name(NAME_1) .ports(ImmutableSet.of(PORT_1)) .build(); instance2 = DefaultKubevirtInstance.builder() .uid(UID_2) .name(NAME_2) .ports(ImmutableSet.of(PORT_2)) .build(); }
void function() { instance1 = DefaultKubevirtInstance.builder() .uid(UID_1) .name(NAME_1) .ports(ImmutableSet.of(PORT_1)) .build(); sameAsInstance1 = DefaultKubevirtInstance.builder() .uid(UID_1) .name(NAME_1) .ports(ImmutableSet.of(PORT_1)) .build(); instance2 = DefaultKubevirtInstance.builder() .uid(UID_2) .name(NAME_2) .ports(ImmutableSet.of(PORT_2)) .build(); }
/** * Initial setup for this unit test. */
Initial setup for this unit test
setUp
{ "repo_name": "gkatsikas/onos", "path": "apps/kubevirt-networking/api/src/test/java/org/onosproject/kubevirtnetworking/api/DefaultKubevirtInstanceTest.java", "license": "apache-2.0", "size": 4404 }
[ "com.google.common.collect.ImmutableSet" ]
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.*;
[ "com.google.common" ]
com.google.common;
1,405,445
public void testInvalidHashCode() { Object a = new InvalidHashCodeObject(1, 2); Object b = new InvalidHashCodeObject(1, 2); equalsTester.addEqualityGroup(a, b); try { equalsTester.testEquals(); } catch (AssertionFailedError e) { assertErrorMessage( e, "the Object#hashCode (" + a.hashCode() + ") of " + a + " [group 1, item 1] must be equal to the Object#hashCode (" + b.hashCode() + ") of " + b); return; } fail("Should get invalid hashCode error"); }
void function() { Object a = new InvalidHashCodeObject(1, 2); Object b = new InvalidHashCodeObject(1, 2); equalsTester.addEqualityGroup(a, b); try { equalsTester.testEquals(); } catch (AssertionFailedError e) { assertErrorMessage( e, STR + a.hashCode() + STR + a + STR + b.hashCode() + STR + b); return; } fail(STR); }
/** * Test for an invalid hashCode method, i.e., one that returns different value for objects that * are equal according to the equals method */
Test for an invalid hashCode method, i.e., one that returns different value for objects that are equal according to the equals method
testInvalidHashCode
{ "repo_name": "google/guava", "path": "guava-testlib/test/com/google/common/testing/EqualsTesterTest.java", "license": "apache-2.0", "size": 13068 }
[ "junit.framework.AssertionFailedError" ]
import junit.framework.AssertionFailedError;
import junit.framework.*;
[ "junit.framework" ]
junit.framework;
1,034,296
public void addAll(final List<Dependency> dependencies) { for(final Dependency dependency: dependencies){ addDependency(dependency); } }
void function(final List<Dependency> dependencies) { for(final Dependency dependency: dependencies){ addDependency(dependency); } }
/** * Add many dependencies to the list * * @param dependencies List<Dependency> */
Add many dependencies to the list
addAll
{ "repo_name": "Axway/Grapes", "path": "server/src/main/java/org/axway/grapes/server/webapp/views/DependencyListView.java", "license": "apache-2.0", "size": 9693 }
[ "java.util.List", "org.axway.grapes.commons.datamodel.Dependency" ]
import java.util.List; import org.axway.grapes.commons.datamodel.Dependency;
import java.util.*; import org.axway.grapes.commons.datamodel.*;
[ "java.util", "org.axway.grapes" ]
java.util; org.axway.grapes;
394,093
@Override protected void toDotAux(FileWriter where) throws java.io.IOException { linkToNode("condition", condition.toDot(where), where); linkToNode("then", then.toDot(where), where); linkToNode("_else", _else.toDot(where), where); } /** * Performs the type-checking of the conditional command * by using a given type-checker. It type-checks the condition, <i>then</i> * and <i>else</i> branches of the conditional. * It checks that the condition is a Boolean expression. It returns * the original type-checker passed as a parameter, so that * local declarations inside the branches of the conditional are not visible after. * * @param checker the type-checker to be used for type-checking * @return the type-checker {@code checker}
void function(FileWriter where) throws java.io.IOException { linkToNode(STR, condition.toDot(where), where); linkToNode("then", then.toDot(where), where); linkToNode("_else", _else.toDot(where), where); } /** * Performs the type-checking of the conditional command * by using a given type-checker. It type-checks the condition, <i>then</i> * and <i>else</i> branches of the conditional. * It checks that the condition is a Boolean expression. It returns * the original type-checker passed as a parameter, so that * local declarations inside the branches of the conditional are not visible after. * * @param checker the type-checker to be used for type-checking * @return the type-checker {@code checker}
/** * Adds abstract syntax class-specific information in the dot file * representing the abstract syntax of the conditional command. * This amounts to adding arcs from the node for the conditional * command to the abstract syntax for its {@link #condition}, * {@link #then} and {@link #_else} components. * * @param where the file where the dot representation must be written */
Adds abstract syntax class-specific information in the dot file representing the abstract syntax of the conditional command. This amounts to adding arcs from the node for the conditional command to the abstract syntax for its <code>#condition</code>, <code>#then</code> and <code>#_else</code> components
toDotAux
{ "repo_name": "PgRepository/Kitten", "path": "src/absyn/IfThenElse.java", "license": "gpl-2.0", "size": 5302 }
[ "java.io.FileWriter" ]
import java.io.FileWriter;
import java.io.*;
[ "java.io" ]
java.io;
1,818,815
@Override @SuppressWarnings("unchecked") public ChronoLocalDateTime<AccountingDate> localDateTime(TemporalAccessor temporal) { return (ChronoLocalDateTime<AccountingDate>) super.localDateTime(temporal); }
@SuppressWarnings(STR) ChronoLocalDateTime<AccountingDate> function(TemporalAccessor temporal) { return (ChronoLocalDateTime<AccountingDate>) super.localDateTime(temporal); }
/** * Obtains a Accounting local date-time from another date-time object. * * @param temporal the date-time object to convert, not null * @return the Accounting local date-time, not null * @throws DateTimeException if unable to create the date-time */
Obtains a Accounting local date-time from another date-time object
localDateTime
{ "repo_name": "steve-o/threeten-extra", "path": "src/main/java/org/threeten/extra/chrono/AccountingChronology.java", "license": "bsd-3-clause", "size": 25178 }
[ "java.time.chrono.ChronoLocalDateTime", "java.time.temporal.TemporalAccessor" ]
import java.time.chrono.ChronoLocalDateTime; import java.time.temporal.TemporalAccessor;
import java.time.chrono.*; import java.time.temporal.*;
[ "java.time" ]
java.time;
1,203,374
void setTileEntity(int x, int y, int z, TileEntity tileEntity);
void setTileEntity(int x, int y, int z, TileEntity tileEntity);
/** * Add or replace a tile entity to a block at the requested location. Does nothing if the location is out of bounds. * @param x the X coord in world space. * @param y the Y coord in world space. * @param z the Z coord in world space. * @param tileEntity the Tile Entity to set. */
Add or replace a tile entity to a block at the requested location. Does nothing if the location is out of bounds
setTileEntity
{ "repo_name": "CannibalVox/Schematica", "path": "src/api/java/com/github/lunatrius/schematica/api/ISchematic.java", "license": "mit", "size": 4669 }
[ "net.minecraft.tileentity.TileEntity" ]
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.*;
[ "net.minecraft.tileentity" ]
net.minecraft.tileentity;
1,951,689
Class<?>[] primitiveTypes = DataType.getPrimitive(parameterTypes); for (Constructor<?> constructor : clazz.getConstructors()) { if (!DataType.compare(DataType.getPrimitive(constructor.getParameterTypes()), primitiveTypes)) { continue; } return constructor; } throw new NoSuchMethodException("There is no such constructor in this class with the specified parameter types"); }
Class<?>[] primitiveTypes = DataType.getPrimitive(parameterTypes); for (Constructor<?> constructor : clazz.getConstructors()) { if (!DataType.compare(DataType.getPrimitive(constructor.getParameterTypes()), primitiveTypes)) { continue; } return constructor; } throw new NoSuchMethodException(STR); }
/** * Returns the constructor of a given class with the given parameter types * * @param clazz Target class * @param parameterTypes Parameter types of the desired constructor * @return The constructor of the target class with the specified parameter types * @throws NoSuchMethodException If the desired constructor with the specified parameter types cannot be found * @see DataType * @see DataType#getPrimitive(Class[]) * @see DataType#compare(Class[], Class[]) */
Returns the constructor of a given class with the given parameter types
getConstructor
{ "repo_name": "KENisFIS/PAWGamesHub", "path": "PAWGamesHub/src/us/pawgames/hub/effects/ReflectionUtils.java", "license": "lgpl-3.0", "size": 27930 }
[ "java.lang.reflect.Constructor" ]
import java.lang.reflect.Constructor;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
2,196,349
public void addToCache(K key, V entry) { // Element already in the cache. Remove it first clearCacheEntry(key); Cache<K,V> cache = getBaseCache(); if (cache != null) { cache.put(key, entry); } }
void function(K key, V entry) { clearCacheEntry(key); Cache<K,V> cache = getBaseCache(); if (cache != null) { cache.put(key, entry); } }
/** * Add a cache entry. * * @param key * Key which cache entry is indexed. * @param entry * Actual object where cache entry is placed. */
Add a cache entry
addToCache
{ "repo_name": "maheshika/carbon-identity", "path": "components/identity/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth/cache/BaseCache.java", "license": "apache-2.0", "size": 2631 }
[ "javax.cache.Cache" ]
import javax.cache.Cache;
import javax.cache.*;
[ "javax.cache" ]
javax.cache;
45,172
void speak(String text) throws IOException, UnsupportedOperationException;
void speak(String text) throws IOException, UnsupportedOperationException;
/** * Send test to a text to speech engine * * @param text * @throws IOException an error was encountered sending * @throws UnsupportedOperationException if this class does not support this */
Send test to a text to speech engine
speak
{ "repo_name": "avatar42/MyMonitor", "path": "src/main/java/dea/monitor/broadcast/BroadcastInterface.java", "license": "apache-2.0", "size": 7608 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,194,102
protected void printElements(Printer out) { super.printElements(out); if (m_artist != null) { out.print("\n<artist>"); out.print(m_artist); out.print("</artist>\n"); } if (m_title != null) { out.print("\n<title>"); out.print(m_title); out.print("</title>\n"); } }
void function(Printer out) { super.printElements(out); if (m_artist != null) { out.print(STR); out.print(m_artist); out.print(STR); } if (m_title != null) { out.print(STR); out.print(m_title); out.print(STR); } }
/** * Printing method, prints the XML element to a Printer. * This method prints an XML fragment starting from CDType. * * @param out the Printer that the element is printed to * @see com.xml2j.util.Printer */
Printing method, prints the XML element to a Printer. This method prints an XML fragment starting from CDType
printElements
{ "repo_name": "lolkedijkstra/xml2j-gen", "path": "tutorial/subst2/src/main/java/com/xml2j/tutorial/subst2/CDType.java", "license": "mit", "size": 3783 }
[ "com.xml2j.util.Printer" ]
import com.xml2j.util.Printer;
import com.xml2j.util.*;
[ "com.xml2j.util" ]
com.xml2j.util;
1,022,562
private Object writeReplace() throws ObjectStreamException { return new LinkedHashMap<K, V>(this); }
Object function() throws ObjectStreamException { return new LinkedHashMap<K, V>(this); }
/** * If somebody is unlucky enough to have to serialize one of these, serialize * it as a LinkedHashMap so that they won't need Gson on the other side to * deserialize it. Using serialization defeats our DoS defence, so most apps * shouldn't use it. */
If somebody is unlucky enough to have to serialize one of these, serialize it as a LinkedHashMap so that they won't need Gson on the other side to deserialize it. Using serialization defeats our DoS defence, so most apps shouldn't use it
writeReplace
{ "repo_name": "odoo-mobile-intern/odoo-work", "path": "app/src/main/java/com/odoo/google/gson/internal/LinkedTreeMap.java", "license": "apache-2.0", "size": 20533 }
[ "java.io.ObjectStreamException", "java.util.LinkedHashMap" ]
import java.io.ObjectStreamException; import java.util.LinkedHashMap;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
1,573,198
public ListenableFuture<E> insert(final E element) { return this.insert(element, (List<Pair<String, String>>) null); }
ListenableFuture<E> function(final E element) { return this.insert(element, (List<Pair<String, String>>) null); }
/** * Inserts an entity into a Mobile Service Table * * @param element The entity to insert */
Inserts an entity into a Mobile Service Table
insert
{ "repo_name": "soninaren/azure-mobile-apps-android-client", "path": "sdk/src/sdk/src/main/java/com/microsoft/windowsazure/mobileservices/table/MobileServiceTable.java", "license": "apache-2.0", "size": 31661 }
[ "android.util.Pair", "com.google.common.util.concurrent.ListenableFuture", "java.util.List" ]
import android.util.Pair; import com.google.common.util.concurrent.ListenableFuture; import java.util.List;
import android.util.*; import com.google.common.util.concurrent.*; import java.util.*;
[ "android.util", "com.google.common", "java.util" ]
android.util; com.google.common; java.util;
886,329
public void fromPNML(OMElement subRoot,IdRefLinker idr) throws InnerBuildException, InvalidIDException, VoidRepositoryException{ item.fromPNML(subRoot,idr); }
void function(OMElement subRoot,IdRefLinker idr) throws InnerBuildException, InvalidIDException, VoidRepositoryException{ item.fromPNML(subRoot,idr); }
/** * creates an object from the xml nodes.(symetric work of toPNML) */
creates an object from the xml nodes.(symetric work of toPNML)
fromPNML
{ "repo_name": "lhillah/pnmlframework", "path": "pnmlFw-PTNet/src/fr/lip6/move/pnml/ptnet/hlapi/PositionHLAPI.java", "license": "epl-1.0", "size": 6942 }
[ "fr.lip6.move.pnml.framework.utils.IdRefLinker", "fr.lip6.move.pnml.framework.utils.exception.InnerBuildException", "fr.lip6.move.pnml.framework.utils.exception.InvalidIDException", "fr.lip6.move.pnml.framework.utils.exception.VoidRepositoryException", "org.apache.axiom.om.OMElement" ]
import fr.lip6.move.pnml.framework.utils.IdRefLinker; import fr.lip6.move.pnml.framework.utils.exception.InnerBuildException; import fr.lip6.move.pnml.framework.utils.exception.InvalidIDException; import fr.lip6.move.pnml.framework.utils.exception.VoidRepositoryException; import org.apache.axiom.om.OMElement;
import fr.lip6.move.pnml.framework.utils.*; import fr.lip6.move.pnml.framework.utils.exception.*; import org.apache.axiom.om.*;
[ "fr.lip6.move", "org.apache.axiom" ]
fr.lip6.move; org.apache.axiom;
2,643,325
if (args.length != 1) { System.err.println("Verifies the given class."); System.err.println("Usage: CheckClassAdapter " + "<fully qualified class name or class file name>"); return; } ClassReader cr; if (args[0].endsWith(".class")) { cr = new ClassReader(new FileInputStream(args[0])); } else { cr = new ClassReader(args[0]); } verify(cr, false, new PrintWriter(System.err)); }
if (args.length != 1) { System.err.println(STR); System.err.println(STR + STR); return; } ClassReader cr; if (args[0].endsWith(STR)) { cr = new ClassReader(new FileInputStream(args[0])); } else { cr = new ClassReader(args[0]); } verify(cr, false, new PrintWriter(System.err)); }
/** * Checks a given class. * <p> * Usage: CheckClassAdapter &lt;binary class name or class file name&gt; * * @param args * the command line arguments. * * @throws Exception * if the class cannot be found, or if an IO exception occurs. */
Checks a given class. Usage: CheckClassAdapter &lt;binary class name or class file name&gt
main
{ "repo_name": "Xyene/JBL", "path": "src/test/java/benchmark/asm/util/CheckClassAdapter.java", "license": "lgpl-3.0", "size": 33149 }
[ "java.io.FileInputStream", "java.io.PrintWriter" ]
import java.io.FileInputStream; import java.io.PrintWriter;
import java.io.*;
[ "java.io" ]
java.io;
554,129
// instantiate the command used for the autonomous period // Initialize all subsystems CommandBase.init(); }
CommandBase.init(); }
/** * This function is run when the robot is first started up and should be * used for any initialization code. */
This function is run when the robot is first started up and should be used for any initialization code
robotInit
{ "repo_name": "ThinkRedstone/FLFL2014", "path": "src/edu/wpi/first/wpilibj/templates/RobotTemplate.java", "license": "bsd-3-clause", "size": 2550 }
[ "edu.wpi.first.wpilibj.templates.commands.CommandBase" ]
import edu.wpi.first.wpilibj.templates.commands.CommandBase;
import edu.wpi.first.wpilibj.templates.commands.*;
[ "edu.wpi.first" ]
edu.wpi.first;
519,221
@SuppressWarnings("unchecked") protected void addToArray(Object array, long pos, Object e) { ((Collection) array).add(e); }
@SuppressWarnings(STR) void function(Object array, long pos, Object e) { ((Collection) array).add(e); }
/** Called by the default implementation of {@link #readArray} to add a * value. The default implementation is for {@link Collection}.*/
Called by the default implementation of <code>#readArray</code> to add a
addToArray
{ "repo_name": "RallySoftware/avro", "path": "lang/java/avro/src/main/java/org/apache/avro/generic/GenericDatumReader.java", "license": "apache-2.0", "size": 17380 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
46,661
public Pair<File , Long > getProfile() { return ((PersistenceServiceImpl) fPersistenceService).getProfile(); }
Pair<File , Long > function() { return ((PersistenceServiceImpl) fPersistenceService).getProfile(); }
/** * Returns the profile {@link File} that contains all data and the * {@link Long} timestamp when it was last successfully used. * * @return the profile {@link File} and the {@link Long} timestamp when it was * last successfully used. */
Returns the profile <code>File</code> that contains all data and the <code>Long</code> timestamp when it was last successfully used
getProfile
{ "repo_name": "rssowl/RSSOwl", "path": "org.rssowl.core/src/org/rssowl/core/internal/InternalOwl.java", "license": "epl-1.0", "size": 16228 }
[ "java.io.File", "org.rssowl.core.internal.persist.service.PersistenceServiceImpl", "org.rssowl.core.util.Pair" ]
import java.io.File; import org.rssowl.core.internal.persist.service.PersistenceServiceImpl; import org.rssowl.core.util.Pair;
import java.io.*; import org.rssowl.core.internal.persist.service.*; import org.rssowl.core.util.*;
[ "java.io", "org.rssowl.core" ]
java.io; org.rssowl.core;
2,667,485
void setError(NodeEntry state, ErrorInfo errorInfo) throws InterruptedException { Preconditions.checkState(value == null, "%s %s %s", skyKey, value, errorInfo); Preconditions.checkState(this.errorInfo == null, "%s %s %s", skyKey, this.errorInfo, errorInfo); if (errorInfo.isDirectlyTransient()) { NodeEntry errorTransienceNode = Preconditions.checkNotNull( evaluatorContext .getGraph() .get(skyKey, Reason.RDEP_ADDITION, ErrorTransienceValue.KEY), "Null error value? %s", skyKey); DependencyState triState; if (oldDeps.contains(ErrorTransienceValue.KEY)) { triState = errorTransienceNode.checkIfDoneForDirtyReverseDep(skyKey); } else { triState = errorTransienceNode.addReverseDepAndCheckIfDone(skyKey); } Preconditions.checkState( triState == DependencyState.DONE, "%s %s %s", skyKey, triState, errorInfo); state.addTemporaryDirectDeps(GroupedListHelper.create(ErrorTransienceValue.KEY)); state.signalDep(evaluatorContext.getGraphVersion(), ErrorTransienceValue.KEY); maxChildVersion = evaluatorContext.getGraphVersion(); } this.errorInfo = Preconditions.checkNotNull(errorInfo, skyKey); } /** * Returns a map of {@code keys} to values or {@link #NULL_MARKER}s, populating the map's contents * by looking in order at: * * <ol> * <li>{@link #bubbleErrorInfo} * <li>{@link #previouslyRequestedDepsValues} * <li>{@link #newlyRequestedDepsValues}
void setError(NodeEntry state, ErrorInfo errorInfo) throws InterruptedException { Preconditions.checkState(value == null, STR, skyKey, value, errorInfo); Preconditions.checkState(this.errorInfo == null, STR, skyKey, this.errorInfo, errorInfo); if (errorInfo.isDirectlyTransient()) { NodeEntry errorTransienceNode = Preconditions.checkNotNull( evaluatorContext .getGraph() .get(skyKey, Reason.RDEP_ADDITION, ErrorTransienceValue.KEY), STR, skyKey); DependencyState triState; if (oldDeps.contains(ErrorTransienceValue.KEY)) { triState = errorTransienceNode.checkIfDoneForDirtyReverseDep(skyKey); } else { triState = errorTransienceNode.addReverseDepAndCheckIfDone(skyKey); } Preconditions.checkState( triState == DependencyState.DONE, STR, skyKey, triState, errorInfo); state.addTemporaryDirectDeps(GroupedListHelper.create(ErrorTransienceValue.KEY)); state.signalDep(evaluatorContext.getGraphVersion(), ErrorTransienceValue.KEY); maxChildVersion = evaluatorContext.getGraphVersion(); } this.errorInfo = Preconditions.checkNotNull(errorInfo, skyKey); } /** * Returns a map of {@code keys} to values or {@link #NULL_MARKER}s, populating the map's contents * by looking in order at: * * <ol> * <li>{@link #bubbleErrorInfo} * <li>{@link #previouslyRequestedDepsValues} * <li>{@link #newlyRequestedDepsValues}
/** * Set this node to be in error. The node's value must not have already been set. However, all * dependencies of this node <i>must</i> already have been registered, since this method may * register a dependence on the error transience node, which should always be the last dep. */
Set this node to be in error. The node's value must not have already been set. However, all dependencies of this node must already have been registered, since this method may register a dependence on the error transience node, which should always be the last dep
setError
{ "repo_name": "meteorcloudy/bazel", "path": "src/main/java/com/google/devtools/build/skyframe/SkyFunctionEnvironment.java", "license": "apache-2.0", "size": 42587 }
[ "com.google.common.base.Preconditions", "com.google.devtools.build.lib.util.GroupedList", "com.google.devtools.build.skyframe.NodeEntry", "com.google.devtools.build.skyframe.QueryableGraph" ]
import com.google.common.base.Preconditions; import com.google.devtools.build.lib.util.GroupedList; import com.google.devtools.build.skyframe.NodeEntry; import com.google.devtools.build.skyframe.QueryableGraph;
import com.google.common.base.*; import com.google.devtools.build.lib.util.*; import com.google.devtools.build.skyframe.*;
[ "com.google.common", "com.google.devtools" ]
com.google.common; com.google.devtools;
1,293,093
protected void setCellLocations(mxGraph graph, mxGraphHierarchyModel model) { rankTopY = new double[model.ranks.size()]; rankBottomY = new double[model.ranks.size()]; for (int i = 0; i < model.ranks.size(); i++) { rankTopY[i] = Double.MAX_VALUE; rankBottomY[i] = -Double.MAX_VALUE; } Set<Object> parentsChanged = null; if (layout.isResizeParent()) { parentsChanged = new HashSet<Object>(); } Map<Object, mxGraphHierarchyEdge> edges = model.getEdgeMapper(); Map<Object, mxGraphHierarchyNode> vertices = model.getVertexMapper(); // Process vertices all first, since they define the lower and // limits of each rank. Between these limits lie the channels // where the edges can be routed across the graph for (mxGraphHierarchyNode cell : vertices.values()) { setVertexLocation(cell); if (layout.isResizeParent()) { parentsChanged.add(graph.getModel().getParent(cell.cell)); } } if (layout.isResizeParent()) { adjustParents(parentsChanged); } // Post process edge styles. Needs the vertex locations set for initial // values of the top and bottoms of each rank if (this.edgeStyle == HierarchicalEdgeStyle.ORTHOGONAL || this.edgeStyle == HierarchicalEdgeStyle.POLYLINE) { localEdgeProcessing(model); } for (mxGraphAbstractHierarchyCell cell : edges.values()) { setEdgePosition(cell); } }
void function(mxGraph graph, mxGraphHierarchyModel model) { rankTopY = new double[model.ranks.size()]; rankBottomY = new double[model.ranks.size()]; for (int i = 0; i < model.ranks.size(); i++) { rankTopY[i] = Double.MAX_VALUE; rankBottomY[i] = -Double.MAX_VALUE; } Set<Object> parentsChanged = null; if (layout.isResizeParent()) { parentsChanged = new HashSet<Object>(); } Map<Object, mxGraphHierarchyEdge> edges = model.getEdgeMapper(); Map<Object, mxGraphHierarchyNode> vertices = model.getVertexMapper(); for (mxGraphHierarchyNode cell : vertices.values()) { setVertexLocation(cell); if (layout.isResizeParent()) { parentsChanged.add(graph.getModel().getParent(cell.cell)); } } if (layout.isResizeParent()) { adjustParents(parentsChanged); } if (this.edgeStyle == HierarchicalEdgeStyle.ORTHOGONAL this.edgeStyle == HierarchicalEdgeStyle.POLYLINE) { localEdgeProcessing(model); } for (mxGraphAbstractHierarchyCell cell : edges.values()) { setEdgePosition(cell); } }
/** * Sets the cell locations in the facade to those stored after this layout * processing step has completed. * * @param graph * the facade describing the input graph * @param model * an internal model of the hierarchical layout */
Sets the cell locations in the facade to those stored after this layout processing step has completed
setCellLocations
{ "repo_name": "jgraph/mxgraph", "path": "java/src/com/mxgraph/layout/hierarchical/stage/mxCoordinateAssignment.java", "license": "apache-2.0", "size": 50764 }
[ "java.util.HashSet", "java.util.Map", "java.util.Set" ]
import java.util.HashSet; import java.util.Map; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
1,435,267
public void setColor(Color newColor) { // set the red, green, and blue values int red = newColor.getRed(); int green = newColor.getGreen(); int blue = newColor.getBlue(); // update the associated picture updatePicture(this.getAlpha(),red,green,blue); }
void function(Color newColor) { int red = newColor.getRed(); int green = newColor.getGreen(); int blue = newColor.getBlue(); updatePicture(this.getAlpha(),red,green,blue); }
/** * Method to set the pixel color to the passed in color object. * @param newColor the new color to use */
Method to set the pixel color to the passed in color object
setColor
{ "repo_name": "DirkyJerky/ProgrammingClass", "path": "src/me/yoerger/geoff/edu/progClass/bookClasses/Pixel.java", "license": "mit", "size": 10328 }
[ "java.awt.Color" ]
import java.awt.Color;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,454,534
public int parsea(String spar) { double longitud = 0.0; double latitud = 0.0; float valor = 0; int marca = 0; int ctok = 0; String slon; String slat; String svalor; String smarca; try { StringTokenizer st = new StringTokenizer(spar, ",|"); ctok = st.countTokens(); slon = st.nextToken(); if (slon.length() > 0 && slon.charAt(0) != '#') { longitud = Double.parseDouble(slon); } slat = st.nextToken(); if (slat.length() > 0 && slat.charAt(0) != '#') { latitud = Double.parseDouble(slat); } svalor = st.nextToken(); if (svalor.length() > 0 && svalor.charAt(0) != '#') { valor = Float.parseFloat(svalor); } smarca = st.nextToken(); if (smarca.length() > 0 && smarca.charAt(0) != '#') { marca = Integer.parseInt(smarca); } Dato daux = new Dato(longitud, latitud, valor, marca); daux.radio = valor; aD.add(daux); } catch (NumberFormatException nfex) { System.out.println(spar); } return ctok; }
int function(String spar) { double longitud = 0.0; double latitud = 0.0; float valor = 0; int marca = 0; int ctok = 0; String slon; String slat; String svalor; String smarca; try { StringTokenizer st = new StringTokenizer(spar, STR); ctok = st.countTokens(); slon = st.nextToken(); if (slon.length() > 0 && slon.charAt(0) != '#') { longitud = Double.parseDouble(slon); } slat = st.nextToken(); if (slat.length() > 0 && slat.charAt(0) != '#') { latitud = Double.parseDouble(slat); } svalor = st.nextToken(); if (svalor.length() > 0 && svalor.charAt(0) != '#') { valor = Float.parseFloat(svalor); } smarca = st.nextToken(); if (smarca.length() > 0 && smarca.charAt(0) != '#') { marca = Integer.parseInt(smarca); } Dato daux = new Dato(longitud, latitud, valor, marca); daux.radio = valor; aD.add(daux); } catch (NumberFormatException nfex) { System.out.println(spar); } return ctok; }
/** * * Metodo que parsea una entrada de coordenadas geograficar con marca valor * Modelo: * * longitud,latitud,valor,marca * * @return La cantidad de tokens procesados */
Metodo que parsea una entrada de coordenadas geograficar con marca valor Modelo: longitud,latitud,valor,marca
parsea
{ "repo_name": "alffore/GCAR", "path": "GCAR/src/aafr/int2svg/lectorins/LectorPC.java", "license": "gpl-2.0", "size": 3007 }
[ "java.util.StringTokenizer" ]
import java.util.StringTokenizer;
import java.util.*;
[ "java.util" ]
java.util;
486,972
public static SyncStatusInfo getSyncStatus(Account account, String authority) { try { return getContentService().getSyncStatus(account, authority); } catch (RemoteException e) { throw new RuntimeException("the ContentService should always be reachable", e); } }
static SyncStatusInfo function(Account account, String authority) { try { return getContentService().getSyncStatus(account, authority); } catch (RemoteException e) { throw new RuntimeException(STR, e); } }
/** * Returns the status that matches the authority. * @param account the account whose setting we are querying * @param authority the provider whose behavior is being queried * @return the SyncStatusInfo for the authority, or null if none exists * @hide */
Returns the status that matches the authority
getSyncStatus
{ "repo_name": "haikuowuya/android_system_code", "path": "src/android/content/ContentResolver.java", "license": "apache-2.0", "size": 82308 }
[ "android.accounts.Account", "android.os.RemoteException" ]
import android.accounts.Account; import android.os.RemoteException;
import android.accounts.*; import android.os.*;
[ "android.accounts", "android.os" ]
android.accounts; android.os;
428,858
public SecureElementManager getSecureElementManager() throws RemoteException { if (service == null) { return null; } if (secureElementManager == null) { secureElementManager = new SecureElementManager(service.getSecureElementInterface()); } return secureElementManager; }
SecureElementManager function() throws RemoteException { if (service == null) { return null; } if (secureElementManager == null) { secureElementManager = new SecureElementManager(service.getSecureElementInterface()); } return secureElementManager; }
/** * Get the Manager to access Secure Element API * @return the Secure Element Manager instance * @throws RemoteException if can't connect to the Open NFC Extensions service */
Get the Manager to access Secure Element API
getSecureElementManager
{ "repo_name": "rex-xxx/mt6572_x201", "path": "external/libnfc-opennfc/java/src/com/opennfc/extension/OpenNFCExtManager.java", "license": "gpl-2.0", "size": 12352 }
[ "android.os.RemoteException" ]
import android.os.RemoteException;
import android.os.*;
[ "android.os" ]
android.os;
1,460,283
public Authentication getUser() { return this.authentication; } protected DownloadJob(UpdateSite site, Authentication authentication) { super(site); this.authentication = authentication; }
Authentication function() { return this.authentication; } protected DownloadJob(UpdateSite site, Authentication authentication) { super(site); this.authentication = authentication; }
/** * Get the user that initiated this job */
Get the user that initiated this job
getUser
{ "repo_name": "evernat/jenkins", "path": "core/src/main/java/hudson/model/UpdateCenter.java", "license": "mit", "size": 79626 }
[ "org.acegisecurity.Authentication" ]
import org.acegisecurity.Authentication;
import org.acegisecurity.*;
[ "org.acegisecurity" ]
org.acegisecurity;
1,525,635
void setup(HTableFactory factory, ExecutorService pool, Abortable abortable, Stoppable stop, int cacheSize) { this.factory = new CachingHTableFactory(factory, cacheSize); this.pool = new QuickFailingTaskRunner(pool); this.stopped = stop; }
void setup(HTableFactory factory, ExecutorService pool, Abortable abortable, Stoppable stop, int cacheSize) { this.factory = new CachingHTableFactory(factory, cacheSize); this.pool = new QuickFailingTaskRunner(pool); this.stopped = stop; }
/** * Setup <tt>this</tt>. * <p> * Exposed for TESTING */
Setup this. Exposed for TESTING
setup
{ "repo_name": "jffnothing/phoenix-4.0.0-incubating", "path": "phoenix-core/src/main/java/org/apache/phoenix/hbase/index/write/ParallelWriterIndexCommitter.java", "license": "apache-2.0", "size": 9651 }
[ "java.util.concurrent.ExecutorService", "org.apache.hadoop.hbase.Abortable", "org.apache.hadoop.hbase.Stoppable", "org.apache.phoenix.hbase.index.parallel.QuickFailingTaskRunner", "org.apache.phoenix.hbase.index.table.CachingHTableFactory", "org.apache.phoenix.hbase.index.table.HTableFactory" ]
import java.util.concurrent.ExecutorService; import org.apache.hadoop.hbase.Abortable; import org.apache.hadoop.hbase.Stoppable; import org.apache.phoenix.hbase.index.parallel.QuickFailingTaskRunner; import org.apache.phoenix.hbase.index.table.CachingHTableFactory; import org.apache.phoenix.hbase.index.table.HTableFactory;
import java.util.concurrent.*; import org.apache.hadoop.hbase.*; import org.apache.phoenix.hbase.index.parallel.*; import org.apache.phoenix.hbase.index.table.*;
[ "java.util", "org.apache.hadoop", "org.apache.phoenix" ]
java.util; org.apache.hadoop; org.apache.phoenix;
2,527,821
boolean checkForDuplicateUnits(List<AwardPerson> projectPersons) { boolean valid = true; for(AwardPerson p: projectPersons) { Set<Unit> uniqueUnits = new HashSet<Unit>(); List<Unit> tempUnits = new ArrayList<Unit>(); for(AwardPersonUnit apu: p.getUnits()) { uniqueUnits.add(apu.getUnit()); tempUnits.add(apu.getUnit()); } valid &= tempUnits.size() == uniqueUnits.size(); if(!valid) { // remove unique units from list of all units for(Unit u: uniqueUnits) { tempUnits.remove(u); } // remove duplicates from remaining units Set<Unit> duplicateUnits = new HashSet<Unit>(tempUnits); for(Unit dupeUnit: duplicateUnits) { GlobalVariables.getMessageMap().putError(AWARD_PROJECT_PERSON_LIST_ERROR_KEY, ERROR_AWARD_PROJECT_PERSON_DUPLICATE_UNITS, dupeUnit.getUnitName(), dupeUnit.getUnitNumber(), p.getFullName()); } } } return valid; }
boolean checkForDuplicateUnits(List<AwardPerson> projectPersons) { boolean valid = true; for(AwardPerson p: projectPersons) { Set<Unit> uniqueUnits = new HashSet<Unit>(); List<Unit> tempUnits = new ArrayList<Unit>(); for(AwardPersonUnit apu: p.getUnits()) { uniqueUnits.add(apu.getUnit()); tempUnits.add(apu.getUnit()); } valid &= tempUnits.size() == uniqueUnits.size(); if(!valid) { for(Unit u: uniqueUnits) { tempUnits.remove(u); } Set<Unit> duplicateUnits = new HashSet<Unit>(tempUnits); for(Unit dupeUnit: duplicateUnits) { GlobalVariables.getMessageMap().putError(AWARD_PROJECT_PERSON_LIST_ERROR_KEY, ERROR_AWARD_PROJECT_PERSON_DUPLICATE_UNITS, dupeUnit.getUnitName(), dupeUnit.getUnitNumber(), p.getFullName()); } } } return valid; }
/** * Duplicate units not allowed * @param projectPersons * @return */
Duplicate units not allowed
checkForDuplicateUnits
{ "repo_name": "rashikpolus/MIT_KC", "path": "coeus-impl/src/main/java/org/kuali/kra/award/contacts/AwardProjectPersonsSaveRuleImpl.java", "license": "agpl-3.0", "size": 7958 }
[ "java.util.ArrayList", "java.util.HashSet", "java.util.List", "java.util.Set", "org.kuali.coeus.common.framework.unit.Unit", "org.kuali.rice.krad.util.GlobalVariables" ]
import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import org.kuali.coeus.common.framework.unit.Unit; import org.kuali.rice.krad.util.GlobalVariables;
import java.util.*; import org.kuali.coeus.common.framework.unit.*; import org.kuali.rice.krad.util.*;
[ "java.util", "org.kuali.coeus", "org.kuali.rice" ]
java.util; org.kuali.coeus; org.kuali.rice;
2,732,640
Security enhanceSecurity(Security security);
Security enhanceSecurity(Security security);
/** * Enhances the information about a the specified security from the underlying data source. * <p> * The security is specified by external identifier bundle. * * @param security the security to enhance, not null * @return the enhanced security, not null * @throws RuntimeException if a problem occurs */
Enhances the information about a the specified security from the underlying data source. The security is specified by external identifier bundle
enhanceSecurity
{ "repo_name": "McLeodMoores/starling", "path": "projects/provider/src/main/java/com/opengamma/provider/security/SecurityEnhancer.java", "license": "apache-2.0", "size": 2728 }
[ "com.opengamma.core.security.Security" ]
import com.opengamma.core.security.Security;
import com.opengamma.core.security.*;
[ "com.opengamma.core" ]
com.opengamma.core;
1,841,388
private boolean isWorthTrying(X509Certificate trustedCert, X509Certificate firstCert) { boolean worthy = false; if (debug != null) { debug.println("PKIXCertPathValidator.isWorthTrying() checking " + "if this trusted cert is worth trying ..."); } if (firstCert == null) { return true; } AdaptableX509CertSelector issuerSelector = new AdaptableX509CertSelector(); // check trusted certificate's subject issuerSelector.setSubject(firstCert.getIssuerX500Principal()); // check the validity period issuerSelector.setValidityPeriod(firstCert.getNotBefore(), firstCert.getNotAfter()); try { X509CertImpl firstCertImpl = X509CertImpl.toImpl(firstCert); issuerSelector.parseAuthorityKeyIdentifierExtension( firstCertImpl.getAuthorityKeyIdentifierExtension()); worthy = issuerSelector.match(trustedCert); } catch (Exception e) { // It is not worth trying. } if (debug != null) { if (worthy) { debug.println("YES - try this trustedCert"); } else { debug.println("NO - don't try this trustedCert"); } } return worthy; }
boolean function(X509Certificate trustedCert, X509Certificate firstCert) { boolean worthy = false; if (debug != null) { debug.println(STR + STR); } if (firstCert == null) { return true; } AdaptableX509CertSelector issuerSelector = new AdaptableX509CertSelector(); issuerSelector.setSubject(firstCert.getIssuerX500Principal()); issuerSelector.setValidityPeriod(firstCert.getNotBefore(), firstCert.getNotAfter()); try { X509CertImpl firstCertImpl = X509CertImpl.toImpl(firstCert); issuerSelector.parseAuthorityKeyIdentifierExtension( firstCertImpl.getAuthorityKeyIdentifierExtension()); worthy = issuerSelector.match(trustedCert); } catch (Exception e) { } if (debug != null) { if (worthy) { debug.println(STR); } else { debug.println(STR); } } return worthy; }
/** * Internal method to do some simple checks to see if a given cert is * worth trying to validate in the chain. */
Internal method to do some simple checks to see if a given cert is worth trying to validate in the chain
isWorthTrying
{ "repo_name": "greghaskins/openjdk-jdk7u-jdk", "path": "src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java", "license": "gpl-2.0", "size": 13887 }
[ "java.security.cert.X509Certificate" ]
import java.security.cert.X509Certificate;
import java.security.cert.*;
[ "java.security" ]
java.security;
484,320
public final Set<BioAssayDataConstraintsWrapper> getBioAssayDataConstraintsWrappers() { return this.bioAssayDataConstraintsWrappers; }
final Set<BioAssayDataConstraintsWrapper> function() { return this.bioAssayDataConstraintsWrappers; }
/** * Get bioassay data constraint wrapper objects. * This method is used for persisting the * {@code bioAssayDataConstraints} property. * @return Bioassay data constraints wrappers */
Get bioassay data constraint wrapper objects. This method is used for persisting the bioAssayDataConstraints property
getBioAssayDataConstraintsWrappers
{ "repo_name": "NCIP/webgenome", "path": "java/core/src/org/rti/webgenome/domain/Experiment.java", "license": "bsd-3-clause", "size": 43315 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
2,684,726
public void testGetFromPrefs() throws Exception { String userID = "USER_TEST_ID"; // store input and later test retrieval assertTrue(Utils.saveToPrefs(context, ConstVar.PREFS_LOGIN_USER_ID_KEY, userID)); // test bad input assertEquals(Utils.getFromPrefs(null, null, null), null); // test bad key assertEquals(Utils.getFromPrefs(context, "bad key", ""), null); // test real params assertEquals(Utils.getFromPrefs(context, ConstVar.PREFS_LOGIN_USER_ID_KEY, ""), userID); }
void function() throws Exception { String userID = STR; assertTrue(Utils.saveToPrefs(context, ConstVar.PREFS_LOGIN_USER_ID_KEY, userID)); assertEquals(Utils.getFromPrefs(null, null, null), null); assertEquals(Utils.getFromPrefs(context, STR, STR"), userID); }
/** * Method stores USER_ID then tests retrieval, along with other functionality. * * @throws Exception for failed tests */
Method stores USER_ID then tests retrieval, along with other functionality
testGetFromPrefs
{ "repo_name": "seales/PHINet", "path": "PHINetDroid/app/src/androidTest/java/com/ndnhealthnet/androidudpclient/UtilsTest.java", "license": "mit", "size": 14286 }
[ "com.ndnhealthnet.androidudpclient.Utility" ]
import com.ndnhealthnet.androidudpclient.Utility;
import com.ndnhealthnet.androidudpclient.*;
[ "com.ndnhealthnet.androidudpclient" ]
com.ndnhealthnet.androidudpclient;
2,735,482
private int encryptBlock( byte[] in, int inOff, byte[] out, int outOff) throws DataLengthException, IllegalStateException { if ((inOff + blockSize) > in.length) { throw new DataLengthException("input buffer too short"); } for (int i = 0; i < blockSize; i++) { cbcV[i] ^= in[inOff + i]; } int length = cipher.processBlock(cbcV, 0, out, outOff); System.arraycopy(out, outOff, cbcV, 0, cbcV.length); return length; }
int function( byte[] in, int inOff, byte[] out, int outOff) throws DataLengthException, IllegalStateException { if ((inOff + blockSize) > in.length) { throw new DataLengthException(STR); } for (int i = 0; i < blockSize; i++) { cbcV[i] ^= in[inOff + i]; } int length = cipher.processBlock(cbcV, 0, out, outOff); System.arraycopy(out, outOff, cbcV, 0, cbcV.length); return length; }
/** * Do the appropriate chaining step for CBC mode encryption. * * @param in the array containing the data to be encrypted. * @param inOff offset into the in array the data starts at. * @param out the array the encrypted data will be copied into. * @param outOff the offset into the out array the output will start at. * @exception DataLengthException if there isn't enough data in in, or * space in out. * @exception IllegalStateException if the cipher isn't initialised. * @return the number of bytes processed and produced. */
Do the appropriate chaining step for CBC mode encryption
encryptBlock
{ "repo_name": "barmstrong/bitcoin-android", "path": "src/com/google/bitcoin/bouncycastle/crypto/modes/CBCBlockCipher.java", "license": "apache-2.0", "size": 7039 }
[ "com.google.bitcoin.bouncycastle.crypto.DataLengthException" ]
import com.google.bitcoin.bouncycastle.crypto.DataLengthException;
import com.google.bitcoin.bouncycastle.crypto.*;
[ "com.google.bitcoin" ]
com.google.bitcoin;
556,044
@Override public IComplexNDArray createComplex(float[] data, int[] shape, int[] stride, int offset, char ordering) { return new ComplexNDArray(data,shape,stride,offset,ordering); }
IComplexNDArray function(float[] data, int[] shape, int[] stride, int offset, char ordering) { return new ComplexNDArray(data,shape,stride,offset,ordering); }
/** * Create a complex ndarray with the given data * * @param data the data to use with tne ndarray * @param shape the shape of the ndarray * @param stride the stride for the ndarray * @param offset the offset of the ndarray * @param ordering the ordering for the ndarray * @return the created complex ndarray */
Create a complex ndarray with the given data
createComplex
{ "repo_name": "wlin12/JNN", "path": "src/org/nd4j/linalg/jblas/JblasNDArrayFactory.java", "license": "apache-2.0", "size": 12934 }
[ "org.nd4j.linalg.api.complex.IComplexNDArray", "org.nd4j.linalg.jblas.complex.ComplexNDArray" ]
import org.nd4j.linalg.api.complex.IComplexNDArray; import org.nd4j.linalg.jblas.complex.ComplexNDArray;
import org.nd4j.linalg.api.complex.*; import org.nd4j.linalg.jblas.complex.*;
[ "org.nd4j.linalg" ]
org.nd4j.linalg;
2,241,058
public void busy() { Preconditions.checkState(!executor.isShutdown()); // Make sure tasks are finished after shutdown(), so they do not intefere // with subsequent server invocations. executor.shutdown(); executor.setContinueExistingPeriodicTasksAfterShutdownPolicy(false); executor.setExecuteExistingDelayedTasksAfterShutdownPolicy(false); boolean interrupted = false; while (true) { try { executor.awaitTermination(Long.MAX_VALUE, TimeUnit.HOURS); break; } catch (InterruptedException e) { // It's unsafe to leak threads - just reset the interrupt bit later. interrupted = true; } } if (interrupted) { Thread.currentThread().interrupt(); } }
void function() { Preconditions.checkState(!executor.isShutdown()); executor.shutdown(); executor.setContinueExistingPeriodicTasksAfterShutdownPolicy(false); executor.setExecuteExistingDelayedTasksAfterShutdownPolicy(false); boolean interrupted = false; while (true) { try { executor.awaitTermination(Long.MAX_VALUE, TimeUnit.HOURS); break; } catch (InterruptedException e) { interrupted = true; } } if (interrupted) { Thread.currentThread().interrupt(); } }
/** * Called by the main thread when the server gets to work. * Should return quickly. */
Called by the main thread when the server gets to work. Should return quickly
busy
{ "repo_name": "juhalindfors/bazel-patches", "path": "src/main/java/com/google/devtools/build/lib/server/IdleServerTasks.java", "license": "apache-2.0", "size": 5284 }
[ "com.google.devtools.build.lib.util.Preconditions", "java.util.concurrent.TimeUnit" ]
import com.google.devtools.build.lib.util.Preconditions; import java.util.concurrent.TimeUnit;
import com.google.devtools.build.lib.util.*; import java.util.concurrent.*;
[ "com.google.devtools", "java.util" ]
com.google.devtools; java.util;
1,835,948
private ExtraData.Loader loader() throws IOException { if (loader == null) { loader = extra.loader(ctx); } return loader; } } public abstract static class ForDoubles extends BucketedSort { private DoubleArray values = bigArrays.newDoubleArray(getBucketSize(), false); public ForDoubles(BigArrays bigArrays, SortOrder sortOrder, DocValueFormat format, int bucketSize, ExtraData extra) { super(bigArrays, sortOrder, format, bucketSize, extra); initGatherOffsets(); } @Override public boolean needsScores() { return false; }
ExtraData.Loader function() throws IOException { if (loader == null) { loader = extra.loader(ctx); } return loader; } } public abstract static class ForDoubles extends BucketedSort { private DoubleArray values = bigArrays.newDoubleArray(getBucketSize(), false); public ForDoubles(BigArrays bigArrays, SortOrder sortOrder, DocValueFormat format, int bucketSize, ExtraData extra) { super(bigArrays, sortOrder, format, bucketSize, extra); initGatherOffsets(); } public boolean needsScores() { return false; }
/** * Get the extra data loader, building it if we haven't yet built one for this leaf. */
Get the extra data loader, building it if we haven't yet built one for this leaf
loader
{ "repo_name": "nknize/elasticsearch", "path": "server/src/main/java/org/elasticsearch/search/sort/BucketedSort.java", "license": "apache-2.0", "size": 25517 }
[ "java.io.IOException", "org.elasticsearch.common.util.BigArrays", "org.elasticsearch.common.util.DoubleArray", "org.elasticsearch.search.DocValueFormat" ]
import java.io.IOException; import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.DoubleArray; import org.elasticsearch.search.DocValueFormat;
import java.io.*; import org.elasticsearch.common.util.*; import org.elasticsearch.search.*;
[ "java.io", "org.elasticsearch.common", "org.elasticsearch.search" ]
java.io; org.elasticsearch.common; org.elasticsearch.search;
34,183
protected final ServletContext getServletContext() { return getWebApplicationContext().getServletContext(); }
final ServletContext function() { return getWebApplicationContext().getServletContext(); }
/** * Return the current ServletContext. */
Return the current ServletContext
getServletContext
{ "repo_name": "dachengxi/spring1.1.1_source", "path": "src/org/springframework/web/context/support/WebApplicationObjectSupport.java", "license": "mit", "size": 2192 }
[ "javax.servlet.ServletContext" ]
import javax.servlet.ServletContext;
import javax.servlet.*;
[ "javax.servlet" ]
javax.servlet;
2,117,590
protected void writeNothing() throws IOException { fos.writeInt(0); fos.flush(); } } private class LocalFsFileStream extends DirectoryFileStream { public LocalFsFileStream(SolrParams solrParams) { super(solrParams); }
void function() throws IOException { fos.writeInt(0); fos.flush(); } } private class LocalFsFileStream extends DirectoryFileStream { public LocalFsFileStream(SolrParams solrParams) { super(solrParams); }
/** * Used to write a marker for EOF */
Used to write a marker for EOF
writeNothing
{ "repo_name": "pengzong1111/solr4", "path": "solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java", "license": "apache-2.0", "size": 51498 }
[ "java.io.IOException", "org.apache.solr.common.params.SolrParams" ]
import java.io.IOException; import org.apache.solr.common.params.SolrParams;
import java.io.*; import org.apache.solr.common.params.*;
[ "java.io", "org.apache.solr" ]
java.io; org.apache.solr;
2,825,749
protected static final void configureAutoSave(boolean live){ JPanel endPanel = new JPanel(new BorderLayout()); endPanel.setBorder(BorderFactory.createTitledBorder("Save on exit")); JCheckBox saveOnExit = new JCheckBox("Save statistics to a file on exit", Main.config.saveStatsOnExit); JCheckBox loadOnStart = new JCheckBox("Load saved statistics from a file on launch", Main.config.loadStatsOnLaunch); JPanel selectFile = new JPanel(new BorderLayout(2, 0)); selectFile.add(new JLabel("Save location: "), BorderLayout.LINE_START); JTextField selectedFile = new JTextField(Main.config.statsSaveFile); selectFile.add(selectedFile, BorderLayout.CENTER); JButton select = new JButton("Select"); selectFile.add(select, BorderLayout.LINE_END); select.addActionListener((e)->{ File dir = Dialog.showFileSaveDialog(KPS_STATS_EXT, "stats"); if(dir != null){ selectedFile.setText(dir.getAbsolutePath()); } }); ActionListener stateTask = e->{ boolean enabled = saveOnExit.isSelected() || loadOnStart.isSelected(); selectedFile.setEnabled(enabled); select.setEnabled(enabled); }; saveOnExit.addActionListener(stateTask); loadOnStart.addActionListener(stateTask); stateTask.actionPerformed(null); endPanel.add(saveOnExit, BorderLayout.PAGE_START); endPanel.add(loadOnStart, BorderLayout.CENTER); endPanel.add(selectFile, BorderLayout.PAGE_END); JPanel periodicPanel = new JPanel(new BorderLayout()); periodicPanel.setBorder(BorderFactory.createTitledBorder("Periodic saving")); JCheckBox enabled = new JCheckBox("Periodically save the statistics so far to a file", Main.config.autoSaveStats); BorderLayout layout = new BorderLayout(); layout.setHgap(2); JPanel settings = new JPanel(layout); JPanel labels = new JPanel(new GridLayout(3, 1, 0, 2)); JPanel fields = new JPanel(new GridLayout(3, 1, 0, 2)); JPanel extras = new JPanel(new GridLayout(3, 1, 0, 2)); JButton seldest = new JButton("Select"); JTextField ldest = new JTextField(Main.config.statsDest); fields.add(ldest); extras.add(seldest); labels.add(new JLabel("Save location: ")); seldest.addActionListener((e)->{ File dir = Dialog.showFolderOpenDialog(); if(dir != null){ ldest.setText(dir.getAbsolutePath()); } }); JComboBox<Unit> timeUnit = new JComboBox<Unit>(Unit.values()); Unit bestUnit = Unit.fromMillis(Main.config.statsSaveInterval); timeUnit.setSelectedItem(bestUnit); JSpinner time = new JSpinner(new SpinnerNumberModel(Long.valueOf(Main.config.statsSaveInterval / bestUnit.unit.toMillis(1)), Long.valueOf(1L), Long.valueOf(Long.MAX_VALUE), Long.valueOf(1L))); labels.add(new JLabel("Save interval: ")); fields.add(time); JPanel unitPanel = new JPanel(new BorderLayout()); unitPanel.setBorder(BorderFactory.createEmptyBorder(0, 1, 0, 1)); unitPanel.add(timeUnit, BorderLayout.CENTER); extras.add(unitPanel);
static final void function(boolean live){ JPanel endPanel = new JPanel(new BorderLayout()); endPanel.setBorder(BorderFactory.createTitledBorder(STR)); JCheckBox saveOnExit = new JCheckBox(STR, Main.config.saveStatsOnExit); JCheckBox loadOnStart = new JCheckBox(STR, Main.config.loadStatsOnLaunch); JPanel selectFile = new JPanel(new BorderLayout(2, 0)); selectFile.add(new JLabel(STR), BorderLayout.LINE_START); JTextField selectedFile = new JTextField(Main.config.statsSaveFile); selectFile.add(selectedFile, BorderLayout.CENTER); JButton select = new JButton(STR); selectFile.add(select, BorderLayout.LINE_END); select.addActionListener((e)->{ File dir = Dialog.showFileSaveDialog(KPS_STATS_EXT, "stats"); if(dir != null){ selectedFile.setText(dir.getAbsolutePath()); } }); ActionListener stateTask = e->{ boolean enabled = saveOnExit.isSelected() loadOnStart.isSelected(); selectedFile.setEnabled(enabled); select.setEnabled(enabled); }; saveOnExit.addActionListener(stateTask); loadOnStart.addActionListener(stateTask); stateTask.actionPerformed(null); endPanel.add(saveOnExit, BorderLayout.PAGE_START); endPanel.add(loadOnStart, BorderLayout.CENTER); endPanel.add(selectFile, BorderLayout.PAGE_END); JPanel periodicPanel = new JPanel(new BorderLayout()); periodicPanel.setBorder(BorderFactory.createTitledBorder(STR)); JCheckBox enabled = new JCheckBox(STR, Main.config.autoSaveStats); BorderLayout layout = new BorderLayout(); layout.setHgap(2); JPanel settings = new JPanel(layout); JPanel labels = new JPanel(new GridLayout(3, 1, 0, 2)); JPanel fields = new JPanel(new GridLayout(3, 1, 0, 2)); JPanel extras = new JPanel(new GridLayout(3, 1, 0, 2)); JButton seldest = new JButton(STR); JTextField ldest = new JTextField(Main.config.statsDest); fields.add(ldest); extras.add(seldest); labels.add(new JLabel(STR)); seldest.addActionListener((e)->{ File dir = Dialog.showFolderOpenDialog(); if(dir != null){ ldest.setText(dir.getAbsolutePath()); } }); JComboBox<Unit> timeUnit = new JComboBox<Unit>(Unit.values()); Unit bestUnit = Unit.fromMillis(Main.config.statsSaveInterval); timeUnit.setSelectedItem(bestUnit); JSpinner time = new JSpinner(new SpinnerNumberModel(Long.valueOf(Main.config.statsSaveInterval / bestUnit.unit.toMillis(1)), Long.valueOf(1L), Long.valueOf(Long.MAX_VALUE), Long.valueOf(1L))); labels.add(new JLabel(STR)); fields.add(time); JPanel unitPanel = new JPanel(new BorderLayout()); unitPanel.setBorder(BorderFactory.createEmptyBorder(0, 1, 0, 1)); unitPanel.add(timeUnit, BorderLayout.CENTER); extras.add(unitPanel);
/** * Show the auto save statistics configuration dialog * @param live Whether or not the program is already running */
Show the auto save statistics configuration dialog
configureAutoSave
{ "repo_name": "RoanH/KeysPerSecond", "path": "KeysPerSecond/src/dev/roanh/kps/Statistics.java", "license": "gpl-3.0", "size": 15002 }
[ "dev.roanh.util.Dialog", "java.awt.BorderLayout", "java.awt.GridLayout", "java.awt.event.ActionListener", "java.io.File", "javax.swing.BorderFactory", "javax.swing.JButton", "javax.swing.JCheckBox", "javax.swing.JComboBox", "javax.swing.JLabel", "javax.swing.JPanel", "javax.swing.JSpinner", "javax.swing.JTextField", "javax.swing.SpinnerNumberModel" ]
import dev.roanh.util.Dialog; import java.awt.BorderLayout; import java.awt.GridLayout; import java.awt.event.ActionListener; import java.io.File; import javax.swing.BorderFactory; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JSpinner; import javax.swing.JTextField; import javax.swing.SpinnerNumberModel;
import dev.roanh.util.*; import java.awt.*; import java.awt.event.*; import java.io.*; import javax.swing.*;
[ "dev.roanh.util", "java.awt", "java.io", "javax.swing" ]
dev.roanh.util; java.awt; java.io; javax.swing;
2,466,278
public void playerQuit(Player player) { synchronized (players) { if (ConfigManager.getJobsConfiguration().saveOnDisconnect()) { JobsPlayer jPlayer = players.remove(player.getName().toLowerCase()); if (jPlayer != null) { jPlayer.save(Jobs.getJobsDAO()); jPlayer.onDisconnect(); } } else { JobsPlayer jPlayer = players.get(player.getName().toLowerCase()); if (jPlayer != null) { jPlayer.onDisconnect(); } } } }
void function(Player player) { synchronized (players) { if (ConfigManager.getJobsConfiguration().saveOnDisconnect()) { JobsPlayer jPlayer = players.remove(player.getName().toLowerCase()); if (jPlayer != null) { jPlayer.save(Jobs.getJobsDAO()); jPlayer.onDisconnect(); } } else { JobsPlayer jPlayer = players.get(player.getName().toLowerCase()); if (jPlayer != null) { jPlayer.onDisconnect(); } } } }
/** * Handles player quit * @param playername */
Handles player quit
playerQuit
{ "repo_name": "GamingMesh/Jobs", "path": "src/main/java/com/gamingmesh/jobs/PlayerManager.java", "license": "apache-2.0", "size": 12229 }
[ "com.gamingmesh.jobs.config.ConfigManager", "com.gamingmesh.jobs.container.JobsPlayer", "org.bukkit.entity.Player" ]
import com.gamingmesh.jobs.config.ConfigManager; import com.gamingmesh.jobs.container.JobsPlayer; import org.bukkit.entity.Player;
import com.gamingmesh.jobs.config.*; import com.gamingmesh.jobs.container.*; import org.bukkit.entity.*;
[ "com.gamingmesh.jobs", "org.bukkit.entity" ]
com.gamingmesh.jobs; org.bukkit.entity;
961,302
@Override public CommonCRS defaultHorizontalCRS(final boolean spherical) { return CommonCRS.WGS84; } // β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” // β”‚ COVERAGE RANGE β”‚ // β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
CommonCRS function(final boolean spherical) { return CommonCRS.WGS84; }
/** * Returns the default prime meridian, ellipsoid, datum or CRS to use if no information is found in the netCDF file. * GCOM documentation said that the datum is WGS 84. * * @param spherical ignored, since we assume an ellipsoid in all cases. * @return information about geodetic objects to use if no explicit information is found in the file. */
Returns the default prime meridian, ellipsoid, datum or CRS to use if no information is found in the netCDF file. GCOM documentation said that the datum is WGS 84
defaultHorizontalCRS
{ "repo_name": "apache/sis", "path": "profiles/sis-japan-profile/src/main/java/org/apache/sis/internal/earth/netcdf/GCOM_W.java", "license": "apache-2.0", "size": 13205 }
[ "org.apache.sis.referencing.CommonCRS" ]
import org.apache.sis.referencing.CommonCRS;
import org.apache.sis.referencing.*;
[ "org.apache.sis" ]
org.apache.sis;
2,195,034
public Shape lookupLegendShape(int series) { Shape result = getLegendShape(series); if (result == null) { result = this.baseLegendShape; } if (result == null) { result = lookupSeriesShape(series); } return result; }
Shape function(int series) { Shape result = getLegendShape(series); if (result == null) { result = this.baseLegendShape; } if (result == null) { result = lookupSeriesShape(series); } return result; }
/** * Performs a lookup for the legend shape. * * @param series the series index. * * @return The shape (possibly <code>null</code>). * * @since 1.0.11 */
Performs a lookup for the legend shape
lookupLegendShape
{ "repo_name": "ciaracdb/LOG6302", "path": "examples/jfreechart/source/org/jfree/chart/renderer/AbstractRenderer.java", "license": "apache-2.0", "size": 142729 }
[ "java.awt.Shape" ]
import java.awt.Shape;
import java.awt.*;
[ "java.awt" ]
java.awt;
742,949
@Test(expected = IllegalArgumentException.class) public void constructorArrayTooShort() { final byte[] bytes = {(byte)71, (byte)80}; new BinaryHeader(bytes); }
@Test(expected = IllegalArgumentException.class) void function() { final byte[] bytes = {(byte)71, (byte)80}; new BinaryHeader(bytes); }
/** * Constructor should fail on a byte array that's too short */
Constructor should fail on a byte array that's too short
constructorArrayTooShort
{ "repo_name": "GitHubRGI/swagd", "path": "GeoPackage/src/test/java/com/rgi/geopackage/features/BinaryHeaderTest.java", "license": "mit", "size": 18972 }
[ "org.junit.Test" ]
import org.junit.Test;
import org.junit.*;
[ "org.junit" ]
org.junit;
2,916,064