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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
private void createDestinationGroup(Composite mainComposite)
{
// create destination group
Group destinationGroup = new Group(mainComposite, SWT.SHADOW_ETCHED_OUT);
GridLayout layout = new GridLayout(3, false);
destinationGroup.setLayout(layout);
GridData defaultDestGrid... | void function(Composite mainComposite) { Group destinationGroup = new Group(mainComposite, SWT.SHADOW_ETCHED_OUT); GridLayout layout = new GridLayout(3, false); destinationGroup.setLayout(layout); GridData defaultDestGridData = new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1); destinationGroup.setLayoutData(defaul... | /**
* Create the destination selection group
*
* @param mainComposite
* : the parent composite
*/ | Create the destination selection group | createDestinationGroup | {
"repo_name": "rex-xxx/mt6572_x201",
"path": "tools/motodev/src/plugins/packaging.ui/src/com/motorola/studio/android/packaging/ui/export/PackageExportWizardArea.java",
"license": "gpl-2.0",
"size": 67009
} | [
"com.motorola.studio.android.packaging.ui.i18n.Messages",
"org.eclipse.swt.layout.GridData",
"org.eclipse.swt.layout.GridLayout",
"org.eclipse.swt.widgets.Button",
"org.eclipse.swt.widgets.Composite",
"org.eclipse.swt.widgets.Group",
"org.eclipse.swt.widgets.Label",
"org.eclipse.swt.widgets.Text"
] | import com.motorola.studio.android.packaging.ui.i18n.Messages; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Label; import org.eclipse... | import com.motorola.studio.android.packaging.ui.i18n.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; | [
"com.motorola.studio",
"org.eclipse.swt"
] | com.motorola.studio; org.eclipse.swt; | 2,571,846 |
public MethodWrapper[] getMethodWrappers()
{
Method[] methods = cl.getMethods();
MethodWrapper[] result = new MethodWrapper[methods.length];
for (int i = 0; i < methods.length; ++i) {
result[i] = new MethodWrapper(methods[i]);
}
return result;
}
| MethodWrapper[] function() { Method[] methods = cl.getMethods(); MethodWrapper[] result = new MethodWrapper[methods.length]; for (int i = 0; i < methods.length; ++i) { result[i] = new MethodWrapper(methods[i]); } return result; } | /**
* Returns an array of MethodWrapper objects, which contain a wrapper for each public method of
* the wrapped type.
*
* @return An array of MethodWrapper objects, which contain a wrapper for each public method of
* the wrapped type.
*/ | Returns an array of MethodWrapper objects, which contain a wrapper for each public method of the wrapped type | getMethodWrappers | {
"repo_name": "THeinemann/jnitor",
"path": "src/main/java/com/github/theinemann/jnitor/wrappers/TypeWrapper.java",
"license": "apache-2.0",
"size": 8281
} | [
"java.lang.reflect.Method"
] | import java.lang.reflect.Method; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 1,639,049 |
FileInfo addLogFile(final String server, final String logfile) throws IOException {
WALLink logLink = new WALLink(conf, server, logfile);
long size = -1;
try {
size = logLink.getFileStatus(fs).getLen();
logSize.addAndGet(size);
logsCount.incrementAndGet();
} catch (Fi... | FileInfo addLogFile(final String server, final String logfile) throws IOException { WALLink logLink = new WALLink(conf, server, logfile); long size = -1; try { size = logLink.getFileStatus(fs).getLen(); logSize.addAndGet(size); logsCount.incrementAndGet(); } catch (FileNotFoundException e) { logsMissing.incrementAndGet... | /**
* Add the specified log file to the stats
* @param server server name
* @param logfile log file name
* @return the log information
*/ | Add the specified log file to the stats | addLogFile | {
"repo_name": "ZhangXFeng/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotInfo.java",
"license": "apache-2.0",
"size": 20191
} | [
"java.io.FileNotFoundException",
"java.io.IOException",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.hbase.io.WALLink"
] | import java.io.FileNotFoundException; import java.io.IOException; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.io.WALLink; | import java.io.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hbase.io.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 474,855 |
public void handleMotionEvent(MotionEvent motionEvent) {
mJoystickPositions[JOYSTICK_1][AXIS_X] = motionEvent.getAxisValue(MotionEvent.AXIS_X);
mJoystickPositions[JOYSTICK_1][AXIS_Y] = motionEvent.getAxisValue(MotionEvent.AXIS_Y);
// The X and Y axes of the second joystick on a controller a... | void function(MotionEvent motionEvent) { mJoystickPositions[JOYSTICK_1][AXIS_X] = motionEvent.getAxisValue(MotionEvent.AXIS_X); mJoystickPositions[JOYSTICK_1][AXIS_Y] = motionEvent.getAxisValue(MotionEvent.AXIS_Y); mJoystickPositions[JOYSTICK_2][AXIS_X] = motionEvent.getAxisValue(MotionEvent.AXIS_Z); mJoystickPositions... | /**
* Updates the tracked state values of this controller in response to a motion input event.
*/ | Updates the tracked state values of this controller in response to a motion input event | handleMotionEvent | {
"repo_name": "guadabernal/Avalanche",
"path": "software/MyApplication/app/src/main/java/com/example/bernal/myapplication/GamepadController.java",
"license": "mit",
"size": 5522
} | [
"android.view.MotionEvent"
] | import android.view.MotionEvent; | import android.view.*; | [
"android.view"
] | android.view; | 2,520,720 |
public void toggleWhenActive(final Command command) {
new ButtonScheduler() {
private boolean m_pressedLast = grab(); | void function(final Command command) { new ButtonScheduler() { private boolean m_pressedLast = grab(); | /**
* Toggles a command when the trigger becomes active.
*
* @param command the command to toggle
*/ | Toggles a command when the trigger becomes active | toggleWhenActive | {
"repo_name": "333fred/allwpilib",
"path": "wpilibj/src/shared/java/edu/wpi/first/wpilibj/buttons/Trigger.java",
"license": "bsd-3-clause",
"size": 5571
} | [
"edu.wpi.first.wpilibj.command.Command"
] | import edu.wpi.first.wpilibj.command.Command; | import edu.wpi.first.wpilibj.command.*; | [
"edu.wpi.first"
] | edu.wpi.first; | 58,950 |
public Text getTextProxy() {
return this.textProxy;
} | Text function() { return this.textProxy; } | /**
*
* return a proxy for the main text. Use the standard set methods on this
* object such as .setFontSize(1) etc. and it will set the property for all
* texts.
*/ | return a proxy for the main text. Use the standard set methods on this object such as .setFontSize(1) etc. and it will set the property for all texts | getTextProxy | {
"repo_name": "idega/platform2",
"path": "src/com/idega/block/news/presentation/NewsReader.java",
"license": "gpl-3.0",
"size": 47785
} | [
"com.idega.presentation.text.Text"
] | import com.idega.presentation.text.Text; | import com.idega.presentation.text.*; | [
"com.idega.presentation"
] | com.idega.presentation; | 1,585,397 |
// XXX: (Jon Skeet) Any reason for writing a message and then using a bare
// RuntimeException rather than just using a BuildException here? Is it
// in case the message could end up being written to no loggers (as the
// loggers could have failed to be created due to this failure)?
private BuildLo... | BuildLogger function() { BuildLogger logger = null; if (loggerClassname != null) { try { Class loggerClass = Class.forName(loggerClassname); logger = (BuildLogger) (loggerClass.newInstance()); } catch (ClassCastException e) { System.err.println(STR + loggerClassname + STR); throw new RuntimeException(); } catch (Except... | /**
* Creates the default build logger for sending build events to the ant
* log.
*
* @return the logger instance for this build.
*/ | Creates the default build logger for sending build events to the ant log | createLogger | {
"repo_name": "neoautus/lucidj",
"path": "extras/AntInstaller/AntInstaller-beta0.8/src/org/tp23/antinstaller/antmod/Main.java",
"license": "apache-2.0",
"size": 41286
} | [
"org.apache.tools.ant.BuildLogger",
"org.apache.tools.ant.DefaultLogger"
] | import org.apache.tools.ant.BuildLogger; import org.apache.tools.ant.DefaultLogger; | import org.apache.tools.ant.*; | [
"org.apache.tools"
] | org.apache.tools; | 464,053 |
private void populateMap(Object bean) {
Class<?> klass = bean.getClass();
// If klass is a System class then set includeSuperClass to false.
boolean includeSuperClass = klass.getClassLoader() != null;
Method[] methods = includeSuperClass ? klass.getMethods() : klass.getDeclaredMet... | void function(Object bean) { Class<?> klass = bean.getClass(); boolean includeSuperClass = klass.getClassLoader() != null; Method[] methods = includeSuperClass ? klass.getMethods() : klass.getDeclaredMethods(); for (final Method method : methods) { final int modifiers = method.getModifiers(); if (Modifier.isPublic(modi... | /**
* Populates the internal map of the JSONObject with the bean properties. The
* bean can not be recursive.
*
* @see JSONObject#JSONObject(Object)
*
* @param bean
* the bean
*/ | Populates the internal map of the JSONObject with the bean properties. The bean can not be recursive | populateMap | {
"repo_name": "xushaomin/appleframework",
"path": "apple-commons/src/main/java/com/appleframework/tools/json/JSONObject.java",
"license": "apache-2.0",
"size": 93667
} | [
"java.io.Closeable",
"java.io.IOException",
"java.lang.reflect.InvocationTargetException",
"java.lang.reflect.Method",
"java.lang.reflect.Modifier"
] | import java.io.Closeable; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; | import java.io.*; import java.lang.reflect.*; | [
"java.io",
"java.lang"
] | java.io; java.lang; | 2,067,036 |
public void setLocale(Locale locale) {
fLocale = locale;
fErrorReporter.setLocale(locale);
} // setLocale(Locale) | void function(Locale locale) { fLocale = locale; fErrorReporter.setLocale(locale); } | /**
* Set the locale to use for messages.
*
* @param locale The locale object to use for localization of messages.
*
* @exception XNIException Thrown if the parser does not support the
* specified locale.
*/ | Set the locale to use for messages | setLocale | {
"repo_name": "shun634501730/java_source_cn",
"path": "src_en/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader.java",
"license": "apache-2.0",
"size": 57481
} | [
"java.util.Locale"
] | import java.util.Locale; | import java.util.*; | [
"java.util"
] | java.util; | 2,659,381 |
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Void> revalidateAsync(
String resourceGroupName,
String managedInstanceName,
EncryptionProtectorName encryptionProtectorName,
Context context) {
return beginRevalidateAsync(resourceGroupName, managedInstanceName, en... | @ServiceMethod(returns = ReturnType.SINGLE) Mono<Void> function( String resourceGroupName, String managedInstanceName, EncryptionProtectorName encryptionProtectorName, Context context) { return beginRevalidateAsync(resourceGroupName, managedInstanceName, encryptionProtectorName, context) .last() .flatMap(this.client::g... | /**
* Revalidates an existing encryption protector.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param managedInstanceName The name of the managed instance.
* @p... | Revalidates an existing encryption protector | revalidateAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-sql/src/main/java/com/azure/resourcemanager/sql/implementation/ManagedInstanceEncryptionProtectorsClientImpl.java",
"license": "mit",
"size": 61605
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.util.Context",
"com.azure.resourcemanager.sql.models.EncryptionProtectorName"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.util.Context; import com.azure.resourcemanager.sql.models.EncryptionProtectorName; | import com.azure.core.annotation.*; import com.azure.core.util.*; import com.azure.resourcemanager.sql.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 614,860 |
public Set< FieldModel > getFields()
{
return fields;
} | Set< FieldModel > function() { return fields; } | /**
* Gets the fields.
*
* @return the fields
*/ | Gets the fields | getFields | {
"repo_name": "RampantLions/CodeTools",
"path": "CodeToolsModules/CodeToolsSwagger/CodeToolsSwaggerGenerators/src/main/java/io/github/rampantlions/codetools/restbuilder/generators/models/ModelModel.java",
"license": "apache-2.0",
"size": 4749
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 2,856,984 |
try {
Document doc= createDocument(string, positions);
edit.apply(doc, 0);
if (positions != null) {
for (int i= 0; i < positions.length; i++) {
Assert.isTrue(!positions[i].isDeleted, "Position got deleted"); //$NON-NLS-1$
}
}
return doc.get();
} catch (BadLocationException e) {
log(e)... | try { Document doc= createDocument(string, positions); edit.apply(doc, 0); if (positions != null) { for (int i= 0; i < positions.length; i++) { Assert.isTrue(!positions[i].isDeleted, STR); } } return doc.get(); } catch (BadLocationException e) { log(e); Assert.isTrue(false, STR + e.getMessage()); } return null; } | /**
* Evaluates the edit on the given string.
*
* @throws IllegalArgumentException if the positions are not inside the
* string
*/ | Evaluates the edit on the given string | evaluateFormatterEdit | {
"repo_name": "trylimits/Eclipse-Postfix-Code-Completion",
"path": "luna/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/comment/CommentFormatterUtil.java",
"license": "epl-1.0",
"size": 4377
} | [
"org.eclipse.core.runtime.Assert",
"org.eclipse.jface.text.BadLocationException",
"org.eclipse.jface.text.Document"
] | import org.eclipse.core.runtime.Assert; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.Document; | import org.eclipse.core.runtime.*; import org.eclipse.jface.text.*; | [
"org.eclipse.core",
"org.eclipse.jface"
] | org.eclipse.core; org.eclipse.jface; | 1,586,688 |
public static <S extends AnnotatedSpace<A>, A extends TypedAxis> Stream<A>
spatialAxisStream(final S space)
{
return axisStream(space).filter(a -> a.type().isSpatial());
} | static <S extends AnnotatedSpace<A>, A extends TypedAxis> Stream<A> function(final S space) { return axisStream(space).filter(a -> a.type().isSpatial()); } | /**
* Generates a {@link Stream} from the spatial axes in the given space.
*
* @param space an N-dimensional space.
* @param <S> type of the space.
* @param <A> type of the axes.
* @return a Stream of spatial axes.
*/ | Generates a <code>Stream</code> from the spatial axes in the given space | spatialAxisStream | {
"repo_name": "bonej-org/BoneJ2",
"path": "Modern/utilities/src/main/java/org/bonej/utilities/Streamers.java",
"license": "bsd-2-clause",
"size": 4097
} | [
"java.util.stream.Stream",
"net.imagej.axis.TypedAxis",
"net.imagej.space.AnnotatedSpace"
] | import java.util.stream.Stream; import net.imagej.axis.TypedAxis; import net.imagej.space.AnnotatedSpace; | import java.util.stream.*; import net.imagej.axis.*; import net.imagej.space.*; | [
"java.util",
"net.imagej.axis",
"net.imagej.space"
] | java.util; net.imagej.axis; net.imagej.space; | 144,401 |
Map<String, ISnomedBrowserConstant> getConstants(String branchPath, List<ExtendedLocale> extendedLocales); | Map<String, ISnomedBrowserConstant> getConstants(String branchPath, List<ExtendedLocale> extendedLocales); | /**
* Retrieves a map of enum constants and corresponding concepts.
*
* @param branchPath - the branch to use
* @param extendedLocales - the {@link ExtendedLocale}s to inspect when determining FSN, in decreasing order of preference
* @return a map with keys as constant identifiers, and values as corresponding... | Retrieves a map of enum constants and corresponding concepts | getConstants | {
"repo_name": "IHTSDO/snow-owl",
"path": "snomed/com.b2international.snowowl.snomed.api/src/com/b2international/snowowl/snomed/api/browser/ISnomedBrowserService.java",
"license": "apache-2.0",
"size": 7203
} | [
"com.b2international.commons.http.ExtendedLocale",
"com.b2international.snowowl.snomed.api.domain.browser.ISnomedBrowserConstant",
"java.util.List",
"java.util.Map"
] | import com.b2international.commons.http.ExtendedLocale; import com.b2international.snowowl.snomed.api.domain.browser.ISnomedBrowserConstant; import java.util.List; import java.util.Map; | import com.b2international.commons.http.*; import com.b2international.snowowl.snomed.api.domain.browser.*; import java.util.*; | [
"com.b2international.commons",
"com.b2international.snowowl",
"java.util"
] | com.b2international.commons; com.b2international.snowowl; java.util; | 2,881,606 |
@Override
public int prepare(Xid xid) throws XAException {
if (isDebugEnabled()) {
debugCode("prepare("+JdbcXid.toString(xid)+");");
}
checkOpen();
if (!currentTransaction.equals(xid)) {
throw new XAException(XAException.XAER_INVAL);
}
try... | int function(Xid xid) throws XAException { if (isDebugEnabled()) { debugCode(STR+JdbcXid.toString(xid)+");"); } checkOpen(); if (!currentTransaction.equals(xid)) { throw new XAException(XAException.XAER_INVAL); } try (Statement stat = physicalConn.createStatement()) { stat.execute(STR + JdbcXid.toString(xid)); prepared... | /**
* Prepare a transaction.
*
* @param xid the transaction id
* @return XA_OK
*/ | Prepare a transaction | prepare | {
"repo_name": "wizardofos/Protozoo",
"path": "extra/h2/src/main/java/org/h2/jdbcx/JdbcXAConnection.java",
"license": "mit",
"size": 13856
} | [
"java.sql.SQLException",
"java.sql.Statement",
"javax.transaction.xa.XAException",
"javax.transaction.xa.Xid"
] | import java.sql.SQLException; import java.sql.Statement; import javax.transaction.xa.XAException; import javax.transaction.xa.Xid; | import java.sql.*; import javax.transaction.xa.*; | [
"java.sql",
"javax.transaction"
] | java.sql; javax.transaction; | 1,563,698 |
private boolean validateAndSave(boolean force) {
String name = checkNotSet(mName.getText());
String apn = checkNotSet(mApn.getText());
String mcc = checkNotSet(mMcc.getText());
String mnc = checkNotSet(mMnc.getText());
if (getErrorMsg() != null && !force) {
showD... | boolean function(boolean force) { String name = checkNotSet(mName.getText()); String apn = checkNotSet(mApn.getText()); String mcc = checkNotSet(mMcc.getText()); String mnc = checkNotSet(mMnc.getText()); if (getErrorMsg() != null && !force) { showDialog(ERROR_DIALOG_ID); return false; } if (!mCursor.moveToFirst()) { Lo... | /**
* Check the key fields' validity and save if valid.
* @param force save even if the fields are not valid, if the app is
* being suspended
* @return true if the data was saved
*/ | Check the key fields' validity and save if valid | validateAndSave | {
"repo_name": "louis20150702/mytestgit",
"path": "Settings/src/com/android/settings/ApnEditor.java",
"license": "gpl-2.0",
"size": 34532
} | [
"android.content.ContentValues",
"android.provider.Settings",
"android.provider.Telephony",
"android.util.Log"
] | import android.content.ContentValues; import android.provider.Settings; import android.provider.Telephony; import android.util.Log; | import android.content.*; import android.provider.*; import android.util.*; | [
"android.content",
"android.provider",
"android.util"
] | android.content; android.provider; android.util; | 2,375,990 |
public Builder addPaths(
@CompileTimeConstant String arg, @Nullable NestedSet<PathFragment> values) {
return addNestedSetInternal(arg, values);
} | Builder function( @CompileTimeConstant String arg, @Nullable NestedSet<PathFragment> values) { return addNestedSetInternal(arg, values); } | /**
* Adds the arg followed by the path fragments.
*
* <p>If values is empty, the arg isn't added.
*/ | Adds the arg followed by the path fragments. If values is empty, the arg isn't added | addPaths | {
"repo_name": "meteorcloudy/bazel",
"path": "src/main/java/com/google/devtools/build/lib/analysis/actions/CustomCommandLine.java",
"license": "apache-2.0",
"size": 50692
} | [
"com.google.devtools.build.lib.collect.nestedset.NestedSet",
"com.google.devtools.build.lib.vfs.PathFragment",
"com.google.errorprone.annotations.CompileTimeConstant",
"javax.annotation.Nullable"
] | import com.google.devtools.build.lib.collect.nestedset.NestedSet; import com.google.devtools.build.lib.vfs.PathFragment; import com.google.errorprone.annotations.CompileTimeConstant; import javax.annotation.Nullable; | import com.google.devtools.build.lib.collect.nestedset.*; import com.google.devtools.build.lib.vfs.*; import com.google.errorprone.annotations.*; import javax.annotation.*; | [
"com.google.devtools",
"com.google.errorprone",
"javax.annotation"
] | com.google.devtools; com.google.errorprone; javax.annotation; | 555,671 |
private void buildMenu() {
setVisible(false);
removeAll();
if (recentSearches.getLength() == 0) {
JMenuItem noRecent = new JMenuItem(UIManagerExt.getString("SearchField.noRecentsText"));
noRecent.setEnabled(false);
add(noRecent);
} else {
JMenuItem recent = new JMenuItem(UIManagerExt.g... | void function() { setVisible(false); removeAll(); if (recentSearches.getLength() == 0) { JMenuItem noRecent = new JMenuItem(UIManagerExt.getString(STR)); noRecent.setEnabled(false); add(noRecent); } else { JMenuItem recent = new JMenuItem(UIManagerExt.getString(STR)); recent.setEnabled(false); add(recent); for (String ... | /**
* Rebuilds the menu according to the recent searches.
*/ | Rebuilds the menu according to the recent searches | buildMenu | {
"repo_name": "Mindtoeye/Hoop",
"path": "src/org/jdesktop/swingx/search/RecentSearches.java",
"license": "lgpl-3.0",
"size": 9965
} | [
"javax.swing.JMenuItem",
"org.jdesktop.swingx.plaf.UIManagerExt"
] | import javax.swing.JMenuItem; import org.jdesktop.swingx.plaf.UIManagerExt; | import javax.swing.*; import org.jdesktop.swingx.plaf.*; | [
"javax.swing",
"org.jdesktop.swingx"
] | javax.swing; org.jdesktop.swingx; | 2,342,684 |
public static CustomerEditFragment newInstance(String customerId)
{
// Prepare arguments.
Bundle args = new Bundle(); // Contains key-value pairs.
args.putString(EXTRA_CUSTOMER_ID, customerId);
// Creates a fragment instance and sets its arguments.
CustomerEditFragment fragment = new CustomerEditFragme... | static CustomerEditFragment function(String customerId) { Bundle args = new Bundle(); args.putString(EXTRA_CUSTOMER_ID, customerId); CustomerEditFragment fragment = new CustomerEditFragment(); fragment.setArguments(args); return fragment; } | /**
* Creates a new fragment instance and set the specified id as fragment's arguments.
* @param crimeId a UUID
* @return a new fragment instance with the specified UUID attached as its arguments.
*/ | Creates a new fragment instance and set the specified id as fragment's arguments | newInstance | {
"repo_name": "mnishiguchi/MovingEstimator",
"path": "src/com/mnishiguchi/android/movingestimator/CustomerEditFragment.java",
"license": "mit",
"size": 17004
} | [
"android.os.Bundle"
] | import android.os.Bundle; | import android.os.*; | [
"android.os"
] | android.os; | 1,327,657 |
private UUID nodeForKey(Object key) {
assert partMapping != null;
int part = RendezvousAffinityFunction.calculatePartition(key, affinityMask, partMapping.length);
return partMapping[part];
} | UUID function(Object key) { assert partMapping != null; int part = RendezvousAffinityFunction.calculatePartition(key, affinityMask, partMapping.length); return partMapping[part]; } | /**
* Calculates node for given key.
*
* @param key Key.
*/ | Calculates node for given key | nodeForKey | {
"repo_name": "NSAmelchev/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheAffinityMapping.java",
"license": "apache-2.0",
"size": 10210
} | [
"org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction"
] | import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; | import org.apache.ignite.cache.affinity.rendezvous.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 846,667 |
public static WorkflowItem findByItem(Context context, Item i)
throws SQLException
{
// Look for the unique workflowitem entry where 'item_id' references this item
TableRow row = DatabaseManager.findByUnique(context, "workflowitem", "item_id", i.getID());
if (row == null)
... | static WorkflowItem function(Context context, Item i) throws SQLException { TableRow row = DatabaseManager.findByUnique(context, STR, STR, i.getID()); if (row == null) { return null; } else { return new WorkflowItem(context, row); } } | /**
* Check to see if a particular item is currently under Workflow.
* If so, its WorkflowItem is returned. If not, null is returned
*
* @param context
* the context object
* @param i
* the item
*
* @return workflow item corresponding to the item, or n... | Check to see if a particular item is currently under Workflow. If so, its WorkflowItem is returned. If not, null is returned | findByItem | {
"repo_name": "mdiggory/dryad-repo",
"path": "dspace-api/src/main/java/org/dspace/workflow/WorkflowItem.java",
"license": "bsd-3-clause",
"size": 11141
} | [
"java.sql.SQLException",
"org.dspace.content.Item",
"org.dspace.core.Context",
"org.dspace.storage.rdbms.DatabaseManager",
"org.dspace.storage.rdbms.TableRow"
] | import java.sql.SQLException; import org.dspace.content.Item; import org.dspace.core.Context; import org.dspace.storage.rdbms.DatabaseManager; import org.dspace.storage.rdbms.TableRow; | import java.sql.*; import org.dspace.content.*; import org.dspace.core.*; import org.dspace.storage.rdbms.*; | [
"java.sql",
"org.dspace.content",
"org.dspace.core",
"org.dspace.storage"
] | java.sql; org.dspace.content; org.dspace.core; org.dspace.storage; | 667,681 |
public IDocument parse(Reader r) throws IOException; | IDocument function(Reader r) throws IOException; | /**
* Parse an {@link IDocument} from a {@link Reader}.
*
* @param r
* @return
* @throws IOException
*/ | Parse an <code>IDocument</code> from a <code>Reader</code> | parse | {
"repo_name": "intarsys/runtime",
"path": "src/de/intarsys/tools/infoset/IElementFactory.java",
"license": "bsd-3-clause",
"size": 2351
} | [
"java.io.IOException",
"java.io.Reader"
] | import java.io.IOException; import java.io.Reader; | import java.io.*; | [
"java.io"
] | java.io; | 1,359,232 |
void addSuppression(String suppression) {
lazyInitInfo();
if (info.suppressions == null) {
info.suppressions = ImmutableSet.of(suppression);
} else {
info.suppressions = new ImmutableSet.Builder<String>()
.addAll(info.suppressions)
.add(suppression)
.build();
... | void addSuppression(String suppression) { lazyInitInfo(); if (info.suppressions == null) { info.suppressions = ImmutableSet.of(suppression); } else { info.suppressions = new ImmutableSet.Builder<String>() .addAll(info.suppressions) .add(suppression) .build(); } } | /**
* Add a suppressed warning.
*/ | Add a suppressed warning | addSuppression | {
"repo_name": "GerHobbelt/closure-compiler",
"path": "src/com/google/javascript/rhino/JSDocInfo.java",
"license": "apache-2.0",
"size": 60946
} | [
"com.google.common.collect.ImmutableSet"
] | import com.google.common.collect.ImmutableSet; | import com.google.common.collect.*; | [
"com.google.common"
] | com.google.common; | 1,729,889 |
private void syncUser(@Nonnull ExternalUser user) throws SyncException {
Root root = getRoot();
if (root == null) {
throw new SyncException("Cannot synchronize user. root == null");
}
UserManager userManager = getUserManager();
if (userManager == null) {
... | void function(@Nonnull ExternalUser user) throws SyncException { Root root = getRoot(); if (root == null) { throw new SyncException(STR); } UserManager userManager = getUserManager(); if (userManager == null) { throw new SyncException(STR); } int numAttempt = 0; while (numAttempt++ < MAX_SYNC_ATTEMPTS) { SyncContext co... | /**
* Initiates synchronization of the external user.
* @param user the external user
* @throws SyncException if an error occurs
*/ | Initiates synchronization of the external user | syncUser | {
"repo_name": "bdelacretaz/jackrabbit-oak",
"path": "oak-auth-external/src/main/java/org/apache/jackrabbit/oak/spi/security/authentication/external/impl/ExternalLoginModule.java",
"license": "apache-2.0",
"size": 16599
} | [
"javax.annotation.Nonnull",
"org.apache.jackrabbit.api.security.user.UserManager",
"org.apache.jackrabbit.oak.api.CommitFailedException",
"org.apache.jackrabbit.oak.api.Root",
"org.apache.jackrabbit.oak.commons.DebugTimer",
"org.apache.jackrabbit.oak.namepath.NamePathMapper",
"org.apache.jackrabbit.oak.... | import javax.annotation.Nonnull; import org.apache.jackrabbit.api.security.user.UserManager; import org.apache.jackrabbit.oak.api.CommitFailedException; import org.apache.jackrabbit.oak.api.Root; import org.apache.jackrabbit.oak.commons.DebugTimer; import org.apache.jackrabbit.oak.namepath.NamePathMapper; import org.ap... | import javax.annotation.*; import org.apache.jackrabbit.api.security.user.*; import org.apache.jackrabbit.oak.api.*; import org.apache.jackrabbit.oak.commons.*; import org.apache.jackrabbit.oak.namepath.*; import org.apache.jackrabbit.oak.plugins.value.*; import org.apache.jackrabbit.oak.spi.security.authentication.ext... | [
"javax.annotation",
"org.apache.jackrabbit"
] | javax.annotation; org.apache.jackrabbit; | 1,010,583 |
public void updateFloat(int columnIndex, float x) throws SQLException {
throw new SQLException( "updates not supported" );
} | void function(int columnIndex, float x) throws SQLException { throw new SQLException( STR ); } | /**
* Updates the designated column with a <code>float</code> value.
* The updater methods are used to update column values in the
* current row or the insert row. The updater methods do not
* update the underlying database; instead the <code>updateRow</code> or
* <code>insertRow</code> methods are called t... | Updates the designated column with a <code>float</code> value. The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code> methods are called to update the database | updateFloat | {
"repo_name": "OpenBD/openbd-core",
"path": "src/com/naryx/tagfusion/cfm/engine/cfQueryResultData.java",
"license": "gpl-3.0",
"size": 154192
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 720,237 |
public static void deletePath(Configuration conf, String path)
throws IOException {
deletePath(conf, new Path(path));
} | static void function(Configuration conf, String path) throws IOException { deletePath(conf, new Path(path)); } | /**
* Helper method to remove a path if it exists.
*
* @param conf Configuration to load FileSystem from
* @param path Path to remove
* @throws IOException
*/ | Helper method to remove a path if it exists | deletePath | {
"repo_name": "mmaro/giraph",
"path": "giraph-core/src/main/java/org/apache/giraph/utils/FileUtils.java",
"license": "apache-2.0",
"size": 4818
} | [
"java.io.IOException",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.fs.Path"
] | import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; | import java.io.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.fs.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 2,062,012 |
public void installToolbar(boolean initToolbar) {
if (initToolbar){
toolbar.removeAll();
westToolbar = new JToolBar();;
westToolbar.setFloatable(false);
westToolbar.setRollover(true);
errorLabel = new JLabel("");
errorLabel.setForeground(Color.red);
toolbar.setLayout(new... | void function(boolean initToolbar) { if (initToolbar){ toolbar.removeAll(); westToolbar = new JToolBar();; westToolbar.setFloatable(false); westToolbar.setRollover(true); errorLabel = new JLabel(STRSTRSTRSTRSTRSTRSTRSTRSTRSTRhoareSTRicon.undoSTRhoareSTRttt.undoSTRhoareSTRicon.redoSTRhoareSTRttt.redoSTRhoareSTRicon.rein... | /**
* installs the Toolbar with buttons and errorLabel
* if boolean initToolbar is true, the function will init the toolbar without buttons
* if it is false it will init the buttons (therefor the toolbar should be inited before)
*
* @param initToolbar
*/ | installs the Toolbar with buttons and errorLabel if boolean initToolbar is true, the function will init the toolbar without buttons if it is false it will init the buttons (therefor the toolbar should be inited before) | installToolbar | {
"repo_name": "jurkov/j-algo-mod",
"path": "src/org/jalgo/module/hoare/view/View.java",
"license": "gpl-2.0",
"size": 32171
} | [
"javax.swing.JLabel",
"javax.swing.JToolBar"
] | import javax.swing.JLabel; import javax.swing.JToolBar; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 1,245,094 |
private void detectSlaveChanges() {
for (VdsNetworkInterface newIface : params.getInterfaces()) {
VdsNetworkInterface existingIface = getExistingIfaces().get(newIface.getName());
if (existingIface != null && !existingIface.isBond() && existingIface.getVlanId() == null) {
... | void function() { for (VdsNetworkInterface newIface : params.getInterfaces()) { VdsNetworkInterface existingIface = getExistingIfaces().get(newIface.getName()); if (existingIface != null && !existingIface.isBond() && existingIface.getVlanId() == null) { String bondNameInNewIface = newIface.getBondName(); String bondNam... | /**
* Detect a bond that it's slaves have changed, to add to the modified bonds list.<br>
* Make sure not to add bond that was removed entirely.
*/ | Detect a bond that it's slaves have changed, to add to the modified bonds list. Make sure not to add bond that was removed entirely | detectSlaveChanges | {
"repo_name": "jtux270/translate",
"path": "ovirt/3.6_source/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/SetupNetworksHelper.java",
"license": "gpl-3.0",
"size": 42072
} | [
"org.apache.commons.lang.StringUtils",
"org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface"
] | import org.apache.commons.lang.StringUtils; import org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface; | import org.apache.commons.lang.*; import org.ovirt.engine.core.common.businessentities.network.*; | [
"org.apache.commons",
"org.ovirt.engine"
] | org.apache.commons; org.ovirt.engine; | 1,148,026 |
public Logging fetchByregionentitlementIDStringIDString_First(
String entitlementIDString, OrderByComparator orderByComparator)
throws SystemException {
List<Logging> list = findByregionentitlementIDStringIDString(entitlementIDString,
0, 1, orderByComparator);
if (!l... | Logging function( String entitlementIDString, OrderByComparator orderByComparator) throws SystemException { List<Logging> list = findByregionentitlementIDStringIDString(entitlementIDString, 0, 1, orderByComparator); if (!list.isEmpty()) { return list.get(0); } return null; } | /**
* Returns the first logging in the ordered set where entitlementIDString = ?.
*
* @param entitlementIDString the entitlement i d string
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the first matching logging, or <code>null</code>... | Returns the first logging in the ordered set where entitlementIDString = ? | fetchByregionentitlementIDStringIDString_First | {
"repo_name": "fraunhoferfokus/govapps",
"path": "data-portlet/src/main/java/de/fraunhofer/fokus/movepla/service/persistence/LoggingPersistenceImpl.java",
"license": "bsd-3-clause",
"size": 212106
} | [
"com.liferay.portal.kernel.exception.SystemException",
"com.liferay.portal.kernel.util.OrderByComparator",
"de.fraunhofer.fokus.movepla.model.Logging",
"java.util.List"
] | import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.util.OrderByComparator; import de.fraunhofer.fokus.movepla.model.Logging; import java.util.List; | import com.liferay.portal.kernel.exception.*; import com.liferay.portal.kernel.util.*; import de.fraunhofer.fokus.movepla.model.*; import java.util.*; | [
"com.liferay.portal",
"de.fraunhofer.fokus",
"java.util"
] | com.liferay.portal; de.fraunhofer.fokus; java.util; | 1,075,464 |
//--------------------//
// checkAugmentedDots //
//--------------------//
private int checkAugmentedDots ()
{
logger.debug("S#{} checkAugmentedDots", system.getId());
int modifs = 0;
List<Inter> entities = sig.inters(AugmentationDotInter.class);
for (Int... | int function () { logger.debug(STR, system.getId()); int modifs = 0; List<Inter> entities = sig.inters(AugmentationDotInter.class); for (Inter entity : entities) { Set<Relation> rels = sig.getRelations(entity, DoubleDotRelation.class); if (rels.size() > 1) { modifs += reduceAugmentations(rels); if (entity.isVip()) { lo... | /**
* Perform checks on augmented dots (double dots).
*
* @return the count of modifications done
*/ | Perform checks on augmented dots (double dots) | checkAugmentedDots | {
"repo_name": "Audiveris/audiveris",
"path": "src/main/org/audiveris/omr/sig/SigReducer.java",
"license": "agpl-3.0",
"size": 72261
} | [
"java.util.List",
"java.util.Set",
"org.audiveris.omr.sig.inter.AugmentationDotInter",
"org.audiveris.omr.sig.inter.Inter",
"org.audiveris.omr.sig.relation.DoubleDotRelation",
"org.audiveris.omr.sig.relation.Relation"
] | import java.util.List; import java.util.Set; import org.audiveris.omr.sig.inter.AugmentationDotInter; import org.audiveris.omr.sig.inter.Inter; import org.audiveris.omr.sig.relation.DoubleDotRelation; import org.audiveris.omr.sig.relation.Relation; | import java.util.*; import org.audiveris.omr.sig.inter.*; import org.audiveris.omr.sig.relation.*; | [
"java.util",
"org.audiveris.omr"
] | java.util; org.audiveris.omr; | 1,990,035 |
@CalledByNative
private void getToken(final int requestId, final String authorizedEntity, final String scope,
String[] extrasStrings, int flags) {
final Bundle extras = new Bundle();
assert extrasStrings.length % 2 == 0;
for (int i = 0; i < extrasStrings.length; i += 2) {
... | void function(final int requestId, final String authorizedEntity, final String scope, String[] extrasStrings, int flags) { final Bundle extras = new Bundle(); assert extrasStrings.length % 2 == 0; for (int i = 0; i < extrasStrings.length; i += 2) { extras.putString(extrasStrings[i], extrasStrings[i + 1]); } | /** Async wrapper for {@link InstanceID#getToken(String, String, Bundle)}.
* |isLazy| isn't part of the InstanceID.getToken() call and not sent to the
* FCM server. It's used to mark the subscription as lazy such that incoming
* messages are deferred until there are visible activities.*/ | Async wrapper for <code>InstanceID#getToken(String, String, Bundle)</code>. |isLazy| isn't part of the InstanceID.getToken() call and not sent to the FCM server. It's used to mark the subscription as lazy such that incoming | getToken | {
"repo_name": "endlessm/chromium-browser",
"path": "components/gcm_driver/instance_id/android/java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDBridge.java",
"license": "bsd-3-clause",
"size": 10954
} | [
"android.os.Bundle"
] | import android.os.Bundle; | import android.os.*; | [
"android.os"
] | android.os; | 2,776,967 |
public List<League> getTeamLeagueById(String teamId) {
return getTeamLeagueById(new String[] {teamId}).get(teamId);
}
/**
* Queries for the league entries of the team IDs. A maximum of 10 team IDs can be provided.
*
* @param teamIds the IDs of the teams to lookup
* @return a ... | List<League> function(String teamId) { return getTeamLeagueById(new String[] {teamId}).get(teamId); } /** * Queries for the league entries of the team IDs. A maximum of 10 team IDs can be provided. * * @param teamIds the IDs of the teams to lookup * @return a {@link java.util.Map} containing a {@link java.util.List} of... | /**
* Helper function for the {@link #getTeamLeagueById(String...) getTeamLeagueById} method when only a single
* team ID is provided.
*
* @param teamId the ID of the team to lookup
* @return a {@link java.util.List} of each {@link dto.league.League} the team is a part of (3v3 and
* ... | Helper function for the <code>#getTeamLeagueById(String...) getTeamLeagueById</code> method when only a single team ID is provided | getTeamLeagueById | {
"repo_name": "a64adam/ulti",
"path": "src/main/java/api/Ulti.java",
"license": "mit",
"size": 36883
} | [
"java.util.List",
"java.util.Map"
] | import java.util.List; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 715,316 |
private DianaPoint _getApproximatedNearestPoint(DianaPoint aPoint, int firstTriedObjectIndex) {
int MAX_TRIES = 10;
int tries = 0;
DianaPoint returned = aPoint.clone();
// System.out.println("_getApproximatedNearestPoint() called for "+aPoint+" on "+this);
while (!containsPoint(returned) && tries < MAX_T... | DianaPoint function(DianaPoint aPoint, int firstTriedObjectIndex) { int MAX_TRIES = 10; int tries = 0; DianaPoint returned = aPoint.clone(); while (!containsPoint(returned) && tries < MAX_TRIES) { DianaArea current = getObjects().elementAt(firstTriedObjectIndex); firstTriedObjectIndex++; if (firstTriedObjectIndex >= ge... | /**
* Little heuristic to find nearest point for a formal intersection (not working in all cases !)
*
* @param aPoint
* @param firstTriedObjectIndex
* @return
*/ | Little heuristic to find nearest point for a formal intersection (not working in all cases !) | _getApproximatedNearestPoint | {
"repo_name": "openflexo-team/diana",
"path": "diana-geom/src/main/java/org/openflexo/diana/geom/area/DianaIntersectionArea.java",
"license": "gpl-3.0",
"size": 17172
} | [
"org.openflexo.diana.geom.DianaPoint"
] | import org.openflexo.diana.geom.DianaPoint; | import org.openflexo.diana.geom.*; | [
"org.openflexo.diana"
] | org.openflexo.diana; | 2,547,919 |
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
super.notifyChanged(notification);
}
| void function(Notification notification) { updateChildren(notification); super.notifyChanged(notification); } | /**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc --> <!--
* end-user-doc -->
* @generated
*/ | This handles model notifications by calling <code>#updateChildren</code> to update any cached children and by creating a viewer notification, which it passes to <code>#fireNotifyChanged</code>. | notifyChanged | {
"repo_name": "dresden-ocl/dresdenocl",
"path": "plugins/org.dresdenocl.language.ocl.edit/src/org/dresdenocl/language/ocl/provider/LogicalOrOperationCallExpCSItemProvider.java",
"license": "lgpl-3.0",
"size": 3864
} | [
"org.eclipse.emf.common.notify.Notification"
] | import org.eclipse.emf.common.notify.Notification; | import org.eclipse.emf.common.notify.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 688,128 |
public void addCallStatusListener(CallStatusListener listener) {
synchronized (listeners) {
listeners.add(listener);
}
} | void function(CallStatusListener listener) { synchronized (listeners) { listeners.add(listener); } } | /**
* Add a listener that will be notified whenever the call status
* changes
*
* @param listener the listener
*/ | Add a listener that will be notified whenever the call status changes | addCallStatusListener | {
"repo_name": "damirkusar/jvoicebridge",
"path": "voip/src/com/sun/voip/client/connector/impl/VoiceBridgeConnection.java",
"license": "gpl-2.0",
"size": 21364
} | [
"com.sun.voip.client.connector.CallStatusListener"
] | import com.sun.voip.client.connector.CallStatusListener; | import com.sun.voip.client.connector.*; | [
"com.sun.voip"
] | com.sun.voip; | 1,800,757 |
public NotificationCounter getBadgeCount() {
NotificationCounter notificationCounter = new NotificationCounter();
for (Room room : mFilteredRooms) {
notificationCounter.addHighlights(room.getHighlightCount());
// sanity checks : reported by GA
if (null != room.g... | NotificationCounter function() { NotificationCounter notificationCounter = new NotificationCounter(); for (Room room : mFilteredRooms) { notificationCounter.addHighlights(room.getHighlightCount()); if (null != room.getDataHandler() && (null != room.getDataHandler().getBingRulesManager()) && room.getDataHandler().getBin... | /**
* Return the sum of highlight and notifications for all the displayed rooms
*
* @return badge value
*/ | Return the sum of highlight and notifications for all the displayed rooms | getBadgeCount | {
"repo_name": "vector-im/vector-android",
"path": "vector/src/main/java/im/vector/adapters/HomeRoomAdapter.java",
"license": "apache-2.0",
"size": 8143
} | [
"im.vector.adapters.model.NotificationCounter",
"org.matrix.androidsdk.data.Room"
] | import im.vector.adapters.model.NotificationCounter; import org.matrix.androidsdk.data.Room; | import im.vector.adapters.model.*; import org.matrix.androidsdk.data.*; | [
"im.vector.adapters",
"org.matrix.androidsdk"
] | im.vector.adapters; org.matrix.androidsdk; | 2,901,439 |
public boolean rename(String from, String to) throws IOException
{
if (!FTPReply.isPositiveIntermediate(rnfr(from))) {
return false;
}
return FTPReply.isPositiveCompletion(rnto(to));
} | boolean function(String from, String to) throws IOException { if (!FTPReply.isPositiveIntermediate(rnfr(from))) { return false; } return FTPReply.isPositiveCompletion(rnto(to)); } | /**
* Renames a remote file.
*
* @param from The name of the remote file to rename.
* @param to The new name of the remote file.
* @return True if successfully completed, false if not.
* @throws FTPConnectionClosedException
* If the FTP server prematurely closes the connectio... | Renames a remote file | rename | {
"repo_name": "grtlinux/KIEA_JAVA7",
"path": "KIEA_JAVA7/src/tain/kr/com/commons/net/v01/ftp/FTPClient.java",
"license": "gpl-3.0",
"size": 168033
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 637,880 |
@Override
public boolean containsValue(@NullableDecl Object value) {
return findEntryByValue(value) != ABSENT;
} | boolean function(@NullableDecl Object value) { return findEntryByValue(value) != ABSENT; } | /**
* Returns {@code true} if this BiMap contains an entry whose value is equal to {@code value} (or,
* equivalently, if this inverse view contains a key that is equal to {@code value}).
*
* <p>Due to the property that values in a BiMap are unique, this will tend to execute in
* faster-than-linear time.
... | Returns true if this BiMap contains an entry whose value is equal to value (or, equivalently, if this inverse view contains a key that is equal to value). Due to the property that values in a BiMap are unique, this will tend to execute in faster-than-linear time | containsValue | {
"repo_name": "typetools/guava",
"path": "android/guava/src/com/google/common/collect/HashBiMap.java",
"license": "apache-2.0",
"size": 34085
} | [
"org.checkerframework.checker.nullness.compatqual.NullableDecl"
] | import org.checkerframework.checker.nullness.compatqual.NullableDecl; | import org.checkerframework.checker.nullness.compatqual.*; | [
"org.checkerframework.checker"
] | org.checkerframework.checker; | 564,394 |
public void validate(Object obj, Errors errors) {
Program p = (Program) obj;
if (p == null) {
errors.rejectValue("program", "error.general");
} else {
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "name", "error.name");
List<Program> programs = Context.getProgramWorkflowService().getAllPrograms(fa... | void function(Object obj, Errors errors) { Program p = (Program) obj; if (p == null) { errors.rejectValue(STR, STR); } else { ValidationUtils.rejectIfEmptyOrWhitespace(errors, "name", STR); List<Program> programs = Context.getProgramWorkflowService().getAllPrograms(false); for (Program program : programs) { if (program... | /**
* Checks the form object for any inconsistencies/errors
*
* @see org.springframework.validation.Validator#validate(java.lang.Object,
* org.springframework.validation.Errors)
* @should fail validation if name is null or empty or whitespace
* @should pass validation if description is null or empty o... | Checks the form object for any inconsistencies/errors | validate | {
"repo_name": "Winbobob/openmrs-core",
"path": "api/src/main/java/org/openmrs/validator/ProgramValidator.java",
"license": "mpl-2.0",
"size": 2568
} | [
"java.util.List",
"org.openmrs.Program",
"org.openmrs.api.context.Context",
"org.springframework.validation.Errors",
"org.springframework.validation.ValidationUtils"
] | import java.util.List; import org.openmrs.Program; import org.openmrs.api.context.Context; import org.springframework.validation.Errors; import org.springframework.validation.ValidationUtils; | import java.util.*; import org.openmrs.*; import org.openmrs.api.context.*; import org.springframework.validation.*; | [
"java.util",
"org.openmrs",
"org.openmrs.api",
"org.springframework.validation"
] | java.util; org.openmrs; org.openmrs.api; org.springframework.validation; | 2,068,984 |
@Test
public void testCreateJob() throws GenieException {
final int cpu = 1;
final int mem = 1;
final String email = "name@domain.com";
final String setupFile = "setupFilePath";
final String group = "group";
final String description = "job description";
fi... | void function() throws GenieException { final int cpu = 1; final int mem = 1; final String email = STR; final String setupFile = STR; final String group = "group"; final String description = STR; final Set<String> tags = new HashSet<>(); tags.add("foo"); tags.add("bar"); final JobRequest jobRequest = new JobRequest.Bui... | /**
* Test the createJob method.
*
* @throws GenieException For any problem
*/ | Test the createJob method | testCreateJob | {
"repo_name": "ajoymajumdar/genie",
"path": "genie-core/src/test/java/com/netflix/genie/core/jpa/services/JpaJobPersistenceServiceImplUnitTests.java",
"license": "apache-2.0",
"size": 23606
} | [
"com.google.common.collect.Lists",
"com.google.common.collect.Sets",
"com.netflix.genie.common.dto.Job",
"com.netflix.genie.common.dto.JobExecution",
"com.netflix.genie.common.dto.JobMetadata",
"com.netflix.genie.common.dto.JobRequest",
"com.netflix.genie.common.dto.JobStatus",
"com.netflix.genie.comm... | import com.google.common.collect.Lists; import com.google.common.collect.Sets; import com.netflix.genie.common.dto.Job; import com.netflix.genie.common.dto.JobExecution; import com.netflix.genie.common.dto.JobMetadata; import com.netflix.genie.common.dto.JobRequest; import com.netflix.genie.common.dto.JobStatus; import... | import com.google.common.collect.*; import com.netflix.genie.common.dto.*; import com.netflix.genie.common.exceptions.*; import com.netflix.genie.core.jpa.entities.*; import java.util.*; import org.hamcrest.*; import org.junit.*; import org.mockito.*; | [
"com.google.common",
"com.netflix.genie",
"java.util",
"org.hamcrest",
"org.junit",
"org.mockito"
] | com.google.common; com.netflix.genie; java.util; org.hamcrest; org.junit; org.mockito; | 2,228,692 |
private void writeWasteTreatment(SPWasteTreatment wasteTreatment)
throws IOException {
writeln("Process");
writer.newLine();
writeDocumentation(wasteTreatment.getDocumentation(), false);
writeln("Waste treatment");
writeln(getWasteSpecificationLine(
wasteTreatment.getWasteSpecification(),
waste... | void function(SPWasteTreatment wasteTreatment) throws IOException { writeln(STR); writer.newLine(); writeDocumentation(wasteTreatment.getDocumentation(), false); writeln(STR); writeln(getWasteSpecificationLine( wasteTreatment.getWasteSpecification(), wasteTreatment.getSubCategory())); writer.newLine(); writeln(STR); fo... | /**
* Writes a waste treatment into the CSV file
*
* @param wasteTreatment
* The waste treatment to be written
* @throws java.io.IOException
*/ | Writes a waste treatment into the CSV file | writeWasteTreatment | {
"repo_name": "GreenDelta/olca-converter",
"path": "src/main/java/com/greendeltatc/simapro/csv/CSVWriter.java",
"license": "mpl-2.0",
"size": 32413
} | [
"com.greendeltatc.simapro.csv.model.SPCalculatedParameter",
"com.greendeltatc.simapro.csv.model.SPElementaryFlow",
"com.greendeltatc.simapro.csv.model.SPInputParameter",
"com.greendeltatc.simapro.csv.model.SPProductFlow",
"com.greendeltatc.simapro.csv.model.SPWasteToTreatmentFlow",
"com.greendeltatc.simap... | import com.greendeltatc.simapro.csv.model.SPCalculatedParameter; import com.greendeltatc.simapro.csv.model.SPElementaryFlow; import com.greendeltatc.simapro.csv.model.SPInputParameter; import com.greendeltatc.simapro.csv.model.SPProductFlow; import com.greendeltatc.simapro.csv.model.SPWasteToTreatmentFlow; import com.g... | import com.greendeltatc.simapro.csv.model.*; import com.greendeltatc.simapro.csv.model.types.*; import java.io.*; | [
"com.greendeltatc.simapro",
"java.io"
] | com.greendeltatc.simapro; java.io; | 2,115,187 |
public static String generateFieldsQueryString(String qry, String tableAlias, H2TableDescriptor tbl)
throws IgniteCheckedException {
assert tbl != null;
final String qry0 = qry;
String t = tbl.fullTableName();
String from = " ";
qry = qry.trim();
String u... | static String function(String qry, String tableAlias, H2TableDescriptor tbl) throws IgniteCheckedException { assert tbl != null; final String qry0 = qry; String t = tbl.fullTableName(); String from = " "; qry = qry.trim(); String upper = qry.toUpperCase(); if (upper.startsWith(STR)) { qry = qry.substring(6).trim(); fin... | /**
* Generate SqlFieldsQuery string from SqlQuery.
*
* @param qry Query string.
* @param tableAlias table alias.
* @param tbl Table to use.
* @return Prepared statement.
* @throws IgniteCheckedException In case of error.
*/ | Generate SqlFieldsQuery string from SqlQuery | generateFieldsQueryString | {
"repo_name": "ptupitsyn/ignite",
"path": "modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2Utils.java",
"license": "apache-2.0",
"size": 32662
} | [
"org.apache.ignite.IgniteCheckedException",
"org.apache.ignite.internal.util.typedef.F"
] | import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.internal.util.typedef.F; | import org.apache.ignite.*; import org.apache.ignite.internal.util.typedef.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 1,761,243 |
@Test
public void testGetAllModelInstanceObjects01() {
IModelInstance modelInstance;
modelInstance = ModelBusTestUtility
.createEmptyJavaModelInstance(this.model);
List<IModelInstanceObject> objects;
objects = modelInstance.getAllModelInstanceObjects();
assertNotNull(objects);
assertEq... | void function() { IModelInstance modelInstance; modelInstance = ModelBusTestUtility .createEmptyJavaModelInstance(this.model); List<IModelInstanceObject> objects; objects = modelInstance.getAllModelInstanceObjects(); assertNotNull(objects); assertEquals(0, objects.size()); } | /**
* <p>
* Tests the method {@link IModelInstance#getAllModelInstanceObjects()}.
* </p>
*
* @throws TypeNotFoundInModelException
*/ | Tests the method <code>IModelInstance#getAllModelInstanceObjects()</code>. | testGetAllModelInstanceObjects01 | {
"repo_name": "dresden-ocl/dresdenocl",
"path": "tests/org.dresdenocl.modelbus.test/src/org/dresdenocl/modelbus/test/modelinstance/AbstractModelInstanceTest.java",
"license": "lgpl-3.0",
"size": 10112
} | [
"java.util.List",
"org.dresdenocl.modelbus.test.ModelBusTestUtility",
"org.dresdenocl.modelinstance.IModelInstance",
"org.dresdenocl.modelinstancetype.types.IModelInstanceObject",
"org.junit.Assert"
] | import java.util.List; import org.dresdenocl.modelbus.test.ModelBusTestUtility; import org.dresdenocl.modelinstance.IModelInstance; import org.dresdenocl.modelinstancetype.types.IModelInstanceObject; import org.junit.Assert; | import java.util.*; import org.dresdenocl.modelbus.test.*; import org.dresdenocl.modelinstance.*; import org.dresdenocl.modelinstancetype.types.*; import org.junit.*; | [
"java.util",
"org.dresdenocl.modelbus",
"org.dresdenocl.modelinstance",
"org.dresdenocl.modelinstancetype",
"org.junit"
] | java.util; org.dresdenocl.modelbus; org.dresdenocl.modelinstance; org.dresdenocl.modelinstancetype; org.junit; | 2,403,183 |
public static String format(final BigDecimal value, final Locale locale)
{
if (value == null) {
return "";
}
return format(value, value.scale(), locale);
} | static String function(final BigDecimal value, final Locale locale) { if (value == null) { return ""; } return format(value, value.scale(), locale); } | /**
* Uses the scale of the BigDecimal.
* @param value
* @param locale
*/ | Uses the scale of the BigDecimal | format | {
"repo_name": "developerleo/ProjectForge-2nd",
"path": "src/main/java/org/projectforge/core/NumberFormatter.java",
"license": "gpl-3.0",
"size": 3320
} | [
"java.math.BigDecimal",
"java.util.Locale"
] | import java.math.BigDecimal; import java.util.Locale; | import java.math.*; import java.util.*; | [
"java.math",
"java.util"
] | java.math; java.util; | 2,790,515 |
protected long loadStatics( String[] urls ) throws IOException
{
long staticsLoaded = 0;
for ( String url : urls )
{
if ( this._cachedURLs.add( url ) )
{
this._logger.finer( "Loading URL: " + url );
this._http.fetchUrl( url );
staticsLoaded++;
}
else
{
this._logger.finer( ... | long function( String[] urls ) throws IOException { long staticsLoaded = 0; for ( String url : urls ) { if ( this._cachedURLs.add( url ) ) { this._logger.finer( STR + url ); this._http.fetchUrl( url ); staticsLoaded++; } else { this._logger.finer( STR + url ); } } return staticsLoaded; } | /**
* Load the static files specified by the URLs if the current request is
* not cached and the file was not previously loaded and cached.
*
* @param urls The set of static file URLs.
* @return The number of static files loaded.
*
* @throws IOException
*/ | Load the static files specified by the URLs if the current request is not cached and the file was not previously loaded and cached | loadStatics | {
"repo_name": "marmbrus/rain-workload-toolkit",
"path": "src/radlab/rain/workload/olio/OlioOperation.java",
"license": "bsd-3-clause",
"size": 14109
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,953,207 |
public V remove(Object key) {
synchronized (this) {
Map<K, V> newMap = new HashMap<K, V>(internalMap);
V val = newMap.remove(key);
internalMap = newMap;
return val;
}
} | V function(Object key) { synchronized (this) { Map<K, V> newMap = new HashMap<K, V>(internalMap); V val = newMap.remove(key); internalMap = newMap; return val; } } | /**
* Removed the value and key from this map based on the
* provided key.
*
* @see java.util.Map#remove(java.lang.Object)
*/ | Removed the value and key from this map based on the provided key | remove | {
"repo_name": "xuse/ef-orm",
"path": "common-core/src/main/java/jef/common/CopyOnWriteMap.java",
"license": "apache-2.0",
"size": 5088
} | [
"java.util.HashMap",
"java.util.Map"
] | import java.util.HashMap; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 618,378 |
public void executionPhaseEnding() {
if (!inExecutionPhase.get()) {
return;
}
Profiler.instance().startTask(ProfilerTask.INFO, "Shutting down executors");
Profiler.instance().completeTask(ProfilerTask.INFO);
inExecutionPhase.set(false);
} | void function() { if (!inExecutionPhase.get()) { return; } Profiler.instance().startTask(ProfilerTask.INFO, STR); Profiler.instance().completeTask(ProfilerTask.INFO); inExecutionPhase.set(false); } | /**
* This method is called after the end of the execution phase of each build
* request (even if there was an interrupt).
*/ | This method is called after the end of the execution phase of each build request (even if there was an interrupt) | executionPhaseEnding | {
"repo_name": "mbrukman/bazel",
"path": "src/main/java/com/google/devtools/build/lib/actions/BlazeExecutor.java",
"license": "apache-2.0",
"size": 7718
} | [
"com.google.devtools.build.lib.profiler.Profiler",
"com.google.devtools.build.lib.profiler.ProfilerTask"
] | import com.google.devtools.build.lib.profiler.Profiler; import com.google.devtools.build.lib.profiler.ProfilerTask; | import com.google.devtools.build.lib.profiler.*; | [
"com.google.devtools"
] | com.google.devtools; | 2,047,099 |
Group renderColumn(final GridColumn<?> column,
final GridBodyColumnRenderContext context,
final BaseGridRendererHelper rendererHelper,
final BaseGridRendererHelper.RenderingInformation renderingInformation); | Group renderColumn(final GridColumn<?> column, final GridBodyColumnRenderContext context, final BaseGridRendererHelper rendererHelper, final BaseGridRendererHelper.RenderingInformation renderingInformation); | /**
* Renders the column.textual information to support rendering
* @param column The column to render
* @param context Contextual information to support rendering
* @param rendererHelper Helper for rendering.
* @param renderingInformation Calculated rendering information supporting rendering.
... | Renders the column.textual information to support rendering | renderColumn | {
"repo_name": "mbiarnes/uberfire",
"path": "uberfire-extensions/uberfire-wires/uberfire-wires-core/uberfire-wires-core-grids/src/main/java/org/uberfire/ext/wires/core/grids/client/widget/grid/renderers/columns/GridColumnRenderer.java",
"license": "apache-2.0",
"size": 2889
} | [
"com.ait.lienzo.client.core.shape.Group",
"org.uberfire.ext.wires.core.grids.client.model.GridColumn",
"org.uberfire.ext.wires.core.grids.client.widget.context.GridBodyColumnRenderContext",
"org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper"
] | import com.ait.lienzo.client.core.shape.Group; import org.uberfire.ext.wires.core.grids.client.model.GridColumn; import org.uberfire.ext.wires.core.grids.client.widget.context.GridBodyColumnRenderContext; import org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper; | import com.ait.lienzo.client.core.shape.*; import org.uberfire.ext.wires.core.grids.client.model.*; import org.uberfire.ext.wires.core.grids.client.widget.context.*; import org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.*; | [
"com.ait.lienzo",
"org.uberfire.ext"
] | com.ait.lienzo; org.uberfire.ext; | 546,148 |
IdmIdentityContractDto getPrimeContract(IdmIdentityDto identity);
| IdmIdentityContractDto getPrimeContract(IdmIdentityDto identity); | /**
* Returns prime identity contract
*
* @param identity
* @return
*/ | Returns prime identity contract | getPrimeContract | {
"repo_name": "bcvsolutions/CzechIdMng",
"path": "Realization/backend/core/core-test-api/src/main/java/eu/bcvsolutions/idm/test/api/TestHelper.java",
"license": "mit",
"size": 30086
} | [
"eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto",
"eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto"
] | import eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto; import eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto; | import eu.bcvsolutions.idm.core.api.dto.*; | [
"eu.bcvsolutions.idm"
] | eu.bcvsolutions.idm; | 2,228,018 |
private void _substringmatch() throws IOException {
if (debug) {
checkState(reader.curChar == '*');
}
builder.type = Type.SUBSTRINGMATCH;
builder.append("*=");
reader.next();
if (debug) {
checkState(reader.curChar == '=');
}
}
/**
* HASHNAME "#"{name} name {nmchar}+ [_a-z0-9-]|{nonascii}|{es... | void function() throws IOException { if (debug) { checkState(reader.curChar == '*'); } builder.type = Type.SUBSTRINGMATCH; builder.append("*="); reader.next(); if (debug) { checkState(reader.curChar == '='); } } /** * HASHNAME "#"{name} name {nmchar}+ [_a-z0-9-] {nonascii} {escape} | /**
* SUBSTRINGMATCH *=
*/ | SUBSTRINGMATCH *= | _substringmatch | {
"repo_name": "tectronics/epubcheck",
"path": "src/main/java/org/idpf/epubcheck/util/css/CssScanner.java",
"license": "mit",
"size": 31370
} | [
"com.google.common.base.Preconditions",
"java.io.IOException",
"org.idpf.epubcheck.util.css.CssToken"
] | import com.google.common.base.Preconditions; import java.io.IOException; import org.idpf.epubcheck.util.css.CssToken; | import com.google.common.base.*; import java.io.*; import org.idpf.epubcheck.util.css.*; | [
"com.google.common",
"java.io",
"org.idpf.epubcheck"
] | com.google.common; java.io; org.idpf.epubcheck; | 2,833,223 |
public java.io.InputStream getAsciiStream() throws SQLException { throw methodNotImplemented(); } | public java.io.InputStream getAsciiStream() throws SQLException { throw methodNotImplemented(); } | /**
* This routine is not used by the VTI to read the data, so no
* implementation is provided, an exception is thrown if it is
* called.
*
* @see java.sql.Clob
*/ | This routine is not used by the VTI to read the data, so no implementation is provided, an exception is thrown if it is called | getSubString | {
"repo_name": "apache/derby",
"path": "java/org.apache.derby.engine/org/apache/derby/impl/load/ImportClob.java",
"license": "apache-2.0",
"size": 7425
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,611,491 |
// content equals
// -----------------------------------------------------------------------
public static boolean contentEquals(InputStream input1, InputStream input2)
throws IOException {
if (!(input1 instanceof BufferedInputStream)) {
input1 = new BufferedInputStream(input1);
}
if (!(input2 instance... | static boolean function(InputStream input1, InputStream input2) throws IOException { if (!(input1 instanceof BufferedInputStream)) { input1 = new BufferedInputStream(input1); } if (!(input2 instanceof BufferedInputStream)) { input2 = new BufferedInputStream(input2); } int ch = input1.read(); while (-1 != ch) { int ch2 ... | /**
* Compare the contents of two Streams to determine if they are equal or
* not.
* <p>
* This method buffers the input internally using
* <code>BufferedInputStream</code> if they are not already buffered.
*
* @param input1
* the first stream
* @param input2
* the second stre... | Compare the contents of two Streams to determine if they are equal or not. This method buffers the input internally using <code>BufferedInputStream</code> if they are not already buffered | contentEquals | {
"repo_name": "opensagres/xdocreport.eclipse",
"path": "commons/fr.opensagres.eclipse.forms/src/fr/opensagres/eclipse/forms/internal/IOUtils.java",
"license": "lgpl-2.1",
"size": 46409
} | [
"java.io.BufferedInputStream",
"java.io.IOException",
"java.io.InputStream"
] | import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; | import java.io.*; | [
"java.io"
] | java.io; | 297,530 |
public long queryForLong(DatabaseConnection databaseConnection, String query, String[] arguments)
throws SQLException {
logger.debug("executing raw query for long: {}", query);
if (arguments.length > 0) {
// need to do the (Object) cast to force args to be a single object
logger.trace("query arguments: ... | long function(DatabaseConnection databaseConnection, String query, String[] arguments) throws SQLException { logger.debug(STR, query); if (arguments.length > 0) { logger.trace(STR, (Object) arguments); } CompiledStatement compiledStatement = null; DatabaseResults results = null; try { compiledStatement = databaseConnec... | /**
* Return a long from a raw query with String[] arguments.
*/ | Return a long from a raw query with String[] arguments | queryForLong | {
"repo_name": "lobo12/ormlite-core",
"path": "src/main/java/com/j256/ormlite/stmt/StatementExecutor.java",
"license": "isc",
"size": 30736
} | [
"com.j256.ormlite.misc.IOUtils",
"com.j256.ormlite.stmt.StatementBuilder",
"com.j256.ormlite.support.CompiledStatement",
"com.j256.ormlite.support.DatabaseConnection",
"com.j256.ormlite.support.DatabaseResults",
"java.sql.SQLException"
] | import com.j256.ormlite.misc.IOUtils; import com.j256.ormlite.stmt.StatementBuilder; import com.j256.ormlite.support.CompiledStatement; import com.j256.ormlite.support.DatabaseConnection; import com.j256.ormlite.support.DatabaseResults; import java.sql.SQLException; | import com.j256.ormlite.misc.*; import com.j256.ormlite.stmt.*; import com.j256.ormlite.support.*; import java.sql.*; | [
"com.j256.ormlite",
"java.sql"
] | com.j256.ormlite; java.sql; | 2,794,374 |
@SuppressWarnings({ "rawtypes" })
public static boolean isZipValidWebanno(File aZipFile)
throws ZipException, IOException
{
boolean isZipValidWebanno = false;
ZipFile zip = new ZipFile(aZipFile);
for (Enumeration zipEnumerate = zip.entries(); zipEnumerate.hasMoreElements();)... | @SuppressWarnings({ STR }) static boolean function(File aZipFile) throws ZipException, IOException { boolean isZipValidWebanno = false; ZipFile zip = new ZipFile(aZipFile); for (Enumeration zipEnumerate = zip.entries(); zipEnumerate.hasMoreElements();) { ZipEntry entry = (ZipEntry) zipEnumerate.nextElement(); if (entry... | /**
* Check if the zip file is webanno compatible
*
* @param aZipFile the file.
* @return if it is valid.
* @throws ZipException if the ZIP file is corrupt.
* @throws IOException if an I/O error occurs.
*
*/ | Check if the zip file is webanno compatible | isZipValidWebanno | {
"repo_name": "debovis/webanno",
"path": "webanno-project/src/main/java/de/tudarmstadt/ukp/clarin/webanno/project/page/ImportUtil.java",
"license": "apache-2.0",
"size": 40737
} | [
"java.io.File",
"java.io.IOException",
"java.util.Enumeration",
"java.util.zip.ZipEntry",
"java.util.zip.ZipException",
"java.util.zip.ZipFile"
] | import java.io.File; import java.io.IOException; import java.util.Enumeration; import java.util.zip.ZipEntry; import java.util.zip.ZipException; import java.util.zip.ZipFile; | import java.io.*; import java.util.*; import java.util.zip.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 2,212,524 |
public static Double getCalculatedTarget( final int periodIndex, final int timeUnits, final List<String> dataRow,
final Double target, final PeriodType queryPt, final PeriodType dataSetPt,
final List<DimensionalItemObject> filterPeriods )
{
if ( dataSetPt.equalsName( NAME ) )
{
... | static Double function( final int periodIndex, final int timeUnits, final List<String> dataRow, final Double target, final PeriodType queryPt, final PeriodType dataSetPt, final List<DimensionalItemObject> filterPeriods ) { if ( dataSetPt.equalsName( NAME ) ) { boolean hasPeriodInDimension = periodIndex != -1; if ( hasP... | /**
* Use number of days for daily data sets as target, as query periods might
* often span/contain different numbers of days.
*
* @param periodIndex the index of the period in the "dataRow".
* @param timeUnits the time unit size found in the current DataQueryParams.
* See {@link #D... | Use number of days for daily data sets as target, as query periods might often span/contain different numbers of days | getCalculatedTarget | {
"repo_name": "hispindia/dhis2-Core",
"path": "dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/util/ReportRatesHelper.java",
"license": "bsd-3-clause",
"size": 5238
} | [
"java.util.List",
"org.hisp.dhis.common.DimensionalItemObject",
"org.hisp.dhis.period.PeriodType"
] | import java.util.List; import org.hisp.dhis.common.DimensionalItemObject; import org.hisp.dhis.period.PeriodType; | import java.util.*; import org.hisp.dhis.common.*; import org.hisp.dhis.period.*; | [
"java.util",
"org.hisp.dhis"
] | java.util; org.hisp.dhis; | 2,801,720 |
@Test(expected = TarjetaCaducadaException.class)
public void testCreateCompraTarjetaCaducada()
throws DuplicateInstanceException, InstanceNotFoundException,
SesionLlenaException, BadArgumentException, InterruptedException,
TarjetaCaducadaException, SesionPasadaException {
... | @Test(expected = TarjetaCaducadaException.class) void function() throws DuplicateInstanceException, InstanceNotFoundException, SesionLlenaException, BadArgumentException, InterruptedException, TarjetaCaducadaException, SesionPasadaException { UserProfile userProfile = new UserProfile(STR, PasswordEncrypter.crypt(STR), ... | /**
* Test create compra tarjeta caducada.
*
* @throws DuplicateInstanceException
* the duplicate instance exception
* @throws InstanceNotFoundException
* the instance not found exception
* @throws SesionLlenaException
* the sesion llena except... | Test create compra tarjeta caducada | testCreateCompraTarjetaCaducada | {
"repo_name": "iago-suarez/pojo-cinema-app",
"path": "src/test/java/es/udc/pojo/test/model/compraservice/CompraServiceTest.java",
"license": "gpl-2.0",
"size": 26430
} | [
"es.udc.pojo.model.cine.Cine",
"es.udc.pojo.model.pelicula.Pelicula",
"es.udc.pojo.model.provincia.Provincia",
"es.udc.pojo.model.sala.Sala",
"es.udc.pojo.model.sesion.Sesion",
"es.udc.pojo.model.userprofile.TipoUsuario",
"es.udc.pojo.model.userprofile.UserProfile",
"es.udc.pojo.model.userservice.util... | import es.udc.pojo.model.cine.Cine; import es.udc.pojo.model.pelicula.Pelicula; import es.udc.pojo.model.provincia.Provincia; import es.udc.pojo.model.sala.Sala; import es.udc.pojo.model.sesion.Sesion; import es.udc.pojo.model.userprofile.TipoUsuario; import es.udc.pojo.model.userprofile.UserProfile; import es.udc.pojo... | import es.udc.pojo.model.cine.*; import es.udc.pojo.model.pelicula.*; import es.udc.pojo.model.provincia.*; import es.udc.pojo.model.sala.*; import es.udc.pojo.model.sesion.*; import es.udc.pojo.model.userprofile.*; import es.udc.pojo.model.userservice.util.*; import es.udc.pojo.model.util.*; import es.udc.pojo.modelut... | [
"es.udc.pojo",
"java.util",
"org.junit"
] | es.udc.pojo; java.util; org.junit; | 518,216 |
static private void mergeSortHelp(ArrayList<Integer> unsorted, int lowerBoundIndex, int upperBoundIndex, Order order){
if (lowerBoundIndex < upperBoundIndex) {
int middleIndex = (int) Math.floor((lowerBoundIndex + upperBoundIndex)/2.0);
mergeSortHelp(unsorted, lowerBoundIndex, middle... | static void function(ArrayList<Integer> unsorted, int lowerBoundIndex, int upperBoundIndex, Order order){ if (lowerBoundIndex < upperBoundIndex) { int middleIndex = (int) Math.floor((lowerBoundIndex + upperBoundIndex)/2.0); mergeSortHelp(unsorted, lowerBoundIndex, middleIndex, order); mergeSortHelp(unsorted, (middleInd... | /**
* A helper method for mergeSort.
* @param unsorted An unsorted ArrayList of integers.
* @param lowerBoundIndex Start index of current sort operation.
* @param upperBoundIndex End index of current sort operation.
* @param order Sort in increasing or decreasing order.
*/ | A helper method for mergeSort | mergeSortHelp | {
"repo_name": "Z-Foster/clrs-java",
"path": "src/clrs_section/Foundations.java",
"license": "mit",
"size": 12197
} | [
"java.util.ArrayList"
] | import java.util.ArrayList; | import java.util.*; | [
"java.util"
] | java.util; | 1,459,913 |
private void handleOutdatePresence() {
for (Workgroup workgroup : getWorkgroups()) {
for (AgentSession agentSession : workgroup.getAgentSessions()) {
final JID agentJID = agentSession.getJID();
final PresenceManager presenceManager = XMPPServer.getInstance().getPr... | void function() { for (Workgroup workgroup : getWorkgroups()) { for (AgentSession agentSession : workgroup.getAgentSessions()) { final JID agentJID = agentSession.getJID(); final PresenceManager presenceManager = XMPPServer.getInstance().getPresenceManager(); boolean isOnline = false; for (Presence presence : presenceM... | /**
* Checks for outdated presences caused by network failures, etc.
*/ | Checks for outdated presences caused by network failures, etc | handleOutdatePresence | {
"repo_name": "wudingli/openfire",
"path": "src/plugins/fastpath/src/java/org/jivesoftware/xmpp/workgroup/WorkgroupManager.java",
"license": "apache-2.0",
"size": 37809
} | [
"org.jivesoftware.openfire.PresenceManager",
"org.jivesoftware.openfire.XMPPServer",
"org.xmpp.packet.Presence"
] | import org.jivesoftware.openfire.PresenceManager; import org.jivesoftware.openfire.XMPPServer; import org.xmpp.packet.Presence; | import org.jivesoftware.openfire.*; import org.xmpp.packet.*; | [
"org.jivesoftware.openfire",
"org.xmpp.packet"
] | org.jivesoftware.openfire; org.xmpp.packet; | 1,064,841 |
public void takeInAccountKidAtTheEnd() {
Team kidAtTheEndTeam = this.game.getTeamWithKidAtTheEnd();
if (kidAtTheEndTeam != null) {
// base kid at the end points
int baseKidAtTheEndPoints = this.kidAtTheEndPoints * this.getBetRate();
// attack got the kid at the end => attack takes nbPlayers x ba... | void function() { Team kidAtTheEndTeam = this.game.getTeamWithKidAtTheEnd(); if (kidAtTheEndTeam != null) { int baseKidAtTheEndPoints = this.kidAtTheEndPoints * this.getBetRate(); int attackKidAtTheEndPoints = ( kidAtTheEndTeam == Team.LEADING_TEAM ? baseKidAtTheEndPoints : -baseKidAtTheEndPoints ); if (this.game.isLea... | /**
* Alters the score of each player with kid at the end points.
*/ | Alters the score of each player with kid at the end points | takeInAccountKidAtTheEnd | {
"repo_name": "daffycricket/tarotdroid",
"path": "tarotDroidBiz/src/main/java/org/nla/tarotdroid/biz/computers/StandardTarot5GameScoresComputer.java",
"license": "gpl-2.0",
"size": 15300
} | [
"org.nla.tarotdroid.biz.Player",
"org.nla.tarotdroid.biz.Team"
] | import org.nla.tarotdroid.biz.Player; import org.nla.tarotdroid.biz.Team; | import org.nla.tarotdroid.biz.*; | [
"org.nla.tarotdroid"
] | org.nla.tarotdroid; | 210,682 |
private Map<String, Object> getNoGroup( Locale locale )
{
FeatureGroup noGroup = new FeatureGroup( );
noGroup.setLocale( locale );
noGroup.setId( NO_GROUP_ID );
noGroup.setOrder( NO_GROUP_ORDER );
noGroup.setDescriptionKey( NO_GROUP_DESCRIPTION );
noGroup.setLabel... | Map<String, Object> function( Locale locale ) { FeatureGroup noGroup = new FeatureGroup( ); noGroup.setLocale( locale ); noGroup.setId( NO_GROUP_ID ); noGroup.setOrder( NO_GROUP_ORDER ); noGroup.setDescriptionKey( NO_GROUP_DESCRIPTION ); noGroup.setLabelKey( NO_GROUP_LABEL ); Map<String, Object> groupMap = new HashMap<... | /**
* Generate a combo containing all available groups
*
* @param locale
* The locale
* @return the reference list of feature groups
*/ | Generate a combo containing all available groups | getNoGroup | {
"repo_name": "lutece-platform/lutece-core",
"path": "src/java/fr/paris/lutece/portal/web/features/FeaturesAdminDashboardComponent.java",
"license": "bsd-3-clause",
"size": 6834
} | [
"fr.paris.lutece.portal.business.right.FeatureGroup",
"fr.paris.lutece.portal.business.right.RightHome",
"fr.paris.lutece.portal.service.i18n.I18nService",
"java.util.HashMap",
"java.util.Locale",
"java.util.Map"
] | import fr.paris.lutece.portal.business.right.FeatureGroup; import fr.paris.lutece.portal.business.right.RightHome; import fr.paris.lutece.portal.service.i18n.I18nService; import java.util.HashMap; import java.util.Locale; import java.util.Map; | import fr.paris.lutece.portal.business.right.*; import fr.paris.lutece.portal.service.i18n.*; import java.util.*; | [
"fr.paris.lutece",
"java.util"
] | fr.paris.lutece; java.util; | 1,170,662 |
public Optional<List<? extends ReadOnlyPerson>> getRelevantPersons() {
return Optional.ofNullable(relevantPersons);
} | Optional<List<? extends ReadOnlyPerson>> function() { return Optional.ofNullable(relevantPersons); } | /**
* Returns list of persons relevant to the command command result, if any.
*/ | Returns list of persons relevant to the command command result, if any | getRelevantPersons | {
"repo_name": "zachylimwl/addressbook-level2",
"path": "src/seedu/addressbook/commands/CommandResult.java",
"license": "mit",
"size": 1151
} | [
"java.util.List",
"java.util.Optional"
] | import java.util.List; import java.util.Optional; | import java.util.*; | [
"java.util"
] | java.util; | 1,714,674 |
private void compile(HierarchicalConfiguration cfg,
String namespace, Group parentGroup) {
String opfx = pfx;
pfx = pfx + ">";
print("pfx=%s namespace=%s", pfx, namespace);
// Scan all imports
cfg.configurationsAt(IMPORT)
.forEach(c -... | void function(HierarchicalConfiguration cfg, String namespace, Group parentGroup) { String opfx = pfx; pfx = pfx + ">"; print(STR, pfx, namespace); cfg.configurationsAt(IMPORT) .forEach(c -> processImport(c, namespace, parentGroup)); cfg.configurationsAt(STEP) .forEach(c -> processStep(c, namespace, parentGroup)); cfg.... | /**
* Recursively elaborates this definition to produce a final process flow graph.
*
* @param cfg hierarchical definition
* @param namespace optional namespace
* @param parentGroup optional parent group
*/ | Recursively elaborates this definition to produce a final process flow graph | compile | {
"repo_name": "kuangrewawa/OnosFw",
"path": "utils/stc/src/main/java/org/onlab/stc/Compiler.java",
"license": "apache-2.0",
"size": 16429
} | [
"org.apache.commons.configuration.HierarchicalConfiguration"
] | import org.apache.commons.configuration.HierarchicalConfiguration; | import org.apache.commons.configuration.*; | [
"org.apache.commons"
] | org.apache.commons; | 2,481,229 |
public static TimerUpdate empty() {
return new TimerUpdate(
null,
Collections.<TimerData>emptyList(),
Collections.<TimerData>emptyList(),
Collections.<TimerData>emptyList());
} | static TimerUpdate function() { return new TimerUpdate( null, Collections.<TimerData>emptyList(), Collections.<TimerData>emptyList(), Collections.<TimerData>emptyList()); } | /**
* Returns a TimerUpdate for a null key with no timers.
*/ | Returns a TimerUpdate for a null key with no timers | empty | {
"repo_name": "yafengguo/Apache-beam",
"path": "runners/direct-java/src/main/java/org/apache/beam/runners/direct/WatermarkManager.java",
"license": "apache-2.0",
"size": 56507
} | [
"java.util.Collections",
"org.apache.beam.sdk.util.TimerInternals"
] | import java.util.Collections; import org.apache.beam.sdk.util.TimerInternals; | import java.util.*; import org.apache.beam.sdk.util.*; | [
"java.util",
"org.apache.beam"
] | java.util; org.apache.beam; | 601,659 |
@SuppressWarnings({"unchecked"})
@Nullable private <V> V getThreadContext(GridTaskThreadContextKey key) {
return thCtx == null ? null : (V)thCtx.get(key);
} | @SuppressWarnings({STR}) @Nullable <V> V function(GridTaskThreadContextKey key) { return thCtx == null ? null : (V)thCtx.get(key); } | /**
* Gets value from thread-local context.
*
* @param key Thread-local context key.
* @return Thread-local context value, if any.
*/ | Gets value from thread-local context | getThreadContext | {
"repo_name": "agura/incubator-ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskWorker.java",
"license": "apache-2.0",
"size": 52943
} | [
"org.jetbrains.annotations.Nullable"
] | import org.jetbrains.annotations.Nullable; | import org.jetbrains.annotations.*; | [
"org.jetbrains.annotations"
] | org.jetbrains.annotations; | 997,368 |
void onRstStreamRead(ChannelHandlerContext ctx, int streamId, long errorCode) throws Http2Exception; | void onRstStreamRead(ChannelHandlerContext ctx, int streamId, long errorCode) throws Http2Exception; | /**
* Handles an inbound {@code RST_STREAM} frame.
*
* @param ctx the context from the handler where the frame was read.
* @param streamId the stream that is terminating.
* @param errorCode the error code identifying the type of failure.
*/ | Handles an inbound RST_STREAM frame | onRstStreamRead | {
"repo_name": "wuyinxian124/netty",
"path": "codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameListener.java",
"license": "apache-2.0",
"size": 11088
} | [
"io.netty.channel.ChannelHandlerContext"
] | import io.netty.channel.ChannelHandlerContext; | import io.netty.channel.*; | [
"io.netty.channel"
] | io.netty.channel; | 2,135,054 |
private List<INode> loadDeletedList(final List<INodeReference> refList,
InputStream in, INodeDirectory dir, List<Long> deletedNodes,
List<Integer> deletedRefNodes)
throws IOException {
List<INode> dlist = new ArrayList<INode>(deletedRefNodes.size()
+ deletedNodes.size());
... | List<INode> function(final List<INodeReference> refList, InputStream in, INodeDirectory dir, List<Long> deletedNodes, List<Integer> deletedRefNodes) throws IOException { List<INode> dlist = new ArrayList<INode>(deletedRefNodes.size() + deletedNodes.size()); for (long deletedId : deletedNodes) { INode deleted = fsDir.ge... | /**
* Load the deleted list in a DirectoryDiff
*/ | Load the deleted list in a DirectoryDiff | loadDeletedList | {
"repo_name": "cnfire/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/snapshot/FSImageFormatPBSnapshot.java",
"license": "apache-2.0",
"size": 25207
} | [
"java.io.IOException",
"java.io.InputStream",
"java.util.ArrayList",
"java.util.List",
"org.apache.hadoop.hdfs.server.namenode.INode",
"org.apache.hadoop.hdfs.server.namenode.INodeDirectory",
"org.apache.hadoop.hdfs.server.namenode.INodeReference"
] | import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import org.apache.hadoop.hdfs.server.namenode.INode; import org.apache.hadoop.hdfs.server.namenode.INodeDirectory; import org.apache.hadoop.hdfs.server.namenode.INodeReference; | import java.io.*; import java.util.*; import org.apache.hadoop.hdfs.server.namenode.*; | [
"java.io",
"java.util",
"org.apache.hadoop"
] | java.io; java.util; org.apache.hadoop; | 1,925,920 |
private void appendColumns(Element tableNode, Table table) {
for (TableColumn column : table.getColumns()) {
appendColumn(tableNode, column);
}
}
| void function(Element tableNode, Table table) { for (TableColumn column : table.getColumns()) { appendColumn(tableNode, column); } } | /**
* Append all columns in the table to the XML node
*
* @param tableNode
* @param table
*/ | Append all columns in the table to the XML node | appendColumns | {
"repo_name": "su-kun1899/schemaspy-maven-plugin",
"path": "src/main/java/net/sourceforge/schemaspy/view/XmlTableFormatter.java",
"license": "lgpl-3.0",
"size": 11867
} | [
"net.sourceforge.schemaspy.model.Table",
"net.sourceforge.schemaspy.model.TableColumn",
"org.w3c.dom.Element"
] | import net.sourceforge.schemaspy.model.Table; import net.sourceforge.schemaspy.model.TableColumn; import org.w3c.dom.Element; | import net.sourceforge.schemaspy.model.*; import org.w3c.dom.*; | [
"net.sourceforge.schemaspy",
"org.w3c.dom"
] | net.sourceforge.schemaspy; org.w3c.dom; | 350,000 |
private GuideModel getModel(IGuide guide)
{
GuideModel model;
if (guide == selectedGuide && viewModel != null)
{
model = viewModel;
} else
{
model = navigationModel;
navigationModel.setGuide(guide);
}
retu... | GuideModel function(IGuide guide) { GuideModel model; if (guide == selectedGuide && viewModel != null) { model = viewModel; } else { model = navigationModel; navigationModel.setGuide(guide); } return model; } | /**
* Returns mode initialized for the guide.
*
* @param guide guide.
*
* @return model.
*/ | Returns mode initialized for the guide | getModel | {
"repo_name": "pitosalas/blogbridge",
"path": "src/com/salas/bb/core/NavigatorAdv.java",
"license": "gpl-2.0",
"size": 16643
} | [
"com.salas.bb.domain.IGuide"
] | import com.salas.bb.domain.IGuide; | import com.salas.bb.domain.*; | [
"com.salas.bb"
] | com.salas.bb; | 2,249,452 |
@Override
protected Entry findEvictionCandidate() {
Entry hand = handCold;
if (hotSize > getHotMax() || hand == null) {
return runHandHot();
}
coldRunCnt++;
int scanCnt = 1;
if (hand.hitCnt > 0) {
Entry evictFromHot = null;
do {
if (hotSize >= getHotMax() && handHot... | Entry function() { Entry hand = handCold; if (hotSize > getHotMax() hand == null) { return runHandHot(); } coldRunCnt++; int scanCnt = 1; if (hand.hitCnt > 0) { Entry evictFromHot = null; do { if (hotSize >= getHotMax() && handHot != null) { evictFromHot = runHandHot(); } coldHits += hand.hitCnt; Entry e = hand; hand =... | /**
* Runs cold hand an in turn hot hand to find eviction candidate.
*/ | Runs cold hand an in turn hot hand to find eviction candidate | findEvictionCandidate | {
"repo_name": "headissue/cache2k",
"path": "cache2k-core/src/main/java/org/cache2k/core/eviction/ClockProPlusEviction.java",
"license": "gpl-3.0",
"size": 13525
} | [
"org.cache2k.core.Entry"
] | import org.cache2k.core.Entry; | import org.cache2k.core.*; | [
"org.cache2k.core"
] | org.cache2k.core; | 1,451,687 |
public Folder initFolderService(
ActionRequest actionRequest, ThemeDisplay themeDisplay) {
// Folder contains template service files
String dateFolderName = DateTimeUtil.getStringDate();
Folder folder = null;
try {
// Check ROOT folder exist
long rootFolderId = 0;
long parentFolderId = 0;... | Folder function( ActionRequest actionRequest, ThemeDisplay themeDisplay) { String dateFolderName = DateTimeUtil.getStringDate(); Folder folder = null; try { long rootFolderId = 0; long parentFolderId = 0; boolean isRootFolderExist = isFolderExist( themeDisplay.getScopeGroupId(), 0, ROOT_FOLDER_NAME); ServiceContext ser... | /**
* Create tree folder. Return folder contains template files
*
* @param actionRequest
* @param themeDisplay
* @return
*/ | Create tree folder. Return folder contains template files | initFolderService | {
"repo_name": "tuanta/opencps",
"path": "portlets/opencps-portlet/docroot/WEB-INF/src/org/opencps/servicemgt/portlet/ServiceMgtPortlet.java",
"license": "agpl-3.0",
"size": 16010
} | [
"com.liferay.portal.kernel.repository.model.Folder",
"com.liferay.portal.service.ServiceContext",
"com.liferay.portal.service.ServiceContextFactory",
"com.liferay.portal.theme.ThemeDisplay",
"com.liferay.portlet.documentlibrary.service.DLAppServiceUtil",
"javax.portlet.ActionRequest",
"org.opencps.util.... | import com.liferay.portal.kernel.repository.model.Folder; import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.ServiceContextFactory; import com.liferay.portal.theme.ThemeDisplay; import com.liferay.portlet.documentlibrary.service.DLAppServiceUtil; import javax.portlet.ActionRequest; impo... | import com.liferay.portal.kernel.repository.model.*; import com.liferay.portal.service.*; import com.liferay.portal.theme.*; import com.liferay.portlet.documentlibrary.service.*; import javax.portlet.*; import org.opencps.util.*; | [
"com.liferay.portal",
"com.liferay.portlet",
"javax.portlet",
"org.opencps.util"
] | com.liferay.portal; com.liferay.portlet; javax.portlet; org.opencps.util; | 2,780,630 |
public void setParameterDescription(ParameterDescription v) throws TorqueException
{
if (v == null)
{
setParameterKey((String)null);
}
else
{
setParameterKey(v.getParameterKey());
}
aParameterDescripti... | void function(ParameterDescription v) throws TorqueException { if (v == null) { setParameterKey((String)null); } else { setParameterKey(v.getParameterKey()); } aParameterDescription = v; } | /**
* Declares an association between this object and a ParameterDescription object
*
* @param v ParameterDescription
* @throws TorqueException
*/ | Declares an association between this object and a ParameterDescription object | setParameterDescription | {
"repo_name": "jrtex/primeTime",
"path": "pt/src/main/java/de/vahrson/pt/om/BaseParameter.java",
"license": "gpl-2.0",
"size": 14741
} | [
"org.apache.torque.TorqueException"
] | import org.apache.torque.TorqueException; | import org.apache.torque.*; | [
"org.apache.torque"
] | org.apache.torque; | 2,056,689 |
@SqlQuery("SELECT resource_group_id\n" +
"FROM exact_match_source_selectors\n" +
"WHERE source = :source\n" +
" AND (environment = :environment OR environment IS NULL)\n" +
" AND (query_type = :query_type OR query_type IS NULL)\n" +
"ORDER BY environment... | @SqlQuery(STR + STR + STR + STR + STR + STR + STR) String getExactMatchResourceGroup( @Bind(STR) String environment, @Bind(STR) String source, @Bind(STR) String queryType); | /**
* Returns the most specific exact-match selector for a given environment, source and query type.
* NULL values in the environment and query type fields signify wildcards.
*/ | Returns the most specific exact-match selector for a given environment, source and query type. NULL values in the environment and query type fields signify wildcards | getExactMatchResourceGroup | {
"repo_name": "haozhun/presto",
"path": "presto-resource-group-managers/src/main/java/com/facebook/presto/resourceGroups/db/ResourceGroupsDao.java",
"license": "apache-2.0",
"size": 5375
} | [
"org.jdbi.v3.sqlobject.customizer.Bind",
"org.jdbi.v3.sqlobject.statement.SqlQuery"
] | import org.jdbi.v3.sqlobject.customizer.Bind; import org.jdbi.v3.sqlobject.statement.SqlQuery; | import org.jdbi.v3.sqlobject.customizer.*; import org.jdbi.v3.sqlobject.statement.*; | [
"org.jdbi.v3"
] | org.jdbi.v3; | 1,404,799 |
private void openExternalDataSource(String typeName) {
logger.debug("openExternalDataSource : " + typeName);
if (externalDataSource == null) {
ConsoleManager.getInstance().error(this, "No external data source creation object set");
} else {
List<DataSourceInfo> dataS... | void function(String typeName) { logger.debug(STR + typeName); if (externalDataSource == null) { ConsoleManager.getInstance().error(this, STR); } else { List<DataSourceInfo> dataSourceInfoList = externalDataSource.connect(typeName, null, this.editorFileInterface); if ((dataSourceInfoList != null) && (dataSourceInfoList... | /**
* Open external data source.
*
* @param typeName the type name
*/ | Open external data source | openExternalDataSource | {
"repo_name": "robward-scisys/sldeditor",
"path": "modules/application/src/main/java/com/sldeditor/datasource/impl/DataSourceImpl.java",
"license": "gpl-3.0",
"size": 24055
} | [
"com.sldeditor.common.SLDDataInterface",
"com.sldeditor.common.console.ConsoleManager",
"com.sldeditor.datasource.attribute.DataSourceAttributeList",
"java.util.List"
] | import com.sldeditor.common.SLDDataInterface; import com.sldeditor.common.console.ConsoleManager; import com.sldeditor.datasource.attribute.DataSourceAttributeList; import java.util.List; | import com.sldeditor.common.*; import com.sldeditor.common.console.*; import com.sldeditor.datasource.attribute.*; import java.util.*; | [
"com.sldeditor.common",
"com.sldeditor.datasource",
"java.util"
] | com.sldeditor.common; com.sldeditor.datasource; java.util; | 1,642,801 |
public static DiscoverInfo getDiscoverInfoByUser(String user) {
NodeVerHash nvh = jidCaps.get(user);
if (nvh == null)
return null;
return getDiscoveryInfoByNodeVer(nvh.nodeVer);
} | static DiscoverInfo function(String user) { NodeVerHash nvh = jidCaps.get(user); if (nvh == null) return null; return getDiscoveryInfoByNodeVer(nvh.nodeVer); } | /**
* Get the discover info given a user name. The discover info is returned if
* the user has a node#ver associated with it and the node#ver has a
* discover info associated with it.
*
* @param user
* user name (Full JID)
* @return the discovered info
*/ | Get the discover info given a user name. The discover info is returned if the user has a node#ver associated with it and the node#ver has a discover info associated with it | getDiscoverInfoByUser | {
"repo_name": "yiyiboy2010/androidpn-client",
"path": "smack/org/jivesoftware/smackx/entitycaps/EntityCapsManager.java",
"license": "apache-2.0",
"size": 25248
} | [
"org.jivesoftware.smackx.packet.DiscoverInfo"
] | import org.jivesoftware.smackx.packet.DiscoverInfo; | import org.jivesoftware.smackx.packet.*; | [
"org.jivesoftware.smackx"
] | org.jivesoftware.smackx; | 1,637,700 |
String acquire(long leaseTime, TimeUnit unit) throws InterruptedException;
/**
* Tries to acquire currently available permit and return its id.
*
* @return permit id if a permit was acquired and {@code null} | String acquire(long leaseTime, TimeUnit unit) throws InterruptedException; /** * Tries to acquire currently available permit and return its id. * * @return permit id if a permit was acquired and {@code null} | /**
* Acquires a permit with defined <code>leaseTime</code> and return its id.
* Waits if necessary until a permit became available.
*
* @param leaseTime permit lease time
* @param unit time unit
* @return permit id
* @throws InterruptedException if the current thread is interrupted
... | Acquires a permit with defined <code>leaseTime</code> and return its id. Waits if necessary until a permit became available | acquire | {
"repo_name": "mrniko/redisson",
"path": "redisson/src/main/java/org/redisson/api/RPermitExpirableSemaphore.java",
"license": "apache-2.0",
"size": 4830
} | [
"java.util.concurrent.TimeUnit"
] | import java.util.concurrent.TimeUnit; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 67,273 |
public void remCards(List<Long> ids) {
remCards(ids, true);
} | void function(List<Long> ids) { remCards(ids, true); } | /**
* Bulk delete cards by ID.
*/ | Bulk delete cards by ID | remCards | {
"repo_name": "donald-w/Anki-Android",
"path": "AnkiDroid/src/main/java/com/ichi2/libanki/Collection.java",
"license": "gpl-3.0",
"size": 89072
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,080,856 |
private void caseClause(final Tree.CaseClause cc, String expvar, final Tree.Term switchTerm) {
gen.out("if(");
final Tree.CaseItem item = cc.getCaseItem();
Tree.Variable caseVar = null;
Value caseDec = null;
if (item instanceof IsCase) {
IsCase isCaseItem = (IsCas... | void function(final Tree.CaseClause cc, String expvar, final Tree.Term switchTerm) { gen.out("if("); final Tree.CaseItem item = cc.getCaseItem(); Tree.Variable caseVar = null; Value caseDec = null; if (item instanceof IsCase) { IsCase isCaseItem = (IsCase) item; gen.generateIsOfType(item, expvar, isCaseItem.getType().g... | /** Generates code for a case clause, as part of a switch statement. Each case
* is rendered as an if. */ | Generates code for a case clause, as part of a switch statement. Each case | caseClause | {
"repo_name": "ceylon/ceylon-js",
"path": "src/main/java/com/redhat/ceylon/compiler/js/ConditionGenerator.java",
"license": "apache-2.0",
"size": 23025
} | [
"com.redhat.ceylon.common.Backend",
"com.redhat.ceylon.compiler.typechecker.tree.Tree",
"com.redhat.ceylon.model.typechecker.model.ModelUtil",
"com.redhat.ceylon.model.typechecker.model.Value",
"java.util.Collections",
"java.util.Set"
] | import com.redhat.ceylon.common.Backend; import com.redhat.ceylon.compiler.typechecker.tree.Tree; import com.redhat.ceylon.model.typechecker.model.ModelUtil; import com.redhat.ceylon.model.typechecker.model.Value; import java.util.Collections; import java.util.Set; | import com.redhat.ceylon.common.*; import com.redhat.ceylon.compiler.typechecker.tree.*; import com.redhat.ceylon.model.typechecker.model.*; import java.util.*; | [
"com.redhat.ceylon",
"java.util"
] | com.redhat.ceylon; java.util; | 2,478,700 |
public static LocalIncomingServerSession createSession(String serverName, XMPPPacketReader reader,
SocketConnection connection) throws XmlPullParserException, IOException {
XmlPullParser xpp = reader.getXPPParser();
String version = xpp.getAttributeValue("", "version... | static LocalIncomingServerSession function(String serverName, XMPPPacketReader reader, SocketConnection connection) throws XmlPullParserException, IOException { XmlPullParser xpp = reader.getXPPParser(); String version = xpp.getAttributeValue(STRversionSTR<stream:streamSTR xmlns:db=\STRSTR xmlns:stream=\STR xmlns=\STRS... | /**
* Creates a new session that will receive packets. The new session will be authenticated
* before being returned. If the authentication process fails then the answer will be
* <tt>null</tt>.<p>
*
* @param serverName hostname of this server.
* @param reader reader on the new estab... | Creates a new session that will receive packets. The new session will be authenticated before being returned. If the authentication process fails then the answer will be null | createSession | {
"repo_name": "mhd911/openfire",
"path": "src/java/org/jivesoftware/openfire/session/LocalIncomingServerSession.java",
"license": "apache-2.0",
"size": 17105
} | [
"java.io.IOException",
"org.dom4j.io.XMPPPacketReader",
"org.jivesoftware.openfire.Connection",
"org.jivesoftware.openfire.StreamID",
"org.jivesoftware.openfire.net.SocketConnection",
"org.xmlpull.v1.XmlPullParser",
"org.xmlpull.v1.XmlPullParserException"
] | import java.io.IOException; import org.dom4j.io.XMPPPacketReader; import org.jivesoftware.openfire.Connection; import org.jivesoftware.openfire.StreamID; import org.jivesoftware.openfire.net.SocketConnection; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; | import java.io.*; import org.dom4j.io.*; import org.jivesoftware.openfire.*; import org.jivesoftware.openfire.net.*; import org.xmlpull.v1.*; | [
"java.io",
"org.dom4j.io",
"org.jivesoftware.openfire",
"org.xmlpull.v1"
] | java.io; org.dom4j.io; org.jivesoftware.openfire; org.xmlpull.v1; | 1,270,946 |
public String getAuthType()
{
Object login = getAttribute(AbstractLogin.LOGIN_NAME);
if (login instanceof X509Certificate)
return HttpServletRequest.CLIENT_CERT_AUTH;
WebApp app = getWebApp();
if (app != null && app.getLogin() != null && getUserPrincipal() != null)
return app.getLogin... | String function() { Object login = getAttribute(AbstractLogin.LOGIN_NAME); if (login instanceof X509Certificate) return HttpServletRequest.CLIENT_CERT_AUTH; WebApp app = getWebApp(); if (app != null && app.getLogin() != null && getUserPrincipal() != null) return app.getLogin().getAuthType(); else return null; } | /**
* Gets the authorization type
*/ | Gets the authorization type | getAuthType | {
"repo_name": "christianchristensen/resin",
"path": "modules/resin/src/com/caucho/server/http/HttpServletRequestImpl.java",
"license": "gpl-2.0",
"size": 55697
} | [
"com.caucho.security.AbstractLogin",
"com.caucho.server.webapp.WebApp",
"java.security.cert.X509Certificate",
"javax.servlet.http.HttpServletRequest"
] | import com.caucho.security.AbstractLogin; import com.caucho.server.webapp.WebApp; import java.security.cert.X509Certificate; import javax.servlet.http.HttpServletRequest; | import com.caucho.security.*; import com.caucho.server.webapp.*; import java.security.cert.*; import javax.servlet.http.*; | [
"com.caucho.security",
"com.caucho.server",
"java.security",
"javax.servlet"
] | com.caucho.security; com.caucho.server; java.security; javax.servlet; | 311,217 |
public void setMultipartUploads(List<MultipartUpload> multipartUploads) {
this.multipartUploads = multipartUploads;
} | void function(List<MultipartUpload> multipartUploads) { this.multipartUploads = multipartUploads; } | /**
* Sets the list of multipart uploads.
*
* @param multipartUploads
* The list of multipart uploads.
*/ | Sets the list of multipart uploads | setMultipartUploads | {
"repo_name": "loremipsumdolor/CastFast",
"path": "src/com/amazonaws/services/s3/model/MultipartUploadListing.java",
"license": "mit",
"size": 14532
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 521,583 |
List<String> getExtraStackDefinitionsUrls(); | List<String> getExtraStackDefinitionsUrls(); | /**
* Urls for extra stack definitions e.g. Kerberos
*
* @return List of Strings of form http://host/def.tar.gz
*/ | Urls for extra stack definitions e.g. Kerberos | getExtraStackDefinitionsUrls | {
"repo_name": "brooklyncentral/brooklyn-ambari",
"path": "ambari/src/main/java/io/brooklyn/ambari/AmbariCluster.java",
"license": "apache-2.0",
"size": 12555
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 280,423 |
public static RecipeManaInfusion registerManaAlchemyRecipe(ItemStack output, Object input, int mana) {
RecipeManaInfusion recipe = registerManaInfusionRecipe(output, input, mana);
recipe.setAlchemy(true);
return recipe;
} | static RecipeManaInfusion function(ItemStack output, Object input, int mana) { RecipeManaInfusion recipe = registerManaInfusionRecipe(output, input, mana); recipe.setAlchemy(true); return recipe; } | /**
* Register a Mana Infusion Recipe and flags it as an Alchemy recipe (requires an
* Alchemy Catalyst below the pool).
* @see BotaniaAPI#registerManaInfusionRecipe
*/ | Register a Mana Infusion Recipe and flags it as an Alchemy recipe (requires an Alchemy Catalyst below the pool) | registerManaAlchemyRecipe | {
"repo_name": "TGMP/ModularArmour",
"path": "src/api/java/vazkii/botania/api/BotaniaAPI.java",
"license": "gpl-3.0",
"size": 18107
} | [
"net.minecraft.item.ItemStack"
] | import net.minecraft.item.ItemStack; | import net.minecraft.item.*; | [
"net.minecraft.item"
] | net.minecraft.item; | 1,182,858 |
public static void SetText (String text)
{
gWnd.fTxtOutput.setText (text);
}
private static final long serialVersionUID = -3713894035663997050L;
private JPanel contentPane;
private JTextArea fTxtOutput;
public TWndDebug ()
... | static void function (String text) { gWnd.fTxtOutput.setText (text); } private static final long serialVersionUID = -3713894035663997050L; private JPanel contentPane; private JTextArea fTxtOutput; public TWndDebug () { setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); setTitle("Debug"); setBounds (100, 100, 700, 73... | /**
* Set the window's text content.
*
* @param text The test to set - which means, the statistics dump.
*/ | Set the window's text content | SetText | {
"repo_name": "ustegrew/ppm-java",
"path": "src/ppm_java/util/debug/TWndDebug.java",
"license": "gpl-3.0",
"size": 2927
} | [
"java.awt.BorderLayout",
"java.awt.Font",
"javax.swing.JFrame",
"javax.swing.JPanel",
"javax.swing.JScrollPane",
"javax.swing.JTextArea",
"javax.swing.ScrollPaneConstants",
"javax.swing.border.EmptyBorder"
] | import java.awt.BorderLayout; import java.awt.Font; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.ScrollPaneConstants; import javax.swing.border.EmptyBorder; | import java.awt.*; import javax.swing.*; import javax.swing.border.*; | [
"java.awt",
"javax.swing"
] | java.awt; javax.swing; | 1,367,666 |
Set<String> searchArtifactsByPattern(String pattern) throws ExecutionException, InterruptedException,
TimeoutException; | Set<String> searchArtifactsByPattern(String pattern) throws ExecutionException, InterruptedException, TimeoutException; | /**
* Search for artifacts within a repository matching a given pattern.<br> The pattern should be like
* repo-key:this/is/a/pattern
*
* @param pattern Pattern to search for
* @return Set of matching artifact paths relative to the repo
*/ | Search for artifacts within a repository matching a given pattern. The pattern should be like repo-key:this/is/a/pattern | searchArtifactsByPattern | {
"repo_name": "alancnet/artifactory",
"path": "base/api/src/main/java/org/artifactory/api/search/SearchService.java",
"license": "apache-2.0",
"size": 4991
} | [
"java.util.Set",
"java.util.concurrent.ExecutionException",
"java.util.concurrent.TimeoutException"
] | import java.util.Set; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeoutException; | import java.util.*; import java.util.concurrent.*; | [
"java.util"
] | java.util; | 2,485,743 |
@Test
@Transactional
public void testQBeanUsage() {
SQLQuery<?> query = query();
QTestPerson testPerson = QTestPerson.testPerson;
PathBuilder<Object[]> sq = new PathBuilder<Object[]>(Object[].class, "sq");
SQLQuery<TestPersonVO> select = query.from(new QTestPerson("sq")).... | void function() { SQLQuery<?> query = query(); QTestPerson testPerson = QTestPerson.testPerson; PathBuilder<Object[]> sq = new PathBuilder<Object[]>(Object[].class, "sq"); SQLQuery<TestPersonVO> select = query.from(new QTestPerson("sq")).select( Projections.bean(TestPersonVO.class, Collections.singletonMap("name", sq.g... | /**
* <pre>
* select "sq"."NAME" from "TEST_PERSON" "sq"
* </pre>
*/ | <code> select "sq"."NAME" from "TEST_PERSON" "sq" </code> | testQBeanUsage | {
"repo_name": "csc19601128/misc-examples",
"path": "querydsl/src/test/java/org/csc/phynixx/sqlquery/querydsl/H2DatabaseSQLTest.java",
"license": "apache-2.0",
"size": 33333
} | [
"com.querydsl.core.types.Projections",
"com.querydsl.core.types.dsl.PathBuilder",
"com.querydsl.sql.SQLQuery",
"java.util.Collections",
"java.util.List",
"org.csc.phynixx.sqlquery.legacy.beans.TestPersonVO",
"org.csc.phynixx.sqlquery.querydsl.legacy.QTestPerson"
] | import com.querydsl.core.types.Projections; import com.querydsl.core.types.dsl.PathBuilder; import com.querydsl.sql.SQLQuery; import java.util.Collections; import java.util.List; import org.csc.phynixx.sqlquery.legacy.beans.TestPersonVO; import org.csc.phynixx.sqlquery.querydsl.legacy.QTestPerson; | import com.querydsl.core.types.*; import com.querydsl.core.types.dsl.*; import com.querydsl.sql.*; import java.util.*; import org.csc.phynixx.sqlquery.legacy.beans.*; import org.csc.phynixx.sqlquery.querydsl.legacy.*; | [
"com.querydsl.core",
"com.querydsl.sql",
"java.util",
"org.csc.phynixx"
] | com.querydsl.core; com.querydsl.sql; java.util; org.csc.phynixx; | 1,727,425 |
private void validateByRules(InputStream objectAsStream,
String ruleSchemaPath,
String preprocessorPath,
String phase) throws ObjectValidityException,
GeneralException {
try {
DOValida... | void function(InputStream objectAsStream, String ruleSchemaPath, String preprocessorPath, String phase) throws ObjectValidityException, GeneralException { try { DOValidatorSchematron schtron = new DOValidatorSchematron(ruleSchemaPath, preprocessorPath, phase); schtron.validate(objectAsStream); } catch (ObjectValidityEx... | /**
* Do Schematron rules validation on the Fedora object. Schematron
* validation tests the object against a set of rules expressed using XPATH
* in a Schematron schema. These test for things that are beyond what can be
* expressed using XML Schema.
*
* @param objectAsFile
* T... | Do Schematron rules validation on the Fedora object. Schematron validation tests the object against a set of rules expressed using XPATH in a Schematron schema. These test for things that are beyond what can be expressed using XML Schema | validateByRules | {
"repo_name": "hbarnard/fcrepo-phaidra",
"path": "fcrepo-server/src/main/java/org/fcrepo/server/validation/DOValidatorImpl.java",
"license": "apache-2.0",
"size": 18930
} | [
"java.io.InputStream",
"org.fcrepo.server.errors.GeneralException",
"org.fcrepo.server.errors.ObjectValidityException"
] | import java.io.InputStream; import org.fcrepo.server.errors.GeneralException; import org.fcrepo.server.errors.ObjectValidityException; | import java.io.*; import org.fcrepo.server.errors.*; | [
"java.io",
"org.fcrepo.server"
] | java.io; org.fcrepo.server; | 676,426 |
@NotNull String getTableLevel(); | @NotNull String getTableLevel(); | /**
* Returns unique ID of the table. Must not be equal to one the standard levels ("application", "project", "module").
*/ | Returns unique ID of the table. Must not be equal to one the standard levels ("application", "project", "module") | getTableLevel | {
"repo_name": "siosio/intellij-community",
"path": "platform/projectModel-api/src/com/intellij/openapi/roots/libraries/CustomLibraryTableDescription.java",
"license": "apache-2.0",
"size": 1168
} | [
"org.jetbrains.annotations.NotNull"
] | import org.jetbrains.annotations.NotNull; | import org.jetbrains.annotations.*; | [
"org.jetbrains.annotations"
] | org.jetbrains.annotations; | 2,021,313 |
private static final Comparator<Component> RTLComparator = new Comparator<Component>() {
private double getScaledY(Component cmp) {
double y = 0;
while (cmp != null) {
double ratio = cmp.getHeight()/(double)Math.max(cmp.getScrollDimension().getHeight(), cmp.g... | static final Comparator<Component> RTLComparator = new Comparator<Component>() { private double function(Component cmp) { double y = 0; while (cmp != null) { double ratio = cmp.getHeight()/(double)Math.max(cmp.getScrollDimension().getHeight(), cmp.getHeight()); y = ratio * y; y += cmp.getY() + cmp.getScrollY(); cmp = c... | /**
* We can't just use component's AbsoluteY coordinates for ordering because of scrolling,
* so we create a scaled coorindate that will order components properly.
* @param cmp
* @return
*/ | We can't just use component's AbsoluteY coordinates for ordering because of scrolling, so we create a scaled coorindate that will order components properly | getScaledY | {
"repo_name": "codenameone/CodenameOne",
"path": "CodenameOne/src/com/codename1/ui/TextSelection.java",
"license": "gpl-2.0",
"size": 58804
} | [
"java.util.Comparator"
] | import java.util.Comparator; | import java.util.*; | [
"java.util"
] | java.util; | 1,055,732 |
@SuppressWarnings("unchecked")
public Map<String, Object> getProperties()
{
if (this.properties == null)
{
// this Map implements the Scriptable interface for native JS syntax property access
// this impl of the QNameMap is capable of creating ScriptContentData ... | @SuppressWarnings(STR) Map<String, Object> function() { if (this.properties == null) { this.properties = new ContentAwareScriptableQNameMap<String, Serializable>(this, this.services); Map<QName, Serializable> props = null; if (this.nodeInfo != null) { props = this.nodeInfo.getProperties(); } else { props = this.nodeSer... | /**
* Return all the properties known about this node. The Map returned implements the Scriptable interface to
* allow access to the properties via JavaScript associative array access. This means properties of a node can
* be access thus: <code>node.properties["name"]</code>
*
* @return M... | Return all the properties known about this node. The Map returned implements the Scriptable interface to allow access to the properties via JavaScript associative array access. This means properties of a node can be access thus: <code>node.properties["name"]</code> | getProperties | {
"repo_name": "loftuxab/alfresco-community-loftux",
"path": "projects/repository/source/java/org/alfresco/repo/jscript/ScriptNode.java",
"license": "lgpl-3.0",
"size": 164696
} | [
"java.io.Serializable",
"java.util.Map",
"org.alfresco.service.namespace.QName"
] | import java.io.Serializable; import java.util.Map; import org.alfresco.service.namespace.QName; | import java.io.*; import java.util.*; import org.alfresco.service.namespace.*; | [
"java.io",
"java.util",
"org.alfresco.service"
] | java.io; java.util; org.alfresco.service; | 1,460,729 |
final OutputStreamWriter osw = new OutputStreamWriter(oS, "UTF-8");
writer = new PrintWriter(osw);
} | final OutputStreamWriter osw = new OutputStreamWriter(oS, "UTF-8"); writer = new PrintWriter(osw); } | /**
* sets the OutputStream
* @param oS the OutputStream to use
* @throws UnsupportedEncodingException is UTF-8 is not supported
**/ | sets the OutputStream | setOutputStream | {
"repo_name": "naver/checkstyle",
"path": "src/main/java/com/puppycrawl/tools/checkstyle/XMLLogger.java",
"license": "lgpl-2.1",
"size": 7683
} | [
"java.io.OutputStreamWriter",
"java.io.PrintWriter"
] | import java.io.OutputStreamWriter; import java.io.PrintWriter; | import java.io.*; | [
"java.io"
] | java.io; | 1,560,339 |
private void checkTempDir(final Path tmpdir, final Configuration c, final FileSystem fs)
throws IOException {
// If the temp directory exists, clear the content (left over, from the previous run)
if (fs.exists(tmpdir)) {
// Archive table in temp, maybe left over from failed deletion,
// if n... | void function(final Path tmpdir, final Configuration c, final FileSystem fs) throws IOException { if (fs.exists(tmpdir)) { for (Path tabledir: FSUtils.getTableDirs(fs, tmpdir)) { for (Path regiondir: FSUtils.getRegionDirs(fs, tabledir)) { HFileArchiver.archiveRegion(fs, this.rootdir, tabledir, regiondir); } } if (!HBas... | /**
* Make sure the hbase temp directory exists and is empty.
* NOTE that this method is only executed once just after the master becomes the active one.
*/ | Make sure the hbase temp directory exists and is empty. NOTE that this method is only executed once just after the master becomes the active one | checkTempDir | {
"repo_name": "zqxjjj/NobidaBase",
"path": "target/hbase-0.94.9/hbase-0.94.9/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java",
"license": "apache-2.0",
"size": 25589
} | [
"java.io.IOException",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.hbase.HBaseFileSystem",
"org.apache.hadoop.hbase.backup.HFileArchiver",
"org.apache.hadoop.hbase.util.FSUtils"
] | import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseFileSystem; import org.apache.hadoop.hbase.backup.HFileArchiver; import org.apache.hadoop.hbase.util.FSUtils; | import java.io.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.backup.*; import org.apache.hadoop.hbase.util.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 2,315,175 |
protected com.idega.core.persistence.Query createNewQueryInline(String queryExpression) {
com.idega.core.persistence.Query q = ELUtil.getInstance().getBean(QueryInlineImpl.beanIdentifier);
q.setQueryExpression(queryExpression);
return q;
} | com.idega.core.persistence.Query function(String queryExpression) { com.idega.core.persistence.Query q = ELUtil.getInstance().getBean(QueryInlineImpl.beanIdentifier); q.setQueryExpression(queryExpression); return q; } | /**
* <p>Gets {@link com.idega.core.persistence.Query} and sets
* {@link com.idega.core.persistence.Query
* #setQueryExpression(String)} to queryExpression.</p>
* @param queryExpression Hibernate HQL type query.
* @return com.idega.core.persistence.Query with queryExpression set.
*/ | Gets <code>com.idega.core.persistence.Query</code> and sets <code>com.idega.core.persistence.Query #setQueryExpression(String)</code> to queryExpression | createNewQueryInline | {
"repo_name": "idega/com.idega.core",
"path": "src/java/com/idega/core/persistence/impl/GenericDaoImpl.java",
"license": "gpl-3.0",
"size": 5078
} | [
"com.idega.util.expression.ELUtil",
"javax.persistence.Query"
] | import com.idega.util.expression.ELUtil; import javax.persistence.Query; | import com.idega.util.expression.*; import javax.persistence.*; | [
"com.idega.util",
"javax.persistence"
] | com.idega.util; javax.persistence; | 1,910,352 |
public static int countNodes( Node n, String tag ) {
NodeList children;
Node childnode;
int count = 0;
if ( n == null ) {
return 0;
}
children = n.getChildNodes();
for ( int i = 0; i < children.getLength(); i++ ) {
childnode = children.item( i );
if ( childnode.getNode... | static int function( Node n, String tag ) { NodeList children; Node childnode; int count = 0; if ( n == null ) { return 0; } children = n.getChildNodes(); for ( int i = 0; i < children.getLength(); i++ ) { childnode = children.item( i ); if ( childnode.getNodeName().equalsIgnoreCase( tag ) ) { count++; } } return count... | /**
* Count nodes with a certain tag
*
* @param n
* The node to look in
* @param tag
* The tags to count
* @return The number of nodes found with a certain tag
*/ | Count nodes with a certain tag | countNodes | {
"repo_name": "codek/pentaho-kettle",
"path": "core/src/org/pentaho/di/core/xml/XMLHandler.java",
"license": "apache-2.0",
"size": 37433
} | [
"org.w3c.dom.Node",
"org.w3c.dom.NodeList"
] | import org.w3c.dom.Node; import org.w3c.dom.NodeList; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 1,743,438 |
public static double lpNorm(final double[] a, final double p) {
if(p == 1) return l1Norm(a);
if(p == 2) return l2Norm(a);
double power = 1.0 / p;
return FastMath.pow(sum(pow(abs(a), p)), power);
}
| static double function(final double[] a, final double p) { if(p == 1) return l1Norm(a); if(p == 2) return l2Norm(a); double power = 1.0 / p; return FastMath.pow(sum(pow(abs(a), p)), power); } | /**
* Return the <tt>L<sub>P</sub></tt> or Minkowski norm
* @param a
* @param p
* @return the <tt>L<sub>P</sub></tt> norm
*/ | Return the LP or Minkowski norm | lpNorm | {
"repo_name": "tgsmith61591/clust4j",
"path": "src/main/java/com/clust4j/utils/VecUtils.java",
"license": "apache-2.0",
"size": 45939
} | [
"org.apache.commons.math3.util.FastMath"
] | import org.apache.commons.math3.util.FastMath; | import org.apache.commons.math3.util.*; | [
"org.apache.commons"
] | org.apache.commons; | 300,412 |
public static List<Alarm> getAllRemoteAlarmsForUser() {
ParseUser currentUser = ParseUser.getCurrentUser();
// Query the group table for the requested currentuser object
ParseQuery<ParseObject> query = ParseQuery.getQuery(TABLE_GROUPS);
query.whereEqualTo(COLUMN_USERS, currentUser)... | static List<Alarm> function() { ParseUser currentUser = ParseUser.getCurrentUser(); ParseQuery<ParseObject> query = ParseQuery.getQuery(TABLE_GROUPS); query.whereEqualTo(COLUMN_USERS, currentUser); List<ParseObject> groupObjectList = null; try { groupObjectList = query.find(); } catch (ParseException e) { Log.d(TAG, ST... | /**
* Get all alarms associated with a specific user.
* @return
*/ | Get all alarms associated with a specific user | getAllRemoteAlarmsForUser | {
"repo_name": "AlexanderHederstaf/groupalarm",
"path": "GroupAlarm/app/src/main/java/com/groupalarm/asijge/groupalarm/AlarmManaging/ParseHelper.java",
"license": "gpl-2.0",
"size": 28208
} | [
"android.util.Log",
"com.groupalarm.asijge.groupalarm.Data",
"com.parse.ParseException",
"com.parse.ParseObject",
"com.parse.ParseQuery",
"com.parse.ParseRelation",
"com.parse.ParseUser",
"java.util.LinkedList",
"java.util.List"
] | import android.util.Log; import com.groupalarm.asijge.groupalarm.Data; import com.parse.ParseException; import com.parse.ParseObject; import com.parse.ParseQuery; import com.parse.ParseRelation; import com.parse.ParseUser; import java.util.LinkedList; import java.util.List; | import android.util.*; import com.groupalarm.asijge.groupalarm.*; import com.parse.*; import java.util.*; | [
"android.util",
"com.groupalarm.asijge",
"com.parse",
"java.util"
] | android.util; com.groupalarm.asijge; com.parse; java.util; | 2,378,318 |
@Nonnull
public DeviceEnrollmentWindowsHelloForBusinessConfigurationRequest select(@Nonnull final String value) {
addSelectOption(value);
return this;
} | DeviceEnrollmentWindowsHelloForBusinessConfigurationRequest function(@Nonnull final String value) { addSelectOption(value); return this; } | /**
* Sets the select clause for the request
*
* @param value the select clause
* @return the updated request
*/ | Sets the select clause for the request | select | {
"repo_name": "microsoftgraph/msgraph-sdk-java",
"path": "src/main/java/com/microsoft/graph/requests/DeviceEnrollmentWindowsHelloForBusinessConfigurationRequest.java",
"license": "mit",
"size": 8046
} | [
"javax.annotation.Nonnull"
] | import javax.annotation.Nonnull; | import javax.annotation.*; | [
"javax.annotation"
] | javax.annotation; | 2,349,357 |
public TableInfo<T, ID> getTableInfo() {
return tableInfo;
} | TableInfo<T, ID> function() { return tableInfo; } | /**
* Used by internal classes to get the table information structure for the Dao's class.
*/ | Used by internal classes to get the table information structure for the Dao's class | getTableInfo | {
"repo_name": "lobo12/ormlite-core",
"path": "src/main/java/com/j256/ormlite/dao/BaseDaoImpl.java",
"license": "isc",
"size": 35415
} | [
"com.j256.ormlite.table.TableInfo"
] | import com.j256.ormlite.table.TableInfo; | import com.j256.ormlite.table.*; | [
"com.j256.ormlite"
] | com.j256.ormlite; | 174,608 |
public FileSystem getNewFileSystemInstance(int nnIndex) throws IOException {
FileSystem dfs = FileSystem.newInstance(getURI(nnIndex), nameNodes[nnIndex].conf);
fileSystems.add(dfs);
return dfs;
} | FileSystem function(int nnIndex) throws IOException { FileSystem dfs = FileSystem.newInstance(getURI(nnIndex), nameNodes[nnIndex].conf); fileSystems.add(dfs); return dfs; } | /**
* Get another FileSystem instance that is different from FileSystem.get(conf).
* This simulating different threads working on different FileSystem instances.
*/ | Get another FileSystem instance that is different from FileSystem.get(conf). This simulating different threads working on different FileSystem instances | getNewFileSystemInstance | {
"repo_name": "simbadzina/hadoop-fcfs",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java",
"license": "apache-2.0",
"size": 101960
} | [
"java.io.IOException",
"org.apache.hadoop.fs.FileSystem"
] | import java.io.IOException; import org.apache.hadoop.fs.FileSystem; | import java.io.*; import org.apache.hadoop.fs.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 2,364,440 |
public static Result collectResult(LocationProvider provider) {
return new Result(provider.getLatitude(), provider.getLongitude(), provider.getAccuracy());
} | static Result function(LocationProvider provider) { return new Result(provider.getLatitude(), provider.getLongitude(), provider.getAccuracy()); } | /**
* Speicher die Informationen in das Result-Objekt
*
* @param provider Welcher Provider?
* @return Result
*/ | Speicher die Informationen in das Result-Objekt | collectResult | {
"repo_name": "bestog/pals",
"path": "app/src/main/java/com/bestog/pals/utils/Util.java",
"license": "lgpl-3.0",
"size": 3065
} | [
"com.bestog.pals.provider.LocationProvider"
] | import com.bestog.pals.provider.LocationProvider; | import com.bestog.pals.provider.*; | [
"com.bestog.pals"
] | com.bestog.pals; | 1,262,378 |
public ServiceFuture<NamespaceResourceInner> createOrUpdateAsync(String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParametersInner parameters, final ServiceCallback<NamespaceResourceInner> serviceCallback) {
return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resour... | ServiceFuture<NamespaceResourceInner> function(String resourceGroupName, String namespaceName, NamespaceCreateOrUpdateParametersInner parameters, final ServiceCallback<NamespaceResourceInner> serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, pa... | /**
* Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent.
*
* @param resourceGroupName The name of the resource group.
* @param namespaceName The namespace name.
* @param parameters Parameters supplied to create a Nam... | Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent | createOrUpdateAsync | {
"repo_name": "martinsawicki/azure-sdk-for-java",
"path": "azure-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/implementation/NamespacesInner.java",
"license": "mit",
"size": 118543
} | [
"com.microsoft.rest.ServiceCallback",
"com.microsoft.rest.ServiceFuture"
] | import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 2,079,462 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.