method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public String $() { if (Shell.WINDOWS) { return "%" + variable + "%"; } else { return "$" + variable; } }
public String $() { if (Shell.WINDOWS) { return "%" + variable + "%"; } else { return "$" + variable; } }
/** * Expand the environment variable based on client OS environment variable * expansion syntax (e.g. $VAR for Linux and %VAR% for Windows). * <p> * Note: Use $$() method for cross-platform practice i.e. submit an * application from a Windows client to a Linux/Unix server or vice versa. * </p> */
Expand the environment variable based on client OS environment variable expansion syntax (e.g. $VAR for Linux and %VAR% for Windows). Note: Use $$() method for cross-platform practice i.e. submit an application from a Windows client to a Linux/Unix server or vice versa.
$
{ "repo_name": "robzor92/hops", "path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/ApplicationConstants.java", "license": "apache-2.0", "size": 7782 }
[ "org.apache.hadoop.util.Shell" ]
import org.apache.hadoop.util.Shell;
import org.apache.hadoop.util.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,576,849
public static void setAllocationModeForContext(String allocationModeForContext) { if (!allocationModeForContext.equals("heap") && !allocationModeForContext.equals("javacpp") && !allocationModeForContext.equals("direct")) throw new IllegalArgumentException("Allocation mode must be one of: heap,javacpp, or direct"); Nd4jContext.getInstance().getConf().put("alloc", allocationModeForContext); }
static void function(String allocationModeForContext) { if (!allocationModeForContext.equals("heap") && !allocationModeForContext.equals(STR) && !allocationModeForContext.equals(STR)) throw new IllegalArgumentException(STR); Nd4jContext.getInstance().getConf().put("alloc", allocationModeForContext); }
/** * Set the allocation mode for the nd4j context * The value must be one of: heap, java cpp, or direct * or an @link{IllegalArgumentException} is thrown * @param allocationModeForContext */
Set the allocation mode for the nd4j context The value must be one of: heap, java cpp, or direct or an @link{IllegalArgumentException} is thrown
setAllocationModeForContext
{ "repo_name": "deeplearning4j/nd4j", "path": "nd4j-buffer/src/main/java/org/nd4j/linalg/api/buffer/util/AllocUtil.java", "license": "apache-2.0", "size": 2670 }
[ "org.nd4j.context.Nd4jContext" ]
import org.nd4j.context.Nd4jContext;
import org.nd4j.context.*;
[ "org.nd4j.context" ]
org.nd4j.context;
548,489
void put(Method method) { synchronized (methodMap) { MethodKey methodKey = new MethodKey(method); // We don't overwrite methods. Especially not if we fill the // cache from defined class towards java.lang.Object because // abstract methods in superclasses would else overwrite concrete // classes further down the hierarchy. if (methods.get(methodKey) == null) { methods.put(methodKey, method); methodMap.add(method); } } }
void put(Method method) { synchronized (methodMap) { MethodKey methodKey = new MethodKey(method); if (methods.get(methodKey) == null) { methods.put(methodKey, method); methodMap.add(method); } } }
/** * Adds a method to the map. * @param method the method to add */
Adds a method to the map
put
{ "repo_name": "InsomniaxGaming/OWHInternals", "path": "src/org/apache/commons/jexl2/internal/introspection/ClassMap.java", "license": "gpl-2.0", "size": 13949 }
[ "java.lang.reflect.Method" ]
import java.lang.reflect.Method;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
157,130
public static void assertRunController(final Instrumentation instrumentation, final ViewGroup view, final LayoutAnimationController controller, final long duration) throws InterruptedException {
static void function(final Instrumentation instrumentation, final ViewGroup view, final LayoutAnimationController controller, final long duration) throws InterruptedException {
/** * Assert run an AbsListView with LayoutAnimationController successfully. * @param instrumentation * @param view * @param controller * @param duration * @throws InterruptedException */
Assert run an AbsListView with LayoutAnimationController successfully
assertRunController
{ "repo_name": "rex-xxx/mt6572_x201", "path": "mediatek/frameworks/base/tests/WMS/src/mediatek/animation/cts/AnimationTestUtils.java", "license": "gpl-2.0", "size": 5796 }
[ "android.app.Instrumentation", "android.view.ViewGroup", "android.view.animation.LayoutAnimationController" ]
import android.app.Instrumentation; import android.view.ViewGroup; import android.view.animation.LayoutAnimationController;
import android.app.*; import android.view.*; import android.view.animation.*;
[ "android.app", "android.view" ]
android.app; android.view;
619,455
public SubscriptionContractInner withExpirationDate(OffsetDateTime expirationDate) { if (this.innerProperties() == null) { this.innerProperties = new SubscriptionContractProperties(); } this.innerProperties().withExpirationDate(expirationDate); return this; }
SubscriptionContractInner function(OffsetDateTime expirationDate) { if (this.innerProperties() == null) { this.innerProperties = new SubscriptionContractProperties(); } this.innerProperties().withExpirationDate(expirationDate); return this; }
/** * Set the expirationDate property: Subscription expiration date. The setting is for audit purposes only and the * subscription is not automatically expired. The subscription lifecycle can be managed by using the `state` * property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 * standard. * * @param expirationDate the expirationDate value to set. * @return the SubscriptionContractInner object itself. */
Set the expirationDate property: Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the `state` standard
withExpirationDate
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/SubscriptionContractInner.java", "license": "mit", "size": 15065 }
[ "java.time.OffsetDateTime" ]
import java.time.OffsetDateTime;
import java.time.*;
[ "java.time" ]
java.time;
2,805,203
public List<String> getOptionsList() { // A list of custom-tab features that are used, stored for telemetry purposed final List<String> featureList = new LinkedList<>(unsupportedFeatureList); if (toolbarColor != null) { featureList.add("hasToolbarColor"); } if (closeButtonIcon != null) { featureList.add("hasCloseButton"); } if (!disableUrlbarHiding) { featureList.add("disablesUrlbarHiding"); } if (actionButtonConfig != null) { featureList.add("hasActionButton"); } if (showShareMenuItem) { featureList.add("hasShareItem"); } if (menuItems.size() > 0) { featureList.add("hasCustomizedMenu"); } return Collections.unmodifiableList(featureList); }
List<String> function() { final List<String> featureList = new LinkedList<>(unsupportedFeatureList); if (toolbarColor != null) { featureList.add(STR); } if (closeButtonIcon != null) { featureList.add(STR); } if (!disableUrlbarHiding) { featureList.add(STR); } if (actionButtonConfig != null) { featureList.add(STR); } if (showShareMenuItem) { featureList.add(STR); } if (menuItems.size() > 0) { featureList.add(STR); } return Collections.unmodifiableList(featureList); }
/** * Get a list of options enabled in the custom tabs intent, e.g. [hasToolbarColor, hasCloseButton]. */
Get a list of options enabled in the custom tabs intent, e.g. [hasToolbarColor, hasCloseButton]
getOptionsList
{ "repo_name": "layely/focus-android", "path": "app/src/main/java/org/mozilla/focus/customtabs/CustomTabConfig.java", "license": "mpl-2.0", "size": 12349 }
[ "java.util.Collections", "java.util.LinkedList", "java.util.List" ]
import java.util.Collections; import java.util.LinkedList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,244,264
private void initNationRelation(final Game newGame, final NationsRelation thisNR) { final NationsRelation newNR = new NationsRelation(); newNR.setGame(newGame); newNR.setNation(thisNR.getNation()); newNR.setTarget(thisNR.getTarget()); newNR.setRelation(thisNR.getRelation()); newNR.setPrisoners(thisNR.getPrisoners()); newNR.setVisible(thisNR.isVisible()); RelationsManager.getInstance().add(newNR); }
void function(final Game newGame, final NationsRelation thisNR) { final NationsRelation newNR = new NationsRelation(); newNR.setGame(newGame); newNR.setNation(thisNR.getNation()); newNR.setTarget(thisNR.getTarget()); newNR.setRelation(thisNR.getRelation()); newNR.setPrisoners(thisNR.getPrisoners()); newNR.setVisible(thisNR.isVisible()); RelationsManager.getInstance().add(newNR); }
/** * Initialze the particular nations relation. * * @param newGame the game object. * @param thisNR the new object. */
Initialze the particular nations relation
initNationRelation
{ "repo_name": "EaW1805/engine", "path": "src/main/java/com/eaw1805/core/initializers/GameInitializer.java", "license": "mit", "size": 56645 }
[ "com.eaw1805.data.managers.RelationsManager", "com.eaw1805.data.model.Game", "com.eaw1805.data.model.NationsRelation" ]
import com.eaw1805.data.managers.RelationsManager; import com.eaw1805.data.model.Game; import com.eaw1805.data.model.NationsRelation;
import com.eaw1805.data.managers.*; import com.eaw1805.data.model.*;
[ "com.eaw1805.data" ]
com.eaw1805.data;
520,071
private void renameCheckpoint(long txid, NameNodeFile fromNnf, NameNodeFile toNnf, boolean renameMD5) throws IOException { ArrayList<StorageDirectory> al = null; for (StorageDirectory sd : storage.dirIterable(NameNodeDirType.IMAGE)) { try { renameImageFileInDir(sd, fromNnf, toNnf, txid, renameMD5); } catch (IOException ioe) { LOG.warn("Unable to rename checkpoint in " + sd, ioe); if (al == null) { al = Lists.newArrayList(); } al.add(sd); } } if(al != null) storage.reportErrorsOnDirectories(al); }
void function(long txid, NameNodeFile fromNnf, NameNodeFile toNnf, boolean renameMD5) throws IOException { ArrayList<StorageDirectory> al = null; for (StorageDirectory sd : storage.dirIterable(NameNodeDirType.IMAGE)) { try { renameImageFileInDir(sd, fromNnf, toNnf, txid, renameMD5); } catch (IOException ioe) { LOG.warn(STR + sd, ioe); if (al == null) { al = Lists.newArrayList(); } al.add(sd); } } if(al != null) storage.reportErrorsOnDirectories(al); }
/** * Rename FSImage with the specific txid */
Rename FSImage with the specific txid
renameCheckpoint
{ "repo_name": "bysslord/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java", "license": "apache-2.0", "size": 57081 }
[ "com.google.common.collect.Lists", "java.io.IOException", "java.util.ArrayList", "org.apache.hadoop.hdfs.server.common.Storage", "org.apache.hadoop.hdfs.server.namenode.NNStorage" ]
import com.google.common.collect.Lists; import java.io.IOException; import java.util.ArrayList; import org.apache.hadoop.hdfs.server.common.Storage; import org.apache.hadoop.hdfs.server.namenode.NNStorage;
import com.google.common.collect.*; import java.io.*; import java.util.*; import org.apache.hadoop.hdfs.server.common.*; import org.apache.hadoop.hdfs.server.namenode.*;
[ "com.google.common", "java.io", "java.util", "org.apache.hadoop" ]
com.google.common; java.io; java.util; org.apache.hadoop;
834,404
public void startDTD(String name, String publicId, String systemId) throws SAXException { if (_lexHandler != null) { _lexHandler.startDTD(name, publicId, systemId); } }
void function(String name, String publicId, String systemId) throws SAXException { if (_lexHandler != null) { _lexHandler.startDTD(name, publicId, systemId); } }
/** * Implements org.xml.sax.ext.LexicalHandler.startDTD() */
Implements org.xml.sax.ext.LexicalHandler.startDTD()
startDTD
{ "repo_name": "kcsl/immutability-benchmark", "path": "benchmark-applications/reiminfer-oopsla-2012/source/Xalan/src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java", "license": "mit", "size": 14774 }
[ "org.xml.sax.SAXException" ]
import org.xml.sax.SAXException;
import org.xml.sax.*;
[ "org.xml.sax" ]
org.xml.sax;
1,018,061
private JTree getUsbTree() { if (usbTree == null) { // open bus LibusbJava.usb_init(); LibusbJava.usb_find_busses(); LibusbJava.usb_find_devices(); UsbBus bus = LibusbJava.usb_get_busses(); treeModel = new UsbTreeModel(bus, jPropertiesArea); usbTree = new JTree(treeModel); expandAll(usbTree); usbTree.addTreeSelectionListener(treeModel); getJTestAppPopup(); usbTree.addMouseListener(new MouseAdapter() {
JTree function() { if (usbTree == null) { LibusbJava.usb_init(); LibusbJava.usb_find_busses(); LibusbJava.usb_find_devices(); UsbBus bus = LibusbJava.usb_get_busses(); treeModel = new UsbTreeModel(bus, jPropertiesArea); usbTree = new JTree(treeModel); expandAll(usbTree); usbTree.addTreeSelectionListener(treeModel); getJTestAppPopup(); usbTree.addMouseListener(new MouseAdapter() {
/** * This method initializes usbTree * * @return javax.swing.JTree */
This method initializes usbTree
getUsbTree
{ "repo_name": "stefanofornari/usbjava2", "path": "usbjava/src/main/java/ch/ntb/usb/demo/UsbView.java", "license": "lgpl-2.1", "size": 11589 }
[ "ch.ntb.usb.LibusbJava", "ch.ntb.usb.UsbBus", "java.awt.event.MouseAdapter", "javax.swing.JTree" ]
import ch.ntb.usb.LibusbJava; import ch.ntb.usb.UsbBus; import java.awt.event.MouseAdapter; import javax.swing.JTree;
import ch.ntb.usb.*; import java.awt.event.*; import javax.swing.*;
[ "ch.ntb.usb", "java.awt", "javax.swing" ]
ch.ntb.usb; java.awt; javax.swing;
1,490,357
public String getCarbonIndexFilePath(final String taskId, final String partitionId, final String segmentId, final String bucketNumber) { String segmentDir = getSegmentDir(partitionId, segmentId); CarbonFile carbonFile = FileFactory.getCarbonFile(segmentDir, FileFactory.getFileType(segmentDir));
String function(final String taskId, final String partitionId, final String segmentId, final String bucketNumber) { String segmentDir = getSegmentDir(partitionId, segmentId); CarbonFile carbonFile = FileFactory.getCarbonFile(segmentDir, FileFactory.getFileType(segmentDir));
/** * Below method will be used to get the index file present in the segment folder * based on task id * * @param taskId task id of the file * @param partitionId partition number * @param segmentId segment number * @return full qualified carbon index path */
Below method will be used to get the index file present in the segment folder based on task id
getCarbonIndexFilePath
{ "repo_name": "ksimar/incubator-carbondata", "path": "core/src/main/java/org/apache/carbondata/core/util/path/CarbonTablePath.java", "license": "apache-2.0", "size": 23844 }
[ "org.apache.carbondata.core.datastore.filesystem.CarbonFile", "org.apache.carbondata.core.datastore.impl.FileFactory" ]
import org.apache.carbondata.core.datastore.filesystem.CarbonFile; import org.apache.carbondata.core.datastore.impl.FileFactory;
import org.apache.carbondata.core.datastore.filesystem.*; import org.apache.carbondata.core.datastore.impl.*;
[ "org.apache.carbondata" ]
org.apache.carbondata;
2,488,113
@Override public void onReceivedLoadError(XWalkView view, int errorCode, String description, String failingUrl) { LOG.d(TAG, "CordovaWebViewClient.onReceivedError: Error code=%s Description=%s URL=%s", errorCode, description, failingUrl); parentEngine.client.onReceivedError(errorCode, description, failingUrl); }
void function(XWalkView view, int errorCode, String description, String failingUrl) { LOG.d(TAG, STR, errorCode, description, failingUrl); parentEngine.client.onReceivedError(errorCode, description, failingUrl); }
/** * Report an error to the host application. These errors are unrecoverable (i.e. the main resource is unavailable). * The errorCode parameter corresponds to one of the ERROR_* constants. * * @param view The WebView that is initiating the callback. * @param errorCode The error code corresponding to an ERROR_* value. * @param description A String describing the error. * @param failingUrl The url that failed to load. */
Report an error to the host application. These errors are unrecoverable (i.e. the main resource is unavailable). The errorCode parameter corresponds to one of the ERROR_* constants
onReceivedLoadError
{ "repo_name": "wesley1001/mobile", "path": "plugins/cordova-plugin-crosswalk-webview/src/android/XWalkCordovaResourceClient.java", "license": "agpl-3.0", "size": 3911 }
[ "org.apache.cordova.LOG", "org.xwalk.core.XWalkView" ]
import org.apache.cordova.LOG; import org.xwalk.core.XWalkView;
import org.apache.cordova.*; import org.xwalk.core.*;
[ "org.apache.cordova", "org.xwalk.core" ]
org.apache.cordova; org.xwalk.core;
2,899,415
public Columns columnsFor( PlanNode node ) { return columnsByPlanNode.get(node); }
Columns function( PlanNode node ) { return columnsByPlanNode.get(node); }
/** * Get the {@link Columns} object for the given plan node. * * @param node plan node; may not be null * @return the columns to be assocated with this plan node; may not be null */
Get the <code>Columns</code> object for the given plan node
columnsFor
{ "repo_name": "stemig62/modeshape", "path": "modeshape-jcr/src/main/java/org/modeshape/jcr/query/engine/ScanningQueryEngine.java", "license": "apache-2.0", "size": 161032 }
[ "org.modeshape.jcr.query.QueryResults", "org.modeshape.jcr.query.plan.PlanNode" ]
import org.modeshape.jcr.query.QueryResults; import org.modeshape.jcr.query.plan.PlanNode;
import org.modeshape.jcr.query.*; import org.modeshape.jcr.query.plan.*;
[ "org.modeshape.jcr" ]
org.modeshape.jcr;
1,797,823
private static double accumulate(AreaEval sumRange, int relRowIndex, int relColIndex) { if (sumRange == null) return 1.0; // count ValueEval addend = sumRange.getRelativeValue(relRowIndex, relColIndex); if (addend instanceof NumberEval) { return ((NumberEval)addend).getNumberValue(); } // everything else (including string and boolean values) counts as zero return 0.0; }
static double function(AreaEval sumRange, int relRowIndex, int relColIndex) { if (sumRange == null) return 1.0; ValueEval addend = sumRange.getRelativeValue(relRowIndex, relColIndex); if (addend instanceof NumberEval) { return ((NumberEval)addend).getNumberValue(); } return 0.0; }
/** * For counts, this would return 1, for sums it returns a cell value or zero. * This is only called after all the criteria are confirmed true for the coordinates. * @param sumRange if used * @param relRowIndex * @param relColIndex * @return the aggregate input value corresponding to the given range coordinates */
For counts, this would return 1, for sums it returns a cell value or zero. This is only called after all the criteria are confirmed true for the coordinates
accumulate
{ "repo_name": "lvweiwolf/poi-3.16", "path": "src/java/org/apache/poi/ss/formula/functions/Baseifs.java", "license": "apache-2.0", "size": 7354 }
[ "org.apache.poi.ss.formula.eval.AreaEval", "org.apache.poi.ss.formula.eval.NumberEval", "org.apache.poi.ss.formula.eval.ValueEval" ]
import org.apache.poi.ss.formula.eval.AreaEval; import org.apache.poi.ss.formula.eval.NumberEval; import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.eval.*;
[ "org.apache.poi" ]
org.apache.poi;
1,276,792
Paint paint = new Paint(); paint.setColorFilter(colorFilter); canvas.drawBitmap(realBitmapDrawable.getBitmap(), 0, 0, paint); }
Paint paint = new Paint(); paint.setColorFilter(colorFilter); canvas.drawBitmap(realBitmapDrawable.getBitmap(), 0, 0, paint); }
/** * Draws the contained bitmap onto the canvas at 0,0 with a default {@code Paint} * * @param canvas the canvas to draw on */
Draws the contained bitmap onto the canvas at 0,0 with a default Paint
draw
{ "repo_name": "qx/FullRobolectricTestSample", "path": "src/main/java/org/robolectric/shadows/ShadowBitmapDrawable.java", "license": "mit", "size": 3281 }
[ "android.graphics.Paint" ]
import android.graphics.Paint;
import android.graphics.*;
[ "android.graphics" ]
android.graphics;
2,901,300
protected File getConfigXmlFile(String typeSelect) { File configFile = null; try { configFile = File.createTempFile("input-config", ".xml"); InputStream bindFileInputStream = this.getClass().getResourceAsStream("/import-configs/" + typeSelect + "-config.xml"); if (bindFileInputStream == null) { printWriter.append(I18n.get(IExceptionMessage.IMPORTER_3) + "\n"); } try (FileOutputStream outputStream = new FileOutputStream(configFile)) { IOUtils.copy(bindFileInputStream, outputStream); } } catch (Exception e) { TraceBackService.trace(e); printWriter.append(e.getLocalizedMessage() + " at " + e.getStackTrace()[0] + "\n"); } return configFile; }
File function(String typeSelect) { File configFile = null; try { configFile = File.createTempFile(STR, ".xml"); InputStream bindFileInputStream = this.getClass().getResourceAsStream(STR + typeSelect + STR); if (bindFileInputStream == null) { printWriter.append(I18n.get(IExceptionMessage.IMPORTER_3) + "\n"); } try (FileOutputStream outputStream = new FileOutputStream(configFile)) { IOUtils.copy(bindFileInputStream, outputStream); } } catch (Exception e) { TraceBackService.trace(e); printWriter.append(e.getLocalizedMessage() + STR + e.getStackTrace()[0] + "\n"); } return configFile; }
/** * Creates binding or configuration file according to typeSelect * * @param typeSelect * @return */
Creates binding or configuration file according to typeSelect
getConfigXmlFile
{ "repo_name": "axelor/axelor-business-suite", "path": "axelor-base/src/main/java/com/axelor/apps/base/service/imports/ImportCityServiceImpl.java", "license": "agpl-3.0", "size": 18562 }
[ "com.axelor.apps.base.exceptions.IExceptionMessage", "com.axelor.exception.service.TraceBackService", "com.axelor.i18n.I18n", "java.io.File", "java.io.FileOutputStream", "java.io.InputStream", "org.apache.commons.io.IOUtils" ]
import com.axelor.apps.base.exceptions.IExceptionMessage; import com.axelor.exception.service.TraceBackService; import com.axelor.i18n.I18n; import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; import org.apache.commons.io.IOUtils;
import com.axelor.apps.base.exceptions.*; import com.axelor.exception.service.*; import com.axelor.i18n.*; import java.io.*; import org.apache.commons.io.*;
[ "com.axelor.apps", "com.axelor.exception", "com.axelor.i18n", "java.io", "org.apache.commons" ]
com.axelor.apps; com.axelor.exception; com.axelor.i18n; java.io; org.apache.commons;
2,489,604
public final <C extends Collection<? super E>> C copyInto(C collection) { checkNotNull(collection); if (iterable instanceof Collection) { collection.addAll(Collections2.cast(iterable)); } else { for (E item : iterable) { collection.add(item); } } return collection; }
final <C extends Collection<? super E>> C function(C collection) { checkNotNull(collection); if (iterable instanceof Collection) { collection.addAll(Collections2.cast(iterable)); } else { for (E item : iterable) { collection.add(item); } } return collection; }
/** * Copies all the elements from this fluent iterable to {@code collection}. This is equivalent to * calling {@code Iterables.addAll(collection, this)}. * * @param collection the collection to copy elements to * @return {@code collection}, for convenience * @since 14.0 */
Copies all the elements from this fluent iterable to collection. This is equivalent to calling Iterables.addAll(collection, this)
copyInto
{ "repo_name": "dongxingong/Guava", "path": "guava/src/com/google/common/collect/FluentIterable.java", "license": "apache-2.0", "size": 20334 }
[ "com.google.common.base.Preconditions", "java.util.Collection" ]
import com.google.common.base.Preconditions; import java.util.Collection;
import com.google.common.base.*; import java.util.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
17,043
@Metadata(description = "The ssl password, which is required to access the keystore file (this is the same password that is supplied to the keystore command's -storepass option).", label = "security", secret = true) public void setSslPassword(String sslPassword) { this.sslPassword = sslPassword; }
@Metadata(description = STR, label = STR, secret = true) void function(String sslPassword) { this.sslPassword = sslPassword; }
/** * The ssl password, which is required to access the keystore file (this is the same password that is supplied to the keystore command's -storepass option). */
The ssl password, which is required to access the keystore file (this is the same password that is supplied to the keystore command's -storepass option)
setSslPassword
{ "repo_name": "jonmcewen/camel", "path": "components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java", "license": "apache-2.0", "size": 65878 }
[ "org.apache.camel.spi.Metadata" ]
import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.*;
[ "org.apache.camel" ]
org.apache.camel;
270,728
public void assertObject(final InternalFactHandle factHandle, final PropagationContext context, final InternalWorkingMemory workingMemory) { EntryPointId entryPoint = context.getEntryPoint(); EntryPointNode node = this.entryPoints.get( entryPoint ); ObjectTypeConf typeConf = ((InternalWorkingMemoryEntryPoint) workingMemory.getWorkingMemoryEntryPoint( entryPoint.getEntryPointId() )).getObjectTypeConfigurationRegistry().getObjectTypeConf( entryPoint, factHandle.getObject() ); node.assertObject( factHandle, context, typeConf, workingMemory ); }
void function(final InternalFactHandle factHandle, final PropagationContext context, final InternalWorkingMemory workingMemory) { EntryPointId entryPoint = context.getEntryPoint(); EntryPointNode node = this.entryPoints.get( entryPoint ); ObjectTypeConf typeConf = ((InternalWorkingMemoryEntryPoint) workingMemory.getWorkingMemoryEntryPoint( entryPoint.getEntryPointId() )).getObjectTypeConfigurationRegistry().getObjectTypeConf( entryPoint, factHandle.getObject() ); node.assertObject( factHandle, context, typeConf, workingMemory ); }
/** * This is the entry point into the network for all asserted Facts. Iterates a cache * of matching <code>ObjectTypdeNode</code>s asserting the Fact. If the cache does not * exist it first iteraes and builds the cache. * * @param factHandle * The FactHandle of the fact to assert * @param context * The <code>PropagationContext</code> of the <code>WorkingMemory</code> action * @param workingMemory * The working memory session. */
This is the entry point into the network for all asserted Facts. Iterates a cache of matching <code>ObjectTypdeNode</code>s asserting the Fact. If the cache does not exist it first iteraes and builds the cache
assertObject
{ "repo_name": "rokn/Count_Words_2015", "path": "testing/drools-master/drools-core/src/main/java/org/drools/core/reteoo/Rete.java", "license": "mit", "size": 10501 }
[ "org.drools.core.common.InternalFactHandle", "org.drools.core.common.InternalWorkingMemory", "org.drools.core.common.InternalWorkingMemoryEntryPoint", "org.drools.core.rule.EntryPointId", "org.drools.core.spi.PropagationContext" ]
import org.drools.core.common.InternalFactHandle; import org.drools.core.common.InternalWorkingMemory; import org.drools.core.common.InternalWorkingMemoryEntryPoint; import org.drools.core.rule.EntryPointId; import org.drools.core.spi.PropagationContext;
import org.drools.core.common.*; import org.drools.core.rule.*; import org.drools.core.spi.*;
[ "org.drools.core" ]
org.drools.core;
1,022,356
public Date getEndDateTime() { return m_endDateTime; }
Date function() { return m_endDateTime; }
/** * Gets the end date/time for when this event should stop recurring. * * <p> * This is ignored for {@link ScheduleType#NOW NOW} and {@link ScheduleType#ONE_TIME ONE_TIME} scheduling. * </p> */
Gets the end date/time for when this event should stop recurring. This is ignored for <code>ScheduleType#NOW NOW</code> and <code>ScheduleType#ONE_TIME ONE_TIME</code> scheduling.
getEndDateTime
{ "repo_name": "3Seventy/vector370-java", "path": "com.t70.vector.client/src/com/t70/vector/client/model/EventPushCampaign.java", "license": "bsd-3-clause", "size": 17936 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
759,840
protected HtmlHeaderContainer newHtmlHeaderContainer(String id) { return new HtmlHeaderContainer(id); }
HtmlHeaderContainer function(String id) { return new HtmlHeaderContainer(id); }
/** * Return a new HtmlHeaderContainer * * @param id * @return HtmlHeaderContainer */
Return a new HtmlHeaderContainer
newHtmlHeaderContainer
{ "repo_name": "Servoy/wicket", "path": "wicket/src/main/java/org/apache/wicket/markup/resolver/HtmlHeaderResolver.java", "license": "apache-2.0", "size": 6444 }
[ "org.apache.wicket.markup.html.internal.HtmlHeaderContainer" ]
import org.apache.wicket.markup.html.internal.HtmlHeaderContainer;
import org.apache.wicket.markup.html.internal.*;
[ "org.apache.wicket" ]
org.apache.wicket;
456,838
public void ensureAtLeastNumDataNodes(int n) { final List<Async<String>> asyncs = new ArrayList<>(); synchronized (this) { int size = numDataNodes(); for (int i = size; i < n; i++) { logger.info("increasing cluster size from {} to {}", size, n); asyncs.add(startNodeAsync()); } } try { for (Async<String> async : asyncs) { async.get(); } } catch (Exception e) { throw new ElasticsearchException("failed to start nodes", e); } if (!asyncs.isEmpty()) { synchronized (this) { assertNoTimeout(client().admin().cluster().prepareHealth().setWaitForNodes(Integer.toString(nodes.size())).get()); } } }
void function(int n) { final List<Async<String>> asyncs = new ArrayList<>(); synchronized (this) { int size = numDataNodes(); for (int i = size; i < n; i++) { logger.info(STR, size, n); asyncs.add(startNodeAsync()); } } try { for (Async<String> async : asyncs) { async.get(); } } catch (Exception e) { throw new ElasticsearchException(STR, e); } if (!asyncs.isEmpty()) { synchronized (this) { assertNoTimeout(client().admin().cluster().prepareHealth().setWaitForNodes(Integer.toString(nodes.size())).get()); } } }
/** * Ensures that at least <code>n</code> data nodes are present in the cluster. * if more nodes than <code>n</code> are present this method will not * stop any of the running nodes. */
Ensures that at least <code>n</code> data nodes are present in the cluster. if more nodes than <code>n</code> are present this method will not stop any of the running nodes
ensureAtLeastNumDataNodes
{ "repo_name": "clintongormley/elasticsearch", "path": "test/framework/src/main/java/org/elasticsearch/test/InternalTestCluster.java", "license": "apache-2.0", "size": 81745 }
[ "java.util.ArrayList", "java.util.List", "org.elasticsearch.ElasticsearchException", "org.elasticsearch.test.hamcrest.ElasticsearchAssertions" ]
import java.util.ArrayList; import java.util.List; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.test.hamcrest.ElasticsearchAssertions;
import java.util.*; import org.elasticsearch.*; import org.elasticsearch.test.hamcrest.*;
[ "java.util", "org.elasticsearch", "org.elasticsearch.test" ]
java.util; org.elasticsearch; org.elasticsearch.test;
309,750
public static Date StringToDate(String str) { Date date = null; final DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US); try { date = format.parse(str); } catch (ParseException e) { Log.e(TAG, "Error in parse string to date."); } return date; }
static Date function(String str) { Date date = null; final DateFormat format = new SimpleDateFormat(STR, Locale.US); try { date = format.parse(str); } catch (ParseException e) { Log.e(TAG, STR); } return date; }
/** * Convert {@link String} to Date * @param str The string date */
Convert <code>String</code> to Date
StringToDate
{ "repo_name": "AliMehrpour/ClipBox", "path": "app/src/main/java/com/volcano/clipbox/Util/Utils.java", "license": "apache-2.0", "size": 7023 }
[ "android.util.Log", "java.text.DateFormat", "java.text.ParseException", "java.text.SimpleDateFormat", "java.util.Date", "java.util.Locale" ]
import android.util.Log; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale;
import android.util.*; import java.text.*; import java.util.*;
[ "android.util", "java.text", "java.util" ]
android.util; java.text; java.util;
1,224,002
public static org.sakaiproject.api.app.syllabus.SyllabusService getInstance() { if (ComponentManager.CACHE_COMPONENTS) { if (m_instance == null) m_instance = (org.sakaiproject.api.app.syllabus.SyllabusService) ComponentManager .get(org.sakaiproject.api.app.syllabus.SyllabusService.class); return m_instance; } else { return (org.sakaiproject.api.app.syllabus.SyllabusService) ComponentManager .get(org.sakaiproject.api.app.syllabus.SyllabusService.class); } }
static org.sakaiproject.api.app.syllabus.SyllabusService function() { if (ComponentManager.CACHE_COMPONENTS) { if (m_instance == null) m_instance = (org.sakaiproject.api.app.syllabus.SyllabusService) ComponentManager .get(org.sakaiproject.api.app.syllabus.SyllabusService.class); return m_instance; } else { return (org.sakaiproject.api.app.syllabus.SyllabusService) ComponentManager .get(org.sakaiproject.api.app.syllabus.SyllabusService.class); } }
/** * Access the component instance: special cover only method. * * @return the component instance. */
Access the component instance: special cover only method
getInstance
{ "repo_name": "eemirtekin/Sakai-10.6-TR", "path": "syllabus/syllabus-api/src/java/org/sakaiproject/api/app/syllabus/cover/SyllabusService.java", "license": "apache-2.0", "size": 3559 }
[ "org.sakaiproject.component.cover.ComponentManager" ]
import org.sakaiproject.component.cover.ComponentManager;
import org.sakaiproject.component.cover.*;
[ "org.sakaiproject.component" ]
org.sakaiproject.component;
1,829,921
@Test public void testPoolNewWrapper() { try { PooledConnection pc = getPooledConnection(); con = pc.getConnection(); Connection con2 = pc.getConnection(); con2.close(); pc.close(); assertTrue( "Two calls to PooledConnection.getConnection should not return the same connection wrapper", con != con2); } catch (SQLException e) { fail(e.getMessage()); } }
void function() { try { PooledConnection pc = getPooledConnection(); con = pc.getConnection(); Connection con2 = pc.getConnection(); con2.close(); pc.close(); assertTrue( STR, con != con2); } catch (SQLException e) { fail(e.getMessage()); } }
/** * Makes sure that if you get two connection wrappers from the same PooledConnection, they are * different, even though the represent the same physical connection. See JDBC 2.0 Optional * Pacakge spec section 6.2.2 */
Makes sure that if you get two connection wrappers from the same PooledConnection, they are different, even though the represent the same physical connection. See JDBC 2.0 Optional Pacakge spec section 6.2.2
testPoolNewWrapper
{ "repo_name": "whitingjr/pgjdbc", "path": "pgjdbc/src/test/java/org/postgresql/test/jdbc2/optional/ConnectionPoolTest.java", "license": "bsd-2-clause", "size": 16906 }
[ "java.sql.Connection", "java.sql.SQLException", "javax.sql.PooledConnection", "org.junit.Assert" ]
import java.sql.Connection; import java.sql.SQLException; import javax.sql.PooledConnection; import org.junit.Assert;
import java.sql.*; import javax.sql.*; import org.junit.*;
[ "java.sql", "javax.sql", "org.junit" ]
java.sql; javax.sql; org.junit;
712,457
public void updateIndex(SchemaIndexCacheFilter filter, SchemaIndexCacheVisitorClosure clo) throws IgniteCheckedException, GridCacheEntryRemovedException;
void function(SchemaIndexCacheFilter filter, SchemaIndexCacheVisitorClosure clo) throws IgniteCheckedException, GridCacheEntryRemovedException;
/** * Update index from within entry lock, passing key, value, and expiration time to provided closure. * * @param filter Row filter. * @param clo Closure to apply to key, value, and expiration time. * @throws IgniteCheckedException If failed. * @throws GridCacheEntryRemovedException If entry was removed. */
Update index from within entry lock, passing key, value, and expiration time to provided closure
updateIndex
{ "repo_name": "psadusumilli/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java", "license": "apache-2.0", "size": 38267 }
[ "org.apache.ignite.IgniteCheckedException", "org.apache.ignite.internal.processors.query.schema.SchemaIndexCacheFilter", "org.apache.ignite.internal.processors.query.schema.SchemaIndexCacheVisitorClosure" ]
import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.internal.processors.query.schema.SchemaIndexCacheFilter; import org.apache.ignite.internal.processors.query.schema.SchemaIndexCacheVisitorClosure;
import org.apache.ignite.*; import org.apache.ignite.internal.processors.query.schema.*;
[ "org.apache.ignite" ]
org.apache.ignite;
482,128
@Test public void testLenientMocksControl_notEqualsDifferentArguments() { MockedClass mock = lenientMocksControl.createMock(MockedClass.class); expect(mock.someBehavior(true, 999, "XXXX", new ArrayList<Object>())).andReturn("Result"); replay(mock); try { mock.someBehavior(true, 999, "Test", new ArrayList<Object>()); fail(); } catch (AssertionError e) { //expected } }
void function() { MockedClass mock = lenientMocksControl.createMock(MockedClass.class); expect(mock.someBehavior(true, 999, "XXXX", new ArrayList<Object>())).andReturn(STR); replay(mock); try { mock.someBehavior(true, 999, "Test", new ArrayList<Object>()); fail(); } catch (AssertionError e) { } }
/** * Test for a mocked method call that is invoked with the different arguments. */
Test for a mocked method call that is invoked with the different arguments
testLenientMocksControl_notEqualsDifferentArguments
{ "repo_name": "arteam/unitils", "path": "unitils-test/src/test/java/org/unitils/easymock/util/LenientMocksControlTest.java", "license": "apache-2.0", "size": 6764 }
[ "java.util.ArrayList", "org.easymock.EasyMock", "org.easymock.classextension.EasyMock", "org.junit.Assert", "org.junit.Test" ]
import java.util.ArrayList; import org.easymock.EasyMock; import org.easymock.classextension.EasyMock; import org.junit.Assert; import org.junit.Test;
import java.util.*; import org.easymock.*; import org.easymock.classextension.*; import org.junit.*;
[ "java.util", "org.easymock", "org.easymock.classextension", "org.junit" ]
java.util; org.easymock; org.easymock.classextension; org.junit;
2,592,215
public long getStorageCardAvail() { long size = 0; String status = Environment.getExternalStorageState(); if (status.equals(Environment.MEDIA_MOUNTED)) { try { File path = Environment.getExternalStorageDirectory(); StatFs stat = new StatFs(path.getPath()); long blockSize = stat.getBlockSize(); long availableBlocks = stat.getAvailableBlocks(); size = availableBlocks * blockSize; } catch (IllegalArgumentException e) { e.printStackTrace(); } } return size; }
long function() { long size = 0; String status = Environment.getExternalStorageState(); if (status.equals(Environment.MEDIA_MOUNTED)) { try { File path = Environment.getExternalStorageDirectory(); StatFs stat = new StatFs(path.getPath()); long blockSize = stat.getBlockSize(); long availableBlocks = stat.getAvailableBlocks(); size = availableBlocks * blockSize; } catch (IllegalArgumentException e) { e.printStackTrace(); } } return size; }
/** * get storage card available size * * @return byte value, can be formated to string by formatSize(long size) * function */
get storage card available size
getStorageCardAvail
{ "repo_name": "BaiduQA/Cafe", "path": "testservice/src/com/baidu/cafe/remote/SystemLib.java", "license": "apache-2.0", "size": 87756 }
[ "android.os.Environment", "android.os.StatFs", "java.io.File" ]
import android.os.Environment; import android.os.StatFs; import java.io.File;
import android.os.*; import java.io.*;
[ "android.os", "java.io" ]
android.os; java.io;
2,232,039
private String getCommandString(SendCommand sendCommand) { String serialNumber = sendCommand.getDeviceSerial(); ChannelUID channelUID = sendCommand.getChannelUID(); Command command = sendCommand.getCommand(); // send command to MAX!Cube LAN Gateway HeatingThermostat device = (HeatingThermostat) getDevice(serialNumber, devices); if (device == null) { logger.debug("Cannot send command to device with serial number {}, device not listed.", serialNumber); return null; } String rfAddress = device.getRFAddress(); String commandString = null; // Temperature setting if (channelUID.getId().equals(CHANNEL_SETTEMP)) { if (command instanceof DecimalType || command instanceof OnOffType) { DecimalType decimalType = DEFAULT_OFF_TEMPERATURE; if (command instanceof DecimalType) { decimalType = (DecimalType) command; } else if (command instanceof OnOffType) { decimalType = OnOffType.ON.equals(command) ? DEFAULT_ON_TEMPERATURE : DEFAULT_OFF_TEMPERATURE; } S_Command cmd = new S_Command(rfAddress, device.getRoomId(), device.getMode(), decimalType.doubleValue()); commandString = cmd.getCommandString(); } // Mode setting } else if (channelUID.getId().equals(CHANNEL_MODE)) { if (command instanceof StringType) { String commandContent = command.toString().trim().toUpperCase(); S_Command cmd = null; ThermostatModeType commandThermoType = null; Double setTemp = Double.parseDouble(device.getTemperatureSetpoint().toString()); if (commandContent.contentEquals(ThermostatModeType.AUTOMATIC.toString())) { commandThermoType = ThermostatModeType.AUTOMATIC; cmd = new S_Command(rfAddress, device.getRoomId(), commandThermoType, 0D); } else if (commandContent.contentEquals(ThermostatModeType.BOOST.toString())) { commandThermoType = ThermostatModeType.BOOST; cmd = new S_Command(rfAddress, device.getRoomId(), commandThermoType, setTemp); } else if (commandContent.contentEquals(ThermostatModeType.MANUAL.toString())) { commandThermoType = ThermostatModeType.MANUAL; cmd = new S_Command(rfAddress, device.getRoomId(), commandThermoType, setTemp); logger.debug("updates to MANUAL mode with temperature '{}'", setTemp); } else { logger.debug("Only updates to AUTOMATIC & BOOST & MANUAL supported, received value :'{}'", commandContent); return null; } commandString = cmd.getCommandString(); } } return commandString; }
String function(SendCommand sendCommand) { String serialNumber = sendCommand.getDeviceSerial(); ChannelUID channelUID = sendCommand.getChannelUID(); Command command = sendCommand.getCommand(); HeatingThermostat device = (HeatingThermostat) getDevice(serialNumber, devices); if (device == null) { logger.debug(STR, serialNumber); return null; } String rfAddress = device.getRFAddress(); String commandString = null; if (channelUID.getId().equals(CHANNEL_SETTEMP)) { if (command instanceof DecimalType command instanceof OnOffType) { DecimalType decimalType = DEFAULT_OFF_TEMPERATURE; if (command instanceof DecimalType) { decimalType = (DecimalType) command; } else if (command instanceof OnOffType) { decimalType = OnOffType.ON.equals(command) ? DEFAULT_ON_TEMPERATURE : DEFAULT_OFF_TEMPERATURE; } S_Command cmd = new S_Command(rfAddress, device.getRoomId(), device.getMode(), decimalType.doubleValue()); commandString = cmd.getCommandString(); } } else if (channelUID.getId().equals(CHANNEL_MODE)) { if (command instanceof StringType) { String commandContent = command.toString().trim().toUpperCase(); S_Command cmd = null; ThermostatModeType commandThermoType = null; Double setTemp = Double.parseDouble(device.getTemperatureSetpoint().toString()); if (commandContent.contentEquals(ThermostatModeType.AUTOMATIC.toString())) { commandThermoType = ThermostatModeType.AUTOMATIC; cmd = new S_Command(rfAddress, device.getRoomId(), commandThermoType, 0D); } else if (commandContent.contentEquals(ThermostatModeType.BOOST.toString())) { commandThermoType = ThermostatModeType.BOOST; cmd = new S_Command(rfAddress, device.getRoomId(), commandThermoType, setTemp); } else if (commandContent.contentEquals(ThermostatModeType.MANUAL.toString())) { commandThermoType = ThermostatModeType.MANUAL; cmd = new S_Command(rfAddress, device.getRoomId(), commandThermoType, setTemp); logger.debug(STR, setTemp); } else { logger.debug(STR, commandContent); return null; } commandString = cmd.getCommandString(); } } return commandString; }
/** * Processes device command and sends it to the MAX!Cube Lan Gateway. * * @param SendCommand * the SendCommand containing the serial number of the device as * String the channelUID used to send the command and the the * command data */
Processes device command and sends it to the MAX!Cube Lan Gateway
getCommandString
{ "repo_name": "kaikreuzer/openhab2", "path": "addons/binding/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/handler/MaxCubeBridgeHandler.java", "license": "epl-1.0", "size": 23004 }
[ "org.eclipse.smarthome.core.library.types.DecimalType", "org.eclipse.smarthome.core.library.types.OnOffType", "org.eclipse.smarthome.core.library.types.StringType", "org.eclipse.smarthome.core.thing.ChannelUID", "org.eclipse.smarthome.core.types.Command", "org.openhab.binding.max.internal.message.HeatingThermostat", "org.openhab.binding.max.internal.message.SendCommand", "org.openhab.binding.max.internal.message.ThermostatModeType" ]
import org.eclipse.smarthome.core.library.types.DecimalType; import org.eclipse.smarthome.core.library.types.OnOffType; import org.eclipse.smarthome.core.library.types.StringType; import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.types.Command; import org.openhab.binding.max.internal.message.HeatingThermostat; import org.openhab.binding.max.internal.message.SendCommand; import org.openhab.binding.max.internal.message.ThermostatModeType;
import org.eclipse.smarthome.core.library.types.*; import org.eclipse.smarthome.core.thing.*; import org.eclipse.smarthome.core.types.*; import org.openhab.binding.max.internal.message.*;
[ "org.eclipse.smarthome", "org.openhab.binding" ]
org.eclipse.smarthome; org.openhab.binding;
1,753,368
public Point2D getPosition() { return position; }
Point2D function() { return position; }
/** * Returns the current <code>Point2D</code> position of this <code>Robot</code>. * @return the current <code>Point2D</code> position of this <code>Robot</code>. */
Returns the current <code>Point2D</code> position of this <code>Robot</code>
getPosition
{ "repo_name": "mhl787156/MinecraftAI", "path": "libraries/neat-preview/neat-experiment-robot-0.1/src/edu/uwa/aidan/robot/world/Robot.java", "license": "lgpl-2.1", "size": 8982 }
[ "java.awt.geom.Point2D" ]
import java.awt.geom.Point2D;
import java.awt.geom.*;
[ "java.awt" ]
java.awt;
2,468,497
public List<Name<String>> pendingMemberNames() { return new ArrayList<Name<String>>(this.memberNamesSource.pendingNames); }
List<Name<String>> function() { return new ArrayList<Name<String>>(this.memberNamesSource.pendingNames); }
/** * Return the pending member names. * * @return the pending member names. */
Return the pending member names
pendingMemberNames
{ "repo_name": "ldp4j/ldp4j", "path": "framework/application/examples/src/main/java/org/ldp4j/example/NameProvider.java", "license": "apache-2.0", "size": 6392 }
[ "java.util.ArrayList", "java.util.List", "org.ldp4j.application.data.Name" ]
import java.util.ArrayList; import java.util.List; import org.ldp4j.application.data.Name;
import java.util.*; import org.ldp4j.application.data.*;
[ "java.util", "org.ldp4j.application" ]
java.util; org.ldp4j.application;
384,707
private void processInputFingerprints(String file, Job job) { @SuppressWarnings("unchecked") Class<? extends LocalStructure> MatcherClass = (Class<? extends LocalStructure>) Util.getClassFromProperty(getConf(), "matcher"); LocalStructure [][] inputls = LocalStructure.extractLocalStructuresFromFile(MatcherClass, file); if(inputls.length == 0) { System.err.println("processInputFingerprints: no input local structures could be read"); return; }
void function(String file, Job job) { @SuppressWarnings(STR) Class<? extends LocalStructure> MatcherClass = (Class<? extends LocalStructure>) Util.getClassFromProperty(getConf(), STR); LocalStructure [][] inputls = LocalStructure.extractLocalStructuresFromFile(MatcherClass, file); if(inputls.length == 0) { System.err.println(STR); return; }
/** * Performs the necessary operations to store the fingerprint information in the distributed cache * @param file Name of the input fingerprint file * @param job Job */
Performs the necessary operations to store the fingerprint information in the distributed cache
processInputFingerprints
{ "repo_name": "dperaltac/bigdata-fingerprint", "path": "src/main/java/sci2s/mrfingerprint/ProcessInputFingerprints.java", "license": "apache-2.0", "size": 4136 }
[ "org.apache.hadoop.mapreduce.Job" ]
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
442,189
// create same two pce-path objects. final String cost1 = "1"; final String bandwidth1 = "200"; final String src1 = "foo"; final String dst1 = "bee"; final String type1 = "1"; final String name1 = "pcc"; PcePath path1 = DefaultPcePath.builder() .source(src1) .destination(dst1) .lspType(type1) .name(name1) .costConstraint(cost1) .bandwidthConstraint(bandwidth1) .build(); path1.id(TunnelId.valueOf("1")); // create same as above object PcePath samePath1 = DefaultPcePath.builder() .source(src1) .destination(dst1) .lspType(type1) .name(name1) .costConstraint(cost1) .bandwidthConstraint(bandwidth1) .build(); samePath1.id(TunnelId.valueOf("1")); // Create different pce-path object. final String cost2 = "1"; final String bandwidth2 = "200"; final String src2 = "google"; final String dst2 = "yahoo"; final String type2 = "2"; final String name2 = "pcc2"; PcePath path2 = DefaultPcePath.builder() .source(src2) .destination(dst2) .lspType(type2) .name(name2) .costConstraint(cost2) .bandwidthConstraint(bandwidth2) .build(); path2.id(TunnelId.valueOf("2")); //TODO: will be uncommented below line once CostConstraint and LocalBandwidthConstraint classes are ready //new EqualsTester().addEqualityGroup(path1, samePath1).addEqualityGroup(path2).testEquals(); }
final String cost1 = "1"; final String bandwidth1 = "200"; final String src1 = "foo"; final String dst1 = "bee"; final String type1 = "1"; final String name1 = "pcc"; PcePath path1 = DefaultPcePath.builder() .source(src1) .destination(dst1) .lspType(type1) .name(name1) .costConstraint(cost1) .bandwidthConstraint(bandwidth1) .build(); path1.id(TunnelId.valueOf("1")); PcePath samePath1 = DefaultPcePath.builder() .source(src1) .destination(dst1) .lspType(type1) .name(name1) .costConstraint(cost1) .bandwidthConstraint(bandwidth1) .build(); samePath1.id(TunnelId.valueOf("1")); final String cost2 = "1"; final String bandwidth2 = "200"; final String src2 = STR; final String dst2 = "yahoo"; final String type2 = "2"; final String name2 = "pcc2"; PcePath path2 = DefaultPcePath.builder() .source(src2) .destination(dst2) .lspType(type2) .name(name2) .costConstraint(cost2) .bandwidthConstraint(bandwidth2) .build(); path2.id(TunnelId.valueOf("2")); }
/** * Checks the operation of equals() methods. */
Checks the operation of equals() methods
testEquals
{ "repo_name": "Phaneendra-Huawei/demo", "path": "apps/pce/app/src/test/java/org/onosproject/pce/pceservice/DefaultPcePathTest.java", "license": "apache-2.0", "size": 3913 }
[ "org.onosproject.incubator.net.tunnel.TunnelId" ]
import org.onosproject.incubator.net.tunnel.TunnelId;
import org.onosproject.incubator.net.tunnel.*;
[ "org.onosproject.incubator" ]
org.onosproject.incubator;
1,329,063
public void setSearchItemResultRows(List<SearchItemResultRow> searchItemResultRows) { this.searchItemResultRows = searchItemResultRows; }
void function(List<SearchItemResultRow> searchItemResultRows) { this.searchItemResultRows = searchItemResultRows; }
/** * Sets search item result rows. * * @param searchItemResultRows the search item result rows */
Sets search item result rows
setSearchItemResultRows
{ "repo_name": "angelindayana/scsb-etl", "path": "src/main/java/org/recap/model/search/SearchResultRow.java", "license": "apache-2.0", "size": 8925 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,770,771
public void itemsAdvanced( final ReportEvent event ) { image = null; }
void function( final ReportEvent event ) { image = null; }
/** * Receives notification that a row of data is being processed. * * @param event * the event. */
Receives notification that a row of data is being processed
itemsAdvanced
{ "repo_name": "mbatchelor/pentaho-reporting", "path": "engine/core/src/main/java/org/pentaho/reporting/engine/classic/core/function/PaintDynamicComponentFunction.java", "license": "lgpl-2.1", "size": 7832 }
[ "org.pentaho.reporting.engine.classic.core.event.ReportEvent" ]
import org.pentaho.reporting.engine.classic.core.event.ReportEvent;
import org.pentaho.reporting.engine.classic.core.event.*;
[ "org.pentaho.reporting" ]
org.pentaho.reporting;
331,635
@WebMethod @WebResult(name = "rval", targetNamespace = "https://www.google.com/apis/ads/publisher/v201502") @RequestWrapper(localName = "createProductTemplates", targetNamespace = "https://www.google.com/apis/ads/publisher/v201502", className = "com.google.api.ads.dfp.jaxws.v201502.ProductTemplateServiceInterfacecreateProductTemplates") @ResponseWrapper(localName = "createProductTemplatesResponse", targetNamespace = "https://www.google.com/apis/ads/publisher/v201502", className = "com.google.api.ads.dfp.jaxws.v201502.ProductTemplateServiceInterfacecreateProductTemplatesResponse") public List<ProductTemplate> createProductTemplates( @WebParam(name = "productTemplates", targetNamespace = "https://www.google.com/apis/ads/publisher/v201502") List<ProductTemplate> productTemplates) throws ApiException_Exception ;
@WebResult(name = "rval", targetNamespace = STRcreateProductTemplatesSTRhttps: @ResponseWrapper(localName = "createProductTemplatesResponseSTRhttps: List<ProductTemplate> function( @WebParam(name = "productTemplatesSTRhttps: List<ProductTemplate> productTemplates) throws ApiException_Exception ;
/** * * Creates new {@link ProductTemplate} objects. * * @param productTemplates the productTemplates to create * @return the persisted product templates with their Ids filled in * * * @param productTemplates * @return * returns java.util.List<com.google.api.ads.dfp.jaxws.v201502.ProductTemplate> * @throws ApiException_Exception */
Creates new <code>ProductTemplate</code> objects
createProductTemplates
{ "repo_name": "stoksey69/googleads-java-lib", "path": "modules/dfp_appengine/src/main/java/com/google/api/ads/dfp/jaxws/v201502/ProductTemplateServiceInterface.java", "license": "apache-2.0", "size": 8440 }
[ "java.util.List", "javax.jws.WebParam", "javax.jws.WebResult", "javax.xml.ws.ResponseWrapper" ]
import java.util.List; import javax.jws.WebParam; import javax.jws.WebResult; import javax.xml.ws.ResponseWrapper;
import java.util.*; import javax.jws.*; import javax.xml.ws.*;
[ "java.util", "javax.jws", "javax.xml" ]
java.util; javax.jws; javax.xml;
1,846,007
public NamingEnumeration list(Name name) throws NamingException { return listBindings(name); }
NamingEnumeration function(Name name) throws NamingException { return listBindings(name); }
/** * The same as listBindings(String). * * @param name name of Context, relative to this Context * @return NamingEnumeration of all name-class pairs. Each element from the enumeration is * instance of NameClassPair * @throws NamingException if naming error occurs * */
The same as listBindings(String)
list
{ "repo_name": "pivotal-amurmann/geode", "path": "geode-core/src/main/java/org/apache/geode/internal/jndi/ContextImpl.java", "license": "apache-2.0", "size": 29126 }
[ "javax.naming.Name", "javax.naming.NamingEnumeration", "javax.naming.NamingException" ]
import javax.naming.Name; import javax.naming.NamingEnumeration; import javax.naming.NamingException;
import javax.naming.*;
[ "javax.naming" ]
javax.naming;
2,422,632
Paint paint = new Paint(); String result = paint.pyramid(2); String expected = String.format(" ^ \r\n^^^\r\n"); assertThat(result, is(expected)); }
Paint paint = new Paint(); String result = paint.pyramid(2); String expected = String.format(STR); assertThat(result, is(expected)); }
/** *Test. Draws pyramid when height == 2. */
Test. Draws pyramid when height == 2
drawsWhenHeightTwo
{ "repo_name": "Malamut54/dbobrov", "path": "chapter_001/src/test/java/ru/job4j/loop/PaintTest.java", "license": "apache-2.0", "size": 789 }
[ "org.hamcrest.core.Is", "org.junit.Assert" ]
import org.hamcrest.core.Is; import org.junit.Assert;
import org.hamcrest.core.*; import org.junit.*;
[ "org.hamcrest.core", "org.junit" ]
org.hamcrest.core; org.junit;
958,626
public void validateVarEntryId( SnmpOid rowOid, long var, Object data ) throws SnmpStatusException { node.validateVarId(var, data); }
void function( SnmpOid rowOid, long var, Object data ) throws SnmpStatusException { node.validateVarId(var, data); }
/** * check that the given "var" identifies a columnar object. */
check that the given "var" identifies a columnar object
validateVarEntryId
{ "repo_name": "rokn/Count_Words_2015", "path": "testing/openjdk/jdk/src/share/classes/sun/management/snmp/jvmmib/JvmRTLibraryPathTableMeta.java", "license": "mit", "size": 9555 }
[ "com.sun.jmx.snmp.SnmpOid", "com.sun.jmx.snmp.SnmpStatusException" ]
import com.sun.jmx.snmp.SnmpOid; import com.sun.jmx.snmp.SnmpStatusException;
import com.sun.jmx.snmp.*;
[ "com.sun.jmx" ]
com.sun.jmx;
2,317,783
String getDefault(CmsObject cms);
String getDefault(CmsObject cms);
/** * Returns the default value of this parameter.<p> * * If no default value has been provided, <code>null</code> is returned.<p> * * @param cms an initialized instance of an OpenCms user context * * @return the default value of this parameter */
Returns the default value of this parameter. If no default value has been provided, <code>null</code> is returned
getDefault
{ "repo_name": "mediaworx/opencms-core", "path": "src/org/opencms/widgets/I_CmsWidgetParameter.java", "license": "lgpl-2.1", "size": 3856 }
[ "org.opencms.file.CmsObject" ]
import org.opencms.file.CmsObject;
import org.opencms.file.*;
[ "org.opencms.file" ]
org.opencms.file;
455,530
public static Locale getLocale(String language, String country, String variant) { LocaleData localeData = lookupLocaleData(resolveLocaleCode(language, country, variant)); return localeData.locale; }
static Locale function(String language, String country, String variant) { LocaleData localeData = lookupLocaleData(resolveLocaleCode(language, country, variant)); return localeData.locale; }
/** * Returns Locale from cache. */
Returns Locale from cache
getLocale
{ "repo_name": "mohanaraosv/jodd", "path": "jodd-core/src/main/java/jodd/util/LocaleUtil.java", "license": "bsd-2-clause", "size": 5294 }
[ "java.util.Locale" ]
import java.util.Locale;
import java.util.*;
[ "java.util" ]
java.util;
1,350,354
void createSchema(String topic, SchemaInfo schemaInfo) throws PulsarAdminException;
void createSchema(String topic, SchemaInfo schemaInfo) throws PulsarAdminException;
/** * Create a schema for a given <tt>topic</tt> with the provided schema info. * * @param topic topic name, in fully qualified fomrat * @param schemaInfo schema info * @throws PulsarAdminException */
Create a schema for a given topic with the provided schema info
createSchema
{ "repo_name": "massakam/pulsar", "path": "pulsar-client-admin-api/src/main/java/org/apache/pulsar/client/admin/Schemas.java", "license": "apache-2.0", "size": 7636 }
[ "org.apache.pulsar.common.schema.SchemaInfo" ]
import org.apache.pulsar.common.schema.SchemaInfo;
import org.apache.pulsar.common.schema.*;
[ "org.apache.pulsar" ]
org.apache.pulsar;
2,344,176
public static IntValuedEnum<RTresult> rtGeometryIsDirty(RTgeometry geometry, Pointer<Integer> dirty) { return FlagSet.fromValue(rtGeometryIsDirty(Pointer.getPeer(geometry), Pointer.getPeer(dirty)), RTresult.class); }
static IntValuedEnum<RTresult> function(RTgeometry geometry, Pointer<Integer> dirty) { return FlagSet.fromValue(rtGeometryIsDirty(Pointer.getPeer(geometry), Pointer.getPeer(dirty)), RTresult.class); }
/** * Original signature : <code>RTresult rtGeometryIsDirty(RTgeometry, int*)</code><br> * <i>native declaration : include\optix_host.h:6269</i> */
Original signature : <code>RTresult rtGeometryIsDirty(RTgeometry, int*)</code> native declaration : include\optix_host.h:6269
rtGeometryIsDirty
{ "repo_name": "fetox74/optix-wrapper", "path": "src/main/java/com/fetoxdevelopments/optix/api/RT.java", "license": "mit", "size": 162970 }
[ "com.fetoxdevelopments.optix.api.enumeration.RTresult", "com.fetoxdevelopments.optix.api.struct.RTgeometry", "org.bridj.FlagSet", "org.bridj.IntValuedEnum", "org.bridj.Pointer" ]
import com.fetoxdevelopments.optix.api.enumeration.RTresult; import com.fetoxdevelopments.optix.api.struct.RTgeometry; import org.bridj.FlagSet; import org.bridj.IntValuedEnum; import org.bridj.Pointer;
import com.fetoxdevelopments.optix.api.enumeration.*; import com.fetoxdevelopments.optix.api.struct.*; import org.bridj.*;
[ "com.fetoxdevelopments.optix", "org.bridj" ]
com.fetoxdevelopments.optix; org.bridj;
861,233
private void setHandshakeFailure(ChannelHandlerContext ctx, Throwable cause) { // Release all resources such as internal buffers that SSLEngine // is managing. engine.closeOutbound(); try { engine.closeInbound(); } catch (SSLException e) { // only log in debug mode as it most likely harmless and latest chrome still trigger // this all the time. // // See https://github.com/netty/netty/issues/1340 String msg = e.getMessage(); if (msg == null || !msg.contains("possible truncation attack")) { logger.debug("{} SSLEngine.closeInbound() raised an exception.", ctx.channel(), e); } } notifyHandshakeFailure(cause); pendingUnencryptedWrites.removeAndFailAll(cause); }
void function(ChannelHandlerContext ctx, Throwable cause) { engine.closeOutbound(); try { engine.closeInbound(); } catch (SSLException e) { String msg = e.getMessage(); if (msg == null !msg.contains(STR)) { logger.debug(STR, ctx.channel(), e); } } notifyHandshakeFailure(cause); pendingUnencryptedWrites.removeAndFailAll(cause); }
/** * Notify all the handshake futures about the failure during the handshake. */
Notify all the handshake futures about the failure during the handshake
setHandshakeFailure
{ "repo_name": "taojiaenx/netty-source-study", "path": "handler/src/main/java/io/netty/handler/ssl/SslHandler.java", "license": "apache-2.0", "size": 59615 }
[ "io.netty.channel.ChannelHandlerContext", "javax.net.ssl.SSLException" ]
import io.netty.channel.ChannelHandlerContext; import javax.net.ssl.SSLException;
import io.netty.channel.*; import javax.net.ssl.*;
[ "io.netty.channel", "javax.net" ]
io.netty.channel; javax.net;
2,896,086
private static void logCommon(int type, String typeIndicator, String message) { if (debug && ((logTypes & type) == type)) { if (logListener != null) { logListener.onLog(type, typeIndicator, message); } else { Log.d(TAG, "[" + TAG + "][" + typeIndicator + "]" + (!message.startsWith("[") && !message.startsWith(" ") ? " " : "") + message); } } }
static void function(int type, String typeIndicator, String message) { if (debug && ((logTypes & type) == type)) { if (logListener != null) { logListener.onLog(type, typeIndicator, message); } else { Log.d(TAG, "[" + TAG + "][" + typeIndicator + "]" + (!message.startsWith("[") && !message.startsWith(" ") ? " " : "") + message); } } }
/** * <p>Log a message (internal)</p> * * <p>Current debug and enabled logtypes decide what gets logged - * even if a custom callback is registered</p> * * @param type Type of message to log * @param typeIndicator String indicator for message type * @param message The message to log */
Log a message (internal) Current debug and enabled logtypes decide what gets logged - even if a custom callback is registered
logCommon
{ "repo_name": "yangyaofei/SSPlugin", "path": "app/src/main/java/eu/chainfire/libsuperuser/Debug.java", "license": "gpl-2.0", "size": 7111 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
2,679,507
public Map<QName, String> getOtherProperties() { return otherProperties; }
Map<QName, String> function() { return otherProperties; }
/** * Metadata properties not hard-coded like the author, title, etc. * * @return Metadata properties not hard-coded like the author, title, etc. */
Metadata properties not hard-coded like the author, title, etc
getOtherProperties
{ "repo_name": "DanielRuf/Plain-of-JARs", "path": "sources/epub2xls/nl/siegmann/epublib/domain/Metadata.java", "license": "gpl-3.0", "size": 5244 }
[ "java.util.Map", "javax.xml.namespace.QName" ]
import java.util.Map; import javax.xml.namespace.QName;
import java.util.*; import javax.xml.namespace.*;
[ "java.util", "javax.xml" ]
java.util; javax.xml;
737,419
public static List<PageDecorator> getPageDecorators() { // this method may be called to render start up errors, at which point Hudson doesn't exist yet. see HUDSON-3608 if(Hudson.getInstance()==null) return Collections.emptyList(); return PageDecorator.all(); }
static List<PageDecorator> function() { if(Hudson.getInstance()==null) return Collections.emptyList(); return PageDecorator.all(); }
/** * Gets all the {@link PageDecorator}s. */
Gets all the <code>PageDecorator</code>s
getPageDecorators
{ "repo_name": "iterate/coding-dojo", "path": "2011-04-26-refactoring_hudson/core/src/main/java/hudson/Functions.java", "license": "apache-2.0", "size": 48096 }
[ "hudson.model.Hudson", "hudson.model.PageDecorator", "java.util.Collections", "java.util.List" ]
import hudson.model.Hudson; import hudson.model.PageDecorator; import java.util.Collections; import java.util.List;
import hudson.model.*; import java.util.*;
[ "hudson.model", "java.util" ]
hudson.model; java.util;
1,320,742
public void writeString(String s, String tag) throws IOException;
void function(String s, String tag) throws IOException;
/** * Write a unicode string to serialized record. * @param s String to be serialized * @param tag Used by tagged serialization formats (such as XML) * @throws IOException Indicates error in serialization */
Write a unicode string to serialized record
writeString
{ "repo_name": "nvoron23/hadoop-20", "path": "src/core/org/apache/hadoop/record/RecordOutput.java", "license": "apache-2.0", "size": 5114 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,685,882
public void renameFile(String sourcefilename, String destinationfilename) throws KettleJobException { try{ c.rename(sourcefilename, destinationfilename); } catch (SftpException e) { throw new KettleJobException(e); } }
void function(String sourcefilename, String destinationfilename) throws KettleJobException { try{ c.rename(sourcefilename, destinationfilename); } catch (SftpException e) { throw new KettleJobException(e); } }
/** * Rename the file. */
Rename the file
renameFile
{ "repo_name": "jjeb/kettle-trunk", "path": "engine/src/org/pentaho/di/job/entries/sftp/SFTPClient.java", "license": "apache-2.0", "size": 11293 }
[ "com.jcraft.jsch.SftpException", "org.pentaho.di.core.exception.KettleJobException" ]
import com.jcraft.jsch.SftpException; import org.pentaho.di.core.exception.KettleJobException;
import com.jcraft.jsch.*; import org.pentaho.di.core.exception.*;
[ "com.jcraft.jsch", "org.pentaho.di" ]
com.jcraft.jsch; org.pentaho.di;
1,799,690
ServerConfig serverConfig = retrieveServerConfig(EndpointType.PROCESS); try { return clientService.getTask(serverConfig, taskId, runtime); } catch (FlowableServiceException e) { LOGGER.error("Error getting task {}", taskId); throw new BadRequestException(e.getMessage()); } }
ServerConfig serverConfig = retrieveServerConfig(EndpointType.PROCESS); try { return clientService.getTask(serverConfig, taskId, runtime); } catch (FlowableServiceException e) { LOGGER.error(STR, taskId); throw new BadRequestException(e.getMessage()); } }
/** * GET /rest/authenticate -> check if the user is authenticated, and return its login. */
GET /rest/authenticate -> check if the user is authenticated, and return its login
getTask
{ "repo_name": "stephraleigh/flowable-engine", "path": "modules/flowable-ui-admin/src/main/java/org/flowable/admin/app/rest/client/TaskClientResource.java", "license": "apache-2.0", "size": 6002 }
[ "org.flowable.admin.domain.EndpointType", "org.flowable.admin.domain.ServerConfig", "org.flowable.admin.service.engine.exception.FlowableServiceException", "org.flowable.app.service.exception.BadRequestException" ]
import org.flowable.admin.domain.EndpointType; import org.flowable.admin.domain.ServerConfig; import org.flowable.admin.service.engine.exception.FlowableServiceException; import org.flowable.app.service.exception.BadRequestException;
import org.flowable.admin.domain.*; import org.flowable.admin.service.engine.exception.*; import org.flowable.app.service.exception.*;
[ "org.flowable.admin", "org.flowable.app" ]
org.flowable.admin; org.flowable.app;
1,989,253
public void writeShortLittle(short n) throws IOException { writeByte(n); writeByte(n >> 8); }
void function(short n) throws IOException { writeByte(n); writeByte(n >> 8); }
/** * Write a 16 bit integer to the stream in Little Endian format. */
Write a 16 bit integer to the stream in Little Endian format
writeShortLittle
{ "repo_name": "philburk/jsyn", "path": "src/main/java/com/jsyn/util/WaveFileWriter.java", "license": "apache-2.0", "size": 8987 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
636,983
@Path("{id}") public HostResource getHostSubResource(@PathParam("id") String id);
@Path("{id}") HostResource function(@PathParam("id") String id);
/** * Sub-resource locator method, returns individual HostResource on which the * remainder of the URI is dispatched. * * @param id the Host ID * @return matching subresource if found */
Sub-resource locator method, returns individual HostResource on which the remainder of the URI is dispatched
getHostSubResource
{ "repo_name": "halober/ovirt-engine", "path": "backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/HostsResource.java", "license": "apache-2.0", "size": 2327 }
[ "javax.ws.rs.Path", "javax.ws.rs.PathParam" ]
import javax.ws.rs.Path; import javax.ws.rs.PathParam;
import javax.ws.rs.*;
[ "javax.ws" ]
javax.ws;
2,029,059
@Nonnull public OnenoteEntityBaseModelRequest expand(@Nonnull final String value) { addExpandOption(value); return this; }
OnenoteEntityBaseModelRequest function(@Nonnull final String value) { addExpandOption(value); return this; }
/** * Sets the expand clause for the request * * @param value the expand clause * @return the updated request */
Sets the expand clause for the request
expand
{ "repo_name": "microsoftgraph/msgraph-sdk-java", "path": "src/main/java/com/microsoft/graph/requests/OnenoteEntityBaseModelRequest.java", "license": "mit", "size": 6990 }
[ "javax.annotation.Nonnull" ]
import javax.annotation.Nonnull;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
724,057
PetriNetDoc getPetrinet();
PetriNetDoc getPetrinet();
/** * Returns the value of the '<em><b>Petrinet</b></em>' reference. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Petrinet</em>' reference isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Petrinet</em>' reference. * @see #setPetrinet(PetriNetDoc) * @see configuration.ConfigurationPackage#getConfiguration_Petrinet() * @model required="true" * @generated */
Returns the value of the 'Petrinet' reference. If the meaning of the 'Petrinet' reference isn't clear, there really should be more of a description here...
getPetrinet
{ "repo_name": "albertfdp/petrinet", "path": "src/dk.dtu.se2.configuration/src/configuration/Configuration.java", "license": "mit", "size": 3394 }
[ "org.pnml.tools.epnk.pnmlcoremodel.PetriNetDoc" ]
import org.pnml.tools.epnk.pnmlcoremodel.PetriNetDoc;
import org.pnml.tools.epnk.pnmlcoremodel.*;
[ "org.pnml.tools" ]
org.pnml.tools;
2,510,837
public void setTypes() { this.jComboBoxCalculationType.addItem(new Tag( CalculationEnum.NOTHING,I18n.getString("JRSubreportReturnValueDialog.ComboBox.Nothing"))); this.jComboBoxCalculationType.addItem(new Tag( CalculationEnum.COUNT, I18n.getString("JRSubreportReturnValueDialog.ComboBox.Count"))); this.jComboBoxCalculationType.addItem(new Tag( CalculationEnum.DISTINCT_COUNT, I18n.getString("JRSubreportReturnValueDialog.ComboBox.DistinctCount"))); this.jComboBoxCalculationType.addItem(new Tag( CalculationEnum.SUM, I18n.getString("JRSubreportReturnValueDialog.ComboBox.Sum"))); this.jComboBoxCalculationType.addItem(new Tag( CalculationEnum.AVERAGE, I18n.getString("JRSubreportReturnValueDialog.ComboBox.Average"))); this.jComboBoxCalculationType.addItem(new Tag( CalculationEnum.LOWEST, I18n.getString("JRSubreportReturnValueDialog.ComboBox.Lowest"))); this.jComboBoxCalculationType.addItem(new Tag( CalculationEnum.HIGHEST, I18n.getString("JRSubreportReturnValueDialog.ComboBox.Highest"))); this.jComboBoxCalculationType.addItem(new Tag( CalculationEnum.STANDARD_DEVIATION, I18n.getString("JRSubreportReturnValueDialog.ComboBox.StandardDeviation"))); this.jComboBoxCalculationType.addItem(new Tag( CalculationEnum.VARIANCE, I18n.getString("JRSubreportReturnValueDialog.ComboBox.Variance"))); // CALCULATION_SYSTEM Not allowed as calc type for return values... [bug 0004349] // this.jComboBoxCalculationType.addItem(new Tag( new Byte( JRDesignVariable.CALCULATION_SYSTEM ), I18n.getString("JRSubreportReturnValueDialog.ComboBox.System"))); this.jComboBoxCalculationType.addItem(new Tag( CalculationEnum.FIRST, I18n.getString("JRSubreportReturnValueDialog.ComboBox.First"))); }
void function() { this.jComboBoxCalculationType.addItem(new Tag( CalculationEnum.NOTHING,I18n.getString(STR))); this.jComboBoxCalculationType.addItem(new Tag( CalculationEnum.COUNT, I18n.getString(STR))); this.jComboBoxCalculationType.addItem(new Tag( CalculationEnum.DISTINCT_COUNT, I18n.getString(STR))); this.jComboBoxCalculationType.addItem(new Tag( CalculationEnum.SUM, I18n.getString(STR))); this.jComboBoxCalculationType.addItem(new Tag( CalculationEnum.AVERAGE, I18n.getString(STR))); this.jComboBoxCalculationType.addItem(new Tag( CalculationEnum.LOWEST, I18n.getString(STR))); this.jComboBoxCalculationType.addItem(new Tag( CalculationEnum.HIGHEST, I18n.getString(STR))); this.jComboBoxCalculationType.addItem(new Tag( CalculationEnum.STANDARD_DEVIATION, I18n.getString(STR))); this.jComboBoxCalculationType.addItem(new Tag( CalculationEnum.VARIANCE, I18n.getString(STR))); this.jComboBoxCalculationType.addItem(new Tag( CalculationEnum.FIRST, I18n.getString(STR))); }
/** * DOCUMENT ME! */
DOCUMENT ME
setTypes
{ "repo_name": "klebergraciasoares/ireport-fork", "path": "ireport-designer/src/com/jaspersoft/ireport/designer/tools/JRSubreportReturnValueDialog.java", "license": "agpl-3.0", "size": 18528 }
[ "com.jaspersoft.ireport.designer.sheet.Tag", "com.jaspersoft.ireport.locale.I18n", "net.sf.jasperreports.engine.type.CalculationEnum" ]
import com.jaspersoft.ireport.designer.sheet.Tag; import com.jaspersoft.ireport.locale.I18n; import net.sf.jasperreports.engine.type.CalculationEnum;
import com.jaspersoft.ireport.designer.sheet.*; import com.jaspersoft.ireport.locale.*; import net.sf.jasperreports.engine.type.*;
[ "com.jaspersoft.ireport", "net.sf.jasperreports" ]
com.jaspersoft.ireport; net.sf.jasperreports;
139,534
public BitSet getStates() { return states; }
BitSet function() { return states; }
/** Get the state set of this element (if kind is one of INF, FIN, INF_NOT, FIN_NOT). */
Get the state set of this element (if kind is one of INF, FIN, INF_NOT, FIN_NOT)
getStates
{ "repo_name": "nicodelpiano/prism", "path": "src/acceptance/AcceptanceGeneric.java", "license": "gpl-2.0", "size": 10860 }
[ "java.util.BitSet" ]
import java.util.BitSet;
import java.util.*;
[ "java.util" ]
java.util;
2,146,732
public GapPolicy gapPolicy() { return gapPolicy; }
GapPolicy function() { return gapPolicy; }
/** * Gets the GapPolicy to use on the output of this aggregation. */
Gets the GapPolicy to use on the output of this aggregation
gapPolicy
{ "repo_name": "GlenRSmith/elasticsearch", "path": "server/src/main/java/org/elasticsearch/search/aggregations/pipeline/SerialDiffPipelineAggregationBuilder.java", "license": "apache-2.0", "size": 9390 }
[ "org.elasticsearch.search.aggregations.pipeline.BucketHelpers" ]
import org.elasticsearch.search.aggregations.pipeline.BucketHelpers;
import org.elasticsearch.search.aggregations.pipeline.*;
[ "org.elasticsearch.search" ]
org.elasticsearch.search;
316,747
public TileEntity createNewTileEntity(World worldIn, int meta) { return new TileEntityFurnace(); }
TileEntity function(World worldIn, int meta) { return new TileEntityFurnace(); }
/** * Returns a new instance of a block's tile entity class. Called on placing the block. */
Returns a new instance of a block's tile entity class. Called on placing the block
createNewTileEntity
{ "repo_name": "InverMN/MinecraftForgeReference", "path": "MinecraftBlocks/BlockFurnace.java", "license": "unlicense", "size": 11513 }
[ "net.minecraft.tileentity.TileEntity", "net.minecraft.tileentity.TileEntityFurnace", "net.minecraft.world.World" ]
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityFurnace; import net.minecraft.world.World;
import net.minecraft.tileentity.*; import net.minecraft.world.*;
[ "net.minecraft.tileentity", "net.minecraft.world" ]
net.minecraft.tileentity; net.minecraft.world;
2,099,303
public void setConfigurations(Map<String, QuickfixjConfiguration> configurations) { this.configurations = configurations; }
void function(Map<String, QuickfixjConfiguration> configurations) { this.configurations = configurations; }
/** * To use the given map of pre configured QuickFix configurations mapped to the key */
To use the given map of pre configured QuickFix configurations mapped to the key
setConfigurations
{ "repo_name": "DariusX/camel", "path": "components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjComponent.java", "license": "apache-2.0", "size": 8304 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,897,078
protected ConfigurableApplicationContext createApplicationContext() { Class<?> contextClass = this.applicationContextClass; if (contextClass == null) { try { contextClass = Class.forName(this.webEnvironment ? DEFAULT_WEB_CONTEXT_CLASS : DEFAULT_CONTEXT_CLASS); } catch (ClassNotFoundException ex) { throw new IllegalStateException( "Unable create a default ApplicationContext, " + "please specify an ApplicationContextClass", ex); } } return (ConfigurableApplicationContext) BeanUtils.instantiate(contextClass); }
ConfigurableApplicationContext function() { Class<?> contextClass = this.applicationContextClass; if (contextClass == null) { try { contextClass = Class.forName(this.webEnvironment ? DEFAULT_WEB_CONTEXT_CLASS : DEFAULT_CONTEXT_CLASS); } catch (ClassNotFoundException ex) { throw new IllegalStateException( STR + STR, ex); } } return (ConfigurableApplicationContext) BeanUtils.instantiate(contextClass); }
/** * Strategy method used to create the {@link ApplicationContext}. By default this * method will respect any explicitly set application context or application context * class before falling back to a suitable default. * @return the application context (not yet refreshed) * @see #setApplicationContextClass(Class) */
Strategy method used to create the <code>ApplicationContext</code>. By default this method will respect any explicitly set application context or application context class before falling back to a suitable default
createApplicationContext
{ "repo_name": "lenicliu/spring-boot", "path": "spring-boot/src/main/java/org/springframework/boot/SpringApplication.java", "license": "apache-2.0", "size": 45335 }
[ "org.springframework.beans.BeanUtils", "org.springframework.context.ConfigurableApplicationContext" ]
import org.springframework.beans.BeanUtils; import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.beans.*; import org.springframework.context.*;
[ "org.springframework.beans", "org.springframework.context" ]
org.springframework.beans; org.springframework.context;
1,567,372
Xid[] doRecover (Xid xid, String parentNodeName) throws XAException, NotSupportedException;
Xid[] doRecover (Xid xid, String parentNodeName) throws XAException, NotSupportedException;
/** * Return a list of indoubt transactions. This may include those * transactions that are currently in-flight (the 2PC phase has not been reached) and do not need * recovery invoked on them. * * @param parentNodeName * If not null then only recover transactions for this node * @throws XAException * thrown if any error occurs. * @return a list of potentially indoubt transactions or <code>null</code>. */
Return a list of indoubt transactions. This may include those transactions that are currently in-flight (the 2PC phase has not been reached) and do not need recovery invoked on them
doRecover
{ "repo_name": "jbosstm/jboss-transaction-spi", "path": "javaee/src/main/java/org/jboss/tm/ExtendedJBossXATerminator.java", "license": "lgpl-2.1", "size": 6604 }
[ "javax.transaction.NotSupportedException", "javax.transaction.xa.XAException", "javax.transaction.xa.Xid" ]
import javax.transaction.NotSupportedException; import javax.transaction.xa.XAException; import javax.transaction.xa.Xid;
import javax.transaction.*; import javax.transaction.xa.*;
[ "javax.transaction" ]
javax.transaction;
1,195,965
public void setZone(DateTimeZone zone) { iSavedState = null; iZone = zone == DateTimeZone.UTC ? null : zone; iOffset = 0; }
void function(DateTimeZone zone) { iSavedState = null; iZone = zone == DateTimeZone.UTC ? null : zone; iOffset = 0; }
/** * Set a time zone to be used when computeMillis is called, which * overrides any set time zone offset. * * @param zone the date time zone to operate in, or null if UTC */
Set a time zone to be used when computeMillis is called, which overrides any set time zone offset
setZone
{ "repo_name": "hedefalk/joda-time", "path": "src/main/java/org/joda/time/format/DateTimeParserBucket.java", "license": "apache-2.0", "size": 18206 }
[ "org.joda.time.DateTimeZone" ]
import org.joda.time.DateTimeZone;
import org.joda.time.*;
[ "org.joda.time" ]
org.joda.time;
136,156
public static int nullSafeHashCode(@Nullable char[] array) { if (array == null) { return 0; } int hash = INITIAL_HASH; for (char element : array) { hash = MULTIPLIER * hash + element; } return hash; }
static int function(@Nullable char[] array) { if (array == null) { return 0; } int hash = INITIAL_HASH; for (char element : array) { hash = MULTIPLIER * hash + element; } return hash; }
/** * Return a hash code based on the contents of the specified array. * If {@code array} is {@code null}, this method returns 0. */
Return a hash code based on the contents of the specified array. If array is null, this method returns 0
nullSafeHashCode
{ "repo_name": "spring-projects/spring-framework", "path": "spring-core/src/main/java/org/springframework/util/ObjectUtils.java", "license": "apache-2.0", "size": 28717 }
[ "org.springframework.lang.Nullable" ]
import org.springframework.lang.Nullable;
import org.springframework.lang.*;
[ "org.springframework.lang" ]
org.springframework.lang;
2,050,574
public static void setBackground(MutableAttributeSet a, Color bg) { a.addAttribute(Background, bg); }
static void function(MutableAttributeSet a, Color bg) { a.addAttribute(Background, bg); }
/** * Adds a background attribute to the specified set. * * @param a the attribute set (<code>null</code> not permitted). * @param bg the background (<code>null</code> not permitted). * * @throws NullPointerException if either argument is <code>null</code>. * * @see #getBackground(AttributeSet) */
Adds a background attribute to the specified set
setBackground
{ "repo_name": "SanDisk-Open-Source/SSD_Dashboard", "path": "uefi/gcc/gcc-4.6.3/libjava/classpath/javax/swing/text/StyleConstants.java", "license": "gpl-2.0", "size": 32608 }
[ "java.awt.Color" ]
import java.awt.Color;
import java.awt.*;
[ "java.awt" ]
java.awt;
780,632
@NonNull public List<T> getItems() { return mItems != null ? Collections.unmodifiableList(mItems) : Collections.<T>emptyList(); }
List<T> function() { return mItems != null ? Collections.unmodifiableList(mItems) : Collections.<T>emptyList(); }
/** * Get the list of all items. * * @return an unmodifiable list of all items */
Get the list of all items
getItems
{ "repo_name": "panzerfahrer/android-maps-utils", "path": "library/src/com/google/maps/android/MarkerManager.java", "license": "apache-2.0", "size": 32056 }
[ "java.util.Collections", "java.util.List" ]
import java.util.Collections; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,342,809
public static java.util.List extractPaymentTreatingHospitalLinkList(ims.domain.ILightweightDomainFactory domainFactory, ims.admin.vo.PaymentTreatmentHospitalLinkVoCollection voCollection) { return extractPaymentTreatingHospitalLinkList(domainFactory, voCollection, null, new HashMap()); }
static java.util.List function(ims.domain.ILightweightDomainFactory domainFactory, ims.admin.vo.PaymentTreatmentHospitalLinkVoCollection voCollection) { return extractPaymentTreatingHospitalLinkList(domainFactory, voCollection, null, new HashMap()); }
/** * Create the ims.ntpf.configuration.domain.objects.PaymentTreatingHospitalLink list from the value object collection. * @param domainFactory - used to create existing (persistent) domain objects. * @param voCollection - the collection of value objects */
Create the ims.ntpf.configuration.domain.objects.PaymentTreatingHospitalLink list from the value object collection
extractPaymentTreatingHospitalLinkList
{ "repo_name": "FreudianNM/openMAXIMS", "path": "Source Library/openmaxims_workspace/ValueObjects/src/ims/admin/vo/domain/PaymentTreatmentHospitalLinkVoAssembler.java", "license": "agpl-3.0", "size": 20695 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
2,697,892
public void dispose() { for (Image img : m_icons.values()) { img.dispose(); } m_icons = null; m_scopeStyles = null; m_text = null; s_cfg.removePropertyChangeListener(this); }
void function() { for (Image img : m_icons.values()) { img.dispose(); } m_icons = null; m_scopeStyles = null; m_text = null; s_cfg.removePropertyChangeListener(this); }
/*************************************************************************** * Dispose the graphic objects to release resources **************************************************************************/
Dispose the graphic objects to release resources
dispose
{ "repo_name": "Spacecraft-Code/SPELL", "path": "src/spel-gui/com.astra.ses.spell.gui.textview/src/com/astra/ses/spell/gui/presentation/text/controls/TextLineLabelProvider.java", "license": "lgpl-3.0", "size": 7766 }
[ "org.eclipse.swt.graphics.Image" ]
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.*;
[ "org.eclipse.swt" ]
org.eclipse.swt;
170,518
public void zoomInRange(double x, double y) { Plot p = this.chart.getPlot(); if (p instanceof Zoomable) { Zoomable z = (Zoomable) p; z.zoomRangeAxes(this.zoomInFactor, this.info.getPlotInfo(), translateScreenToJava2D(new Point((int) x, (int) y))); } }
void function(double x, double y) { Plot p = this.chart.getPlot(); if (p instanceof Zoomable) { Zoomable z = (Zoomable) p; z.zoomRangeAxes(this.zoomInFactor, this.info.getPlotInfo(), translateScreenToJava2D(new Point((int) x, (int) y))); } }
/** * Decreases the length of the range axis, centered about the given * coordinate on the screen. The length of the range axis is reduced by * the value of {@link #getZoomInFactor()}. * * @param x the x-coordinate (in screen coordinates). * @param y the y coordinate (in screen coordinates). */
Decreases the length of the range axis, centered about the given coordinate on the screen. The length of the range axis is reduced by the value of <code>#getZoomInFactor()</code>
zoomInRange
{ "repo_name": "simeshev/parabuild-ci", "path": "3rdparty/jfreechart-1.0.5/source/org/jfree/chart/ChartPanel.java", "license": "lgpl-3.0", "size": 84894 }
[ "java.awt.Point", "org.jfree.chart.plot.Plot", "org.jfree.chart.plot.Zoomable" ]
import java.awt.Point; import org.jfree.chart.plot.Plot; import org.jfree.chart.plot.Zoomable;
import java.awt.*; import org.jfree.chart.plot.*;
[ "java.awt", "org.jfree.chart" ]
java.awt; org.jfree.chart;
2,290,630
public ServiceResponse<Void> putMax64(long intBody) throws ErrorException, IOException { Call<ResponseBody> call = service.putMax64(intBody); return putMax64Delegate(call.execute()); }
ServiceResponse<Void> function(long intBody) throws ErrorException, IOException { Call<ResponseBody> call = service.putMax64(intBody); return putMax64Delegate(call.execute()); }
/** * Put max int64 value. * * @param intBody the long value * @throws ErrorException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @return the {@link ServiceResponse} object if successful. */
Put max int64 value
putMax64
{ "repo_name": "xingwu1/autorest", "path": "AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/bodyinteger/IntOperationsImpl.java", "license": "mit", "size": 32576 }
[ "com.microsoft.rest.ServiceResponse", "java.io.IOException" ]
import com.microsoft.rest.ServiceResponse; import java.io.IOException;
import com.microsoft.rest.*; import java.io.*;
[ "com.microsoft.rest", "java.io" ]
com.microsoft.rest; java.io;
1,946,195
public String getAttribute(String attribute) { String value = null; IValueMap attributeMap = openTag.getAttributes(); if (attributeMap != null) { for (String attr : attributeMap.keySet()) { if (attr.equalsIgnoreCase(attribute)) { value = attributeMap.getString(attr); } } } return value; }
String function(String attribute) { String value = null; IValueMap attributeMap = openTag.getAttributes(); if (attributeMap != null) { for (String attr : attributeMap.keySet()) { if (attr.equalsIgnoreCase(attribute)) { value = attributeMap.getString(attr); } } } return value; }
/** * Gets the value for a given attribute. Please note that this is non case-sensitive, because * attributes in HTML may be non case-sensitive. * * @param attribute * an attribute to look for in the tag * @return the value of the attribute or <code>null</code> if it isn't found. */
Gets the value for a given attribute. Please note that this is non case-sensitive, because attributes in HTML may be non case-sensitive
getAttribute
{ "repo_name": "topicusonderwijs/wicket", "path": "wicket-core/src/main/java/org/apache/wicket/util/tester/TagTester.java", "license": "apache-2.0", "size": 18256 }
[ "org.apache.wicket.util.value.IValueMap" ]
import org.apache.wicket.util.value.IValueMap;
import org.apache.wicket.util.value.*;
[ "org.apache.wicket" ]
org.apache.wicket;
980,090
@Override public void setLogWriter(PrintWriter out) throws SQLException { }
void function(PrintWriter out) throws SQLException { }
/** * set log writer. * * @param out * PrintWriter * @throws SQLException * sql exception */
set log writer
setLogWriter
{ "repo_name": "GavinGu/kyli_v2", "path": "src/main/java/com/xthena/core/jdbc/MockDataSource.java", "license": "apache-2.0", "size": 2164 }
[ "java.io.PrintWriter", "java.sql.SQLException" ]
import java.io.PrintWriter; import java.sql.SQLException;
import java.io.*; import java.sql.*;
[ "java.io", "java.sql" ]
java.io; java.sql;
1,054,817
public ActionListener[] getActionListeners() { return (ActionListener[]) listenerList.getListeners(ActionListener.class); }
ActionListener[] function() { return (ActionListener[]) listenerList.getListeners(ActionListener.class); }
/** * DOCUMENT ME! * * @return DOCUMENT ME! * * @since 1.4 */
DOCUMENT ME
getActionListeners
{ "repo_name": "unofficial-opensource-apple/gcc_40", "path": "libjava/javax/swing/Timer.java", "license": "gpl-2.0", "size": 7552 }
[ "java.awt.event.ActionListener" ]
import java.awt.event.ActionListener;
import java.awt.event.*;
[ "java.awt" ]
java.awt;
1,031,170
protected final void setCollationUsingCompilationSchema() throws StandardException { setCollationUsingCompilationSchema( StringDataValue.COLLATION_DERIVATION_IMPLICIT); }
final void function() throws StandardException { setCollationUsingCompilationSchema( StringDataValue.COLLATION_DERIVATION_IMPLICIT); }
/** * Set the collation based upon the current schema with derivation * type implicit. * * @throws StandardException */
Set the collation based upon the current schema with derivation type implicit
setCollationUsingCompilationSchema
{ "repo_name": "viaper/DBPlus", "path": "DerbyHodgepodge/java/engine/org/apache/derby/impl/sql/compile/ValueNode.java", "license": "apache-2.0", "size": 43555 }
[ "org.apache.derby.iapi.error.StandardException", "org.apache.derby.iapi.types.StringDataValue" ]
import org.apache.derby.iapi.error.StandardException; import org.apache.derby.iapi.types.StringDataValue;
import org.apache.derby.iapi.error.*; import org.apache.derby.iapi.types.*;
[ "org.apache.derby" ]
org.apache.derby;
1,179,465
public void next(Alert alert, Displayable next) { if (this.current == next) { return; } if (this.current != null) { this.stack.push(this.current); } this.current = next; this.display.setCurrent(alert, this.current); }
void function(Alert alert, Displayable next) { if (this.current == next) { return; } if (this.current != null) { this.stack.push(this.current); } this.current = next; this.display.setCurrent(alert, this.current); }
/** * Sets the specified displayable as the current * screen. * * @param next screen to show. */
Sets the specified displayable as the current screen
next
{ "repo_name": "SaferMobile/InTheClear", "path": "projects/j2me/src/org/safermobile/micro/ui/DisplayManager.java", "license": "gpl-3.0", "size": 1626 }
[ "javax.microedition.lcdui.Alert", "javax.microedition.lcdui.Displayable" ]
import javax.microedition.lcdui.Alert; import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.*;
[ "javax.microedition" ]
javax.microedition;
2,723,146
public final NitfSegmentsFlow forEachTextSegment(final Consumer<TextSegment> consumer) { return forEachSegment(consumer, () -> mDataSource.getTextSegments()); }
final NitfSegmentsFlow function(final Consumer<TextSegment> consumer) { return forEachSegment(consumer, () -> mDataSource.getTextSegments()); }
/** * Iterates over the text segments in the NITF file and passes them to the supplied consumer. * * @param consumer The consumer to pass the text segment to. * @return this NitfSegmentsFlow. */
Iterates over the text segments in the NITF file and passes them to the supplied consumer
forEachTextSegment
{ "repo_name": "bradh/imaging-nitf", "path": "fluent-api/src/main/java/org/codice/imaging/nitf/fluent/NitfSegmentsFlow.java", "license": "lgpl-2.1", "size": 5712 }
[ "java.util.function.Consumer", "org.codice.imaging.nitf.core.text.TextSegment" ]
import java.util.function.Consumer; import org.codice.imaging.nitf.core.text.TextSegment;
import java.util.function.*; import org.codice.imaging.nitf.core.text.*;
[ "java.util", "org.codice.imaging" ]
java.util; org.codice.imaging;
716,682
@SuppressWarnings("deprecation") @Test public void retrieveWhereGTNullByEqual() throws Exception { IQuery<QueryEntity> query = qb .build(qb.let(qb.property(propertyName3)).isGreaterThan(qb.valueName(paramName1))); nameToValueMap.put(paramName1, null); List<QueryEntity> actual = query.retrieve(nameToValueMap); assertTrue(actual.isEmpty()); }
@SuppressWarnings(STR) void function() throws Exception { IQuery<QueryEntity> query = qb .build(qb.let(qb.property(propertyName3)).isGreaterThan(qb.valueName(paramName1))); nameToValueMap.put(paramName1, null); List<QueryEntity> actual = query.retrieve(nameToValueMap); assertTrue(actual.isEmpty()); }
/** * Greater-than with a null-value is always false - so no results. * * @throws Exception */
Greater-than with a null-value is always false - so no results
retrieveWhereGTNullByEqual
{ "repo_name": "Dennis-Koch/ambeth", "path": "jambeth/jambeth-test/src/test/java/com/koch/ambeth/query/QueryTest.java", "license": "apache-2.0", "size": 28311 }
[ "java.util.List", "org.junit.Assert" ]
import java.util.List; import org.junit.Assert;
import java.util.*; import org.junit.*;
[ "java.util", "org.junit" ]
java.util; org.junit;
1,295,361
public void close() throws IOException { // Nothing to do here. super.close(); }
void function() throws IOException { super.close(); }
/** * Closes the input stream. * * @throws IOException if an error occurs during an I/O operation. */
Closes the input stream
close
{ "repo_name": "SanDisk-Open-Source/SSD_Dashboard", "path": "uefi/gcc/gcc-4.6.3/libjava/classpath/java/util/zip/GZIPInputStream.java", "license": "gpl-2.0", "size": 10261 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
98,671
public DescriptorExtensionList<AbstractStorageProvider, AbstractStorageProvider.StorageProviderDescriptor> getAllProviders() { return AbstractStorageProvider.getAllDescriptors(); }
DescriptorExtensionList<AbstractStorageProvider, AbstractStorageProvider.StorageProviderDescriptor> function() { return AbstractStorageProvider.getAllDescriptors(); }
/** * Get the list of all registered {@link AbstractStorageProvider}. */
Get the list of all registered <code>AbstractStorageProvider</code>
getAllProviders
{ "repo_name": "astroilov/google-persistent-master-plugin", "path": "src/main/java/com/google/jenkins/plugins/persistentmaster/PersistentMasterPlugin.java", "license": "apache-2.0", "size": 14540 }
[ "com.google.jenkins.plugins.persistentmaster.storage.AbstractStorageProvider" ]
import com.google.jenkins.plugins.persistentmaster.storage.AbstractStorageProvider;
import com.google.jenkins.plugins.persistentmaster.storage.*;
[ "com.google.jenkins" ]
com.google.jenkins;
1,600,257
public void setObjectIds(Iterable<? extends ObjectIdentifiable> exchangeIds) { if (exchangeIds == null) { _objectIds = null; } else { _objectIds = new ArrayList<ObjectId>(); for (ObjectIdentifiable exchangeId : exchangeIds) { _objectIds.add(exchangeId.getObjectId()); } } }
void function(Iterable<? extends ObjectIdentifiable> exchangeIds) { if (exchangeIds == null) { _objectIds = null; } else { _objectIds = new ArrayList<ObjectId>(); for (ObjectIdentifiable exchangeId : exchangeIds) { _objectIds.add(exchangeId.getObjectId()); } } }
/** * Sets the set of exchange object identifiers, null to not limit by exchange object identifiers. * Note that an empty set will return no exchanges. * * @param exchangeIds the new exchange identifiers, null clears the exchange id search */
Sets the set of exchange object identifiers, null to not limit by exchange object identifiers. Note that an empty set will return no exchanges
setObjectIds
{ "repo_name": "ChinaQuants/OG-Platform", "path": "projects/OG-Master/src/main/java/com/opengamma/master/exchange/ExchangeSearchRequest.java", "license": "apache-2.0", "size": 17411 }
[ "com.opengamma.id.ObjectId", "com.opengamma.id.ObjectIdentifiable", "java.util.ArrayList" ]
import com.opengamma.id.ObjectId; import com.opengamma.id.ObjectIdentifiable; import java.util.ArrayList;
import com.opengamma.id.*; import java.util.*;
[ "com.opengamma.id", "java.util" ]
com.opengamma.id; java.util;
1,387,201
public void startActivity(final Intent intent, final boolean fullStart) { final T activity = startActivity(intent, null, null, fullStart); assertSame(activity, test.getActivity()); assertTrue(activityClass.isInstance(activity)); }
void function(final Intent intent, final boolean fullStart) { final T activity = startActivity(intent, null, null, fullStart); assertSame(activity, test.getActivity()); assertTrue(activityClass.isInstance(activity)); }
/** * Starts the activity and asserts that it is really started. * * @param intent * the intent to use. * @param fullStart * if true then the full activity start-up is performed: * onCreate(), onStart(), onResume(). If false then only the * onCreate() method is invoked. */
Starts the activity and asserts that it is really started
startActivity
{ "repo_name": "dper/aedict", "path": "aedict-apk-test/src/sk/baka/aedict/AndroidTester.java", "license": "gpl-3.0", "size": 15760 }
[ "android.content.Intent", "junit.framework.Assert" ]
import android.content.Intent; import junit.framework.Assert;
import android.content.*; import junit.framework.*;
[ "android.content", "junit.framework" ]
android.content; junit.framework;
330,180
new PushButton(this, ADD_LOCAL_CATALOG).click(); Shell localCatalogShell = new DefaultShell(LOCAL_CATALOG_SHELL); new DefaultCombo(localCatalogShell).setText(catalogFile); new LabeledText(localCatalogShell, CATALOG_DESCRIPTION).setText(description); new OkButton(localCatalogShell).click(); new WaitWhile(new ShellIsAvailable(localCatalogShell)); return this; }
new PushButton(this, ADD_LOCAL_CATALOG).click(); Shell localCatalogShell = new DefaultShell(LOCAL_CATALOG_SHELL); new DefaultCombo(localCatalogShell).setText(catalogFile); new LabeledText(localCatalogShell, CATALOG_DESCRIPTION).setText(description); new OkButton(localCatalogShell).click(); new WaitWhile(new ShellIsAvailable(localCatalogShell)); return this; }
/** * Add new archetypes local catalog to Eclipse. * * @param catalogFile * path to the XML catalog file, e.g. archetype-catalog.xml * @param description * description of the local catalog */
Add new archetypes local catalog to Eclipse
addLocalCatalog
{ "repo_name": "djelinek/reddeer", "path": "plugins/org.eclipse.reddeer.eclipse/src/org/eclipse/reddeer/eclipse/m2e/core/ui/preferences/MavenArchetypesPreferencePage.java", "license": "epl-1.0", "size": 9888 }
[ "org.eclipse.reddeer.common.wait.WaitWhile", "org.eclipse.reddeer.swt.api.Shell", "org.eclipse.reddeer.swt.condition.ShellIsAvailable", "org.eclipse.reddeer.swt.impl.button.OkButton", "org.eclipse.reddeer.swt.impl.button.PushButton", "org.eclipse.reddeer.swt.impl.combo.DefaultCombo", "org.eclipse.reddeer.swt.impl.shell.DefaultShell", "org.eclipse.reddeer.swt.impl.text.LabeledText" ]
import org.eclipse.reddeer.common.wait.WaitWhile; import org.eclipse.reddeer.swt.api.Shell; import org.eclipse.reddeer.swt.condition.ShellIsAvailable; import org.eclipse.reddeer.swt.impl.button.OkButton; import org.eclipse.reddeer.swt.impl.button.PushButton; import org.eclipse.reddeer.swt.impl.combo.DefaultCombo; import org.eclipse.reddeer.swt.impl.shell.DefaultShell; import org.eclipse.reddeer.swt.impl.text.LabeledText;
import org.eclipse.reddeer.common.wait.*; import org.eclipse.reddeer.swt.api.*; import org.eclipse.reddeer.swt.condition.*; import org.eclipse.reddeer.swt.impl.button.*; import org.eclipse.reddeer.swt.impl.combo.*; import org.eclipse.reddeer.swt.impl.shell.*; import org.eclipse.reddeer.swt.impl.text.*;
[ "org.eclipse.reddeer" ]
org.eclipse.reddeer;
1,791,807
CRC32 crc = new CRC32(); crc.reset(); if (!testGzipMagic(in, crc)) { throw new NoGzipMagicException(); } this.length += 2; if (readByte(in, crc) != Deflater.DEFLATED) { throw new IOException("Unknown compression"); } this.length++; // Get gzip header flag. this.flg = readByte(in, crc); this.length++; // Get MTIME. this.mtime = readInt(in, crc); this.length += 4; // Read XFL and OS. this.xfl = readByte(in, crc); this.length++; this.os = readByte(in, crc); this.length++; // Skip optional extra field -- stuff w/ alexa stuff in it. final int FLG_FEXTRA = 4; if ((this.flg & FLG_FEXTRA) == FLG_FEXTRA) { int count = readShort(in, crc); this.length +=2; this.fextra = new byte[count]; readByte(in, crc, this.fextra, 0, count); this.length += count; } // Skip file name. It ends in null. final int FLG_FNAME = 8; if ((this.flg & FLG_FNAME) == FLG_FNAME) { while (readByte(in, crc) != 0) { this.length++; } } // Skip file comment. It ends in null. final int FLG_FCOMMENT = 16; // File comment if ((this.flg & FLG_FCOMMENT) == FLG_FCOMMENT) { while (readByte(in, crc) != 0) { this.length++; } } // Check optional CRC. final int FLG_FHCRC = 2; if ((this.flg & FLG_FHCRC) == FLG_FHCRC) { int calcCrc = (int)(crc.getValue() & 0xffff); if (readShort(in, crc) != calcCrc) { throw new IOException("Bad header CRC"); } this.length += 2; } }
CRC32 crc = new CRC32(); crc.reset(); if (!testGzipMagic(in, crc)) { throw new NoGzipMagicException(); } this.length += 2; if (readByte(in, crc) != Deflater.DEFLATED) { throw new IOException(STR); } this.length++; this.flg = readByte(in, crc); this.length++; this.mtime = readInt(in, crc); this.length += 4; this.xfl = readByte(in, crc); this.length++; this.os = readByte(in, crc); this.length++; final int FLG_FEXTRA = 4; if ((this.flg & FLG_FEXTRA) == FLG_FEXTRA) { int count = readShort(in, crc); this.length +=2; this.fextra = new byte[count]; readByte(in, crc, this.fextra, 0, count); this.length += count; } final int FLG_FNAME = 8; if ((this.flg & FLG_FNAME) == FLG_FNAME) { while (readByte(in, crc) != 0) { this.length++; } } final int FLG_FCOMMENT = 16; if ((this.flg & FLG_FCOMMENT) == FLG_FCOMMENT) { while (readByte(in, crc) != 0) { this.length++; } } final int FLG_FHCRC = 2; if ((this.flg & FLG_FHCRC) == FLG_FHCRC) { int calcCrc = (int)(crc.getValue() & 0xffff); if (readShort(in, crc) != calcCrc) { throw new IOException(STR); } this.length += 2; } }
/** * Read in gzip header. * * Advances the stream past the gzip header. * @param in InputStream. * * @throws IOException Throws if does not start with GZIP Header. */
Read in gzip header. Advances the stream past the gzip header
readHeader
{ "repo_name": "ukwa/webarchive-commons", "path": "src/main/java/org/archive/util/zip/GzipHeader.java", "license": "apache-2.0", "size": 8993 }
[ "java.io.IOException", "java.util.zip.Deflater" ]
import java.io.IOException; import java.util.zip.Deflater;
import java.io.*; import java.util.zip.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,007,305
public void get(String remoteFile, String localTargetDirectory) throws IOException { get(new String[] { remoteFile }, localTargetDirectory); }
void function(String remoteFile, String localTargetDirectory) throws IOException { get(new String[] { remoteFile }, localTargetDirectory); }
/** * Download a file from the remote server to a local directory. * * @param remoteFile * Path and name of the remote file. * @param localTargetDirectory * Local directory to put the downloaded file. * * @throws IOException */
Download a file from the remote server to a local directory
get
{ "repo_name": "0xD34D/connectbot", "path": "src/com/trilead/ssh2/SCPClient.java", "license": "apache-2.0", "size": 19045 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
785,522
private static void fillAssemblyRegionsWithReads(final List<AssemblyRegion> assemblyRegions, final PeekableIterator<GaeaSamRecord> reads) { AssemblyRegion previousRegion = null; for (final AssemblyRegion region : assemblyRegions) { // Before examining new reads, check the previous region to see if // any of its reads overlap the current region if (previousRegion != null) { for (final GaeaSamRecord previousRegionRead : previousRegion.getReads()) { if (region.getExtendedSpan().overlaps(previousRegionRead)) { region.add(previousRegionRead); } } } // Then pull new reads from our iterator and add them to the current // region until we advance past the // extended span of the current region while (reads.hasNext()) { final GaeaSamRecord read = reads.peek(); if (region.getExtendedSpan().overlaps(read)) { region.add(reads.next()); } else { break; } } previousRegion = region; } }
static void function(final List<AssemblyRegion> assemblyRegions, final PeekableIterator<GaeaSamRecord> reads) { AssemblyRegion previousRegion = null; for (final AssemblyRegion region : assemblyRegions) { if (previousRegion != null) { for (final GaeaSamRecord previousRegionRead : previousRegion.getReads()) { if (region.getExtendedSpan().overlaps(previousRegionRead)) { region.add(previousRegionRead); } } } while (reads.hasNext()) { final GaeaSamRecord read = reads.peek(); if (region.getExtendedSpan().overlaps(read)) { region.add(reads.next()); } else { break; } } previousRegion = region; } }
/** * Helper method for {@link #createFromReadShard} that fills the given * AssemblyRegions with overlapping reads from the provided iterator. The * AssemblyRegions and the reads must both be sorted in order of ascending * location. * * @param assemblyRegions * List of AssemblyRegions to fill with reads. Must be sorted in * order of ascending location. * @param reads * Peekable iterator over reads. Must be sorted in order of * ascending location. */
Helper method for <code>#createFromReadShard</code> that fills the given AssemblyRegions with overlapping reads from the provided iterator. The AssemblyRegions and the reads must both be sorted in order of ascending location
fillAssemblyRegionsWithReads
{ "repo_name": "BGI-flexlab/SOAPgaeaDevelopment4.0", "path": "src/main/java/org/bgi/flexlab/gaea/tools/haplotypecaller/assembly/AssemblyRegion.java", "license": "gpl-3.0", "size": 29521 }
[ "java.util.List", "org.bgi.flexlab.gaea.data.structure.bam.GaeaSamRecord" ]
import java.util.List; import org.bgi.flexlab.gaea.data.structure.bam.GaeaSamRecord;
import java.util.*; import org.bgi.flexlab.gaea.data.structure.bam.*;
[ "java.util", "org.bgi.flexlab" ]
java.util; org.bgi.flexlab;
2,607,397
public synchronized void setShouldStopAtCheckpoint( boolean shouldStopAtCheckpoint, ActionListener<Void> shouldStopAtCheckpointListener ) { logger.debug( "[{}] attempted to set task to stop at checkpoint [{}] with state [{}]", getTransformId(), shouldStopAtCheckpoint, getState() ); if (context.getTaskState() != TransformTaskState.STARTED || getIndexer() == null) { shouldStopAtCheckpointListener.onResponse(null); return; } // move the call to the generic thread pool, so we do not block the network thread getThreadPool().executor(ThreadPool.Names.GENERIC) .execute(() -> { getIndexer().setStopAtCheckpoint(shouldStopAtCheckpoint, shouldStopAtCheckpointListener); }); }
synchronized void function( boolean shouldStopAtCheckpoint, ActionListener<Void> shouldStopAtCheckpointListener ) { logger.debug( STR, getTransformId(), shouldStopAtCheckpoint, getState() ); if (context.getTaskState() != TransformTaskState.STARTED getIndexer() == null) { shouldStopAtCheckpointListener.onResponse(null); return; } getThreadPool().executor(ThreadPool.Names.GENERIC) .execute(() -> { getIndexer().setStopAtCheckpoint(shouldStopAtCheckpoint, shouldStopAtCheckpointListener); }); }
/** * This sets the flag for the task to stop at the next checkpoint. * * @param shouldStopAtCheckpoint whether or not we should stop at the next checkpoint or not * @param shouldStopAtCheckpointListener the listener to return to when we have persisted the updated value to the state index. */
This sets the flag for the task to stop at the next checkpoint
setShouldStopAtCheckpoint
{ "repo_name": "nknize/elasticsearch", "path": "x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/transforms/TransformTask.java", "license": "apache-2.0", "size": 24515 }
[ "org.elasticsearch.action.ActionListener", "org.elasticsearch.threadpool.ThreadPool", "org.elasticsearch.xpack.core.transform.transforms.TransformTaskState" ]
import org.elasticsearch.action.ActionListener; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.xpack.core.transform.transforms.TransformTaskState;
import org.elasticsearch.action.*; import org.elasticsearch.threadpool.*; import org.elasticsearch.xpack.core.transform.transforms.*;
[ "org.elasticsearch.action", "org.elasticsearch.threadpool", "org.elasticsearch.xpack" ]
org.elasticsearch.action; org.elasticsearch.threadpool; org.elasticsearch.xpack;
1,231,293
@ApiModelProperty(example = "/Date(1583967733054+0000)/", value = "Last modified timestamp") public String getUpdatedDateUTC() { return updatedDateUTC; }
@ApiModelProperty(example = STR, value = STR) String function() { return updatedDateUTC; }
/** * Last modified timestamp * * @return updatedDateUTC */
Last modified timestamp
getUpdatedDateUTC
{ "repo_name": "XeroAPI/Xero-Java", "path": "src/main/java/com/xero/models/payrollau/Payslip.java", "license": "mit", "size": 22670 }
[ "io.swagger.annotations.ApiModelProperty" ]
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.*;
[ "io.swagger.annotations" ]
io.swagger.annotations;
1,485,260
public void xtestTransactionRollbackOnSessionClose() throws Exception { Destination destination = createDestination(getClass().getName()); Connection connection = createConnection(); connection.setClientID(idGen.generateId()); connection.start(); Session consumerSession = connection.createSession(true, Session.CLIENT_ACKNOWLEDGE); MessageConsumer consumer = null; if (topic) { consumer = consumerSession.createDurableSubscriber((Topic) destination, "TESTRED"); } else { consumer = consumerSession.createConsumer(destination); } Session producerSession = connection.createSession(true, Session.AUTO_ACKNOWLEDGE); MessageProducer producer = producerSession.createProducer(destination); producer.setDeliveryMode(deliveryMode); TextMessage sentMsg = producerSession.createTextMessage(); sentMsg.setText("msg1"); producer.send(sentMsg); producerSession.commit(); Message recMsg = consumer.receive(RECEIVE_TIMEOUT); assertFalse(recMsg.getJMSRedelivered()); consumerSession.close(); consumerSession = connection.createSession(true, Session.CLIENT_ACKNOWLEDGE); consumer = consumerSession.createConsumer(destination); recMsg = consumer.receive(RECEIVE_TIMEOUT); consumerSession.commit(); assertTrue(recMsg.equals(sentMsg)); connection.close(); }
void function() throws Exception { Destination destination = createDestination(getClass().getName()); Connection connection = createConnection(); connection.setClientID(idGen.generateId()); connection.start(); Session consumerSession = connection.createSession(true, Session.CLIENT_ACKNOWLEDGE); MessageConsumer consumer = null; if (topic) { consumer = consumerSession.createDurableSubscriber((Topic) destination, STR); } else { consumer = consumerSession.createConsumer(destination); } Session producerSession = connection.createSession(true, Session.AUTO_ACKNOWLEDGE); MessageProducer producer = producerSession.createProducer(destination); producer.setDeliveryMode(deliveryMode); TextMessage sentMsg = producerSession.createTextMessage(); sentMsg.setText("msg1"); producer.send(sentMsg); producerSession.commit(); Message recMsg = consumer.receive(RECEIVE_TIMEOUT); assertFalse(recMsg.getJMSRedelivered()); consumerSession.close(); consumerSession = connection.createSession(true, Session.CLIENT_ACKNOWLEDGE); consumer = consumerSession.createConsumer(destination); recMsg = consumer.receive(RECEIVE_TIMEOUT); consumerSession.commit(); assertTrue(recMsg.equals(sentMsg)); connection.close(); }
/** * Check a session is rollbacked on a Session close(); * * @throws Exception */
Check a session is rollbacked on a Session close()
xtestTransactionRollbackOnSessionClose
{ "repo_name": "l-dobrev/activemq-artemis", "path": "tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/TopicRedeliverTest.java", "license": "apache-2.0", "size": 10114 }
[ "javax.jms.Connection", "javax.jms.Destination", "javax.jms.Message", "javax.jms.MessageConsumer", "javax.jms.MessageProducer", "javax.jms.Session", "javax.jms.TextMessage", "javax.jms.Topic" ]
import javax.jms.Connection; import javax.jms.Destination; import javax.jms.Message; import javax.jms.MessageConsumer; import javax.jms.MessageProducer; import javax.jms.Session; import javax.jms.TextMessage; import javax.jms.Topic;
import javax.jms.*;
[ "javax.jms" ]
javax.jms;
1,271,669
@Around("execution(* org.apache.wicket.Component.onInitialize(..))") public Object aroundOnInitialize(ProceedingJoinPoint joinPoint) throws Throwable { return measureTime("core/component/initialize", joinPoint); }
@Around(STR) Object function(ProceedingJoinPoint joinPoint) throws Throwable { return measureTime(STR, joinPoint); }
/** * Collects data how often components calls onInitialize * * @param joinPoint * the join point (component) which is initialized * @return the object returned from the join point * * @throws Throwable * might occur while invoking onInitialize */
Collects data how often components calls onInitialize
aroundOnInitialize
{ "repo_name": "selckin/wicket", "path": "wicket-experimental/wicket-metrics/src/main/java/org/apache/wicket/metrics/aspects/component/ComponentOnInitializeAspect.java", "license": "apache-2.0", "size": 1733 }
[ "org.aspectj.lang.ProceedingJoinPoint", "org.aspectj.lang.annotation.Around" ]
import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.*; import org.aspectj.lang.annotation.*;
[ "org.aspectj.lang" ]
org.aspectj.lang;
2,382,487
List<Segment> segmentsToSearch(Segments segments, long from, long to); }
List<Segment> segmentsToSearch(Segments segments, long from, long to); }
/** * Used during {@link SegmentedBytesStore#fetch(Bytes, long, long)} operations to determine * which segments should be scanned. * @param segments * @param from * @param to * @return List of segments to search */
Used during <code>SegmentedBytesStore#fetch(Bytes, long, long)</code> operations to determine which segments should be scanned
segmentsToSearch
{ "repo_name": "rhauch/kafka", "path": "streams/src/main/java/org/apache/kafka/streams/state/internals/SegmentedBytesStore.java", "license": "apache-2.0", "size": 4799 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
108,981
@NonNull public Builder addTargets(Collection<TimingTarget> targets) { if (targets != null) for (TimingTarget target : targets) addTarget(target); return this; }
Builder function(Collection<TimingTarget> targets) { if (targets != null) for (TimingTarget target : targets) addTarget(target); return this; }
/** * Adds the collection of passed {@link TimingTarget}s to the list of * targets that get notified of each timing event while the animation is * running. * <p> * {@link TimingTarget}s will be called in the order they are added. * Duplicate additions are ignored. * * @param targets * a collection of {@link TimingTarget} objects. * @return this builder (to allow chained operations). */
Adds the collection of passed <code>TimingTarget</code>s to the list of targets that get notified of each timing event while the animation is running. <code>TimingTarget</code>s will be called in the order they are added. Duplicate additions are ignored
addTargets
{ "repo_name": "knappast/Q10_ruler", "path": "obsolete/org/jdesktop/core/animation/timing/Animator.java", "license": "apache-2.0", "size": 65614 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
1,636,751
private SelectOneData getSelectOne (Object o) { return new SelectOneData(makeSelection(o)); }
SelectOneData function (Object o) { return new SelectOneData(makeSelection(o)); }
/** * create a SelectOneData from an integer (index mode) or string (value mode) */
create a SelectOneData from an integer (index mode) or string (value mode)
getSelectOne
{ "repo_name": "Jonathan727/javarosa", "path": "core/src/main/java/org/javarosa/core/model/instance/utils/CompactInstanceWrapper.java", "license": "apache-2.0", "size": 17566 }
[ "org.javarosa.core.model.data.SelectOneData" ]
import org.javarosa.core.model.data.SelectOneData;
import org.javarosa.core.model.data.*;
[ "org.javarosa.core" ]
org.javarosa.core;
2,901,073
@Test public void testEqualsObject () { assertFalse(pair.equals(null)); assertFalse(pair.equals(new Object())); assertFalse(emptyPair.equals(pair)); final MutablePair<String, Integer> otherPair = new MutablePair<>("aba", 28); otherPair.setLeft("man"); assertNotEquals(otherPair, pair); otherPair.setLeft("aba"); assertEquals(pair, otherPair); otherPair.setRight(4); assertNotEquals(otherPair, pair); }
void function () { assertFalse(pair.equals(null)); assertFalse(pair.equals(new Object())); assertFalse(emptyPair.equals(pair)); final MutablePair<String, Integer> otherPair = new MutablePair<>("aba", 28); otherPair.setLeft("man"); assertNotEquals(otherPair, pair); otherPair.setLeft("aba"); assertEquals(pair, otherPair); otherPair.setRight(4); assertNotEquals(otherPair, pair); }
/** * Test method for {@link Pair#equals(Object)}. */
Test method for <code>Pair#equals(Object)</code>
testEqualsObject
{ "repo_name": "AlexRNL/Commons", "path": "src/test/java/com/alexrnl/commons/utils/object/MutablePairTest.java", "license": "bsd-3-clause", "size": 3685 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
956,711
@InterfaceAudience.Private public static Cell createCell(final byte[] row, final byte[] family, final byte[] qualifier, final long timestamp, final byte type, final byte[] value, final long memstoreTS) { KeyValue keyValue = new KeyValue(row, family, qualifier, timestamp, KeyValue.Type.codeToType(type), value); keyValue.setSequenceId(memstoreTS); return keyValue; }
@InterfaceAudience.Private static Cell function(final byte[] row, final byte[] family, final byte[] qualifier, final long timestamp, final byte type, final byte[] value, final long memstoreTS) { KeyValue keyValue = new KeyValue(row, family, qualifier, timestamp, KeyValue.Type.codeToType(type), value); keyValue.setSequenceId(memstoreTS); return keyValue; }
/** * Marked as audience Private as of 1.2.0. * Creating a Cell with a memstoreTS/mvcc is an internal implementation detail not for * public use. */
Marked as audience Private as of 1.2.0. Creating a Cell with a memstoreTS/mvcc is an internal implementation detail not for public use
createCell
{ "repo_name": "lshmouse/hbase", "path": "hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java", "license": "apache-2.0", "size": 54459 }
[ "org.apache.hadoop.hbase.KeyValue", "org.apache.hadoop.hbase.classification.InterfaceAudience" ]
import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.classification.InterfaceAudience;
import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.classification.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,212,123
public static Object[] convertBasicDBListToObjectArray(final BasicDBList basicDbList) { final List<Object> list = new ArrayList<>(); final Object[] array = basicDbList.toArray(); for (final Object child : array) { if (child instanceof BasicDBList) { list.add(convertBasicDBListToObjectArray((BasicDBList)child)); } else { list.add(child); } } return list.toArray(new Object[0]); }
static Object[] function(final BasicDBList basicDbList) { final List<Object> list = new ArrayList<>(); final Object[] array = basicDbList.toArray(); for (final Object child : array) { if (child instanceof BasicDBList) { list.add(convertBasicDBListToObjectArray((BasicDBList)child)); } else { list.add(child); } } return list.toArray(new Object[0]); }
/** * Converts a {@link BasicDBList} into an array of {@link Object}s. * @param basicDbList the {@link BasicDBList} to convert. * @return the array of {@link Object}s. */
Converts a <code>BasicDBList</code> into an array of <code>Object</code>s
convertBasicDBListToObjectArray
{ "repo_name": "meiercaleb/incubator-rya", "path": "dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/document/util/DocumentVisibilityUtil.java", "license": "apache-2.0", "size": 13744 }
[ "com.mongodb.BasicDBList", "java.util.ArrayList", "java.util.List" ]
import com.mongodb.BasicDBList; import java.util.ArrayList; import java.util.List;
import com.mongodb.*; import java.util.*;
[ "com.mongodb", "java.util" ]
com.mongodb; java.util;
991,205
requiredTranslations = Sets.newTreeSet(Splitter.on(',') .trimResults().omitEmptyStrings().split(translationCodes)); }
requiredTranslations = Sets.newTreeSet(Splitter.on(',') .trimResults().omitEmptyStrings().split(translationCodes)); }
/** * Sets language codes of required translations for the check. * @param translationCodes a comma separated list of language codes. */
Sets language codes of required translations for the check
setRequiredTranslations
{ "repo_name": "gallandarakhneorg/checkstyle", "path": "src/main/java/com/puppycrawl/tools/checkstyle/checks/TranslationCheck.java", "license": "lgpl-2.1", "size": 18234 }
[ "com.google.common.base.Splitter", "com.google.common.collect.Sets" ]
import com.google.common.base.Splitter; import com.google.common.collect.Sets;
import com.google.common.base.*; import com.google.common.collect.*;
[ "com.google.common" ]
com.google.common;
2,395,559
public ShardIterator onlyNodeSelectorActiveInitializingShardsIt(String[] nodeAttributes, DiscoveryNodes discoveryNodes) { ArrayList<ShardRouting> ordered = new ArrayList<>(activeShards.size() + allInitializingShards.size()); Set<String> selectedNodes = Sets.newHashSet(discoveryNodes.resolveNodesIds(nodeAttributes)); int seed = shuffler.nextSeed(); for (ShardRouting shardRouting : shuffler.shuffle(activeShards, seed)) { if (selectedNodes.contains(shardRouting.currentNodeId())) { ordered.add(shardRouting); } } for (ShardRouting shardRouting : shuffler.shuffle(allInitializingShards, seed)) { if (selectedNodes.contains(shardRouting.currentNodeId())) { ordered.add(shardRouting); } } if (ordered.isEmpty()) { throw new IllegalArgumentException("no data nodes with critera(s) " + Strings.arrayToCommaDelimitedString(nodeAttributes) + "] found for shard:" + shardId()); } return new PlainShardIterator(shardId, ordered); }
ShardIterator function(String[] nodeAttributes, DiscoveryNodes discoveryNodes) { ArrayList<ShardRouting> ordered = new ArrayList<>(activeShards.size() + allInitializingShards.size()); Set<String> selectedNodes = Sets.newHashSet(discoveryNodes.resolveNodesIds(nodeAttributes)); int seed = shuffler.nextSeed(); for (ShardRouting shardRouting : shuffler.shuffle(activeShards, seed)) { if (selectedNodes.contains(shardRouting.currentNodeId())) { ordered.add(shardRouting); } } for (ShardRouting shardRouting : shuffler.shuffle(allInitializingShards, seed)) { if (selectedNodes.contains(shardRouting.currentNodeId())) { ordered.add(shardRouting); } } if (ordered.isEmpty()) { throw new IllegalArgumentException(STR + Strings.arrayToCommaDelimitedString(nodeAttributes) + STR + shardId()); } return new PlainShardIterator(shardId, ordered); }
/** * Returns shards based on nodeAttributes given such as node name , node attribute, node IP * Supports node specifications in cluster API */
Returns shards based on nodeAttributes given such as node name , node attribute, node IP Supports node specifications in cluster API
onlyNodeSelectorActiveInitializingShardsIt
{ "repo_name": "strapdata/elassandra-test", "path": "core/src/main/java/org/elasticsearch/cluster/routing/IndexShardRoutingTable.java", "license": "apache-2.0", "size": 25832 }
[ "com.google.common.collect.Sets", "java.util.ArrayList", "java.util.Set", "org.elasticsearch.cluster.node.DiscoveryNodes", "org.elasticsearch.common.Strings" ]
import com.google.common.collect.Sets; import java.util.ArrayList; import java.util.Set; import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.common.Strings;
import com.google.common.collect.*; import java.util.*; import org.elasticsearch.cluster.node.*; import org.elasticsearch.common.*;
[ "com.google.common", "java.util", "org.elasticsearch.cluster", "org.elasticsearch.common" ]
com.google.common; java.util; org.elasticsearch.cluster; org.elasticsearch.common;
1,445,759
public void printSheet() { JReportGrid reportGrid = getFocusedGrid(); if (reportGrid != null) { try { reportGrid.print(); } catch (PrinterException e1) { Utils.showError(e1); } } }
void function() { JReportGrid reportGrid = getFocusedGrid(); if (reportGrid != null) { try { reportGrid.print(); } catch (PrinterException e1) { Utils.showError(e1); } } }
/** * Printing of the selected sheet */
Printing of the selected sheet
printSheet
{ "repo_name": "andreikh/jdbreport", "path": "jdbreport-rt/src/main/java/jdbreport/view/ReportPane.java", "license": "apache-2.0", "size": 44164 }
[ "java.awt.print.PrinterException" ]
import java.awt.print.PrinterException;
import java.awt.print.*;
[ "java.awt" ]
java.awt;
2,879,723
@Test public final void testTypeMatching() { Sentence s1 = ConversationParser.parse("no"); // "0/NUM" is the normalized form of "no" because of the 0/no ambiguity. Sentence m1 = ConversationParser.parseAsMatcher("|TYPE|0/NUM"); assertFalse(s1.hasError()); assertFalse(m1.hasError()); assertEquals("0/NUM", s1.toString()); assertEquals("|TYPE|0/NUM", m1.toString()); assertTrue(s1.matchesFull(m1)); s1 = ConversationParser.parse("No"); m1 = ConversationParser.parseAsMatcher("|TYPE|0/NUM"); assertFalse(s1.hasError()); assertFalse(m1.hasError()); assertEquals("0/NUM", s1.toString()); assertEquals("|TYPE|0/NUM", m1.toString()); assertTrue(s1.matchesFull(m1)); }
final void function() { Sentence s1 = ConversationParser.parse("no"); Sentence m1 = ConversationParser.parseAsMatcher(STR); assertFalse(s1.hasError()); assertFalse(m1.hasError()); assertEquals("0/NUM", s1.toString()); assertEquals(STR, m1.toString()); assertTrue(s1.matchesFull(m1)); s1 = ConversationParser.parse("No"); m1 = ConversationParser.parseAsMatcher(STR); assertFalse(s1.hasError()); assertFalse(m1.hasError()); assertEquals("0/NUM", s1.toString()); assertEquals(STR, m1.toString()); assertTrue(s1.matchesFull(m1)); }
/** * Tests for typeMatching. */
Tests for typeMatching
testTypeMatching
{ "repo_name": "acsid/stendhal", "path": "tests/games/stendhal/common/parser/SentenceTest.java", "license": "gpl-2.0", "size": 13591 }
[ "games.stendhal.common.parser.ConversationParser", "games.stendhal.common.parser.Sentence", "org.junit.Assert" ]
import games.stendhal.common.parser.ConversationParser; import games.stendhal.common.parser.Sentence; import org.junit.Assert;
import games.stendhal.common.parser.*; import org.junit.*;
[ "games.stendhal.common", "org.junit" ]
games.stendhal.common; org.junit;
160,539
Optional<Icon> getSplash();
Optional<Icon> getSplash();
/** * Gets the splash of the server. * * @return The splash of the server. */
Gets the splash of the server
getSplash
{ "repo_name": "BtoBastian/Javacord", "path": "javacord-api/src/main/java/org/javacord/api/entity/server/Server.java", "license": "lgpl-3.0", "size": 103692 }
[ "java.util.Optional", "org.javacord.api.entity.Icon" ]
import java.util.Optional; import org.javacord.api.entity.Icon;
import java.util.*; import org.javacord.api.entity.*;
[ "java.util", "org.javacord.api" ]
java.util; org.javacord.api;
1,044,587
public void schedulePeriodicStats() { timer = new Timer(); TimerTask statsPrinting = new TimerTask() { @Override public void run() { printStatistics(); }
void function() { timer = new Timer(); TimerTask statsPrinting = new TimerTask() { public void run() { printStatistics(); }
/** * Create a Timer task to display performance data on the Vote procedure * It calls printStatistics() every displayInterval seconds */
Create a Timer task to display performance data on the Vote procedure It calls printStatistics() every displayInterval seconds
schedulePeriodicStats
{ "repo_name": "migue/voltdb", "path": "tests/test_apps/voter-selfcheck/src/voter/AsyncBenchmark.java", "license": "agpl-3.0", "size": 17919 }
[ "java.util.Timer", "java.util.TimerTask" ]
import java.util.Timer; import java.util.TimerTask;
import java.util.*;
[ "java.util" ]
java.util;
316,470