method
stringlengths 13
441k
| clean_method
stringlengths 7
313k
| doc
stringlengths 17
17.3k
| comment
stringlengths 3
1.42k
| method_name
stringlengths 1
273
| extra
dict | imports
list | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
list | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
|---|---|---|---|---|---|---|---|---|---|---|---|
public HTTPVersion getHttpVersion() {
return httpVersion;
}
|
HTTPVersion function() { return httpVersion; }
|
/**
* Get the used HTTP version for this response. Defaults to 1.1
*
* @return The used HTTP version.
*/
|
Get the used HTTP version for this response. Defaults to 1.1
|
getHttpVersion
|
{
"repo_name": "hanbei/mock-httpserver",
"path": "src/main/java/de/hanbei/httpserver/response/Response.java",
"license": "apache-2.0",
"size": 4340
}
|
[
"de.hanbei.httpserver.common.HTTPVersion"
] |
import de.hanbei.httpserver.common.HTTPVersion;
|
import de.hanbei.httpserver.common.*;
|
[
"de.hanbei.httpserver"
] |
de.hanbei.httpserver;
| 2,865,696
|
public Vector<String> getMatches() {
return m_Matches;
}
|
Vector<String> function() { return m_Matches; }
|
/**
* returns the matches from the last find call.
*
* @return the matching classname from the last find run
*/
|
returns the matches from the last find call
|
getMatches
|
{
"repo_name": "dsibournemouth/autoweka",
"path": "weka-3.7.7/src/main/java/weka/core/FindWithCapabilities.java",
"license": "gpl-3.0",
"size": 28983
}
|
[
"java.util.Vector"
] |
import java.util.Vector;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 920,640
|
public boolean isActionRedirect(String address, int n) {
boolean result = false;
Object action = actionsExecuted.get(n);
if (action != null && action instanceof ActionRedirect) {
ActionRedirect actionRedirect = (ActionRedirect) action;
result = address.equals(actionRedirect.getAddress());
}
return result;
}
|
boolean function(String address, int n) { boolean result = false; Object action = actionsExecuted.get(n); if (action != null && action instanceof ActionRedirect) { ActionRedirect actionRedirect = (ActionRedirect) action; result = address.equals(actionRedirect.getAddress()); } return result; }
|
/**
* Is the <code>n<code>'th action a <code>Redirect</code>
* with given address?
* @param address <code>String</code> redirect address
* @param n index to check
* @return true if the <code>n<code>'th action is a <code>Redirect</code>
* with given redirect address
*/
|
Is the <code>n<code>'th action a <code>Redirect</code> with given address
|
isActionRedirect
|
{
"repo_name": "aduprat/james-jsieve",
"path": "util/src/main/java/org/apache/jsieve/util/check/ScriptChecker.java",
"license": "apache-2.0",
"size": 8747
}
|
[
"org.apache.jsieve.mail.ActionRedirect"
] |
import org.apache.jsieve.mail.ActionRedirect;
|
import org.apache.jsieve.mail.*;
|
[
"org.apache.jsieve"
] |
org.apache.jsieve;
| 263,364
|
private boolean internalIsStoredInSD(File file){
SparseArray<String> basePaths = StorageHelper.getInstance(sContext).getBasePaths();
int availableStorage = basePaths.size();
//If there are only one storage, no need to check
// where is stored file.
if(availableStorage < 2)
return false;
//The position 0 belongs to non removable external storage.
for(int d = 0 ; d < availableStorage ; d++){
if(d == 0 && file.getParent().contains(basePaths.get(d)) ){
return false;
}
}
return true;
}
|
boolean function(File file){ SparseArray<String> basePaths = StorageHelper.getInstance(sContext).getBasePaths(); int availableStorage = basePaths.size(); if(availableStorage < 2) return false; for(int d = 0 ; d < availableStorage ; d++){ if(d == 0 && file.getParent().contains(basePaths.get(d)) ){ return false; } } return true; }
|
/**
* Check if file is stored on SD card or Non removable storage.
* @return True if file is stored in SD, false otherwise.
*/
|
Check if file is stored on SD card or Non removable storage
|
internalIsStoredInSD
|
{
"repo_name": "frank240889/MusicalLibraryOrganizer",
"path": "app/src/main/java/mx/dev/franco/automusictagfixer/utilities/StorageHelper.java",
"license": "gpl-3.0",
"size": 5575
}
|
[
"android.util.SparseArray",
"java.io.File"
] |
import android.util.SparseArray; import java.io.File;
|
import android.util.*; import java.io.*;
|
[
"android.util",
"java.io"
] |
android.util; java.io;
| 1,223,383
|
public int update(Connection conn, String sql, Object param) throws SQLException {
return execute(() -> queryRunner.update(conn, sql, param));
}
|
int function(Connection conn, String sql, Object param) throws SQLException { return execute(() -> queryRunner.update(conn, sql, param)); }
|
/**
* Execute an SQL INSERT, UPDATE, or DELETE query with a single replacement parameter.
*
* @param conn The connection to use to run the query.
* @param sql The SQL to execute.
* @param param The replacement parameter.
* @return The number of rows updated.
* @throws SQLException if a database access error occurs
*/
|
Execute an SQL INSERT, UPDATE, or DELETE query with a single replacement parameter
|
update
|
{
"repo_name": "AirVantage/av-sched",
"path": "src/main/java/net/airvantage/sched/dao/QueryExecutor.java",
"license": "mit",
"size": 15385
}
|
[
"java.sql.Connection",
"java.sql.SQLException"
] |
import java.sql.Connection; import java.sql.SQLException;
|
import java.sql.*;
|
[
"java.sql"
] |
java.sql;
| 2,129,132
|
private static URI removeQuery(final URI link) {
final String query = link.getRawQuery();
final URI uri;
if (query == null) {
uri = link;
} else {
final String href = link.toString();
uri = URI.create(
href.substring(0, href.length() - query.length() - 1)
);
}
return uri;
}
|
static URI function(final URI link) { final String query = link.getRawQuery(); final URI uri; if (query == null) { uri = link; } else { final String href = link.toString(); uri = URI.create( href.substring(0, href.length() - query.length() - 1) ); } return uri; }
|
/**
* Remove the query part from the provided URI and return the resulting URI.
* @param link The link from which the query needs to be removed.
* @return The URI corresponding to the same provided URI but without the
* query part.
*/
|
Remove the query part from the provided URI and return the resulting URI
|
removeQuery
|
{
"repo_name": "xupyprmv/takes",
"path": "src/main/java/org/takes/misc/Href.java",
"license": "mit",
"size": 10464
}
|
[
"java.net.URI"
] |
import java.net.URI;
|
import java.net.*;
|
[
"java.net"
] |
java.net;
| 2,133,655
|
public IncludeExclude includeExclude() {
return includeExclude;
}
|
IncludeExclude function() { return includeExclude; }
|
/**
* Get terms to include and exclude from the aggregation results
*/
|
Get terms to include and exclude from the aggregation results
|
includeExclude
|
{
"repo_name": "HonzaKral/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/search/aggregations/bucket/significant/SignificantTextAggregationBuilder.java",
"license": "apache-2.0",
"size": 16539
}
|
[
"org.elasticsearch.search.aggregations.bucket.terms.IncludeExclude"
] |
import org.elasticsearch.search.aggregations.bucket.terms.IncludeExclude;
|
import org.elasticsearch.search.aggregations.bucket.terms.*;
|
[
"org.elasticsearch.search"
] |
org.elasticsearch.search;
| 2,237,214
|
public FluentCv filterCirclesToLine(double maxDistance, String... tag) {
if (this.mat.cols() < 2) {
return store(this.mat, tag);
}
List<Point> points = new ArrayList<>();
// collect the circles into a list of points
for (int i = 0; i < this.mat.cols(); i++) {
float[] circle = new float[3];
this.mat.get(0, i, circle);
float x = circle[0];
float y = circle[1];
points.add(new Point(x, y));
}
List<Ransac.Line> lines = Ransac.ransac(points, 100, maxDistance);
Point a = lines.get(0).a;
Point b = lines.get(0).b;
// filter the points by distance from the resulting line
List<float[]> results = new ArrayList<>();
for (int i = 0; i < this.mat.cols(); i++) {
float[] circle = new float[3];
this.mat.get(0, i, circle);
Point p = new Point(circle[0], circle[1]);
if (pointToLineDistance(a, b, p) <= maxDistance) {
results.add(circle);
}
}
// It really seems like there must be a better way to do this, but after hours
// and hours of trying I can't find one. How the hell do you append an element
// of 3 channels to a Mat?!
Mat r = new Mat(1, results.size(), CvType.CV_32FC3);
for (int i = 0; i < results.size(); i++) {
r.put(0, i, results.get(i));
}
return store(r, tag);
}
|
FluentCv function(double maxDistance, String... tag) { if (this.mat.cols() < 2) { return store(this.mat, tag); } List<Point> points = new ArrayList<>(); for (int i = 0; i < this.mat.cols(); i++) { float[] circle = new float[3]; this.mat.get(0, i, circle); float x = circle[0]; float y = circle[1]; points.add(new Point(x, y)); } List<Ransac.Line> lines = Ransac.ransac(points, 100, maxDistance); Point a = lines.get(0).a; Point b = lines.get(0).b; List<float[]> results = new ArrayList<>(); for (int i = 0; i < this.mat.cols(); i++) { float[] circle = new float[3]; this.mat.get(0, i, circle); Point p = new Point(circle[0], circle[1]); if (pointToLineDistance(a, b, p) <= maxDistance) { results.add(circle); } } Mat r = new Mat(1, results.size(), CvType.CV_32FC3); for (int i = 0; i < results.size(); i++) { r.put(0, i, results.get(i)); } return store(r, tag); }
|
/**
* Filter circles as returned from e.g. houghCircles to only those that are within maxDistance
* of the best fitting line.
*
* @param tag
* @return
*/
|
Filter circles as returned from e.g. houghCircles to only those that are within maxDistance of the best fitting line
|
filterCirclesToLine
|
{
"repo_name": "richard-sim/openpnp",
"path": "src/main/java/org/openpnp/vision/FluentCv.java",
"license": "gpl-3.0",
"size": 29276
}
|
[
"java.util.ArrayList",
"java.util.List",
"org.opencv.core.CvType",
"org.opencv.core.Mat",
"org.opencv.core.Point"
] |
import java.util.ArrayList; import java.util.List; import org.opencv.core.CvType; import org.opencv.core.Mat; import org.opencv.core.Point;
|
import java.util.*; import org.opencv.core.*;
|
[
"java.util",
"org.opencv.core"
] |
java.util; org.opencv.core;
| 960,950
|
public InputStream getInputStream(int index) {
return ins[index];
}
|
InputStream function(int index) { return ins[index]; }
|
/**
* Returns the unbuffered stream with the value for {@code index}.
*/
|
Returns the unbuffered stream with the value for index
|
getInputStream
|
{
"repo_name": "moltin/android-example",
"path": "shutterbug/src/main/java/com/applidium/shutterbug/cache/DiskLruCache.java",
"license": "mit",
"size": 33066
}
|
[
"java.io.InputStream"
] |
import java.io.InputStream;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,341,516
|
public short getNodeType() {
return Node.TEXT_NODE;
}
|
short function() { return Node.TEXT_NODE; }
|
/**
* A short integer indicating what type of node this is. The named
* constants for this value are defined in the org.w3c.dom.Node interface.
*/
|
A short integer indicating what type of node this is. The named constants for this value are defined in the org.w3c.dom.Node interface
|
getNodeType
|
{
"repo_name": "itgeeker/jdk",
"path": "src/com/sun/org/apache/xerces/internal/dom/TextImpl.java",
"license": "apache-2.0",
"size": 23022
}
|
[
"org.w3c.dom.Node"
] |
import org.w3c.dom.Node;
|
import org.w3c.dom.*;
|
[
"org.w3c.dom"
] |
org.w3c.dom;
| 2,460,715
|
public Date getDate() {
return date;
}
|
Date function() { return date; }
|
/**
* Method declaration
* @return
* @see
*/
|
Method declaration
|
getDate
|
{
"repo_name": "NicolasEYSSERIC/Silverpeas-Core",
"path": "web-core/src/main/java/com/stratelia/webactiv/util/viewGenerator/html/monthCalendar/Day.java",
"license": "agpl-3.0",
"size": 3730
}
|
[
"java.util.Date"
] |
import java.util.Date;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,524,895
|
@SuppressWarnings("rawtypes")
@Override
public Object getAdapter(Class key) {
if (key.equals(IContentOutlinePage.class)) {
return showOutlineView() ? getContentOutlinePage() : null;
}
else if (key.equals(IPropertySheetPage.class)) {
return getPropertySheetPage();
}
else if (key.equals(IGotoMarker.class)) {
return this;
}
else {
return super.getAdapter(key);
}
}
|
@SuppressWarnings(STR) Object function(Class key) { if (key.equals(IContentOutlinePage.class)) { return showOutlineView() ? getContentOutlinePage() : null; } else if (key.equals(IPropertySheetPage.class)) { return getPropertySheetPage(); } else if (key.equals(IGotoMarker.class)) { return this; } else { return super.getAdapter(key); } }
|
/**
* This is how the framework determines which interfaces we implement.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
|
This is how the framework determines which interfaces we implement.
|
getAdapter
|
{
"repo_name": "ObeoNetwork/EAST-ADL-Designer",
"path": "plugins/org.obeonetwork.dsl.eastadl.editor/src/org/obeonetwork/dsl/east_adl/requirements/presentation/RequirementsEditor.java",
"license": "epl-1.0",
"size": 56816
}
|
[
"org.eclipse.ui.ide.IGotoMarker",
"org.eclipse.ui.views.contentoutline.IContentOutlinePage",
"org.eclipse.ui.views.properties.IPropertySheetPage"
] |
import org.eclipse.ui.ide.IGotoMarker; import org.eclipse.ui.views.contentoutline.IContentOutlinePage; import org.eclipse.ui.views.properties.IPropertySheetPage;
|
import org.eclipse.ui.ide.*; import org.eclipse.ui.views.contentoutline.*; import org.eclipse.ui.views.properties.*;
|
[
"org.eclipse.ui"
] |
org.eclipse.ui;
| 813,950
|
public void removeFolder(String folderId,
Map serverItems,
String source_uri,
long principalId,
String username)
throws EntityException {
String fullpath;
IMAPFolder f;
if (folderId.equalsIgnoreCase(Def.FOLDER_INBOX_ID) ||
folderId.equalsIgnoreCase(Def.FOLDER_OUTBOX_ID) ||
folderId.equalsIgnoreCase(Def.FOLDER_SENT_ID) ||
folderId.equalsIgnoreCase(Def.FOLDER_DRAFTS_ID) ||
folderId.equalsIgnoreCase(Def.FOLDER_TRASH_ID)) {
throw new EntityException("You can't delete this Folder");
} else {
try {
fullpath = this.ied.getFullPathFromGUID(folderId, source_uri, principalId, username);
if (fullpath != null) {
// remove folder from MailServer
f = (IMAPFolder) this.imsw.getMailDefaultFolder().getFolder(fullpath);
if (f.exists()) {
this.ied.removeFolderInServer(f);
}
// remove folder from Local DB
this.ied.removeFolderInDB(folderId, source_uri, principalId, username);
// remove folder from serverItems
this.ied.removeItemInServerItems(folderId, serverItems);
}
} catch (MessagingException me) {
throw new EntityException(me);
}
}
}
|
void function(String folderId, Map serverItems, String source_uri, long principalId, String username) throws EntityException { String fullpath; IMAPFolder f; if (folderId.equalsIgnoreCase(Def.FOLDER_INBOX_ID) folderId.equalsIgnoreCase(Def.FOLDER_OUTBOX_ID) folderId.equalsIgnoreCase(Def.FOLDER_SENT_ID) folderId.equalsIgnoreCase(Def.FOLDER_DRAFTS_ID) folderId.equalsIgnoreCase(Def.FOLDER_TRASH_ID)) { throw new EntityException(STR); } else { try { fullpath = this.ied.getFullPathFromGUID(folderId, source_uri, principalId, username); if (fullpath != null) { f = (IMAPFolder) this.imsw.getMailDefaultFolder().getFolder(fullpath); if (f.exists()) { this.ied.removeFolderInServer(f); } this.ied.removeFolderInDB(folderId, source_uri, principalId, username); this.ied.removeItemInServerItems(folderId, serverItems); } } catch (MessagingException me) { throw new EntityException(me); } } }
|
/**
* deletes a Folder
*
* @param folderId String
* @param source_uri String
* @param principalId long
* @throws EntityException
*/
|
deletes a Folder
|
removeFolder
|
{
"repo_name": "accesstest3/cfunambol",
"path": "modules/email/email-core/src/main/java/com/funambol/email/items/manager/ImapEntityManager.java",
"license": "agpl-3.0",
"size": 94235
}
|
[
"com.funambol.email.exception.EntityException",
"com.funambol.email.util.Def",
"com.sun.mail.imap.IMAPFolder",
"java.util.Map",
"javax.mail.MessagingException"
] |
import com.funambol.email.exception.EntityException; import com.funambol.email.util.Def; import com.sun.mail.imap.IMAPFolder; import java.util.Map; import javax.mail.MessagingException;
|
import com.funambol.email.exception.*; import com.funambol.email.util.*; import com.sun.mail.imap.*; import java.util.*; import javax.mail.*;
|
[
"com.funambol.email",
"com.sun.mail",
"java.util",
"javax.mail"
] |
com.funambol.email; com.sun.mail; java.util; javax.mail;
| 1,945,841
|
@SuppressWarnings("unchecked")
protected String doIt() throws Exception {
MView viewFrom = new MView(getCtx(), p_AD_View_ID, get_TrxName());
MView viewTo = new MView(getCtx(), p_Record_ID, get_TrxName());
viewFrom.copyValues(viewFrom, viewTo);
viewTo.saveEx();
for (MViewDefinition viewDefinitionFrom : viewFrom.getViewDefinitions()) {
MViewDefinition viewDefinitionTo = new MViewDefinition(getCtx(), 0,
get_TrxName());
viewDefinitionFrom.copyValues(viewDefinitionFrom, viewDefinitionTo);
viewDefinitionTo.saveEx();
for (MViewColumn viewColumnFrom : viewDefinitionFrom
.getADViewColunms()) {
MViewColumn viewColumnTo = new MViewColumn(getCtx(), 0,
get_TrxName());
viewColumnFrom.copyValues(viewColumnFrom, viewColumnTo);
viewColumnTo.saveEx();
}
}
return "@Ok@";
}
|
@SuppressWarnings(STR) String function() throws Exception { MView viewFrom = new MView(getCtx(), p_AD_View_ID, get_TrxName()); MView viewTo = new MView(getCtx(), p_Record_ID, get_TrxName()); viewFrom.copyValues(viewFrom, viewTo); viewTo.saveEx(); for (MViewDefinition viewDefinitionFrom : viewFrom.getViewDefinitions()) { MViewDefinition viewDefinitionTo = new MViewDefinition(getCtx(), 0, get_TrxName()); viewDefinitionFrom.copyValues(viewDefinitionFrom, viewDefinitionTo); viewDefinitionTo.saveEx(); for (MViewColumn viewColumnFrom : viewDefinitionFrom .getADViewColunms()) { MViewColumn viewColumnTo = new MViewColumn(getCtx(), 0, get_TrxName()); viewColumnFrom.copyValues(viewColumnFrom, viewColumnTo); viewColumnTo.saveEx(); } } return "@Ok@"; }
|
/**
* Copy view from other view
*
* @return result string
*/
|
Copy view from other view
|
doIt
|
{
"repo_name": "geneos/adempiere",
"path": "base/src/org/eevolution/process/ViewCopyFrom.java",
"license": "gpl-2.0",
"size": 3305
}
|
[
"org.adempiere.model.MView",
"org.adempiere.model.MViewColumn",
"org.adempiere.model.MViewDefinition"
] |
import org.adempiere.model.MView; import org.adempiere.model.MViewColumn; import org.adempiere.model.MViewDefinition;
|
import org.adempiere.model.*;
|
[
"org.adempiere.model"
] |
org.adempiere.model;
| 766,037
|
public void messageLogged(BuildEvent event) {
if (event.getPriority() > logLevel) {
// ignore event
return;
}
if (event.getPriority() == Project.MSG_INFO || event.getPriority() == Project.MSG_WARN
|| event.getPriority() == Project.MSG_ERR) {
logBuffer.append(event.getMessage());
}
fullLogBuffer.append(event.getMessage());
}
}
|
void function(BuildEvent event) { if (event.getPriority() > logLevel) { return; } if (event.getPriority() == Project.MSG_INFO event.getPriority() == Project.MSG_WARN event.getPriority() == Project.MSG_ERR) { logBuffer.append(event.getMessage()); } fullLogBuffer.append(event.getMessage()); } }
|
/**
* Fired whenever a message is logged.
*
* @see BuildEvent#getMessage()
* @see BuildEvent#getPriority()
*/
|
Fired whenever a message is logged
|
messageLogged
|
{
"repo_name": "apache/ant-easyant-core",
"path": "src/test/java/org/apache/easyant/core/EasyAntBaseTest.java",
"license": "apache-2.0",
"size": 22958
}
|
[
"org.apache.tools.ant.BuildEvent",
"org.apache.tools.ant.Project"
] |
import org.apache.tools.ant.BuildEvent; import org.apache.tools.ant.Project;
|
import org.apache.tools.ant.*;
|
[
"org.apache.tools"
] |
org.apache.tools;
| 634,599
|
Pageable getDefinitionPageable();
|
Pageable getDefinitionPageable();
|
/**
* Pabeable for find definitions used on record details and on form projections.
* All defined form definitions are returned by default sorted by order or by main definition, if order is not defined (~ fallback).
*
* @return default form definition pagination + sort
* @since 11.1.0
*/
|
Pabeable for find definitions used on record details and on form projections. All defined form definitions are returned by default sorted by order or by main definition, if order is not defined (~ fallback)
|
getDefinitionPageable
|
{
"repo_name": "bcvsolutions/CzechIdMng",
"path": "Realization/backend/core/core-api/src/main/java/eu/bcvsolutions/idm/core/eav/api/service/FormService.java",
"license": "mit",
"size": 39367
}
|
[
"org.springframework.data.domain.Pageable"
] |
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.*;
|
[
"org.springframework.data"
] |
org.springframework.data;
| 1,081,575
|
public static <T> T splitEachLine(CharSequence self, CharSequence regex, @ClosureParams(value=FromString.class,options={"List<String>","String[]"},conflictResolutionStrategy=PickFirstResolver.class) Closure<T> closure) throws IOException {
return splitEachLine(self, Pattern.compile(regex.toString()), closure);
}
|
static <T> T function(CharSequence self, CharSequence regex, @ClosureParams(value=FromString.class,options={STR,STR},conflictResolutionStrategy=PickFirstResolver.class) Closure<T> closure) throws IOException { return splitEachLine(self, Pattern.compile(regex.toString()), closure); }
|
/**
* Iterates through the given CharSequence line by line, splitting each line using
* the given regex delimiter. The list of tokens for each line is then passed to
* the given closure.
*
* @param self a CharSequence
* @param regex the delimiting regular expression
* @param closure a closure
* @return the last value returned by the closure
* @throws java.io.IOException if an error occurs
* @throws java.util.regex.PatternSyntaxException if the regular expression's syntax is invalid
* @see #splitEachLine(CharSequence, java.util.regex.Pattern, groovy.lang.Closure)
* @since 1.8.2
*/
|
Iterates through the given CharSequence line by line, splitting each line using the given regex delimiter. The list of tokens for each line is then passed to the given closure
|
splitEachLine
|
{
"repo_name": "pledbrook/incubator-groovy",
"path": "src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java",
"license": "apache-2.0",
"size": 142054
}
|
[
"groovy.lang.Closure",
"groovy.transform.stc.ClosureParams",
"groovy.transform.stc.FromString",
"groovy.transform.stc.PickFirstResolver",
"java.io.IOException",
"java.util.regex.Pattern"
] |
import groovy.lang.Closure; import groovy.transform.stc.ClosureParams; import groovy.transform.stc.FromString; import groovy.transform.stc.PickFirstResolver; import java.io.IOException; import java.util.regex.Pattern;
|
import groovy.lang.*; import groovy.transform.stc.*; import java.io.*; import java.util.regex.*;
|
[
"groovy.lang",
"groovy.transform.stc",
"java.io",
"java.util"
] |
groovy.lang; groovy.transform.stc; java.io; java.util;
| 1,893,634
|
public List<LatLng> getOuterBoundaryCoordinates() {
return mOuterBoundaryCoordinates;
}
|
List<LatLng> function() { return mOuterBoundaryCoordinates; }
|
/**
* Gets an array of outer boundary coordinates
*
* @return array of outer boundary coordinates
*/
|
Gets an array of outer boundary coordinates
|
getOuterBoundaryCoordinates
|
{
"repo_name": "googlemaps/android-maps-utils",
"path": "library/src/main/java/com/google/maps/android/data/kml/KmlPolygon.java",
"license": "apache-2.0",
"size": 3364
}
|
[
"com.google.android.gms.maps.model.LatLng",
"java.util.List"
] |
import com.google.android.gms.maps.model.LatLng; import java.util.List;
|
import com.google.android.gms.maps.model.*; import java.util.*;
|
[
"com.google.android",
"java.util"
] |
com.google.android; java.util;
| 2,596,791
|
public boolean supportsRootPasswordChange() throws CloudException, InternalException;
|
boolean function() throws CloudException, InternalException;
|
/**
* Indicates whether the cloud supports the changing of the root user password after the rds instance is created
* @return true if the password can be changed
* @throws CloudException an error occurred in the cloud provider
* @throws InternalException an error occurred within the Dasein Cloud implementation
*/
|
Indicates whether the cloud supports the changing of the root user password after the rds instance is created
|
supportsRootPasswordChange
|
{
"repo_name": "JanewzhWang/dasein-cloud-core",
"path": "src/main/java/org/dasein/cloud/platform/RelationalDatabaseCapabilities.java",
"license": "apache-2.0",
"size": 6075
}
|
[
"org.dasein.cloud.CloudException",
"org.dasein.cloud.InternalException"
] |
import org.dasein.cloud.CloudException; import org.dasein.cloud.InternalException;
|
import org.dasein.cloud.*;
|
[
"org.dasein.cloud"
] |
org.dasein.cloud;
| 424,524
|
public static float[] checkNotEmpty(float[] array) {
Preconditions.checkNotNull(array);
if (array.length == 0) {
throw new IllegalArgumentException();
}
return array;
}
/**
* Ensures that an array is not empty.
*
* @param array an array
* @param errorMessage the exception message to use if the check fails; will be converted to a string using
* {@link String#valueOf(Object)}
|
static float[] function(float[] array) { Preconditions.checkNotNull(array); if (array.length == 0) { throw new IllegalArgumentException(); } return array; } /** * Ensures that an array is not empty. * * @param array an array * @param errorMessage the exception message to use if the check fails; will be converted to a string using * {@link String#valueOf(Object)}
|
/**
* Ensures that an array is not empty.
*
* @param array an array
* @return the non-empty array that was validated
* @throws NullPointerException if {@code array} is null
* @throws IllegalArgumentException if {@code array} empty.
*/
|
Ensures that an array is not empty
|
checkNotEmpty
|
{
"repo_name": "equus52/carbine-common",
"path": "src/main/java/equus/carbine/util/Preconditions2.java",
"license": "mit",
"size": 13153
}
|
[
"com.google.common.base.Preconditions"
] |
import com.google.common.base.Preconditions;
|
import com.google.common.base.*;
|
[
"com.google.common"
] |
com.google.common;
| 1,341,020
|
public String content( MediaType contentType )
{
if ( contentType.isCompatibleWith( MediaType.APPLICATION_JSON ) )
{
fail( "Use one of the other content() methods for JSON" );
}
String actualContentType = header( "Content-Type" );
String expected = contentType.toString();
assertTrue( actualContentType.startsWith( expected ),
String.format( "Expected %s but was: %s", expected, actualContentType ) );
return failOnException( response::getContent );
}
|
String function( MediaType contentType ) { if ( contentType.isCompatibleWith( MediaType.APPLICATION_JSON ) ) { fail( STR ); } String actualContentType = header( STR ); String expected = contentType.toString(); assertTrue( actualContentType.startsWith( expected ), String.format( STR, expected, actualContentType ) ); return failOnException( response::getContent ); }
|
/**
* Access raw response body for non JSON responses
*
* @param contentType the expected content type
* @return raw content body in UTF-8 encoding
*/
|
Access raw response body for non JSON responses
|
content
|
{
"repo_name": "dhis2/dhis2-core",
"path": "dhis-2/dhis-web-api-test/src/test/java/org/hisp/dhis/webapi/WebClient.java",
"license": "bsd-3-clause",
"size": 12581
}
|
[
"org.hisp.dhis.webapi.utils.WebClientUtils",
"org.junit.jupiter.api.Assertions",
"org.springframework.http.MediaType"
] |
import org.hisp.dhis.webapi.utils.WebClientUtils; import org.junit.jupiter.api.Assertions; import org.springframework.http.MediaType;
|
import org.hisp.dhis.webapi.utils.*; import org.junit.jupiter.api.*; import org.springframework.http.*;
|
[
"org.hisp.dhis",
"org.junit.jupiter",
"org.springframework.http"
] |
org.hisp.dhis; org.junit.jupiter; org.springframework.http;
| 2,211,236
|
public Map<String, MessageExtensionUnmarshaller> getUnmarshallers() {
return Collections.unmodifiableMap(unmarshallers);
}
|
Map<String, MessageExtensionUnmarshaller> function() { return Collections.unmodifiableMap(unmarshallers); }
|
/**
* Get immutable map of all registered message unmarshallers.
*
* @return all message unmarshallers
*/
|
Get immutable map of all registered message unmarshallers
|
getUnmarshallers
|
{
"repo_name": "willnorris/java-openid",
"path": "src/main/java/edu/internet2/middleware/openid/extensions/MessageExtensionUnmarshallerFactory.java",
"license": "apache-2.0",
"size": 2903
}
|
[
"java.util.Collections",
"java.util.Map"
] |
import java.util.Collections; import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 401,303
|
public List<PimRegistryEntry> getEntries()
throws PimListenerException {
try {
return dao.getEntries();
} catch (DataAccessException ex) {
throw new PimListenerException("Error performing getEntriesBy", ex);
}
}
|
List<PimRegistryEntry> function() throws PimListenerException { try { return dao.getEntries(); } catch (DataAccessException ex) { throw new PimListenerException(STR, ex); } }
|
/**
* Returns a list with all entries
* @throws com.funambol.pimlistener.service.PimListenerException if an error occurs
* @return a list with all entries
*/
|
Returns a list with all entries
|
getEntries
|
{
"repo_name": "accesstest3/cfunambol",
"path": "modules/foundation/pim-listener/src/main/java/com/funambol/pimlistener/registry/PimRegistryEntryManager.java",
"license": "agpl-3.0",
"size": 9404
}
|
[
"com.funambol.pimlistener.service.PimListenerException",
"com.funambol.pushlistener.service.registry.dao.DataAccessException",
"java.util.List"
] |
import com.funambol.pimlistener.service.PimListenerException; import com.funambol.pushlistener.service.registry.dao.DataAccessException; import java.util.List;
|
import com.funambol.pimlistener.service.*; import com.funambol.pushlistener.service.registry.dao.*; import java.util.*;
|
[
"com.funambol.pimlistener",
"com.funambol.pushlistener",
"java.util"
] |
com.funambol.pimlistener; com.funambol.pushlistener; java.util;
| 1,683,163
|
public byte[] toBytecode() throws IOException, CannotCompileException {
ByteArrayOutputStream barray = new ByteArrayOutputStream();
DataOutputStream out = new DataOutputStream(barray);
try {
toBytecode(out);
}
finally {
out.close();
}
return barray.toByteArray();
}
|
byte[] function() throws IOException, CannotCompileException { ByteArrayOutputStream barray = new ByteArrayOutputStream(); DataOutputStream out = new DataOutputStream(barray); try { toBytecode(out); } finally { out.close(); } return barray.toByteArray(); }
|
/**
* Converts this class to a class file.
* Once this method is called, further modifications are not
* possible any more.
*
* @return the contents of the class file.
*/
|
Converts this class to a class file. Once this method is called, further modifications are not possible any more
|
toBytecode
|
{
"repo_name": "MeRPG/EndHQ-Libraries",
"path": "src/javassist/CtClass.java",
"license": "apache-2.0",
"size": 51280
}
|
[
"java.io.ByteArrayOutputStream",
"java.io.DataOutputStream",
"java.io.IOException"
] |
import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,510,541
|
private APIKey getAPIKeyFromOauthApp(String type, String keyManagerName,
OAuthApplicationInfo oAuthApplicationInfo){
APIKey apiKey = new APIKey();
apiKey.setType(type);
apiKey.setConsumerKey(oAuthApplicationInfo.getClientId());
apiKey.setConsumerSecret(oAuthApplicationInfo.getClientSecret());
apiKey.setGrantTypes((String) oAuthApplicationInfo.getParameter(GRANT_TYPES));
apiKey.setKeyManager(keyManagerName);
if (apiKey.getGrantTypes().contains(GRANT_TYPE_IMPLICIT) && apiKey.getGrantTypes().contains(GRANT_TYPE_CODE)){
apiKey.setCallbackUrl((String) oAuthApplicationInfo.getParameter(REDIRECT_URIS));
}
long validityPeriod = OAuthServerConfiguration.getInstance().getApplicationAccessTokenValidityPeriodInSeconds();
apiKey.setValidityPeriod(validityPeriod);
apiKey.setTokenScope(DEFAULT_TOKEN_SCOPE);
apiKey.setAdditionalProperties(oAuthApplicationInfo.getParameter(APIConstants.JSON_ADDITIONAL_PROPERTIES));
return apiKey;
}
|
APIKey function(String type, String keyManagerName, OAuthApplicationInfo oAuthApplicationInfo){ APIKey apiKey = new APIKey(); apiKey.setType(type); apiKey.setConsumerKey(oAuthApplicationInfo.getClientId()); apiKey.setConsumerSecret(oAuthApplicationInfo.getClientSecret()); apiKey.setGrantTypes((String) oAuthApplicationInfo.getParameter(GRANT_TYPES)); apiKey.setKeyManager(keyManagerName); if (apiKey.getGrantTypes().contains(GRANT_TYPE_IMPLICIT) && apiKey.getGrantTypes().contains(GRANT_TYPE_CODE)){ apiKey.setCallbackUrl((String) oAuthApplicationInfo.getParameter(REDIRECT_URIS)); } long validityPeriod = OAuthServerConfiguration.getInstance().getApplicationAccessTokenValidityPeriodInSeconds(); apiKey.setValidityPeriod(validityPeriod); apiKey.setTokenScope(DEFAULT_TOKEN_SCOPE); apiKey.setAdditionalProperties(oAuthApplicationInfo.getParameter(APIConstants.JSON_ADDITIONAL_PROPERTIES)); return apiKey; }
|
/**
* This extracts information for creating an APIKey from an OAuthApplication
* @param type Type of the OAuthApp(SANDBOX or PRODUCTION)
* @param keyManagerName
* @param oAuthApplicationInfo OAuth Application information
* @return An APIKey containing keys from OAuthApplication
*/
|
This extracts information for creating an APIKey from an OAuthApplication
|
getAPIKeyFromOauthApp
|
{
"repo_name": "jaadds/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.rest.api.admin/src/main/java/org/wso2/carbon/apimgt/rest/api/admin/impl/ImportApiServiceImpl.java",
"license": "apache-2.0",
"size": 14914
}
|
[
"org.wso2.carbon.apimgt.api.model.APIKey",
"org.wso2.carbon.apimgt.api.model.OAuthApplicationInfo",
"org.wso2.carbon.apimgt.impl.APIConstants",
"org.wso2.carbon.identity.oauth.config.OAuthServerConfiguration"
] |
import org.wso2.carbon.apimgt.api.model.APIKey; import org.wso2.carbon.apimgt.api.model.OAuthApplicationInfo; import org.wso2.carbon.apimgt.impl.APIConstants; import org.wso2.carbon.identity.oauth.config.OAuthServerConfiguration;
|
import org.wso2.carbon.apimgt.api.model.*; import org.wso2.carbon.apimgt.impl.*; import org.wso2.carbon.identity.oauth.config.*;
|
[
"org.wso2.carbon"
] |
org.wso2.carbon;
| 1,741,576
|
@Test
public void testSendScheduleOrUpdateConsumersMessage() throws Exception {
{
// Pipelined, send message => notify
ResultPartitionConsumableNotifier notifier = mock(ResultPartitionConsumableNotifier.class);
ResultPartition partition = createPartition(notifier, ResultPartitionType.PIPELINED, true);
partition.addBufferConsumer(createFilledBufferConsumer(BufferBuilderTestUtils.BUFFER_SIZE), 0);
verify(notifier, times(1))
.notifyPartitionConsumable(
eq(partition.getJobId()),
eq(partition.getPartitionId()),
any(TaskActions.class));
}
{
// Pipelined, don't send message => don't notify
ResultPartitionConsumableNotifier notifier = mock(ResultPartitionConsumableNotifier.class);
ResultPartition partition = createPartition(notifier, ResultPartitionType.PIPELINED, false);
partition.addBufferConsumer(createFilledBufferConsumer(BufferBuilderTestUtils.BUFFER_SIZE), 0);
verify(notifier, never()).notifyPartitionConsumable(any(JobID.class), any(ResultPartitionID.class), any(TaskActions.class));
}
{
// Blocking, send message => don't notify
ResultPartitionConsumableNotifier notifier = mock(ResultPartitionConsumableNotifier.class);
ResultPartition partition = createPartition(notifier, ResultPartitionType.BLOCKING, true);
partition.addBufferConsumer(createFilledBufferConsumer(BufferBuilderTestUtils.BUFFER_SIZE), 0);
verify(notifier, never()).notifyPartitionConsumable(any(JobID.class), any(ResultPartitionID.class), any(TaskActions.class));
}
{
// Blocking, don't send message => don't notify
ResultPartitionConsumableNotifier notifier = mock(ResultPartitionConsumableNotifier.class);
ResultPartition partition = createPartition(notifier, ResultPartitionType.BLOCKING, false);
partition.addBufferConsumer(createFilledBufferConsumer(BufferBuilderTestUtils.BUFFER_SIZE), 0);
verify(notifier, never()).notifyPartitionConsumable(any(JobID.class), any(ResultPartitionID.class), any(TaskActions.class));
}
}
|
void function() throws Exception { { ResultPartitionConsumableNotifier notifier = mock(ResultPartitionConsumableNotifier.class); ResultPartition partition = createPartition(notifier, ResultPartitionType.PIPELINED, true); partition.addBufferConsumer(createFilledBufferConsumer(BufferBuilderTestUtils.BUFFER_SIZE), 0); verify(notifier, times(1)) .notifyPartitionConsumable( eq(partition.getJobId()), eq(partition.getPartitionId()), any(TaskActions.class)); } { ResultPartitionConsumableNotifier notifier = mock(ResultPartitionConsumableNotifier.class); ResultPartition partition = createPartition(notifier, ResultPartitionType.PIPELINED, false); partition.addBufferConsumer(createFilledBufferConsumer(BufferBuilderTestUtils.BUFFER_SIZE), 0); verify(notifier, never()).notifyPartitionConsumable(any(JobID.class), any(ResultPartitionID.class), any(TaskActions.class)); } { ResultPartitionConsumableNotifier notifier = mock(ResultPartitionConsumableNotifier.class); ResultPartition partition = createPartition(notifier, ResultPartitionType.BLOCKING, true); partition.addBufferConsumer(createFilledBufferConsumer(BufferBuilderTestUtils.BUFFER_SIZE), 0); verify(notifier, never()).notifyPartitionConsumable(any(JobID.class), any(ResultPartitionID.class), any(TaskActions.class)); } { ResultPartitionConsumableNotifier notifier = mock(ResultPartitionConsumableNotifier.class); ResultPartition partition = createPartition(notifier, ResultPartitionType.BLOCKING, false); partition.addBufferConsumer(createFilledBufferConsumer(BufferBuilderTestUtils.BUFFER_SIZE), 0); verify(notifier, never()).notifyPartitionConsumable(any(JobID.class), any(ResultPartitionID.class), any(TaskActions.class)); } }
|
/**
* Tests the schedule or update consumers message sending behaviour depending on the relevant flags.
*/
|
Tests the schedule or update consumers message sending behaviour depending on the relevant flags
|
testSendScheduleOrUpdateConsumersMessage
|
{
"repo_name": "ueshin/apache-flink",
"path": "flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/ResultPartitionTest.java",
"license": "apache-2.0",
"size": 10707
}
|
[
"org.apache.flink.api.common.JobID",
"org.apache.flink.runtime.io.network.buffer.BufferBuilderTestUtils",
"org.apache.flink.runtime.taskmanager.TaskActions",
"org.mockito.Matchers",
"org.mockito.Mockito"
] |
import org.apache.flink.api.common.JobID; import org.apache.flink.runtime.io.network.buffer.BufferBuilderTestUtils; import org.apache.flink.runtime.taskmanager.TaskActions; import org.mockito.Matchers; import org.mockito.Mockito;
|
import org.apache.flink.api.common.*; import org.apache.flink.runtime.io.network.buffer.*; import org.apache.flink.runtime.taskmanager.*; import org.mockito.*;
|
[
"org.apache.flink",
"org.mockito"
] |
org.apache.flink; org.mockito;
| 855,550
|
public void setOutputList(List<FoodProductionProcessItem> outputList) {
this.outputList = outputList;
}
|
void function(List<FoodProductionProcessItem> outputList) { this.outputList = outputList; }
|
/**
* Sets the list of the output items produced by the process.
* @param outputList the output items.
*/
|
Sets the list of the output items produced by the process
|
setOutputList
|
{
"repo_name": "mars-sim/mars-sim",
"path": "mars-sim-core/src/main/java/org/mars_sim/msp/core/foodProduction/FoodProductionProcessInfo.java",
"license": "gpl-3.0",
"size": 6102
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 613,124
|
Vector3ic getPosition();
|
Vector3ic getPosition();
|
/**
* Chunk task position. used for ChunkTask Sorting.
*
* @return
*/
|
Chunk task position. used for ChunkTask Sorting
|
getPosition
|
{
"repo_name": "Malanius/Terasology",
"path": "engine/src/main/java/org/terasology/world/chunks/pipeline/stages/ChunkTask.java",
"license": "apache-2.0",
"size": 922
}
|
[
"org.joml.Vector3ic"
] |
import org.joml.Vector3ic;
|
import org.joml.*;
|
[
"org.joml"
] |
org.joml;
| 1,903,978
|
public static Predicate<Number> lessThan(final Number value) {
return new Predicate<Number>() {
|
static Predicate<Number> function(final Number value) { return new Predicate<Number>() {
|
/**
* If a number is less than.
*
* @param value
* @return A number criteria
*/
|
If a number is less than
|
lessThan
|
{
"repo_name": "kristianolsson/tools4j",
"path": "support/support-test/src/main/java/org/deephacks/tools4j/support/test/Criteria.java",
"license": "apache-2.0",
"size": 9447
}
|
[
"com.google.common.base.Predicate"
] |
import com.google.common.base.Predicate;
|
import com.google.common.base.*;
|
[
"com.google.common"
] |
com.google.common;
| 2,552,698
|
public List<PhoneNumber> getPhoneNumbers() {
return phoneNumbers;
}
|
List<PhoneNumber> function() { return phoneNumbers; }
|
/**
* A list of phone numbers associated with the account by the financial institution. May be an empty array if no relevant information is returned from the financial institution.
* @return phoneNumbers
**/
|
A list of phone numbers associated with the account by the financial institution. May be an empty array if no relevant information is returned from the financial institution
|
getPhoneNumbers
|
{
"repo_name": "plaid/plaid-java",
"path": "src/main/java/com/plaid/client/model/Owner.java",
"license": "mit",
"size": 7288
}
|
[
"com.plaid.client.model.PhoneNumber",
"java.util.List"
] |
import com.plaid.client.model.PhoneNumber; import java.util.List;
|
import com.plaid.client.model.*; import java.util.*;
|
[
"com.plaid.client",
"java.util"
] |
com.plaid.client; java.util;
| 946,400
|
public final void collectExistingBucket(LeafBucketCollector subCollector, int doc, long bucketOrd) throws IOException {
docCounts.increment(bucketOrd, 1);
subCollector.collect(doc, bucketOrd);
}
|
final void function(LeafBucketCollector subCollector, int doc, long bucketOrd) throws IOException { docCounts.increment(bucketOrd, 1); subCollector.collect(doc, bucketOrd); }
|
/**
* Same as {@link #collectBucket(LeafBucketCollector, int, long)}, but doesn't check if the docCounts needs to be re-sized.
*/
|
Same as <code>#collectBucket(LeafBucketCollector, int, long)</code>, but doesn't check if the docCounts needs to be re-sized
|
collectExistingBucket
|
{
"repo_name": "jimczi/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/search/aggregations/bucket/BucketsAggregator.java",
"license": "apache-2.0",
"size": 5552
}
|
[
"java.io.IOException",
"org.elasticsearch.search.aggregations.LeafBucketCollector"
] |
import java.io.IOException; import org.elasticsearch.search.aggregations.LeafBucketCollector;
|
import java.io.*; import org.elasticsearch.search.aggregations.*;
|
[
"java.io",
"org.elasticsearch.search"
] |
java.io; org.elasticsearch.search;
| 1,107,989
|
static DurableInput from(Iterable<DurableInput> inputs) {
Iterator<DurableInput> it = inputs.iterator();
DurableInput in = it.next();
return it.hasNext()
? new ConcatInput(
inputs,
new Bounds(null, 0, Iterators.toStream(inputs.iterator()).mapToLong(DurableInput::size).sum())
)
: in;
}
/**
* @return an input representing the byte interval between {@code [start, end)}
|
static DurableInput from(Iterable<DurableInput> inputs) { Iterator<DurableInput> it = inputs.iterator(); DurableInput in = it.next(); return it.hasNext() ? new ConcatInput( inputs, new Bounds(null, 0, Iterators.toStream(inputs.iterator()).mapToLong(DurableInput::size).sum()) ) : in; } /** * @return an input representing the byte interval between {@code [start, end)}
|
/**
* Constructs an input from the concatenation of one or more {@code inputs}.
*/
|
Constructs an input from the concatenation of one or more inputs
|
from
|
{
"repo_name": "lacuna/bifurcan",
"path": "src/io/lacuna/bifurcan/DurableInput.java",
"license": "mit",
"size": 10456
}
|
[
"io.lacuna.bifurcan.durable.io.ConcatInput",
"io.lacuna.bifurcan.utils.Iterators",
"java.util.Iterator"
] |
import io.lacuna.bifurcan.durable.io.ConcatInput; import io.lacuna.bifurcan.utils.Iterators; import java.util.Iterator;
|
import io.lacuna.bifurcan.durable.io.*; import io.lacuna.bifurcan.utils.*; import java.util.*;
|
[
"io.lacuna.bifurcan",
"java.util"
] |
io.lacuna.bifurcan; java.util;
| 1,152,681
|
public RequestCreator withPayload(Source payload) {
return RequestCreators.withPayload(payload);
}
|
RequestCreator function(Source payload) { return RequestCreators.withPayload(payload); }
|
/**
* Create a request with the given {@link Source} XML as payload.
*
* @param payload the request payload
* @return the request creator
*/
|
Create a request with the given <code>Source</code> XML as payload
|
withPayload
|
{
"repo_name": "lukas-krecan/smock",
"path": "common/src/main/java/net/javacrumbs/smock/common/server/AbstractCommonWebServiceServerTest.java",
"license": "apache-2.0",
"size": 7310
}
|
[
"javax.xml.transform.Source",
"org.springframework.ws.test.server.RequestCreator",
"org.springframework.ws.test.server.RequestCreators"
] |
import javax.xml.transform.Source; import org.springframework.ws.test.server.RequestCreator; import org.springframework.ws.test.server.RequestCreators;
|
import javax.xml.transform.*; import org.springframework.ws.test.server.*;
|
[
"javax.xml",
"org.springframework.ws"
] |
javax.xml; org.springframework.ws;
| 1,536,321
|
@Test
public void getServices() throws AmbariException {
Map<String, ServiceInfo> services = metaInfo.getServices(STACK_NAME_HDP,
STACK_VERSION_HDP);
LOG.info("Getting all the services ");
for (Map.Entry<String, ServiceInfo> entry : services.entrySet()) {
LOG.info("Service Name " + entry.getKey() + " values " + entry.getValue());
}
assertTrue(services.containsKey("HDFS"));
assertTrue(services.containsKey("MAPREDUCE"));
assertNotNull(services);
assertFalse(services.keySet().size() == 0);
}
|
void function() throws AmbariException { Map<String, ServiceInfo> services = metaInfo.getServices(STACK_NAME_HDP, STACK_VERSION_HDP); LOG.info(STR); for (Map.Entry<String, ServiceInfo> entry : services.entrySet()) { LOG.info(STR + entry.getKey() + STR + entry.getValue()); } assertTrue(services.containsKey("HDFS")); assertTrue(services.containsKey(STR)); assertNotNull(services); assertFalse(services.keySet().size() == 0); }
|
/**
* Method: Map<String, ServiceInfo> getServices(String stackName, String
* version, String serviceName)
* @throws AmbariException
*/
|
Method: Map getServices(String stackName, String version, String serviceName)
|
getServices
|
{
"repo_name": "alexryndin/ambari",
"path": "ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java",
"license": "apache-2.0",
"size": 89911
}
|
[
"java.util.Map",
"org.apache.ambari.server.AmbariException",
"org.apache.ambari.server.state.ServiceInfo",
"org.junit.Assert"
] |
import java.util.Map; import org.apache.ambari.server.AmbariException; import org.apache.ambari.server.state.ServiceInfo; import org.junit.Assert;
|
import java.util.*; import org.apache.ambari.server.*; import org.apache.ambari.server.state.*; import org.junit.*;
|
[
"java.util",
"org.apache.ambari",
"org.junit"
] |
java.util; org.apache.ambari; org.junit;
| 994,907
|
void forEachCube(Consumer<CubePos> callback) throws IOException;
|
void forEachCube(Consumer<CubePos> callback) throws IOException;
|
/**
* Iterates over all the cubes that exist in the world.
*
* @param callback the callback function to run
*/
|
Iterates over all the cubes that exist in the world
|
forEachCube
|
{
"repo_name": "OpenCubicChunks/CubicChunks",
"path": "CubicChunksAPI/src/main/java/io/github/opencubicchunks/cubicchunks/api/world/storage/ICubicStorage.java",
"license": "mit",
"size": 9580
}
|
[
"io.github.opencubicchunks.cubicchunks.api.util.CubePos",
"java.io.IOException",
"java.util.function.Consumer"
] |
import io.github.opencubicchunks.cubicchunks.api.util.CubePos; import java.io.IOException; import java.util.function.Consumer;
|
import io.github.opencubicchunks.cubicchunks.api.util.*; import java.io.*; import java.util.function.*;
|
[
"io.github.opencubicchunks",
"java.io",
"java.util"
] |
io.github.opencubicchunks; java.io; java.util;
| 953,272
|
public static <K, V> Predicate<Map<K, V>> anyEntry(
Predicate<? super Map.Entry<K, V>> p) {
return forEntries(Predicates.<Map.Entry<K, V>>any(p));
}
|
static <K, V> Predicate<Map<K, V>> function( Predicate<? super Map.Entry<K, V>> p) { return forEntries(Predicates.<Map.Entry<K, V>>any(p)); }
|
/**
* Returns a predicate that applies {@code any(p)} to the entries of
* its argument.
*/
|
Returns a predicate that applies any(p) to the entries of its argument
|
anyEntry
|
{
"repo_name": "konvergeio/cofoja",
"path": "src/main/java/com/google/java/contract/util/Predicates.java",
"license": "lgpl-3.0",
"size": 8856
}
|
[
"java.util.Map"
] |
import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 616,664
|
public static DocumentInfo documentFromFileUri(Uri fileUri) {
if (fileUri == null)
return null;
try {
URI uri = new URI(fileUri.toString());
File file = new File(uri);
DocumentInfo document = new DocumentInfo();
document.documentName = file.getName();
document.documentSizeKb = file.length() / 1024;
document.documentData = new FileInputStream(file);
String ext = MimeTypeMap.getFileExtensionFromUrl(fileUri.toString());
if (ext != null && !"".equals(ext))
document.documentMimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(ext);
return document;
} catch (Exception e) {
}
return null;
}
public static class DocumentInfo {
public String documentName;
public long documentSizeKb;
public InputStream documentData;
public String documentMimeType;
|
static DocumentInfo function(Uri fileUri) { if (fileUri == null) return null; try { URI uri = new URI(fileUri.toString()); File file = new File(uri); DocumentInfo document = new DocumentInfo(); document.documentName = file.getName(); document.documentSizeKb = file.length() / 1024; document.documentData = new FileInputStream(file); String ext = MimeTypeMap.getFileExtensionFromUrl(fileUri.toString()); if (ext != null && !"".equals(ext)) document.documentMimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(ext); return document; } catch (Exception e) { } return null; } public static class DocumentInfo { public String documentName; public long documentSizeKb; public InputStream documentData; public String documentMimeType;
|
/**
* Gets a DocumentInfo with info coming from the file at the given URI.
*
* @param fileUri the file URI (file:// ...)
* @return a DocumentInfo or null if an error occurs
*/
|
Gets a DocumentInfo with info coming from the file at the given URI
|
documentFromFileUri
|
{
"repo_name": "paristote/mobile-android-studio",
"path": "eXoMobile/src/main/java/org/exoplatform/utils/ExoDocumentUtils.java",
"license": "lgpl-3.0",
"size": 31868
}
|
[
"android.net.Uri",
"android.webkit.MimeTypeMap",
"java.io.File",
"java.io.FileInputStream",
"java.io.InputStream"
] |
import android.net.Uri; import android.webkit.MimeTypeMap; import java.io.File; import java.io.FileInputStream; import java.io.InputStream;
|
import android.net.*; import android.webkit.*; import java.io.*;
|
[
"android.net",
"android.webkit",
"java.io"
] |
android.net; android.webkit; java.io;
| 1,509,422
|
public boolean detectMulti(Mat img, Mat points) {
return detectMulti_0(nativeObj, img.nativeObj, points.nativeObj);
}
//
// C++: string cv::QRCodeDetector::decode(Mat img, Mat points, Mat& straight_qrcode = Mat())
//
|
boolean function(Mat img, Mat points) { return detectMulti_0(nativeObj, img.nativeObj, points.nativeObj); } //
|
/**
* Detects QR codes in image and returns the vector of the quadrangles containing the codes.
* @param img grayscale or color (BGR) image containing (or not) QR codes.
* @param points Output vector of vector of vertices of the minimum-area quadrangle containing the codes.
* @return automatically generated
*/
|
Detects QR codes in image and returns the vector of the quadrangles containing the codes
|
detectMulti
|
{
"repo_name": "donaldmunro/AARemu",
"path": "OpenCV/src/main/java/org/opencv/objdetect/QRCodeDetector.java",
"license": "apache-2.0",
"size": 12761
}
|
[
"org.opencv.core.Mat"
] |
import org.opencv.core.Mat;
|
import org.opencv.core.*;
|
[
"org.opencv.core"
] |
org.opencv.core;
| 745,263
|
@Column(name = "chrComments", length = 45)
public String getChrComments() {
return this.chrComments;
}
|
@Column(name = STR, length = 45) String function() { return this.chrComments; }
|
/**
* Get the status comments
*
* @return The comments
*/
|
Get the status comments
|
getChrComments
|
{
"repo_name": "anu-doi/metadata-stores",
"path": "aries/src/main/java/au/edu/anu/metadatastores/datamodel/aries/grants/ContractsGrantsStatus.java",
"license": "gpl-3.0",
"size": 5572
}
|
[
"javax.persistence.Column"
] |
import javax.persistence.Column;
|
import javax.persistence.*;
|
[
"javax.persistence"
] |
javax.persistence;
| 2,443,863
|
public void createDataObjectWithChildren(DataObject data)
{
if (data == null) return;
Browser browser = model.getSelectedBrowser();
if (browser == null) return;
TreeImageDisplay[] selection = browser.getSelectedDisplays();
if (selection.length == 0) return;
if (data instanceof DatasetData) {
Set images = new HashSet();
Object ho;
for (int i = 0; i < selection.length; i++) {
ho = selection[i].getUserObject();
if (ho instanceof ImageData && canLink(ho))
images.add(ho);
}
if (images.size() == 0) {
UserNotifier un =
TreeViewerAgent.getRegistry().getUserNotifier();
un.notifyInfo("Dataset Creation",
"No images to add to the dataset.");
}
model.fireDataSaving(data, images);
}
}
|
void function(DataObject data) { if (data == null) return; Browser browser = model.getSelectedBrowser(); if (browser == null) return; TreeImageDisplay[] selection = browser.getSelectedDisplays(); if (selection.length == 0) return; if (data instanceof DatasetData) { Set images = new HashSet(); Object ho; for (int i = 0; i < selection.length; i++) { ho = selection[i].getUserObject(); if (ho instanceof ImageData && canLink(ho)) images.add(ho); } if (images.size() == 0) { UserNotifier un = TreeViewerAgent.getRegistry().getUserNotifier(); un.notifyInfo(STR, STR); } model.fireDataSaving(data, images); } }
|
/**
* Implemented as specified by the {@link TreeViewer} interface.
* @see TreeViewer#createDataObjectWithChildren(DataObject)
*/
|
Implemented as specified by the <code>TreeViewer</code> interface
|
createDataObjectWithChildren
|
{
"repo_name": "dominikl/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewerComponent.java",
"license": "gpl-2.0",
"size": 162310
}
|
[
"java.util.HashSet",
"java.util.Set",
"org.openmicroscopy.shoola.agents.treeviewer.TreeViewerAgent",
"org.openmicroscopy.shoola.agents.treeviewer.browser.Browser",
"org.openmicroscopy.shoola.agents.util.browser.TreeImageDisplay",
"org.openmicroscopy.shoola.env.ui.UserNotifier"
] |
import java.util.HashSet; import java.util.Set; import org.openmicroscopy.shoola.agents.treeviewer.TreeViewerAgent; import org.openmicroscopy.shoola.agents.treeviewer.browser.Browser; import org.openmicroscopy.shoola.agents.util.browser.TreeImageDisplay; import org.openmicroscopy.shoola.env.ui.UserNotifier;
|
import java.util.*; import org.openmicroscopy.shoola.agents.treeviewer.*; import org.openmicroscopy.shoola.agents.treeviewer.browser.*; import org.openmicroscopy.shoola.agents.util.browser.*; import org.openmicroscopy.shoola.env.ui.*;
|
[
"java.util",
"org.openmicroscopy.shoola"
] |
java.util; org.openmicroscopy.shoola;
| 310,740
|
@ServiceMethod(returns = ReturnType.SINGLE)
public EndpointInner start(String resourceGroupName, String profileName, String endpointName) {
return startAsync(resourceGroupName, profileName, endpointName).block();
}
|
@ServiceMethod(returns = ReturnType.SINGLE) EndpointInner function(String resourceGroupName, String profileName, String endpointName) { return startAsync(resourceGroupName, profileName, endpointName).block(); }
|
/**
* Starts an existing CDN endpoint that is on a stopped state.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName Name of the CDN profile which is unique within the resource group.
* @param endpointName Name of the endpoint under the profile which is unique globally.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin,
* protocol, content caching and delivery behavior.
*/
|
Starts an existing CDN endpoint that is on a stopped state
|
start
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/implementation/EndpointsClientImpl.java",
"license": "mit",
"size": 169310
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.resourcemanager.cdn.fluent.models.EndpointInner"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.cdn.fluent.models.EndpointInner;
|
import com.azure.core.annotation.*; import com.azure.resourcemanager.cdn.fluent.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 2,602,193
|
public Printer visitMethodTypeAnnotation(final int typeRef,
final TypePath typePath, final String desc, final boolean visible) {
throw new RuntimeException("Must be overriden");
}
|
Printer function(final int typeRef, final TypePath typePath, final String desc, final boolean visible) { throw new RuntimeException(STR); }
|
/**
* Method type annotation. See
* {@link edu.columbia.cs.psl.phosphor.org.objectweb.asm.MethodVisitor#visitTypeAnnotation}.
*/
|
Method type annotation. See <code>edu.columbia.cs.psl.phosphor.org.objectweb.asm.MethodVisitor#visitTypeAnnotation</code>
|
visitMethodTypeAnnotation
|
{
"repo_name": "Programming-Systems-Lab/knarr",
"path": "Phosphor/src/edu/columbia/cs/psl/phosphor/org/objectweb/asm/util/Printer.java",
"license": "mit",
"size": 23516
}
|
[
"edu.columbia.cs.psl.phosphor.org.objectweb.asm.TypePath"
] |
import edu.columbia.cs.psl.phosphor.org.objectweb.asm.TypePath;
|
import edu.columbia.cs.psl.phosphor.org.objectweb.asm.*;
|
[
"edu.columbia.cs"
] |
edu.columbia.cs;
| 1,242,373
|
@Nonnull
CompositeData getDataStoreGCStatus();
|
CompositeData getDataStoreGCStatus();
|
/**
* Data store garbage collection status
*
* @return the status of the ongoing operation or if none the terminal
* status of the last operation or <em>Status not available</em> if none.
*/
|
Data store garbage collection status
|
getDataStoreGCStatus
|
{
"repo_name": "leftouterjoin/jackrabbit-oak",
"path": "oak-core/src/main/java/org/apache/jackrabbit/oak/api/jmx/RepositoryManagementMBean.java",
"license": "apache-2.0",
"size": 7867
}
|
[
"javax.management.openmbean.CompositeData"
] |
import javax.management.openmbean.CompositeData;
|
import javax.management.openmbean.*;
|
[
"javax.management"
] |
javax.management;
| 24,086
|
@Override
protected void keyTyped(char par1, int par2) {
if (par2 == 1) {
actionPerformed((GuiButton) buttonList.get(1));
return;
}
nameBox.textboxKeyTyped(par1, par2);
if (par2 == 28 || par2 == 156) actionPerformed((GuiButton) buttonList.get(0));
}
|
void function(char par1, int par2) { if (par2 == 1) { actionPerformed((GuiButton) buttonList.get(1)); return; } nameBox.textboxKeyTyped(par1, par2); if (par2 == 28 par2 == 156) actionPerformed((GuiButton) buttonList.get(0)); }
|
/**
* Fired when a key is typed. This is the equivalent of
* KeyListener.keyTyped(KeyEvent e).
*/
|
Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e)
|
keyTyped
|
{
"repo_name": "null-dev/EvenWurse",
"path": "Wurst Client/src/tk/wurst_client/gui/options/xray/GuiXRayBlocksAdd.java",
"license": "mpl-2.0",
"size": 5929
}
|
[
"net.minecraft.client.gui.GuiButton"
] |
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.*;
|
[
"net.minecraft.client"
] |
net.minecraft.client;
| 687,318
|
public void setDownNode(String nodeUrl) {
RMNode rmNode = getNodebyUrl(nodeUrl);
if (rmNode != null) {
// If the node is already down no need to go further
if (rmNode.isDown()) {
return;
}
logger.info("The node " + rmNode.getNodeURL() + " provided by " + rmNode.getProvider() + " is down");
// Get the previous state of the node needed for the event
final NodeState previousNodeState = rmNode.getState();
if (rmNode.isFree()) {
eligibleNodes.remove(rmNode);
}
rmNode.setDown();
persistUpdatedRMNodeIfRecoveryEnabled(rmNode);
// create the event
this.registerAndEmitNodeEvent(rmNode.createNodeEvent(RMEventType.NODE_STATE_CHANGED,
previousNodeState,
rmNode.getProvider().getName()));
} else {
// the nodes has been removed from core asynchronously
// when pinger of selection manager tried to access it
// do nothing in this case
logger.debug("setDownNode returned immediately because the node " + nodeUrl + " was not known");
}
}
|
void function(String nodeUrl) { RMNode rmNode = getNodebyUrl(nodeUrl); if (rmNode != null) { if (rmNode.isDown()) { return; } logger.info(STR + rmNode.getNodeURL() + STR + rmNode.getProvider() + STR); final NodeState previousNodeState = rmNode.getState(); if (rmNode.isFree()) { eligibleNodes.remove(rmNode); } rmNode.setDown(); persistUpdatedRMNodeIfRecoveryEnabled(rmNode); this.registerAndEmitNodeEvent(rmNode.createNodeEvent(RMEventType.NODE_STATE_CHANGED, previousNodeState, rmNode.getProvider().getName())); } else { logger.debug(STR + nodeUrl + STR); } }
|
/**
* Sets a node state to down and updates all internal structures of rm core
* accordingly. Sends an event indicating that the node is down.
*/
|
Sets a node state to down and updates all internal structures of rm core accordingly. Sends an event indicating that the node is down
|
setDownNode
|
{
"repo_name": "paraita/scheduling",
"path": "rm/rm-server/src/main/java/org/ow2/proactive/resourcemanager/core/RMCore.java",
"license": "agpl-3.0",
"size": 126360
}
|
[
"org.ow2.proactive.resourcemanager.common.NodeState",
"org.ow2.proactive.resourcemanager.common.event.RMEventType",
"org.ow2.proactive.resourcemanager.rmnode.RMNode"
] |
import org.ow2.proactive.resourcemanager.common.NodeState; import org.ow2.proactive.resourcemanager.common.event.RMEventType; import org.ow2.proactive.resourcemanager.rmnode.RMNode;
|
import org.ow2.proactive.resourcemanager.common.*; import org.ow2.proactive.resourcemanager.common.event.*; import org.ow2.proactive.resourcemanager.rmnode.*;
|
[
"org.ow2.proactive"
] |
org.ow2.proactive;
| 2,724,328
|
public HorizontalPanel getMainPanel() {
return mainPanel;
}
|
HorizontalPanel function() { return mainPanel; }
|
/**
* Gets the main panel.
*
* @return the main panel
*/
|
Gets the main panel
|
getMainPanel
|
{
"repo_name": "JaLandry/MeasureAuthoringTool_LatestSprint",
"path": "mat/src/mat/client/clause/QDMAvailableValueSetWidget.java",
"license": "apache-2.0",
"size": 33219
}
|
[
"com.google.gwt.user.client.ui.HorizontalPanel"
] |
import com.google.gwt.user.client.ui.HorizontalPanel;
|
import com.google.gwt.user.client.ui.*;
|
[
"com.google.gwt"
] |
com.google.gwt;
| 1,862,805
|
int insert(UPermission record);
|
int insert(UPermission record);
|
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table public.u_permission
*
* @mbggenerated Sat Aug 26 12:41:35 CST 2017
*/
|
This method was generated by MyBatis Generator. This method corresponds to the database table public.u_permission
|
insert
|
{
"repo_name": "eskimo220/utadahikaru",
"path": "src/main/java/com/heroku/mapper/UPermissionMapper.java",
"license": "mit",
"size": 3171
}
|
[
"com.heroku.entity.UPermission"
] |
import com.heroku.entity.UPermission;
|
import com.heroku.entity.*;
|
[
"com.heroku.entity"
] |
com.heroku.entity;
| 741,951
|
public static boolean isDecimalType(MajorType type) {
return isDecimalType(type.getMinorType());
}
|
static boolean function(MajorType type) { return isDecimalType(type.getMinorType()); }
|
/**
* Returns true if specified type is decimal data type.
*
* @param type type to check
* @return true if specified type is decimal data type.
*/
|
Returns true if specified type is decimal data type
|
isDecimalType
|
{
"repo_name": "pwong-mapr/incubator-drill",
"path": "common/src/main/java/org/apache/drill/common/types/Types.java",
"license": "apache-2.0",
"size": 25845
}
|
[
"org.apache.drill.common.types.TypeProtos"
] |
import org.apache.drill.common.types.TypeProtos;
|
import org.apache.drill.common.types.*;
|
[
"org.apache.drill"
] |
org.apache.drill;
| 801,767
|
@Override
protected AWSGroundStation build(AwsSyncClientParams params) {
return new AWSGroundStationClient(params);
}
|
AWSGroundStation function(AwsSyncClientParams params) { return new AWSGroundStationClient(params); }
|
/**
* Construct a synchronous implementation of AWSGroundStation using the current builder configuration.
*
* @param params
* Current builder configuration represented as a parameter object.
* @return Fully configured implementation of AWSGroundStation.
*/
|
Construct a synchronous implementation of AWSGroundStation using the current builder configuration
|
build
|
{
"repo_name": "jentfoo/aws-sdk-java",
"path": "aws-java-sdk-groundstation/src/main/java/com/amazonaws/services/groundstation/AWSGroundStationClientBuilder.java",
"license": "apache-2.0",
"size": 2388
}
|
[
"com.amazonaws.client.AwsSyncClientParams"
] |
import com.amazonaws.client.AwsSyncClientParams;
|
import com.amazonaws.client.*;
|
[
"com.amazonaws.client"
] |
com.amazonaws.client;
| 588,400
|
public void importBookDirectory(File dir, UUID uuid) {
BookPreview nb = getCurrentBookPreview();
final boolean isCurrentBook = currentBook.getUUID().equals(uuid);
if (isCurrentBook)
currentBook = null;
File bookDir = storage.getBookDirectory(uuid);
bookDir.mkdir();
for (File src : dir.listFiles()) {
File dst = new File(bookDir, src.getName());
dst.delete();
src.renameTo(dst);
}
dir.delete();
nb = getPreview(uuid);
if (nb != null)
nb.reload();
else {
nb = new BookPreview(uuid);
data.add(nb);
}
if (isCurrentBook)
setCurrentBook(nb, false);
Assert.assertTrue(data.contains(nb));
}
|
void function(File dir, UUID uuid) { BookPreview nb = getCurrentBookPreview(); final boolean isCurrentBook = currentBook.getUUID().equals(uuid); if (isCurrentBook) currentBook = null; File bookDir = storage.getBookDirectory(uuid); bookDir.mkdir(); for (File src : dir.listFiles()) { File dst = new File(bookDir, src.getName()); dst.delete(); src.renameTo(dst); } dir.delete(); nb = getPreview(uuid); if (nb != null) nb.reload(); else { nb = new BookPreview(uuid); data.add(nb); } if (isCurrentBook) setCurrentBook(nb, false); Assert.assertTrue(data.contains(nb)); }
|
/**
* Import a notebook directory.
* The directory is deleted after importing it.
* @param dir A quill notebook directory
* @param uuid The uuid of the notebook
* @throws BookIOException
*/
|
Import a notebook directory. The directory is deleted after importing it
|
importBookDirectory
|
{
"repo_name": "sumanthmamidi/sumanthmp-pad",
"path": "src/com/write/Quill/data/Bookshelf.java",
"license": "gpl-3.0",
"size": 10349
}
|
[
"java.io.File",
"junit.framework.Assert"
] |
import java.io.File; import junit.framework.Assert;
|
import java.io.*; import junit.framework.*;
|
[
"java.io",
"junit.framework"
] |
java.io; junit.framework;
| 1,759,987
|
protected String determineCorrelationId(Message message, String provisionalCorrelationId) throws JMSException {
if (provisionalCorrelationId != null) {
return provisionalCorrelationId;
}
final JmsConfiguration configuration = endpoint.getConfiguration();
final String correlationProperty = configuration.getCorrelationProperty();
final String messageId = message.getJMSMessageID();
final String correlationId = message.getJMSCorrelationID();
final String correlationPropertyValue;
if (correlationProperty == null) {
correlationPropertyValue = null;
} else {
correlationPropertyValue = message.getStringProperty(correlationProperty);
}
if (!ObjectHelper.isEmpty(correlationPropertyValue)) {
return correlationPropertyValue;
} else if (configuration.isUseMessageIDAsCorrelationID()) {
return messageId;
} else if (ObjectHelper.isEmpty(correlationId)) {
// correlation id is empty so fallback to message id
return messageId;
} else {
return correlationId;
}
}
|
String function(Message message, String provisionalCorrelationId) throws JMSException { if (provisionalCorrelationId != null) { return provisionalCorrelationId; } final JmsConfiguration configuration = endpoint.getConfiguration(); final String correlationProperty = configuration.getCorrelationProperty(); final String messageId = message.getJMSMessageID(); final String correlationId = message.getJMSCorrelationID(); final String correlationPropertyValue; if (correlationProperty == null) { correlationPropertyValue = null; } else { correlationPropertyValue = message.getStringProperty(correlationProperty); } if (!ObjectHelper.isEmpty(correlationPropertyValue)) { return correlationPropertyValue; } else if (configuration.isUseMessageIDAsCorrelationID()) { return messageId; } else if (ObjectHelper.isEmpty(correlationId)) { return messageId; } else { return correlationId; } }
|
/**
* Strategy to determine which correlation id to use among <tt>JMSMessageID</tt> and <tt>JMSCorrelationID</tt>.
*
* @param message the JMS message
* @param provisionalCorrelationId an optional provisional correlation id, which is preferred to be used
* @return the correlation id to use
* @throws JMSException can be thrown
*/
|
Strategy to determine which correlation id to use among JMSMessageID and JMSCorrelationID
|
determineCorrelationId
|
{
"repo_name": "yuruki/camel",
"path": "components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java",
"license": "apache-2.0",
"size": 27907
}
|
[
"javax.jms.JMSException",
"javax.jms.Message",
"org.apache.camel.util.ObjectHelper"
] |
import javax.jms.JMSException; import javax.jms.Message; import org.apache.camel.util.ObjectHelper;
|
import javax.jms.*; import org.apache.camel.util.*;
|
[
"javax.jms",
"org.apache.camel"
] |
javax.jms; org.apache.camel;
| 1,118,904
|
azure
.containerRegistries()
.manager()
.serviceClient()
.getPrivateEndpointConnections()
.delete("myResourceGroup", "myRegistry", "myConnection", Context.NONE);
}
|
azure .containerRegistries() .manager() .serviceClient() .getPrivateEndpointConnections() .delete(STR, STR, STR, Context.NONE); }
|
/**
* Sample code: PrivateEndpointConnectionDelete.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
|
Sample code: PrivateEndpointConnectionDelete
|
privateEndpointConnectionDelete
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/PrivateEndpointConnectionsDeleteSamples.java",
"license": "mit",
"size": 1066
}
|
[
"com.azure.core.util.Context"
] |
import com.azure.core.util.Context;
|
import com.azure.core.util.*;
|
[
"com.azure.core"
] |
com.azure.core;
| 1,073,955
|
void importObjectsFromFile(File input, ImportOptionsType options, Task task, OperationResult parentResult) throws FileNotFoundException;
|
void importObjectsFromFile(File input, ImportOptionsType options, Task task, OperationResult parentResult) throws FileNotFoundException;
|
/**
* Import objects from file.
*
* Invocation of this method may be switched to background.
*
* @param input
* @param task
*/
|
Import objects from file. Invocation of this method may be switched to background
|
importObjectsFromFile
|
{
"repo_name": "gureronder/midpoint",
"path": "model/model-api/src/main/java/com/evolveum/midpoint/model/api/ModelService.java",
"license": "apache-2.0",
"size": 26515
}
|
[
"com.evolveum.midpoint.schema.result.OperationResult",
"com.evolveum.midpoint.task.api.Task",
"com.evolveum.midpoint.xml.ns._public.common.api_types_3.ImportOptionsType",
"java.io.File",
"java.io.FileNotFoundException"
] |
import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.xml.ns._public.common.api_types_3.ImportOptionsType; import java.io.File; import java.io.FileNotFoundException;
|
import com.evolveum.midpoint.schema.result.*; import com.evolveum.midpoint.task.api.*; import com.evolveum.midpoint.xml.ns._public.common.api_types_3.*; import java.io.*;
|
[
"com.evolveum.midpoint",
"java.io"
] |
com.evolveum.midpoint; java.io;
| 1,978,753
|
public void gotoPreviousPreviousSlide(View btnPrevPrev) {
TextView txtMessage = (TextView) this.findViewById(R.id.message);
this.enableButtons(false);
try {
this.controller.gotoPreviousPreviousSlide();
txtMessage.setText("");
} catch (com.sun.star.comp.helper.BootstrapException e) {
txtMessage.setText(e.getMessage());
} catch (com.sun.star.connection.NoConnectException e) {
txtMessage.setText(e.getMessage());
} catch (com.sun.star.connection.ConnectionSetupException e) {
txtMessage.setText(e.getMessage());
} catch (tw.idv.imacat.android.mpresent.uno.NoRunningException e) {
txtMessage.setText(e.getMessage());
}
this.redraw();
this.enableButtons(true);
return;
}
|
void function(View btnPrevPrev) { TextView txtMessage = (TextView) this.findViewById(R.id.message); this.enableButtons(false); try { this.controller.gotoPreviousPreviousSlide(); txtMessage.setText(""); } catch (com.sun.star.comp.helper.BootstrapException e) { txtMessage.setText(e.getMessage()); } catch (com.sun.star.connection.NoConnectException e) { txtMessage.setText(e.getMessage()); } catch (com.sun.star.connection.ConnectionSetupException e) { txtMessage.setText(e.getMessage()); } catch (tw.idv.imacat.android.mpresent.uno.NoRunningException e) { txtMessage.setText(e.getMessage()); } this.redraw(); this.enableButtons(true); return; }
|
/**
* Goes to the previous-previous slide.
*
* @param btnPrevPrev the previous-previous button
*/
|
Goes to the previous-previous slide
|
gotoPreviousPreviousSlide
|
{
"repo_name": "imacat/mpresent-android",
"path": "src/tw/idv/imacat/android/mpresent/RemoteControllerActivity.java",
"license": "gpl-3.0",
"size": 42701
}
|
[
"android.view.View",
"android.widget.TextView"
] |
import android.view.View; import android.widget.TextView;
|
import android.view.*; import android.widget.*;
|
[
"android.view",
"android.widget"
] |
android.view; android.widget;
| 1,252,173
|
@Override
public StopContainersResponse stopContainers(StopContainersRequest requests)
throws YarnException, IOException {
List<ContainerId> succeededRequests = new ArrayList<ContainerId>();
Map<ContainerId, SerializedException> failedRequests =
new HashMap<ContainerId, SerializedException>();
UserGroupInformation remoteUgi = getRemoteUgi();
NMTokenIdentifier identifier = selectNMTokenIdentifier(remoteUgi);
if (identifier == null) {
throw RPCUtil.getRemoteException(INVALID_NMTOKEN_MSG);
}
for (ContainerId id : requests.getContainerIds()) {
try {
Container container = this.context.getContainers().get(id);
authorizeGetAndStopContainerRequest(id, container, true, identifier);
stopContainerInternal(id);
succeededRequests.add(id);
} catch (YarnException e) {
failedRequests.put(id, SerializedException.newInstance(e));
}
}
return StopContainersResponse
.newInstance(succeededRequests, failedRequests);
}
|
StopContainersResponse function(StopContainersRequest requests) throws YarnException, IOException { List<ContainerId> succeededRequests = new ArrayList<ContainerId>(); Map<ContainerId, SerializedException> failedRequests = new HashMap<ContainerId, SerializedException>(); UserGroupInformation remoteUgi = getRemoteUgi(); NMTokenIdentifier identifier = selectNMTokenIdentifier(remoteUgi); if (identifier == null) { throw RPCUtil.getRemoteException(INVALID_NMTOKEN_MSG); } for (ContainerId id : requests.getContainerIds()) { try { Container container = this.context.getContainers().get(id); authorizeGetAndStopContainerRequest(id, container, true, identifier); stopContainerInternal(id); succeededRequests.add(id); } catch (YarnException e) { failedRequests.put(id, SerializedException.newInstance(e)); } } return StopContainersResponse .newInstance(succeededRequests, failedRequests); }
|
/**
* Stop a list of containers running on this NodeManager.
*/
|
Stop a list of containers running on this NodeManager
|
stopContainers
|
{
"repo_name": "wenxinhe/hadoop",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/ContainerManagerImpl.java",
"license": "apache-2.0",
"size": 78919
}
|
[
"java.io.IOException",
"java.util.ArrayList",
"java.util.HashMap",
"java.util.List",
"java.util.Map",
"org.apache.hadoop.security.UserGroupInformation",
"org.apache.hadoop.yarn.api.protocolrecords.StopContainersRequest",
"org.apache.hadoop.yarn.api.protocolrecords.StopContainersResponse",
"org.apache.hadoop.yarn.api.records.ContainerId",
"org.apache.hadoop.yarn.api.records.SerializedException",
"org.apache.hadoop.yarn.exceptions.YarnException",
"org.apache.hadoop.yarn.ipc.RPCUtil",
"org.apache.hadoop.yarn.security.NMTokenIdentifier",
"org.apache.hadoop.yarn.server.nodemanager.containermanager.container.Container"
] |
import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.yarn.api.protocolrecords.StopContainersRequest; import org.apache.hadoop.yarn.api.protocolrecords.StopContainersResponse; import org.apache.hadoop.yarn.api.records.ContainerId; import org.apache.hadoop.yarn.api.records.SerializedException; import org.apache.hadoop.yarn.exceptions.YarnException; import org.apache.hadoop.yarn.ipc.RPCUtil; import org.apache.hadoop.yarn.security.NMTokenIdentifier; import org.apache.hadoop.yarn.server.nodemanager.containermanager.container.Container;
|
import java.io.*; import java.util.*; import org.apache.hadoop.security.*; import org.apache.hadoop.yarn.api.protocolrecords.*; import org.apache.hadoop.yarn.api.records.*; import org.apache.hadoop.yarn.exceptions.*; import org.apache.hadoop.yarn.ipc.*; import org.apache.hadoop.yarn.security.*; import org.apache.hadoop.yarn.server.nodemanager.containermanager.container.*;
|
[
"java.io",
"java.util",
"org.apache.hadoop"
] |
java.io; java.util; org.apache.hadoop;
| 1,667,238
|
protected HttpRequest createConnectRequest(HttpRoute route,
HttpContext context) {
// see RFC 2817, section 5.2 and
// INTERNET-DRAFT: Tunneling TCP based protocols through
// Web proxy servers
HttpHost target = route.getTargetHost();
String host = target.getHostName();
int port = target.getPort();
if (port < 0) {
Scheme scheme = connManager.getSchemeRegistry().
getScheme(target.getSchemeName());
port = scheme.getDefaultPort();
}
StringBuilder buffer = new StringBuilder(host.length() + 6);
buffer.append(host);
buffer.append(':');
buffer.append(Integer.toString(port));
String authority = buffer.toString();
ProtocolVersion ver = HttpProtocolParams.getVersion(params);
HttpRequest req = new BasicHttpRequest
("CONNECT", authority, ver);
return req;
}
|
HttpRequest function(HttpRoute route, HttpContext context) { HttpHost target = route.getTargetHost(); String host = target.getHostName(); int port = target.getPort(); if (port < 0) { Scheme scheme = connManager.getSchemeRegistry(). getScheme(target.getSchemeName()); port = scheme.getDefaultPort(); } StringBuilder buffer = new StringBuilder(host.length() + 6); buffer.append(host); buffer.append(':'); buffer.append(Integer.toString(port)); String authority = buffer.toString(); ProtocolVersion ver = HttpProtocolParams.getVersion(params); HttpRequest req = new BasicHttpRequest (STR, authority, ver); return req; }
|
/**
* Creates the CONNECT request for tunnelling.
* Called by {@link #createTunnelToTarget createTunnelToTarget}.
*
* @param route the route to establish
* @param context the context for request execution
*
* @return the CONNECT request for tunnelling
*/
|
Creates the CONNECT request for tunnelling. Called by <code>#createTunnelToTarget createTunnelToTarget</code>
|
createConnectRequest
|
{
"repo_name": "rex-xxx/mt6572_x201",
"path": "external/apache-http/src/org/apache/http/impl/client/DefaultRequestDirector.java",
"license": "gpl-2.0",
"size": 47843
}
|
[
"org.apache.http.HttpHost",
"org.apache.http.HttpRequest",
"org.apache.http.ProtocolVersion",
"org.apache.http.conn.routing.HttpRoute",
"org.apache.http.conn.scheme.Scheme",
"org.apache.http.message.BasicHttpRequest",
"org.apache.http.params.HttpProtocolParams",
"org.apache.http.protocol.HttpContext"
] |
import org.apache.http.HttpHost; import org.apache.http.HttpRequest; import org.apache.http.ProtocolVersion; import org.apache.http.conn.routing.HttpRoute; import org.apache.http.conn.scheme.Scheme; import org.apache.http.message.BasicHttpRequest; import org.apache.http.params.HttpProtocolParams; import org.apache.http.protocol.HttpContext;
|
import org.apache.http.*; import org.apache.http.conn.routing.*; import org.apache.http.conn.scheme.*; import org.apache.http.message.*; import org.apache.http.params.*; import org.apache.http.protocol.*;
|
[
"org.apache.http"
] |
org.apache.http;
| 304,025
|
public final Format getFormat(final StoreListeners listeners) {
if (name != null) try {
return MetadataSource.getProvided().lookup(Format.class, name);
} catch (MetadataStoreException e) {
if (listeners != null) {
listeners.warning(e);
} else {
final Level level;
if (!logged) {
logged = true; // Not atomic - not a big deal if we use warning level twice.
level = Level.WARNING;
} else {
level = Level.FINE;
}
final LogRecord record = Resources.forLocale(null).getLogRecord(level,
Resources.Keys.CanNotGetCommonMetadata_2, getShortName(), e.getLocalizedMessage());
record.setLoggerName(Modules.STORAGE);
Logging.log(getClass(), "getFormat", record);
}
}
return super.getFormat();
}
|
final Format function(final StoreListeners listeners) { if (name != null) try { return MetadataSource.getProvided().lookup(Format.class, name); } catch (MetadataStoreException e) { if (listeners != null) { listeners.warning(e); } else { final Level level; if (!logged) { logged = true; level = Level.WARNING; } else { level = Level.FINE; } final LogRecord record = Resources.forLocale(null).getLogRecord(level, Resources.Keys.CanNotGetCommonMetadata_2, getShortName(), e.getLocalizedMessage()); record.setLoggerName(Modules.STORAGE); Logging.log(getClass(), STR, record); } } return super.getFormat(); }
|
/**
* Returns a more complete description of the format, sending warnings to the given listeners if non-null.
*
* @param listeners where to report the warning in case of error, or {@code null} if none.
* @return a description of the data format.
*/
|
Returns a more complete description of the format, sending warnings to the given listeners if non-null
|
getFormat
|
{
"repo_name": "apache/sis",
"path": "storage/sis-storage/src/main/java/org/apache/sis/internal/storage/DocumentedStoreProvider.java",
"license": "apache-2.0",
"size": 4682
}
|
[
"java.util.logging.Level",
"java.util.logging.LogRecord",
"org.apache.sis.internal.system.Modules",
"org.apache.sis.metadata.sql.MetadataSource",
"org.apache.sis.metadata.sql.MetadataStoreException",
"org.apache.sis.storage.event.StoreListeners",
"org.apache.sis.util.logging.Logging",
"org.opengis.metadata.distribution.Format"
] |
import java.util.logging.Level; import java.util.logging.LogRecord; import org.apache.sis.internal.system.Modules; import org.apache.sis.metadata.sql.MetadataSource; import org.apache.sis.metadata.sql.MetadataStoreException; import org.apache.sis.storage.event.StoreListeners; import org.apache.sis.util.logging.Logging; import org.opengis.metadata.distribution.Format;
|
import java.util.logging.*; import org.apache.sis.internal.system.*; import org.apache.sis.metadata.sql.*; import org.apache.sis.storage.event.*; import org.apache.sis.util.logging.*; import org.opengis.metadata.distribution.*;
|
[
"java.util",
"org.apache.sis",
"org.opengis.metadata"
] |
java.util; org.apache.sis; org.opengis.metadata;
| 2,497,997
|
public void run() {
try {
// Decorate the streams so we can send characters
// and not just bytes. Ensure output is flushed
// after every newline.
BufferedReader in = new BufferedReader(
new InputStreamReader(socket.getInputStream()));
PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
// Send a welcome message to the client.
out.println("Hello, you are client #" + clientNumber + ".");
out.println("Enter a line with only a period to quit\n");
// Get messages from the client, line by line; return them
// capitalized
while (true) {
String input = in.readLine();
if (input == null || input.equals(".")) {
break;
}
out.println(input);
System.out.println(input);
}
} catch (IOException e) {
log("Error handling client# " + clientNumber + ": " + e);
} finally {
try {
socket.close();
} catch (IOException e) {
log("Couldn't close a socket, what's going on?");
}
log("Connection with client# " + clientNumber + " closed");
}
}
|
void function() { try { BufferedReader in = new BufferedReader( new InputStreamReader(socket.getInputStream())); PrintWriter out = new PrintWriter(socket.getOutputStream(), true); out.println(STR + clientNumber + "."); out.println(STR); while (true) { String input = in.readLine(); if (input == null input.equals(".")) { break; } out.println(input); System.out.println(input); } } catch (IOException e) { log(STR + clientNumber + STR + e); } finally { try { socket.close(); } catch (IOException e) { log(STR); } log(STR + clientNumber + STR); } }
|
/**
* Services this thread's client by first sending the
* client a welcome message then repeatedly reading strings
* and sending back the capitalized version of the string.
*/
|
Services this thread's client by first sending the client a welcome message then repeatedly reading strings and sending back the capitalized version of the string
|
run
|
{
"repo_name": "wit543/Softwheel",
"path": "expertSystem/src/CapitalizeServer.java",
"license": "gpl-3.0",
"size": 4012
}
|
[
"java.io.BufferedReader",
"java.io.IOException",
"java.io.InputStreamReader",
"java.io.PrintWriter"
] |
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,153,137
|
super.onCreate(savedInstanceState);
m_ActivityContext = this;
m_mainApp = (TestApplication)getApplication();
setContentView(R.layout.activity_main);
// Create the adapter that will return a fragment for each of the three primary sections
// of the app.
m_CustomPagerAdapter = new CustomPagerAdapter(getSupportFragmentManager(), m_ActivityContext, m_mainApp);
// Set up the action bar.
final ActionBar actionBar = getActionBar();
// Specify that the Home/Up button should not be enabled, since there is no hierarchical
// parent.
//actionBar.setHomeButtonEnabled(false);
// Specify that we will be displaying tabs in the action bar.
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
|
super.onCreate(savedInstanceState); m_ActivityContext = this; m_mainApp = (TestApplication)getApplication(); setContentView(R.layout.activity_main); m_CustomPagerAdapter = new CustomPagerAdapter(getSupportFragmentManager(), m_ActivityContext, m_mainApp); final ActionBar actionBar = getActionBar(); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
|
/**
* Holder of the main tab/fragmen/section
*/
|
Holder of the main tab/fragmen/section
|
onCreate
|
{
"repo_name": "bgamecho/arduino2android",
"path": "src/org/egokituz/arduino2android/activities/MainActivity.java",
"license": "apache-2.0",
"size": 7851
}
|
[
"android.app.ActionBar",
"org.egokituz.arduino2android.TestApplication",
"org.egokituz.arduino2android.adapters.CustomPagerAdapter"
] |
import android.app.ActionBar; import org.egokituz.arduino2android.TestApplication; import org.egokituz.arduino2android.adapters.CustomPagerAdapter;
|
import android.app.*; import org.egokituz.arduino2android.*; import org.egokituz.arduino2android.adapters.*;
|
[
"android.app",
"org.egokituz.arduino2android"
] |
android.app; org.egokituz.arduino2android;
| 2,905,172
|
public Builder applyToAllUnaryMethods(
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
super.applyToAllUnaryMethods(
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
return this;
}
|
Builder function( ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) { super.applyToAllUnaryMethods( getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; }
|
/**
* Applies the given settings updater function to all of the unary API methods in this service.
*
* <p>Note: This method does not support applying settings to streaming methods.
*/
|
Applies the given settings updater function to all of the unary API methods in this service. Note: This method does not support applying settings to streaming methods
|
applyToAllUnaryMethods
|
{
"repo_name": "googleads/google-ads-java",
"path": "google-ads-stubs-v9/src/main/java/com/google/ads/googleads/v9/services/OperatingSystemVersionConstantServiceSettings.java",
"license": "apache-2.0",
"size": 8198
}
|
[
"com.google.api.core.ApiFunction",
"com.google.api.gax.rpc.UnaryCallSettings"
] |
import com.google.api.core.ApiFunction; import com.google.api.gax.rpc.UnaryCallSettings;
|
import com.google.api.core.*; import com.google.api.gax.rpc.*;
|
[
"com.google.api"
] |
com.google.api;
| 1,284,903
|
public void decreaseParStats(Statistics stats) {
synchronized (statsMap) {
primaryBucketCount -= statsMap.get(StatsKey.PRIMARY_BUCKET_COUNT).intValue();
bucketCount -= statsMap.get(StatsKey.BUCKET_COUNT).intValue();
totalBucketSize -= statsMap.get(StatsKey.TOTAL_BUCKET_SIZE).intValue();
removed = true;
}
}
};
|
void function(Statistics stats) { synchronized (statsMap) { primaryBucketCount -= statsMap.get(StatsKey.PRIMARY_BUCKET_COUNT).intValue(); bucketCount -= statsMap.get(StatsKey.BUCKET_COUNT).intValue(); totalBucketSize -= statsMap.get(StatsKey.TOTAL_BUCKET_SIZE).intValue(); removed = true; } } };
|
/**
* Only decrease those values which can both increase and decrease and not
* values which can only increase like read/writes
*
* Remove last sample value from the aggregate. Last Sampled value can be
* obtained from the DefaultHashMap for the disk
*
* @param stats
*/
|
Only decrease those values which can both increase and decrease and not values which can only increase like read/writes Remove last sample value from the aggregate. Last Sampled value can be obtained from the DefaultHashMap for the disk
|
decreaseParStats
|
{
"repo_name": "papicella/snappy-store",
"path": "gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/beans/stats/AggregateRegionStatsMonitor.java",
"license": "apache-2.0",
"size": 8496
}
|
[
"com.gemstone.gemfire.Statistics"
] |
import com.gemstone.gemfire.Statistics;
|
import com.gemstone.gemfire.*;
|
[
"com.gemstone.gemfire"
] |
com.gemstone.gemfire;
| 871,732
|
EReference getSchemaType_AttributeGroup();
|
EReference getSchemaType_AttributeGroup();
|
/**
* Returns the meta object for the containment reference list '{@link org.w3._2001.schema.SchemaType#getAttributeGroup <em>Attribute Group</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference list '<em>Attribute Group</em>'.
* @see org.w3._2001.schema.SchemaType#getAttributeGroup()
* @see #getSchemaType()
* @generated
*/
|
Returns the meta object for the containment reference list '<code>org.w3._2001.schema.SchemaType#getAttributeGroup Attribute Group</code>'.
|
getSchemaType_AttributeGroup
|
{
"repo_name": "geotools/geotools",
"path": "modules/ogc/net.opengis.wps/src/org/w3/_2001/schema/SchemaPackage.java",
"license": "lgpl-2.1",
"size": 433240
}
|
[
"org.eclipse.emf.ecore.EReference"
] |
import org.eclipse.emf.ecore.EReference;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 1,878,607
|
try {
EventSetDescriptor [] esds =
{ new EventSetDescriptor(PredictionAppender.class,
"dataSet",
DataSourceListener.class,
"acceptDataSet"),
new EventSetDescriptor(PredictionAppender.class,
"instance",
InstanceListener.class,
"acceptInstance"),
new EventSetDescriptor(PredictionAppender.class,
"trainingSet",
TrainingSetListener.class,
"acceptTrainingSet"),
new EventSetDescriptor(PredictionAppender.class,
"testSet",
TestSetListener.class,
"acceptTestSet")
};
return esds;
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}
|
try { EventSetDescriptor [] esds = { new EventSetDescriptor(PredictionAppender.class, STR, DataSourceListener.class, STR), new EventSetDescriptor(PredictionAppender.class, STR, InstanceListener.class, STR), new EventSetDescriptor(PredictionAppender.class, STR, TrainingSetListener.class, STR), new EventSetDescriptor(PredictionAppender.class, STR, TestSetListener.class, STR) }; return esds; } catch (Exception ex) { ex.printStackTrace(); } return null; }
|
/**
* Get the event set descriptors pertinent to data sources
*
* @return an <code>EventSetDescriptor[]</code> value
*/
|
Get the event set descriptors pertinent to data sources
|
getEventSetDescriptors
|
{
"repo_name": "dsibournemouth/autoweka",
"path": "weka-3.7.7/src/main/java/weka/gui/beans/PredictionAppenderBeanInfo.java",
"license": "gpl-3.0",
"size": 2816
}
|
[
"java.beans.EventSetDescriptor"
] |
import java.beans.EventSetDescriptor;
|
import java.beans.*;
|
[
"java.beans"
] |
java.beans;
| 427,562
|
public T caseIntermediateCatchEvent(IntermediateCatchEvent object) {
return null;
}
|
T function(IntermediateCatchEvent object) { return null; }
|
/**
* Returns the result of interpreting the object as an instance of '<em>Intermediate Catch Event</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Intermediate Catch Event</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
|
Returns the result of interpreting the object as an instance of 'Intermediate Catch Event'. This implementation returns null; returning a non-null result will terminate the switch.
|
caseIntermediateCatchEvent
|
{
"repo_name": "romartin/kie-wb-common",
"path": "kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/util/Bpmn2Switch.java",
"license": "apache-2.0",
"size": 144865
}
|
[
"org.eclipse.bpmn2.IntermediateCatchEvent"
] |
import org.eclipse.bpmn2.IntermediateCatchEvent;
|
import org.eclipse.bpmn2.*;
|
[
"org.eclipse.bpmn2"
] |
org.eclipse.bpmn2;
| 1,340,605
|
public void testAmbiguousHoursAfterDSTSwitch() {
Rounding tzRounding;
final DateTimeZone tz = DateTimeZone.forID("Asia/Jerusalem");
tzRounding = Rounding.builder(DateTimeUnit.HOUR_OF_DAY).timeZone(tz).build();
assertThat(tzRounding.round(time("2014-10-26T00:30:00+03:00")), isDate(time("2014-10-26T00:00:00+03:00"), tz));
assertThat(tzRounding.round(time("2014-10-26T01:30:00+03:00")), isDate(time("2014-10-26T01:00:00+03:00"), tz));
// the utc date for "2014-10-25T03:00:00+03:00" and "2014-10-25T03:00:00+02:00" is the same, local time turns back 1h here
assertThat(time("2014-10-26T03:00:00+03:00"), isDate(time("2014-10-26T02:00:00+02:00"), tz));
assertThat(tzRounding.round(time("2014-10-26T01:30:00+02:00")), isDate(time("2014-10-26T01:00:00+02:00"), tz));
assertThat(tzRounding.round(time("2014-10-26T02:30:00+02:00")), isDate(time("2014-10-26T02:00:00+02:00"), tz));
// Day interval
tzRounding = Rounding.builder(DateTimeUnit.DAY_OF_MONTH).timeZone(tz).build();
assertThat(tzRounding.round(time("2014-11-11T17:00:00", tz)), isDate(time("2014-11-11T00:00:00", tz), tz));
// DST on
assertThat(tzRounding.round(time("2014-08-11T17:00:00", tz)), isDate(time("2014-08-11T00:00:00", tz), tz));
// Day of switching DST on -> off
assertThat(tzRounding.round(time("2014-10-26T17:00:00", tz)), isDate(time("2014-10-26T00:00:00", tz), tz));
// Day of switching DST off -> on
assertThat(tzRounding.round(time("2015-03-27T17:00:00", tz)), isDate(time("2015-03-27T00:00:00", tz), tz));
// Month interval
tzRounding = Rounding.builder(DateTimeUnit.MONTH_OF_YEAR).timeZone(tz).build();
assertThat(tzRounding.round(time("2014-11-11T17:00:00", tz)), isDate(time("2014-11-01T00:00:00", tz), tz));
// DST on
assertThat(tzRounding.round(time("2014-10-10T17:00:00", tz)), isDate(time("2014-10-01T00:00:00", tz), tz));
// Year interval
tzRounding = Rounding.builder(DateTimeUnit.YEAR_OF_CENTURY).timeZone(tz).build();
assertThat(tzRounding.round(time("2014-11-11T17:00:00", tz)), isDate(time("2014-01-01T00:00:00", tz), tz));
// Two timestamps in same year and different timezone offset ("Double buckets" issue - #9491)
tzRounding = Rounding.builder(DateTimeUnit.YEAR_OF_CENTURY).timeZone(tz).build();
assertThat(tzRounding.round(time("2014-11-11T17:00:00", tz)),
isDate(tzRounding.round(time("2014-08-11T17:00:00", tz)), tz));
}
|
void function() { Rounding tzRounding; final DateTimeZone tz = DateTimeZone.forID(STR); tzRounding = Rounding.builder(DateTimeUnit.HOUR_OF_DAY).timeZone(tz).build(); assertThat(tzRounding.round(time(STR)), isDate(time(STR), tz)); assertThat(tzRounding.round(time(STR)), isDate(time(STR), tz)); assertThat(time(STR), isDate(time(STR), tz)); assertThat(tzRounding.round(time(STR)), isDate(time(STR), tz)); assertThat(tzRounding.round(time(STR)), isDate(time(STR), tz)); tzRounding = Rounding.builder(DateTimeUnit.DAY_OF_MONTH).timeZone(tz).build(); assertThat(tzRounding.round(time(STR, tz)), isDate(time(STR, tz), tz)); assertThat(tzRounding.round(time(STR, tz)), isDate(time(STR, tz), tz)); assertThat(tzRounding.round(time(STR, tz)), isDate(time(STR, tz), tz)); assertThat(tzRounding.round(time(STR, tz)), isDate(time(STR, tz), tz)); tzRounding = Rounding.builder(DateTimeUnit.MONTH_OF_YEAR).timeZone(tz).build(); assertThat(tzRounding.round(time(STR, tz)), isDate(time(STR, tz), tz)); assertThat(tzRounding.round(time(STR, tz)), isDate(time(STR, tz), tz)); tzRounding = Rounding.builder(DateTimeUnit.YEAR_OF_CENTURY).timeZone(tz).build(); assertThat(tzRounding.round(time(STR, tz)), isDate(time(STR, tz), tz)); tzRounding = Rounding.builder(DateTimeUnit.YEAR_OF_CENTURY).timeZone(tz).build(); assertThat(tzRounding.round(time(STR, tz)), isDate(tzRounding.round(time(STR, tz)), tz)); }
|
/**
* special test for DST switch from #9491
*/
|
special test for DST switch from #9491
|
testAmbiguousHoursAfterDSTSwitch
|
{
"repo_name": "qwerty4030/elasticsearch",
"path": "server/src/test/java/org/elasticsearch/common/rounding/TimeZoneRoundingTests.java",
"license": "apache-2.0",
"size": 44535
}
|
[
"org.joda.time.DateTimeZone"
] |
import org.joda.time.DateTimeZone;
|
import org.joda.time.*;
|
[
"org.joda.time"
] |
org.joda.time;
| 1,155,048
|
public okhttp3.Call deleteNamespacedNetworkPolicyCall(
String name,
String namespace,
String pretty,
String dryRun,
Integer gracePeriodSeconds,
Boolean orphanDependents,
String propagationPolicy,
V1DeleteOptions body,
final ApiCallback _callback)
throws ApiException {
Object localVarPostBody = body;
// create path and map variables
String localVarPath =
"/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}"
.replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString()))
.replaceAll(
"\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
if (pretty != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));
}
if (dryRun != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun));
}
if (gracePeriodSeconds != null) {
localVarQueryParams.addAll(
localVarApiClient.parameterToPair("gracePeriodSeconds", gracePeriodSeconds));
}
if (orphanDependents != null) {
localVarQueryParams.addAll(
localVarApiClient.parameterToPair("orphanDependents", orphanDependents));
}
if (propagationPolicy != null) {
localVarQueryParams.addAll(
localVarApiClient.parameterToPair("propagationPolicy", propagationPolicy));
}
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json", "application/yaml", "application/vnd.kubernetes.protobuf"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {};
final String localVarContentType =
localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] {"BearerToken"};
return localVarApiClient.buildCall(
localVarPath,
"DELETE",
localVarQueryParams,
localVarCollectionQueryParams,
localVarPostBody,
localVarHeaderParams,
localVarCookieParams,
localVarFormParams,
localVarAuthNames,
_callback);
}
|
okhttp3.Call function( String name, String namespace, String pretty, String dryRun, Integer gracePeriodSeconds, Boolean orphanDependents, String propagationPolicy, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { Object localVarPostBody = body; String localVarPath = STR .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())) .replaceAll( "\\{" + STR + "\\}", localVarApiClient.escapeString(namespace.toString())); List<Pair> localVarQueryParams = new ArrayList<Pair>(); List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); if (pretty != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair(STR, pretty)); } if (dryRun != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair(STR, dryRun)); } if (gracePeriodSeconds != null) { localVarQueryParams.addAll( localVarApiClient.parameterToPair(STR, gracePeriodSeconds)); } if (orphanDependents != null) { localVarQueryParams.addAll( localVarApiClient.parameterToPair(STR, orphanDependents)); } if (propagationPolicy != null) { localVarQueryParams.addAll( localVarApiClient.parameterToPair(STR, propagationPolicy)); } Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, String> localVarCookieParams = new HashMap<String, String>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>(); final String[] localVarAccepts = { STR, STR, STR }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put(STR, localVarAccept); } final String[] localVarContentTypes = {}; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put(STR, localVarContentType); String[] localVarAuthNames = new String[] {STR}; return localVarApiClient.buildCall( localVarPath, STR, localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); }
|
/**
* Build call for deleteNamespacedNetworkPolicy
*
* @param name name of the NetworkPolicy (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)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @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>
*/
|
Build call for deleteNamespacedNetworkPolicy
|
deleteNamespacedNetworkPolicyCall
|
{
"repo_name": "kubernetes-client/java",
"path": "kubernetes/src/main/java/io/kubernetes/client/openapi/apis/NetworkingV1Api.java",
"license": "apache-2.0",
"size": 477939
}
|
[
"io.kubernetes.client.openapi.ApiCallback",
"io.kubernetes.client.openapi.ApiException",
"io.kubernetes.client.openapi.Pair",
"io.kubernetes.client.openapi.models.V1DeleteOptions",
"java.util.ArrayList",
"java.util.HashMap",
"java.util.List",
"java.util.Map"
] |
import io.kubernetes.client.openapi.ApiCallback; import io.kubernetes.client.openapi.ApiException; import io.kubernetes.client.openapi.Pair; import io.kubernetes.client.openapi.models.V1DeleteOptions; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map;
|
import io.kubernetes.client.openapi.*; import io.kubernetes.client.openapi.models.*; import java.util.*;
|
[
"io.kubernetes.client",
"java.util"
] |
io.kubernetes.client; java.util;
| 852,427
|
public final void testRequestFreeTime() throws ParseException {
ComponentList components = new ComponentList();
VEvent event1 = new VEvent(new DateTime("20050101T080000"), new Dur(0,
0, 15, 0), "Consultation 1");
components.add(event1);
DateTime start = new DateTime("20050103T000000");
DateTime end = new DateTime("20050104T000000");
VFreeBusy requestFree = new VFreeBusy(start, end, new Dur(0, 0, 5, 0));
VFreeBusy freeBusy = new VFreeBusy(requestFree, components);
FreeBusy fg = (FreeBusy) freeBusy.getProperty(Property.FREEBUSY);
assertNotNull(fg);
// free/busy type should be FREE..
assertEquals(FbType.FREE, fg.getParameter(Parameter.FBTYPE));
// should be only one period..
assertEquals(1, fg.getPeriods().size());
// period should be from the start to the end date..
assertEquals(new Period(start, end), fg.getPeriods().first());
}
|
final void function() throws ParseException { ComponentList components = new ComponentList(); VEvent event1 = new VEvent(new DateTime(STR), new Dur(0, 0, 15, 0), STR); components.add(event1); DateTime start = new DateTime(STR); DateTime end = new DateTime(STR); VFreeBusy requestFree = new VFreeBusy(start, end, new Dur(0, 0, 5, 0)); VFreeBusy freeBusy = new VFreeBusy(requestFree, components); FreeBusy fg = (FreeBusy) freeBusy.getProperty(Property.FREEBUSY); assertNotNull(fg); assertEquals(FbType.FREE, fg.getParameter(Parameter.FBTYPE)); assertEquals(1, fg.getPeriods().size()); assertEquals(new Period(start, end), fg.getPeriods().first()); }
|
/**
* A test for a request for free time where the VFreeBusy instance doesn't
* consume any time in the specified range. Correct behaviour should see the
* return of a VFreeBusy specifying the entire range as free.
*
* @throws ParseException
*/
|
A test for a request for free time where the VFreeBusy instance doesn't consume any time in the specified range. Correct behaviour should see the return of a VFreeBusy specifying the entire range as free
|
testRequestFreeTime
|
{
"repo_name": "henry4j/ical4j-0.9.20",
"path": "test/net/fortuna/ical4j/model/component/VFreeBusyTest.java",
"license": "bsd-3-clause",
"size": 13111
}
|
[
"java.text.ParseException",
"net.fortuna.ical4j.model.ComponentList",
"net.fortuna.ical4j.model.DateTime",
"net.fortuna.ical4j.model.Dur",
"net.fortuna.ical4j.model.Parameter",
"net.fortuna.ical4j.model.Period",
"net.fortuna.ical4j.model.Property",
"net.fortuna.ical4j.model.parameter.FbType",
"net.fortuna.ical4j.model.property.FreeBusy"
] |
import java.text.ParseException; import net.fortuna.ical4j.model.ComponentList; import net.fortuna.ical4j.model.DateTime; import net.fortuna.ical4j.model.Dur; import net.fortuna.ical4j.model.Parameter; import net.fortuna.ical4j.model.Period; import net.fortuna.ical4j.model.Property; import net.fortuna.ical4j.model.parameter.FbType; import net.fortuna.ical4j.model.property.FreeBusy;
|
import java.text.*; import net.fortuna.ical4j.model.*; import net.fortuna.ical4j.model.parameter.*; import net.fortuna.ical4j.model.property.*;
|
[
"java.text",
"net.fortuna.ical4j"
] |
java.text; net.fortuna.ical4j;
| 505,592
|
private double getLengthDim(final Object gemNr,
final String gu,
final Integer wdm,
final GerinneGeschlFlaechenReportDialog.Art art,
final Integer from,
final Integer till) {
final List<GmdPartObjGeschl> gemList = gemPartMap.get(gemNr);
double length = 0;
for (final GmdPartObjGeschl tmp : gemList) {
if (tmp.getOwner().equals(gu) && tmp.getWidmung().equals(wdm) && tmp.getArt().equals(art.name())
&& valueBetween(tmp.getDim(), from, till)) {
length += tmp.getLength();
}
}
return length;
}
|
double function(final Object gemNr, final String gu, final Integer wdm, final GerinneGeschlFlaechenReportDialog.Art art, final Integer from, final Integer till) { final List<GmdPartObjGeschl> gemList = gemPartMap.get(gemNr); double length = 0; for (final GmdPartObjGeschl tmp : gemList) { if (tmp.getOwner().equals(gu) && tmp.getWidmung().equals(wdm) && tmp.getArt().equals(art.name()) && valueBetween(tmp.getDim(), from, till)) { length += tmp.getLength(); } } return length; }
|
/**
* DOCUMENT ME!
*
* @param gemNr DOCUMENT ME!
* @param gu gew DOCUMENT ME!
* @param wdm DOCUMENT ME!
* @param art DOCUMENT ME!
* @param from DOCUMENT ME!
* @param till DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
|
DOCUMENT ME
|
getLengthDim
|
{
"repo_name": "cismet/watergis-client",
"path": "src/main/java/de/cismet/watergis/reports/GerinneGFlReport.java",
"license": "lgpl-3.0",
"size": 159735
}
|
[
"de.cismet.watergis.gui.dialog.GerinneGeschlFlaechenReportDialog",
"de.cismet.watergis.reports.types.GmdPartObjGeschl",
"java.util.List"
] |
import de.cismet.watergis.gui.dialog.GerinneGeschlFlaechenReportDialog; import de.cismet.watergis.reports.types.GmdPartObjGeschl; import java.util.List;
|
import de.cismet.watergis.gui.dialog.*; import de.cismet.watergis.reports.types.*; import java.util.*;
|
[
"de.cismet.watergis",
"java.util"
] |
de.cismet.watergis; java.util;
| 489,824
|
@Nonnull
public DeviceComplianceUserStatusRequest select(@Nonnull final String value) {
addSelectOption(value);
return this;
}
|
DeviceComplianceUserStatusRequest function(@Nonnull final String value) { addSelectOption(value); return this; }
|
/**
* Sets the select clause for the request
*
* @param value the select clause
* @return the updated request
*/
|
Sets the select clause for the request
|
select
|
{
"repo_name": "microsoftgraph/msgraph-sdk-java",
"path": "src/main/java/com/microsoft/graph/requests/DeviceComplianceUserStatusRequest.java",
"license": "mit",
"size": 6544
}
|
[
"javax.annotation.Nonnull"
] |
import javax.annotation.Nonnull;
|
import javax.annotation.*;
|
[
"javax.annotation"
] |
javax.annotation;
| 1,771,394
|
public ServiceCall<Void> beginDeleteAsyncRelativeRetryInvalidJsonPollingAsync(final ServiceCallback<Void> serviceCallback) {
return ServiceCall.fromHeaderResponse(beginDeleteAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(), serviceCallback);
}
|
ServiceCall<Void> function(final ServiceCallback<Void> serviceCallback) { return ServiceCall.fromHeaderResponse(beginDeleteAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(), serviceCallback); }
|
/**
* Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
|
Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status
|
beginDeleteAsyncRelativeRetryInvalidJsonPollingAsync
|
{
"repo_name": "matthchr/autorest",
"path": "src/generator/AutoRest.Java.Azure.Fluent.Tests/src/main/java/fixtures/lro/implementation/LROSADsInner.java",
"license": "mit",
"size": 277083
}
|
[
"com.microsoft.rest.ServiceCall",
"com.microsoft.rest.ServiceCallback"
] |
import com.microsoft.rest.ServiceCall; import com.microsoft.rest.ServiceCallback;
|
import com.microsoft.rest.*;
|
[
"com.microsoft.rest"
] |
com.microsoft.rest;
| 1,218,001
|
@Override
public void handleMessage(Message<?> messageIn) throws MessagingException {
logger.debug("Message received by handleMessage(): " + messageIn.toString());
// We can use static methods of the SimpleStarStatusMessageTemplate to check if the message is one we might be interested in.
// In this case we just test whether the message was generated by the SimpleStarStatusMessageTemplate.
if (SimpleStarStatusMessageTemplate.isMessageOfCorrectType(messageIn))
receivedMessages.add(messageIn); // keep Star messages only
}
|
void function(Message<?> messageIn) throws MessagingException { logger.debug(STR + messageIn.toString()); if (SimpleStarStatusMessageTemplate.isMessageOfCorrectType(messageIn)) receivedMessages.add(messageIn); }
|
/**
* Asynchronously handles any messages received on channels this class is subscribed to in real time
* (in this case only the "wasp.channel.notification.default" channel is monitored).
*/
|
Asynchronously handles any messages received on channels this class is subscribed to in real time (in this case only the "wasp.channel.notification.default" channel is monitored)
|
handleMessage
|
{
"repo_name": "WASP-System/central",
"path": "plugins/star/src/test/java/edu/yu/einstein/wasp/plugins/star/integration/messages/StarJobLaunchTests.java",
"license": "agpl-3.0",
"size": 8199
}
|
[
"edu.yu.einstein.wasp.plugins.star.integration.messages.SimpleStarStatusMessageTemplate",
"org.springframework.messaging.Message",
"org.springframework.messaging.MessagingException"
] |
import edu.yu.einstein.wasp.plugins.star.integration.messages.SimpleStarStatusMessageTemplate; import org.springframework.messaging.Message; import org.springframework.messaging.MessagingException;
|
import edu.yu.einstein.wasp.plugins.star.integration.messages.*; import org.springframework.messaging.*;
|
[
"edu.yu.einstein",
"org.springframework.messaging"
] |
edu.yu.einstein; org.springframework.messaging;
| 421,429
|
@PostMapping(value = "/{rolloutId}/approve", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<Void> approve(@PathVariable("rolloutId") Long rolloutId,
@RequestParam(value = "remark", required = false) String remark);
|
@PostMapping(value = STR, produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) ResponseEntity<Void> approve(@PathVariable(STR) Long rolloutId, @RequestParam(value = STR, required = false) String remark);
|
/**
* Handles the request for approving a rollout.
*
* @param rolloutId
* the ID of the rollout to be approved.
* @param remark
* an optional remark on the approval decision
* @return OK response (200) if rollout is approved now. In case of any
* exception the corresponding errors occur.
*/
|
Handles the request for approving a rollout
|
approve
|
{
"repo_name": "eclipse/hawkbit",
"path": "hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtRolloutRestApi.java",
"license": "epl-1.0",
"size": 11998
}
|
[
"org.springframework.hateoas.MediaTypes",
"org.springframework.http.MediaType",
"org.springframework.http.ResponseEntity",
"org.springframework.web.bind.annotation.PathVariable",
"org.springframework.web.bind.annotation.PostMapping",
"org.springframework.web.bind.annotation.RequestParam"
] |
import org.springframework.hateoas.MediaTypes; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.hateoas.*; import org.springframework.http.*; import org.springframework.web.bind.annotation.*;
|
[
"org.springframework.hateoas",
"org.springframework.http",
"org.springframework.web"
] |
org.springframework.hateoas; org.springframework.http; org.springframework.web;
| 2,892,276
|
EClass getSubsectionStart();
|
EClass getSubsectionStart();
|
/**
* Returns the meta object for class '{@link org.lunifera.doc.dsl.doccompiler.SubsectionStart <em>Subsection Start</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Subsection Start</em>'.
* @see org.lunifera.doc.dsl.doccompiler.SubsectionStart
* @generated
*/
|
Returns the meta object for class '<code>org.lunifera.doc.dsl.doccompiler.SubsectionStart Subsection Start</code>'.
|
getSubsectionStart
|
{
"repo_name": "lunifera/lunifera-doc",
"path": "org.lunifera.doc.dsl.semantic/src/org/lunifera/doc/dsl/doccompiler/DocCompilerPackage.java",
"license": "epl-1.0",
"size": 267430
}
|
[
"org.eclipse.emf.ecore.EClass"
] |
import org.eclipse.emf.ecore.EClass;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 428,114
|
private void unregisterMbean(Object o, @Nullable String cacheName, boolean near) {
assert o != null;
MBeanServer srvr = ctx.config().getMBeanServer();
assert srvr != null;
cacheName = U.maskName(cacheName);
cacheName = near ? cacheName + "-near" : cacheName;
for (Class<?> itf : o.getClass().getInterfaces()) {
if (itf.getName().endsWith("MBean") || itf.getName().endsWith("MXBean")) {
try {
srvr.unregisterMBean(U.makeCacheMBeanName(ctx.gridName(), cacheName, o.getClass().getName()));
}
catch (JMException e) {
U.error(log, "Failed to unregister MBean for component: " + o, e);
}
break;
}
}
}
|
void function(Object o, @Nullable String cacheName, boolean near) { assert o != null; MBeanServer srvr = ctx.config().getMBeanServer(); assert srvr != null; cacheName = U.maskName(cacheName); cacheName = near ? cacheName + "-near" : cacheName; for (Class<?> itf : o.getClass().getInterfaces()) { if (itf.getName().endsWith("MBean") itf.getName().endsWith(STR)) { try { srvr.unregisterMBean(U.makeCacheMBeanName(ctx.gridName(), cacheName, o.getClass().getName())); } catch (JMException e) { U.error(log, STR + o, e); } break; } } }
|
/**
* Unregisters MBean for cache components.
*
* @param o Cache component.
* @param cacheName Cache name.
* @param near Near flag.
*/
|
Unregisters MBean for cache components
|
unregisterMbean
|
{
"repo_name": "murador/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java",
"license": "apache-2.0",
"size": 137564
}
|
[
"javax.management.JMException",
"javax.management.MBeanServer",
"org.apache.ignite.internal.util.typedef.internal.U",
"org.jetbrains.annotations.Nullable"
] |
import javax.management.JMException; import javax.management.MBeanServer; import org.apache.ignite.internal.util.typedef.internal.U; import org.jetbrains.annotations.Nullable;
|
import javax.management.*; import org.apache.ignite.internal.util.typedef.internal.*; import org.jetbrains.annotations.*;
|
[
"javax.management",
"org.apache.ignite",
"org.jetbrains.annotations"
] |
javax.management; org.apache.ignite; org.jetbrains.annotations;
| 810,128
|
protected String createResponse(String challenge) {
String handshake = challenge.concat("-").concat(config.getPassword());
MessageDigest md5;
try {
md5 = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
logger.error("This version of Java does not support MD5 hashing");
return "";
}
byte[] handshakeHash;
try {
handshakeHash = md5.digest(handshake.getBytes("UTF-16LE"));
} catch (UnsupportedEncodingException e) {
logger.error("This version of Java does not understand UTF-16LE encoding");
return "";
}
String response = challenge.concat("-");
for (byte handshakeByte : handshakeHash) {
response = response.concat(String.format("%02x", handshakeByte));
}
return response;
}
public FritzahaWebInterface(AvmFritzConfiguration config, IFritzHandler handler) {
this.config = config;
this.fbHandler = handler;
sid = null;
asyncclient = new HttpClient(new SslContextFactory(true));
asyncclient.setMaxConnectionsPerDestination(asyncmaxconns);
try {
asyncclient.start();
} catch (Exception e) {
logger.error("Could not start HTTP Client for {}", getURL(""));
}
authenticate();
logger.debug("Starting with SID {}", sid);
}
|
String function(String challenge) { String handshake = challenge.concat("-").concat(config.getPassword()); MessageDigest md5; try { md5 = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { logger.error(STR); return STRUTF-16LESTRThis version of Java does not understand UTF-16LE encodingSTRSTR-STR%02xSTRCould not start HTTP Client for {}STRSTRStarting with SID {}", sid); }
|
/**
* Creates the proper response to a given challenge based on the password
* stored
*
* @param challenge Challenge string as returned by the FRITZ!OS login
* script
* @return Response to the challenge
*/
|
Creates the proper response to a given challenge based on the password stored
|
createResponse
|
{
"repo_name": "mvolaart/openhab2-addons",
"path": "addons/binding/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/FritzahaWebInterface.java",
"license": "epl-1.0",
"size": 12514
}
|
[
"java.security.MessageDigest",
"java.security.NoSuchAlgorithmException"
] |
import java.security.MessageDigest; import java.security.NoSuchAlgorithmException;
|
import java.security.*;
|
[
"java.security"
] |
java.security;
| 127,945
|
public void testQuery() {
//Create a configuration with non default values
Map<String, String> props = new HashMap<String, String>();
ConnectionParameters cp = new ConnectionParameters(new MockConnectionEl(props, "tst://file"), MockDriverContext.INSTANCE);
|
void function() { Map<String, String> props = new HashMap<String, String>(); ConnectionParameters cp = new ConnectionParameters(new MockConnectionEl(props, "tst:
|
/**
* History:
* 11.09.2006 - Duron 1.7Mhz - 1265 ms
* 09.09.2006 - Duron 1.7Mhz - 1400 ms
*/
|
History: 11.09.2006 - Duron 1.7Mhz - 1265 ms 09.09.2006 - Duron 1.7Mhz - 1400 ms
|
testQuery
|
{
"repo_name": "scriptella/scriptella-etl",
"path": "drivers/src/test/scriptella/driver/csv/CsvConnectionPerfTest.java",
"license": "apache-2.0",
"size": 4601
}
|
[
"java.util.HashMap",
"java.util.Map"
] |
import java.util.HashMap; import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 566,945
|
if (bytesReadPastMark <= bufferSize) {
if (log.isDebugEnabled()) {
log.debug("Reset after reading " + bytesReadPastMark + " bytes.");
}
bufferOffset = 0;
} else {
throw new IOException(
"Input stream cannot be reset as " + this.bytesReadPastMark
+ " bytes have been written, exceeding the available buffer size of " + this.bufferSize);
}
}
|
if (bytesReadPastMark <= bufferSize) { if (log.isDebugEnabled()) { log.debug(STR + bytesReadPastMark + STR); } bufferOffset = 0; } else { throw new IOException( STR + this.bytesReadPastMark + STR + this.bufferSize); } }
|
/**
* Resets the input stream to the beginning by pointing the buffer offset to
* the beginning of the available data buffer.
*
* @throws IOException
* When the available buffer size has been exceeded, in which
* case the input stream data cannot be repeated.
*/
|
Resets the input stream to the beginning by pointing the buffer offset to the beginning of the available data buffer
|
reset
|
{
"repo_name": "sinacloud/sinacloud-sdk-java",
"path": "src/main/java/com/sinacloud/scs/services/scs/model/RepeatableInputStream.java",
"license": "apache-2.0",
"size": 6965
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,182,141
|
public static byte[] getHash(InputStream in) throws IOException {
MD5 md5 = new MD5();
byte[] buffer = new byte[1024];
int read;
while ((read = in.read(buffer)) != -1){
md5.update(buffer, read);
}
return md5.getHash();
}
|
static byte[] function(InputStream in) throws IOException { MD5 md5 = new MD5(); byte[] buffer = new byte[1024]; int read; while ((read = in.read(buffer)) != -1){ md5.update(buffer, read); } return md5.getHash(); }
|
/**
* Gets the MD5 hash the data on the given InputStream.
*
* @param in byte array for which an MD5 hash is desired.
* @return Array of 16 bytes, the hash of all updated bytes.
* @throws IOException if an I/O error occurs.
*
* @since ostermillerutils 1.00.00
*/
|
Gets the MD5 hash the data on the given InputStream
|
getHash
|
{
"repo_name": "luisbandalap/sls",
"path": "src/com/adam/aslfms/util/MD5.java",
"license": "gpl-3.0",
"size": 21969
}
|
[
"java.io.IOException",
"java.io.InputStream"
] |
import java.io.IOException; import java.io.InputStream;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,837,519
|
HttpSession session = request.getSession();
String viewNameId = RequestHandler.getRequestUri(request.getPathInfo());
GenericValue userLogin = (GenericValue) session.getAttribute("userLogin");
Delegator delegator = (Delegator) request.getAttribute("delegator");
String returnValue = "success";
if (userLogin != null) {
String userLoginId = userLogin.getString("userLoginId");
try {
List<GenericValue> protectedViews = EntityQuery.use(delegator)
.from("UserLoginAndProtectedView")
.where("userLoginId", userLoginId, "viewNameId", viewNameId)
.cache(true)
.queryList();
// Any views to deal with ?
if (UtilValidate.isNotEmpty(protectedViews)) {
Long now = System.currentTimeMillis(); // we are not in a margin of some milliseconds
// Is this login/view couple already tarpitted ? (ie denied access to view for login for a period of time)
List<GenericValue> tarpittedLoginViews = EntityQuery.use(delegator)
.from("TarpittedLoginView")
.where("userLoginId", userLoginId, "viewNameId", viewNameId)
.cache(true)
.queryList();
String viewNameUserLoginId = viewNameId + userLoginId;
if (UtilValidate.isNotEmpty(tarpittedLoginViews)) {
GenericValue tarpittedLoginView = tarpittedLoginViews.get(0);
Long tarpitReleaseDateTime = (Long) tarpittedLoginView.get("tarpitReleaseDateTime");
if (now < tarpitReleaseDateTime) {
String tarpittedMessage = UtilProperties.getMessage(resourceWebapp, "protectedviewevents.tarpitted_message", UtilHttp.getLocale(request));
// reset since now protected by the tarpit duration
hitsByViewAccessed.put(viewNameUserLoginId, 0L);
return ":_protect_:" + tarpittedMessage;
}
}
GenericValue protectedView = protectedViews.get(0);
// 1st hit ?
Long curMaxHits = hitsByViewAccessed.get(viewNameUserLoginId);
if (UtilValidate.isEmpty(curMaxHits)) {
hitsByViewAccessed.put(viewNameUserLoginId, one);
Long maxHitsDuration = (Long) protectedView.get("maxHitsDuration") * 1000;
durationByViewAccessed.put(viewNameUserLoginId, now + maxHitsDuration);
} else {
Long maxDuration = durationByViewAccessed.get(viewNameUserLoginId);
Long newMaxHits = curMaxHits + one;
hitsByViewAccessed.put(viewNameUserLoginId, newMaxHits);
// Are we in a period of time where we need to check if there was too much hits ?
if (now < maxDuration) {
// Check if over the max hit count...
if (newMaxHits > protectedView.getLong("maxHits")) { // yes : block and set tarpitReleaseDateTime
String blockedMessage = UtilProperties.getMessage(resourceWebapp, "protectedviewevents.blocked_message", UtilHttp.getLocale(request));
returnValue = ":_protect_:" + blockedMessage;
Long tarpitDuration = (Long) protectedView.get("tarpitDuration") * 1000;
GenericValue tarpittedLoginView = delegator.makeValue("TarpittedLoginView");
tarpittedLoginView.set("userLoginId", userLoginId);
tarpittedLoginView.set("viewNameId", viewNameId);
tarpittedLoginView.set("tarpitReleaseDateTime", now + tarpitDuration);
try {
delegator.createOrStore(tarpittedLoginView);
} catch (GenericEntityException e) {
Debug.logError(e, "Could not save TarpittedLoginView:", module);
}
}
} else {
// The tarpit period is over, begin a new one.
// Actually it's not a discrete process but we do as it was...
// We don't need precision here, a theft will be caught anyway !
// We could also take an average of hits in the last x periods of time as initial value,
// but it does not make any more sense.
// Of course for this to work well the tarpitting period must be long enough...
hitsByViewAccessed.put(viewNameUserLoginId, one);
Long maxHitsDuration = (Long) protectedView.get("maxHitsDuration") * 1000;
durationByViewAccessed.put(viewNameUserLoginId, now + maxHitsDuration);
}
}
}
} catch (GenericEntityException e) {
Map<String, String> messageMap = UtilMisc.toMap("errMessage", e.getMessage());
String errMsg = UtilProperties.getMessage("CommonUiLabels", "CommonDatabaseProblem", messageMap, UtilHttp.getLocale(request));
Debug.logError(e, errMsg, module);
}
}
return returnValue;
}
|
HttpSession session = request.getSession(); String viewNameId = RequestHandler.getRequestUri(request.getPathInfo()); GenericValue userLogin = (GenericValue) session.getAttribute(STR); Delegator delegator = (Delegator) request.getAttribute(STR); String returnValue = STR; if (userLogin != null) { String userLoginId = userLogin.getString(STR); try { List<GenericValue> protectedViews = EntityQuery.use(delegator) .from(STR) .where(STR, userLoginId, STR, viewNameId) .cache(true) .queryList(); if (UtilValidate.isNotEmpty(protectedViews)) { Long now = System.currentTimeMillis(); List<GenericValue> tarpittedLoginViews = EntityQuery.use(delegator) .from(STR) .where(STR, userLoginId, STR, viewNameId) .cache(true) .queryList(); String viewNameUserLoginId = viewNameId + userLoginId; if (UtilValidate.isNotEmpty(tarpittedLoginViews)) { GenericValue tarpittedLoginView = tarpittedLoginViews.get(0); Long tarpitReleaseDateTime = (Long) tarpittedLoginView.get(STR); if (now < tarpitReleaseDateTime) { String tarpittedMessage = UtilProperties.getMessage(resourceWebapp, STR, UtilHttp.getLocale(request)); hitsByViewAccessed.put(viewNameUserLoginId, 0L); return STR + tarpittedMessage; } } GenericValue protectedView = protectedViews.get(0); Long curMaxHits = hitsByViewAccessed.get(viewNameUserLoginId); if (UtilValidate.isEmpty(curMaxHits)) { hitsByViewAccessed.put(viewNameUserLoginId, one); Long maxHitsDuration = (Long) protectedView.get(STR) * 1000; durationByViewAccessed.put(viewNameUserLoginId, now + maxHitsDuration); } else { Long maxDuration = durationByViewAccessed.get(viewNameUserLoginId); Long newMaxHits = curMaxHits + one; hitsByViewAccessed.put(viewNameUserLoginId, newMaxHits); if (now < maxDuration) { if (newMaxHits > protectedView.getLong(STR)) { String blockedMessage = UtilProperties.getMessage(resourceWebapp, STR, UtilHttp.getLocale(request)); returnValue = STR + blockedMessage; Long tarpitDuration = (Long) protectedView.get(STR) * 1000; GenericValue tarpittedLoginView = delegator.makeValue(STR); tarpittedLoginView.set(STR, userLoginId); tarpittedLoginView.set(STR, viewNameId); tarpittedLoginView.set(STR, now + tarpitDuration); try { delegator.createOrStore(tarpittedLoginView); } catch (GenericEntityException e) { Debug.logError(e, STR, module); } } } else { hitsByViewAccessed.put(viewNameUserLoginId, one); Long maxHitsDuration = (Long) protectedView.get(STR) * 1000; durationByViewAccessed.put(viewNameUserLoginId, now + maxHitsDuration); } } } } catch (GenericEntityException e) { Map<String, String> messageMap = UtilMisc.toMap(STR, e.getMessage()); String errMsg = UtilProperties.getMessage(STR, STR, messageMap, UtilHttp.getLocale(request)); Debug.logError(e, errMsg, module); } } return returnValue; }
|
/**
* An HTTP WebEvent handler that checks to see if an userLogin should be tarpitted
* The decision is made in regard of number of hits in last period of time
*
* @param request The HTTP request object for the current JSP or Servlet request.
* @param response The HTTP response object for the current JSP or Servlet request.
* @return String
*/
|
An HTTP WebEvent handler that checks to see if an userLogin should be tarpitted The decision is made in regard of number of hits in last period of time
|
checkProtectedView
|
{
"repo_name": "ilscipio/scipio-erp",
"path": "framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java",
"license": "apache-2.0",
"size": 8744
}
|
[
"java.util.List",
"java.util.Map",
"javax.servlet.http.HttpSession",
"org.ofbiz.base.util.Debug",
"org.ofbiz.base.util.UtilHttp",
"org.ofbiz.base.util.UtilMisc",
"org.ofbiz.base.util.UtilProperties",
"org.ofbiz.base.util.UtilValidate",
"org.ofbiz.entity.Delegator",
"org.ofbiz.entity.GenericEntityException",
"org.ofbiz.entity.GenericValue",
"org.ofbiz.entity.util.EntityQuery"
] |
import java.util.List; import java.util.Map; import javax.servlet.http.HttpSession; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilHttp; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.util.EntityQuery;
|
import java.util.*; import javax.servlet.http.*; import org.ofbiz.base.util.*; import org.ofbiz.entity.*; import org.ofbiz.entity.util.*;
|
[
"java.util",
"javax.servlet",
"org.ofbiz.base",
"org.ofbiz.entity"
] |
java.util; javax.servlet; org.ofbiz.base; org.ofbiz.entity;
| 1,189,675
|
private static void checkUsername(final String expected, final String name
) throws IOException {
if (expected == null && name != null) {
throw new IOException("Usernames not matched: expecting null but name="
+ name);
}
if (name == null) { //name is optional, null is okay
return;
}
KerberosName u = new KerberosName(name);
String shortName = u.getShortName();
if (!shortName.equals(expected)) {
throw new IOException("Usernames not matched: name=" + shortName
+ " != expected=" + expected);
}
}
|
static void function(final String expected, final String name ) throws IOException { if (expected == null && name != null) { throw new IOException(STR + name); } if (name == null) { return; } KerberosName u = new KerberosName(name); String shortName = u.getShortName(); if (!shortName.equals(expected)) { throw new IOException(STR + shortName + STR + expected); } }
|
/**
* Expected user name should be a short name.
*/
|
Expected user name should be a short name
|
checkUsername
|
{
"repo_name": "tseen/Federated-HDFS",
"path": "tseenliu/FedHDFS-hadoop-src/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/JspHelper.java",
"license": "apache-2.0",
"size": 28943
}
|
[
"java.io.IOException",
"org.apache.hadoop.security.authentication.util.KerberosName"
] |
import java.io.IOException; import org.apache.hadoop.security.authentication.util.KerberosName;
|
import java.io.*; import org.apache.hadoop.security.authentication.util.*;
|
[
"java.io",
"org.apache.hadoop"
] |
java.io; org.apache.hadoop;
| 2,418,083
|
public AskBuilder useHistory() {
this.history = Optional.of("history");
return this;
}
/**
* Enable usage of history of specific file. History will be saved to ~/.jline/{@param file}
|
AskBuilder function() { this.history = Optional.of(STR); return this; } /** * Enable usage of history of specific file. History will be saved to ~/.jline/{@param file}
|
/**
* Enable usage of history. History will be saved to ~/.jline/history
*
* @return the builder instance
*/
|
Enable usage of history. History will be saved to ~/.jline/history
|
useHistory
|
{
"repo_name": "dfoerderreuther/console-builder",
"path": "console-builder/src/main/java/de/eleon/console/builder/AskBuilder.java",
"license": "apache-2.0",
"size": 8139
}
|
[
"com.google.common.base.Optional"
] |
import com.google.common.base.Optional;
|
import com.google.common.base.*;
|
[
"com.google.common"
] |
com.google.common;
| 956,353
|
protected void copyProfileConfigFiles(File profileBuildDir, File profileConfigDir) throws IOException {
File[] files = profileConfigDir.listFiles();
if (files != null) {
profileBuildDir.mkdirs();
for (File file : files) {
if (!toBeExclude(file.getName())) {
File outFile = new File(profileBuildDir, file.getName());
if (file.isDirectory()) {
copyProfileConfigFiles(outFile, file);
} else {
Files.copy(file, outFile);
}
}
}
}
}
|
void function(File profileBuildDir, File profileConfigDir) throws IOException { File[] files = profileConfigDir.listFiles(); if (files != null) { profileBuildDir.mkdirs(); for (File file : files) { if (!toBeExclude(file.getName())) { File outFile = new File(profileBuildDir, file.getName()); if (file.isDirectory()) { copyProfileConfigFiles(outFile, file); } else { Files.copy(file, outFile); } } } } }
|
/**
* Copies any local configuration files into the profile directory
*/
|
Copies any local configuration files into the profile directory
|
copyProfileConfigFiles
|
{
"repo_name": "jludvice/fabric8",
"path": "fabric8-maven-plugin/src/main/java/io/fabric8/maven/CreateProfileZipMojo.java",
"license": "apache-2.0",
"size": 27331
}
|
[
"io.fabric8.common.util.Files",
"java.io.File",
"java.io.IOException"
] |
import io.fabric8.common.util.Files; import java.io.File; import java.io.IOException;
|
import io.fabric8.common.util.*; import java.io.*;
|
[
"io.fabric8.common",
"java.io"
] |
io.fabric8.common; java.io;
| 2,004,866
|
public Set<Obs> getAllObs(boolean includeVoided) {
if (includeVoided && obs != null)
return obs;
Set<Obs> ret = new HashSet<Obs>();
if (this.obs != null) {
for (Obs o : this.obs) {
if (includeVoided)
ret.add(o);
else if (!o.isVoided())
ret.add(o);
}
}
return ret;
}
|
Set<Obs> function(boolean includeVoided) { if (includeVoided && obs != null) return obs; Set<Obs> ret = new HashSet<Obs>(); if (this.obs != null) { for (Obs o : this.obs) { if (includeVoided) ret.add(o); else if (!o.isVoided()) ret.add(o); } } return ret; }
|
/**
* Returns all Obs where Obs.encounterId = Encounter.encounterId In practice, this method should
* not be used very often...
*
* @param includeVoided specifies whether or not to include voided Obs
* @return Returns the all Obs.
* @should not return null with null obs set
* @should get obs
* @should get both parent and child obs
* @should get both parent and child with child directly on encounter
* @should get both child and parent obs after removing child from parent grouping
*/
|
Returns all Obs where Obs.encounterId = Encounter.encounterId In practice, this method should not be used very often..
|
getAllObs
|
{
"repo_name": "Bhamni/openmrs-core",
"path": "api/src/main/java/org/openmrs/Encounter.java",
"license": "mpl-2.0",
"size": 21194
}
|
[
"java.util.HashSet",
"java.util.Set"
] |
import java.util.HashSet; import java.util.Set;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,223,453
|
public void setExpression(JPQLExpression expression) {
super.setExpression(expression);
}
|
void function(JPQLExpression expression) { super.setExpression(expression); }
|
/**
* Keeps a reference of the {@link JPQLExpression parsed object} object, which should only be
* done when this object is instantiated during the conversion of a parsed JPQL query into
* {@link StateObject StateObjects}.
*
* @param expression The {@link JPQLExpression parsed object} representing the JPQL query
*/
|
Keeps a reference of the <code>JPQLExpression parsed object</code> object, which should only be done when this object is instantiated during the conversion of a parsed JPQL query into <code>StateObject StateObjects</code>
|
setExpression
|
{
"repo_name": "bfg-repo-cleaner-demos/eclipselink.runtime-bfg-strip-big-blobs",
"path": "jpa/org.eclipse.persistence.jpa.jpql/src/org/eclipse/persistence/jpa/jpql/tools/model/query/JPQLQueryStateObject.java",
"license": "epl-1.0",
"size": 9700
}
|
[
"org.eclipse.persistence.jpa.jpql.parser.JPQLExpression"
] |
import org.eclipse.persistence.jpa.jpql.parser.JPQLExpression;
|
import org.eclipse.persistence.jpa.jpql.parser.*;
|
[
"org.eclipse.persistence"
] |
org.eclipse.persistence;
| 1,944,478
|
public RectangleInsets getPadding() {
return this.padding;
}
/**
* Sets the padding for the thermometer and sends a {@link PlotChangeEvent}
|
RectangleInsets function() { return this.padding; } /** * Sets the padding for the thermometer and sends a {@link PlotChangeEvent}
|
/**
* Returns the padding for the thermometer. This is the space inside the
* plot area.
*
* @return The padding (never <code>null</code>).
*
* @see #setPadding(RectangleInsets)
*/
|
Returns the padding for the thermometer. This is the space inside the plot area
|
getPadding
|
{
"repo_name": "ilyessou/jfreechart",
"path": "source/org/jfree/chart/plot/ThermometerPlot.java",
"license": "lgpl-2.1",
"size": 56273
}
|
[
"org.jfree.chart.event.PlotChangeEvent",
"org.jfree.chart.util.RectangleInsets"
] |
import org.jfree.chart.event.PlotChangeEvent; import org.jfree.chart.util.RectangleInsets;
|
import org.jfree.chart.event.*; import org.jfree.chart.util.*;
|
[
"org.jfree.chart"
] |
org.jfree.chart;
| 777,998
|
public static void main(final String[] args) {
SecureRandom saltGen = null;
try {
saltGen = SecureRandom.getInstance("SHA1PRNG");
} catch (final NoSuchAlgorithmException e) {
e.printStackTrace();
}
final String hashed = BCrypt.hashpw("Dheeraj", BCrypt.gensalt(5, saltGen));
System.out.println("Hashed password: " + hashed);
final boolean isMatched = BCrypt.checkpw("Dheeraj", "$2a$05$IYfRarp756ijW.lB/vM/yuep6pdlZoMunShuBeHhMvgVQk.C9NIB2");
System.out.println(isMatched);
}
|
static void function(final String[] args) { SecureRandom saltGen = null; try { saltGen = SecureRandom.getInstance(STR); } catch (final NoSuchAlgorithmException e) { e.printStackTrace(); } final String hashed = BCrypt.hashpw(STR, BCrypt.gensalt(5, saltGen)); System.out.println(STR + hashed); final boolean isMatched = BCrypt.checkpw(STR, STR); System.out.println(isMatched); }
|
/**
* The main method.
*
* @param args the arguments
*/
|
The main method
|
main
|
{
"repo_name": "dheerajarora/playground",
"path": "playground-core/src/main/java/org/drjkrsna/hashing/BCryptHashing.java",
"license": "apache-2.0",
"size": 1658
}
|
[
"java.security.NoSuchAlgorithmException",
"java.security.SecureRandom"
] |
import java.security.NoSuchAlgorithmException; import java.security.SecureRandom;
|
import java.security.*;
|
[
"java.security"
] |
java.security;
| 1,023,592
|
@XmlTransient
public WebResourcesAuthorization getUpdateAuthorization() {
if (updateAuthorization==null) {
updateAuthorization = new WebResourcesAuthorization(AuthorizationType.NONE, null, null);
}
return updateAuthorization;
}
|
WebResourcesAuthorization function() { if (updateAuthorization==null) { updateAuthorization = new WebResourcesAuthorization(AuthorizationType.NONE, null, null); } return updateAuthorization; }
|
/**
* Returns the update authorization.
* @return the update authorization
*/
|
Returns the update authorization
|
getUpdateAuthorization
|
{
"repo_name": "EnFlexIT/AgentWorkbench",
"path": "eclipseProjects/org.agentgui/bundles/org.agentgui.core/src/agentgui/core/project/Project.java",
"license": "lgpl-2.1",
"size": 78478
}
|
[
"de.enflexit.common.http.WebResourcesAuthorization"
] |
import de.enflexit.common.http.WebResourcesAuthorization;
|
import de.enflexit.common.http.*;
|
[
"de.enflexit.common"
] |
de.enflexit.common;
| 2,138,930
|
public void start(Query query) {
int firstResult = 1;
while (firstResult <= getMaxResultsTotal()) {
getCopy().start(query, firstResult);
firstResult += getMaxResultsPerQuery();
}
}
|
void function(Query query) { int firstResult = 1; while (firstResult <= getMaxResultsTotal()) { getCopy().start(query, firstResult); firstResult += getMaxResultsPerQuery(); } }
|
/**
* <p>Creates <code>[MAX_RESULTS_TOTAL / MAX_RESULTS_PERQUERY]</code>
* threads that fetch up to <code>MAX_RESULTS_TOTAL</code> results.</p>
*
* <p>This method should be used instead of the inherited
* <code>start()</code> method without arguments.</p>
*
* @param query <code>Query</code> object
*/
|
Creates <code>[MAX_RESULTS_TOTAL / MAX_RESULTS_PERQUERY]</code> threads that fetch up to <code>MAX_RESULTS_TOTAL</code> results. This method should be used instead of the inherited <code>start()</code> method without arguments
|
start
|
{
"repo_name": "wufei523/QA",
"path": "src/info/ephyra/search/searchers/KnowledgeMiner.java",
"license": "gpl-2.0",
"size": 5013
}
|
[
"info.ephyra.querygeneration.Query"
] |
import info.ephyra.querygeneration.Query;
|
import info.ephyra.querygeneration.*;
|
[
"info.ephyra.querygeneration"
] |
info.ephyra.querygeneration;
| 2,550,213
|
public void testLdapNameString014() throws Exception {
try {
new LdapName("test");
fail("InvalidNameException expected");
} catch (InvalidNameException e) {}
try {
new LdapName("t=test,control");
fail("InvalidNameException expected");
} catch (InvalidNameException e) {}
new LdapName("t=test,");
try {
new LdapName(",t=test");
fail("InvalidNameException expected");
} catch (InvalidNameException e) {}
try {
new LdapName(",t=test,");
fail("InvalidNameException expected");
} catch (InvalidNameException e) {}
}
|
void function() throws Exception { try { new LdapName("test"); fail(STR); } catch (InvalidNameException e) {} try { new LdapName(STR); fail(STR); } catch (InvalidNameException e) {} new LdapName(STR); try { new LdapName(STR); fail(STR); } catch (InvalidNameException e) {} try { new LdapName(STR); fail(STR); } catch (InvalidNameException e) {} }
|
/**
* <p>
* Test method for 'javax.naming.ldap.LdapName(String)'
* </p>
* <p>
* Here we are testing the constructor, this method should not accept a
* String with an incorrect format like "test".
* </p>
* <p>
* The expected result is an InvalidNameException.
* </p>
*/
|
Test method for 'javax.naming.ldap.LdapName(String)' Here we are testing the constructor, this method should not accept a String with an incorrect format like "test". The expected result is an InvalidNameException.
|
testLdapNameString014
|
{
"repo_name": "freeVM/freeVM",
"path": "enhanced/java/classlib/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/LdapNameTest.java",
"license": "apache-2.0",
"size": 119091
}
|
[
"javax.naming.InvalidNameException",
"javax.naming.ldap.LdapName"
] |
import javax.naming.InvalidNameException; import javax.naming.ldap.LdapName;
|
import javax.naming.*; import javax.naming.ldap.*;
|
[
"javax.naming"
] |
javax.naming;
| 176,834
|
public static void launch(
Context context,
AppAccount appAccount,
String startLabelId,
String experimentId,
int activeSensorIndex,
boolean fromRecord,
boolean createTask,
boolean claimExperimentsMode,
Bundle options) {
// TODO(saff): fancy schmancy material transition here (see specs)
final Intent intent =
createLaunchIntent(
context,
appAccount,
startLabelId,
experimentId,
activeSensorIndex,
fromRecord,
createTask,
claimExperimentsMode);
context.startActivity(intent, options);
}
|
static void function( Context context, AppAccount appAccount, String startLabelId, String experimentId, int activeSensorIndex, boolean fromRecord, boolean createTask, boolean claimExperimentsMode, Bundle options) { final Intent intent = createLaunchIntent( context, appAccount, startLabelId, experimentId, activeSensorIndex, fromRecord, createTask, claimExperimentsMode); context.startActivity(intent, options); }
|
/**
* Launches a new recording review activity
*
* @param startLabelId The ID of the start run label.
* @param activeSensorIndex The index of the sensor which ought to be displayed first.
* @param fromRecord Whether we reached the RunReview activity from recording directly or from
* another part of the app.
* @param options Options bundle for launch
*/
|
Launches a new recording review activity
|
launch
|
{
"repo_name": "googlearchive/science-journal",
"path": "OpenScienceJournal/whistlepunk_library/src/main/java/com/google/android/apps/forscience/whistlepunk/review/RunReviewActivity.java",
"license": "apache-2.0",
"size": 9640
}
|
[
"android.content.Context",
"android.content.Intent",
"android.os.Bundle",
"com.google.android.apps.forscience.whistlepunk.accounts.AppAccount"
] |
import android.content.Context; import android.content.Intent; import android.os.Bundle; import com.google.android.apps.forscience.whistlepunk.accounts.AppAccount;
|
import android.content.*; import android.os.*; import com.google.android.apps.forscience.whistlepunk.accounts.*;
|
[
"android.content",
"android.os",
"com.google.android"
] |
android.content; android.os; com.google.android;
| 186,797
|
@Override
public double apply(UnivariateStatistic stat) {
double[] v = this.getValues();
if (v != null) {
return stat.evaluate(v, 0, v.length);
}
return Double.NaN;
}
|
double function(UnivariateStatistic stat) { double[] v = this.getValues(); if (v != null) { return stat.evaluate(v, 0, v.length); } return Double.NaN; }
|
/**
* Apply the given statistic to this univariate collection.
* @param stat the statistic to apply
* @return the computed value of the statistic.
*/
|
Apply the given statistic to this univariate collection
|
apply
|
{
"repo_name": "SpoonLabs/astor",
"path": "examples/Math-issue-288/src/test/java/org/apache/commons/math/stat/descriptive/ListUnivariateImpl.java",
"license": "gpl-2.0",
"size": 6277
}
|
[
"org.apache.commons.math.stat.descriptive.UnivariateStatistic"
] |
import org.apache.commons.math.stat.descriptive.UnivariateStatistic;
|
import org.apache.commons.math.stat.descriptive.*;
|
[
"org.apache.commons"
] |
org.apache.commons;
| 1,749,967
|
public Collection<Option> getOptionList() {
return options.values();
}
|
Collection<Option> function() { return options.values(); }
|
/**
* Returns all options for this option group.
*
* @return a list of options
*/
|
Returns all options for this option group
|
getOptionList
|
{
"repo_name": "runelk/maltnob",
"path": "tools/maltparser-1.8.1/src/org/maltparser/core/options/OptionGroup.java",
"license": "mit",
"size": 3048
}
|
[
"java.util.Collection",
"org.maltparser.core.options.option.Option"
] |
import java.util.Collection; import org.maltparser.core.options.option.Option;
|
import java.util.*; import org.maltparser.core.options.option.*;
|
[
"java.util",
"org.maltparser.core"
] |
java.util; org.maltparser.core;
| 565,571
|
public StaticLayoutBuilderCompat setEllipsize(@Nullable TextUtils.TruncateAt ellipsize) {
mEllipsize = ellipsize;
return this;
}
|
StaticLayoutBuilderCompat function(@Nullable TextUtils.TruncateAt ellipsize) { mEllipsize = ellipsize; return this; }
|
/**
* Set ellipsizing on the layout. Causes words that are longer than the view
* is wide, or exceeding the number of lines (see #setMaxLines) in the case
* of {@link android.text.TextUtils.TruncateAt#END} or
* {@link android.text.TextUtils.TruncateAt#MARQUEE}, to be ellipsized instead
* of broken. The default is
* {@code null}, indicating no ellipsis is to be applied.
*
* @param ellipsize type of ellipsis behavior
* @return this builder, useful for chaining
* @see android.widget.TextView#setEllipsize
*/
|
Set ellipsizing on the layout. Causes words that are longer than the view is wide, or exceeding the number of lines (see #setMaxLines) in the case of <code>android.text.TextUtils.TruncateAt#END</code> or <code>android.text.TextUtils.TruncateAt#MARQUEE</code>, to be ellipsized instead of broken. The default is null, indicating no ellipsis is to be applied
|
setEllipsize
|
{
"repo_name": "lsjwzh/FastTextView",
"path": "widget.FastTextView/src/main/java/android/text/StaticLayoutBuilderCompat.java",
"license": "apache-2.0",
"size": 10497
}
|
[
"android.annotation.Nullable"
] |
import android.annotation.Nullable;
|
import android.annotation.*;
|
[
"android.annotation"
] |
android.annotation;
| 2,299,678
|
protected void setInitParam(String paramName, String paramValue)
throws ServletException
{
if ("compile".equals(paramName)) {
setCompile(paramValue);
}
else if ("ini-file".equals(paramName)) {
Quercus quercus = getQuercus();
String realPath = getServletContext().getRealPath(paramValue);
Path path = quercus.getPwd().lookup(realPath);
setIniFile(path);
}
else if ("mysql-version".equals(paramName)) {
setMysqlVersion(paramValue);
}
else if ("php-version".equals(paramName)) {
setPhpVersion(paramValue);
}
else if ("script-encoding".equals(paramName)) {
setScriptEncoding(paramValue);
}
else if ("strict".equals(paramName)) {
setStrict("true".equals(paramValue));
}
else if ("page-cache-entries".equals(paramName)) {
setPageCacheEntries(Integer.parseInt(paramValue));
}
else if ("connection-pool".equals(paramName)) {
setConnectionPool("true".equals(paramValue));
}else if ("datasource".equals(paramName)) {
setDatabase(paramValue);
}
else
throw new ServletException("'{0}' is not a recognized init-param");
}
|
void function(String paramName, String paramValue) throws ServletException { if (STR.equals(paramName)) { setCompile(paramValue); } else if (STR.equals(paramName)) { Quercus quercus = getQuercus(); String realPath = getServletContext().getRealPath(paramValue); Path path = quercus.getPwd().lookup(realPath); setIniFile(path); } else if (STR.equals(paramName)) { setMysqlVersion(paramValue); } else if (STR.equals(paramName)) { setPhpVersion(paramValue); } else if (STR.equals(paramName)) { setScriptEncoding(paramValue); } else if (STR.equals(paramName)) { setStrict("true".equals(paramValue)); } else if (STR.equals(paramName)) { setPageCacheEntries(Integer.parseInt(paramValue)); } else if (STR.equals(paramName)) { setConnectionPool("true".equals(paramValue)); }else if (STR.equals(paramName)) { setDatabase(paramValue); } else throw new ServletException(STR); }
|
/**
* Sets a named init-param to the passed value.
*
* @throws ServletException if the init-param is not recognized
*/
|
Sets a named init-param to the passed value
|
setInitParam
|
{
"repo_name": "ggonzales/ksl",
"path": "src/com/dotmarketing/scripting/servlet/PHPServlet.java",
"license": "gpl-3.0",
"size": 11943
}
|
[
"com.caucho.quercus.Quercus",
"com.caucho.vfs.Path",
"javax.servlet.ServletException"
] |
import com.caucho.quercus.Quercus; import com.caucho.vfs.Path; import javax.servlet.ServletException;
|
import com.caucho.quercus.*; import com.caucho.vfs.*; import javax.servlet.*;
|
[
"com.caucho.quercus",
"com.caucho.vfs",
"javax.servlet"
] |
com.caucho.quercus; com.caucho.vfs; javax.servlet;
| 572,745
|
public static Component performComponentLifecycle(View view, Object model, HttpServletRequest request,
ViewPostMetadata viewPostMetadata, String componentId) {
if (viewPostMetadata == null) {
UifFormBase form = (UifFormBase) model;
throw new RuntimeException("View post metadata is null which cannot occur for refresh. Form id: "
+ form.getFormKey() + ", requested form id: " + form.getRequestedFormKey());
}
ComponentPostMetadata componentPostMetadata = viewPostMetadata.getComponentPostMetadata(componentId);
if ((componentPostMetadata == null) || componentPostMetadata.isDetachedComponent()) {
if (componentPostMetadata == null) {
componentPostMetadata = viewPostMetadata.initializeComponentPostMetadata(componentId);
}
setupStandaloneComponentForRefresh(view, componentId, componentPostMetadata);
}
Map<String, List<String>> refreshPathMappings = componentPostMetadata.getRefreshPathMappings();
encapsulateLifecycle(view, model, viewPostMetadata, componentPostMetadata, request, new ViewLifecycleBuild(null,
refreshPathMappings));
return ObjectPropertyUtils.getPropertyValue(view, componentPostMetadata.getPath());
}
|
static Component function(View view, Object model, HttpServletRequest request, ViewPostMetadata viewPostMetadata, String componentId) { if (viewPostMetadata == null) { UifFormBase form = (UifFormBase) model; throw new RuntimeException(STR + form.getFormKey() + STR + form.getRequestedFormKey()); } ComponentPostMetadata componentPostMetadata = viewPostMetadata.getComponentPostMetadata(componentId); if ((componentPostMetadata == null) componentPostMetadata.isDetachedComponent()) { if (componentPostMetadata == null) { componentPostMetadata = viewPostMetadata.initializeComponentPostMetadata(componentId); } setupStandaloneComponentForRefresh(view, componentId, componentPostMetadata); } Map<String, List<String>> refreshPathMappings = componentPostMetadata.getRefreshPathMappings(); encapsulateLifecycle(view, model, viewPostMetadata, componentPostMetadata, request, new ViewLifecycleBuild(null, refreshPathMappings)); return ObjectPropertyUtils.getPropertyValue(view, componentPostMetadata.getPath()); }
|
/**
* Performs a lifecycle process to rebuild the component given by the update id.
*
* @param view view instance the component belongs to
* @param model object containing the full view data
* @param request The active servlet request.
* @param viewPostMetadata post metadata for the view
* @param componentId id of the component within the view, used to pull the current component from the view
* @return component instance the lifecycle has been run on
*/
|
Performs a lifecycle process to rebuild the component given by the update id
|
performComponentLifecycle
|
{
"repo_name": "mztaylor/rice-git",
"path": "rice-framework/krad-web-framework/src/main/java/org/kuali/rice/krad/uif/lifecycle/ViewLifecycle.java",
"license": "apache-2.0",
"size": 31655
}
|
[
"java.util.List",
"java.util.Map",
"javax.servlet.http.HttpServletRequest",
"org.kuali.rice.krad.uif.component.Component",
"org.kuali.rice.krad.uif.util.ObjectPropertyUtils",
"org.kuali.rice.krad.uif.view.View",
"org.kuali.rice.krad.web.form.UifFormBase"
] |
import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import org.kuali.rice.krad.uif.component.Component; import org.kuali.rice.krad.uif.util.ObjectPropertyUtils; import org.kuali.rice.krad.uif.view.View; import org.kuali.rice.krad.web.form.UifFormBase;
|
import java.util.*; import javax.servlet.http.*; import org.kuali.rice.krad.uif.component.*; import org.kuali.rice.krad.uif.util.*; import org.kuali.rice.krad.uif.view.*; import org.kuali.rice.krad.web.form.*;
|
[
"java.util",
"javax.servlet",
"org.kuali.rice"
] |
java.util; javax.servlet; org.kuali.rice;
| 2,307,522
|
public void sendTransformationXMLToSlaveServer(TransMeta transMeta, TransExecutionConfiguration executionConfiguration) {
try {
Trans.sendToSlaveServer(transMeta, executionConfiguration, rep);
} catch (Exception e) {
new ErrorDialog(shell, "Error", "Error sending transformation to server", e);
}
}
|
void function(TransMeta transMeta, TransExecutionConfiguration executionConfiguration) { try { Trans.sendToSlaveServer(transMeta, executionConfiguration, rep); } catch (Exception e) { new ErrorDialog(shell, "Error", STR, e); } }
|
/**
* Sends transformation to slave server
*
* @param executionConfiguration
*/
|
Sends transformation to slave server
|
sendTransformationXMLToSlaveServer
|
{
"repo_name": "jjeb/kettle-trunk",
"path": "ui/src/org/pentaho/di/ui/spoon/Spoon.java",
"license": "apache-2.0",
"size": 320804
}
|
[
"org.pentaho.di.trans.Trans",
"org.pentaho.di.trans.TransExecutionConfiguration",
"org.pentaho.di.trans.TransMeta",
"org.pentaho.di.ui.core.dialog.ErrorDialog"
] |
import org.pentaho.di.trans.Trans; import org.pentaho.di.trans.TransExecutionConfiguration; import org.pentaho.di.trans.TransMeta; import org.pentaho.di.ui.core.dialog.ErrorDialog;
|
import org.pentaho.di.trans.*; import org.pentaho.di.ui.core.dialog.*;
|
[
"org.pentaho.di"
] |
org.pentaho.di;
| 2,167,939
|
public static void show(final DialogFragmentActivity activity,
final int requestCode, final String title, final String message,
final ArrayList<Label> choices, final boolean[] selectedChoices) {
Bundle arguments = createArguments(title, message, requestCode);
arguments.putParcelableArrayList(ARG_CHOICES, choices);
arguments.putBooleanArray(ARG_SELECTED_CHOICES, selectedChoices);
show(activity, new LabelsDialogFragment(), arguments, TAG);
}
|
static void function(final DialogFragmentActivity activity, final int requestCode, final String title, final String message, final ArrayList<Label> choices, final boolean[] selectedChoices) { Bundle arguments = createArguments(title, message, requestCode); arguments.putParcelableArrayList(ARG_CHOICES, choices); arguments.putBooleanArray(ARG_SELECTED_CHOICES, selectedChoices); show(activity, new LabelsDialogFragment(), arguments, TAG); }
|
/**
* Confirm message and deliver callback to given activity
*
* @param activity
* @param requestCode
* @param title
* @param message
* @param choices
* @param selectedChoices
*/
|
Confirm message and deliver callback to given activity
|
show
|
{
"repo_name": "hufsm/PocketHub",
"path": "app/src/main/java/com/github/pockethub/ui/issue/LabelsDialogFragment.java",
"license": "apache-2.0",
"size": 7749
}
|
[
"android.os.Bundle",
"com.alorma.github.sdk.bean.dto.response.Label",
"com.github.pockethub.ui.DialogFragmentActivity",
"java.util.ArrayList"
] |
import android.os.Bundle; import com.alorma.github.sdk.bean.dto.response.Label; import com.github.pockethub.ui.DialogFragmentActivity; import java.util.ArrayList;
|
import android.os.*; import com.alorma.github.sdk.bean.dto.response.*; import com.github.pockethub.ui.*; import java.util.*;
|
[
"android.os",
"com.alorma.github",
"com.github.pockethub",
"java.util"
] |
android.os; com.alorma.github; com.github.pockethub; java.util;
| 2,361,975
|
@Before
public void beforeTests() throws FileNotFoundException {
file = new File(path);
}
|
void function() throws FileNotFoundException { file = new File(path); }
|
/**
* Creates a file and plate writer.
* @throws FileNotFoundException
*/
|
Creates a file and plate writer
|
beforeTests
|
{
"repo_name": "jessemull/MicroFlex",
"path": "src/test/java/com/github/jessemull/microflex/io/iodouble/PlateReaderDoubleSetsTest.java",
"license": "apache-2.0",
"size": 24099
}
|
[
"java.io.File",
"java.io.FileNotFoundException"
] |
import java.io.File; import java.io.FileNotFoundException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,412,274
|
public static String zipEntryToString(File zipFile, String entryName) throws IOException {
return zipEntryToString(zipFile.toPath(), entryName);
}
|
static String function(File zipFile, String entryName) throws IOException { return zipEntryToString(zipFile.toPath(), entryName); }
|
/**
* See {@link #zipEntryToString(Path, String, Charset)}. Use UTF-8 as charset.
*/
|
See <code>#zipEntryToString(Path, String, Charset)</code>. Use UTF-8 as charset
|
zipEntryToString
|
{
"repo_name": "jjYBdx4IL/misc",
"path": "io-utils/src/main/java/com/github/jjYBdx4IL/utils/io/ZipUtils.java",
"license": "apache-2.0",
"size": 12745
}
|
[
"java.io.File",
"java.io.IOException"
] |
import java.io.File; import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,475,790
|
public static boolean isConnected(Context context) {
ConnectivityManager connectivity = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connectivity.getActiveNetworkInfo();
if (networkInfo != null && networkInfo.isConnectedOrConnecting()) {
return true;
}
return false;
}
|
static boolean function(Context context) { ConnectivityManager connectivity = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = connectivity.getActiveNetworkInfo(); if (networkInfo != null && networkInfo.isConnectedOrConnecting()) { return true; } return false; }
|
/**
* Checks if there is Internet connection or data connection on the device.
*
* @param context - The activity calling this method.
* @return boolean
*/
|
Checks if there is Internet connection or data connection on the device
|
isConnected
|
{
"repo_name": "aksalj/SMSSync",
"path": "smssync/src/main/java/org/addhen/smssync/data/util/Utility.java",
"license": "lgpl-3.0",
"size": 2223
}
|
[
"android.content.Context",
"android.net.ConnectivityManager",
"android.net.NetworkInfo"
] |
import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo;
|
import android.content.*; import android.net.*;
|
[
"android.content",
"android.net"
] |
android.content; android.net;
| 1,948,348
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.