method
stringlengths 13
441k
| clean_method
stringlengths 7
313k
| doc
stringlengths 17
17.3k
| comment
stringlengths 3
1.42k
| method_name
stringlengths 1
273
| extra
dict | imports
list | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
list | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
|---|---|---|---|---|---|---|---|---|---|---|---|
void setWrappedModel(TableModel model);
|
void setWrappedModel(TableModel model);
|
/**
* Causes this wrapper to wrap the given model instead of the one it was
* formerly wrapping.
*/
|
Causes this wrapper to wrap the given model instead of the one it was formerly wrapping
|
setWrappedModel
|
{
"repo_name": "amitkr/sqlpower-library",
"path": "src/main/java/ca/sqlpower/swingui/table/TableModelWrapper.java",
"license": "gpl-3.0",
"size": 1353
}
|
[
"javax.swing.table.TableModel"
] |
import javax.swing.table.TableModel;
|
import javax.swing.table.*;
|
[
"javax.swing"
] |
javax.swing;
| 2,732,931
|
@Override
public void log(final Level level, final String message) {
first .log(level, message);
second.log(level, message);
}
|
void function(final Level level, final String message) { first .log(level, message); second.log(level, message); }
|
/**
* Logs a record at the specified level.
*/
|
Logs a record at the specified level
|
log
|
{
"repo_name": "apache/sis",
"path": "core/sis-utility/src/main/java/org/apache/sis/util/logging/DualLogger.java",
"license": "apache-2.0",
"size": 3898
}
|
[
"java.util.logging.Level"
] |
import java.util.logging.Level;
|
import java.util.logging.*;
|
[
"java.util"
] |
java.util;
| 2,217,785
|
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException {
stream.defaultReadObject();
this.wallPaint = SerialUtilities.readPaint(stream);
}
|
void function(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); this.wallPaint = SerialUtilities.readPaint(stream); }
|
/**
* Provides serialization support.
*
* @param stream the input stream.
*
* @throws IOException if there is an I/O error.
* @throws ClassNotFoundException if there is a classpath problem.
*/
|
Provides serialization support
|
readObject
|
{
"repo_name": "nologic/nabs",
"path": "client/trunk/shared/libraries/jfreechart-1.0.5/source/org/jfree/chart/renderer/category/LineRenderer3D.java",
"license": "gpl-2.0",
"size": 23549
}
|
[
"java.io.IOException",
"java.io.ObjectInputStream",
"org.jfree.io.SerialUtilities"
] |
import java.io.IOException; import java.io.ObjectInputStream; import org.jfree.io.SerialUtilities;
|
import java.io.*; import org.jfree.io.*;
|
[
"java.io",
"org.jfree.io"
] |
java.io; org.jfree.io;
| 610,504
|
public ValidatorError storeMethod(User currentUser) {
if (logger.isDebugEnabled()) {
logger.debug("storeMethod(User currentUser=" + currentUser +
") - start");
}
String dest = null;
if (this.method.getType().equals(NotificationFactory.TYPE_EMAIL)) {
dest = this.method.getEmailAddress();
}
else if (this.method.getType().equals(NotificationFactory.TYPE_PAGER)) {
dest = this.method.getPagerEmail();
}
if (StringUtils.isEmpty(dest)) {
ValidatorError returnValidatorError = new ValidatorError(
"errors.required", LocalizationService.getInstance()
.getMessage("method-form.jspf.name"));
if (logger.isDebugEnabled()) {
logger.debug("storeMethod(User) - end - return value=" +
returnValidatorError);
}
return returnValidatorError;
}
// Verify the passed in name to make sure they aren't trying
// to save a new (or existing) Method with a name that is
// already taken.
Method lookedUp = NotificationFactory.lookupMethodByNameAndUser(
this.method.getMethodName(), this.method.getUser().getId());
if (lookedUp != null &&
lookedUp.getMethodName().equals(this.method.getMethodName())) {
// now check to see if the found Method has the same ID (is the same)
// as the one in the Command:
if (this.method.getId() == null ||
lookedUp.getId().longValue() != this.method.getId().longValue()) {
ValidatorError returnValidatorError = new ValidatorError(
"method.nametaken", this.method.getMethodName());
if (logger.isDebugEnabled()) {
logger.debug("storeMethod(User) - end - return value=" +
returnValidatorError);
}
return returnValidatorError;
}
}
NotificationFactory.saveContactGroup(currentUser, this.method.getContactGroup());
NotificationFactory.saveMethod(this.method, currentUser);
if (logger.isDebugEnabled()) {
logger.debug("storeMethod(User) - end - return value=" + null);
}
return null;
}
|
ValidatorError function(User currentUser) { if (logger.isDebugEnabled()) { logger.debug(STR + currentUser + STR); } String dest = null; if (this.method.getType().equals(NotificationFactory.TYPE_EMAIL)) { dest = this.method.getEmailAddress(); } else if (this.method.getType().equals(NotificationFactory.TYPE_PAGER)) { dest = this.method.getPagerEmail(); } if (StringUtils.isEmpty(dest)) { ValidatorError returnValidatorError = new ValidatorError( STR, LocalizationService.getInstance() .getMessage(STR)); if (logger.isDebugEnabled()) { logger.debug(STR + returnValidatorError); } return returnValidatorError; } Method lookedUp = NotificationFactory.lookupMethodByNameAndUser( this.method.getMethodName(), this.method.getUser().getId()); if (lookedUp != null && lookedUp.getMethodName().equals(this.method.getMethodName())) { if (this.method.getId() == null lookedUp.getId().longValue() != this.method.getId().longValue()) { ValidatorError returnValidatorError = new ValidatorError( STR, this.method.getMethodName()); if (logger.isDebugEnabled()) { logger.debug(STR + returnValidatorError); } return returnValidatorError; } } NotificationFactory.saveContactGroup(currentUser, this.method.getContactGroup()); NotificationFactory.saveMethod(this.method, currentUser); if (logger.isDebugEnabled()) { logger.debug(STR + null); } return null; }
|
/**
* Persist the Method
* @param currentUser The user/admin storing this method. Usually not the user
* associated with the Notification Method and instead is the one who initiated
* the save.
* @return ValidatorError if the currentUser is in the wrong state or is
* missing a field.
*/
|
Persist the Method
|
storeMethod
|
{
"repo_name": "dmacvicar/spacewalk",
"path": "java/code/src/com/redhat/rhn/manager/monitoring/ModifyMethodCommand.java",
"license": "gpl-2.0",
"size": 9049
}
|
[
"com.redhat.rhn.common.localization.LocalizationService",
"com.redhat.rhn.common.validator.ValidatorError",
"com.redhat.rhn.domain.monitoring.notification.Method",
"com.redhat.rhn.domain.monitoring.notification.NotificationFactory",
"com.redhat.rhn.domain.user.User",
"org.apache.commons.lang.StringUtils"
] |
import com.redhat.rhn.common.localization.LocalizationService; import com.redhat.rhn.common.validator.ValidatorError; import com.redhat.rhn.domain.monitoring.notification.Method; import com.redhat.rhn.domain.monitoring.notification.NotificationFactory; import com.redhat.rhn.domain.user.User; import org.apache.commons.lang.StringUtils;
|
import com.redhat.rhn.common.localization.*; import com.redhat.rhn.common.validator.*; import com.redhat.rhn.domain.monitoring.notification.*; import com.redhat.rhn.domain.user.*; import org.apache.commons.lang.*;
|
[
"com.redhat.rhn",
"org.apache.commons"
] |
com.redhat.rhn; org.apache.commons;
| 1,619,469
|
public static Checkin getDataFromCursor(Cursor cursor) {
long rowID = cursor.getLong(cursor.getColumnIndex(SymptomSchema.Checkin.Cols.ID));
String howbad = cursor.getString(cursor.getColumnIndex(SymptomSchema.Checkin.Cols.HOWBAD));
String painstop = cursor.getString(cursor.getColumnIndex(SymptomSchema.Checkin.Cols.PAINSTOP));
String checkinDate = cursor.getString(cursor.getColumnIndex(SymptomSchema.Checkin.Cols.CHECKINDATE));
boolean send = cursor.getInt(cursor.getColumnIndex(SymptomSchema.Checkin.Cols.SEND)) == 1?true:false;
boolean takemedication = cursor.getInt(cursor.getColumnIndex(SymptomSchema.Checkin.Cols.TAKEMEDICATION)) == 1?true:false;
String photoPath = cursor.getString(cursor.getColumnIndex(SymptomSchema.Checkin.Cols.PHOTO_PATH));
long patientId = cursor.getLong(cursor.getColumnIndex(SymptomSchema.Checkin.Cols.ID_PATIENT));
return new Checkin(rowID, checkinDate, send, howbad, painstop, takemedication, photoPath, patientId);
}
|
static Checkin function(Cursor cursor) { long rowID = cursor.getLong(cursor.getColumnIndex(SymptomSchema.Checkin.Cols.ID)); String howbad = cursor.getString(cursor.getColumnIndex(SymptomSchema.Checkin.Cols.HOWBAD)); String painstop = cursor.getString(cursor.getColumnIndex(SymptomSchema.Checkin.Cols.PAINSTOP)); String checkinDate = cursor.getString(cursor.getColumnIndex(SymptomSchema.Checkin.Cols.CHECKINDATE)); boolean send = cursor.getInt(cursor.getColumnIndex(SymptomSchema.Checkin.Cols.SEND)) == 1?true:false; boolean takemedication = cursor.getInt(cursor.getColumnIndex(SymptomSchema.Checkin.Cols.TAKEMEDICATION)) == 1?true:false; String photoPath = cursor.getString(cursor.getColumnIndex(SymptomSchema.Checkin.Cols.PHOTO_PATH)); long patientId = cursor.getLong(cursor.getColumnIndex(SymptomSchema.Checkin.Cols.ID_PATIENT)); return new Checkin(rowID, checkinDate, send, howbad, painstop, takemedication, photoPath, patientId); }
|
/**
* This method creates a new Checkin object getting the data from cursor object
*
* @param cursor a Cursor object that is mapped to the local database
* @return a Checkin object with data read from cursor
*/
|
This method creates a new Checkin object getting the data from cursor object
|
getDataFromCursor
|
{
"repo_name": "estebanluengo/symptommanagment",
"path": "Symptom/src/org/coursera/symptom/orm/Checkin.java",
"license": "apache-2.0",
"size": 11391
}
|
[
"android.database.Cursor",
"org.coursera.symptom.provider.SymptomSchema"
] |
import android.database.Cursor; import org.coursera.symptom.provider.SymptomSchema;
|
import android.database.*; import org.coursera.symptom.provider.*;
|
[
"android.database",
"org.coursera.symptom"
] |
android.database; org.coursera.symptom;
| 1,988,370
|
Distribution getDistribution() {
return distribution;
}
|
Distribution getDistribution() { return distribution; }
|
/**
* Gets the distribution this operation represents
*
* @return Distribution
*/
|
Gets the distribution this operation represents
|
getDistribution
|
{
"repo_name": "tseen/Federated-HDFS",
"path": "tseenliu/FedHDFS-hadoop-src/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/OperationData.java",
"license": "apache-2.0",
"size": 2900
}
|
[
"org.apache.hadoop.fs.slive.Constants"
] |
import org.apache.hadoop.fs.slive.Constants;
|
import org.apache.hadoop.fs.slive.*;
|
[
"org.apache.hadoop"
] |
org.apache.hadoop;
| 1,442,252
|
public Vector<MRFEdge> getEdges() {
return m_Edges;
}
|
Vector<MRFEdge> function() { return m_Edges; }
|
/**
* <p>Method : getEdges
* <p>Purpose : Returns the list of edges
* <p>@return Vector<MRFEdge>
*/
|
Method : getEdges Purpose : Returns the list of edges @return Vector
|
getEdges
|
{
"repo_name": "Khalian/WSDAlphaExpansion",
"path": "code/MRFGraph.java",
"license": "apache-2.0",
"size": 2330
}
|
[
"java.util.Vector"
] |
import java.util.Vector;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,602,189
|
public PokestopLootResult loot() throws RequestFailedException {
return AsyncHelper.toBlocking(lootAsync());
}
|
PokestopLootResult function() throws RequestFailedException { return AsyncHelper.toBlocking(lootAsync()); }
|
/**
* Loots a pokestop for pokeballs and other items.
*
* @return PokestopLootResult
* @throws RequestFailedException if an exception occurred while sending requests
*/
|
Loots a pokestop for pokeballs and other items
|
loot
|
{
"repo_name": "gegy1000/PokeGOAPI-Java",
"path": "library/src/main/java/com/pokegoapi/api/map/fort/Fort.java",
"license": "gpl-3.0",
"size": 9019
}
|
[
"com.pokegoapi.exceptions.request.RequestFailedException",
"com.pokegoapi.util.AsyncHelper"
] |
import com.pokegoapi.exceptions.request.RequestFailedException; import com.pokegoapi.util.AsyncHelper;
|
import com.pokegoapi.exceptions.request.*; import com.pokegoapi.util.*;
|
[
"com.pokegoapi.exceptions",
"com.pokegoapi.util"
] |
com.pokegoapi.exceptions; com.pokegoapi.util;
| 541,869
|
void bookmarksOrHistoryPicker(boolean startWithHistory) {
WebView current = mTabControl.getCurrentWebView();
if (current == null) {
return;
}
Intent intent = new Intent(this,
CombinedBookmarkHistoryActivity.class);
String title = current.getTitle();
String url = current.getUrl();
Bitmap thumbnail = createScreenshot(current);
// Just in case the user opens bookmarks before a page finishes loading
// so the current history item, and therefore the page, is null.
if (null == url) {
url = mLastEnteredUrl;
// This can happen.
if (null == url) {
url = mSettings.getHomePage();
}
}
// In case the web page has not yet received its associated title.
if (title == null) {
title = url;
}
intent.putExtra("title", title);
intent.putExtra("url", url);
intent.putExtra("thumbnail", thumbnail);
// Disable opening in a new window if we have maxed out the windows
intent.putExtra("disable_new_window", !mTabControl.canCreateNewTab());
intent.putExtra("touch_icon_url", current.getTouchIconUrl());
if (startWithHistory) {
intent.putExtra(CombinedBookmarkHistoryActivity.STARTING_TAB,
CombinedBookmarkHistoryActivity.HISTORY_TAB);
}
startActivityForResult(intent, COMBO_PAGE);
}
|
void bookmarksOrHistoryPicker(boolean startWithHistory) { WebView current = mTabControl.getCurrentWebView(); if (current == null) { return; } Intent intent = new Intent(this, CombinedBookmarkHistoryActivity.class); String title = current.getTitle(); String url = current.getUrl(); Bitmap thumbnail = createScreenshot(current); if (null == url) { url = mLastEnteredUrl; if (null == url) { url = mSettings.getHomePage(); } } if (title == null) { title = url; } intent.putExtra("title", title); intent.putExtra("url", url); intent.putExtra(STR, thumbnail); intent.putExtra(STR, !mTabControl.canCreateNewTab()); intent.putExtra(STR, current.getTouchIconUrl()); if (startWithHistory) { intent.putExtra(CombinedBookmarkHistoryActivity.STARTING_TAB, CombinedBookmarkHistoryActivity.HISTORY_TAB); } startActivityForResult(intent, COMBO_PAGE); }
|
/**
* Open the Go page.
* @param startWithHistory If true, open starting on the history tab.
* Otherwise, start with the bookmarks tab.
*/
|
Open the Go page
|
bookmarksOrHistoryPicker
|
{
"repo_name": "xjwangliang/android_source_note",
"path": "Browser_2.3/BrowserActivity/src/com/android/browser/BrowserActivity.java",
"license": "apache-2.0",
"size": 160209
}
|
[
"android.content.Intent",
"android.graphics.Bitmap",
"android.webkit.WebView"
] |
import android.content.Intent; import android.graphics.Bitmap; import android.webkit.WebView;
|
import android.content.*; import android.graphics.*; import android.webkit.*;
|
[
"android.content",
"android.graphics",
"android.webkit"
] |
android.content; android.graphics; android.webkit;
| 901,159
|
public void testDoReloadProperties( ) throws AccessDeniedException, IOException
{
String property = "junit_testDoReloadProperties";
String propertyValue = getRandomName( );
File luteceProperties = new File( getResourcesDir( ), "WEB-INF/conf/lutece.properties" );
Properties props = new Properties( );
InputStream is = new FileInputStream( luteceProperties );
props.load( is );
is.close( );
props.setProperty( property, propertyValue );
OutputStream os = new FileOutputStream( luteceProperties );
props.store( os, "saved for junit " + this.getClass( ).getCanonicalName( ) );
os.close( );
assertFalse( propertyValue.equals( AppPropertiesService.getProperty( property ) ) );
MockHttpServletRequest request = new MockHttpServletRequest( );
Utils.registerAdminUserWithRigth( request, new AdminUser( ), CacheJspBean.RIGHT_CACHE_MANAGEMENT );
request.addParameter( SecurityTokenService.PARAMETER_TOKEN,
SecurityTokenService.getInstance( ).getToken( request, "admin/system/manage_caches.html" ) );
CacheJspBean instance = new CacheJspBean( );
instance.doReloadProperties( request );
assertEquals( propertyValue, AppPropertiesService.getProperty( property ) );
}
|
void function( ) throws AccessDeniedException, IOException { String property = STR; String propertyValue = getRandomName( ); File luteceProperties = new File( getResourcesDir( ), STR ); Properties props = new Properties( ); InputStream is = new FileInputStream( luteceProperties ); props.load( is ); is.close( ); props.setProperty( property, propertyValue ); OutputStream os = new FileOutputStream( luteceProperties ); props.store( os, STR + this.getClass( ).getCanonicalName( ) ); os.close( ); assertFalse( propertyValue.equals( AppPropertiesService.getProperty( property ) ) ); MockHttpServletRequest request = new MockHttpServletRequest( ); Utils.registerAdminUserWithRigth( request, new AdminUser( ), CacheJspBean.RIGHT_CACHE_MANAGEMENT ); request.addParameter( SecurityTokenService.PARAMETER_TOKEN, SecurityTokenService.getInstance( ).getToken( request, STR ) ); CacheJspBean instance = new CacheJspBean( ); instance.doReloadProperties( request ); assertEquals( propertyValue, AppPropertiesService.getProperty( property ) ); }
|
/**
* Test of doReloadProperties method, of class fr.paris.lutece.portal.web.system.SystemJspBean.
*
* @throws AccessDeniedException
* @throws IOException
*/
|
Test of doReloadProperties method, of class fr.paris.lutece.portal.web.system.SystemJspBean
|
testDoReloadProperties
|
{
"repo_name": "lutece-platform/lutece-core",
"path": "src/test/java/fr/paris/lutece/portal/web/system/CacheJspBeanTest.java",
"license": "bsd-3-clause",
"size": 23149
}
|
[
"fr.paris.lutece.portal.business.user.AdminUser",
"fr.paris.lutece.portal.service.admin.AccessDeniedException",
"fr.paris.lutece.portal.service.security.SecurityTokenService",
"fr.paris.lutece.portal.service.util.AppPropertiesService",
"fr.paris.lutece.test.Utils",
"java.io.File",
"java.io.FileInputStream",
"java.io.FileOutputStream",
"java.io.IOException",
"java.io.InputStream",
"java.io.OutputStream",
"java.util.Properties",
"org.springframework.mock.web.MockHttpServletRequest"
] |
import fr.paris.lutece.portal.business.user.AdminUser; import fr.paris.lutece.portal.service.admin.AccessDeniedException; import fr.paris.lutece.portal.service.security.SecurityTokenService; import fr.paris.lutece.portal.service.util.AppPropertiesService; import fr.paris.lutece.test.Utils; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Properties; import org.springframework.mock.web.MockHttpServletRequest;
|
import fr.paris.lutece.portal.business.user.*; import fr.paris.lutece.portal.service.admin.*; import fr.paris.lutece.portal.service.security.*; import fr.paris.lutece.portal.service.util.*; import fr.paris.lutece.test.*; import java.io.*; import java.util.*; import org.springframework.mock.web.*;
|
[
"fr.paris.lutece",
"java.io",
"java.util",
"org.springframework.mock"
] |
fr.paris.lutece; java.io; java.util; org.springframework.mock;
| 764,729
|
@Override
public void removeListener(Listener<ReusableFloatBuffer> listener)
{
mListener = null;
}
|
void function(Listener<ReusableFloatBuffer> listener) { mListener = null; }
|
/**
* Unregisters the listener from receiving sample buffers
*/
|
Unregisters the listener from receiving sample buffers
|
removeListener
|
{
"repo_name": "ImagoTrigger/sdrtrunk",
"path": "src/main/java/io/github/dsheirer/source/wave/RealWaveSource.java",
"license": "gpl-3.0",
"size": 8217
}
|
[
"io.github.dsheirer.sample.Listener",
"io.github.dsheirer.sample.buffer.ReusableFloatBuffer"
] |
import io.github.dsheirer.sample.Listener; import io.github.dsheirer.sample.buffer.ReusableFloatBuffer;
|
import io.github.dsheirer.sample.*; import io.github.dsheirer.sample.buffer.*;
|
[
"io.github.dsheirer"
] |
io.github.dsheirer;
| 1,855,572
|
public List<ConceptName> getCompatibleNames(Locale desiredLocale) {
// lazy create the cache
List<ConceptName> compatibleNames = null;
if (compatibleCache == null) {
compatibleCache = new HashMap<Locale, List<ConceptName>>();
} else {
compatibleNames = compatibleCache.get(desiredLocale);
}
if (compatibleNames == null) {
compatibleNames = new Vector<ConceptName>();
for (ConceptName possibleName : getNames()) {
if (LocaleUtility.areCompatible(possibleName.getLocale(), desiredLocale)) {
compatibleNames.add(possibleName);
}
}
compatibleCache.put(desiredLocale, compatibleNames);
}
return compatibleNames;
}
|
List<ConceptName> function(Locale desiredLocale) { List<ConceptName> compatibleNames = null; if (compatibleCache == null) { compatibleCache = new HashMap<Locale, List<ConceptName>>(); } else { compatibleNames = compatibleCache.get(desiredLocale); } if (compatibleNames == null) { compatibleNames = new Vector<ConceptName>(); for (ConceptName possibleName : getNames()) { if (LocaleUtility.areCompatible(possibleName.getLocale(), desiredLocale)) { compatibleNames.add(possibleName); } } compatibleCache.put(desiredLocale, compatibleNames); } return compatibleNames; }
|
/**
* Returns all names from compatible locales. A locale is considered compatible if it is exactly
* the same locale, or if either locale has no country specified and the language matches. <br>
* <br>
* This is recommended when presenting possible names to the use.
*
* @param desiredLocale locale with which the names should be compatible
* @return Collection of compatible names
* @should exclude incompatible country locales
* @should exclude incompatible language locales
*/
|
Returns all names from compatible locales. A locale is considered compatible if it is exactly the same locale, or if either locale has no country specified and the language matches. This is recommended when presenting possible names to the use
|
getCompatibleNames
|
{
"repo_name": "koskedk/openmrs-core",
"path": "api/src/main/java/org/openmrs/Concept.java",
"license": "mpl-2.0",
"size": 52924
}
|
[
"java.util.HashMap",
"java.util.List",
"java.util.Locale",
"java.util.Vector",
"org.openmrs.util.LocaleUtility"
] |
import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Vector; import org.openmrs.util.LocaleUtility;
|
import java.util.*; import org.openmrs.util.*;
|
[
"java.util",
"org.openmrs.util"
] |
java.util; org.openmrs.util;
| 21,467
|
SELF allSatisfy(Consumer<? super ELEMENT> requirements);
|
SELF allSatisfy(Consumer<? super ELEMENT> requirements);
|
/**
* Verifies that all the elements satisfy the given requirements expressed as a {@link Consumer}.
* <p>
* This is useful to perform a group of assertions on elements.
* <p>
* Example:
* <pre><code class='java'> assertThat(myIcelanderFriends).allSatisfy(person -> {
* assertThat(person.getCountry()).isEqualTo("Iceland");
* assertThat(person.getPhoneCountryCode()).isEqualTo("+354");
* });</code></pre>
*
* <p>
* If the actual iterable is empty, this assertion succeeds as there is no elements to check.
*
* @param requirements the given {@link Consumer}.
* @return {@code this} object.
* @throws NullPointerException if the given {@link Consumer} is {@code null}.
* @throws AssertionError if one or more elements don't satisfy the given requirements.
* @since 3.6.0
*/
|
Verifies that all the elements satisfy the given requirements expressed as a <code>Consumer</code>. This is useful to perform a group of assertions on elements. Example: <code> assertThat(myIcelanderFriends).allSatisfy(person -> { assertThat(person.getCountry()).isEqualTo("Iceland"); assertThat(person.getPhoneCountryCode()).isEqualTo("+354"); });</code></code> If the actual iterable is empty, this assertion succeeds as there is no elements to check
|
allSatisfy
|
{
"repo_name": "hazendaz/assertj-core",
"path": "src/main/java/org/assertj/core/api/ObjectEnumerableAssert.java",
"license": "apache-2.0",
"size": 87624
}
|
[
"java.util.function.Consumer"
] |
import java.util.function.Consumer;
|
import java.util.function.*;
|
[
"java.util"
] |
java.util;
| 1,477,467
|
@DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_STRING,
defaultValue = "")
@SimpleProperty(userVisible = false,
description = "This is the display name of the installed application in the phone." +
"If the AppName is blank, it will be set to the name of the project when the project is built.")
public void AppName(String aName) {
// We don't actually need to do anything.
}
|
@DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_STRING, defaultValue = STRThis is the display name of the installed application in the phone.STRIf the AppName is blank, it will be set to the name of the project when the project is built.") void function(String aName) { }
|
/**
* Specifies the App Name.
*
* @param aName the display name of the installed application in the phone
*/
|
Specifies the App Name
|
AppName
|
{
"repo_name": "Klomi/appinventor-sources",
"path": "appinventor/components/src/com/google/appinventor/components/runtime/Form.java",
"license": "apache-2.0",
"size": 87303
}
|
[
"com.google.appinventor.components.annotations.DesignerProperty",
"com.google.appinventor.components.common.PropertyTypeConstants"
] |
import com.google.appinventor.components.annotations.DesignerProperty; import com.google.appinventor.components.common.PropertyTypeConstants;
|
import com.google.appinventor.components.annotations.*; import com.google.appinventor.components.common.*;
|
[
"com.google.appinventor"
] |
com.google.appinventor;
| 2,113,589
|
public static void startHouseKeepingThreads() throws AndesException {
//reload exchanges/queues/bindings and subscriptions
AndesContextInformationManager contextInformationManager = AndesContext.getInstance()
.getAndesContextInformationManager();
AndesSubscriptionManager subscriptionManager = AndesContext.getInstance()
.getAndesSubscriptionManager();
InboundEventManager inboundEventManager = AndesContext.getInstance()
.getInboundEventManager();
AndesRecoveryTask andesRecoveryTask = new AndesRecoveryTask(contextInformationManager,
subscriptionManager, inboundEventManager);
//deleted the expired message from db
PeriodicExpiryMessageDeletionTask periodicExpiryMessageDeletionTask = null;
int recoveryTaskScheduledPeriod = AndesConfigurationManager.readValue
(AndesConfiguration.PERFORMANCE_TUNING_FAILOVER_VHOST_SYNC_TASK_INTERVAL);
int dbBasedDeletionTaskScheduledPeriod = AndesConfigurationManager.readValue
(AndesConfiguration.PERFORMANCE_TUNING_PERIODIC_EXPIRY_MESSAGE_DELETION_INTERVAL);
int safeDeleteRegionSlotCount = AndesConfigurationManager.readValue
(AndesConfiguration.PERFORMANCE_TUNING_SAFE_DELETE_REGION_SLOT_COUNT);
periodicExpiryMessageDeletionTask = new PeriodicExpiryMessageDeletionTask();
andesRecoveryTaskScheduler.scheduleAtFixedRate(andesRecoveryTask, recoveryTaskScheduledPeriod,
recoveryTaskScheduledPeriod, TimeUnit.SECONDS);
if (safeDeleteRegionSlotCount >= 1) {
expiryMessageDeletionTaskScheduler.scheduleAtFixedRate(periodicExpiryMessageDeletionTask,
dbBasedDeletionTaskScheduledPeriod, dbBasedDeletionTaskScheduledPeriod, TimeUnit.SECONDS);
} else {
log.error("DB based expiry message deletion task is not scheduled due to not providing "
+ "a valid safe delete region slot count is not given. Given slot count is "
+ safeDeleteRegionSlotCount);
}
ClusterResourceHolder.getInstance().setAndesRecoveryTask(andesRecoveryTask);
}
|
static void function() throws AndesException { AndesContextInformationManager contextInformationManager = AndesContext.getInstance() .getAndesContextInformationManager(); AndesSubscriptionManager subscriptionManager = AndesContext.getInstance() .getAndesSubscriptionManager(); InboundEventManager inboundEventManager = AndesContext.getInstance() .getInboundEventManager(); AndesRecoveryTask andesRecoveryTask = new AndesRecoveryTask(contextInformationManager, subscriptionManager, inboundEventManager); PeriodicExpiryMessageDeletionTask periodicExpiryMessageDeletionTask = null; int recoveryTaskScheduledPeriod = AndesConfigurationManager.readValue (AndesConfiguration.PERFORMANCE_TUNING_FAILOVER_VHOST_SYNC_TASK_INTERVAL); int dbBasedDeletionTaskScheduledPeriod = AndesConfigurationManager.readValue (AndesConfiguration.PERFORMANCE_TUNING_PERIODIC_EXPIRY_MESSAGE_DELETION_INTERVAL); int safeDeleteRegionSlotCount = AndesConfigurationManager.readValue (AndesConfiguration.PERFORMANCE_TUNING_SAFE_DELETE_REGION_SLOT_COUNT); periodicExpiryMessageDeletionTask = new PeriodicExpiryMessageDeletionTask(); andesRecoveryTaskScheduler.scheduleAtFixedRate(andesRecoveryTask, recoveryTaskScheduledPeriod, recoveryTaskScheduledPeriod, TimeUnit.SECONDS); if (safeDeleteRegionSlotCount >= 1) { expiryMessageDeletionTaskScheduler.scheduleAtFixedRate(periodicExpiryMessageDeletionTask, dbBasedDeletionTaskScheduledPeriod, dbBasedDeletionTaskScheduledPeriod, TimeUnit.SECONDS); } else { log.error(STR + STR + safeDeleteRegionSlotCount); } ClusterResourceHolder.getInstance().setAndesRecoveryTask(andesRecoveryTask); }
|
/**
* start andes house keeping threads for the broker
*
* @throws AndesException
*/
|
start andes house keeping threads for the broker
|
startHouseKeepingThreads
|
{
"repo_name": "pumudu88/andes",
"path": "modules/andes-core/broker/src/main/java/org/wso2/andes/kernel/AndesKernelBoot.java",
"license": "apache-2.0",
"size": 25991
}
|
[
"java.util.concurrent.TimeUnit",
"org.wso2.andes.configuration.AndesConfigurationManager",
"org.wso2.andes.configuration.enums.AndesConfiguration",
"org.wso2.andes.kernel.disruptor.inbound.InboundEventManager",
"org.wso2.andes.kernel.subscription.AndesSubscriptionManager",
"org.wso2.andes.server.ClusterResourceHolder"
] |
import java.util.concurrent.TimeUnit; import org.wso2.andes.configuration.AndesConfigurationManager; import org.wso2.andes.configuration.enums.AndesConfiguration; import org.wso2.andes.kernel.disruptor.inbound.InboundEventManager; import org.wso2.andes.kernel.subscription.AndesSubscriptionManager; import org.wso2.andes.server.ClusterResourceHolder;
|
import java.util.concurrent.*; import org.wso2.andes.configuration.*; import org.wso2.andes.configuration.enums.*; import org.wso2.andes.kernel.disruptor.inbound.*; import org.wso2.andes.kernel.subscription.*; import org.wso2.andes.server.*;
|
[
"java.util",
"org.wso2.andes"
] |
java.util; org.wso2.andes;
| 2,412,027
|
private static int keyForCode(int keyCode) {
switch (keyCode) {
case KeyCodes.KEY_ALT:
return Keys.ALT_LEFT;
case KeyCodes.KEY_BACKSPACE:
return Keys.BACKSPACE;
case KeyCodes.KEY_CTRL:
return Keys.CONTROL_LEFT;
case KeyCodes.KEY_DELETE:
return Keys.DEL;
case KeyCodes.KEY_DOWN:
return Keys.DOWN;
case KeyCodes.KEY_END:
return Keys.END;
case KeyCodes.KEY_ENTER:
return Keys.ENTER;
case KeyCodes.KEY_ESCAPE:
return Keys.ESCAPE;
case KeyCodes.KEY_HOME:
return Keys.HOME;
case KeyCodes.KEY_LEFT:
return Keys.LEFT;
case KeyCodes.KEY_PAGEDOWN:
return Keys.PAGE_DOWN;
case KeyCodes.KEY_PAGEUP:
return Keys.PAGE_UP;
case KeyCodes.KEY_RIGHT:
return Keys.RIGHT;
case KeyCodes.KEY_SHIFT:
return Keys.SHIFT_LEFT;
case KeyCodes.KEY_TAB:
return Keys.TAB;
case KeyCodes.KEY_UP:
return Keys.UP;
case KEY_PAUSE:
return Keys.UNKNOWN; // FIXME
case KEY_CAPS_LOCK:
return Keys.UNKNOWN; // FIXME
case KEY_SPACE:
return Keys.SPACE;
case KEY_INSERT:
return Keys.INSERT;
case KEY_0:
return Keys.NUM_0;
case KEY_1:
return Keys.NUM_1;
case KEY_2:
return Keys.NUM_2;
case KEY_3:
return Keys.NUM_3;
case KEY_4:
return Keys.NUM_4;
case KEY_5:
return Keys.NUM_5;
case KEY_6:
return Keys.NUM_6;
case KEY_7:
return Keys.NUM_7;
case KEY_8:
return Keys.NUM_8;
case KEY_9:
return Keys.NUM_9;
case KEY_A:
return Keys.A;
case KEY_B:
return Keys.B;
case KEY_C:
return Keys.C;
case KEY_D:
return Keys.D;
case KEY_E:
return Keys.E;
case KEY_F:
return Keys.F;
case KEY_G:
return Keys.G;
case KEY_H:
return Keys.H;
case KEY_I:
return Keys.I;
case KEY_J:
return Keys.J;
case KEY_K:
return Keys.K;
case KEY_L:
return Keys.L;
case KEY_M:
return Keys.M;
case KEY_N:
return Keys.N;
case KEY_O:
return Keys.O;
case KEY_P:
return Keys.P;
case KEY_Q:
return Keys.Q;
case KEY_R:
return Keys.R;
case KEY_S:
return Keys.S;
case KEY_T:
return Keys.T;
case KEY_U:
return Keys.U;
case KEY_V:
return Keys.V;
case KEY_W:
return Keys.W;
case KEY_X:
return Keys.X;
case KEY_Y:
return Keys.Y;
case KEY_Z:
return Keys.Z;
case KEY_LEFT_WINDOW_KEY:
return Keys.UNKNOWN; // FIXME
case KEY_RIGHT_WINDOW_KEY:
return Keys.UNKNOWN; // FIXME
// case KEY_SELECT_KEY: return Keys.SELECT_KEY;
case KEY_NUMPAD0:
return Keys.NUMPAD_0;
case KEY_NUMPAD1:
return Keys.NUMPAD_1;
case KEY_NUMPAD2:
return Keys.NUMPAD_2;
case KEY_NUMPAD3:
return Keys.NUMPAD_3;
case KEY_NUMPAD4:
return Keys.NUMPAD_4;
case KEY_NUMPAD5:
return Keys.NUMPAD_5;
case KEY_NUMPAD6:
return Keys.NUMPAD_6;
case KEY_NUMPAD7:
return Keys.NUMPAD_7;
case KEY_NUMPAD8:
return Keys.NUMPAD_8;
case KEY_NUMPAD9:
return Keys.NUMPAD_9;
case KEY_MULTIPLY:
return Keys.UNKNOWN; // FIXME
case KEY_ADD:
return Keys.PLUS;
case KEY_SUBTRACT:
return Keys.MINUS;
case KEY_DECIMAL_POINT_KEY:
return Keys.PERIOD;
case KEY_DIVIDE:
return Keys.UNKNOWN; // FIXME
case KEY_F1:
return Keys.F1;
case KEY_F2:
return Keys.F2;
case KEY_F3:
return Keys.F3;
case KEY_F4:
return Keys.F4;
case KEY_F5:
return Keys.F5;
case KEY_F6:
return Keys.F6;
case KEY_F7:
return Keys.F7;
case KEY_F8:
return Keys.F8;
case KEY_F9:
return Keys.F9;
case KEY_F10:
return Keys.F10;
case KEY_F11:
return Keys.F11;
case KEY_F12:
return Keys.F12;
case KEY_NUM_LOCK:
return Keys.NUM;
case KEY_SCROLL_LOCK:
return Keys.UNKNOWN; // FIXME
case KEY_SEMICOLON:
return Keys.SEMICOLON;
case KEY_EQUALS:
return Keys.EQUALS;
case KEY_COMMA:
return Keys.COMMA;
case KEY_DASH:
return Keys.MINUS;
case KEY_PERIOD:
return Keys.PERIOD;
case KEY_FORWARD_SLASH:
return Keys.SLASH;
case KEY_GRAVE_ACCENT:
return Keys.UNKNOWN; // FIXME
case KEY_OPEN_BRACKET:
return Keys.LEFT_BRACKET;
case KEY_BACKSLASH:
return Keys.BACKSLASH;
case KEY_CLOSE_BRACKET:
return Keys.RIGHT_BRACKET;
case KEY_SINGLE_QUOTE:
return Keys.APOSTROPHE;
default:
return Keys.UNKNOWN;
}
}
// these are absent from KeyCodes; we know not why...
private static final int KEY_PAUSE = 19;
private static final int KEY_CAPS_LOCK = 20;
private static final int KEY_SPACE = 32;
private static final int KEY_INSERT = 45;
private static final int KEY_0 = 48;
private static final int KEY_1 = 49;
private static final int KEY_2 = 50;
private static final int KEY_3 = 51;
private static final int KEY_4 = 52;
private static final int KEY_5 = 53;
private static final int KEY_6 = 54;
private static final int KEY_7 = 55;
private static final int KEY_8 = 56;
private static final int KEY_9 = 57;
private static final int KEY_A = 65;
private static final int KEY_B = 66;
private static final int KEY_C = 67;
private static final int KEY_D = 68;
private static final int KEY_E = 69;
private static final int KEY_F = 70;
private static final int KEY_G = 71;
private static final int KEY_H = 72;
private static final int KEY_I = 73;
private static final int KEY_J = 74;
private static final int KEY_K = 75;
private static final int KEY_L = 76;
private static final int KEY_M = 77;
private static final int KEY_N = 78;
private static final int KEY_O = 79;
private static final int KEY_P = 80;
private static final int KEY_Q = 81;
private static final int KEY_R = 82;
private static final int KEY_S = 83;
private static final int KEY_T = 84;
private static final int KEY_U = 85;
private static final int KEY_V = 86;
private static final int KEY_W = 87;
private static final int KEY_X = 88;
private static final int KEY_Y = 89;
private static final int KEY_Z = 90;
private static final int KEY_LEFT_WINDOW_KEY = 91;
private static final int KEY_RIGHT_WINDOW_KEY = 92;
private static final int KEY_SELECT_KEY = 93;
private static final int KEY_NUMPAD0 = 96;
private static final int KEY_NUMPAD1 = 97;
private static final int KEY_NUMPAD2 = 98;
private static final int KEY_NUMPAD3 = 99;
private static final int KEY_NUMPAD4 = 100;
private static final int KEY_NUMPAD5 = 101;
private static final int KEY_NUMPAD6 = 102;
private static final int KEY_NUMPAD7 = 103;
private static final int KEY_NUMPAD8 = 104;
private static final int KEY_NUMPAD9 = 105;
private static final int KEY_MULTIPLY = 106;
private static final int KEY_ADD = 107;
private static final int KEY_SUBTRACT = 109;
private static final int KEY_DECIMAL_POINT_KEY = 110;
private static final int KEY_DIVIDE = 111;
private static final int KEY_F1 = 112;
private static final int KEY_F2 = 113;
private static final int KEY_F3 = 114;
private static final int KEY_F4 = 115;
private static final int KEY_F5 = 116;
private static final int KEY_F6 = 117;
private static final int KEY_F7 = 118;
private static final int KEY_F8 = 119;
private static final int KEY_F9 = 120;
private static final int KEY_F10 = 121;
private static final int KEY_F11 = 122;
private static final int KEY_F12 = 123;
private static final int KEY_NUM_LOCK = 144;
private static final int KEY_SCROLL_LOCK = 145;
private static final int KEY_SEMICOLON = 186;
private static final int KEY_EQUALS = 187;
private static final int KEY_COMMA = 188;
private static final int KEY_DASH = 189;
private static final int KEY_PERIOD = 190;
private static final int KEY_FORWARD_SLASH = 191;
private static final int KEY_GRAVE_ACCENT = 192;
private static final int KEY_OPEN_BRACKET = 219;
private static final int KEY_BACKSLASH = 220;
private static final int KEY_CLOSE_BRACKET = 221;
private static final int KEY_SINGLE_QUOTE = 222;
|
static int function(int keyCode) { switch (keyCode) { case KeyCodes.KEY_ALT: return Keys.ALT_LEFT; case KeyCodes.KEY_BACKSPACE: return Keys.BACKSPACE; case KeyCodes.KEY_CTRL: return Keys.CONTROL_LEFT; case KeyCodes.KEY_DELETE: return Keys.DEL; case KeyCodes.KEY_DOWN: return Keys.DOWN; case KeyCodes.KEY_END: return Keys.END; case KeyCodes.KEY_ENTER: return Keys.ENTER; case KeyCodes.KEY_ESCAPE: return Keys.ESCAPE; case KeyCodes.KEY_HOME: return Keys.HOME; case KeyCodes.KEY_LEFT: return Keys.LEFT; case KeyCodes.KEY_PAGEDOWN: return Keys.PAGE_DOWN; case KeyCodes.KEY_PAGEUP: return Keys.PAGE_UP; case KeyCodes.KEY_RIGHT: return Keys.RIGHT; case KeyCodes.KEY_SHIFT: return Keys.SHIFT_LEFT; case KeyCodes.KEY_TAB: return Keys.TAB; case KeyCodes.KEY_UP: return Keys.UP; case KEY_PAUSE: return Keys.UNKNOWN; case KEY_CAPS_LOCK: return Keys.UNKNOWN; case KEY_SPACE: return Keys.SPACE; case KEY_INSERT: return Keys.INSERT; case KEY_0: return Keys.NUM_0; case KEY_1: return Keys.NUM_1; case KEY_2: return Keys.NUM_2; case KEY_3: return Keys.NUM_3; case KEY_4: return Keys.NUM_4; case KEY_5: return Keys.NUM_5; case KEY_6: return Keys.NUM_6; case KEY_7: return Keys.NUM_7; case KEY_8: return Keys.NUM_8; case KEY_9: return Keys.NUM_9; case KEY_A: return Keys.A; case KEY_B: return Keys.B; case KEY_C: return Keys.C; case KEY_D: return Keys.D; case KEY_E: return Keys.E; case KEY_F: return Keys.F; case KEY_G: return Keys.G; case KEY_H: return Keys.H; case KEY_I: return Keys.I; case KEY_J: return Keys.J; case KEY_K: return Keys.K; case KEY_L: return Keys.L; case KEY_M: return Keys.M; case KEY_N: return Keys.N; case KEY_O: return Keys.O; case KEY_P: return Keys.P; case KEY_Q: return Keys.Q; case KEY_R: return Keys.R; case KEY_S: return Keys.S; case KEY_T: return Keys.T; case KEY_U: return Keys.U; case KEY_V: return Keys.V; case KEY_W: return Keys.W; case KEY_X: return Keys.X; case KEY_Y: return Keys.Y; case KEY_Z: return Keys.Z; case KEY_LEFT_WINDOW_KEY: return Keys.UNKNOWN; case KEY_RIGHT_WINDOW_KEY: return Keys.UNKNOWN; case KEY_NUMPAD0: return Keys.NUMPAD_0; case KEY_NUMPAD1: return Keys.NUMPAD_1; case KEY_NUMPAD2: return Keys.NUMPAD_2; case KEY_NUMPAD3: return Keys.NUMPAD_3; case KEY_NUMPAD4: return Keys.NUMPAD_4; case KEY_NUMPAD5: return Keys.NUMPAD_5; case KEY_NUMPAD6: return Keys.NUMPAD_6; case KEY_NUMPAD7: return Keys.NUMPAD_7; case KEY_NUMPAD8: return Keys.NUMPAD_8; case KEY_NUMPAD9: return Keys.NUMPAD_9; case KEY_MULTIPLY: return Keys.UNKNOWN; case KEY_ADD: return Keys.PLUS; case KEY_SUBTRACT: return Keys.MINUS; case KEY_DECIMAL_POINT_KEY: return Keys.PERIOD; case KEY_DIVIDE: return Keys.UNKNOWN; case KEY_F1: return Keys.F1; case KEY_F2: return Keys.F2; case KEY_F3: return Keys.F3; case KEY_F4: return Keys.F4; case KEY_F5: return Keys.F5; case KEY_F6: return Keys.F6; case KEY_F7: return Keys.F7; case KEY_F8: return Keys.F8; case KEY_F9: return Keys.F9; case KEY_F10: return Keys.F10; case KEY_F11: return Keys.F11; case KEY_F12: return Keys.F12; case KEY_NUM_LOCK: return Keys.NUM; case KEY_SCROLL_LOCK: return Keys.UNKNOWN; case KEY_SEMICOLON: return Keys.SEMICOLON; case KEY_EQUALS: return Keys.EQUALS; case KEY_COMMA: return Keys.COMMA; case KEY_DASH: return Keys.MINUS; case KEY_PERIOD: return Keys.PERIOD; case KEY_FORWARD_SLASH: return Keys.SLASH; case KEY_GRAVE_ACCENT: return Keys.UNKNOWN; case KEY_OPEN_BRACKET: return Keys.LEFT_BRACKET; case KEY_BACKSLASH: return Keys.BACKSLASH; case KEY_CLOSE_BRACKET: return Keys.RIGHT_BRACKET; case KEY_SINGLE_QUOTE: return Keys.APOSTROPHE; default: return Keys.UNKNOWN; } } private static final int KEY_PAUSE = 19; private static final int KEY_CAPS_LOCK = 20; private static final int KEY_SPACE = 32; private static final int KEY_INSERT = 45; private static final int KEY_0 = 48; private static final int KEY_1 = 49; private static final int KEY_2 = 50; private static final int KEY_3 = 51; private static final int KEY_4 = 52; private static final int KEY_5 = 53; private static final int KEY_6 = 54; private static final int KEY_7 = 55; private static final int KEY_8 = 56; private static final int KEY_9 = 57; private static final int KEY_A = 65; private static final int KEY_B = 66; private static final int KEY_C = 67; private static final int KEY_D = 68; private static final int KEY_E = 69; private static final int KEY_F = 70; private static final int KEY_G = 71; private static final int KEY_H = 72; private static final int KEY_I = 73; private static final int KEY_J = 74; private static final int KEY_K = 75; private static final int KEY_L = 76; private static final int KEY_M = 77; private static final int KEY_N = 78; private static final int KEY_O = 79; private static final int KEY_P = 80; private static final int KEY_Q = 81; private static final int KEY_R = 82; private static final int KEY_S = 83; private static final int KEY_T = 84; private static final int KEY_U = 85; private static final int KEY_V = 86; private static final int KEY_W = 87; private static final int KEY_X = 88; private static final int KEY_Y = 89; private static final int KEY_Z = 90; private static final int KEY_LEFT_WINDOW_KEY = 91; private static final int KEY_RIGHT_WINDOW_KEY = 92; private static final int KEY_SELECT_KEY = 93; private static final int KEY_NUMPAD0 = 96; private static final int KEY_NUMPAD1 = 97; private static final int KEY_NUMPAD2 = 98; private static final int KEY_NUMPAD3 = 99; private static final int KEY_NUMPAD4 = 100; private static final int KEY_NUMPAD5 = 101; private static final int KEY_NUMPAD6 = 102; private static final int KEY_NUMPAD7 = 103; private static final int KEY_NUMPAD8 = 104; private static final int KEY_NUMPAD9 = 105; private static final int KEY_MULTIPLY = 106; private static final int KEY_ADD = 107; private static final int KEY_SUBTRACT = 109; private static final int KEY_DECIMAL_POINT_KEY = 110; private static final int KEY_DIVIDE = 111; private static final int KEY_F1 = 112; private static final int KEY_F2 = 113; private static final int KEY_F3 = 114; private static final int KEY_F4 = 115; private static final int KEY_F5 = 116; private static final int KEY_F6 = 117; private static final int KEY_F7 = 118; private static final int KEY_F8 = 119; private static final int KEY_F9 = 120; private static final int KEY_F10 = 121; private static final int KEY_F11 = 122; private static final int KEY_F12 = 123; private static final int KEY_NUM_LOCK = 144; private static final int KEY_SCROLL_LOCK = 145; private static final int KEY_SEMICOLON = 186; private static final int KEY_EQUALS = 187; private static final int KEY_COMMA = 188; private static final int KEY_DASH = 189; private static final int KEY_PERIOD = 190; private static final int KEY_FORWARD_SLASH = 191; private static final int KEY_GRAVE_ACCENT = 192; private static final int KEY_OPEN_BRACKET = 219; private static final int KEY_BACKSLASH = 220; private static final int KEY_CLOSE_BRACKET = 221; private static final int KEY_SINGLE_QUOTE = 222;
|
/**
* borrowed from PlayN, thanks guys
**/
|
borrowed from PlayN, thanks guys
|
keyForCode
|
{
"repo_name": "mapsforge/vtm",
"path": "vtm-web/src/org/oscim/gdx/emu/com/badlogic/gdx/backends/gwt/GwtInput.java",
"license": "lgpl-3.0",
"size": 35943
}
|
[
"com.google.gwt.event.dom.client.KeyCodes"
] |
import com.google.gwt.event.dom.client.KeyCodes;
|
import com.google.gwt.event.dom.client.*;
|
[
"com.google.gwt"
] |
com.google.gwt;
| 1,717,814
|
public void declare(String varname, Location location)
throws EvalException {
checkReadonly(varname, location);
if (parent == null) { // top-level values are immutable
readOnlyVariables.add(varname);
if (!futureReadOnlyVariables.isEmpty()) {
// Currently validating an if-else statement
futureReadOnlyVariables.peek().add(varname);
}
}
variables.add(varname);
variableLocations.put(varname, location);
}
|
void function(String varname, Location location) throws EvalException { checkReadonly(varname, location); if (parent == null) { readOnlyVariables.add(varname); if (!futureReadOnlyVariables.isEmpty()) { futureReadOnlyVariables.peek().add(varname); } } variables.add(varname); variableLocations.put(varname, location); }
|
/**
* Declare a variable and add it to the environment.
*/
|
Declare a variable and add it to the environment
|
declare
|
{
"repo_name": "juhalindfors/bazel-patches",
"path": "src/main/java/com/google/devtools/build/lib/syntax/ValidationEnvironment.java",
"license": "apache-2.0",
"size": 7216
}
|
[
"com.google.devtools.build.lib.events.Location"
] |
import com.google.devtools.build.lib.events.Location;
|
import com.google.devtools.build.lib.events.*;
|
[
"com.google.devtools"
] |
com.google.devtools;
| 2,903,320
|
private Block allocateBlock(String src, INode[] inodes) throws IOException {
Block b = new Block(FSNamesystem.randBlockId.nextLong(), 0, 0);
while(isValidBlock(b)) {
b.setBlockId(FSNamesystem.randBlockId.nextLong());
}
b.setGenerationStamp(getGenerationStamp());
b = dir.addBlock(src, inodes, b);
NameNode.stateChangeLog.info("BLOCK* NameSystem.allocateBlock: "
+src+ ". "+b);
return b;
}
|
Block function(String src, INode[] inodes) throws IOException { Block b = new Block(FSNamesystem.randBlockId.nextLong(), 0, 0); while(isValidBlock(b)) { b.setBlockId(FSNamesystem.randBlockId.nextLong()); } b.setGenerationStamp(getGenerationStamp()); b = dir.addBlock(src, inodes, b); NameNode.stateChangeLog.info(STR +src+ STR+b); return b; }
|
/**
* Allocate a block at the given pending filename
*
* @param src path to the file
* @param inodes INode representing each of the components of src.
* <code>inodes[inodes.length-1]</code> is the INode for the file.
*/
|
Allocate a block at the given pending filename
|
allocateBlock
|
{
"repo_name": "andy8788/hadoop-hdfs",
"path": "src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java",
"license": "apache-2.0",
"size": 214042
}
|
[
"java.io.IOException",
"org.apache.hadoop.hdfs.protocol.Block"
] |
import java.io.IOException; import org.apache.hadoop.hdfs.protocol.Block;
|
import java.io.*; import org.apache.hadoop.hdfs.protocol.*;
|
[
"java.io",
"org.apache.hadoop"
] |
java.io; org.apache.hadoop;
| 1,530,262
|
public int getRequestCount() {
int result = 0;
Container[] children = findChildren();
if (children != null) {
for( int i=0; i< children.length; i++ ) {
result += ((StandardWrapper)children[i]).getRequestCount();
}
}
return result;
}
|
int function() { int result = 0; Container[] children = findChildren(); if (children != null) { for( int i=0; i< children.length; i++ ) { result += ((StandardWrapper)children[i]).getRequestCount(); } } return result; }
|
/**
* Gets the cumulative request count of all servlets in this
* StandardContext.
*
* @return Cumulative request count of all servlets in this
* StandardContext
*/
|
Gets the cumulative request count of all servlets in this StandardContext
|
getRequestCount
|
{
"repo_name": "sdw2330976/apache-tomcat-7.0.57",
"path": "target/classes/org/apache/catalina/core/StandardContext.java",
"license": "apache-2.0",
"size": 213785
}
|
[
"org.apache.catalina.Container"
] |
import org.apache.catalina.Container;
|
import org.apache.catalina.*;
|
[
"org.apache.catalina"
] |
org.apache.catalina;
| 2,161,688
|
public static double getAssignedMemoryForSlot(final Map<String, Object> topConf) {
double totalWorkerMemory = 0.0;
final Integer topologyWorkerDefaultMemoryAllocation = 768;
List<String> topologyWorkerGcChildopts = ConfigUtils.getValueAsList(
Config.TOPOLOGY_WORKER_GC_CHILDOPTS, topConf);
List<String> workerGcChildopts = ConfigUtils.getValueAsList(
Config.WORKER_GC_CHILDOPTS, topConf);
Double memGcChildopts = null;
memGcChildopts = Utils.parseJvmHeapMemByChildOpts(
topologyWorkerGcChildopts, null);
if (memGcChildopts == null) {
memGcChildopts = Utils.parseJvmHeapMemByChildOpts(
workerGcChildopts, null);
}
List<String> topologyWorkerChildopts = ConfigUtils.getValueAsList(
Config.TOPOLOGY_WORKER_CHILDOPTS, topConf);
Double memTopologyWorkerChildopts = Utils.parseJvmHeapMemByChildOpts(
topologyWorkerChildopts, null);
List<String> workerChildopts = ConfigUtils.getValueAsList(
Config.WORKER_CHILDOPTS, topConf);
Double memWorkerChildopts = Utils.parseJvmHeapMemByChildOpts(
workerChildopts, null);
if (memGcChildopts != null) {
totalWorkerMemory += memGcChildopts;
} else if (memTopologyWorkerChildopts != null) {
totalWorkerMemory += memTopologyWorkerChildopts;
} else if (memWorkerChildopts != null) {
totalWorkerMemory += memWorkerChildopts;
} else {
Object workerHeapMemoryMb = topConf.get(
Config.WORKER_HEAP_MEMORY_MB);
totalWorkerMemory += ObjectReader.getInt(
workerHeapMemoryMb, topologyWorkerDefaultMemoryAllocation);
}
List<String> topoWorkerLwChildopts = ConfigUtils.getValueAsList(
Config.TOPOLOGY_WORKER_LOGWRITER_CHILDOPTS, topConf);
if (topoWorkerLwChildopts != null) {
totalWorkerMemory += Utils.parseJvmHeapMemByChildOpts(
topoWorkerLwChildopts, 0.0);
}
return totalWorkerMemory;
}
|
static double function(final Map<String, Object> topConf) { double totalWorkerMemory = 0.0; final Integer topologyWorkerDefaultMemoryAllocation = 768; List<String> topologyWorkerGcChildopts = ConfigUtils.getValueAsList( Config.TOPOLOGY_WORKER_GC_CHILDOPTS, topConf); List<String> workerGcChildopts = ConfigUtils.getValueAsList( Config.WORKER_GC_CHILDOPTS, topConf); Double memGcChildopts = null; memGcChildopts = Utils.parseJvmHeapMemByChildOpts( topologyWorkerGcChildopts, null); if (memGcChildopts == null) { memGcChildopts = Utils.parseJvmHeapMemByChildOpts( workerGcChildopts, null); } List<String> topologyWorkerChildopts = ConfigUtils.getValueAsList( Config.TOPOLOGY_WORKER_CHILDOPTS, topConf); Double memTopologyWorkerChildopts = Utils.parseJvmHeapMemByChildOpts( topologyWorkerChildopts, null); List<String> workerChildopts = ConfigUtils.getValueAsList( Config.WORKER_CHILDOPTS, topConf); Double memWorkerChildopts = Utils.parseJvmHeapMemByChildOpts( workerChildopts, null); if (memGcChildopts != null) { totalWorkerMemory += memGcChildopts; } else if (memTopologyWorkerChildopts != null) { totalWorkerMemory += memTopologyWorkerChildopts; } else if (memWorkerChildopts != null) { totalWorkerMemory += memWorkerChildopts; } else { Object workerHeapMemoryMb = topConf.get( Config.WORKER_HEAP_MEMORY_MB); totalWorkerMemory += ObjectReader.getInt( workerHeapMemoryMb, topologyWorkerDefaultMemoryAllocation); } List<String> topoWorkerLwChildopts = ConfigUtils.getValueAsList( Config.TOPOLOGY_WORKER_LOGWRITER_CHILDOPTS, topConf); if (topoWorkerLwChildopts != null) { totalWorkerMemory += Utils.parseJvmHeapMemByChildOpts( topoWorkerLwChildopts, 0.0); } return totalWorkerMemory; }
|
/**
* Get heap memory usage for a worker's main process and logwriter process.
*
* @param topConf - the topology config
* @return the assigned memory (in MB)
*/
|
Get heap memory usage for a worker's main process and logwriter process
|
getAssignedMemoryForSlot
|
{
"repo_name": "erikdw/storm",
"path": "storm-server/src/main/java/org/apache/storm/scheduler/Cluster.java",
"license": "apache-2.0",
"size": 36707
}
|
[
"java.util.List",
"java.util.Map",
"org.apache.storm.Config",
"org.apache.storm.utils.ConfigUtils",
"org.apache.storm.utils.ObjectReader",
"org.apache.storm.utils.Utils"
] |
import java.util.List; import java.util.Map; import org.apache.storm.Config; import org.apache.storm.utils.ConfigUtils; import org.apache.storm.utils.ObjectReader; import org.apache.storm.utils.Utils;
|
import java.util.*; import org.apache.storm.*; import org.apache.storm.utils.*;
|
[
"java.util",
"org.apache.storm"
] |
java.util; org.apache.storm;
| 103,035
|
static void reloadLuceneSPI(ClassLoader loader) {
// do NOT change the order of these method calls!
// Codecs:
PostingsFormat.reloadPostingsFormats(loader);
DocValuesFormat.reloadDocValuesFormats(loader);
Codec.reloadCodecs(loader);
// Analysis:
CharFilterFactory.reloadCharFilters(loader);
TokenFilterFactory.reloadTokenFilters(loader);
TokenizerFactory.reloadTokenizers(loader);
}
|
static void reloadLuceneSPI(ClassLoader loader) { PostingsFormat.reloadPostingsFormats(loader); DocValuesFormat.reloadDocValuesFormats(loader); Codec.reloadCodecs(loader); CharFilterFactory.reloadCharFilters(loader); TokenFilterFactory.reloadTokenFilters(loader); TokenizerFactory.reloadTokenizers(loader); }
|
/**
* Reloads all Lucene SPI implementations using the new classloader.
* This method must be called after the new classloader has been created to
* register the services for use.
*/
|
Reloads all Lucene SPI implementations using the new classloader. This method must be called after the new classloader has been created to register the services for use
|
reloadLuceneSPI
|
{
"repo_name": "gfyoung/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/plugins/PluginsService.java",
"license": "apache-2.0",
"size": 28221
}
|
[
"org.apache.lucene.analysis.util.CharFilterFactory",
"org.apache.lucene.analysis.util.TokenFilterFactory",
"org.apache.lucene.analysis.util.TokenizerFactory",
"org.apache.lucene.codecs.Codec",
"org.apache.lucene.codecs.DocValuesFormat",
"org.apache.lucene.codecs.PostingsFormat"
] |
import org.apache.lucene.analysis.util.CharFilterFactory; import org.apache.lucene.analysis.util.TokenFilterFactory; import org.apache.lucene.analysis.util.TokenizerFactory; import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.DocValuesFormat; import org.apache.lucene.codecs.PostingsFormat;
|
import org.apache.lucene.analysis.util.*; import org.apache.lucene.codecs.*;
|
[
"org.apache.lucene"
] |
org.apache.lucene;
| 2,264,221
|
public Set<Artifact> artifactClosureOf(Iterable<Artifact> artifacts) {
Set<Artifact> visited = new LinkedHashSet<>();
List<Artifact> toVisit = Lists.newArrayList(artifacts);
while (!toVisit.isEmpty()) {
Artifact current = toVisit.remove(0);
if (!visited.add(current)) {
continue;
}
Action generatingAction = actionGraph.getGeneratingAction(current);
if (generatingAction != null) {
Iterables.addAll(toVisit, generatingAction.getInputs());
}
}
return visited;
}
|
Set<Artifact> function(Iterable<Artifact> artifacts) { Set<Artifact> visited = new LinkedHashSet<>(); List<Artifact> toVisit = Lists.newArrayList(artifacts); while (!toVisit.isEmpty()) { Artifact current = toVisit.remove(0); if (!visited.add(current)) { continue; } Action generatingAction = actionGraph.getGeneratingAction(current); if (generatingAction != null) { Iterables.addAll(toVisit, generatingAction.getInputs()); } } return visited; }
|
/**
* Returns the closure over the input files of a set of artifacts.
*/
|
Returns the closure over the input files of a set of artifacts
|
artifactClosureOf
|
{
"repo_name": "wakashige/bazel",
"path": "src/test/java/com/google/devtools/build/lib/actions/util/ActionsTestUtil.java",
"license": "apache-2.0",
"size": 18348
}
|
[
"com.google.common.collect.Iterables",
"com.google.common.collect.Lists",
"com.google.devtools.build.lib.actions.Action",
"com.google.devtools.build.lib.actions.Artifact",
"java.util.LinkedHashSet",
"java.util.List",
"java.util.Set"
] |
import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.google.devtools.build.lib.actions.Action; import com.google.devtools.build.lib.actions.Artifact; import java.util.LinkedHashSet; import java.util.List; import java.util.Set;
|
import com.google.common.collect.*; import com.google.devtools.build.lib.actions.*; import java.util.*;
|
[
"com.google.common",
"com.google.devtools",
"java.util"
] |
com.google.common; com.google.devtools; java.util;
| 785,480
|
EReference getColumn_Cells();
|
EReference getColumn_Cells();
|
/**
* Returns the meta object for the reference list '{@link org.obeonetwork.dsl.connectfour.Column#getCells <em>Cells</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>Cells</em>'.
* @see org.obeonetwork.dsl.connectfour.Column#getCells()
* @see #getColumn()
* @generated
*/
|
Returns the meta object for the reference list '<code>org.obeonetwork.dsl.connectfour.Column#getCells Cells</code>'.
|
getColumn_Cells
|
{
"repo_name": "ejuliot/PlayWithSirius",
"path": "connectfour/plugins/org.obeonetwork.dsl.connectfour/src/org/obeonetwork/dsl/connectfour/ConnectfourPackage.java",
"license": "epl-1.0",
"size": 25290
}
|
[
"org.eclipse.emf.ecore.EReference"
] |
import org.eclipse.emf.ecore.EReference;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 210,576
|
@Nonnegative
public int collectUnfreshPeers() {
long now = System.currentTimeMillis();
int count = 0;
for (TrackedPeer peer : peers.values()) {
if (!peer.isFresh(now, getPeerExpiryInterval())) {
peers.remove(TorrentUtils.toHex(peer.getPeerId()), peer);
count++;
}
}
return count;
}
|
int function() { long now = System.currentTimeMillis(); int count = 0; for (TrackedPeer peer : peers.values()) { if (!peer.isFresh(now, getPeerExpiryInterval())) { peers.remove(TorrentUtils.toHex(peer.getPeerId()), peer); count++; } } return count; }
|
/**
* Remove unfresh peers from this torrent.
*
* <p>
* Collect and remove all non-fresh peers from this torrent. This is
* usually called by the periodic peer collector of the BitTorrent tracker.
* </p>
*/
|
Remove unfresh peers from this torrent. Collect and remove all non-fresh peers from this torrent. This is usually called by the periodic peer collector of the BitTorrent tracker.
|
collectUnfreshPeers
|
{
"repo_name": "letroll/TtorrentAndroid",
"path": "app/src/main/java/fr/letroll/ttorrentandroid/tracker/TrackedTorrent.java",
"license": "apache-2.0",
"size": 10687
}
|
[
"fr.letroll.ttorrentandroid.common.TorrentUtils"
] |
import fr.letroll.ttorrentandroid.common.TorrentUtils;
|
import fr.letroll.ttorrentandroid.common.*;
|
[
"fr.letroll.ttorrentandroid"
] |
fr.letroll.ttorrentandroid;
| 910,915
|
public Configuration copy() throws IOException {
JsonNode treeCopy = yamlMapper.valueToTree(this).deepCopy();
return yamlMapper.treeToValue(treeCopy, Configuration.class);
}
|
Configuration function() throws IOException { JsonNode treeCopy = yamlMapper.valueToTree(this).deepCopy(); return yamlMapper.treeToValue(treeCopy, Configuration.class); }
|
/**
* Make a copy of this configuration object.
*/
|
Make a copy of this configuration object
|
copy
|
{
"repo_name": "ViDA-NYU/ache",
"path": "ache/src/main/java/achecrawler/config/Configuration.java",
"license": "apache-2.0",
"size": 6462
}
|
[
"com.fasterxml.jackson.databind.JsonNode",
"java.io.IOException"
] |
import com.fasterxml.jackson.databind.JsonNode; import java.io.IOException;
|
import com.fasterxml.jackson.databind.*; import java.io.*;
|
[
"com.fasterxml.jackson",
"java.io"
] |
com.fasterxml.jackson; java.io;
| 666,273
|
private void write(final String str) {
try {
this.os.write(str.getBytes());
} catch (final IOException e) {
throw new BotError(e);
}
}
|
void function(final String str) { try { this.os.write(str.getBytes()); } catch (final IOException e) { throw new BotError(e); } }
|
/**
* Write the specified string, without a carriage return and line feed.
*
* @param str
* The String to write.
*/
|
Write the specified string, without a carriage return and line feed
|
write
|
{
"repo_name": "Crespo911/encog-java-core",
"path": "src/main/java/org/encog/util/http/FormUtility.java",
"license": "apache-2.0",
"size": 7086
}
|
[
"java.io.IOException",
"org.encog.bot.BotError"
] |
import java.io.IOException; import org.encog.bot.BotError;
|
import java.io.*; import org.encog.bot.*;
|
[
"java.io",
"org.encog.bot"
] |
java.io; org.encog.bot;
| 438,714
|
@Deprecated
@Override
public ActiveSpan log(long timestampMicroseconds, String eventName, Object payload) {
return this;
}
|
ActiveSpan function(long timestampMicroseconds, String eventName, Object payload) { return this; }
|
/**
* Don't support logging with payload.
*/
|
Don't support logging with payload
|
log
|
{
"repo_name": "zhangkewei/sky-walking",
"path": "apm-application-toolkit/apm-toolkit-opentracing/src/main/java/org/skywalking/apm/toolkit/opentracing/SkywalkingActiveSpan.java",
"license": "apache-2.0",
"size": 3382
}
|
[
"io.opentracing.ActiveSpan"
] |
import io.opentracing.ActiveSpan;
|
import io.opentracing.*;
|
[
"io.opentracing"
] |
io.opentracing;
| 694,581
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
String formatted = format.format(date);
view.setText(formatted);
}
|
SimpleDateFormat format = new SimpleDateFormat(STR); String formatted = format.format(date); view.setText(formatted); }
|
/**
* Simple binding adapter to convert long timestamp to a human-readable date.
* @param view
* @param date
*/
|
Simple binding adapter to convert long timestamp to a human-readable date
|
setText
|
{
"repo_name": "google/spline",
"path": "app/src/main/java/com/android/example/spline/bindingadapter/FileBindingAdapters.java",
"license": "apache-2.0",
"size": 1253
}
|
[
"java.text.SimpleDateFormat"
] |
import java.text.SimpleDateFormat;
|
import java.text.*;
|
[
"java.text"
] |
java.text;
| 1,663,712
|
@SuppressWarnings("ReturnOfCollectionOrArrayField")
protected List<String> getConfigurationsToCreate() {
return confClassnames;
}
|
@SuppressWarnings(STR) List<String> function() { return confClassnames; }
|
/**
* Override point: Get a list of configuration classes to create.
* @return the array of configs to attempt to create. If any are off the
* classpath, that is logged
*/
|
Override point: Get a list of configuration classes to create
|
getConfigurationsToCreate
|
{
"repo_name": "xiao-chen/hadoop",
"path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/service/launcher/ServiceLauncher.java",
"license": "apache-2.0",
"size": 34752
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 13,189
|
public static JBBPOut BeginBin() {
return new JBBPOut(new ByteArrayOutputStream(), DEFAULT_BYTE_ORDER, DEFAULT_BIT_ORDER);
}
|
static JBBPOut function() { return new JBBPOut(new ByteArrayOutputStream(), DEFAULT_BYTE_ORDER, DEFAULT_BIT_ORDER); }
|
/**
* Start a DSL session for default parameters and inside byte array stream.
*
* @return the new DSL session generated with the default parameters and
* inside byte array stream.
*/
|
Start a DSL session for default parameters and inside byte array stream
|
BeginBin
|
{
"repo_name": "raydac/java-binary-block-parser",
"path": "jbbp/src/main/java/com/igormaznitsa/jbbp/io/JBBPOut.java",
"license": "apache-2.0",
"size": 39215
}
|
[
"java.io.ByteArrayOutputStream"
] |
import java.io.ByteArrayOutputStream;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,514,526
|
void setResponse(Message param, CellScanner cells, Throwable errorThrowable, String error);
|
void setResponse(Message param, CellScanner cells, Throwable errorThrowable, String error);
|
/**
* Set the response resulting from this RPC call.
* @param param The result message as response.
* @param cells The CellScanner that possibly carries the payload.
* @param errorThrowable The error Throwable resulting from the call.
* @param error Extra error message.
*/
|
Set the response resulting from this RPC call
|
setResponse
|
{
"repo_name": "JingchengDu/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcCall.java",
"license": "apache-2.0",
"size": 3987
}
|
[
"org.apache.hadoop.hbase.CellScanner",
"org.apache.hadoop.hbase.shaded.com.google.protobuf.Message"
] |
import org.apache.hadoop.hbase.CellScanner; import org.apache.hadoop.hbase.shaded.com.google.protobuf.Message;
|
import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.shaded.com.google.protobuf.*;
|
[
"org.apache.hadoop"
] |
org.apache.hadoop;
| 160,723
|
public void setStatusString(String status) {
setStatus(EnumResourceStatus.valueOf(status.toUpperCase(Locale.ROOT)));
}
private Equipment(Parcel in) {
setId(in.readInt());
setName(in.readString());
setStatusString(in.readString());
setDescription(in.readString());
}
|
void function(String status) { setStatus(EnumResourceStatus.valueOf(status.toUpperCase(Locale.ROOT))); } Equipment(Parcel in) { setId(in.readInt()); setName(in.readString()); function(in.readString()); setDescription(in.readString()); }
|
/**
* Set the status as String value.
* @param status
*/
|
Set the status as String value
|
setStatusString
|
{
"repo_name": "marcusfelipetm/jemf",
"path": "src/br/ufrj/ppgi/jemf/mobile/bean/Equipment.java",
"license": "gpl-3.0",
"size": 4606
}
|
[
"android.os.Parcel",
"br.ufrj.ppgi.jemf.core.coordination.EnumResourceStatus",
"java.util.Locale"
] |
import android.os.Parcel; import br.ufrj.ppgi.jemf.core.coordination.EnumResourceStatus; import java.util.Locale;
|
import android.os.*; import br.ufrj.ppgi.jemf.core.coordination.*; import java.util.*;
|
[
"android.os",
"br.ufrj.ppgi",
"java.util"
] |
android.os; br.ufrj.ppgi; java.util;
| 2,819,922
|
protected final Map<String, MemberDescriptor<E>> getMembers() {
return this.members;
}
|
final Map<String, MemberDescriptor<E>> function() { return this.members; }
|
/**
* Gets the value for the members field.
*
* @return The value for the members field.
*/
|
Gets the value for the members field
|
getMembers
|
{
"repo_name": "lunarray-org/model-descriptor",
"path": "src/main/java/org/lunarray/model/descriptor/builder/annotation/base/builders/entity/AbstractEntityDescriptorBuilder.java",
"license": "lgpl-3.0",
"size": 14756
}
|
[
"java.util.Map",
"org.lunarray.model.descriptor.model.member.MemberDescriptor"
] |
import java.util.Map; import org.lunarray.model.descriptor.model.member.MemberDescriptor;
|
import java.util.*; import org.lunarray.model.descriptor.model.member.*;
|
[
"java.util",
"org.lunarray.model"
] |
java.util; org.lunarray.model;
| 1,039,943
|
public void test_toString() {
int[] pos = { 0, 1, 1000, Integer.MAX_VALUE, (Integer.MAX_VALUE - 1) };
SSLEngineResult.Status [] enS =
SSLEngineResult.Status.values();
SSLEngineResult.HandshakeStatus [] enHS =
SSLEngineResult.HandshakeStatus.values();
for (int i = 0; i < enS.length; i++) {
for (int j = 0; j < enHS.length; j++) {
for (int n = 0; n < pos.length; n++) {
for (int l = 0; l < pos.length; ++l) {
SSLEngineResult res = new SSLEngineResult(enS[i],
enHS[j], pos[n], pos[l]);
assertNotNull("Result of toSring() method is null",
res.toString());
}
}
}
}
}
|
void function() { int[] pos = { 0, 1, 1000, Integer.MAX_VALUE, (Integer.MAX_VALUE - 1) }; SSLEngineResult.Status [] enS = SSLEngineResult.Status.values(); SSLEngineResult.HandshakeStatus [] enHS = SSLEngineResult.HandshakeStatus.values(); for (int i = 0; i < enS.length; i++) { for (int j = 0; j < enHS.length; j++) { for (int n = 0; n < pos.length; n++) { for (int l = 0; l < pos.length; ++l) { SSLEngineResult res = new SSLEngineResult(enS[i], enHS[j], pos[n], pos[l]); assertNotNull(STR, res.toString()); } } } } }
|
/**
* Test for <code>toString()</code> method
*/
|
Test for <code>toString()</code> method
|
test_toString
|
{
"repo_name": "mirego/j2objc",
"path": "jre_emul/android/platform/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/SSLEngineResultTest.java",
"license": "apache-2.0",
"size": 8348
}
|
[
"javax.net.ssl.SSLEngineResult"
] |
import javax.net.ssl.SSLEngineResult;
|
import javax.net.ssl.*;
|
[
"javax.net"
] |
javax.net;
| 1,775,771
|
@Nullable @Optional @Input
String getMinHeapSize();
|
@Nullable @Optional String getMinHeapSize();
|
/**
* Returns the minimum heap size for the process, if any.
*
* @return The minimum heap size. Returns null if the default minimum heap size should be used.
*/
|
Returns the minimum heap size for the process, if any
|
getMinHeapSize
|
{
"repo_name": "lsmaira/gradle",
"path": "subprojects/core-api/src/main/java/org/gradle/process/JavaForkOptions.java",
"license": "apache-2.0",
"size": 8888
}
|
[
"javax.annotation.Nullable",
"org.gradle.api.tasks.Optional"
] |
import javax.annotation.Nullable; import org.gradle.api.tasks.Optional;
|
import javax.annotation.*; import org.gradle.api.tasks.*;
|
[
"javax.annotation",
"org.gradle.api"
] |
javax.annotation; org.gradle.api;
| 2,250,388
|
private void initializePanels() {
// Adding Select data category pane
treeViewScrollPane = new JScrollPane(dataCategoryPanel);
treeViewScrollPane.getViewport().setBackground(Color.WHITE);
treeViewScrollPane.setPreferredSize(new Dimension(250, 200));
treeViewScrollPane.setBorder(null);
stackedBox.addBox("Experiment Data", treeViewScrollPane, SELECT_DATA_CATEGORY, false);
// Adding Filter data category panel
dataFilterPanel = new Cab2bPanel(new RiverLayout(0, 5));
dataFilterPanel.setPreferredSize(new Dimension(250, 200));
dataFilterPanel.setOpaque(false);
dataFilterPanel.setBorder(null);
dataFilterPanel.add(new ColumnFilterVerticalConsole());
stackedBox.addBox("Filters", dataFilterPanel, FILTER_DATA, true);
// Adding Visualize data panel
visualiseDataPanel = new Cab2bPanel(new RiverLayout(0, 5));
visualiseDataPanel.setPreferredSize(new Dimension(250, 100));
visualiseDataPanel.setOpaque(false);
visualiseDataPanel.setBorder(null);
visualiseDataPanel.removeAll();
// Set the type of charts to be displayed.
setBarChartLink();
setLineChartLink();
setScatterPlotLink();
stackedBox.addBox("Visualize Data ", visualiseDataPanel, VISUALIZE_DATA, true);
// Adding Analyse data panel
analyseDataPanel = new Cab2bPanel(new RiverLayout(0, 5));
analyseDataPanel.setPreferredSize(new Dimension(250, 150));
analyseDataPanel.setOpaque(false);
analyseDataPanel.setBorder(null);
stackedBox.addBox("Analyze Data ", analyseDataPanel, ANALYZE_DATA, true);
stackedBox.setPreferredSize(new Dimension(250, 500));
stackedBox.setMinimumSize(new Dimension(250, 500));
stackedBox.setBorder(BorderFactory.createLineBorder(new Color(200, 200, 220)));
stackedBox.revalidate();
this.add(stackedBox);
updateUI();
}
|
void function() { treeViewScrollPane = new JScrollPane(dataCategoryPanel); treeViewScrollPane.getViewport().setBackground(Color.WHITE); treeViewScrollPane.setPreferredSize(new Dimension(250, 200)); treeViewScrollPane.setBorder(null); stackedBox.addBox(STR, treeViewScrollPane, SELECT_DATA_CATEGORY, false); dataFilterPanel = new Cab2bPanel(new RiverLayout(0, 5)); dataFilterPanel.setPreferredSize(new Dimension(250, 200)); dataFilterPanel.setOpaque(false); dataFilterPanel.setBorder(null); dataFilterPanel.add(new ColumnFilterVerticalConsole()); stackedBox.addBox(STR, dataFilterPanel, FILTER_DATA, true); visualiseDataPanel = new Cab2bPanel(new RiverLayout(0, 5)); visualiseDataPanel.setPreferredSize(new Dimension(250, 100)); visualiseDataPanel.setOpaque(false); visualiseDataPanel.setBorder(null); visualiseDataPanel.removeAll(); setBarChartLink(); setLineChartLink(); setScatterPlotLink(); stackedBox.addBox(STR, visualiseDataPanel, VISUALIZE_DATA, true); analyseDataPanel = new Cab2bPanel(new RiverLayout(0, 5)); analyseDataPanel.setPreferredSize(new Dimension(250, 150)); analyseDataPanel.setOpaque(false); analyseDataPanel.setBorder(null); stackedBox.addBox(STR, analyseDataPanel, ANALYZE_DATA, true); stackedBox.setPreferredSize(new Dimension(250, 500)); stackedBox.setMinimumSize(new Dimension(250, 500)); stackedBox.setBorder(BorderFactory.createLineBorder(new Color(200, 200, 220))); stackedBox.revalidate(); this.add(stackedBox); updateUI(); }
|
/**
* This method initialzse the different UI panels and panes.
*/
|
This method initialzse the different UI panels and panes
|
initializePanels
|
{
"repo_name": "NCIP/cab2b",
"path": "software/cab2b/src/java/client/edu/wustl/cab2b/client/ui/experiment/ExperimentStackBox.java",
"license": "bsd-3-clause",
"size": 41479
}
|
[
"edu.wustl.cab2b.client.ui.controls.Cab2bPanel",
"edu.wustl.cab2b.client.ui.controls.RiverLayout",
"edu.wustl.cab2b.client.ui.controls.sheet.ColumnFilterVerticalConsole",
"java.awt.Color",
"java.awt.Dimension",
"javax.swing.BorderFactory",
"javax.swing.JScrollPane"
] |
import edu.wustl.cab2b.client.ui.controls.Cab2bPanel; import edu.wustl.cab2b.client.ui.controls.RiverLayout; import edu.wustl.cab2b.client.ui.controls.sheet.ColumnFilterVerticalConsole; import java.awt.Color; import java.awt.Dimension; import javax.swing.BorderFactory; import javax.swing.JScrollPane;
|
import edu.wustl.cab2b.client.ui.controls.*; import edu.wustl.cab2b.client.ui.controls.sheet.*; import java.awt.*; import javax.swing.*;
|
[
"edu.wustl.cab2b",
"java.awt",
"javax.swing"
] |
edu.wustl.cab2b; java.awt; javax.swing;
| 1,439,365
|
default Stream<? extends RegisteredService> getAllServicesStream() {
return getAllServices().stream();
}
|
default Stream<? extends RegisteredService> getAllServicesStream() { return getAllServices().stream(); }
|
/**
* Gets services stream.
* <p>
* The returning stream may be bound to an IO channel (such as database connection),
* so it should be properly closed after usage.
*
* @return the services stream
*/
|
Gets services stream. The returning stream may be bound to an IO channel (such as database connection), so it should be properly closed after usage
|
getAllServicesStream
|
{
"repo_name": "philliprower/cas",
"path": "api/cas-server-core-api-services/src/main/java/org/apereo/cas/services/ServicesManager.java",
"license": "apache-2.0",
"size": 5073
}
|
[
"java.util.stream.Stream"
] |
import java.util.stream.Stream;
|
import java.util.stream.*;
|
[
"java.util"
] |
java.util;
| 762,173
|
//-------------------------------------------------------------------------
public static void writeCurveGroup(File file, CurveGroup... groups) {
try (Writer writer = new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8)) {
writeCurveGroup(writer, groups);
} catch (IOException ex) {
throw new UncheckedIOException(ex);
}
}
|
static void function(File file, CurveGroup... groups) { try (Writer writer = new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8)) { writeCurveGroup(writer, groups); } catch (IOException ex) { throw new UncheckedIOException(ex); } }
|
/**
* Writes the curve group in a CSV format to a file.
*
* @param file the file
* @param groups the curve groups
*/
|
Writes the curve group in a CSV format to a file
|
writeCurveGroup
|
{
"repo_name": "ChinaQuants/Strata",
"path": "modules/loader/src/main/java/com/opengamma/strata/loader/csv/CurveGroupDefinitionCsvLoader.java",
"license": "apache-2.0",
"size": 12545
}
|
[
"com.opengamma.strata.market.curve.CurveGroup",
"java.io.File",
"java.io.FileOutputStream",
"java.io.IOException",
"java.io.OutputStreamWriter",
"java.io.UncheckedIOException",
"java.io.Writer",
"java.nio.charset.StandardCharsets"
] |
import com.opengamma.strata.market.curve.CurveGroup; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.UncheckedIOException; import java.io.Writer; import java.nio.charset.StandardCharsets;
|
import com.opengamma.strata.market.curve.*; import java.io.*; import java.nio.charset.*;
|
[
"com.opengamma.strata",
"java.io",
"java.nio"
] |
com.opengamma.strata; java.io; java.nio;
| 1,907,236
|
@Aspect(advice = org.support.project.ormapping.transaction.Transaction.class)
public void delete(String serviceName) {
DBUserPool pool = Container.getComp(DBUserPool.class);
Integer user = (Integer) pool.getUser();
delete(user, serviceName);
}
|
@Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) void function(String serviceName) { DBUserPool pool = Container.getComp(DBUserPool.class); Integer user = (Integer) pool.getUser(); delete(user, serviceName); }
|
/**
* Delete.
* if delete flag is exists, the data is logical delete.
* @param serviceName serviceName
*/
|
Delete. if delete flag is exists, the data is logical delete
|
delete
|
{
"repo_name": "support-project/knowledge",
"path": "src/main/java/org/support/project/knowledge/dao/gen/GenServiceConfigsDao.java",
"license": "apache-2.0",
"size": 16811
}
|
[
"org.support.project.aop.Aspect",
"org.support.project.di.Container",
"org.support.project.ormapping.common.DBUserPool"
] |
import org.support.project.aop.Aspect; import org.support.project.di.Container; import org.support.project.ormapping.common.DBUserPool;
|
import org.support.project.aop.*; import org.support.project.di.*; import org.support.project.ormapping.common.*;
|
[
"org.support.project"
] |
org.support.project;
| 1,291,149
|
@Override
public void write(byte[] b, int off, int len) throws IOException {
long start = range.getFirstBytePos();
Long end = range.getLastBytePos();
if (pos + len >= start && (end == null || pos <= end)) {
long skipStart = Math.max(0, start - pos);
long newOff = off + skipStart;
long newLen = len - skipStart;
if (end != null) {
newLen = min(newLen, end - pos + 1, end - start + 1);
}
out.write(b, (int) newOff, (int) newLen);
}
pos += len;
}
|
void function(byte[] b, int off, int len) throws IOException { long start = range.getFirstBytePos(); Long end = range.getLastBytePos(); if (pos + len >= start && (end == null pos <= end)) { long skipStart = Math.max(0, start - pos); long newOff = off + skipStart; long newLen = len - skipStart; if (end != null) { newLen = min(newLen, end - pos + 1, end - start + 1); } out.write(b, (int) newOff, (int) newLen); } pos += len; }
|
/**
* Writes the subset of the bytes that are within the range.
*
* @param b The bytes to write.
* @param off The offset to start at.
* @param len The number of bytes to write.
* @throws IOException Thrown if there was a problem writing to the stream.
*/
|
Writes the subset of the bytes that are within the range
|
write
|
{
"repo_name": "MadMarty/madsonic-server-5.1",
"path": "madsonic-main/src/main/java/org/madsonic/io/RangeOutputStream.java",
"license": "gpl-3.0",
"size": 3157
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,968,397
|
public ResourceService getResourceService() {
return resourceService;
}
|
ResourceService function() { return resourceService; }
|
/**
* Returns the resource remote service.
*
* @return the resource remote service
*/
|
Returns the resource remote service
|
getResourceService
|
{
"repo_name": "fraunhoferfokus/govapps",
"path": "data-portlet/src/main/java/de/fraunhofer/fokus/movepla/service/base/EntitlementLocalServiceBaseImpl.java",
"license": "bsd-3-clause",
"size": 42460
}
|
[
"com.liferay.portal.service.ResourceService"
] |
import com.liferay.portal.service.ResourceService;
|
import com.liferay.portal.service.*;
|
[
"com.liferay.portal"
] |
com.liferay.portal;
| 2,476,738
|
public Properties asProperties() {
Properties properties = new Properties();
set(properties, "service", getService());
set(properties, "max_timeout", getMaxTimeout());
set(properties, "default_jta_timeout", getDefaultJtaTimeout());
set(properties, "max_actives", getMaxActives());
set(properties, "enable_logging", isEnableLogging());
set(properties, "tm_unique_name", getTransactionManagerUniqueName());
set(properties, "serial_jta_transactions", isSerialJtaTransactions());
set(properties, "force_shutdown_on_vm_exit", isForceShutdownOnVmExit());
set(properties, "log_base_name", getLogBaseName());
set(properties, "log_base_dir", getLogBaseDir());
set(properties, "checkpoint_interval", getCheckpointInterval());
set(properties, "console_log_level", getConsoleLogLevel());
set(properties, "output_dir", getOutputDir());
set(properties, "console_file_name", getConsoleFileName());
set(properties, "console_file_count", getConsoleFileCount());
set(properties, "console_file_limit", getConsoleFileLimit());
set(properties, "threaded_2pc", isThreadedTwoPhaseCommit());
return properties;
}
|
Properties function() { Properties properties = new Properties(); set(properties, STR, getService()); set(properties, STR, getMaxTimeout()); set(properties, STR, getDefaultJtaTimeout()); set(properties, STR, getMaxActives()); set(properties, STR, isEnableLogging()); set(properties, STR, getTransactionManagerUniqueName()); set(properties, STR, isSerialJtaTransactions()); set(properties, STR, isForceShutdownOnVmExit()); set(properties, STR, getLogBaseName()); set(properties, STR, getLogBaseDir()); set(properties, STR, getCheckpointInterval()); set(properties, STR, getConsoleLogLevel()); set(properties, STR, getOutputDir()); set(properties, STR, getConsoleFileName()); set(properties, STR, getConsoleFileCount()); set(properties, STR, getConsoleFileLimit()); set(properties, STR, isThreadedTwoPhaseCommit()); return properties; }
|
/**
* Returns the properties as a {@link Properties} object that can be used with
* Atomikos.
* @return the properties
*/
|
Returns the properties as a <code>Properties</code> object that can be used with Atomikos
|
asProperties
|
{
"repo_name": "shangyi0102/spring-boot",
"path": "spring-boot/src/main/java/org/springframework/boot/jta/atomikos/AtomikosProperties.java",
"license": "apache-2.0",
"size": 12875
}
|
[
"java.util.Properties"
] |
import java.util.Properties;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,257,194
|
public Builder setSSLConf(Configuration sslCnf) {
this.sslConf = sslCnf;
return this;
}
|
Builder function(Configuration sslCnf) { this.sslConf = sslCnf; return this; }
|
/**
* Specify the SSL configuration to load. This API provides an alternative
* to keyStore/keyPassword/trustStore.
*/
|
Specify the SSL configuration to load. This API provides an alternative to keyStore/keyPassword/trustStore
|
setSSLConf
|
{
"repo_name": "soumabrata-chakraborty/hadoop",
"path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer2.java",
"license": "apache-2.0",
"size": 58537
}
|
[
"org.apache.hadoop.conf.Configuration"
] |
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.*;
|
[
"org.apache.hadoop"
] |
org.apache.hadoop;
| 2,253,532
|
@Test
public void testCreateClassLoaderTwiceSameCachedData() {
String expectedDexName = WebApkCommonUtils.getRuntimeDexName(REMOTE_DEX_VERSION);
HostBrowserClassLoader.createClassLoader(mContext, mRemoteContext, mMockDexLoader, null);
verifyDexLoaderLoadCall(expectedDexName);
Mockito.reset(mMockDexLoader);
HostBrowserClassLoader.createClassLoader(mContext, mRemoteContext, mMockDexLoader, null);
verifyDexLoaderLoadCall(expectedDexName);
Mockito.verify(mMockDexLoader, Mockito.never()).deleteCachedDexes(Mockito.any(File.class));
}
|
void function() { String expectedDexName = WebApkCommonUtils.getRuntimeDexName(REMOTE_DEX_VERSION); HostBrowserClassLoader.createClassLoader(mContext, mRemoteContext, mMockDexLoader, null); verifyDexLoaderLoadCall(expectedDexName); Mockito.reset(mMockDexLoader); HostBrowserClassLoader.createClassLoader(mContext, mRemoteContext, mMockDexLoader, null); verifyDexLoaderLoadCall(expectedDexName); Mockito.verify(mMockDexLoader, Mockito.never()).deleteCachedDexes(Mockito.any(File.class)); }
|
/**
* Test that HostBrowserClassLoader#deleteCachedDexes() is not called if nothing has changed
* between calls to HostBrowserClassLoader#createClassLoader().
*/
|
Test that HostBrowserClassLoader#deleteCachedDexes() is not called if nothing has changed between calls to HostBrowserClassLoader#createClassLoader()
|
testCreateClassLoaderTwiceSameCachedData
|
{
"repo_name": "ric2b/Vivaldi-browser",
"path": "chromium/chrome/android/webapk/shell_apk/junit/src/org/chromium/webapk/shell_apk/HostBrowserClassLoaderTest.java",
"license": "bsd-3-clause",
"size": 6431
}
|
[
"java.io.File",
"org.chromium.webapk.lib.common.WebApkCommonUtils",
"org.mockito.Mockito"
] |
import java.io.File; import org.chromium.webapk.lib.common.WebApkCommonUtils; import org.mockito.Mockito;
|
import java.io.*; import org.chromium.webapk.lib.common.*; import org.mockito.*;
|
[
"java.io",
"org.chromium.webapk",
"org.mockito"
] |
java.io; org.chromium.webapk; org.mockito;
| 285,470
|
private SocketAndStreams getSocketAndStreams(SocketDestination destination)
throws IOException {
ByteArray keyBytes = new ByteArray(ByteUtils.getBytes(MetadataStore.SERVER_STATE_KEY,
"UTF-8"));
VAdminProto.VoldemortAdminRequest request = VAdminProto.VoldemortAdminRequest.newBuilder()
.setType(VAdminProto.AdminRequestType.GET_METADATA)
.setGetMetadata(VAdminProto.GetMetadataRequest.newBuilder()
.setKey(ByteString.copyFrom(keyBytes.get())))
.build();
SocketAndStreams sands = socketPool.checkout(destination);
try {
rpcOps.innerSendAndReceive(sands,
request,
VAdminProto.GetMetadataResponse.newBuilder());
} catch(EOFException eofe) {
helperOps.close(sands.getSocket());
socketPool.checkin(destination, sands);
socketPool.close(destination);
sands = socketPool.checkout(destination);
System.out.println("Socket connection to " + destination.getHost() + ":"
+ destination.getPort() + " was stale and it's now refreshed.");
}
return sands;
}
|
SocketAndStreams function(SocketDestination destination) throws IOException { ByteArray keyBytes = new ByteArray(ByteUtils.getBytes(MetadataStore.SERVER_STATE_KEY, "UTF-8")); VAdminProto.VoldemortAdminRequest request = VAdminProto.VoldemortAdminRequest.newBuilder() .setType(VAdminProto.AdminRequestType.GET_METADATA) .setGetMetadata(VAdminProto.GetMetadataRequest.newBuilder() .setKey(ByteString.copyFrom(keyBytes.get()))) .build(); SocketAndStreams sands = socketPool.checkout(destination); try { rpcOps.innerSendAndReceive(sands, request, VAdminProto.GetMetadataResponse.newBuilder()); } catch(EOFException eofe) { helperOps.close(sands.getSocket()); socketPool.checkin(destination, sands); socketPool.close(destination); sands = socketPool.checkout(destination); System.out.println(STR + destination.getHost() + ":" + destination.getPort() + STR); } return sands; }
|
/**
* tests socket connection by sending a get metadata request
*
* @throws IOException
*/
|
tests socket connection by sending a get metadata request
|
getSocketAndStreams
|
{
"repo_name": "bitti/voldemort",
"path": "src/java/voldemort/client/protocol/admin/AdminClient.java",
"license": "apache-2.0",
"size": 288293
}
|
[
"com.google.protobuf.ByteString",
"java.io.EOFException",
"java.io.IOException"
] |
import com.google.protobuf.ByteString; import java.io.EOFException; import java.io.IOException;
|
import com.google.protobuf.*; import java.io.*;
|
[
"com.google.protobuf",
"java.io"
] |
com.google.protobuf; java.io;
| 229,126
|
public double score(Iterator<LabelPair<L>> iter);
|
double function(Iterator<LabelPair<L>> iter);
|
/**
* Calculates score.
*
* @param iter Iterator that supplies pairs of truth values and predicated.
* @return Score.
*/
|
Calculates score
|
score
|
{
"repo_name": "alexzaitzev/ignite",
"path": "modules/ml/src/main/java/org/apache/ignite/ml/selection/scoring/metric/Metric.java",
"license": "apache-2.0",
"size": 1285
}
|
[
"java.util.Iterator",
"org.apache.ignite.ml.selection.scoring.LabelPair"
] |
import java.util.Iterator; import org.apache.ignite.ml.selection.scoring.LabelPair;
|
import java.util.*; import org.apache.ignite.ml.selection.scoring.*;
|
[
"java.util",
"org.apache.ignite"
] |
java.util; org.apache.ignite;
| 2,431,208
|
public static boolean isExactSegmentLabel(Map map) {
Boolean bool = (Boolean) map.get(EXACTSEGMENTRELATIVE);
if (bool != null)
return bool.booleanValue();
return false;
}
|
static boolean function(Map map) { Boolean bool = (Boolean) map.get(EXACTSEGMENTRELATIVE); if (bool != null) return bool.booleanValue(); return false; }
|
/**
* Returns whether the exact segment is worked out for placement of labels
* along edges for the specified cell.
*
* @param map
* the attribute map for the cell being tested for this
* condition.
* @return whether or not exact segments should be calculated on this cell
*/
|
Returns whether the exact segment is worked out for placement of labels along edges for the specified cell
|
isExactSegmentLabel
|
{
"repo_name": "Baltasarq/Gia",
"path": "src/JGraph/src/org/jgraph/graph/GraphConstants.java",
"license": "mit",
"size": 48823
}
|
[
"java.util.Map"
] |
import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,183,872
|
public void onItemStateChanged(@NonNull K key, boolean selected) {
}
|
void function(@NonNull K key, boolean selected) { }
|
/**
* Called when the state of an item has been changed.
*/
|
Called when the state of an item has been changed
|
onItemStateChanged
|
{
"repo_name": "aosp-mirror/platform_frameworks_support",
"path": "recyclerview-selection/src/main/java/androidx/recyclerview/selection/SelectionTracker.java",
"license": "apache-2.0",
"size": 31952
}
|
[
"androidx.annotation.NonNull"
] |
import androidx.annotation.NonNull;
|
import androidx.annotation.*;
|
[
"androidx.annotation"
] |
androidx.annotation;
| 981,377
|
@Deprecated
public static <K, V> Multimap<K, V> unmodifiableMultimap(ImmutableMultimap<K, V> delegate) {
return checkNotNull(delegate);
}
private static class UnmodifiableMultimap<K, V> extends ForwardingMultimap<K, V>
implements Serializable {
final Multimap<K, V> delegate;
transient Collection<Entry<K, V>> entries;
transient Multiset<K> keys;
transient Set<K> keySet;
transient Collection<V> values;
transient Map<K, Collection<V>> map;
UnmodifiableMultimap(final Multimap<K, V> delegate) {
this.delegate = checkNotNull(delegate);
}
|
static <K, V> Multimap<K, V> function(ImmutableMultimap<K, V> delegate) { return checkNotNull(delegate); } private static class UnmodifiableMultimap<K, V> extends ForwardingMultimap<K, V> implements Serializable { final Multimap<K, V> delegate; transient Collection<Entry<K, V>> entries; transient Multiset<K> keys; transient Set<K> keySet; transient Collection<V> values; transient Map<K, Collection<V>> map; UnmodifiableMultimap(final Multimap<K, V> delegate) { this.delegate = checkNotNull(delegate); }
|
/**
* Simply returns its argument.
*
* @deprecated no need to use this
* @since 10.0
*/
|
Simply returns its argument
|
unmodifiableMultimap
|
{
"repo_name": "paulmartel/voltdb",
"path": "third_party/java/src/com/google_voltpatches/common/collect/Multimaps.java",
"license": "agpl-3.0",
"size": 79260
}
|
[
"com.google_voltpatches.common.base.Preconditions",
"java.io.Serializable",
"java.util.Collection",
"java.util.Map",
"java.util.Set"
] |
import com.google_voltpatches.common.base.Preconditions; import java.io.Serializable; import java.util.Collection; import java.util.Map; import java.util.Set;
|
import com.google_voltpatches.common.base.*; import java.io.*; import java.util.*;
|
[
"com.google_voltpatches.common",
"java.io",
"java.util"
] |
com.google_voltpatches.common; java.io; java.util;
| 733,601
|
return new BigInteger(new StringBuilder().append(n).reverse().toString());
}
|
return new BigInteger(new StringBuilder().append(n).reverse().toString()); }
|
/**
* Reverses the number {@param n}.
*
* @param n
* @return the reverse of the number {@param n}.
*/
|
Reverses the number n
|
getReverse
|
{
"repo_name": "ramswaroop/Algorithms-and-Data-Structures-in-Java",
"path": "src/main/java/com/rampatra/misc/ReverseAndAdd.java",
"license": "mit",
"size": 2818
}
|
[
"java.math.BigInteger"
] |
import java.math.BigInteger;
|
import java.math.*;
|
[
"java.math"
] |
java.math;
| 1,563,778
|
public RunListBuilder addRecipes(String... recipes) {
addAll(list, transform(Arrays.asList(checkNotNull(recipes, "recipes")), new Function<String, String>() {
|
RunListBuilder function(String... recipes) { addAll(list, transform(Arrays.asList(checkNotNull(recipes, STR)), new Function<String, String>() {
|
/**
* Add the following recipes to the run list
*/
|
Add the following recipes to the run list
|
addRecipes
|
{
"repo_name": "jclouds/legacy-jclouds-chef",
"path": "core/src/main/java/org/jclouds/chef/util/RunListBuilder.java",
"license": "apache-2.0",
"size": 2552
}
|
[
"com.google.common.base.Function",
"com.google.common.collect.Iterables",
"com.google.common.collect.Lists",
"java.util.Arrays"
] |
import com.google.common.base.Function; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import java.util.Arrays;
|
import com.google.common.base.*; import com.google.common.collect.*; import java.util.*;
|
[
"com.google.common",
"java.util"
] |
com.google.common; java.util;
| 2,603,391
|
public List<Element> getDescriptor();
|
List<Element> function();
|
/**
* Returns a descriptor data stream (DC/NSSESS/...)
*
* @return
*/
|
Returns a descriptor data stream (DC/NSSESS/...)
|
getDescriptor
|
{
"repo_name": "proarc/proarc",
"path": "proarc-common/src/main/java/cz/cas/lib/proarc/common/export/desa/structure/IDesaElement.java",
"license": "gpl-3.0",
"size": 3909
}
|
[
"java.util.List",
"org.w3c.dom.Element"
] |
import java.util.List; import org.w3c.dom.Element;
|
import java.util.*; import org.w3c.dom.*;
|
[
"java.util",
"org.w3c.dom"
] |
java.util; org.w3c.dom;
| 220,464
|
private void cmd_button()
{
log.config("Activity=" + m_activity);
if (m_activity == null)
return;
//
MWFNode node = m_activity.getNode();
if (MWFNode.ACTION_UserWindow.equals(node.getAction()))
{
int AD_Window_ID = node.getAD_Window_ID(); // Explicit Window
String ColumnName = m_activity.getPO().get_TableName() + "_ID";
int Record_ID = m_activity.getRecord_ID();
MQuery query = MQuery.getEqualQuery(ColumnName, Record_ID);
boolean IsSOTrx = m_activity.isSOTrx();
//
log.info("Zoom to AD_Window_ID=" + AD_Window_ID
+ " - " + query + " (IsSOTrx=" + IsSOTrx + ")");
AWindow frame = new AWindow();
if (!frame.initWindow(AD_Window_ID, query))
return;
AEnv.addToWindowManager(frame);
AEnv.showCenterScreen(frame);
frame = null;
}
else if (MWFNode.ACTION_UserForm.equals(node.getAction()))
{
int AD_Form_ID = node.getAD_Form_ID();
FormFrame ff = new FormFrame();
ff.openForm(AD_Form_ID);
ff.pack();
AEnv.addToWindowManager(ff);
AEnv.showCenterScreen(ff);
}
else
log.log(Level.SEVERE, "No User Action:" + node.getAction());
} // cmd_button
|
void function() { log.config(STR + m_activity); if (m_activity == null) return; MWFNode node = m_activity.getNode(); if (MWFNode.ACTION_UserWindow.equals(node.getAction())) { int AD_Window_ID = node.getAD_Window_ID(); String ColumnName = m_activity.getPO().get_TableName() + "_ID"; int Record_ID = m_activity.getRecord_ID(); MQuery query = MQuery.getEqualQuery(ColumnName, Record_ID); boolean IsSOTrx = m_activity.isSOTrx(); log.info(STR + AD_Window_ID + STR + query + STR + IsSOTrx + ")"); AWindow frame = new AWindow(); if (!frame.initWindow(AD_Window_ID, query)) return; AEnv.addToWindowManager(frame); AEnv.showCenterScreen(frame); frame = null; } else if (MWFNode.ACTION_UserForm.equals(node.getAction())) { int AD_Form_ID = node.getAD_Form_ID(); FormFrame ff = new FormFrame(); ff.openForm(AD_Form_ID); ff.pack(); AEnv.addToWindowManager(ff); AEnv.showCenterScreen(ff); } else log.log(Level.SEVERE, STR + node.getAction()); }
|
/**
* Answer Button
*/
|
Answer Button
|
cmd_button
|
{
"repo_name": "arthurmelo88/palmetalADP",
"path": "adempiere_360/client/src/org/compiere/apps/wf/WFActivity.java",
"license": "gpl-2.0",
"size": 25927
}
|
[
"java.util.logging.Level",
"org.compiere.apps.AEnv",
"org.compiere.apps.AWindow",
"org.compiere.apps.form.FormFrame",
"org.compiere.model.MQuery",
"org.compiere.wf.MWFNode"
] |
import java.util.logging.Level; import org.compiere.apps.AEnv; import org.compiere.apps.AWindow; import org.compiere.apps.form.FormFrame; import org.compiere.model.MQuery; import org.compiere.wf.MWFNode;
|
import java.util.logging.*; import org.compiere.apps.*; import org.compiere.apps.form.*; import org.compiere.model.*; import org.compiere.wf.*;
|
[
"java.util",
"org.compiere.apps",
"org.compiere.model",
"org.compiere.wf"
] |
java.util; org.compiere.apps; org.compiere.model; org.compiere.wf;
| 2,772,324
|
public String logout() {
FacesContext.getCurrentInstance().getExternalContext().invalidateSession();
FacesContext.getCurrentInstance().addMessage(null,
new FacesMessage(FacesMessage.SEVERITY_INFO, "Abmeldung erfolgreich!", "Abmeldung erfolgreich!"));
return "/login";
}
|
String function() { FacesContext.getCurrentInstance().getExternalContext().invalidateSession(); FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, STR, STR)); return STR; }
|
/**
* This method is called when the logout link, specified in the
* template.xhtml file and therefore available on every page, is clicked.
* The session is invalidated, the user is returned to the start page and a
* info message is displayed.
*
* @return The login page.
*/
|
This method is called when the logout link, specified in the template.xhtml file and therefore available on every page, is clicked. The session is invalidated, the user is returned to the start page and a info message is displayed
|
logout
|
{
"repo_name": "Walti91/stab",
"path": "src/main/java/controller/AuthenticationController.java",
"license": "gpl-3.0",
"size": 3609
}
|
[
"javax.faces.application.FacesMessage",
"javax.faces.context.FacesContext"
] |
import javax.faces.application.FacesMessage; import javax.faces.context.FacesContext;
|
import javax.faces.application.*; import javax.faces.context.*;
|
[
"javax.faces"
] |
javax.faces;
| 2,244,985
|
public String findUserMachineId(UserId userId) {
if ( userId == null ) return null;
Jedis jedis = JedisFactory.getJedis();
String machineBytes = jedis.hget(userId.toString(), H_MACHINE_KEY);
return machineBytes;
}
|
String function(UserId userId) { if ( userId == null ) return null; Jedis jedis = JedisFactory.getJedis(); String machineBytes = jedis.hget(userId.toString(), H_MACHINE_KEY); return machineBytes; }
|
/**
* Find the user's machine id by his/her userId
* @param userId
* @return
*/
|
Find the user's machine id by his/her userId
|
findUserMachineId
|
{
"repo_name": "wangqi/gameserver",
"path": "server/src/main/java/com/xinqihd/sns/gameserver/session/SessionManager.java",
"license": "apache-2.0",
"size": 17163
}
|
[
"com.xinqihd.sns.gameserver.entity.user.UserId",
"com.xinqihd.sns.gameserver.jedis.Jedis",
"com.xinqihd.sns.gameserver.jedis.JedisFactory"
] |
import com.xinqihd.sns.gameserver.entity.user.UserId; import com.xinqihd.sns.gameserver.jedis.Jedis; import com.xinqihd.sns.gameserver.jedis.JedisFactory;
|
import com.xinqihd.sns.gameserver.entity.user.*; import com.xinqihd.sns.gameserver.jedis.*;
|
[
"com.xinqihd.sns"
] |
com.xinqihd.sns;
| 1,874,538
|
private void doAsynchronousAck(String ack) {
if (ConditionalCompilationControls.TESTHARNESS) {
final String ASYNCRESPONSEDELAYCOUNTDOWN = "org.warlock.spine.asyncresponsedelaycountdown";
String prop = System.getProperty(ASYNCRESPONSEDELAYCOUNTDOWN);
if (prop != null && prop.trim().toLowerCase().equals("y")) {
long asynchronousResponseDelay = 0;
final String ASYNCHRONOUSRESPONSEDELAY = "org.warlock.spine.asynchronousebxmlreply.delay";
String srd = System.getProperty(ASYNCHRONOUSRESPONSEDELAY);
if (srd != null) {
try {
asynchronousResponseDelay = Long.parseLong(srd) * 1000;
} catch (Exception e) {
System.err.println("Warning: Error setting asynchronous response delay: " + srd);
}
}
if (asynchronousResponseDelay != 0) {
try {
Thread.sleep(asynchronousResponseDelay);
} catch (Exception e) {
System.err.println("Warning: asynchronousResponseDelay sleep() interrupted.");
}
}
}
if(ConditionalCompilationControls.otwMessageLogging){refMessage = ack;}
}
try {
ConnectionManager c = ConnectionManager.getInstance();
SpineSecurityContext tlsContext = c.getSecurityContext();
// SSLSocketFactory sf = tlsContext.getSocketFactory();
EbXmlAcknowledgment ebxmlack = new EbXmlAcknowledgment(ack);
URL u = new URL(ebxmlack.getResolvedUrl());
// try (SSLSocket s = (SSLSocket)sf.createSocket(u.getHost(), 443)) {
// URL.getPort() is borken and returns -1 for https://something when the
// default port is assumed from the scheme.
try (Socket s = tlsContext.createSocket(u.getHost(), (u.getPort() == -1) ? u.getDefaultPort() : u.getPort())) {
//s.startHandshake();
ebxmlack.write(s.getOutputStream());
int rlength = getHeader(s.getInputStream());
if (rlength == -1) {
SpineToolsLogger.getInstance().log("org.warlock.spine.connection.SpineMessageHandler.doAsynchronousAck", "Failed to get HTTP response to asynchronous ack");
}
}
} catch (Exception e) {
SpineToolsLogger.getInstance().log("org.warlock.spine.connection.SpineMessageHandler.doAsynchronousAck", e);
}
}
|
void function(String ack) { if (ConditionalCompilationControls.TESTHARNESS) { final String ASYNCRESPONSEDELAYCOUNTDOWN = STR; String prop = System.getProperty(ASYNCRESPONSEDELAYCOUNTDOWN); if (prop != null && prop.trim().toLowerCase().equals("y")) { long asynchronousResponseDelay = 0; final String ASYNCHRONOUSRESPONSEDELAY = STR; String srd = System.getProperty(ASYNCHRONOUSRESPONSEDELAY); if (srd != null) { try { asynchronousResponseDelay = Long.parseLong(srd) * 1000; } catch (Exception e) { System.err.println(STR + srd); } } if (asynchronousResponseDelay != 0) { try { Thread.sleep(asynchronousResponseDelay); } catch (Exception e) { System.err.println(STR); } } } if(ConditionalCompilationControls.otwMessageLogging){refMessage = ack;} } try { ConnectionManager c = ConnectionManager.getInstance(); SpineSecurityContext tlsContext = c.getSecurityContext(); EbXmlAcknowledgment ebxmlack = new EbXmlAcknowledgment(ack); URL u = new URL(ebxmlack.getResolvedUrl()); try (Socket s = tlsContext.createSocket(u.getHost(), (u.getPort() == -1) ? u.getDefaultPort() : u.getPort())) { ebxmlack.write(s.getOutputStream()); int rlength = getHeader(s.getInputStream()); if (rlength == -1) { SpineToolsLogger.getInstance().log(STR, STR); } } } catch (Exception e) { SpineToolsLogger.getInstance().log(STR, e); } }
|
/**
* Create and return an asynchronous ebXML acknowledgment.
*
* @param ack
*/
|
Create and return an asynchronous ebXML acknowledgment
|
doAsynchronousAck
|
{
"repo_name": "DamianJMurphy/SpineTools-Java",
"path": "SpineTools-Java/src/org/warlock/spine/connection/SpineMessageHandler.java",
"license": "apache-2.0",
"size": 21227
}
|
[
"java.net.Socket",
"org.warlock.spine.logging.SpineToolsLogger",
"org.warlock.spine.messaging.EbXmlAcknowledgment"
] |
import java.net.Socket; import org.warlock.spine.logging.SpineToolsLogger; import org.warlock.spine.messaging.EbXmlAcknowledgment;
|
import java.net.*; import org.warlock.spine.logging.*; import org.warlock.spine.messaging.*;
|
[
"java.net",
"org.warlock.spine"
] |
java.net; org.warlock.spine;
| 1,772,240
|
protected int getZoneFromChannelUID(String channelUID) {
int zone = 0;
Matcher matcher = PioneerAvrBindingConstants.GROUP_CHANNEL_ZONE_PATTERN.matcher(channelUID);
if (matcher.find()) {
zone = Integer.valueOf(matcher.group(1));
}
return zone;
}
|
int function(String channelUID) { int zone = 0; Matcher matcher = PioneerAvrBindingConstants.GROUP_CHANNEL_ZONE_PATTERN.matcher(channelUID); if (matcher.find()) { zone = Integer.valueOf(matcher.group(1)); } return zone; }
|
/**
* Return the zone from the given channelUID.
*
* Return 0 if the zone cannot be extracted from the channelUID.
*
* @param channelUID
* @return
*/
|
Return the zone from the given channelUID. Return 0 if the zone cannot be extracted from the channelUID
|
getZoneFromChannelUID
|
{
"repo_name": "georgeerhan/openhab2-addons",
"path": "addons/binding/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/handler/AbstractAvrHandler.java",
"license": "epl-1.0",
"size": 12770
}
|
[
"java.util.regex.Matcher",
"org.openhab.binding.pioneeravr.PioneerAvrBindingConstants"
] |
import java.util.regex.Matcher; import org.openhab.binding.pioneeravr.PioneerAvrBindingConstants;
|
import java.util.regex.*; import org.openhab.binding.pioneeravr.*;
|
[
"java.util",
"org.openhab.binding"
] |
java.util; org.openhab.binding;
| 2,701,403
|
public List<ElementArticle> getArticlesInJournal(ElementJournal journal, int year) throws IOException {
checkYear(year);
return getMatchingValuesInTag("journal", journal.getValue(), "year", String.valueOf(year), "title", "article", ElementArticle.class);
}
|
List<ElementArticle> function(ElementJournal journal, int year) throws IOException { checkYear(year); return getMatchingValuesInTag(STR, journal.getValue(), "year", String.valueOf(year), "title", STR, ElementArticle.class); }
|
/**
* Returns a list of all articles that appeared in the given journal in the given year. Derived from DBLP.
* @param journal
* @param year
* @return
* @throws IOException
*/
|
Returns a list of all articles that appeared in the given journal in the given year. Derived from DBLP
|
getArticlesInJournal
|
{
"repo_name": "prasser/bibliometrics",
"path": "src/de/linearbits/bibliometrics/Bibliometrics.java",
"license": "epl-1.0",
"size": 8368
}
|
[
"java.io.IOException",
"java.util.List"
] |
import java.io.IOException; import java.util.List;
|
import java.io.*; import java.util.*;
|
[
"java.io",
"java.util"
] |
java.io; java.util;
| 511,402
|
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
}
|
void function(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); }
|
/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing
* the children that can be created under this object. <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
|
This adds <code>org.eclipse.emf.edit.command.CommandParameter</code>s describing the children that can be created under this object.
|
collectNewChildDescriptors
|
{
"repo_name": "enterpriseDomain/ClassMaker",
"path": "bundles/org.enterprisedomain.classmaker.edit/src/org/enterprisedomain/classmaker/provider/EMFPluginItemProvider.java",
"license": "apache-2.0",
"size": 3804
}
|
[
"java.util.Collection"
] |
import java.util.Collection;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,260,389
|
public WorkflowDetails getWorkflowDetails(String workflowId) throws WorkflowException {
checkNotNull(workflowId, "workflowId is null");
try {
return workflowsClient.showWorkflow(workflowId);
} catch (RuntimeException e) {
throw new WorkflowException(e);
}
}
|
WorkflowDetails function(String workflowId) throws WorkflowException { checkNotNull(workflowId, STR); try { return workflowsClient.showWorkflow(workflowId); } catch (RuntimeException e) { throw new WorkflowException(e); } }
|
/**
* Gets details about a given workflow.
*
* @param workflowId
* The id of the workflow.
* @return A details object for this workflow.
* @throws WorkflowException
* If there was an issue getting the details of the workflow.
*/
|
Gets details about a given workflow
|
getWorkflowDetails
|
{
"repo_name": "phac-nml/irida",
"path": "src/main/java/ca/corefacility/bioinformatics/irida/pipeline/upload/galaxy/GalaxyWorkflowService.java",
"license": "apache-2.0",
"size": 5734
}
|
[
"ca.corefacility.bioinformatics.irida.exceptions.WorkflowException",
"com.github.jmchilton.blend4j.galaxy.beans.WorkflowDetails",
"com.google.common.base.Preconditions"
] |
import ca.corefacility.bioinformatics.irida.exceptions.WorkflowException; import com.github.jmchilton.blend4j.galaxy.beans.WorkflowDetails; import com.google.common.base.Preconditions;
|
import ca.corefacility.bioinformatics.irida.exceptions.*; import com.github.jmchilton.blend4j.galaxy.beans.*; import com.google.common.base.*;
|
[
"ca.corefacility.bioinformatics",
"com.github.jmchilton",
"com.google.common"
] |
ca.corefacility.bioinformatics; com.github.jmchilton; com.google.common;
| 1,304,474
|
public final Throwable getException() {
int s = status & DONE_MASK;
return ((s >= NORMAL) ? null :
(s == CANCELLED) ? new CancellationException() :
getThrowableException());
}
/**
* Completes this task abnormally, and if not already aborted or
* cancelled, causes it to throw the given exception upon
* {@code join} and related operations. This method may be used
* to induce exceptions in asynchronous tasks, or to force
* completion of tasks that would not otherwise complete. Its use
* in other situations is discouraged. This method is
* overridable, but overridden versions must invoke {@code super}
|
final Throwable function() { int s = status & DONE_MASK; return ((s >= NORMAL) ? null : (s == CANCELLED) ? new CancellationException() : getThrowableException()); } /** * Completes this task abnormally, and if not already aborted or * cancelled, causes it to throw the given exception upon * {@code join} and related operations. This method may be used * to induce exceptions in asynchronous tasks, or to force * completion of tasks that would not otherwise complete. Its use * in other situations is discouraged. This method is * overridable, but overridden versions must invoke {@code super}
|
/**
* Returns the exception thrown by the base computation, or a
* {@code CancellationException} if cancelled, or {@code null} if
* none or if the method has not yet completed.
*
* @return the exception, or {@code null} if none
*/
|
Returns the exception thrown by the base computation, or a CancellationException if cancelled, or null if none or if the method has not yet completed
|
getException
|
{
"repo_name": "molecule-labs/molecule",
"path": "molecule-core/src/main/java/molecule/jsr166y/ForkJoinTask.java",
"license": "apache-2.0",
"size": 61050
}
|
[
"java.util.concurrent.CancellationException"
] |
import java.util.concurrent.CancellationException;
|
import java.util.concurrent.*;
|
[
"java.util"
] |
java.util;
| 2,314,100
|
public boolean isEditAvailable() {
return SpringUtils.isAclPermissionGranted(workingAgreement, BasePermission.WRITE);
}
|
boolean function() { return SpringUtils.isAclPermissionGranted(workingAgreement, BasePermission.WRITE); }
|
/**
* Whether or not edit button is available for user
*
* @return true if user can edit current object
*/
|
Whether or not edit button is available for user
|
isEditAvailable
|
{
"repo_name": "terrex/tntconcept-materials-testing",
"path": "src/main/java/com/autentia/intra/bean/admin/WorkingAgreementBean.java",
"license": "gpl-2.0",
"size": 14936
}
|
[
"com.autentia.intra.util.SpringUtils",
"org.acegisecurity.acls.domain.BasePermission"
] |
import com.autentia.intra.util.SpringUtils; import org.acegisecurity.acls.domain.BasePermission;
|
import com.autentia.intra.util.*; import org.acegisecurity.acls.domain.*;
|
[
"com.autentia.intra",
"org.acegisecurity.acls"
] |
com.autentia.intra; org.acegisecurity.acls;
| 1,422,091
|
public void insert(Vgrdetailproductcategory dto);
|
void function(Vgrdetailproductcategory dto);
|
/**
* Method 'insert'
*
* @param dto
*/
|
Method 'insert'
|
insert
|
{
"repo_name": "rmage/gnvc-ims",
"path": "src/java/com/app/wms/engine/db/dao/VgrdetailproductcategoryDao.java",
"license": "lgpl-3.0",
"size": 4497
}
|
[
"com.app.wms.engine.db.dto.Vgrdetailproductcategory"
] |
import com.app.wms.engine.db.dto.Vgrdetailproductcategory;
|
import com.app.wms.engine.db.dto.*;
|
[
"com.app.wms"
] |
com.app.wms;
| 1,100,861
|
public String getJobFlowBatchJobName(Workflow workflow);
|
String function(Workflow workflow);
|
/**
* Get name of Batch Flow Job specified for the current workflow.
* Returns null if not found.
* @return
*/
|
Get name of Batch Flow Job specified for the current workflow. Returns null if not found
|
getJobFlowBatchJobName
|
{
"repo_name": "WASP-System/central",
"path": "wasp-core/src/main/java/edu/yu/einstein/wasp/service/WorkflowService.java",
"license": "agpl-3.0",
"size": 3359
}
|
[
"edu.yu.einstein.wasp.model.Workflow"
] |
import edu.yu.einstein.wasp.model.Workflow;
|
import edu.yu.einstein.wasp.model.*;
|
[
"edu.yu.einstein"
] |
edu.yu.einstein;
| 1,842,059
|
public void setMultiplyRate (BigDecimal MultiplyRate);
|
void function (BigDecimal MultiplyRate);
|
/** Set Multiply Rate.
* Rate to multiple the source by to calculate the target.
*/
|
Set Multiply Rate. Rate to multiple the source by to calculate the target
|
setMultiplyRate
|
{
"repo_name": "geneos/adempiere",
"path": "base/src/org/compiere/model/I_C_Conversion_Rate.java",
"license": "gpl-2.0",
"size": 6605
}
|
[
"java.math.BigDecimal"
] |
import java.math.BigDecimal;
|
import java.math.*;
|
[
"java.math"
] |
java.math;
| 433,828
|
@Before
public void prepareTestDatabase()
{
// START SNIPPET: beforeTest
deleteFileOrDirectory( testDatabasePath );
graphDb = new EmbeddedGraphDatabase( testDatabasePath.getAbsolutePath() );
// END SNIPPET: beforeTest
}
|
void function() { deleteFileOrDirectory( testDatabasePath ); graphDb = new EmbeddedGraphDatabase( testDatabasePath.getAbsolutePath() ); }
|
/**
* Create temporary database for each unit test.
* <p/>
* This will delete any existing database prior to creating a new one.
*/
|
Create temporary database for each unit test. This will delete any existing database prior to creating a new one
|
prepareTestDatabase
|
{
"repo_name": "neo4j-attic/examples",
"path": "src/test/java/org/neo4j/examples/Neo4jBasicTest.java",
"license": "apache-2.0",
"size": 3493
}
|
[
"org.neo4j.kernel.EmbeddedGraphDatabase"
] |
import org.neo4j.kernel.EmbeddedGraphDatabase;
|
import org.neo4j.kernel.*;
|
[
"org.neo4j.kernel"
] |
org.neo4j.kernel;
| 702,833
|
private static void verifyInputs(RankingExpression expression, ImportedMlModel model,
RankProfile profile, QueryProfileRegistry queryProfiles) {
Set<String> functionNames = new HashSet<>();
addFunctionNamesIn(expression.getRoot(), functionNames, model);
for (String functionName : functionNames) {
Optional<TensorType> requiredType = model.inputTypeSpec(functionName).map(TensorType::fromSpec);
if ( requiredType.isEmpty()) continue; // Not a required function
RankProfile.RankingExpressionFunction rankingExpressionFunction = profile.getFunctions().get(functionName);
if (rankingExpressionFunction == null)
throw new IllegalArgumentException("Model refers input '" + functionName +
"' of type " + requiredType.get() +
" but this function is not present in " + profile);
// TODO: We should verify this in the (function reference(s) this is invoked (starting from first/second
// phase and summary features), as it may only resolve correctly given those bindings
// Or, probably better, annotate the functions with type constraints here and verify during general
// type verification
TensorType actualType = rankingExpressionFunction.function().getBody().getRoot().type(profile.typeContext(queryProfiles));
if ( actualType == null)
throw new IllegalArgumentException("Model refers input '" + functionName +
"' of type " + requiredType.get() +
" which must be produced by a function in the rank profile, but " +
"this function references a feature which is not declared");
if ( ! actualType.isAssignableTo(requiredType.get()))
throw new IllegalArgumentException("Model refers input '" + functionName + "'. " +
typeMismatchExplanation(requiredType.get(), actualType));
}
}
|
static void function(RankingExpression expression, ImportedMlModel model, RankProfile profile, QueryProfileRegistry queryProfiles) { Set<String> functionNames = new HashSet<>(); addFunctionNamesIn(expression.getRoot(), functionNames, model); for (String functionName : functionNames) { Optional<TensorType> requiredType = model.inputTypeSpec(functionName).map(TensorType::fromSpec); if ( requiredType.isEmpty()) continue; RankProfile.RankingExpressionFunction rankingExpressionFunction = profile.getFunctions().get(functionName); if (rankingExpressionFunction == null) throw new IllegalArgumentException(STR + functionName + STR + requiredType.get() + STR + profile); TensorType actualType = rankingExpressionFunction.function().getBody().getRoot().type(profile.typeContext(queryProfiles)); if ( actualType == null) throw new IllegalArgumentException(STR + functionName + STR + requiredType.get() + STR + STR); if ( ! actualType.isAssignableTo(requiredType.get())) throw new IllegalArgumentException(STR + functionName + STR + typeMismatchExplanation(requiredType.get(), actualType)); } }
|
/**
* Verify that the inputs declared in the given expression exists in the given rank profile as functions,
* and return tensors of the correct types.
*/
|
Verify that the inputs declared in the given expression exists in the given rank profile as functions, and return tensors of the correct types
|
verifyInputs
|
{
"repo_name": "vespa-engine/vespa",
"path": "config-model/src/main/java/com/yahoo/vespa/model/ml/ConvertedModel.java",
"license": "apache-2.0",
"size": 36590
}
|
[
"ai.vespa.rankingexpression.importer.configmodelview.ImportedMlModel",
"com.yahoo.search.query.profile.QueryProfileRegistry",
"com.yahoo.searchdefinition.RankProfile",
"com.yahoo.searchlib.rankingexpression.RankingExpression",
"com.yahoo.tensor.TensorType",
"java.util.HashSet",
"java.util.Optional",
"java.util.Set"
] |
import ai.vespa.rankingexpression.importer.configmodelview.ImportedMlModel; import com.yahoo.search.query.profile.QueryProfileRegistry; import com.yahoo.searchdefinition.RankProfile; import com.yahoo.searchlib.rankingexpression.RankingExpression; import com.yahoo.tensor.TensorType; import java.util.HashSet; import java.util.Optional; import java.util.Set;
|
import ai.vespa.rankingexpression.importer.configmodelview.*; import com.yahoo.search.query.profile.*; import com.yahoo.searchdefinition.*; import com.yahoo.searchlib.rankingexpression.*; import com.yahoo.tensor.*; import java.util.*;
|
[
"ai.vespa.rankingexpression",
"com.yahoo.search",
"com.yahoo.searchdefinition",
"com.yahoo.searchlib",
"com.yahoo.tensor",
"java.util"
] |
ai.vespa.rankingexpression; com.yahoo.search; com.yahoo.searchdefinition; com.yahoo.searchlib; com.yahoo.tensor; java.util;
| 2,905,809
|
public void decrementAndGetTestLogic(SimpleAtomicLong simpleAtomicLong,
long preValue, long resultValue, long postValue) {
long pre = simpleAtomicLong.get();
long result = simpleAtomicLong.decrementAndGet();
long post = simpleAtomicLong.get();
assertEquals(pre - 1, result);
assertEquals(result, post);
compareResults(pre,
preValue,
result,
resultValue,
post,
postValue);
}
|
void function(SimpleAtomicLong simpleAtomicLong, long preValue, long resultValue, long postValue) { long pre = simpleAtomicLong.get(); long result = simpleAtomicLong.decrementAndGet(); long post = simpleAtomicLong.get(); assertEquals(pre - 1, result); assertEquals(result, post); compareResults(pre, preValue, result, resultValue, post, postValue); }
|
/**
* The Logic of testing decrementAndGet
*
* @param simpleAtomicLong
* The SimpleAtomicLong to be tested
* @param preValue
* The expected 'pre' value
* @param resultValue
* The expected 'result' value
* @param postValue
* The expected 'post' value
*/
|
The Logic of testing decrementAndGet
|
decrementAndGetTestLogic
|
{
"repo_name": "mbabic/POSA",
"path": "src/hw1/SimpleAtomicLongSingleThreadedTest.java",
"license": "unlicense",
"size": 7683
}
|
[
"org.junit.Assert"
] |
import org.junit.Assert;
|
import org.junit.*;
|
[
"org.junit"
] |
org.junit;
| 2,388,630
|
public void setPaint(Paint pPaint) {
if (pPaint == null)
throw new IllegalArgumentException("pPaint argument cannot be null");
paint = pPaint;
}
|
void function(Paint pPaint) { if (pPaint == null) throw new IllegalArgumentException(STR); paint = pPaint; }
|
/**
* Sets a new {@link Paint}-element.
*
* @param pPaint
* The new element
*/
|
Sets a new <code>Paint</code>-element
|
setPaint
|
{
"repo_name": "dakuenne/TrafficJamDroid-App",
"path": "src/org/traffic/jamdroid/views/overlays/DrawableOverlayItem.java",
"license": "gpl-3.0",
"size": 6741
}
|
[
"android.graphics.Paint"
] |
import android.graphics.Paint;
|
import android.graphics.*;
|
[
"android.graphics"
] |
android.graphics;
| 1,376,775
|
public void fireEvent(final Class listenerType) {
final Set<String> existing = new HashSet<>();
while (true) {
final MutableInteger newCount = MutableInteger.of(0);
madpc.forEachBeanType(listenerType, name -> {
if (existing.add(name)) {
// name not found, fire!
newCount.value++;
final Object listener = lookupComponent(name);
if (listener != null) {
MadvocComponentLifecycle.invoke(listener, listenerType);
}
}
});
if (newCount.value == 0) {
break;
}
}
}
// ---------------------------------------------------------------- lookup
|
void function(final Class listenerType) { final Set<String> existing = new HashSet<>(); while (true) { final MutableInteger newCount = MutableInteger.of(0); madpc.forEachBeanType(listenerType, name -> { if (existing.add(name)) { newCount.value++; final Object listener = lookupComponent(name); if (listener != null) { MadvocComponentLifecycle.invoke(listener, listenerType); } } }); if (newCount.value == 0) { break; } } }
|
/**
* Fires the Madvoc event.
* Warning: since event handlers may register more handlers, we
* must collect first the list of components that matches the type
* and then to execute.
*/
|
Fires the Madvoc event. Warning: since event handlers may register more handlers, we must collect first the list of components that matches the type and then to execute
|
fireEvent
|
{
"repo_name": "mosoft521/jodd",
"path": "jodd-madvoc/src/main/java/jodd/madvoc/component/MadvocContainer.java",
"license": "bsd-2-clause",
"size": 7563
}
|
[
"java.util.HashSet",
"java.util.Set"
] |
import java.util.HashSet; import java.util.Set;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,802,014
|
public void destroyAll() {
Set<String> set = new HashSet<String>(cache.keySet());
for (String key : set) {
destroyKey(key);
}
}
|
void function() { Set<String> set = new HashSet<String>(cache.keySet()); for (String key : set) { destroyKey(key); } }
|
/**
* clear and destroy all {@link ReferenceConfig} in the cache.
*/
|
clear and destroy all <code>ReferenceConfig</code> in the cache
|
destroyAll
|
{
"repo_name": "dadarom/dubbo",
"path": "dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/utils/ReferenceConfigCache.java",
"license": "apache-2.0",
"size": 5500
}
|
[
"java.util.HashSet",
"java.util.Set"
] |
import java.util.HashSet; import java.util.Set;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,229,520
|
List<String[]> getSpeechFormatDescriptions();
|
List<String[]> getSpeechFormatDescriptions();
|
/**
* Returns a list of all the speech formats in this debate format, with descriptions.
* @return An <code>ArrayList</code> of <code>String</code> arrays. Each
* <code>String</code> array has two elements. The first element is
* the speech type reference. The second element is a short
* description of the speech type. The <code>ArrayList</code> is
* sorted in the order the speech types appear in the debate. If a
* speech type isn't used, it isn't part of the returned
* <code>ArrayList</code>.
*/
|
Returns a list of all the speech formats in this debate format, with descriptions
|
getSpeechFormatDescriptions
|
{
"repo_name": "czlee/debatekeeper",
"path": "app/src/main/java/net/czlee/debatekeeper/debateformat/DebateFormatInfo.java",
"license": "gpl-3.0",
"size": 3354
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,712,670
|
Document.Role getClassDocumentRole(String classId, String documentId)
throws DataAccessException;
|
Document.Role getClassDocumentRole(String classId, String documentId) throws DataAccessException;
|
/**
* Retrieves a class' document role if it is associated with a document.
*
* @param classId The class' unique identifier.
*
* @param documentId The document's unique identifier.
*
* @return The class' role for some document or null if the class is not
* associated with the document.
*
* @throws DataAccessException Thrown if there is an error.
*/
|
Retrieves a class' document role if it is associated with a document
|
getClassDocumentRole
|
{
"repo_name": "HaiJiaoXinHeng/server-1",
"path": "src/org/ohmage/query/IClassDocumentQueries.java",
"license": "apache-2.0",
"size": 1762
}
|
[
"org.ohmage.domain.Document",
"org.ohmage.exception.DataAccessException"
] |
import org.ohmage.domain.Document; import org.ohmage.exception.DataAccessException;
|
import org.ohmage.domain.*; import org.ohmage.exception.*;
|
[
"org.ohmage.domain",
"org.ohmage.exception"
] |
org.ohmage.domain; org.ohmage.exception;
| 2,630,209
|
public boolean isDefault(Label environment) {
checkInitialized();
return defaults.contains(environment);
}
|
boolean function(Label environment) { checkInitialized(); return defaults.contains(environment); }
|
/**
* Determines whether or not an environment is a default. Returns false if the environment doesn't
* belong to this group.
*/
|
Determines whether or not an environment is a default. Returns false if the environment doesn't belong to this group
|
isDefault
|
{
"repo_name": "twitter-forks/bazel",
"path": "src/main/java/com/google/devtools/build/lib/packages/EnvironmentLabels.java",
"license": "apache-2.0",
"size": 7087
}
|
[
"com.google.devtools.build.lib.cmdline.Label"
] |
import com.google.devtools.build.lib.cmdline.Label;
|
import com.google.devtools.build.lib.cmdline.*;
|
[
"com.google.devtools"
] |
com.google.devtools;
| 1,102,218
|
public static ArrayList<String> convertArrayToList(String[] array) {
ArrayList<String> elemList = new ArrayList<String>();
for (String element : array) {
elemList.add(element);
}
return elemList;
}
|
static ArrayList<String> function(String[] array) { ArrayList<String> elemList = new ArrayList<String>(); for (String element : array) { elemList.add(element); } return elemList; }
|
/**
* Convert array to list of objects.
*
* @param array
* @return
*/
|
Convert array to list of objects
|
convertArrayToList
|
{
"repo_name": "VicCebedo/SeabedOHM",
"path": "src/com/seabed/util/Utilities.java",
"license": "gpl-2.0",
"size": 4871
}
|
[
"java.util.ArrayList"
] |
import java.util.ArrayList;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 416,499
|
public void appendStringContent(StringBuilder sb) {
sb.append(sbuf, 1, sizeCache - 2);
}
/**
* make sense for those types of token:<br/>
* {@link MySQLToken#USR_VAR}: e.g. "@var1", "@'mary''s'";<br/>
* {@link MySQLToken#SYS_VAR}: e.g. "var2";<br/>
* {@link MySQLToken#LITERAL_CHARS}, {@link MySQLToken#LITERAL_NCHARS}: e.g.
* "'ab\\'c'";<br/>
* {@link MySQLToken#LITERAL_BIT}: e.g. "0101" <br/>
* {@link MySQLToken#IDENTIFIER}
|
void function(StringBuilder sb) { sb.append(sbuf, 1, sizeCache - 2); } /** * make sense for those types of token:<br/> * {@link MySQLToken#USR_VAR}: e.g. "@var1", STR;<br/> * {@link MySQLToken#SYS_VAR}: e.g. "var2";<br/> * {@link MySQLToken#LITERAL_CHARS}, {@link MySQLToken#LITERAL_NCHARS}: e.g. * STR;<br/> * {@link MySQLToken#LITERAL_BIT}: e.g. "0101" <br/> * {@link MySQLToken#IDENTIFIER}
|
/**
* if {@link #stringValue()} returns "'abc\\'d'", then "abc\\'d" is appended
*/
|
if <code>#stringValue()</code> returns "'abc\\'d'", then "abc\\'d" is appended
|
appendStringContent
|
{
"repo_name": "xloye/tddl5",
"path": "tddl-parser/src/main/java/com/alibaba/cobar/parser/recognizer/mysql/lexer/SQLLexer.java",
"license": "apache-2.0",
"size": 38765
}
|
[
"com.alibaba.cobar.parser.recognizer.mysql.MySQLToken"
] |
import com.alibaba.cobar.parser.recognizer.mysql.MySQLToken;
|
import com.alibaba.cobar.parser.recognizer.mysql.*;
|
[
"com.alibaba.cobar"
] |
com.alibaba.cobar;
| 611,879
|
public static void copyRecursively(File src, File dest) throws IOException {
Assert.isTrue(src != null && (src.isDirectory() || src.isFile()), "Source File must denote a directory or file");
Assert.notNull(dest, "Destination File must not be null");
doCopyRecursively(src, dest);
}
|
static void function(File src, File dest) throws IOException { Assert.isTrue(src != null && (src.isDirectory() src.isFile()), STR); Assert.notNull(dest, STR); doCopyRecursively(src, dest); }
|
/**
* Recursively copy the contents of the {@code src} file/directory
* to the {@code dest} file/directory.
*
* @param src the source directory
* @param dest the destination directory
* @throws java.io.IOException in the case of I/O errors
*/
|
Recursively copy the contents of the src file/directory to the dest file/directory
|
copyRecursively
|
{
"repo_name": "blademainer/common_utils",
"path": "common_helper/src/main/java/com/xiongyingqi/util/FileSystemUtils.java",
"license": "apache-2.0",
"size": 3471
}
|
[
"java.io.File",
"java.io.IOException"
] |
import java.io.File; import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 407,940
|
public static void setClusterId(FileSystem fs, Path rootdir, ClusterId clusterId,
int wait) throws IOException {
while (true) {
try {
Path idFile = new Path(rootdir, HConstants.CLUSTER_ID_FILE_NAME);
Path tempIdFile = new Path(rootdir, HConstants.HBASE_TEMP_DIRECTORY +
Path.SEPARATOR + HConstants.CLUSTER_ID_FILE_NAME);
// Write the id file to a temporary location
FSDataOutputStream s = fs.create(tempIdFile);
try {
s.write(clusterId.toByteArray());
s.close();
s = null;
// Move the temporary file to its normal location. Throw an IOE if
// the rename failed
if (!fs.rename(tempIdFile, idFile)) {
throw new IOException("Unable to move temp version file to " + idFile);
}
} finally {
// Attempt to close the stream if still open on the way out
try {
if (s != null) s.close();
} catch (IOException ignore) { }
}
if (LOG.isDebugEnabled()) {
LOG.debug("Created cluster ID file at " + idFile.toString() + " with ID: " + clusterId);
}
return;
} catch (IOException ioe) {
if (wait > 0) {
LOG.warn("Unable to create cluster ID file in " + rootdir.toString() +
", retrying in " + wait + "msec: " + StringUtils.stringifyException(ioe));
try {
Thread.sleep(wait);
} catch (InterruptedException e) {
throw (InterruptedIOException)new InterruptedIOException().initCause(e);
}
} else {
throw ioe;
}
}
}
}
|
static void function(FileSystem fs, Path rootdir, ClusterId clusterId, int wait) throws IOException { while (true) { try { Path idFile = new Path(rootdir, HConstants.CLUSTER_ID_FILE_NAME); Path tempIdFile = new Path(rootdir, HConstants.HBASE_TEMP_DIRECTORY + Path.SEPARATOR + HConstants.CLUSTER_ID_FILE_NAME); FSDataOutputStream s = fs.create(tempIdFile); try { s.write(clusterId.toByteArray()); s.close(); s = null; if (!fs.rename(tempIdFile, idFile)) { throw new IOException(STR + idFile); } } finally { try { if (s != null) s.close(); } catch (IOException ignore) { } } if (LOG.isDebugEnabled()) { LOG.debug(STR + idFile.toString() + STR + clusterId); } return; } catch (IOException ioe) { if (wait > 0) { LOG.warn(STR + rootdir.toString() + STR + wait + STR + StringUtils.stringifyException(ioe)); try { Thread.sleep(wait); } catch (InterruptedException e) { throw (InterruptedIOException)new InterruptedIOException().initCause(e); } } else { throw ioe; } } } }
|
/**
* Writes a new unique identifier for this cluster to the "hbase.id" file
* in the HBase root directory
* @param fs the root directory FileSystem
* @param rootdir the path to the HBase root directory
* @param clusterId the unique identifier to store
* @param wait how long (in milliseconds) to wait between retries
* @throws IOException if writing to the FileSystem fails and no wait value
*/
|
Writes a new unique identifier for this cluster to the "hbase.id" file in the HBase root directory
|
setClusterId
|
{
"repo_name": "andrewmains12/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java",
"license": "apache-2.0",
"size": 77341
}
|
[
"java.io.IOException",
"java.io.InterruptedIOException",
"org.apache.hadoop.fs.FSDataOutputStream",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.hbase.ClusterId",
"org.apache.hadoop.hbase.HConstants",
"org.apache.hadoop.util.StringUtils"
] |
import java.io.IOException; import java.io.InterruptedIOException; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.ClusterId; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.util.StringUtils;
|
import java.io.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.util.*;
|
[
"java.io",
"org.apache.hadoop"
] |
java.io; org.apache.hadoop;
| 2,804,461
|
protected ResourceLocation getEntityTexture(EntitySlime entity)
{
return SLIME_TEXTURES;
}
|
ResourceLocation function(EntitySlime entity) { return SLIME_TEXTURES; }
|
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
|
Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture
|
getEntityTexture
|
{
"repo_name": "boredherobrine13/morefuelsmod-1.10",
"path": "build/tmp/recompileMc/sources/net/minecraft/client/renderer/entity/RenderSlime.java",
"license": "lgpl-2.1",
"size": 2017
}
|
[
"net.minecraft.entity.monster.EntitySlime",
"net.minecraft.util.ResourceLocation"
] |
import net.minecraft.entity.monster.EntitySlime; import net.minecraft.util.ResourceLocation;
|
import net.minecraft.entity.monster.*; import net.minecraft.util.*;
|
[
"net.minecraft.entity",
"net.minecraft.util"
] |
net.minecraft.entity; net.minecraft.util;
| 591,416
|
public IScope scope_MParameterValueAssignment_parameter(MSwPackageProvidedInterface pswi, EReference reference)
{
if (pswi.getSwinterface() == null ||
pswi.getSwinterface().eIsProxy() == true)
{
return IScope.NULLSCOPE;
}
Set<MParameter> params = new HashSet<MParameter>();
for (MSwInterface eswi : pswi.getSwinterface().getExtends())
{
params.addAll(mesputil.getAllParameters(eswi));
}
IScope outerScope = getFullObjectScope(params);
return getSimpleObjectScope(mesputil.getParameters(pswi.getSwinterface()), outerScope);
}
|
IScope function(MSwPackageProvidedInterface pswi, EReference reference) { if (pswi.getSwinterface() == null pswi.getSwinterface().eIsProxy() == true) { return IScope.NULLSCOPE; } Set<MParameter> params = new HashSet<MParameter>(); for (MSwInterface eswi : pswi.getSwinterface().getExtends()) { params.addAll(mesputil.getAllParameters(eswi)); } IScope outerScope = getFullObjectScope(params); return getSimpleObjectScope(mesputil.getParameters(pswi.getSwinterface()), outerScope); }
|
/**
* Provides the scope for the parameters whose values can be assigned
* when a software interface is provided by a software package.
*
* @param pswi the software interface that is being provided.
* @param reference the object representing the reference within the
* given class.
* @return the scope of the reference.
*/
|
Provides the scope for the parameters whose values can be assigned when a software interface is provided by a software package
|
scope_MParameterValueAssignment_parameter
|
{
"repo_name": "parraman/micobs",
"path": "mesp/es.uah.aut.srg.micobs.mesp.editor.swp/src/es/uah/aut/srg/micobs/mesp/lang/scoping/SWPScopeProvider.java",
"license": "epl-1.0",
"size": 45945
}
|
[
"es.uah.aut.srg.micobs.common.MParameter",
"es.uah.aut.srg.micobs.mesp.mespswi.MSwInterface",
"es.uah.aut.srg.micobs.mesp.mespswp.MSwPackageProvidedInterface",
"java.util.HashSet",
"java.util.Set",
"org.eclipse.emf.ecore.EReference",
"org.eclipse.xtext.scoping.IScope"
] |
import es.uah.aut.srg.micobs.common.MParameter; import es.uah.aut.srg.micobs.mesp.mespswi.MSwInterface; import es.uah.aut.srg.micobs.mesp.mespswp.MSwPackageProvidedInterface; import java.util.HashSet; import java.util.Set; import org.eclipse.emf.ecore.EReference; import org.eclipse.xtext.scoping.IScope;
|
import es.uah.aut.srg.micobs.common.*; import es.uah.aut.srg.micobs.mesp.mespswi.*; import es.uah.aut.srg.micobs.mesp.mespswp.*; import java.util.*; import org.eclipse.emf.ecore.*; import org.eclipse.xtext.scoping.*;
|
[
"es.uah.aut",
"java.util",
"org.eclipse.emf",
"org.eclipse.xtext"
] |
es.uah.aut; java.util; org.eclipse.emf; org.eclipse.xtext;
| 2,320,460
|
public void onGuiClosed()
{
Keyboard.enableRepeatEvents(false);
}
|
void function() { Keyboard.enableRepeatEvents(false); }
|
/**
* Called when the screen is unloaded. Used to disable keyboard repeat events
*/
|
Called when the screen is unloaded. Used to disable keyboard repeat events
|
onGuiClosed
|
{
"repo_name": "Ubiquitous-Spice/Modjam-3",
"path": "src/main/java/com/github/ubiquitousspice/mobjam/gamemodehack/HackedCreateWorld.java",
"license": "lgpl-3.0",
"size": 17185
}
|
[
"org.lwjgl.input.Keyboard"
] |
import org.lwjgl.input.Keyboard;
|
import org.lwjgl.input.*;
|
[
"org.lwjgl.input"
] |
org.lwjgl.input;
| 1,048,823
|
public RunOmhSim setSortedSimSchemaNames(List<String> sortedSimSchemaNames) {
this.sortedSimSchemaNames = sortedSimSchemaNames;
return this;
}
|
RunOmhSim function(List<String> sortedSimSchemaNames) { this.sortedSimSchemaNames = sortedSimSchemaNames; return this; }
|
/**
* Sets the sorted sim schema names.
*
* @param sortedSimSchemaNames the sorted sim schema names
* @return the run omh sim
*/
|
Sets the sorted sim schema names
|
setSortedSimSchemaNames
|
{
"repo_name": "petezybrick/iote2e",
"path": "iote2e-tests/src/main/java/com/pzybrick/iote2e/tests/omh/RunOmhSim.java",
"license": "apache-2.0",
"size": 11362
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,255,175
|
public static String createDateTimeAndFormat(double value) {
if (Double.isNaN(value)) {
return MISSING_DATE;
} else {
DATE_TIME_FORMAT.get().setTimeZone(getPreferredTimeZone());
return DATE_TIME_FORMAT.get().format(new Date((long) value));
}
}
|
static String function(double value) { if (Double.isNaN(value)) { return MISSING_DATE; } else { DATE_TIME_FORMAT.get().setTimeZone(getPreferredTimeZone()); return DATE_TIME_FORMAT.get().format(new Date((long) value)); } }
|
/**
* Format double value as a short datetime string. If value is NaN, returns
* {@value #MISSING_DATE}.
*
* @param value
* the value to be formatted as datetime
* @return a short datetime string or {@value #MISSING_DATE} if value was NaN
* @since 6.1.1
*/
|
Format double value as a short datetime string. If value is NaN, returns #MISSING_DATE
|
createDateTimeAndFormat
|
{
"repo_name": "aborg0/rapidminer-studio",
"path": "src/main/java/com/rapidminer/tools/Tools.java",
"license": "agpl-3.0",
"size": 76542
}
|
[
"java.util.Date"
] |
import java.util.Date;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,847,229
|
public T secureXML(String secureTag, Map<String, String> namespaces, boolean secureTagContents) {
XMLSecurityDataFormat xsdf = new XMLSecurityDataFormat(secureTag, namespaces, secureTagContents);
return dataFormat(xsdf);
}
|
T function(String secureTag, Map<String, String> namespaces, boolean secureTagContents) { XMLSecurityDataFormat xsdf = new XMLSecurityDataFormat(secureTag, namespaces, secureTagContents); return dataFormat(xsdf); }
|
/**
* Uses the XML Security data format
*/
|
Uses the XML Security data format
|
secureXML
|
{
"repo_name": "jarst/camel",
"path": "camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java",
"license": "apache-2.0",
"size": 39484
}
|
[
"java.util.Map",
"org.apache.camel.model.dataformat.XMLSecurityDataFormat"
] |
import java.util.Map; import org.apache.camel.model.dataformat.XMLSecurityDataFormat;
|
import java.util.*; import org.apache.camel.model.dataformat.*;
|
[
"java.util",
"org.apache.camel"
] |
java.util; org.apache.camel;
| 332,957
|
private void notifySomethingIsPlaying(final PlayerType.GetActivePlayersReturnType getActivePlayersResult,
final PlayerType.PropertyValue getPropertiesResult,
final ListType.ItemsAll getItemResult,
PlayerEventsObserver observer) {
if (getPropertiesResult.speed == 0) {
// Paused
observer.playerOnPause(getActivePlayersResult, getPropertiesResult, getItemResult);
} else {
// Playing
observer.playerOnPlay(getActivePlayersResult, getPropertiesResult, getItemResult);
}
}
|
void function(final PlayerType.GetActivePlayersReturnType getActivePlayersResult, final PlayerType.PropertyValue getPropertiesResult, final ListType.ItemsAll getItemResult, PlayerEventsObserver observer) { if (getPropertiesResult.speed == 0) { observer.playerOnPause(getActivePlayersResult, getPropertiesResult, getItemResult); } else { observer.playerOnPlay(getActivePlayersResult, getPropertiesResult, getItemResult); } }
|
/**
* Something is playing or paused, notify a specific observer
* Always notifies the observer, and doesn't save results in last call
* @param getActivePlayersResult
* @param getPropertiesResult
* @param getItemResult
* @param observer Specific observer
*/
|
Something is playing or paused, notify a specific observer Always notifies the observer, and doesn't save results in last call
|
notifySomethingIsPlaying
|
{
"repo_name": "jtdor/Kore",
"path": "app/src/main/java/org/xbmc/kore/host/HostConnectionObserver.java",
"license": "apache-2.0",
"size": 34282
}
|
[
"org.xbmc.kore.jsonrpc.type.ListType",
"org.xbmc.kore.jsonrpc.type.PlayerType"
] |
import org.xbmc.kore.jsonrpc.type.ListType; import org.xbmc.kore.jsonrpc.type.PlayerType;
|
import org.xbmc.kore.jsonrpc.type.*;
|
[
"org.xbmc.kore"
] |
org.xbmc.kore;
| 2,290,380
|
private void checkContainsAll(List<String> list) {
List<String> additionalList = new ArrayList<>();
String substring;
for (String depCode : list) {
if (depCode.contains("\\")) {
for (int index = 0; index != depCode.length(); index++) {
index = depCode.indexOf("\\", index);
if (index == -1) {
break;
}
substring = depCode.substring(0, index);
if (!list.contains(substring) && !additionalList.contains(substring)) {
additionalList.add(substring);
}
}
}
}
if (additionalList.size() > 0) {
list.addAll(additionalList);
}
}
|
void function(List<String> list) { List<String> additionalList = new ArrayList<>(); String substring; for (String depCode : list) { if (depCode.contains("\\")) { for (int index = 0; index != depCode.length(); index++) { index = depCode.indexOf("\\", index); if (index == -1) { break; } substring = depCode.substring(0, index); if (!list.contains(substring) && !additionalList.contains(substring)) { additionalList.add(substring); } } } } if (additionalList.size() > 0) { list.addAll(additionalList); } }
|
/**
* Method for check and complement list of department codes.
* @param list original list
*/
|
Method for check and complement list of department codes
|
checkContainsAll
|
{
"repo_name": "PavelZubaha/pzubaha",
"path": "chapter_003/src/main/java/pzubaha/collection/catalog/DepartmentSort.java",
"license": "apache-2.0",
"size": 2902
}
|
[
"java.util.ArrayList",
"java.util.List"
] |
import java.util.ArrayList; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,212,085
|
@Nullable public static Element getFirstChild(@NotNull final Element el, @NotNull final String childName) {
final NodeList childNodes = el.getChildNodes();
final int count = childNodes.getLength();
for (int i = 0; i < count; i++) {
final Node node = childNodes.item(i);
if (node.getNodeType() == ELEMENT_NODE && node.getNodeName().equals(childName)) {
return (Element) node;
}
}
return null;
}
public NodeListIterator(@NotNull final NodeList nodeList) {
this.nodeList = nodeList;
}
public NodeListIterator(@NotNull final Element item, final short nodeType) {
this(new FilteredNodeList<T>(item, nodeType));
}
public NodeListIterator(@NotNull final Element item, @NotNull final String childName) {
this(new FilteredNodeList<T>(item, childName));
}
public NodeListIterator(@NotNull final XPath xpath, @NotNull final Element item, @NotNull final String expression) throws XPathExpressionException {
this((NodeList) xpath.evaluate(expression, item, NODESET));
}
|
@Nullable static Element function(@NotNull final Element el, @NotNull final String childName) { final NodeList childNodes = el.getChildNodes(); final int count = childNodes.getLength(); for (int i = 0; i < count; i++) { final Node node = childNodes.item(i); if (node.getNodeType() == ELEMENT_NODE && node.getNodeName().equals(childName)) { return (Element) node; } } return null; } public NodeListIterator(@NotNull final NodeList nodeList) { this.nodeList = nodeList; } public NodeListIterator(@NotNull final Element item, final short nodeType) { this(new FilteredNodeList<T>(item, nodeType)); } public NodeListIterator(@NotNull final Element item, @NotNull final String childName) { this(new FilteredNodeList<T>(item, childName)); } public NodeListIterator(@NotNull final XPath xpath, @NotNull final Element item, @NotNull final String expression) throws XPathExpressionException { this((NodeList) xpath.evaluate(expression, item, NODESET)); }
|
/** Convenience helper method for getting the first child of an element that is an element with a specific name.
* @param el element to get child of
* @param childName name of child element to get
* @return child element or <code>null</code> if no such child element
*/
|
Convenience helper method for getting the first child of an element that is an element with a specific name
|
getFirstChild
|
{
"repo_name": "christianhujer/japi",
"path": "historic2/src/prj/net/sf/japi/xml/NodeListIterator.java",
"license": "lgpl-3.0",
"size": 4400
}
|
[
"javax.xml.xpath.XPath",
"javax.xml.xpath.XPathExpressionException",
"org.jetbrains.annotations.NotNull",
"org.jetbrains.annotations.Nullable",
"org.w3c.dom.Element",
"org.w3c.dom.Node",
"org.w3c.dom.NodeList"
] |
import javax.xml.xpath.XPath; import javax.xml.xpath.XPathExpressionException; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList;
|
import javax.xml.xpath.*; import org.jetbrains.annotations.*; import org.w3c.dom.*;
|
[
"javax.xml",
"org.jetbrains.annotations",
"org.w3c.dom"
] |
javax.xml; org.jetbrains.annotations; org.w3c.dom;
| 583,998
|
protected void regenerateOutput(final ResultItem item) {
SwingWorker worker;
|
void function(final ResultItem item) { SwingWorker worker;
|
/**
* Regenerates the output.
*
* @param item the result item to use
*/
|
Regenerates the output
|
regenerateOutput
|
{
"repo_name": "waikato-datamining/adams-base",
"path": "adams-weka/src/main/java/adams/gui/tools/wekainvestigator/tab/ClassifyTab.java",
"license": "gpl-3.0",
"size": 37828
}
|
[
"javax.swing.SwingWorker"
] |
import javax.swing.SwingWorker;
|
import javax.swing.*;
|
[
"javax.swing"
] |
javax.swing;
| 1,917,516
|
protected void initializeEditingDomain() {
// Create an adapter factory that yields item providers.
//
adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
adapterFactory.addAdapterFactory(new UmlTraceItemProviderAdapterFactory());
adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
adapterFactory.addAdapterFactory(new UMLItemProviderAdapterFactory());
adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
// Create the command stack that will notify this editor as commands are executed.
//
BasicCommandStack commandStack = new BasicCommandStack();
|
void function() { adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new UmlTraceItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new UMLItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
|
/**
* This sets up the editing domain for the model editor.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
|
This sets up the editing domain for the model editor.
|
initializeEditingDomain
|
{
"repo_name": "ujhelyiz/EMF-IncQuery-Examples",
"path": "papyrus-uml/hu.bme.mit.examples.uml.trace.model.editor/src/UmlTrace/presentation/UmlTraceEditor.java",
"license": "epl-1.0",
"size": 66822
}
|
[
"org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory",
"org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory",
"org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory",
"org.eclipse.uml2.uml.edit.providers.UMLItemProviderAdapterFactory"
] |
import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory; import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory; import org.eclipse.uml2.uml.edit.providers.UMLItemProviderAdapterFactory;
|
import org.eclipse.emf.ecore.provider.*; import org.eclipse.emf.edit.provider.*; import org.eclipse.emf.edit.provider.resource.*; import org.eclipse.uml2.uml.edit.providers.*;
|
[
"org.eclipse.emf",
"org.eclipse.uml2"
] |
org.eclipse.emf; org.eclipse.uml2;
| 1,049,833
|
private JMenuItem getSaveMenuItem() {
if (saveMenuItem == null) {
saveMenuItem = new JMenuItem();
saveMenuItem.addActionListener(getSaveAction());
}
return saveMenuItem;
}
|
JMenuItem function() { if (saveMenuItem == null) { saveMenuItem = new JMenuItem(); saveMenuItem.addActionListener(getSaveAction()); } return saveMenuItem; }
|
/**
* This method initializes jMenuItem
* @return javax.swing.JMenuItem
* @uml.property name="saveMenuItem"
*/
|
This method initializes jMenuItem
|
getSaveMenuItem
|
{
"repo_name": "sanyaade-mediadev/vars",
"path": "vars-query/src/main/java/vars/query/ui/QueryResultsFrame.java",
"license": "lgpl-2.1",
"size": 15384
}
|
[
"javax.swing.JMenuItem"
] |
import javax.swing.JMenuItem;
|
import javax.swing.*;
|
[
"javax.swing"
] |
javax.swing;
| 2,334,257
|
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity e) {
super.setRotationAngles(f, f1, f2, f3, f4, f5, e);
}
|
void function(float f, float f1, float f2, float f3, float f4, float f5, Entity e) { super.setRotationAngles(f, f1, f2, f3, f4, f5, e); }
|
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are
* used for animating the movement of arms and legs, where par1 represents
* the time(so that arms and legs swing back and forth) and par2 represents
* how "far" arms and legs can swing at most.
*/
|
Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms and legs can swing at most
|
setRotationAngles
|
{
"repo_name": "GollumTeam/AtlanteanMillenaire",
"path": "src/main/java/com/gollum/atlanteanmillenaire/client/model/ceramic/ModelBathroomSink.java",
"license": "gpl-2.0",
"size": 5892
}
|
[
"net.minecraft.entity.Entity"
] |
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.*;
|
[
"net.minecraft.entity"
] |
net.minecraft.entity;
| 1,245,040
|
public static boolean isCategoryAccessible(final int categoryId)
{
return isCategoryAccessible(SessionFacade.getUserSession().getUserId(), categoryId);
}
|
static boolean function(final int categoryId) { return isCategoryAccessible(SessionFacade.getUserSession().getUserId(), categoryId); }
|
/**
* Check if some category is accessible.
* A call to @link #isCategoryAccessible(int, int) is made, using the
* return of <code>SessionFacade.getUserSession().getUserId()</code>
* as argument for the "userId" parameter.
*
* @param categoryId The category id to check for access rights
* @return <code>true</code> if access to the category is allowed.
*/
|
Check if some category is accessible. A call to @link #isCategoryAccessible(int, int) is made, using the return of <code>SessionFacade.getUserSession().getUserId()</code> as argument for the "userId" parameter
|
isCategoryAccessible
|
{
"repo_name": "javadan/jforum",
"path": "src/main/java/net/jforum/repository/ForumRepository.java",
"license": "bsd-3-clause",
"size": 28127
}
|
[
"net.jforum.SessionFacade"
] |
import net.jforum.SessionFacade;
|
import net.jforum.*;
|
[
"net.jforum"
] |
net.jforum;
| 1,466,687
|
@Override
public String toString() {
return RuntimeDelegate.getInstance().createHeaderDelegate(RestconfMediaType.class).toString(this);
}
|
String function() { return RuntimeDelegate.getInstance().createHeaderDelegate(RestconfMediaType.class).toString(this); }
|
/**
* Convert the media type to a string suitable for use as the value of a
* corresponding HTTP header.
*
* @return a string version of the media type.
*/
|
Convert the media type to a string suitable for use as the value of a corresponding HTTP header
|
toString
|
{
"repo_name": "cboling/onos-restconf-providers",
"path": "protocols/restconf/api/src/main/java/org/onosproject/restconf/RestconfMediaType.java",
"license": "apache-2.0",
"size": 13547
}
|
[
"javax.ws.rs.ext.RuntimeDelegate"
] |
import javax.ws.rs.ext.RuntimeDelegate;
|
import javax.ws.rs.ext.*;
|
[
"javax.ws"
] |
javax.ws;
| 17,140
|
@Before
public void setUp() throws Exception {
less = createLessInstance();
equal1 = createEqualInstance();
equal2 = createEqualInstance();
greater = createGreaterInstance();
// We want these assertions to yield errors, not failures.
try {
assertNotNull("createLessInstance() returned null", less);
assertNotNull("createEqualInstance() returned null", equal1);
assertNotNull("2nd createEqualInstance() returned null", equal2);
assertNotNull("createGreaterInstance() returned null", greater);
assertEquals("less and equal1 of different classes",
less.getClass(), equal1.getClass());
assertEquals("less and equal2 of different classes",
less.getClass(), equal2.getClass());
assertEquals("less and greater of different classes",
less.getClass(), greater.getClass());
checkForEquality(equal1, equal2);
} catch (AssertionFailedError ex) {
throw new IllegalArgumentException(ex.getMessage());
}
}
|
void function() throws Exception { less = createLessInstance(); equal1 = createEqualInstance(); equal2 = createEqualInstance(); greater = createGreaterInstance(); try { assertNotNull(STR, less); assertNotNull(STR, equal1); assertNotNull(STR, equal2); assertNotNull(STR, greater); assertEquals(STR, less.getClass(), equal1.getClass()); assertEquals(STR, less.getClass(), equal2.getClass()); assertEquals(STR, less.getClass(), greater.getClass()); checkForEquality(equal1, equal2); } catch (AssertionFailedError ex) { throw new IllegalArgumentException(ex.getMessage()); } }
|
/**
* Sets up the test fixture.
*
* @throws Exception
*/
|
Sets up the test fixture
|
setUp
|
{
"repo_name": "fharias/purplecore",
"path": "jpos/src/test/java/org/jpos/testhelpers/ComparabilityTestCase.java",
"license": "agpl-3.0",
"size": 6358
}
|
[
"junit.framework.AssertionFailedError",
"org.junit.Assert"
] |
import junit.framework.AssertionFailedError; import org.junit.Assert;
|
import junit.framework.*; import org.junit.*;
|
[
"junit.framework",
"org.junit"
] |
junit.framework; org.junit;
| 248,939
|
void retypeColumn(ColumnSchema oldCol, ColumnSchema newCol) {
boolean allowed = true;
int oldType = oldCol.getDataType().typeCode;
int newType = newCol.getDataType().typeCode;
if (!table.isEmpty(session) && oldType != newType) {
allowed =
newCol.getDataType().canConvertFrom(oldCol.getDataType());
switch (oldType) {
case Types.SQL_BLOB :
case Types.SQL_CLOB :
case Types.OTHER :
case Types.JAVA_OBJECT :
allowed = false;
break;
}
}
if (!allowed) {
throw Error.error(ErrorCode.X_42561);
}
int colIndex = table.getColumnIndex(oldCol.getName().name);
// if there is a multi-column PK, do not change the PK attributes
if (newCol.isIdentity() && table.hasIdentityColumn()
&& table.identityColumn != colIndex) {
throw Error.error(ErrorCode.X_42525);
}
if (table.getPrimaryKey().length > 1) {
newCol.setPrimaryKey(oldCol.isPrimaryKey());
if (ArrayUtil.find(table.getPrimaryKey(), colIndex) != -1) {}
} else if (table.hasPrimaryKey()) {
if (oldCol.isPrimaryKey()) {
newCol.setPrimaryKey(true);
} else if (newCol.isPrimaryKey()) {
throw Error.error(ErrorCode.X_42532);
}
} else if (newCol.isPrimaryKey()) {
throw Error.error(ErrorCode.X_42530);
}
// apply and return if only metadata change is required
boolean meta = newType == oldType;
meta &= oldCol.isNullable() == newCol.isNullable();
meta &= oldCol.getDataType().scale == newCol.getDataType().scale;
meta &= (oldCol.isIdentity() == newCol.isIdentity());
meta &=
(oldCol.getDataType().precision == newCol.getDataType().precision
|| (oldCol.getDataType().precision
< newCol.getDataType().precision && (oldType
== Types.SQL_VARCHAR || oldType == Types.SQL_VARBINARY)));
if (meta) {
// size of some types may be increased with this command
// default expressions can change
oldCol.setType(newCol);
oldCol.setDefaultExpression(newCol.getDefaultExpression());
if (newCol.isIdentity()) {
oldCol.setIdentity(newCol.getIdentitySequence());
}
table.setColumnTypeVars(colIndex);
table.resetDefaultsFlag();
return;
}
database.schemaManager.checkColumnIsReferenced(table.getName(),
table.getColumn(colIndex).getName());
table.checkColumnInCheckConstraint(colIndex);
table.checkColumnInFKConstraint(colIndex);
checkConvertColDataType(oldCol, newCol);
retypeColumn(newCol, colIndex);
}
|
void retypeColumn(ColumnSchema oldCol, ColumnSchema newCol) { boolean allowed = true; int oldType = oldCol.getDataType().typeCode; int newType = newCol.getDataType().typeCode; if (!table.isEmpty(session) && oldType != newType) { allowed = newCol.getDataType().canConvertFrom(oldCol.getDataType()); switch (oldType) { case Types.SQL_BLOB : case Types.SQL_CLOB : case Types.OTHER : case Types.JAVA_OBJECT : allowed = false; break; } } if (!allowed) { throw Error.error(ErrorCode.X_42561); } int colIndex = table.getColumnIndex(oldCol.getName().name); if (newCol.isIdentity() && table.hasIdentityColumn() && table.identityColumn != colIndex) { throw Error.error(ErrorCode.X_42525); } if (table.getPrimaryKey().length > 1) { newCol.setPrimaryKey(oldCol.isPrimaryKey()); if (ArrayUtil.find(table.getPrimaryKey(), colIndex) != -1) {} } else if (table.hasPrimaryKey()) { if (oldCol.isPrimaryKey()) { newCol.setPrimaryKey(true); } else if (newCol.isPrimaryKey()) { throw Error.error(ErrorCode.X_42532); } } else if (newCol.isPrimaryKey()) { throw Error.error(ErrorCode.X_42530); } boolean meta = newType == oldType; meta &= oldCol.isNullable() == newCol.isNullable(); meta &= oldCol.getDataType().scale == newCol.getDataType().scale; meta &= (oldCol.isIdentity() == newCol.isIdentity()); meta &= (oldCol.getDataType().precision == newCol.getDataType().precision (oldCol.getDataType().precision < newCol.getDataType().precision && (oldType == Types.SQL_VARCHAR oldType == Types.SQL_VARBINARY))); if (meta) { oldCol.setType(newCol); oldCol.setDefaultExpression(newCol.getDefaultExpression()); if (newCol.isIdentity()) { oldCol.setIdentity(newCol.getIdentitySequence()); } table.setColumnTypeVars(colIndex); table.resetDefaultsFlag(); return; } database.schemaManager.checkColumnIsReferenced(table.getName(), table.getColumn(colIndex).getName()); table.checkColumnInCheckConstraint(colIndex); table.checkColumnInFKConstraint(colIndex); checkConvertColDataType(oldCol, newCol); retypeColumn(newCol, colIndex); }
|
/**
* Allows changing the type or addition of an IDENTITY sequence.
*
* @param oldCol Column
* @param newCol Column
*/
|
Allows changing the type or addition of an IDENTITY sequence
|
retypeColumn
|
{
"repo_name": "kobronson/cs-voltdb",
"path": "src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java",
"license": "agpl-3.0",
"size": 43321
}
|
[
"org.hsqldb_voltpatches.lib.ArrayUtil"
] |
import org.hsqldb_voltpatches.lib.ArrayUtil;
|
import org.hsqldb_voltpatches.lib.*;
|
[
"org.hsqldb_voltpatches.lib"
] |
org.hsqldb_voltpatches.lib;
| 2,555,244
|
private void init(OutputStream out, String encoding)
throws UnsupportedEncodingException, IOException {
internalOut = new OutputStreamWriter(out, encoding);
// Write the proper BOM if they specified a Unicode encoding.
// NOTE: Creating an OutputStreamWriter with encoding "UTF-16" DOES
// DOES write out the BOM; "UTF-16LE", "UTF-16BE", "UTF-32", "UTF-32LE"
// and "UTF-32BE" don't.
if ("UTF-8".equals(encoding)) {
if (getWriteUtf8BOM()) {
out.write(UTF8_BOM, 0, UTF8_BOM.length);
}
}
else if ("UTF-16LE".equals(encoding)) {
out.write(UTF16LE_BOM, 0, UTF16LE_BOM.length);
}
else if ("UTF-16BE".equals(encoding)) {
out.write(UTF16BE_BOM, 0, UTF16BE_BOM.length);
}
else if ("UTF-32LE".equals(encoding)) {
out.write(UTF32LE_BOM, 0, UTF32LE_BOM.length);
}
else if ("UTF-32".equals(encoding) || "UTF-32BE".equals(encoding)) {
out.write(UTF32BE_BOM, 0, UTF32BE_BOM.length);
}
}
|
void function(OutputStream out, String encoding) throws UnsupportedEncodingException, IOException { internalOut = new OutputStreamWriter(out, encoding); if ("UTF-8".equals(encoding)) { if (getWriteUtf8BOM()) { out.write(UTF8_BOM, 0, UTF8_BOM.length); } } else if (STR.equals(encoding)) { out.write(UTF16LE_BOM, 0, UTF16LE_BOM.length); } else if (STR.equals(encoding)) { out.write(UTF16BE_BOM, 0, UTF16BE_BOM.length); } else if (STR.equals(encoding)) { out.write(UTF32LE_BOM, 0, UTF32LE_BOM.length); } else if (STR.equals(encoding) STR.equals(encoding)) { out.write(UTF32BE_BOM, 0, UTF32BE_BOM.length); } }
|
/**
* Initializes the internal output stream and writes the BOM if the
* specified encoding is a Unicode encoding.
*
* @param out The output stream we are writing.
* @param encoding The encoding in which to write.
* @throws UnsupportedEncodingException If the specified encoding isn't
* supported.
* @throws IOException If an I/O error occurs while writing a BOM.
*/
|
Initializes the internal output stream and writes the BOM if the specified encoding is a Unicode encoding
|
init
|
{
"repo_name": "curiosag/ftc",
"path": "RSyntaxTextArea/src/main/java/org/fife/io/UnicodeWriter.java",
"license": "gpl-3.0",
"size": 7741
}
|
[
"java.io.IOException",
"java.io.OutputStream",
"java.io.OutputStreamWriter",
"java.io.UnsupportedEncodingException"
] |
import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.UnsupportedEncodingException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,511,511
|
public void testStepLargerThanRange() {
final List callLog = new ArrayList();
final Closure closure = new RecordingClosure(callLog);
final Range range = createRange(1, 5);
range.step(6, closure);
assertEquals("wrong number of calls to closure", 1, callLog.size());
assertEquals("wrong value", createValue(1), callLog.get(0));
final List stepList = range.step(6);
assertEquals("wrong number of values in result", 1, stepList.size());
assertEquals("wrong value", createValue(1), callLog.get(0));
}
|
void function() { final List callLog = new ArrayList(); final Closure closure = new RecordingClosure(callLog); final Range range = createRange(1, 5); range.step(6, closure); assertEquals(STR, 1, callLog.size()); assertEquals(STR, createValue(1), callLog.get(0)); final List stepList = range.step(6); assertEquals(STR, 1, stepList.size()); assertEquals(STR, createValue(1), callLog.get(0)); }
|
/**
* Tests stepping backwards through a range with a step size greater than the range size.
*/
|
Tests stepping backwards through a range with a step size greater than the range size
|
testStepLargerThanRange
|
{
"repo_name": "jwagenleitner/incubator-groovy",
"path": "src/test/groovy/lang/NumberRangeTestCase.java",
"license": "apache-2.0",
"size": 25516
}
|
[
"java.util.ArrayList",
"java.util.List"
] |
import java.util.ArrayList; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,928,354
|
public void addType(final PluginType type) {
types.add(type);
}
|
void function(final PluginType type) { types.add(type); }
|
/**
* Adds the specified type.
*
* @param type
* the specified type
*/
|
Adds the specified type
|
addType
|
{
"repo_name": "daima/solo-spring",
"path": "src/main/java/org/b3log/solo/module/event/AbstractPlugin.java",
"license": "apache-2.0",
"size": 14490
}
|
[
"org.b3log.solo.frame.plugin.PluginType"
] |
import org.b3log.solo.frame.plugin.PluginType;
|
import org.b3log.solo.frame.plugin.*;
|
[
"org.b3log.solo"
] |
org.b3log.solo;
| 864,459
|
interface AwsEcsComponentBuilder extends ComponentBuilder<ECSComponent> {
default AwsEcsComponentBuilder autoDiscoverClient(
boolean autoDiscoverClient) {
doSetProperty("autoDiscoverClient", autoDiscoverClient);
return this;
}
|
interface AwsEcsComponentBuilder extends ComponentBuilder<ECSComponent> { default AwsEcsComponentBuilder autoDiscoverClient( boolean autoDiscoverClient) { doSetProperty(STR, autoDiscoverClient); return this; }
|
/**
* Setting the autoDiscoverClient mechanism, if true, the component will
* look for a client instance in the registry automatically otherwise it
* will skip that checking.
*
* The option is a: <code>boolean</code> type.
*
* Default: true
* Group: common
*/
|
Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. The option is a: <code>boolean</code> type. Default: true Group: common
|
autoDiscoverClient
|
{
"repo_name": "nicolaferraro/camel",
"path": "core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AwsEcsComponentBuilderFactory.java",
"license": "apache-2.0",
"size": 10565
}
|
[
"org.apache.camel.builder.component.ComponentBuilder",
"org.apache.camel.component.aws.ecs.ECSComponent"
] |
import org.apache.camel.builder.component.ComponentBuilder; import org.apache.camel.component.aws.ecs.ECSComponent;
|
import org.apache.camel.builder.component.*; import org.apache.camel.component.aws.ecs.*;
|
[
"org.apache.camel"
] |
org.apache.camel;
| 391,081
|
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
java.awt.GridBagConstraints gridBagConstraints;
bindingGroup = new org.jdesktop.beansbinding.BindingGroup();
setOpaque(false);
setLayout(new java.awt.GridBagLayout());
lblName.setText(NbBundle.getMessage(
DoCalibrationVisualPanelMetadata.class,
"DoCalibrationVisualPanelMetadata.lblName.text")); // NOI18N
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 0;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
add(lblName, gridBagConstraints);
org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
this,
org.jdesktop.beansbinding.ELProperty.create("${model.name}"),
txtName,
org.jdesktop.beansbinding.BeanProperty.create("text"));
bindingGroup.addBinding(binding);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 0;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
add(txtName, gridBagConstraints);
lblDescrption.setText(NbBundle.getMessage(
DoCalibrationVisualPanelMetadata.class,
"DoCalibrationVisualPanelMetadata.lblDescrption.text")); // NOI18N
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 1;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
add(lblDescrption, gridBagConstraints);
txaDescription.setColumns(20);
txaDescription.setRows(5);
binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
this,
org.jdesktop.beansbinding.ELProperty.create("${model.description}"),
txaDescription,
org.jdesktop.beansbinding.BeanProperty.create("text"));
bindingGroup.addBinding(binding);
jScrollPane1.setViewportView(txaDescription);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 1;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.weighty = 1.0;
gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
add(jScrollPane1, gridBagConstraints);
bindingGroup.bind();
} // </editor-fold>//GEN-END:initComponents
|
@SuppressWarnings(STR) void function() { java.awt.GridBagConstraints gridBagConstraints; bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); setOpaque(false); setLayout(new java.awt.GridBagLayout()); lblName.setText(NbBundle.getMessage( DoCalibrationVisualPanelMetadata.class, STR)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(lblName, gridBagConstraints); org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create(STR), txtName, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(txtName, gridBagConstraints); lblDescrption.setText(NbBundle.getMessage( DoCalibrationVisualPanelMetadata.class, STR)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(lblDescrption, gridBagConstraints); txaDescription.setColumns(20); txaDescription.setRows(5); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create(STR), txaDescription, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); jScrollPane1.setViewportView(txaDescription); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(jScrollPane1, gridBagConstraints); bindingGroup.bind(); }
|
/**
* This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The
* content of this method is always regenerated by the Form Editor.
*/
|
content of this method is always regenerated by the Form Editor
|
initComponents
|
{
"repo_name": "cismet/cids-custom-sudplan",
"path": "src/main/java/de/cismet/cids/custom/sudplan/hydrology/DoCalibrationVisualPanelMetadata.java",
"license": "lgpl-3.0",
"size": 5851
}
|
[
"org.openide.util.NbBundle"
] |
import org.openide.util.NbBundle;
|
import org.openide.util.*;
|
[
"org.openide.util"
] |
org.openide.util;
| 241,297
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.