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
@Override public void removeUpdate(DocumentEvent e) { updateState(); }
void function(DocumentEvent e) { updateState(); }
/** * DocumentListener implementation, do not use. * * @param e * DocumentEvent */
DocumentListener implementation, do not use
removeUpdate
{ "repo_name": "shred/jinn", "path": "src/main/java/net/shredzone/jinn/action/TextComponentAction.java", "license": "gpl-3.0", "size": 10231 }
[ "javax.swing.event.DocumentEvent" ]
import javax.swing.event.DocumentEvent;
import javax.swing.event.*;
[ "javax.swing" ]
javax.swing;
1,145,830
@Override public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { super.tightUnmarshal(wireFormat, o, dataIn, bs); MessageAck info = (MessageAck) o; info.setDestination((OpenWireDestination) tightUnmarsalCachedObject(wireF...
void function(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { super.tightUnmarshal(wireFormat, o, dataIn, bs); MessageAck info = (MessageAck) o; info.setDestination((OpenWireDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); info.setTransactionId((TransactionI...
/** * Un-marshal an object instance from the data input stream * * @param o * the object to un-marshal * @param dataIn * the data input stream to build the object from * @throws IOException */
Un-marshal an object instance from the data input stream
tightUnmarshal
{ "repo_name": "apache/activemq-openwire", "path": "openwire-legacy/src/main/java/org/apache/activemq/openwire/codec/v9/MessageAckMarshaller.java", "license": "apache-2.0", "size": 6907 }
[ "java.io.DataInput", "java.io.IOException", "org.apache.activemq.openwire.codec.BooleanStream", "org.apache.activemq.openwire.codec.OpenWireFormat", "org.apache.activemq.openwire.commands.ConsumerId", "org.apache.activemq.openwire.commands.MessageAck", "org.apache.activemq.openwire.commands.MessageId", ...
import java.io.DataInput; import java.io.IOException; import org.apache.activemq.openwire.codec.BooleanStream; import org.apache.activemq.openwire.codec.OpenWireFormat; import org.apache.activemq.openwire.commands.ConsumerId; import org.apache.activemq.openwire.commands.MessageAck; import org.apache.activemq.openwire.c...
import java.io.*; import org.apache.activemq.openwire.codec.*; import org.apache.activemq.openwire.commands.*;
[ "java.io", "org.apache.activemq" ]
java.io; org.apache.activemq;
2,006,954
public static void addDungeonLoot(int tier, ItemStack loot) { List<ItemStack> dungeonStacks = null; if (GalacticraftRegistry.dungeonLootMap.containsKey(tier)) { dungeonStacks = GalacticraftRegistry.dungeonLootMap.get(tier); dungeonStacks.add(loot); } else { dungeonStacks = new ArrayList<ItemSt...
static void function(int tier, ItemStack loot) { List<ItemStack> dungeonStacks = null; if (GalacticraftRegistry.dungeonLootMap.containsKey(tier)) { dungeonStacks = GalacticraftRegistry.dungeonLootMap.get(tier); dungeonStacks.add(loot); } else { dungeonStacks = new ArrayList<ItemStack>(); dungeonStacks.add(loot); } Gala...
/** * Add loot to the list of items that can possibly spawn in dungeon chests, * but it is guaranteed that one will always spawn * * @param tier * Tier of dungeon chest to add loot to. For example Moon is 1 * and Mars is 2 * @param loot * The itemstack to add to the pos...
Add loot to the list of items that can possibly spawn in dungeon chests, but it is guaranteed that one will always spawn
addDungeonLoot
{ "repo_name": "4Space/4-Space-1.6.4", "path": "dependencies/micdoodle8/mods/galacticraft/api/GalacticraftRegistry.java", "license": "gpl-2.0", "size": 6366 }
[ "java.util.ArrayList", "java.util.List", "net.minecraft.item.ItemStack" ]
import java.util.ArrayList; import java.util.List; import net.minecraft.item.ItemStack;
import java.util.*; import net.minecraft.item.*;
[ "java.util", "net.minecraft.item" ]
java.util; net.minecraft.item;
1,740,921
@Override public void validateDataOnEntry() throws DataModelException { // TODO auto-generated method stub, to be implemented by parser }
void function() throws DataModelException { }
/** * Validates the data on entering the corresponding parse tree node. * * @throws DataModelException a violation of data model rules */
Validates the data on entering the corresponding parse tree node
validateDataOnEntry
{ "repo_name": "VinodKumarS-Huawei/ietf96yang", "path": "utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangBits.java", "license": "apache-2.0", "size": 7706 }
[ "org.onosproject.yangutils.datamodel.exceptions.DataModelException" ]
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.datamodel.exceptions.*;
[ "org.onosproject.yangutils" ]
org.onosproject.yangutils;
2,573,226
public void flush() throws IOException { synchronized(directory) { assureOpen(); if (indexWriter != null) { indexWriter.close(); indexWriter = null; createIndexWriter(); } else { indexReader.close(); indexReader = null; createIndexReader(); }...
void function() throws IOException { synchronized(directory) { assureOpen(); if (indexWriter != null) { indexWriter.close(); indexWriter = null; createIndexWriter(); } else { indexReader.close(); indexReader = null; createIndexReader(); } } }
/** * Make sure all changes are written to disk. * @throws IOException */
Make sure all changes are written to disk
flush
{ "repo_name": "lpxz/grail-lucene358684", "path": "src/java/org/apache/lucene/index/IndexModifier.java", "license": "apache-2.0", "size": 21694 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
653,177
public static FSMatchConstraint makeConstituentSyntaxAnnotationConstraint(JCas jcas, String constituentNamespace) { final Feature constituentNamespaceFeat = jcas.getTypeSystem().getFeatureByFullName( SyntaxAnnotation.class.getName() + ":namespace"); final ConstraintFactory cf = jcas.getConstrain...
static FSMatchConstraint function(JCas jcas, String constituentNamespace) { final Feature constituentNamespaceFeat = jcas.getTypeSystem().getFeatureByFullName( SyntaxAnnotation.class.getName() + STR); final ConstraintFactory cf = jcas.getConstraintFactory(); final FeaturePath namespacePath = jcas.createFeaturePath(); n...
/** * Make a constraint that allows iterating constituent annotations in a CAS. */
Make a constraint that allows iterating constituent annotations in a CAS
makeConstituentSyntaxAnnotationConstraint
{ "repo_name": "fnl/txtfnnl", "path": "txtfnnl-wrappers/src/main/java/txtfnnl/uima/collection/RelationshipPatternLineWriter.java", "license": "apache-2.0", "size": 31164 }
[ "org.apache.uima.cas.ConstraintFactory", "org.apache.uima.cas.FSMatchConstraint", "org.apache.uima.cas.FSStringConstraint", "org.apache.uima.cas.Feature", "org.apache.uima.cas.FeaturePath", "org.apache.uima.jcas.JCas" ]
import org.apache.uima.cas.ConstraintFactory; import org.apache.uima.cas.FSMatchConstraint; import org.apache.uima.cas.FSStringConstraint; import org.apache.uima.cas.Feature; import org.apache.uima.cas.FeaturePath; import org.apache.uima.jcas.JCas;
import org.apache.uima.cas.*; import org.apache.uima.jcas.*;
[ "org.apache.uima" ]
org.apache.uima;
386,616
public static void createZip(File path, String root, OutputStream os) throws IOException { log.debug("createZip({}, {}, {})", new Object[] { path, root, os }); if (path.exists() && path.canRead()) { ZipArchiveOutputStream zaos = new ZipArchiveOutputStream(os); zaos.setComment("Generated by OpenKM"); ...
static void function(File path, String root, OutputStream os) throws IOException { log.debug(STR, new Object[] { path, root, os }); if (path.exists() && path.canRead()) { ZipArchiveOutputStream zaos = new ZipArchiveOutputStream(os); zaos.setComment(STR); zaos.setCreateUnicodeExtraFields(UnicodeExtraFieldPolicy.ALWAYS);...
/** * Recursively create ZIP archive from directory */
Recursively create ZIP archive from directory
createZip
{ "repo_name": "papamas/DMS-KANGREG-XI-MANADO", "path": "src/main/java/com/openkm/util/ArchiveUtils.java", "license": "gpl-3.0", "size": 7232 }
[ "java.io.File", "java.io.IOException", "java.io.OutputStream", "org.apache.commons.compress.archivers.zip.ZipArchiveEntry", "org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream" ]
import java.io.File; import java.io.IOException; import java.io.OutputStream; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
import java.io.*; import org.apache.commons.compress.archivers.zip.*;
[ "java.io", "org.apache.commons" ]
java.io; org.apache.commons;
2,376,090
public static <TSource, TKey, TElement> Enumerable<Grouping<TKey, TElement>> groupBy( Enumerable<TSource> enumerable, Function1<TSource, TKey> keySelector, Function1<TSource, TElement> elementSelector) { return enumerable.toLookup(keySelector, elementSelector); }
static <TSource, TKey, TElement> Enumerable<Grouping<TKey, TElement>> function( Enumerable<TSource> enumerable, Function1<TSource, TKey> keySelector, Function1<TSource, TElement> elementSelector) { return enumerable.toLookup(keySelector, elementSelector); }
/** * Groups the elements of a sequence according to a * specified key selector function and projects the elements for * each group by using a specified function. */
Groups the elements of a sequence according to a specified key selector function and projects the elements for each group by using a specified function
groupBy
{ "repo_name": "vlsi/calcite", "path": "linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableDefaults.java", "license": "apache-2.0", "size": 156877 }
[ "org.apache.calcite.linq4j.function.Function1" ]
import org.apache.calcite.linq4j.function.Function1;
import org.apache.calcite.linq4j.function.*;
[ "org.apache.calcite" ]
org.apache.calcite;
2,853,220
@VisibleForTesting static <T> Iterable<T> breadthFirstTraversal(final T root, final TreeViewer<T> viewer) { checkNotNull(root); checkNotNull(viewer); return new TreeTraversalIterable<T>(root, TraversalStrategy.BREADTH_FIRST, viewer); } private static class TreeTraversalIterable<T> implements Ite...
static <T> Iterable<T> breadthFirstTraversal(final T root, final TreeViewer<T> viewer) { checkNotNull(root); checkNotNull(viewer); return new TreeTraversalIterable<T>(root, TraversalStrategy.BREADTH_FIRST, viewer); } private static class TreeTraversalIterable<T> implements Iterable<T> { private final T root; private fi...
/** * Creates a breadth first traversing iterator of the tree rooted at root. * * @param root the root of the tree * @param viewer a TreeViewer which can determine leafiness of any instance of T and generate * Iterables for the direct children of any instance of T. */
Creates a breadth first traversing iterator of the tree rooted at root
breadthFirstTraversal
{ "repo_name": "djodjoni/tarator-deprecated", "path": "tarator/src/main/java/org/djodjo/tarator/util/TreeIterables.java", "license": "apache-2.0", "size": 9169 }
[ "com.google.common.base.Preconditions" ]
import com.google.common.base.Preconditions;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
597,337
public void mouseWheelMoved(MouseWheelEvent e) { getHandler().mouseWheelMoved(e); } }
void function(MouseWheelEvent e) { getHandler().mouseWheelMoved(e); } }
/** * Called when the mouse wheel is rotated while over a JScrollPane. * * @param e * MouseWheelEvent to be handled * @since 1.4 */
Called when the mouse wheel is rotated while over a JScrollPane
mouseWheelMoved
{ "repo_name": "khuxtable/seaglass", "path": "src/main/java/com/seaglasslookandfeel/ui/SeaGlassScrollPaneUI.java", "license": "apache-2.0", "size": 41643 }
[ "java.awt.event.MouseWheelEvent" ]
import java.awt.event.MouseWheelEvent;
import java.awt.event.*;
[ "java.awt" ]
java.awt;
756,943
public void writeBoolean(boolean b) throws IOException { writeByte(b ? ONE : ZERO); }
void function(boolean b) throws IOException { writeByte(b ? ONE : ZERO); }
/** * Writes a boolean. */
Writes a boolean
writeBoolean
{ "repo_name": "iamjakob/elasticsearch", "path": "core/src/main/java/org/elasticsearch/common/io/stream/StreamOutput.java", "license": "apache-2.0", "size": 19083 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,353,410
@Override public void run() { // thread exits when exitWhenFinished is true and there are no more tracked objects while (exitWhenFinished == false || trackers.size() > 0) { try { // Wait for a tracker to remove. Tracker trac...
void function() { while (exitWhenFinished == false trackers.size() > 0) { try { Tracker tracker = (Tracker) q.remove(); trackers.remove(tracker); if (!tracker.delete()) { deleteFailures.add(tracker.getPath()); } tracker.clear(); } catch (InterruptedException e) { continue; } } } } private static final class Tracker ext...
/** * Run the reaper thread that will delete files as their associated * marker objects are reclaimed by the garbage collector. */
Run the reaper thread that will delete files as their associated marker objects are reclaimed by the garbage collector
run
{ "repo_name": "contra/CJBE", "path": "src/org/apache/commons/io/FileCleaningTracker.java", "license": "gpl-3.0", "size": 11093 }
[ "java.lang.ref.PhantomReference", "java.lang.ref.ReferenceQueue" ]
import java.lang.ref.PhantomReference; import java.lang.ref.ReferenceQueue;
import java.lang.ref.*;
[ "java.lang" ]
java.lang;
1,362,217
private boolean matchesJ2clGetKeySignature(String className, Node getKey) { if (!getKey.hasChildren() || !getKey.getFirstChild().isFunction()) { return false; } Node getFunction = getKey.getFirstChild(); if (!getFunction.hasChildren() || !getFunction.getLastChild().isBlock()) { ...
boolean function(String className, Node getKey) { if (!getKey.hasChildren() !getKey.getFirstChild().isFunction()) { return false; } Node getFunction = getKey.getFirstChild(); if (!getFunction.hasChildren() !getFunction.getLastChild().isBlock()) { return false; } Node getBlock = getFunction.getLastChild(); if (!getBlock...
/** * <li> We match J2CL property getters by looking for the following signature: * <pre>{@code * get: function() { return (ClassName.$clinit(), ClassName.$fieldName)}; * </pre> */
We match J2CL property getters by looking for the following signature: <code>get: function() { return (ClassName.$clinit(), ClassName.$fieldName); </code>
matchesJ2clGetKeySignature
{ "repo_name": "shantanusharma/closure-compiler", "path": "src/com/google/javascript/jscomp/J2clPropertyInlinerPass.java", "license": "apache-2.0", "size": 15821 }
[ "com.google.javascript.rhino.Node" ]
import com.google.javascript.rhino.Node;
import com.google.javascript.rhino.*;
[ "com.google.javascript" ]
com.google.javascript;
2,854,722
public void setXAttr(Path path, String name, byte[] value, EnumSet<XAttrSetFlag> flag) throws IOException { throw new UnsupportedOperationException(getClass().getSimpleName() + " doesn't support setXAttr"); }
void function(Path path, String name, byte[] value, EnumSet<XAttrSetFlag> flag) throws IOException { throw new UnsupportedOperationException(getClass().getSimpleName() + STR); }
/** * Set an xattr of a file or directory. * The name must be prefixed with the namespace followed by ".". For example, * "user.attr". * <p/> * Refer to the HDFS extended attributes user documentation for details. * * @param path Path to modify * @param name xattr name. * @param value xattr v...
Set an xattr of a file or directory. The name must be prefixed with the namespace followed by ".". For example, "user.attr". Refer to the HDFS extended attributes user documentation for details
setXAttr
{ "repo_name": "jonathangizmo/HadoopDistJ", "path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java", "license": "mit", "size": 110020 }
[ "java.io.IOException", "java.util.EnumSet" ]
import java.io.IOException; import java.util.EnumSet;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
1,934,286
public static void expand(ByteBuffer in, ByteBuffer out) { do { int ctrl = in.get() & 255; if (ctrl < MAX_LITERAL) { // literal run of length = ctrl + 1, ctrl++; // copy to output and move forward this many bytes // (maybe slice would be faster) for (int i = 0; i < ctrl; i++) { out.p...
static void function(ByteBuffer in, ByteBuffer out) { do { int ctrl = in.get() & 255; if (ctrl < MAX_LITERAL) { ctrl++; for (int i = 0; i < ctrl; i++) { out.put(in.get()); } } else { int len = ctrl >> 5; if (len == 7) { len += in.get() & 255; } len += 2; ctrl = -((ctrl & 0x1f) << 8) - 1; ctrl -= in.get() & 255; ctrl +=...
/** * Expand a number of compressed bytes. * * @param in * the compressed data * @param out * the output area */
Expand a number of compressed bytes
expand
{ "repo_name": "wen866595/redis-tool", "path": "src/main/java/org/h2/compress/CompressLZF.java", "license": "apache-2.0", "size": 14662 }
[ "java.nio.ByteBuffer" ]
import java.nio.ByteBuffer;
import java.nio.*;
[ "java.nio" ]
java.nio;
796,720
public static void setIsStorageLow(boolean newValue) { if (sIsStorageLow == newValue) { // The state is unchanged, nothing to do. return; } sIsStorageLow = newValue; if (sHandler == null) { return; } if (newValue) { sHan...
static void function(boolean newValue) { if (sIsStorageLow == newValue) { return; } sIsStorageLow = newValue; if (sHandler == null) { return; } if (newValue) { sHandler.onStorageLow(); } else { sHandler.onStorageOk(); } } /** * Sets the handler that can adjust application state to deal with storage low and * storage ok...
/** * Notifies {@link StorageLowState} that the device has entered storage low state. */
Notifies <code>StorageLowState</code> that the device has entered storage low state
setIsStorageLow
{ "repo_name": "s20121035/rk3288_android5.1_repo", "path": "packages/apps/UnifiedEmail/src/com/android/mail/utils/StorageLowState.java", "license": "gpl-3.0", "size": 3603 }
[ "android.content.Intent" ]
import android.content.Intent;
import android.content.*;
[ "android.content" ]
android.content;
2,590,019
@Test public void testMissingServerResource() throws Throwable { try { HttpServer2 server = createServer("NoSuchWebapp"); //should not have got here. //close the server String serverDescription = server.toString(); stop(server); fail("Expected an exception, got " + serverDesc...
void function() throws Throwable { try { HttpServer2 server = createServer(STR); String serverDescription = server.toString(); stop(server); fail(STR + serverDescription); } catch (FileNotFoundException expected) { LOG.debug(STR + expected, expected); } }
/** * Test that an invalid webapp triggers an exception * @throws Throwable if something went wrong */
Test that an invalid webapp triggers an exception
testMissingServerResource
{ "repo_name": "dennishuo/hadoop", "path": "hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestHttpServerWebapps.java", "license": "apache-2.0", "size": 2035 }
[ "java.io.FileNotFoundException" ]
import java.io.FileNotFoundException;
import java.io.*;
[ "java.io" ]
java.io;
2,305,843
public YearMonth plusMonths(long monthsToAdd) { if (monthsToAdd == 0) { return this; } long monthCount = year * 12L + (month - 1); long calcMonths = monthCount + monthsToAdd; // safe overflow int newYear = YEAR.checkValidIntValue(Math.floorDiv(calcMonths, 12)); ...
YearMonth function(long monthsToAdd) { if (monthsToAdd == 0) { return this; } long monthCount = year * 12L + (month - 1); long calcMonths = monthCount + monthsToAdd; int newYear = YEAR.checkValidIntValue(Math.floorDiv(calcMonths, 12)); int newMonth = (int) Math.floorMod(calcMonths, 12) + 1; return with(newYear, newMont...
/** * Returns a copy of this {@code YearMonth} with the specified number of months added. * <p> * This instance is immutable and unaffected by this method call. * * @param monthsToAdd the months to add, may be negative * @return a {@code YearMonth} based on this year-month with the months...
Returns a copy of this YearMonth with the specified number of months added. This instance is immutable and unaffected by this method call
plusMonths
{ "repo_name": "google/desugar_jdk_libs", "path": "src/share/classes/java/time/YearMonth.java", "license": "gpl-2.0", "size": 53945 }
[ "java.time.temporal.ChronoField" ]
import java.time.temporal.ChronoField;
import java.time.temporal.*;
[ "java.time" ]
java.time;
2,854,090
@Test public void testT1RV6D5_T1LV6D4() { test_id = getTestId("T1RV6D5", "T1LV6D4", "235"); String src = selectTRVD("T1RV6D5"); String dest = selectTLVD("T1LV6D4"); String result = "."; try { result = TRVD_TLVD_Action(src, dest); } catch (RecognitionException e) { e.printStackTrace()...
void function() { test_id = getTestId(STR, STR, "235"); String src = selectTRVD(STR); String dest = selectTLVD(STR); String result = "."; try { result = TRVD_TLVD_Action(src, dest); } catch (RecognitionException e) { e.printStackTrace(); } catch (TokenStreamException e) { e.printStackTrace(); } assertTrue(ParamFailure3...
/** * Perform the test for the given matrix column (T1RV6D5) and row (T1LV6D4). * */
Perform the test for the given matrix column (T1RV6D5) and row (T1LV6D4)
testT1RV6D5_T1LV6D4
{ "repo_name": "jason-rhodes/bridgepoint", "path": "src/org.xtuml.bp.als.oal.test/src/org/xtuml/bp/als/oal/test/SingleDimensionFixedArrayAssigmentTest_12_Generics.java", "license": "apache-2.0", "size": 155634 }
[ "org.xtuml.bp.ui.graphics.editor.GraphicalEditor" ]
import org.xtuml.bp.ui.graphics.editor.GraphicalEditor;
import org.xtuml.bp.ui.graphics.editor.*;
[ "org.xtuml.bp" ]
org.xtuml.bp;
1,489,512
protected void scanComment() throws IOException, XNIException { fContentBuffer.clear(); scanComment(fContentBuffer); //getTextCharacters can also be called for reading comments fUsebuffer = true; fMarkupDepth--; } // scanComment()
void function() throws IOException, XNIException { fContentBuffer.clear(); scanComment(fContentBuffer); fUsebuffer = true; fMarkupDepth--; }
/** * Scans a comment. * <p> * <pre> * [15] Comment ::= '&lt!--' ((Char - '-') | ('-' (Char - '-')))* '-->' * </pre> * <p> * <strong>Note:</strong> Called after scanning past '&lt;!--' */
Scans a comment. <code> [15] Comment ::= '&lt!--' ((Char - '-') | ('-' (Char - '-')))* '-->' </code> Note: Called after scanning past '&lt;!--'
scanComment
{ "repo_name": "haikuowuya/android_system_code", "path": "src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java", "license": "apache-2.0", "size": 128900 }
[ "com.sun.org.apache.xerces.internal.xni.XNIException", "java.io.IOException" ]
import com.sun.org.apache.xerces.internal.xni.XNIException; import java.io.IOException;
import com.sun.org.apache.xerces.internal.xni.*; import java.io.*;
[ "com.sun.org", "java.io" ]
com.sun.org; java.io;
46,857
public static Class<?> forName(String name) throws ClassNotFoundException { return VMClass.forName(name, true, VMStackWalker.getCallingClassLoader()); }
static Class<?> function(String name) throws ClassNotFoundException { return VMClass.forName(name, true, VMStackWalker.getCallingClassLoader()); }
/** * Use the classloader of the current class to load, link, and initialize * a class. This is equivalent to your code calling * <code>Class.forName(name, true, getClass().getClassLoader())</code>. * * @param name the name of the class to find * @return the Class object representing the class * @t...
Use the classloader of the current class to load, link, and initialize a class. This is equivalent to your code calling <code>Class.forName(name, true, getClass().getClassLoader())</code>
forName
{ "repo_name": "ccompiler4pic32/pic32-gcc", "path": "libjava/classpath/java/lang/Class.java", "license": "gpl-2.0", "size": 61021 }
[ "gnu.classpath.VMStackWalker" ]
import gnu.classpath.VMStackWalker;
import gnu.classpath.*;
[ "gnu.classpath" ]
gnu.classpath;
1,050,321
EList<RunningAsType> getRunningAs();
EList<RunningAsType> getRunningAs();
/** * Returns the value of the '<em><b>Running As</b></em>' containment reference list. * The list contents are of type {@link org.liquibase.xml.ns.dbchangelog.RunningAsType}. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Running As</em>' containment reference list isn't clear, * there really...
Returns the value of the 'Running As' containment reference list. The list contents are of type <code>org.liquibase.xml.ns.dbchangelog.RunningAsType</code>. If the meaning of the 'Running As' containment reference list isn't clear, there really should be more of a description here...
getRunningAs
{ "repo_name": "dzonekl/LiquibaseEditor", "path": "plugins/org.liquidbase.model/src/org/liquibase/xml/ns/dbchangelog/OrType.java", "license": "mit", "size": 19957 }
[ "org.eclipse.emf.common.util.EList" ]
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
152,259
public static <V> java.util.concurrent.Callable<V> wrapWithLock(java.util.concurrent.Callable<V> callable) { final Jenkins jenkins = Jenkins.getInstanceOrNull(); // TODO confirm safe to assume non-null and use getInstance() final Queue queue = jenkins == null ? null : jenkins.getQueue(); ...
static <V> java.util.concurrent.Callable<V> function(java.util.concurrent.Callable<V> callable) { final Jenkins jenkins = Jenkins.getInstanceOrNull(); final Queue queue = jenkins == null ? null : jenkins.getQueue(); return queue == null ? callable : new LockedJUCCallable<V>(callable); }
/** * Wraps a {@link java.util.concurrent.Callable} with the {@link Queue} lock held. * * @param callable the operation to wrap. * @since 1.618 */
Wraps a <code>java.util.concurrent.Callable</code> with the <code>Queue</code> lock held
wrapWithLock
{ "repo_name": "alvarolobato/jenkins", "path": "core/src/main/java/hudson/model/Queue.java", "license": "mit", "size": 108236 }
[ "java.util.concurrent.Callable" ]
import java.util.concurrent.Callable;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,476,289
public Validator addConstraint(Component cmp, Constraint... c) { if(c.length == 1) { constraintList.put(cmp, c[0]); } else { constraintList.put(cmp, new GroupConstraint(c)); } bindDataListener(cmp); boolean isV = isValid(); for(Component btn : ...
Validator function(Component cmp, Constraint... c) { if(c.length == 1) { constraintList.put(cmp, c[0]); } else { constraintList.put(cmp, new GroupConstraint(c)); } bindDataListener(cmp); boolean isV = isValid(); for(Component btn : submitButtons) { btn.setEnabled(isV); } return this; }
/** * Places a constraint on the validator, returns this object so constraint additions can be chained. * Notice that only one constraint * @param cmp the component to validate * @param c the constraint or constraints * @return this object so we can write code like v.addConstraint(cmp1, cons)...
Places a constraint on the validator, returns this object so constraint additions can be chained. Notice that only one constraint
addConstraint
{ "repo_name": "shannah/CodenameOne", "path": "CodenameOne/src/com/codename1/ui/validation/Validator.java", "license": "gpl-2.0", "size": 25730 }
[ "com.codename1.ui.Component" ]
import com.codename1.ui.Component;
import com.codename1.ui.*;
[ "com.codename1.ui" ]
com.codename1.ui;
1,444,960
public static ChiefController createAuthHome(UserRequest ureq) { if (!ureq.getUserSession().isAuthenticated()) throw new AssertException("not authenticated!");
static ChiefController function(UserRequest ureq) { if (!ureq.getUserSession().isAuthenticated()) throw new AssertException(STR);
/** * Create a base chief controller for the current authenticated user request * and initialize the first screen after login. * * @param ureq The authenticated user request. * @return The chief controller */
Create a base chief controller for the current authenticated user request and initialize the first screen after login
createAuthHome
{ "repo_name": "stevenhva/InfoLearn_OpenOLAT", "path": "src/main/java/org/olat/basesecurity/AuthHelper.java", "license": "apache-2.0", "size": 22632 }
[ "org.olat.core.gui.UserRequest", "org.olat.core.gui.control.ChiefController", "org.olat.core.logging.AssertException" ]
import org.olat.core.gui.UserRequest; import org.olat.core.gui.control.ChiefController; import org.olat.core.logging.AssertException;
import org.olat.core.gui.*; import org.olat.core.gui.control.*; import org.olat.core.logging.*;
[ "org.olat.core" ]
org.olat.core;
1,033,330
public java.util.List<fr.lip6.move.pnml.hlpn.finiteIntRanges.hlapi.LessThanHLAPI> getSubterm_finiteIntRanges_LessThanHLAPI(){ java.util.List<fr.lip6.move.pnml.hlpn.finiteIntRanges.hlapi.LessThanHLAPI> retour = new ArrayList<fr.lip6.move.pnml.hlpn.finiteIntRanges.hlapi.LessThanHLAPI>(); for (Term elemnt : get...
java.util.List<fr.lip6.move.pnml.hlpn.finiteIntRanges.hlapi.LessThanHLAPI> function(){ java.util.List<fr.lip6.move.pnml.hlpn.finiteIntRanges.hlapi.LessThanHLAPI> retour = new ArrayList<fr.lip6.move.pnml.hlpn.finiteIntRanges.hlapi.LessThanHLAPI>(); for (Term elemnt : getSubterm()) { if(elemnt.getClass().equals(fr.lip6.m...
/** * This accessor return a list of encapsulated subelement, only of LessThanHLAPI kind. * WARNING : this method can creates a lot of new object in memory. */
This accessor return a list of encapsulated subelement, only of LessThanHLAPI kind. WARNING : this method can creates a lot of new object in memory
getSubterm_finiteIntRanges_LessThanHLAPI
{ "repo_name": "lhillah/pnmlframework", "path": "pnmlFw-HLPN/src/fr/lip6/move/pnml/hlpn/integers/hlapi/DivisionHLAPI.java", "license": "epl-1.0", "size": 108424 }
[ "fr.lip6.move.pnml.hlpn.terms.Term", "java.util.ArrayList", "java.util.List" ]
import fr.lip6.move.pnml.hlpn.terms.Term; import java.util.ArrayList; import java.util.List;
import fr.lip6.move.pnml.hlpn.terms.*; import java.util.*;
[ "fr.lip6.move", "java.util" ]
fr.lip6.move; java.util;
1,132,490
public static boolean areAppMessagesSupported( final Context context ) { Cursor c = context.getContentResolver().query( Uri.parse( "content://com.getpebble.android.provider/state" ), null, null, ...
static boolean function( final Context context ) { Cursor c = context.getContentResolver().query( Uri.parse( "content: null, null, null ); if( c == null !c.moveToNext() ) { return false; } return c.getInt( KIT_STATE_COLUMN_APPMSG_SUPPORT ) == 1; }
/** * Synchronously query the Pebble application to see if the connected watch is running a firmware version that * supports PebbleKit messages. * * @param context The Android context used to perform the query. * <p/> * <em>Protip:</em> You probably want to use your Application...
Synchronously query the Pebble application to see if the connected watch is running a firmware version that supports PebbleKit messages
areAppMessagesSupported
{ "repo_name": "zaxebo1/RingMyPhoneAndroid", "path": "RingMyPhone/src/main/java/com/getpebble/android/kit/PebbleKit.java", "license": "mit", "size": 35095 }
[ "android.content.Context", "android.database.Cursor", "android.net.Uri" ]
import android.content.Context; import android.database.Cursor; import android.net.Uri;
import android.content.*; import android.database.*; import android.net.*;
[ "android.content", "android.database", "android.net" ]
android.content; android.database; android.net;
1,926,513
// TODO: this really needs to be refactored into fieldcacheimpl public long copyUsingLengthPrefix(BytesRef bytes) { if (bytes.length >= 32768) { throw new IllegalArgumentException("max length is 32767 (got " + bytes.length + ")"); } if (upto + bytes.length + 2 > blockSize) { if (bytes.lengt...
long function(BytesRef bytes) { if (bytes.length >= 32768) { throw new IllegalArgumentException(STR + bytes.length + ")"); } if (upto + bytes.length + 2 > blockSize) { if (bytes.length + 2 > blockSize) { throw new IllegalArgumentException(STR + blockSize + STR + bytes.length + STR); } if (currentBlock != null) { addBlo...
/** Copy bytes in, writing the length as a 1 or 2 byte * vInt prefix. */
Copy bytes in, writing the length as a 1 or 2 byte
copyUsingLengthPrefix
{ "repo_name": "smartan/lucene", "path": "src/main/java/org/apache/lucene/util/PagedBytes.java", "license": "apache-2.0", "size": 13294 }
[ "org.apache.lucene.store.DataInput" ]
import org.apache.lucene.store.DataInput;
import org.apache.lucene.store.*;
[ "org.apache.lucene" ]
org.apache.lucene;
916,592
@Deprecated public boolean isExplicitlySet(StandardPlural count) { return explicit[count.ordinal()]; } /** * {@inheritDoc}
boolean function(StandardPlural count) { return explicit[count.ordinal()]; } /** * {@inheritDoc}
/** * Internal method to determines whether the StandardPluralCategories was explicitly used in any add statement. * * @param count * plural category to test * @return true if set * @internal * @deprecated This API is ICU internal only. */
Internal method to determines whether the StandardPluralCategories was explicitly used in any add statement
isExplicitlySet
{ "repo_name": "abhijitvalluri/fitnotifications", "path": "icu4j/src/main/java/com/ibm/icu/text/PluralRanges.java", "license": "apache-2.0", "size": 11348 }
[ "com.ibm.icu.impl.StandardPlural" ]
import com.ibm.icu.impl.StandardPlural;
import com.ibm.icu.impl.*;
[ "com.ibm.icu" ]
com.ibm.icu;
2,298,077
public void testMoveSingleResource() throws Throwable { CmsObject cms = getCmsObject(); echo("Testing move of a file"); String source = "/folder1/index.html"; String destination = "/folder1/index_move.html"; storeResources(cms, source); cms.lockResource(source); ...
void function() throws Throwable { CmsObject cms = getCmsObject(); echo(STR); String source = STR; String destination = STR; storeResources(cms, source); cms.lockResource(source); cms.moveResource(source, destination); try { cms.readResource(source, CmsResourceFilter.ALL); fail(STR); } catch (CmsException e) { } assert...
/** * Tests the "move single resource" operation.<p> * * @throws Throwable if something goes wrong */
Tests the "move single resource" operation
testMoveSingleResource
{ "repo_name": "PatidarWeb/opencms-core", "path": "test/org/opencms/file/TestMoveRename.java", "license": "lgpl-2.1", "size": 27569 }
[ "org.opencms.lock.CmsLockFilter", "org.opencms.lock.CmsLockType", "org.opencms.main.CmsException", "org.opencms.main.OpenCms", "org.opencms.test.OpenCmsTestResourceFilter" ]
import org.opencms.lock.CmsLockFilter; import org.opencms.lock.CmsLockType; import org.opencms.main.CmsException; import org.opencms.main.OpenCms; import org.opencms.test.OpenCmsTestResourceFilter;
import org.opencms.lock.*; import org.opencms.main.*; import org.opencms.test.*;
[ "org.opencms.lock", "org.opencms.main", "org.opencms.test" ]
org.opencms.lock; org.opencms.main; org.opencms.test;
1,907,508
@Override public void remove() { if (previousInAccessor < 0) { throw new IllegalStateException(); } checkConcurrentModification(); if (subIterator != null) { subIterator.remove(); } else { clearAt...
void function() { if (previousInAccessor < 0) { throw new IllegalStateException(); } checkConcurrentModification(); if (subIterator != null) { subIterator.remove(); } else { clearAt(previousInAccessor); previousInAccessor = -1; } modCountCheck = ++modCount; } } /** * Adds the given node to this list. This method fetche...
/** * Clears the element returned by the last call to {@link #next()}. * Whether the cleared element is considered removed or not depends * on the value policy and on the element type. With the default * {@code NON_EMPTY} policy, the effect is a removal. */
Clears the element returned by the last call to <code>#next()</code>. Whether the cleared element is considered removed or not depends on the value policy and on the element type. With the default NON_EMPTY policy, the effect is a removal
remove
{ "repo_name": "apache/sis", "path": "core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNodeChildren.java", "license": "apache-2.0", "size": 28471 }
[ "org.apache.sis.util.collection.TableColumn" ]
import org.apache.sis.util.collection.TableColumn;
import org.apache.sis.util.collection.*;
[ "org.apache.sis" ]
org.apache.sis;
2,888,282
void register(DataObjectRegistration file);
void register(DataObjectRegistration file);
/** * Registers the passed file and updates the annotation. * * @param file The file to register.. */
Registers the passed file and updates the annotation
register
{ "repo_name": "rleigh-dundee/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewer.java", "license": "gpl-2.0", "size": 33564 }
[ "org.openmicroscopy.shoola.agents.util.DataObjectRegistration" ]
import org.openmicroscopy.shoola.agents.util.DataObjectRegistration;
import org.openmicroscopy.shoola.agents.util.*;
[ "org.openmicroscopy.shoola" ]
org.openmicroscopy.shoola;
1,657,658
private int getSCFromCGIStatusHeader(String value) { if (value.length() < 3) { // Not a valid status value log.warn(sm.getString("cgiServlet.runInvalidStatus", value)); return HttpServletResponse.SC_INTERNAL_SERVER_ERROR; } Str...
int function(String value) { if (value.length() < 3) { log.warn(sm.getString(STR, value)); return HttpServletResponse.SC_INTERNAL_SERVER_ERROR; } String status = value.substring(0, 3); int statusCode; try { statusCode = Integer.parseInt(status); } catch (NumberFormatException nfe) { log.warn(sm.getString(STR, status));...
/** * Parses the CGI Status Header value and extracts the status code. * * @param value The CGI Status value of the form <code> * digit digit digit SP reason-phrase</code> * @return The extracted status code or the code representing an * internal error i...
Parses the CGI Status Header value and extracts the status code
getSCFromCGIStatusHeader
{ "repo_name": "thanple/tomcatsrc", "path": "java/org/apache/catalina/servlets/CGIServlet.java", "license": "apache-2.0", "size": 70205 }
[ "javax.servlet.http.HttpServletResponse" ]
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.*;
[ "javax.servlet" ]
javax.servlet;
1,623,365
public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) { return itemStackIn; }
ItemStack function(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) { return itemStackIn; }
/** * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer */
Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
onItemRightClick
{ "repo_name": "dogjaw2233/tiu-s-mod", "path": "build/tmp/recompileMc/sources/net/minecraft/item/Item.java", "license": "lgpl-2.1", "size": 80864 }
[ "net.minecraft.entity.player.EntityPlayer", "net.minecraft.world.World" ]
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World;
import net.minecraft.entity.player.*; import net.minecraft.world.*;
[ "net.minecraft.entity", "net.minecraft.world" ]
net.minecraft.entity; net.minecraft.world;
2,462,205
private void put(final byte [] row, byte [] family, List<? extends Cell> edits) throws IOException { NavigableMap<byte[], List<? extends Cell>> familyMap; familyMap = new TreeMap<byte[], List<? extends Cell>>(Bytes.BYTES_COMPARATOR); familyMap.put(family, edits); Put p = new Put(row); p.setFami...
void function(final byte [] row, byte [] family, List<? extends Cell> edits) throws IOException { NavigableMap<byte[], List<? extends Cell>> familyMap; familyMap = new TreeMap<byte[], List<? extends Cell>>(Bytes.BYTES_COMPARATOR); familyMap.put(family, edits); Put p = new Put(row); p.setFamilyMap(familyMap); p.setClust...
/** * Add updates first to the hlog and then add values to memstore. * Warning: Assumption is caller has lock on passed in row. * @param family * @param edits Cell updates by column * @praram now * @throws IOException */
Add updates first to the hlog and then add values to memstore. Warning: Assumption is caller has lock on passed in row
put
{ "repo_name": "francisliu/hbase_namespace", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java", "license": "apache-2.0", "size": 208409 }
[ "java.io.IOException", "java.util.List", "java.util.NavigableMap", "java.util.TreeMap", "org.apache.hadoop.hbase.Cell", "org.apache.hadoop.hbase.HConstants", "org.apache.hadoop.hbase.client.Put", "org.apache.hadoop.hbase.util.Bytes" ]
import java.io.IOException; import java.util.List; import java.util.NavigableMap; import java.util.TreeMap; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.util.Bytes;
import java.io.*; import java.util.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.util.*;
[ "java.io", "java.util", "org.apache.hadoop" ]
java.io; java.util; org.apache.hadoop;
320,121
private static boolean conditionalReset(IPreferenceStore store, String oldKey, String newKey) { if (!store.isDefault(oldKey)) { if (store.isDefault(newKey)) store.setValue(newKey, store.getString(oldKey)); store.setToDefault(oldKey); return true; } return false; }
static boolean function(IPreferenceStore store, String oldKey, String newKey) { if (!store.isDefault(oldKey)) { if (store.isDefault(newKey)) store.setValue(newKey, store.getString(oldKey)); store.setToDefault(oldKey); return true; } return false; }
/** * If the setting pointed to by <code>oldKey</code> is not the default * setting, store that setting under <code>newKey</code> and reset * <code>oldKey</code> to its default setting. * <p> * Returns <code>true</code> if any changes were made. * </p> * * @param store the preference store to read from ...
If the setting pointed to by <code>oldKey</code> is not the default setting, store that setting under <code>newKey</code> and reset <code>oldKey</code> to its default setting. Returns <code>true</code> if any changes were made.
conditionalReset
{ "repo_name": "trylimits/Eclipse-Postfix-Code-Completion-Juno38", "path": "juno38/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/SemanticHighlightings.java", "license": "epl-1.0", "size": 69361 }
[ "org.eclipse.jface.preference.IPreferenceStore" ]
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.*;
[ "org.eclipse.jface" ]
org.eclipse.jface;
1,606,174
private Method getCompatibleMethod(final Class<?> clazz, final String methodName, final Class<?>[] parameterTypes) { for (Method method : clazz.getMethods()) { // if the method name does match we go to the next method ...
Method function(final Class<?> clazz, final String methodName, final Class<?>[] parameterTypes) { for (Method method : clazz.getMethods()) { if (method.getName().compareTo(methodName) != 0) { continue; } int numRequestParameters = 0; if (parameterTypes != null) { numRequestParameters = parameterTypes.length; } if (meth...
/** * Get a compatible constructor to the supplied parameter types. * * @param clazz The class which we want to construct * @param methodName The method to invoke * @param parameterTypes The types required of the constructor * @return a compatible constructor or null if none e...
Get a compatible constructor to the supplied parameter types
getCompatibleMethod
{ "repo_name": "jackybourgeois/active-home", "path": "org.active-home.service/src/main/java/org/activehome/service/Service.java", "license": "gpl-3.0", "size": 19230 }
[ "java.lang.reflect.Method" ]
import java.lang.reflect.Method;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
791,781
final Renderer unit = unit(); Assert.assertSame(unit, unit.list()); }
final Renderer unit = unit(); Assert.assertSame(unit, unit.list()); }
/** * Tests {@link Renderer#list()} to return this. */
Tests <code>Renderer#list()</code> to return this
listThis
{ "repo_name": "cosmocode/cosmocode-rendering", "path": "src/test/java/de/cosmocode/rendering/AbstractRendererListTest.java", "license": "apache-2.0", "size": 3048 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
525,657
public void join(MutationState newMutationState) { if (this == newMutationState) { // Doesn't make sense return; } this.sizeOffset += newMutationState.sizeOffset; // Merge newMutation with this one, keeping state from newMutation for any overlaps for (Map.Entry<Ta...
void function(MutationState newMutationState) { if (this == newMutationState) { return; } this.sizeOffset += newMutationState.sizeOffset; for (Map.Entry<TableRef, Map<ImmutableBytesPtr,RowMutationState>> entry : newMutationState.mutations.entrySet()) { TableRef tableRef = entry.getKey(); PTable table = tableRef.getTabl...
/** * Combine a newer mutation with this one, where in the event of overlaps, the newer one will take precedence. * Combine any metrics collected for the newer mutation. * * @param newMutationState the newer mutation state */
Combine a newer mutation with this one, where in the event of overlaps, the newer one will take precedence. Combine any metrics collected for the newer mutation
join
{ "repo_name": "nickman/phoenix", "path": "phoenix-core/src/main/java/org/apache/phoenix/execute/MutationState.java", "license": "apache-2.0", "size": 28734 }
[ "java.util.Map", "org.apache.phoenix.hbase.index.util.ImmutableBytesPtr", "org.apache.phoenix.schema.PColumn", "org.apache.phoenix.schema.PRow", "org.apache.phoenix.schema.PTable", "org.apache.phoenix.schema.PTableType", "org.apache.phoenix.schema.TableRef" ]
import java.util.Map; import org.apache.phoenix.hbase.index.util.ImmutableBytesPtr; import org.apache.phoenix.schema.PColumn; import org.apache.phoenix.schema.PRow; import org.apache.phoenix.schema.PTable; import org.apache.phoenix.schema.PTableType; import org.apache.phoenix.schema.TableRef;
import java.util.*; import org.apache.phoenix.hbase.index.util.*; import org.apache.phoenix.schema.*;
[ "java.util", "org.apache.phoenix" ]
java.util; org.apache.phoenix;
1,964,766
public List<NameValuePair> getParameters(HttpMessage msg, HtmlParameter.Type type) { if (msg == null) { throw new IllegalArgumentException("Parameter msg must not be null."); } if (type == null) { throw new IllegalArgumentException("Parameter type must not be null.");...
List<NameValuePair> function(HttpMessage msg, HtmlParameter.Type type) { if (msg == null) { throw new IllegalArgumentException(STR); } if (type == null) { throw new IllegalArgumentException(STR); } switch (type) { case form: return this.getFormParamParser(msg.getRequestHeader().getURI().toString()) .getParameters(msg, ...
/** * Gets the parameters of the given {@code type} from the given {@code message}. * * <p>Parameters' names and values are in decoded form. * * @param msg the message whose parameters will be extracted from * @param type the type of parameters to extract * @return a {@code List} cont...
Gets the parameters of the given type from the given message. Parameters' names and values are in decoded form
getParameters
{ "repo_name": "psiinon/zaproxy", "path": "zap/src/main/java/org/parosproxy/paros/model/Session.java", "license": "apache-2.0", "size": 68333 }
[ "java.util.List", "org.parosproxy.paros.network.HtmlParameter", "org.parosproxy.paros.network.HttpMessage", "org.zaproxy.zap.model.NameValuePair" ]
import java.util.List; import org.parosproxy.paros.network.HtmlParameter; import org.parosproxy.paros.network.HttpMessage; import org.zaproxy.zap.model.NameValuePair;
import java.util.*; import org.parosproxy.paros.network.*; import org.zaproxy.zap.model.*;
[ "java.util", "org.parosproxy.paros", "org.zaproxy.zap" ]
java.util; org.parosproxy.paros; org.zaproxy.zap;
1,396,499
public void insertString(int offs, String str, AttributeSet a) throws BadLocationException { if (getLength() >= _maxDigits) return; char[] source = str.toCharArray(); char[] result = new char[source.length]; int j = 0; for (int i = 0; i < result.length && j < _maxDigits; i++) { if (Characte...
void function(int offs, String str, AttributeSet a) throws BadLocationException { if (getLength() >= _maxDigits) return; char[] source = str.toCharArray(); char[] result = new char[source.length]; int j = 0; for (int i = 0; i < result.length && j < _maxDigits; i++) { if (Character.isDigit(source[i])) result[j++] = sour...
/** * Override the insert string method * @param offs offset * @param str string * @param a attributes * @throws BadLocationException on insert failure */
Override the insert string method
insertString
{ "repo_name": "ta-apps/GpsPrune", "path": "src/tim/prune/gui/WholeNumberField.java", "license": "gpl-2.0", "size": 2075 }
[ "javax.swing.text.AttributeSet", "javax.swing.text.BadLocationException" ]
import javax.swing.text.AttributeSet; import javax.swing.text.BadLocationException;
import javax.swing.text.*;
[ "javax.swing" ]
javax.swing;
2,388,246
public Cursor fetchAll(Long failedActionID, String actionParameterName, String failedActionParameterData) { SQLiteQueryBuilder qb = new SQLiteQueryBuilder(); qb.setTables(DATABASE_TABLE); qb.appendWhere("1=1"); if (failedActionID != null) { qb.appendWhere(" AND " + KEY_FAILEDACTIONID + "...
Cursor function(Long failedActionID, String actionParameterName, String failedActionParameterData) { SQLiteQueryBuilder qb = new SQLiteQueryBuilder(); qb.setTables(DATABASE_TABLE); qb.appendWhere("1=1"); if (failedActionID != null) { qb.appendWhere(STR + KEY_FAILEDACTIONID + STR + failedActionID); } if (actionParameter...
/** * Return a Cursor that contains all FailedActionParameter records which matches the parameters. * * @param failedActionID * is id of failed action it belongs to, or null to fetch any * @param actionParameterName * name of action parameter, or null to fetch any * @param failed...
Return a Cursor that contains all FailedActionParameter records which matches the parameters
fetchAll
{ "repo_name": "biotinker/LibreTasks", "path": "LibreTasks/src/libretasks/app/model/db/FailedActionParameterDbAdapter.java", "license": "apache-2.0", "size": 9571 }
[ "android.database.Cursor", "android.database.sqlite.SQLiteQueryBuilder" ]
import android.database.Cursor; import android.database.sqlite.SQLiteQueryBuilder;
import android.database.*; import android.database.sqlite.*;
[ "android.database" ]
android.database;
1,648,369
final T fromJson(String json) throws IOException { return fromJson(new StringReader(json)); }
final T fromJson(String json) throws IOException { return fromJson(new StringReader(json)); }
/** * Converts the JSON document in {@code json} to a Java object. Unlike Gson's * similar {@link Gson#fromJson(String, Class) fromJson} method, this read is * strict. Create a {@link JsonReader#setLenient(boolean) lenient} {@code * JsonReader} and call {@link #read(JsonReader)} for lenient reading. * ...
Converts the JSON document in json to a Java object. Unlike Gson's similar <code>Gson#fromJson(String, Class) fromJson</code> method, this read is strict. Create a <code>JsonReader#setLenient(boolean) lenient</code> JsonReader and call <code>#read(JsonReader)</code> for lenient reading
fromJson
{ "repo_name": "IT--boy/newandbase", "path": "src/com/google/gson/TypeAdapter.java", "license": "apache-2.0", "size": 10854 }
[ "java.io.IOException", "java.io.StringReader" ]
import java.io.IOException; import java.io.StringReader;
import java.io.*;
[ "java.io" ]
java.io;
2,188,939
synchronized Block addStoredBlock(Block block, DatanodeDescriptor node, DatanodeDescriptor delNodeHint) { BlockInfo storedBlock = blocksMap.getStoredBlock(block); if (storedBlock == null) { // If we have a block in the block map wi...
synchronized Block addStoredBlock(Block block, DatanodeDescriptor node, DatanodeDescriptor delNodeHint) { BlockInfo storedBlock = blocksMap.getStoredBlock(block); if (storedBlock == null) { storedBlock = blocksMap.getStoredBlockWithoutMatchingGS(block); if (storedBlock == null) { return rejectAddStoredBlock( block, nod...
/** * Modify (block-->datanode) map. Remove block from set of * needed replications if this takes care of the problem. * @return the block that is stored in blockMap. */
Modify (block-->datanode) map. Remove block from set of needed replications if this takes care of the problem
addStoredBlock
{ "repo_name": "fchu/hadoop-0.20.205", "path": "src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java", "license": "apache-2.0", "size": 212199 }
[ "java.io.IOException", "java.util.Iterator", "org.apache.hadoop.hdfs.protocol.Block", "org.apache.hadoop.hdfs.server.namenode.BlocksMap" ]
import java.io.IOException; import java.util.Iterator; import org.apache.hadoop.hdfs.protocol.Block; import org.apache.hadoop.hdfs.server.namenode.BlocksMap;
import java.io.*; import java.util.*; import org.apache.hadoop.hdfs.protocol.*; import org.apache.hadoop.hdfs.server.namenode.*;
[ "java.io", "java.util", "org.apache.hadoop" ]
java.io; java.util; org.apache.hadoop;
1,709,552
public Rectangle2D getBounds() { return this.bounds; }
Rectangle2D function() { return this.bounds; }
/** * Returns the current bounds of the block. * * @return The bounds. * * @see #setBounds(Rectangle2D) */
Returns the current bounds of the block
getBounds
{ "repo_name": "nologic/nabs", "path": "client/trunk/shared/libraries/jfreechart-1.0.5/source/org/jfree/chart/block/AbstractBlock.java", "license": "gpl-2.0", "size": 20275 }
[ "java.awt.geom.Rectangle2D" ]
import java.awt.geom.Rectangle2D;
import java.awt.geom.*;
[ "java.awt" ]
java.awt;
2,100,954
interface UpdateStages { interface WithDefaultSecurityRules { Update withDefaultSecurityRules(List<SecurityRuleInner> defaultSecurityRules); }
interface UpdateStages { interface WithDefaultSecurityRules { Update withDefaultSecurityRules(List<SecurityRuleInner> defaultSecurityRules); }
/** * Specifies defaultSecurityRules. * @param defaultSecurityRules The default security rules of network security group * @return the next update stage */
Specifies defaultSecurityRules
withDefaultSecurityRules
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/network/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkSecurityGroup.java", "license": "mit", "size": 8538 }
[ "com.microsoft.azure.management.network.v2019_02_01.implementation.SecurityRuleInner", "java.util.List" ]
import com.microsoft.azure.management.network.v2019_02_01.implementation.SecurityRuleInner; import java.util.List;
import com.microsoft.azure.management.network.v2019_02_01.implementation.*; import java.util.*;
[ "com.microsoft.azure", "java.util" ]
com.microsoft.azure; java.util;
1,484,499
@Override public void injectEvents(HandlerManager eventBus) { // Event handling is done here. }
void function(HandlerManager eventBus) { }
/** * To handle events. * * @param eventBus HandlerManager */
To handle events
injectEvents
{ "repo_name": "kuzavas/ephesoft", "path": "dcma-gwt/dcma-gwt-admin/src/main/java/com/ephesoft/dcma/gwt/admin/bm/client/presenter/tableinfo/EditTableInfoPresenter.java", "license": "agpl-3.0", "size": 9561 }
[ "com.google.gwt.event.shared.HandlerManager" ]
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.event.shared.*;
[ "com.google.gwt" ]
com.google.gwt;
230,221
public Vector3 getPoint(float distance) { return Vector3.add(origin, direction.scaled(distance)); }
Vector3 function(float distance) { return Vector3.add(origin, direction.scaled(distance)); }
/** * Get a point at a distance along the ray. * * @param distance distance along the ray of the point * @return a new vector that represents a point at a distance along the ray. */
Get a point at a distance along the ray
getPoint
{ "repo_name": "google-ar/sceneform-android-sdk", "path": "sceneformsrc/sceneform/src/main/java/com/google/ar/sceneform/collision/Ray.java", "license": "apache-2.0", "size": 2389 }
[ "com.google.ar.sceneform.math.Vector3" ]
import com.google.ar.sceneform.math.Vector3;
import com.google.ar.sceneform.math.*;
[ "com.google.ar" ]
com.google.ar;
2,060,234
void addToBag(ObjectStoreBag osb, Integer element) throws ObjectStoreException;
void addToBag(ObjectStoreBag osb, Integer element) throws ObjectStoreException;
/** * Adds an element to an ObjectStoreBag. * * @param osb an ObjectStoreBag * @param element an Integer to add to the bag * @throws ObjectStoreException if an error occurs */
Adds an element to an ObjectStoreBag
addToBag
{ "repo_name": "julie-sullivan/phytomine", "path": "intermine/objectstore/main/src/org/intermine/objectstore/ObjectStoreWriter.java", "license": "lgpl-2.1", "size": 8152 }
[ "org.intermine.objectstore.query.ObjectStoreBag" ]
import org.intermine.objectstore.query.ObjectStoreBag;
import org.intermine.objectstore.query.*;
[ "org.intermine.objectstore" ]
org.intermine.objectstore;
1,876,172
public Observable<ServiceResponse<DatabaseInner>> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and...
Observable<ServiceResponse<DatabaseInner>> function(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (clusterName == null) { throw new IllegalArgumentException(STR); } if (databaseName == null) {...
/** * Creates or updates a database. * * @param resourceGroupName The name of the resource group containing the Kusto cluster. * @param clusterName The name of the Kusto cluster. * @param databaseName The name of the database in the Kusto cluster. * @param parameters The database parameter...
Creates or updates a database
createOrUpdateWithServiceResponseAsync
{ "repo_name": "navalev/azure-sdk-for-java", "path": "sdk/kusto/mgmt-v2019_05_15/src/main/java/com/microsoft/azure/management/kusto/v2019_05_15/implementation/DatabasesInner.java", "license": "mit", "size": 87420 }
[ "com.google.common.reflect.TypeToken", "com.microsoft.rest.ServiceResponse", "com.microsoft.rest.Validator" ]
import com.google.common.reflect.TypeToken; import com.microsoft.rest.ServiceResponse; import com.microsoft.rest.Validator;
import com.google.common.reflect.*; import com.microsoft.rest.*;
[ "com.google.common", "com.microsoft.rest" ]
com.google.common; com.microsoft.rest;
2,126,003
private static Artifact createSingleOptimizationAction( String runtypeSuffix, RuleContext ruleContext, String mnemonic, int optimizationPassNum, FilesToRunProvider executable, Artifact programJar, ImmutableList<Artifact> proguardSpecs, @Nullable Artifact proguardMapping...
static Artifact function( String runtypeSuffix, RuleContext ruleContext, String mnemonic, int optimizationPassNum, FilesToRunProvider executable, Artifact programJar, ImmutableList<Artifact> proguardSpecs, @Nullable Artifact proguardMapping, @Nullable Artifact proguardDictionary, NestedSet<Artifact> libraryJars, Progua...
/** * Creates a single build stage where the run type of the optimizer is "OPTMIZATION*" where "*" is * the value of the provided runtypeSuffix. For example, if runtypeSuffix is "_INITIAL", the run * type will be "OPTIMIZATION_INITIAL". * * @return The output artifact from the last "OPTIMIZATION*" stage....
Creates a single build stage where the run type of the optimizer is "OPTMIZATION*" where "*" is the value of the provided runtypeSuffix. For example, if runtypeSuffix is "_INITIAL", the run type will be "OPTIMIZATION_INITIAL"
createSingleOptimizationAction
{ "repo_name": "werkt/bazel", "path": "src/main/java/com/google/devtools/build/lib/rules/android/ProguardHelper.java", "license": "apache-2.0", "size": 26851 }
[ "com.google.common.base.Ascii", "com.google.common.collect.ImmutableList", "com.google.devtools.build.lib.actions.Artifact", "com.google.devtools.build.lib.analysis.FilesToRunProvider", "com.google.devtools.build.lib.analysis.RuleContext", "com.google.devtools.build.lib.analysis.actions.CustomCommandLine"...
import com.google.common.base.Ascii; import com.google.common.collect.ImmutableList; import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.analysis.FilesToRunProvider; import com.google.devtools.build.lib.analysis.RuleContext; import com.google.devtools.build.lib.analysis.actions.C...
import com.google.common.base.*; import com.google.common.collect.*; import com.google.devtools.build.lib.actions.*; import com.google.devtools.build.lib.analysis.*; import com.google.devtools.build.lib.analysis.actions.*; import com.google.devtools.build.lib.collect.nestedset.*; import javax.annotation.*;
[ "com.google.common", "com.google.devtools", "javax.annotation" ]
com.google.common; com.google.devtools; javax.annotation;
1,233,714
void waitInitialization() throws DOError;
void waitInitialization() throws DOError;
/** * Blocks the thread till the storage is initialized * @throws DOError throws an error in case of any issue */
Blocks the thread till the storage is initialized
waitInitialization
{ "repo_name": "beolnix/tcdop", "path": "tcdop-server/src/main/java/io/cyberstock/tcdop/server/integration/digitalocean/storage/CloudImageStorage.java", "license": "mit", "size": 2642 }
[ "io.cyberstock.tcdop.model.error.DOError" ]
import io.cyberstock.tcdop.model.error.DOError;
import io.cyberstock.tcdop.model.error.*;
[ "io.cyberstock.tcdop" ]
io.cyberstock.tcdop;
2,764,244
public static Mono<MatchResult> notMatch() { return Mono.just(new MatchResult(false, Collections.emptyMap())); } }
static Mono<MatchResult> function() { return Mono.just(new MatchResult(false, Collections.emptyMap())); } }
/** * Creates an instance of {@link MatchResult} that is not a match. * @return */
Creates an instance of <code>MatchResult</code> that is not a match
notMatch
{ "repo_name": "eddumelendez/spring-security", "path": "web/src/main/java/org/springframework/security/web/server/util/matcher/ServerWebExchangeMatcher.java", "license": "apache-2.0", "size": 2296 }
[ "java.util.Collections" ]
import java.util.Collections;
import java.util.*;
[ "java.util" ]
java.util;
1,763,063
protected void preGetSubLeafCollectors() throws IOException { }
void function() throws IOException { }
/** * Can be overridden by aggregator implementations that like the perform an operation before the leaf collectors * of children aggregators are instantiated for the next segment. */
Can be overridden by aggregator implementations that like the perform an operation before the leaf collectors of children aggregators are instantiated for the next segment
preGetSubLeafCollectors
{ "repo_name": "HonzaKral/elasticsearch", "path": "server/src/main/java/org/elasticsearch/search/aggregations/AggregatorBase.java", "license": "apache-2.0", "size": 10196 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,442,818
public PyObject nextset() { ensureOpen(); PyObject nextset = fetch.nextset(); // If the fetch is exhausted and multiple ResultSets are supported, try addding a // next ResultSet. XXX: DynamicFetch currently isn't so tailored for this if (!nextset.__nonzero__() && connection....
PyObject function() { ensureOpen(); PyObject nextset = fetch.nextset(); if (!nextset.__nonzero__() && connection.supportsMultipleResultSets && !dynamicFetch) { Statement stmt = statement.statement; try { boolean hasMoreResults; int updateCount = -1; if ((hasMoreResults = stmt.getMoreResults()) (updateCount = stmt.getUp...
/** * Move the result pointer to the next set if available. * * @return true if more sets exist, else None */
Move the result pointer to the next set if available
nextset
{ "repo_name": "alvin319/CarnotKE", "path": "jyhton/src/com/ziclix/python/sql/PyCursor.java", "license": "apache-2.0", "size": 36242 }
[ "java.sql.SQLException", "java.sql.Statement", "org.python.core.Py", "org.python.core.PyObject" ]
import java.sql.SQLException; import java.sql.Statement; import org.python.core.Py; import org.python.core.PyObject;
import java.sql.*; import org.python.core.*;
[ "java.sql", "org.python.core" ]
java.sql; org.python.core;
111,560
public List<Component> components() { return new LinkedList<Component>(components.values()); }
List<Component> function() { return new LinkedList<Component>(components.values()); }
/** * Fetches all components contained in this {@link Entity}. * @return a {@link List} containing this entity's components. */
Fetches all components contained in this <code>Entity</code>
components
{ "repo_name": "Nirei/Tobacco", "path": "tobacco-core/src/tobacco/core/entities/Entity.java", "license": "gpl-3.0", "size": 3259 }
[ "java.util.LinkedList", "java.util.List" ]
import java.util.LinkedList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,055,930
public synchronized ListenableFuture<?> waitForMinimumWorkers() { if (currentWorkerCount >= workerMinCount) { return immediateFuture(null); } SettableFuture<?> future = SettableFuture.create(); workerSizeFutures.add(future); // if future does not finish in w...
synchronized ListenableFuture<?> function() { if (currentWorkerCount >= workerMinCount) { return immediateFuture(null); } SettableFuture<?> future = SettableFuture.create(); workerSizeFutures.add(future); ScheduledFuture<?> timeoutTask = executor.schedule( () -> { synchronized (this) { future.setException(new PrestoExc...
/** * Returns a listener that completes when the minimum number of workers for the cluster has been met. * Note: caller should not add a listener using the direct executor, as this can delay the * notifications for other listeners. */
Returns a listener that completes when the minimum number of workers for the cluster has been met. Note: caller should not add a listener using the direct executor, as this can delay the notifications for other listeners
waitForMinimumWorkers
{ "repo_name": "mvp/presto", "path": "presto-main/src/main/java/com/facebook/presto/execution/ClusterSizeMonitor.java", "license": "apache-2.0", "size": 9196 }
[ "com.facebook.presto.spi.PrestoException", "com.google.common.util.concurrent.Futures", "com.google.common.util.concurrent.ListenableFuture", "com.google.common.util.concurrent.SettableFuture", "java.lang.String", "java.util.concurrent.ScheduledFuture" ]
import com.facebook.presto.spi.PrestoException; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; import java.lang.String; import java.util.concurrent.ScheduledFuture;
import com.facebook.presto.spi.*; import com.google.common.util.concurrent.*; import java.lang.*; import java.util.concurrent.*;
[ "com.facebook.presto", "com.google.common", "java.lang", "java.util" ]
com.facebook.presto; com.google.common; java.lang; java.util;
1,168,713
boolean removeBlockInfo(ReceivedDeletedBlockInfo blockInfo) { return (pendingIncrementalBR.remove(blockInfo.getBlock().getBlockId()) != null); } }
boolean removeBlockInfo(ReceivedDeletedBlockInfo blockInfo) { return (pendingIncrementalBR.remove(blockInfo.getBlock().getBlockId()) != null); } }
/** * Remove pending incremental block report for a single block if it * exists. * * @param blockInfo * @return true if a report was removed, false if no report existed for * the given block. */
Remove pending incremental block report for a single block if it exists
removeBlockInfo
{ "repo_name": "korrelate/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java", "license": "apache-2.0", "size": 36925 }
[ "org.apache.hadoop.hdfs.server.protocol.ReceivedDeletedBlockInfo" ]
import org.apache.hadoop.hdfs.server.protocol.ReceivedDeletedBlockInfo;
import org.apache.hadoop.hdfs.server.protocol.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,374,813
@Test public void testgetTreeHeight() { assertEquals(6, server.getTreeHeight()); }
void function() { assertEquals(6, server.getTreeHeight()); }
/** * Test the tree construction by checking the height */
Test the tree construction by checking the height
testgetTreeHeight
{ "repo_name": "factcenter/inchworm", "path": "src/test/java/org/factcenter/pathORam/test/LocalServerTest.java", "license": "mit", "size": 3270 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
1,695,707
@Test public void testSingleUser() throws IOException { final String input = readFile("userQuery2.xml"); final UserQueryResponse.Result response = new UserQueryResponseParser().parseResponse(input); logger.info("Result: {}", response); assertNotNull("Should not be null", respons...
void function() throws IOException { final String input = readFile(STR); final UserQueryResponse.Result response = new UserQueryResponseParser().parseResponse(input); logger.info(STR, response); assertNotNull(STR, response); assertEquals(STR, 1, (int) response.getTotalResults()); assertEquals(STR, 1, response.getUsers(...
/** * Validates we can parse a User query with single user response A-OK. */
Validates we can parse a User query with single user response A-OK
testSingleUser
{ "repo_name": "Crim/pardot-java-client", "path": "src/test/java/com/darksci/pardot/api/parser/user/UserQueryResponseParserTest.java", "license": "mit", "size": 4666 }
[ "com.darksci.pardot.api.response.user.UserQueryResponse", "java.io.IOException", "org.junit.Assert" ]
import com.darksci.pardot.api.response.user.UserQueryResponse; import java.io.IOException; import org.junit.Assert;
import com.darksci.pardot.api.response.user.*; import java.io.*; import org.junit.*;
[ "com.darksci.pardot", "java.io", "org.junit" ]
com.darksci.pardot; java.io; org.junit;
2,315,292
private byte convertToTxState(TransactionState state) { switch (state) { case PREPARED: return TxState.PREPARED; case COMMITTED: return TxState.COMMITTED; case ROLLED_BACK: return TxState.ABORTED; default: ...
byte function(TransactionState state) { switch (state) { case PREPARED: return TxState.PREPARED; case COMMITTED: return TxState.COMMITTED; case ROLLED_BACK: return TxState.ABORTED; default: throw new IllegalStateException(STR); } }
/** * Convert {@link TransactionState} to Mvcc {@link TxState}. * * @param state TransactionState. * @return TxState. */
Convert <code>TransactionState</code> to Mvcc <code>TxState</code>
convertToTxState
{ "repo_name": "samaitra/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java", "license": "apache-2.0", "size": 127324 }
[ "org.apache.ignite.internal.processors.cache.mvcc.txlog.TxState", "org.apache.ignite.transactions.TransactionState" ]
import org.apache.ignite.internal.processors.cache.mvcc.txlog.TxState; import org.apache.ignite.transactions.TransactionState;
import org.apache.ignite.internal.processors.cache.mvcc.txlog.*; import org.apache.ignite.transactions.*;
[ "org.apache.ignite" ]
org.apache.ignite;
827,735
protected void createAbstractMethod(String messageName, String operationName, MethodDeclaration operation) throws JavaModelException { JavaAstElementFactory javaFactory = JavaAstElementFactory.getInstance(); JavaAstModelProducer producer = JavaAstModelProducer.getInstance(); ja...
void function(String messageName, String operationName, MethodDeclaration operation) throws JavaModelException { JavaAstElementFactory javaFactory = JavaAstElementFactory.getInstance(); JavaAstModelProducer producer = JavaAstModelProducer.getInstance(); javaFactory.getJavaAstMethod().setMethodName(operation, operationN...
/** * Create the callback method. * * @param messageName * the message name * @param operationName * the operation name * @param operation * the method declaration * * @throws JavaModelException */
Create the callback method
createAbstractMethod
{ "repo_name": "NABUCCO/org.nabucco.framework.generator", "path": "org.nabucco.framework.generator.compiler/src/main/org/nabucco/framework/generator/compiler/transformation/java/application/connector/NabuccoToJavaServiceTargetServiceLinkVisitor.java", "license": "epl-1.0", "size": 17778 }
[ "java.util.List", "org.eclipse.jdt.internal.compiler.ast.Argument", "org.eclipse.jdt.internal.compiler.ast.MethodDeclaration", "org.eclipse.jdt.internal.compiler.ast.TypeReference", "org.nabucco.framework.mda.model.java.JavaModelException", "org.nabucco.framework.mda.model.java.ast.element.JavaAstElementF...
import java.util.List; import org.eclipse.jdt.internal.compiler.ast.Argument; import org.eclipse.jdt.internal.compiler.ast.MethodDeclaration; import org.eclipse.jdt.internal.compiler.ast.TypeReference; import org.nabucco.framework.mda.model.java.JavaModelException; import org.nabucco.framework.mda.model.java.ast.elemen...
import java.util.*; import org.eclipse.jdt.internal.compiler.ast.*; import org.nabucco.framework.mda.model.java.*; import org.nabucco.framework.mda.model.java.ast.element.*; import org.nabucco.framework.mda.model.java.ast.produce.*;
[ "java.util", "org.eclipse.jdt", "org.nabucco.framework" ]
java.util; org.eclipse.jdt; org.nabucco.framework;
2,310,693
public final Node lastWeightedChild() { List<Node> kids = getChildren(); Node weightedChild = null; for(Node child : kids) { if ( !child.isVisible()) continue; if (child.getWeight() > 0.0) { weightedChild = child; } } return weightedChild; ...
final Node function() { List<Node> kids = getChildren(); Node weightedChild = null; for(Node child : kids) { if ( !child.isVisible()) continue; if (child.getWeight() > 0.0) { weightedChild = child; } } return weightedChild; } public String getName() { return name; }
/** * Convenience method that returns the last child whose weight * is > 0.0. * * @return the last child whose weight is > 0.0. * @see #getChildren * @see Node#getWeight */
Convenience method that returns the last child whose weight is > 0.0
lastWeightedChild
{ "repo_name": "syncer/swingx", "path": "swingx-core/src/main/java/org/jdesktop/swingx/MultiSplitLayout.java", "license": "lgpl-2.1", "size": 73438 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,561,707
@Override public Concept intersect(final Concept that) { return new Concept(new MutableBitSet(), this.and(that)); }
Concept function(final Concept that) { return new Concept(new MutableBitSet(), this.and(that)); }
/** * Find the intersection of two concepts * @param that concept * @return a concept with empty extent and intent corresponding to the * intersection of this and that intent */
Find the intersection of two concepts
intersect
{ "repo_name": "heuermh/ngs", "path": "fca/src/main/java/org/nmdp/ngs/fca/Concept.java", "license": "lgpl-3.0", "size": 4805 }
[ "org.dishevelled.bitset.MutableBitSet" ]
import org.dishevelled.bitset.MutableBitSet;
import org.dishevelled.bitset.*;
[ "org.dishevelled.bitset" ]
org.dishevelled.bitset;
545,950
public final CursorPage<DmMeeting> queryPageByLocationId(java.lang.String locationId, int pageSize, String cursorString) { final Filter filter = createEqualsFilter(COLUMN_NAME_LOCATIONID, locationId); return queryPage(false, pageSize, null, null, null, false, null, false, cursorSt...
final CursorPage<DmMeeting> function(java.lang.String locationId, int pageSize, String cursorString) { final Filter filter = createEqualsFilter(COLUMN_NAME_LOCATIONID, locationId); return queryPage(false, pageSize, null, null, null, false, null, false, cursorString, filter); } /** * {@inheritDoc}
/** * query-page-by method for field locationId * @param locationId the specified attribute * @param pageSize the number of domain entities in the page * @param cursorString non-null if get next page * @return a Page of DmMeetings for the specified locationId */
query-page-by method for field locationId
queryPageByLocationId
{ "repo_name": "goldengekko/Meetr-Backend", "path": "src/main/java/com/goldengekko/meetr/dao/GeneratedDmMeetingDaoImpl.java", "license": "gpl-3.0", "size": 68599 }
[ "com.goldengekko.meetr.domain.DmMeeting", "net.sf.mardao.core.CursorPage", "net.sf.mardao.core.Filter" ]
import com.goldengekko.meetr.domain.DmMeeting; import net.sf.mardao.core.CursorPage; import net.sf.mardao.core.Filter;
import com.goldengekko.meetr.domain.*; import net.sf.mardao.core.*;
[ "com.goldengekko.meetr", "net.sf.mardao" ]
com.goldengekko.meetr; net.sf.mardao;
2,138,747
@Override public Instance generateExample() throws Exception { Instance result; double salary; double commission; double hvalue; double loan; int age; int elevel; int car; int zipcode; int hyears; boolean desiredClassFound; double[] atts; Random random; ClassF...
Instance function() throws Exception { Instance result; double salary; double commission; double hvalue; double loan; int age; int elevel; int car; int zipcode; int hyears; boolean desiredClassFound; double[] atts; Random random; ClassFunction classFunction; result = null; random = getRandom(); if (m_DatasetFormat == n...
/** * Generates one example of the dataset. * * @return the generated example * @throws Exception if the format of the dataset is not yet defined * @throws Exception if the generator only works with generateExamples which * means in non single mode */
Generates one example of the dataset
generateExample
{ "repo_name": "mydzigear/weka.kmeanspp.silhouette_score", "path": "src/weka/datagenerators/classifiers/classification/Agrawal.java", "license": "gpl-3.0", "size": 27827 }
[ "java.util.Random" ]
import java.util.Random;
import java.util.*;
[ "java.util" ]
java.util;
310,820
@Metadata(description = "To set a value for minimum number of threads in server thread pool. Notice that both a min and max size must be configured.", label = "consumer") public void setMinThreads(Integer minThreads) { this.minThreads = minThreads; }
@Metadata(description = STR, label = STR) void function(Integer minThreads) { this.minThreads = minThreads; }
/** * To set a value for minimum number of threads in server thread pool. Notice that both a min and max size must be configured. */
To set a value for minimum number of threads in server thread pool. Notice that both a min and max size must be configured
setMinThreads
{ "repo_name": "Fabryprog/camel", "path": "components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java", "license": "apache-2.0", "size": 65017 }
[ "org.apache.camel.spi.Metadata" ]
import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.*;
[ "org.apache.camel" ]
org.apache.camel;
2,875,075
public void addActivityStatusConditions(Collection simpleConditionNodeCollection, Set fromTables) throws DAOException, ClassNotFoundException { // Creating aliasName set with full package names. // Required for checking the activityStatus. Iterator fromTableSetIterator = fromTables.iterator(); // C...
void function(Collection simpleConditionNodeCollection, Set fromTables) throws DAOException, ClassNotFoundException { Iterator fromTableSetIterator = fromTables.iterator(); List activityStatusConditionList = new ArrayList(); while (fromTableSetIterator.hasNext()) { String alias = (String) fromTableSetIterator.next(); S...
/** * Adds the activity status conditions for all the objects in the from clause. * @param simpleConditionNodeCollection The SimpleConditionsNode Collection. * @param fromTables Set of tables in the from clause of the query. * @param simpleConditionsNode The last condition in the simpleConditionNode's Colle...
Adds the activity status conditions for all the objects in the from clause
addActivityStatusConditions
{ "repo_name": "NCIP/wustl-common-package", "path": "src/edu/wustl/common/bizlogic/SimpleQueryBizLogic.java", "license": "bsd-3-clause", "size": 31268 }
[ "edu.wustl.common.query.SimpleConditionsNode", "edu.wustl.common.util.dbManager.DAOException", "edu.wustl.common.util.global.Constants", "java.util.ArrayList", "java.util.Collection", "java.util.Iterator", "java.util.List", "java.util.Set" ]
import edu.wustl.common.query.SimpleConditionsNode; import edu.wustl.common.util.dbManager.DAOException; import edu.wustl.common.util.global.Constants; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.Set;
import edu.wustl.common.query.*; import edu.wustl.common.util.*; import edu.wustl.common.util.global.*; import java.util.*;
[ "edu.wustl.common", "java.util" ]
edu.wustl.common; java.util;
394,410
public static void printStatus(String position) { System.out.println("WRITE BUFFER STATUS ("+position+") --"); //print buffer meta data System.out.println("\tWB: Buffer Meta Data: " + "limit="+_limit+", " + "size[bytes]="+_size+", " + "size[elements]="+_mQueue.size()+"/"+_mQueue....
static void function(String position) { System.out.println(STR+position+STR); System.out.println(STR + STR+_limit+STR + STR+_size+STR + STR+_mQueue.size()+"/"+_mQueue.size()); int count = _mQueue.size(); for( Entry<String, ByteBuffer> entry : _mQueue.entrySet() ) { String fname = entry.getKey(); ByteBuffer bbuff = entr...
/** * Print current status of buffer pool, including all entries. * NOTE: use only for debugging or testing. * * @param position the position */
Print current status of buffer pool, including all entries
printStatus
{ "repo_name": "dusenberrymw/systemml", "path": "src/main/java/org/apache/sysml/runtime/controlprogram/caching/LazyWriteBuffer.java", "license": "apache-2.0", "size": 8905 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,418,549
protected ModelCheckerResult computeReachRewardsValIter(STPG stpg, STPGRewards rewards, BitSet target, BitSet inf, boolean min1, boolean min2, double init[], BitSet known) throws PrismException { System.out.println("test from compute reach rewards value iteration"); ModelCheckerResult res; BitSet unknown, ...
ModelCheckerResult function(STPG stpg, STPGRewards rewards, BitSet target, BitSet inf, boolean min1, boolean min2, double init[], BitSet known) throws PrismException { System.out.println(STR); ModelCheckerResult res; BitSet unknown, notInf; int i, n, iters; double soln[], soln2[], tmpsoln[]; int adv[] = null; boolean g...
/** * Compute expected reachability rewards using value iteration. * @param stpg The STPG * @param rewards The rewards * @param target Target states * @param inf States for which reward is infinite * @param min1 Min or max rewards for player 1 (true=min, false=max) * @param min2 Min or max rewards for pla...
Compute expected reachability rewards using value iteration
computeReachRewardsValIter
{ "repo_name": "azlanismail/prismgames", "path": "src/explicit/STPGModelChecker.java", "license": "gpl-2.0", "size": 65353 }
[ "java.util.BitSet" ]
import java.util.BitSet;
import java.util.*;
[ "java.util" ]
java.util;
1,497,599
EReference getEntity_SuperType();
EReference getEntity_SuperType();
/** * Returns the meta object for the reference '{@link org.eclipse.vorto.core.api.model.datatype.Entity#getSuperType <em>Super Type</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the reference '<em>Super Type</em>'. * @see org.eclipse.vorto.core.api.model.datatype.Ent...
Returns the meta object for the reference '<code>org.eclipse.vorto.core.api.model.datatype.Entity#getSuperType Super Type</code>'.
getEntity_SuperType
{ "repo_name": "hrohmer/vorto", "path": "bundles/org.eclipse.vorto.core/src/org/eclipse/vorto/core/api/model/datatype/DatatypePackage.java", "license": "epl-1.0", "size": 57755 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
194,916
@Override public void setDecoderStateListener(Listener<DecoderStateEvent> listener) { mDecoderStateListener = listener; }
void function(Listener<DecoderStateEvent> listener) { mDecoderStateListener = listener; }
/** * Adds a decoder state event listener */
Adds a decoder state event listener
setDecoderStateListener
{ "repo_name": "ImagoTrigger/sdrtrunk", "path": "src/main/java/io/github/dsheirer/channel/state/AbstractDecoderState.java", "license": "gpl-3.0", "size": 4812 }
[ "io.github.dsheirer.sample.Listener" ]
import io.github.dsheirer.sample.Listener;
import io.github.dsheirer.sample.*;
[ "io.github.dsheirer" ]
io.github.dsheirer;
73,057
public MapUpdate removeCounter(String key) { BinaryValue k = BinaryValue.create(key); removes.add(new MapOp.MapField(MapOp.FieldType.COUNTER, k)); return this; }
MapUpdate function(String key) { BinaryValue k = BinaryValue.create(key); removes.add(new MapOp.MapField(MapOp.FieldType.COUNTER, k)); return this; }
/** * Update the map in Riak by removing the counter mapped to the provided key. * @param key the key the counter is mapped to. * @return a reference to this object. */
Update the map in Riak by removing the counter mapped to the provided key
removeCounter
{ "repo_name": "basho/riak-java-client", "path": "src/main/java/com/basho/riak/client/api/commands/datatypes/MapUpdate.java", "license": "apache-2.0", "size": 6739 }
[ "com.basho.riak.client.core.query.crdt.ops.MapOp", "com.basho.riak.client.core.util.BinaryValue" ]
import com.basho.riak.client.core.query.crdt.ops.MapOp; import com.basho.riak.client.core.util.BinaryValue;
import com.basho.riak.client.core.query.crdt.ops.*; import com.basho.riak.client.core.util.*;
[ "com.basho.riak" ]
com.basho.riak;
1,158,255
public ViewProperties withTimeframe(ReportTimeframeType timeframe) { if (this.innerQuery() == null) { this.innerQuery = new ReportConfigDefinition(); } this.innerQuery().withTimeframe(timeframe); return this; }
ViewProperties function(ReportTimeframeType timeframe) { if (this.innerQuery() == null) { this.innerQuery = new ReportConfigDefinition(); } this.innerQuery().withTimeframe(timeframe); return this; }
/** * Set the timeframe property: The time frame for pulling data for the report. If custom, then a specific time * period must be provided. * * @param timeframe the timeframe value to set. * @return the ViewProperties object itself. */
Set the timeframe property: The time frame for pulling data for the report. If custom, then a specific time period must be provided
withTimeframe
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/costmanagement/azure-resourcemanager-costmanagement/src/main/java/com/azure/resourcemanager/costmanagement/fluent/models/ViewProperties.java", "license": "mit", "size": 15552 }
[ "com.azure.resourcemanager.costmanagement.models.ReportTimeframeType" ]
import com.azure.resourcemanager.costmanagement.models.ReportTimeframeType;
import com.azure.resourcemanager.costmanagement.models.*;
[ "com.azure.resourcemanager" ]
com.azure.resourcemanager;
2,191,219
protected JLVReactantsMap getJLVReactantsMap() throws TermLoadException { return new JLVReactantsMap(this.oDBConnection); }
JLVReactantsMap function() throws TermLoadException { return new JLVReactantsMap(this.oDBConnection); }
/** * Return a handle to the JLVReactantsMap object. * * @return The handle to the JLVReactantsMap * @throws TermLoadException This error is thrown if there is any exception. */
Return a handle to the JLVReactantsMap object
getJLVReactantsMap
{ "repo_name": "KRMAssociatesInc/eHMP", "path": "ehmp/product/production/hmp-main/src/main/java/gov/va/cpe/vpr/termeng/jlv/JLVHddDao.java", "license": "apache-2.0", "size": 11604 }
[ "gov.va.cpe.vpr.termeng.TermLoadException" ]
import gov.va.cpe.vpr.termeng.TermLoadException;
import gov.va.cpe.vpr.termeng.*;
[ "gov.va.cpe" ]
gov.va.cpe;
2,905,663
@Generated(value = "com.sun.tools.xjc.Driver", date = "2015-10-25T05:29:34+06:00", comments = "JAXB RI v2.2.11") public long getRadiustype() { return radiustype; }
@Generated(value = STR, date = STR, comments = STR) long function() { return radiustype; }
/** * Gets the value of the radiustype property. * */
Gets the value of the radiustype property
getRadiustype
{ "repo_name": "kanonirov/lanb-client", "path": "src/main/java/ru/lanbilling/webservice/wsdl/SoapDictionary.java", "license": "mit", "size": 8749 }
[ "javax.annotation.Generated" ]
import javax.annotation.Generated;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
1,622,494
public void unregisterSource(ProgressSource pi) { synchronized(progressSourceList) { // Return if ProgressEvent does not exist if (progressSourceList.contains(pi) == false) return; // Close entry and remove from map pi.close(); pr...
void function(ProgressSource pi) { synchronized(progressSourceList) { if (progressSourceList.contains(pi) == false) return; pi.close(); progressSourceList.remove(pi); } if (progressListenerList.size() > 0) { ArrayList<ProgressListener> listeners = new ArrayList<ProgressListener>(); synchronized(progressListenerList) { ...
/** * Unregister progress source when progress is finished. */
Unregister progress source when progress is finished
unregisterSource
{ "repo_name": "TheTypoMaster/Scaper", "path": "openjdk/jdk/src/share/classes/sun/net/ProgressMonitor.java", "license": "gpl-2.0", "size": 8707 }
[ "java.util.ArrayList", "java.util.Iterator" ]
import java.util.ArrayList; import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
160,518
Effort saveEffort(Effort timeEffort) throws PersistenceException;
Effort saveEffort(Effort timeEffort) throws PersistenceException;
/** * Saves a new timeEffort or updates an existing one. * * @param timeEffort the timeEffort to be saved * @return saved Effort * @throws PersistenceException if Parameter is null or another Exception is * thrown */
Saves a new timeEffort or updates an existing one
saveEffort
{ "repo_name": "tita/tita", "path": "tita-business/src/main/java/at/ac/tuwien/ifs/tita/business/service/time/IEffortService.java", "license": "apache-2.0", "size": 6641 }
[ "at.ac.tuwien.ifs.tita.entity.Effort", "javax.persistence.PersistenceException" ]
import at.ac.tuwien.ifs.tita.entity.Effort; import javax.persistence.PersistenceException;
import at.ac.tuwien.ifs.tita.entity.*; import javax.persistence.*;
[ "at.ac.tuwien", "javax.persistence" ]
at.ac.tuwien; javax.persistence;
673,407
List<Metric> poll(MetricFilter filter); /** * Fetch the current values for a set of metrics that match the provided * filter. This method should be cheap, thread-safe, and interruptible so * that it can be called frequently to collect metrics at a regular * interval. * * @param fi...
List<Metric> poll(MetricFilter filter); /** * Fetch the current values for a set of metrics that match the provided * filter. This method should be cheap, thread-safe, and interruptible so * that it can be called frequently to collect metrics at a regular * interval. * * @param filter retricts the set of metrics * @par...
/** * Fetch the current values for a set of metrics that match the provided * filter. This method should be cheap, thread-safe, and interruptible so * that it can be called frequently to collect metrics at a regular * interval. * * @param filter retricts the set of metrics * @return ...
Fetch the current values for a set of metrics that match the provided filter. This method should be cheap, thread-safe, and interruptible so that it can be called frequently to collect metrics at a regular interval
poll
{ "repo_name": "dmuino/servo", "path": "servo-core/src/main/java/com/netflix/servo/publish/MetricPoller.java", "license": "apache-2.0", "size": 1800 }
[ "com.netflix.servo.Metric", "java.util.List" ]
import com.netflix.servo.Metric; import java.util.List;
import com.netflix.servo.*; import java.util.*;
[ "com.netflix.servo", "java.util" ]
com.netflix.servo; java.util;
1,912,750
UnionBuilder annotatedWith(final Class<? extends Annotation> annotation); /** * Returns classes marked with given modifiers. * @param modifiers modifiers to expect, see {@link Modifier}
UnionBuilder annotatedWith(final Class<? extends Annotation> annotation); /** * Returns classes marked with given modifiers. * @param modifiers modifiers to expect, see {@link Modifier}
/** * Returns classes annotated with given annotation. * <p> * As opposed to {@link ClassIndex#getAnnotated(Class)} this method only works if annotation * is itself annotation with {@link Retention} set to {@link RetentionPolicy#RUNTIME}. * </p> * @throws IllegalStateException if annotation retention ...
Returns classes annotated with given annotation. As opposed to <code>ClassIndex#getAnnotated(Class)</code> this method only works if annotation is itself annotation with <code>Retention</code> set to <code>RetentionPolicy#RUNTIME</code>.
annotatedWith
{ "repo_name": "soklet/soklet", "path": "src/main/java/com/soklet/classindex/ClassFilter.java", "license": "apache-2.0", "size": 7872 }
[ "java.lang.annotation.Annotation", "java.lang.reflect.Modifier" ]
import java.lang.annotation.Annotation; import java.lang.reflect.Modifier;
import java.lang.annotation.*; import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
1,099,007
public ClosableIterator<Thing> getAllGivennames() { return Base.getAll(this.model, this.getResource(), GIVENNAME, Thing.class); }
ClosableIterator<Thing> function() { return Base.getAll(this.model, this.getResource(), GIVENNAME, Thing.class); }
/** * Get all values of property Givenname * @return a ClosableIterator of * $type [Generated from RDFReactor template rule #get12dynamic] */
Get all values of property Givenname $type [Generated from RDFReactor template rule #get12dynamic]
getAllGivennames
{ "repo_name": "m0ep/master-thesis", "path": "source/apis/rdf2go/rdf2go-foaf/src/main/java/com/xmlns/foaf/Thing.java", "license": "mit", "size": 274766 }
[ "org.ontoware.aifbcommons.collection.ClosableIterator", "org.ontoware.rdfreactor.runtime.Base" ]
import org.ontoware.aifbcommons.collection.ClosableIterator; import org.ontoware.rdfreactor.runtime.Base;
import org.ontoware.aifbcommons.collection.*; import org.ontoware.rdfreactor.runtime.*;
[ "org.ontoware.aifbcommons", "org.ontoware.rdfreactor" ]
org.ontoware.aifbcommons; org.ontoware.rdfreactor;
2,809,868
@SuppressWarnings("deprecation") CuratorCacheBridgeBuilder withExecutorService(ExecutorService executorService);
@SuppressWarnings(STR) CuratorCacheBridgeBuilder withExecutorService(ExecutorService executorService);
/** * If the old {@link org.apache.curator.framework.recipes.cache.TreeCache} is used by the bridge * (i.e. you are using ZooKeeper 3.5.x) then this executor service is passed to {@link org.apache.curator.framework.recipes.cache.TreeCache.Builder#setExecutor(java.util.concurrent.ExecutorService)}. * For ...
If the old <code>org.apache.curator.framework.recipes.cache.TreeCache</code> is used by the bridge (i.e. you are using ZooKeeper 3.5.x) then this executor service is passed to <code>org.apache.curator.framework.recipes.cache.TreeCache.Builder#setExecutor(java.util.concurrent.ExecutorService)</code>. For <code>org.apach...
withExecutorService
{ "repo_name": "mosoft521/curator", "path": "curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/CuratorCacheBridgeBuilder.java", "license": "apache-2.0", "size": 2232 }
[ "java.util.concurrent.ExecutorService" ]
import java.util.concurrent.ExecutorService;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
2,447,423
private String getAdminConsoleURL(HttpServletRequest request) { String url = CarbonUIUtil.getAdminConsoleURL(request); if (!url.endsWith("/")) { url = url + "/"; } if (url.indexOf("/acs") != -1) { url = url.replace("/acs", ""); } return url; ...
String function(HttpServletRequest request) { String url = CarbonUIUtil.getAdminConsoleURL(request); if (!url.endsWith("/")) { url = url + "/"; } if (url.indexOf("/acs") != -1) { url = url.replace("/acs", ""); } return url; }
/** * Get the admin console url from the request. * * @param request httpServletReq that hits the ACS Servlet * @return Admin Console URL https://10.100.1.221:8443/acs/carbon/ */
Get the admin console url from the request
getAdminConsoleURL
{ "repo_name": "malakasilva/carbon-identity", "path": "components/authenticators/saml2-sso-authenticator/org.wso2.carbon.identity.authenticator.saml2.sso.ui/src/main/java/org/wso2/carbon/identity/authenticator/saml2/sso/ui/SSOAssertionConsumerService.java", "license": "apache-2.0", "size": 18055 }
[ "javax.servlet.http.HttpServletRequest", "org.wso2.carbon.ui.CarbonUIUtil" ]
import javax.servlet.http.HttpServletRequest; import org.wso2.carbon.ui.CarbonUIUtil;
import javax.servlet.http.*; import org.wso2.carbon.ui.*;
[ "javax.servlet", "org.wso2.carbon" ]
javax.servlet; org.wso2.carbon;
1,580,088
public ChatClientBuilder configuration(Configuration configuration) { this.configuration = configuration; return this; }
ChatClientBuilder function(Configuration configuration) { this.configuration = configuration; return this; }
/** * Sets the configuration object used to retrieve environment configuration values during building of the client. * * @param configuration Configuration store used to retrieve environment configurations. * @return the updated BlobServiceClientBuilder object */
Sets the configuration object used to retrieve environment configuration values during building of the client
configuration
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/communication/azure-communication-chat/src/main/java/com/azure/communication/chat/ChatClientBuilder.java", "license": "mit", "size": 8680 }
[ "com.azure.core.util.Configuration" ]
import com.azure.core.util.Configuration;
import com.azure.core.util.*;
[ "com.azure.core" ]
com.azure.core;
2,777,928
public void setCustomer(Map<String, String> customer) { this.customer = customer; }
void function(Map<String, String> customer) { this.customer = customer; }
/** * Sets the customer attribute value. * @param customer The customer to set. */
Sets the customer attribute value
setCustomer
{ "repo_name": "Ariah-Group/Finance", "path": "af_webapp/src/main/java/org/kuali/kfs/module/ar/report/util/CustomerInvoiceReportDataHolder.java", "license": "apache-2.0", "size": 4184 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
855,146
private void waitForPreviewToBeCreated(CloudProviderFileHandleInterface fileHandle) throws InterruptedException, SynapseException { long start = System.currentTimeMillis(); while(fileHandle.getPreviewId() == null){ System.out.println("Waiting for a preview file to be created"); Thread.sleep(1000); ...
void function(CloudProviderFileHandleInterface fileHandle) throws InterruptedException, SynapseException { long start = System.currentTimeMillis(); while(fileHandle.getPreviewId() == null){ System.out.println(STR); Thread.sleep(1000); assertTrue((System.currentTimeMillis()-start) < MAX_WAIT_MS, STR); fileHandle = (Clou...
/** * Wait for a preview to be generated for the given file handle. * @throws InterruptedException * @throws SynapseException */
Wait for a preview to be generated for the given file handle
waitForPreviewToBeCreated
{ "repo_name": "Sage-Bionetworks/Synapse-Repository-Services", "path": "integration-test/src/test/java/org/sagebionetworks/IT055WikiPageTest.java", "license": "apache-2.0", "size": 7798 }
[ "org.junit.jupiter.api.Assertions", "org.sagebionetworks.client.exceptions.SynapseException", "org.sagebionetworks.repo.model.file.CloudProviderFileHandleInterface" ]
import org.junit.jupiter.api.Assertions; import org.sagebionetworks.client.exceptions.SynapseException; import org.sagebionetworks.repo.model.file.CloudProviderFileHandleInterface;
import org.junit.jupiter.api.*; import org.sagebionetworks.client.exceptions.*; import org.sagebionetworks.repo.model.file.*;
[ "org.junit.jupiter", "org.sagebionetworks.client", "org.sagebionetworks.repo" ]
org.junit.jupiter; org.sagebionetworks.client; org.sagebionetworks.repo;
1,661,857
@SuppressWarnings("unchecked") public static RepositoryManager getRepositoryManagerServiceFromFactory( String serviceFactory) { RepositoryManagerFactory factory; Class<RepositoryManagerFactory> clazz; try { clazz = (Class<RepositoryManagerFactory>) Class.forName(...
@SuppressWarnings(STR) static RepositoryManager function( String serviceFactory) { RepositoryManagerFactory factory; Class<RepositoryManagerFactory> clazz; try { clazz = (Class<RepositoryManagerFactory>) Class.forName(serviceFactory); factory = clazz.newInstance(); return factory.createRepositoryManager(); } catch (Cla...
/** * <p> * Constructs a new {@link RepositoryManager} from the specified * <code>serviceFactory</code>. * </p> * * @param serviceFactory * The class name of the service factory used to create new * RepositoryManager objects. * @return A newly construc...
Constructs a new <code>RepositoryManager</code> from the specified <code>serviceFactory</code>.
getRepositoryManagerServiceFromFactory
{ "repo_name": "lewismc/oodt", "path": "filemgr/src/main/java/org/apache/oodt/cas/filemgr/util/GenericFileManagerObjectFactory.java", "license": "apache-2.0", "size": 14483 }
[ "java.util.logging.Level", "org.apache.oodt.cas.filemgr.repository.RepositoryManager", "org.apache.oodt.cas.filemgr.repository.RepositoryManagerFactory" ]
import java.util.logging.Level; import org.apache.oodt.cas.filemgr.repository.RepositoryManager; import org.apache.oodt.cas.filemgr.repository.RepositoryManagerFactory;
import java.util.logging.*; import org.apache.oodt.cas.filemgr.repository.*;
[ "java.util", "org.apache.oodt" ]
java.util; org.apache.oodt;
1,263,754
public void killOneBackupZooKeeperServer() throws IOException, InterruptedException { if (!started || activeZKServerIndex < 0 || standaloneServerFactoryList.size() <= 1) { return; } int backupZKServerIndex = activeZKServerIndex + 1; // Shutdown the current active one NIOServerCnxn...
void function() throws IOException, InterruptedException { if (!started activeZKServerIndex < 0 standaloneServerFactoryList.size() <= 1) { return; } int backupZKServerIndex = activeZKServerIndex + 1; NIOServerCnxnFactory standaloneServerFactory = standaloneServerFactoryList.get(backupZKServerIndex); int clientPort = cl...
/** * Kill one back up ZK servers * * @throws IOException * @throws InterruptedException */
Kill one back up ZK servers
killOneBackupZooKeeperServer
{ "repo_name": "mattyb149/incubator-drill", "path": "exec/java-exec/src/test/java/org/apache/drill/exec/util/MiniZooKeeperCluster.java", "license": "apache-2.0", "size": 11581 }
[ "java.io.IOException", "org.apache.zookeeper.server.NIOServerCnxnFactory" ]
import java.io.IOException; import org.apache.zookeeper.server.NIOServerCnxnFactory;
import java.io.*; import org.apache.zookeeper.server.*;
[ "java.io", "org.apache.zookeeper" ]
java.io; org.apache.zookeeper;
2,391,039
Customer findCustomer(Integer id);
Customer findCustomer(Integer id);
/** * Finds a {@link Customer} with given primary key. * * @param id * primary key * @return found {@link Customer} entity */
Finds a <code>Customer</code> with given primary key
findCustomer
{ "repo_name": "CIT-VSB-TUO/ResBill", "path": "resbill/src/main/java/cz/vsb/resbill/dao/CustomerDAO.java", "license": "bsd-3-clause", "size": 1272 }
[ "cz.vsb.resbill.model.Customer" ]
import cz.vsb.resbill.model.Customer;
import cz.vsb.resbill.model.*;
[ "cz.vsb.resbill" ]
cz.vsb.resbill;
1,437,314
public DateTime ifUnmodifiedSince() { if (this.ifUnmodifiedSince == null) { return null; } return this.ifUnmodifiedSince.getDateTime(); }
DateTime function() { if (this.ifUnmodifiedSince == null) { return null; } return this.ifUnmodifiedSince.getDateTime(); }
/** * Get the ifUnmodifiedSince value. * * @return the ifUnmodifiedSince value */
Get the ifUnmodifiedSince value
ifUnmodifiedSince
{ "repo_name": "pomortaz/azure-sdk-for-java", "path": "azure-batch/src/main/java/com/microsoft/azure/batch/protocol/models/JobScheduleDeleteOptions.java", "license": "mit", "size": 6927 }
[ "org.joda.time.DateTime" ]
import org.joda.time.DateTime;
import org.joda.time.*;
[ "org.joda.time" ]
org.joda.time;
2,812,250
// Create a new instance of the application and make the currently // running thread the application's event dispatch thread. final LocationPickerDemo app = new LocationPickerDemo(); app.enterEventDispatcher(); } public LocationPickerDemo() { pushScreen(new LocationP...
final LocationPickerDemo app = new LocationPickerDemo(); app.enterEventDispatcher(); } public LocationPickerDemo() { pushScreen(new LocationPickerDemoScreen()); } static class LocationPickerDemoScreen extends MainScreen implements LocationPicker.Listener, FieldChangeListener { private final LocationPicker _locationPick...
/** * Entry point for application * * @param args * Command line arguments (not used) */
Entry point for application
main
{ "repo_name": "blackberry/JDE-Samples", "path": "com/rim/samples/device/ui/locationpickerdemo/LocationPickerDemo.java", "license": "apache-2.0", "size": 9594 }
[ "java.util.Enumeration", "javax.microedition.location.Landmark", "javax.microedition.location.QualifiedCoordinates", "net.rim.device.api.gps.GPSInfo", "net.rim.device.api.lbs.picker.ContactsLocationPicker", "net.rim.device.api.lbs.picker.EnterLocationPicker", "net.rim.device.api.lbs.picker.GPSLocationPi...
import java.util.Enumeration; import javax.microedition.location.Landmark; import javax.microedition.location.QualifiedCoordinates; import net.rim.device.api.gps.GPSInfo; import net.rim.device.api.lbs.picker.ContactsLocationPicker; import net.rim.device.api.lbs.picker.EnterLocationPicker; import net.rim.device.api.lbs....
import java.util.*; import javax.microedition.location.*; import net.rim.device.api.gps.*; import net.rim.device.api.lbs.picker.*; import net.rim.device.api.ui.*; import net.rim.device.api.ui.component.*; import net.rim.device.api.ui.container.*;
[ "java.util", "javax.microedition", "net.rim.device" ]
java.util; javax.microedition; net.rim.device;
1,211,953
DefaultMutableTreeNode findMatchingChild(TreePath parent, DefaultMutableTreeNode n, String name) { name = name.replace("/", ""); if (n.getChildCount() == 0) return null; else { DefaultMutableTreeNode c = null; for (int i = 0; i < n.getChildCount(); i++) { c = (DefaultMutableTreeNode) n.getChildAt(...
DefaultMutableTreeNode findMatchingChild(TreePath parent, DefaultMutableTreeNode n, String name) { name = name.replace("/", STRchild name: STR name: STRchild names are equal... returning childSTRchild names not equal"); } } return null; }
/** * Method to find a child with a specific name. * * @param parent TreePath for the parent we are searching * @param n Node to look for children * @param name Name for the child we are looking for * * @return DefaultMutableTreeNode Returns the child we are looking for, * or null if it does not exist....
Method to find a child with a specific name
findMatchingChild
{ "repo_name": "gujianxiao/gatewayForMulticom", "path": "javasrc/src/main/org/ndnx/ndn/utils/explorer/ContentExplorer.java", "license": "lgpl-2.1", "size": 39307 }
[ "javax.swing.tree.DefaultMutableTreeNode", "javax.swing.tree.TreePath" ]
import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.TreePath;
import javax.swing.tree.*;
[ "javax.swing" ]
javax.swing;
1,184,325
boolean has(Mage mage, Wand wand);
boolean has(Mage mage, Wand wand);
/** * Whether or not a mage has the required costs. * * @param mage The mage to check for costs * @param wand A optional wand, to be used for mana costs * @return True if the mage has these costs. */
Whether or not a mage has the required costs
has
{ "repo_name": "elBukkit/MagicPlugin", "path": "MagicAPI/src/main/java/com/elmakers/mine/bukkit/api/item/Cost.java", "license": "mit", "size": 7300 }
[ "com.elmakers.mine.bukkit.api.magic.Mage", "com.elmakers.mine.bukkit.api.wand.Wand" ]
import com.elmakers.mine.bukkit.api.magic.Mage; import com.elmakers.mine.bukkit.api.wand.Wand;
import com.elmakers.mine.bukkit.api.magic.*; import com.elmakers.mine.bukkit.api.wand.*;
[ "com.elmakers.mine" ]
com.elmakers.mine;
261,383
public String save() throws Exception { Boolean encrypt = (Boolean) getConfiguration().get( Constants.ENCRYPT_PASSWORD); if (encrypt != null && encrypt) { String algorithm = (String) getConfiguration().get( Constants.ENC_ALGORITHM); if (algorithm == null) { // should only happen for test case ...
String function() throws Exception { Boolean encrypt = (Boolean) getConfiguration().get( Constants.ENCRYPT_PASSWORD); if (encrypt != null && encrypt) { String algorithm = (String) getConfiguration().get( Constants.ENC_ALGORITHM); if (algorithm == null) { if (log.isDebugEnabled()) { log.debug(STR); } algorithm = "SHA"; ...
/** * Save the user, encrypting their passwords if necessary * * @return success when good things happen * @throws Exception * when bad things happen */
Save the user, encrypting their passwords if necessary
save
{ "repo_name": "delphiprogramming/gisgraphy", "path": "src/main/java/com/gisgraphy/webapp/action/SignupAction.java", "license": "lgpl-3.0", "size": 4838 }
[ "com.gisgraphy.Constants", "com.gisgraphy.service.UserExistsException", "com.gisgraphy.util.StringUtil", "com.gisgraphy.webapp.util.RequestUtil", "java.util.ArrayList", "java.util.List", "javax.servlet.http.HttpServletResponse", "org.springframework.security.AccessDeniedException", "org.springframew...
import com.gisgraphy.Constants; import com.gisgraphy.service.UserExistsException; import com.gisgraphy.util.StringUtil; import com.gisgraphy.webapp.util.RequestUtil; import java.util.ArrayList; import java.util.List; import javax.servlet.http.HttpServletResponse; import org.springframework.security.AccessDeniedExceptio...
import com.gisgraphy.*; import com.gisgraphy.service.*; import com.gisgraphy.util.*; import com.gisgraphy.webapp.util.*; import java.util.*; import javax.servlet.http.*; import org.springframework.security.*; import org.springframework.security.context.*; import org.springframework.security.providers.*;
[ "com.gisgraphy", "com.gisgraphy.service", "com.gisgraphy.util", "com.gisgraphy.webapp", "java.util", "javax.servlet", "org.springframework.security" ]
com.gisgraphy; com.gisgraphy.service; com.gisgraphy.util; com.gisgraphy.webapp; java.util; javax.servlet; org.springframework.security;
181,583
private AgentConfiguration fetchConfig() { AgentConfiguration newConfig; try { logger.info("fetching configuration from server at: " + server); File buffer = new File(bufferFile).getAbsoluteFile(); try { while (buffer != null && buffer.getUsableSpace() == 0) { buffer = buff...
AgentConfiguration function() { AgentConfiguration newConfig; try { logger.info(STR + server); File buffer = new File(bufferFile).getAbsoluteFile(); try { while (buffer != null && buffer.getUsableSpace() == 0) { buffer = buffer.getParentFile(); } if (buffer != null) { bufferSpaceLeft.set(Math.min((long) Integer.MAX_VAL...
/** * Fetch configuration of the daemon from remote server. * * @return Fetched configuration. {@code null} if the configuration is invalid. */
Fetch configuration of the daemon from remote server
fetchConfig
{ "repo_name": "jbau/proxy", "path": "src/main/java/com/wavefront/agent/AbstractAgent.java", "license": "apache-2.0", "size": 17664 }
[ "com.fasterxml.jackson.databind.JsonNode", "com.google.common.base.Throwables", "com.wavefront.api.agent.AgentConfiguration", "com.wavefront.metrics.JsonMetricsGenerator", "com.yammer.metrics.Metrics", "java.io.File", "java.util.logging.Level" ]
import com.fasterxml.jackson.databind.JsonNode; import com.google.common.base.Throwables; import com.wavefront.api.agent.AgentConfiguration; import com.wavefront.metrics.JsonMetricsGenerator; import com.yammer.metrics.Metrics; import java.io.File; import java.util.logging.Level;
import com.fasterxml.jackson.databind.*; import com.google.common.base.*; import com.wavefront.api.agent.*; import com.wavefront.metrics.*; import com.yammer.metrics.*; import java.io.*; import java.util.logging.*;
[ "com.fasterxml.jackson", "com.google.common", "com.wavefront.api", "com.wavefront.metrics", "com.yammer.metrics", "java.io", "java.util" ]
com.fasterxml.jackson; com.google.common; com.wavefront.api; com.wavefront.metrics; com.yammer.metrics; java.io; java.util;
2,196,731
private int getDataOffset(PacketHeader packetHeader) throws IOException { int eventDataOffset = 0; switch (packetHeader.eventType) { case PolarityEvent: eventDataOffset = 0; break; case FrameEvent: eventDataOffset = 36 ...
int function(PacketHeader packetHeader) throws IOException { int eventDataOffset = 0; switch (packetHeader.eventType) { case PolarityEvent: eventDataOffset = 0; break; case FrameEvent: eventDataOffset = 36 + (2 * framePixelArrayOffset); break; case SampleEvent: eventDataOffset = 0; break; case ConfigEvent: eventDataOff...
/** * Returns the data offset of different events. * * @param packetHeader the current packet header. * @return the data offset of different events. * @throws IOException */
Returns the data offset of different events
getDataOffset
{ "repo_name": "viktorbahr/jaer", "path": "src/net/sf/jaer/eventio/Jaer3BufferParser.java", "license": "lgpl-2.1", "size": 50314 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,689,111
public static boolean requiresFourStateContentSetting( @ContentSettingsType int contentSettingsType) { return contentSettingsType == ContentSettingsType.COOKIES; }
static boolean function( @ContentSettingsType int contentSettingsType) { return contentSettingsType == ContentSettingsType.COOKIES; }
/** * Whether the setting type requires four-state * (Allow/BlockThirdPartyIncognito/BlockThirdParty/Block) setting. */
Whether the setting type requires four-state (Allow/BlockThirdPartyIncognito/BlockThirdParty/Block) setting
requiresFourStateContentSetting
{ "repo_name": "chromium/chromium", "path": "components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java", "license": "bsd-3-clause", "size": 20075 }
[ "org.chromium.components.content_settings.ContentSettingsType" ]
import org.chromium.components.content_settings.ContentSettingsType;
import org.chromium.components.content_settings.*;
[ "org.chromium.components" ]
org.chromium.components;
1,301,175
void activateCmdlet(long cmdletID) throws IOException;
void activateCmdlet(long cmdletID) throws IOException;
/** * Get information about the given cmdlet. * @param cmdletID * @return CmdletInfo * @throws IOException */
Get information about the given cmdlet
activateCmdlet
{ "repo_name": "huafengw/SSM", "path": "smart-common/src/main/java/org/smartdata/protocol/SmartAdminProtocol.java", "license": "apache-2.0", "size": 4342 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
327,877
@Test(expected = QuickLinksProfileEvaluationException.class) public void contradictingPropertyFiltersRejected() throws Exception { List<Filter> filters = Lists.newArrayList( linkAttributeFilter(SSO, true), linkAttributeFilter(SSO, false)); new FilterEvaluator(filters); }
@Test(expected = QuickLinksProfileEvaluationException.class) void function() throws Exception { List<Filter> filters = Lists.newArrayList( linkAttributeFilter(SSO, true), linkAttributeFilter(SSO, false)); new FilterEvaluator(filters); }
/** * Contradicting property filters should result in {@link QuickLinksProfileEvaluationException}. * @throws Exception */
Contradicting property filters should result in <code>QuickLinksProfileEvaluationException</code>
contradictingPropertyFiltersRejected
{ "repo_name": "radicalbit/ambari", "path": "ambari-server/src/test/java/org/apache/ambari/server/state/quicklinksprofile/FilterEvaluatorTest.java", "license": "apache-2.0", "size": 8069 }
[ "com.google.common.collect.Lists", "java.util.List", "org.apache.ambari.server.state.quicklinksprofile.Filter", "org.junit.Test" ]
import com.google.common.collect.Lists; import java.util.List; import org.apache.ambari.server.state.quicklinksprofile.Filter; import org.junit.Test;
import com.google.common.collect.*; import java.util.*; import org.apache.ambari.server.state.quicklinksprofile.*; import org.junit.*;
[ "com.google.common", "java.util", "org.apache.ambari", "org.junit" ]
com.google.common; java.util; org.apache.ambari; org.junit;
1,027,701
public void testStaticMethodInvokingStaticMethodWithInnerClass() { List<TypeDeclaration> types = translateClassBody( "public static int test(Object object) { return 0; }" + "public static int test(Object object, Object foo) {" + " if (foo == null) { return Test.test(object); } return 1; }...
void function() { List<TypeDeclaration> types = translateClassBody( STR + STR + STR + STR); assertEquals(2, types.size());
/** * Regression test: verify that references to class members of a type with * an inner class aren't disturbed. */
Regression test: verify that references to class members of a type with an inner class aren't disturbed
testStaticMethodInvokingStaticMethodWithInnerClass
{ "repo_name": "rwl/j2objc", "path": "src/test/java/com/google/devtools/j2objc/translate/InnerClassExtractorTest.java", "license": "apache-2.0", "size": 37083 }
[ "java.util.List", "org.eclipse.jdt.core.dom.TypeDeclaration" ]
import java.util.List; import org.eclipse.jdt.core.dom.TypeDeclaration;
import java.util.*; import org.eclipse.jdt.core.dom.*;
[ "java.util", "org.eclipse.jdt" ]
java.util; org.eclipse.jdt;
1,625,575