method
stringlengths 13
441k
| clean_method
stringlengths 7
313k
| doc
stringlengths 17
17.3k
| comment
stringlengths 3
1.42k
| method_name
stringlengths 1
273
| extra
dict | imports
sequence | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
sequence | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
---|---|---|---|---|---|---|---|---|---|---|---|
private void reportResult(TestResult testInfo) {
if (!testInfo.isComplete()) {
Log.w(LOG_TAG, "invalid instrumentation status bundle " + testInfo.toString());
return;
}
reportTestRunStarted(testInfo);
TestIdentifier testId = new TestIdentifier(testInfo.mTestClass, testInfo.mTestName);
Map<String, String> metrics;
switch (testInfo.mCode) {
case StatusCodes.START:
for (ITestRunListener listener : mTestListeners) {
listener.testStarted(testId);
}
break;
case StatusCodes.FAILURE:
metrics = getAndResetTestMetrics();
for (ITestRunListener listener : mTestListeners) {
listener.testFailed(ITestRunListener.TestFailure.FAILURE, testId,
getTrace(testInfo));
listener.testEnded(testId, metrics);
}
mNumTestsRun++;
break;
case StatusCodes.ERROR:
metrics = getAndResetTestMetrics();
for (ITestRunListener listener : mTestListeners) {
listener.testFailed(ITestRunListener.TestFailure.ERROR, testId,
getTrace(testInfo));
listener.testEnded(testId, metrics);
}
mNumTestsRun++;
break;
case StatusCodes.OK:
metrics = getAndResetTestMetrics();
for (ITestRunListener listener : mTestListeners) {
listener.testEnded(testId, metrics);
}
mNumTestsRun++;
break;
default:
metrics = getAndResetTestMetrics();
Log.e(LOG_TAG, "Unknown status code received: " + testInfo.mCode);
for (ITestRunListener listener : mTestListeners) {
listener.testEnded(testId, metrics);
}
mNumTestsRun++;
break;
}
} | void function(TestResult testInfo) { if (!testInfo.isComplete()) { Log.w(LOG_TAG, STR + testInfo.toString()); return; } reportTestRunStarted(testInfo); TestIdentifier testId = new TestIdentifier(testInfo.mTestClass, testInfo.mTestName); Map<String, String> metrics; switch (testInfo.mCode) { case StatusCodes.START: for (ITestRunListener listener : mTestListeners) { listener.testStarted(testId); } break; case StatusCodes.FAILURE: metrics = getAndResetTestMetrics(); for (ITestRunListener listener : mTestListeners) { listener.testFailed(ITestRunListener.TestFailure.FAILURE, testId, getTrace(testInfo)); listener.testEnded(testId, metrics); } mNumTestsRun++; break; case StatusCodes.ERROR: metrics = getAndResetTestMetrics(); for (ITestRunListener listener : mTestListeners) { listener.testFailed(ITestRunListener.TestFailure.ERROR, testId, getTrace(testInfo)); listener.testEnded(testId, metrics); } mNumTestsRun++; break; case StatusCodes.OK: metrics = getAndResetTestMetrics(); for (ITestRunListener listener : mTestListeners) { listener.testEnded(testId, metrics); } mNumTestsRun++; break; default: metrics = getAndResetTestMetrics(); Log.e(LOG_TAG, STR + testInfo.mCode); for (ITestRunListener listener : mTestListeners) { listener.testEnded(testId, metrics); } mNumTestsRun++; break; } } | /**
* Reports a test result to the test run listener. Must be called when a individual test
* result has been fully parsed.
*
* @param statusMap key-value status pairs of test result
*/ | Reports a test result to the test run listener. Must be called when a individual test result has been fully parsed | reportResult | {
"repo_name": "lrscp/ControlAndroidDeviceFromPC",
"path": "src/com/android/ddmlib/testrunner/InstrumentationResultParser.java",
"license": "apache-2.0",
"size": 23236
} | [
"com.android.ddmlib.Log",
"java.util.Map"
] | import com.android.ddmlib.Log; import java.util.Map; | import com.android.ddmlib.*; import java.util.*; | [
"com.android.ddmlib",
"java.util"
] | com.android.ddmlib; java.util; | 2,128,297 |
public Observable<ServiceResponse<DeploymentValidateResultInner>> validateWithServiceResponseAsync(String resourceGroupName, String deploymentName, DeploymentInner parameters) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (deploymentName == null) {
throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (parameters == null) {
throw new IllegalArgumentException("Parameter parameters is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
} | Observable<ServiceResponse<DeploymentValidateResultInner>> function(String resourceGroupName, String deploymentName, DeploymentInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (deploymentName == null) { throw new IllegalArgumentException(STR); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); } if (parameters == null) { throw new IllegalArgumentException(STR); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException(STR); } | /**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..
*
* @param resourceGroupName The name of the resource group the template will be deployed to. The name is case insensitive.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the DeploymentValidateResultInner object
*/ | Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager. | validateWithServiceResponseAsync | {
"repo_name": "ljhljh235/azure-sdk-for-java",
"path": "azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentsInner.java",
"license": "apache-2.0",
"size": 83287
} | [
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.rest.ServiceResponse; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 937,098 |
public final void fill(Menu parent, int index) {
Assert.isTrue(false, "Can't add a control to a menu");//$NON-NLS-1$
} | final void function(Menu parent, int index) { Assert.isTrue(false, STR); } | /**
* The control item implementation of this <code>IContributionItem</code>
* method throws an exception since controls cannot be added to menus.
*/ | The control item implementation of this <code>IContributionItem</code> method throws an exception since controls cannot be added to menus | fill | {
"repo_name": "ghillairet/gef-gwt",
"path": "src/main/java/org/eclipse/jface/action/ControlContribution.java",
"license": "epl-1.0",
"size": 3693
} | [
"org.eclipse.core.runtime.Assert",
"org.eclipse.swt.widgets.Menu"
] | import org.eclipse.core.runtime.Assert; import org.eclipse.swt.widgets.Menu; | import org.eclipse.core.runtime.*; import org.eclipse.swt.widgets.*; | [
"org.eclipse.core",
"org.eclipse.swt"
] | org.eclipse.core; org.eclipse.swt; | 1,446,339 |
public static String getMsgTime(long lasttime,long msgtime) throws Exception {
Calendar msgcalendar = Calendar.getInstance();
msgcalendar.setTimeInMillis(lasttime);
Calendar curcalendar = Calendar.getInstance();
curcalendar.setTimeInMillis(msgtime);
SimpleDateFormat format = null;
String showTime = "";
int msgYear = msgcalendar.get(Calendar.YEAR);
int curYear = curcalendar.get(Calendar.YEAR);
if (curYear != msgYear) {
format = DATE_FORMAT_DATE;
showTime = format.format(msgtime);
} else {
int msgMonth = msgcalendar.get(Calendar.MONTH);
int curMonth = curcalendar.get(Calendar.MONTH);
if (msgMonth != curMonth) {
format = DATE_FORMAT_MONTH;
showTime = format.format(msgtime);
} else {
Context context = BaseApplication.getInstance().getBaseContext();
int msgDay = msgcalendar.get(Calendar.DAY_OF_MONTH);
int curDay = curcalendar.get(Calendar.DAY_OF_MONTH);
switch (curDay - msgDay) {
case 0:
format = DATE_FORMAT_HOUR_MIN;
showTime = format.format(msgtime);
break;
case 1:
format = DATE_FORMAT_HOUR_MIN;
showTime = format.format(msgtime);
showTime = context.getString(R.string.Chat_Yesterday)+" "+showTime;
break;
case 2:
format = DATE_FORMAT_HOUR_MIN;
showTime = format.format(msgtime);
showTime = context.getString(R.string.Chat_the_day_before_yesterday_time, " " + showTime);
break;
default:
format = DATE_FORMAT_HOUR_MIN;
showTime = format.format(msgtime);
break;
}
}
}
return showTime;
} | static String function(long lasttime,long msgtime) throws Exception { Calendar msgcalendar = Calendar.getInstance(); msgcalendar.setTimeInMillis(lasttime); Calendar curcalendar = Calendar.getInstance(); curcalendar.setTimeInMillis(msgtime); SimpleDateFormat format = null; String showTime = STR STR " + showTime); break; default: format = DATE_FORMAT_HOUR_MIN; showTime = format.format(msgtime); break; } } } return showTime; } | /**
* Timestamp to descriptive time
* @param lasttime
* @param msgtime
* @return
* @throws Exception
*/ | Timestamp to descriptive time | getMsgTime | {
"repo_name": "connectim/Android",
"path": "app/src/main/java/connect/utils/TimeUtil.java",
"license": "mit",
"size": 5507
} | [
"java.text.SimpleDateFormat",
"java.util.Calendar"
] | import java.text.SimpleDateFormat; import java.util.Calendar; | import java.text.*; import java.util.*; | [
"java.text",
"java.util"
] | java.text; java.util; | 1,819,806 |
public static Object prefs_readPreference(Context ctx, String prefName, String key, Class<?> valueType){
SharedPreferences prefs = ctx.getSharedPreferences(
prefName, Context.MODE_PRIVATE);
if(prefs==null) //In case of a Service, for example, we take the default preferences.
prefs = PreferenceManager.getDefaultSharedPreferences(ctx);
if(valueType == Long.class){
return prefs.getLong(key, Long.valueOf(-1));
}else if(valueType == Boolean.class){
return prefs.getBoolean(key, Boolean.valueOf(false));
}else if (valueType == Double.class) {
return Double.longBitsToDouble(prefs.getLong(key, Double.doubleToRawLongBits(-1)));
}else if(valueType == Float.class){
return prefs.getFloat(key, Float.valueOf(-1));
}else if(valueType == Integer.class){
return prefs.getInt(key, Integer.valueOf(-1));
}else if(valueType == String.class){
return prefs.getString(key, null);
}else if(valueType == Set.class){
//return prefs.getStringSet(key, null); //Only from 11 API level.
return getSetListFromCommaSeparatedString(ctx, prefName, key);
}
return null;
}
| static Object function(Context ctx, String prefName, String key, Class<?> valueType){ SharedPreferences prefs = ctx.getSharedPreferences( prefName, Context.MODE_PRIVATE); if(prefs==null) prefs = PreferenceManager.getDefaultSharedPreferences(ctx); if(valueType == Long.class){ return prefs.getLong(key, Long.valueOf(-1)); }else if(valueType == Boolean.class){ return prefs.getBoolean(key, Boolean.valueOf(false)); }else if (valueType == Double.class) { return Double.longBitsToDouble(prefs.getLong(key, Double.doubleToRawLongBits(-1))); }else if(valueType == Float.class){ return prefs.getFloat(key, Float.valueOf(-1)); }else if(valueType == Integer.class){ return prefs.getInt(key, Integer.valueOf(-1)); }else if(valueType == String.class){ return prefs.getString(key, null); }else if(valueType == Set.class){ return getSetListFromCommaSeparatedString(ctx, prefName, key); } return null; } | /**
* Gets a value from given key in the preferences.
*
* @param ctx
* @param prefName
* @param key
* @param valueType
* @return
*/ | Gets a value from given key in the preferences | prefs_readPreference | {
"repo_name": "javocsoft/javocsoft-toolbox",
"path": "src/es/javocsoft/android/lib/toolbox/ToolBox.java",
"license": "gpl-3.0",
"size": 316451
} | [
"android.content.Context",
"android.content.SharedPreferences",
"android.preference.PreferenceManager",
"java.util.Set"
] | import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; import java.util.Set; | import android.content.*; import android.preference.*; import java.util.*; | [
"android.content",
"android.preference",
"java.util"
] | android.content; android.preference; java.util; | 227,894 |
public Observable<ServiceResponse<TopologyInner>> getTopologyWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, TopologyParameters parameters) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (networkWatcherName == null) {
throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (parameters == null) {
throw new IllegalArgumentException("Parameter parameters is required and cannot be null.");
} | Observable<ServiceResponse<TopologyInner>> function(String resourceGroupName, String networkWatcherName, TopologyParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (networkWatcherName == null) { throw new IllegalArgumentException(STR); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); } if (parameters == null) { throw new IllegalArgumentException(STR); } | /**
* Gets the current network topology by resource group.
*
* @param resourceGroupName The name of the resource group.
* @param networkWatcherName The name of the network watcher.
* @param parameters Parameters that define the representation of topology.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the TopologyInner object
*/ | Gets the current network topology by resource group | getTopologyWithServiceResponseAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/network/v2020_03_01/implementation/NetworkWatchersInner.java",
"license": "mit",
"size": 190989
} | [
"com.microsoft.azure.management.network.v2020_03_01.TopologyParameters",
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.azure.management.network.v2020_03_01.TopologyParameters; import com.microsoft.rest.ServiceResponse; | import com.microsoft.azure.management.network.v2020_03_01.*; import com.microsoft.rest.*; | [
"com.microsoft.azure",
"com.microsoft.rest"
] | com.microsoft.azure; com.microsoft.rest; | 2,227,857 |
@Override
protected void onPreExecute() {
super.onPreExecute();
pDialog = new ProgressDialog(EditProductActivity.this);
pDialog.setMessage("Deleting Product...");
pDialog.setIndeterminate(false);
pDialog.setCancelable(true);
pDialog.show();
} | void function() { super.onPreExecute(); pDialog = new ProgressDialog(EditProductActivity.this); pDialog.setMessage(STR); pDialog.setIndeterminate(false); pDialog.setCancelable(true); pDialog.show(); } | /**
* Before starting background thread Show Progress Dialog
* */ | Before starting background thread Show Progress Dialog | onPreExecute | {
"repo_name": "AungWinnHtut/projAndroid",
"path": "com.example.androidhive.MainScreenActivity/src/com/example/androidhive/EditProductActivity.java",
"license": "mit",
"size": 8524
} | [
"android.app.ProgressDialog"
] | import android.app.ProgressDialog; | import android.app.*; | [
"android.app"
] | android.app; | 381,266 |
EReference getConditionalExpression_Condition(); | EReference getConditionalExpression_Condition(); | /**
* Returns the meta object for the containment reference '{@link org.xtext.example.delphi.astm.ConditionalExpression#getCondition <em>Condition</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference '<em>Condition</em>'.
* @see org.xtext.example.delphi.astm.ConditionalExpression#getCondition()
* @see #getConditionalExpression()
* @generated
*/ | Returns the meta object for the containment reference '<code>org.xtext.example.delphi.astm.ConditionalExpression#getCondition Condition</code>'. | getConditionalExpression_Condition | {
"repo_name": "adolfosbh/cs2as",
"path": "org.xtext.example.delphi/emf-gen/org/xtext/example/delphi/astm/AstmPackage.java",
"license": "epl-1.0",
"size": 670467
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,037,398 |
private boolean checkForSuperAdmin(final Set<SecurityGroup> userGroups) {
boolean isSuperAdmin = false;
if (null != userGroups && !userGroups.isEmpty()) {
SecurityGroup securityGroup = null;
for (Iterator<SecurityGroup> iterator = userGroups.iterator(); iterator.hasNext();) {
securityGroup = (SecurityGroup) iterator.next();
if (securityGroup.isSuperAdmin()) {
isSuperAdmin = true;
break;
}
}
}
return isSuperAdmin;
} | boolean function(final Set<SecurityGroup> userGroups) { boolean isSuperAdmin = false; if (null != userGroups && !userGroups.isEmpty()) { SecurityGroup securityGroup = null; for (Iterator<SecurityGroup> iterator = userGroups.iterator(); iterator.hasNext();) { securityGroup = (SecurityGroup) iterator.next(); if (securityGroup.isSuperAdmin()) { isSuperAdmin = true; break; } } } return isSuperAdmin; } | /**
* Checks for a super admin group in the groups assigned to user.
*
* @param userGroups {@link SecurityGroup} set of security group assigned to user.
* @return <code>true/false</code> if any user groups belongs to super admin role.
*/ | Checks for a super admin group in the groups assigned to user | checkForSuperAdmin | {
"repo_name": "ungerik/ephesoft",
"path": "Ephesoft_Community_Release_4.0.2.0/source/dcma-data-access/src/main/java/com/ephesoft/dcma/da/dao/hibernate/SecurityUserDaoImpl.java",
"license": "agpl-3.0",
"size": 6700
} | [
"com.ephesoft.dcma.da.domain.SecurityGroup",
"java.util.Iterator",
"java.util.Set"
] | import com.ephesoft.dcma.da.domain.SecurityGroup; import java.util.Iterator; import java.util.Set; | import com.ephesoft.dcma.da.domain.*; import java.util.*; | [
"com.ephesoft.dcma",
"java.util"
] | com.ephesoft.dcma; java.util; | 1,526,820 |
public static Optional<String> getDescription(int conceptId) {
return getDescription(conceptId, null, null);
}
| static Optional<String> function(int conceptId) { return getDescription(conceptId, null, null); } | /**
* Utility method to get the best text value description for a concept, according to the user preferences.
* Calls {@link #getDescription(int, LanguageCoordinate, StampCoordinate)}.
* @param conceptId - either a sequence or a nid
* @return
*/ | Utility method to get the best text value description for a concept, according to the user preferences. Calls <code>#getDescription(int, LanguageCoordinate, StampCoordinate)</code> | getDescription | {
"repo_name": "Apelon-VA/va-isaac-gui",
"path": "otf-util/src/main/java/gov/va/isaac/util/OchreUtility.java",
"license": "apache-2.0",
"size": 26380
} | [
"java.util.Optional"
] | import java.util.Optional; | import java.util.*; | [
"java.util"
] | java.util; | 981,659 |
public static ExecutorService getExecutorService() {
CHFWBundle c = instance.get();
if (null != c) {
return c.executorService;
}
return null;
} | static ExecutorService function() { CHFWBundle c = instance.get(); if (null != c) { return c.executorService; } return null; } | /**
* Access the channel framework's {@link java.util.concurrent.ExecutorService} to
* use for work dispatch.
*
* @return the executor service instance to use within the channel framework
*/ | Access the channel framework's <code>java.util.concurrent.ExecutorService</code> to use for work dispatch | getExecutorService | {
"repo_name": "kgibm/open-liberty",
"path": "dev/com.ibm.ws.channelfw/src/com/ibm/websphere/channelfw/osgi/CHFWBundle.java",
"license": "epl-1.0",
"size": 22042
} | [
"java.util.concurrent.ExecutorService"
] | import java.util.concurrent.ExecutorService; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 1,074,047 |
private static Step createStartupProgressStep(EditLogInputStream edits)
throws IOException {
long length = edits.length();
String name = edits.getCurrentStreamName();
return length != -1 ? new Step(name, length) : new Step(name);
} | static Step function(EditLogInputStream edits) throws IOException { long length = edits.length(); String name = edits.getCurrentStreamName(); return length != -1 ? new Step(name, length) : new Step(name); } | /**
* Creates a Step used for updating startup progress, populated with
* information from the given edits. The step always includes the log's name.
* If the log has a known length, then the length is included in the step too.
*
* @param edits EditLogInputStream to use for populating step
* @return Step populated with information from edits
* @throws IOException thrown if there is an I/O error
*/ | Creates a Step used for updating startup progress, populated with information from the given edits. The step always includes the log's name. If the log has a known length, then the length is included in the step too | createStartupProgressStep | {
"repo_name": "tecknowledgeable/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogLoader.java",
"license": "apache-2.0",
"size": 48487
} | [
"java.io.IOException",
"org.apache.hadoop.hdfs.server.namenode.startupprogress.Step"
] | import java.io.IOException; import org.apache.hadoop.hdfs.server.namenode.startupprogress.Step; | import java.io.*; import org.apache.hadoop.hdfs.server.namenode.startupprogress.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 2,260,323 |
public boolean getFieldBool(String field, String param, boolean def) {
String val = getFieldParam(field, param);
return val==null ? def : StrUtils.parseBool(val);
} | boolean function(String field, String param, boolean def) { String val = getFieldParam(field, param); return val==null ? def : StrUtils.parseBool(val); } | /** Returns the boolean value of the field param,
or the value for param, or def if neither is set. */ | Returns the boolean value of the field param | getFieldBool | {
"repo_name": "fogbeam/Heceta_solr",
"path": "solr/solrj/src/java/org/apache/solr/common/params/SolrParams.java",
"license": "apache-2.0",
"size": 10686
} | [
"org.apache.solr.common.util.StrUtils"
] | import org.apache.solr.common.util.StrUtils; | import org.apache.solr.common.util.*; | [
"org.apache.solr"
] | org.apache.solr; | 534,324 |
public ByteString concat(ByteString other) {
int otherLen = other.length();
if (otherLen == 0) {
return this;
}
int len = bytes.length;
byte[] buf = Arrays.copyOf(bytes, len + otherLen);
System.arraycopy(other.bytes, 0, buf, len, other.bytes.length);
return new ByteString(buf, false);
} | ByteString function(ByteString other) { int otherLen = other.length(); if (otherLen == 0) { return this; } int len = bytes.length; byte[] buf = Arrays.copyOf(bytes, len + otherLen); System.arraycopy(other.bytes, 0, buf, len, other.bytes.length); return new ByteString(buf, false); } | /**
* Returns a ByteString consisting of the concatenation of this and another
* string.
*
* @param other Byte string to concatenate
* @return Combined byte string
*/ | Returns a ByteString consisting of the concatenation of this and another string | concat | {
"repo_name": "sungsoo/optiq-project",
"path": "avatica/src/main/java/net/hydromatic/avatica/ByteString.java",
"license": "apache-2.0",
"size": 6184
} | [
"java.util.Arrays"
] | import java.util.Arrays; | import java.util.*; | [
"java.util"
] | java.util; | 1,493,981 |
protected JComponent createSouthPane(JInternalFrame w)
{
return null;
} | JComponent function(JInternalFrame w) { return null; } | /**
* This method creates the south pane used in the JInternalFrame.
*
* @param w The JInternalFrame to create a south pane for.
*
* @return The south pane.
*/ | This method creates the south pane used in the JInternalFrame | createSouthPane | {
"repo_name": "shaotuanchen/sunflower_exp",
"path": "tools/source/gcc-4.2.4/libjava/classpath/javax/swing/plaf/basic/BasicInternalFrameUI.java",
"license": "bsd-3-clause",
"size": 48539
} | [
"javax.swing.JComponent",
"javax.swing.JInternalFrame"
] | import javax.swing.JComponent; import javax.swing.JInternalFrame; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 1,644,513 |
public void setSubscriptionEngine(SubscriptionEngine subscriptionEngine) {
this.subscriptionEngine = subscriptionEngine;
} | void function(SubscriptionEngine subscriptionEngine) { this.subscriptionEngine = subscriptionEngine; } | /**
* set subscription store
*
* @param subscriptionEngine subscription store
*/ | set subscription store | setSubscriptionEngine | {
"repo_name": "hemikak/andes",
"path": "modules/andes-core/broker/src/main/java/org/wso2/andes/kernel/AndesContext.java",
"license": "apache-2.0",
"size": 7348
} | [
"org.wso2.andes.subscription.SubscriptionEngine"
] | import org.wso2.andes.subscription.SubscriptionEngine; | import org.wso2.andes.subscription.*; | [
"org.wso2.andes"
] | org.wso2.andes; | 533,894 |
@Override
protected InputStream getScriptInputStream() {
return new ReaderInputStream(new StringReader(scriptContent));
}
}
| InputStream function() { return new ReaderInputStream(new StringReader(scriptContent)); } } | /**
* Opens a stream to the content of the script.
*
* @return The content stream, not null
*/ | Opens a stream to the content of the script | getScriptInputStream | {
"repo_name": "arteam/unitils",
"path": "unitils-dbmaintainer/src/main/java/org/unitils/dbmaintainer/script/ScriptContentHandle.java",
"license": "apache-2.0",
"size": 4626
} | [
"java.io.InputStream",
"java.io.StringReader",
"org.hibernate.lob.ReaderInputStream"
] | import java.io.InputStream; import java.io.StringReader; import org.hibernate.lob.ReaderInputStream; | import java.io.*; import org.hibernate.lob.*; | [
"java.io",
"org.hibernate.lob"
] | java.io; org.hibernate.lob; | 1,706,664 |
int readShort()
throws IOException
{
int c1 = _is.read();
int c2 = _is.read();
return ((c1 << 8) | c2);
} | int readShort() throws IOException { int c1 = _is.read(); int c2 = _is.read(); return ((c1 << 8) c2); } | /**
* Parses a 16-bit int.
*/ | Parses a 16-bit int | readShort | {
"repo_name": "CleverCloud/Quercus",
"path": "resin/src/main/java/com/caucho/bytecode/ByteCodeParser.java",
"license": "gpl-2.0",
"size": 13380
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 83,141 |
private void autodetect(AutodetectCallback callback) {
Set<String> beanNames = new LinkedHashSet<String>(this.beanFactory.getBeanDefinitionCount());
beanNames.addAll(Arrays.asList(this.beanFactory.getBeanDefinitionNames()));
if (this.beanFactory instanceof ConfigurableBeanFactory) {
beanNames.addAll(Arrays.asList(((ConfigurableBeanFactory) this.beanFactory).getSingletonNames()));
}
for (String beanName : beanNames) {
if (!isExcluded(beanName) && !isBeanDefinitionAbstract(this.beanFactory, beanName)) {
try {
Class<?> beanClass = this.beanFactory.getType(beanName);
if (beanClass != null && callback.include(beanClass, beanName)) {
boolean lazyInit = isBeanDefinitionLazyInit(this.beanFactory, beanName);
Object beanInstance = (!lazyInit ? this.beanFactory.getBean(beanName) : null);
if (!ScopedProxyUtils.isScopedTarget(beanName) && !this.beans.containsValue(beanName) &&
(beanInstance == null ||
!CollectionUtils.containsInstance(this.beans.values(), beanInstance))) {
// Not already registered for JMX exposure.
this.beans.put(beanName, (beanInstance != null ? beanInstance : beanName));
if (logger.isInfoEnabled()) {
logger.info("Bean with name '" + beanName + "' has been autodetected for JMX exposure");
}
}
else {
if (logger.isDebugEnabled()) {
logger.debug("Bean with name '" + beanName + "' is already registered for JMX exposure");
}
}
}
}
catch (CannotLoadBeanClassException ex) {
if (this.allowEagerInit) {
throw ex;
}
// otherwise ignore beans where the class is not resolvable
}
}
}
} | void function(AutodetectCallback callback) { Set<String> beanNames = new LinkedHashSet<String>(this.beanFactory.getBeanDefinitionCount()); beanNames.addAll(Arrays.asList(this.beanFactory.getBeanDefinitionNames())); if (this.beanFactory instanceof ConfigurableBeanFactory) { beanNames.addAll(Arrays.asList(((ConfigurableBeanFactory) this.beanFactory).getSingletonNames())); } for (String beanName : beanNames) { if (!isExcluded(beanName) && !isBeanDefinitionAbstract(this.beanFactory, beanName)) { try { Class<?> beanClass = this.beanFactory.getType(beanName); if (beanClass != null && callback.include(beanClass, beanName)) { boolean lazyInit = isBeanDefinitionLazyInit(this.beanFactory, beanName); Object beanInstance = (!lazyInit ? this.beanFactory.getBean(beanName) : null); if (!ScopedProxyUtils.isScopedTarget(beanName) && !this.beans.containsValue(beanName) && (beanInstance == null !CollectionUtils.containsInstance(this.beans.values(), beanInstance))) { this.beans.put(beanName, (beanInstance != null ? beanInstance : beanName)); if (logger.isInfoEnabled()) { logger.info(STR + beanName + STR); } } else { if (logger.isDebugEnabled()) { logger.debug(STR + beanName + STR); } } } } catch (CannotLoadBeanClassException ex) { if (this.allowEagerInit) { throw ex; } } } } } | /**
* Performs the actual autodetection process, delegating to an
* {@code AutodetectCallback} instance to vote on the inclusion of a
* given bean.
* @param callback the {@code AutodetectCallback} to use when deciding
* whether to include a bean or not
*/ | Performs the actual autodetection process, delegating to an AutodetectCallback instance to vote on the inclusion of a given bean | autodetect | {
"repo_name": "shivpun/spring-framework",
"path": "spring-context/src/main/java/org/springframework/jmx/export/MBeanExporter.java",
"license": "apache-2.0",
"size": 44893
} | [
"java.util.Arrays",
"java.util.LinkedHashSet",
"java.util.Set",
"org.springframework.aop.scope.ScopedProxyUtils",
"org.springframework.beans.factory.CannotLoadBeanClassException",
"org.springframework.beans.factory.config.ConfigurableBeanFactory",
"org.springframework.util.CollectionUtils"
] | import java.util.Arrays; import java.util.LinkedHashSet; import java.util.Set; import org.springframework.aop.scope.ScopedProxyUtils; import org.springframework.beans.factory.CannotLoadBeanClassException; import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.util.CollectionUtils; | import java.util.*; import org.springframework.aop.scope.*; import org.springframework.beans.factory.*; import org.springframework.beans.factory.config.*; import org.springframework.util.*; | [
"java.util",
"org.springframework.aop",
"org.springframework.beans",
"org.springframework.util"
] | java.util; org.springframework.aop; org.springframework.beans; org.springframework.util; | 2,278,647 |
public static Calendar getSiguienteFinDeConsulta(Consulta consulta) {
Calendar resultado = null;
if (consulta != null) {
resultado = Calendar.getInstance();
while (resultado.get(Calendar.DAY_OF_WEEK) != getCalendarInt(consulta.getDiaSemana())) {
resultado.add(Calendar.DATE, 1);
}
Calendar horaFinConsulta = Calendar.getInstance();
horaFinConsulta.setTimeInMillis(consulta.getHoraFin().getTime());
resultado.set(Calendar.HOUR_OF_DAY, horaFinConsulta.get(Calendar.HOUR_OF_DAY));
resultado.set(Calendar.MINUTE, horaFinConsulta.get(Calendar.MINUTE));
}
return resultado;
} | static Calendar function(Consulta consulta) { Calendar resultado = null; if (consulta != null) { resultado = Calendar.getInstance(); while (resultado.get(Calendar.DAY_OF_WEEK) != getCalendarInt(consulta.getDiaSemana())) { resultado.add(Calendar.DATE, 1); } Calendar horaFinConsulta = Calendar.getInstance(); horaFinConsulta.setTimeInMillis(consulta.getHoraFin().getTime()); resultado.set(Calendar.HOUR_OF_DAY, horaFinConsulta.get(Calendar.HOUR_OF_DAY)); resultado.set(Calendar.MINUTE, horaFinConsulta.get(Calendar.MINUTE)); } return resultado; } | /**
* Dada una consulta devuelve un <i>java.util.Calendar</i> con el inicio (fecha y hora) de la siguiente consulta
* con respecto a la fecha actual del sistema.
*
* @param consulta De la que se quiere la información
* @return Fecha y hora del inicio de la siguiente consulta (fecha y hora).
*/ | Dada una consulta devuelve un java.util.Calendar con el inicio (fecha y hora) de la siguiente consulta con respecto a la fecha actual del sistema | getSiguienteFinDeConsulta | {
"repo_name": "ivangarciaalcaide/clifis",
"path": "src/es/upm/etsisi/clifis/gestores/GestorFechas.java",
"license": "gpl-3.0",
"size": 8718
} | [
"es.upm.etsisi.clifis.model.Consulta",
"java.util.Calendar"
] | import es.upm.etsisi.clifis.model.Consulta; import java.util.Calendar; | import es.upm.etsisi.clifis.model.*; import java.util.*; | [
"es.upm.etsisi",
"java.util"
] | es.upm.etsisi; java.util; | 654,129 |
public void addContribution(final BodiesElements elements,
final double[][] cnm, final double[][] snm) {
final double thetaF = cGamma * elements.getGamma() +
cL * elements.getL() + cLPrime * elements.getLPrime() + cF * elements.getF() +
cD * elements.getD() + cOmega * elements.getOmega();
final double cos = FastMath.cos(thetaF);
final double sin = FastMath.sin(thetaF);
for (int i = START_DEGREE; i <= degree; ++i) {
for (int j = 0; j <= FastMath.min(i, order); ++j) {
// from IERS conventions 2010, section 6.3, equation 6.15
cnm[i][j] += (cPlus[i][j] + cMinus[i][j]) * cos + (sPlus[i][j] + sMinus[i][j]) * sin;
snm[i][j] += (sPlus[i][j] - sMinus[i][j]) * cos - (cPlus[i][j] - cMinus[i][j]) * sin;
}
}
} | void function(final BodiesElements elements, final double[][] cnm, final double[][] snm) { final double thetaF = cGamma * elements.getGamma() + cL * elements.getL() + cLPrime * elements.getLPrime() + cF * elements.getF() + cD * elements.getD() + cOmega * elements.getOmega(); final double cos = FastMath.cos(thetaF); final double sin = FastMath.sin(thetaF); for (int i = START_DEGREE; i <= degree; ++i) { for (int j = 0; j <= FastMath.min(i, order); ++j) { cnm[i][j] += (cPlus[i][j] + cMinus[i][j]) * cos + (sPlus[i][j] + sMinus[i][j]) * sin; snm[i][j] += (sPlus[i][j] - sMinus[i][j]) * cos - (cPlus[i][j] - cMinus[i][j]) * sin; } } } | /** Add the contribution of the wave to Stokes coefficients.
* @param elements nutation elements
* @param cnm spherical harmonic cosine coefficients table to add contribution too
* @param snm spherical harmonic sine coefficients table to add contribution too
*/ | Add the contribution of the wave to Stokes coefficients | addContribution | {
"repo_name": "ProjectPersephone/Orekit",
"path": "src/main/java/org/orekit/forces/gravity/potential/OceanTidesWave.java",
"license": "apache-2.0",
"size": 6264
} | [
"org.apache.commons.math3.util.FastMath",
"org.orekit.data.BodiesElements"
] | import org.apache.commons.math3.util.FastMath; import org.orekit.data.BodiesElements; | import org.apache.commons.math3.util.*; import org.orekit.data.*; | [
"org.apache.commons",
"org.orekit.data"
] | org.apache.commons; org.orekit.data; | 2,265,223 |
public static Envelope createEnvelope( Position min, Position max, CoordinateSystem crs ) {
return new EnvelopeImpl( min, max, crs );
}
| static Envelope function( Position min, Position max, CoordinateSystem crs ) { return new EnvelopeImpl( min, max, crs ); } | /**
* creates a Envelope object out from two corner coordinates
*
* @param min
* lower point
* @param max
* upper point
* @param crs
* The coordinate system
* @return an Envelope with given parameters
*/ | creates a Envelope object out from two corner coordinates | createEnvelope | {
"repo_name": "lat-lon/deegree2-base",
"path": "deegree2-core/src/main/java/org/deegree/model/spatialschema/GeometryFactory.java",
"license": "lgpl-2.1",
"size": 46620
} | [
"org.deegree.model.crs.CoordinateSystem"
] | import org.deegree.model.crs.CoordinateSystem; | import org.deegree.model.crs.*; | [
"org.deegree.model"
] | org.deegree.model; | 1,089,266 |
public void setInput(InputStream stdin) {
this.stdin = stdin;
updateReadyStatus();
} | void function(InputStream stdin) { this.stdin = stdin; updateReadyStatus(); } | /**
* Sets standard input to be passed on to the invoked cgi script
*
* @param stdin InputStream to be used
*
*/ | Sets standard input to be passed on to the invoked cgi script | setInput | {
"repo_name": "devjin24/howtomcatworks",
"path": "bookrefer/jakarta-tomcat-4.1.12-src/catalina/src/share/org/apache/catalina/util/ProcessHelper.java",
"license": "apache-2.0",
"size": 19099
} | [
"java.io.InputStream"
] | import java.io.InputStream; | import java.io.*; | [
"java.io"
] | java.io; | 1,021,832 |
public ItemDataIfc getItemData() {
return itemData;
} | ItemDataIfc function() { return itemData; } | /**
* the item data itself
*
* @return
*/ | the item data itself | getItemData | {
"repo_name": "harfalm/Sakai-10.1",
"path": "samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/delivery/ItemContentsBean.java",
"license": "apache-2.0",
"size": 39376
} | [
"org.sakaiproject.tool.assessment.data.ifc.assessment.ItemDataIfc"
] | import org.sakaiproject.tool.assessment.data.ifc.assessment.ItemDataIfc; | import org.sakaiproject.tool.assessment.data.ifc.assessment.*; | [
"org.sakaiproject.tool"
] | org.sakaiproject.tool; | 843,945 |
public void engineDeleteEntry(String alias) throws KeyStoreException {
this.certificateMap.remove(alias);
} | void function(String alias) throws KeyStoreException { this.certificateMap.remove(alias); } | /**
* Deletes the entry identified by the given alias from this keystore.
*
* @param alias the alias name
* @throws java.security.KeyStoreException
* if the entry cannot be removed.
*/ | Deletes the entry identified by the given alias from this keystore | engineDeleteEntry | {
"repo_name": "turtlebender/crux-security-core",
"path": "ssl-proxy/src/test/java/org/globus/security/provider/MockKeyStore.java",
"license": "apache-2.0",
"size": 13825
} | [
"java.security.KeyStoreException"
] | import java.security.KeyStoreException; | import java.security.*; | [
"java.security"
] | java.security; | 74,528 |
public static Method findMethod(Class<?> clazz, String name) {
return findMethod(clazz, name, new Class<?>[0]);
} | static Method function(Class<?> clazz, String name) { return findMethod(clazz, name, new Class<?>[0]); } | /**
* Attempt to find a {@link Method} on the supplied class with the supplied name
* and no parameters. Searches all superclasses up to {@code Object}.
* <p>Returns {@code null} if no {@link Method} can be found.
* @param clazz the class to introspect
* @param name the name of the method
* @return the Method object, or {@code null} if none found
*/ | Attempt to find a <code>Method</code> on the supplied class with the supplied name and no parameters. Searches all superclasses up to Object. Returns null if no <code>Method</code> can be found | findMethod | {
"repo_name": "leogoing/spring_jeesite",
"path": "spring-core-4.0/org/springframework/util/ReflectionUtils.java",
"license": "apache-2.0",
"size": 26121
} | [
"java.lang.reflect.Method"
] | import java.lang.reflect.Method; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 2,657,719 |
public static Annotation[] readAnnotations(ValueExpression p_expression, UIComponent p_component) {
FacesContext context = FacesContext.getCurrentInstance();
ELContext elContext = context.getELContext();
try {
ValueReference valueReference = p_expression.getValueReference(elContext);
Object base;
if (null == valueReference) {
base = evaluteBaseForMojarra(elContext, p_expression);
} else {
base = valueReference.getBase();
}
if (null == base) {
return null;
}
Field declaredField = getField(base, p_expression.getExpressionString());
if (null != declaredField) {
return declaredField.getAnnotations();
}
Method getter = getGetter(base, p_expression.getExpressionString());
if (null != getter) {
return getter.getAnnotations();
}
} catch (PropertyNotFoundException ex) {
// this happens if a bean is null. That's a legal state, so suffice it to return no annotation.
}
return null;
} | static Annotation[] function(ValueExpression p_expression, UIComponent p_component) { FacesContext context = FacesContext.getCurrentInstance(); ELContext elContext = context.getELContext(); try { ValueReference valueReference = p_expression.getValueReference(elContext); Object base; if (null == valueReference) { base = evaluteBaseForMojarra(elContext, p_expression); } else { base = valueReference.getBase(); } if (null == base) { return null; } Field declaredField = getField(base, p_expression.getExpressionString()); if (null != declaredField) { return declaredField.getAnnotations(); } Method getter = getGetter(base, p_expression.getExpressionString()); if (null != getter) { return getter.getAnnotations(); } } catch (PropertyNotFoundException ex) { } return null; } | /**
* Which annotations are given to an object described by an EL expression?
*
* @param p_expression
* EL expression of the JSF bean attribute
* @return null if there are no annotations, or if they cannot be accessed
*/ | Which annotations are given to an object described by an EL expression | readAnnotations | {
"repo_name": "TheCoder4eu/BootsFaces-OSP",
"path": "src/main/java/net/bootsfaces/beans/ELTools.java",
"license": "apache-2.0",
"size": 14393
} | [
"java.lang.annotation.Annotation",
"java.lang.reflect.Field",
"java.lang.reflect.Method",
"javax.el.ELContext",
"javax.el.PropertyNotFoundException",
"javax.el.ValueExpression",
"javax.el.ValueReference",
"javax.faces.component.UIComponent",
"javax.faces.context.FacesContext"
] | import java.lang.annotation.Annotation; import java.lang.reflect.Field; import java.lang.reflect.Method; import javax.el.ELContext; import javax.el.PropertyNotFoundException; import javax.el.ValueExpression; import javax.el.ValueReference; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; | import java.lang.annotation.*; import java.lang.reflect.*; import javax.el.*; import javax.faces.component.*; import javax.faces.context.*; | [
"java.lang",
"javax.el",
"javax.faces"
] | java.lang; javax.el; javax.faces; | 1,388,052 |
interface RemovalListener<K, V> {
void onRemoval(RemovalNotification<K, V> notification);
}
static final class RemovalNotification<K, V> extends ImmutableEntry<K, V> {
private static final long serialVersionUID = 0;
private final RemovalCause cause;
RemovalNotification(@Nullable K key, @Nullable V value, RemovalCause cause) {
super(key, value);
this.cause = cause;
} | interface RemovalListener<K, V> { void onRemoval(RemovalNotification<K, V> notification); } static final class RemovalNotification<K, V> extends ImmutableEntry<K, V> { private static final long serialVersionUID = 0; private final RemovalCause cause; RemovalNotification(@Nullable K key, @Nullable V value, RemovalCause cause) { super(key, value); this.cause = cause; } | /**
* Notifies the listener that a removal occurred at some point in the past.
*/ | Notifies the listener that a removal occurred at some point in the past | onRemoval | {
"repo_name": "newrelic/guava-libraries",
"path": "guava/src/com/google/common/collect/MapMaker.java",
"license": "apache-2.0",
"size": 36696
} | [
"javax.annotation.Nullable"
] | import javax.annotation.Nullable; | import javax.annotation.*; | [
"javax.annotation"
] | javax.annotation; | 955,341 |
boolean addBridge(BridgeName bridgeName, String dpid, List<ControllerInfo> controllers); | boolean addBridge(BridgeName bridgeName, String dpid, List<ControllerInfo> controllers); | /**
* Adds a bridge with given bridge name and dpid, and sets the controller
* of the bridge with given controllers.
*
* @param bridgeName bridge name
* @param dpid dpid
* @param controllers list of controller
* @return true if succeeds, fail otherwise
*/ | Adds a bridge with given bridge name and dpid, and sets the controller of the bridge with given controllers | addBridge | {
"repo_name": "sonu283304/onos",
"path": "core/api/src/main/java/org/onosproject/net/behaviour/BridgeConfig.java",
"license": "apache-2.0",
"size": 3319
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,529,759 |
public static WidgetInfo createWidgetInfo(GetWidgetDiagnosticsResponse widgetDiagnostics) {
checkNotNull(widgetDiagnostics, "The widget diagnostics instance is null.");
WidgetInfoBuilder widgetInfo = new WidgetInfoBuilder();
if (widgetDiagnostics.getRuntimeType() == null) {
throw new FlutterProtocolException(
String.format(
"The widget diagnostics info must contain the runtime type of the widget. Illegal"
+ " widget diagnostics info: %s.",
widgetDiagnostics));
}
widgetInfo.setRuntimeType(widgetDiagnostics.getRuntimeType());
// Ugly, but let's figure out a better way as this evolves.
switch (WidgetRuntimeType.getType(widgetDiagnostics.getRuntimeType())) {
case TEXT:
// Flutter Text Widget's "data" field stores the text info.
if (widgetDiagnostics.getPropertyByName("data") != null) {
String text = widgetDiagnostics.getPropertyByName("data").getValue();
widgetInfo.setText(text);
}
break;
case RICH_TEXT:
if (widgetDiagnostics.getPropertyByName("text") != null) {
String richText = widgetDiagnostics.getPropertyByName("text").getValue();
widgetInfo.setText(richText);
}
break;
default:
// Let's be silent when we know little about the widget's type.
// The widget's fields will be mostly empty but it can be used for checking the existence
// of the widget.
Log.i(
TAG,
String.format(
"Unknown widget type: %s. Widget diagnostics info: %s.",
widgetDiagnostics.getRuntimeType(), widgetDiagnostics));
}
return widgetInfo.build();
} | static WidgetInfo function(GetWidgetDiagnosticsResponse widgetDiagnostics) { checkNotNull(widgetDiagnostics, STR); WidgetInfoBuilder widgetInfo = new WidgetInfoBuilder(); if (widgetDiagnostics.getRuntimeType() == null) { throw new FlutterProtocolException( String.format( STR + STR, widgetDiagnostics)); } widgetInfo.setRuntimeType(widgetDiagnostics.getRuntimeType()); switch (WidgetRuntimeType.getType(widgetDiagnostics.getRuntimeType())) { case TEXT: if (widgetDiagnostics.getPropertyByName("data") != null) { String text = widgetDiagnostics.getPropertyByName("data").getValue(); widgetInfo.setText(text); } break; case RICH_TEXT: if (widgetDiagnostics.getPropertyByName("text") != null) { String richText = widgetDiagnostics.getPropertyByName("text").getValue(); widgetInfo.setText(richText); } break; default: Log.i( TAG, String.format( STR, widgetDiagnostics.getRuntimeType(), widgetDiagnostics)); } return widgetInfo.build(); } | /**
* Creates a {@code WidgetInfo} instance based on the given diagnostics info.
*
* <p>The current implementation is ugly. As the widget's properties are serialized out as JSON
* strings, we have to inspect the content based on the widget type.
*
* @throws FlutterProtocolException when the given {@code widgetDiagnostics} is invalid.
*/ | Creates a WidgetInfo instance based on the given diagnostics info. The current implementation is ugly. As the widget's properties are serialized out as JSON strings, we have to inspect the content based on the widget type | createWidgetInfo | {
"repo_name": "mehmetf/plugins",
"path": "packages/espresso/android/src/main/java/androidx/test/espresso/flutter/internal/protocol/impl/WidgetInfoFactory.java",
"license": "bsd-3-clause",
"size": 3283
} | [
"android.util.Log",
"androidx.test.espresso.flutter.model.WidgetInfo",
"androidx.test.espresso.flutter.model.WidgetInfoBuilder",
"com.google.common.base.Preconditions"
] | import android.util.Log; import androidx.test.espresso.flutter.model.WidgetInfo; import androidx.test.espresso.flutter.model.WidgetInfoBuilder; import com.google.common.base.Preconditions; | import android.util.*; import androidx.test.espresso.flutter.model.*; import com.google.common.base.*; | [
"android.util",
"androidx.test",
"com.google.common"
] | android.util; androidx.test; com.google.common; | 356,388 |
protected void connectToLeader(InetSocketAddress addr)
throws IOException, ConnectException, InterruptedException {
sock = new Socket();
sock.setSoTimeout(self.tickTime * self.initLimit);
int initLimitTime = self.tickTime * self.initLimit;
int remainingInitLimitTime = initLimitTime;
long startNanoTime = nanoTime();
for (int tries = 0; tries < 5; tries++) {
try {
// recalculate the init limit time because retries sleep for 1000 milliseconds
remainingInitLimitTime = initLimitTime - (int)((nanoTime() - startNanoTime) / 1000000);
if (remainingInitLimitTime <= 0) {
LOG.error("initLimit exceeded on retries.");
throw new IOException("initLimit exceeded on retries.");
}
sockConnect(sock, addr, Math.min(self.tickTime * self.syncLimit, remainingInitLimitTime));
sock.setTcpNoDelay(nodelay);
break;
} catch (IOException e) {
remainingInitLimitTime = initLimitTime - (int)((nanoTime() - startNanoTime) / 1000000);
if (remainingInitLimitTime <= 1000) {
LOG.error("Unexpected exception, initLimit exceeded. tries=" + tries +
", remaining init limit=" + remainingInitLimitTime +
", connecting to " + addr,e);
throw e;
} else if (tries >= 4) {
LOG.error("Unexpected exception, retries exceeded. tries=" + tries +
", remaining init limit=" + remainingInitLimitTime +
", connecting to " + addr,e);
throw e;
} else {
LOG.warn("Unexpected exception, tries=" + tries +
", remaining init limit=" + remainingInitLimitTime +
", connecting to " + addr,e);
sock = new Socket();
sock.setSoTimeout(self.tickTime * self.initLimit);
}
}
Thread.sleep(1000);
}
leaderIs = BinaryInputArchive.getArchive(new BufferedInputStream(
sock.getInputStream()));
bufferedOutput = new BufferedOutputStream(sock.getOutputStream());
leaderOs = BinaryOutputArchive.getArchive(bufferedOutput);
} | void function(InetSocketAddress addr) throws IOException, ConnectException, InterruptedException { sock = new Socket(); sock.setSoTimeout(self.tickTime * self.initLimit); int initLimitTime = self.tickTime * self.initLimit; int remainingInitLimitTime = initLimitTime; long startNanoTime = nanoTime(); for (int tries = 0; tries < 5; tries++) { try { remainingInitLimitTime = initLimitTime - (int)((nanoTime() - startNanoTime) / 1000000); if (remainingInitLimitTime <= 0) { LOG.error(STR); throw new IOException(STR); } sockConnect(sock, addr, Math.min(self.tickTime * self.syncLimit, remainingInitLimitTime)); sock.setTcpNoDelay(nodelay); break; } catch (IOException e) { remainingInitLimitTime = initLimitTime - (int)((nanoTime() - startNanoTime) / 1000000); if (remainingInitLimitTime <= 1000) { LOG.error(STR + tries + STR + remainingInitLimitTime + STR + addr,e); throw e; } else if (tries >= 4) { LOG.error(STR + tries + STR + remainingInitLimitTime + STR + addr,e); throw e; } else { LOG.warn(STR + tries + STR + remainingInitLimitTime + STR + addr,e); sock = new Socket(); sock.setSoTimeout(self.tickTime * self.initLimit); } } Thread.sleep(1000); } leaderIs = BinaryInputArchive.getArchive(new BufferedInputStream( sock.getInputStream())); bufferedOutput = new BufferedOutputStream(sock.getOutputStream()); leaderOs = BinaryOutputArchive.getArchive(bufferedOutput); } | /**
* Establish a connection with the Leader found by findLeader. Retries
* until either initLimit time has elapsed or 5 tries have happened.
* @param addr - the address of the Leader to connect to.
* @throws IOException - if the socket connection fails on the 5th attempt
* @throws ConnectException
* @throws InterruptedException
*/ | Establish a connection with the Leader found by findLeader. Retries until either initLimit time has elapsed or 5 tries have happened | connectToLeader | {
"repo_name": "ervinyang/tutorial_zookeeper",
"path": "zookeeper-trunk/src/java/main/org/apache/zookeeper/server/quorum/Learner.java",
"license": "mit",
"size": 26522
} | [
"java.io.BufferedInputStream",
"java.io.BufferedOutputStream",
"java.io.IOException",
"java.net.ConnectException",
"java.net.InetSocketAddress",
"java.net.Socket",
"org.apache.jute.BinaryInputArchive",
"org.apache.jute.BinaryOutputArchive"
] | import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.IOException; import java.net.ConnectException; import java.net.InetSocketAddress; import java.net.Socket; import org.apache.jute.BinaryInputArchive; import org.apache.jute.BinaryOutputArchive; | import java.io.*; import java.net.*; import org.apache.jute.*; | [
"java.io",
"java.net",
"org.apache.jute"
] | java.io; java.net; org.apache.jute; | 858,642 |
private static float calculateAlignPosition(float x, ReportAlignType align, PdfTextStyle textConfig, float allowedWidth, String text) {
switch (align) {
case LEFT:
return x;
case RIGHT:
float w = getTextWidth(textConfig.getCurrentFontStyle(), textConfig.getFontSize(), text);
return x + allowedWidth - w;
case CENTER:
float halfW = getTextWidth(textConfig.getCurrentFontStyle(), textConfig.getFontSize(), text) / 2;
float absoluteCenter = allowedWidth / 2 + x;
return absoluteCenter - halfW;
default:
throw new IllegalArgumentException("Align type " + align + " not implemented for text");
}
} | static float function(float x, ReportAlignType align, PdfTextStyle textConfig, float allowedWidth, String text) { switch (align) { case LEFT: return x; case RIGHT: float w = getTextWidth(textConfig.getCurrentFontStyle(), textConfig.getFontSize(), text); return x + allowedWidth - w; case CENTER: float halfW = getTextWidth(textConfig.getCurrentFontStyle(), textConfig.getFontSize(), text) / 2; float absoluteCenter = allowedWidth / 2 + x; return absoluteCenter - halfW; default: throw new IllegalArgumentException(STR + align + STR); } } | /**
* Calculates the position where a string needs to be drawn in order to conform to the alignment
*
* @param x the desired position, will be corrected as necessary
* @return the corrected position
*/ | Calculates the position where a string needs to be drawn in order to conform to the alignment | calculateAlignPosition | {
"repo_name": "Catalysts/cat-boot",
"path": "cat-boot-report-pdf/src/main/java/cc/catalysts/boot/report/pdf/elements/PdfBoxHelper.java",
"license": "apache-2.0",
"size": 24079
} | [
"cc.catalysts.boot.report.pdf.config.PdfTextStyle",
"cc.catalysts.boot.report.pdf.utils.ReportAlignType"
] | import cc.catalysts.boot.report.pdf.config.PdfTextStyle; import cc.catalysts.boot.report.pdf.utils.ReportAlignType; | import cc.catalysts.boot.report.pdf.config.*; import cc.catalysts.boot.report.pdf.utils.*; | [
"cc.catalysts.boot"
] | cc.catalysts.boot; | 2,615,440 |
public void removeUncacheableAttributes(Map<String, Object> attributeMap) {
for (String uncacheableAttribute : uncacheableAttributes) {
attributeMap.remove(uncacheableAttribute);
}
attributeMap.remove(CmsFlexController.ATTRIBUTE_NAME);
attributeMap.remove(CmsDetailPageResourceHandler.ATTR_DETAIL_CONTENT_RESOURCE);
} | void function(Map<String, Object> attributeMap) { for (String uncacheableAttribute : uncacheableAttributes) { attributeMap.remove(uncacheableAttribute); } attributeMap.remove(CmsFlexController.ATTRIBUTE_NAME); attributeMap.remove(CmsDetailPageResourceHandler.ATTR_DETAIL_CONTENT_RESOURCE); } | /**
* Removes request attributes which shouldn't be cached in flex cache entries from a map.<p>
*
* @param attributeMap the map of attributes
*/ | Removes request attributes which shouldn't be cached in flex cache entries from a map | removeUncacheableAttributes | {
"repo_name": "ggiudetti/opencms-core",
"path": "src/org/opencms/flex/CmsFlexController.java",
"license": "lgpl-2.1",
"size": 25386
} | [
"java.util.Map",
"org.opencms.ade.detailpage.CmsDetailPageResourceHandler"
] | import java.util.Map; import org.opencms.ade.detailpage.CmsDetailPageResourceHandler; | import java.util.*; import org.opencms.ade.detailpage.*; | [
"java.util",
"org.opencms.ade"
] | java.util; org.opencms.ade; | 1,572,471 |
public static void createDirectoriesOnWorker(SubProcessConfiguration configuration)
throws IOException {
try {
Path path = Paths.get(configuration.getWorkerPath());
if (!path.toFile().exists()) {
Files.createDirectories(path);
LOG.info(String.format("Created Folder %s ", path.toFile()));
}
} catch (FileAlreadyExistsException ex) {
LOG.warn(
String.format(
" Tried to create folder %s which already existsed, this should not happen!",
configuration.getWorkerPath()),
ex);
}
} | static void function(SubProcessConfiguration configuration) throws IOException { try { Path path = Paths.get(configuration.getWorkerPath()); if (!path.toFile().exists()) { Files.createDirectories(path); LOG.info(String.format(STR, path.toFile())); } } catch (FileAlreadyExistsException ex) { LOG.warn( String.format( STR, configuration.getWorkerPath()), ex); } } | /**
* Create directories needed based on configuration.
*
* @param configuration
* @throws IOException
*/ | Create directories needed based on configuration | createDirectoriesOnWorker | {
"repo_name": "rangadi/beam",
"path": "examples/java/src/main/java/org/apache/beam/examples/subprocess/utils/FileUtils.java",
"license": "apache-2.0",
"size": 6057
} | [
"java.io.IOException",
"java.nio.file.FileAlreadyExistsException",
"java.nio.file.Files",
"java.nio.file.Path",
"java.nio.file.Paths",
"org.apache.beam.examples.subprocess.configuration.SubProcessConfiguration"
] | import java.io.IOException; import java.nio.file.FileAlreadyExistsException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import org.apache.beam.examples.subprocess.configuration.SubProcessConfiguration; | import java.io.*; import java.nio.file.*; import org.apache.beam.examples.subprocess.configuration.*; | [
"java.io",
"java.nio",
"org.apache.beam"
] | java.io; java.nio; org.apache.beam; | 787,891 |
private boolean checkFeedData(Feed feed) {
if (feed.getTitle() == null) {
Log.e(TAG, "Feed has no title.");
return false;
}
if (!hasValidFeedItems(feed)) {
Log.e(TAG, "Feed has invalid items");
return false;
}
return true;
} | boolean function(Feed feed) { if (feed.getTitle() == null) { Log.e(TAG, STR); return false; } if (!hasValidFeedItems(feed)) { Log.e(TAG, STR); return false; } return true; } | /**
* Checks if the feed was parsed correctly.
*/ | Checks if the feed was parsed correctly | checkFeedData | {
"repo_name": "samarone/AntennaPod",
"path": "core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java",
"license": "mit",
"size": 50372
} | [
"android.util.Log",
"de.danoeh.antennapod.core.feed.Feed"
] | import android.util.Log; import de.danoeh.antennapod.core.feed.Feed; | import android.util.*; import de.danoeh.antennapod.core.feed.*; | [
"android.util",
"de.danoeh.antennapod"
] | android.util; de.danoeh.antennapod; | 1,373,053 |
public Builder settlementDateOffset(DaysAdjustment settlementDateOffset) {
JodaBeanUtils.notNull(settlementDateOffset, "settlementDateOffset");
this.settlementDateOffset = settlementDateOffset;
return this;
} | Builder function(DaysAdjustment settlementDateOffset) { JodaBeanUtils.notNull(settlementDateOffset, STR); this.settlementDateOffset = settlementDateOffset; return this; } | /**
* Sets the number of days between valuation date and settlement date.
* <p>
* It is usually one business day for US and UK bills and two days for Euroland government bills.
* @param settlementDateOffset the new value, not null
* @return this, for chaining, not null
*/ | Sets the number of days between valuation date and settlement date. It is usually one business day for US and UK bills and two days for Euroland government bills | settlementDateOffset | {
"repo_name": "OpenGamma/Strata",
"path": "modules/product/src/main/java/com/opengamma/strata/product/bond/ResolvedBill.java",
"license": "apache-2.0",
"size": 22213
} | [
"com.opengamma.strata.basics.date.DaysAdjustment",
"org.joda.beans.JodaBeanUtils"
] | import com.opengamma.strata.basics.date.DaysAdjustment; import org.joda.beans.JodaBeanUtils; | import com.opengamma.strata.basics.date.*; import org.joda.beans.*; | [
"com.opengamma.strata",
"org.joda.beans"
] | com.opengamma.strata; org.joda.beans; | 375,388 |
@Override
public Number getVolume(int series, int item) {
DatasetInfo di = getDatasetInfo(series);
return ((OHLCDataset) di.data).getVolume(di.series, item);
}
| Number function(int series, int item) { DatasetInfo di = getDatasetInfo(series); return ((OHLCDataset) di.data).getVolume(di.series, item); } | /**
* Returns the volume value for the specified series and item.
* <P>
* Note: throws <code>ClassCastException</code> if the series is not from a
* {@link OHLCDataset}.
*
* @param series the index of the series of interest (zero-based).
* @param item the index of the item of interest (zero-based).
*
* @return The volume value for the specified series and item.
*/ | Returns the volume value for the specified series and item. Note: throws <code>ClassCastException</code> if the series is not from a <code>OHLCDataset</code> | getVolume | {
"repo_name": "sebkur/JFreeChart",
"path": "src/main/java/org/jfree/data/general/CombinedDataset.java",
"license": "lgpl-3.0",
"size": 21590
} | [
"org.jfree.data.xy.OHLCDataset"
] | import org.jfree.data.xy.OHLCDataset; | import org.jfree.data.xy.*; | [
"org.jfree.data"
] | org.jfree.data; | 517,907 |
public Family getFamily() {
return bFam;
} | Family function() { return bFam; } | /**
* Returns the Family
* @return the Family
*/ | Returns the Family | getFamily | {
"repo_name": "pjain1/sketches-core",
"path": "sketches/src/main/java/com/yahoo/sketches/theta/UpdateSketchBuilder.java",
"license": "apache-2.0",
"size": 7392
} | [
"com.yahoo.sketches.Family"
] | import com.yahoo.sketches.Family; | import com.yahoo.sketches.*; | [
"com.yahoo.sketches"
] | com.yahoo.sketches; | 2,589,406 |
return InternshipRegulateRecord.class;
}
public final TableField<InternshipRegulateRecord, String> INTERNSHIP_REGULATE_ID = createField("internship_regulate_id", org.jooq.impl.SQLDataType.VARCHAR(64).nullable(false), this, "");
public final TableField<InternshipRegulateRecord, String> STUDENT_NAME = createField("student_name", org.jooq.impl.SQLDataType.VARCHAR(30).nullable(false), this, "");
public final TableField<InternshipRegulateRecord, String> STUDENT_NUMBER = createField("student_number", org.jooq.impl.SQLDataType.VARCHAR(20).nullable(false), this, "");
public final TableField<InternshipRegulateRecord, String> STUDENT_TEL = createField("student_tel", org.jooq.impl.SQLDataType.VARCHAR(15).nullable(false), this, "");
public final TableField<InternshipRegulateRecord, String> INTERNSHIP_CONTENT = createField("internship_content", org.jooq.impl.SQLDataType.VARCHAR(200).nullable(false), this, "");
public final TableField<InternshipRegulateRecord, String> INTERNSHIP_PROGRESS = createField("internship_progress", org.jooq.impl.SQLDataType.VARCHAR(200).nullable(false), this, "");
public final TableField<InternshipRegulateRecord, String> REPORT_WAY = createField("report_way", org.jooq.impl.SQLDataType.VARCHAR(20).nullable(false), this, "");
public final TableField<InternshipRegulateRecord, Date> REPORT_DATE = createField("report_date", org.jooq.impl.SQLDataType.DATE.nullable(false), this, "");
public final TableField<InternshipRegulateRecord, String> SCHOOL_GUIDANCE_TEACHER = createField("school_guidance_teacher", org.jooq.impl.SQLDataType.VARCHAR(30).nullable(false), this, "");
public final TableField<InternshipRegulateRecord, String> TLIY = createField("tliy", org.jooq.impl.SQLDataType.VARCHAR(200), this, "");
public final TableField<InternshipRegulateRecord, Timestamp> CREATE_DATE = createField("create_date", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, "");
public final TableField<InternshipRegulateRecord, Integer> STUDENT_ID = createField("student_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
public final TableField<InternshipRegulateRecord, String> INTERNSHIP_RELEASE_ID = createField("internship_release_id", org.jooq.impl.SQLDataType.VARCHAR(64).nullable(false), this, "");
public final TableField<InternshipRegulateRecord, Integer> STAFF_ID = createField("staff_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
public InternshipRegulate() {
this(DSL.name("internship_regulate"), null);
}
public InternshipRegulate(String alias) {
this(DSL.name(alias), INTERNSHIP_REGULATE);
}
public InternshipRegulate(Name alias) {
this(alias, INTERNSHIP_REGULATE);
}
private InternshipRegulate(Name alias, Table<InternshipRegulateRecord> aliased) {
this(alias, aliased, null);
}
private InternshipRegulate(Name alias, Table<InternshipRegulateRecord> aliased, Field<?>[] parameters) {
super(alias, null, aliased, parameters, "");
}
/**
* {@inheritDoc} | return InternshipRegulateRecord.class; } public final TableField<InternshipRegulateRecord, String> INTERNSHIP_REGULATE_ID = createField(STR, org.jooq.impl.SQLDataType.VARCHAR(64).nullable(false), this, STRstudent_nameSTRSTRstudent_numberSTRSTRstudent_telSTRSTRinternship_contentSTRSTRinternship_progressSTRSTRreport_waySTRSTRreport_dateSTRSTRschool_guidance_teacherSTRSTRtliySTRSTRcreate_dateSTRSTRstudent_idSTRSTRinternship_release_idSTRSTRstaff_idSTRSTRinternship_regulateSTR"); } /** * {@inheritDoc} | /**
* The class holding records for this type
*/ | The class holding records for this type | getRecordType | {
"repo_name": "zbeboy/ISY",
"path": "src/main/java/top/zbeboy/isy/domain/tables/InternshipRegulate.java",
"license": "mit",
"size": 7702
} | [
"org.jooq.TableField",
"top.zbeboy.isy.domain.tables.records.InternshipRegulateRecord"
] | import org.jooq.TableField; import top.zbeboy.isy.domain.tables.records.InternshipRegulateRecord; | import org.jooq.*; import top.zbeboy.isy.domain.tables.records.*; | [
"org.jooq",
"top.zbeboy.isy"
] | org.jooq; top.zbeboy.isy; | 2,326,969 |
public void finish() {
if (m_writeHtml) {
m_printStream.println(CmsReport.generatePageEndExtended());
}
close();
}
| void function() { if (m_writeHtml) { m_printStream.println(CmsReport.generatePageEndExtended()); } close(); } | /**
* Finishes the report, closing the stream.<p>
*/ | Finishes the report, closing the stream | finish | {
"repo_name": "comundus/opencms-comundus",
"path": "src/main/java/org/opencms/report/CmsPrintStreamReport.java",
"license": "lgpl-2.1",
"size": 6064
} | [
"org.opencms.workplace.CmsReport"
] | import org.opencms.workplace.CmsReport; | import org.opencms.workplace.*; | [
"org.opencms.workplace"
] | org.opencms.workplace; | 1,039,898 |
public void setModifiedTotal(@Nullable String modifiedTotal) {
updatePromoMessage(modifiedTotal);
} | void function(@Nullable String modifiedTotal) { updatePromoMessage(modifiedTotal); } | /**
* Sets the modified total for this payment app.
*
* @param modifiedTotal The new modified total to use.
*/ | Sets the modified total for this payment app | setModifiedTotal | {
"repo_name": "scheib/chromium",
"path": "components/payments/content/android/java/src/org/chromium/components/payments/PaymentApp.java",
"license": "bsd-3-clause",
"size": 12573
} | [
"androidx.annotation.Nullable"
] | import androidx.annotation.Nullable; | import androidx.annotation.*; | [
"androidx.annotation"
] | androidx.annotation; | 201,070 |
public void captureNextImage(final ImageCaptureListener onImageCaptured,
final List<CapturedImageConstraint> constraints) {
mPendingImageCaptureCallback = onImageCaptured;
mPendingImageCaptureConstraints = constraints;
} | void function(final ImageCaptureListener onImageCaptured, final List<CapturedImageConstraint> constraints) { mPendingImageCaptureCallback = onImageCaptured; mPendingImageCaptureConstraints = constraints; } | /**
* Sets the pending image capture request, overriding any previous calls to
* {@link #captureNextImage} which have not yet been resolved. When the next
* available image which satisfies the given constraints can be captured,
* onImageCaptured will be invoked.
*
* @param onImageCaptured the callback which will be invoked with the
* captured image.
* @param constraints the set of constraints which must be satisfied in
* order for the image to be captured.
*/ | Sets the pending image capture request, overriding any previous calls to <code>#captureNextImage</code> which have not yet been resolved. When the next available image which satisfies the given constraints can be captured, onImageCaptured will be invoked | captureNextImage | {
"repo_name": "s20121035/rk3288_android5.1_repo",
"path": "packages/apps/Camera2/src/com/android/camera/one/v2/ImageCaptureManager.java",
"license": "gpl-3.0",
"size": 27737
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,022,693 |
public CheckpointSignature rollEditLog() throws IOException; | CheckpointSignature function() throws IOException; | /**
* Closes the current edit log and opens a new one. The
* call fails if the file system is in SafeMode.
* @throws IOException
* @return a unique token to identify this transaction.
*/ | Closes the current edit log and opens a new one. The call fails if the file system is in SafeMode | rollEditLog | {
"repo_name": "hanhlh/hadoop-0.20.2_FatBTree",
"path": "src/hdfs/org/apache/hadoop/hdfs/server/protocol/NamenodeProtocol.java",
"license": "apache-2.0",
"size": 2759
} | [
"java.io.IOException",
"org.apache.hadoop.hdfs.server.namenode.CheckpointSignature"
] | import java.io.IOException; import org.apache.hadoop.hdfs.server.namenode.CheckpointSignature; | import java.io.*; import org.apache.hadoop.hdfs.server.namenode.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 2,527,928 |
IndicesSegmentsRequestBuilder prepareSegments(String... indices); | IndicesSegmentsRequestBuilder prepareSegments(String... indices); | /**
* The segments of one or more indices.
*/ | The segments of one or more indices | prepareSegments | {
"repo_name": "gfyoung/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/client/IndicesAdminClient.java",
"license": "apache-2.0",
"size": 31239
} | [
"org.elasticsearch.action.admin.indices.segments.IndicesSegmentsRequestBuilder"
] | import org.elasticsearch.action.admin.indices.segments.IndicesSegmentsRequestBuilder; | import org.elasticsearch.action.admin.indices.segments.*; | [
"org.elasticsearch.action"
] | org.elasticsearch.action; | 1,582,351 |
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setHeader("Expires","-1");
response.setHeader("Pragma","no-cache");
response.setHeader("Cache-control","no-cache");
response.setHeader("Content-Type", "text/html; charset=utf-8");
PrintWriter out = response.getWriter();
String sId = request.getParameter("id");
// String charset = Constants.charset;
// String content = new String(request.getParameter("content").getBytes(charset), "utf-8");
String content = request.getParameter("content");
if (sId != null) {
try {
Note note = NotesController.getNoteById(getAuthProfile(request), new Long(sId));
if (note != null) {
note.setNoteContent(content);
note.setNoteDate(new Timestamp(new Date().getTime()));
NotesController.saveNote(getAuthProfile(request), note);
}
out.print("ok");
} catch (Exception e) {
out.print("fail");
}
} else {
out.print("fail");
}
} | void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setHeader(STR,"-1"); response.setHeader(STR,STR); response.setHeader(STR,STR); response.setHeader(STR, STR); PrintWriter out = response.getWriter(); String sId = request.getParameter("id"); String content = request.getParameter(STR); if (sId != null) { try { Note note = NotesController.getNoteById(getAuthProfile(request), new Long(sId)); if (note != null) { note.setNoteContent(content); note.setNoteDate(new Timestamp(new Date().getTime())); NotesController.saveNote(getAuthProfile(request), note); } out.print("ok"); } catch (Exception e) { out.print("fail"); } } else { out.print("fail"); } } | /**
* The doPost method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to post.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/ | The doPost method of the servlet. This method is called when a form has its tag value method equals to post | doPost | {
"repo_name": "atealxt/crm",
"path": "intouch2/src/intouch2-src/org/claros/intouch/notes/services/SaveNoteService.java",
"license": "gpl-2.0",
"size": 1963
} | [
"java.io.IOException",
"java.io.PrintWriter",
"java.sql.Timestamp",
"java.util.Date",
"javax.servlet.ServletException",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse",
"org.claros.intouch.notes.controllers.NotesController",
"org.claros.intouch.notes.models.Note"
] | import java.io.IOException; import java.io.PrintWriter; import java.sql.Timestamp; import java.util.Date; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.claros.intouch.notes.controllers.NotesController; import org.claros.intouch.notes.models.Note; | import java.io.*; import java.sql.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import org.claros.intouch.notes.controllers.*; import org.claros.intouch.notes.models.*; | [
"java.io",
"java.sql",
"java.util",
"javax.servlet",
"org.claros.intouch"
] | java.io; java.sql; java.util; javax.servlet; org.claros.intouch; | 2,078,216 |
protected void sendDelete(GitblitReceivePack receivePack, ReceiveCommand cmd, RefType rType) throws IOException {
UserModel user = receivePack.getUserModel();
RepositoryModel repo = receivePack.getRepositoryModel();
String shortRef = Repository.shortenRefName(cmd.getRefName());
String repoUrl = getUrl(repo.name, null, null);
boolean postAsUser = receivePack.getGitblit().getSettings().getBoolean(Plugin.SETTING_POST_AS_USER, true);
String author;
if (postAsUser) {
// posting as user, do not BOLD username
author = user.getDisplayName();
} else {
// posting as Gitblit, BOLD username to draw attention
author = "*" + user.getDisplayName() + "*";
}
String msg = String.format("%s has deleted %s *%s* from <%s|%s>", author,
rType.name().toLowerCase(), shortRef, repoUrl, StringUtils.stripDotGit(repo.name));
Payload payload = Payload.instance(msg);
attribute(payload, user);
slacker.setChannel(repo, payload);
slacker.sendAsync(payload);
} | void function(GitblitReceivePack receivePack, ReceiveCommand cmd, RefType rType) throws IOException { UserModel user = receivePack.getUserModel(); RepositoryModel repo = receivePack.getRepositoryModel(); String shortRef = Repository.shortenRefName(cmd.getRefName()); String repoUrl = getUrl(repo.name, null, null); boolean postAsUser = receivePack.getGitblit().getSettings().getBoolean(Plugin.SETTING_POST_AS_USER, true); String author; if (postAsUser) { author = user.getDisplayName(); } else { author = "*" + user.getDisplayName() + "*"; } String msg = String.format(STR, author, rType.name().toLowerCase(), shortRef, repoUrl, StringUtils.stripDotGit(repo.name)); Payload payload = Payload.instance(msg); attribute(payload, user); slacker.setChannel(repo, payload); slacker.sendAsync(payload); } | /**
* Sends a Slack message when a branch or a tag is deleted.
*
* @param receivePack
* @param cmd
* @param rType
*/ | Sends a Slack message when a branch or a tag is deleted | sendDelete | {
"repo_name": "gitblit/gitblit-slack-plugin",
"path": "src/main/java/com/gitblit/plugin/slack/SlackReceiveHook.java",
"license": "apache-2.0",
"size": 12304
} | [
"com.gitblit.git.GitblitReceivePack",
"com.gitblit.models.RepositoryModel",
"com.gitblit.models.UserModel",
"com.gitblit.plugin.slack.entity.Payload",
"com.gitblit.utils.StringUtils",
"java.io.IOException",
"org.eclipse.jgit.lib.Repository",
"org.eclipse.jgit.transport.ReceiveCommand"
] | import com.gitblit.git.GitblitReceivePack; import com.gitblit.models.RepositoryModel; import com.gitblit.models.UserModel; import com.gitblit.plugin.slack.entity.Payload; import com.gitblit.utils.StringUtils; import java.io.IOException; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.transport.ReceiveCommand; | import com.gitblit.git.*; import com.gitblit.models.*; import com.gitblit.plugin.slack.entity.*; import com.gitblit.utils.*; import java.io.*; import org.eclipse.jgit.lib.*; import org.eclipse.jgit.transport.*; | [
"com.gitblit.git",
"com.gitblit.models",
"com.gitblit.plugin",
"com.gitblit.utils",
"java.io",
"org.eclipse.jgit"
] | com.gitblit.git; com.gitblit.models; com.gitblit.plugin; com.gitblit.utils; java.io; org.eclipse.jgit; | 498,901 |
public void handleResult(Object result)
{
if (viewer.getState() == ImViewer.DISCARDED) return; //Async cancel.
viewer.setProjectedRenderingSettings((Boolean) result, image);
} | void function(Object result) { if (viewer.getState() == ImViewer.DISCARDED) return; viewer.setProjectedRenderingSettings((Boolean) result, image); } | /**
* Feeds the result back to the viewer.
* @see DataLoader#handleResult(Object)
*/ | Feeds the result back to the viewer | handleResult | {
"repo_name": "jballanc/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/agents/imviewer/RenderingSettingsCreator.java",
"license": "gpl-2.0",
"size": 3923
} | [
"org.openmicroscopy.shoola.agents.imviewer.view.ImViewer"
] | import org.openmicroscopy.shoola.agents.imviewer.view.ImViewer; | import org.openmicroscopy.shoola.agents.imviewer.view.*; | [
"org.openmicroscopy.shoola"
] | org.openmicroscopy.shoola; | 598,398 |
protected FormFieldValueEntity getFormFieldValue(FieldTemplate fieldTemplate, DataRecord data,
String lang) throws Exception {
// Field data
Field field = data.getField(fieldTemplate.getFieldName());
final FormFieldValueEntity entity;
if (Field.TYPE_FILE.equals(field.getTypeName())) {
// File Field case
String fieldValue = field.getValue(lang);
String attachmentId = null;
String attachmentUrl = null;
URI attachmentUri = null;
if (StringUtil.isDefined(fieldValue)) {
String serverApplicationURL =
URLUtil.getServerURL(getHttpServletRequest()) + URLUtil.getApplicationURL();
if (fieldValue.startsWith("/")) {
// case of an image provided by a gallery
attachmentUrl = fieldValue;
fieldValue = null;
} else {
SimpleDocument attachment = AttachmentServiceProvider.getAttachmentService()
.searchDocumentById(new SimpleDocumentPK(fieldValue, getComponentId()), lang);
if (attachment != null) {
attachmentId = fieldValue;
fieldValue = attachment.getTitle();
attachmentUrl = serverApplicationURL + attachment.getAttachmentURL();
attachmentUri = new URI(URLUtil.getServerURL(getHttpServletRequest()) +
URLUtil.getSimpleURL(URLUtil.URL_FILE, attachmentId));
}
}
}
if (fieldValue == null) {
fieldValue = "";
}
entity = FormFieldValueEntity.createFrom(attachmentId, fieldValue).withLink(attachmentUrl)
.withAttachmentURI(attachmentUri);
} else if (UserField.TYPE.equals(field.getTypeName())) {
// User field case
UserField userField = (UserField) field;
entity = FormFieldValueEntity.createFrom(userField.getUserId(), userField.getValue());
} else {
// Text field case
String fieldValue = field.getValue(lang);
if (StringUtil.isDefined(fieldValue)) {
if (fieldValue.startsWith(WysiwygFCKFieldDisplayer.dbKey)) {
// Rich text
entity = FormFieldValueEntity.createFrom(null, WysiwygFCKFieldDisplayer
.getContentFromFile(getComponentId(), getContributionId(),
fieldTemplate.getFieldName(), lang));
} else {
// Simple text
Map<String, String> keyValuePairs =
((GenericFieldTemplate) fieldTemplate).getKeyValuePairs(lang);
// Field value entity
if (keyValuePairs.isEmpty()) {
// Simple value
entity = FormFieldValueEntity.createFrom(null, fieldValue);
} else {
// Value like checkbox for example.
// Value is empty if "##" string is detected.
entity = FormFieldValueEntity
.createFrom((!fieldValue.contains("##") ? fieldValue : null),
keyValuePairs.get(fieldValue));
}
}
} else {
// No value
entity = FormFieldValueEntity.createFrom(null, "");
}
}
return entity;
} | FormFieldValueEntity function(FieldTemplate fieldTemplate, DataRecord data, String lang) throws Exception { Field field = data.getField(fieldTemplate.getFieldName()); final FormFieldValueEntity entity; if (Field.TYPE_FILE.equals(field.getTypeName())) { String fieldValue = field.getValue(lang); String attachmentId = null; String attachmentUrl = null; URI attachmentUri = null; if (StringUtil.isDefined(fieldValue)) { String serverApplicationURL = URLUtil.getServerURL(getHttpServletRequest()) + URLUtil.getApplicationURL(); if (fieldValue.startsWith("/")) { attachmentUrl = fieldValue; fieldValue = null; } else { SimpleDocument attachment = AttachmentServiceProvider.getAttachmentService() .searchDocumentById(new SimpleDocumentPK(fieldValue, getComponentId()), lang); if (attachment != null) { attachmentId = fieldValue; fieldValue = attachment.getTitle(); attachmentUrl = serverApplicationURL + attachment.getAttachmentURL(); attachmentUri = new URI(URLUtil.getServerURL(getHttpServletRequest()) + URLUtil.getSimpleURL(URLUtil.URL_FILE, attachmentId)); } } } if (fieldValue == null) { fieldValue = STR##STR"); } } return entity; } | /**
* Gets the value of a field.
* @param fieldTemplate
* @param data
* @param lang
* @return
* @throws Exception
*/ | Gets the value of a field | getFormFieldValue | {
"repo_name": "ebonnet/Silverpeas-Core",
"path": "core-web/src/main/java/org/silverpeas/core/webapi/contribution/AbstractContributionResource.java",
"license": "agpl-3.0",
"size": 7089
} | [
"org.silverpeas.core.contribution.attachment.AttachmentServiceProvider",
"org.silverpeas.core.contribution.attachment.model.SimpleDocument",
"org.silverpeas.core.contribution.attachment.model.SimpleDocumentPK",
"org.silverpeas.core.contribution.content.form.DataRecord",
"org.silverpeas.core.contribution.content.form.Field",
"org.silverpeas.core.contribution.content.form.FieldTemplate",
"org.silverpeas.core.util.StringUtil",
"org.silverpeas.core.util.URLUtil"
] | import org.silverpeas.core.contribution.attachment.AttachmentServiceProvider; import org.silverpeas.core.contribution.attachment.model.SimpleDocument; import org.silverpeas.core.contribution.attachment.model.SimpleDocumentPK; import org.silverpeas.core.contribution.content.form.DataRecord; import org.silverpeas.core.contribution.content.form.Field; import org.silverpeas.core.contribution.content.form.FieldTemplate; import org.silverpeas.core.util.StringUtil; import org.silverpeas.core.util.URLUtil; | import org.silverpeas.core.contribution.attachment.*; import org.silverpeas.core.contribution.attachment.model.*; import org.silverpeas.core.contribution.content.form.*; import org.silverpeas.core.util.*; | [
"org.silverpeas.core"
] | org.silverpeas.core; | 561,717 |
private void createListener(final SibRaMessagingEngineConnection connection)
throws ResourceException
{
final String methodName = "createListener";
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled())
{
SibTr.entry(this, TRACE, methodName, connection);
}
if (_endpointConfiguration.getUseDestinationWildcard())
{
createMultipleListeners(connection);
}
else
{
createSingleListener(connection);
}
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.exit(this, TRACE, methodName);
}
} | void function(final SibRaMessagingEngineConnection connection) throws ResourceException { final String methodName = STR; if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, methodName, connection); } if (_endpointConfiguration.getUseDestinationWildcard()) { createMultipleListeners(connection); } else { createSingleListener(connection); } if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.exit(this, TRACE, methodName); } } | /**
* Creates a listener to the configured destination using the given connection.
*
* @param connection
* the connection to the messaging engine
* @throws ResourceException
* if the creation of the listener fails
*/ | Creates a listener to the configured destination using the given connection | createListener | {
"repo_name": "kgibm/open-liberty",
"path": "dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/ra/inbound/impl/SibRaCommonEndpointActivation.java",
"license": "epl-1.0",
"size": 77678
} | [
"com.ibm.websphere.ras.TraceComponent",
"com.ibm.ws.sib.utils.ras.SibTr",
"javax.resource.ResourceException"
] | import com.ibm.websphere.ras.TraceComponent; import com.ibm.ws.sib.utils.ras.SibTr; import javax.resource.ResourceException; | import com.ibm.websphere.ras.*; import com.ibm.ws.sib.utils.ras.*; import javax.resource.*; | [
"com.ibm.websphere",
"com.ibm.ws",
"javax.resource"
] | com.ibm.websphere; com.ibm.ws; javax.resource; | 400,462 |
@Test
public void testCallHipaaSpace_Checked_status_is_OK_and_Content_Type_is_Correct() throws Exception {
when(hippaSpaceCodedConceptLookupService.searchCodes(anyString(), anyString(), anyString())).thenReturn("artifitial JSON");
mockMvc.perform(get("/consents/callHippaSpace.html").param("domain", "icd9").param("q", "hiv").param("rt", "json"))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON));
}
| void function() throws Exception { when(hippaSpaceCodedConceptLookupService.searchCodes(anyString(), anyString(), anyString())).thenReturn(STR); mockMvc.perform(get(STR).param(STR, "icd9").param("q", "hiv").param("rt", "json")) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)); } | /**
* Test callHipaaSpace. Checked status is OK and content type is correct.
*
* @throws Exception the exception
*/ | Test callHipaaSpace. Checked status is OK and content type is correct | testCallHipaaSpace_Checked_status_is_OK_and_Content_Type_is_Correct | {
"repo_name": "tlin-fei/ds4p",
"path": "DS4P/consent2share/web/src/test/java/gov/samhsa/consent2share/web/ConsentControllerTest.java",
"license": "bsd-3-clause",
"size": 19236
} | [
"org.mockito.Matchers",
"org.mockito.Mockito",
"org.springframework.http.MediaType"
] | import org.mockito.Matchers; import org.mockito.Mockito; import org.springframework.http.MediaType; | import org.mockito.*; import org.springframework.http.*; | [
"org.mockito",
"org.springframework.http"
] | org.mockito; org.springframework.http; | 711,938 |
public Factory<CacheStoreSessionListener>[] getCacheStoreSessionListenerFactories() {
return storeSesLsnrs;
}
/**
* Cache store session listener factories.
* <p>
* These are global store session listeners, so they are applied to
* all caches. If you need to override listeners for a
* particular cache, use {@link CacheConfiguration#setCacheStoreSessionListenerFactories(Factory[])} | Factory<CacheStoreSessionListener>[] function() { return storeSesLsnrs; } /** * Cache store session listener factories. * <p> * These are global store session listeners, so they are applied to * all caches. If you need to override listeners for a * particular cache, use {@link CacheConfiguration#setCacheStoreSessionListenerFactories(Factory[])} | /**
* Gets cache store session listener factories.
*
* @return Cache store session listener factories.
* @see CacheStoreSessionListener
*/ | Gets cache store session listener factories | getCacheStoreSessionListenerFactories | {
"repo_name": "apacheignite/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java",
"license": "apache-2.0",
"size": 83343
} | [
"javax.cache.configuration.Factory",
"org.apache.ignite.cache.store.CacheStoreSessionListener"
] | import javax.cache.configuration.Factory; import org.apache.ignite.cache.store.CacheStoreSessionListener; | import javax.cache.configuration.*; import org.apache.ignite.cache.store.*; | [
"javax.cache",
"org.apache.ignite"
] | javax.cache; org.apache.ignite; | 2,722,680 |
M p = M.m().a("name", type).a("caption", AstUtil.captionOf(type));
IJavaElement e = type.getJavaElement();
IPath root = ResourcesPlugin.getWorkspace().getRoot().getLocation();
if (e != null && root != null) {
IPath path = e.getResource() != null ? e.getResource().getLocation()
.makeRelativeTo(root) : e.getPath();
p.a("file", path.toString());
}
if (type.isInterface()) {
p.a("extends", type.getInterfaces());
accessor.execute(CREATEINTERFACE, p);
} else {
p.a("implements", type.getInterfaces()).a("extends", type.getSuperclass());
accessor.execute(CREATECLASS, p);
}
if (!filepath.isEmpty()) {
p.a("file", filepath).a("lineNumber", lineNumber);
accessor.execute(ADDTYPEFILE, p);
}
} | M p = M.m().a("name", type).a(STR, AstUtil.captionOf(type)); IJavaElement e = type.getJavaElement(); IPath root = ResourcesPlugin.getWorkspace().getRoot().getLocation(); if (e != null && root != null) { IPath path = e.getResource() != null ? e.getResource().getLocation() .makeRelativeTo(root) : e.getPath(); p.a("file", path.toString()); } if (type.isInterface()) { p.a(STR, type.getInterfaces()); accessor.execute(CREATEINTERFACE, p); } else { p.a(STR, type.getInterfaces()).a(STR, type.getSuperclass()); accessor.execute(CREATECLASS, p); } if (!filepath.isEmpty()) { p.a("file", filepath).a(STR, lineNumber); accessor.execute(ADDTYPEFILE, p); } } | /**
* Method createType.
*
* @author manbaum
* @since Oct 10, 2014
* @param type
*/ | Method createType | createType | {
"repo_name": "manbaum/dnw-depmap",
"path": "src/main/java/com/dnw/depmap/neo/NeoWriter.java",
"license": "epl-1.0",
"size": 12398
} | [
"com.dnw.json.M",
"com.dnw.plugin.ast.AstUtil",
"org.eclipse.core.resources.ResourcesPlugin",
"org.eclipse.core.runtime.IPath",
"org.eclipse.jdt.core.IJavaElement"
] | import com.dnw.json.M; import com.dnw.plugin.ast.AstUtil; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.IPath; import org.eclipse.jdt.core.IJavaElement; | import com.dnw.json.*; import com.dnw.plugin.ast.*; import org.eclipse.core.resources.*; import org.eclipse.core.runtime.*; import org.eclipse.jdt.core.*; | [
"com.dnw.json",
"com.dnw.plugin",
"org.eclipse.core",
"org.eclipse.jdt"
] | com.dnw.json; com.dnw.plugin; org.eclipse.core; org.eclipse.jdt; | 2,099,915 |
public void addAgente(IAgente agente) {
if (listaAgentes == null) {
listaAgentes = new ArrayList<>();
}
listaAgentes.add(agente);
}
| void function(IAgente agente) { if (listaAgentes == null) { listaAgentes = new ArrayList<>(); } listaAgentes.add(agente); } | /**
* Adiciona um agente a lista de agentes
*
* @param agente
*/ | Adiciona um agente a lista de agentes | addAgente | {
"repo_name": "douglasbreda/SimuladorExperimentos",
"path": "src/br/simulador/gerenciadores/GerenciadorExecucao.java",
"license": "lgpl-3.0",
"size": 17741
} | [
"br.simulador.plugin.biblioteca.base.IAgente",
"java.util.ArrayList"
] | import br.simulador.plugin.biblioteca.base.IAgente; import java.util.ArrayList; | import br.simulador.plugin.biblioteca.base.*; import java.util.*; | [
"br.simulador.plugin",
"java.util"
] | br.simulador.plugin; java.util; | 19,251 |
public static <R extends Number> ITuple4<R> rotateY(
final ITuple4<?> tupleToRotate, final Number rotationAngle,
final Class<? extends R> returnType) {
return GeometricOperations.rotate(tupleToRotate,
Vector4.jUnitVector(returnType), rotationAngle, returnType);
} | static <R extends Number> ITuple4<R> function( final ITuple4<?> tupleToRotate, final Number rotationAngle, final Class<? extends R> returnType) { return GeometricOperations.rotate(tupleToRotate, Vector4.jUnitVector(returnType), rotationAngle, returnType); } | /**
* Rotates the {@link ITuple4 Tuple} by the provided rotation angle around
* the y-axis.
*
* @param <R>
* the {@link Number} type of the rotated {@link ITuple4 Tuple}.
*
* @param tupleToRotate
* the {@link ITuple4 Tuple} to rotate.
* @param rotationAngle
* the rotation angle.
* @param returnType
* the desired return type.
* @return the rotated {@link ITuple4 Tuple}.
*/ | Rotates the <code>ITuple4 Tuple</code> by the provided rotation angle around the y-axis | rotateY | {
"repo_name": "aftenkap/jutility",
"path": "jutility-math/src/main/java/org/jutility/math/geometry/GeometricOperations.java",
"license": "apache-2.0",
"size": 125764
} | [
"org.jutility.math.vectoralgebra.ITuple4",
"org.jutility.math.vectoralgebra.Vector4"
] | import org.jutility.math.vectoralgebra.ITuple4; import org.jutility.math.vectoralgebra.Vector4; | import org.jutility.math.vectoralgebra.*; | [
"org.jutility.math"
] | org.jutility.math; | 2,838,947 |
public static HeaderSymlinkTree createHeaderSymlinkTreeBuildRule(
BuildTarget target,
ProjectFilesystem filesystem,
Path root,
ImmutableMap<Path, SourcePath> links,
HeaderMode headerMode) {
switch (headerMode) {
case SYMLINK_TREE_WITH_HEADER_MAP:
return HeaderSymlinkTreeWithHeaderMap.create(target, filesystem, root, links);
case HEADER_MAP_ONLY:
return new DirectHeaderMap(target, filesystem, root, links);
default:
case SYMLINK_TREE_ONLY:
return new HeaderSymlinkTree(target, filesystem, root, links);
}
} | static HeaderSymlinkTree function( BuildTarget target, ProjectFilesystem filesystem, Path root, ImmutableMap<Path, SourcePath> links, HeaderMode headerMode) { switch (headerMode) { case SYMLINK_TREE_WITH_HEADER_MAP: return HeaderSymlinkTreeWithHeaderMap.create(target, filesystem, root, links); case HEADER_MAP_ONLY: return new DirectHeaderMap(target, filesystem, root, links); default: case SYMLINK_TREE_ONLY: return new HeaderSymlinkTree(target, filesystem, root, links); } } | /**
* Build the {@link HeaderSymlinkTree} rule using the original build params from a target node. In
* particular, make sure to drop all dependencies from the original build rule params, as these
* are modeled via {@link CxxPreprocessAndCompile}.
*/ | Build the <code>HeaderSymlinkTree</code> rule using the original build params from a target node. In particular, make sure to drop all dependencies from the original build rule params, as these are modeled via <code>CxxPreprocessAndCompile</code> | createHeaderSymlinkTreeBuildRule | {
"repo_name": "shybovycha/buck",
"path": "src/com/facebook/buck/cxx/CxxPreprocessables.java",
"license": "apache-2.0",
"size": 9372
} | [
"com.facebook.buck.cxx.toolchain.HeaderMode",
"com.facebook.buck.cxx.toolchain.HeaderSymlinkTree",
"com.facebook.buck.io.filesystem.ProjectFilesystem",
"com.facebook.buck.model.BuildTarget",
"com.facebook.buck.rules.SourcePath",
"com.google.common.collect.ImmutableMap",
"java.nio.file.Path"
] | import com.facebook.buck.cxx.toolchain.HeaderMode; import com.facebook.buck.cxx.toolchain.HeaderSymlinkTree; import com.facebook.buck.io.filesystem.ProjectFilesystem; import com.facebook.buck.model.BuildTarget; import com.facebook.buck.rules.SourcePath; import com.google.common.collect.ImmutableMap; import java.nio.file.Path; | import com.facebook.buck.cxx.toolchain.*; import com.facebook.buck.io.filesystem.*; import com.facebook.buck.model.*; import com.facebook.buck.rules.*; import com.google.common.collect.*; import java.nio.file.*; | [
"com.facebook.buck",
"com.google.common",
"java.nio"
] | com.facebook.buck; com.google.common; java.nio; | 812,239 |
public ScheduleBasedBackupCriteria withDaysOfTheWeek(List<DayOfWeek> daysOfTheWeek) {
this.daysOfTheWeek = daysOfTheWeek;
return this;
} | ScheduleBasedBackupCriteria function(List<DayOfWeek> daysOfTheWeek) { this.daysOfTheWeek = daysOfTheWeek; return this; } | /**
* Set the daysOfTheWeek property: It should be Sunday/Monday/T..../Saturday.
*
* @param daysOfTheWeek the daysOfTheWeek value to set.
* @return the ScheduleBasedBackupCriteria object itself.
*/ | Set the daysOfTheWeek property: It should be Sunday/Monday/T..../Saturday | withDaysOfTheWeek | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/ScheduleBasedBackupCriteria.java",
"license": "mit",
"size": 6311
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 939,906 |
public Set<String> findIncludingFeatures(Set<String> features, Bundle b1) {
Set<String> foundInFeatures = new HashSet<String>();
for (String feature : features) {
ProvisioningFeatureDefinition fdefinition = featureRepository.getFeature(feature);
for (FeatureResource fr : fdefinition.getConstituents(SubsystemContentType.BUNDLE_TYPE)) {
try {
Bundle rfr = bundleCache.getBundle(bundleContext, fr);
if (b1.equals(rfr)) {
foundInFeatures.add(feature);
}
} catch (MalformedURLException e) {
}
}
}
return foundInFeatures;
}
static final class ConflictRecord {
String conflict;
String configured;
String chain;
String compatibleConflict;
} | Set<String> function(Set<String> features, Bundle b1) { Set<String> foundInFeatures = new HashSet<String>(); for (String feature : features) { ProvisioningFeatureDefinition fdefinition = featureRepository.getFeature(feature); for (FeatureResource fr : fdefinition.getConstituents(SubsystemContentType.BUNDLE_TYPE)) { try { Bundle rfr = bundleCache.getBundle(bundleContext, fr); if (b1.equals(rfr)) { foundInFeatures.add(feature); } } catch (MalformedURLException e) { } } } return foundInFeatures; } static final class ConflictRecord { String conflict; String configured; String chain; String compatibleConflict; } | /**
* Find which features include the given bundle
*
* @param features The feature list to scan for this bundle
* @param b1 The bundle to look for in features
* @return List of features this bundle is included in
*/ | Find which features include the given bundle | findIncludingFeatures | {
"repo_name": "kgibm/open-liberty",
"path": "dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/FeatureManager.java",
"license": "epl-1.0",
"size": 113378
} | [
"com.ibm.ws.kernel.feature.provisioning.FeatureResource",
"com.ibm.ws.kernel.feature.provisioning.ProvisioningFeatureDefinition",
"com.ibm.ws.kernel.feature.provisioning.SubsystemContentType",
"java.net.MalformedURLException",
"java.util.HashSet",
"java.util.Set",
"org.osgi.framework.Bundle"
] | import com.ibm.ws.kernel.feature.provisioning.FeatureResource; import com.ibm.ws.kernel.feature.provisioning.ProvisioningFeatureDefinition; import com.ibm.ws.kernel.feature.provisioning.SubsystemContentType; import java.net.MalformedURLException; import java.util.HashSet; import java.util.Set; import org.osgi.framework.Bundle; | import com.ibm.ws.kernel.feature.provisioning.*; import java.net.*; import java.util.*; import org.osgi.framework.*; | [
"com.ibm.ws",
"java.net",
"java.util",
"org.osgi.framework"
] | com.ibm.ws; java.net; java.util; org.osgi.framework; | 2,368,484 |
public void truncateUndoLog(boolean rollback, long token, long spHandle, List<UndoAction> undoActions); | void function(boolean rollback, long token, long spHandle, List<UndoAction> undoActions); | /**
* IV2 commit / rollback interface to the EE
*/ | IV2 commit / rollback interface to the EE | truncateUndoLog | {
"repo_name": "eoneil1942/voltdb-4.7fix",
"path": "src/frontend/org/voltdb/SiteProcedureConnection.java",
"license": "agpl-3.0",
"size": 6372
} | [
"java.util.List",
"org.voltdb.dtxn.UndoAction"
] | import java.util.List; import org.voltdb.dtxn.UndoAction; | import java.util.*; import org.voltdb.dtxn.*; | [
"java.util",
"org.voltdb.dtxn"
] | java.util; org.voltdb.dtxn; | 1,204,722 |
public static <V> GridTuple<V> t(@Nullable V v) {
return new GridTuple<>(v);
} | static <V> GridTuple<V> function(@Nullable V v) { return new GridTuple<>(v); } | /**
* Factory method returning new tuple with given parameter.
*
* @param v Parameter for tuple.
* @param <V> Type of the tuple.
* @return Newly created tuple.
*/ | Factory method returning new tuple with given parameter | t | {
"repo_name": "dlnufox/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java",
"license": "apache-2.0",
"size": 157742
} | [
"org.jetbrains.annotations.Nullable"
] | import org.jetbrains.annotations.Nullable; | import org.jetbrains.annotations.*; | [
"org.jetbrains.annotations"
] | org.jetbrains.annotations; | 1,670,060 |
public void updateTimestamp(int index,
java.sql.Timestamp x,
int scale,
boolean forceEncrypt) throws SQLServerException {
if (loggerExternal.isLoggable(java.util.logging.Level.FINER))
loggerExternal.entering(getClassNameLogging(), "updateTimestamp", new Object[] {index, x, scale, forceEncrypt});
checkClosed();
updateValue(index, JDBCType.TIMESTAMP, x, JavaType.TIMESTAMP, null, scale, forceEncrypt);
loggerExternal.exiting(getClassNameLogging(), "updateTimestamp");
} | void function(int index, java.sql.Timestamp x, int scale, boolean forceEncrypt) throws SQLServerException { if (loggerExternal.isLoggable(java.util.logging.Level.FINER)) loggerExternal.entering(getClassNameLogging(), STR, new Object[] {index, x, scale, forceEncrypt}); checkClosed(); updateValue(index, JDBCType.TIMESTAMP, x, JavaType.TIMESTAMP, null, scale, forceEncrypt); loggerExternal.exiting(getClassNameLogging(), STR); } | /**
* Updates the designated column with a <code>java.sql.Timestamp</code> value. The updater methods are used to update column values in the current
* row or the insert row. The updater methods do not update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
* methods are called to update the database.
*
* @param index
* the first column is 1, the second is 2, ...
* @param x
* the new column value
* @param scale
* the scale of the column
* @param forceEncrypt
* If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always
* Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force
* encryption on parameters.
* @throws SQLServerException
* when an error occurs
*/ | Updates the designated column with a <code>java.sql.Timestamp</code> value. The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code> methods are called to update the database | updateTimestamp | {
"repo_name": "v-nisidh/mssql-jdbc",
"path": "src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResultSet.java",
"license": "mit",
"size": 288041
} | [
"java.util.logging.Level"
] | import java.util.logging.Level; | import java.util.logging.*; | [
"java.util"
] | java.util; | 2,630,804 |
public SubmitterExecutor getClientsThreadExecutor() {
return clientExecutor;
} | SubmitterExecutor function() { return clientExecutor; } | /**
* <p> This returns this clients {@link SubmitterExecutor}.</p>
*
* <p> Its worth noting that operations done on this {@link SubmitterExecutor} can/will block Read callbacks on the
* client, but it does provide you the ability to execute things on the clients read thread.</p>
*
* @return The {@link SubmitterExecutor} for the client.
*/ | This returns this clients <code>SubmitterExecutor</code>. Its worth noting that operations done on this <code>SubmitterExecutor</code> can/will block Read callbacks on the client, but it does provide you the ability to execute things on the clients read thread | getClientsThreadExecutor | {
"repo_name": "jentfoo/litesockets",
"path": "src/main/java/org/threadly/litesockets/Client.java",
"license": "mpl-2.0",
"size": 27742
} | [
"org.threadly.concurrent.SubmitterExecutor"
] | import org.threadly.concurrent.SubmitterExecutor; | import org.threadly.concurrent.*; | [
"org.threadly.concurrent"
] | org.threadly.concurrent; | 2,403,136 |
public Catinfo getConfig() {
getReadLock().lock();
try {
return m_config;
} finally {
getReadLock().unlock();
}
} | Catinfo function() { getReadLock().lock(); try { return m_config; } finally { getReadLock().unlock(); } } | /**
* Return the categories configuration.
*
* @return the categories configuration
*/ | Return the categories configuration | getConfig | {
"repo_name": "vishwaAbhinav/OpenNMS",
"path": "opennms-services/src/main/java/org/opennms/netmgt/config/CategoryFactory.java",
"license": "gpl-2.0",
"size": 17309
} | [
"org.opennms.netmgt.config.categories.Catinfo"
] | import org.opennms.netmgt.config.categories.Catinfo; | import org.opennms.netmgt.config.categories.*; | [
"org.opennms.netmgt"
] | org.opennms.netmgt; | 1,798,726 |
protected double calculateLogLikelihood() {
double lnL;
if (populationSizeModel != null) {
PopulationSizeFunction popFunction = populationSizeModel.getPopulationSizeFunction();
lnL = calculateLogLikelihood(popFunction);
} else {
lnL = calculateLogLikelihood(demographicModel);
}
if (Double.isNaN(lnL) || Double.isInfinite(lnL)) {
Logger.getLogger("warning").severe("CoalescentLikelihood for " + demographicModel.getId() + " is " + Double.toString(lnL));
}
return lnL;
} | double function() { double lnL; if (populationSizeModel != null) { PopulationSizeFunction popFunction = populationSizeModel.getPopulationSizeFunction(); lnL = calculateLogLikelihood(popFunction); } else { lnL = calculateLogLikelihood(demographicModel); } if (Double.isNaN(lnL) Double.isInfinite(lnL)) { Logger.getLogger(STR).severe(STR + demographicModel.getId() + STR + Double.toString(lnL)); } return lnL; } | /**
* Calculates the log likelihood of this set of coalescent intervals,
* given a demographic model.
*/ | Calculates the log likelihood of this set of coalescent intervals, given a demographic model | calculateLogLikelihood | {
"repo_name": "adamallo/beast-mcmc",
"path": "src/dr/evomodel/coalescent/CoalescentLikelihood.java",
"license": "lgpl-2.1",
"size": 8839
} | [
"java.util.logging.Logger"
] | import java.util.logging.Logger; | import java.util.logging.*; | [
"java.util"
] | java.util; | 1,333,413 |
@Around("execution(private void com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(com.sun.jersey.server.impl.application.WebApplicationContext, com.sun.jersey.spi.container.ContainerRequest, com.sun.jersey.spi.container.ContainerResponse))")
public Object operationHandleRequest(final ProceedingJoinPoint thisJoinPoint) throws Throwable { // NOCS (Throwable)
if (!OperationExecutionJerseyServerInterceptor.CTRLINST.isMonitoringEnabled()) {
return thisJoinPoint.proceed();
}
final String signature = this.signatureToLongString(thisJoinPoint.getSignature());
if (!OperationExecutionJerseyServerInterceptor.CTRLINST.isProbeActivated(signature)) {
return thisJoinPoint.proceed();
}
boolean entrypoint = true;
final String hostname = OperationExecutionJerseyServerInterceptor.VMNAME;
String sessionId = OperationExecutionJerseyServerInterceptor.SESSION_REGISTRY.recallThreadLocalSessionId();
Long traceId = -1L;
int eoi; // this is executionOrderIndex-th execution in this trace
int ess; // this is the height in the dynamic call tree of this execution
final Object[] args = thisJoinPoint.getArgs();
final ContainerRequest request = (ContainerRequest) args[1];
final MultivaluedMap<String, String> requestHeader = request.getRequestHeaders();
final List<String> requestJerseyHeader = requestHeader
.get(JerseyHeaderConstants.OPERATION_EXECUTION_JERSEY_HEADER);
if ((requestJerseyHeader == null) || (requestJerseyHeader.isEmpty())) {
OperationExecutionJerseyServerInterceptor.LOGGER
.debug("No monitoring data found in the incoming request header");
// LOG.info("Will continue without sending back reponse header");
traceId = OperationExecutionJerseyServerInterceptor.CF_REGISTRY.getAndStoreUniqueThreadLocalTraceId();
OperationExecutionJerseyServerInterceptor.CF_REGISTRY.storeThreadLocalEOI(0);
OperationExecutionJerseyServerInterceptor.CF_REGISTRY.storeThreadLocalESS(1); // next operation is ess + 1
eoi = 0;
ess = 0;
} else {
final String operationExecutionHeader = requestJerseyHeader.get(0);
OperationExecutionJerseyServerInterceptor.LOGGER.debug("Received request: {} with header = {}",
request.getRequestUri(), requestHeader.toString());
final String[] headerArray = operationExecutionHeader.split(",");
// Extract session id
sessionId = headerArray[1];
if ("null".equals(sessionId)) {
sessionId = OperationExecutionRecord.NO_SESSION_ID;
}
// Extract EOI
final String eoiStr = headerArray[2];
eoi = -1;
try {
eoi = 1 + Integer.parseInt(eoiStr);
} catch (final NumberFormatException exc) {
OperationExecutionJerseyServerInterceptor.LOGGER.warn("Invalid eoi", exc);
}
// Extract ESS
final String essStr = headerArray[3];
ess = -1;
try {
ess = Integer.parseInt(essStr);
} catch (final NumberFormatException exc) {
OperationExecutionJerseyServerInterceptor.LOGGER.warn("Invalid ess", exc);
}
// Extract trace id
final String traceIdStr = headerArray[0];
if (traceIdStr != null) {
try {
traceId = Long.parseLong(traceIdStr);
} catch (final NumberFormatException exc) {
OperationExecutionJerseyServerInterceptor.LOGGER.warn("Invalid trace id", exc);
}
} else {
traceId = OperationExecutionJerseyServerInterceptor.CF_REGISTRY.getUniqueTraceId();
sessionId = OperationExecutionJerseyServerInterceptor.SESSION_ID_ASYNC_TRACE;
entrypoint = true;
eoi = 0; // EOI of this execution
ess = 0; // ESS of this execution
}
// Store thread-local values
OperationExecutionJerseyServerInterceptor.CF_REGISTRY.storeThreadLocalTraceId(traceId);
OperationExecutionJerseyServerInterceptor.CF_REGISTRY.storeThreadLocalEOI(eoi); // this execution has
// EOI=eoi; next execution
// will get eoi with
// incrementAndRecall
OperationExecutionJerseyServerInterceptor.CF_REGISTRY.storeThreadLocalESS(ess + 1); // this execution has
// ESS=ess
OperationExecutionJerseyServerInterceptor.SESSION_REGISTRY.storeThreadLocalSessionId(sessionId);
}
// measure before
final long tin = OperationExecutionJerseyServerInterceptor.TIME.getTime();
// execution of the called method
final Object retval;
try {
retval = thisJoinPoint.proceed();
} finally {
// measure after
final long tout = OperationExecutionJerseyServerInterceptor.TIME.getTime();
OperationExecutionJerseyServerInterceptor.CTRLINST.newMonitoringRecord(
new OperationExecutionRecord(signature, sessionId, traceId, tin, tout, hostname, eoi, ess));
// cleanup
if (entrypoint) {
this.unsetKiekerThreadLocalData();
} else {
OperationExecutionJerseyServerInterceptor.CF_REGISTRY.storeThreadLocalESS(ess); // next operation is ess
}
}
return retval;
} | @Around(STR) Object function(final ProceedingJoinPoint thisJoinPoint) throws Throwable { if (!OperationExecutionJerseyServerInterceptor.CTRLINST.isMonitoringEnabled()) { return thisJoinPoint.proceed(); } final String signature = this.signatureToLongString(thisJoinPoint.getSignature()); if (!OperationExecutionJerseyServerInterceptor.CTRLINST.isProbeActivated(signature)) { return thisJoinPoint.proceed(); } boolean entrypoint = true; final String hostname = OperationExecutionJerseyServerInterceptor.VMNAME; String sessionId = OperationExecutionJerseyServerInterceptor.SESSION_REGISTRY.recallThreadLocalSessionId(); Long traceId = -1L; int eoi; int ess; final Object[] args = thisJoinPoint.getArgs(); final ContainerRequest request = (ContainerRequest) args[1]; final MultivaluedMap<String, String> requestHeader = request.getRequestHeaders(); final List<String> requestJerseyHeader = requestHeader .get(JerseyHeaderConstants.OPERATION_EXECUTION_JERSEY_HEADER); if ((requestJerseyHeader == null) (requestJerseyHeader.isEmpty())) { OperationExecutionJerseyServerInterceptor.LOGGER .debug(STR); traceId = OperationExecutionJerseyServerInterceptor.CF_REGISTRY.getAndStoreUniqueThreadLocalTraceId(); OperationExecutionJerseyServerInterceptor.CF_REGISTRY.storeThreadLocalEOI(0); OperationExecutionJerseyServerInterceptor.CF_REGISTRY.storeThreadLocalESS(1); eoi = 0; ess = 0; } else { final String operationExecutionHeader = requestJerseyHeader.get(0); OperationExecutionJerseyServerInterceptor.LOGGER.debug(STR, request.getRequestUri(), requestHeader.toString()); final String[] headerArray = operationExecutionHeader.split(","); sessionId = headerArray[1]; if ("null".equals(sessionId)) { sessionId = OperationExecutionRecord.NO_SESSION_ID; } final String eoiStr = headerArray[2]; eoi = -1; try { eoi = 1 + Integer.parseInt(eoiStr); } catch (final NumberFormatException exc) { OperationExecutionJerseyServerInterceptor.LOGGER.warn(STR, exc); } final String essStr = headerArray[3]; ess = -1; try { ess = Integer.parseInt(essStr); } catch (final NumberFormatException exc) { OperationExecutionJerseyServerInterceptor.LOGGER.warn(STR, exc); } final String traceIdStr = headerArray[0]; if (traceIdStr != null) { try { traceId = Long.parseLong(traceIdStr); } catch (final NumberFormatException exc) { OperationExecutionJerseyServerInterceptor.LOGGER.warn(STR, exc); } } else { traceId = OperationExecutionJerseyServerInterceptor.CF_REGISTRY.getUniqueTraceId(); sessionId = OperationExecutionJerseyServerInterceptor.SESSION_ID_ASYNC_TRACE; entrypoint = true; eoi = 0; ess = 0; } OperationExecutionJerseyServerInterceptor.CF_REGISTRY.storeThreadLocalTraceId(traceId); OperationExecutionJerseyServerInterceptor.CF_REGISTRY.storeThreadLocalEOI(eoi); OperationExecutionJerseyServerInterceptor.CF_REGISTRY.storeThreadLocalESS(ess + 1); OperationExecutionJerseyServerInterceptor.SESSION_REGISTRY.storeThreadLocalSessionId(sessionId); } final long tin = OperationExecutionJerseyServerInterceptor.TIME.getTime(); final Object retval; try { retval = thisJoinPoint.proceed(); } finally { final long tout = OperationExecutionJerseyServerInterceptor.TIME.getTime(); OperationExecutionJerseyServerInterceptor.CTRLINST.newMonitoringRecord( new OperationExecutionRecord(signature, sessionId, traceId, tin, tout, hostname, eoi, ess)); if (entrypoint) { this.unsetKiekerThreadLocalData(); } else { OperationExecutionJerseyServerInterceptor.CF_REGISTRY.storeThreadLocalESS(ess); } } return retval; } | /**
* Method to intercept incoming request.
*
* @return value of the intercepted method
*/ | Method to intercept incoming request | operationHandleRequest | {
"repo_name": "kieker-monitoring/kieker",
"path": "kieker-monitoring/src/kieker/monitoring/probe/aspectj/jersey/OperationExecutionJerseyServerInterceptor.java",
"license": "apache-2.0",
"size": 10040
} | [
"jakarta.ws.rs.core.MultivaluedMap",
"java.util.List",
"org.aspectj.lang.ProceedingJoinPoint",
"org.aspectj.lang.annotation.Around",
"org.glassfish.jersey.server.ContainerRequest"
] | import jakarta.ws.rs.core.MultivaluedMap; import java.util.List; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.glassfish.jersey.server.ContainerRequest; | import jakarta.ws.rs.core.*; import java.util.*; import org.aspectj.lang.*; import org.aspectj.lang.annotation.*; import org.glassfish.jersey.server.*; | [
"jakarta.ws.rs",
"java.util",
"org.aspectj.lang",
"org.glassfish.jersey"
] | jakarta.ws.rs; java.util; org.aspectj.lang; org.glassfish.jersey; | 1,929,592 |
void putMinDate(LocalDate dateBody) throws ErrorException, IOException, IllegalArgumentException; | void putMinDate(LocalDate dateBody) throws ErrorException, IOException, IllegalArgumentException; | /**
* Put min date value 0000-01-01.
*
* @param dateBody the LocalDate value
* @throws ErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @throws IllegalArgumentException exception thrown from invalid parameters
*/ | Put min date value 0000-01-01 | putMinDate | {
"repo_name": "tbombach/autorest",
"path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/bodydate/Dates.java",
"license": "mit",
"size": 9069
} | [
"java.io.IOException",
"org.joda.time.LocalDate"
] | import java.io.IOException; import org.joda.time.LocalDate; | import java.io.*; import org.joda.time.*; | [
"java.io",
"org.joda.time"
] | java.io; org.joda.time; | 2,897,687 |
@GuardedBy("lock")
void removePendingStream(OkHttpClientStream pendingStream) {
pendingStreams.remove(pendingStream);
maybeClearInUse();
} | @GuardedBy("lock") void removePendingStream(OkHttpClientStream pendingStream) { pendingStreams.remove(pendingStream); maybeClearInUse(); } | /**
* Removes given pending stream, used when a pending stream is cancelled.
*/ | Removes given pending stream, used when a pending stream is cancelled | removePendingStream | {
"repo_name": "rmichela/grpc-java",
"path": "okhttp/src/main/java/io/grpc/okhttp/OkHttpClientTransport.java",
"license": "apache-2.0",
"size": 40854
} | [
"javax.annotation.concurrent.GuardedBy"
] | import javax.annotation.concurrent.GuardedBy; | import javax.annotation.concurrent.*; | [
"javax.annotation"
] | javax.annotation; | 2,568,961 |
private int getThumbnailDimension() {
// Converts dp to pixel
Resources r = MainApp.getAppContext().getResources();
Double d = Math.pow(2, Math.floor(Math.log(r.getDimension(R.dimen.file_icon_size_grid)) / Math.log(2))) / 2;
return d.intValue();
} | int function() { Resources r = MainApp.getAppContext().getResources(); Double d = Math.pow(2, Math.floor(Math.log(r.getDimension(R.dimen.file_icon_size_grid)) / Math.log(2))) / 2; return d.intValue(); } | /**
* Converts size of file icon from dp to pixel
*
* @return int
*/ | Converts size of file icon from dp to pixel | getThumbnailDimension | {
"repo_name": "jsargent7089/android",
"path": "src/main/java/com/owncloud/android/ui/adapter/ActivityListAdapter.java",
"license": "gpl-2.0",
"size": 20378
} | [
"android.content.res.Resources",
"com.owncloud.android.MainApp"
] | import android.content.res.Resources; import com.owncloud.android.MainApp; | import android.content.res.*; import com.owncloud.android.*; | [
"android.content",
"com.owncloud.android"
] | android.content; com.owncloud.android; | 1,590,515 |
public SelectionTreeNode getSelectedNode() {
TreePath treePath = this.getSelectionPath();
if (treePath != null) {
Object obj = treePath.getLastPathComponent();
if (obj instanceof SelectionTreeNode) {
return (SelectionTreeNode) obj;
}
}
return null;
} | SelectionTreeNode function() { TreePath treePath = this.getSelectionPath(); if (treePath != null) { Object obj = treePath.getLastPathComponent(); if (obj instanceof SelectionTreeNode) { return (SelectionTreeNode) obj; } } return null; } | /**
* Answers selected {@link SelectionTreeNode}.
*/ | Answers selected <code>SelectionTreeNode</code> | getSelectedNode | {
"repo_name": "otmarjr/jtreg-fork",
"path": "dist-with-aspectj/jtreg/lib/javatest/com/sun/javatest/tool/selectiontree/SelectionTree.java",
"license": "gpl-2.0",
"size": 39252
} | [
"javax.swing.tree.TreePath"
] | import javax.swing.tree.TreePath; | import javax.swing.tree.*; | [
"javax.swing"
] | javax.swing; | 878,825 |
private void processSetCssNameMapping(NodeTraversal t, Node n, Node parent) {
Node left = n.getFirstChild();
Node arg = left.getNext();
if (verifySetCssNameMapping(t, left, arg)) {
// Translate OBJECTLIT into SubstitutionMap. All keys and
// values must be strings, or an error will be thrown.
final Map<String, String> cssNames = new HashMap<>();
for (Node key = arg.getFirstChild(); key != null;
key = key.getNext()) {
Node value = key.getFirstChild();
if (!key.isStringKey()
|| value == null
|| !value.isString()) {
compiler.report(
t.makeError(n,
NON_STRING_PASSED_TO_SET_CSS_NAME_MAPPING_ERROR));
return;
}
cssNames.put(key.getString(), value.getString());
}
String styleStr = "BY_PART";
if (arg.getNext() != null) {
styleStr = arg.getNext().getString();
}
final CssRenamingMap.Style style;
try {
style = CssRenamingMap.Style.valueOf(styleStr);
} catch (IllegalArgumentException e) {
compiler.report(
t.makeError(n, INVALID_STYLE_ERROR, styleStr));
return;
}
if (style == CssRenamingMap.Style.BY_PART) {
// Make sure that no keys contain -'s
List<String> errors = new ArrayList<>();
for (String key : cssNames.keySet()) {
if (key.contains("-")) {
errors.add(key);
}
}
if (!errors.isEmpty()) {
compiler.report(
t.makeError(n, INVALID_CSS_RENAMING_MAP, errors.toString()));
}
} else if (style == CssRenamingMap.Style.BY_WHOLE) {
// Verifying things is a lot trickier here. We just do a quick
// n^2 check over the map which makes sure that if "a-b" in
// the map, then map(a-b) = map(a)-map(b).
// To speed things up, only consider cases where len(b) <= 10
List<String> errors = new ArrayList<>();
for (Map.Entry<String, String> b : cssNames.entrySet()) {
if (b.getKey().length() > 10) {
continue;
}
for (Map.Entry<String, String> a : cssNames.entrySet()) {
String combined = cssNames.get(a.getKey() + "-" + b.getKey());
if (combined != null &&
!combined.equals(a.getValue() + "-" + b.getValue())) {
errors.add("map(" + a.getKey() + "-" + b.getKey() + ") != map(" +
a.getKey() + ")-map(" + b.getKey() + ")");
}
}
}
if (!errors.isEmpty()) {
compiler.report(
t.makeError(n, INVALID_CSS_RENAMING_MAP, errors.toString()));
}
} | void function(NodeTraversal t, Node n, Node parent) { Node left = n.getFirstChild(); Node arg = left.getNext(); if (verifySetCssNameMapping(t, left, arg)) { final Map<String, String> cssNames = new HashMap<>(); for (Node key = arg.getFirstChild(); key != null; key = key.getNext()) { Node value = key.getFirstChild(); if (!key.isStringKey() value == null !value.isString()) { compiler.report( t.makeError(n, NON_STRING_PASSED_TO_SET_CSS_NAME_MAPPING_ERROR)); return; } cssNames.put(key.getString(), value.getString()); } String styleStr = STR; if (arg.getNext() != null) { styleStr = arg.getNext().getString(); } final CssRenamingMap.Style style; try { style = CssRenamingMap.Style.valueOf(styleStr); } catch (IllegalArgumentException e) { compiler.report( t.makeError(n, INVALID_STYLE_ERROR, styleStr)); return; } if (style == CssRenamingMap.Style.BY_PART) { List<String> errors = new ArrayList<>(); for (String key : cssNames.keySet()) { if (key.contains("-")) { errors.add(key); } } if (!errors.isEmpty()) { compiler.report( t.makeError(n, INVALID_CSS_RENAMING_MAP, errors.toString())); } } else if (style == CssRenamingMap.Style.BY_WHOLE) { List<String> errors = new ArrayList<>(); for (Map.Entry<String, String> b : cssNames.entrySet()) { if (b.getKey().length() > 10) { continue; } for (Map.Entry<String, String> a : cssNames.entrySet()) { String combined = cssNames.get(a.getKey() + "-" + b.getKey()); if (combined != null && !combined.equals(a.getValue() + "-" + b.getValue())) { errors.add("map(" + a.getKey() + "-" + b.getKey() + STR + a.getKey() + STR + b.getKey() + ")"); } } } if (!errors.isEmpty()) { compiler.report( t.makeError(n, INVALID_CSS_RENAMING_MAP, errors.toString())); } } | /**
* Processes a call to goog.setCssNameMapping(). Either the argument to
* goog.setCssNameMapping() is valid, in which case it will be used to create
* a CssRenamingMap for the compiler of this CompilerPass, or it is invalid
* and a JSCompiler error will be reported.
* @see #visit(NodeTraversal, Node, Node)
*/ | Processes a call to goog.setCssNameMapping(). Either the argument to goog.setCssNameMapping() is valid, in which case it will be used to create a CssRenamingMap for the compiler of this CompilerPass, or it is invalid and a JSCompiler error will be reported | processSetCssNameMapping | {
"repo_name": "pauldraper/closure-compiler",
"path": "src/com/google/javascript/jscomp/ProcessClosurePrimitives.java",
"license": "apache-2.0",
"size": 54586
} | [
"com.google.javascript.rhino.Node",
"java.util.ArrayList",
"java.util.HashMap",
"java.util.List",
"java.util.Map"
] | import com.google.javascript.rhino.Node; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; | import com.google.javascript.rhino.*; import java.util.*; | [
"com.google.javascript",
"java.util"
] | com.google.javascript; java.util; | 2,010,796 |
@Async
public CompletableFuture<String> sendMails(
String[] toAddrList, String subject, String body, String okUrl, String ngUrl)
throws InterruptedException, ExecutionException {
log.info("control thread - start.");
// Send emails asynchronously by destination.
List<CompletableFuture<Boolean>> futures = new ArrayList<CompletableFuture<Boolean>>();
for (String toAddr : toAddrList) {
// Get a bean for each email address and assign a thread
SendEmailService service = context.getBean(SendEmailService.class);
futures.add(service.sendMail(toAddr, subject, body));
}
// Wait for all threads to complete.
CompletableFuture.allOf(futures.toArray(new CompletableFuture[futures.size()])).join();
log.info("control thread - completed.");
// Return the result of sending all emails.
for (CompletableFuture<Boolean> future : futures) {
if (!future.get().booleanValue()) {
return CompletableFuture.completedFuture(ngUrl);
}
}
return CompletableFuture.completedFuture(okUrl);
} | CompletableFuture<String> function( String[] toAddrList, String subject, String body, String okUrl, String ngUrl) throws InterruptedException, ExecutionException { log.info(STR); List<CompletableFuture<Boolean>> futures = new ArrayList<CompletableFuture<Boolean>>(); for (String toAddr : toAddrList) { SendEmailService service = context.getBean(SendEmailService.class); futures.add(service.sendMail(toAddr, subject, body)); } CompletableFuture.allOf(futures.toArray(new CompletableFuture[futures.size()])).join(); log.info(STR); for (CompletableFuture<Boolean> future : futures) { if (!future.get().booleanValue()) { return CompletableFuture.completedFuture(ngUrl); } } return CompletableFuture.completedFuture(okUrl); } | /**
* Send emails to all email addresses.
* @param toAddrList destination email address list.
* @param subject email subject.
* @param body email body.
* @param okUrl request URL when processing is successful.
* @param ngUrl request URL when processing fails.
* @return true if all emails are sent successfully.
* @throws InterruptedException
* @throws ExecutionException
*/ | Send emails to all email addresses | sendMails | {
"repo_name": "d-saitou/Spring4MvcExample",
"path": "src/main/java/com/example/springmvc/domain/di/service/SendEmailThreadControlService.java",
"license": "mit",
"size": 2239
} | [
"java.util.ArrayList",
"java.util.List",
"java.util.concurrent.CompletableFuture",
"java.util.concurrent.ExecutionException"
] | import java.util.ArrayList; import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; | import java.util.*; import java.util.concurrent.*; | [
"java.util"
] | java.util; | 656,050 |
public void setSelection(Object o, boolean fireEvents){
if (fireEvents == false) {
viewer.removeSelectionChangedListener(this);
viewer.setSelection(new StructuredSelection(o), true);
viewer.addSelectionChangedListener(this);
} else {
viewer.setSelection(new StructuredSelection(o), true);
}
}
| void function(Object o, boolean fireEvents){ if (fireEvents == false) { viewer.removeSelectionChangedListener(this); viewer.setSelection(new StructuredSelection(o), true); viewer.addSelectionChangedListener(this); } else { viewer.setSelection(new StructuredSelection(o), true); } } | /**
* Das selektierte Element des Viewers einstellen
*
* @param o
* Das Element
*/ | Das selektierte Element des Viewers einstellen | setSelection | {
"repo_name": "elexis/elexis-3-core",
"path": "bundles/ch.elexis.core.ui/src/ch/elexis/core/ui/util/viewers/CommonViewer.java",
"license": "epl-1.0",
"size": 17922
} | [
"org.eclipse.jface.viewers.StructuredSelection"
] | import org.eclipse.jface.viewers.StructuredSelection; | import org.eclipse.jface.viewers.*; | [
"org.eclipse.jface"
] | org.eclipse.jface; | 1,409,108 |
protected void printResources(PrintWriter writer, String prefix,
javax.naming.Context namingContext,
String type, Class clazz) {
try {
NamingEnumeration items = namingContext.listBindings("");
while (items.hasMore()) {
Binding item = (Binding) items.next();
if (item.getObject() instanceof javax.naming.Context) {
printResources
(writer, prefix + item.getName() + "/",
(javax.naming.Context) item.getObject(), type, clazz);
} else {
if ((clazz != null) &&
(!(clazz.isInstance(item.getObject())))) {
continue;
}
writer.print(prefix + item.getName());
writer.print(':');
writer.print(item.getClassName());
// Do we want a description if available?
writer.println();
}
}
} catch (Throwable t) {
log("ManagerServlet.resources[" + type + "]", t);
writer.println(sm.getString("managerServlet.exception",
t.toString()));
}
} | void function(PrintWriter writer, String prefix, javax.naming.Context namingContext, String type, Class clazz) { try { NamingEnumeration items = namingContext.listBindings(STR/STRManagerServlet.resources[STR]STRmanagerServlet.exception", t.toString())); } } | /**
* List the resources of the given context.
*/ | List the resources of the given context | printResources | {
"repo_name": "devjin24/howtomcatworks",
"path": "bookrefer/jakarta-tomcat-4.1.12-src/catalina/src/share/org/apache/catalina/servlets/ManagerServlet.java",
"license": "apache-2.0",
"size": 49061
} | [
"java.io.PrintWriter",
"javax.naming.NamingEnumeration",
"org.apache.catalina.Context"
] | import java.io.PrintWriter; import javax.naming.NamingEnumeration; import org.apache.catalina.Context; | import java.io.*; import javax.naming.*; import org.apache.catalina.*; | [
"java.io",
"javax.naming",
"org.apache.catalina"
] | java.io; javax.naming; org.apache.catalina; | 1,357,241 |
public Promise<List<Phone>> getPhones() {
RetrofitPromise<List<Phone>> promise = new RetrofitPromise<>();
UserService userService = this.getUpholdRestAdapter().create(UserService.class);
userService.getUserPhones(promise);
return promise;
}
/**
* Gets the user settings.
*
* @return the user {@link Settings} | Promise<List<Phone>> function() { RetrofitPromise<List<Phone>> promise = new RetrofitPromise<>(); UserService userService = this.getUpholdRestAdapter().create(UserService.class); userService.getUserPhones(promise); return promise; } /** * Gets the user settings. * * @return the user {@link Settings} | /**
* Gets the user phones.
*
* @return a promise {@link Promise<List<Phone>>} with the list of user phones.
*/ | Gets the user phones | getPhones | {
"repo_name": "uphold/uphold-sdk-android",
"path": "src/app/src/main/java/com/uphold/uphold_android_sdk/model/User.java",
"license": "mit",
"size": 16893
} | [
"com.darylteo.rx.promises.java.Promise",
"com.uphold.uphold_android_sdk.client.retrofitpromise.RetrofitPromise",
"com.uphold.uphold_android_sdk.model.user.Phone",
"com.uphold.uphold_android_sdk.model.user.Settings",
"com.uphold.uphold_android_sdk.service.UserService",
"java.util.List"
] | import com.darylteo.rx.promises.java.Promise; import com.uphold.uphold_android_sdk.client.retrofitpromise.RetrofitPromise; import com.uphold.uphold_android_sdk.model.user.Phone; import com.uphold.uphold_android_sdk.model.user.Settings; import com.uphold.uphold_android_sdk.service.UserService; import java.util.List; | import com.darylteo.rx.promises.java.*; import com.uphold.uphold_android_sdk.client.retrofitpromise.*; import com.uphold.uphold_android_sdk.model.user.*; import com.uphold.uphold_android_sdk.service.*; import java.util.*; | [
"com.darylteo.rx",
"com.uphold.uphold_android_sdk",
"java.util"
] | com.darylteo.rx; com.uphold.uphold_android_sdk; java.util; | 291,804 |
public void lockssRun() {
final String DEBUG_HEADER = "lockssRun(): ";
if (log.isDebug2()) log.debug2(DEBUG_HEADER + "Starting...");
LockssDaemon daemon = LockssDaemon.getLockssDaemon();
dbManager = daemon.getDbManager();
mdManager = daemon.getMetadataManager();
pluginManager = daemon.getPluginManager();
// Wait until the archival units have been started.
if (!daemon.areAusStarted()) {
log.debug(DEBUG_HEADER + "Waiting for aus to start");
while (!daemon.areAusStarted()) {
try {
daemon.waitUntilAusStarted();
} catch (InterruptedException ex) {
}
}
}
// Sanity check.
if (dbManager == null || !dbManager.isReady()) {
if (log.isDebug()) log.debug(DEBUG_HEADER + "DbManager is not ready.");
if (log.isDebug2()) log.debug2(DEBUG_HEADER + "Done.");
return;
}
// Get a connection to the database.
Connection conn = null;
String message = CANNOT_CONNECT_TO_DB_ERROR_MESSAGE;
try {
// Get a connection to the database.
conn = dbManager.getConnection();
if (log.isDebug3()) log.debug3(DEBUG_HEADER + "conn = " + conn);
} catch (DbException dbe) {
log.error(message, dbe);
}
if (conn == null) {
if (log.isDebug2()) log.debug2(DEBUG_HEADER + "Done.");
return;
}
// Get the Total Subscription feature setting.
message = CANNOT_GET_TOTAL_SUBSCRIPTION_ERROR_MESSAGE;
try {
queryTotalSubscriptionSetting(conn);
} catch (DbException dbe) {
log.error(message, dbe);
if (log.isDebug2()) log.debug2(DEBUG_HEADER + "Done.");
return;
}
// Nothing more to do if the Total Subscription feature is set to off.
if (isTotalSubscription != null && !isTotalSubscription.booleanValue()) {
if (log.isDebug2()) log.debug2(DEBUG_HEADER + "Done.");
return;
}
boolean isFirstRun = false;
if (!isTotalSubscriptionOn && !mustConfigure) {
message = CANNOT_CHECK_FIRST_RUN_ERROR_MESSAGE;
try {
// Determine whether this is the first run of the subscription manager.
isFirstRun = mdManager.countUnconfiguredAus(conn) == 0;
if (log.isDebug3())
log.debug3(DEBUG_HEADER + "isFirstRun = " + isFirstRun);
} catch (DbException dbe) {
log.error(message, dbe);
if (log.isDebug2()) log.debug2(DEBUG_HEADER + "Done.");
return;
}
}
Iterator<TdbAu> tdbAuIterator = null;
boolean afterFirstIterator = false;
int overallConfiguredAuCount = 0;
long overallConfiguredAuCountStartTime = 0;
if (log.isDebug3()) {
overallConfiguredAuCountStartTime = new Date().getTime();
}
// Initialize the configuration used to configure the archival units.
Configuration config = ConfigManager.newConfiguration();
// Keep running until there are no more TdbAus to be processed.
while (true) {
if (log.isDebug3()) log.debug3(DEBUG_HEADER
+ (tdbAuIterator == null ? "tdbAuIterator == null"
: "tdbAuIterator.hasNext() = " + tdbAuIterator.hasNext()));
// Check whether a new TdbAu iterator needs to be processed.
if (tdbAuIterator == null || !tdbAuIterator.hasNext()) {
synchronized (tdbAuIterators) {
// Yes: Get it.
tdbAuIterator = tdbAuIterators.poll();
// Determine whether the thread needs to exit.
exiting = tdbAuIterator == null;
}
if (log.isDebug3()) log.debug3(DEBUG_HEADER + "exiting = " + exiting);
// Check whether there are no more TdbAus to be processed.
if (exiting) {
// Yes: Configure the last partial batch of archival units.
try {
subscriptionManager.configureAuBatch(config);
} catch (IOException ioe) {
log.error("Exception caught configuring a batch of archival units. "
+ "Config = " + config, ioe);
}
// Clean up and exit.
DbManager.safeRollbackAndClose(conn);
if (log.isDebug2()) log.debug2(DEBUG_HEADER + "Done.");
return;
}
if (!isTotalSubscriptionOn && !mustConfigure) {
// Make sure the flag that indicates this is the first run of the
// subscription manager is reset after the first iterator.
if (afterFirstIterator) {
isFirstRun = false;
} else {
afterFirstIterator = true;
}
}
}
long configuredAuCountStartTime = 0;
if (log.isDebug3()) {
configuredAuCountStartTime = new Date().getTime();
}
// Prepare a batch of archival units to be configured, if any.
int configuredAuCount =
prepareBatch(tdbAuIterator, conn, isFirstRun, config);
// Check whether no archival units were batched to be configured.
if (configuredAuCount == 0) {
// Yes: Continue with the next TdbAu iterator.
continue;
}
// No: Configure the batch of archival units.
try {
subscriptionManager.configureAuBatch(config);
} catch (IOException ioe) {
log.error("Exception caught configuring a batch of archival units. "
+ "Config = " + config, ioe);
}
// Reset the configuration for the next batch.
config = ConfigManager.newConfiguration();
long startDelayTime = 0;
if (log.isDebug3()) {
startDelayTime = new Date().getTime();
}
// Wait until the next batch can be started in order to keep the
// appropriate configuration rate.
try {
if (log.isDebug3()) log.debug3(DEBUG_HEADER
+ "Waiting until the next batch is allowed to proceed...");
configureAuRateLimiter.waitUntilEventOk();
} catch (InterruptedException ie) {
}
if (log.isDebug3()) {
long currentTime = new Date().getTime();
log.debug3(DEBUG_HEADER + "configuredAuCountDelaySeconds = "
+ (currentTime - startDelayTime) / 1000.00);
log.debug3(DEBUG_HEADER + "configuredAuCountRate = "
+ (configuredAuCount * 60000.0D)
/ (currentTime - configuredAuCountStartTime));
overallConfiguredAuCount += configuredAuCount;
log.debug3(DEBUG_HEADER + "overallConfiguredAuCount = "
+ overallConfiguredAuCount);
log.debug3(DEBUG_HEADER + "overallConfiguredAuCountRate = "
+ (overallConfiguredAuCount * 60000.0D)
/ (currentTime - overallConfiguredAuCountStartTime));
}
}
} | void function() { final String DEBUG_HEADER = STR; if (log.isDebug2()) log.debug2(DEBUG_HEADER + STR); LockssDaemon daemon = LockssDaemon.getLockssDaemon(); dbManager = daemon.getDbManager(); mdManager = daemon.getMetadataManager(); pluginManager = daemon.getPluginManager(); if (!daemon.areAusStarted()) { log.debug(DEBUG_HEADER + STR); while (!daemon.areAusStarted()) { try { daemon.waitUntilAusStarted(); } catch (InterruptedException ex) { } } } if (dbManager == null !dbManager.isReady()) { if (log.isDebug()) log.debug(DEBUG_HEADER + STR); if (log.isDebug2()) log.debug2(DEBUG_HEADER + "Done."); return; } Connection conn = null; String message = CANNOT_CONNECT_TO_DB_ERROR_MESSAGE; try { conn = dbManager.getConnection(); if (log.isDebug3()) log.debug3(DEBUG_HEADER + STR + conn); } catch (DbException dbe) { log.error(message, dbe); } if (conn == null) { if (log.isDebug2()) log.debug2(DEBUG_HEADER + "Done."); return; } message = CANNOT_GET_TOTAL_SUBSCRIPTION_ERROR_MESSAGE; try { queryTotalSubscriptionSetting(conn); } catch (DbException dbe) { log.error(message, dbe); if (log.isDebug2()) log.debug2(DEBUG_HEADER + "Done."); return; } if (isTotalSubscription != null && !isTotalSubscription.booleanValue()) { if (log.isDebug2()) log.debug2(DEBUG_HEADER + "Done."); return; } boolean isFirstRun = false; if (!isTotalSubscriptionOn && !mustConfigure) { message = CANNOT_CHECK_FIRST_RUN_ERROR_MESSAGE; try { isFirstRun = mdManager.countUnconfiguredAus(conn) == 0; if (log.isDebug3()) log.debug3(DEBUG_HEADER + STR + isFirstRun); } catch (DbException dbe) { log.error(message, dbe); if (log.isDebug2()) log.debug2(DEBUG_HEADER + "Done."); return; } } Iterator<TdbAu> tdbAuIterator = null; boolean afterFirstIterator = false; int overallConfiguredAuCount = 0; long overallConfiguredAuCountStartTime = 0; if (log.isDebug3()) { overallConfiguredAuCountStartTime = new Date().getTime(); } Configuration config = ConfigManager.newConfiguration(); while (true) { if (log.isDebug3()) log.debug3(DEBUG_HEADER + (tdbAuIterator == null ? STR : STR + tdbAuIterator.hasNext())); if (tdbAuIterator == null !tdbAuIterator.hasNext()) { synchronized (tdbAuIterators) { tdbAuIterator = tdbAuIterators.poll(); exiting = tdbAuIterator == null; } if (log.isDebug3()) log.debug3(DEBUG_HEADER + STR + exiting); if (exiting) { try { subscriptionManager.configureAuBatch(config); } catch (IOException ioe) { log.error(STR + STR + config, ioe); } DbManager.safeRollbackAndClose(conn); if (log.isDebug2()) log.debug2(DEBUG_HEADER + "Done."); return; } if (!isTotalSubscriptionOn && !mustConfigure) { if (afterFirstIterator) { isFirstRun = false; } else { afterFirstIterator = true; } } } long configuredAuCountStartTime = 0; if (log.isDebug3()) { configuredAuCountStartTime = new Date().getTime(); } int configuredAuCount = prepareBatch(tdbAuIterator, conn, isFirstRun, config); if (configuredAuCount == 0) { continue; } try { subscriptionManager.configureAuBatch(config); } catch (IOException ioe) { log.error(STR + STR + config, ioe); } config = ConfigManager.newConfiguration(); long startDelayTime = 0; if (log.isDebug3()) { startDelayTime = new Date().getTime(); } try { if (log.isDebug3()) log.debug3(DEBUG_HEADER + STR); configureAuRateLimiter.waitUntilEventOk(); } catch (InterruptedException ie) { } if (log.isDebug3()) { long currentTime = new Date().getTime(); log.debug3(DEBUG_HEADER + STR + (currentTime - startDelayTime) / 1000.00); log.debug3(DEBUG_HEADER + STR + (configuredAuCount * 60000.0D) / (currentTime - configuredAuCountStartTime)); overallConfiguredAuCount += configuredAuCount; log.debug3(DEBUG_HEADER + STR + overallConfiguredAuCount); log.debug3(DEBUG_HEADER + STR + (overallConfiguredAuCount * 60000.0D) / (currentTime - overallConfiguredAuCountStartTime)); } } } | /**
* Entry point to start the process to handle TdbAus that may need to be
* configured depending on applicable subscriptions.
*/ | Entry point to start the process to handle TdbAus that may need to be configured depending on applicable subscriptions | lockssRun | {
"repo_name": "edina/lockss-daemon",
"path": "src/org/lockss/subscription/SubscriptionStarter.java",
"license": "bsd-3-clause",
"size": 26304
} | [
"java.io.IOException",
"java.sql.Connection",
"java.util.Date",
"java.util.Iterator",
"org.lockss.app.LockssDaemon",
"org.lockss.config.ConfigManager",
"org.lockss.config.Configuration",
"org.lockss.config.TdbAu",
"org.lockss.db.DbException",
"org.lockss.db.DbManager"
] | import java.io.IOException; import java.sql.Connection; import java.util.Date; import java.util.Iterator; import org.lockss.app.LockssDaemon; import org.lockss.config.ConfigManager; import org.lockss.config.Configuration; import org.lockss.config.TdbAu; import org.lockss.db.DbException; import org.lockss.db.DbManager; | import java.io.*; import java.sql.*; import java.util.*; import org.lockss.app.*; import org.lockss.config.*; import org.lockss.db.*; | [
"java.io",
"java.sql",
"java.util",
"org.lockss.app",
"org.lockss.config",
"org.lockss.db"
] | java.io; java.sql; java.util; org.lockss.app; org.lockss.config; org.lockss.db; | 664,924 |
public void setBitCount(int count) {
m_BitCount = count;
m_Discretes = new BitVector(count);
//set correct length, without counting unitid and fc
setDataLength(m_Discretes.byteSize() + 1);
}//setBitCount | void function(int count) { m_BitCount = count; m_Discretes = new BitVector(count); setDataLength(m_Discretes.byteSize() + 1); } | /**
* Sets the number of bits in this response.
*
* @param count the number of response bits as int.
*/ | Sets the number of bits in this response | setBitCount | {
"repo_name": "graham22/Classic",
"path": "j2modlite/src/main/java/ca/farrelltonsolar/j2modlite/msg/ReadInputDiscretesResponse.java",
"license": "apache-2.0",
"size": 5594
} | [
"ca.farrelltonsolar.j2modlite.util.BitVector"
] | import ca.farrelltonsolar.j2modlite.util.BitVector; | import ca.farrelltonsolar.j2modlite.util.*; | [
"ca.farrelltonsolar.j2modlite"
] | ca.farrelltonsolar.j2modlite; | 2,592,509 |
@Test
public void testRingBufferEventHandlerStuckWhenSyncFailed()
throws IOException, InterruptedException {
// A WAL that we can have throw exceptions and slow FSHLog.replaceWriter down
class DodgyFSLog extends FSHLog {
private volatile boolean zigZagCreated = false;
public DodgyFSLog(FileSystem fs, Path root, String logDir, Configuration conf)
throws IOException {
super(fs, root, logDir, conf);
} | void function() throws IOException, InterruptedException { class DodgyFSLog extends FSHLog { private volatile boolean zigZagCreated = false; public DodgyFSLog(FileSystem fs, Path root, String logDir, Configuration conf) throws IOException { super(fs, root, logDir, conf); } | /**
*
* If below is broken, we will see this test timeout because RingBufferEventHandler was stuck in
* attainSafePoint. Everyone will wait for sync to finish forever. See HBASE-14317.
*/ | If below is broken, we will see this test timeout because RingBufferEventHandler was stuck in attainSafePoint. Everyone will wait for sync to finish forever. See HBASE-14317 | testRingBufferEventHandlerStuckWhenSyncFailed | {
"repo_name": "HubSpot/hbase",
"path": "hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALLockup.java",
"license": "apache-2.0",
"size": 19436
} | [
"java.io.IOException",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.hbase.regionserver.wal.FSHLog"
] | import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.regionserver.wal.FSHLog; | import java.io.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hbase.regionserver.wal.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 649,862 |
private void formatAttributeHelp(StringBuffer buffer, ObjectName beanObjectName, String attributeName) {
buffer
.append("\n")
.append("\n---------------------------------------------------------------------------------------\n")
.append(" ATTRIBUTE HELP ")
.append("\n---------------------------------------------------------------------------------------\n")
.append("MBean Name : ").append(beanObjectName.getCanonicalName()).append("\n")
.append("Name : ").append(attributeName).append("\n")
.append("Value : ").append(getAttributeValue(beanObjectName, attributeName)).append("\n")
.append("Type : ").append(storage.getBeanAttributes().get(attributeName).get(storage.CLASS_NAME)).append("\n")
.append("Is Readable : ").append(storage.getBeanAttributes().get(attributeName).get(storage.READABLE)).append("\n")
.append("Is Writable : ").append(storage.getBeanAttributes().get(attributeName).get(storage.WRITEABLE)).append("\n")
.append("Is Boolean : ").append(storage.getBeanAttributes().get(attributeName).get(storage.IS_GETTER)).append("\n")
.append("Description : ").append(storage.getBeanAttributes().get(attributeName).get(storage.DESCRIPTION)).append("\n")
.append("---------------------------------------------------------------------------------------\n");
} | void function(StringBuffer buffer, ObjectName beanObjectName, String attributeName) { buffer .append("\n") .append(STR) .append(STR) .append(STR) .append(STR).append(beanObjectName.getCanonicalName()).append("\n") .append(STR).append(attributeName).append("\n") .append(STR).append(getAttributeValue(beanObjectName, attributeName)).append("\n") .append(STR).append(storage.getBeanAttributes().get(attributeName).get(storage.CLASS_NAME)).append("\n") .append(STR).append(storage.getBeanAttributes().get(attributeName).get(storage.READABLE)).append("\n") .append(STR).append(storage.getBeanAttributes().get(attributeName).get(storage.WRITEABLE)).append("\n") .append(STR).append(storage.getBeanAttributes().get(attributeName).get(storage.IS_GETTER)).append("\n") .append(STR).append(storage.getBeanAttributes().get(attributeName).get(storage.DESCRIPTION)).append("\n") .append(STR); } | /**
* Format attribute help.
*
* @param buffer the buffer
* @param beanObjectName the bean object name
* @param attributeName the attribute name
*/ | Format attribute help | formatAttributeHelp | {
"repo_name": "sohailalam2/GenericMBeanCLI",
"path": "src/com/sohail/alam/generic/mbean/cli/jmx/DefaultAttributeHelper.java",
"license": "apache-2.0",
"size": 29533
} | [
"javax.management.ObjectName"
] | import javax.management.ObjectName; | import javax.management.*; | [
"javax.management"
] | javax.management; | 796,642 |
public static UnitElement createProcessingUnit(
final NodeDescription unitDescription,
final Point origin) {
return createProcessingUnit(unitDescription, origin, null);
}
| static UnitElement function( final NodeDescription unitDescription, final Point origin) { return createProcessingUnit(unitDescription, origin, null); } | /**
* Creates a {@link UnitElement} based on the given Descriptions.
* @param unitDescription
* @param origin
* @return
*/ | Creates a <code>UnitElement</code> based on the given Descriptions | createProcessingUnit | {
"repo_name": "Dahie/imageflow",
"path": "src/de/danielsenff/imageflow/models/unit/UnitFactory.java",
"license": "gpl-2.0",
"size": 9833
} | [
"de.danielsenff.imageflow.models.delegates.NodeDescription",
"java.awt.Point"
] | import de.danielsenff.imageflow.models.delegates.NodeDescription; import java.awt.Point; | import de.danielsenff.imageflow.models.delegates.*; import java.awt.*; | [
"de.danielsenff.imageflow",
"java.awt"
] | de.danielsenff.imageflow; java.awt; | 742,261 |
EClass getNestedDotID(); | EClass getNestedDotID(); | /**
* Returns the meta object for class '{@link com.rockwellcollins.atc.agree.agree.NestedDotID <em>Nested Dot ID</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Nested Dot ID</em>'.
* @see com.rockwellcollins.atc.agree.agree.NestedDotID
* @generated
*/ | Returns the meta object for class '<code>com.rockwellcollins.atc.agree.agree.NestedDotID Nested Dot ID</code>'. | getNestedDotID | {
"repo_name": "smaccm/smaccm",
"path": "fm-workbench/agree/com.rockwellcollins.atc.agree/src-gen/com/rockwellcollins/atc/agree/agree/AgreePackage.java",
"license": "bsd-3-clause",
"size": 292940
} | [
"org.eclipse.emf.ecore.EClass"
] | import org.eclipse.emf.ecore.EClass; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,185,846 |
public INode saveChild2Snapshot(final INode child, final int latestSnapshotId,
final INode snapshotCopy) {
if (latestSnapshotId == Snapshot.CURRENT_STATE_ID) {
return child;
}
// add snapshot feature if necessary
DirectoryWithSnapshotFeature sf = getDirectoryWithSnapshotFeature();
if (sf == null) {
sf = this.addSnapshotFeature(null);
}
return sf.saveChild2Snapshot(this, child, latestSnapshotId, snapshotCopy);
} | INode function(final INode child, final int latestSnapshotId, final INode snapshotCopy) { if (latestSnapshotId == Snapshot.CURRENT_STATE_ID) { return child; } DirectoryWithSnapshotFeature sf = getDirectoryWithSnapshotFeature(); if (sf == null) { sf = this.addSnapshotFeature(null); } return sf.saveChild2Snapshot(this, child, latestSnapshotId, snapshotCopy); } | /**
* Save the child to the latest snapshot.
*
* @return the child inode, which may be replaced.
*/ | Save the child to the latest snapshot | saveChild2Snapshot | {
"repo_name": "JingchengDu/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeDirectory.java",
"license": "apache-2.0",
"size": 36327
} | [
"org.apache.hadoop.hdfs.server.namenode.snapshot.DirectoryWithSnapshotFeature",
"org.apache.hadoop.hdfs.server.namenode.snapshot.Snapshot"
] | import org.apache.hadoop.hdfs.server.namenode.snapshot.DirectoryWithSnapshotFeature; import org.apache.hadoop.hdfs.server.namenode.snapshot.Snapshot; | import org.apache.hadoop.hdfs.server.namenode.snapshot.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 1,256,226 |
public void post(String methodName, Object[] args, Class<?>[] argType,
int position)
{
Message msg = new Message(client, methodName, args, argType);
messages.add(position, msg);
DebugManager.print(ClientSocketHandler.GetTag() + "Debug info MailBox = "
+ messages.size() + "/" + position,
WifiDirectManager.DEBUGGER_CHANNEL);
if (_sendFirstMessageWhenPosted && messages.size() == 1)
{
_sendFirstMessageWhenPosted = false;
send();
}
} | void function(String methodName, Object[] args, Class<?>[] argType, int position) { Message msg = new Message(client, methodName, args, argType); messages.add(position, msg); DebugManager.print(ClientSocketHandler.GetTag() + STR + messages.size() + "/" + position, WifiDirectManager.DEBUGGER_CHANNEL); if (_sendFirstMessageWhenPosted && messages.size() == 1) { _sendFirstMessageWhenPosted = false; send(); } } | /**
* post a message (@see Message)
*
* @param methodName
* the method to call from the class ClientSocketHandler
* @param args
* argument of the method
* @param argType
* class type of the arguments "args"
* @param position
* position in the sending order. The closer to zero, the sooner
* to be send.
*/ | post a message (@see Message) | post | {
"repo_name": "ludomuse/Ludomuse",
"path": "proj.android/src/org/cocos2dx/cpp/sockets/MailBox.java",
"license": "agpl-3.0",
"size": 5361
} | [
"org.cocos2dx.cpp.DebugManager",
"org.cocos2dx.cpp.wifiDirect.WifiDirectManager"
] | import org.cocos2dx.cpp.DebugManager; import org.cocos2dx.cpp.wifiDirect.WifiDirectManager; | import org.cocos2dx.cpp.*; | [
"org.cocos2dx.cpp"
] | org.cocos2dx.cpp; | 1,971,947 |
@Override
public OdfName getOdfName() {
return ATTRIBUTE_NAME;
} | OdfName function() { return ATTRIBUTE_NAME; } | /**
* Returns the attribute name.
*
* @return the <code>OdfName</code> for {@odf.attribute table:start-column}.
*/ | Returns the attribute name | getOdfName | {
"repo_name": "jbjonesjr/geoproponis",
"path": "external/odfdom-java-0.8.10-incubating-sources/org/odftoolkit/odfdom/dom/attribute/table/TableStartColumnAttribute.java",
"license": "gpl-2.0",
"size": 3431
} | [
"org.odftoolkit.odfdom.pkg.OdfName"
] | import org.odftoolkit.odfdom.pkg.OdfName; | import org.odftoolkit.odfdom.pkg.*; | [
"org.odftoolkit.odfdom"
] | org.odftoolkit.odfdom; | 207,422 |
private void initializeConflationThreadPool() {
final LoggingThreadGroup loggingThreadGroup =
LoggingThreadGroup.createThreadGroup("WAN Queue Conflation Logger Group", logger); | void function() { final LoggingThreadGroup loggingThreadGroup = LoggingThreadGroup.createThreadGroup(STR, logger); | /**
* Initialize the thread pool, setting the number of threads that is equal to the number of
* processors available to the JVM.
*/ | Initialize the thread pool, setting the number of threads that is equal to the number of processors available to the JVM | initializeConflationThreadPool | {
"repo_name": "smanvi-pivotal/geode",
"path": "geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java",
"license": "apache-2.0",
"size": 68361
} | [
"org.apache.geode.internal.logging.LoggingThreadGroup"
] | import org.apache.geode.internal.logging.LoggingThreadGroup; | import org.apache.geode.internal.logging.*; | [
"org.apache.geode"
] | org.apache.geode; | 2,847,822 |
public void setItemFrame(EntityItemFrame p_82842_1_)
{
this.itemFrame = p_82842_1_;
} | void function(EntityItemFrame p_82842_1_) { this.itemFrame = p_82842_1_; } | /**
* Set the item frame this stack is on.
*/ | Set the item frame this stack is on | setItemFrame | {
"repo_name": "TheHecticByte/BananaJ1.7.10Beta",
"path": "src/net/minecraft/Server1_7_10/item/ItemStack.java",
"license": "gpl-3.0",
"size": 22181
} | [
"net.minecraft.Server1_7_10"
] | import net.minecraft.Server1_7_10; | import net.minecraft.*; | [
"net.minecraft"
] | net.minecraft; | 1,592,787 |
public static void main(String argv[]) {
StringUtils.startupShutdownMessage(HourGlass.class, argv, LOG);
try {
HourGlass hourGlass = new HourGlass(new Configuration());
hourGlass.run();
} catch (Throwable e) {
LOG.fatal(StringUtils.stringifyException(e));
System.exit(-1);
}
} | static void function(String argv[]) { StringUtils.startupShutdownMessage(HourGlass.class, argv, LOG); try { HourGlass hourGlass = new HourGlass(new Configuration()); hourGlass.run(); } catch (Throwable e) { LOG.fatal(StringUtils.stringifyException(e)); System.exit(-1); } } | /**
* Start the HourGlass process
*/ | Start the HourGlass process | main | {
"repo_name": "jchen123/hadoop-20-warehouse-fix",
"path": "src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/HourGlass.java",
"license": "apache-2.0",
"size": 16237
} | [
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.util.StringUtils"
] | import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.util.StringUtils; | import org.apache.hadoop.conf.*; import org.apache.hadoop.util.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 2,605,375 |
public JsonWriter nullValue() throws IOException {
if (deferredName != null) {
if (serializeNulls) {
writeDeferredName();
} else {
deferredName = null;
return this; // skip the name and the value
}
}
beforeValue(false);
out.write("null");
return this;
} | JsonWriter function() throws IOException { if (deferredName != null) { if (serializeNulls) { writeDeferredName(); } else { deferredName = null; return this; } } beforeValue(false); out.write("null"); return this; } | /**
* Encodes {@code null}.
*
* @return this writer.
*/ | Encodes null | nullValue | {
"repo_name": "freefair/advanced-bugsnag-android",
"path": "src/main/java/com/bugsnag/android/JsonWriter.java",
"license": "mit",
"size": 19644
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,787,536 |
List<RichMember> findRichMembersWithAttributes(PerunSession sess, String searchString) throws InternalErrorException; | List<RichMember> findRichMembersWithAttributes(PerunSession sess, String searchString) throws InternalErrorException; | /**
* Return list of rich members with attributes by theirs name or login or email
* @param sess
* @param searchString
* @return list of rich members with attributes
* @throws InternalErrorException
*/ | Return list of rich members with attributes by theirs name or login or email | findRichMembersWithAttributes | {
"repo_name": "stavamichal/perun",
"path": "perun-core/src/main/java/cz/metacentrum/perun/core/bl/MembersManagerBl.java",
"license": "bsd-2-clause",
"size": 66169
} | [
"cz.metacentrum.perun.core.api.PerunSession",
"cz.metacentrum.perun.core.api.RichMember",
"cz.metacentrum.perun.core.api.exceptions.InternalErrorException",
"java.util.List"
] | import cz.metacentrum.perun.core.api.PerunSession; import cz.metacentrum.perun.core.api.RichMember; import cz.metacentrum.perun.core.api.exceptions.InternalErrorException; import java.util.List; | import cz.metacentrum.perun.core.api.*; import cz.metacentrum.perun.core.api.exceptions.*; import java.util.*; | [
"cz.metacentrum.perun",
"java.util"
] | cz.metacentrum.perun; java.util; | 1,842,859 |
public void transform(PortletBridgeMemento memento, PerPortletMemento perPortletMemento, URI currentUrl,
RenderRequest request, RenderResponse response,
Reader in) throws ResourceException {
try {
PortletPreferences preferences = request.getPreferences();
String stylesheet = preferences.getValue("stylesheet", null);
String stylesheetUrl = preferences.getValue("stylesheetUrl", null);
Templates templates = null;
if(stylesheetUrl != null) {
templates = templateFactory.getTemplatesFromUrl(stylesheetUrl);
} else {
templates = templateFactory.getTemplatesFromString(stylesheet);
}
SerializerFactory factory = SerializerFactory
.getSerializerFactory("html");
OutputFormat outputFormat = new OutputFormat();
outputFormat.setPreserveSpace(true);
outputFormat.setOmitDocumentType(true);
outputFormat.setOmitXMLDeclaration(true);
Serializer writer = factory.makeSerializer(outputFormat);
PrintWriter responseWriter = response.getWriter();
writer.setOutputCharStream(responseWriter);
XslFilter filter = new XslFilter(templates);
Map context = new HashMap();
context.put("bridge", bridgeFunctionsFactory.createBridgeFunctions(memento, perPortletMemento, servletName,
currentUrl, request, response));
filter.setContext(context);
filter.setParent(parser);
filter.setContentHandler(writer.asContentHandler());
InputSource inputSource = new InputSource(in);
filter.parse(inputSource);
} catch (TransformerConfigurationException e) {
throw new ResourceException("error.transformer", e
.getLocalizedMessage(), e);
} catch (SAXException e) {
throw new ResourceException("error.filter.sax", e
.getLocalizedMessage(), e);
} catch (IOException e) {
throw new ResourceException("error.filter.io", e
.getLocalizedMessage(), e);
}
} | void function(PortletBridgeMemento memento, PerPortletMemento perPortletMemento, URI currentUrl, RenderRequest request, RenderResponse response, Reader in) throws ResourceException { try { PortletPreferences preferences = request.getPreferences(); String stylesheet = preferences.getValue(STR, null); String stylesheetUrl = preferences.getValue(STR, null); Templates templates = null; if(stylesheetUrl != null) { templates = templateFactory.getTemplatesFromUrl(stylesheetUrl); } else { templates = templateFactory.getTemplatesFromString(stylesheet); } SerializerFactory factory = SerializerFactory .getSerializerFactory("html"); OutputFormat outputFormat = new OutputFormat(); outputFormat.setPreserveSpace(true); outputFormat.setOmitDocumentType(true); outputFormat.setOmitXMLDeclaration(true); Serializer writer = factory.makeSerializer(outputFormat); PrintWriter responseWriter = response.getWriter(); writer.setOutputCharStream(responseWriter); XslFilter filter = new XslFilter(templates); Map context = new HashMap(); context.put(STR, bridgeFunctionsFactory.createBridgeFunctions(memento, perPortletMemento, servletName, currentUrl, request, response)); filter.setContext(context); filter.setParent(parser); filter.setContentHandler(writer.asContentHandler()); InputSource inputSource = new InputSource(in); filter.parse(inputSource); } catch (TransformerConfigurationException e) { throw new ResourceException(STR, e .getLocalizedMessage(), e); } catch (SAXException e) { throw new ResourceException(STR, e .getLocalizedMessage(), e); } catch (IOException e) { throw new ResourceException(STR, e .getLocalizedMessage(), e); } } | /**
* Transforms the HTML from a downstream site using a configured XSL
* stylesheet.
*
* @param request
* the render request
* @param response
* the render response
* @param in
* the http result from calling the downstream site.
* @throws ResourceException
* if there was a problem doing the transform (e.g. if the
* stylesheet throws an error).
*/ | Transforms the HTML from a downstream site using a configured XSL stylesheet | transform | {
"repo_name": "jamiemccrindle/portletbridge",
"path": "portletbridge-core/src/main/java/org/portletbridge/portlet/DefaultBridgeTransformer.java",
"license": "apache-2.0",
"size": 4966
} | [
"java.io.IOException",
"java.io.PrintWriter",
"java.io.Reader",
"java.util.HashMap",
"java.util.Map",
"javax.portlet.PortletPreferences",
"javax.portlet.RenderRequest",
"javax.portlet.RenderResponse",
"javax.xml.transform.Templates",
"javax.xml.transform.TransformerConfigurationException",
"org.apache.xml.serialize.OutputFormat",
"org.apache.xml.serialize.Serializer",
"org.apache.xml.serialize.SerializerFactory",
"org.portletbridge.ResourceException",
"org.portletbridge.xsl.XslFilter",
"org.xml.sax.InputSource",
"org.xml.sax.SAXException"
] | import java.io.IOException; import java.io.PrintWriter; import java.io.Reader; import java.util.HashMap; import java.util.Map; import javax.portlet.PortletPreferences; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; import javax.xml.transform.Templates; import javax.xml.transform.TransformerConfigurationException; import org.apache.xml.serialize.OutputFormat; import org.apache.xml.serialize.Serializer; import org.apache.xml.serialize.SerializerFactory; import org.portletbridge.ResourceException; import org.portletbridge.xsl.XslFilter; import org.xml.sax.InputSource; import org.xml.sax.SAXException; | import java.io.*; import java.util.*; import javax.portlet.*; import javax.xml.transform.*; import org.apache.xml.serialize.*; import org.portletbridge.*; import org.portletbridge.xsl.*; import org.xml.sax.*; | [
"java.io",
"java.util",
"javax.portlet",
"javax.xml",
"org.apache.xml",
"org.portletbridge",
"org.portletbridge.xsl",
"org.xml.sax"
] | java.io; java.util; javax.portlet; javax.xml; org.apache.xml; org.portletbridge; org.portletbridge.xsl; org.xml.sax; | 1,133,042 |
@Override
public boolean removeJob(JobKey jobKey) throws JobPersistenceException {
boolean found = false;
lock();
try {
List<OperableTrigger> trigger = getTriggersForJob(jobKey);
for (OperableTrigger trig : trigger) {
this.removeTrigger(trig.getKey());
found = true;
}
found = (jobFacade.remove(jobKey) != null) | found;
if (found) {
Set<String> grpSet = toolkitDSHolder.getOrCreateJobsGroupMap(jobKey.getGroup());
grpSet.remove(jobKey.getName());
if (grpSet.isEmpty()) {
toolkitDSHolder.removeJobsGroupMap(jobKey.getGroup());
jobFacade.removeGroup(jobKey.getGroup());
}
}
} finally {
unlock();
}
return found;
} | boolean function(JobKey jobKey) throws JobPersistenceException { boolean found = false; lock(); try { List<OperableTrigger> trigger = getTriggersForJob(jobKey); for (OperableTrigger trig : trigger) { this.removeTrigger(trig.getKey()); found = true; } found = (jobFacade.remove(jobKey) != null) found; if (found) { Set<String> grpSet = toolkitDSHolder.getOrCreateJobsGroupMap(jobKey.getGroup()); grpSet.remove(jobKey.getName()); if (grpSet.isEmpty()) { toolkitDSHolder.removeJobsGroupMap(jobKey.getGroup()); jobFacade.removeGroup(jobKey.getGroup()); } } } finally { unlock(); } return found; } | /**
* <p>
* Remove (delete) the <code>{@link org.quartz.Job}</code> with the given name, and any
* <code>{@link org.quartz.Trigger}</code> s that reference it.
* </p>
*
* @param jobKey The key of the <code>Job</code> to be removed.
* @return <code>true</code> if a <code>Job</code> with the given name & group was found and removed from the store.
*/ | Remove (delete) the <code><code>org.quartz.Job</code></code> with the given name, and any <code><code>org.quartz.Trigger</code></code> s that reference it. | removeJob | {
"repo_name": "suthat/signal",
"path": "vendor/quartz-2.2.0/src/org/terracotta/quartz/DefaultClusteredJobStore.java",
"license": "apache-2.0",
"size": 64329
} | [
"java.util.List",
"java.util.Set",
"org.quartz.JobKey",
"org.quartz.JobPersistenceException",
"org.quartz.spi.OperableTrigger"
] | import java.util.List; import java.util.Set; import org.quartz.JobKey; import org.quartz.JobPersistenceException; import org.quartz.spi.OperableTrigger; | import java.util.*; import org.quartz.*; import org.quartz.spi.*; | [
"java.util",
"org.quartz",
"org.quartz.spi"
] | java.util; org.quartz; org.quartz.spi; | 2,580,562 |
public AuthToken getToken() {
return caller.getToken();
} | AuthToken function() { return caller.getToken(); } | /** Get the token this client uses to communicate with the server.
* @return the authorization token.
*/ | Get the token this client uses to communicate with the server | getToken | {
"repo_name": "aekazakov/GrowthDataUtils",
"path": "lib/src/growthdatautils/GrowthDataUtilsClient.java",
"license": "mit",
"size": 5898
} | [
"us.kbase.auth.AuthToken"
] | import us.kbase.auth.AuthToken; | import us.kbase.auth.*; | [
"us.kbase.auth"
] | us.kbase.auth; | 974,033 |
public ProcedimentoBuilder setEspecificacao(String value) {
procedimento.setEspecificacao(SEIUtil.truncate(value, 100));
return this;
} | ProcedimentoBuilder function(String value) { procedimento.setEspecificacao(SEIUtil.truncate(value, 100)); return this; } | /**
* Atualiza o novo valor de especificacao, limitando seu tamanho a 100 caracteres
*
* @param value o(a) value.
* @return o valor de procedimento builder
*/ | Atualiza o novo valor de especificacao, limitando seu tamanho a 100 caracteres | setEspecificacao | {
"repo_name": "opensingular/singular-server",
"path": "requirement/requirement-sei-31-connector/src/main/java/org/opensingular/requirement/connector/sei31/builder/ProcedimentoBuilder.java",
"license": "apache-2.0",
"size": 5306
} | [
"org.opensingular.requirement.connector.sei31.util.SEIUtil"
] | import org.opensingular.requirement.connector.sei31.util.SEIUtil; | import org.opensingular.requirement.connector.sei31.util.*; | [
"org.opensingular.requirement"
] | org.opensingular.requirement; | 2,843,131 |
public static Splitter on(final String separator) {
checkArgument(separator.length() != 0,
"The separator may not be the empty string."); | static Splitter function(final String separator) { checkArgument(separator.length() != 0, STR); | /**
* Returns a splitter that uses the given fixed string as a separator. For
* example, {@code Splitter.on(", ").split("foo, bar, baz,qux")} returns an
* iterable containing {@code ["foo", "bar", "baz,qux"]}.
*
* @param separator the literal, nonempty string to recognize as a separator
* @return a splitter, with default settings, that recognizes that separator
*/ | Returns a splitter that uses the given fixed string as a separator. For example, Splitter.on(", ").split("foo, bar, baz,qux") returns an iterable containing ["foo", "bar", "baz,qux"] | on | {
"repo_name": "mkeesey/guava-for-small-classpaths",
"path": "guava/src/com/google/common/base/Splitter.java",
"license": "apache-2.0",
"size": 21448
} | [
"com.google.common.base.Preconditions"
] | import com.google.common.base.Preconditions; | import com.google.common.base.*; | [
"com.google.common"
] | com.google.common; | 2,757,521 |
@Override
public void updateTime(String columnLabel, Time x) throws SQLException {
throw new BQSQLFeatureNotSupportedException();
} | void function(String columnLabel, Time x) throws SQLException { throw new BQSQLFeatureNotSupportedException(); } | /**
* <p>
* <h1>Implementation Details:</h1><br>
* Throws BQSQLFeatureNotSupportedException
* </p>
*
* @throws BQSQLFeatureNotSupportedException
*/ | Implementation Details: Throws BQSQLFeatureNotSupportedException | updateTime | {
"repo_name": "jonathanswenson/starschema-bigquery-jdbc",
"path": "src/main/java/net/starschema/clouddb/jdbc/ScrollableResultset.java",
"license": "bsd-2-clause",
"size": 73793
} | [
"java.sql.SQLException",
"java.sql.Time"
] | import java.sql.SQLException; import java.sql.Time; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,020,376 |
private void testAddOnPartition(final ResultPartitionType partitionType) throws Exception {
ResultPartitionConsumableNotifier notifier = mock(ResultPartitionConsumableNotifier.class);
JobID jobId = new JobID();
TaskActions taskActions = new NoOpTaskActions();
ResultPartitionWriter consumableNotifyingPartitionWriter = createConsumableNotifyingResultPartitionWriter(
partitionType,
taskActions,
jobId,
notifier);
BufferConsumer bufferConsumer = createFilledFinishedBufferConsumer(BufferBuilderTestUtils.BUFFER_SIZE);
try {
// partition.add() adds the bufferConsumer without recycling it (if not spilling)
consumableNotifyingPartitionWriter.addBufferConsumer(bufferConsumer, 0);
assertFalse("bufferConsumer should not be recycled (still in the queue)", bufferConsumer.isRecycled());
} finally {
if (!bufferConsumer.isRecycled()) {
bufferConsumer.close();
}
// should have been notified for pipelined partitions
if (partitionType.isPipelined()) {
verify(notifier, times(1))
.notifyPartitionConsumable(eq(jobId), eq(consumableNotifyingPartitionWriter.getPartitionId()), eq(taskActions));
}
}
} | void function(final ResultPartitionType partitionType) throws Exception { ResultPartitionConsumableNotifier notifier = mock(ResultPartitionConsumableNotifier.class); JobID jobId = new JobID(); TaskActions taskActions = new NoOpTaskActions(); ResultPartitionWriter consumableNotifyingPartitionWriter = createConsumableNotifyingResultPartitionWriter( partitionType, taskActions, jobId, notifier); BufferConsumer bufferConsumer = createFilledFinishedBufferConsumer(BufferBuilderTestUtils.BUFFER_SIZE); try { consumableNotifyingPartitionWriter.addBufferConsumer(bufferConsumer, 0); assertFalse(STR, bufferConsumer.isRecycled()); } finally { if (!bufferConsumer.isRecycled()) { bufferConsumer.close(); } if (partitionType.isPipelined()) { verify(notifier, times(1)) .notifyPartitionConsumable(eq(jobId), eq(consumableNotifyingPartitionWriter.getPartitionId()), eq(taskActions)); } } } | /**
* Tests {@link ResultPartition#addBufferConsumer(BufferConsumer, int)} on a working partition.
*
* @param partitionType the result partition type to set up
*/ | Tests <code>ResultPartition#addBufferConsumer(BufferConsumer, int)</code> on a working partition | testAddOnPartition | {
"repo_name": "gyfora/flink",
"path": "flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/ResultPartitionTest.java",
"license": "apache-2.0",
"size": 15340
} | [
"org.apache.flink.api.common.JobID",
"org.apache.flink.runtime.io.network.api.writer.ResultPartitionWriter",
"org.apache.flink.runtime.io.network.buffer.BufferBuilderTestUtils",
"org.apache.flink.runtime.io.network.buffer.BufferConsumer",
"org.apache.flink.runtime.taskmanager.NoOpTaskActions",
"org.apache.flink.runtime.taskmanager.TaskActions",
"org.junit.Assert",
"org.mockito.Matchers",
"org.mockito.Mockito"
] | import org.apache.flink.api.common.JobID; import org.apache.flink.runtime.io.network.api.writer.ResultPartitionWriter; import org.apache.flink.runtime.io.network.buffer.BufferBuilderTestUtils; import org.apache.flink.runtime.io.network.buffer.BufferConsumer; import org.apache.flink.runtime.taskmanager.NoOpTaskActions; import org.apache.flink.runtime.taskmanager.TaskActions; import org.junit.Assert; import org.mockito.Matchers; import org.mockito.Mockito; | import org.apache.flink.api.common.*; import org.apache.flink.runtime.io.network.api.writer.*; import org.apache.flink.runtime.io.network.buffer.*; import org.apache.flink.runtime.taskmanager.*; import org.junit.*; import org.mockito.*; | [
"org.apache.flink",
"org.junit",
"org.mockito"
] | org.apache.flink; org.junit; org.mockito; | 849,976 |
@RequestMapping(value = "letter", method = RequestMethod.POST)
@ResponseStatus(HttpStatus.OK)
@ResponseBody
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public Letter create(@RequestBody Letter letter) throws OPMException {
String signature = CLASS_NAME + "#create(Letter letter)";
Logger logger = getLogger();
LoggingHelper.logEntrance(logger, signature,
new String[] {"letter"},
new Object[] {letter});
Letter result = letterService.create(letter);
LoggingHelper.logExit(logger, signature, new Object[] {result});
return result;
} | @RequestMapping(value = STR, method = RequestMethod.POST) @ResponseStatus(HttpStatus.OK) @TransactionAttribute(TransactionAttributeType.REQUIRED) Letter function(@RequestBody Letter letter) throws OPMException { String signature = CLASS_NAME + STR; Logger logger = getLogger(); LoggingHelper.logEntrance(logger, signature, new String[] {STR}, new Object[] {letter}); Letter result = letterService.create(letter); LoggingHelper.logExit(logger, signature, new Object[] {result}); return result; } | /**
* Creates a letter.
* @param letter the letter to create.
* @throws OPMException if there are any error.
*/ | Creates a letter | create | {
"repo_name": "NASA-Tournament-Lab/CoECI-OPM-Service-Credit-Redeposit-Deposit-Application",
"path": "Code/SCRD_BRE/src/java/web/gov/opm/scrd/web/controllers/LetterController.java",
"license": "apache-2.0",
"size": 5840
} | [
"gov.opm.scrd.LoggingHelper",
"gov.opm.scrd.entities.application.Letter",
"gov.opm.scrd.services.OPMException",
"javax.ejb.TransactionAttribute",
"javax.ejb.TransactionAttributeType",
"org.jboss.logging.Logger",
"org.springframework.http.HttpStatus",
"org.springframework.web.bind.annotation.RequestBody",
"org.springframework.web.bind.annotation.RequestMapping",
"org.springframework.web.bind.annotation.RequestMethod",
"org.springframework.web.bind.annotation.ResponseStatus"
] | import gov.opm.scrd.LoggingHelper; import gov.opm.scrd.entities.application.Letter; import gov.opm.scrd.services.OPMException; import javax.ejb.TransactionAttribute; import javax.ejb.TransactionAttributeType; import org.jboss.logging.Logger; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseStatus; | import gov.opm.scrd.*; import gov.opm.scrd.entities.application.*; import gov.opm.scrd.services.*; import javax.ejb.*; import org.jboss.logging.*; import org.springframework.http.*; import org.springframework.web.bind.annotation.*; | [
"gov.opm.scrd",
"javax.ejb",
"org.jboss.logging",
"org.springframework.http",
"org.springframework.web"
] | gov.opm.scrd; javax.ejb; org.jboss.logging; org.springframework.http; org.springframework.web; | 1,973,944 |
protected Node exitSnmpSyntaxPart(Production node)
throws ParseException {
return node;
} | Node function(Production node) throws ParseException { return node; } | /**
* Called when exiting a parse tree node.
*
* @param node the node being exited
*
* @return the node to add to the parse tree, or
* null if no parse tree should be created
*
* @throws ParseException if the node analysis discovered errors
*/ | Called when exiting a parse tree node | exitSnmpSyntaxPart | {
"repo_name": "richb-hanover/mibble-2.9.2",
"path": "src/java/net/percederberg/mibble/asn1/Asn1Analyzer.java",
"license": "gpl-2.0",
"size": 275483
} | [
"net.percederberg.grammatica.parser.Node",
"net.percederberg.grammatica.parser.ParseException",
"net.percederberg.grammatica.parser.Production"
] | import net.percederberg.grammatica.parser.Node; import net.percederberg.grammatica.parser.ParseException; import net.percederberg.grammatica.parser.Production; | import net.percederberg.grammatica.parser.*; | [
"net.percederberg.grammatica"
] | net.percederberg.grammatica; | 447,817 |
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<ContainersRenameResponse> renameWithResponseAsync(
String containerName,
String sourceContainerName,
Integer timeout,
String requestId,
String sourceLeaseId,
Context context) {
final String restype = "container";
final String comp = "rename";
final String accept = "application/xml";
return service.rename(
this.client.getUrl(),
containerName,
restype,
comp,
timeout,
this.client.getVersion(),
requestId,
sourceContainerName,
sourceLeaseId,
accept,
context);
} | @ServiceMethod(returns = ReturnType.SINGLE) Mono<ContainersRenameResponse> function( String containerName, String sourceContainerName, Integer timeout, String requestId, String sourceLeaseId, Context context) { final String restype = STR; final String comp = STR; final String accept = STR; return service.rename( this.client.getUrl(), containerName, restype, comp, timeout, this.client.getVersion(), requestId, sourceContainerName, sourceLeaseId, accept, context); } | /**
* Renames an existing container.
*
* @param containerName The container name.
* @param sourceContainerName Required. Specifies the name of the container to rename.
* @param timeout The timeout parameter is expressed in seconds. For more information, see <a
* href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
* Timeouts for Blob Service Operations.</a>.
* @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the
* analytics logs when storage analytics logging is enabled.
* @param sourceLeaseId A lease ID for the source path. If specified, the source path must have an active lease and
* the lease ID must match.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws BlobStorageException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the completion.
*/ | Renames an existing container | renameWithResponseAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ContainersImpl.java",
"license": "mit",
"size": 69007
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.util.Context",
"com.azure.storage.blob.implementation.models.ContainersRenameResponse"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.util.Context; import com.azure.storage.blob.implementation.models.ContainersRenameResponse; | import com.azure.core.annotation.*; import com.azure.core.util.*; import com.azure.storage.blob.implementation.models.*; | [
"com.azure.core",
"com.azure.storage"
] | com.azure.core; com.azure.storage; | 1,743,603 |
private static boolean hasResponseBody(int requestMethod, int responseCode) {
return requestMethod != Request.Method.HEAD &&
!(HttpStatus.SC_CONTINUE <= responseCode && responseCode < HttpStatus.SC_OK) &&
responseCode != HttpStatus.SC_NO_CONTENT &&
responseCode != HttpStatus.SC_NOT_MODIFIED;
} | static boolean function(int requestMethod, int responseCode) { return requestMethod != Request.Method.HEAD && !(HttpStatus.SC_CONTINUE <= responseCode && responseCode < HttpStatus.SC_OK) && responseCode != HttpStatus.SC_NO_CONTENT && responseCode != HttpStatus.SC_NOT_MODIFIED; } | /**
* Checks if a response message contains a body.
*
* @param requestMethod request method
* @param responseCode response status code
* @return whether the response has a body
* @see <a href="https://tools.ietf.org/html/rfc7230#section-3.3">RFC 7230 section 3.3</a>
*/ | Checks if a response message contains a body | hasResponseBody | {
"repo_name": "CaMnter/AndroidLife",
"path": "volley/src/main/java/com/android/volley/toolbox/HurlStack.java",
"license": "apache-2.0",
"size": 17572
} | [
"com.android.volley.Request",
"org.apache.http.HttpStatus"
] | import com.android.volley.Request; import org.apache.http.HttpStatus; | import com.android.volley.*; import org.apache.http.*; | [
"com.android.volley",
"org.apache.http"
] | com.android.volley; org.apache.http; | 633,620 |
static void setupChildMapredLocalDirs(Task t, JobConf conf) {
String[] localDirs = conf.getTrimmedStrings(JobConf.MAPRED_LOCAL_DIR_PROPERTY);
String jobId = t.getJobID().toString();
String taskId = t.getTaskID().toString();
boolean isCleanup = t.isTaskCleanupTask();
String user = t.getUser();
StringBuffer childMapredLocalDir =
new StringBuffer(localDirs[0] + Path.SEPARATOR
+ TaskTracker.getLocalTaskDir(user, jobId, taskId, isCleanup));
for (int i = 1; i < localDirs.length; i++) {
childMapredLocalDir.append("," + localDirs[i] + Path.SEPARATOR
+ TaskTracker.getLocalTaskDir(user, jobId, taskId, isCleanup));
}
LOG.debug("mapred.local.dir for child : " + childMapredLocalDir);
conf.set("mapred.local.dir", childMapredLocalDir.toString());
} | static void setupChildMapredLocalDirs(Task t, JobConf conf) { String[] localDirs = conf.getTrimmedStrings(JobConf.MAPRED_LOCAL_DIR_PROPERTY); String jobId = t.getJobID().toString(); String taskId = t.getTaskID().toString(); boolean isCleanup = t.isTaskCleanupTask(); String user = t.getUser(); StringBuffer childMapredLocalDir = new StringBuffer(localDirs[0] + Path.SEPARATOR + TaskTracker.getLocalTaskDir(user, jobId, taskId, isCleanup)); for (int i = 1; i < localDirs.length; i++) { childMapredLocalDir.append("," + localDirs[i] + Path.SEPARATOR + TaskTracker.getLocalTaskDir(user, jobId, taskId, isCleanup)); } LOG.debug(STR + childMapredLocalDir); conf.set(STR, childMapredLocalDir.toString()); } | /**
* Prepare the mapred.local.dir for the child. The child is sand-boxed now.
* Whenever it uses LocalDirAllocator from now on inside the child, it will
* only see files inside the attempt-directory. This is done in the Child's
* process space.
*/ | Prepare the mapred.local.dir for the child. The child is sand-boxed now. Whenever it uses LocalDirAllocator from now on inside the child, it will only see files inside the attempt-directory. This is done in the Child's process space | setupChildMapredLocalDirs | {
"repo_name": "simplegeo/hadoop",
"path": "src/mapred/org/apache/hadoop/mapred/TaskRunner.java",
"license": "apache-2.0",
"size": 28330
} | [
"org.apache.hadoop.fs.Path"
] | import org.apache.hadoop.fs.Path; | import org.apache.hadoop.fs.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 938,380 |
Executions<Set<V>> georadiusbymember(K key, V member, double distance, GeoArgs.Unit unit);
/**
*
* Retrieve members selected by distance with the center of {@code member}. The member itself is always contained in the
* results.
*
* @param key the key of the geo set
* @param member reference member
* @param distance radius distance
* @param unit distance unit
* @param geoArgs args to control the result
* @return nested multi-bulk reply. The {@link GeoWithin} contains only fields which were requested by {@link GeoArgs} | Executions<Set<V>> georadiusbymember(K key, V member, double distance, GeoArgs.Unit unit); /** * * Retrieve members selected by distance with the center of {@code member}. The member itself is always contained in the * results. * * @param key the key of the geo set * @param member reference member * @param distance radius distance * @param unit distance unit * @param geoArgs args to control the result * @return nested multi-bulk reply. The {@link GeoWithin} contains only fields which were requested by {@link GeoArgs} | /**
* Retrieve members selected by distance with the center of {@code member}. The member itself is always contained in the
* results.
*
* @param key the key of the geo set
* @param member reference member
* @param distance radius distance
* @param unit distance unit
* @return set of members
*/ | Retrieve members selected by distance with the center of member. The member itself is always contained in the results | georadiusbymember | {
"repo_name": "CiNC0/Cartier",
"path": "cartier-redis/src/main/java/com/lambdaworks/redis/cluster/api/sync/NodeSelectionGeoCommands.java",
"license": "apache-2.0",
"size": 7069
} | [
"com.lambdaworks.redis.GeoArgs",
"com.lambdaworks.redis.GeoWithin",
"java.util.Set"
] | import com.lambdaworks.redis.GeoArgs; import com.lambdaworks.redis.GeoWithin; import java.util.Set; | import com.lambdaworks.redis.*; import java.util.*; | [
"com.lambdaworks.redis",
"java.util"
] | com.lambdaworks.redis; java.util; | 1,080,124 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.