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
|
|---|---|---|---|---|---|---|---|---|---|---|---|
int numberOfPriorities = MeasurementConfiguration.numberOfPriorities;
for (int i = 1; i<=numberOfPriorities; i++) {
int t = MeasurementConfiguration.getMeasurementTime(i);
Assert.assertNotSame(-1, t);
}
for (int i = 1; i<=numberOfPriorities; i++) {
int t = MeasurementConfiguration.getNumberOfMeasurementMeasurements(i);
Assert.assertNotSame(-1, t);
}
for (int i = 1; i<=numberOfPriorities; i++) {
int t = MeasurementConfiguration.getNumberOfPoints(i);
Assert.assertNotSame(-1, t);
}
for (int i = 1; i<=numberOfPriorities; i++) {
int t = MeasurementConfiguration.getNumberOfWarmupMeasurements(i);
Assert.assertNotSame(-1, t);
}
for (int i = 1; i<numberOfPriorities; i++) {
int t = MeasurementConfiguration.getWarmupTime(i);
Assert.assertNotSame(-1, t);
}
}
|
int numberOfPriorities = MeasurementConfiguration.numberOfPriorities; for (int i = 1; i<=numberOfPriorities; i++) { int t = MeasurementConfiguration.getMeasurementTime(i); Assert.assertNotSame(-1, t); } for (int i = 1; i<=numberOfPriorities; i++) { int t = MeasurementConfiguration.getNumberOfMeasurementMeasurements(i); Assert.assertNotSame(-1, t); } for (int i = 1; i<=numberOfPriorities; i++) { int t = MeasurementConfiguration.getNumberOfPoints(i); Assert.assertNotSame(-1, t); } for (int i = 1; i<=numberOfPriorities; i++) { int t = MeasurementConfiguration.getNumberOfWarmupMeasurements(i); Assert.assertNotSame(-1, t); } for (int i = 1; i<numberOfPriorities; i++) { int t = MeasurementConfiguration.getWarmupTime(i); Assert.assertNotSame(-1, t); } }
|
/**
* Tests, whether all measure properties are properly defined.
*/
|
Tests, whether all measure properties are properly defined
|
testWhetherEveryPropertyIsCorrectlyDefined
|
{
"repo_name": "arahusky/performance_javadoc",
"path": "src/test-java/cz/cuni/mff/d3s/tools/perfdoc/server/measuring/MeasurementConfigurationTest.java",
"license": "gpl-3.0",
"size": 2164
}
|
[
"org.junit.Assert"
] |
import org.junit.Assert;
|
import org.junit.*;
|
[
"org.junit"
] |
org.junit;
| 617,318
|
public void send(@Nullable final String data) {
send(data, null);
}
|
void function(@Nullable final String data) { send(data, null); }
|
/**
* Sends a message with the specified data.
* @param data the message data.
*/
|
Sends a message with the specified data
|
send
|
{
"repo_name": "programingjd/okserver",
"path": "src/main/java/info/jdavid/ok/server/Response.java",
"license": "apache-2.0",
"size": 31412
}
|
[
"javax.annotation.Nullable"
] |
import javax.annotation.Nullable;
|
import javax.annotation.*;
|
[
"javax.annotation"
] |
javax.annotation;
| 1,326,330
|
public static String[] getMatches(String regExpression, String source) throws TransformationException {
if (regExpression == null || source == null) {
throw new TransformationException("The given parameters 'regExpression' and 'source' must not be null");
}
logger.debug("about to transform '{}' by the function '{}'", source, regExpression);
// Check if RegEx is a substitution (s/<regex>/result/g) or (s/<regex>/result/)
if (isSubtitution(regExpression)) {
Matcher substMatcher = SUBST_PATTERN.matcher(regExpression);
// If there is no match of substitution, source is returned
String result = source;
if (substMatcher.matches()) {
logger.debug("Using substitution form of regex transformation");
String regex = substMatcher.group(1);
String substitution = substMatcher.group(2);
String options = substMatcher.group(3);
if (options.equals("g")) {
result = source.trim().replaceAll(regex, substitution);
} else {
result = source.trim().replaceFirst(regex, substitution);
}
}
return new String[] { result };
} else {
// Not a substitution, return matches
Matcher matcher = getPattern(regExpression).matcher(source.trim());
List<String> results = new ArrayList<>();
while (matcher.find()) {
// Only return first/primary group matches
// This way you can use secondary groups to quantify occurrence count
results.add(matcher.group(1));
}
return results.toArray(new String[results.size()]);
}
}
|
static String[] function(String regExpression, String source) throws TransformationException { if (regExpression == null source == null) { throw new TransformationException(STR); } logger.debug(STR, source, regExpression); if (isSubtitution(regExpression)) { Matcher substMatcher = SUBST_PATTERN.matcher(regExpression); String result = source; if (substMatcher.matches()) { logger.debug(STR); String regex = substMatcher.group(1); String substitution = substMatcher.group(2); String options = substMatcher.group(3); if (options.equals("g")) { result = source.trim().replaceAll(regex, substitution); } else { result = source.trim().replaceFirst(regex, substitution); } } return new String[] { result }; } else { Matcher matcher = getPattern(regExpression).matcher(source.trim()); List<String> results = new ArrayList<>(); while (matcher.find()) { results.add(matcher.group(1)); } return results.toArray(new String[results.size()]); } }
|
/**
* Returns array of strings that match given regular expression.
* If expression is not known the compiled pattern is cached in pattern cache
*
* @param regExpression regular expression to match or a substitution in form of "s/<regex>/result/g" (replace all)
* or "s/<regex>/result/" (replace first)
* @param source text to search in
* @return Array of matched strings or empty array if none found
* @throws TransformationException if regExpression or source is null
* @see org.eclipse.smarthome.transform.regex.internal.RegExTranformationService RegExTranformationService
*/
|
Returns array of strings that match given regular expression. If expression is not known the compiled pattern is cached in pattern cache
|
getMatches
|
{
"repo_name": "openhab/openhab",
"path": "bundles/binding/org.openhab.binding.serial/src/main/java/org/openhab/binding/serial/internal/RegexPatternMatcher.java",
"license": "epl-1.0",
"size": 5580
}
|
[
"java.util.ArrayList",
"java.util.List",
"java.util.regex.Matcher",
"org.openhab.core.transform.TransformationException"
] |
import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; import org.openhab.core.transform.TransformationException;
|
import java.util.*; import java.util.regex.*; import org.openhab.core.transform.*;
|
[
"java.util",
"org.openhab.core"
] |
java.util; org.openhab.core;
| 242,017
|
public List<EnvironmentSetting> environmentVariables() {
return this.environmentVariables;
}
|
List<EnvironmentSetting> function() { return this.environmentVariables; }
|
/**
* Get the environmentVariables value.
*
* @return the environmentVariables value
*/
|
Get the environmentVariables value
|
environmentVariables
|
{
"repo_name": "hovsepm/azure-sdk-for-java",
"path": "batchai/resource-manager/v2017_09_01_preview/src/main/java/com/microsoft/azure/management/batchai/v2017_09_01_preview/SetupTask.java",
"license": "mit",
"size": 3272
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,794,831
|
protected ConnectionRecord getConnectionRecord(JID node, Map<String, String> data) {
BareJID userId = BareJID.bareJIDInstanceNS(data.get(USER_ID));
String resource = data.get(RESOURCE);
JID jid = JID.jidInstanceNS(userId, resource);
String sessionId = data.get(XMPP_SESSION_ID);
JID connectionId = JID.jidInstanceNS(data.get(CONNECTION_ID));
ConnectionRecord rec = new ConnectionRecord(node, jid, sessionId, connectionId);
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "ConnectionRecord created: {0}", new Object[] { rec });
}
return rec;
}
|
ConnectionRecord function(JID node, Map<String, String> data) { BareJID userId = BareJID.bareJIDInstanceNS(data.get(USER_ID)); String resource = data.get(RESOURCE); JID jid = JID.jidInstanceNS(userId, resource); String sessionId = data.get(XMPP_SESSION_ID); JID connectionId = JID.jidInstanceNS(data.get(CONNECTION_ID)); ConnectionRecord rec = new ConnectionRecord(node, jid, sessionId, connectionId); if (log.isLoggable(Level.FINEST)) { log.log(Level.FINEST, STR, new Object[] { rec }); } return rec; }
|
/**
* Method takes the data received from other cluster node and creates a
* ConnectionRecord with all essential connection information. This might be
* used later to identify user's XMPPResourceConnection or use the clustering
* strategy API.
*
* @param node
* @param data
* @return
*/
|
Method takes the data received from other cluster node and creates a ConnectionRecord with all essential connection information. This might be used later to identify user's XMPPResourceConnection or use the clustering strategy API
|
getConnectionRecord
|
{
"repo_name": "zooldk/tigase-server",
"path": "src/main/java/tigase/cluster/SessionManagerClustered.java",
"license": "agpl-3.0",
"size": 36834
}
|
[
"java.util.Map",
"java.util.logging.Level"
] |
import java.util.Map; import java.util.logging.Level;
|
import java.util.*; import java.util.logging.*;
|
[
"java.util"
] |
java.util;
| 1,241,470
|
public ParametersBuilder setViewportSizeToPhysicalDisplaySize(Context context,
boolean viewportOrientationMayChange) {
// Assume the viewport is fullscreen.
Point viewportSize = Util.getPhysicalDisplaySize(context);
return setViewportSize(viewportSize.x, viewportSize.y, viewportOrientationMayChange);
}
|
ParametersBuilder function(Context context, boolean viewportOrientationMayChange) { Point viewportSize = Util.getPhysicalDisplaySize(context); return setViewportSize(viewportSize.x, viewportSize.y, viewportOrientationMayChange); }
|
/**
* Equivalent to invoking {@link #setViewportSize} with the viewport size obtained from
* {@link Util#getPhysicalDisplaySize(Context)}.
*
* @param context The context to obtain the viewport size from.
* @param viewportOrientationMayChange See {@link #viewportOrientationMayChange}.
* @return This builder.
*/
|
Equivalent to invoking <code>#setViewportSize</code> with the viewport size obtained from <code>Util#getPhysicalDisplaySize(Context)</code>
|
setViewportSizeToPhysicalDisplaySize
|
{
"repo_name": "KiminRyu/ExoPlayer",
"path": "library/core/src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java",
"license": "apache-2.0",
"size": 55885
}
|
[
"android.content.Context",
"android.graphics.Point",
"com.google.android.exoplayer2.util.Util"
] |
import android.content.Context; import android.graphics.Point; import com.google.android.exoplayer2.util.Util;
|
import android.content.*; import android.graphics.*; import com.google.android.exoplayer2.util.*;
|
[
"android.content",
"android.graphics",
"com.google.android"
] |
android.content; android.graphics; com.google.android;
| 2,062,745
|
private void initSsl(){
String keyStoreType = KeyStore.getDefaultType();
String tmfAlgorithm = TrustManagerFactory.getDefaultAlgorithm();
try {
CertificateFactory cf = CertificateFactory.getInstance("X.509");
InputStream caInput = new BufferedInputStream(ctx.getResources().openRawResource(R.raw.server));
Certificate cert = cf.generateCertificate(caInput);
caInput.close();
KeyStore store = KeyStore.getInstance(keyStoreType);
store.load(null, null);
store.setCertificateEntry("server", cert);
TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmfAlgorithm);
tmf.init(store);
sslCtx = SSLContext.getInstance("TLS");
sslCtx.init(null, tmf.getTrustManagers(), null);
} catch (CertificateException | IOException | KeyStoreException | NoSuchAlgorithmException | KeyManagementException e) {
e.printStackTrace();
}
}
|
void function(){ String keyStoreType = KeyStore.getDefaultType(); String tmfAlgorithm = TrustManagerFactory.getDefaultAlgorithm(); try { CertificateFactory cf = CertificateFactory.getInstance("X.509"); InputStream caInput = new BufferedInputStream(ctx.getResources().openRawResource(R.raw.server)); Certificate cert = cf.generateCertificate(caInput); caInput.close(); KeyStore store = KeyStore.getInstance(keyStoreType); store.load(null, null); store.setCertificateEntry(STR, cert); TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmfAlgorithm); tmf.init(store); sslCtx = SSLContext.getInstance("TLS"); sslCtx.init(null, tmf.getTrustManagers(), null); } catch (CertificateException IOException KeyStoreException NoSuchAlgorithmException KeyManagementException e) { e.printStackTrace(); } }
|
/**
* Sets up the SSL context to trust our self-signed server certificate (and nothing else)
* The context is only set-up once and reused later
*/
|
Sets up the SSL context to trust our self-signed server certificate (and nothing else) The context is only set-up once and reused later
|
initSsl
|
{
"repo_name": "christophL/AndroidTracker",
"path": "app/src/main/java/uibk/ac/at/androidtracker/PostLocationTask.java",
"license": "gpl-2.0",
"size": 8750
}
|
[
"java.io.BufferedInputStream",
"java.io.IOException",
"java.io.InputStream",
"java.security.KeyManagementException",
"java.security.KeyStore",
"java.security.KeyStoreException",
"java.security.NoSuchAlgorithmException",
"java.security.cert.Certificate",
"java.security.cert.CertificateException",
"java.security.cert.CertificateFactory",
"javax.net.ssl.SSLContext",
"javax.net.ssl.TrustManagerFactory"
] |
import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; import java.security.KeyManagementException; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.cert.Certificate; import java.security.cert.CertificateException; import java.security.cert.CertificateFactory; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManagerFactory;
|
import java.io.*; import java.security.*; import java.security.cert.*; import javax.net.ssl.*;
|
[
"java.io",
"java.security",
"javax.net"
] |
java.io; java.security; javax.net;
| 1,346,394
|
public ServiceCall<Product> validationOfMethodParametersAsync(String resourceGroupName, int id, final ServiceCallback<Product> serviceCallback) {
return ServiceCall.create(validationOfMethodParametersWithServiceResponseAsync(resourceGroupName, id), serviceCallback);
}
|
ServiceCall<Product> function(String resourceGroupName, int id, final ServiceCallback<Product> serviceCallback) { return ServiceCall.create(validationOfMethodParametersWithServiceResponseAsync(resourceGroupName, id), serviceCallback); }
|
/**
* Validates input parameters on the method. See swagger for details.
*
* @param resourceGroupName Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+.
* @param id Required int multiple of 10 from 100 to 1000.
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
|
Validates input parameters on the method. See swagger for details
|
validationOfMethodParametersAsync
|
{
"repo_name": "tbombach/autorest",
"path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/validation/implementation/AutoRestValidationTestImpl.java",
"license": "mit",
"size": 25390
}
|
[
"com.microsoft.rest.ServiceCall",
"com.microsoft.rest.ServiceCallback"
] |
import com.microsoft.rest.ServiceCall; import com.microsoft.rest.ServiceCallback;
|
import com.microsoft.rest.*;
|
[
"com.microsoft.rest"
] |
com.microsoft.rest;
| 2,525,031
|
public boolean isAccessibilityEnabled() {
if (mModeChangeHandler == null) registerModeChangeListeners();
if (mIsAccessibilityEnabled != null) return mIsAccessibilityEnabled;
TraceEvent.begin("AccessibilityManager::isAccessibilityEnabled");
AccessibilityManager manager = getAccessibilityManager();
boolean accessibilityEnabled =
manager != null && manager.isEnabled() && manager.isTouchExplorationEnabled();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && manager != null
&& manager.isEnabled() && !accessibilityEnabled) {
List<AccessibilityServiceInfo> services = manager.getEnabledAccessibilityServiceList(
AccessibilityServiceInfo.FEEDBACK_ALL_MASK);
for (AccessibilityServiceInfo service : services) {
if (canPerformGestures(service)) {
accessibilityEnabled = true;
break;
}
}
}
mIsAccessibilityEnabled = accessibilityEnabled;
TraceEvent.end("AccessibilityManager::isAccessibilityEnabled");
return mIsAccessibilityEnabled;
}
|
boolean function() { if (mModeChangeHandler == null) registerModeChangeListeners(); if (mIsAccessibilityEnabled != null) return mIsAccessibilityEnabled; TraceEvent.begin(STR); AccessibilityManager manager = getAccessibilityManager(); boolean accessibilityEnabled = manager != null && manager.isEnabled() && manager.isTouchExplorationEnabled(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && manager != null && manager.isEnabled() && !accessibilityEnabled) { List<AccessibilityServiceInfo> services = manager.getEnabledAccessibilityServiceList( AccessibilityServiceInfo.FEEDBACK_ALL_MASK); for (AccessibilityServiceInfo service : services) { if (canPerformGestures(service)) { accessibilityEnabled = true; break; } } } mIsAccessibilityEnabled = accessibilityEnabled; TraceEvent.end(STR); return mIsAccessibilityEnabled; }
|
/**
* Checks to see that this device has accessibility and touch exploration enabled.
* @return Whether or not accessibility and touch exploration are enabled.
*/
|
Checks to see that this device has accessibility and touch exploration enabled
|
isAccessibilityEnabled
|
{
"repo_name": "endlessm/chromium-browser",
"path": "weblayer/browser/java/org/chromium/weblayer_private/AccessibilityUtil.java",
"license": "bsd-3-clause",
"size": 8245
}
|
[
"android.accessibilityservice.AccessibilityServiceInfo",
"android.os.Build",
"android.view.accessibility.AccessibilityManager",
"java.util.List",
"org.chromium.base.TraceEvent"
] |
import android.accessibilityservice.AccessibilityServiceInfo; import android.os.Build; import android.view.accessibility.AccessibilityManager; import java.util.List; import org.chromium.base.TraceEvent;
|
import android.accessibilityservice.*; import android.os.*; import android.view.accessibility.*; import java.util.*; import org.chromium.base.*;
|
[
"android.accessibilityservice",
"android.os",
"android.view",
"java.util",
"org.chromium.base"
] |
android.accessibilityservice; android.os; android.view; java.util; org.chromium.base;
| 2,146,317
|
public void setByteArrayValues(Collection<byte[]> values);
|
void function(Collection<byte[]> values);
|
/**
* Sets {@code byte[]} values to this object.
* <p>
* After calling this function, the type of this object is set to
* {@link Type#BYTE_ARRAY}, all previous values of this object is cleared, and
* the new values is set to this object.
* </p>
*
* @param values
* the collection of new {@code byte[]} values to be set to this
* object, whose elements may be null. Note that the cloned copy of
* this collection will be stored in this object.
*/
|
Sets byte[] values to this object. After calling this function, the type of this object is set to <code>Type#BYTE_ARRAY</code>, all previous values of this object is cleared, and the new values is set to this object.
|
setByteArrayValues
|
{
"repo_name": "Haixing-Hu/commons",
"path": "src/main/java/com/github/haixing_hu/util/value/MultiValues.java",
"license": "apache-2.0",
"size": 81305
}
|
[
"java.util.Collection"
] |
import java.util.Collection;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,409,829
|
public boolean setFakeEventID() {
if (bucketId.intValue() < 0) {
return false;
}
if (!isUsedFakeEventId()) {
// assign a fake big thread id. bucket id starts from 0. In order to distinguish
// with other read thread, let bucket id starts from 1 in fake thread id
long threadId = ThreadIdentifier.createFakeThreadIDForPutAll(bucketId.intValue(), eventID.getThreadID());
this.eventID = new EventID(eventID.getMembershipID(), threadId, eventID.getSequenceID());
this.setUsedFakeEventId(true);
}
return true;
}
|
boolean function() { if (bucketId.intValue() < 0) { return false; } if (!isUsedFakeEventId()) { long threadId = ThreadIdentifier.createFakeThreadIDForPutAll(bucketId.intValue(), eventID.getThreadID()); this.eventID = new EventID(eventID.getMembershipID(), threadId, eventID.getSequenceID()); this.setUsedFakeEventId(true); } return true; }
|
/**
* change event id into fake event id
* The algorithm is to change the threadid into
* bucketid*MAX_THREAD_PER_CLIENT+oldthreadid. So from the log, we can
* derive the original thread id.
*
* @return wether current event id is fake or not
* new bucket id
*/
|
change event id into fake event id The algorithm is to change the threadid into bucketid*MAX_THREAD_PER_CLIENT+oldthreadid. So from the log, we can derive the original thread id
|
setFakeEventID
|
{
"repo_name": "papicella/snappy-store",
"path": "gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/DistributedPutAllOperation.java",
"license": "apache-2.0",
"size": 48618
}
|
[
"com.gemstone.gemfire.internal.cache.ha.ThreadIdentifier"
] |
import com.gemstone.gemfire.internal.cache.ha.ThreadIdentifier;
|
import com.gemstone.gemfire.internal.cache.ha.*;
|
[
"com.gemstone.gemfire"
] |
com.gemstone.gemfire;
| 1,669,221
|
private Element createVariableToSpec(ToSpec toSpec) {
return createVariableSpec(TO, toSpec.getVariableName(),
toSpec.getPart(), toSpec.getQuery(), toSpec.getQueryLanguage(),
toSpec.getHeader());
}
|
Element function(ToSpec toSpec) { return createVariableSpec(TO, toSpec.getVariableName(), toSpec.getPart(), toSpec.getQuery(), toSpec.getQueryLanguage(), toSpec.getHeader()); }
|
/**
* Creates a "to" element from the given ToSpec object. The ToSpec
* object should be of the type Variable. If the ToSpec object does
* not define a variable name, an error is added to the output.
*
* @param toSpec The ToSpec of the type Variable.
*
* @return The created "to" element.
*/
|
Creates a "to" element from the given ToSpec object. The ToSpec object should be of the type Variable. If the ToSpec object does not define a variable name, an error is added to the output
|
createVariableToSpec
|
{
"repo_name": "grasscrm/gdesigner",
"path": "editor/server/src/de/hpi/bpmn2bpel/factories/SupportingFactory.java",
"license": "apache-2.0",
"size": 30466
}
|
[
"de.hpi.bpmn2bpel.model.supporting.ToSpec",
"org.w3c.dom.Element"
] |
import de.hpi.bpmn2bpel.model.supporting.ToSpec; import org.w3c.dom.Element;
|
import de.hpi.bpmn2bpel.model.supporting.*; import org.w3c.dom.*;
|
[
"de.hpi.bpmn2bpel",
"org.w3c.dom"
] |
de.hpi.bpmn2bpel; org.w3c.dom;
| 153,417
|
@Override
public float getPanelHeightFromState(PanelState state) {
switch (state) {
case PEEKED:
return MOCK_PEEKED_HEIGHT;
case EXPANDED:
return MOCK_EXPANDED_HEIGHT;
case MAXIMIZED:
return MOCK_MAXIMIZED_HEIGHT;
default:
return 0.0f;
}
}
}
private static class NoExpandMockOverlayPanel extends MockOverlayPanel {
public NoExpandMockOverlayPanel(Context context, OverlayPanelManager manager) {
super(context, manager);
}
|
float function(PanelState state) { switch (state) { case PEEKED: return MOCK_PEEKED_HEIGHT; case EXPANDED: return MOCK_EXPANDED_HEIGHT; case MAXIMIZED: return MOCK_MAXIMIZED_HEIGHT; default: return 0.0f; } } } private static class NoExpandMockOverlayPanel extends MockOverlayPanel { public NoExpandMockOverlayPanel(Context context, OverlayPanelManager manager) { super(context, manager); }
|
/**
* Override to return arbitrary test heights.
*/
|
Override to return arbitrary test heights
|
getPanelHeightFromState
|
{
"repo_name": "danakj/chromium",
"path": "chrome/android/javatests/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelBaseTest.java",
"license": "bsd-3-clause",
"size": 10213
}
|
[
"android.content.Context",
"org.chromium.chrome.browser.compositor.bottombar.OverlayPanel"
] |
import android.content.Context; import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel;
|
import android.content.*; import org.chromium.chrome.browser.compositor.bottombar.*;
|
[
"android.content",
"org.chromium.chrome"
] |
android.content; org.chromium.chrome;
| 651,051
|
@Override
public void itemStateChanged(ItemEvent event) {
// if (event.getItem() == junit4){
// setupClasslist();
// }
}
|
void function(ItemEvent event) { }
|
/**
* Handle change events: currently handles events for the JUnit4
* checkbox, and sets up the relevant class names.
*/
|
Handle change events: currently handles events for the JUnit4 checkbox, and sets up the relevant class names
|
itemStateChanged
|
{
"repo_name": "gabehamilton/jmeter-spock-sampler",
"path": "src/main/java/com/github/gabehamilton/jmeter/SpockSamplerGui.java",
"license": "apache-2.0",
"size": 15601
}
|
[
"java.awt.event.ItemEvent"
] |
import java.awt.event.ItemEvent;
|
import java.awt.event.*;
|
[
"java.awt"
] |
java.awt;
| 246,265
|
public BigDecimal getConfirmedQty ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_ConfirmedQty);
if (bd == null)
return Env.ZERO;
return bd;
}
|
BigDecimal function () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_ConfirmedQty); if (bd == null) return Env.ZERO; return bd; }
|
/** Get Confirmed Quantity.
@return Confirmation of a received quantity
*/
|
Get Confirmed Quantity
|
getConfirmedQty
|
{
"repo_name": "arthurmelo88/palmetalADP",
"path": "adempiere_360/base/src/org/compiere/model/X_M_MovementLineConfirm.java",
"license": "gpl-2.0",
"size": 8788
}
|
[
"java.math.BigDecimal",
"org.compiere.util.Env"
] |
import java.math.BigDecimal; import org.compiere.util.Env;
|
import java.math.*; import org.compiere.util.*;
|
[
"java.math",
"org.compiere.util"
] |
java.math; org.compiere.util;
| 2,396,369
|
public Adapter createArrayTypeSpecifierAdapter() {
return null;
}
|
Adapter function() { return null; }
|
/**
* Creates a new adapter for an object of class '{@link org.yakindu.base.types.ArrayTypeSpecifier <em>Array Type Specifier</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.yakindu.base.types.ArrayTypeSpecifier
* @generated
*/
|
Creates a new adapter for an object of class '<code>org.yakindu.base.types.ArrayTypeSpecifier Array Type Specifier</code>'. This default implementation returns null so that we can easily ignore cases; it's useful to ignore a case when inheritance will catch all the cases anyway.
|
createArrayTypeSpecifierAdapter
|
{
"repo_name": "Yakindu/statecharts",
"path": "plugins/org.yakindu.base.types/src-gen/org/yakindu/base/types/util/TypesAdapterFactory.java",
"license": "epl-1.0",
"size": 19611
}
|
[
"org.eclipse.emf.common.notify.Adapter"
] |
import org.eclipse.emf.common.notify.Adapter;
|
import org.eclipse.emf.common.notify.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 357,466
|
public synchronized NamedValue create_named_value(String s, Any any, int flags)
{
checkShutdownState();
return new NamedValueImpl(this, s, any, flags);
}
|
synchronized NamedValue function(String s, Any any, int flags) { checkShutdownState(); return new NamedValueImpl(this, s, any, flags); }
|
/**
* Create a NamedValue
*
* @result NamedValue created
*/
|
Create a NamedValue
|
create_named_value
|
{
"repo_name": "JetBrains/jdk8u_corba",
"path": "src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java",
"license": "gpl-2.0",
"size": 70996
}
|
[
"com.sun.corba.se.impl.corba.NamedValueImpl",
"org.omg.CORBA"
] |
import com.sun.corba.se.impl.corba.NamedValueImpl; import org.omg.CORBA;
|
import com.sun.corba.se.impl.corba.*; import org.omg.*;
|
[
"com.sun.corba",
"org.omg"
] |
com.sun.corba; org.omg;
| 1,258,673
|
public QuartzJobDetails quartzJob(String groupName, String jobName) throws SchedulerException {
JobKey jobKey = JobKey.jobKey(jobName, groupName);
JobDetail jobDetail = this.scheduler.getJobDetail(jobKey);
if (jobDetail != null) {
List<? extends Trigger> triggers = this.scheduler.getTriggersOfJob(jobKey);
return new QuartzJobDetails(jobDetail.getKey().getGroup(), jobDetail.getKey().getName(),
jobDetail.getDescription(), jobDetail.getJobClass().getName(), jobDetail.isDurable(),
jobDetail.requestsRecovery(), sanitizeJobDataMap(jobDetail.getJobDataMap()),
extractTriggersSummary(triggers));
}
return null;
}
|
QuartzJobDetails function(String groupName, String jobName) throws SchedulerException { JobKey jobKey = JobKey.jobKey(jobName, groupName); JobDetail jobDetail = this.scheduler.getJobDetail(jobKey); if (jobDetail != null) { List<? extends Trigger> triggers = this.scheduler.getTriggersOfJob(jobKey); return new QuartzJobDetails(jobDetail.getKey().getGroup(), jobDetail.getKey().getName(), jobDetail.getDescription(), jobDetail.getJobClass().getName(), jobDetail.isDurable(), jobDetail.requestsRecovery(), sanitizeJobDataMap(jobDetail.getJobDataMap()), extractTriggersSummary(triggers)); } return null; }
|
/**
* Return the {@link QuartzJobDetails details of the job} identified with the given
* group name and job name.
* @param groupName the name of the group
* @param jobName the name of the job
* @return the details of the job or {@code null} if such job does not exist
* @throws SchedulerException if retrieving the information from the scheduler failed
*/
|
Return the <code>QuartzJobDetails details of the job</code> identified with the given group name and job name
|
quartzJob
|
{
"repo_name": "philwebb/spring-boot",
"path": "spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/quartz/QuartzEndpoint.java",
"license": "apache-2.0",
"size": 24821
}
|
[
"java.util.List",
"org.quartz.JobDetail",
"org.quartz.JobKey",
"org.quartz.SchedulerException",
"org.quartz.Trigger"
] |
import java.util.List; import org.quartz.JobDetail; import org.quartz.JobKey; import org.quartz.SchedulerException; import org.quartz.Trigger;
|
import java.util.*; import org.quartz.*;
|
[
"java.util",
"org.quartz"
] |
java.util; org.quartz;
| 2,420,103
|
DeterministicKeyChain makeWatchingKeyChain(Protos.Key key, Protos.Key firstSubKey, DeterministicKey accountKey, boolean isFollowingKey, boolean isMarried) throws UnreadableWalletException;
|
DeterministicKeyChain makeWatchingKeyChain(Protos.Key key, Protos.Key firstSubKey, DeterministicKey accountKey, boolean isFollowingKey, boolean isMarried) throws UnreadableWalletException;
|
/**
* Make a watching keychain.
*
* <p>isMarried and isFollowingKey must not be true at the same time.
*
* @param key the protobuf for the account key
* @param firstSubKey the protobuf for the first child key (normally the parent of the external subchain)
* @param accountKey the account extended public key
* @param isFollowingKey whether the keychain is following in a marriage
* @param isMarried whether the keychain is leading in a marriage
*/
|
Make a watching keychain. isMarried and isFollowingKey must not be true at the same time
|
makeWatchingKeyChain
|
{
"repo_name": "janko33bd/bitcoinj",
"path": "core/src/main/java/org/bitcoinj/wallet/KeyChainFactory.java",
"license": "apache-2.0",
"size": 2849
}
|
[
"org.bitcoinj.crypto.DeterministicKey"
] |
import org.bitcoinj.crypto.DeterministicKey;
|
import org.bitcoinj.crypto.*;
|
[
"org.bitcoinj.crypto"
] |
org.bitcoinj.crypto;
| 450,261
|
@Override
public void close()
throws IOException
{
try {
super.close();
beforeClose();
if (this.store.isOpened()) {
this.store.commit();
}
afterClose();
} catch (final EFapsException e) {
throw new IOException("commit of store not possible", e);
} finally {
if (this.store.isOpened()) {
try {
this.store.abort();
} catch (final EFapsException e) {
throw new IOException("store resource could not be aborted", e);
}
}
}
}
|
void function() throws IOException { try { super.close(); beforeClose(); if (this.store.isOpened()) { this.store.commit(); } afterClose(); } catch (final EFapsException e) { throw new IOException(STR, e); } finally { if (this.store.isOpened()) { try { this.store.abort(); } catch (final EFapsException e) { throw new IOException(STR, e); } } } }
|
/**
* Calls method {@link #beforeClose()}, then commits the store and at least calls method {@link #afterClose()}.
*
* @see #beforeClose()
* @see #afterClose()
* @throws IOException on error
*/
|
Calls method <code>#beforeClose()</code>, then commits the store and at least calls method <code>#afterClose()</code>
|
close
|
{
"repo_name": "ov3rflow/eFaps-Kernel",
"path": "src/main/java/org/efaps/db/store/AbstractStoreResource.java",
"license": "apache-2.0",
"size": 19819
}
|
[
"java.io.IOException",
"org.efaps.util.EFapsException"
] |
import java.io.IOException; import org.efaps.util.EFapsException;
|
import java.io.*; import org.efaps.util.*;
|
[
"java.io",
"org.efaps.util"
] |
java.io; org.efaps.util;
| 313,619
|
@Test
public void sendWithLongErrorResponseTest() throws ClientProtocolException, IOException {
//get sample response XML
File file = new File(this.getClass().getResource(PAYMENT_RESPONSE_FULL_ERROR_XML_PATH).getPath());
StreamSource source = new StreamSource(file);
PaymentResponse fromXmlResponse = new PaymentResponse().fromXml(source);
//mock HttpResponse
HttpResponse httpResponseMock = mock(HttpResponse.class);
when(httpResponseMock.getEntity()).thenReturn(new StringEntity(fromXmlResponse.toXml()));
when(httpResponseMock.getStatusLine()).thenReturn(new BasicStatusLine(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, null));
//create empty request
PaymentRequest request = new PaymentRequest();
//create configuration
HttpConfiguration httpConfiguration = new HttpConfiguration();
httpConfiguration.setOnlyAllowHttps(false);
//mock HttpCLient instance
HttpClient httpClientMock = mock(HttpClient.class);
when(httpClientMock.execute(Matchers.any(HttpUriRequest.class))).thenReturn(httpResponseMock);
//execute send on client
RealexClient realexClient = new RealexClient(SampleXmlValidationUtils.SECRET, httpClientMock, httpConfiguration);
PaymentResponse response = realexClient.send(request);
checkFullResponseError(response);
}
|
void function() throws ClientProtocolException, IOException { File file = new File(this.getClass().getResource(PAYMENT_RESPONSE_FULL_ERROR_XML_PATH).getPath()); StreamSource source = new StreamSource(file); PaymentResponse fromXmlResponse = new PaymentResponse().fromXml(source); HttpResponse httpResponseMock = mock(HttpResponse.class); when(httpResponseMock.getEntity()).thenReturn(new StringEntity(fromXmlResponse.toXml())); when(httpResponseMock.getStatusLine()).thenReturn(new BasicStatusLine(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, null)); PaymentRequest request = new PaymentRequest(); HttpConfiguration httpConfiguration = new HttpConfiguration(); httpConfiguration.setOnlyAllowHttps(false); HttpClient httpClientMock = mock(HttpClient.class); when(httpClientMock.execute(Matchers.any(HttpUriRequest.class))).thenReturn(httpResponseMock); RealexClient realexClient = new RealexClient(SampleXmlValidationUtils.SECRET, httpClientMock, httpConfiguration); PaymentResponse response = realexClient.send(request); checkFullResponseError(response); }
|
/**
* Test sending a payment request and receiving a payment response error.
*/
|
Test sending a payment request and receiving a payment response error
|
sendWithLongErrorResponseTest
|
{
"repo_name": "realexpayments/rxp-remote-java",
"path": "src/test/java/com/realexpayments/remote/sdk/RealexClientTest.java",
"license": "mit",
"size": 12471
}
|
[
"com.realexpayments.remote.sdk.domain.payment.PaymentRequest",
"com.realexpayments.remote.sdk.domain.payment.PaymentResponse",
"com.realexpayments.remote.sdk.http.HttpConfiguration",
"com.realexpayments.remote.sdk.utils.SampleXmlValidationUtils",
"java.io.File",
"java.io.IOException",
"javax.xml.transform.stream.StreamSource",
"org.apache.http.HttpResponse",
"org.apache.http.HttpStatus",
"org.apache.http.HttpVersion",
"org.apache.http.client.ClientProtocolException",
"org.apache.http.client.HttpClient",
"org.apache.http.client.methods.HttpUriRequest",
"org.apache.http.entity.StringEntity",
"org.apache.http.message.BasicStatusLine",
"org.mockito.Matchers",
"org.mockito.Mockito"
] |
import com.realexpayments.remote.sdk.domain.payment.PaymentRequest; import com.realexpayments.remote.sdk.domain.payment.PaymentResponse; import com.realexpayments.remote.sdk.http.HttpConfiguration; import com.realexpayments.remote.sdk.utils.SampleXmlValidationUtils; import java.io.File; import java.io.IOException; import javax.xml.transform.stream.StreamSource; import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.apache.http.HttpVersion; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.entity.StringEntity; import org.apache.http.message.BasicStatusLine; import org.mockito.Matchers; import org.mockito.Mockito;
|
import com.realexpayments.remote.sdk.domain.payment.*; import com.realexpayments.remote.sdk.http.*; import com.realexpayments.remote.sdk.utils.*; import java.io.*; import javax.xml.transform.stream.*; import org.apache.http.*; import org.apache.http.client.*; import org.apache.http.client.methods.*; import org.apache.http.entity.*; import org.apache.http.message.*; import org.mockito.*;
|
[
"com.realexpayments.remote",
"java.io",
"javax.xml",
"org.apache.http",
"org.mockito"
] |
com.realexpayments.remote; java.io; javax.xml; org.apache.http; org.mockito;
| 542,831
|
@Test
// BEGIN SUPRESS CATCH EXCEPTION
public void test_dispose() {
// END SUPRESS CATCH EXCEPTION
YView view1 = modelFactory.createYView();
IViewEditpart view1Editpart = editpartManager.getEditpart(view1);
assertFalse(view1Editpart.isDisposed());
view1Editpart.dispose();
assertTrue(view1Editpart.isDisposed());
view1Editpart.isDisposed();
view1Editpart.dispose();
|
void function() { YView view1 = modelFactory.createYView(); IViewEditpart view1Editpart = editpartManager.getEditpart(view1); assertFalse(view1Editpart.isDisposed()); view1Editpart.dispose(); assertTrue(view1Editpart.isDisposed()); view1Editpart.isDisposed(); view1Editpart.dispose();
|
/**
* Tests the disposal.
*/
|
Tests the disposal
|
test_dispose
|
{
"repo_name": "lunifera/lunifera-ecview",
"path": "org.lunifera.ecview.core.common.tests/src/org/lunifera/ecview/core/ui/common/tests/editparts/emf/ViewEditpartTest.java",
"license": "epl-1.0",
"size": 17189
}
|
[
"org.junit.Assert",
"org.lunifera.ecview.core.common.editpart.IViewEditpart",
"org.lunifera.ecview.core.common.model.core.YView"
] |
import org.junit.Assert; import org.lunifera.ecview.core.common.editpart.IViewEditpart; import org.lunifera.ecview.core.common.model.core.YView;
|
import org.junit.*; import org.lunifera.ecview.core.common.editpart.*; import org.lunifera.ecview.core.common.model.core.*;
|
[
"org.junit",
"org.lunifera.ecview"
] |
org.junit; org.lunifera.ecview;
| 2,413,975
|
ArrowType createArrowType(Node parametersNode) {
return new ArrowType(this, parametersNode, null);
}
|
ArrowType createArrowType(Node parametersNode) { return new ArrowType(this, parametersNode, null); }
|
/**
* Creates an arrow type with an unknown return type.
*
* @param parametersNode the parameters' types, formatted as a Node with
* param names and optionality info.
*/
|
Creates an arrow type with an unknown return type
|
createArrowType
|
{
"repo_name": "Medium/closure-compiler",
"path": "src/com/google/javascript/rhino/jstype/JSTypeRegistry.java",
"license": "apache-2.0",
"size": 66964
}
|
[
"com.google.javascript.rhino.Node"
] |
import com.google.javascript.rhino.Node;
|
import com.google.javascript.rhino.*;
|
[
"com.google.javascript"
] |
com.google.javascript;
| 2,360,302
|
void enrichAuditDatasetFromXuaToken(
SoapMessage message,
Header.Direction headerDirection,
WsAuditDataset auditDataset);
XuaProcessor NOOP = (message, headerDirection, auditDataset) -> {};
|
void enrichAuditDatasetFromXuaToken( SoapMessage message, Header.Direction headerDirection, WsAuditDataset auditDataset); XuaProcessor NOOP = (message, headerDirection, auditDataset) -> {};
|
/**
* Enriches the given audit dataset with elements from the XUA token (SAML2 assertion)
* contained in the given CXF message.
*
* @param message
* source CXF message.
* @param headerDirection
* direction of the header containing the SAML2 assertion.
* @param auditDataset
* target ATNA audit dataset.
*/
|
Enriches the given audit dataset with elements from the XUA token (SAML2 assertion) contained in the given CXF message
|
enrichAuditDatasetFromXuaToken
|
{
"repo_name": "oehf/ipf",
"path": "commons/ihe/ws/src/main/java/org/openehealth/ipf/commons/ihe/ws/cxf/audit/XuaProcessor.java",
"license": "apache-2.0",
"size": 1432
}
|
[
"org.apache.cxf.binding.soap.SoapMessage",
"org.apache.cxf.headers.Header"
] |
import org.apache.cxf.binding.soap.SoapMessage; import org.apache.cxf.headers.Header;
|
import org.apache.cxf.binding.soap.*; import org.apache.cxf.headers.*;
|
[
"org.apache.cxf"
] |
org.apache.cxf;
| 2,252,479
|
return ToStringBuilder.reflectionToString(this, JAXBToStringStyle.DEFAULT_STYLE);
}
|
return ToStringBuilder.reflectionToString(this, JAXBToStringStyle.DEFAULT_STYLE); }
|
/**
* Generates a String representation of the contents of this type.
* This is an extension method, produced by the 'ts' xjc plugin
*
*/
|
Generates a String representation of the contents of this type. This is an extension method, produced by the 'ts' xjc plugin
|
toString
|
{
"repo_name": "fpompermaier/onvif",
"path": "onvif-ws-client/src/main/java/org/onvif/ver10/media/wsdl/GetAudioDecoderConfigurations.java",
"license": "apache-2.0",
"size": 1252
}
|
[
"org.apache.commons.lang3.builder.ToStringBuilder",
"org.apache.cxf.xjc.runtime.JAXBToStringStyle"
] |
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.cxf.xjc.runtime.JAXBToStringStyle;
|
import org.apache.commons.lang3.builder.*; import org.apache.cxf.xjc.runtime.*;
|
[
"org.apache.commons",
"org.apache.cxf"
] |
org.apache.commons; org.apache.cxf;
| 1,988,220
|
public static void setDocsDir(final File docs_dir_path) {
lock.writeLock().lock();
docs_dir = (docs_dir_path == null) ? new File(DEFAULT_DIR_NAME_DOCS)
: docs_dir_path;
lock.writeLock().unlock();
}
|
static void function(final File docs_dir_path) { lock.writeLock().lock(); docs_dir = (docs_dir_path == null) ? new File(DEFAULT_DIR_NAME_DOCS) : docs_dir_path; lock.writeLock().unlock(); }
|
/**
* Set the documentation directory.
*
* @param docs_dir_path
* The path to the documentation directory.
*/
|
Set the documentation directory
|
setDocsDir
|
{
"repo_name": "chvink/kilomek",
"path": "megamek/src/megamek/common/Configuration.java",
"license": "gpl-3.0",
"size": 16433
}
|
[
"java.io.File"
] |
import java.io.File;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,575,756
|
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPesquisar = new javax.swing.JFrame();
jPanel8 = new javax.swing.JPanel();
jTxtPesquisa_Multi = new javax.swing.JTextField();
jBtnConfirmar = new javax.swing.JButton();
jBtnCancelar1 = new javax.swing.JButton();
jScrollPane4 = new javax.swing.JScrollPane();
jTblConsulta_Multi = new javax.swing.JTable();
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jTxtId = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
jTxtCompetencia = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
jTxtSequencia = new javax.swing.JTextField();
jBtnPesquisar = new javax.swing.JButton();
jLblStatus = new javax.swing.JLabel();
jCheckBox1 = new javax.swing.JCheckBox();
jPanel2 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jTxtIdEst = new javax.swing.JTextField();
jTxtNomeEst = new javax.swing.JTextField();
jBtnPesqEst = new javax.swing.JButton();
jTxtIdTransportador = new javax.swing.JTextField();
jTxtNomeTransportador = new javax.swing.JTextField();
jBtnPesqTransp = new javax.swing.JButton();
jPanel4 = new javax.swing.JPanel();
jLabel6 = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable();
jPanel5 = new javax.swing.JPanel();
jLabel7 = new javax.swing.JLabel();
jTxtFaturamento = new javax.swing.JTextField();
jLabel10 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
jTxtIRRF = new javax.swing.JTextField();
jTxtInss = new javax.swing.JTextField();
jLabel12 = new javax.swing.JLabel();
jSpEmissao = new javax.swing.JSpinner();
jPanel6 = new javax.swing.JPanel();
jLabel13 = new javax.swing.JLabel();
jLabel14 = new javax.swing.JLabel();
jLabel15 = new javax.swing.JLabel();
jTxtLiquido = new javax.swing.JTextField();
jTxtTerceiros = new javax.swing.JTextField();
jLabel16 = new javax.swing.JLabel();
jSpPgto = new javax.swing.JSpinner();
jSpVlrPagar = new JNumberFormatField99(new DecimalFormat("#,##0.00"));
jBtnAddCte = new javax.swing.JButton();
jBtnRemoveCte = new javax.swing.JButton();
jPanel7 = new javax.swing.JPanel();
jLabel9 = new javax.swing.JLabel();
jLabel17 = new javax.swing.JLabel();
jLabel18 = new javax.swing.JLabel();
jTxtAcum = new javax.swing.JTextField();
jTxtAcumIrrf = new javax.swing.JTextField();
jTxtAcumQtdeFrete = new javax.swing.JTextField();
jLabel19 = new javax.swing.JLabel();
jLabel20 = new javax.swing.JLabel();
jLabel21 = new javax.swing.JLabel();
jTxtCategoria = new javax.swing.JTextField();
jTxtAcumTerc = new javax.swing.JTextField();
jTxtAcumInss = new javax.swing.JTextField();
jLblMargem = new javax.swing.JLabel();
jPanel3 = new javax.swing.JPanel();
jBtnGravar = new javax.swing.JButton();
jBtnEditar = new javax.swing.JButton();
jBtnAdicionar = new javax.swing.JButton();
jLabel8 = new javax.swing.JLabel();
jTxtQtdCte = new javax.swing.JTextField();
jLabel22 = new javax.swing.JLabel();
jTxtCodFolha = new javax.swing.JTextField();
jBtnAtualizar = new javax.swing.JButton();
jPesquisar.setTitle("Pesquisar");
jPesquisar.setMinimumSize(new java.awt.Dimension(700, 400));
|
@SuppressWarnings(STR) void function() { jPesquisar = new javax.swing.JFrame(); jPanel8 = new javax.swing.JPanel(); jTxtPesquisa_Multi = new javax.swing.JTextField(); jBtnConfirmar = new javax.swing.JButton(); jBtnCancelar1 = new javax.swing.JButton(); jScrollPane4 = new javax.swing.JScrollPane(); jTblConsulta_Multi = new javax.swing.JTable(); jPanel1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jTxtId = new javax.swing.JTextField(); jLabel4 = new javax.swing.JLabel(); jTxtCompetencia = new javax.swing.JTextField(); jLabel5 = new javax.swing.JLabel(); jTxtSequencia = new javax.swing.JTextField(); jBtnPesquisar = new javax.swing.JButton(); jLblStatus = new javax.swing.JLabel(); jCheckBox1 = new javax.swing.JCheckBox(); jPanel2 = new javax.swing.JPanel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jTxtIdEst = new javax.swing.JTextField(); jTxtNomeEst = new javax.swing.JTextField(); jBtnPesqEst = new javax.swing.JButton(); jTxtIdTransportador = new javax.swing.JTextField(); jTxtNomeTransportador = new javax.swing.JTextField(); jBtnPesqTransp = new javax.swing.JButton(); jPanel4 = new javax.swing.JPanel(); jLabel6 = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); jPanel5 = new javax.swing.JPanel(); jLabel7 = new javax.swing.JLabel(); jTxtFaturamento = new javax.swing.JTextField(); jLabel10 = new javax.swing.JLabel(); jLabel11 = new javax.swing.JLabel(); jTxtIRRF = new javax.swing.JTextField(); jTxtInss = new javax.swing.JTextField(); jLabel12 = new javax.swing.JLabel(); jSpEmissao = new javax.swing.JSpinner(); jPanel6 = new javax.swing.JPanel(); jLabel13 = new javax.swing.JLabel(); jLabel14 = new javax.swing.JLabel(); jLabel15 = new javax.swing.JLabel(); jTxtLiquido = new javax.swing.JTextField(); jTxtTerceiros = new javax.swing.JTextField(); jLabel16 = new javax.swing.JLabel(); jSpPgto = new javax.swing.JSpinner(); jSpVlrPagar = new JNumberFormatField99(new DecimalFormat(STR)); jBtnAddCte = new javax.swing.JButton(); jBtnRemoveCte = new javax.swing.JButton(); jPanel7 = new javax.swing.JPanel(); jLabel9 = new javax.swing.JLabel(); jLabel17 = new javax.swing.JLabel(); jLabel18 = new javax.swing.JLabel(); jTxtAcum = new javax.swing.JTextField(); jTxtAcumIrrf = new javax.swing.JTextField(); jTxtAcumQtdeFrete = new javax.swing.JTextField(); jLabel19 = new javax.swing.JLabel(); jLabel20 = new javax.swing.JLabel(); jLabel21 = new javax.swing.JLabel(); jTxtCategoria = new javax.swing.JTextField(); jTxtAcumTerc = new javax.swing.JTextField(); jTxtAcumInss = new javax.swing.JTextField(); jLblMargem = new javax.swing.JLabel(); jPanel3 = new javax.swing.JPanel(); jBtnGravar = new javax.swing.JButton(); jBtnEditar = new javax.swing.JButton(); jBtnAdicionar = new javax.swing.JButton(); jLabel8 = new javax.swing.JLabel(); jTxtQtdCte = new javax.swing.JTextField(); jLabel22 = new javax.swing.JLabel(); jTxtCodFolha = new javax.swing.JTextField(); jBtnAtualizar = new javax.swing.JButton(); jPesquisar.setTitle(STR); jPesquisar.setMinimumSize(new java.awt.Dimension(700, 400));
|
/**
* 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.
*/
|
This method is called from within the constructor to initialize the form. regenerated by the Form Editor
|
initComponents
|
{
"repo_name": "barcellosLuizFernando/facilitador",
"path": "src/telaCadastros/EmitirRpa.java",
"license": "mit",
"size": 98595
}
|
[
"java.awt.Dimension",
"java.text.DecimalFormat"
] |
import java.awt.Dimension; import java.text.DecimalFormat;
|
import java.awt.*; import java.text.*;
|
[
"java.awt",
"java.text"
] |
java.awt; java.text;
| 2,270,146
|
PaginationResult getOperations(DeviceIdentifier deviceId, PaginationRequest request)
throws OperationManagementException;
|
PaginationResult getOperations(DeviceIdentifier deviceId, PaginationRequest request) throws OperationManagementException;
|
/**
* Method to retrieve all the operations applied to a device with pagination support.
*
* @param deviceId DeviceIdentifier of the device
* @param request PaginationRequest object holding the data for pagination
* @return PaginationResult - Result including the required parameters necessary to do pagination.
* @throws OperationManagementException If some unusual behaviour is observed while fetching the
* operation list.
*/
|
Method to retrieve all the operations applied to a device with pagination support
|
getOperations
|
{
"repo_name": "charithag/carbon-device-mgt",
"path": "components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/OperationManager.java",
"license": "apache-2.0",
"size": 5585
}
|
[
"org.wso2.carbon.device.mgt.common.DeviceIdentifier",
"org.wso2.carbon.device.mgt.common.PaginationRequest",
"org.wso2.carbon.device.mgt.common.PaginationResult"
] |
import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.PaginationRequest; import org.wso2.carbon.device.mgt.common.PaginationResult;
|
import org.wso2.carbon.device.mgt.common.*;
|
[
"org.wso2.carbon"
] |
org.wso2.carbon;
| 2,175,165
|
public Set<RuntimeIdentity> getIdentities() throws InfrastructureException {
throw new UnsupportedOperationException("The implementation does not track runtimes");
}
|
Set<RuntimeIdentity> function() throws InfrastructureException { throw new UnsupportedOperationException(STR); }
|
/**
* An Infrastructure MAY track Runtimes. In this case the method should be overridden.
*
* <p>One of the reason for infrastructure to support this is ability to recover infrastructure
* after shutting down Master server. For this purpose an Infrastructure should also implement
* getRuntime(id) method
*
* @return list of tracked Runtimes' Identities.
* @throws UnsupportedOperationException if implementation does not support runtimes tracking
* @throws InfrastructureException if any other error occurred
*/
|
An Infrastructure MAY track Runtimes. In this case the method should be overridden. One of the reason for infrastructure to support this is ability to recover infrastructure after shutting down Master server. For this purpose an Infrastructure should also implement getRuntime(id) method
|
getIdentities
|
{
"repo_name": "akervern/che",
"path": "wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/spi/RuntimeInfrastructure.java",
"license": "epl-1.0",
"size": 4528
}
|
[
"java.util.Set",
"org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity"
] |
import java.util.Set; import org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity;
|
import java.util.*; import org.eclipse.che.api.core.model.workspace.runtime.*;
|
[
"java.util",
"org.eclipse.che"
] |
java.util; org.eclipse.che;
| 2,248,827
|
public void addTimeoutListener(@Nullable final TimeValue timeout, final TimeoutClusterStateListener listener) {
if (lifecycle.stoppedOrClosed()) {
listener.onClose();
return;
}
|
void function(@Nullable final TimeValue timeout, final TimeoutClusterStateListener listener) { if (lifecycle.stoppedOrClosed()) { listener.onClose(); return; }
|
/**
* Adds a cluster state listener that is expected to be removed during a short period of time.
* If provided, the listener will be notified once a specific time has elapsed.
*
* NOTE: the listener is not removed on timeout. This is the responsibility of the caller.
*/
|
Adds a cluster state listener that is expected to be removed during a short period of time. If provided, the listener will be notified once a specific time has elapsed
|
addTimeoutListener
|
{
"repo_name": "crate/crate",
"path": "server/src/main/java/org/elasticsearch/cluster/service/ClusterApplierService.java",
"license": "apache-2.0",
"size": 29210
}
|
[
"io.crate.common.unit.TimeValue",
"javax.annotation.Nullable",
"org.elasticsearch.cluster.TimeoutClusterStateListener"
] |
import io.crate.common.unit.TimeValue; import javax.annotation.Nullable; import org.elasticsearch.cluster.TimeoutClusterStateListener;
|
import io.crate.common.unit.*; import javax.annotation.*; import org.elasticsearch.cluster.*;
|
[
"io.crate.common",
"javax.annotation",
"org.elasticsearch.cluster"
] |
io.crate.common; javax.annotation; org.elasticsearch.cluster;
| 2,700,104
|
public Observable<ServiceResponse<Page<AppServicePlanInner>>> listSinglePageAsync(final Boolean detailed) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
|
Observable<ServiceResponse<Page<AppServicePlanInner>>> function(final Boolean detailed) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException(STR); }
|
/**
* Get all App Service plans for a subscription.
* Get all App Service plans for a subscription.
*
ServiceResponse<PageImpl<AppServicePlanInner>> * @param detailed Specify <code>true</code> to return all App Service plan properties. The default is <code>false</code>, which returns a subset of the properties.
Retrieval of all properties may increase the API latency.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<AppServicePlanInner> object wrapped in {@link ServiceResponse} if successful.
*/
|
Get all App Service plans for a subscription. Get all App Service plans for a subscription
|
listSinglePageAsync
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/appservice/mgmt-v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServicePlansInner.java",
"license": "mit",
"size": 300795
}
|
[
"com.microsoft.azure.Page",
"com.microsoft.rest.ServiceResponse"
] |
import com.microsoft.azure.Page; import com.microsoft.rest.ServiceResponse;
|
import com.microsoft.azure.*; import com.microsoft.rest.*;
|
[
"com.microsoft.azure",
"com.microsoft.rest"
] |
com.microsoft.azure; com.microsoft.rest;
| 474,603
|
public void setAuthToken(AuthToken auth) {
authToken = auth;
}
|
void function(AuthToken auth) { authToken = auth; }
|
/**
* Sets the new Authorization Token for this session. The session is not yet considered fully
* authenticated (i.e. active) since a resource has not been binded at this point. This
* message will be sent after SASL authentication was successful but yet resource binding
* is required.
*
* @param auth the authentication token obtained from SASL authentication.
*/
|
Sets the new Authorization Token for this session. The session is not yet considered fully authenticated (i.e. active) since a resource has not been binded at this point. This message will be sent after SASL authentication was successful but yet resource binding is required
|
setAuthToken
|
{
"repo_name": "trimnguye/JavaChatServer",
"path": "src/java/org/jivesoftware/openfire/session/LocalClientSession.java",
"license": "apache-2.0",
"size": 36257
}
|
[
"org.jivesoftware.openfire.auth.AuthToken"
] |
import org.jivesoftware.openfire.auth.AuthToken;
|
import org.jivesoftware.openfire.auth.*;
|
[
"org.jivesoftware.openfire"
] |
org.jivesoftware.openfire;
| 862,326
|
public boolean checkInAnyVillage(){
boolean inVillage = false;
if(this.instance.getVillageListConfig().contains("Villages.")){
ConfigurationSection villages = this.instance.getVillageListConfig().getConfigurationSection("Villages.");
for(String village : villages.getKeys(false)){
if(this.checkInVillage(village)){
inVillage = true;
}
}
}
return inVillage;
}
|
boolean function(){ boolean inVillage = false; if(this.instance.getVillageListConfig().contains(STR)){ ConfigurationSection villages = this.instance.getVillageListConfig().getConfigurationSection(STR); for(String village : villages.getKeys(false)){ if(this.checkInVillage(village)){ inVillage = true; } } } return inVillage; }
|
/**
* Checks if that player is in any village
*
* @return if the player is in any village
*/
|
Checks if that player is in any village
|
checkInAnyVillage
|
{
"repo_name": "weeryan17/Villages",
"path": "Villages/src/com/weeryan17/vgs/util/PlayerUtil.java",
"license": "mit",
"size": 4357
}
|
[
"org.bukkit.configuration.ConfigurationSection"
] |
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.*;
|
[
"org.bukkit.configuration"
] |
org.bukkit.configuration;
| 2,416,652
|
public int tickRate(World worldIn)
{
return 10;
}
|
int function(World worldIn) { return 10; }
|
/**
* How many world ticks before ticking
*/
|
How many world ticks before ticking
|
tickRate
|
{
"repo_name": "TheGreatAndPowerfulWeegee/wipunknown",
"path": "build/tmp/recompileMc/sources/net/minecraft/block/Block.java",
"license": "gpl-3.0",
"size": 129758
}
|
[
"net.minecraft.world.World"
] |
import net.minecraft.world.World;
|
import net.minecraft.world.*;
|
[
"net.minecraft.world"
] |
net.minecraft.world;
| 1,159,974
|
@PrePersist
public void initializeDates() {
if (forceCreateDate != null) {
this.created = forceCreateDate;
} else {
this.created = new Date();
}
this.modified = new Date();
}
|
void function() { if (forceCreateDate != null) { this.created = forceCreateDate; } else { this.created = new Date(); } this.modified = new Date(); }
|
/**
* sets the created and modified dates to now. Called on PrePersist event
*/
|
sets the created and modified dates to now. Called on PrePersist event
|
initializeDates
|
{
"repo_name": "intuit/Tank",
"path": "data_model/src/main/java/com/intuit/tank/project/BaseEntity.java",
"license": "epl-1.0",
"size": 3349
}
|
[
"java.util.Date"
] |
import java.util.Date;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 350,910
|
private boolean pluginExists(String name) {
File[] plugins = listFilesOrError(new File("plugins"));
for (final File file : plugins) {
if (file.getName().equals(name)) {
return true;
}
}
return false;
}
|
boolean function(String name) { File[] plugins = listFilesOrError(new File(STR)); for (final File file : plugins) { if (file.getName().equals(name)) { return true; } } return false; }
|
/**
* Check if the name of a jar is one of the plugins currently installed, used for extracting the correct files out of a zip.
*
* @param name a name to check for inside the plugins folder.
* @return true if a file inside the plugins folder is named this.
*/
|
Check if the name of a jar is one of the plugins currently installed, used for extracting the correct files out of a zip
|
pluginExists
|
{
"repo_name": "bog500/SecurityBOG",
"path": "mc.securitybog/src/mc/securitybog/Updater.java",
"license": "gpl-3.0",
"size": 30608
}
|
[
"java.io.File"
] |
import java.io.File;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 311,287
|
public MMovementLineConfirm[] getLines (boolean requery)
{
if (m_lines != null && !requery) {
set_TrxName(m_lines, get_TrxName());
return m_lines;
}
String sql = "SELECT * FROM M_MovementLineConfirm "
+ "WHERE M_MovementConfirm_ID=?";
ArrayList<MMovementLineConfirm> list = new ArrayList<MMovementLineConfirm>();
PreparedStatement pstmt = null;
try
{
pstmt = DB.prepareStatement (sql, get_TrxName());
pstmt.setInt (1, getM_MovementConfirm_ID());
ResultSet rs = pstmt.executeQuery ();
while (rs.next ())
list.add(new MMovementLineConfirm(getCtx(), rs, get_TrxName()));
rs.close ();
pstmt.close ();
pstmt = null;
}
catch (Exception e)
{
log.error(sql, e);
}
try
{
if (pstmt != null)
pstmt.close ();
pstmt = null;
}
catch (Exception e)
{
pstmt = null;
}
m_lines = new MMovementLineConfirm[list.size ()];
list.toArray (m_lines);
return m_lines;
} // getLines
|
MMovementLineConfirm[] function (boolean requery) { if (m_lines != null && !requery) { set_TrxName(m_lines, get_TrxName()); return m_lines; } String sql = STR + STR; ArrayList<MMovementLineConfirm> list = new ArrayList<MMovementLineConfirm>(); PreparedStatement pstmt = null; try { pstmt = DB.prepareStatement (sql, get_TrxName()); pstmt.setInt (1, getM_MovementConfirm_ID()); ResultSet rs = pstmt.executeQuery (); while (rs.next ()) list.add(new MMovementLineConfirm(getCtx(), rs, get_TrxName())); rs.close (); pstmt.close (); pstmt = null; } catch (Exception e) { log.error(sql, e); } try { if (pstmt != null) pstmt.close (); pstmt = null; } catch (Exception e) { pstmt = null; } m_lines = new MMovementLineConfirm[list.size ()]; list.toArray (m_lines); return m_lines; }
|
/**
* Get Lines
* @param requery requery
* @return array of lines
*/
|
Get Lines
|
getLines
|
{
"repo_name": "klst-com/metasfresh",
"path": "de.metas.business/src/main/java-legacy/org/compiere/model/MMovementConfirm.java",
"license": "gpl-2.0",
"size": 19011
}
|
[
"java.sql.PreparedStatement",
"java.sql.ResultSet",
"java.util.ArrayList"
] |
import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ArrayList;
|
import java.sql.*; import java.util.*;
|
[
"java.sql",
"java.util"
] |
java.sql; java.util;
| 1,810,022
|
private void excuteRemoveListener(PropertyChangeListener listener, EntityIdentity entityIdentity) {
// synchronized (lock) {
Set<PropertyChangeListener> listenerSet = listeners.get(entityIdentity);
if (listenerSet == null) {
return;
}
listenerSet.remove(listener);
// }
}
|
void function(PropertyChangeListener listener, EntityIdentity entityIdentity) { Set<PropertyChangeListener> listenerSet = listeners.get(entityIdentity); if (listenerSet == null) { return; } listenerSet.remove(listener); }
|
/**
* Remove PropertyChangeListener.
*
* @param listener property change listener
* @param entityClass entity class
* @param primaryKey primary key
*/
|
Remove PropertyChangeListener
|
excuteRemoveListener
|
{
"repo_name": "free-creations/phon",
"path": "DbEntities/src/de/free_creations/dbEntities/PropertyChangeManager.java",
"license": "apache-2.0",
"size": 5142
}
|
[
"java.beans.PropertyChangeListener",
"java.util.Set"
] |
import java.beans.PropertyChangeListener; import java.util.Set;
|
import java.beans.*; import java.util.*;
|
[
"java.beans",
"java.util"
] |
java.beans; java.util;
| 1,788,487
|
public List<StepInterface> findBaseSteps( String stepname ) {
List<StepInterface> baseSteps = new ArrayList<>();
if ( steps == null ) {
return baseSteps;
}
for ( int i = 0; i < steps.size(); i++ ) {
StepMetaDataCombi sid = steps.get( i );
StepInterface stepInterface = sid.step;
if ( stepInterface.getStepname().equalsIgnoreCase( stepname ) ) {
baseSteps.add( stepInterface );
}
}
return baseSteps;
}
|
List<StepInterface> function( String stepname ) { List<StepInterface> baseSteps = new ArrayList<>(); if ( steps == null ) { return baseSteps; } for ( int i = 0; i < steps.size(); i++ ) { StepMetaDataCombi sid = steps.get( i ); StepInterface stepInterface = sid.step; if ( stepInterface.getStepname().equalsIgnoreCase( stepname ) ) { baseSteps.add( stepInterface ); } } return baseSteps; }
|
/**
* Find the base steps for the step with the specified name.
*
* @param stepname the step name
* @return the list of base steps for the specified step
*/
|
Find the base steps for the step with the specified name
|
findBaseSteps
|
{
"repo_name": "flbrino/pentaho-kettle",
"path": "engine/src/main/java/org/pentaho/di/trans/Trans.java",
"license": "apache-2.0",
"size": 198588
}
|
[
"java.util.ArrayList",
"java.util.List",
"org.pentaho.di.trans.step.StepInterface",
"org.pentaho.di.trans.step.StepMetaDataCombi"
] |
import java.util.ArrayList; import java.util.List; import org.pentaho.di.trans.step.StepInterface; import org.pentaho.di.trans.step.StepMetaDataCombi;
|
import java.util.*; import org.pentaho.di.trans.step.*;
|
[
"java.util",
"org.pentaho.di"
] |
java.util; org.pentaho.di;
| 2,439,764
|
public Document get() throws IOException;
|
Document function() throws IOException;
|
/**
* Execute the request as a GET, and parse the result.
* @return parsed Document
* @throws java.net.MalformedURLException if the request URL is not a HTTP or HTTPS URL, or is otherwise malformed
* @throws HttpStatusException if the response is not OK and HTTP response errors are not ignored
* @throws UnsupportedMimeTypeException if the response mime type is not supported and those errors are not ignored
* @throws java.net.SocketTimeoutException if the connection times out
* @throws IOException on error
*/
|
Execute the request as a GET, and parse the result
|
get
|
{
"repo_name": "Geforce132/Beacon",
"path": "1.8 In-dev/java/org/freeforums/geforce/beacon/jsoup/Connection.java",
"license": "gpl-2.0",
"size": 17337
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 337,417
|
protected T setString(GoogleAnalyticsParameter parameter, String value) {
if (value == null) {
parms.remove(parameter);
} else {
String stringValue = value;
parms.put(parameter, stringValue);
}
return (T) this;
}
|
T function(GoogleAnalyticsParameter parameter, String value) { if (value == null) { parms.remove(parameter); } else { String stringValue = value; parms.put(parameter, stringValue); } return (T) this; }
|
/**
* Sets the String value for specified parameter. If value is null, the parameter
* is removed from the parameters list.
*
* @param parameter
* @param value
* @return
*/
|
Sets the String value for specified parameter. If value is null, the parameter is removed from the parameters list
|
setString
|
{
"repo_name": "punithgowdap/GA-MP-API",
"path": "src/main/java/com/gamp/transport/GoogleAnalyticsRequest.java",
"license": "cc0-1.0",
"size": 52692
}
|
[
"com.gamp.config.GoogleAnalyticsParameter"
] |
import com.gamp.config.GoogleAnalyticsParameter;
|
import com.gamp.config.*;
|
[
"com.gamp.config"
] |
com.gamp.config;
| 1,864,165
|
@Value.Default
default ImmutableSortedSet<SourcePath> getRawHeaders() {
return ImmutableSortedSet.of();
}
|
@Value.Default default ImmutableSortedSet<SourcePath> getRawHeaders() { return ImmutableSortedSet.of(); }
|
/**
* Raw headers are headers which are used as they are (via compilation flags). Buck doesn't copy
* them or create symlinks for them. They are public (since managed by compilation flags).
*
* @return a list of raw headers
*/
|
Raw headers are headers which are used as they are (via compilation flags). Buck doesn't copy them or create symlinks for them. They are public (since managed by compilation flags)
|
getRawHeaders
|
{
"repo_name": "brettwooldridge/buck",
"path": "src/com/facebook/buck/cxx/CxxConstructorArg.java",
"license": "apache-2.0",
"size": 5810
}
|
[
"com.facebook.buck.core.sourcepath.SourcePath",
"com.google.common.collect.ImmutableSortedSet",
"org.immutables.value.Value"
] |
import com.facebook.buck.core.sourcepath.SourcePath; import com.google.common.collect.ImmutableSortedSet; import org.immutables.value.Value;
|
import com.facebook.buck.core.sourcepath.*; import com.google.common.collect.*; import org.immutables.value.*;
|
[
"com.facebook.buck",
"com.google.common",
"org.immutables.value"
] |
com.facebook.buck; com.google.common; org.immutables.value;
| 1,335,966
|
@Override
public double valueToJava2D(double value, Rectangle2D area,
RectangleEdge edge) {
Range range = getRange();
double axisMin = range.getLowerBound();
double axisMax = range.getUpperBound();
double min = 0.0;
double max = 0.0;
if (RectangleEdge.isTopOrBottom(edge)) {
min = area.getX();
max = area.getMaxX();
}
else if (RectangleEdge.isLeftOrRight(edge)) {
max = area.getMinY();
min = area.getMaxY();
}
if (isInverted()) {
return max
- ((value - axisMin) / (axisMax - axisMin)) * (max - min);
}
else {
return min
+ ((value - axisMin) / (axisMax - axisMin)) * (max - min);
}
}
|
double function(double value, Rectangle2D area, RectangleEdge edge) { Range range = getRange(); double axisMin = range.getLowerBound(); double axisMax = range.getUpperBound(); double min = 0.0; double max = 0.0; if (RectangleEdge.isTopOrBottom(edge)) { min = area.getX(); max = area.getMaxX(); } else if (RectangleEdge.isLeftOrRight(edge)) { max = area.getMinY(); min = area.getMaxY(); } if (isInverted()) { return max - ((value - axisMin) / (axisMax - axisMin)) * (max - min); } else { return min + ((value - axisMin) / (axisMax - axisMin)) * (max - min); } }
|
/**
* Converts a data value to a coordinate in Java2D space, assuming that the
* axis runs along one edge of the specified dataArea.
* <p>
* Note that it is possible for the coordinate to fall outside the plotArea.
*
* @param value the data value.
* @param area the area for plotting the data.
* @param edge the axis location.
*
* @return The Java2D coordinate.
*
* @see #java2DToValue(double, Rectangle2D, RectangleEdge)
*/
|
Converts a data value to a coordinate in Java2D space, assuming that the axis runs along one edge of the specified dataArea. Note that it is possible for the coordinate to fall outside the plotArea
|
valueToJava2D
|
{
"repo_name": "hongliangpan/manydesigns.cn",
"path": "trunk/portofino-chart/jfreechat.src/org/jfree/chart/axis/NumberAxis.java",
"license": "lgpl-3.0",
"size": 55177
}
|
[
"java.awt.geom.Rectangle2D",
"org.jfree.data.Range",
"org.jfree.ui.RectangleEdge"
] |
import java.awt.geom.Rectangle2D; import org.jfree.data.Range; import org.jfree.ui.RectangleEdge;
|
import java.awt.geom.*; import org.jfree.data.*; import org.jfree.ui.*;
|
[
"java.awt",
"org.jfree.data",
"org.jfree.ui"
] |
java.awt; org.jfree.data; org.jfree.ui;
| 2,876,459
|
public static Pair<Integer, Integer> match(final String string) throws Exception {
Matcher matcher = PRICE_REGEX_DOLLARS_CENTS.matcher(string);
if (matcher.matches() && matcher.group(1) != null && !matcher.group(1).isEmpty()) {
int dollars;
Integer cents;
if (matcher.group("dollars").isEmpty()) {
if (matcher.group("cents").isEmpty()) {
return null;
}
dollars = 0;
}
else {
dollars = Integer.valueOf(matcher.group(1).replace(",", ""));
}
cents = matchCents(matcher.group("cents"));
if (cents == null) {
return null;
}
return new Pair<Integer, Integer>(dollars, cents);
}
matcher = PRICE_REGEX_DOLLARS_ONLY.matcher(string);
if (matcher.matches() && matcher.group(1) != null && !matcher.group(1).isEmpty()) {
int dollars = Integer.valueOf(matcher.group("dollars").replace(",", ""));
return new Pair<Integer, Integer>(dollars, 0);
}
matcher = PRICE_REGEX_CENTS_ONLY.matcher(string);
if (matcher.matches()) {
Integer cents = matchCents(matcher.group("cents"));
if (cents == null) {
return null;
}
return new Pair<Integer, Integer>(0, cents);
}
return null;
}
|
static Pair<Integer, Integer> function(final String string) throws Exception { Matcher matcher = PRICE_REGEX_DOLLARS_CENTS.matcher(string); if (matcher.matches() && matcher.group(1) != null && !matcher.group(1).isEmpty()) { int dollars; Integer cents; if (matcher.group(STR).isEmpty()) { if (matcher.group("cents").isEmpty()) { return null; } dollars = 0; } else { dollars = Integer.valueOf(matcher.group(1).replace(",", STRcents")); if (cents == null) { return null; } return new Pair<Integer, Integer>(dollars, cents); } matcher = PRICE_REGEX_DOLLARS_ONLY.matcher(string); if (matcher.matches() && matcher.group(1) != null && !matcher.group(1).isEmpty()) { int dollars = Integer.valueOf(matcher.group(STR).replace(",STRSTRcents")); if (cents == null) { return null; } return new Pair<Integer, Integer>(0, cents); } return null; }
|
/**
* Attempts to parse the supplied string as a dollars/cents value.
* @param string
* @return
* @throws Exception
*/
|
Attempts to parse the supplied string as a dollars/cents value
|
match
|
{
"repo_name": "kilroyrlc/kaflib",
"path": "src/kaflib/types/Price.java",
"license": "mit",
"size": 9850
}
|
[
"java.util.regex.Matcher"
] |
import java.util.regex.Matcher;
|
import java.util.regex.*;
|
[
"java.util"
] |
java.util;
| 76,397
|
protected String localizeValue( Object value, IScriptStyle style )
{
if ( value == null )
{
return null;
}
if ( value instanceof Number )
{
String format = getNumberFormat( style );
NumberFormatter fmt = getNumberFormatter( format );;
return fmt.format( (Number) value );
}
if ( value instanceof java.util.Date )
{
String format = getDateFormat( style, (java.util.Date) value );
DateFormatter fmt = getDateFormatter( format );
return fmt.format( (Date) value );
}
else if ( value instanceof String )
{
String format = getStringFormat( style );
StringFormatter fmt = getStringFormatter( format );
return fmt.format( (String) value );
}
return value.toString( );
}
|
String function( Object value, IScriptStyle style ) { if ( value == null ) { return null; } if ( value instanceof Number ) { String format = getNumberFormat( style ); NumberFormatter fmt = getNumberFormatter( format );; return fmt.format( (Number) value ); } if ( value instanceof java.util.Date ) { String format = getDateFormat( style, (java.util.Date) value ); DateFormatter fmt = getDateFormatter( format ); return fmt.format( (Date) value ); } else if ( value instanceof String ) { String format = getStringFormat( style ); StringFormatter fmt = getStringFormatter( format ); return fmt.format( (String) value ); } return value.toString( ); }
|
/**
* localize the value to a string.
*
* @param value
* @param style
* @param locale
* @return
*/
|
localize the value to a string
|
localizeValue
|
{
"repo_name": "sguan-actuate/birt",
"path": "engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/toc/TOCFormatUtil.java",
"license": "epl-1.0",
"size": 3894
}
|
[
"java.util.Date",
"org.eclipse.birt.core.format.DateFormatter",
"org.eclipse.birt.core.format.NumberFormatter",
"org.eclipse.birt.core.format.StringFormatter",
"org.eclipse.birt.report.engine.api.script.instance.IScriptStyle"
] |
import java.util.Date; import org.eclipse.birt.core.format.DateFormatter; import org.eclipse.birt.core.format.NumberFormatter; import org.eclipse.birt.core.format.StringFormatter; import org.eclipse.birt.report.engine.api.script.instance.IScriptStyle;
|
import java.util.*; import org.eclipse.birt.core.format.*; import org.eclipse.birt.report.engine.api.script.instance.*;
|
[
"java.util",
"org.eclipse.birt"
] |
java.util; org.eclipse.birt;
| 683,918
|
private void doSortMenu(final boolean showAll) {
LayoutInflater inf = this.getLayoutInflater();
View root = inf.inflate(R.layout.booklist_style_menu, null);
RadioGroup group = (RadioGroup)root.findViewById(R.id.radio_buttons);
LinearLayout main = (LinearLayout)root.findViewById(R.id.menu);
final AlertDialog sortDialog = new AlertDialog.Builder(this).setView(root).create();
sortDialog.setTitle(R.string.select_style);
sortDialog.show();
Iterator<BooklistStyle> i;
if (!showAll)
i = BooklistStyles.getPreferredStyles(mDb).iterator();
else
i = BooklistStyles.getAllStyles(mDb).iterator();
while(i.hasNext()) {
BooklistStyle style = i.next();
makeRadio(sortDialog, inf, group, style);
}
int moreLess;
if (showAll)
moreLess = R.string.show_fewer_ellipsis;
else
moreLess = R.string.show_more_ellipsis;
|
void function(final boolean showAll) { LayoutInflater inf = this.getLayoutInflater(); View root = inf.inflate(R.layout.booklist_style_menu, null); RadioGroup group = (RadioGroup)root.findViewById(R.id.radio_buttons); LinearLayout main = (LinearLayout)root.findViewById(R.id.menu); final AlertDialog sortDialog = new AlertDialog.Builder(this).setView(root).create(); sortDialog.setTitle(R.string.select_style); sortDialog.show(); Iterator<BooklistStyle> i; if (!showAll) i = BooklistStyles.getPreferredStyles(mDb).iterator(); else i = BooklistStyles.getAllStyles(mDb).iterator(); while(i.hasNext()) { BooklistStyle style = i.next(); makeRadio(sortDialog, inf, group, style); } int moreLess; if (showAll) moreLess = R.string.show_fewer_ellipsis; else moreLess = R.string.show_more_ellipsis;
|
/**
* Setup the sort options. This function will also call fillData when
* complete having loaded the appropriate view.
*/
|
Setup the sort options. This function will also call fillData when complete having loaded the appropriate view
|
doSortMenu
|
{
"repo_name": "jgaldo/Book-Catalogue",
"path": "src/com/eleybourn/bookcatalogue/BooksOnBookshelf.java",
"license": "gpl-3.0",
"size": 49648
}
|
[
"android.app.AlertDialog",
"android.view.LayoutInflater",
"android.view.View",
"android.widget.LinearLayout",
"android.widget.RadioGroup",
"com.eleybourn.bookcatalogue.booklist.BooklistStyle",
"com.eleybourn.bookcatalogue.booklist.BooklistStyles",
"java.util.Iterator"
] |
import android.app.AlertDialog; import android.view.LayoutInflater; import android.view.View; import android.widget.LinearLayout; import android.widget.RadioGroup; import com.eleybourn.bookcatalogue.booklist.BooklistStyle; import com.eleybourn.bookcatalogue.booklist.BooklistStyles; import java.util.Iterator;
|
import android.app.*; import android.view.*; import android.widget.*; import com.eleybourn.bookcatalogue.booklist.*; import java.util.*;
|
[
"android.app",
"android.view",
"android.widget",
"com.eleybourn.bookcatalogue",
"java.util"
] |
android.app; android.view; android.widget; com.eleybourn.bookcatalogue; java.util;
| 1,575,823
|
public String toString() {
try {
Iterator keys = keys();
StringBuffer sb = new StringBuffer("{");
while (keys.hasNext()) {
if (sb.length() > 1) {
sb.append(',');
}
Object o = keys.next();
sb.append(quote(o.toString()));
sb.append(':');
sb.append(valueToString(this.map.get(o)));
}
sb.append('}');
return sb.toString();
} catch (Exception e) {
return null;
}
}
|
String function() { try { Iterator keys = keys(); StringBuffer sb = new StringBuffer("{"); while (keys.hasNext()) { if (sb.length() > 1) { sb.append(','); } Object o = keys.next(); sb.append(quote(o.toString())); sb.append(':'); sb.append(valueToString(this.map.get(o))); } sb.append('}'); return sb.toString(); } catch (Exception e) { return null; } }
|
/**
* Make a JSON text of this JSONObject. For compactness, no whitespace
* is added. If this would not result in a syntactically correct JSON text,
* then null will be returned instead.
* <p>
* Warning: This method assumes that the data structure is acyclical.
*
* @return a printable, displayable, portable, transmittable
* representation of the object, beginning
* with <code>{</code> <small>(left brace)</small> and ending
* with <code>}</code> <small>(right brace)</small>.
*/
|
Make a JSON text of this JSONObject. For compactness, no whitespace is added. If this would not result in a syntactically correct JSON text, then null will be returned instead. Warning: This method assumes that the data structure is acyclical
|
toString
|
{
"repo_name": "amahule/aws-sdk-for-android",
"path": "src/com/amazonaws/util/json/JSONObject.java",
"license": "apache-2.0",
"size": 52300
}
|
[
"java.util.Iterator"
] |
import java.util.Iterator;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,536,164
|
public static void addRewritePolyfillPass(List<PassFactory> passes) {
passes.add(rewritePolyfills);
}
|
static void function(List<PassFactory> passes) { passes.add(rewritePolyfills); }
|
/**
* Adds the pass to inject ES6 polyfills, which goes after the late ES6 passes.
*/
|
Adds the pass to inject ES6 polyfills, which goes after the late ES6 passes
|
addRewritePolyfillPass
|
{
"repo_name": "tdelmas/closure-compiler",
"path": "src/com/google/javascript/jscomp/TranspilationPasses.java",
"license": "apache-2.0",
"size": 18638
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 302,192
|
boolean shouldUpdate = UpdatePolicy.NOW.shouldUpdate(null);
assertTrue(shouldUpdate);
}
|
boolean shouldUpdate = UpdatePolicy.NOW.shouldUpdate(null); assertTrue(shouldUpdate); }
|
/**
* Tests if an update is made if no previous update ran.
*/
|
Tests if an update is made if no previous update ran
|
testFirstTime
|
{
"repo_name": "kaiwinter/android-remote-notifications",
"path": "android-remote-notifications/src/test/java/com/github/kaiwinter/androidremotenotifications/model/UpdatePolicyTest.java",
"license": "apache-2.0",
"size": 2141
}
|
[
"org.junit.Assert"
] |
import org.junit.Assert;
|
import org.junit.*;
|
[
"org.junit"
] |
org.junit;
| 1,715,486
|
@Test
public void testGetMasterFor() {
expect(mockService.getMasterFor(anyObject())).andReturn(nodeId1).anyTimes();
replay(mockService);
final WebTarget wt = target();
final String response = wt.path("mastership/" + deviceId1.toString() +
"/master").request().get(String.class);
final JsonObject result = Json.parse(response).asObject();
assertThat(result, notNullValue());
assertThat(result.names(), hasSize(1));
assertThat(result.names().get(0), is("nodeId"));
final String node = result.get("nodeId").asString();
assertThat(node, notNullValue());
assertThat(node, is("node:1"));
}
|
void function() { expect(mockService.getMasterFor(anyObject())).andReturn(nodeId1).anyTimes(); replay(mockService); final WebTarget wt = target(); final String response = wt.path(STR + deviceId1.toString() + STR).request().get(String.class); final JsonObject result = Json.parse(response).asObject(); assertThat(result, notNullValue()); assertThat(result.names(), hasSize(1)); assertThat(result.names().get(0), is(STR)); final String node = result.get(STR).asString(); assertThat(node, notNullValue()); assertThat(node, is(STR)); }
|
/**
* Tests the result of the REST API GET when there is active master.
*/
|
Tests the result of the REST API GET when there is active master
|
testGetMasterFor
|
{
"repo_name": "Shashikanth-Huawei/bmp",
"path": "web/api/src/test/java/org/onosproject/rest/resources/MastershipResourceTest.java",
"license": "apache-2.0",
"size": 12784
}
|
[
"com.eclipsesource.json.Json",
"com.eclipsesource.json.JsonObject",
"javax.ws.rs.client.WebTarget",
"org.easymock.EasyMock",
"org.hamcrest.Matchers",
"org.junit.Assert"
] |
import com.eclipsesource.json.Json; import com.eclipsesource.json.JsonObject; import javax.ws.rs.client.WebTarget; import org.easymock.EasyMock; import org.hamcrest.Matchers; import org.junit.Assert;
|
import com.eclipsesource.json.*; import javax.ws.rs.client.*; import org.easymock.*; import org.hamcrest.*; import org.junit.*;
|
[
"com.eclipsesource.json",
"javax.ws",
"org.easymock",
"org.hamcrest",
"org.junit"
] |
com.eclipsesource.json; javax.ws; org.easymock; org.hamcrest; org.junit;
| 244,981
|
public void createPlotPart(Composite parent,
String plotName,
IActionBars bars,
PlotType hint,
IWorkbenchPart part);
|
void function(Composite parent, String plotName, IActionBars bars, PlotType hint, IWorkbenchPart part);
|
/**
* Call to create the UI component dealing with the plotting.
* @param parent
* @param plotName
* @param bars
* @param hint
* @param part - may be null
*/
|
Call to create the UI component dealing with the plotting
|
createPlotPart
|
{
"repo_name": "Anthchirp/dawnsci",
"path": "org.eclipse.dawnsci.plotting.api/src/org/eclipse/dawnsci/plotting/api/IPlottingSystem.java",
"license": "epl-1.0",
"size": 18299
}
|
[
"org.eclipse.swt.widgets.Composite",
"org.eclipse.ui.IActionBars",
"org.eclipse.ui.IWorkbenchPart"
] |
import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.IActionBars; import org.eclipse.ui.IWorkbenchPart;
|
import org.eclipse.swt.widgets.*; import org.eclipse.ui.*;
|
[
"org.eclipse.swt",
"org.eclipse.ui"
] |
org.eclipse.swt; org.eclipse.ui;
| 1,598,500
|
@Override
public synchronized List<FinalizedReplica> getFinalizedBlocks(String bpid) {
ArrayList<FinalizedReplica> finalized =
new ArrayList<FinalizedReplica>(volumeMap.size(bpid));
for (ReplicaInfo b : volumeMap.replicas(bpid)) {
if(b.getState() == ReplicaState.FINALIZED) {
finalized.add(new FinalizedReplica((FinalizedReplica)b));
}
}
return finalized;
}
|
synchronized List<FinalizedReplica> function(String bpid) { ArrayList<FinalizedReplica> finalized = new ArrayList<FinalizedReplica>(volumeMap.size(bpid)); for (ReplicaInfo b : volumeMap.replicas(bpid)) { if(b.getState() == ReplicaState.FINALIZED) { finalized.add(new FinalizedReplica((FinalizedReplica)b)); } } return finalized; }
|
/**
* Get the list of finalized blocks from in-memory blockmap for a block pool.
*/
|
Get the list of finalized blocks from in-memory blockmap for a block pool
|
getFinalizedBlocks
|
{
"repo_name": "tianshouzhi/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java",
"license": "apache-2.0",
"size": 112898
}
|
[
"java.util.ArrayList",
"java.util.List",
"org.apache.hadoop.hdfs.server.common.HdfsServerConstants",
"org.apache.hadoop.hdfs.server.datanode.FinalizedReplica",
"org.apache.hadoop.hdfs.server.datanode.ReplicaInfo"
] |
import java.util.ArrayList; import java.util.List; import org.apache.hadoop.hdfs.server.common.HdfsServerConstants; import org.apache.hadoop.hdfs.server.datanode.FinalizedReplica; import org.apache.hadoop.hdfs.server.datanode.ReplicaInfo;
|
import java.util.*; import org.apache.hadoop.hdfs.server.common.*; import org.apache.hadoop.hdfs.server.datanode.*;
|
[
"java.util",
"org.apache.hadoop"
] |
java.util; org.apache.hadoop;
| 2,681,181
|
public Cancellable getJobAsync(GetJobRequest request, RequestOptions options, ActionListener<GetJobResponse> listener) {
return restHighLevelClient.performRequestAsyncAndParseEntity(request,
MLRequestConverters::getJob,
options,
GetJobResponse::fromXContent,
listener,
Collections.emptySet());
}
|
Cancellable function(GetJobRequest request, RequestOptions options, ActionListener<GetJobResponse> listener) { return restHighLevelClient.performRequestAsyncAndParseEntity(request, MLRequestConverters::getJob, options, GetJobResponse::fromXContent, listener, Collections.emptySet()); }
|
/**
* Gets one or more Machine Learning job configuration info, asynchronously.
* <p>
* For additional info
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html">ML GET job documentation</a>
* @param request {@link GetJobRequest} Request containing a list of jobId(s) and additional options
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
* @param listener Listener to be notified with {@link GetJobResponse} upon request completion
* @return cancellable that may be used to cancel the request
*/
|
Gets one or more Machine Learning job configuration info, asynchronously. For additional info see ML GET job documentation
|
getJobAsync
|
{
"repo_name": "HonzaKral/elasticsearch",
"path": "client/rest-high-level/src/main/java/org/elasticsearch/client/MachineLearningClient.java",
"license": "apache-2.0",
"size": 130306
}
|
[
"java.util.Collections",
"org.elasticsearch.action.ActionListener",
"org.elasticsearch.client.ml.GetJobRequest",
"org.elasticsearch.client.ml.GetJobResponse"
] |
import java.util.Collections; import org.elasticsearch.action.ActionListener; import org.elasticsearch.client.ml.GetJobRequest; import org.elasticsearch.client.ml.GetJobResponse;
|
import java.util.*; import org.elasticsearch.action.*; import org.elasticsearch.client.ml.*;
|
[
"java.util",
"org.elasticsearch.action",
"org.elasticsearch.client"
] |
java.util; org.elasticsearch.action; org.elasticsearch.client;
| 1,418,673
|
@Test
public void test_getClaimNumber() {
String value = "new_value";
instance.setClaimNumber(value);
assertEquals("'getClaimNumber' should be correct.",
value, instance.getClaimNumber());
}
|
void function() { String value = STR; instance.setClaimNumber(value); assertEquals(STR, value, instance.getClaimNumber()); }
|
/**
* <p>
* Accuracy test for the method <code>getClaimNumber()</code>.<br>
* The value should be properly retrieved.
* </p>
*/
|
Accuracy test for the method <code>getClaimNumber()</code>. The value should be properly retrieved.
|
test_getClaimNumber
|
{
"repo_name": "NASA-Tournament-Lab/CoECI-OPM-Service-Credit-Redeposit-Deposit-Application",
"path": "Code/SCRD_BRE/src/java/tests/gov/opm/scrd/entities/application/PaymentMoveTransactionUnitTests.java",
"license": "apache-2.0",
"size": 16888
}
|
[
"org.junit.Assert"
] |
import org.junit.Assert;
|
import org.junit.*;
|
[
"org.junit"
] |
org.junit;
| 2,079,918
|
final IRemoteTx tx = remoteTx.get();
if (tx != null) {
final RemoteRepository rtmp = repo.getRemoteRepository();
final String sparqlEndpointURL = rtmp.getSparqlEndPoint();
final RemoteRepositoryManager rmgr = rtmp.getRemoteRepositoryManager();
return rmgr.getRepositoryForURL(sparqlEndpointURL, tx);
}
return repo.getRemoteRepository();
}
|
final IRemoteTx tx = remoteTx.get(); if (tx != null) { final RemoteRepository rtmp = repo.getRemoteRepository(); final String sparqlEndpointURL = rtmp.getSparqlEndPoint(); final RemoteRepositoryManager rmgr = rtmp.getRemoteRepositoryManager(); return rmgr.getRepositoryForURL(sparqlEndpointURL, tx); } return repo.getRemoteRepository(); }
|
/**
* Return a {@link RemoteRepository} for this connection.
*
* @see RemoteRepositoryManager#new
*/
|
Return a <code>RemoteRepository</code> for this connection
|
getRepositoryForConnection
|
{
"repo_name": "rac021/blazegraph_1_5_3_cluster_2_nodes",
"path": "bigdata-client/src/main/java/com/bigdata/rdf/sail/remote/BigdataSailRemoteRepositoryConnection.java",
"license": "gpl-2.0",
"size": 30505
}
|
[
"com.bigdata.rdf.sail.webapp.client.IRemoteTx",
"com.bigdata.rdf.sail.webapp.client.RemoteRepository",
"com.bigdata.rdf.sail.webapp.client.RemoteRepositoryManager"
] |
import com.bigdata.rdf.sail.webapp.client.IRemoteTx; import com.bigdata.rdf.sail.webapp.client.RemoteRepository; import com.bigdata.rdf.sail.webapp.client.RemoteRepositoryManager;
|
import com.bigdata.rdf.sail.webapp.client.*;
|
[
"com.bigdata.rdf"
] |
com.bigdata.rdf;
| 663,444
|
@Test
public void testGetAllSupported() throws Exception {
CacheTransactionManager ctm = this.cache.getCacheTransactionManager();
AttributesFactory af = new AttributesFactory();
Region r = this.cache.createRegion("dRegion", af.create());
PartitionAttributes pa =
new PartitionAttributesFactory().setRedundantCopies(0).setTotalNumBuckets(1).create();
af.setPartitionAttributes(pa);
Region pr = this.cache.createRegion("prRegion", af.create());
List list = new ArrayList();
list.add("stuff");
list.add("stuff2");
ctm.begin();
pr.getAll(list);
r.getAll(list);
ctm.commit();
// now we aren't in tx so these shouldn't throw
pr.getAll(list);
r.getAll(list);
}
|
void function() throws Exception { CacheTransactionManager ctm = this.cache.getCacheTransactionManager(); AttributesFactory af = new AttributesFactory(); Region r = this.cache.createRegion(STR, af.create()); PartitionAttributes pa = new PartitionAttributesFactory().setRedundantCopies(0).setTotalNumBuckets(1).create(); af.setPartitionAttributes(pa); Region pr = this.cache.createRegion(STR, af.create()); List list = new ArrayList(); list.add("stuff"); list.add(STR); ctm.begin(); pr.getAll(list); r.getAll(list); ctm.commit(); pr.getAll(list); r.getAll(list); }
|
/**
* make sure that we throw an UnsupportedOperationInTransactionException
*
*/
|
make sure that we throw an UnsupportedOperationInTransactionException
|
testGetAllSupported
|
{
"repo_name": "deepakddixit/incubator-geode",
"path": "geode-core/src/integrationTest/java/org/apache/geode/TXJUnitTest.java",
"license": "apache-2.0",
"size": 260403
}
|
[
"java.util.ArrayList",
"java.util.List",
"org.apache.geode.cache.AttributesFactory",
"org.apache.geode.cache.CacheTransactionManager",
"org.apache.geode.cache.PartitionAttributes",
"org.apache.geode.cache.PartitionAttributesFactory",
"org.apache.geode.cache.Region"
] |
import java.util.ArrayList; import java.util.List; import org.apache.geode.cache.AttributesFactory; import org.apache.geode.cache.CacheTransactionManager; import org.apache.geode.cache.PartitionAttributes; import org.apache.geode.cache.PartitionAttributesFactory; import org.apache.geode.cache.Region;
|
import java.util.*; import org.apache.geode.cache.*;
|
[
"java.util",
"org.apache.geode"
] |
java.util; org.apache.geode;
| 1,785,610
|
Cursor cursor = db.query(
DbSearch.TABLE,
new String[] { "MAX(" + DbSearch.Column.POSITION + ")" },
null,
null,
null,
null,
null);
try {
if (cursor.moveToFirst()) {
int maxPosition = cursor.getInt(0);
values.put(DbSearch.Column.POSITION, maxPosition + 1);
}
} finally {
cursor.close();
}
}
|
Cursor cursor = db.query( DbSearch.TABLE, new String[] { "MAX(" + DbSearch.Column.POSITION + ")" }, null, null, null, null, null); try { if (cursor.moveToFirst()) { int maxPosition = cursor.getInt(0); values.put(DbSearch.Column.POSITION, maxPosition + 1); } } finally { cursor.close(); } }
|
/**
* Updates ContentValues with the position. Sets it to maximum existing + 1.
*/
|
Updates ContentValues with the position. Sets it to maximum existing + 1
|
updateWithNextPosition
|
{
"repo_name": "MackieLoeffel/orgzly-android",
"path": "app/src/main/java/com/orgzly/android/provider/ProviderFilters.java",
"license": "gpl-3.0",
"size": 3827
}
|
[
"android.database.Cursor",
"com.orgzly.android.provider.models.DbSearch"
] |
import android.database.Cursor; import com.orgzly.android.provider.models.DbSearch;
|
import android.database.*; import com.orgzly.android.provider.models.*;
|
[
"android.database",
"com.orgzly.android"
] |
android.database; com.orgzly.android;
| 2,441,602
|
synchronized public void failOn(Failure fail) {
if (failures == null) {
failures = new ArrayList();
}
failures.add(fail);
}
|
synchronized void function(Failure fail) { if (failures == null) { failures = new ArrayList(); } failures.add(fail); }
|
/**
* add a Failure object to the list of objects to be evaluated
* at every potential failure point
*/
|
add a Failure object to the list of objects to be evaluated at every potential failure point
|
failOn
|
{
"repo_name": "sluk3r/lucene-3.0.2-src-study",
"path": "src/test/org/apache/lucene/store/MockRAMDirectory.java",
"license": "apache-2.0",
"size": 10210
}
|
[
"java.util.ArrayList"
] |
import java.util.ArrayList;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 716,054
|
public void addPage(@Nonnull WizardPage<T> page) {
page.setUpdateDelegate(delegate);
page.setContext(context);
page.init(dataObject);
wizardPages.add(page);
}
|
void function(@Nonnull WizardPage<T> page) { page.setUpdateDelegate(delegate); page.setContext(context); page.init(dataObject); wizardPages.add(page); }
|
/**
* Add page to wizard.
*
* @param page
* page to add
*/
|
Add page to wizard
|
addPage
|
{
"repo_name": "vitaliy0922/cop_che-core",
"path": "ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/wizard/AbstractWizard.java",
"license": "epl-1.0",
"size": 5675
}
|
[
"javax.annotation.Nonnull"
] |
import javax.annotation.Nonnull;
|
import javax.annotation.*;
|
[
"javax.annotation"
] |
javax.annotation;
| 2,217,454
|
public static native void close(FileDescriptor fd) throws IOException;
|
static native void function(FileDescriptor fd) throws IOException;
|
/**
* Calls close(2) on 'fd'. Also resets the internal int to -1.
*/
|
Calls close(2) on 'fd'. Also resets the internal int to -1
|
close
|
{
"repo_name": "openweave/openweave-core",
"path": "third_party/android/platform-libcore/android-platform-libcore/luni/src/main/java/libcore/io/IoUtils.java",
"license": "apache-2.0",
"size": 2401
}
|
[
"java.io.FileDescriptor",
"java.io.IOException"
] |
import java.io.FileDescriptor; import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 813,677
|
EClass getProcessRefStart();
|
EClass getProcessRefStart();
|
/**
* Returns the meta object for class '{@link org.lunifera.doc.dsl.doccompiler.ProcessRefStart <em>Process Ref Start</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Process Ref Start</em>'.
* @see org.lunifera.doc.dsl.doccompiler.ProcessRefStart
* @generated
*/
|
Returns the meta object for class '<code>org.lunifera.doc.dsl.doccompiler.ProcessRefStart Process Ref Start</code>'.
|
getProcessRefStart
|
{
"repo_name": "lunifera/lunifera-doc",
"path": "org.lunifera.doc.dsl.semantic/src/org/lunifera/doc/dsl/doccompiler/DocCompilerPackage.java",
"license": "epl-1.0",
"size": 267430
}
|
[
"org.eclipse.emf.ecore.EClass"
] |
import org.eclipse.emf.ecore.EClass;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 428,139
|
@Bean(name = "shibboleth.UnmarshallerFactory")
@DependsOn("shibboleth.OpenSAMLConfig")
public UnmarshallerFactory unmarshallerFactory() {
return XMLObjectProviderRegistrySupport.getUnmarshallerFactory();
}
|
@Bean(name = STR) @DependsOn(STR) UnmarshallerFactory function() { return XMLObjectProviderRegistrySupport.getUnmarshallerFactory(); }
|
/**
* Unmarshaller factory unmarshaller factory.
*
* @return the unmarshaller factory
*/
|
Unmarshaller factory unmarshaller factory
|
unmarshallerFactory
|
{
"repo_name": "yisiqi/cas",
"path": "cas-server-support-saml-core/src/main/java/org/apereo/cas/config/CoreSamlConfiguration.java",
"license": "apache-2.0",
"size": 5991
}
|
[
"org.opensaml.core.xml.config.XMLObjectProviderRegistrySupport",
"org.opensaml.core.xml.io.UnmarshallerFactory",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.DependsOn"
] |
import org.opensaml.core.xml.config.XMLObjectProviderRegistrySupport; import org.opensaml.core.xml.io.UnmarshallerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.DependsOn;
|
import org.opensaml.core.xml.config.*; import org.opensaml.core.xml.io.*; import org.springframework.context.annotation.*;
|
[
"org.opensaml.core",
"org.springframework.context"
] |
org.opensaml.core; org.springframework.context;
| 404,316
|
public UUIDWrapper getUUIDWrapper() {
return UUIDHandler.getUUIDWrapper();
}
|
UUIDWrapper function() { return UUIDHandler.getUUIDWrapper(); }
|
/**
* UUIDWrapper class has basic methods for getting UUIDS (it's recommended to use the UUIDHandler class instead)
*
* @return UUIDWrapper
*
* @see com.intellectualcrafters.plot.uuid.UUIDWrapper
*/
|
UUIDWrapper class has basic methods for getting UUIDS (it's recommended to use the UUIDHandler class instead)
|
getUUIDWrapper
|
{
"repo_name": "LaxWasHere/PlotSquared",
"path": "src/main/java/com/intellectualcrafters/plot/api/PlotAPI.java",
"license": "gpl-3.0",
"size": 22189
}
|
[
"com.intellectualcrafters.plot.util.UUIDHandler",
"com.intellectualcrafters.plot.uuid.UUIDWrapper"
] |
import com.intellectualcrafters.plot.util.UUIDHandler; import com.intellectualcrafters.plot.uuid.UUIDWrapper;
|
import com.intellectualcrafters.plot.util.*; import com.intellectualcrafters.plot.uuid.*;
|
[
"com.intellectualcrafters.plot"
] |
com.intellectualcrafters.plot;
| 1,715,122
|
public static ContentType getBestContentType(String acceptHeader,
List<ContentType> actualContentTypes) {
// If not accept header is specified, return the first actual type
if (acceptHeader == null) {
return actualContentTypes.get(0);
}
// iterate over all of the accepted content types to find the best match
float bestQ = 0;
ContentType bestContentType = null;
String[] acceptedTypes = acceptHeader.split(",");
for (String acceptedTypeString : acceptedTypes) {
// create the content type object
ContentType acceptedContentType;
try {
acceptedContentType = new ContentType(acceptedTypeString.trim());
} catch (IllegalArgumentException ex) {
// ignore exception
continue;
}
// parse the "q" value (default of 1)
float curQ = 1;
try {
String qAttr = acceptedContentType.getAttribute("q");
if (qAttr != null) {
float qValue = Float.valueOf(qAttr);
if (qValue <= 0 || qValue > 1) {
continue;
}
curQ = qValue + 0.0001F;
}
} catch (NumberFormatException ex) {
// ignore exception
continue;
}
// only check it if it's at least as good ("q") as the best one so far
if (curQ < bestQ) {
continue;
}
for (ContentType actualContentType : actualContentTypes) {
if (curQ == bestQ && bestContentType == actualContentType) {
break;
}
if (actualContentType.match(acceptedContentType)) {
bestContentType = actualContentType;
bestQ = curQ;
break;
}
}
}
// if found an acceptable content type, return the best one
if (bestQ != 0) {
return bestContentType;
}
// Return null if no match
return null;
}
|
static ContentType function(String acceptHeader, List<ContentType> actualContentTypes) { if (acceptHeader == null) { return actualContentTypes.get(0); } float bestQ = 0; ContentType bestContentType = null; String[] acceptedTypes = acceptHeader.split(","); for (String acceptedTypeString : acceptedTypes) { ContentType acceptedContentType; try { acceptedContentType = new ContentType(acceptedTypeString.trim()); } catch (IllegalArgumentException ex) { continue; } float curQ = 1; try { String qAttr = acceptedContentType.getAttribute("q"); if (qAttr != null) { float qValue = Float.valueOf(qAttr); if (qValue <= 0 qValue > 1) { continue; } curQ = qValue + 0.0001F; } } catch (NumberFormatException ex) { continue; } if (curQ < bestQ) { continue; } for (ContentType actualContentType : actualContentTypes) { if (curQ == bestQ && bestContentType == actualContentType) { break; } if (actualContentType.match(acceptedContentType)) { bestContentType = actualContentType; bestQ = curQ; break; } } } if (bestQ != 0) { return bestContentType; } return null; }
|
/**
* Determines the best "Content-Type" header to use in a servlet response
* based on the "Accept" header from a servlet request.
*
* @param acceptHeader "Accept" header value from a servlet request (not
* {@code null})
* @param actualContentTypes actual content types in descending order of
* preference (non-empty, and each entry is of the
* form "type/subtype" without the wildcard char
* '*') or {@code null} if no "Accept" header
* was specified
* @return the best content type to use (or {@code null} on no match).
*/
|
Determines the best "Content-Type" header to use in a servlet response based on the "Accept" header from a servlet request
|
getBestContentType
|
{
"repo_name": "vivo-project/Vitro",
"path": "api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/ContentType.java",
"license": "bsd-3-clause",
"size": 29958
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,073,033
|
static private LatLong cameraFrameToLocalFrame(LatLong img, double[][] dcm, double alt,
double focalLength, LatLong center) {
double x = alt
* (dcm[0][0] * img.getLatitude() + dcm[1][0] * img.getLongitude() + dcm[2][0] * (-focalLength))
/ (dcm[0][2] * img.getLatitude() + dcm[1][2] * img.getLongitude() + dcm[2][2] * (-focalLength));
double y = alt
* (dcm[0][1] * img.getLatitude() + dcm[1][1] * img.getLongitude() + dcm[2][1] * (-focalLength))
/ (dcm[0][2] * img.getLatitude() + dcm[1][2] * img.getLongitude() + dcm[2][2] * (-focalLength));
return GeoTools.moveCoordinate(center, x, y);
}
|
static LatLong function(LatLong img, double[][] dcm, double alt, double focalLength, LatLong center) { double x = alt * (dcm[0][0] * img.getLatitude() + dcm[1][0] * img.getLongitude() + dcm[2][0] * (-focalLength)) / (dcm[0][2] * img.getLatitude() + dcm[1][2] * img.getLongitude() + dcm[2][2] * (-focalLength)); double y = alt * (dcm[0][1] * img.getLatitude() + dcm[1][1] * img.getLongitude() + dcm[2][1] * (-focalLength)) / (dcm[0][2] * img.getLatitude() + dcm[1][2] * img.getLongitude() + dcm[2][2] * (-focalLength)); return GeoTools.moveCoordinate(center, x, y); }
|
/**
* based on http://www.asprs.org/a/publications/pers/2005journal/july/2005_july_863-871.pdf
*/
|
based on HREF
|
cameraFrameToLocalFrame
|
{
"repo_name": "forgodsake/TowerPlus",
"path": "Android/src/com/fuav/android/core/survey/Footprint.java",
"license": "gpl-3.0",
"size": 3131
}
|
[
"com.fuav.android.core.helpers.geoTools.GeoTools",
"com.o3dr.services.android.lib.coordinate.LatLong"
] |
import com.fuav.android.core.helpers.geoTools.GeoTools; import com.o3dr.services.android.lib.coordinate.LatLong;
|
import com.fuav.android.core.helpers.*; import com.o3dr.services.android.lib.coordinate.*;
|
[
"com.fuav.android",
"com.o3dr.services"
] |
com.fuav.android; com.o3dr.services;
| 2,334,196
|
private void generateSingleMLBytecodeCompilation(
Map<Path, ImmutableSortedSet<BuildRule>> sourceToRule,
ImmutableList.Builder<SourcePath> cmoFiles,
Path mlSource,
ImmutableMap<Path, ImmutableList<Path>> sources,
ImmutableList<Path> cycleDetector) {
ImmutableList<Path> newCycleDetector = ImmutableList.<Path>builder()
.addAll(cycleDetector)
.add(mlSource)
.build();
if (cycleDetector.contains(mlSource)) {
throw new HumanReadableException("Dependency cycle detected: %s",
Joiner.on(" -> ").join(newCycleDetector));
}
if (sourceToRule.containsKey(mlSource)) {
return;
}
ImmutableSortedSet.Builder<BuildRule> depsBuilder = ImmutableSortedSet.naturalOrder();
if (sources.containsKey(mlSource)) {
for (Path dep : checkNotNull(sources.get(mlSource))) {
generateSingleMLBytecodeCompilation(
sourceToRule,
cmoFiles,
dep,
sources,
newCycleDetector);
depsBuilder.addAll(checkNotNull(sourceToRule.get(dep)));
}
}
ImmutableSortedSet<BuildRule> deps = depsBuilder.build();
String name = mlSource.toFile().getName();
BuildTarget buildTarget = createMLBytecodeCompileBuildTarget(
params.getBuildTarget(),
name);
BuildRuleParams compileParams = params.copyWithChanges(
buildTarget,
Suppliers.ofInstance(
ImmutableSortedSet.<BuildRule>naturalOrder()
.addAll(params.getDeclaredDeps().get())
.addAll(deps)
.addAll(ocamlContext.getBytecodeCompileDeps())
.build()),
params.getExtraDeps());
String outputFileName = getMLBytecodeOutputName(name);
Path outputPath = ocamlContext.getCompileBytecodeOutputDir()
.resolve(outputFileName);
final ImmutableList<String> compileFlags = getCompileFlags(
true,
false);
BuildRule compileBytecode = new OCamlMLCompile(
compileParams,
pathResolver,
new OCamlMLCompileStep.Args(
params.getProjectFilesystem().getAbsolutifier(),
cCompiler.getEnvironment(pathResolver),
cCompiler.getCommandPrefix(pathResolver),
ocamlContext.getOcamlBytecodeCompiler().get(),
outputPath,
mlSource,
compileFlags));
resolver.addToIndex(compileBytecode);
sourceToRule.put(
mlSource,
ImmutableSortedSet.<BuildRule>naturalOrder()
.add(compileBytecode)
.addAll(deps)
.build());
if (!outputFileName.endsWith(OCamlCompilables.OCAML_CMI)) {
cmoFiles.add(
new BuildTargetSourcePath(compileBytecode.getBuildTarget()));
}
}
|
void function( Map<Path, ImmutableSortedSet<BuildRule>> sourceToRule, ImmutableList.Builder<SourcePath> cmoFiles, Path mlSource, ImmutableMap<Path, ImmutableList<Path>> sources, ImmutableList<Path> cycleDetector) { ImmutableList<Path> newCycleDetector = ImmutableList.<Path>builder() .addAll(cycleDetector) .add(mlSource) .build(); if (cycleDetector.contains(mlSource)) { throw new HumanReadableException(STR, Joiner.on(STR).join(newCycleDetector)); } if (sourceToRule.containsKey(mlSource)) { return; } ImmutableSortedSet.Builder<BuildRule> depsBuilder = ImmutableSortedSet.naturalOrder(); if (sources.containsKey(mlSource)) { for (Path dep : checkNotNull(sources.get(mlSource))) { generateSingleMLBytecodeCompilation( sourceToRule, cmoFiles, dep, sources, newCycleDetector); depsBuilder.addAll(checkNotNull(sourceToRule.get(dep))); } } ImmutableSortedSet<BuildRule> deps = depsBuilder.build(); String name = mlSource.toFile().getName(); BuildTarget buildTarget = createMLBytecodeCompileBuildTarget( params.getBuildTarget(), name); BuildRuleParams compileParams = params.copyWithChanges( buildTarget, Suppliers.ofInstance( ImmutableSortedSet.<BuildRule>naturalOrder() .addAll(params.getDeclaredDeps().get()) .addAll(deps) .addAll(ocamlContext.getBytecodeCompileDeps()) .build()), params.getExtraDeps()); String outputFileName = getMLBytecodeOutputName(name); Path outputPath = ocamlContext.getCompileBytecodeOutputDir() .resolve(outputFileName); final ImmutableList<String> compileFlags = getCompileFlags( true, false); BuildRule compileBytecode = new OCamlMLCompile( compileParams, pathResolver, new OCamlMLCompileStep.Args( params.getProjectFilesystem().getAbsolutifier(), cCompiler.getEnvironment(pathResolver), cCompiler.getCommandPrefix(pathResolver), ocamlContext.getOcamlBytecodeCompiler().get(), outputPath, mlSource, compileFlags)); resolver.addToIndex(compileBytecode); sourceToRule.put( mlSource, ImmutableSortedSet.<BuildRule>naturalOrder() .add(compileBytecode) .addAll(deps) .build()); if (!outputFileName.endsWith(OCamlCompilables.OCAML_CMI)) { cmoFiles.add( new BuildTargetSourcePath(compileBytecode.getBuildTarget())); } }
|
/**
* Compiles a single .ml file to a .cmo
*/
|
Compiles a single .ml file to a .cmo
|
generateSingleMLBytecodeCompilation
|
{
"repo_name": "Dominator008/buck",
"path": "src/com/facebook/buck/ocaml/OCamlBuildRulesGenerator.java",
"license": "apache-2.0",
"size": 21771
}
|
[
"com.facebook.buck.model.BuildTarget",
"com.facebook.buck.rules.BuildRule",
"com.facebook.buck.rules.BuildRuleParams",
"com.facebook.buck.rules.BuildTargetSourcePath",
"com.facebook.buck.rules.SourcePath",
"com.facebook.buck.util.HumanReadableException",
"com.google.common.base.Joiner",
"com.google.common.base.Preconditions",
"com.google.common.base.Suppliers",
"com.google.common.collect.ImmutableList",
"com.google.common.collect.ImmutableMap",
"com.google.common.collect.ImmutableSortedSet",
"java.nio.file.Path",
"java.util.Map"
] |
import com.facebook.buck.model.BuildTarget; import com.facebook.buck.rules.BuildRule; import com.facebook.buck.rules.BuildRuleParams; import com.facebook.buck.rules.BuildTargetSourcePath; import com.facebook.buck.rules.SourcePath; import com.facebook.buck.util.HumanReadableException; import com.google.common.base.Joiner; import com.google.common.base.Preconditions; import com.google.common.base.Suppliers; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSortedSet; import java.nio.file.Path; import java.util.Map;
|
import com.facebook.buck.model.*; import com.facebook.buck.rules.*; import com.facebook.buck.util.*; import com.google.common.base.*; import com.google.common.collect.*; import java.nio.file.*; import java.util.*;
|
[
"com.facebook.buck",
"com.google.common",
"java.nio",
"java.util"
] |
com.facebook.buck; com.google.common; java.nio; java.util;
| 2,853,185
|
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof Structure)) {
return false;
}
if (o.getClass() != getClass()
&& ((Structure)o).baseClass() != baseClass()) {
return false;
}
Structure s = (Structure)o;
if (s.getPointer().equals(getPointer())) {
return true;
}
if (s.size() == size()) {
clear(); write();
byte[] buf = getPointer().getByteArray(0, size());
s.clear(); s.write();
byte[] sbuf = s.getPointer().getByteArray(0, s.size());
return Arrays.equals(buf, sbuf);
}
return false;
}
|
boolean function(Object o) { if (o == this) { return true; } if (!(o instanceof Structure)) { return false; } if (o.getClass() != getClass() && ((Structure)o).baseClass() != baseClass()) { return false; } Structure s = (Structure)o; if (s.getPointer().equals(getPointer())) { return true; } if (s.size() == size()) { clear(); write(); byte[] buf = getPointer().getByteArray(0, size()); s.clear(); s.write(); byte[] sbuf = s.getPointer().getByteArray(0, s.size()); return Arrays.equals(buf, sbuf); } return false; }
|
/** This structure is equal to another based on the same data type
* and memory contents.
*/
|
This structure is equal to another based on the same data type and memory contents
|
equals
|
{
"repo_name": "SitChenNam/jna",
"path": "src/com/sun/jna/Structure.java",
"license": "lgpl-2.1",
"size": 61333
}
|
[
"java.util.Arrays"
] |
import java.util.Arrays;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,339,363
|
@Override
public Request<AssociateTransitGatewayRouteTableRequest> getDryRunRequest() {
Request<AssociateTransitGatewayRouteTableRequest> request = new AssociateTransitGatewayRouteTableRequestMarshaller().marshall(this);
request.addParameter("DryRun", Boolean.toString(true));
return request;
}
|
Request<AssociateTransitGatewayRouteTableRequest> function() { Request<AssociateTransitGatewayRouteTableRequest> request = new AssociateTransitGatewayRouteTableRequestMarshaller().marshall(this); request.addParameter(STR, Boolean.toString(true)); return request; }
|
/**
* This method is intended for internal use only. Returns the marshaled request configured with additional
* parameters to enable operation dry-run.
*/
|
This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run
|
getDryRunRequest
|
{
"repo_name": "aws/aws-sdk-java",
"path": "aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/AssociateTransitGatewayRouteTableRequest.java",
"license": "apache-2.0",
"size": 6406
}
|
[
"com.amazonaws.Request",
"com.amazonaws.services.ec2.model.transform.AssociateTransitGatewayRouteTableRequestMarshaller"
] |
import com.amazonaws.Request; import com.amazonaws.services.ec2.model.transform.AssociateTransitGatewayRouteTableRequestMarshaller;
|
import com.amazonaws.*; import com.amazonaws.services.ec2.model.transform.*;
|
[
"com.amazonaws",
"com.amazonaws.services"
] |
com.amazonaws; com.amazonaws.services;
| 2,313,621
|
@Override
public Set<Info<String>> computeClassesRelatedToClass(String javaClass) {
Set<Info<String>> classes = new TreeSet<Info<String>>();
Set<EdgeType> relationshipTypes = null;
ReverseTraceabilityMap instance = ReverseTraceabilityMap.getInstance();
Set<IElement> elements = instance.getElements(javaClass);
if (elements != null) {
for (IElement element : elements) {
if (element instanceof OObject) {
OObject object = (OObject) element;
// Find immediate predecessors
Set<IObject> preds = getPredecessors(object,
relationshipTypes);
for (IObject pred : preds) {
classes.addAll(getMostImportantClasses(pred));
}
// Find immediate successors
Set<IObject> succs = getSuccessors(object,
relationshipTypes);
for (IObject succ : succs) {
classes.addAll(getMostImportantClasses(succ));
}
}
}
}
return classes;
}
|
Set<Info<String>> function(String javaClass) { Set<Info<String>> classes = new TreeSet<Info<String>>(); Set<EdgeType> relationshipTypes = null; ReverseTraceabilityMap instance = ReverseTraceabilityMap.getInstance(); Set<IElement> elements = instance.getElements(javaClass); if (elements != null) { for (IElement element : elements) { if (element instanceof OObject) { OObject object = (OObject) element; Set<IObject> preds = getPredecessors(object, relationshipTypes); for (IObject pred : preds) { classes.addAll(getMostImportantClasses(pred)); } Set<IObject> succs = getSuccessors(object, relationshipTypes); for (IObject succ : succs) { classes.addAll(getMostImportantClasses(succ)); } } } } return classes; }
|
/**
* From the javaClass, pull up the associated RuntimeObjects. - Find the
* edges associated with the OObject. - Find the immediate
* successor/predecessor objects. NOTE: NOT doing any transitive closure
* here.
*/
|
From the javaClass, pull up the associated RuntimeObjects. - Find the edges associated with the OObject. - Find the immediate here
|
computeClassesRelatedToClass
|
{
"repo_name": "aroog/code",
"path": "ArchSummary/src/edu/wayne/summary/strategies/SummaryImpl1.java",
"license": "gpl-3.0",
"size": 7469
}
|
[
"edu.wayne.ograph.OObject",
"edu.wayne.summary.traceability.ReverseTraceabilityMap",
"java.util.Set",
"java.util.TreeSet"
] |
import edu.wayne.ograph.OObject; import edu.wayne.summary.traceability.ReverseTraceabilityMap; import java.util.Set; import java.util.TreeSet;
|
import edu.wayne.ograph.*; import edu.wayne.summary.traceability.*; import java.util.*;
|
[
"edu.wayne.ograph",
"edu.wayne.summary",
"java.util"
] |
edu.wayne.ograph; edu.wayne.summary; java.util;
| 2,318,248
|
private static float getFloat(String s, Param param, Messages messages) {
float f;
try {
f = Float.parseFloat(s);
if (!(f >= param.minFloat() && f <= param.maxFloat())) {
messages.addMessage(param.name(), param.message());
}
}
catch (NullPointerException | NumberFormatException e) {
f = param.defaultFloat();
}
return f;
}
|
static float function(String s, Param param, Messages messages) { float f; try { f = Float.parseFloat(s); if (!(f >= param.minFloat() && f <= param.maxFloat())) { messages.addMessage(param.name(), param.message()); } } catch (NullPointerException NumberFormatException e) { f = param.defaultFloat(); } return f; }
|
/**
* Returns a float value, considering the constraints given by Param.
* @param s a string containing the value to convert.
* @param param a Param annotation containing a group of default values and
* constraints.
* @param messages a Messages instance where errors during conversion will
* be posted.
* @return a float value.
*/
|
Returns a float value, considering the constraints given by Param
|
getFloat
|
{
"repo_name": "ajaimes/cinnamon",
"path": "src/main/java/com/cinnamonframework/ParameterManager.java",
"license": "bsd-3-clause",
"size": 20614
}
|
[
"com.cinnamonframework.annotations.Param"
] |
import com.cinnamonframework.annotations.Param;
|
import com.cinnamonframework.annotations.*;
|
[
"com.cinnamonframework.annotations"
] |
com.cinnamonframework.annotations;
| 464,512
|
private static DocumentStyleImpl getStyleImpl() {
if (styleImpl == null) {
styleImpl = GWT.create(DocumentStyleImpl.class);
}
return styleImpl;
}
|
static DocumentStyleImpl function() { if (styleImpl == null) { styleImpl = GWT.create(DocumentStyleImpl.class); } return styleImpl; }
|
/**
* Returns the document style implementation.<p>
*
* @return the document style implementation
*/
|
Returns the document style implementation
|
getStyleImpl
|
{
"repo_name": "it-tavis/opencms-core",
"path": "src-gwt/org/opencms/gwt/client/util/CmsDomUtil.java",
"license": "lgpl-2.1",
"size": 63520
}
|
[
"com.google.gwt.core.client.GWT",
"org.opencms.gwt.client.util.impl.DocumentStyleImpl"
] |
import com.google.gwt.core.client.GWT; import org.opencms.gwt.client.util.impl.DocumentStyleImpl;
|
import com.google.gwt.core.client.*; import org.opencms.gwt.client.util.impl.*;
|
[
"com.google.gwt",
"org.opencms.gwt"
] |
com.google.gwt; org.opencms.gwt;
| 1,676,228
|
@Override
protected final Collection makeFullCollection() {
return makeFullSet();
}
|
final Collection function() { return makeFullSet(); }
|
/**
* Makes a full collection by invoking {@link #makeFullSet()}.
*
* @return a full collection
*/
|
Makes a full collection by invoking <code>#makeFullSet()</code>
|
makeFullCollection
|
{
"repo_name": "intrigus/jtransc",
"path": "jtransc-main/test/javatest/utils/TestSet.java",
"license": "apache-2.0",
"size": 5413
}
|
[
"java.util.Collection"
] |
import java.util.Collection;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,432,729
|
private void updateXPoints(XYSeries series) {
if (series == null) {
throw new IllegalArgumentException("Null 'series' not permitted.");
}
HashSet seriesXPoints = new HashSet();
boolean savedState = this.propagateEvents;
this.propagateEvents = false;
for (int itemNo = 0; itemNo < series.getItemCount(); itemNo++) {
Number xValue = series.getX(itemNo);
seriesXPoints.add(xValue);
if (!this.xPoints.contains(xValue)) {
this.xPoints.add(xValue);
int seriesCount = this.data.size();
for (int seriesNo = 0; seriesNo < seriesCount; seriesNo++) {
XYSeries dataSeries = (XYSeries) this.data.get(seriesNo);
if (!dataSeries.equals(series)) {
dataSeries.add(xValue, null);
}
}
}
}
Iterator iterator = this.xPoints.iterator();
while (iterator.hasNext()) {
Number xPoint = (Number) iterator.next();
if (!seriesXPoints.contains(xPoint)) {
series.add(xPoint, null);
}
}
this.propagateEvents = savedState;
}
|
void function(XYSeries series) { if (series == null) { throw new IllegalArgumentException(STR); } HashSet seriesXPoints = new HashSet(); boolean savedState = this.propagateEvents; this.propagateEvents = false; for (int itemNo = 0; itemNo < series.getItemCount(); itemNo++) { Number xValue = series.getX(itemNo); seriesXPoints.add(xValue); if (!this.xPoints.contains(xValue)) { this.xPoints.add(xValue); int seriesCount = this.data.size(); for (int seriesNo = 0; seriesNo < seriesCount; seriesNo++) { XYSeries dataSeries = (XYSeries) this.data.get(seriesNo); if (!dataSeries.equals(series)) { dataSeries.add(xValue, null); } } } } Iterator iterator = this.xPoints.iterator(); while (iterator.hasNext()) { Number xPoint = (Number) iterator.next(); if (!seriesXPoints.contains(xPoint)) { series.add(xPoint, null); } } this.propagateEvents = savedState; }
|
/**
* Adds any unique x-values from 'series' to the dataset, and also adds any
* x-values that are in the dataset but not in 'series' to the series.
*
* @param series the series (<code>null</code> not permitted).
*/
|
Adds any unique x-values from 'series' to the dataset, and also adds any x-values that are in the dataset but not in 'series' to the series
|
updateXPoints
|
{
"repo_name": "ibestvina/multithread-centiscape",
"path": "CentiScaPe2.1/src/main/java/org/jfree/data/xy/DefaultTableXYDataset.java",
"license": "mit",
"size": 20258
}
|
[
"java.util.HashSet",
"java.util.Iterator"
] |
import java.util.HashSet; import java.util.Iterator;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 370,820
|
private boolean adjustBaseModelWeights(ExampleSet exampleSet, Vector<BayBoostBaseModelInfo> modelInfo)
throws OperatorException {
for (int j = 0; j < modelInfo.size(); j++) {
BayBoostBaseModelInfo consideredModelInfo = modelInfo.get(j);
Model consideredModel = consideredModelInfo.getModel();
ContingencyMatrix cm = consideredModelInfo.getContingencyMatrix();
// double[][] oldBiasMatrix = (double[][]) consideredModelInfo[1];
BayBoostStream.createOrReplacePredictedLabelFor(exampleSet);
exampleSet = consideredModel.apply(exampleSet);
if (!exampleSet.getAttributes().getPredictedLabel().isNominal()) {
// Only the case of nominal base classifiers is supported!
throw new UserError(this, 101, "BayBoostStream base learners", exampleSet.getAttributes().getLabel());
}
WeightedPerformanceMeasures wp = new WeightedPerformanceMeasures(exampleSet);
ContingencyMatrix cmNew = wp.getContingencyMatrix();
// double[][] newBiasMatrix = wp.createLiftRatioMatrix();
if (isModelUseful(cm) == false) {
modelInfo.remove(j);
j--;
log("Discard base model because of low advantage.");
} else {
consideredModelInfo = new BayBoostBaseModelInfo(consideredModel, cmNew);
modelInfo.set(j, consideredModelInfo);
boolean stillUncoveredExamples = WeightedPerformanceMeasures.reweightExamples(exampleSet, cmNew, false) > 0;
if (stillUncoveredExamples == false) {
return false;
}
}
}
return true;
}
|
boolean function(ExampleSet exampleSet, Vector<BayBoostBaseModelInfo> modelInfo) throws OperatorException { for (int j = 0; j < modelInfo.size(); j++) { BayBoostBaseModelInfo consideredModelInfo = modelInfo.get(j); Model consideredModel = consideredModelInfo.getModel(); ContingencyMatrix cm = consideredModelInfo.getContingencyMatrix(); BayBoostStream.createOrReplacePredictedLabelFor(exampleSet); exampleSet = consideredModel.apply(exampleSet); if (!exampleSet.getAttributes().getPredictedLabel().isNominal()) { throw new UserError(this, 101, STR, exampleSet.getAttributes().getLabel()); } WeightedPerformanceMeasures wp = new WeightedPerformanceMeasures(exampleSet); ContingencyMatrix cmNew = wp.getContingencyMatrix(); if (isModelUseful(cm) == false) { modelInfo.remove(j); j--; log(STR); } else { consideredModelInfo = new BayBoostBaseModelInfo(consideredModel, cmNew); modelInfo.set(j, consideredModelInfo); boolean stillUncoveredExamples = WeightedPerformanceMeasures.reweightExamples(exampleSet, cmNew, false) > 0; if (stillUncoveredExamples == false) { return false; } } } return true; }
|
/**
* This helper method takes as input the traing set and the set of models trained so far. It
* re-estimates the model weights one by one, which means that it changes the contents of the
* modelInfo container. Works with crisp base classifiers, only!
*
* @param exampleSet
* the training set to be used to tune the weights
* @param modelInfo
* the <code>Vector</code> of <code>Model</code>s, each with its biasMatrix
* @return <code>true</code> iff the <code>ExampleSet</code> contains at least one example that
* is not yet explained deterministically (otherwise: nothing left to learn)
*/
|
This helper method takes as input the traing set and the set of models trained so far. It re-estimates the model weights one by one, which means that it changes the contents of the modelInfo container. Works with crisp base classifiers, only
|
adjustBaseModelWeights
|
{
"repo_name": "aborg0/rapidminer-studio",
"path": "src/main/java/com/rapidminer/operator/learner/meta/BayBoostStream.java",
"license": "agpl-3.0",
"size": 27510
}
|
[
"com.rapidminer.example.ExampleSet",
"com.rapidminer.operator.Model",
"com.rapidminer.operator.OperatorException",
"com.rapidminer.operator.UserError",
"java.util.Vector"
] |
import com.rapidminer.example.ExampleSet; import com.rapidminer.operator.Model; import com.rapidminer.operator.OperatorException; import com.rapidminer.operator.UserError; import java.util.Vector;
|
import com.rapidminer.example.*; import com.rapidminer.operator.*; import java.util.*;
|
[
"com.rapidminer.example",
"com.rapidminer.operator",
"java.util"
] |
com.rapidminer.example; com.rapidminer.operator; java.util;
| 1,079,703
|
protected boolean closeAndOfflineRegionForSplitOrMerge(
final List<String> regionEncodedName) throws IOException {
for (int i = 0; i < regionEncodedName.size(); ++i) {
Region regionToClose = this.getFromOnlineRegions(regionEncodedName.get(i));
if (regionToClose != null) {
Map<byte[], List<StoreFile>> hstoreFiles = null;
Exception exceptionToThrow = null;
try{
hstoreFiles = ((HRegion)regionToClose).close(false);
} catch (Exception e) {
exceptionToThrow = e;
}
if (exceptionToThrow == null && hstoreFiles == null) {
// The region was closed by someone else
exceptionToThrow =
new IOException("Failed to close region: already closed by another thread");
}
if (exceptionToThrow != null) {
if (exceptionToThrow instanceof IOException) throw (IOException)exceptionToThrow;
throw new IOException(exceptionToThrow);
}
if (regionToClose.getTableDescriptor().hasSerialReplicationScope()) {
// For serial replication, we need add a final barrier on this region. But the splitting
// or merging may be reverted, so we should make sure if we reopen this region, the open
// barrier is same as this final barrier
long seq = regionToClose.getMaxFlushedSeqId();
if (seq == HConstants.NO_SEQNUM) {
// No edits in WAL for this region; get the sequence number when the region was opened.
seq = regionToClose.getOpenSeqNum();
if (seq == HConstants.NO_SEQNUM) {
// This region has no data
seq = 0;
}
} else {
seq++;
}
Put finalBarrier = MetaTableAccessor.makeBarrierPut(
Bytes.toBytes(regionEncodedName.get(i)),
seq,
regionToClose.getTableDescriptor().getTableName().getName());
MetaTableAccessor.putToMetaTable(getConnection(), finalBarrier);
}
// Offline the region
this.removeFromOnlineRegions(regionToClose, null);
}
}
return true;
}
|
boolean function( final List<String> regionEncodedName) throws IOException { for (int i = 0; i < regionEncodedName.size(); ++i) { Region regionToClose = this.getFromOnlineRegions(regionEncodedName.get(i)); if (regionToClose != null) { Map<byte[], List<StoreFile>> hstoreFiles = null; Exception exceptionToThrow = null; try{ hstoreFiles = ((HRegion)regionToClose).close(false); } catch (Exception e) { exceptionToThrow = e; } if (exceptionToThrow == null && hstoreFiles == null) { exceptionToThrow = new IOException(STR); } if (exceptionToThrow != null) { if (exceptionToThrow instanceof IOException) throw (IOException)exceptionToThrow; throw new IOException(exceptionToThrow); } if (regionToClose.getTableDescriptor().hasSerialReplicationScope()) { long seq = regionToClose.getMaxFlushedSeqId(); if (seq == HConstants.NO_SEQNUM) { seq = regionToClose.getOpenSeqNum(); if (seq == HConstants.NO_SEQNUM) { seq = 0; } } else { seq++; } Put finalBarrier = MetaTableAccessor.makeBarrierPut( Bytes.toBytes(regionEncodedName.get(i)), seq, regionToClose.getTableDescriptor().getTableName().getName()); MetaTableAccessor.putToMetaTable(getConnection(), finalBarrier); } this.removeFromOnlineRegions(regionToClose, null); } } return true; }
|
/**
* Close and offline the region for split or merge
*
* @param regionEncodedName the name of the region(s) to close
* @return true if closed the region successfully.
* @throws IOException
*/
|
Close and offline the region for split or merge
|
closeAndOfflineRegionForSplitOrMerge
|
{
"repo_name": "gustavoanatoly/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java",
"license": "apache-2.0",
"size": 143925
}
|
[
"java.io.IOException",
"java.util.List",
"java.util.Map",
"org.apache.hadoop.hbase.HConstants",
"org.apache.hadoop.hbase.MetaTableAccessor",
"org.apache.hadoop.hbase.client.Put",
"org.apache.hadoop.hbase.util.Bytes"
] |
import java.io.IOException; import java.util.List; import java.util.Map; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.MetaTableAccessor; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.util.Bytes;
|
import java.io.*; import java.util.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.util.*;
|
[
"java.io",
"java.util",
"org.apache.hadoop"
] |
java.io; java.util; org.apache.hadoop;
| 1,849,542
|
public boolean supersedes(ClusterState other) {
return this.nodes().masterNodeId() != null && this.nodes().masterNodeId().equals(other.nodes().masterNodeId()) && this.version() > other.version();
}
public enum Metric {
VERSION("version"),
MASTER_NODE("master_node"),
BLOCKS("blocks"),
NODES("nodes"),
METADATA("metadata"),
ROUTING_TABLE("routing_table"),
ROUTING_NODES("routing_nodes"),
CUSTOMS("customs");
private static Map<String, Metric> valueToEnum;
static {
valueToEnum = new HashMap<>();
for (Metric metric : Metric.values()) {
valueToEnum.put(metric.value, metric);
}
}
private final String value;
private Metric(String value) {
this.value = value;
}
|
boolean function(ClusterState other) { return this.nodes().masterNodeId() != null && this.nodes().masterNodeId().equals(other.nodes().masterNodeId()) && this.version() > other.version(); } public enum Metric { VERSION(STR), MASTER_NODE(STR), BLOCKS(STR), NODES("nodes"), METADATA(STR), ROUTING_TABLE(STR), ROUTING_NODES(STR), CUSTOMS(STR); private static Map<String, Metric> valueToEnum; static { valueToEnum = new HashMap<>(); for (Metric metric : Metric.values()) { valueToEnum.put(metric.value, metric); } } private final String value; private Metric(String value) { this.value = value; }
|
/**
* a cluster state supersedes another state iff they are from the same master and the version this state is higher thant the other state.
* <p>
* In essence that means that all the changes from the other cluster state are also reflected by the current one
*/
|
a cluster state supersedes another state iff they are from the same master and the version this state is higher thant the other state. In essence that means that all the changes from the other cluster state are also reflected by the current one
|
supersedes
|
{
"repo_name": "ESamir/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/cluster/ClusterState.java",
"license": "apache-2.0",
"size": 31416
}
|
[
"java.util.HashMap",
"java.util.Map"
] |
import java.util.HashMap; import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,281,585
|
public SshConnectionProperties getProperties() {
return properties;
}
|
SshConnectionProperties function() { return properties; }
|
/**
* DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
|
DOCUMENT ME
|
getProperties
|
{
"repo_name": "swift-lang/swift-k",
"path": "cogkit/modules/provider-ssh/src/com/sshtools/j2ssh/transport/TransportProtocolCommon.java",
"license": "apache-2.0",
"size": 43025
}
|
[
"com.sshtools.j2ssh.configuration.SshConnectionProperties"
] |
import com.sshtools.j2ssh.configuration.SshConnectionProperties;
|
import com.sshtools.j2ssh.configuration.*;
|
[
"com.sshtools.j2ssh"
] |
com.sshtools.j2ssh;
| 1,709,870
|
public Member getMember() {
return member;
}
|
Member function() { return member; }
|
/**
* Return an instance of the user - to display when validation errors occur
*
* @return a populated user
*/
|
Return an instance of the user - to display when validation errors occur
|
getMember
|
{
"repo_name": "stevenzh/tourismwork",
"path": "src/apps/portal/src/main/java/com/opentravelsoft/webapp/action/SignupAction.java",
"license": "gpl-2.0",
"size": 3461
}
|
[
"com.opentravelsoft.entity.Member"
] |
import com.opentravelsoft.entity.Member;
|
import com.opentravelsoft.entity.*;
|
[
"com.opentravelsoft.entity"
] |
com.opentravelsoft.entity;
| 2,071,332
|
public void testRequestOnClosedIndex() {
client().admin().indices().prepareClose("test").get();
try {
client().admin().indices().prepareSegments("test").get();
fail("Expected IndexClosedException");
} catch (IndexClosedException e) {
assertThat(e.getMessage(), is("closed"));
}
}
|
void function() { client().admin().indices().prepareClose("test").get(); try { client().admin().indices().prepareSegments("test").get(); fail(STR); } catch (IndexClosedException e) { assertThat(e.getMessage(), is(STR)); } }
|
/**
* with the default IndicesOptions inherited from BroadcastOperationRequest this will raise an exception
*/
|
with the default IndicesOptions inherited from BroadcastOperationRequest this will raise an exception
|
testRequestOnClosedIndex
|
{
"repo_name": "qwerty4030/elasticsearch",
"path": "server/src/test/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsRequestTests.java",
"license": "apache-2.0",
"size": 4370
}
|
[
"org.elasticsearch.indices.IndexClosedException",
"org.hamcrest.Matchers"
] |
import org.elasticsearch.indices.IndexClosedException; import org.hamcrest.Matchers;
|
import org.elasticsearch.indices.*; import org.hamcrest.*;
|
[
"org.elasticsearch.indices",
"org.hamcrest"
] |
org.elasticsearch.indices; org.hamcrest;
| 2,436,367
|
private Vector<JKTableRecord> geteRecords() {
return this.records;
}
|
Vector<JKTableRecord> function() { return this.records; }
|
/**
* Gets the e records.
*
* @return the e records
*/
|
Gets the e records
|
geteRecords
|
{
"repo_name": "kiswanij/jk-util",
"path": "src/main/java/com/jk/util/model/table/JKTableModel.java",
"license": "mit",
"size": 27674
}
|
[
"java.util.Vector"
] |
import java.util.Vector;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,076,769
|
public void startEngine(String lang, String speed, Object... startPropSpec) {
if(handle > 0) {
return;
}
if(StringUtils.isEmpty(lang)) {
throw new IllegalArgumentException("Language is required.");
}
if(! (SPEED_FASTEST.equals(speed) || SPEED_FAST.equals(speed) || SPEED_SLOW.equals(speed))) {
throw new IllegalArgumentException("Invalid speed: " + speed);
}
Properties props = readProperties(startPropSpec);
String s = doStart(lang, speed, propsToString(props), CONFIG_PROP_SEPARATOR, CONFIG_PROP_KEY_VALUE_SEPARATOR);
if(s != null) {
throw new OcrException(s);
}
}
|
void function(String lang, String speed, Object... startPropSpec) { if(handle > 0) { return; } if(StringUtils.isEmpty(lang)) { throw new IllegalArgumentException(STR); } if(! (SPEED_FASTEST.equals(speed) SPEED_FAST.equals(speed) SPEED_SLOW.equals(speed))) { throw new IllegalArgumentException(STR + speed); } Properties props = readProperties(startPropSpec); String s = doStart(lang, speed, propsToString(props), CONFIG_PROP_SEPARATOR, CONFIG_PROP_KEY_VALUE_SEPARATOR); if(s != null) { throw new OcrException(s); } }
|
/**
* Starts the OCR engine with optional properties (e.g., to specify dictionary/templates file)
* @param lang e.g., "eng" for English
* @param speed valid values: {@linkplain #SPEED_FASTEST}, {@linkplain #SPEED_FAST}, {@linkplain #SPEED_SLOW}.
* @param startPropSpec optional start properties, can be a single {@linkplain java.util.Properties} object or inline specification in pairs or a single string. Valid property names are defined in this class, etc.
*/
|
Starts the OCR engine with optional properties (e.g., to specify dictionary/templates file)
|
startEngine
|
{
"repo_name": "Asprise/java-ocr-api",
"path": "src/main/java/com/asprise/ocr/Ocr.java",
"license": "agpl-3.0",
"size": 45099
}
|
[
"com.asprise.ocr.util.StringUtils",
"java.util.Properties"
] |
import com.asprise.ocr.util.StringUtils; import java.util.Properties;
|
import com.asprise.ocr.util.*; import java.util.*;
|
[
"com.asprise.ocr",
"java.util"
] |
com.asprise.ocr; java.util;
| 619,599
|
public void unregisterMBean(Object mbeanIdentifier)
{
if (mbeanIdentifier == null)
return;
unregisterMBean((ObjectName) mbeanIdentifier);
}
|
void function(Object mbeanIdentifier) { if (mbeanIdentifier == null) return; unregisterMBean((ObjectName) mbeanIdentifier); }
|
/**
* Unregister an mbean using an object previous returned from registerMBean.
*/
|
Unregister an mbean using an object previous returned from registerMBean
|
unregisterMBean
|
{
"repo_name": "scnakandala/derby",
"path": "java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java",
"license": "apache-2.0",
"size": 14890
}
|
[
"javax.management.ObjectName"
] |
import javax.management.ObjectName;
|
import javax.management.*;
|
[
"javax.management"
] |
javax.management;
| 2,827,626
|
@Message(id = 201, value = "Unknown attribute '%s'")
String unknownAttribute(String name);
|
@Message(id = 201, value = STR) String unknownAttribute(String name);
|
/**
* A message indicating the attribute, represented by the {@code name} parameter, is unknown.
*
* @param name the attribute name.
*
* @return the message.
*/
|
A message indicating the attribute, represented by the name parameter, is unknown
|
unknownAttribute
|
{
"repo_name": "aloubyansky/wildfly-core",
"path": "controller/src/main/java/org/jboss/as/controller/logging/ControllerLogger.java",
"license": "lgpl-2.1",
"size": 164970
}
|
[
"org.jboss.logging.annotations.Message"
] |
import org.jboss.logging.annotations.Message;
|
import org.jboss.logging.annotations.*;
|
[
"org.jboss.logging"
] |
org.jboss.logging;
| 79,176
|
@Test
public void testAttributes() {
Node root = document.getDocumentElement();
assertTrue(XmlParserHelper.existsXmlAttribute(root, INFO1_ATTRIBUTE));
assertEquals("1", XmlParserHelper.getXmlAttributeValue(root, INFO1_ATTRIBUTE));
assertTrue(XmlParserHelper.existsXmlAttribute(root, INFO2_ATTRIBUTE));
assertEquals("2", XmlParserHelper.getXmlAttributeValue(root, INFO2_ATTRIBUTE));
assertTrue(XmlParserHelper.existsXmlAttribute(root, INFO3_ATTRIBUTE));
assertEquals("3", XmlParserHelper.getXmlAttributeValue(root, INFO3_ATTRIBUTE));
}
|
void function() { Node root = document.getDocumentElement(); assertTrue(XmlParserHelper.existsXmlAttribute(root, INFO1_ATTRIBUTE)); assertEquals("1", XmlParserHelper.getXmlAttributeValue(root, INFO1_ATTRIBUTE)); assertTrue(XmlParserHelper.existsXmlAttribute(root, INFO2_ATTRIBUTE)); assertEquals("2", XmlParserHelper.getXmlAttributeValue(root, INFO2_ATTRIBUTE)); assertTrue(XmlParserHelper.existsXmlAttribute(root, INFO3_ATTRIBUTE)); assertEquals("3", XmlParserHelper.getXmlAttributeValue(root, INFO3_ATTRIBUTE)); }
|
/**
* Checks if the XML test file has the expected attributes.
*/
|
Checks if the XML test file has the expected attributes
|
testAttributes
|
{
"repo_name": "gammalgris/jmul",
"path": "Utilities/XML-Tests/src/test/jmul/xml/TestFileStructureTest.java",
"license": "gpl-3.0",
"size": 2982
}
|
[
"org.junit.Assert",
"org.w3c.dom.Node"
] |
import org.junit.Assert; import org.w3c.dom.Node;
|
import org.junit.*; import org.w3c.dom.*;
|
[
"org.junit",
"org.w3c.dom"
] |
org.junit; org.w3c.dom;
| 2,390,525
|
Set<PersistentMemberID> getMissingMemberIds();
|
Set<PersistentMemberID> getMissingMemberIds();
|
/**
* Return the set of member ids which this resource knows are missing
*/
|
Return the set of member ids which this resource knows are missing
|
getMissingMemberIds
|
{
"repo_name": "jdeppe-pivotal/geode",
"path": "geode-core/src/main/java/org/apache/geode/internal/cache/persistence/PersistentMemberManager.java",
"license": "apache-2.0",
"size": 8657
}
|
[
"java.util.Set"
] |
import java.util.Set;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,991,086
|
@Override
public SkillSet getSkills() {
return this.skills;
}
|
SkillSet function() { return this.skills; }
|
/**
* Fetches the Persona's SkillSet. This also contains any temporary
* modifications to skills, like prayer or potion modifications.
*
* @return the Persona's SkillSet
*/
|
Fetches the Persona's SkillSet. This also contains any temporary modifications to skills, like prayer or potion modifications
|
getSkills
|
{
"repo_name": "tehnewb/Titan",
"path": "src/org/maxgamer/rs/model/entity/mob/persona/Persona.java",
"license": "gpl-3.0",
"size": 29244
}
|
[
"org.maxgamer.rs.model.skill.SkillSet"
] |
import org.maxgamer.rs.model.skill.SkillSet;
|
import org.maxgamer.rs.model.skill.*;
|
[
"org.maxgamer.rs"
] |
org.maxgamer.rs;
| 353,263
|
public CRL engineGenerateCRL(
InputStream inStream)
throws CRLException
{
if (currentCrlStream == null)
{
currentCrlStream = inStream;
sCrlData = null;
sCrlDataObjectCount = 0;
}
else if (currentCrlStream != inStream) // reset if input stream has changed
{
currentCrlStream = inStream;
sCrlData = null;
sCrlDataObjectCount = 0;
}
try
{
if (sCrlData != null)
{
if (sCrlDataObjectCount != sCrlData.size())
{
return getCRL();
}
else
{
sCrlData = null;
sCrlDataObjectCount = 0;
return null;
}
}
PushbackInputStream pis = new PushbackInputStream(inStream);
int tag = pis.read();
if (tag == -1)
{
return null;
}
pis.unread(tag);
if (tag != 0x30) // assume ascii PEM encoded.
{
return readPEMCRL(pis);
}
else
{ // lazy evaluate to help processing of large CRLs
return readDERCRL(new ASN1InputStream(pis, true));
}
}
catch (CRLException e)
{
throw e;
}
catch (Exception e)
{
throw new CRLException(e.toString());
}
}
|
CRL function( InputStream inStream) throws CRLException { if (currentCrlStream == null) { currentCrlStream = inStream; sCrlData = null; sCrlDataObjectCount = 0; } else if (currentCrlStream != inStream) { currentCrlStream = inStream; sCrlData = null; sCrlDataObjectCount = 0; } try { if (sCrlData != null) { if (sCrlDataObjectCount != sCrlData.size()) { return getCRL(); } else { sCrlData = null; sCrlDataObjectCount = 0; return null; } } PushbackInputStream pis = new PushbackInputStream(inStream); int tag = pis.read(); if (tag == -1) { return null; } pis.unread(tag); if (tag != 0x30) { return readPEMCRL(pis); } else { return readDERCRL(new ASN1InputStream(pis, true)); } } catch (CRLException e) { throw e; } catch (Exception e) { throw new CRLException(e.toString()); } }
|
/**
* Generates a certificate revocation list (CRL) object and initializes
* it with the data read from the input stream inStream.
*/
|
Generates a certificate revocation list (CRL) object and initializes it with the data read from the input stream inStream
|
engineGenerateCRL
|
{
"repo_name": "Skywalker-11/spongycastle",
"path": "prov/src/main/jdk1.1/org/spongycastle/jcajce/provider/asymmetric/x509/CertificateFactory.java",
"license": "mit",
"size": 11050
}
|
[
"java.io.InputStream",
"java.io.PushbackInputStream",
"java.security.cert.CRLException",
"org.spongycastle.asn1.ASN1InputStream"
] |
import java.io.InputStream; import java.io.PushbackInputStream; import java.security.cert.CRLException; import org.spongycastle.asn1.ASN1InputStream;
|
import java.io.*; import java.security.cert.*; import org.spongycastle.asn1.*;
|
[
"java.io",
"java.security",
"org.spongycastle.asn1"
] |
java.io; java.security; org.spongycastle.asn1;
| 1,053,006
|
public void addView(View view) {
this.view = view;
}
|
void function(View view) { this.view = view; }
|
/**
* Connect a view to this controller
*
* @param view View to link to this controller
*/
|
Connect a view to this controller
|
addView
|
{
"repo_name": "KeydownR/DTE",
"path": "JAVA/src/be/chrisv/dte/controller/Controller.java",
"license": "gpl-3.0",
"size": 5440
}
|
[
"be.chrisv.dte.view.View"
] |
import be.chrisv.dte.view.View;
|
import be.chrisv.dte.view.*;
|
[
"be.chrisv.dte"
] |
be.chrisv.dte;
| 2,436,847
|
Path genericConfigFolder = createTempDir();
Settings baseSettings = settingsBuilder()
.put(Environment.PATH_HOME_SETTING.getKey(), createTempDir().toString())
.put(Environment.PATH_CONF_SETTING.getKey(), genericConfigFolder)
.build();
Environment environment = new Environment(baseSettings);
ScriptContextRegistry scriptContextRegistry = new ScriptContextRegistry(Collections.emptyList());
ScriptEngineRegistry scriptEngineRegistry = new ScriptEngineRegistry(Collections.singletonList(new ScriptEngineRegistry
.ScriptEngineRegistration(TestEngineService.class, TestEngineService.TYPES)));
ScriptSettings scriptSettings = new ScriptSettings(scriptEngineRegistry, scriptContextRegistry);
suggesters = new Suggesters(Collections.emptyMap());
namedWriteableRegistry = new NamedWriteableRegistry();
namedWriteableRegistry.registerPrototype(SuggestionBuilder.class, TermSuggestionBuilder.PROTOTYPE);
namedWriteableRegistry.registerPrototype(SuggestionBuilder.class, PhraseSuggestionBuilder.PROTOTYPE);
namedWriteableRegistry.registerPrototype(SuggestionBuilder.class, CompletionSuggestionBuilder.PROTOTYPE);
queriesRegistry = new SearchModule(Settings.EMPTY, namedWriteableRegistry).buildQueryParserRegistry();
parseFieldMatcher = ParseFieldMatcher.STRICT;
}
|
Path genericConfigFolder = createTempDir(); Settings baseSettings = settingsBuilder() .put(Environment.PATH_HOME_SETTING.getKey(), createTempDir().toString()) .put(Environment.PATH_CONF_SETTING.getKey(), genericConfigFolder) .build(); Environment environment = new Environment(baseSettings); ScriptContextRegistry scriptContextRegistry = new ScriptContextRegistry(Collections.emptyList()); ScriptEngineRegistry scriptEngineRegistry = new ScriptEngineRegistry(Collections.singletonList(new ScriptEngineRegistry .ScriptEngineRegistration(TestEngineService.class, TestEngineService.TYPES))); ScriptSettings scriptSettings = new ScriptSettings(scriptEngineRegistry, scriptContextRegistry); suggesters = new Suggesters(Collections.emptyMap()); namedWriteableRegistry = new NamedWriteableRegistry(); namedWriteableRegistry.registerPrototype(SuggestionBuilder.class, TermSuggestionBuilder.PROTOTYPE); namedWriteableRegistry.registerPrototype(SuggestionBuilder.class, PhraseSuggestionBuilder.PROTOTYPE); namedWriteableRegistry.registerPrototype(SuggestionBuilder.class, CompletionSuggestionBuilder.PROTOTYPE); queriesRegistry = new SearchModule(Settings.EMPTY, namedWriteableRegistry).buildQueryParserRegistry(); parseFieldMatcher = ParseFieldMatcher.STRICT; }
|
/**
* setup for the whole base test class
*/
|
setup for the whole base test class
|
init
|
{
"repo_name": "mapr/elasticsearch",
"path": "core/src/test/java/org/elasticsearch/search/suggest/AbstractSuggestionBuilderTestCase.java",
"license": "apache-2.0",
"size": 12408
}
|
[
"java.nio.file.Path",
"java.util.Collections",
"org.elasticsearch.common.ParseFieldMatcher",
"org.elasticsearch.common.io.stream.NamedWriteableRegistry",
"org.elasticsearch.common.settings.Settings",
"org.elasticsearch.env.Environment",
"org.elasticsearch.script.ScriptContextRegistry",
"org.elasticsearch.script.ScriptEngineRegistry",
"org.elasticsearch.script.ScriptServiceTests",
"org.elasticsearch.script.ScriptSettings",
"org.elasticsearch.search.SearchModule",
"org.elasticsearch.search.suggest.completion.CompletionSuggestionBuilder",
"org.elasticsearch.search.suggest.phrase.PhraseSuggestionBuilder",
"org.elasticsearch.search.suggest.term.TermSuggestionBuilder"
] |
import java.nio.file.Path; import java.util.Collections; import org.elasticsearch.common.ParseFieldMatcher; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.env.Environment; import org.elasticsearch.script.ScriptContextRegistry; import org.elasticsearch.script.ScriptEngineRegistry; import org.elasticsearch.script.ScriptServiceTests; import org.elasticsearch.script.ScriptSettings; import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.suggest.completion.CompletionSuggestionBuilder; import org.elasticsearch.search.suggest.phrase.PhraseSuggestionBuilder; import org.elasticsearch.search.suggest.term.TermSuggestionBuilder;
|
import java.nio.file.*; import java.util.*; import org.elasticsearch.common.*; import org.elasticsearch.common.io.stream.*; import org.elasticsearch.common.settings.*; import org.elasticsearch.env.*; import org.elasticsearch.script.*; import org.elasticsearch.search.*; import org.elasticsearch.search.suggest.completion.*; import org.elasticsearch.search.suggest.phrase.*; import org.elasticsearch.search.suggest.term.*;
|
[
"java.nio",
"java.util",
"org.elasticsearch.common",
"org.elasticsearch.env",
"org.elasticsearch.script",
"org.elasticsearch.search"
] |
java.nio; java.util; org.elasticsearch.common; org.elasticsearch.env; org.elasticsearch.script; org.elasticsearch.search;
| 1,938,202
|
FSObject getObject(String path) throws ReconstructionException;
|
FSObject getObject(String path) throws ReconstructionException;
|
/**
* retrieve some object from the servers
*/
|
retrieve some object from the servers
|
getObject
|
{
"repo_name": "Archistar/archistar-core",
"path": "src/main/java/at/ac/ait/archistar/engine/dataobjects/SimpleFileInterface.java",
"license": "gpl-2.0",
"size": 1046
}
|
[
"at.archistar.crypto.secretsharing.ReconstructionException"
] |
import at.archistar.crypto.secretsharing.ReconstructionException;
|
import at.archistar.crypto.secretsharing.*;
|
[
"at.archistar.crypto"
] |
at.archistar.crypto;
| 1,903,535
|
public String createCacheId(PrimaryKeyMap pk,
ObjectMapped object) throws CacheException;
|
String function(PrimaryKeyMap pk, ObjectMapped object) throws CacheException;
|
/**
*
* Creates id cache for an object specified in obj.
*
* Value of cache id is created on value of primary key.
*
* @param pk PrimaryKeyMap
* @param object ObjectMapped
* @return String cache id
* @throws CacheException
*
*/
|
Creates id cache for an object specified in obj. Value of cache id is created on value of primary key
|
createCacheId
|
{
"repo_name": "kcsl/immutability-benchmark",
"path": "benchmark-applications/reiminfer-oopsla-2012/source/JdbF/src/org/jdbf/engine/caching/CacheIdManager.java",
"license": "mit",
"size": 2468
}
|
[
"org.jdbf.engine.basic.ObjectMapped",
"org.jdbf.engine.mapping.PrimaryKeyMap"
] |
import org.jdbf.engine.basic.ObjectMapped; import org.jdbf.engine.mapping.PrimaryKeyMap;
|
import org.jdbf.engine.basic.*; import org.jdbf.engine.mapping.*;
|
[
"org.jdbf.engine"
] |
org.jdbf.engine;
| 1,371,576
|
@Override
public boolean equals(Object obj1) {
if (obj1 instanceof ContainsConstraint) {
ContainsConstraint cc = (ContainsConstraint) obj1;
return this.ref.equals(cc.ref)
&& this.op == cc.op
&& Util.equals(this.obj, cc.obj)
&& Util.equals(this.cls, cc.cls);
}
return false;
}
|
boolean function(Object obj1) { if (obj1 instanceof ContainsConstraint) { ContainsConstraint cc = (ContainsConstraint) obj1; return this.ref.equals(cc.ref) && this.op == cc.op && Util.equals(this.obj, cc.obj) && Util.equals(this.cls, cc.cls); } return false; }
|
/**
* Test whether two ContainsConstraints are equal, overrides Object.equals()
*
* @param obj1 the object to compare with
* @return true if objects are equal
*/
|
Test whether two ContainsConstraints are equal, overrides Object.equals()
|
equals
|
{
"repo_name": "elsiklab/intermine",
"path": "intermine/objectstore/main/src/org/intermine/objectstore/query/ContainsConstraint.java",
"license": "lgpl-2.1",
"size": 5990
}
|
[
"org.intermine.metadata.Util"
] |
import org.intermine.metadata.Util;
|
import org.intermine.metadata.*;
|
[
"org.intermine.metadata"
] |
org.intermine.metadata;
| 178,355
|
protected EObject createInitialModel() {
EClass eClass = (EClass)workforcePackage.getEClassifier(initialObjectCreationPage.getInitialObjectName());
EObject rootObject = workforceFactory.create(eClass);
return rootObject;
}
|
EObject function() { EClass eClass = (EClass)workforcePackage.getEClassifier(initialObjectCreationPage.getInitialObjectName()); EObject rootObject = workforceFactory.create(eClass); return rootObject; }
|
/**
* Create a new model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
|
Create a new model.
|
createInitialModel
|
{
"repo_name": "BaSys-PC1/models",
"path": "de.dfki.iui.basys.model.domain.editor/src/de/dfki/iui/basys/model/domain/workforce/presentation/WorkforceModelWizard.java",
"license": "epl-1.0",
"size": 17904
}
|
[
"org.eclipse.emf.ecore.EClass",
"org.eclipse.emf.ecore.EObject"
] |
import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 1,325,203
|
// primary sentiment
String sent1 = "WPID:" + this.weiboId + " ";
sent1 += LabelMap.getIndex(Category.getEmotionString(weiboEmotionType1));
sent1 += getFeatureString();
// secondary sentiment
String sent2 = "WPID:" + this.weiboId + " ";
sent2 += LabelMap.getIndex(Category.getEmotionString(weiboEmotionType2));
sent2 += getFeatureString();
return sent1 + "\n" + sent2;
}
|
String sent1 = "WPID:" + this.weiboId + " "; sent1 += LabelMap.getIndex(Category.getEmotionString(weiboEmotionType1)); sent1 += getFeatureString(); String sent2 = "WPID:" + this.weiboId + " "; sent2 += LabelMap.getIndex(Category.getEmotionString(weiboEmotionType2)); sent2 += getFeatureString(); return sent1 + "\n" + sent2; }
|
/**
* Dump string representation of current weibo
* @return
*/
|
Dump string representation of current weibo
|
dump
|
{
"repo_name": "intfloat/weibo-emotion-analyzer",
"path": "src/edu/pku/instance/Weibo.java",
"license": "gpl-2.0",
"size": 5388
}
|
[
"edu.pku.emotion.feat.LabelMap"
] |
import edu.pku.emotion.feat.LabelMap;
|
import edu.pku.emotion.feat.*;
|
[
"edu.pku.emotion"
] |
edu.pku.emotion;
| 2,244,834
|
boolean offerLast(E e, long timeout, TimeUnit unit)
throws InterruptedException;
|
boolean offerLast(E e, long timeout, TimeUnit unit) throws InterruptedException;
|
/**
* Inserts the specified element at the end of this deque,
* waiting up to the specified wait time if necessary for space to
* become available.
*
* @param e the element to add
* @param timeout how long to wait before giving up, in units of
* <tt>unit</tt>
* @param unit a <tt>TimeUnit</tt> determining how to interpret the
* <tt>timeout</tt> parameter
* @return <tt>true</tt> if successful, or <tt>false</tt> if
* the specified waiting time elapses before space is available
* @throws InterruptedException if interrupted while waiting
* @throws ClassCastException if the class of the specified element
* prevents it from being added to this deque
* @throws NullPointerException if the specified element is null
* @throws IllegalArgumentException if some property of the specified
* element prevents it from being added to this deque
*/
|
Inserts the specified element at the end of this deque, waiting up to the specified wait time if necessary for space to become available
|
offerLast
|
{
"repo_name": "DrizzleSuite/DrizzleSMS",
"path": "src/org/grovecity/drizzlesms/util/deque/BlockingDeque.java",
"license": "gpl-3.0",
"size": 25239
}
|
[
"java.util.concurrent.TimeUnit"
] |
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.*;
|
[
"java.util"
] |
java.util;
| 2,414,193
|
@Override
public List<CategoryTick> refreshTicks(Graphics2D g2, AxisState state,
Rectangle2D dataArea, RectangleEdge edge) {
List<CategoryTick> ticks = new java.util.ArrayList<CategoryTick>();
// sanity check for data area...
if (dataArea.getHeight() <= 0.0 || dataArea.getWidth() < 0.0) {
return ticks;
}
CategoryPlot plot = (CategoryPlot) getPlot();
List<Comparable> categories = plot.getCategoriesForAxis(this);
double max = 0.0;
if (categories != null) {
CategoryLabelPosition position
= this.categoryLabelPositions.getLabelPosition(edge);
float r = this.maximumCategoryLabelWidthRatio;
if (r <= 0.0) {
r = position.getWidthRatio();
}
float l;
if (position.getWidthType() == CategoryLabelWidthType.CATEGORY) {
l = (float) calculateCategorySize(categories.size(), dataArea,
edge);
}
else {
if (RectangleEdge.isLeftOrRight(edge)) {
l = (float) dataArea.getWidth();
}
else {
l = (float) dataArea.getHeight();
}
}
int categoryIndex = 0;
for (Comparable category : categories) {
g2.setFont(getTickLabelFont(category));
TextBlock label = createLabel(category, l * r, edge, g2);
if (edge == RectangleEdge.TOP || edge == RectangleEdge.BOTTOM) {
max = Math.max(max, calculateTextBlockHeight(label,
position, g2));
} else if (edge == RectangleEdge.LEFT
|| edge == RectangleEdge.RIGHT) {
max = Math.max(max, calculateTextBlockWidth(label,
position, g2));
}
ticks.add(new CategoryTick(category, label,
position.getLabelAnchor(),
position.getRotationAnchor(), position.getAngle()));
categoryIndex = categoryIndex + 1;
}
}
state.setMax(max);
return ticks;
}
|
List<CategoryTick> function(Graphics2D g2, AxisState state, Rectangle2D dataArea, RectangleEdge edge) { List<CategoryTick> ticks = new java.util.ArrayList<CategoryTick>(); if (dataArea.getHeight() <= 0.0 dataArea.getWidth() < 0.0) { return ticks; } CategoryPlot plot = (CategoryPlot) getPlot(); List<Comparable> categories = plot.getCategoriesForAxis(this); double max = 0.0; if (categories != null) { CategoryLabelPosition position = this.categoryLabelPositions.getLabelPosition(edge); float r = this.maximumCategoryLabelWidthRatio; if (r <= 0.0) { r = position.getWidthRatio(); } float l; if (position.getWidthType() == CategoryLabelWidthType.CATEGORY) { l = (float) calculateCategorySize(categories.size(), dataArea, edge); } else { if (RectangleEdge.isLeftOrRight(edge)) { l = (float) dataArea.getWidth(); } else { l = (float) dataArea.getHeight(); } } int categoryIndex = 0; for (Comparable category : categories) { g2.setFont(getTickLabelFont(category)); TextBlock label = createLabel(category, l * r, edge, g2); if (edge == RectangleEdge.TOP edge == RectangleEdge.BOTTOM) { max = Math.max(max, calculateTextBlockHeight(label, position, g2)); } else if (edge == RectangleEdge.LEFT edge == RectangleEdge.RIGHT) { max = Math.max(max, calculateTextBlockWidth(label, position, g2)); } ticks.add(new CategoryTick(category, label, position.getLabelAnchor(), position.getRotationAnchor(), position.getAngle())); categoryIndex = categoryIndex + 1; } } state.setMax(max); return ticks; }
|
/**
* Creates a temporary list of ticks that can be used when drawing the axis.
*
* @param g2 the graphics device (used to get font measurements).
* @param state the axis state.
* @param dataArea the area inside the axes.
* @param edge the location of the axis.
*
* @return A list of ticks.
*/
|
Creates a temporary list of ticks that can be used when drawing the axis
|
refreshTicks
|
{
"repo_name": "akardapolov/ASH-Viewer",
"path": "jfreechart-fse/src/main/java/org/jfree/chart/axis/CategoryAxis.java",
"license": "gpl-3.0",
"size": 54058
}
|
[
"java.awt.Graphics2D",
"java.awt.geom.Rectangle2D",
"java.util.List",
"org.jfree.chart.plot.CategoryPlot",
"org.jfree.chart.text.TextBlock",
"org.jfree.chart.ui.RectangleEdge"
] |
import java.awt.Graphics2D; import java.awt.geom.Rectangle2D; import java.util.List; import org.jfree.chart.plot.CategoryPlot; import org.jfree.chart.text.TextBlock; import org.jfree.chart.ui.RectangleEdge;
|
import java.awt.*; import java.awt.geom.*; import java.util.*; import org.jfree.chart.plot.*; import org.jfree.chart.text.*; import org.jfree.chart.ui.*;
|
[
"java.awt",
"java.util",
"org.jfree.chart"
] |
java.awt; java.util; org.jfree.chart;
| 1,193,292
|
public PortTypeFinder getPortTypeFinder() {
return portTypeFinder;
}
|
PortTypeFinder function() { return portTypeFinder; }
|
/**
* Returns the port type finder.
*
* @return the port type finder
*/
|
Returns the port type finder
|
getPortTypeFinder
|
{
"repo_name": "queza85/edison",
"path": "edison-portal-framework/edison-appstore-2016-portlet/docroot/WEB-INF/src/org/kisti/edison/science/service/base/CommonLibServiceBaseImpl.java",
"license": "gpl-3.0",
"size": 52433
}
|
[
"org.kisti.edison.science.service.persistence.PortTypeFinder"
] |
import org.kisti.edison.science.service.persistence.PortTypeFinder;
|
import org.kisti.edison.science.service.persistence.*;
|
[
"org.kisti.edison"
] |
org.kisti.edison;
| 2,345,141
|
public BusConnection connectDevice(String bdAddress)
throws IOException {
String handle = "btspp://" + bdAddress + ":" +
Integer.toString(RFCOMM_CHANNEL);
StreamConnection conn = (StreamConnection) Connector.open(handle);
return new BluetoothConnection (conn);
}
private class BluetoothConnection implements BusConnection {
private InputStream inStream;
private OutputStream outStream;
private StreamConnection conn;
private boolean closed;
private InterfaceAddress remoteAddress;
BluetoothConnection(StreamConnection stream)
throws IOException {
conn = stream;
closed = false;
|
BusConnection function(String bdAddress) throws IOException { String handle = "btspp: Integer.toString(RFCOMM_CHANNEL); StreamConnection conn = (StreamConnection) Connector.open(handle); return new BluetoothConnection (conn); } private class BluetoothConnection implements BusConnection { private InputStream inStream; private OutputStream outStream; private StreamConnection conn; private boolean closed; private InterfaceAddress remoteAddress; BluetoothConnection(StreamConnection stream) throws IOException { conn = stream; closed = false;
|
/** Connect to a remote Bluetooth device.
*
* @param bdAddress The 48-bit Bluetooth address of the device to
* connect to, as a hexadecimal string.
*
* @return a newly-established <code>BusConnection</code>.
*/
|
Connect to a remote Bluetooth device
|
connectDevice
|
{
"repo_name": "peter-b/distributed-bus-system",
"path": "pc-src/uk/ac/cam/dbs/BluetoothConnectionManager.java",
"license": "gpl-2.0",
"size": 10360
}
|
[
"java.io.IOException",
"java.io.InputStream",
"java.io.OutputStream",
"javax.microedition.io.Connector",
"javax.microedition.io.StreamConnection"
] |
import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import javax.microedition.io.Connector; import javax.microedition.io.StreamConnection;
|
import java.io.*; import javax.microedition.io.*;
|
[
"java.io",
"javax.microedition"
] |
java.io; javax.microedition;
| 1,385,743
|
protected B _nlv(String key, Supplier<? extends NLV> nlv) {
return set(key, nlv.get());
}
|
B function(String key, Supplier<? extends NLV> nlv) { return set(key, nlv.get()); }
|
/**
* Method _nlv.
* @param key String
* @param nlv Supplier
* @return B
**/
|
Method _nlv
|
_nlv
|
{
"repo_name": "worldline-messaging/activitystreams",
"path": "core/src/main/java/com/ibm/common/activitystreams/ASObject.java",
"license": "apache-2.0",
"size": 65559
}
|
[
"com.google.common.base.Supplier"
] |
import com.google.common.base.Supplier;
|
import com.google.common.base.*;
|
[
"com.google.common"
] |
com.google.common;
| 2,266,784
|
public static long remaining(final Buffer[] buffers, final int offs, final int len) {
long t = 0L;
for (int i = 0; i < len; i ++) {
t += buffers[i + offs].remaining();
}
return t;
}
|
static long function(final Buffer[] buffers, final int offs, final int len) { long t = 0L; for (int i = 0; i < len; i ++) { t += buffers[i + offs].remaining(); } return t; }
|
/**
* Get the total remaining size of all the given buffers.
*
* @param buffers the buffers
* @param offs the offset into the buffers array
* @param len the number of buffers to check
* @return the number of remaining elements
*/
|
Get the total remaining size of all the given buffers
|
remaining
|
{
"repo_name": "stuartwdouglas/xnio",
"path": "api/src/main/java/org/xnio/Buffers.java",
"license": "apache-2.0",
"size": 86113
}
|
[
"java.nio.Buffer"
] |
import java.nio.Buffer;
|
import java.nio.*;
|
[
"java.nio"
] |
java.nio;
| 864,594
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.