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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Object arr = Array.newInstance(primitive.type, defaultValues.length);
for(int i = 0; i < defaultValues.length; i++) {
Array.set(arr, i, defaultValues[i]);
}
return arr;
}
| Object arr = Array.newInstance(primitive.type, defaultValues.length); for(int i = 0; i < defaultValues.length; i++) { Array.set(arr, i, defaultValues[i]); } return arr; } | /**
* Converts the passed numbers to a primitive array for the passed primitive enum member
* @param primitive The Primitive enum member
* @param defaultValues The numbers to convert
* @return a primitive array
*/ | Converts the passed numbers to a primitive array for the passed primitive enum member | toPrimitiveArray | {
"repo_name": "nickman/shorthand",
"path": "agent/src/main/java/com/heliosapm/shorthand/collectors/Primitive.java",
"license": "apache-2.0",
"size": 3144
} | [
"java.lang.reflect.Array"
] | import java.lang.reflect.Array; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 1,314,095 |
public void setObjectId(
final EntityItemIntType id
)
{
this.id = id;
} | void function( final EntityItemIntType id ) { this.id = id; } | /**
* This property is renamed from "id" to "objectID"
* because the super class ItemType has the property of the same name.
*/ | This property is renamed from "id" to "objectID" because the super class ItemType has the property of the same name | setObjectId | {
"repo_name": "nakamura5akihito/six-oval",
"path": "src/main/java/io/opensec/six/oval/model/windows/MetabaseItem.java",
"license": "apache-2.0",
"size": 5140
} | [
"io.opensec.six.oval.model.sc.EntityItemIntType"
] | import io.opensec.six.oval.model.sc.EntityItemIntType; | import io.opensec.six.oval.model.sc.*; | [
"io.opensec.six"
] | io.opensec.six; | 1,699,093 |
ServiceResponse<Map<String, Map<String, String>>> getDictionaryValid() throws ErrorException, IOException; | ServiceResponse<Map<String, Map<String, String>>> getDictionaryValid() throws ErrorException, IOException; | /**
* Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": {"4": "four", "5": "five", "6": "six"}, "2": {"7": "seven", "8": "eight", "9": "nine"}}.
*
* @throws ErrorException exception thrown from REST call
* @throws IOExcep... | Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": {"4": "four", "5": "five", "6": "six"}, "2": {"7": "seven", "8": "eight", "9": "nine"}} | getDictionaryValid | {
"repo_name": "matt-gibbs/AutoRest",
"path": "AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/bodydictionary/Dictionary.java",
"license": "mit",
"size": 63614
} | [
"com.microsoft.rest.ServiceResponse",
"java.io.IOException",
"java.util.Map"
] | import com.microsoft.rest.ServiceResponse; import java.io.IOException; import java.util.Map; | import com.microsoft.rest.*; import java.io.*; import java.util.*; | [
"com.microsoft.rest",
"java.io",
"java.util"
] | com.microsoft.rest; java.io; java.util; | 2,661,743 |
IOException delete(String path, IOException ex) {
ex = Utils.closeQuietly(ex, this);
new File(path).delete();
return ex;
} | IOException delete(String path, IOException ex) { ex = Utils.closeQuietly(ex, this); new File(path).delete(); return ex; } | /**
* Quietly closes the file and deletes it.
*
* @param ex returned if non-null
* @return IOException which was caught, unless first was non-null
*/ | Quietly closes the file and deletes it | delete | {
"repo_name": "cojen/Tupl",
"path": "src/main/java/org/cojen/tupl/core/LockedFile.java",
"license": "agpl-3.0",
"size": 3087
} | [
"java.io.File",
"java.io.IOException"
] | import java.io.File; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,865,083 |
@Override
public void finalize() {
try {
this.finalized = true;
this.solverManager.finalize();
} catch (Throwable t) {
// Log it, but do nothing.
if (Globals.getInst().symbolicExecLogger.isEnabledFor(Level.WARN))
Globals.getInst().symbolicExecLogger
.warn("Shutting down the Solver... | void function() { try { this.finalized = true; this.solverManager.finalize(); } catch (Throwable t) { if (Globals.getInst().symbolicExecLogger.isEnabledFor(Level.WARN)) Globals.getInst().symbolicExecLogger .warn(STR); } finally { super.finalize(); } } | /**
* Finalize the SymbolicalVirtualMachine.
*/ | Finalize the SymbolicalVirtualMachine | finalize | {
"repo_name": "wwu-pi/muggl",
"path": "muggl-core/src/de/wwu/muggl/vm/impl/symbolic/SymbolicVirtualMachine.java",
"license": "gpl-3.0",
"size": 47549
} | [
"de.wwu.muggl.configuration.Globals",
"org.apache.log4j.Level"
] | import de.wwu.muggl.configuration.Globals; import org.apache.log4j.Level; | import de.wwu.muggl.configuration.*; import org.apache.log4j.*; | [
"de.wwu.muggl",
"org.apache.log4j"
] | de.wwu.muggl; org.apache.log4j; | 758,986 |
byte[] bytes = new byte[4];
IoBuffer rev = IoBuffer.allocate(4);
rev.putInt(value);
rev.flip();
bytes[3] = rev.get();
bytes[2] = rev.get();
bytes[1] = rev.get();
bytes[0] = rev.get();
out.put(bytes);
rev.free();
rev = null;
}
| byte[] bytes = new byte[4]; IoBuffer rev = IoBuffer.allocate(4); rev.putInt(value); rev.flip(); bytes[3] = rev.get(); bytes[2] = rev.get(); bytes[1] = rev.get(); bytes[0] = rev.get(); out.put(bytes); rev.free(); rev = null; } | /**
* Writes reversed integer to buffer.
*
* @param out Buffer
* @param value Integer to write
*/ | Writes reversed integer to buffer | writeReverseIntOld | {
"repo_name": "OpenCorrelate/red5load",
"path": "red5/src/main/java/org/red5/server/net/rtmp/RTMPUtils.java",
"license": "lgpl-3.0",
"size": 7285
} | [
"org.apache.mina.core.buffer.IoBuffer"
] | import org.apache.mina.core.buffer.IoBuffer; | import org.apache.mina.core.buffer.*; | [
"org.apache.mina"
] | org.apache.mina; | 1,969,476 |
public static boolean higherOrEquals(Integer source, Integer target) {
if (source == null) {
source = Ordered.LOWEST_PRECEDENCE;
}
if (target == null) {
target = Ordered.LOWEST_PRECEDENCE;
}
return source <= target;
} | static boolean function(Integer source, Integer target) { if (source == null) { source = Ordered.LOWEST_PRECEDENCE; } if (target == null) { target = Ordered.LOWEST_PRECEDENCE; } return source <= target; } | /**
* Is higher or equals.
*
* @param source the source
* @param target the target
* @return the boolean
*/ | Is higher or equals | higherOrEquals | {
"repo_name": "seata/seata",
"path": "spring/src/main/java/io/seata/spring/util/OrderUtil.java",
"license": "apache-2.0",
"size": 7552
} | [
"org.springframework.core.Ordered"
] | import org.springframework.core.Ordered; | import org.springframework.core.*; | [
"org.springframework.core"
] | org.springframework.core; | 2,391,009 |
protected ReportContext context = null;
protected StreamSource source = null;
protected String contentType = null;
private String reportDataName = null;
public StreamSource getStreamSource()
{
return source;
}
| ReportContext context = null; protected StreamSource source = null; protected String contentType = null; private String reportDataName = null; public StreamSource function() { return source; } | /**
* Gets the stream source containing the data
*
* @return StreamSource the source containing the data
*
* @see Report#getStreamSource()
*/ | Gets the stream source containing the data | getStreamSource | {
"repo_name": "GaloisInc/KOA",
"path": "infrastructure/source/WebVotingSystem/src/ie/ucd/srg/koa/reportserver/report/AbstractReport.java",
"license": "gpl-2.0",
"size": 2618
} | [
"ie.ucd.srg.koa.reportserver.report.ReportContext",
"javax.xml.transform.stream.StreamSource"
] | import ie.ucd.srg.koa.reportserver.report.ReportContext; import javax.xml.transform.stream.StreamSource; | import ie.ucd.srg.koa.reportserver.report.*; import javax.xml.transform.stream.*; | [
"ie.ucd.srg",
"javax.xml"
] | ie.ucd.srg; javax.xml; | 1,209,208 |
Map<String, RegionsCapability> regions(); | Map<String, RegionsCapability> regions(); | /**
* Gets the regions property: The virtual machine size compatibility features.
*
* @return the regions value.
*/ | Gets the regions property: The virtual machine size compatibility features | regions | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/CapabilitiesResult.java",
"license": "mit",
"size": 1290
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 623,545 |
public BoxProperty setDirection(Direction dir)
{
this.clearAttribute("box-direction");
this.putAttribute("box-direction", dir.toString());
this.clearAttribute("-moz-box-direction");
this.putAttribute("-moz-box-direction", dir.toString());
this.clearAttribute("-webkit-box-direction");
this.putAt... | BoxProperty function(Direction dir) { this.clearAttribute(STR); this.putAttribute(STR, dir.toString()); this.clearAttribute(STR); this.putAttribute(STR, dir.toString()); this.clearAttribute(STR); this.putAttribute(STR, dir.toString()); return this; } | /**
* The box-direction property specifies the direction in which child
* elements of a box element are laid out.<br>
*
* Default value: normal<br>
* Inherited: no<br>
* Version: CSS3<br>
* JavaScript syntax: object.style.boxDirection="reverse"<br>
*
* @param dir
* the direction of the ... | The box-direction property specifies the direction in which child elements of a box element are laid out. Default value: normal Inherited: no Version: CSS3 JavaScript syntax: object.style.boxDirection="reverse" | setDirection | {
"repo_name": "Ccook/Stonewall",
"path": "src/main/java/edu/american/student/stonewall/display/css/property/BoxProperty.java",
"license": "apache-2.0",
"size": 8319
} | [
"edu.american.student.stonewall.display.css.util.Direction"
] | import edu.american.student.stonewall.display.css.util.Direction; | import edu.american.student.stonewall.display.css.util.*; | [
"edu.american.student"
] | edu.american.student; | 370,610 |
EClass getTransition(); | EClass getTransition(); | /**
* Returns the meta object for class '{@link net.sf.markov4jmeter.behavior.Transition <em>Transition</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Transition</em>'.
* @see net.sf.markov4jmeter.behavior.Transition
* @generated
*/ | Returns the meta object for class '<code>net.sf.markov4jmeter.behavior.Transition Transition</code>'. | getTransition | {
"repo_name": "Wessbas/wessbas.behaviorModelExtractor",
"path": "src-gen/net/sf/markov4jmeter/behavior/BehaviorPackage.java",
"license": "apache-2.0",
"size": 45781
} | [
"org.eclipse.emf.ecore.EClass"
] | import org.eclipse.emf.ecore.EClass; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,016,573 |
private static String template(String location) {
String template = Static.GetStringResource(location);
//Replace all instances of ///! with nothing.
template = template.replace("///!", "");
Pattern p = Pattern.compile("%%(.*?)%%");
Matcher m = p.matcher(template);
while(m.find()) {
template = templat... | static String function(String location) { String template = Static.GetStringResource(location); template = template.replace(STR%%(.*?)%%STR%%STR%%", macro(m.group(1))); } return template; } | /**
* Available macros are listed in the code below.
*
* @param location
* @return
*/ | Available macros are listed in the code below | template | {
"repo_name": "sk89q/CommandHelper",
"path": "src/main/java/com/laytonsmith/tools/SyntaxHighlighters.java",
"license": "mit",
"size": 10206
} | [
"com.laytonsmith.core.Static"
] | import com.laytonsmith.core.Static; | import com.laytonsmith.core.*; | [
"com.laytonsmith.core"
] | com.laytonsmith.core; | 221,960 |
public Set<AbstractMap.SimpleEntry<Node, Edge>> getConnections(Node node) {
return graph.get(node);
} | Set<AbstractMap.SimpleEntry<Node, Edge>> function(Node node) { return graph.get(node); } | /**
* Returns the set of outgoing edges from the node
*
* @param node
* @return empty set if there are no edges
*/ | Returns the set of outgoing edges from the node | getConnections | {
"repo_name": "limespace/VaadinGraphvizComponent",
"path": "vizcomponent-root/vizcomponent/src/main/java/com/vaadin/pontus/vizcomponent/model/Subgraph.java",
"license": "apache-2.0",
"size": 13215
} | [
"java.util.AbstractMap",
"java.util.Set"
] | import java.util.AbstractMap; import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 490,355 |
public UsageUnit unit() {
return this.unit;
} | UsageUnit function() { return this.unit; } | /**
* Get gets the unit of measurement. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond'.
*
* @return the unit value
*/ | Get gets the unit of measurement. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond' | unit | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/storage/mgmt-v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/UsageInner.java",
"license": "mit",
"size": 2309
} | [
"com.microsoft.azure.management.storage.v2018_03_01_preview.UsageUnit"
] | import com.microsoft.azure.management.storage.v2018_03_01_preview.UsageUnit; | import com.microsoft.azure.management.storage.v2018_03_01_preview.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 219,233 |
void close()
throws StandardException
{
Enumeration e = scanControllers.elements();
while (e.hasMoreElements())
{
ScanController scan = (ScanController)e.nextElement();
scan.close();
}
scanControllers.clear();
} | void close() throws StandardException { Enumeration e = scanControllers.elements(); while (e.hasMoreElements()) { ScanController scan = (ScanController)e.nextElement(); scan.close(); } scanControllers.clear(); } | /**
* Clean up all scan controllers
*
* @exception StandardException on error
*/ | Clean up all scan controllers | close | {
"repo_name": "papicella/snappy-store",
"path": "gemfirexd/core/src/main/java/com/pivotal/gemfirexd/internal/impl/sql/execute/GenericRIChecker.java",
"license": "apache-2.0",
"size": 9540
} | [
"com.pivotal.gemfirexd.internal.iapi.error.StandardException",
"com.pivotal.gemfirexd.internal.iapi.store.access.ScanController",
"java.util.Enumeration"
] | import com.pivotal.gemfirexd.internal.iapi.error.StandardException; import com.pivotal.gemfirexd.internal.iapi.store.access.ScanController; import java.util.Enumeration; | import com.pivotal.gemfirexd.internal.iapi.error.*; import com.pivotal.gemfirexd.internal.iapi.store.access.*; import java.util.*; | [
"com.pivotal.gemfirexd",
"java.util"
] | com.pivotal.gemfirexd; java.util; | 1,097,231 |
@Test
public void testGetRooDseNoAttribute() throws Exception
{
Entry rootDse = connection.getRootDse( "1.1" );
assertNotNull( rootDse );
assertEquals( 0, rootDse.size() );
} | void function() throws Exception { Entry rootDse = connection.getRootDse( "1.1" ); assertNotNull( rootDse ); assertEquals( 0, rootDse.size() ); } | /**
* Test a lookup requesting no attributes (1.1)
*
* @throws Exception
*/ | Test a lookup requesting no attributes (1.1) | testGetRooDseNoAttribute | {
"repo_name": "apache/directory-server",
"path": "ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/GetRootDseTest.java",
"license": "apache-2.0",
"size": 9485
} | [
"org.apache.directory.api.ldap.model.entry.Entry",
"org.junit.jupiter.api.Assertions"
] | import org.apache.directory.api.ldap.model.entry.Entry; import org.junit.jupiter.api.Assertions; | import org.apache.directory.api.ldap.model.entry.*; import org.junit.jupiter.api.*; | [
"org.apache.directory",
"org.junit.jupiter"
] | org.apache.directory; org.junit.jupiter; | 352,122 |
private static void logCommon(int type, String typeIndicator, String message) {
if (debug && ((logTypes & type) == type)) {
if (logListener != null) {
logListener.onLog(type, typeIndicator, message);
} else {
Log.d(TAG, "[" + TAG + "][" + typeIndicator... | static void function(int type, String typeIndicator, String message) { if (debug && ((logTypes & type) == type)) { if (logListener != null) { logListener.onLog(type, typeIndicator, message); } else { Log.d(TAG, "[" + TAG + "][" + typeIndicator + "]" + (!message.startsWith("[") && !message.startsWith(" ") ? " " : "") + ... | /**
* <p>Log a message (internal)</p>
*
* <p>Current debug and enabled logtypes decide what gets logged -
* even if a custom callback is registered</p>
*
* @param type Type of message to log
* @param typeIndicator String indicator for message type
* @param message The messag... | Log a message (internal) Current debug and enabled logtypes decide what gets logged - even if a custom callback is registered | logCommon | {
"repo_name": "imoblife/ImoblifeLibrary",
"path": "src/eu/chainfire/libsuperuser/Debug.java",
"license": "bsd-3-clause",
"size": 7078
} | [
"android.util.Log"
] | import android.util.Log; | import android.util.*; | [
"android.util"
] | android.util; | 1,172,995 |
public static ScrollPanel newScrollPanel (Widget contents, int xpad, int ypad)
{
ScrollPanel panel = new ScrollPanel(contents);
if (xpad >= 0) {
String maxWidth = (Window.getClientWidth() - xpad) + "px";
DOM.setStyleAttribute(panel.getElement(), "maxWidth", maxWidth);
... | static ScrollPanel function (Widget contents, int xpad, int ypad) { ScrollPanel panel = new ScrollPanel(contents); if (xpad >= 0) { String maxWidth = (Window.getClientWidth() - xpad) + "px"; DOM.setStyleAttribute(panel.getElement(), STR, maxWidth); } if (ypad >= 0) { String maxHeight = (Window.getClientHeight() - ypad)... | /**
* Wraps the supplied contents in a scroll panel that will set the max-width to
* Window.getClientWidth()-xpad and the max-height to Window.getClientHeight()-ypad. If either
* xpad or ypad are less than zero, the max-size attribute on that axis will not be set.
*/ | Wraps the supplied contents in a scroll panel that will set the max-width to Window.getClientWidth()-xpad and the max-height to Window.getClientHeight()-ypad. If either xpad or ypad are less than zero, the max-size attribute on that axis will not be set | newScrollPanel | {
"repo_name": "threerings/gwt-utils",
"path": "src/main/java/com/threerings/gwt/ui/Widgets.java",
"license": "lgpl-2.1",
"size": 15875
} | [
"com.google.gwt.user.client.DOM",
"com.google.gwt.user.client.Window",
"com.google.gwt.user.client.ui.ScrollPanel",
"com.google.gwt.user.client.ui.Widget"
] | import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.ScrollPanel; import com.google.gwt.user.client.ui.Widget; | import com.google.gwt.user.client.*; import com.google.gwt.user.client.ui.*; | [
"com.google.gwt"
] | com.google.gwt; | 1,271,520 |
public boolean isAbstract()
{
return Modifier.isAbstract(getAccessFlags());
} | boolean function() { return Modifier.isAbstract(getAccessFlags()); } | /**
* Returns true for an abstract class.
*/ | Returns true for an abstract class | isAbstract | {
"repo_name": "baratine/baratine",
"path": "core/src/main/java/com/caucho/v5/bytecode/JavaClass.java",
"license": "gpl-2.0",
"size": 17328
} | [
"java.lang.reflect.Modifier"
] | import java.lang.reflect.Modifier; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 449,149 |
public String render(AtomicVertex vertex, StrongComponent cycle, int layerIndex); | String function(AtomicVertex vertex, StrongComponent cycle, int layerIndex); | /**
* Renders an {@link AtomicVertex}.
*
* @param vertex
* Vertex to be rendered.
* @param cycle
* Cycle to which <code>vertex</code> belongs. Will be
* <code>null</code> if it does not belong to a cycle (i.e. a
* strong component with ... | Renders an <code>AtomicVertex</code> | render | {
"repo_name": "netmelody/neoclassycle",
"path": "src/main/java/org/netmelody/neoclassycle/renderer/AtomicVertexRenderer.java",
"license": "bsd-2-clause",
"size": 2336
} | [
"org.netmelody.neoclassycle.graph.AtomicVertex",
"org.netmelody.neoclassycle.graph.StrongComponent"
] | import org.netmelody.neoclassycle.graph.AtomicVertex; import org.netmelody.neoclassycle.graph.StrongComponent; | import org.netmelody.neoclassycle.graph.*; | [
"org.netmelody.neoclassycle"
] | org.netmelody.neoclassycle; | 562,354 |
var obj = this.data;
var toReturn = @com.emitrom.ti4j.mobile.client.blob.Blob::new(Lcom/google/gwt/core/client/JavaScriptObject;)(obj);
return toReturn;
}-*/; | var obj = this.data; var toReturn = @com.emitrom.ti4j.mobile.client.blob.Blob::new(Lcom/google/gwt/core/client/JavaScriptObject;)(obj); return toReturn; }-*/; | /**
* a blob representing the data read, can be interpreted via toString
*/ | a blob representing the data read, can be interpreted via toString | getData | {
"repo_name": "mvniekerk/titanium4j",
"path": "src/com/emitrom/ti4j/mobile/client/core/events/ReadEvent.java",
"license": "apache-2.0",
"size": 1293
} | [
"com.emitrom.ti4j.mobile.client.blob.Blob"
] | import com.emitrom.ti4j.mobile.client.blob.Blob; | import com.emitrom.ti4j.mobile.client.blob.*; | [
"com.emitrom.ti4j"
] | com.emitrom.ti4j; | 958,770 |
protected SingleFilterAdapter<?> getAdapterForFilterOrThrow(Filter filter) {
if (adapterMap.containsKey(filter.getClass())) {
return adapterMap.get(filter.getClass());
} else {
throw new UnsupportedFilterException(
ImmutableList.of(FilterSupportStatus.newUnknownFilterType(filter)));
... | SingleFilterAdapter<?> function(Filter filter) { if (adapterMap.containsKey(filter.getClass())) { return adapterMap.get(filter.getClass()); } else { throw new UnsupportedFilterException( ImmutableList.of(FilterSupportStatus.newUnknownFilterType(filter))); } } | /**
* Get the adapter for the given Filter or throw an UnsupportedFilterException if one is not
* available.
*/ | Get the adapter for the given Filter or throw an UnsupportedFilterException if one is not available | getAdapterForFilterOrThrow | {
"repo_name": "waprin/cloud-bigtable-client",
"path": "bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/adapters/filters/FilterAdapter.java",
"license": "apache-2.0",
"size": 7443
} | [
"com.google.common.collect.ImmutableList",
"org.apache.hadoop.hbase.filter.Filter"
] | import com.google.common.collect.ImmutableList; import org.apache.hadoop.hbase.filter.Filter; | import com.google.common.collect.*; import org.apache.hadoop.hbase.filter.*; | [
"com.google.common",
"org.apache.hadoop"
] | com.google.common; org.apache.hadoop; | 2,211,206 |
public void removeAllOnCompletionDefinition(ProcessorDefinition<?> definition) {
for (Iterator<ProcessorDefinition<?>> it = definition.getOutputs().iterator(); it.hasNext();) {
ProcessorDefinition<?> out = it.next();
if (out instanceof OnCompletionDefinition) {
it.rem... | void function(ProcessorDefinition<?> definition) { for (Iterator<ProcessorDefinition<?>> it = definition.getOutputs().iterator(); it.hasNext();) { ProcessorDefinition<?> out = it.next(); if (out instanceof OnCompletionDefinition) { it.remove(); } } } | /**
* Removes all existing {@link org.apache.camel.model.OnCompletionDefinition} from the definition.
* <p/>
* This is used to let route scoped <tt>onCompletion</tt> overrule any global <tt>onCompletion</tt>.
* Hence we remove all existing as they are global.
*
* @param definition the pare... | Removes all existing <code>org.apache.camel.model.OnCompletionDefinition</code> from the definition. This is used to let route scoped onCompletion overrule any global onCompletion. Hence we remove all existing as they are global | removeAllOnCompletionDefinition | {
"repo_name": "jonmcewen/camel",
"path": "camel-core/src/main/java/org/apache/camel/model/OnCompletionDefinition.java",
"license": "apache-2.0",
"size": 14287
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 2,799,191 |
@Override
public Trackable setTrackable(final Trackable newT) {
Trackable oldT = t;
t = newT;
drawnBefore = false;
return oldT;
} | Trackable function(final Trackable newT) { Trackable oldT = t; t = newT; drawnBefore = false; return oldT; } | /**
* Set the trackable on which to draw the Marker.
*
* @param newT the trackable
* @return the old Trackable being marked, or null if there was none
*/ | Set the trackable on which to draw the Marker | setTrackable | {
"repo_name": "bhenne/MoSP-Siafu",
"path": "Siafu/src/de/uni_hannover/dcsec/siafu/graphics/markers/SpotMarker.java",
"license": "gpl-2.0",
"size": 6089
} | [
"de.uni_hannover.dcsec.siafu.model.Trackable"
] | import de.uni_hannover.dcsec.siafu.model.Trackable; | import de.uni_hannover.dcsec.siafu.model.*; | [
"de.uni_hannover.dcsec"
] | de.uni_hannover.dcsec; | 1,736,216 |
public static java.util.List extractPlinthWorkActivitiesList(ims.domain.ILightweightDomainFactory domainFactory, ims.therapies.vo.PlinthWorkActivitiesVoCollection voCollection)
{
return extractPlinthWorkActivitiesList(domainFactory, voCollection, null, new HashMap());
}
| static java.util.List function(ims.domain.ILightweightDomainFactory domainFactory, ims.therapies.vo.PlinthWorkActivitiesVoCollection voCollection) { return extractPlinthWorkActivitiesList(domainFactory, voCollection, null, new HashMap()); } | /**
* Create the ims.therapies.treatment.domain.objects.PlinthWorkActivities list from the value object collection.
* @param domainFactory - used to create existing (persistent) domain objects.
* @param voCollection - the collection of value objects
*/ | Create the ims.therapies.treatment.domain.objects.PlinthWorkActivities list from the value object collection | extractPlinthWorkActivitiesList | {
"repo_name": "FreudianNM/openMAXIMS",
"path": "Source Library/openmaxims_workspace/ValueObjects/src/ims/therapies/vo/domain/PlinthWorkActivitiesVoAssembler.java",
"license": "agpl-3.0",
"size": 19179
} | [
"java.util.HashMap"
] | import java.util.HashMap; | import java.util.*; | [
"java.util"
] | java.util; | 1,475,717 |
@Test(expected = NoSuchTableException.class)
public final void testGet_inValidTable() throws NoSuchTableException {
// a non existent Table should return null
assertEquals(null, db.getTable("someRandomNonExistantTable"));
} | @Test(expected = NoSuchTableException.class) final void function() throws NoSuchTableException { assertEquals(null, db.getTable(STR)); } | /**
* Test method for Database#add(String, parser.Table). case:
* table doesn't exist
*
* @throws NoSuchTableException if Table can't be found
*/ | Test method for Database#add(String, parser.Table). case: table doesn't exist | testGet_inValidTable | {
"repo_name": "AlvaroNaranjo/Databases",
"path": "DBMS/test/parser/DatabaseTest.java",
"license": "gpl-2.0",
"size": 93847
} | [
"org.junit.Assert",
"org.junit.Test"
] | import org.junit.Assert; import org.junit.Test; | import org.junit.*; | [
"org.junit"
] | org.junit; | 2,249,478 |
public final MetaProperty<Double> recoveryRate() {
return _recoveryRate;
} | final MetaProperty<Double> function() { return _recoveryRate; } | /**
* The meta-property for the {@code recoveryRate} property.
* @return the meta-property, not null
*/ | The meta-property for the recoveryRate property | recoveryRate | {
"repo_name": "McLeodMoores/starling",
"path": "projects/master-db/src/main/java/com/opengamma/masterdb/security/hibernate/cds/CDSSecurityBean.java",
"license": "apache-2.0",
"size": 33407
} | [
"org.joda.beans.MetaProperty"
] | import org.joda.beans.MetaProperty; | import org.joda.beans.*; | [
"org.joda.beans"
] | org.joda.beans; | 2,813,968 |
public YangString getServiceValue() throws JNCException {
return (YangString)getValue("service");
} | YangString function() throws JNCException { return (YangString)getValue(STR); } | /**
* Gets the value for child leaf "service".
* @return The value of the leaf.
*/ | Gets the value for child leaf "service" | getServiceValue | {
"repo_name": "jnpr-shinma/yangfile",
"path": "hitel/src/hctaEpc/mmeSgsn/statistics/nodal/Upsm.java",
"license": "apache-2.0",
"size": 11304
} | [
"com.tailf.jnc.YangString"
] | import com.tailf.jnc.YangString; | import com.tailf.jnc.*; | [
"com.tailf.jnc"
] | com.tailf.jnc; | 2,448,709 |
@JSConstructor
public static Object constructor(Context cx, Object[] args, Function ctorObj, boolean inNewExpr) {
if (args.length != 1) {
throw ScriptRuntime.constructError("Error", "Bounds constructor takes a single argument");
}
Bounds bounds = null;
Object arg = ar... | static Object function(Context cx, Object[] args, Function ctorObj, boolean inNewExpr) { if (args.length != 1) { throw ScriptRuntime.constructError("Error", STR); } Bounds bounds = null; Object arg = args[0]; if (arg instanceof NativeObject) { NativeObject config = (NativeObject) arg; if (inNewExpr) { bounds = new Boun... | /**
* JavaScript constructor.
* @param cx
* @param args
* @param ctorObj
* @param inNewExpr
* @return
*/ | JavaScript constructor | constructor | {
"repo_name": "griever989/geoscript-js",
"path": "src/main/java/org/geoscript/js/geom/Bounds.java",
"license": "mit",
"size": 12793
} | [
"org.mozilla.javascript.Context",
"org.mozilla.javascript.Function",
"org.mozilla.javascript.NativeArray",
"org.mozilla.javascript.NativeObject",
"org.mozilla.javascript.ScriptRuntime"
] | import org.mozilla.javascript.Context; import org.mozilla.javascript.Function; import org.mozilla.javascript.NativeArray; import org.mozilla.javascript.NativeObject; import org.mozilla.javascript.ScriptRuntime; | import org.mozilla.javascript.*; | [
"org.mozilla.javascript"
] | org.mozilla.javascript; | 1,830,374 |
void getGadgetData(final String gadgetSpecUrl, WaveletName waveletName,
int instanceId, final DataCallback receiveDataCommand); | void getGadgetData(final String gadgetSpecUrl, WaveletName waveletName, int instanceId, final DataCallback receiveDataCommand); | /**
* Requests gadget data from the store.
*
* @param gadgetSpecUrl the gadget specification URL that identified the
* gadget.
* @param waveletName The Wavelet name for this gadget.
* @param instanceId The gadget instance id.
* @param receiveDataCommand callback that receives the result.
... | Requests gadget data from the store | getGadgetData | {
"repo_name": "vega113/incubator-wave",
"path": "wave/src/main/java/org/waveprotocol/wave/client/gadget/renderer/GadgetDataStore.java",
"license": "apache-2.0",
"size": 2672
} | [
"org.waveprotocol.wave.model.id.WaveletName"
] | import org.waveprotocol.wave.model.id.WaveletName; | import org.waveprotocol.wave.model.id.*; | [
"org.waveprotocol.wave"
] | org.waveprotocol.wave; | 1,073,685 |
@SuppressWarnings("cast")
public void setAbs(final int index, final Complex val) {
setAbs(index, (double) val.getReal(), (double) val.getImaginary()); // PRIM_TYPE
} | @SuppressWarnings("cast") void function(final int index, final Complex val) { setAbs(index, (double) val.getReal(), (double) val.getImaginary()); } | /**
* Set values at absolute index in the internal array.
*
* This is an internal method with no checks so can be dangerous. Use with care or ideally with an iterator.
* @param index absolute index
* @param val new values
*/ | Set values at absolute index in the internal array. This is an internal method with no checks so can be dangerous. Use with care or ideally with an iterator | setAbs | {
"repo_name": "colinpalmer/dawnsci",
"path": "org.eclipse.dawnsci.analysis.dataset/src/org/eclipse/dawnsci/analysis/dataset/impl/ComplexDoubleDataset.java",
"license": "epl-1.0",
"size": 29268
} | [
"org.apache.commons.math3.complex.Complex"
] | import org.apache.commons.math3.complex.Complex; | import org.apache.commons.math3.complex.*; | [
"org.apache.commons"
] | org.apache.commons; | 2,461,799 |
protected Settings transportClientSettings() {
return Settings.EMPTY;
} | Settings function() { return Settings.EMPTY; } | /**
* This method is used to obtain additional settings for clients created by the internal cluster.
* These settings will be applied on the client in addition to some randomized settings defined in
* the cluster. These settings will also override any other settings the internal cluster might
* add ... | This method is used to obtain additional settings for clients created by the internal cluster. These settings will be applied on the client in addition to some randomized settings defined in the cluster. These settings will also override any other settings the internal cluster might add by default | transportClientSettings | {
"repo_name": "rajanm/elasticsearch",
"path": "test/framework/src/main/java/org/elasticsearch/test/ESIntegTestCase.java",
"license": "apache-2.0",
"size": 107161
} | [
"org.elasticsearch.common.settings.Settings"
] | import org.elasticsearch.common.settings.Settings; | import org.elasticsearch.common.settings.*; | [
"org.elasticsearch.common"
] | org.elasticsearch.common; | 2,249 |
public com.google.common.util.concurrent.ListenableFuture<
com.google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse>
listScanRuns(com.google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest request) {
return futureUnaryCall(
getChannel().newCall(getListScanRunsMethodH... | com.google.common.util.concurrent.ListenableFuture< com.google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse> function(com.google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest request) { return futureUnaryCall( getChannel().newCall(getListScanRunsMethodHelper(), getCallOptions()), request); } | /**
*
*
* <pre>
* Lists ScanRuns under a given ScanConfig, in descending order of ScanRun
* stop time.
* </pre>
*/ | <code> Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time. </code> | listScanRuns | {
"repo_name": "vam-google/google-cloud-java",
"path": "google-api-grpc/grpc-google-cloud-websecurityscanner-v1alpha/src/main/java/com/google/cloud/websecurityscanner/v1alpha/WebSecurityScannerGrpc.java",
"license": "apache-2.0",
"size": 83312
} | [
"io.grpc.stub.ClientCalls"
] | import io.grpc.stub.ClientCalls; | import io.grpc.stub.*; | [
"io.grpc.stub"
] | io.grpc.stub; | 331,967 |
private List<Message> getMessages(List<Element> messagesEle, String sessionId, String moduleId, Date fromDate) {
List<Message> messages = new ArrayList<Message>();
for (Element ele : messagesEle) {
Message message = new Message();
message.setId(ele.attributeValue("id"));
... | List<Message> function(List<Element> messagesEle, String sessionId, String moduleId, Date fromDate) { List<Message> messages = new ArrayList<Message>(); for (Element ele : messagesEle) { Message message = new Message(); message.setId(ele.attributeValue("id")); message.setTopic(ele.attributeValue("topic")); message.setC... | /**
* Get process all messages when given a XML list of elements containing
* Message information, session id, module id, date from which point to
* filter from.
*
* @param messagesEle
* @param sessionId
* @param moduleId
* @param fromDate
* @return List<Message>
*/ | Get process all messages when given a XML list of elements containing Message information, session id, module id, date from which point to filter from | getMessages | {
"repo_name": "Unipoole/unipoole-service",
"path": "src/main/java/coza/opencollab/unipoole/service/lms/impl/SakaiYaftHandler.java",
"license": "apache-2.0",
"size": 22023
} | [
"java.util.ArrayList",
"java.util.Date",
"java.util.List",
"org.dom4j.Element"
] | import java.util.ArrayList; import java.util.Date; import java.util.List; import org.dom4j.Element; | import java.util.*; import org.dom4j.*; | [
"java.util",
"org.dom4j"
] | java.util; org.dom4j; | 1,579,153 |
public MIDlet getMainMIDlet();
} | MIDlet function(); } | /**
* Get the Midlet
* @return
*/ | Get the Midlet | getMainMIDlet | {
"repo_name": "leotizzei/MobileMedia-Cosmos-v7",
"path": "src/br/unicamp/ic/sed/mobilemedia/music/spec/req/IMobileResources.java",
"license": "mit",
"size": 242
} | [
"javax.microedition.midlet.MIDlet"
] | import javax.microedition.midlet.MIDlet; | import javax.microedition.midlet.*; | [
"javax.microedition"
] | javax.microedition; | 1,705,082 |
String authorization = null;
Contact contact = null;
// api.createOrReplaceContact(authorization, contact);
// TODO: test validations
} | String authorization = null; Contact contact = null; } | /**
*
*
* Create contact or replace if exists
*
* @throws ApiException
* if the Api call fails
*/ | Create contact or replace if exists | createOrReplaceContactTest | {
"repo_name": "shoutout-labs/shoutout-sdk-java",
"path": "src/test/java/com/getshoutout/shoutout/sdk/api/ContactsApiTest.java",
"license": "apache-2.0",
"size": 2072
} | [
"com.getshoutout.shoutout.sdk.model.Contact"
] | import com.getshoutout.shoutout.sdk.model.Contact; | import com.getshoutout.shoutout.sdk.model.*; | [
"com.getshoutout.shoutout"
] | com.getshoutout.shoutout; | 386,541 |
protected void initializeGroups() {
if ((getCriteriaGroup() != null) && (getCriteriaGroup().getItems().isEmpty())) {
getCriteriaGroup().setItems(getCriteriaFields());
}
if (getResultsGroup() != null) {
if ((getResultsGroup().getItems().isEmpty()) && (getResultF... | void function() { if ((getCriteriaGroup() != null) && (getCriteriaGroup().getItems().isEmpty())) { getCriteriaGroup().setItems(getCriteriaFields()); } if (getResultsGroup() != null) { if ((getResultsGroup().getItems().isEmpty()) && (getResultFields() != null)) { getResultsGroup().setItems(getResultFields()); } if (getR... | /**
* Adds the list of criteria and result fields to their group prototypes, then adds the criteria and result
* groups to the items for the view.
*/ | Adds the list of criteria and result fields to their group prototypes, then adds the criteria and result groups to the items for the view | initializeGroups | {
"repo_name": "ricepanda/rice-git3",
"path": "rice-framework/krad-web-framework/src/main/java/org/kuali/rice/krad/lookup/LookupView.java",
"license": "apache-2.0",
"size": 35888
} | [
"java.util.Arrays"
] | import java.util.Arrays; | import java.util.*; | [
"java.util"
] | java.util; | 931,643 |
private Object readItem() {
logger.entering(sourceClass, "readItem");
Object itemRead = null;
try {
currentChunkStatus.incrementItemsTouchedInCurrentChunk();
// call read listeners before and after the actual read
for (ItemReadListenerProxy readListenerProxy : itemReadListeners) {
... | Object function() { logger.entering(sourceClass, STR); Object itemRead = null; try { currentChunkStatus.incrementItemsTouchedInCurrentChunk(); for (ItemReadListenerProxy readListenerProxy : itemReadListeners) { readListenerProxy.beforeRead(); } itemRead = readerProxy.readItem(); for (ItemReadListenerProxy readListenerP... | /**
* Reads an item from the reader
*
* @return the item read
*/ | Reads an item from the reader | readItem | {
"repo_name": "sidgoyal/standards.jsr352.jbatch",
"path": "com.ibm.jbatch.container/src/main/java/com/ibm/jbatch/container/impl/ChunkStepControllerImpl.java",
"license": "apache-2.0",
"size": 41464
} | [
"com.ibm.jbatch.container.artifact.proxy.ItemReadListenerProxy",
"com.ibm.jbatch.container.context.impl.MetricImpl",
"com.ibm.jbatch.container.exception.BatchContainerRuntimeException"
] | import com.ibm.jbatch.container.artifact.proxy.ItemReadListenerProxy; import com.ibm.jbatch.container.context.impl.MetricImpl; import com.ibm.jbatch.container.exception.BatchContainerRuntimeException; | import com.ibm.jbatch.container.artifact.proxy.*; import com.ibm.jbatch.container.context.impl.*; import com.ibm.jbatch.container.exception.*; | [
"com.ibm.jbatch"
] | com.ibm.jbatch; | 2,155,466 |
public static ims.core.vitals.domain.objects.GCS extractGCS(ims.domain.ILightweightDomainFactory domainFactory, ims.core.vo.VSGlasgowComaScale valueObject)
{
return extractGCS(domainFactory, valueObject, new HashMap());
}
| static ims.core.vitals.domain.objects.GCS function(ims.domain.ILightweightDomainFactory domainFactory, ims.core.vo.VSGlasgowComaScale valueObject) { return extractGCS(domainFactory, valueObject, new HashMap()); } | /**
* Create the domain object from the value object.
* @param domainFactory - used to create existing (persistent) domain objects.
* @param valueObject - extract the domain object fields from this.
*/ | Create the domain object from the value object | extractGCS | {
"repo_name": "open-health-hub/openmaxims-linux",
"path": "openmaxims_workspace/ValueObjects/src/ims/core/vo/domain/VSGlasgowComaScaleAssembler.java",
"license": "agpl-3.0",
"size": 15945
} | [
"java.util.HashMap"
] | import java.util.HashMap; | import java.util.*; | [
"java.util"
] | java.util; | 1,052,542 |
private void postPlugin(final boolean isPing) throws IOException {
// Server software specific section
PluginDescriptionFile description = plugin.getDescription();
String pluginName = description.getName();
boolean onlineMode = Bukkit.getServer().getOnlineMode(); // TRUE if online mo... | void function(final boolean isPing) throws IOException { PluginDescriptionFile description = plugin.getDescription(); String pluginName = description.getName(); boolean onlineMode = Bukkit.getServer().getOnlineMode(); String pluginVersion = description.getVersion(); String serverVersion = Bukkit.getVersion(); int playe... | /**
* Generic method that posts a plugin to the metrics website
*/ | Generic method that posts a plugin to the metrics website | postPlugin | {
"repo_name": "yukinoraru/ToggleInventory",
"path": "src/main/java/com/github/yukinoraru/ToggleInventory/Metrics.java",
"license": "gpl-3.0",
"size": 24844
} | [
"java.io.BufferedReader",
"java.io.IOException",
"java.io.InputStreamReader",
"java.io.OutputStream",
"java.net.Proxy",
"java.net.URLConnection",
"java.util.Iterator",
"org.bukkit.Bukkit",
"org.bukkit.plugin.PluginDescriptionFile"
] | import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStream; import java.net.Proxy; import java.net.URLConnection; import java.util.Iterator; import org.bukkit.Bukkit; import org.bukkit.plugin.PluginDescriptionFile; | import java.io.*; import java.net.*; import java.util.*; import org.bukkit.*; import org.bukkit.plugin.*; | [
"java.io",
"java.net",
"java.util",
"org.bukkit",
"org.bukkit.plugin"
] | java.io; java.net; java.util; org.bukkit; org.bukkit.plugin; | 1,089,141 |
public static byte[][] getPathComponents(String path) {
// avoid intermediate split to String[]
final byte[] bytes = string2Bytes(path);
return DFSUtilClient
.bytes2byteArray(bytes, bytes.length, (byte) Path.SEPARATOR_CHAR);
} | static byte[][] function(String path) { final byte[] bytes = string2Bytes(path); return DFSUtilClient .bytes2byteArray(bytes, bytes.length, (byte) Path.SEPARATOR_CHAR); } | /**
* Convert a UTF8 string to an array of byte arrays.
*/ | Convert a UTF8 string to an array of byte arrays | getPathComponents | {
"repo_name": "dennishuo/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java",
"license": "apache-2.0",
"size": 63202
} | [
"org.apache.hadoop.fs.Path"
] | import org.apache.hadoop.fs.Path; | import org.apache.hadoop.fs.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 2,642,319 |
private ActionForward promptForAffectedDelegates(ActionMapping mapping,
ActionForm form, HttpServletRequest request,
HttpServletResponse response,
IdentityManagementRoleDocumentForm roleDocumentForm, KimDocumentRoleMember... roleMembersToConsiderInactive)
throws E... | ActionForward function(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response, IdentityManagementRoleDocumentForm roleDocumentForm, KimDocumentRoleMember... roleMembersToConsiderInactive) throws Exception { List<RoleDocumentDelegationMember> activeDelegatesOfInactiveRoleMembers... | /**
* Side-effecting method returns an ActionForward if needed for handling prompting of the user about automatically
* "inactivating" active delegates of inactive role members. If the user has already responded "Yes", delegates are
* "inactivated" here, and a null forward is returned. Otherwise, an... | Side-effecting method returns an ActionForward if needed for handling prompting of the user about automatically "inactivating" active delegates of inactive role members. If the user has already responded "Yes", delegates are "inactivated" here, and a null forward is returned. Otherwise, an appropriate forward is return... | promptForAffectedDelegates | {
"repo_name": "mztaylor/rice-git",
"path": "rice-middleware/impl/src/main/java/org/kuali/rice/kim/web/struts/action/IdentityManagementRoleDocumentAction.java",
"license": "apache-2.0",
"size": 41470
} | [
"java.sql.Timestamp",
"java.util.Calendar",
"java.util.List",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse",
"org.apache.struts.action.ActionForm",
"org.apache.struts.action.ActionForward",
"org.apache.struts.action.ActionMapping",
"org.kuali.rice.kim.bo.ui.KimDoc... | import java.sql.Timestamp; import java.util.Calendar; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.k... | import java.sql.*; import java.util.*; import javax.servlet.http.*; import org.apache.struts.action.*; import org.kuali.rice.kim.bo.ui.*; import org.kuali.rice.kim.web.struts.form.*; | [
"java.sql",
"java.util",
"javax.servlet",
"org.apache.struts",
"org.kuali.rice"
] | java.sql; java.util; javax.servlet; org.apache.struts; org.kuali.rice; | 1,403,586 |
@Test public void testPairFirstAnd() {
List<String> strings = Arrays.asList("a", "b", "c");
List<String> result = new ArrayList<String>();
for (Pair<String, String> pair : Pair.firstAnd(strings)) {
result.add(pair.toString());
}
assertThat(result.toString(), equalTo("[<a, b>, <a, c>]"));
... | @Test void function() { List<String> strings = Arrays.asList("a", "b", "c"); List<String> result = new ArrayList<String>(); for (Pair<String, String> pair : Pair.firstAnd(strings)) { result.add(pair.toString()); } assertThat(result.toString(), equalTo(STR)); assertThat(Pair.firstAnd(ImmutableList.of()).iterator().hasNe... | /**
* Unit test for {@link Pair#firstAnd(Iterable)}.
*/ | Unit test for <code>Pair#firstAnd(Iterable)</code> | testPairFirstAnd | {
"repo_name": "joshelser/incubator-calcite",
"path": "core/src/test/java/org/apache/calcite/util/UtilTest.java",
"license": "apache-2.0",
"size": 52179
} | [
"com.google.common.collect.ImmutableList",
"com.google.common.collect.Iterables",
"java.util.ArrayList",
"java.util.Arrays",
"java.util.Collections",
"java.util.List",
"org.hamcrest.CoreMatchers",
"org.junit.Assert",
"org.junit.Test"
] | import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import org.hamcrest.CoreMatchers; import org.junit.Assert; import org.junit.Test; | import com.google.common.collect.*; import java.util.*; import org.hamcrest.*; import org.junit.*; | [
"com.google.common",
"java.util",
"org.hamcrest",
"org.junit"
] | com.google.common; java.util; org.hamcrest; org.junit; | 457,090 |
public final int getInterpolationType ()
{
if (hints.containsValue(RenderingHints.VALUE_INTERPOLATION_BILINEAR))
return TYPE_BILINEAR;
else if (hints.containsValue(RenderingHints.VALUE_INTERPOLATION_BICUBIC))
return TYPE_BICUBIC;
else
return TYPE_NEAREST_... | final int function () { if (hints.containsValue(RenderingHints.VALUE_INTERPOLATION_BILINEAR)) return TYPE_BILINEAR; else if (hints.containsValue(RenderingHints.VALUE_INTERPOLATION_BICUBIC)) return TYPE_BICUBIC; else return TYPE_NEAREST_NEIGHBOR; } | /**
* Returns interpolation type used during transformations.
*
* @return interpolation type
*/ | Returns interpolation type used during transformations | getInterpolationType | {
"repo_name": "taciano-perez/JamVM-PH",
"path": "src/classpath/java/awt/image/AffineTransformOp.java",
"license": "gpl-2.0",
"size": 23426
} | [
"java.awt.RenderingHints"
] | import java.awt.RenderingHints; | import java.awt.*; | [
"java.awt"
] | java.awt; | 22,903 |
public void setNodeID(NodeID nodeID) {
this.nodeID = nodeID;
}
| void function(NodeID nodeID) { this.nodeID = nodeID; } | /**
* Sets an ID that uniquely identifies this server in a cluster. When not running in cluster mode
* the returned value is always the same. However, when in cluster mode the value should be set
* when joining the cluster and must be unique even upon restarts of this node.
*
* @param node... | Sets an ID that uniquely identifies this server in a cluster. When not running in cluster mode the returned value is always the same. However, when in cluster mode the value should be set when joining the cluster and must be unique even upon restarts of this node | setNodeID | {
"repo_name": "GinRyan/OpenFireMODxmppServer",
"path": "src/java/org/jivesoftware/openfire/XMPPServer.java",
"license": "apache-2.0",
"size": 59961
} | [
"org.jivesoftware.openfire.cluster.NodeID"
] | import org.jivesoftware.openfire.cluster.NodeID; | import org.jivesoftware.openfire.cluster.*; | [
"org.jivesoftware.openfire"
] | org.jivesoftware.openfire; | 2,876,759 |
List<Project> getAll(); | List<Project> getAll(); | /**
* Retrieves all the registered Projects.
* </p>
* @return all the registered Projects.
*/ | Retrieves all the registered Projects. | getAll | {
"repo_name": "greenpeppersoftware/greenpepper3",
"path": "greenpepper-server/src/main/java/com/greenpepper/server/domain/dao/ProjectDao.java",
"license": "apache-2.0",
"size": 1350
} | [
"com.greenpepper.server.domain.Project",
"java.util.List"
] | import com.greenpepper.server.domain.Project; import java.util.List; | import com.greenpepper.server.domain.*; import java.util.*; | [
"com.greenpepper.server",
"java.util"
] | com.greenpepper.server; java.util; | 2,818,438 |
public void setURL(String url)
{
this.dictionary.setString(COSName.URL, url);
} | void function(String url) { this.dictionary.setString(COSName.URL, url); } | /**
* (Optional) A URL, the use for which is defined by the URLType entry.
*
* @param url String of the URL
*/ | (Optional) A URL, the use for which is defined by the URLType entry | setURL | {
"repo_name": "TomRoush/PdfBox-Android",
"path": "library/src/main/java/com/tom_roush/pdfbox/pdmodel/interactive/digitalsignature/PDSeedValueCertificate.java",
"license": "apache-2.0",
"size": 22688
} | [
"com.tom_roush.pdfbox.cos.COSName"
] | import com.tom_roush.pdfbox.cos.COSName; | import com.tom_roush.pdfbox.cos.*; | [
"com.tom_roush.pdfbox"
] | com.tom_roush.pdfbox; | 288,925 |
public Collection<MetaDataError> getErrorsForInput(InputPort inputPort, MetaData isData, CompatibilityLevel level) {
if (!this.dataClass.isAssignableFrom(isData.dataClass)) {
return Collections.<MetaDataError> singletonList(new InputMissingMetaDataError(inputPort, this.getObjectClass(),
isData.getObject... | Collection<MetaDataError> function(InputPort inputPort, MetaData isData, CompatibilityLevel level) { if (!this.dataClass.isAssignableFrom(isData.dataClass)) { return Collections.<MetaDataError> singletonList(new InputMissingMetaDataError(inputPort, this.getObjectClass(), isData.getObjectClass())); } Collection<MetaData... | /**
* Returns a (possibly empty) list of errors specifying in what regard <code>isData</code>
* differs from <code>this</code> meta data specification.
*
* @param inputPort
* required for generating errors
* @param isData
* the data received by the port
*/ | Returns a (possibly empty) list of errors specifying in what regard <code>isData</code> differs from <code>this</code> meta data specification | getErrorsForInput | {
"repo_name": "boob-sbcm/3838438",
"path": "src/main/java/com/rapidminer/operator/ports/metadata/MetaData.java",
"license": "agpl-3.0",
"size": 8101
} | [
"com.rapidminer.operator.ProcessSetupError",
"com.rapidminer.operator.ports.InputPort",
"java.util.Collection",
"java.util.Collections",
"java.util.LinkedList",
"java.util.Map"
] | import com.rapidminer.operator.ProcessSetupError; import com.rapidminer.operator.ports.InputPort; import java.util.Collection; import java.util.Collections; import java.util.LinkedList; import java.util.Map; | import com.rapidminer.operator.*; import com.rapidminer.operator.ports.*; import java.util.*; | [
"com.rapidminer.operator",
"java.util"
] | com.rapidminer.operator; java.util; | 2,160,249 |
public void evaluateWithEvent(IMonitor monitor);
| void function(IMonitor monitor); | /**
* Evaluate the expression and fire an event on completion (for long calculations, or expressions on UI)
* Can be cancelled using the monitor
*
* @param monitor
*/ | Evaluate the expression and fire an event on completion (for long calculations, or expressions on UI) Can be cancelled using the monitor | evaluateWithEvent | {
"repo_name": "xen-0/dawnsci",
"path": "org.eclipse.dawnsci.analysis.api/src/org/eclipse/dawnsci/analysis/api/expressions/IExpressionEngine.java",
"license": "epl-1.0",
"size": 3172
} | [
"org.eclipse.january.IMonitor"
] | import org.eclipse.january.IMonitor; | import org.eclipse.january.*; | [
"org.eclipse.january"
] | org.eclipse.january; | 158,384 |
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
} | void function(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); } | /**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This adds <code>org.eclipse.emf.edit.command.CommandParameter</code>s describing the children that can be created under this object. | collectNewChildDescriptors | {
"repo_name": "dzonekl/LiquibaseEditor",
"path": "plugins/org.liquidbase.model.edit/src/org/liquibase/xml/ns/dbchangelog/provider/ParamTypeItemProvider.java",
"license": "mit",
"size": 10371
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 2,819,757 |
public void markAsSpent(TransactionInput input) {
checkState(availableForSpending);
availableForSpending = false;
spentBy = input;
} | void function(TransactionInput input) { checkState(availableForSpending); availableForSpending = false; spentBy = input; } | /**
* Sets this objects availableForSpending flag to false and the spentBy pointer to the given input.
* If the input is null, it means this output was signed over to somebody else rather than one of our own keys.
* @throws IllegalStateException if the transaction was already marked as spent.
*/ | Sets this objects availableForSpending flag to false and the spentBy pointer to the given input. If the input is null, it means this output was signed over to somebody else rather than one of our own keys | markAsSpent | {
"repo_name": "hank/litecoinj-new",
"path": "core/src/main/java/com/google/litecoin/core/TransactionOutput.java",
"license": "apache-2.0",
"size": 14630
} | [
"com.google.common.base.Preconditions"
] | import com.google.common.base.Preconditions; | import com.google.common.base.*; | [
"com.google.common"
] | com.google.common; | 981,467 |
private static String trimIfPossible(
String stringValue, PropertyDescriptor propertyDescriptor) {
return isStringTypeProperty(propertyDescriptor) ? stringValue.trim() : stringValue;
} | static String function( String stringValue, PropertyDescriptor propertyDescriptor) { return isStringTypeProperty(propertyDescriptor) ? stringValue.trim() : stringValue; } | /**
* Trims the property if it is of type String.
*
* @param stringValue the string value of the property.
* @param propertyDescriptor the property descriptor.
* @return the property value trimmed.
*/ | Trims the property if it is of type String | trimIfPossible | {
"repo_name": "googleads/aw-reporting",
"path": "aw-reporting-model/src/main/java/com/google/api/ads/adwords/awreporting/model/csv/ModifiedCsvToBean.java",
"license": "apache-2.0",
"size": 4628
} | [
"java.beans.PropertyDescriptor"
] | import java.beans.PropertyDescriptor; | import java.beans.*; | [
"java.beans"
] | java.beans; | 1,750,714 |
if (mObjects.get(position) instanceof Device) {
return (mUnpairedDevices) ? TYPE_UNPAIRED_DEVICE : TYPE_DEVICE;
} else if (mObjects.get(position) instanceof Location) {
return TYPE_LOCATION;
} else if (mObjects.get(position) instanceof String) {
return TYPE_HEADER;
} else {
throw new ClassCastExcept... | if (mObjects.get(position) instanceof Device) { return (mUnpairedDevices) ? TYPE_UNPAIRED_DEVICE : TYPE_DEVICE; } else if (mObjects.get(position) instanceof Location) { return TYPE_LOCATION; } else if (mObjects.get(position) instanceof String) { return TYPE_HEADER; } else { throw new ClassCastException(String.format(ST... | /**
* Returns type based on object's on position class
*
* @param position
* @return TYPE_XXX
*/ | Returns type based on object's on position class | getItemViewType | {
"repo_name": "BeeeOn/android",
"path": "BeeeOn/app/src/main/java/com/rehivetech/beeeon/gui/adapter/DeviceRecycleAdapter.java",
"license": "bsd-3-clause",
"size": 8400
} | [
"com.rehivetech.beeeon.household.device.Device",
"com.rehivetech.beeeon.household.location.Location"
] | import com.rehivetech.beeeon.household.device.Device; import com.rehivetech.beeeon.household.location.Location; | import com.rehivetech.beeeon.household.device.*; import com.rehivetech.beeeon.household.location.*; | [
"com.rehivetech.beeeon"
] | com.rehivetech.beeeon; | 1,283,615 |
private boolean isStateless() {
return SessionCreationPolicy.STATELESS == this.sessionPolicy;
} | boolean function() { return SessionCreationPolicy.STATELESS == this.sessionPolicy; } | /**
* Returns true if the {@link SessionCreationPolicy} is stateless
* @return
*/ | Returns true if the <code>SessionCreationPolicy</code> is stateless | isStateless | {
"repo_name": "kazuki43zoo/spring-security",
"path": "config/src/main/java/org/springframework/security/config/annotation/web/configurers/SessionManagementConfigurer.java",
"license": "apache-2.0",
"size": 26911
} | [
"org.springframework.security.config.http.SessionCreationPolicy"
] | import org.springframework.security.config.http.SessionCreationPolicy; | import org.springframework.security.config.http.*; | [
"org.springframework.security"
] | org.springframework.security; | 205,241 |
protected final void renderInlineStyleAttribute(
UIXRenderingContext context,
UINode node
) throws IOException
{
renderInlineStyleAttribute(context, getInlineStyle(context, node));
} | final void function( UIXRenderingContext context, UINode node ) throws IOException { renderInlineStyleAttribute(context, getInlineStyle(context, node)); } | /**
* Renders the inline style attribute for the specified node
*/ | Renders the inline style attribute for the specified node | renderInlineStyleAttribute | {
"repo_name": "adamrduffy/trinidad-1.0.x",
"path": "trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/XhtmlLafRenderer.java",
"license": "apache-2.0",
"size": 68394
} | [
"java.io.IOException",
"org.apache.myfaces.trinidadinternal.ui.UINode",
"org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext"
] | import java.io.IOException; import org.apache.myfaces.trinidadinternal.ui.UINode; import org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext; | import java.io.*; import org.apache.myfaces.trinidadinternal.ui.*; | [
"java.io",
"org.apache.myfaces"
] | java.io; org.apache.myfaces; | 218,542 |
public static List<String> shorten(List<String> strings, int maxLength) {
return strings.stream()
.map(s -> shorten(s, maxLength))
.collect(Collectors.toList());
} | static List<String> function(List<String> strings, int maxLength) { return strings.stream() .map(s -> shorten(s, maxLength)) .collect(Collectors.toList()); } | /**
* Truncate list of strings to be no longer than maxLength individually.
*/ | Truncate list of strings to be no longer than maxLength individually | shorten | {
"repo_name": "zanata/zanata-mt",
"path": "business-svc/src/main/java/org/zanata/magpie/util/ShortString.java",
"license": "lgpl-2.1",
"size": 2056
} | [
"java.util.List",
"java.util.stream.Collectors"
] | import java.util.List; import java.util.stream.Collectors; | import java.util.*; import java.util.stream.*; | [
"java.util"
] | java.util; | 2,675,403 |
public static String marshallConfig() {
SnmpPeerFactory.getReadLock().lock();
try {
String marshalledConfig = null;
StringWriter writer = null;
try {
writer = new StringWriter();
JaxbUtils.marshal(m_config, writer);
... | static String function() { SnmpPeerFactory.getReadLock().lock(); try { String marshalledConfig = null; StringWriter writer = null; try { writer = new StringWriter(); JaxbUtils.marshal(m_config, writer); marshalledConfig = writer.toString(); } finally { IOUtils.closeQuietly(writer); } return marshalledConfig; } finally ... | /**
* Creates a string containing the XML of the current SnmpConfig
*
* @return Marshalled SnmpConfig
*/ | Creates a string containing the XML of the current SnmpConfig | marshallConfig | {
"repo_name": "peternixon/opennms-mirror",
"path": "opennms-config/src/main/java/org/opennms/netmgt/config/SnmpPeerFactory.java",
"license": "gpl-2.0",
"size": 27915
} | [
"java.io.StringWriter",
"org.apache.commons.io.IOUtils",
"org.opennms.core.xml.JaxbUtils"
] | import java.io.StringWriter; import org.apache.commons.io.IOUtils; import org.opennms.core.xml.JaxbUtils; | import java.io.*; import org.apache.commons.io.*; import org.opennms.core.xml.*; | [
"java.io",
"org.apache.commons",
"org.opennms.core"
] | java.io; org.apache.commons; org.opennms.core; | 2,269,227 |
private int calculateDaysBeforeExpiration(LDAPEntry fe) {
SilverTrace.debug("authentication",
"AuthenticationLDAP.calculateDaysBeforeExpiration()",
"root.MSG_GEN_ENTER_METHOD");
LDAPAttribute pwdLastSetAttr = fe.getAttribute(m_PwdLastSetFieldName);
// if password last set attribute is not... | int function(LDAPEntry fe) { SilverTrace.debug(STR, STR, STR); LDAPAttribute pwdLastSetAttr = fe.getAttribute(m_PwdLastSetFieldName); SilverTrace.debug(STR, STR, STR, STR + (pwdLastSetAttr == null)); if (pwdLastSetAttr == null) { return Integer.MAX_VALUE; } Date pwdLastSet = null; switch (m_PwdLastSetFieldFormat) { cas... | /**
* Given an user ldap entry, compute the numbers of days before password expiration
* @param fe the user ldap entry
* @return duration in days
*/ | Given an user ldap entry, compute the numbers of days before password expiration | calculateDaysBeforeExpiration | {
"repo_name": "NicolasEYSSERIC/Silverpeas-Core",
"path": "lib-core/src/main/java/com/stratelia/silverpeas/authentication/AuthenticationLDAP.java",
"license": "agpl-3.0",
"size": 20404
} | [
"com.novell.ldap.LDAPAttribute",
"com.novell.ldap.LDAPEntry",
"com.stratelia.silverpeas.silvertrace.SilverTrace",
"com.stratelia.webactiv.util.DateUtil",
"java.text.DateFormat",
"java.text.ParseException",
"java.text.SimpleDateFormat",
"java.util.Date"
] | import com.novell.ldap.LDAPAttribute; import com.novell.ldap.LDAPEntry; import com.stratelia.silverpeas.silvertrace.SilverTrace; import com.stratelia.webactiv.util.DateUtil; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; | import com.novell.ldap.*; import com.stratelia.silverpeas.silvertrace.*; import com.stratelia.webactiv.util.*; import java.text.*; import java.util.*; | [
"com.novell.ldap",
"com.stratelia.silverpeas",
"com.stratelia.webactiv",
"java.text",
"java.util"
] | com.novell.ldap; com.stratelia.silverpeas; com.stratelia.webactiv; java.text; java.util; | 2,729,293 |
public Builder addDeclaredIncludeSrcs(Iterable<Artifact> declaredIncludeSrcs) {
this.declaredIncludeSrcs.addAll(declaredIncludeSrcs);
this.headerModuleSrcs.addAll(declaredIncludeSrcs);
return addCompilationPrerequisites(declaredIncludeSrcs);
} | Builder function(Iterable<Artifact> declaredIncludeSrcs) { this.declaredIncludeSrcs.addAll(declaredIncludeSrcs); this.headerModuleSrcs.addAll(declaredIncludeSrcs); return addCompilationPrerequisites(declaredIncludeSrcs); } | /**
* Adds multiple headers that have been declared in the {@code src} or {@code headers
* attribute}. The headers will also be added to the compilation prerequisites.
*/ | Adds multiple headers that have been declared in the src or headers attribute. The headers will also be added to the compilation prerequisites | addDeclaredIncludeSrcs | {
"repo_name": "hhclam/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompilationContext.java",
"license": "apache-2.0",
"size": 39735
} | [
"com.google.devtools.build.lib.actions.Artifact"
] | import com.google.devtools.build.lib.actions.Artifact; | import com.google.devtools.build.lib.actions.*; | [
"com.google.devtools"
] | com.google.devtools; | 1,208,484 |
public void setWorld(World world) {
WolfTable wt = getWolfTable();
if (wt != null) {
wt.setWorld(world.getUID().toString());
}
} | void function(World world) { WolfTable wt = getWolfTable(); if (wt != null) { wt.setWorld(world.getUID().toString()); } } | /**
* Set world.
*
* @param world
*/ | Set world | setWorld | {
"repo_name": "halvors/Lupi",
"path": "src/main/java/org/halvors/lupi/wolf/Wolf.java",
"license": "gpl-3.0",
"size": 8054
} | [
"org.bukkit.World"
] | import org.bukkit.World; | import org.bukkit.*; | [
"org.bukkit"
] | org.bukkit; | 619,528 |
@GetMapping(path = SamlIdPConstants.ENDPOINT_SAML2_SSO_PROFILE_CALLBACK)
protected ModelAndView handleCallbackProfileRequestGet(final HttpServletResponse response,
final HttpServletRequest request) throws Exception {
autoConfigureCookiePath(requ... | @GetMapping(path = SamlIdPConstants.ENDPOINT_SAML2_SSO_PROFILE_CALLBACK) ModelAndView function(final HttpServletResponse response, final HttpServletRequest request) throws Exception { autoConfigureCookiePath(request); val properties = configurationContext.getCasProperties(); val type = properties.getAuthn().getSamlIdp(... | /**
* Handle callback profile request.
*
* @param response the response
* @param request the request
* @return the model and view
* @throws Exception the exception
*/ | Handle callback profile request | handleCallbackProfileRequestGet | {
"repo_name": "fogbeam/cas_mirror",
"path": "support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/sso/SSOSamlIdPProfileCallbackHandlerController.java",
"license": "apache-2.0",
"size": 5903
} | [
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse",
"org.apereo.cas.configuration.model.support.saml.idp.SamlIdPCoreProperties",
"org.apereo.cas.support.saml.SamlIdPConstants",
"org.apereo.cas.web.BrowserSessionStorage",
"org.apereo.cas.web.flow.CasWebflowConstants",
"org.... | import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apereo.cas.configuration.model.support.saml.idp.SamlIdPCoreProperties; import org.apereo.cas.support.saml.SamlIdPConstants; import org.apereo.cas.web.BrowserSessionStorage; import org.apereo.cas.web.flow.CasWebflowCo... | import javax.servlet.http.*; import org.apereo.cas.configuration.model.support.saml.idp.*; import org.apereo.cas.support.saml.*; import org.apereo.cas.web.*; import org.apereo.cas.web.flow.*; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.*; | [
"javax.servlet",
"org.apereo.cas",
"org.springframework.web"
] | javax.servlet; org.apereo.cas; org.springframework.web; | 643,303 |
private String readDatabaseData(ResourceForm startForm, HttpServletRequest request) throws ServletException {
// save toolContentID into HTTPSession
Long contentId = WebUtil.readLongParam(request, ResourceConstants.PARAM_TOOL_CONTENT_ID);
// get back the resource and item list and display them on page
List<Re... | String function(ResourceForm startForm, HttpServletRequest request) throws ServletException { Long contentId = WebUtil.readLongParam(request, ResourceConstants.PARAM_TOOL_CONTENT_ID); List<ResourceItem> items = null; Resource resource = null; String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_C... | /**
* Common method for "start" and "defineLater"
*/ | Common method for "start" and "defineLater" | readDatabaseData | {
"repo_name": "lamsfoundation/lams",
"path": "lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/controller/AuthoringController.java",
"license": "gpl-2.0",
"size": 26868
} | [
"java.util.ArrayList",
"java.util.List",
"java.util.SortedSet",
"javax.servlet.ServletException",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpSession",
"org.lamsfoundation.lams.tool.rsrc.ResourceConstants",
"org.lamsfoundation.lams.tool.rsrc.model.Resource",
"org.lamsfoundation.... | import java.util.ArrayList; import java.util.List; import java.util.SortedSet; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.lamsfoundation.lams.tool.rsrc.ResourceConstants; import org.lamsfoundation.lams.tool.rsrc.model.Resource; ... | import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import org.lamsfoundation.lams.tool.rsrc.*; import org.lamsfoundation.lams.tool.rsrc.model.*; import org.lamsfoundation.lams.tool.rsrc.web.form.*; import org.lamsfoundation.lams.usermanagement.dto.*; import org.lamsfoundation.lams.util.*; import o... | [
"java.util",
"javax.servlet",
"org.lamsfoundation.lams"
] | java.util; javax.servlet; org.lamsfoundation.lams; | 107,558 |
public List<String> listCourses() {
List<String> courses = new ArrayList();
try {
PreparedStatement list = connection.prepareStatement("SELECT * FROM lista_cursos_ae;");
ResultSet resultset = list.executeQuery();
while (resultset.next()) {
courses... | List<String> function() { List<String> courses = new ArrayList(); try { PreparedStatement list = connection.prepareStatement(STR); ResultSet resultset = list.executeQuery(); while (resultset.next()) { courses.add(resultset.getString(1)); } return courses; } catch (SQLException sqlException) { System.err.println(STR); s... | /**
* Lista cursos
*
* @return <code>List</code> com cursos
*/ | Lista cursos | listCourses | {
"repo_name": "jmayer13/SAlmox",
"path": "src/uni/uri/salmox/DAO/AEDAO.java",
"license": "gpl-2.0",
"size": 43972
} | [
"java.sql.PreparedStatement",
"java.sql.ResultSet",
"java.sql.SQLException",
"java.util.ArrayList",
"java.util.List",
"javax.swing.JOptionPane"
] | import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import javax.swing.JOptionPane; | import java.sql.*; import java.util.*; import javax.swing.*; | [
"java.sql",
"java.util",
"javax.swing"
] | java.sql; java.util; javax.swing; | 1,594,865 |
public void setField(Period field) {
this.field = field;
} | void function(Period field) { this.field = field; } | /**
* Set the field value.
*
* @param field the field value to set
*/ | Set the field value | setField | {
"repo_name": "sharadagarwal/autorest",
"path": "AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/bodycomplex/models/DurationWrapper.java",
"license": "mit",
"size": 846
} | [
"org.joda.time.Period"
] | import org.joda.time.Period; | import org.joda.time.*; | [
"org.joda.time"
] | org.joda.time; | 1,102,476 |
public void testCtrlSelectToggle() {
FileTreeNode root = mockTree.getModel().getRoot();
// Render the tree.
mockTree.renderTree(-1);
SignalEvent ctrlSignalEvent = new MockSignalEvent(true, false);
// Select a bunch of nodes at the same tier.
FileTreeNode AD1 = getNodeByPath(0);
assertNo... | void function() { FileTreeNode root = mockTree.getModel().getRoot(); mockTree.renderTree(-1); SignalEvent ctrlSignalEvent = new MockSignalEvent(true, false); FileTreeNode AD1 = getNodeByPath(0); assertNotNull(STR, AD1.getRenderedTreeNode()); assertFalse(AD1.getRenderedTreeNode().isSelected(resources.treeCss())); JsoArr... | /**
* Tests select responses to ctrl clicks that should result in select toggling
*/ | Tests select responses to ctrl clicks that should result in select toggling | testCtrlSelectToggle | {
"repo_name": "WeTheInternet/collide",
"path": "javatests/com/google/collide/client/ui/tree/SelectionModelTest.java",
"license": "apache-2.0",
"size": 13713
} | [
"com.google.collide.json.client.JsoArray",
"org.waveprotocol.wave.client.common.util.SignalEvent"
] | import com.google.collide.json.client.JsoArray; import org.waveprotocol.wave.client.common.util.SignalEvent; | import com.google.collide.json.client.*; import org.waveprotocol.wave.client.common.util.*; | [
"com.google.collide",
"org.waveprotocol.wave"
] | com.google.collide; org.waveprotocol.wave; | 75,157 |
public static ArrayList<Long[]> getSidesOfRightTriangle(Long perimeter)
throws IllegalArgumentException {
if (perimeter < 0)
throw new IllegalArgumentException("Negative perimeter, really?!");
ArrayList<Long[]> solution = new ArrayList<>();
for (long a = 0L; a < perimete... | static ArrayList<Long[]> function(Long perimeter) throws IllegalArgumentException { if (perimeter < 0) throw new IllegalArgumentException(STR); ArrayList<Long[]> solution = new ArrayList<>(); for (long a = 0L; a < perimeter / 3; a++) { for (long b = a + 1; b < 2 * perimeter / 3; b++) { long c = perimeter - a - b; if (a... | /**
* Returns the possibilities of length sides in a right triangle knowing
* its perimeter, and assuming all the length sides are whole numbers.
*
* @since 1.0
*
* @param perimeter is the perimeter of the triangle.
* @return a list of arrays corresponding to the different possibiliti... | Returns the possibilities of length sides in a right triangle knowing its perimeter, and assuming all the length sides are whole numbers | getSidesOfRightTriangle | {
"repo_name": "StevyK/Project-Euler",
"path": "src/main/maths/Geometry.java",
"license": "gpl-3.0",
"size": 1331
} | [
"java.util.ArrayList"
] | import java.util.ArrayList; | import java.util.*; | [
"java.util"
] | java.util; | 895,400 |
public List<GHCommit> getParents() throws IOException {
List<GHCommit> r = new ArrayList<GHCommit>();
for (String sha1 : getParentSHA1s())
r.add(owner.getCommit(sha1));
return r;
} | List<GHCommit> function() throws IOException { List<GHCommit> r = new ArrayList<GHCommit>(); for (String sha1 : getParentSHA1s()) r.add(owner.getCommit(sha1)); return r; } | /**
* Resolves the parent commit objects and return them.
*/ | Resolves the parent commit objects and return them | getParents | {
"repo_name": "appbank2020/GitRobot",
"path": "src/org/kohsuke/github/GHCommit.java",
"license": "apache-2.0",
"size": 7726
} | [
"java.io.IOException",
"java.util.ArrayList",
"java.util.List"
] | import java.io.IOException; import java.util.ArrayList; import java.util.List; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 708,312 |
public BlobContainersInner blobContainers() {
return this.blobContainers;
}
public StorageManagementClientImpl(ServiceClientCredentials credentials) {
this("https://management.azure.com", credentials);
}
public StorageManagementClientImpl(String baseUrl, ServiceClientCred... | BlobContainersInner function() { return this.blobContainers; } public StorageManagementClientImpl(ServiceClientCredentials credentials) { this("https: } public StorageManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { super(baseUrl, credentials); initialize(); } public StorageManagementClientI... | /**
* Gets the BlobContainersInner object to access its operations.
* @return the BlobContainersInner object.
*/ | Gets the BlobContainersInner object to access its operations | blobContainers | {
"repo_name": "hovsepm/azure-sdk-for-java",
"path": "storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/StorageManagementClientImpl.java",
"license": "mit",
"size": 7800
} | [
"com.microsoft.rest.RestClient",
"com.microsoft.rest.credentials.ServiceClientCredentials"
] | import com.microsoft.rest.RestClient; import com.microsoft.rest.credentials.ServiceClientCredentials; | import com.microsoft.rest.*; import com.microsoft.rest.credentials.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 907,013 |
public MemberValue getDefaultValue() {
try {
return new AnnotationsAttribute.Parser(info, constPool).parseMemberValue();
} catch (Exception e) {
throw new RuntimeException(e.toString());
}
} | MemberValue function() { try { return new AnnotationsAttribute.Parser(info, constPool).parseMemberValue(); } catch (Exception e) { throw new RuntimeException(e.toString()); } } | /**
* Obtains the default value represented by this attribute.
*/ | Obtains the default value represented by this attribute | getDefaultValue | {
"repo_name": "alpapad/HotswapAgent",
"path": "hotswap-agent-core/src/main/java/org/hotswap/agent/javassist/bytecode/AnnotationDefaultAttribute.java",
"license": "gpl-2.0",
"size": 4918
} | [
"org.hotswap.agent.javassist.bytecode.annotation.MemberValue"
] | import org.hotswap.agent.javassist.bytecode.annotation.MemberValue; | import org.hotswap.agent.javassist.bytecode.annotation.*; | [
"org.hotswap.agent"
] | org.hotswap.agent; | 491,700 |
protected String getSupportedBinding(IDPSSODescriptor idpSSODescriptor)
{
if (idpSSODescriptor != null)
{
List<SingleSignOnService> ssoServices = idpSSODescriptor.getSingleSignOnServices();
if (ssoServices.size() > 0)
{
// Ret... | String function(IDPSSODescriptor idpSSODescriptor) { if (idpSSODescriptor != null) { List<SingleSignOnService> ssoServices = idpSSODescriptor.getSingleSignOnServices(); if (ssoServices.size() > 0) { for(SingleSignOnService ssos: ssoServices) { if (AbstractEncodingFactory.getSupportedBindings().contains(ssos.getBinding(... | /**
* Returns the first supported binding.
*
* @param idpSSODescriptor IDP SSO Descriptor where to look for the binding.
* @return The first SSO Service binding as String
*/ | Returns the first supported binding | getSupportedBinding | {
"repo_name": "GluuFederation/gluu-Asimba",
"path": "asimba-am-remote-saml2/src/main/java/com/alfaariss/oa/authentication/remote/saml2/profile/sso/WebBrowserSSOProfile.java",
"license": "agpl-3.0",
"size": 44248
} | [
"com.alfaariss.oa.util.saml2.binding.AbstractEncodingFactory",
"java.util.List",
"org.opensaml.saml2.metadata.IDPSSODescriptor",
"org.opensaml.saml2.metadata.SingleSignOnService"
] | import com.alfaariss.oa.util.saml2.binding.AbstractEncodingFactory; import java.util.List; import org.opensaml.saml2.metadata.IDPSSODescriptor; import org.opensaml.saml2.metadata.SingleSignOnService; | import com.alfaariss.oa.util.saml2.binding.*; import java.util.*; import org.opensaml.saml2.metadata.*; | [
"com.alfaariss.oa",
"java.util",
"org.opensaml.saml2"
] | com.alfaariss.oa; java.util; org.opensaml.saml2; | 1,530,574 |
public void prefetchOnMerge(ReduceFn.MergingStateContext state) {
if (subTriggers != null) {
for (Trigger<W> trigger : subTriggers) {
trigger.prefetchOnMerge(state);
}
}
} | void function(ReduceFn.MergingStateContext state) { if (subTriggers != null) { for (Trigger<W> trigger : subTriggers) { trigger.prefetchOnMerge(state); } } } | /**
* Called to allow the trigger to prefetch any state it will likely need to read from during
* an {@link #onMerge} call.
*
* @param state {@link ReduceFn.MergingStateContext} to prefetch from.
*/ | Called to allow the trigger to prefetch any state it will likely need to read from during an <code>#onMerge</code> call | prefetchOnMerge | {
"repo_name": "Test-Betta-Inc/musical-umbrella",
"path": "sdk/src/main/java/com/google/cloud/dataflow/sdk/transforms/windowing/Trigger.java",
"license": "apache-2.0",
"size": 21135
} | [
"com.google.cloud.dataflow.sdk.util.ReduceFn"
] | import com.google.cloud.dataflow.sdk.util.ReduceFn; | import com.google.cloud.dataflow.sdk.util.*; | [
"com.google.cloud"
] | com.google.cloud; | 131,468 |
public void lastOnly() {
final MarketValueCalculator calculator = new MarketValueCalculator();
final MutableFudgeMsg msg = OpenGammaFudgeContext.getInstance().newMessage();
msg.add(MarketDataRequirementNames.LAST, 50.89);
final FieldHistoryStore store = new FieldHistoryStore();
store.liveDataRec... | void function() { final MarketValueCalculator calculator = new MarketValueCalculator(); final MutableFudgeMsg msg = OpenGammaFudgeContext.getInstance().newMessage(); msg.add(MarketDataRequirementNames.LAST, 50.89); final FieldHistoryStore store = new FieldHistoryStore(); store.liveDataReceived(msg); final MutableFudgeM... | /**
* Tests that the last price is used.
*/ | Tests that the last price is used | lastOnly | {
"repo_name": "McLeodMoores/starling",
"path": "projects/live-data/src/test/java/com/opengamma/livedata/normalization/MarketValueCalculatorTest.java",
"license": "apache-2.0",
"size": 10170
} | [
"com.opengamma.core.value.MarketDataRequirementNames",
"com.opengamma.livedata.server.FieldHistoryStore",
"com.opengamma.util.fudgemsg.OpenGammaFudgeContext",
"org.fudgemsg.MutableFudgeMsg",
"org.testng.AssertJUnit"
] | import com.opengamma.core.value.MarketDataRequirementNames; import com.opengamma.livedata.server.FieldHistoryStore; import com.opengamma.util.fudgemsg.OpenGammaFudgeContext; import org.fudgemsg.MutableFudgeMsg; import org.testng.AssertJUnit; | import com.opengamma.core.value.*; import com.opengamma.livedata.server.*; import com.opengamma.util.fudgemsg.*; import org.fudgemsg.*; import org.testng.*; | [
"com.opengamma.core",
"com.opengamma.livedata",
"com.opengamma.util",
"org.fudgemsg",
"org.testng"
] | com.opengamma.core; com.opengamma.livedata; com.opengamma.util; org.fudgemsg; org.testng; | 767,137 |
public ServiceResponseWithHeaders<Void, LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeaders> beginDeleteAsyncRelativeRetryInvalidHeader() throws CloudException, IOException {
Call<ResponseBody> call = service.beginDeleteAsyncRelativeRetryInvalidHeader(this.client.getAcceptLanguage());
return beginDe... | ServiceResponseWithHeaders<Void, LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeaders> function() throws CloudException, IOException { Call<ResponseBody> call = service.beginDeleteAsyncRelativeRetryInvalidHeader(this.client.getAcceptLanguage()); return beginDeleteAsyncRelativeRetryInvalidHeaderDelegate(call.execute()); ... | /**
* Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid.
*
* @throws CloudException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return t... | Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid | beginDeleteAsyncRelativeRetryInvalidHeader | {
"repo_name": "xingwu1/autorest",
"path": "AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/lro/LROSADsOperationsImpl.java",
"license": "mit",
"size": 236888
} | [
"com.microsoft.azure.CloudException",
"com.microsoft.rest.ServiceResponseWithHeaders",
"java.io.IOException"
] | import com.microsoft.azure.CloudException; import com.microsoft.rest.ServiceResponseWithHeaders; import java.io.IOException; | import com.microsoft.azure.*; import com.microsoft.rest.*; import java.io.*; | [
"com.microsoft.azure",
"com.microsoft.rest",
"java.io"
] | com.microsoft.azure; com.microsoft.rest; java.io; | 374,076 |
public static synchronized void forceInjector(Injector injector) {
InjectorFactory.injector = injector;
if (injector == null) {
modules = new ArrayList<>(defaultModules);
} else {
modules = new ArrayList<>();
}
} | static synchronized void function(Injector injector) { InjectorFactory.injector = injector; if (injector == null) { modules = new ArrayList<>(defaultModules); } else { modules = new ArrayList<>(); } } | /**
* Forces the factory to use the given
*
* <p>You should not need this method in production code. This is only useful
* in tests.
*
* @param injector The injector to force. If null, the injector gets
* reset, and re-initialized upon the getting anInjector next time.
*/ | Forces the factory to use the given You should not need this method in production code. This is only useful in tests | forceInjector | {
"repo_name": "SelerityInc/CommonBase",
"path": "src/main/java/com/seleritycorp/common/base/inject/InjectorFactory.java",
"license": "apache-2.0",
"size": 3465
} | [
"com.google.inject.Injector",
"java.util.ArrayList"
] | import com.google.inject.Injector; import java.util.ArrayList; | import com.google.inject.*; import java.util.*; | [
"com.google.inject",
"java.util"
] | com.google.inject; java.util; | 270,781 |
public final void setImageViewResources(Context context, RemoteViews views) {
int containerId = getContainerId();
int buttonId = getButtonId();
int indicatorId = getIndicatorId();
int pos = getPosition();
switch (getTriState(context)) {
... | final void function(Context context, RemoteViews views) { int containerId = getContainerId(); int buttonId = getButtonId(); int indicatorId = getIndicatorId(); int pos = getPosition(); switch (getTriState(context)) { case STATE_DISABLED: views.setContentDescription(containerId, getContentDescription(context, R.string.g... | /**
* Updates the remote views depending on the state (off, on,
* turning off, turning on) of the setting.
*/ | Updates the remote views depending on the state (off, on, turning off, turning on) of the setting | setImageViewResources | {
"repo_name": "rex-xxx/mt6572_x201",
"path": "packages/apps/Settings/src/com/android/settings/widget/SettingsAppWidgetProvider.java",
"license": "gpl-2.0",
"size": 41348
} | [
"android.content.Context",
"android.widget.RemoteViews"
] | import android.content.Context; import android.widget.RemoteViews; | import android.content.*; import android.widget.*; | [
"android.content",
"android.widget"
] | android.content; android.widget; | 514,002 |
public static boolean sendHttpPostRequest(HttpURLConnection connection,
String contentType,
byte[] data) {
try {
connection.setRequestMethod("POST");
} catch (ProtocolException e) {
LOG.log(Level.SEVERE, "Faile... | static boolean function(HttpURLConnection connection, String contentType, byte[] data) { try { connection.setRequestMethod("POST"); } catch (ProtocolException e) { LOG.log(Level.SEVERE, STR, e); return false; } if (data.length > 0) { connection.setRequestProperty(CONTENT_TYPE, contentType); connection.setRequestPropert... | /**
* Send Http POST Request to a connection with given data in request body
*
* @param connection the connection to send post request to
* @param contentType the type of the content to be sent
* @param data the data to send in post request body
* @return true if success
*/ | Send Http POST Request to a connection with given data in request body | sendHttpPostRequest | {
"repo_name": "lucperkins/heron",
"path": "heron/spi/src/java/com/twitter/heron/spi/utils/NetworkUtils.java",
"license": "apache-2.0",
"size": 18064
} | [
"java.io.IOException",
"java.io.OutputStream",
"java.net.HttpURLConnection",
"java.net.ProtocolException",
"java.util.logging.Level"
] | import java.io.IOException; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.ProtocolException; import java.util.logging.Level; | import java.io.*; import java.net.*; import java.util.logging.*; | [
"java.io",
"java.net",
"java.util"
] | java.io; java.net; java.util; | 702,233 |
@Inline
public static int getObjectHashCode(Object o) {
if (ADDRESS_BASED_HASHING) {
if (MemoryManagerConstants.MOVES_OBJECTS) {
Word hashState = Magic.getWordAtOffset(o, STATUS_OFFSET).and(HASH_STATE_MASK);
if (hashState.EQ(HASH_STATE_HASHED)) {
// HASHED, NOT MOVED
re... | static int function(Object o) { if (ADDRESS_BASED_HASHING) { if (MemoryManagerConstants.MOVES_OBJECTS) { Word hashState = Magic.getWordAtOffset(o, STATUS_OFFSET).and(HASH_STATE_MASK); if (hashState.EQ(HASH_STATE_HASHED)) { return Magic.objectAsAddress(o).toWord().rshl(SizeConstants.LOG_BYTES_IN_ADDRESS).toInt(); } else... | /**
* Get the hash code of an object.
*/ | Get the hash code of an object | getObjectHashCode | {
"repo_name": "ut-osa/laminar",
"path": "jikesrvm-3.0.0/rvm/src/org/jikesrvm/objectmodel/JavaHeader.java",
"license": "bsd-3-clause",
"size": 33287
} | [
"org.jikesrvm.SizeConstants",
"org.jikesrvm.classloader.RVMType",
"org.jikesrvm.mm.mminterface.MemoryManagerConstants",
"org.jikesrvm.runtime.Magic",
"org.vmmagic.unboxed.Offset",
"org.vmmagic.unboxed.Word"
] | import org.jikesrvm.SizeConstants; import org.jikesrvm.classloader.RVMType; import org.jikesrvm.mm.mminterface.MemoryManagerConstants; import org.jikesrvm.runtime.Magic; import org.vmmagic.unboxed.Offset; import org.vmmagic.unboxed.Word; | import org.jikesrvm.*; import org.jikesrvm.classloader.*; import org.jikesrvm.mm.mminterface.*; import org.jikesrvm.runtime.*; import org.vmmagic.unboxed.*; | [
"org.jikesrvm",
"org.jikesrvm.classloader",
"org.jikesrvm.mm",
"org.jikesrvm.runtime",
"org.vmmagic.unboxed"
] | org.jikesrvm; org.jikesrvm.classloader; org.jikesrvm.mm; org.jikesrvm.runtime; org.vmmagic.unboxed; | 928,894 |
final Set<String> restapiDomainGetCMCUClusterSet() throws WBXCONexception{
final Set<String> clusters = new TreeSet<String>();
final List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("cmd","get"));
params.add(new BasicNameValuePair("type","ois"));
... | final Set<String> restapiDomainGetCMCUClusterSet() throws WBXCONexception{ final Set<String> clusters = new TreeSet<String>(); final List<NameValuePair> params = new ArrayList<NameValuePair>(); params.add(new BasicNameValuePair("cmd","get")); params.add(new BasicNameValuePair("type","ois")); params.add(new BasicNameVal... | /**
* Query the list of configured CMCU cluster names
*
* @return {@link java.util.Set} of CMCU cluster names
* @throws WBXCONexception
*/ | Query the list of configured CMCU cluster names | restapiDomainGetCMCUClusterSet | {
"repo_name": "ZacWolf/com.zacwolf.commons.webex",
"path": "src/main/java/com/zacwolf/commons/wbxcon/WBXCONorg.java",
"license": "mit",
"size": 56738
} | [
"com.zacwolf.commons.wbxcon.exceptions.WBXCONexception",
"java.util.ArrayList",
"java.util.List",
"java.util.Set",
"java.util.TreeSet",
"org.apache.http.NameValuePair",
"org.apache.http.message.BasicNameValuePair",
"org.w3c.dom.Document",
"org.w3c.dom.NodeList"
] | import com.zacwolf.commons.wbxcon.exceptions.WBXCONexception; import java.util.ArrayList; import java.util.List; import java.util.Set; import java.util.TreeSet; import org.apache.http.NameValuePair; import org.apache.http.message.BasicNameValuePair; import org.w3c.dom.Document; import org.w3c.dom.NodeList; | import com.zacwolf.commons.wbxcon.exceptions.*; import java.util.*; import org.apache.http.*; import org.apache.http.message.*; import org.w3c.dom.*; | [
"com.zacwolf.commons",
"java.util",
"org.apache.http",
"org.w3c.dom"
] | com.zacwolf.commons; java.util; org.apache.http; org.w3c.dom; | 2,510,813 |
private void setParameters(Long[] parameters) {
if ( parameters == null || parameters.length == 0 ) {
// open bounded range
this.initRange = 1;
this.finalRange = Long.MAX_VALUE;
return;
} else if ( parameters.length == 1 ) {... | void function(Long[] parameters) { if ( parameters == null parameters.length == 0 ) { this.initRange = 1; this.finalRange = Long.MAX_VALUE; return; } else if ( parameters.length == 1 ) { this.initRange = parameters[0].longValue(); this.finalRange = Long.MAX_VALUE; } else if ( parameters.length == 2 ) { if ( parameters[... | /**
* This methods sets the parameters appropriately.
*
* @param parameters
*/ | This methods sets the parameters appropriately | setParameters | {
"repo_name": "mswiderski/drools",
"path": "drools-core/src/main/java/org/drools/base/evaluators/BeforeEvaluatorDefinition.java",
"license": "apache-2.0",
"size": 17822
} | [
"org.drools.RuntimeDroolsException"
] | import org.drools.RuntimeDroolsException; | import org.drools.*; | [
"org.drools"
] | org.drools; | 2,396,692 |
@SuppressWarnings("rawtypes")
@Override
public JSONArray put(int index, Map value) throws JSONException {
this.put(index, (Object) value);
return this;
} | @SuppressWarnings(STR) JSONArray function(int index, Map value) throws JSONException { this.put(index, (Object) value); return this; } | /**
* Put a value in the JSONArray, where the value will be a
* JSONObject that is produced from a Map.
* @param index The subscript.
* @param value The Map value.
* @return this.
* @throws JSONException If the index is negative or if the the value is
* an invalid number.
*/ | Put a value in the JSONArray, where the value will be a JSONObject that is produced from a Map | put | {
"repo_name": "senseidb/sensei",
"path": "sensei-core/src/main/java/com/senseidb/util/JSONUtil.java",
"license": "apache-2.0",
"size": 29431
} | [
"java.util.Map",
"org.json.JSONArray",
"org.json.JSONException"
] | import java.util.Map; import org.json.JSONArray; import org.json.JSONException; | import java.util.*; import org.json.*; | [
"java.util",
"org.json"
] | java.util; org.json; | 2,901,529 |
MutableDirectBuffer asDirectBuffer(long index, int length); | MutableDirectBuffer asDirectBuffer(long index, int length); | /**
* Either returns the underlying array or copies the underlying storage into an array. Note that changes to the
* array might or might not be reflected in the underlying storage.
*/ | Either returns the underlying array or copies the underlying storage into an array. Note that changes to the array might or might not be reflected in the underlying storage | asDirectBuffer | {
"repo_name": "subes/invesdwin-util",
"path": "invesdwin-util-parent/invesdwin-util/src/main/java/de/invesdwin/util/streams/buffer/memory/IMemoryBuffer.java",
"license": "lgpl-3.0",
"size": 16737
} | [
"org.agrona.MutableDirectBuffer"
] | import org.agrona.MutableDirectBuffer; | import org.agrona.*; | [
"org.agrona"
] | org.agrona; | 5,894 |
@MagicConstant(valuesFromClass = WidgetTextAlignment.class)
int getYTextAlignment(); | @MagicConstant(valuesFromClass = WidgetTextAlignment.class) int getYTextAlignment(); | /**
* Gets the Y axis text position mode
*
* @see WidgetTextAlignment
*/ | Gets the Y axis text position mode | getYTextAlignment | {
"repo_name": "runelite/runelite",
"path": "runelite-api/src/main/java/net/runelite/api/widgets/Widget.java",
"license": "bsd-2-clause",
"size": 25661
} | [
"org.intellij.lang.annotations.MagicConstant"
] | import org.intellij.lang.annotations.MagicConstant; | import org.intellij.lang.annotations.*; | [
"org.intellij.lang"
] | org.intellij.lang; | 844,018 |
public Resource getComputedResourceLimitForAllUsers(String userName,
Resource clusterResource, String nodePartition,
SchedulingMode schedulingMode) {
Map<SchedulingMode, Resource> userLimitPerSchedulingMode = preComputedAllUserLimit
.get(nodePartition);
try {
writeLock.lock();
... | Resource function(String userName, Resource clusterResource, String nodePartition, SchedulingMode schedulingMode) { Map<SchedulingMode, Resource> userLimitPerSchedulingMode = preComputedAllUserLimit .get(nodePartition); try { writeLock.lock(); if (isRecomputeNeeded(schedulingMode, nodePartition, false)) { userLimitPerS... | /**
* Get computed user-limit for all users in this queue. If cached data is
* invalidated due to resource change, this method also enforce to recompute
* user-limit.
*
* @param userName
* Name of user who has submitted one/more app to given queue.
* @param clusterResource
* to... | Get computed user-limit for all users in this queue. If cached data is invalidated due to resource change, this method also enforce to recompute user-limit | getComputedResourceLimitForAllUsers | {
"repo_name": "WIgor/hadoop",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/UsersManager.java",
"license": "apache-2.0",
"size": 33283
} | [
"java.util.Map",
"org.apache.hadoop.yarn.api.records.Resource"
] | import java.util.Map; import org.apache.hadoop.yarn.api.records.Resource; | import java.util.*; import org.apache.hadoop.yarn.api.records.*; | [
"java.util",
"org.apache.hadoop"
] | java.util; org.apache.hadoop; | 825,758 |
private CurrentPosition insertCurrentPosition(long book_id, int currentContentInBook, int currentSentence) throws ServiceException {
if(book_id<0 || currentContentInBook<0 || currentSentence<0)
throw new ServiceException(ebook_loading_failed);
CurrentPosition c=new CurrentPosition(book_... | CurrentPosition function(long book_id, int currentContentInBook, int currentSentence) throws ServiceException { if(book_id<0 currentContentInBook<0 currentSentence<0) throw new ServiceException(ebook_loading_failed); CurrentPosition c=new CurrentPosition(book_id, currentContentInBook, currentSentence); long id=db.inser... | /**
* Inserts a current position of a book using the DatabaseHelper.
*
* @param book_id id of book that the currentposition belongs to
* @param currentContentInBook content number in current book
* @param currentSentence number of sentence in content
* @return the inserted current position... | Inserts a current position of a book using the DatabaseHelper | insertCurrentPosition | {
"repo_name": "floschu/eREADer",
"path": "eREADer/app/src/main/java/at/ac/tuwien/ims/ereader/Services/BookService.java",
"license": "gpl-2.0",
"size": 18773
} | [
"at.ac.tuwien.ims.ereader.Entities"
] | import at.ac.tuwien.ims.ereader.Entities; | import at.ac.tuwien.ims.ereader.*; | [
"at.ac.tuwien"
] | at.ac.tuwien; | 2,674,207 |
public static byte[] encode(Object message) throws IOException {
if(message.getClass().getAnnotation(io.bigio.Message.class) != null) {
try {
byte[] ret;
ret = (byte[])((BigIOMessage)message).bigioencode();
return ret;
} catch (Excepti... | static byte[] function(Object message) throws IOException { if(message.getClass().getAnnotation(io.bigio.Message.class) != null) { try { byte[] ret; ret = (byte[])((BigIOMessage)message).bigioencode(); return ret; } catch (Exception ex) { LOG.error(STR, ex); } } return null; } | /**
* Encode a message payload.
*
* @param message a message.
* @return the encoded form of the message.
* @throws IOException in case of an error in encoding.
*/ | Encode a message payload | encode | {
"repo_name": "Archarithms/bigio",
"path": "core/src/main/java/io/bigio/core/codec/GenericCodec.java",
"license": "bsd-2-clause",
"size": 3759
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 214,101 |
public static Charset toCharset(final String charset) {
return charset == null ? Charset.defaultCharset() : Charset.forName(charset);
}
public static final Charset ISO_8859_1 = Charset.forName(CharEncoding.ISO_8859_1);
public static final Charset US_ASCII = Charset.forName(CharEncodi... | static Charset function(final String charset) { return charset == null ? Charset.defaultCharset() : Charset.forName(charset); } public static final Charset ISO_8859_1 = Charset.forName(CharEncoding.ISO_8859_1); public static final Charset US_ASCII = Charset.forName(CharEncoding.US_ASCII); public static final Charset UT... | /**
* Returns a Charset for the named charset. If the name is null, return the default Charset.
*
* @param charset
* The name of the requested charset, may be null.
* @return a Charset for the named charset
* @throws java.nio.charset.UnsupportedCharsetException
* ... | Returns a Charset for the named charset. If the name is null, return the default Charset | toCharset | {
"repo_name": "MeilCli/aclog",
"path": "src/info/re4k/asfc/aclog/base64/Charsets.java",
"license": "mit",
"size": 6310
} | [
"java.nio.charset.Charset"
] | import java.nio.charset.Charset; | import java.nio.charset.*; | [
"java.nio"
] | java.nio; | 407,231 |
public void updateProjectRole(UserRole userRole, int projectId) throws Exception;
| void function(UserRole userRole, int projectId) throws Exception; | /**
* Update a role
* @param userRole the role to update
* @param projectId the project to update the role for
* @throws Exception if there is a problem updating the role
*/ | Update a role | updateProjectRole | {
"repo_name": "ox-it/ords-project-api",
"path": "src/main/java/uk/ac/ox/it/ords/api/project/services/ProjectRoleService.java",
"license": "apache-2.0",
"size": 5665
} | [
"uk.ac.ox.it.ords.security.model.UserRole"
] | import uk.ac.ox.it.ords.security.model.UserRole; | import uk.ac.ox.it.ords.security.model.*; | [
"uk.ac.ox"
] | uk.ac.ox; | 1,007,375 |
public PortletInfoType<T> removeShortTitle()
{
childNode.removeChildren("short-title");
return this;
}
// --------------------------------------------------------------------------------------------------------||
// ClassName: PortletInfoType ElementName: string ElementType : keywords
/... | PortletInfoType<T> function() { childNode.removeChildren(STR); return this; } | /**
* Removes the <code>short-title</code> element
* @return the current instance of <code>PortletInfoType<T></code>
*/ | Removes the <code>short-title</code> element | removeShortTitle | {
"repo_name": "forge/javaee-descriptors",
"path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/portletapp20/PortletInfoTypeImpl.java",
"license": "epl-1.0",
"size": 6132
} | [
"org.jboss.shrinkwrap.descriptor.api.portletapp20.PortletInfoType"
] | import org.jboss.shrinkwrap.descriptor.api.portletapp20.PortletInfoType; | import org.jboss.shrinkwrap.descriptor.api.portletapp20.*; | [
"org.jboss.shrinkwrap"
] | org.jboss.shrinkwrap; | 1,603,856 |
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<PolicyCollectionInner> listByOperationAsync(
String resourceGroupName, String serviceName, String apiId, String operationId) {
return listByOperationWithResponseAsync(resourceGroupName, serviceName, apiId, operationId)
.flatMap... | @ServiceMethod(returns = ReturnType.SINGLE) Mono<PolicyCollectionInner> function( String resourceGroupName, String serviceName, String apiId, String operationId) { return listByOperationWithResponseAsync(resourceGroupName, serviceName, apiId, operationId) .flatMap( (Response<PolicyCollectionInner> res) -> { if (res.get... | /**
* Get the list of policy configuration at the API Operation level.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the API Management service.
* @param apiId API revision identifier. Must be unique in the current API Management service instance.... | Get the list of policy configuration at the API Operation level | listByOperationAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiOperationPoliciesClientImpl.java",
"license": "mit",
"size": 67502
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.resourcemanager.apimanagement.fluent.models.PolicyCollectionInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.resourcemanager.apimanagement.fluent.models.PolicyCollectionInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.resourcemanager.apimanagement.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 2,797,185 |
public static int getWindowSystemUiVisibility(View view) {
return IMPL.getWindowSystemUiVisibility(view);
} | static int function(View view) { return IMPL.getWindowSystemUiVisibility(view); } | /**
* Returns the current system UI visibility that is currently set for the entire window.
*/ | Returns the current system UI visibility that is currently set for the entire window | getWindowSystemUiVisibility | {
"repo_name": "madhavanks26/com.vliesaputra.deviceinformation",
"path": "src/com/vliesaputra/cordova/plugins/android/support/v4/src/java/android/support/v4/view/ViewCompat.java",
"license": "mit",
"size": 127830
} | [
"android.view.View"
] | import android.view.View; | import android.view.*; | [
"android.view"
] | android.view; | 757,742 |
protected SshConnectionProperties properties;
public void setProperties(SshConnectionProperties p) { properties = p; }
| protected SshConnectionProperties properties; public void setProperties(SshConnectionProperties p) { properties = p; } | /**
* Way of passing the hostname to the GSI authentication so it can check the remote host's certificate.
*/ | Way of passing the hostname to the GSI authentication so it can check the remote host's certificate | setHostname | {
"repo_name": "Hackworth/FOG",
"path": "src/sshtools/tmp/com/sshtools/j2ssh/authentication/SshAuthenticationClient.java",
"license": "gpl-3.0",
"size": 3137
} | [
"com.sshtools.j2ssh.configuration.SshConnectionProperties"
] | import com.sshtools.j2ssh.configuration.SshConnectionProperties; | import com.sshtools.j2ssh.configuration.*; | [
"com.sshtools.j2ssh"
] | com.sshtools.j2ssh; | 214,265 |
public void info(Object message, Throwable exception) {
log(Level.INFO, String.valueOf(message), exception);
}
| void function(Object message, Throwable exception) { log(Level.INFO, String.valueOf(message), exception); } | /**
* Logs a message with <code>java.util.logging.Level.INFO</code>.
*
* @param message to log
* @param exception log this cause
* @see org.apache.juli.logging.Log#info(Object, Throwable)
*/ | Logs a message with <code>java.util.logging.Level.INFO</code> | info | {
"repo_name": "yuyupapa/OpenSource",
"path": "apache-tomcat-6.0.48/output/extras/logging/commons-logging-1.1.1-src/src/java/org/apache/juli/logging/impl/Jdk13LumberjackLogger.java",
"license": "apache-2.0",
"size": 10225
} | [
"java.util.logging.Level"
] | import java.util.logging.Level; | import java.util.logging.*; | [
"java.util"
] | java.util; | 850,316 |
public boolean isUseableByPlayer(EntityPlayer player)
{
return false;
} | boolean function(EntityPlayer player) { return false; } | /**
* Do not give this method the name canInteractWith because it clashes with Container
*/ | Do not give this method the name canInteractWith because it clashes with Container | isUseableByPlayer | {
"repo_name": "tom5454/ARKCraft",
"path": "src/main/java/com/uberverse/arkcraft/common/inventory/InventoryBlueprints.java",
"license": "mit",
"size": 11167
} | [
"net.minecraft.entity.player.EntityPlayer"
] | import net.minecraft.entity.player.EntityPlayer; | import net.minecraft.entity.player.*; | [
"net.minecraft.entity"
] | net.minecraft.entity; | 299,419 |
private ConcurrentMap<GroupId, Group>
getExtraneousGroupIdTable(DeviceId deviceId) {
return createIfAbsentUnchecked(extraneousGroupEntriesById,
deviceId,
lazyEmptyExtraneousGroupIdTable());
} | ConcurrentMap<GroupId, Group> function(DeviceId deviceId) { return createIfAbsentUnchecked(extraneousGroupEntriesById, deviceId, lazyEmptyExtraneousGroupIdTable()); } | /**
* Returns the extraneous group id table for specified device.
*
* @param deviceId identifier of the device
* @return Map representing group key table of given device.
*/ | Returns the extraneous group id table for specified device | getExtraneousGroupIdTable | {
"repo_name": "packet-tracker/onos",
"path": "core/store/dist/src/main/java/org/onosproject/store/group/impl/DistributedGroupStore.java",
"license": "apache-2.0",
"size": 57369
} | [
"java.util.concurrent.ConcurrentMap",
"org.apache.commons.lang3.concurrent.ConcurrentUtils",
"org.onosproject.core.GroupId",
"org.onosproject.net.DeviceId",
"org.onosproject.net.group.Group"
] | import java.util.concurrent.ConcurrentMap; import org.apache.commons.lang3.concurrent.ConcurrentUtils; import org.onosproject.core.GroupId; import org.onosproject.net.DeviceId; import org.onosproject.net.group.Group; | import java.util.concurrent.*; import org.apache.commons.lang3.concurrent.*; import org.onosproject.core.*; import org.onosproject.net.*; import org.onosproject.net.group.*; | [
"java.util",
"org.apache.commons",
"org.onosproject.core",
"org.onosproject.net"
] | java.util; org.apache.commons; org.onosproject.core; org.onosproject.net; | 187,675 |
@Override
public DataTypeJSONObjectArray createFromParcel(Parcel in) {
return new DataTypeJSONObjectArray(in);
} | DataTypeJSONObjectArray function(Parcel in) { return new DataTypeJSONObjectArray(in); } | /**
* Creates a new <code>DataTypeJSONObjectArray</code> object from a <code>Parcel</code>.
*
* @param in The parcel holding the data type.
* @return The constructed <code>DataTypeJSONObjectArray</code> object
*/ | Creates a new <code>DataTypeJSONObjectArray</code> object from a <code>Parcel</code> | createFromParcel | {
"repo_name": "MD2Korg/mCerebrum-DataKitAPI",
"path": "datakitapi/src/main/java/org/md2k/datakitapi/datatype/DataTypeJSONObjectArray.java",
"license": "bsd-2-clause",
"size": 4307
} | [
"android.os.Parcel"
] | import android.os.Parcel; | import android.os.*; | [
"android.os"
] | android.os; | 337,307 |
ApplicationInsightsComponentInner innerModel();
interface Definition
extends DefinitionStages.Blank,
DefinitionStages.WithLocation,
DefinitionStages.WithResourceGroup,
DefinitionStages.WithKind,
DefinitionStages.WithCreate {
}
interface ... | ApplicationInsightsComponentInner innerModel(); interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, DefinitionStages.WithKind, DefinitionStages.WithCreate { } interface DefinitionStages { interface Blank extends WithLocation { } | /**
* Gets the inner com.azure.resourcemanager.applicationinsights.fluent.models.ApplicationInsightsComponentInner
* object.
*
* @return the inner object.
*/ | Gets the inner com.azure.resourcemanager.applicationinsights.fluent.models.ApplicationInsightsComponentInner object | innerModel | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ApplicationInsightsComponent.java",
"license": "mit",
"size": 26069
} | [
"com.azure.resourcemanager.applicationinsights.fluent.models.ApplicationInsightsComponentInner"
] | import com.azure.resourcemanager.applicationinsights.fluent.models.ApplicationInsightsComponentInner; | import com.azure.resourcemanager.applicationinsights.fluent.models.*; | [
"com.azure.resourcemanager"
] | com.azure.resourcemanager; | 1,275,355 |
public final HBaseClient getClient() {
return this.client;
} | final HBaseClient function() { return this.client; } | /**
* Returns the configured HBase client
* @return The HBase client
* @since 2.0
*/ | Returns the configured HBase client | getClient | {
"repo_name": "OpenTSDB/opentsdb",
"path": "src/core/TSDB.java",
"license": "lgpl-2.1",
"size": 84866
} | [
"org.hbase.async.HBaseClient"
] | import org.hbase.async.HBaseClient; | import org.hbase.async.*; | [
"org.hbase.async"
] | org.hbase.async; | 1,992,441 |
public OrderedPropertiesBuilder withOrdering(Comparator<? super String> comparator) {
this.comparator = comparator;
return this;
} | OrderedPropertiesBuilder function(Comparator<? super String> comparator) { this.comparator = comparator; return this; } | /**
* Use a custom ordering of the keys.
*
* @param comparator the ordering to apply on the keys
* @return the builder
*/ | Use a custom ordering of the keys | withOrdering | {
"repo_name": "etiennestuder/java-ordered-properties",
"path": "src/main/java/nu/studer/java/util/OrderedProperties.java",
"license": "apache-2.0",
"size": 16638
} | [
"java.util.Comparator"
] | import java.util.Comparator; | import java.util.*; | [
"java.util"
] | java.util; | 1,142,007 |
Object config = configObjects.get(name);
if (config == null) {
throw new IllegalArgumentException(
Messages.format(
"No configuration found with type {} and name {}",
configType.getName(),
name));
}
return config;
} | Object config = configObjects.get(name); if (config == null) { throw new IllegalArgumentException( Messages.format( STR, configType.getName(), name)); } return config; } | /**
* Returns the configuration object with the specified name if found or throws an exception if not.
*
* @param name the name of the configuration object
* @return the named object if available
* @throws IllegalArgumentException if no configuration is found with the specified name
*/ | Returns the configuration object with the specified name if found or throws an exception if not | get | {
"repo_name": "ChinaQuants/Strata",
"path": "modules/calc/src/main/java/com/opengamma/strata/calc/marketdata/SingleTypeMarketDataConfig.java",
"license": "apache-2.0",
"size": 14365
} | [
"com.opengamma.strata.collect.Messages"
] | import com.opengamma.strata.collect.Messages; | import com.opengamma.strata.collect.*; | [
"com.opengamma.strata"
] | com.opengamma.strata; | 725,599 |
private void initCouleurs(Color[] couleurs) {
if (couleurs !=null) {
this.couleursContours = new Color[orgLevels.length];
for (int i=0;i<this.couleursContours.length;i++) {
this.couleursContours[i] = couleurs[i];
}
}
else this.couleursContours = null;
}
... | void function(Color[] couleurs) { if (couleurs !=null) { this.couleursContours = new Color[orgLevels.length]; for (int i=0;i<this.couleursContours.length;i++) { this.couleursContours[i] = couleurs[i]; } } else this.couleursContours = null; } /*private void setmin() { int min = 256; for (int i=0;i<pixels.length;i++) { i... | /** initCouleurs - initialise le tableau couleursContours
* @param couleurs - tableau des couleurs
*/ | initCouleurs - initialise le tableau couleursContours | initCouleurs | {
"repo_name": "jankotek/asterope",
"path": "aladin/cds/aladin/PlanContour.java",
"license": "agpl-3.0",
"size": 27588
} | [
"java.awt.Color"
] | import java.awt.Color; | import java.awt.*; | [
"java.awt"
] | java.awt; | 2,876,338 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.