method
stringlengths 13
441k
| clean_method
stringlengths 7
313k
| doc
stringlengths 17
17.3k
| comment
stringlengths 3
1.42k
| method_name
stringlengths 1
273
| extra
dict | imports
sequence | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
sequence | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
---|---|---|---|---|---|---|---|---|---|---|---|
public static ASN1OctetString getInstance(
Object obj)
{
if (obj == null || obj instanceof ASN1OctetString)
{
return (ASN1OctetString)obj;
}
else if (obj instanceof byte[])
{
try
{
return ASN1OctetString.getInstance(ASN1Primitive.fromByteArray((byte[])obj));
}
catch (IOException e)
{
throw new IllegalArgumentException("failed to construct OCTET STRING from byte[]: " + e.getMessage());
}
}
else if (obj instanceof ASN1Encodable)
{
ASN1Primitive primitive = ((ASN1Encodable)obj).toASN1Primitive();
if (primitive instanceof ASN1OctetString)
{
return (ASN1OctetString)primitive;
}
}
throw new IllegalArgumentException("illegal object in getInstance: " + obj.getClass().getName());
}
public ASN1OctetString(
byte[] string)
{
if (string == null)
{
throw new NullPointerException("string cannot be null");
}
this.string = string;
} | static ASN1OctetString function( Object obj) { if (obj == null obj instanceof ASN1OctetString) { return (ASN1OctetString)obj; } else if (obj instanceof byte[]) { try { return ASN1OctetString.getInstance(ASN1Primitive.fromByteArray((byte[])obj)); } catch (IOException e) { throw new IllegalArgumentException(STR + e.getMessage()); } } else if (obj instanceof ASN1Encodable) { ASN1Primitive primitive = ((ASN1Encodable)obj).toASN1Primitive(); if (primitive instanceof ASN1OctetString) { return (ASN1OctetString)primitive; } } throw new IllegalArgumentException(STR + obj.getClass().getName()); } public ASN1OctetString( byte[] string) { if (string == null) { throw new NullPointerException(STR); } this.string = string; } | /**
* return an Octet String from the given object.
*
* @param obj the object we want converted.
* @exception IllegalArgumentException if the object cannot be converted.
*/ | return an Octet String from the given object | getInstance | {
"repo_name": "sake/bouncycastle-java",
"path": "src/org/bouncycastle/asn1/ASN1OctetString.java",
"license": "mit",
"size": 3574
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,589,879 |
public ArrayList <Integer> deleteDescendants (int original_identifier) {
ArrayList <Integer> nodes_deleted;
nodes_deleted = new ArrayList <Integer> ();
// Obtain descendants of descendants
if (left != null) {
nodes_deleted.addAll(left.deleteDescendants(original_identifier));
}
if (right != null) {
nodes_deleted.addAll(right.deleteDescendants(original_identifier));
}
left = null;
right = null;
condition = null;
if (identifier != original_identifier) {
nodes_deleted.add(identifier);
}
return nodes_deleted;
}
| ArrayList <Integer> function (int original_identifier) { ArrayList <Integer> nodes_deleted; nodes_deleted = new ArrayList <Integer> (); if (left != null) { nodes_deleted.addAll(left.deleteDescendants(original_identifier)); } if (right != null) { nodes_deleted.addAll(right.deleteDescendants(original_identifier)); } left = null; right = null; condition = null; if (identifier != original_identifier) { nodes_deleted.add(identifier); } return nodes_deleted; } | /**
* Removes the descendants from a identifier given of a node. The nodes whose descendants are being
* removed become leaf nodes
*
* @param original_identifier Identifier of the node that is becoming a leaf node and whose descendants
* are being removed
* @return ArrayList with all the identifiers of the nodes that are being removed
*/ | Removes the descendants from a identifier given of a node. The nodes whose descendants are being removed become leaf nodes | deleteDescendants | {
"repo_name": "SCI2SUGR/KEEL",
"path": "src/keel/Algorithms/Decision_Trees/PUBLIC/TreeNode.java",
"license": "gpl-3.0",
"size": 18805
} | [
"java.util.ArrayList"
] | import java.util.ArrayList; | import java.util.*; | [
"java.util"
] | java.util; | 1,912,429 |
public OutputStream openOutputStream(Uri uri, boolean append) throws IOException {
assertBackgroundThread();
switch (getUriType(uri)) {
case URI_TYPE_FILE: {
File localFile = new File(uri.getPath());
File parent = localFile.getParentFile();
if (parent != null) {
parent.mkdirs();
}
return new FileOutputStream(localFile, append);
}
case URI_TYPE_CONTENT:
case URI_TYPE_RESOURCE: {
AssetFileDescriptor assetFd = contentResolver.openAssetFileDescriptor(uri, append ? "wa" : "w");
return assetFd.createOutputStream();
}
}
throw new FileNotFoundException("URI not supported by CordovaResourceApi: " + uri);
} | OutputStream function(Uri uri, boolean append) throws IOException { assertBackgroundThread(); switch (getUriType(uri)) { case URI_TYPE_FILE: { File localFile = new File(uri.getPath()); File parent = localFile.getParentFile(); if (parent != null) { parent.mkdirs(); } return new FileOutputStream(localFile, append); } case URI_TYPE_CONTENT: case URI_TYPE_RESOURCE: { AssetFileDescriptor assetFd = contentResolver.openAssetFileDescriptor(uri, append ? "wa" : "w"); return assetFd.createOutputStream(); } } throw new FileNotFoundException(STR + uri); } | /**
* Opens a stream to the given URI.
* @return Never returns null.
* @throws Throws an InvalidArgumentException for relative URIs. Relative URIs should be
* resolved before being passed into this function.
* @throws Throws an IOException if the URI cannot be opened.
*/ | Opens a stream to the given URI | openOutputStream | {
"repo_name": "ReversonMendes/Ionic-Desafio",
"path": "desafio-master/platforms/android/CordovaLib/src/org/apache/cordova/CordovaResourceApi.java",
"license": "gpl-2.0",
"size": 18072
} | [
"android.content.res.AssetFileDescriptor",
"android.net.Uri",
"java.io.File",
"java.io.FileNotFoundException",
"java.io.FileOutputStream",
"java.io.IOException",
"java.io.OutputStream"
] | import android.content.res.AssetFileDescriptor; import android.net.Uri; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; | import android.content.res.*; import android.net.*; import java.io.*; | [
"android.content",
"android.net",
"java.io"
] | android.content; android.net; java.io; | 2,438,809 |
public List<String> getInterfaces() {
return new ArrayList<>(interfaces);
} | List<String> function() { return new ArrayList<>(interfaces); } | /**
* Gets the implemented interfaces.
* @return interfaces
*/ | Gets the implemented interfaces | getInterfaces | {
"repo_name": "offbynull/coroutines",
"path": "instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/ClassInformation.java",
"license": "lgpl-3.0",
"size": 3779
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,470,952 |
public ServiceResponse<Error> patch414() throws ErrorException, IOException {
return patch414Async().toBlocking().single();
} | ServiceResponse<Error> function() throws ErrorException, IOException { return patch414Async().toBlocking().single(); } | /**
* Return 414 status code - should be represented in the client as an error.
*
* @throws ErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the Error object wrapped in {@link ServiceResponse} if successful.
*/ | Return 414 status code - should be represented in the client as an error | patch414 | {
"repo_name": "haocs/autorest",
"path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/http/implementation/HttpClientFailuresImpl.java",
"license": "mit",
"size": 78284
} | [
"com.microsoft.rest.ServiceResponse",
"java.io.IOException"
] | import com.microsoft.rest.ServiceResponse; import java.io.IOException; | import com.microsoft.rest.*; import java.io.*; | [
"com.microsoft.rest",
"java.io"
] | com.microsoft.rest; java.io; | 1,421,740 |
public Hashtable getConfig()
{
return config;
} | Hashtable function() { return config; } | /**
* Returns the configuration values for this request
* @return Returns the configuration values
*/ | Returns the configuration values for this request | getConfig | {
"repo_name": "NCIP/stats-analysis",
"path": "cacoretoolkit 3.1/src/gov/nih/nci/common/net/Request.java",
"license": "bsd-3-clause",
"size": 2642
} | [
"java.util.Hashtable"
] | import java.util.Hashtable; | import java.util.*; | [
"java.util"
] | java.util; | 1,149,093 |
public static Text utf8Trim(Text src, Text dst) {
findUTF8CharOffsets(src, CHAR_OFFSETS);
int len = CHAR_OFFSETS.size();
int st = 0;
byte[] bytes = src.getBytes();
while ((st < len) && (bytes[st] <= ' ')) {
st++;
}
while ((st < len) && (bytes[len - 1] <= ' ')) {
len--;
}
dst.set(bytes, st, len - st);
return dst;
} | static Text function(Text src, Text dst) { findUTF8CharOffsets(src, CHAR_OFFSETS); int len = CHAR_OFFSETS.size(); int st = 0; byte[] bytes = src.getBytes(); while ((st < len) && (bytes[st] <= ' ')) { st++; } while ((st < len) && (bytes[len - 1] <= ' ')) { len--; } dst.set(bytes, st, len - st); return dst; } | /**
* Trim leading / trailing whitespace from the passed src object which
* contains UTF8 byte stream
*
* @param src
* Source to trim
* @param dst
* Destination to populate with trimmed UTF8 string
* @return Destination text object, for call chaining
*/ | Trim leading / trailing whitespace from the passed src object which contains UTF8 byte stream | utf8Trim | {
"repo_name": "chriswhite199/hadoop-text-util",
"path": "src/main/java/csw/hadoop/text/TextUtils.java",
"license": "apache-2.0",
"size": 11967
} | [
"org.apache.hadoop.io.Text"
] | import org.apache.hadoop.io.Text; | import org.apache.hadoop.io.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 403,834 |
public void testAsciiCharConversion() throws Exception {
byte[] buf = new byte[10];
buf[0] = (byte) '?';
buf[1] = (byte) 'S';
buf[2] = (byte) 't';
buf[3] = (byte) 'a';
buf[4] = (byte) 't';
buf[5] = (byte) 'e';
buf[6] = (byte) '-';
buf[7] = (byte) 'b';
buf[8] = (byte) 'o';
buf[9] = (byte) 't';
String testString = "?State-bot";
String convertedString = StringUtils.toAsciiString(buf);
for (int i = 0; i < convertedString.length(); i++) {
System.out.println((byte) convertedString.charAt(i));
}
assertTrue("Converted string != test string", testString
.equals(convertedString));
} | void function() throws Exception { byte[] buf = new byte[10]; buf[0] = (byte) '?'; buf[1] = (byte) 'S'; buf[2] = (byte) 't'; buf[3] = (byte) 'a'; buf[4] = (byte) 't'; buf[5] = (byte) 'e'; buf[6] = (byte) '-'; buf[7] = (byte) 'b'; buf[8] = (byte) 'o'; buf[9] = (byte) 't'; String testString = STR; String convertedString = StringUtils.toAsciiString(buf); for (int i = 0; i < convertedString.length(); i++) { System.out.println((byte) convertedString.charAt(i)); } assertTrue(STR, testString .equals(convertedString)); } | /**
* Tests character conversion bug.
*
* @throws Exception
* if there is an internal error (which is a bug).
*/ | Tests character conversion bug | testAsciiCharConversion | {
"repo_name": "yyuu/libmysql-java",
"path": "src/testsuite/regression/StringRegressionTest.java",
"license": "gpl-2.0",
"size": 28976
} | [
"com.mysql.jdbc.StringUtils"
] | import com.mysql.jdbc.StringUtils; | import com.mysql.jdbc.*; | [
"com.mysql.jdbc"
] | com.mysql.jdbc; | 865,524 |
private static Exception extractException(Exception e) {
while (e instanceof PrivilegedActionException) {
e = ((PrivilegedActionException)e).getException();
}
return e;
}
private static class IdAndFilter {
private Integer id;
private NotificationFilter filter;
IdAndFilter(Integer id, NotificationFilter filter) {
this.id = id;
this.filter = filter;
} | static Exception function(Exception e) { while (e instanceof PrivilegedActionException) { e = ((PrivilegedActionException)e).getException(); } return e; } private static class IdAndFilter { private Integer id; private NotificationFilter filter; IdAndFilter(Integer id, NotificationFilter filter) { this.id = id; this.filter = filter; } | /**
* Iterate until we extract the real exception
* from a stack of PrivilegedActionExceptions.
*/ | Iterate until we extract the real exception from a stack of PrivilegedActionExceptions | extractException | {
"repo_name": "rokn/Count_Words_2015",
"path": "testing/openjdk/jdk/src/share/classes/com/sun/jmx/remote/internal/ServerNotifForwarder.java",
"license": "mit",
"size": 18104
} | [
"java.security.PrivilegedActionException",
"javax.management.NotificationFilter"
] | import java.security.PrivilegedActionException; import javax.management.NotificationFilter; | import java.security.*; import javax.management.*; | [
"java.security",
"javax.management"
] | java.security; javax.management; | 156,621 |
@Override
protected void calc() {
JMadModel model = getModel();
if (model == null) {
return;
}
allNames.clear();
for (ListPrefix listPrefix : ListPrefix.values()) {
for (KeyPrefix keyPrefix : KeyPrefix.values()) {
if (KeyPrefix.S_POSITION.equals(keyPrefix)) {
putValueList(listPrefix, keyPrefix, null,
new ArrayList<>());
} else {
for (Plane plane : Plane.values()) {
putValueList(listPrefix, keyPrefix, plane,
new ArrayList<>());
}
}
}
}
for (OpticPoint point : getOptics().getAllPoints()) {
allNames.add(point.getName());
for (Plane plane : Plane.values()) {
addPoint(ListPrefix.ALL, point, plane, 1);
}
}
List<Element> elements = getElements();
if (elements != null) {
for (Element element : elements) {
addValue(ListPrefix.ALL, KeyPrefix.S_POSITION, null, element
.getPosition().getValue());
}
}
List<Monitor> monitors = getActiveMonitors();
int monitorNumber = 0;
for (Monitor monitor : monitors) {
OpticPoint point = getOpticsPoint(monitor.getName());
Plane plane = monitor.getPlane();
if (point == null) {
for (KeyPrefix keyPrefix : KeyPrefix.values()) {
addValue(ListPrefix.MONITORS, keyPrefix, plane, null);
}
} else {
double monitorGain = monitor.getGain();
addPoint(ListPrefix.MONITORS, point, plane, monitorGain);
}
Element element = getElement(monitor.getName());
if (element == null) {
addValue(ListPrefix.MONITORS, KeyPrefix.S_POSITION, null, null);
} else {
addValue(ListPrefix.MONITORS, KeyPrefix.S_POSITION, null,
element.getPosition().getValue());
}
monitorNumber++;
}
} | void function() { JMadModel model = getModel(); if (model == null) { return; } allNames.clear(); for (ListPrefix listPrefix : ListPrefix.values()) { for (KeyPrefix keyPrefix : KeyPrefix.values()) { if (KeyPrefix.S_POSITION.equals(keyPrefix)) { putValueList(listPrefix, keyPrefix, null, new ArrayList<>()); } else { for (Plane plane : Plane.values()) { putValueList(listPrefix, keyPrefix, plane, new ArrayList<>()); } } } } for (OpticPoint point : getOptics().getAllPoints()) { allNames.add(point.getName()); for (Plane plane : Plane.values()) { addPoint(ListPrefix.ALL, point, plane, 1); } } List<Element> elements = getElements(); if (elements != null) { for (Element element : elements) { addValue(ListPrefix.ALL, KeyPrefix.S_POSITION, null, element .getPosition().getValue()); } } List<Monitor> monitors = getActiveMonitors(); int monitorNumber = 0; for (Monitor monitor : monitors) { OpticPoint point = getOpticsPoint(monitor.getName()); Plane plane = monitor.getPlane(); if (point == null) { for (KeyPrefix keyPrefix : KeyPrefix.values()) { addValue(ListPrefix.MONITORS, keyPrefix, plane, null); } } else { double monitorGain = monitor.getGain(); addPoint(ListPrefix.MONITORS, point, plane, monitorGain); } Element element = getElement(monitor.getName()); if (element == null) { addValue(ListPrefix.MONITORS, KeyPrefix.S_POSITION, null, null); } else { addValue(ListPrefix.MONITORS, KeyPrefix.S_POSITION, null, element.getPosition().getValue()); } monitorNumber++; } } | /**
* recalculates the data
*/ | recalculates the data | calc | {
"repo_name": "jmad/aloha",
"path": "src/java/cern/accsoft/steering/aloha/model/data/JMadModelOpticsData.java",
"license": "apache-2.0",
"size": 14234
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 682,876 |
public CloningInfo cloningInfo() {
return this.cloningInfo;
} | CloningInfo function() { return this.cloningInfo; } | /**
* Get the cloningInfo value.
*
* @return the cloningInfo value
*/ | Get the cloningInfo value | cloningInfo | {
"repo_name": "herveyw/azure-sdk-for-java",
"path": "azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/SiteInner.java",
"license": "mit",
"size": 17562
} | [
"com.microsoft.azure.management.website.CloningInfo"
] | import com.microsoft.azure.management.website.CloningInfo; | import com.microsoft.azure.management.website.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 75,352 |
public Optional<JoinMetadata> getJoinMetadata(final String nodeId) {
requireNonNull(nodeId);
return Optional.fromNullable( joinMetadata.get(nodeId) );
} | Optional<JoinMetadata> function(final String nodeId) { requireNonNull(nodeId); return Optional.fromNullable( joinMetadata.get(nodeId) ); } | /**
* Get a Join node's metadata.
*
* @param nodeId - The node ID of the Join metadata you want. (not null)
* @return The Join metadata if it could be found; otherwise absent.
*/ | Get a Join node's metadata | getJoinMetadata | {
"repo_name": "pujav65/incubator-rya",
"path": "extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/query/FluoQuery.java",
"license": "apache-2.0",
"size": 18910
} | [
"com.google.common.base.Optional",
"java.util.Objects"
] | import com.google.common.base.Optional; import java.util.Objects; | import com.google.common.base.*; import java.util.*; | [
"com.google.common",
"java.util"
] | com.google.common; java.util; | 412,191 |
private int analyse(CmsResource res, String sourceMergeFolder, String targetMergefolder, int currentFolder) {
int retValue = -1;
String resourcenameOther = getResourceNameInOtherFolder(
m_cms.getSitePath(res),
sourceMergeFolder,
targetMergefolder);
try {
CmsResource otherRes = m_cms.readResource(resourcenameOther, CmsResourceFilter.IGNORE_EXPIRATION);
// there was a resource with the same name in the other merge folder
// now check if it is already a sibling of the current resource
if (res.getResourceId().equals(otherRes.getResourceId())) {
// it is a sibling, so set the action to "sibling already";
retValue = FOLDERS_SIBLING;
} else {
// it is no sibling, now test if it has the same resource type than the oringinal resource
if (res.getTypeId() == otherRes.getTypeId()) {
// both resources have the same type, so set the action to "same name". Only those resources can be merged
retValue = FOLDERS_EQUALNAMES;
} else {
// both resources have different types, so set the action to "different types"
retValue = FOLDERS_DIFFERENTTYPES;
}
}
} catch (CmsException e) {
// the resource was not found, so set the action mode to "found only in the source folder"
if (currentFolder == 1) {
retValue = FOLDER1_EXCLUSIVE;
} else {
retValue = FOLDER2_EXCLUSIVE;
}
}
return retValue;
} | int function(CmsResource res, String sourceMergeFolder, String targetMergefolder, int currentFolder) { int retValue = -1; String resourcenameOther = getResourceNameInOtherFolder( m_cms.getSitePath(res), sourceMergeFolder, targetMergefolder); try { CmsResource otherRes = m_cms.readResource(resourcenameOther, CmsResourceFilter.IGNORE_EXPIRATION); if (res.getResourceId().equals(otherRes.getResourceId())) { retValue = FOLDERS_SIBLING; } else { if (res.getTypeId() == otherRes.getTypeId()) { retValue = FOLDERS_EQUALNAMES; } else { retValue = FOLDERS_DIFFERENTTYPES; } } } catch (CmsException e) { if (currentFolder == 1) { retValue = FOLDER1_EXCLUSIVE; } else { retValue = FOLDER2_EXCLUSIVE; } } return retValue; } | /**
* Analyses a page in the source morge folder and tests if a resouce with the same name exists in the target merge folder.<p>
*
* The method then calcualtes a action for further processing of this page, possible values are:
* <ul>
* <li>C_FOLDER1_EXCLUSIVE: exclusivly found in folder 1</li>
* <li>C_FOLDER2_EXCLUSIVE: exclusivly found in folder 2</li>
* <li>C_FOLDERS_SIBLING: found in both folders as siblings of each other </li>
* <li>C_FOLDERS_EQUALNAMES: found in both folders as individual resources</li>
* <li>C_FOLDERS_DIFFERENTTYPES: found in both folders as different types</li>
* </ul>
* @param res the resource to test
* @param sourceMergeFolder the path to the source merge folder
* @param targetMergefolder the path to the target merge folder
* @param currentFolder integer value (1 or 2) showing if the source folder is folder 1 or folder 2
* @return value of the action to do with this page
*/ | Analyses a page in the source morge folder and tests if a resouce with the same name exists in the target merge folder. The method then calcualtes a action for further processing of this page, possible values are: | analyse | {
"repo_name": "it-tavis/opencms-core",
"path": "src-modules/org/opencms/workplace/tools/content/CmsMergePages.java",
"license": "lgpl-2.1",
"size": 33940
} | [
"org.opencms.file.CmsResource",
"org.opencms.file.CmsResourceFilter",
"org.opencms.main.CmsException"
] | import org.opencms.file.CmsResource; import org.opencms.file.CmsResourceFilter; import org.opencms.main.CmsException; | import org.opencms.file.*; import org.opencms.main.*; | [
"org.opencms.file",
"org.opencms.main"
] | org.opencms.file; org.opencms.main; | 853,793 |
public Character[] getCharacterList() {
return gameStateInformation.getCharacterList();
}
| Character[] function() { return gameStateInformation.getCharacterList(); } | /**
* List of characters
* @return Array of Characters
*/ | List of characters | getCharacterList | {
"repo_name": "balazspete/crystal-game",
"path": "crystal-game/src/com/example/crystalgame/game/maps/LocalMapInformation.java",
"license": "mit",
"size": 1319
} | [
"com.example.crystalgame.library.data.Character"
] | import com.example.crystalgame.library.data.Character; | import com.example.crystalgame.library.data.*; | [
"com.example.crystalgame"
] | com.example.crystalgame; | 2,307,302 |
@Test
public void testMissingPath0() throws Exception {
URL url = new URL("http://d.e.f/goo.html");
man.addCookieFromHeader("test=moo", url);
String s = man.getCookieHeaderForURL(new URL("http://d.e.f/"));
assertNotNull(s);
assertEquals("test=moo", s);
}
| void function() throws Exception { URL url = new URL(STRtest=mooSTRhttp: assertNotNull(s); assertEquals(STR, s); } | /** Tests missing cookie path for a trivial URL fetch from the domain
* Note that this fails prior to a fix for BUG 38256
*
* @throws Exception if something fails
*/ | Tests missing cookie path for a trivial URL fetch from the domain Note that this fails prior to a fix for BUG 38256 | testMissingPath0 | {
"repo_name": "yuyupapa/OpenSource",
"path": "apache-jmeter-3.0/test/src/org/apache/jmeter/protocol/http/control/TestHC3CookieManager.java",
"license": "apache-2.0",
"size": 20380
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 711,390 |
private ResourceInstance createUserResource(String userName) {
return createResource(Resource.Type.User,
Collections.singletonMap(Resource.Type.User, userName));
} | ResourceInstance function(String userName) { return createResource(Resource.Type.User, Collections.singletonMap(Resource.Type.User, userName)); } | /**
* Create a user resource instance.
*
* @param userName user name
*
* @return a user resource instance
*/ | Create a user resource instance | createUserResource | {
"repo_name": "telefonicaid/fiware-cosmos-ambari",
"path": "ambari-server/src/main/java/org/apache/ambari/server/api/services/UserService.java",
"license": "apache-2.0",
"size": 4106
} | [
"java.util.Collections",
"org.apache.ambari.server.api.resources.ResourceInstance",
"org.apache.ambari.server.controller.spi.Resource"
] | import java.util.Collections; import org.apache.ambari.server.api.resources.ResourceInstance; import org.apache.ambari.server.controller.spi.Resource; | import java.util.*; import org.apache.ambari.server.api.resources.*; import org.apache.ambari.server.controller.spi.*; | [
"java.util",
"org.apache.ambari"
] | java.util; org.apache.ambari; | 965,762 |
protected Set<Integer> createTranslationScopeSet()
{
return new HashSet<Integer>();
} | Set<Integer> function() { return new HashSet<Integer>(); } | /**
* Factory method to create translation scope set. Creates a new instance of {@link HashSet}. Subclasses may
* override to supply a custom {@link java.util.Set} type.
*
* @return The translation scope set. Will never be <code>null</code>.
*/ | Factory method to create translation scope set. Creates a new instance of <code>HashSet</code>. Subclasses may override to supply a custom <code>java.util.Set</code> type | createTranslationScopeSet | {
"repo_name": "kdunsmore/diffunit",
"path": "core/impl/src/main/java/com/sunsprinter/diffunit/core/translators/TypeBindingTranslator.java",
"license": "apache-2.0",
"size": 7603
} | [
"java.util.HashSet",
"java.util.Set"
] | import java.util.HashSet; import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 129,387 |
public void save(Song song, Channel channel) {
// Does the song exist? Does it exist in the database?
if(song == null || song.getId() == 0) {
// Nope. Don't save anything.
return;
}
// Does the channel exist?
if(channel.getId() > 0) {
// Yes, update.
// Set up value table.
ContentValues values = new ContentValues();
values.put(ChannelSQLiteHelper.COLUMN_NUMBER, channel.getChannelNumber());
values.put(ChannelSQLiteHelper.COLUMN_RIGHTPAN, channel.getRightPanning());
values.put(ChannelSQLiteHelper.COLUMN_LEFTPAN, channel.getLeftPanning());
values.put(ChannelSQLiteHelper.COLUMN_VOLUME, channel.getChannelVolume());
values.put(ChannelSQLiteHelper.COLUMN_MUTE, channel.isMuted() ? 1 : 0);
// Add foreign keys to the value table.
values.put(ChannelSQLiteHelper.FKEY_SONGID, song.getId());
if(channel.getSound() != null) {
values.put(ChannelSQLiteHelper.FKEY_SOUNDID, channel.getSound().getId());
} else {
values.put(ChannelSQLiteHelper.FKEY_SOUNDID, 0);
}
// Set up query.
String where = ChannelSQLiteHelper.COLUMN_ID + " = ?";
String[] whereArgs = new String[] { String.valueOf(channel.getId() )};
// Run query.
database.update(ChannelSQLiteHelper.TABLE_CHANNEL, values, where, whereArgs);
} else {
// The Channel doesn't exist, create it.
long newChannelId = createChannel(song,
channel.getSound(),
channel.getVolume(),
channel.getRightPanning(),
channel.getLeftPanning(),
channel.getChannelNumber(),
channel.isMuted());
// Set the newly obtained id to the channel.
channel.setId(newChannelId);
}
}
| void function(Song song, Channel channel) { if(song == null song.getId() == 0) { return; } if(channel.getId() > 0) { ContentValues values = new ContentValues(); values.put(ChannelSQLiteHelper.COLUMN_NUMBER, channel.getChannelNumber()); values.put(ChannelSQLiteHelper.COLUMN_RIGHTPAN, channel.getRightPanning()); values.put(ChannelSQLiteHelper.COLUMN_LEFTPAN, channel.getLeftPanning()); values.put(ChannelSQLiteHelper.COLUMN_VOLUME, channel.getChannelVolume()); values.put(ChannelSQLiteHelper.COLUMN_MUTE, channel.isMuted() ? 1 : 0); values.put(ChannelSQLiteHelper.FKEY_SONGID, song.getId()); if(channel.getSound() != null) { values.put(ChannelSQLiteHelper.FKEY_SOUNDID, channel.getSound().getId()); } else { values.put(ChannelSQLiteHelper.FKEY_SOUNDID, 0); } String where = ChannelSQLiteHelper.COLUMN_ID + STR; String[] whereArgs = new String[] { String.valueOf(channel.getId() )}; database.update(ChannelSQLiteHelper.TABLE_CHANNEL, values, where, whereArgs); } else { long newChannelId = createChannel(song, channel.getSound(), channel.getVolume(), channel.getRightPanning(), channel.getLeftPanning(), channel.getChannelNumber(), channel.isMuted()); channel.setId(newChannelId); } } | /**
* Saves a channel to a song, if the channel doesn't exists it is created.
* The Channel needs an for ID for the Channel to update.
*
* Also, if the song is null or not in the database the Channel
* won't be saved.
*
* @param song Song the channel belongs to.
* @param channel The Channel to save.
*/ | Saves a channel to a song, if the channel doesn't exists it is created. The Channel needs an for ID for the Channel to update. Also, if the song is null or not in the database the Channel won't be saved | save | {
"repo_name": "KVHC/adrumdrum",
"path": "src/kvhc/util/db/ChannelDataSource.java",
"license": "gpl-3.0",
"size": 9560
} | [
"android.content.ContentValues"
] | import android.content.ContentValues; | import android.content.*; | [
"android.content"
] | android.content; | 2,147,588 |
public void getEmissiveColor(Color3f color) {
if (isLiveOrCompiled())
if (!this.getCapability(ALLOW_COMPONENT_READ))
throw new CapabilityNotSetException(J3dI18N.getString("Material2"));
((MaterialRetained)this.retained).getEmissiveColor(color);
} | void function(Color3f color) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_COMPONENT_READ)) throw new CapabilityNotSetException(J3dI18N.getString(STR)); ((MaterialRetained)this.retained).getEmissiveColor(color); } | /**
* Retrieves this material's emissive color and stores it in the
* argument provided.
* @param color the vector that will receive this material's emissive color
* @exception CapabilityNotSetException if appropriate capability is
* not set and this object is part of live or compiled scene graph
*/ | Retrieves this material's emissive color and stores it in the argument provided | getEmissiveColor | {
"repo_name": "philipwhiuk/j3d-core",
"path": "src/classes/share/javax/media/j3d/Material.java",
"license": "gpl-2.0",
"size": 27667
} | [
"javax.vecmath.Color3f"
] | import javax.vecmath.Color3f; | import javax.vecmath.*; | [
"javax.vecmath"
] | javax.vecmath; | 617,283 |
public Set getOperators();
| Set function(); | /**
* get all the operators
* @return the operators
*/ | get all the operators | getOperators | {
"repo_name": "cybersonic/org.cfeclipse.cfml",
"path": "src/org/cfeclipse/cfml/dictionary/ISyntaxDictionary.java",
"license": "mit",
"size": 3509
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 2,182,352 |
public void setServerPortNumber(String serverPortNumber) {
try {
this.serverPortNumber = Integer.valueOf(serverPortNumber);
} catch (NumberFormatException e) {
throw new RuntimeCamelException(String.format("Invalid target port number: %s", targetPortNumber));
}
} | void function(String serverPortNumber) { try { this.serverPortNumber = Integer.valueOf(serverPortNumber); } catch (NumberFormatException e) { throw new RuntimeCamelException(String.format(STR, targetPortNumber)); } } | /**
* The port number of server.
*/ | The port number of server | setServerPortNumber | {
"repo_name": "sverkera/camel",
"path": "components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Configuration.java",
"license": "apache-2.0",
"size": 11999
} | [
"org.apache.camel.RuntimeCamelException"
] | import org.apache.camel.RuntimeCamelException; | import org.apache.camel.*; | [
"org.apache.camel"
] | org.apache.camel; | 1,296,249 |
public static void render(JRExporter exporter, JasperPrint print, OutputStream outputStream)
throws JRException {
exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);
exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, outputStream);
exporter.exportReport();
}
| static void function(JRExporter exporter, JasperPrint print, OutputStream outputStream) throws JRException { exporter.setParameter(JRExporterParameter.JASPER_PRINT, print); exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, outputStream); exporter.exportReport(); } | /**
* Render the supplied <code>JasperPrint</code> instance using the
* supplied <code>JRAbstractExporter</code> instance and write the results
* to the supplied <code>OutputStream</code>.
* <p>Make sure that the <code>JRAbstractExporter</code> implementation you
* supply is capable of writing to a <code>OutputStream</code>.
* @param exporter the <code>JRAbstractExporter</code> to use to render the report
* @param print the <code>JasperPrint</code> instance to render
* @param outputStream the <code>OutputStream</code> to write the result to
* @throws JRException if rendering failed
*/ | Render the supplied <code>JasperPrint</code> instance using the supplied <code>JRAbstractExporter</code> instance and write the results to the supplied <code>OutputStream</code>. Make sure that the <code>JRAbstractExporter</code> implementation you supply is capable of writing to a <code>OutputStream</code> | render | {
"repo_name": "besom/bbossgroups-mvn",
"path": "bboss_mvc/src/main/java/org/frameworkset/ui/jasperreports/JasperReportsUtils.java",
"license": "apache-2.0",
"size": 12844
} | [
"java.io.OutputStream",
"net.sf.jasperreports.engine.JRException",
"net.sf.jasperreports.engine.JRExporter",
"net.sf.jasperreports.engine.JRExporterParameter",
"net.sf.jasperreports.engine.JasperPrint"
] | import java.io.OutputStream; import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JRExporter; import net.sf.jasperreports.engine.JRExporterParameter; import net.sf.jasperreports.engine.JasperPrint; | import java.io.*; import net.sf.jasperreports.engine.*; | [
"java.io",
"net.sf.jasperreports"
] | java.io; net.sf.jasperreports; | 427,538 |
protected void removeAntiSpoofingIp2Mac(String addrSpace,
Short vlan,
Long mac,
Integer ip) {
ScopedIp scopedIp = new ScopedIp(addrSpace, ip);
Collection<DeviceId> hosts = hostSecurityIpMap.get(scopedIp);
if (hosts == null) {
return;
}
DeviceId host = new DeviceId(addrSpace, vlan, mac);
hosts.remove(host);
if (hosts.isEmpty())
hostSecurityIpMap.remove(scopedIp);
} | void function(String addrSpace, Short vlan, Long mac, Integer ip) { ScopedIp scopedIp = new ScopedIp(addrSpace, ip); Collection<DeviceId> hosts = hostSecurityIpMap.get(scopedIp); if (hosts == null) { return; } DeviceId host = new DeviceId(addrSpace, vlan, mac); hosts.remove(host); if (hosts.isEmpty()) hostSecurityIpMap.remove(scopedIp); } | /**
* Remove an IP to MAC anti-spoofing entry.
*
* NOTE: The caller needs to hold the anti-spoofing write lock.
* @param addrSpace
* @param vlan
* @param mac
* @param ip
*/ | Remove an IP to MAC anti-spoofing entry | removeAntiSpoofingIp2Mac | {
"repo_name": "mandeepdhami/netvirt-ctrl",
"path": "sdnplatform/src/main/java/org/sdnplatform/devicemanager/internal/BetterDeviceManagerImpl.java",
"license": "epl-1.0",
"size": 78077
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 1,370,948 |
private void validateMasterInstanceDefinition(MasterInstanceDefinition masterInstanceDefinition)
{
InstanceDefinition instanceDefinition = new InstanceDefinition();
instanceDefinition.setInstanceCount(masterInstanceDefinition.getInstanceCount());
instanceDefinition.setInstanceMaxSearchPrice(masterInstanceDefinition.getInstanceMaxSearchPrice());
instanceDefinition.setInstanceOnDemandThreshold(masterInstanceDefinition.getInstanceOnDemandThreshold());
instanceDefinition.setInstanceSpotPrice(masterInstanceDefinition.getInstanceSpotPrice());
instanceDefinition.setInstanceType(masterInstanceDefinition.getInstanceType());
validateInstanceDefinition("master", instanceDefinition, 1);
} | void function(MasterInstanceDefinition masterInstanceDefinition) { InstanceDefinition instanceDefinition = new InstanceDefinition(); instanceDefinition.setInstanceCount(masterInstanceDefinition.getInstanceCount()); instanceDefinition.setInstanceMaxSearchPrice(masterInstanceDefinition.getInstanceMaxSearchPrice()); instanceDefinition.setInstanceOnDemandThreshold(masterInstanceDefinition.getInstanceOnDemandThreshold()); instanceDefinition.setInstanceSpotPrice(masterInstanceDefinition.getInstanceSpotPrice()); instanceDefinition.setInstanceType(masterInstanceDefinition.getInstanceType()); validateInstanceDefinition(STR, instanceDefinition, 1); } | /**
* Converts the given master instance definition to a generic instance definition and delegates to validateInstanceDefinition(). Generates an appropriate
* error message using the name "master".
*
* @param masterInstanceDefinition the master instance definition to validate
*
* @throws IllegalArgumentException when any validation error occurs
*/ | Converts the given master instance definition to a generic instance definition and delegates to validateInstanceDefinition(). Generates an appropriate error message using the name "master" | validateMasterInstanceDefinition | {
"repo_name": "FINRAOS/herd",
"path": "herd-code/herd-service/src/main/java/org/finra/herd/service/helper/EmrClusterDefinitionHelper.java",
"license": "apache-2.0",
"size": 13197
} | [
"org.finra.herd.model.api.xml.InstanceDefinition",
"org.finra.herd.model.api.xml.MasterInstanceDefinition"
] | import org.finra.herd.model.api.xml.InstanceDefinition; import org.finra.herd.model.api.xml.MasterInstanceDefinition; | import org.finra.herd.model.api.xml.*; | [
"org.finra.herd"
] | org.finra.herd; | 2,615,541 |
public void close() {
//log.debug("Stream close: {}", publishedName);
if (closed.compareAndSet(false, true)) {
if (livePipe != null) {
livePipe.unsubscribe((IProvider) this);
}
// if we have a recording listener, inform that this stream is done
if (recordingListener != null) {
sendRecordStopNotify();
notifyRecordingStop();
// inform the listener to finish and close
recordingListener.get().stop();
}
sendPublishStopNotify();
// TODO: can we send the client something to make sure he stops sending data?
if (connMsgOut != null) {
connMsgOut.unsubscribe(this);
}
notifyBroadcastClose();
// clear the listener after all the notifications have been sent
if (recordingListener != null) {
recordingListener.clear();
}
// clear listeners
if (!listeners.isEmpty()) {
listeners.clear();
}
// deregister with jmx
unregisterJMX();
setState(StreamState.CLOSED);
}
}
| void function() { if (closed.compareAndSet(false, true)) { if (livePipe != null) { livePipe.unsubscribe((IProvider) this); } if (recordingListener != null) { sendRecordStopNotify(); notifyRecordingStop(); recordingListener.get().stop(); } sendPublishStopNotify(); if (connMsgOut != null) { connMsgOut.unsubscribe(this); } notifyBroadcastClose(); if (recordingListener != null) { recordingListener.clear(); } if (!listeners.isEmpty()) { listeners.clear(); } unregisterJMX(); setState(StreamState.CLOSED); } } | /**
* Closes stream, unsubscribes provides, sends stoppage notifications and broadcast close notification.
*/ | Closes stream, unsubscribes provides, sends stoppage notifications and broadcast close notification | close | {
"repo_name": "solomax/red5-server-common",
"path": "src/main/java/org/red5/server/stream/ClientBroadcastStream.java",
"license": "apache-2.0",
"size": 39246
} | [
"org.red5.server.api.stream.StreamState",
"org.red5.server.messaging.IProvider"
] | import org.red5.server.api.stream.StreamState; import org.red5.server.messaging.IProvider; | import org.red5.server.api.stream.*; import org.red5.server.messaging.*; | [
"org.red5.server"
] | org.red5.server; | 1,669,642 |
long[] getDownloadedVideoDmIdsForSection(String enrollmentId, String chapter, String section,
final DataCallback<List<Long>> callback); | long[] getDownloadedVideoDmIdsForSection(String enrollmentId, String chapter, String section, final DataCallback<List<Long>> callback); | /**
* Returns dmId's of all downloaded videos for given section of logged in user
*
* @param enrollmentId course which has the chapter
* @param chapter the chapter
* @param section the section inside chapter
* @param callback callback to return results to
* @return If the callback is null, returns an array containing the IDs for the downloaded
* videos, or an empty array if there are no videos downloaded in the section. Otherwise,
* returns null.
*/ | Returns dmId's of all downloaded videos for given section of logged in user | getDownloadedVideoDmIdsForSection | {
"repo_name": "IndonesiaX/edx-app-android",
"path": "VideoLocker/src/main/java/org/edx/mobile/module/db/IDatabase.java",
"license": "apache-2.0",
"size": 16172
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,106,658 |
@Test
public void testIsUndefined() {
msg =
ModelInstanceTypeTestSuiteMessages.TestModelInstanceEnumerationLiteral_IsUndefinedIsWrong;
for (IModelInstanceEnumerationLiteral aLiteral : instances_EnumerationLiteral) {
if (aLiteral.isUndefined()) {
assertNull(msg, aLiteral.getLiteral());
}
else {
assertNotNull(msg, aLiteral.getLiteral());
}
}
// end for.
}
| void function() { msg = ModelInstanceTypeTestSuiteMessages.TestModelInstanceEnumerationLiteral_IsUndefinedIsWrong; for (IModelInstanceEnumerationLiteral aLiteral : instances_EnumerationLiteral) { if (aLiteral.isUndefined()) { assertNull(msg, aLiteral.getLiteral()); } else { assertNotNull(msg, aLiteral.getLiteral()); } } } | /**
* <p>
* Tests the method {@link IModelInstanceEnumerationLiteral#isUndefined()}.
* </p>
*/ | Tests the method <code>IModelInstanceEnumerationLiteral#isUndefined()</code>. | testIsUndefined | {
"repo_name": "dresden-ocl/dresdenocl",
"path": "tests/org.dresdenocl.modelinstancetype.test/src/org/dresdenocl/modelinstancetype/test/tests/TestModelInstanceEnumerationLiteral.java",
"license": "lgpl-3.0",
"size": 10622
} | [
"org.dresdenocl.modelinstancetype.test.msg.ModelInstanceTypeTestSuiteMessages",
"org.dresdenocl.modelinstancetype.types.IModelInstanceEnumerationLiteral",
"org.junit.Assert"
] | import org.dresdenocl.modelinstancetype.test.msg.ModelInstanceTypeTestSuiteMessages; import org.dresdenocl.modelinstancetype.types.IModelInstanceEnumerationLiteral; import org.junit.Assert; | import org.dresdenocl.modelinstancetype.test.msg.*; import org.dresdenocl.modelinstancetype.types.*; import org.junit.*; | [
"org.dresdenocl.modelinstancetype",
"org.junit"
] | org.dresdenocl.modelinstancetype; org.junit; | 1,979,661 |
public int getUnusableNodes(Collection<RMNode> unUsableNodes) {
unUsableNodes.addAll(unusableRMNodesConcurrentSet);
return unusableRMNodesConcurrentSet.size();
} | int function(Collection<RMNode> unUsableNodes) { unUsableNodes.addAll(unusableRMNodesConcurrentSet); return unusableRMNodesConcurrentSet.size(); } | /**
* Provides the currently unusable nodes. Copies it into provided collection.
* @param unUsableNodes
* Collection to which the unusable nodes are added
* @return number of unusable nodes added
*/ | Provides the currently unusable nodes. Copies it into provided collection | getUnusableNodes | {
"repo_name": "myeoje/PhillyYarn",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/NodesListManager.java",
"license": "apache-2.0",
"size": 9237
} | [
"java.util.Collection",
"org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNode"
] | import java.util.Collection; import org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNode; | import java.util.*; import org.apache.hadoop.yarn.server.resourcemanager.rmnode.*; | [
"java.util",
"org.apache.hadoop"
] | java.util; org.apache.hadoop; | 1,303,063 |
BrokerInfo getLeaderBroker() throws PulsarAdminException; | BrokerInfo getLeaderBroker() throws PulsarAdminException; | /**
* Get the information of the leader broker.
* <p/>
* Get the information of the leader broker.
* <p/>
* Response Example:
*
* <pre>
* <code>{serviceUrl:"prod1-broker1.messaging.use.example.com:8080"}</code>
* </pre>
*
* @return the information of the leader broker.
* @throws PulsarAdminException
* Unexpected error
*/ | Get the information of the leader broker. Get the information of the leader broker. Response Example: <code> <code>{serviceUrl:"prod1-broker1.messaging.use.example.com:8080"}</code> </code> | getLeaderBroker | {
"repo_name": "massakam/pulsar",
"path": "pulsar-client-admin-api/src/main/java/org/apache/pulsar/client/admin/Brokers.java",
"license": "apache-2.0",
"size": 9824
} | [
"org.apache.pulsar.common.policies.data.BrokerInfo"
] | import org.apache.pulsar.common.policies.data.BrokerInfo; | import org.apache.pulsar.common.policies.data.*; | [
"org.apache.pulsar"
] | org.apache.pulsar; | 1,036,166 |
public Intent getSystemLocationSettingsIntent() {
Intent i = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
return i;
} | Intent function() { Intent i = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); return i; } | /**
* Returns an intent to launch Android Location Settings.
*/ | Returns an intent to launch Android Location Settings | getSystemLocationSettingsIntent | {
"repo_name": "guorendong/iridium-browser-ubuntu",
"path": "chrome/android/java/src/org/chromium/chrome/browser/preferences/LocationSettings.java",
"license": "bsd-3-clause",
"size": 3966
} | [
"android.content.Intent",
"android.provider.Settings"
] | import android.content.Intent; import android.provider.Settings; | import android.content.*; import android.provider.*; | [
"android.content",
"android.provider"
] | android.content; android.provider; | 1,171,402 |
public PDThreadBead getPreviousBead()
{
return new PDThreadBead(bead.getCOSDictionary(COSName.V));
} | PDThreadBead function() { return new PDThreadBead(bead.getCOSDictionary(COSName.V)); } | /**
* This will get the previous bead. If this bead is the first bead in the list then this
* will return the last bead.
*
* @return The previous bead in the list or the last bead if this is the first bead.
*/ | This will get the previous bead. If this bead is the first bead in the list then this will return the last bead | getPreviousBead | {
"repo_name": "kalaspuffar/pdfbox",
"path": "pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/pagenavigation/PDThreadBead.java",
"license": "apache-2.0",
"size": 5619
} | [
"org.apache.pdfbox.cos.COSName"
] | import org.apache.pdfbox.cos.COSName; | import org.apache.pdfbox.cos.*; | [
"org.apache.pdfbox"
] | org.apache.pdfbox; | 415,343 |
public static String explode(Collection<? extends Object> parts, String glue) {
return explode(parts.toArray(new Object[parts.size()]), glue);
}
| static String function(Collection<? extends Object> parts, String glue) { return explode(parts.toArray(new Object[parts.size()]), glue); } | /**
* Concatenates the given parts and puts 'glue' between them.
*/ | Concatenates the given parts and puts 'glue' between them | explode | {
"repo_name": "HyVar/DarwinSPL",
"path": "plugins/eu.hyvar.feature.mapping.resource.hymapping/src-gen/eu/hyvar/feature/mapping/resource/hymapping/util/HymappingStringUtil.java",
"license": "apache-2.0",
"size": 11722
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 2,352,817 |
File getSaveFile();
void setSaveFile(File saveFile);
long getFileSize();
//URN getURN();
//com.limegroup.gnutella.Downloader createDownloader(boolean overwrite)
// throws DownloadException; | File getSaveFile(); void setSaveFile(File saveFile); long getFileSize(); | /**
* Returns the final file size of the download if available, otherwise 0.
*/ | Returns the final file size of the download if available, otherwise 0 | getFileSize | {
"repo_name": "adamfisk/littleshoot-client",
"path": "client/services/src/main/java/org/lastbamboo/client/services/download/DownloaderFactory.java",
"license": "gpl-2.0",
"size": 1382
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 890,639 |
public DateTime endTimeUtc() {
if (this.endTimeUtc == null) {
return null;
}
return this.endTimeUtc.dateTime();
} | DateTime function() { if (this.endTimeUtc == null) { return null; } return this.endTimeUtc.dateTime(); } | /**
* Get the endTimeUtc value.
*
* @return the endTimeUtc value
*/ | Get the endTimeUtc value | endTimeUtc | {
"repo_name": "hovsepm/azure-sdk-for-java",
"path": "iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/JobResponseInner.java",
"license": "mit",
"size": 3825
} | [
"org.joda.time.DateTime"
] | import org.joda.time.DateTime; | import org.joda.time.*; | [
"org.joda.time"
] | org.joda.time; | 2,465,770 |
private void setBatchSize(String persistenceUnit, Map<String, Object> puProperties)
{
String batch_Size = null;
if (puProperties != null)
{
batch_Size = puProperties != null ? (String) puProperties.get(PersistenceProperties.KUNDERA_BATCH_SIZE)
: null;
if (batch_Size != null)
{
setBatchSize(Integer.valueOf(batch_Size));
}
}
else if (batch_Size == null)
{
PersistenceUnitMetadata puMetadata = KunderaMetadataManager.getPersistenceUnitMetadata(kunderaMetadata,
persistenceUnit);
setBatchSize(puMetadata.getBatchSize());
}
} | void function(String persistenceUnit, Map<String, Object> puProperties) { String batch_Size = null; if (puProperties != null) { batch_Size = puProperties != null ? (String) puProperties.get(PersistenceProperties.KUNDERA_BATCH_SIZE) : null; if (batch_Size != null) { setBatchSize(Integer.valueOf(batch_Size)); } } else if (batch_Size == null) { PersistenceUnitMetadata puMetadata = KunderaMetadataManager.getPersistenceUnitMetadata(kunderaMetadata, persistenceUnit); setBatchSize(puMetadata.getBatchSize()); } } | /**
* Sets the batch size.
*
* @param persistenceUnit
* the persistence unit
* @param puProperties
* the pu properties
*/ | Sets the batch size | setBatchSize | {
"repo_name": "ravisund/Kundera",
"path": "src/kundera-redis/src/main/java/com/impetus/client/redis/RedisClient.java",
"license": "apache-2.0",
"size": 75957
} | [
"com.impetus.kundera.PersistenceProperties",
"com.impetus.kundera.metadata.KunderaMetadataManager",
"com.impetus.kundera.metadata.model.PersistenceUnitMetadata",
"java.util.Map"
] | import com.impetus.kundera.PersistenceProperties; import com.impetus.kundera.metadata.KunderaMetadataManager; import com.impetus.kundera.metadata.model.PersistenceUnitMetadata; import java.util.Map; | import com.impetus.kundera.*; import com.impetus.kundera.metadata.*; import com.impetus.kundera.metadata.model.*; import java.util.*; | [
"com.impetus.kundera",
"java.util"
] | com.impetus.kundera; java.util; | 339,760 |
public static String get(final Class<?> c, final String messageKey, Locale locale, final Object... arguments) throws NullPointerException, IllegalArgumentException, MissingResourceException {
if(c == null)
throw new NullPointerException();
return get(c.getCanonicalName(), messageKey, locale, arguments);
} | static String function(final Class<?> c, final String messageKey, Locale locale, final Object... arguments) throws NullPointerException, IllegalArgumentException, MissingResourceException { if(c == null) throw new NullPointerException(); return get(c.getCanonicalName(), messageKey, locale, arguments); } | /**
* <p>Calls {@link #get(String, String, Locale, Object...)} with the {@link Class#getCanonicalName() canonical name} of the given class {@code c} as the {@code bundleKey}.</p>
* @param c The class to determine the {@code bundleKey} from.
* @param messageKey The key of the message in the property resource bundle.
* @param locale The locale to use, if it is {@code null} then the {@link Locale#getDefault() default locale} will be used.
* @param arguments The arguments to format the message with, if it is {@code null} or empty no formatting will be done.
* @return The formatted message.
* @throws NullPointerException If {@code c}, {@code bundleKey} or {@code messageKey} are {@code null}.
* @throws IllegalArgumentException If arguments is neither {@code null} nor empty and the message is no valid {@code MessageFormat} pattern.
* @throws MissingResourceException If no {@link PropertyResourceBundle} with base name {@code bundleKey} can be found.
*/ | Calls <code>#get(String, String, Locale, Object...)</code> with the <code>Class#getCanonicalName() canonical name</code> of the given class c as the bundleKey | get | {
"repo_name": "IvIePhisto/Dual-Strike",
"path": "MCCF/java/mccf/MessageHelper.java",
"license": "gpl-3.0",
"size": 10974
} | [
"java.util.Locale",
"java.util.MissingResourceException"
] | import java.util.Locale; import java.util.MissingResourceException; | import java.util.*; | [
"java.util"
] | java.util; | 2,017,269 |
public void onChunkLoad() {
this.isChunkLoaded = true;
this.worldObj.addTileEntity(this.chunkTileEntityMap.values());
for (int var1 = 0; var1 < this.entityLists.length; ++var1) {
Iterator var2 = this.entityLists[var1].iterator();
while (var2.hasNext()) {
Entity var3 = (Entity)var2.next();
var3.onChunkLoad();
}
this.worldObj.addLoadedEntities(this.entityLists[var1]);
}
// Spout Start - onChunkLoad is only called in SP
SpoutcraftChunk.loadedChunks.add(spoutChunk);
// Spout End
} | void function() { this.isChunkLoaded = true; this.worldObj.addTileEntity(this.chunkTileEntityMap.values()); for (int var1 = 0; var1 < this.entityLists.length; ++var1) { Iterator var2 = this.entityLists[var1].iterator(); while (var2.hasNext()) { Entity var3 = (Entity)var2.next(); var3.onChunkLoad(); } this.worldObj.addLoadedEntities(this.entityLists[var1]); } SpoutcraftChunk.loadedChunks.add(spoutChunk); } | /**
* Called when this Chunk is loaded by the ChunkProvider
*/ | Called when this Chunk is loaded by the ChunkProvider | onChunkLoad | {
"repo_name": "Spoutcraft/Spoutcraft",
"path": "src/main/java/net/minecraft/src/Chunk.java",
"license": "lgpl-3.0",
"size": 36194
} | [
"java.util.Iterator",
"org.spoutcraft.client.block.SpoutcraftChunk"
] | import java.util.Iterator; import org.spoutcraft.client.block.SpoutcraftChunk; | import java.util.*; import org.spoutcraft.client.block.*; | [
"java.util",
"org.spoutcraft.client"
] | java.util; org.spoutcraft.client; | 504,949 |
int indexOf(Advice advice); | int indexOf(Advice advice); | /**
* Return the index (from 0) of the given AOP Alliance Advice,
* or -1 if no such advice is an advice for this proxy.
* <p>The return value of this method can be used to index into
* the advisors array.
* @param advice AOP Alliance advice to search for
* @return index from 0 of this advice, or -1 if there's no such advice
*/ | Return the index (from 0) of the given AOP Alliance Advice, or -1 if no such advice is an advice for this proxy. The return value of this method can be used to index into the advisors array | indexOf | {
"repo_name": "qobel/esoguproject",
"path": "spring-framework/spring-aop/src/main/java/org/springframework/aop/framework/Advised.java",
"license": "apache-2.0",
"size": 8473
} | [
"org.aopalliance.aop.Advice"
] | import org.aopalliance.aop.Advice; | import org.aopalliance.aop.*; | [
"org.aopalliance.aop"
] | org.aopalliance.aop; | 1,362,203 |
public void setCostAmt (BigDecimal CostAmt)
{
set_Value (COLUMNNAME_CostAmt, CostAmt);
} | void function (BigDecimal CostAmt) { set_Value (COLUMNNAME_CostAmt, CostAmt); } | /** Set Cost Value.
@param CostAmt
Value with Cost
*/ | Set Cost Value | setCostAmt | {
"repo_name": "arthurmelo88/palmetalADP",
"path": "adempiere_360/base/src/org/compiere/model/X_T_InventoryValue.java",
"license": "gpl-2.0",
"size": 13649
} | [
"java.math.BigDecimal"
] | import java.math.BigDecimal; | import java.math.*; | [
"java.math"
] | java.math; | 2,730,215 |
public List<AmqpTableEntry> getEntries(String key) {
if ((key == null) || (tableEntryArray == null)) {
return null;
}
List<AmqpTableEntry> entries = new ArrayList<AmqpTableEntry>();
for (AmqpTableEntry entry : tableEntryArray) {
if (entry.key.equals(key)) {
entries.add(entry);
}
}
return entries;
} | List<AmqpTableEntry> function(String key) { if ((key == null) (tableEntryArray == null)) { return null; } List<AmqpTableEntry> entries = new ArrayList<AmqpTableEntry>(); for (AmqpTableEntry entry : tableEntryArray) { if (entry.key.equals(key)) { entries.add(entry); } } return entries; } | /**
* Returns a list of AmqpTableEntry objects that matches the specified key.
* If a null key is passed in, then a null is returned. Also, if the internal
* structure is null, then a null is returned.
*
* @param key name of the entry
* @return List<AmqpTableEntry> object with matching key
*/ | Returns a list of AmqpTableEntry objects that matches the specified key. If a null key is passed in, then a null is returned. Also, if the internal structure is null, then a null is returned | getEntries | {
"repo_name": "michaelcretzman/java.client",
"path": "amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpArguments.java",
"license": "apache-2.0",
"size": 5404
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,054,861 |
private JTextField getLastUpdated() {
if (lastUpdated == null) {
lastUpdated = new JTextField();
lastUpdated.setEditable(false);
}
return lastUpdated;
} | JTextField function() { if (lastUpdated == null) { lastUpdated = new JTextField(); lastUpdated.setEditable(false); } return lastUpdated; } | /**
* This method initializes lastUpdated
*
* @return javax.swing.JTextField
*/ | This method initializes lastUpdated | getLastUpdated | {
"repo_name": "NCIP/cagrid",
"path": "cagrid/Software/core/caGrid/projects/gaards-ui/src/org/cagrid/gaards/ui/gts/LevelOfAssuranceWindow.java",
"license": "bsd-3-clause",
"size": 19111
} | [
"javax.swing.JTextField"
] | import javax.swing.JTextField; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 818,574 |
// singletons
install(new DefaultModule(PlaceManager.class));
// constants
bindConstant().annotatedWith(DefaultPlace.class).to(NameTokens.home);
bindConstant().annotatedWith(SecurityCookie.class).to(
AuthConstants.COOKIE_NAME);
// presenters
bindPresenter(MainPresenter.class, MainPresenter.MyView.class,
MainView.class, MainPresenter.MyProxy.class);
bindPresenter(HomePresenter.class, HomePresenter.MyView.class,
HomeView.class, HomePresenter.MyProxy.class);
bindPresenter(HeaderPresenter.class, HeaderPresenter.MyView.class,
HeaderView.class, HeaderPresenter.MyProxy.class);
bindPresenter(BlogEntryEditorPresenter.class,
BlogEntryEditorPresenter.MyView.class,
BlogEntryEditorView.class,
BlogEntryEditorPresenter.MyProxy.class);
bindPresenter(BlogEntryPresenter.class,
BlogEntryPresenter.MyView.class, BlogEntryView.class,
BlogEntryPresenter.MyProxy.class);
bindPresenterWidget(BlogEntryWidgetPresenter.class,
BlogEntryWidgetPresenter.MyView.class,
BlogEntryWidgetView.class);
bindPresenterWidget(PlaceholderWidgetPresenter.class,
PlaceholderWidgetPresenter.MyView.class,
PlaceholderWidgetView.class);
bindPresenterWidget(ErrorWidgetPresenter.class,
ErrorWidgetPresenter.MyView.class, ErrorWidgetView.class);
} | install(new DefaultModule(PlaceManager.class)); bindConstant().annotatedWith(DefaultPlace.class).to(NameTokens.home); bindConstant().annotatedWith(SecurityCookie.class).to( AuthConstants.COOKIE_NAME); bindPresenter(MainPresenter.class, MainPresenter.MyView.class, MainView.class, MainPresenter.MyProxy.class); bindPresenter(HomePresenter.class, HomePresenter.MyView.class, HomeView.class, HomePresenter.MyProxy.class); bindPresenter(HeaderPresenter.class, HeaderPresenter.MyView.class, HeaderView.class, HeaderPresenter.MyProxy.class); bindPresenter(BlogEntryEditorPresenter.class, BlogEntryEditorPresenter.MyView.class, BlogEntryEditorView.class, BlogEntryEditorPresenter.MyProxy.class); bindPresenter(BlogEntryPresenter.class, BlogEntryPresenter.MyView.class, BlogEntryView.class, BlogEntryPresenter.MyProxy.class); bindPresenterWidget(BlogEntryWidgetPresenter.class, BlogEntryWidgetPresenter.MyView.class, BlogEntryWidgetView.class); bindPresenterWidget(PlaceholderWidgetPresenter.class, PlaceholderWidgetPresenter.MyView.class, PlaceholderWidgetView.class); bindPresenterWidget(ErrorWidgetPresenter.class, ErrorWidgetPresenter.MyView.class, ErrorWidgetView.class); } | /**
* Configures the presenters.
*/ | Configures the presenters | configure | {
"repo_name": "jeraymond/orber.io",
"path": "src/main/java/io/orber/site/web/gwt/client/gin/Module.java",
"license": "apache-2.0",
"size": 4875
} | [
"com.gwtplatform.dispatch.shared.SecurityCookie",
"com.gwtplatform.mvp.client.gin.DefaultModule",
"io.orber.site.web.gwt.client.NameTokens",
"io.orber.site.web.gwt.client.PlaceManager",
"io.orber.site.web.gwt.client.ui.presenter.BlogEntryEditorPresenter",
"io.orber.site.web.gwt.client.ui.presenter.BlogEntryPresenter",
"io.orber.site.web.gwt.client.ui.presenter.BlogEntryWidgetPresenter",
"io.orber.site.web.gwt.client.ui.presenter.ErrorWidgetPresenter",
"io.orber.site.web.gwt.client.ui.presenter.HeaderPresenter",
"io.orber.site.web.gwt.client.ui.presenter.HomePresenter",
"io.orber.site.web.gwt.client.ui.presenter.MainPresenter",
"io.orber.site.web.gwt.client.ui.presenter.PlaceholderWidgetPresenter",
"io.orber.site.web.gwt.client.ui.view.BlogEntryEditorView",
"io.orber.site.web.gwt.client.ui.view.BlogEntryView",
"io.orber.site.web.gwt.client.ui.view.BlogEntryWidgetView",
"io.orber.site.web.gwt.client.ui.view.ErrorWidgetView",
"io.orber.site.web.gwt.client.ui.view.HeaderView",
"io.orber.site.web.gwt.client.ui.view.HomeView",
"io.orber.site.web.gwt.client.ui.view.MainView",
"io.orber.site.web.gwt.client.ui.view.PlaceholderWidgetView",
"io.orber.site.web.gwt.shared.AuthConstants"
] | import com.gwtplatform.dispatch.shared.SecurityCookie; import com.gwtplatform.mvp.client.gin.DefaultModule; import io.orber.site.web.gwt.client.NameTokens; import io.orber.site.web.gwt.client.PlaceManager; import io.orber.site.web.gwt.client.ui.presenter.BlogEntryEditorPresenter; import io.orber.site.web.gwt.client.ui.presenter.BlogEntryPresenter; import io.orber.site.web.gwt.client.ui.presenter.BlogEntryWidgetPresenter; import io.orber.site.web.gwt.client.ui.presenter.ErrorWidgetPresenter; import io.orber.site.web.gwt.client.ui.presenter.HeaderPresenter; import io.orber.site.web.gwt.client.ui.presenter.HomePresenter; import io.orber.site.web.gwt.client.ui.presenter.MainPresenter; import io.orber.site.web.gwt.client.ui.presenter.PlaceholderWidgetPresenter; import io.orber.site.web.gwt.client.ui.view.BlogEntryEditorView; import io.orber.site.web.gwt.client.ui.view.BlogEntryView; import io.orber.site.web.gwt.client.ui.view.BlogEntryWidgetView; import io.orber.site.web.gwt.client.ui.view.ErrorWidgetView; import io.orber.site.web.gwt.client.ui.view.HeaderView; import io.orber.site.web.gwt.client.ui.view.HomeView; import io.orber.site.web.gwt.client.ui.view.MainView; import io.orber.site.web.gwt.client.ui.view.PlaceholderWidgetView; import io.orber.site.web.gwt.shared.AuthConstants; | import com.gwtplatform.dispatch.shared.*; import com.gwtplatform.mvp.client.gin.*; import io.orber.site.web.gwt.client.*; import io.orber.site.web.gwt.client.ui.presenter.*; import io.orber.site.web.gwt.client.ui.view.*; import io.orber.site.web.gwt.shared.*; | [
"com.gwtplatform.dispatch",
"com.gwtplatform.mvp",
"io.orber.site"
] | com.gwtplatform.dispatch; com.gwtplatform.mvp; io.orber.site; | 161,967 |
synchronized static StorageManager getInstance(Context context) {
if (sSingleton == null) {
sSingleton = new StorageManager(context);
}
return sSingleton;
}
private StorageManager(Context context) { // constructor is private
mContext = context;
mDownloadDataDir = context.getCacheDir();
mExternalStorageDir = Environment.getExternalStorageDirectory();
mSystemCacheDir = Environment.getDownloadCacheDirectory();
startThreadToCleanupDatabaseAndPurgeFileSystem();
}
private static final int FREQUENCY_OF_DATABASE_N_FILESYSTEM_CLEANUP = 250;
private int mNumDownloadsSoFar = 0; | synchronized static StorageManager getInstance(Context context) { if (sSingleton == null) { sSingleton = new StorageManager(context); } return sSingleton; } private StorageManager(Context context) { mContext = context; mDownloadDataDir = context.getCacheDir(); mExternalStorageDir = Environment.getExternalStorageDirectory(); mSystemCacheDir = Environment.getDownloadCacheDirectory(); startThreadToCleanupDatabaseAndPurgeFileSystem(); } private static final int FREQUENCY_OF_DATABASE_N_FILESYSTEM_CLEANUP = 250; private int mNumDownloadsSoFar = 0; | /**
* maintains Singleton instance of this class
*/ | maintains Singleton instance of this class | getInstance | {
"repo_name": "xjwangliang/android_source_note",
"path": "Download-Provider/DownloadProvider/src/com/android/providers/downloads/StorageManager.java",
"license": "apache-2.0",
"size": 20668
} | [
"android.content.Context",
"android.os.Environment"
] | import android.content.Context; import android.os.Environment; | import android.content.*; import android.os.*; | [
"android.content",
"android.os"
] | android.content; android.os; | 349,782 |
private Object getRowCell(String rowId, int colNumber, boolean select) {
if (colNumber == 0) {
// first column of row, add rowId
return rowId;
}
else {
// Create a checkbox
HtmlSelectBooleanCheckbox checkboxCell = new HtmlSelectBooleanCheckbox();
checkboxCell.setSelected(select);
// checkboxCell.setSubmittedValue(rowId + "_" + colNumber);
checkboxCell.setRendererType("javax.faces.Checkbox");
ValueBinding aRow = FacesContext.getCurrentInstance()
.getApplication()
.createValueBinding("#{" + checkboxBindingVar + "[" + (colNumber-1) + "]}");
checkboxCell.setValueBinding("value", aRow);
// create MethodBinding so when checkbox checked, can process it
// Class [] classArray = new Class[1];
// classArray[0] = new ValueChangeEvent(checkboxCell,
// Boolean.FALSE, Boolean.FALSE);
// MethodBinding mb =
// FacesContext.getCurrentInstance().getApplication().createMethodBinding("processCheckboxStateChange",
// classArray);
// checkboxCell.setValueChangeListener(mb);
return checkboxCell;
}
} | Object function(String rowId, int colNumber, boolean select) { if (colNumber == 0) { return rowId; } else { HtmlSelectBooleanCheckbox checkboxCell = new HtmlSelectBooleanCheckbox(); checkboxCell.setSelected(select); checkboxCell.setRendererType(STR); ValueBinding aRow = FacesContext.getCurrentInstance() .getApplication() .createValueBinding("#{" + checkboxBindingVar + "[" + (colNumber-1) + "]}"); checkboxCell.setValueBinding("value", aRow); return checkboxCell; } } | /**
* This returns the actual Faces component for each cell.
*
* @param rowId
* The String name for the row being constructed (to be put
* in column 0)
*
* @param colNumber
* Which column are we currently constructing
*
* @param select
* Whether the checkbox should be checked or not (ignored for
* column 0)
*
* @return Object Either the component passed in (column = 0) or a
* HtmlSelectBooleanCheckbox (every other column)
*/ | This returns the actual Faces component for each cell | getRowCell | {
"repo_name": "harfalm/Sakai-10.1",
"path": "podcasts/podcasts-app/src/java/org/sakaiproject/tool/podcasts/podPermBean.java",
"license": "apache-2.0",
"size": 16922
} | [
"javax.faces.component.html.HtmlSelectBooleanCheckbox",
"javax.faces.context.FacesContext",
"javax.faces.el.ValueBinding"
] | import javax.faces.component.html.HtmlSelectBooleanCheckbox; import javax.faces.context.FacesContext; import javax.faces.el.ValueBinding; | import javax.faces.component.html.*; import javax.faces.context.*; import javax.faces.el.*; | [
"javax.faces"
] | javax.faces; | 2,820,478 |
@Override
public void closeCashDrawer(String campusCode) {
CashDrawer drawer = getByCampusCode(campusCode);
this.closeCashDrawer(drawer);
}
| void function(String campusCode) { CashDrawer drawer = getByCampusCode(campusCode); this.closeCashDrawer(drawer); } | /**
* Retrieves the CashDrawer associated with the campus code provided and sets the state of the drawer to closed.
*
* @param campusCode The code of the campus associated with the cash drawer being retrieved.
* @see org.kuali.kfs.fp.service.CashDrawerService#closeCashDrawer(java.lang.String)
*/ | Retrieves the CashDrawer associated with the campus code provided and sets the state of the drawer to closed | closeCashDrawer | {
"repo_name": "ua-eas/ua-kfs-5.3",
"path": "work/src/org/kuali/kfs/fp/service/impl/CashDrawerServiceImpl.java",
"license": "agpl-3.0",
"size": 15206
} | [
"org.kuali.kfs.fp.businessobject.CashDrawer"
] | import org.kuali.kfs.fp.businessobject.CashDrawer; | import org.kuali.kfs.fp.businessobject.*; | [
"org.kuali.kfs"
] | org.kuali.kfs; | 635,792 |
public void setSubjectDN(
X509Name subject)
{
tbsGen.setSubject(subject);
} | void function( X509Name subject) { tbsGen.setSubject(subject); } | /**
* Set the subject distinguished name. The subject describes the entity associated with the public key.
*/ | Set the subject distinguished name. The subject describes the entity associated with the public key | setSubjectDN | {
"repo_name": "ripple/ripple-lib-java",
"path": "ripple-bouncycastle/src/main/java/org/ripple/bouncycastle/x509/X509V3CertificateGenerator.java",
"license": "isc",
"size": 16143
} | [
"org.ripple.bouncycastle.asn1.x509.X509Name"
] | import org.ripple.bouncycastle.asn1.x509.X509Name; | import org.ripple.bouncycastle.asn1.x509.*; | [
"org.ripple.bouncycastle"
] | org.ripple.bouncycastle; | 2,676,393 |
public Builder setUsageOverride(@Nullable String usageOverride) {
this.usageOverride = usageOverride;
return this;
} | Builder function(@Nullable String usageOverride) { this.usageOverride = usageOverride; return this; } | /**
* Set the usage override string. <p>If null, then usage information will be generated automatically.</p>
*
* @param usageOverride The usage override
* @return The builder
*/ | Set the usage override string. If null, then usage information will be generated automatically | setUsageOverride | {
"repo_name": "TheE/Intake",
"path": "intake/src/main/java/com/sk89q/intake/ImmutableDescription.java",
"license": "lgpl-3.0",
"size": 6674
} | [
"javax.annotation.Nullable"
] | import javax.annotation.Nullable; | import javax.annotation.*; | [
"javax.annotation"
] | javax.annotation; | 410,062 |
public static void refreshNodeStructure (TreeNode node) {
((DefaultTreeModel)tree.getModel()).nodeStructureChanged (node);
} | static void function (TreeNode node) { ((DefaultTreeModel)tree.getModel()).nodeStructureChanged (node); } | /**
* Refresh a single node.
*/ | Refresh a single node | refreshNodeStructure | {
"repo_name": "lsilvestre/Jogre",
"path": "server/src/org/jogre/server/administrator/AdminTreePanel.java",
"license": "gpl-2.0",
"size": 4186
} | [
"javax.swing.tree.DefaultTreeModel",
"javax.swing.tree.TreeNode"
] | import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreeNode; | import javax.swing.tree.*; | [
"javax.swing"
] | javax.swing; | 717,623 |
public FormdataOperations getFormdataOperations() {
return new FormdataOperationsImpl(this.retrofitBuilder.client(clientBuilder.build()).build(), this);
}
public AutoRestSwaggerBATFormDataServiceImpl() {
this("http://localhost");
}
public AutoRestSwaggerBATFormDataServiceImpl(String baseUrl) {
super();
this.baseUrl = new AutoRestBaseUrl(baseUrl);
initialize();
}
public AutoRestSwaggerBATFormDataServiceImpl(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder retrofitBuilder) {
super(clientBuilder, retrofitBuilder);
this.baseUrl = new AutoRestBaseUrl(baseUrl);
initialize();
} | FormdataOperations function() { return new FormdataOperationsImpl(this.retrofitBuilder.client(clientBuilder.build()).build(), this); } public AutoRestSwaggerBATFormDataServiceImpl() { this("http: } public AutoRestSwaggerBATFormDataServiceImpl(String baseUrl) { super(); this.baseUrl = new AutoRestBaseUrl(baseUrl); initialize(); } public AutoRestSwaggerBATFormDataServiceImpl(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder retrofitBuilder) { super(clientBuilder, retrofitBuilder); this.baseUrl = new AutoRestBaseUrl(baseUrl); initialize(); } | /**
* Gets the FormdataOperations object to access its operations.
* @return the FormdataOperations object.
*/ | Gets the FormdataOperations object to access its operations | getFormdataOperations | {
"repo_name": "sharadagarwal/autorest",
"path": "AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/bodyformdata/AutoRestSwaggerBATFormDataServiceImpl.java",
"license": "mit",
"size": 2533
} | [
"com.microsoft.rest.AutoRestBaseUrl"
] | import com.microsoft.rest.AutoRestBaseUrl; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 2,549,587 |
public void testPeek() {
LinkedBlockingDeque q = populatedDeque(SIZE);
for (int i = 0; i < SIZE; ++i) {
assertEquals(i, q.peek());
assertEquals(i, q.pollFirst());
assertTrue(q.peek() == null ||
!q.peek().equals(i));
}
assertNull(q.peek());
} | void function() { LinkedBlockingDeque q = populatedDeque(SIZE); for (int i = 0; i < SIZE; ++i) { assertEquals(i, q.peek()); assertEquals(i, q.pollFirst()); assertTrue(q.peek() == null !q.peek().equals(i)); } assertNull(q.peek()); } | /**
* peek returns next element, or null if empty
*/ | peek returns next element, or null if empty | testPeek | {
"repo_name": "debian-pkg-android-tools/android-platform-libcore",
"path": "jsr166-tests/src/test/java/jsr166/LinkedBlockingDequeTest.java",
"license": "gpl-2.0",
"size": 60349
} | [
"java.util.concurrent.LinkedBlockingDeque"
] | import java.util.concurrent.LinkedBlockingDeque; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 2,288,734 |
Activity find(ActivityID id); | Activity find(ActivityID id); | /**
* Find the information of an activity
* @param id The identifier of the object to be searched
* @return Object with all the information or null if not exists.
*/ | Find the information of an activity | find | {
"repo_name": "UOC/PeLP",
"path": "src/main/java/edu/uoc/pelp/model/dao/IActivityDAO.java",
"license": "gpl-3.0",
"size": 4751
} | [
"edu.uoc.pelp.engine.activity.Activity",
"edu.uoc.pelp.engine.activity.ActivityID"
] | import edu.uoc.pelp.engine.activity.Activity; import edu.uoc.pelp.engine.activity.ActivityID; | import edu.uoc.pelp.engine.activity.*; | [
"edu.uoc.pelp"
] | edu.uoc.pelp; | 607,034 |
@Override
public GatewayGetIPsecParametersResponse getIPsecParametersV2(String gatewayId, String connectedentityId) throws IOException, ServiceException, ParserConfigurationException, SAXException {
// Validate
if (gatewayId == null) {
throw new NullPointerException("gatewayId");
}
if (connectedentityId == null) {
throw new NullPointerException("connectedentityId");
}
// Tracing
boolean shouldTrace = CloudTracing.getIsEnabled();
String invocationId = null;
if (shouldTrace) {
invocationId = Long.toString(CloudTracing.getNextInvocationId());
HashMap<String, Object> tracingParameters = new HashMap<String, Object>();
tracingParameters.put("gatewayId", gatewayId);
tracingParameters.put("connectedentityId", connectedentityId);
CloudTracing.enter(invocationId, this, "getIPsecParametersV2Async", tracingParameters);
}
// Construct URL
String url = "";
url = url + "/";
if (this.getClient().getCredentials().getSubscriptionId() != null) {
url = url + URLEncoder.encode(this.getClient().getCredentials().getSubscriptionId(), "UTF-8");
}
url = url + "/services/networking/virtualnetworkgateways/";
url = url + URLEncoder.encode(gatewayId, "UTF-8");
url = url + "/connectedentity/";
url = url + URLEncoder.encode(connectedentityId, "UTF-8");
url = url + "/ipsecparameters";
String baseUrl = this.getClient().getBaseUri().toString();
// Trim '/' character from the end of baseUrl and beginning of url.
if (baseUrl.charAt(baseUrl.length() - 1) == '/') {
baseUrl = baseUrl.substring(0, (baseUrl.length() - 1) + 0);
}
if (url.charAt(0) == '/') {
url = url.substring(1);
}
url = baseUrl + "/" + url;
url = url.replace(" ", "%20");
// Create HTTP transport objects
HttpGet httpRequest = new HttpGet(url);
// Set Headers
httpRequest.setHeader("x-ms-version", "2015-04-01");
// Send Request
HttpResponse httpResponse = null;
try {
if (shouldTrace) {
CloudTracing.sendRequest(invocationId, httpRequest);
}
httpResponse = this.getClient().getHttpClient().execute(httpRequest);
if (shouldTrace) {
CloudTracing.receiveResponse(invocationId, httpResponse);
}
int statusCode = httpResponse.getStatusLine().getStatusCode();
if (statusCode != HttpStatus.SC_OK) {
ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity());
if (shouldTrace) {
CloudTracing.error(invocationId, ex);
}
throw ex;
}
// Create Result
GatewayGetIPsecParametersResponse result = null;
// Deserialize Response
if (statusCode == HttpStatus.SC_OK) {
InputStream responseContent = httpResponse.getEntity().getContent();
result = new GatewayGetIPsecParametersResponse();
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
documentBuilderFactory.setNamespaceAware(true);
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
Document responseDoc = documentBuilder.parse(new BOMInputStream(responseContent));
Element iPsecParametersElement = XmlUtility.getElementByTagNameNS(responseDoc, "http://schemas.microsoft.com/windowsazure", "IPsecParameters");
if (iPsecParametersElement != null) {
IPsecParameters iPsecParametersInstance = new IPsecParameters();
result.setIPsecParameters(iPsecParametersInstance);
Element encryptionTypeElement = XmlUtility.getElementByTagNameNS(iPsecParametersElement, "http://schemas.microsoft.com/windowsazure", "EncryptionType");
if (encryptionTypeElement != null) {
String encryptionTypeInstance;
encryptionTypeInstance = encryptionTypeElement.getTextContent();
iPsecParametersInstance.setEncryptionType(encryptionTypeInstance);
}
Element pfsGroupElement = XmlUtility.getElementByTagNameNS(iPsecParametersElement, "http://schemas.microsoft.com/windowsazure", "PfsGroup");
if (pfsGroupElement != null) {
String pfsGroupInstance;
pfsGroupInstance = pfsGroupElement.getTextContent();
iPsecParametersInstance.setPfsGroup(pfsGroupInstance);
}
Element sADataSizeKilobytesElement = XmlUtility.getElementByTagNameNS(iPsecParametersElement, "http://schemas.microsoft.com/windowsazure", "SADataSizeKilobytes");
if (sADataSizeKilobytesElement != null) {
int sADataSizeKilobytesInstance;
sADataSizeKilobytesInstance = DatatypeConverter.parseInt(sADataSizeKilobytesElement.getTextContent());
iPsecParametersInstance.setSADataSizeKilobytes(sADataSizeKilobytesInstance);
}
Element sALifeTimeSecondsElement = XmlUtility.getElementByTagNameNS(iPsecParametersElement, "http://schemas.microsoft.com/windowsazure", "SALifeTimeSeconds");
if (sALifeTimeSecondsElement != null) {
int sALifeTimeSecondsInstance;
sALifeTimeSecondsInstance = DatatypeConverter.parseInt(sALifeTimeSecondsElement.getTextContent());
iPsecParametersInstance.setSALifeTimeSeconds(sALifeTimeSecondsInstance);
}
Element hashAlgorithmElement = XmlUtility.getElementByTagNameNS(iPsecParametersElement, "http://schemas.microsoft.com/windowsazure", "HashAlgorithm");
if (hashAlgorithmElement != null) {
String hashAlgorithmInstance;
hashAlgorithmInstance = hashAlgorithmElement.getTextContent();
iPsecParametersInstance.setHashAlgorithm(hashAlgorithmInstance);
}
}
}
result.setStatusCode(statusCode);
if (httpResponse.getHeaders("x-ms-request-id").length > 0) {
result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue());
}
if (shouldTrace) {
CloudTracing.exit(invocationId, result);
}
return result;
} finally {
if (httpResponse != null && httpResponse.getEntity() != null) {
httpResponse.getEntity().getContent().close();
}
}
} | GatewayGetIPsecParametersResponse function(String gatewayId, String connectedentityId) throws IOException, ServiceException, ParserConfigurationException, SAXException { if (gatewayId == null) { throw new NullPointerException(STR); } if (connectedentityId == null) { throw new NullPointerException(STR); } boolean shouldTrace = CloudTracing.getIsEnabled(); String invocationId = null; if (shouldTrace) { invocationId = Long.toString(CloudTracing.getNextInvocationId()); HashMap<String, Object> tracingParameters = new HashMap<String, Object>(); tracingParameters.put(STR, gatewayId); tracingParameters.put(STR, connectedentityId); CloudTracing.enter(invocationId, this, STR, tracingParameters); } String url = STR/STRUTF-8STR/services/networking/virtualnetworkgateways/STRUTF-8STR/connectedentity/STRUTF-8STR/ipsecparametersSTR/STR STR%20STRx-ms-versionSTR2015-04-01STRhttp: if (iPsecParametersElement != null) { IPsecParameters iPsecParametersInstance = new IPsecParameters(); result.setIPsecParameters(iPsecParametersInstance); Element encryptionTypeElement = XmlUtility.getElementByTagNameNS(iPsecParametersElement, STRhttp: if (pfsGroupElement != null) { String pfsGroupInstance; pfsGroupInstance = pfsGroupElement.getTextContent(); iPsecParametersInstance.setPfsGroup(pfsGroupInstance); } Element sADataSizeKilobytesElement = XmlUtility.getElementByTagNameNS(iPsecParametersElement, STRhttp: if (sALifeTimeSecondsElement != null) { int sALifeTimeSecondsInstance; sALifeTimeSecondsInstance = DatatypeConverter.parseInt(sALifeTimeSecondsElement.getTextContent()); iPsecParametersInstance.setSALifeTimeSeconds(sALifeTimeSecondsInstance); } Element hashAlgorithmElement = XmlUtility.getElementByTagNameNS(iPsecParametersElement, STRx-ms-request-idSTRx-ms-request-id").getValue()); } if (shouldTrace) { CloudTracing.exit(invocationId, result); } return result; } finally { if (httpResponse != null && httpResponse.getEntity() != null) { httpResponse.getEntity().getContent().close(); } } } | /**
* The Get IPsec Parameters V2 operation gets the IPsec parameters that have
* been set for the virtual network gateway connection
*
* @param gatewayId Required. The virtual network for this gateway Id.
* @param connectedentityId Required. The connected entity Id.
* @throws IOException Signals that an I/O exception of some sort has
* occurred. This class is the general class of exceptions produced by
* failed or interrupted I/O operations.
* @throws ServiceException Thrown if an unexpected response is found.
* @throws ParserConfigurationException Thrown if there was a serious
* configuration error with the document parser.
* @throws SAXException Thrown if there was an error parsing the XML
* response.
* @return The response that will be returned from a GetIPsecParameters
* request. This contains the IPsec parameters for the specified connection.
*/ | The Get IPsec Parameters V2 operation gets the IPsec parameters that have been set for the virtual network gateway connection | getIPsecParametersV2 | {
"repo_name": "flydream2046/azure-sdk-for-java",
"path": "service-management/azure-svc-mgmt-network/src/main/java/com/microsoft/windowsazure/management/network/GatewayOperationsImpl.java",
"license": "apache-2.0",
"size": 573643
} | [
"com.microsoft.windowsazure.core.utils.XmlUtility",
"com.microsoft.windowsazure.exception.ServiceException",
"com.microsoft.windowsazure.management.network.models.GatewayGetIPsecParametersResponse",
"com.microsoft.windowsazure.management.network.models.IPsecParameters",
"com.microsoft.windowsazure.tracing.CloudTracing",
"java.io.IOException",
"java.util.HashMap",
"javax.xml.bind.DatatypeConverter",
"javax.xml.parsers.ParserConfigurationException",
"org.w3c.dom.Element",
"org.xml.sax.SAXException"
] | import com.microsoft.windowsazure.core.utils.XmlUtility; import com.microsoft.windowsazure.exception.ServiceException; import com.microsoft.windowsazure.management.network.models.GatewayGetIPsecParametersResponse; import com.microsoft.windowsazure.management.network.models.IPsecParameters; import com.microsoft.windowsazure.tracing.CloudTracing; import java.io.IOException; import java.util.HashMap; import javax.xml.bind.DatatypeConverter; import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Element; import org.xml.sax.SAXException; | import com.microsoft.windowsazure.core.utils.*; import com.microsoft.windowsazure.exception.*; import com.microsoft.windowsazure.management.network.models.*; import com.microsoft.windowsazure.tracing.*; import java.io.*; import java.util.*; import javax.xml.bind.*; import javax.xml.parsers.*; import org.w3c.dom.*; import org.xml.sax.*; | [
"com.microsoft.windowsazure",
"java.io",
"java.util",
"javax.xml",
"org.w3c.dom",
"org.xml.sax"
] | com.microsoft.windowsazure; java.io; java.util; javax.xml; org.w3c.dom; org.xml.sax; | 1,499,596 |
public static RenderScript create(Context ctx, ContextType ct) {
int v = ctx.getApplicationInfo().targetSdkVersion;
return create(ctx, v, ct);
} | static RenderScript function(Context ctx, ContextType ct) { int v = ctx.getApplicationInfo().targetSdkVersion; return create(ctx, v, ct); } | /**
* Create a RenderScript context.
*
* @hide
*
* @param ctx The context.
* @param ct The type of context to be created.
* @return RenderScript
*/ | Create a RenderScript context | create | {
"repo_name": "s20121035/rk3288_android5.1_repo",
"path": "frameworks/support/v8/renderscript/java/src/android/support/v8/renderscript/RenderScript.java",
"license": "gpl-3.0",
"size": 43056
} | [
"android.content.Context"
] | import android.content.Context; | import android.content.*; | [
"android.content"
] | android.content; | 2,854,242 |
private void validateRequest(LoginRequest request) throws InvalidLoginException {
if (request == null) {
throw new InvalidLoginException("Login Data is not valid.");
}
if (request.getUsername() == null || request.getUsername().getValue() == null) {
throw new InvalidLoginException("User 'null' is not valid.");
}
if (request.getPassword() == null || request.getPassword().getValue() == null) {
throw new InvalidLoginException("Password 'null' is not valid.");
}
if (request.getTenant() == null || request.getTenant().getValue() == null) {
throw new InvalidLoginException("Tenant 'null' is not valid.");
}
} | void function(LoginRequest request) throws InvalidLoginException { if (request == null) { throw new InvalidLoginException(STR); } if (request.getUsername() == null request.getUsername().getValue() == null) { throw new InvalidLoginException(STR); } if (request.getPassword() == null request.getPassword().getValue() == null) { throw new InvalidLoginException(STR); } if (request.getTenant() == null request.getTenant().getValue() == null) { throw new InvalidLoginException(STR); } } | /**
* Validate the login request.
*
* @param request
* the JSON request
*
* @throws InvalidLoginException
* when the request parameter is not valid
*/ | Validate the login request | validateRequest | {
"repo_name": "NABUCCO/org.nabucco.framework.common.authorization",
"path": "org.nabucco.framework.common.authorization.ui.web/src/main/man/org/nabucco/framework/common/authorization/ui/web/AuthorizationLoginServlet.java",
"license": "epl-1.0",
"size": 8029
} | [
"org.nabucco.framework.base.facade.datatype.ui.login.LoginRequest",
"org.nabucco.framework.base.facade.exception.security.InvalidLoginException"
] | import org.nabucco.framework.base.facade.datatype.ui.login.LoginRequest; import org.nabucco.framework.base.facade.exception.security.InvalidLoginException; | import org.nabucco.framework.base.facade.datatype.ui.login.*; import org.nabucco.framework.base.facade.exception.security.*; | [
"org.nabucco.framework"
] | org.nabucco.framework; | 1,686,396 |
@javax.annotation.Nullable
@ApiModelProperty(
value =
"matchExpressions is a list of label selector requirements. The requirements are ANDed.")
public List<V1ServiceMonitorSpecSelectorMatchExpressions> getMatchExpressions() {
return matchExpressions;
} | @javax.annotation.Nullable @ApiModelProperty( value = STR) List<V1ServiceMonitorSpecSelectorMatchExpressions> function() { return matchExpressions; } | /**
* matchExpressions is a list of label selector requirements. The requirements are ANDed.
*
* @return matchExpressions
*/ | matchExpressions is a list of label selector requirements. The requirements are ANDed | getMatchExpressions | {
"repo_name": "kubernetes-client/java",
"path": "client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecStorageVolumeClaimTemplateSpecSelector.java",
"license": "apache-2.0",
"size": 5600
} | [
"io.swagger.annotations.ApiModelProperty",
"java.util.List"
] | import io.swagger.annotations.ApiModelProperty; import java.util.List; | import io.swagger.annotations.*; import java.util.*; | [
"io.swagger.annotations",
"java.util"
] | io.swagger.annotations; java.util; | 1,538,765 |
public void getIndex(int[] val) {
if ( index == null ) {
index = (MFInt32)getField( "index" );
}
index.getValue( val );
} | void function(int[] val) { if ( index == null ) { index = (MFInt32)getField( "index" ); } index.getValue( val ); } | /** Return the index value in the argument int[]
* @param val The int[] to initialize. */ | Return the index value in the argument int[] | getIndex | {
"repo_name": "Norkart/NK-VirtualGlobe",
"path": "Xj3D/src/java/org/xj3d/sai/internal/node/rendering/SAIIndexedTriangleSet.java",
"license": "gpl-2.0",
"size": 8912
} | [
"org.web3d.x3d.sai.MFInt32"
] | import org.web3d.x3d.sai.MFInt32; | import org.web3d.x3d.sai.*; | [
"org.web3d.x3d"
] | org.web3d.x3d; | 1,261,896 |
public V1Status deleteNamespacedRole(
String name,
String namespace,
String pretty,
String dryRun,
Integer gracePeriodSeconds,
Boolean orphanDependents,
String propagationPolicy,
V1DeleteOptions body)
throws ApiException {
ApiResponse<V1Status> localVarResp =
deleteNamespacedRoleWithHttpInfo(
name,
namespace,
pretty,
dryRun,
gracePeriodSeconds,
orphanDependents,
propagationPolicy,
body);
return localVarResp.getData();
} | V1Status function( String name, String namespace, String pretty, String dryRun, Integer gracePeriodSeconds, Boolean orphanDependents, String propagationPolicy, V1DeleteOptions body) throws ApiException { ApiResponse<V1Status> localVarResp = deleteNamespacedRoleWithHttpInfo( name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body); return localVarResp.getData(); } | /**
* delete a Role
*
* @param name name of the Role (required)
* @param namespace object name and auth scope, such as for teams and projects (required)
* @param pretty If 'true', then the output is pretty printed. (optional)
* @param dryRun When present, indicates that modifications should not be persisted. An invalid or
* unrecognized dryRun directive will result in an error response and no further processing of
* the request. Valid values are: - All: all dry run stages will be processed (optional)
* @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value
* must be non-negative integer. The value zero indicates delete immediately. If this value is
* nil, the default grace period for the specified type will be used. Defaults to a per object
* value if not specified. zero means delete immediately. (optional)
* @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be
* deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the
* \"orphan\" finalizer will be added to/removed from the object's finalizers
* list. Either this field or PropagationPolicy may be set, but not both. (optional)
* @param propagationPolicy Whether and how garbage collection will be performed. Either this
* field or OrphanDependents may be set, but not both. The default policy is decided by the
* existing finalizer set in the metadata.finalizers and the resource-specific default policy.
* Acceptable values are: 'Orphan' - orphan the dependents; 'Background' -
* allow the garbage collector to delete the dependents in the background;
* 'Foreground' - a cascading policy that deletes all dependents in the foreground.
* (optional)
* @param body (optional)
* @return V1Status
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the
* response body
* @http.response.details
* <table summary="Response Details" border="1">
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
* <tr><td> 202 </td><td> Accepted </td><td> - </td></tr>
* <tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr>
* </table>
*/ | delete a Role | deleteNamespacedRole | {
"repo_name": "kubernetes-client/java",
"path": "kubernetes/src/main/java/io/kubernetes/client/openapi/apis/RbacAuthorizationV1Api.java",
"license": "apache-2.0",
"size": 563123
} | [
"io.kubernetes.client.openapi.ApiException",
"io.kubernetes.client.openapi.ApiResponse",
"io.kubernetes.client.openapi.models.V1DeleteOptions",
"io.kubernetes.client.openapi.models.V1Status"
] | import io.kubernetes.client.openapi.ApiException; import io.kubernetes.client.openapi.ApiResponse; import io.kubernetes.client.openapi.models.V1DeleteOptions; import io.kubernetes.client.openapi.models.V1Status; | import io.kubernetes.client.openapi.*; import io.kubernetes.client.openapi.models.*; | [
"io.kubernetes.client"
] | io.kubernetes.client; | 2,509,457 |
@MXBeanDescription("Threads priority.")
public int getThreadPriority(); | @MXBeanDescription(STR) int function(); | /**
* Gets thread priority. All threads within SPI will be started with it.
*
* @return Thread priority.
*/ | Gets thread priority. All threads within SPI will be started with it | getThreadPriority | {
"repo_name": "ilantukh/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiMBean.java",
"license": "apache-2.0",
"size": 8612
} | [
"org.apache.ignite.mxbean.MXBeanDescription"
] | import org.apache.ignite.mxbean.MXBeanDescription; | import org.apache.ignite.mxbean.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 443,060 |
public DatabaseReference getRatSpotting(String ratID) {
Log.d(LOG_ID, "Querying Firebase to look for ratspotting with id: " + ratID);
return mDatabase.child(ratID);
} | DatabaseReference function(String ratID) { Log.d(LOG_ID, STR + ratID); return mDatabase.child(ratID); } | /**
* getRatSpotting - obtains a ratspotting based on a unique ID
* @param ratID the unique ID of the ratspotting we are looking for
* @return the database reference to the rat spotting we are looking for
*/ | getRatSpotting - obtains a ratspotting based on a unique ID | getRatSpotting | {
"repo_name": "Zighome24/CS2340_GoGreek",
"path": "app/RatTracker2k17/app/src/main/java/edu/gatech/cs2340/rattracker2k17/Service/RatSpottingBL.java",
"license": "mit",
"size": 5734
} | [
"android.util.Log",
"com.google.firebase.database.DatabaseReference"
] | import android.util.Log; import com.google.firebase.database.DatabaseReference; | import android.util.*; import com.google.firebase.database.*; | [
"android.util",
"com.google.firebase"
] | android.util; com.google.firebase; | 2,112,361 |
public static LinkDescription descriptionOf(
ConnectPoint src, ConnectPoint dst, BasicLinkConfig link) {
checkNotNull(src, "Must supply a source endpoint");
checkNotNull(dst, "Must supply a destination endpoint");
checkNotNull(link, "Must supply a link config");
// Only allowed link is expected link
boolean expected = link.isAllowed();
return new DefaultLinkDescription(
src, dst, link.type(),
expected,
combine(link, DefaultAnnotations.EMPTY));
} | static LinkDescription function( ConnectPoint src, ConnectPoint dst, BasicLinkConfig link) { checkNotNull(src, STR); checkNotNull(dst, STR); checkNotNull(link, STR); boolean expected = link.isAllowed(); return new DefaultLinkDescription( src, dst, link.type(), expected, combine(link, DefaultAnnotations.EMPTY)); } | /**
* Generates a link description from a link config entity. This is for
* links that cannot be discovered and has to be injected. The endpoints
* must be specified to indicate directionality.
*
* @param src the source ConnectPoint
* @param dst the destination ConnectPoint
* @param link the link config entity
* @return a linkDescription based on the config
*/ | Generates a link description from a link config entity. This is for links that cannot be discovered and has to be injected. The endpoints must be specified to indicate directionality | descriptionOf | {
"repo_name": "gkatsikas/onos",
"path": "core/net/src/main/java/org/onosproject/net/link/impl/BasicLinkOperator.java",
"license": "apache-2.0",
"size": 6820
} | [
"com.google.common.base.Preconditions",
"org.onosproject.net.ConnectPoint",
"org.onosproject.net.DefaultAnnotations",
"org.onosproject.net.config.basics.BasicLinkConfig",
"org.onosproject.net.link.DefaultLinkDescription",
"org.onosproject.net.link.LinkDescription"
] | import com.google.common.base.Preconditions; import org.onosproject.net.ConnectPoint; import org.onosproject.net.DefaultAnnotations; import org.onosproject.net.config.basics.BasicLinkConfig; import org.onosproject.net.link.DefaultLinkDescription; import org.onosproject.net.link.LinkDescription; | import com.google.common.base.*; import org.onosproject.net.*; import org.onosproject.net.config.basics.*; import org.onosproject.net.link.*; | [
"com.google.common",
"org.onosproject.net"
] | com.google.common; org.onosproject.net; | 546,039 |
@JsonView(Views.Detail.class)
public String getCity() {
return city;
} | @JsonView(Views.Detail.class) String function() { return city; } | /**
* Returns the city.
*
* @return
*/ | Returns the city | getCity | {
"repo_name": "redlion99/akstore",
"path": "akstore-server/akstore-common/src/main/java/me/smartco/akstore/common/model/Address.java",
"license": "apache-2.0",
"size": 1785
} | [
"com.fasterxml.jackson.annotation.JsonView"
] | import com.fasterxml.jackson.annotation.JsonView; | import com.fasterxml.jackson.annotation.*; | [
"com.fasterxml.jackson"
] | com.fasterxml.jackson; | 1,016,257 |
protected void generateFASTA(String directory, String outputFileName, String dnaSequence) throws IOException{
String fasta = ">\n"+dnaSequence+"\n";
TextFile.write(directory, outputFileName, fasta);
} | void function(String directory, String outputFileName, String dnaSequence) throws IOException{ String fasta = ">\n"+dnaSequence+"\n"; TextFile.write(directory, outputFileName, fasta); } | /**
* Method for generating and printing a FASTA file from a given DNA sequence.
*
* @param directory The directory to which the file will be printed
* @param outputFileName The desired file to be produced, ensure it ends with .fasta
* @param dnaSequence The desired sequence to made into a .fasta file
* @throws IOException
*/ | Method for generating and printing a FASTA file from a given DNA sequence | generateFASTA | {
"repo_name": "CIDARLAB/magelet",
"path": "src/magelets/Magelet.java",
"license": "bsd-3-clause",
"size": 5977
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,060,386 |
private static boolean hasParentInList(ReportBean reportBean, Map<Integer, ReportBean> reportBeansMap) {
Integer parentID = reportBean.getWorkItemBean().getSuperiorworkitem();
if (parentID==null) {
return false;
}
return reportBeansMap.containsKey(parentID);
} | static boolean function(ReportBean reportBean, Map<Integer, ReportBean> reportBeansMap) { Integer parentID = reportBean.getWorkItemBean().getSuperiorworkitem(); if (parentID==null) { return false; } return reportBeansMap.containsKey(parentID); } | /**
* Check if the item has a parent in the hashtable
* @param reportBean
* @return
*/ | Check if the item has a parent in the hashtable | hasParentInList | {
"repo_name": "trackplus/Genji",
"path": "src/main/java/com/aurel/track/report/execute/ReportBeansBL.java",
"license": "gpl-3.0",
"size": 17140
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 44,027 |
public Map<String, String> cookies();
} | Map<String, String> function(); } | /**
* Retrieve all of the request/response cookies as a map
* @return cookies
*/ | Retrieve all of the request/response cookies as a map | cookies | {
"repo_name": "jgimenez/factura-simyo",
"path": "src/org/jsoup/Connection.java",
"license": "apache-2.0",
"size": 14278
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,194,189 |
public static Schema getClassSchema() {
return schema$;
}
public static final class Options {
public static final String RESOURCE_GROUP = "resource_group";
public static final String DEFAULT_SCHEMA = "default_schema";
public static final String CREATE_HOME_DIRECTORY = "create_home_directory";
public static final String TRUE = "true";
public static final String FALSE = "false";
private Options() { }
}
private String name;
private String password;
private Map<String, String> options;
public CreateUserInternalRequest() {
name = "";
password = "";
options = new LinkedHashMap<>();
}
public CreateUserInternalRequest(String name, String password, Map<String, String> options) {
this.name = (name == null) ? "" : name;
this.password = (password == null) ? "" : password;
this.options = (options == null) ? new LinkedHashMap<String, String>() : options;
} | static Schema function() { return schema$; } public static final class Options { public static final String RESOURCE_GROUP = STR; public static final String DEFAULT_SCHEMA = STR; public static final String CREATE_HOME_DIRECTORY = STR; public static final String TRUE = "true"; public static final String FALSE = "false"; private Options() { } } private String name; private String password; private Map<String, String> options; public CreateUserInternalRequest() { name = STRSTRSTR" : password; this.options = (options == null) ? new LinkedHashMap<String, String>() : options; } | /**
* This method supports the Avro framework and is not intended to be called
* directly by the user.
*
* @return the schema for the class.
*
*/ | This method supports the Avro framework and is not intended to be called directly by the user | getClassSchema | {
"repo_name": "kineticadb/kinetica-api-java",
"path": "api/src/main/java/com/gpudb/protocol/CreateUserInternalRequest.java",
"license": "mit",
"size": 13837
} | [
"java.util.LinkedHashMap",
"java.util.Map",
"org.apache.avro.Schema"
] | import java.util.LinkedHashMap; import java.util.Map; import org.apache.avro.Schema; | import java.util.*; import org.apache.avro.*; | [
"java.util",
"org.apache.avro"
] | java.util; org.apache.avro; | 301,348 |
public void zoom(final double xmin, final double xmax, final double ymin, final double ymax) {
this.m_zoomArea = null;
IAxis<?> axisX = this.getAxisX();
IRangePolicy zoomPolicyX = new RangePolicyFixedViewport(new Range(xmin, xmax));
axisX.setRangePolicy(zoomPolicyX);
IAxis<?> axisY = this.getAxisY();
IRangePolicy zoomPolicyY = new RangePolicyFixedViewport(new Range(ymin, ymax));
axisY.setRangePolicy(zoomPolicyY);
} | void function(final double xmin, final double xmax, final double ymin, final double ymax) { this.m_zoomArea = null; IAxis<?> axisX = this.getAxisX(); IRangePolicy zoomPolicyX = new RangePolicyFixedViewport(new Range(xmin, xmax)); axisX.setRangePolicy(zoomPolicyX); IAxis<?> axisY = this.getAxisY(); IRangePolicy zoomPolicyY = new RangePolicyFixedViewport(new Range(ymin, ymax)); axisY.setRangePolicy(zoomPolicyY); } | /**
* Zooms to the selected bounds in both directions.
* <p>
*
* @param xmin
* the lower x bound (value of chart (vs. pixel of screen)).
*
* @param xmax
* the upper x bound (value of chart (vs. pixel of screen)).
*
* @param ymin
* the lower y bound (value of chart (vs. pixel of screen)).
*
* @param ymax
* the upper y bound (value of chart (vs. pixel of screen)).
*/ | Zooms to the selected bounds in both directions. | zoom | {
"repo_name": "cheshirekow/codebase",
"path": "third_party/lcm/lcm-java/jchart2d-code/src/info/monitorenter/gui/chart/ZoomableChart.java",
"license": "gpl-3.0",
"size": 10007
} | [
"info.monitorenter.gui.chart.rangepolicies.RangePolicyFixedViewport",
"info.monitorenter.util.Range"
] | import info.monitorenter.gui.chart.rangepolicies.RangePolicyFixedViewport; import info.monitorenter.util.Range; | import info.monitorenter.gui.chart.rangepolicies.*; import info.monitorenter.util.*; | [
"info.monitorenter.gui",
"info.monitorenter.util"
] | info.monitorenter.gui; info.monitorenter.util; | 420,631 |
private TemporalEdge createEdge(String label, Identifiable source, Identifiable target, long txFrom,
long txTo, long validFrom, long validTo) {
TemporalEdge edge = getConfig().getTemporalGraphFactory().getEdgeFactory()
.createEdge(source.getId(), target.getId());
edge.setLabel(label);
edge.setTransactionTime(Tuple2.of(txFrom, txTo));
edge.setValidTime(Tuple2.of(validFrom, validTo));
return edge;
} | TemporalEdge function(String label, Identifiable source, Identifiable target, long txFrom, long txTo, long validFrom, long validTo) { TemporalEdge edge = getConfig().getTemporalGraphFactory().getEdgeFactory() .createEdge(source.getId(), target.getId()); edge.setLabel(label); edge.setTransactionTime(Tuple2.of(txFrom, txTo)); edge.setValidTime(Tuple2.of(validFrom, validTo)); return edge; } | /**
* Create a temporal edge with temporal attributes set.
*
* @param label The label of the edge.
* @param source The element used as a source for the edge.
* @param target The element used as a target for the edge.
* @param txFrom The start of the transaction time.
* @param txTo The end of the transaction time.
* @param validFrom The start of the valid time.
* @param validTo The end of the valid time.
* @return A temporal edge with those times set.
*/ | Create a temporal edge with temporal attributes set | createEdge | {
"repo_name": "galpha/gradoop",
"path": "gradoop-temporal/src/test/java/org/gradoop/temporal/util/TemporalGradoopTestBase.java",
"license": "apache-2.0",
"size": 17929
} | [
"org.apache.flink.api.java.tuple.Tuple2",
"org.gradoop.common.model.api.entities.Identifiable",
"org.gradoop.temporal.model.impl.pojo.TemporalEdge"
] | import org.apache.flink.api.java.tuple.Tuple2; import org.gradoop.common.model.api.entities.Identifiable; import org.gradoop.temporal.model.impl.pojo.TemporalEdge; | import org.apache.flink.api.java.tuple.*; import org.gradoop.common.model.api.entities.*; import org.gradoop.temporal.model.impl.pojo.*; | [
"org.apache.flink",
"org.gradoop.common",
"org.gradoop.temporal"
] | org.apache.flink; org.gradoop.common; org.gradoop.temporal; | 808,698 |
public Subject newSubject(final String nameIdFormat, final String nameIdValue,
final String recipient, final ZonedDateTime notOnOrAfter,
final String inResponseTo) {
LOGGER.debug("Building subject for NameID [{}]/[{}] and recipient [{}], in response to [{}]",
nameIdValue, nameIdFormat, recipient, inResponseTo);
final SubjectConfirmation confirmation = newSamlObject(SubjectConfirmation.class);
confirmation.setMethod(SubjectConfirmation.METHOD_BEARER);
final SubjectConfirmationData data = newSamlObject(SubjectConfirmationData.class);
data.setRecipient(recipient);
data.setNotOnOrAfter(DateTimeUtils.dateTimeOf(notOnOrAfter));
data.setInResponseTo(inResponseTo);
if (StringUtils.isNotBlank(inResponseTo)) {
final String ip = InetAddressUtils.getByName(inResponseTo);
if (StringUtils.isNotBlank(ip)) {
data.setAddress(ip);
}
}
confirmation.setSubjectConfirmationData(data);
final Subject subject = newSamlObject(Subject.class);
subject.setNameID(getNameID(nameIdFormat, nameIdValue));
subject.getSubjectConfirmations().add(confirmation);
LOGGER.debug("Built subject [{}]", subject);
return subject;
} | Subject function(final String nameIdFormat, final String nameIdValue, final String recipient, final ZonedDateTime notOnOrAfter, final String inResponseTo) { LOGGER.debug(STR, nameIdValue, nameIdFormat, recipient, inResponseTo); final SubjectConfirmation confirmation = newSamlObject(SubjectConfirmation.class); confirmation.setMethod(SubjectConfirmation.METHOD_BEARER); final SubjectConfirmationData data = newSamlObject(SubjectConfirmationData.class); data.setRecipient(recipient); data.setNotOnOrAfter(DateTimeUtils.dateTimeOf(notOnOrAfter)); data.setInResponseTo(inResponseTo); if (StringUtils.isNotBlank(inResponseTo)) { final String ip = InetAddressUtils.getByName(inResponseTo); if (StringUtils.isNotBlank(ip)) { data.setAddress(ip); } } confirmation.setSubjectConfirmationData(data); final Subject subject = newSamlObject(Subject.class); subject.setNameID(getNameID(nameIdFormat, nameIdValue)); subject.getSubjectConfirmations().add(confirmation); LOGGER.debug(STR, subject); return subject; } | /**
* New subject element.
*
* @param nameIdFormat the name id format
* @param nameIdValue the name id value
* @param recipient the recipient
* @param notOnOrAfter the not on or after
* @param inResponseTo the in response to
* @return the subject
*/ | New subject element | newSubject | {
"repo_name": "pmarasse/cas",
"path": "support/cas-server-support-saml/src/main/java/org/apereo/cas/support/saml/util/AbstractSaml20ObjectBuilder.java",
"license": "apache-2.0",
"size": 16781
} | [
"java.time.ZonedDateTime",
"org.apache.commons.lang3.StringUtils",
"org.apereo.cas.util.DateTimeUtils",
"org.apereo.cas.util.InetAddressUtils",
"org.opensaml.saml.saml2.core.Subject",
"org.opensaml.saml.saml2.core.SubjectConfirmation",
"org.opensaml.saml.saml2.core.SubjectConfirmationData"
] | import java.time.ZonedDateTime; import org.apache.commons.lang3.StringUtils; import org.apereo.cas.util.DateTimeUtils; import org.apereo.cas.util.InetAddressUtils; import org.opensaml.saml.saml2.core.Subject; import org.opensaml.saml.saml2.core.SubjectConfirmation; import org.opensaml.saml.saml2.core.SubjectConfirmationData; | import java.time.*; import org.apache.commons.lang3.*; import org.apereo.cas.util.*; import org.opensaml.saml.saml2.core.*; | [
"java.time",
"org.apache.commons",
"org.apereo.cas",
"org.opensaml.saml"
] | java.time; org.apache.commons; org.apereo.cas; org.opensaml.saml; | 505,140 |
public Boolean removeServiceProvider(
String authToken,
String serviceProviderUUID)
throws SemanticRegistryMalformedInputException,
SemanticRegistryAuthException,
SemanticRegistryCommunicationException,
SemanticRegistryException
{
// Remove leading and trailing whitespaces from values to be used as keys
authToken = authToken.trim();
serviceProviderUUID = serviceProviderUUID.trim();
if (InputValidator.isAuthenticationTokenWellFormed(authToken)
&& InputValidator.isUUIDKeyWellFormed(serviceProviderUUID))
{
//The authToken key has been asserted to be valid, but should also have the proper prefix
if (authToken.length() == 36) authToken = "authToken:".concat(authToken);
try
{
proxy.delete_business(authToken, serviceProviderUUID);
}
catch (UDDIException e)
{
DispositionReport dr = e.getDispositionReport();
if (dr != null)
{
Vector results = dr.getResultVector();
for (int i = 0; i < results.size(); i++)
{
Result r = (Result) results.elementAt(i);
System.out
.println("The UDDI server raised an exception with error number: "
+ r.getErrno());
if (r.getErrInfo().getErrCode().equals("E_authTokenRequired"))
{
System.out
.println("E_authTokenRequired: (10120) The authentication token is invalid");
throw new SemanticRegistryAuthException(
"The authentication token is invalid");
}
if (r.getErrInfo().getErrCode().equals("E_authTokenExpired"))
{
System.out
.println("E_invalidKeyPassed: (10110) The authentication token has timed out");
throw new SemanticRegistryAuthException(
"The authentication token has timed out");
}
if (r.getErrInfo().getErrCode().equals("E_invalidKeyPassed"))
{
System.out
.println("E_invalidKeyPassed: (10210) The uuid_key did not match any known key values");
throw new SemanticRegistryException(
"One or more UUID keys do not match any known values");
}
throw new SemanticRegistryException("UDDI exception with error number: "
+ r.getErrno());
}
}
else
{
System.out.println(
"The UDDI server reported an internal error but did not provide a Disposition Report " +
"to explain its cause. The problem resulted while trying to invoke the 'delete_business' " +
"operation, and the cause of the problem may be in the data provided (e.g. some parameter " +
"value exceeding max character length), in a failure to communicate with the UDDI server, " +
"or in a failure to communicate with the database that the UDDI server relies on.");
throw new SemanticRegistryCommunicationException(
"The UDDI server reported an internal error but did not provide a Disposition Report " +
"to explain its cause. The problem resulted while trying to invoke the 'delete_business' " +
"operation, and the cause of the problem may be in the data provided (e.g. some parameter " +
"value exceeding max character length), in a failure to communicate with the UDDI server, " +
"or in a failure to communicate with the database that the UDDI server relies on.");
}
}
catch (TransportException e)
{
System.out.println("TransportException occured!");
throw new SemanticRegistryCommunicationException(
"Problem communicating with the UDDI server");
}
catch (Exception e)
{
System.out.println("SemanticRegistryException occured!");
throw new SemanticRegistryException("An exception occured for unspecified reasons");
}
// If all goes well
return true;
} // endif input is well-formed
else
{
System.out.println("SemanticRegistryMalformedInputException occured!");
if (!InputValidator.isAuthenticationTokenWellFormed(authToken)) throw new SemanticRegistryMalformedInputException(
"Input parameter value 'authToken' is malformed");
if (!InputValidator.isUUIDKeyWellFormed(serviceProviderUUID)) throw new SemanticRegistryMalformedInputException(
"Input parameter value 'serviceProviderUUID' is malformed");
throw new SemanticRegistryMalformedInputException(
"One or more input parameter values are malformed");
}
}
| Boolean function( String authToken, String serviceProviderUUID) throws SemanticRegistryMalformedInputException, SemanticRegistryAuthException, SemanticRegistryCommunicationException, SemanticRegistryException { authToken = authToken.trim(); serviceProviderUUID = serviceProviderUUID.trim(); if (InputValidator.isAuthenticationTokenWellFormed(authToken) && InputValidator.isUUIDKeyWellFormed(serviceProviderUUID)) { if (authToken.length() == 36) authToken = STR.concat(authToken); try { proxy.delete_business(authToken, serviceProviderUUID); } catch (UDDIException e) { DispositionReport dr = e.getDispositionReport(); if (dr != null) { Vector results = dr.getResultVector(); for (int i = 0; i < results.size(); i++) { Result r = (Result) results.elementAt(i); System.out .println(STR + r.getErrno()); if (r.getErrInfo().getErrCode().equals(STR)) { System.out .println(STR); throw new SemanticRegistryAuthException( STR); } if (r.getErrInfo().getErrCode().equals(STR)) { System.out .println(STR); throw new SemanticRegistryAuthException( STR); } if (r.getErrInfo().getErrCode().equals(STR)) { System.out .println(STR); throw new SemanticRegistryException( STR); } throw new SemanticRegistryException(STR + r.getErrno()); } } else { System.out.println( STR + STR + STR + STR + STR); throw new SemanticRegistryCommunicationException( STR + STR + STR + STR + STR); } } catch (TransportException e) { System.out.println(STR); throw new SemanticRegistryCommunicationException( STR); } catch (Exception e) { System.out.println(STR); throw new SemanticRegistryException(STR); } return true; } else { System.out.println(STR); if (!InputValidator.isAuthenticationTokenWellFormed(authToken)) throw new SemanticRegistryMalformedInputException( STR); if (!InputValidator.isUUIDKeyWellFormed(serviceProviderUUID)) throw new SemanticRegistryMalformedInputException( STR); throw new SemanticRegistryMalformedInputException( STR); } } | /**
* Deletes a Service Provider record from the UDDI server. In UDDI, a
* Service Provider is represented as a businessEntity element. Before
* proceeding, the values of all provided input parameters are validated.
*
* @param authToken
* @param serviceProviderUUID
* @return
* @throws SemanticRegistryMalformedInputException
* @throws SemanticRegistryAuthException
* @throws SemanticRegistryCommunicationException
* @throws SemanticRegistryException
*/ | Deletes a Service Provider record from the UDDI server. In UDDI, a Service Provider is represented as a businessEntity element. Before proceeding, the values of all provided input parameters are validated | removeServiceProvider | {
"repo_name": "dkourtesis/fusion-semantic-registry",
"path": "src/org/seerc/fusion/sr/core/PublicationHandler.java",
"license": "apache-2.0",
"size": 130142
} | [
"java.util.Vector",
"org.seerc.fusion.sr.exceptions.SemanticRegistryAuthException",
"org.seerc.fusion.sr.exceptions.SemanticRegistryCommunicationException",
"org.seerc.fusion.sr.exceptions.SemanticRegistryException",
"org.seerc.fusion.sr.exceptions.SemanticRegistryMalformedInputException",
"org.uddi4j.UDDIException",
"org.uddi4j.response.DispositionReport",
"org.uddi4j.response.Result",
"org.uddi4j.transport.TransportException"
] | import java.util.Vector; import org.seerc.fusion.sr.exceptions.SemanticRegistryAuthException; import org.seerc.fusion.sr.exceptions.SemanticRegistryCommunicationException; import org.seerc.fusion.sr.exceptions.SemanticRegistryException; import org.seerc.fusion.sr.exceptions.SemanticRegistryMalformedInputException; import org.uddi4j.UDDIException; import org.uddi4j.response.DispositionReport; import org.uddi4j.response.Result; import org.uddi4j.transport.TransportException; | import java.util.*; import org.seerc.fusion.sr.exceptions.*; import org.uddi4j.*; import org.uddi4j.response.*; import org.uddi4j.transport.*; | [
"java.util",
"org.seerc.fusion",
"org.uddi4j",
"org.uddi4j.response",
"org.uddi4j.transport"
] | java.util; org.seerc.fusion; org.uddi4j; org.uddi4j.response; org.uddi4j.transport; | 597,041 |
@Override
public void onAction(final Player player, final RPAction action) {
ActionData data = new ActionData();
if (!VALIDATION.validateAndInformPlayer(player, action, data)) {
return;
}
Entity entity = data.getEntity();
if (entity != null) {
String name = entity.get(TYPE);
if (entity.has(NAME)) {
name = entity.get(NAME);
}
new GameEvent(player.getName(), LOOK, name).raise();
final String text = entity.describe();
if (entity.has(Actions.ACTION) && entity.get(Actions.ACTION).equals(Actions.READ)) {
player.sendPrivateText(NotificationType.RESPONSE, text);
} else {
player.sendPrivateText(text);
}
player.notifyWorldAboutChanges();
}
} | void function(final Player player, final RPAction action) { ActionData data = new ActionData(); if (!VALIDATION.validateAndInformPlayer(player, action, data)) { return; } Entity entity = data.getEntity(); if (entity != null) { String name = entity.get(TYPE); if (entity.has(NAME)) { name = entity.get(NAME); } new GameEvent(player.getName(), LOOK, name).raise(); final String text = entity.describe(); if (entity.has(Actions.ACTION) && entity.get(Actions.ACTION).equals(Actions.READ)) { player.sendPrivateText(NotificationType.RESPONSE, text); } else { player.sendPrivateText(text); } player.notifyWorldAboutChanges(); } } | /**
* processes the requested action.
*
* @param player the caller of the action
* @param action the action to be performed
*/ | processes the requested action | onAction | {
"repo_name": "AntumDeluge/arianne-stendhal",
"path": "src/games/stendhal/server/actions/query/LookAction.java",
"license": "gpl-2.0",
"size": 3092
} | [
"games.stendhal.common.NotificationType",
"games.stendhal.common.constants.Actions",
"games.stendhal.server.actions.validator.ActionData",
"games.stendhal.server.core.engine.GameEvent",
"games.stendhal.server.entity.Entity",
"games.stendhal.server.entity.player.Player"
] | import games.stendhal.common.NotificationType; import games.stendhal.common.constants.Actions; import games.stendhal.server.actions.validator.ActionData; import games.stendhal.server.core.engine.GameEvent; import games.stendhal.server.entity.Entity; import games.stendhal.server.entity.player.Player; | import games.stendhal.common.*; import games.stendhal.common.constants.*; import games.stendhal.server.actions.validator.*; import games.stendhal.server.core.engine.*; import games.stendhal.server.entity.*; import games.stendhal.server.entity.player.*; | [
"games.stendhal.common",
"games.stendhal.server"
] | games.stendhal.common; games.stendhal.server; | 2,269,687 |
@EventHandler
public void init(FMLInitializationEvent event) {
proxy.initRenderHandlersAndIDs();
BiomeGenTropicraft.registerBiomes();
TCEntityRegistry.init();
proxy.initRenderRegistry();
MinecraftForge.EVENT_BUS.register(new TCBlockEvents());
MinecraftForge.EVENT_BUS.register(new TCItemEvents());
TCMiscEvents misc = new TCMiscEvents();
MinecraftForge.EVENT_BUS.register(misc);
FMLCommonHandler.instance().bus().register(misc);
GameRegistry.registerWorldGenerator(new TCWorldGenerator(), 10);
TropicraftWorldUtils.initializeDimension();
}
| void function(FMLInitializationEvent event) { proxy.initRenderHandlersAndIDs(); BiomeGenTropicraft.registerBiomes(); TCEntityRegistry.init(); proxy.initRenderRegistry(); MinecraftForge.EVENT_BUS.register(new TCBlockEvents()); MinecraftForge.EVENT_BUS.register(new TCItemEvents()); TCMiscEvents misc = new TCMiscEvents(); MinecraftForge.EVENT_BUS.register(misc); FMLCommonHandler.instance().bus().register(misc); GameRegistry.registerWorldGenerator(new TCWorldGenerator(), 10); TropicraftWorldUtils.initializeDimension(); } | /**
* Called on initialization
* @param event
*/ | Called on initialization | init | {
"repo_name": "cbaakman/Tropicraft",
"path": "src/main/java/net/tropicraft/Tropicraft.java",
"license": "mpl-2.0",
"size": 4393
} | [
"net.minecraftforge.common.MinecraftForge",
"net.tropicraft.event.TCBlockEvents",
"net.tropicraft.event.TCItemEvents",
"net.tropicraft.event.TCMiscEvents",
"net.tropicraft.registry.TCEntityRegistry",
"net.tropicraft.util.TropicraftWorldUtils",
"net.tropicraft.world.TCWorldGenerator",
"net.tropicraft.world.biomes.BiomeGenTropicraft"
] | import net.minecraftforge.common.MinecraftForge; import net.tropicraft.event.TCBlockEvents; import net.tropicraft.event.TCItemEvents; import net.tropicraft.event.TCMiscEvents; import net.tropicraft.registry.TCEntityRegistry; import net.tropicraft.util.TropicraftWorldUtils; import net.tropicraft.world.TCWorldGenerator; import net.tropicraft.world.biomes.BiomeGenTropicraft; | import net.minecraftforge.common.*; import net.tropicraft.event.*; import net.tropicraft.registry.*; import net.tropicraft.util.*; import net.tropicraft.world.*; import net.tropicraft.world.biomes.*; | [
"net.minecraftforge.common",
"net.tropicraft.event",
"net.tropicraft.registry",
"net.tropicraft.util",
"net.tropicraft.world"
] | net.minecraftforge.common; net.tropicraft.event; net.tropicraft.registry; net.tropicraft.util; net.tropicraft.world; | 1,757,393 |
public static List<String> sendShell(String command, Result result)
throws IOException, InterruptedException, RootToolsException {
return sendShell(new String[] { command }, 0, result );
} | static List<String> function(String command, Result result) throws IOException, InterruptedException, RootToolsException { return sendShell(new String[] { command }, 0, result ); } | /**
* Sends one shell command as su (attempts to)
*
* @param command command to send to the shell
*
* @param result injected result object that implements the Result class
*
* @return a <code>LinkedList</code> containing each line that was returned
* by the shell after executing or while trying to execute the given commands.
* You must iterate over this list, it does not allow random access,
* so no specifying an index of an item you want,
* not like you're going to know that anyways.
*
* @throws InterruptedException
*
* @throws IOException
*
* @throws RootToolsException
*/ | Sends one shell command as su (attempts to) | sendShell | {
"repo_name": "universsky/diddler",
"path": "src/com/stericson/RootTools/RootTools.java",
"license": "lgpl-3.0",
"size": 17559
} | [
"java.io.IOException",
"java.util.List"
] | import java.io.IOException; import java.util.List; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 2,169,710 |
private static List<Object> buildPayloadData(Request request, Response response, long startTime,
long responseTime) {
List<Object> payload = new ArrayList<>();
final String forwardSlash = "/";
Optional.ofNullable(request.getRequestURI()).map(String::trim).ifPresent(requestedURI -> {
String[] requestedUriParts = requestedURI.split(forwardSlash);
if (!forwardSlash.equals(requestedURI)) {
payload.add((requestedUriParts[1]));
} else {
payload.add((forwardSlash));
}
});
String webappServletVersion = request.getContext().getEffectiveMajorVersion() + "." +
request.getContext().getEffectiveMinorVersion();
payload.add(webappServletVersion);
payload.add(extractUsername(request));
payload.add(request.getRequestURI());
payload.add(startTime);
payload.add(request.getPathInfo());
payload.add(Constants.APP_TYPE);
payload.add(request.getContext().getDisplayName());
payload.add(extractSessionId(request));
payload.add(request.getMethod());
payload.add(request.getContentType());
payload.add(response.getContentType());
payload.add((long) response.getStatus());
payload.add(getClientIpAddress(request));
payload.add(request.getHeader(Constants.REFERRER));
payload.add(request.getHeader(Constants.USER_AGENT));
payload.add(request.getHeader(Constants.HOST));
payload.add(request.getRemoteUser());
payload.add(request.getAuthType());
payload.add(responseTime);
payload.add((long) request.getContentLength());
payload.add((long) response.getContentLength());
payload.add(getRequestHeaders(request));
payload.add(getResponseHeaders(response));
payload.add(request.getLocale().getLanguage());
return payload;
} | static List<Object> function(Request request, Response response, long startTime, long responseTime) { List<Object> payload = new ArrayList<>(); final String forwardSlash = "/"; Optional.ofNullable(request.getRequestURI()).map(String::trim).ifPresent(requestedURI -> { String[] requestedUriParts = requestedURI.split(forwardSlash); if (!forwardSlash.equals(requestedURI)) { payload.add((requestedUriParts[1])); } else { payload.add((forwardSlash)); } }); String webappServletVersion = request.getContext().getEffectiveMajorVersion() + "." + request.getContext().getEffectiveMinorVersion(); payload.add(webappServletVersion); payload.add(extractUsername(request)); payload.add(request.getRequestURI()); payload.add(startTime); payload.add(request.getPathInfo()); payload.add(Constants.APP_TYPE); payload.add(request.getContext().getDisplayName()); payload.add(extractSessionId(request)); payload.add(request.getMethod()); payload.add(request.getContentType()); payload.add(response.getContentType()); payload.add((long) response.getStatus()); payload.add(getClientIpAddress(request)); payload.add(request.getHeader(Constants.REFERRER)); payload.add(request.getHeader(Constants.USER_AGENT)); payload.add(request.getHeader(Constants.HOST)); payload.add(request.getRemoteUser()); payload.add(request.getAuthType()); payload.add(responseTime); payload.add((long) request.getContentLength()); payload.add((long) response.getContentLength()); payload.add(getRequestHeaders(request)); payload.add(getResponseHeaders(response)); payload.add(request.getLocale().getLanguage()); return payload; } | /**
* Creates the payload.
*
* @param request the Request object of client
* @param response the Response object of client
* @param startTime the time at which the valve is invoked
* @param responseTime the time that is taken for the client to receive a response
* @return a list containing all payload data that were extracted from the request and response
*/ | Creates the payload | buildPayloadData | {
"repo_name": "manoj-kumara/product-as",
"path": "modules/http-statistics-monitoring/src/main/java/org/wso2/appserver/monitoring/utils/EventBuilder.java",
"license": "apache-2.0",
"size": 8979
} | [
"java.util.ArrayList",
"java.util.List",
"java.util.Optional",
"org.apache.catalina.connector.Request",
"org.apache.catalina.connector.Response",
"org.wso2.appserver.monitoring.Constants"
] | import java.util.ArrayList; import java.util.List; import java.util.Optional; import org.apache.catalina.connector.Request; import org.apache.catalina.connector.Response; import org.wso2.appserver.monitoring.Constants; | import java.util.*; import org.apache.catalina.connector.*; import org.wso2.appserver.monitoring.*; | [
"java.util",
"org.apache.catalina",
"org.wso2.appserver"
] | java.util; org.apache.catalina; org.wso2.appserver; | 602,598 |
public List<Map.Entry<String, Integer>> getFirstNameFrequencyList()
{
return new ArrayList(firstNameFrequency.entrySet());
} | List<Map.Entry<String, Integer>> function() { return new ArrayList(firstNameFrequency.entrySet()); } | /**
* Returns a list of first names to the number of occurences (frequency) of that name.
* <p>
* These values are first put into a {@link LinkedHashMap} then converted into a {@link List} of {@link Map.Entry}.
* This is to allow use in PrimeFaces' datatable JSF element.
*
* @return a list of first names to the number of occurences (frequency) of that name
*
* @see NamesDataBean#firstNameFrequency
*/ | Returns a list of first names to the number of occurences (frequency) of that name. These values are first put into a <code>LinkedHashMap</code> then converted into a <code>List</code> of <code>Map.Entry</code>. This is to allow use in PrimeFaces' datatable JSF element | getFirstNameFrequencyList | {
"repo_name": "hendrixjoseph/FamilyTree",
"path": "src/main/java/edu/wright/hendrix11/familyTree/bean/mining/NamesBean.java",
"license": "mit",
"size": 2616
} | [
"java.util.ArrayList",
"java.util.List",
"java.util.Map"
] | import java.util.ArrayList; import java.util.List; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,613,452 |
public void setAccount (MAccount acct)
{
m_account = acct;
} // setAccount
| void function (MAccount acct) { m_account = acct; } | /**************************************************************************
* Set GL Journal Account
* @param acct account
*/ | Set GL Journal Account | setAccount | {
"repo_name": "erpcya/adempierePOS",
"path": "base/src/org/compiere/acct/DocLine.java",
"license": "gpl-2.0",
"size": 28977
} | [
"org.compiere.model.MAccount"
] | import org.compiere.model.MAccount; | import org.compiere.model.*; | [
"org.compiere.model"
] | org.compiere.model; | 2,258,414 |
public static String md5Hex(InputStream data) throws IOException {
return Hex.encodeHexString(md5(data));
} | static String function(InputStream data) throws IOException { return Hex.encodeHexString(md5(data)); } | /**
* Calculates the MD5 digest and returns the value as a 32 character hex string.
*
* @param data
* Data to digest
* @return MD5 digest as a hex string
* @throws IOException
* On error reading from the stream
* @since 1.4
*/ | Calculates the MD5 digest and returns the value as a 32 character hex string | md5Hex | {
"repo_name": "mcomella/FirefoxAccounts-android",
"path": "thirdparty/src/main/java/org/mozilla/apache/commons/codec/digest/DigestUtils.java",
"license": "mpl-2.0",
"size": 17367
} | [
"java.io.IOException",
"java.io.InputStream",
"org.mozilla.apache.commons.codec.binary.Hex"
] | import java.io.IOException; import java.io.InputStream; import org.mozilla.apache.commons.codec.binary.Hex; | import java.io.*; import org.mozilla.apache.commons.codec.binary.*; | [
"java.io",
"org.mozilla.apache"
] | java.io; org.mozilla.apache; | 1,664,423 |
public boolean isAcceptable(Dictionary conf) {
try {
checkAcceptability(conf);
} catch (MissingHandlerException e) {
return false;
} catch (UnacceptableConfiguration e) {
return false;
}
return true;
}
| boolean function(Dictionary conf) { try { checkAcceptability(conf); } catch (MissingHandlerException e) { return false; } catch (UnacceptableConfiguration e) { return false; } return true; } | /**
* Checks if the configuration is acceptable.
* @param conf the configuration to test.
* @return <code>true</code> if the configuration is acceptable.
* @see org.apache.felix.ipojo.Factory#isAcceptable(java.util.Dictionary)
*/ | Checks if the configuration is acceptable | isAcceptable | {
"repo_name": "boneman1231/org.apache.felix",
"path": "trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/IPojoFactory.java",
"license": "apache-2.0",
"size": 39355
} | [
"java.util.Dictionary"
] | import java.util.Dictionary; | import java.util.*; | [
"java.util"
] | java.util; | 2,101,452 |
// START SNIPPET: e2
public String slip(String body, @ExchangeProperties Map<String, Object> properties) {
bodies.add(body);
// get the state from the exchange properties and keep track how many
// times
// we have been invoked
int invoked = 0;
Object current = properties.get("invoked");
if (current != null) {
invoked = Integer.valueOf(current.toString());
}
invoked++;
// and store the state back on the properties
properties.put("invoked", invoked);
if (invoked == 1) {
return "mock:a";
} else if (invoked == 2) {
return "mock:b,mock:c";
} else if (invoked == 3) {
return "direct:foo";
} else if (invoked == 4) {
return "mock:result";
}
// no more so return null
return null;
}
// END SNIPPET: e2 | String function(String body, @ExchangeProperties Map<String, Object> properties) { bodies.add(body); int invoked = 0; Object current = properties.get(STR); if (current != null) { invoked = Integer.valueOf(current.toString()); } invoked++; properties.put(STR, invoked); if (invoked == 1) { return STR; } else if (invoked == 2) { return STR; } else if (invoked == 3) { return STR; } else if (invoked == 4) { return STR; } return null; } | /**
* Use this method to compute dynamic where we should route next.
*
* @param body the message body
* @param properties the exchange properties where we can store state
* between invocations
* @return endpoints to go, or <tt>null</tt> to indicate the end
*/ | Use this method to compute dynamic where we should route next | slip | {
"repo_name": "objectiser/camel",
"path": "core/camel-core/src/test/java/org/apache/camel/processor/DynamicRouterExchangePropertiesTest.java",
"license": "apache-2.0",
"size": 4162
} | [
"java.util.Map",
"org.apache.camel.ExchangeProperties"
] | import java.util.Map; import org.apache.camel.ExchangeProperties; | import java.util.*; import org.apache.camel.*; | [
"java.util",
"org.apache.camel"
] | java.util; org.apache.camel; | 2,565,240 |
@ApiModelProperty(example = "null", value = "")
public List<String> getAccessControlAllowMethods() {
return accessControlAllowMethods;
} | @ApiModelProperty(example = "null", value = "") List<String> function() { return accessControlAllowMethods; } | /**
* Get accessControlAllowMethods
* @return accessControlAllowMethods
**/ | Get accessControlAllowMethods | getAccessControlAllowMethods | {
"repo_name": "abimarank/product-apim",
"path": "integration-tests/src/main/java/org/wso2/carbon/apimgt/rest/integration/tests/model/APICorsConfiguration.java",
"license": "apache-2.0",
"size": 7272
} | [
"io.swagger.annotations.ApiModelProperty",
"java.util.List"
] | import io.swagger.annotations.ApiModelProperty; import java.util.List; | import io.swagger.annotations.*; import java.util.*; | [
"io.swagger.annotations",
"java.util"
] | io.swagger.annotations; java.util; | 1,285,894 |
public List<UIComponent> resolve(UIComponent component, List<UIComponent> parentComponents, String currentId,
String originalExpression, String[] parameters) {
List<UIComponent> result = new ArrayList<UIComponent>();
for (UIComponent parent : parentComponents) {
UIComponent grandparent = component.getParent();
for (int i = 0; i < grandparent.getChildCount(); i++) {
if (grandparent.getChildren().get(i) == parent) {
i++;
while (i<grandparent.getChildCount()) {
result.add(grandparent.getChildren().get(i));
i++;
}
}
}
}
if (result.size() > 0) {
return result;
}
throw new FacesException("Invalid search expression - there's no successor to the component " + originalExpression);
} | List<UIComponent> function(UIComponent component, List<UIComponent> parentComponents, String currentId, String originalExpression, String[] parameters) { List<UIComponent> result = new ArrayList<UIComponent>(); for (UIComponent parent : parentComponents) { UIComponent grandparent = component.getParent(); for (int i = 0; i < grandparent.getChildCount(); i++) { if (grandparent.getChildren().get(i) == parent) { i++; while (i<grandparent.getChildCount()) { result.add(grandparent.getChildren().get(i)); i++; } } } } if (result.size() > 0) { return result; } throw new FacesException(STR + originalExpression); } | /**
* Collects every JSF node following the current JSF node within the same branch of the tree.
* It's like "@next @next:@next @next:@next:@next ...".
*/ | Collects every JSF node following the current JSF node within the same branch of the tree. It's like "@next @next:@next @next:@next:@next ..." | resolve | {
"repo_name": "chongma/BootsFaces-OSP",
"path": "src/main/java/net/bootsfaces/expressions/AfterExpressionResolver.java",
"license": "apache-2.0",
"size": 1300
} | [
"java.util.ArrayList",
"java.util.List",
"javax.faces.FacesException",
"javax.faces.component.UIComponent"
] | import java.util.ArrayList; import java.util.List; import javax.faces.FacesException; import javax.faces.component.UIComponent; | import java.util.*; import javax.faces.*; import javax.faces.component.*; | [
"java.util",
"javax.faces"
] | java.util; javax.faces; | 610,069 |
protected static JDialog waitJDialog(WindowOperator owner, ComponentChooser chooser, int index) {
return (waitJDialog((Window) owner.getSource(),
chooser, index,
owner.getTimeouts(), owner.getOutput()));
} | static JDialog function(WindowOperator owner, ComponentChooser chooser, int index) { return (waitJDialog((Window) owner.getSource(), chooser, index, owner.getTimeouts(), owner.getOutput())); } | /**
* A method to be used from subclasses. Uses {@code owner}'s timeouts
* and output during the waiting.
*
* @param owner a window - dialog owner.
* @param chooser org.netbeans.jemmy.ComponentChooser implementation.
* @param index Ordinal component index.
* @return Component instance or null if component was not found.
* @throws TimeoutExpiredException
*/ | A method to be used from subclasses. Uses owner's timeouts and output during the waiting | waitJDialog | {
"repo_name": "md-5/jdk10",
"path": "test/jdk/sanity/client/lib/jemmy/src/org/netbeans/jemmy/operators/JDialogOperator.java",
"license": "gpl-2.0",
"size": 25873
} | [
"java.awt.Window",
"javax.swing.JDialog",
"org.netbeans.jemmy.ComponentChooser"
] | import java.awt.Window; import javax.swing.JDialog; import org.netbeans.jemmy.ComponentChooser; | import java.awt.*; import javax.swing.*; import org.netbeans.jemmy.*; | [
"java.awt",
"javax.swing",
"org.netbeans.jemmy"
] | java.awt; javax.swing; org.netbeans.jemmy; | 985,225 |
public static TreeMap<String,File> getMapOfFilesInDirectory
(String directory,
List<String> domains,
final String extension,
boolean dropExtension) {
TreeMap<String,File> result = new TreeMap<String,File>();
List<File> files = getFilesInDirectory(directory,extension);
Iterator<File> it = files.iterator();
while (it.hasNext()) {
File f = it.next();
String name = f.getName();
if (name.startsWith("._")) { // to handle a bug in Apache FileUtils that only occurs in Windows 8
name = name.substring(2);
}
if (dropExtension) {
name = name.replace("." + extension, "");
}
try {
if (domains == null || domains.isEmpty()) { // we are not filtering by domain, so just put it in map
result.put(name, f);
} else { // try to filter by domain
String[] parts = getAresFileParts(f.getName(),"_",false,true);
if (parts != null && parts.length == 2) { // has a domain
if (domains.contains(parts[1])) { // is the domain in our list?
result.put(name, f);
}
}
}
} catch (Exception e) {
LOGGER.error(e.getMessage());
}
}
return result;
}
| static TreeMap<String,File> function (String directory, List<String> domains, final String extension, boolean dropExtension) { TreeMap<String,File> result = new TreeMap<String,File>(); List<File> files = getFilesInDirectory(directory,extension); Iterator<File> it = files.iterator(); while (it.hasNext()) { File f = it.next(); String name = f.getName(); if (name.startsWith("._")) { name = name.substring(2); } if (dropExtension) { name = name.replace("." + extension, STR_",false,true); if (parts != null && parts.length == 2) { if (domains.contains(parts[1])) { result.put(name, f); } } } } catch (Exception e) { LOGGER.error(e.getMessage()); } } return result; } | /**
* Create a map of files in the directory, where the
* key is the name of the file and the value is the File.
* @param directory - where to start the loading
* @param extension - what file extension to look for
* @param dropExtension - true if you want the key to not use the file extension
* @return the map
*/ | Create a map of files in the directory, where the key is the name of the file and the value is the File | getMapOfFilesInDirectory | {
"repo_name": "OCMC-Translation-Projects/ioc-liturgical-ws",
"path": "src/main/java/net/ages/alwb/gateway/utils/CommonFileUtils.java",
"license": "epl-1.0",
"size": 18105
} | [
"java.io.File",
"java.util.Iterator",
"java.util.List",
"java.util.TreeMap"
] | import java.io.File; import java.util.Iterator; import java.util.List; import java.util.TreeMap; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 1,431,485 |
@FIXVersion(introduced = "4.2", retired = "4.3")
@TagNumRef(tagNum = TagNum.EncodedIssuer)
public byte[] getEncodedIssuer() {
return getSafeInstrument().getEncodedIssuer();
} | @FIXVersion(introduced = "4.2", retired = "4.3") @TagNumRef(tagNum = TagNum.EncodedIssuer) byte[] function() { return getSafeInstrument().getEncodedIssuer(); } | /**
* Message field getter.
* @return field value
*/ | Message field getter | getEncodedIssuer | {
"repo_name": "marvisan/HadesFIX",
"path": "Model/src/main/java/net/hades/fix/message/OrderModificationRequestMsg.java",
"license": "gpl-3.0",
"size": 149491
} | [
"net.hades.fix.message.anno.FIXVersion",
"net.hades.fix.message.anno.TagNumRef",
"net.hades.fix.message.type.TagNum"
] | import net.hades.fix.message.anno.FIXVersion; import net.hades.fix.message.anno.TagNumRef; import net.hades.fix.message.type.TagNum; | import net.hades.fix.message.anno.*; import net.hades.fix.message.type.*; | [
"net.hades.fix"
] | net.hades.fix; | 1,390,178 |
return name;
}
public static class Page extends PagedResources<MetricResource> {
} | return name; } public static class Page extends PagedResources<MetricResource> { } | /**
* Return the name of the metric.
*/ | Return the name of the metric | getName | {
"repo_name": "Sbodiu-pivotal/spring-cloud-data",
"path": "spring-cloud-data-rest-resource/src/main/java/org/springframework/cloud/data/rest/resource/MetricResource.java",
"license": "apache-2.0",
"size": 1435
} | [
"org.springframework.hateoas.PagedResources"
] | import org.springframework.hateoas.PagedResources; | import org.springframework.hateoas.*; | [
"org.springframework.hateoas"
] | org.springframework.hateoas; | 2,827,607 |
public String toHtmlTable(HttpServletRequest request, SessionContext context, Collection distPrefs, boolean addButton) {
String title = MSG.sectionTitleDistributionPreferences();
String backType = request.getParameter("backType");
String backId = request.getParameter("backId");
String instructorFormat = UserProperty.NameFormat.get(context.getUser());
if (addButton && context.hasPermission(Right.DistributionPreferenceAdd)) {
title = "<table width='100%'><tr><td width='100%'>" +
"<DIV class=\"WelcomeRowHeadNoLine\">" + MSG.sectionTitleDistributionPreferences() +"</DIV>"+
"</td><td style='padding-bottom: 2px'>"+
"<input type=\"submit\" name=\"op\" class=\"btn\" accesskey='A' title='Add New Distribution Preference (Alt+A)' value=\"Add Distribution Preference\">"+
"</td></tr></table>";
}
WebTable.setOrder(context,"distPrefsTable.ord",request.getParameter("order"),4);
WebTable tbl = new WebTable(4,
title,
"distributionPrefs.do?order=%%",
new String[] {MSG.columnDistrPrefType(), MSG.columnDistrPrefStructure(), MSG.columnDistrPrefOwner(), MSG.columnDistrPrefClass() },
new String[] { "left", "left", "left", "left"},
new boolean[] { true, true, true, true } );
int nrPrefs = 0;
boolean suffix = ApplicationProperty.DistributionsShowClassSufix.isTrue();
for (Iterator i1=distPrefs.iterator();i1.hasNext();) {
DistributionPref dp = (DistributionPref)i1.next();
if (!context.hasPermission(dp, Right.DistributionPreferenceDetail)) continue;
nrPrefs++;
String objStr = "";
PreferenceGroup pg = dp.getOwner();
String ownerType = "Unknown";
if (pg instanceof Department) {
Department d = (Department)pg;
ownerType = d.getManagingDeptAbbv();
}
for (Iterator i2=dp.getOrderedSetOfDistributionObjects().iterator();i2.hasNext();) {
DistributionObject dO = (DistributionObject)i2.next();
objStr += dO.preferenceText(suffix);
if (i2.hasNext()) objStr += "<BR>";
}
String groupingText = dp.getGroupingName();
Comparable groupingCmp = (dp.getGrouping()==null?"0":dp.getGrouping().toString());
if (pg instanceof DepartmentalInstructor) {
DepartmentalInstructor instructor = (DepartmentalInstructor)pg;
Set<Department> owners = new TreeSet<Department>();
TreeSet classes = new TreeSet(new ClassInstructorComparator(new ClassComparator(ClassComparator.COMPARE_BY_HIERARCHY)));
classes.addAll(instructor.getClasses());
for (Iterator i2=classes.iterator();i2.hasNext();) {
ClassInstructor clazz = (ClassInstructor)i2.next();
if (!clazz.isLead().booleanValue()) continue;
if (objStr.length()>0) objStr += "<BR>";
objStr += clazz.getClassInstructing().getClassLabel(suffix);
Department dept = clazz.getClassInstructing().getManagingDept();
if (dept.isInheritInstructorPreferences()) owners.add(dept);
}
ownerType = "";
for (Department owner: owners)
ownerType += (ownerType.isEmpty() ? "" : "<br>") + owner.getManagingDeptAbbv();
groupingText = "Instructor "+instructor.getName(instructorFormat);
groupingCmp = instructor.getName(instructorFormat);
//prefEditable = false;
if (owners.isEmpty()) continue;
}
String distType = dp.getDistributionType().getLabel();
String prefLevel = dp.getPrefLevel().getPrefName();
String prefColor = dp.getPrefLevel().prefcolor();
if (PreferenceLevel.sNeutral.equals(dp.getPrefLevel().getPrefProlog()))
prefColor = "gray";
String onClick = null;
boolean gray = false;
if (pg instanceof DepartmentalInstructor) {
if (context.hasPermission(pg, Right.InstructorDetail))
onClick = "onClick=\"document.location='instructorDetail.do"
+ "?instructorId=" + dp.getOwner().getUniqueId().toString()
+ "&op=Show%20Instructor%20Preferences'\"";
} else {
if (context.hasPermission(dp, Right.DistributionPreferenceEdit))
onClick = "onClick=\"document.location='distributionPrefs.do"
+ "?dp=" + dp.getUniqueId().toString()
+ "&op=view'\"";
}
boolean back = "PreferenceGroup".equals(backType) && dp.getUniqueId().toString().equals(backId);
tbl.addLine(
onClick,
new String[] {
(back?"<A name=\"back\"</A>":"")+
(gray?"<span style='color:gray;'>":"<span style='color:"+prefColor+";font-weight:bold;' title='"+prefLevel+" "+distType+"'>")+distType+"</span>",
(gray?"<span style='color:gray;'>":"")+groupingText+(gray?"</span>":""),
(gray?"<span style='color:gray;'>":"")+ownerType+(gray?"</span>":""),
(gray?"<span style='color:gray;'>":"")+objStr+(gray?"</span>":"")
},
new Comparable[] { distType, groupingCmp, ownerType, objStr });
}
if (nrPrefs==0)
tbl.addLine(null, new String[] { MSG.noPreferencesFound(), "", "", "" }, null);
return tbl.printTable(WebTable.getOrder(context,"distPrefsTable.ord"));
} | String function(HttpServletRequest request, SessionContext context, Collection distPrefs, boolean addButton) { String title = MSG.sectionTitleDistributionPreferences(); String backType = request.getParameter(STR); String backId = request.getParameter(STR); String instructorFormat = UserProperty.NameFormat.get(context.getUser()); if (addButton && context.hasPermission(Right.DistributionPreferenceAdd)) { title = STR + STRWelcomeRowHeadNoLine\">" + MSG.sectionTitleDistributionPreferences() +STR+ STR+ STRsubmit\STRop\STRbtn\STRAdd Distribution Preference\">"+ STR; } WebTable.setOrder(context,STR,request.getParameter("order"),4); WebTable tbl = new WebTable(4, title, STR, new String[] {MSG.columnDistrPrefType(), MSG.columnDistrPrefStructure(), MSG.columnDistrPrefOwner(), MSG.columnDistrPrefClass() }, new String[] { "leftSTRleftSTRleftSTRleft"}, new boolean[] { true, true, true, true } ); int nrPrefs = 0; boolean suffix = ApplicationProperty.DistributionsShowClassSufix.isTrue(); for (Iterator i1=distPrefs.iterator();i1.hasNext();) { DistributionPref dp = (DistributionPref)i1.next(); if (!context.hasPermission(dp, Right.DistributionPreferenceDetail)) continue; nrPrefs++; String objStr = STRUnknownSTR<BR>STR0STR<BR>STRSTRSTR<br>STRInstructor STRgraySTRonClick=\STR + STR + dp.getOwner().getUniqueId().toString() + STRSTRonClick=\STR + "?dp=" + dp.getUniqueId().toString() + STRSTRPreferenceGroupSTR<A name=\"back\"</A>":"STR<span style='color:gray;'>":"<span style='color:STR;font-weight:bold;' title='STR STR'>STR</span>STR<span style='color:gray;'>":"STR</span>":"STR<span style='color:gray;'>":"STR</span>":"STR<span style='color:gray;'>":"STR</span>":"STRSTRSTR" }, null); return tbl.printTable(WebTable.getOrder(context,STR)); } | /**
* Build a html table with the list representing distribution prefs
* @param distPrefs
* @param ordCol
* @param editable
* @return
*/ | Build a html table with the list representing distribution prefs | toHtmlTable | {
"repo_name": "nikeshmhr/unitime",
"path": "JavaSource/org/unitime/timetable/webutil/DistributionPrefsTableBuilder.java",
"license": "apache-2.0",
"size": 18471
} | [
"java.util.Collection",
"java.util.Iterator",
"javax.servlet.http.HttpServletRequest",
"org.unitime.commons.web.WebTable",
"org.unitime.timetable.defaults.ApplicationProperty",
"org.unitime.timetable.defaults.UserProperty",
"org.unitime.timetable.model.DistributionPref",
"org.unitime.timetable.security.SessionContext",
"org.unitime.timetable.security.rights.Right"
] | import java.util.Collection; import java.util.Iterator; import javax.servlet.http.HttpServletRequest; import org.unitime.commons.web.WebTable; import org.unitime.timetable.defaults.ApplicationProperty; import org.unitime.timetable.defaults.UserProperty; import org.unitime.timetable.model.DistributionPref; import org.unitime.timetable.security.SessionContext; import org.unitime.timetable.security.rights.Right; | import java.util.*; import javax.servlet.http.*; import org.unitime.commons.web.*; import org.unitime.timetable.defaults.*; import org.unitime.timetable.model.*; import org.unitime.timetable.security.*; import org.unitime.timetable.security.rights.*; | [
"java.util",
"javax.servlet",
"org.unitime.commons",
"org.unitime.timetable"
] | java.util; javax.servlet; org.unitime.commons; org.unitime.timetable; | 488,491 |
public List<String> getVariables() {
return variables;
}
| List<String> function() { return variables; } | /**
* Return a list of Variable references in the expression
* @return List of variables
*/ | Return a list of Variable references in the expression | getVariables | {
"repo_name": "fifa0329/vassal",
"path": "src/bsh/BeanShellExpressionValidator.java",
"license": "lgpl-2.1",
"size": 4945
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,605,161 |
public ServiceDiscoveryModuleBuilder<T> annotation(final Class<? extends Annotation> ann) {
this.annotation = AnnotationHolder.create(ann);
return this;
} | ServiceDiscoveryModuleBuilder<T> function(final Class<? extends Annotation> ann) { this.annotation = AnnotationHolder.create(ann); return this; } | /**
* The annotation to use with the binding. Required.
*/ | The annotation to use with the binding. Required | annotation | {
"repo_name": "dclements/cultivar_old",
"path": "cultivar-discovery/src/main/java/org/waterprinciple/cultivar/discovery/ServiceDiscoveryModuleBuilder.java",
"license": "mit",
"size": 7153
} | [
"java.lang.annotation.Annotation",
"org.waterprinciple.cultivar.internal.AnnotationHolder"
] | import java.lang.annotation.Annotation; import org.waterprinciple.cultivar.internal.AnnotationHolder; | import java.lang.annotation.*; import org.waterprinciple.cultivar.internal.*; | [
"java.lang",
"org.waterprinciple.cultivar"
] | java.lang; org.waterprinciple.cultivar; | 551,196 |
public Builder addServletAttribute(String attrName, Object value) {
requireNonNull(attrName, "attrName");
if ( value != null )
servletAttr.put(attrName, value);
else
servletAttr.remove(attrName);
return this;
} | Builder function(String attrName, Object value) { requireNonNull(attrName, STR); if ( value != null ) servletAttr.put(attrName, value); else servletAttr.remove(attrName); return this; } | /**
* Add a servlet attribute. Pass a value of null to remove any existing binding.
*/ | Add a servlet attribute. Pass a value of null to remove any existing binding | addServletAttribute | {
"repo_name": "apache/jena",
"path": "jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/main/JettyServer.java",
"license": "apache-2.0",
"size": 18822
} | [
"java.util.Objects"
] | import java.util.Objects; | import java.util.*; | [
"java.util"
] | java.util; | 913,891 |
public Builder oneshot(final boolean oneshot) {
this.oneshot = of(oneshot);
return this;
} | Builder function(final boolean oneshot) { this.oneshot = of(oneshot); return this; } | /**
* Do not perform any scheduled tasks, only perform then once during startup.
*/ | Do not perform any scheduled tasks, only perform then once during startup | oneshot | {
"repo_name": "lucilecoutouly/heroic",
"path": "heroic-core/src/main/java/com/spotify/heroic/HeroicCore.java",
"license": "apache-2.0",
"size": 36074
} | [
"java.util.Optional"
] | import java.util.Optional; | import java.util.*; | [
"java.util"
] | java.util; | 2,429,006 |
@Test
public void testRemovedCriteriaIgnored() {
CriterionDescriptor rootDescriptor =
new CriterionDescriptor(true, false, null, 1000000L, 1L, null);
List<AdGroupCriterion> criteria = Lists.newArrayList();
criteria.add(rootDescriptor.createCriterion());
// Create a criteria for a child node and set its UserStatus to REMOVED.
ProductBrand brandGoogle = ProductDimensions.createBrand("google");
CriterionDescriptor removedDescriptor =
new CriterionDescriptor(true, false, brandGoogle, null, 2L, 1L);
AdGroupCriterion removedCriterion = removedDescriptor.createCriterion();
((BiddableAdGroupCriterion) removedCriterion).setUserStatus(UserStatus.REMOVED);
criteria.add(removedCriterion);
ProductPartitionTree tree =
ProductPartitionTree.createAdGroupTree(-1L, biddingStrategyConfig, criteria);
assertFalse("Brand = google criteria had status removed, but it is in the tree",
tree.getRoot().hasChild(brandGoogle));
} | void function() { CriterionDescriptor rootDescriptor = new CriterionDescriptor(true, false, null, 1000000L, 1L, null); List<AdGroupCriterion> criteria = Lists.newArrayList(); criteria.add(rootDescriptor.createCriterion()); ProductBrand brandGoogle = ProductDimensions.createBrand(STR); CriterionDescriptor removedDescriptor = new CriterionDescriptor(true, false, brandGoogle, null, 2L, 1L); AdGroupCriterion removedCriterion = removedDescriptor.createCriterion(); ((BiddableAdGroupCriterion) removedCriterion).setUserStatus(UserStatus.REMOVED); criteria.add(removedCriterion); ProductPartitionTree tree = ProductPartitionTree.createAdGroupTree(-1L, biddingStrategyConfig, criteria); assertFalse(STR, tree.getRoot().hasChild(brandGoogle)); } | /**
* Tests that the factory method ignores removed criteria.
*/ | Tests that the factory method ignores removed criteria | testRemovedCriteriaIgnored | {
"repo_name": "stoksey69/googleads-java-lib",
"path": "modules/adwords_axis/src/test/java/com/google/api/ads/adwords/axis/utils/v201502/shopping/ProductPartitionTreeTest.java",
"license": "apache-2.0",
"size": 23036
} | [
"com.google.api.ads.adwords.axis.v201502.cm.AdGroupCriterion",
"com.google.api.ads.adwords.axis.v201502.cm.BiddableAdGroupCriterion",
"com.google.api.ads.adwords.axis.v201502.cm.ProductBrand",
"com.google.api.ads.adwords.axis.v201502.cm.UserStatus",
"com.google.common.collect.Lists",
"java.util.List",
"org.junit.Assert"
] | import com.google.api.ads.adwords.axis.v201502.cm.AdGroupCriterion; import com.google.api.ads.adwords.axis.v201502.cm.BiddableAdGroupCriterion; import com.google.api.ads.adwords.axis.v201502.cm.ProductBrand; import com.google.api.ads.adwords.axis.v201502.cm.UserStatus; import com.google.common.collect.Lists; import java.util.List; import org.junit.Assert; | import com.google.api.ads.adwords.axis.v201502.cm.*; import com.google.common.collect.*; import java.util.*; import org.junit.*; | [
"com.google.api",
"com.google.common",
"java.util",
"org.junit"
] | com.google.api; com.google.common; java.util; org.junit; | 1,577,706 |
public boolean acceptLine(RouteDataObject way);
| boolean function(RouteDataObject way); | /**
* return if the road is accepted for routing
*/ | return if the road is accepted for routing | acceptLine | {
"repo_name": "getintouchapp/getintouchmaps",
"path": "OsmAnd-java/src/net/osmand/router/VehicleRouter.java",
"license": "gpl-3.0",
"size": 1860
} | [
"net.osmand.binary.RouteDataObject"
] | import net.osmand.binary.RouteDataObject; | import net.osmand.binary.*; | [
"net.osmand.binary"
] | net.osmand.binary; | 1,795,172 |
public CustomerCreditMemoDocument createCustomerCreditMemoDocument(CustomerInvoiceDocument invoice) {
CustomerCreditMemoDetail customerCreditMemoDetail;
CustomerCreditMemoDocument customerCreditMemoDocument = null;
KualiDecimal invItemTaxAmount, itemAmount;
Integer itemLineNumber;
BigDecimal itemQuantity;
String documentNumber;
try {
// the document header is created and set here
customerCreditMemoDocument = DocumentTestUtils.createDocument(SpringContext.getBean(DocumentService.class), CustomerCreditMemoDocument.class);
} catch (WorkflowException e) {
throw new RuntimeException("Document creation failed.");
}
customerCreditMemoDocument.setInvoice(invoice); // invoice, not sure I need to set it at all for this test
customerCreditMemoDocument.setFinancialDocumentReferenceInvoiceNumber(invoice.getDocumentNumber());
List<CustomerInvoiceDetail> customerInvoiceDetails = invoice.getCustomerInvoiceDetailsWithoutDiscounts();
if (customerInvoiceDetails == null) {
return customerCreditMemoDocument;
}
for (CustomerInvoiceDetail customerInvoiceDetail : customerInvoiceDetails) {
customerCreditMemoDetail = new CustomerCreditMemoDetail();
customerCreditMemoDetail.setDocumentNumber(customerCreditMemoDocument.getDocumentNumber());
invItemTaxAmount = customerInvoiceDetail.getInvoiceItemTaxAmount();
if (invItemTaxAmount == null) {
invItemTaxAmount = KualiDecimal.ZERO;
}
customerCreditMemoDetail.setCreditMemoItemTaxAmount(invItemTaxAmount.divide(new KualiDecimal(2)));
customerCreditMemoDetail.setReferenceInvoiceItemNumber(customerInvoiceDetail.getSequenceNumber());
itemQuantity = customerInvoiceDetail.getInvoiceItemQuantity().divide(new BigDecimal(2));
customerCreditMemoDetail.setCreditMemoItemQuantity(itemQuantity);
itemAmount = customerInvoiceDetail.getAmount().divide(new KualiDecimal(2));
customerCreditMemoDetail.setCreditMemoItemTotalAmount(itemAmount);
customerCreditMemoDetail.setFinancialDocumentReferenceInvoiceNumber(invoice.getDocumentNumber());
customerCreditMemoDetail.setCustomerInvoiceDetail(customerInvoiceDetail);
customerCreditMemoDocument.getCreditMemoDetails().add(customerCreditMemoDetail);
}
return customerCreditMemoDocument;
} | CustomerCreditMemoDocument function(CustomerInvoiceDocument invoice) { CustomerCreditMemoDetail customerCreditMemoDetail; CustomerCreditMemoDocument customerCreditMemoDocument = null; KualiDecimal invItemTaxAmount, itemAmount; Integer itemLineNumber; BigDecimal itemQuantity; String documentNumber; try { customerCreditMemoDocument = DocumentTestUtils.createDocument(SpringContext.getBean(DocumentService.class), CustomerCreditMemoDocument.class); } catch (WorkflowException e) { throw new RuntimeException(STR); } customerCreditMemoDocument.setInvoice(invoice); customerCreditMemoDocument.setFinancialDocumentReferenceInvoiceNumber(invoice.getDocumentNumber()); List<CustomerInvoiceDetail> customerInvoiceDetails = invoice.getCustomerInvoiceDetailsWithoutDiscounts(); if (customerInvoiceDetails == null) { return customerCreditMemoDocument; } for (CustomerInvoiceDetail customerInvoiceDetail : customerInvoiceDetails) { customerCreditMemoDetail = new CustomerCreditMemoDetail(); customerCreditMemoDetail.setDocumentNumber(customerCreditMemoDocument.getDocumentNumber()); invItemTaxAmount = customerInvoiceDetail.getInvoiceItemTaxAmount(); if (invItemTaxAmount == null) { invItemTaxAmount = KualiDecimal.ZERO; } customerCreditMemoDetail.setCreditMemoItemTaxAmount(invItemTaxAmount.divide(new KualiDecimal(2))); customerCreditMemoDetail.setReferenceInvoiceItemNumber(customerInvoiceDetail.getSequenceNumber()); itemQuantity = customerInvoiceDetail.getInvoiceItemQuantity().divide(new BigDecimal(2)); customerCreditMemoDetail.setCreditMemoItemQuantity(itemQuantity); itemAmount = customerInvoiceDetail.getAmount().divide(new KualiDecimal(2)); customerCreditMemoDetail.setCreditMemoItemTotalAmount(itemAmount); customerCreditMemoDetail.setFinancialDocumentReferenceInvoiceNumber(invoice.getDocumentNumber()); customerCreditMemoDetail.setCustomerInvoiceDetail(customerInvoiceDetail); customerCreditMemoDocument.getCreditMemoDetails().add(customerCreditMemoDetail); } return customerCreditMemoDocument; } | /**
* This method creates a customer credit memo document based on the passed in customer invoice document
*
* @param customer invoice document
* @return
*/ | This method creates a customer credit memo document based on the passed in customer invoice document | createCustomerCreditMemoDocument | {
"repo_name": "quikkian-ua-devops/will-financials",
"path": "kfs-ar/src/test/java/org/kuali/kfs/module/ar/document/validation/impl/CustomerCreditMemoDocumentRuleTest.java",
"license": "agpl-3.0",
"size": 16842
} | [
"java.math.BigDecimal",
"java.util.List",
"org.kuali.kfs.krad.service.DocumentService",
"org.kuali.kfs.module.ar.businessobject.CustomerCreditMemoDetail",
"org.kuali.kfs.module.ar.businessobject.CustomerInvoiceDetail",
"org.kuali.kfs.module.ar.document.CustomerCreditMemoDocument",
"org.kuali.kfs.module.ar.document.CustomerInvoiceDocument",
"org.kuali.kfs.sys.DocumentTestUtils",
"org.kuali.kfs.sys.context.SpringContext",
"org.kuali.rice.core.api.util.type.KualiDecimal",
"org.kuali.rice.kew.api.exception.WorkflowException"
] | import java.math.BigDecimal; import java.util.List; import org.kuali.kfs.krad.service.DocumentService; import org.kuali.kfs.module.ar.businessobject.CustomerCreditMemoDetail; import org.kuali.kfs.module.ar.businessobject.CustomerInvoiceDetail; import org.kuali.kfs.module.ar.document.CustomerCreditMemoDocument; import org.kuali.kfs.module.ar.document.CustomerInvoiceDocument; import org.kuali.kfs.sys.DocumentTestUtils; import org.kuali.kfs.sys.context.SpringContext; import org.kuali.rice.core.api.util.type.KualiDecimal; import org.kuali.rice.kew.api.exception.WorkflowException; | import java.math.*; import java.util.*; import org.kuali.kfs.krad.service.*; import org.kuali.kfs.module.ar.businessobject.*; import org.kuali.kfs.module.ar.document.*; import org.kuali.kfs.sys.*; import org.kuali.kfs.sys.context.*; import org.kuali.rice.core.api.util.type.*; import org.kuali.rice.kew.api.exception.*; | [
"java.math",
"java.util",
"org.kuali.kfs",
"org.kuali.rice"
] | java.math; java.util; org.kuali.kfs; org.kuali.rice; | 2,301,645 |
default Constraint rewardConfigurableLong(String constraintName, ToLongTriFunction<A, B, C> matchWeigher) {
return rewardConfigurableLong(getConstraintFactory().getDefaultConstraintPackage(), constraintName, matchWeigher);
} | default Constraint rewardConfigurableLong(String constraintName, ToLongTriFunction<A, B, C> matchWeigher) { return rewardConfigurableLong(getConstraintFactory().getDefaultConstraintPackage(), constraintName, matchWeigher); } | /**
* Positively impact the {@link Score}: add the {@link ConstraintWeight} multiplied by the match weight.
* Otherwise as defined by {@link #rewardConfigurable(String)}.
* @param constraintName never null, shows up in {@link ConstraintMatchTotal} during score justification
* @param matchWeigher never null, the result of this function (matchWeight) is multiplied by the constraintWeight
* @return never null
*/ | Positively impact the <code>Score</code>: add the <code>ConstraintWeight</code> multiplied by the match weight. Otherwise as defined by <code>#rewardConfigurable(String)</code> | rewardConfigurableLong | {
"repo_name": "baldimir/optaplanner",
"path": "optaplanner-core/src/main/java/org/optaplanner/core/api/score/stream/tri/TriConstraintStream.java",
"license": "apache-2.0",
"size": 17219
} | [
"org.optaplanner.core.api.function.ToLongTriFunction",
"org.optaplanner.core.api.score.stream.Constraint"
] | import org.optaplanner.core.api.function.ToLongTriFunction; import org.optaplanner.core.api.score.stream.Constraint; | import org.optaplanner.core.api.function.*; import org.optaplanner.core.api.score.stream.*; | [
"org.optaplanner.core"
] | org.optaplanner.core; | 428,881 |
List<LoggingEvent> parse(String xml) throws ParseException; | List<LoggingEvent> parse(String xml) throws ParseException; | /**
* Parses the given String for XML to extract the parameter and assign them
* to the members.
*
* @param xml
* XML-Content
* @return List of logging events
* @throws ParseException
* if fails to parse
*/ | Parses the given String for XML to extract the parameter and assign them to the members | parse | {
"repo_name": "stritti/log4js",
"path": "log4js-servlet/src/main/java/de/log4js/parser/EventParser.java",
"license": "apache-2.0",
"size": 1862
} | [
"de.log4js.LoggingEvent",
"java.util.List"
] | import de.log4js.LoggingEvent; import java.util.List; | import de.log4js.*; import java.util.*; | [
"de.log4js",
"java.util"
] | de.log4js; java.util; | 345,691 |
@Override
public void mouseMoved(MouseEvent e) {
Point2D.Float check = to2DPoint(e.getPoint());
Boundary.nearBoundary(check, edit.getBoundaries());
edit.repaint();
} | void function(MouseEvent e) { Point2D.Float check = to2DPoint(e.getPoint()); Boundary.nearBoundary(check, edit.getBoundaries()); edit.repaint(); } | /**
* Update's this tool's editlattice's tooltip as mouse moves
*/ | Update's this tool's editlattice's tooltip as mouse moves | mouseMoved | {
"repo_name": "mBonifant/Fluid2D",
"path": "Deliverables/Source Code/src/gui/DrawingTool.java",
"license": "gpl-3.0",
"size": 17155
} | [
"java.awt.event.MouseEvent",
"java.awt.geom.Point2D"
] | import java.awt.event.MouseEvent; import java.awt.geom.Point2D; | import java.awt.event.*; import java.awt.geom.*; | [
"java.awt"
] | java.awt; | 478,280 |
@SuppressWarnings("deprecation")
public void setNavigationBarTintDrawable(Drawable drawable) {
if (mNavBarAvailable) {
mNavBarTintView.setBackgroundDrawable(drawable);
}
} | @SuppressWarnings(STR) void function(Drawable drawable) { if (mNavBarAvailable) { mNavBarTintView.setBackgroundDrawable(drawable); } } | /**
* Apply the specified drawable to the system navigation bar.
*
* @param drawable The drawable to use as the background, or null to remove it.
*/ | Apply the specified drawable to the system navigation bar | setNavigationBarTintDrawable | {
"repo_name": "zhiaixinyang/LightThink",
"path": "greatbook/src/main/java/com/example/greatbook/utils/SystemBarTintManager.java",
"license": "apache-2.0",
"size": 19996
} | [
"android.graphics.drawable.Drawable"
] | import android.graphics.drawable.Drawable; | import android.graphics.drawable.*; | [
"android.graphics"
] | android.graphics; | 1,581,245 |
void unwantedItem(ItemIF item, ChannelIF channel); | void unwantedItem(ItemIF item, ChannelIF channel); | /**
* Invoked when cleanup engine finds unwanted item.
*
* @param item unwanted item.
* @param channel channel this item resides in.
*/ | Invoked when cleanup engine finds unwanted item | unwantedItem | {
"repo_name": "nikos/informa",
"path": "src/main/java/de/nava/informa/utils/cleaner/CleanerObserverIF.java",
"license": "epl-1.0",
"size": 1280
} | [
"de.nava.informa.core.ChannelIF",
"de.nava.informa.core.ItemIF"
] | import de.nava.informa.core.ChannelIF; import de.nava.informa.core.ItemIF; | import de.nava.informa.core.*; | [
"de.nava.informa"
] | de.nava.informa; | 1,371,779 |
public ImmutableList<Comment> getComments() {
return comments;
} | ImmutableList<Comment> function() { return comments; } | /**
* Returns an (immutable, ordered) list of comments in this BUILD file.
*/ | Returns an (immutable, ordered) list of comments in this BUILD file | getComments | {
"repo_name": "murugamsm/bazel",
"path": "src/main/java/com/google/devtools/build/lib/syntax/BuildFileAST.java",
"license": "apache-2.0",
"size": 11179
} | [
"com.google.common.collect.ImmutableList"
] | import com.google.common.collect.ImmutableList; | import com.google.common.collect.*; | [
"com.google.common"
] | com.google.common; | 2,615,957 |
return INSTANCE;
}
private TrashProjectListBox() {
super(MESSAGES.trashprojectlistbox(),
300, // height
false, // minimizable
false); // removable
trashList = new TrashProjectList();
setContent(trashList);
} | return INSTANCE; } private TrashProjectListBox() { super(MESSAGES.trashprojectlistbox(), 300, false, false); trashList = new TrashProjectList(); setContent(trashList); } | /**
* Returns the singleton deleted projects list box.
*
* @return trash project list box
*/ | Returns the singleton deleted projects list box | getTrashProjectListBox | {
"repo_name": "kkashi01/appinventor-sources",
"path": "appinventor/appengine/src/com/google/appinventor/client/boxes/TrashProjectListBox.java",
"license": "apache-2.0",
"size": 1474
} | [
"com.google.appinventor.client.Ode",
"com.google.appinventor.client.explorer.youngandroid.TrashProjectList"
] | import com.google.appinventor.client.Ode; import com.google.appinventor.client.explorer.youngandroid.TrashProjectList; | import com.google.appinventor.client.*; import com.google.appinventor.client.explorer.youngandroid.*; | [
"com.google.appinventor"
] | com.google.appinventor; | 2,479,183 |
public interface EventHandler<T> {
boolean handleEvent(EditorDomEvent<T> event);
}
protected enum State {
INACTIVE, ACTIVATING, BINDING, ACTIVE, SAVING
}
private Grid<T> grid;
private EditorHandler<T> handler;
private EventHandler<T> eventHandler = GWT
.create(DefaultEditorEventHandler.class);
private DivElement editorOverlay = DivElement.as(DOM.createDiv());
private DivElement cellWrapper = DivElement.as(DOM.createDiv());
private DivElement frozenCellWrapper = DivElement.as(DOM.createDiv());
private DivElement messageAndButtonsWrapper = DivElement
.as(DOM.createDiv());
private DivElement messageWrapper = DivElement.as(DOM.createDiv());
private DivElement buttonsWrapper = DivElement.as(DOM.createDiv());
// Element which contains the error message for the editor
// Should only be added to the DOM when there's a message to show
private DivElement message = DivElement.as(DOM.createDiv());
private Map<Column<?, T>, Widget> columnToWidget = new HashMap<>();
private List<HandlerRegistration> focusHandlers = new ArrayList<>();
private boolean enabled = false;
private State state = State.INACTIVE;
private int rowIndex = -1;
private int focusedColumnIndexDOM = -1;
private String styleName = null;
private HandlerRegistration hScrollHandler;
private HandlerRegistration vScrollHandler;
private final Button saveButton;
private final Button cancelButton; | interface EventHandler<T> { boolean function(EditorDomEvent<T> event); } protected enum State { INACTIVE, ACTIVATING, BINDING, ACTIVE, SAVING } private Grid<T> grid; private EditorHandler<T> handler; private EventHandler<T> eventHandler = GWT .create(DefaultEditorEventHandler.class); private DivElement editorOverlay = DivElement.as(DOM.createDiv()); private DivElement cellWrapper = DivElement.as(DOM.createDiv()); private DivElement frozenCellWrapper = DivElement.as(DOM.createDiv()); private DivElement messageAndButtonsWrapper = DivElement .as(DOM.createDiv()); private DivElement messageWrapper = DivElement.as(DOM.createDiv()); private DivElement buttonsWrapper = DivElement.as(DOM.createDiv()); private DivElement message = DivElement.as(DOM.createDiv()); private Map<Column<?, T>, Widget> columnToWidget = new HashMap<>(); private List<HandlerRegistration> focusHandlers = new ArrayList<>(); private boolean enabled = false; private State state = State.INACTIVE; private int rowIndex = -1; private int focusedColumnIndexDOM = -1; private String styleName = null; private HandlerRegistration hScrollHandler; private HandlerRegistration vScrollHandler; private final Button saveButton; private final Button cancelButton; | /**
* Handles editor-related events in an appropriate way. Opens,
* moves, or closes the editor based on the given event.
*
* @param event
* the received event
* @return true if the event was handled and nothing else should be
* done, false otherwise
*/ | Handles editor-related events in an appropriate way. Opens, moves, or closes the editor based on the given event | handleEvent | {
"repo_name": "peterl1084/framework",
"path": "client/src/main/java/com/vaadin/client/widgets/Grid.java",
"license": "apache-2.0",
"size": 332371
} | [
"com.google.gwt.dom.client.DivElement",
"com.google.gwt.event.shared.HandlerRegistration",
"com.google.gwt.user.client.DOM",
"com.google.gwt.user.client.ui.Button",
"com.google.gwt.user.client.ui.Widget",
"com.vaadin.client.widget.grid.DefaultEditorEventHandler",
"com.vaadin.client.widget.grid.EditorHandler",
"com.vaadin.client.widgets.Grid",
"java.util.ArrayList",
"java.util.HashMap",
"java.util.List",
"java.util.Map"
] | import com.google.gwt.dom.client.DivElement; import com.google.gwt.event.shared.HandlerRegistration; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.Widget; import com.vaadin.client.widget.grid.DefaultEditorEventHandler; import com.vaadin.client.widget.grid.EditorHandler; import com.vaadin.client.widgets.Grid; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; | import com.google.gwt.dom.client.*; import com.google.gwt.event.shared.*; import com.google.gwt.user.client.*; import com.google.gwt.user.client.ui.*; import com.vaadin.client.widget.grid.*; import com.vaadin.client.widgets.*; import java.util.*; | [
"com.google.gwt",
"com.vaadin.client",
"java.util"
] | com.google.gwt; com.vaadin.client; java.util; | 1,349,259 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.