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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
@ServiceMethod(returns = ReturnType.SINGLE)
public void deleteMessage(String chatMessageId) {
this.client.deleteMessage(chatMessageId).block();
} | @ServiceMethod(returns = ReturnType.SINGLE) void function(String chatMessageId) { this.client.deleteMessage(chatMessageId).block(); } | /**
* Deletes a message.
*
* @param chatMessageId The message id.
* @throws ChatErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/ | Deletes a message | deleteMessage | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/communication/azure-communication-chat/src/main/java/com/azure/communication/chat/ChatThreadClient.java",
"license": "mit",
"size": 21369
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; | import com.azure.core.annotation.*; | [
"com.azure.core"
] | com.azure.core; | 1,110,288 |
@Override
protected void onActivityResult(int requestCode, int responseCode, Intent intent) {
updateConnectButtonState();
if (requestCode == OUR_REQUEST_CODE && responseCode == RESULT_OK) {
// If we have a successful result, we will want to be able to resolve any further
// errors, so turn on resolution with our flag.
mAutoResolveOnFail = true;
// If we have a successful result, let's call connect() again. If there are any more
// errors to resolve we'll get our onConnectionFailed, but if not,
// we'll get onConnected.
initiatePlusClientConnect();
} else if (requestCode == OUR_REQUEST_CODE && responseCode != RESULT_OK) {
// If we've got an error we can't resolve, we're no longer in the midst of signing
// in, so we can stop the progress spinner.
setProgressBarVisible(false);
}
} | void function(int requestCode, int responseCode, Intent intent) { updateConnectButtonState(); if (requestCode == OUR_REQUEST_CODE && responseCode == RESULT_OK) { mAutoResolveOnFail = true; initiatePlusClientConnect(); } else if (requestCode == OUR_REQUEST_CODE && responseCode != RESULT_OK) { setProgressBarVisible(false); } } | /**
* An earlier connection failed, and we're now receiving the result of the resolution attempt
* by PlusClient.
*
* @see #onConnectionFailed(ConnectionResult)
*/ | An earlier connection failed, and we're now receiving the result of the resolution attempt by PlusClient | onActivityResult | {
"repo_name": "fouchimi/WorkshopApp",
"path": "app/src/main/java/example/com/workshopapp/PlusBaseActivity.java",
"license": "unlicense",
"size": 9970
} | [
"android.content.Intent"
] | import android.content.Intent; | import android.content.*; | [
"android.content"
] | android.content; | 218,335 |
@Test
public void testDIRSERVER_1183() throws Exception
{
LdapContext ctx = ( LdapContext ) getWiredContext( getLdapServer() ).lookup( BASE );
Attributes attrs = new BasicAttributes( "objectClass", "inetOrgPerson", true );
attrs.get( "objectClass" ).add( "organizationalPerson" );
attrs.get( "objectClass" ).add( "person" );
attrs.put( "givenName", "Jim" );
attrs.put( "sn", "Bean" );
attrs.put( "cn", "Jim, Bean" );
DirContext jimBeanCtx = ctx.createSubcontext( "cn=\"Jim, Bean\"", attrs );
assertNotNull( jimBeanCtx );
} | void function() throws Exception { LdapContext ctx = ( LdapContext ) getWiredContext( getLdapServer() ).lookup( BASE ); Attributes attrs = new BasicAttributes( STR, STR, true ); attrs.get( STR ).add( STR ); attrs.get( STR ).add( STR ); attrs.put( STR, "Jim" ); attrs.put( "sn", "Bean" ); attrs.put( "cn", STR ); DirContext jimBeanCtx = ctx.createSubcontext( "cn=\"Jim, Bean\"", attrs ); assertNotNull( jimBeanCtx ); } | /**
* Test for DIRSERVER-1183.
*
* @see https://issues.apache.org/jira/browse/DIRSERVER-1183
* @throws Exception
*/ | Test for DIRSERVER-1183 | testDIRSERVER_1183 | {
"repo_name": "lucastheisen/apache-directory-server",
"path": "server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/AddIT.java",
"license": "apache-2.0",
"size": 56338
} | [
"javax.naming.directory.Attributes",
"javax.naming.directory.BasicAttributes",
"javax.naming.directory.DirContext",
"javax.naming.ldap.LdapContext",
"org.apache.directory.server.integ.ServerIntegrationUtils",
"org.junit.Assert"
] | import javax.naming.directory.Attributes; import javax.naming.directory.BasicAttributes; import javax.naming.directory.DirContext; import javax.naming.ldap.LdapContext; import org.apache.directory.server.integ.ServerIntegrationUtils; import org.junit.Assert; | import javax.naming.directory.*; import javax.naming.ldap.*; import org.apache.directory.server.integ.*; import org.junit.*; | [
"javax.naming",
"org.apache.directory",
"org.junit"
] | javax.naming; org.apache.directory; org.junit; | 1,258,260 |
protected void merge() {
if (mParent != null && mParent.canMerge()) {
mParent.merge();
} else {
if (mSplit) {
for (int i = 0; i < CHILD_COUNT; ++i) {
//Add all the members of all the children
ArrayList<IGraphNodeMember> members = mChildren[i].getAllMembersRecursively(false);
int members_count = members.size();
for (int j = 0; j < members_count; ++j) {
addToMembers(members.get(j));
}
mChildren[i].destroy();
mChildren[i] = null;
}
mSplit = false;
}
}
} | void function() { if (mParent != null && mParent.canMerge()) { mParent.merge(); } else { if (mSplit) { for (int i = 0; i < CHILD_COUNT; ++i) { ArrayList<IGraphNodeMember> members = mChildren[i].getAllMembersRecursively(false); int members_count = members.size(); for (int j = 0; j < members_count; ++j) { addToMembers(members.get(j)); } mChildren[i].destroy(); mChildren[i] = null; } mSplit = false; } } } | /**
* Merges this child nodes into their parent node.
*/ | Merges this child nodes into their parent node | merge | {
"repo_name": "paoloach/zdomus",
"path": "temperature_monitor/opengl/src/main/java/it/achdjian/paolo/opengl/scenegraph/A_nAABBTree.java",
"license": "gpl-2.0",
"size": 26993
} | [
"java.util.ArrayList"
] | import java.util.ArrayList; | import java.util.*; | [
"java.util"
] | java.util; | 2,272,945 |
public BigInteger validate(String value, String pattern) {
return (BigInteger)parse(value, pattern, (Locale)null);
} | BigInteger function(String value, String pattern) { return (BigInteger)parse(value, pattern, (Locale)null); } | /**
* <p>Validate/convert a <code>BigInteger</code> using the
* specified <i>pattern</i>.
*
* @param value The value validation is being performed on.
* @param pattern The pattern used to validate the value against.
* @return The parsed <code>BigInteger</code> if valid or <code>null</code> if invalid.
*/ | Validate/convert a <code>BigInteger</code> using the specified pattern | validate | {
"repo_name": "apache/commons-validator",
"path": "src/main/java/org/apache/commons/validator/routines/BigIntegerValidator.java",
"license": "apache-2.0",
"size": 8428
} | [
"java.math.BigInteger",
"java.util.Locale"
] | import java.math.BigInteger; import java.util.Locale; | import java.math.*; import java.util.*; | [
"java.math",
"java.util"
] | java.math; java.util; | 1,510,299 |
if (TextUtils.isEmpty(signedData) || TextUtils.isEmpty(base64PublicKey) ||
TextUtils.isEmpty(signature)) {
Log.e(TAG, "Purchase verification failed: missing data.");
return false;
}
PublicKey key = Security.generatePublicKey(base64PublicKey);
return Security.verify(key, signedData, signature);
} | if (TextUtils.isEmpty(signedData) TextUtils.isEmpty(base64PublicKey) TextUtils.isEmpty(signature)) { Log.e(TAG, STR); return false; } PublicKey key = Security.generatePublicKey(base64PublicKey); return Security.verify(key, signedData, signature); } | /**
* Verifies that the data was signed with the given signature, and returns
* the verified purchase. The data is in JSON format and signed
* with a private key. The data also contains the {@link PurchaseState}
* and product ID of the purchase.
*
* @param base64PublicKey the base64-encoded public key to use for verifying.
* @param signedData the signed JSON string (signed, not encrypted)
* @param signature the signature for the data, signed with the private key
*/ | Verifies that the data was signed with the given signature, and returns the verified purchase. The data is in JSON format and signed with a private key. The data also contains the <code>PurchaseState</code> and product ID of the purchase | verifyPurchase | {
"repo_name": "0359xiaodong/turbo-editor",
"path": "libraries/sharedCode/src/main/java/sharedcode/turboeditor/iab/utils/Security.java",
"license": "gpl-3.0",
"size": 5118
} | [
"android.text.TextUtils",
"android.util.Log",
"java.security.PublicKey"
] | import android.text.TextUtils; import android.util.Log; import java.security.PublicKey; | import android.text.*; import android.util.*; import java.security.*; | [
"android.text",
"android.util",
"java.security"
] | android.text; android.util; java.security; | 2,795,295 |
public Properties toProperties() {
return ConfigurationConverter.getProperties(this);
} | Properties function() { return ConfigurationConverter.getProperties(this); } | /**
* Converts this configuration to a property map.
*
* @return this configuration as a property map
*/ | Converts this configuration to a property map | toProperties | {
"repo_name": "sprylab/webinloop",
"path": "webinloop/src/main/java/com/sprylab/webinloop/WiLConfiguration.java",
"license": "lgpl-3.0",
"size": 17924
} | [
"java.util.Properties",
"org.apache.commons.configuration.ConfigurationConverter"
] | import java.util.Properties; import org.apache.commons.configuration.ConfigurationConverter; | import java.util.*; import org.apache.commons.configuration.*; | [
"java.util",
"org.apache.commons"
] | java.util; org.apache.commons; | 500,517 |
public static <T extends OWLAxiom> int handleAxiomCount2(
AxiomType<T> axType, Imports imports,
OWLOntology ontology, Annotation annotation) {
return FilteringHelperAxiomCount.handleAxiomCount2(axType, imports, ontology, annotation);
}
| static <T extends OWLAxiom> int function( AxiomType<T> axType, Imports imports, OWLOntology ontology, Annotation annotation) { return FilteringHelperAxiomCount.handleAxiomCount2(axType, imports, ontology, annotation); } | /**
* count axioms of this type associated with current aspects in this ontology
* optionally including axioms
*
* @param <T>
* type extending OWLAxiom
* @param axType
* Axiom type
* @param imports
* info whether to include imports
* @param ontology
* ontology to check
* @param annotation
* Annotation of type {@link OWLAspectAnd} or {@link OWLAspectOr} specifying current aspects
* @return number of axioms with current aspects
*/ | count axioms of this type associated with current aspects in this ontology optionally including axioms | handleAxiomCount2 | {
"repo_name": "ag-csw/aspect-owlapi",
"path": "src/main/java/de/fuberlin/csw/aood/owlapi/helpers/HelperFacade.java",
"license": "gpl-3.0",
"size": 14829
} | [
"java.lang.annotation.Annotation",
"org.semanticweb.owlapi.model.AxiomType",
"org.semanticweb.owlapi.model.OWLAxiom",
"org.semanticweb.owlapi.model.OWLOntology",
"org.semanticweb.owlapi.model.parameters.Imports"
] | import java.lang.annotation.Annotation; import org.semanticweb.owlapi.model.AxiomType; import org.semanticweb.owlapi.model.OWLAxiom; import org.semanticweb.owlapi.model.OWLOntology; import org.semanticweb.owlapi.model.parameters.Imports; | import java.lang.annotation.*; import org.semanticweb.owlapi.model.*; import org.semanticweb.owlapi.model.parameters.*; | [
"java.lang",
"org.semanticweb.owlapi"
] | java.lang; org.semanticweb.owlapi; | 2,371,114 |
private void showUndoCloseAllBar(List<Integer> closedTabIds) {
String content = String.format(Locale.getDefault(), "%d", closedTabIds.size());
mSnackbarManager.showSnackbar(Snackbar.make(content, this)
.setTemplateText(mContext.getString(R.string.undo_bar_close_all_message))
.setAction(mContext.getString(R.string.undo_bar_button_text), closedTabIds));
} | void function(List<Integer> closedTabIds) { String content = String.format(Locale.getDefault(), "%d", closedTabIds.size()); mSnackbarManager.showSnackbar(Snackbar.make(content, this) .setTemplateText(mContext.getString(R.string.undo_bar_close_all_message)) .setAction(mContext.getString(R.string.undo_bar_button_text), closedTabIds)); } | /**
* Shows an undo close all bar. Based on user actions, this will cause a call to either
* {@link TabModel#commitTabClosure(int)} or {@link TabModel#cancelTabClosure(int)} to be called
* for each tab in {@code closedTabIds}. This will happen unless
* {@code SnackbarManager#removeFromStackForData(Object)} is called.
*
* @param closedTabIds A list of ids corresponding to tabs that were closed
*/ | Shows an undo close all bar. Based on user actions, this will cause a call to either <code>TabModel#commitTabClosure(int)</code> or <code>TabModel#cancelTabClosure(int)</code> to be called for each tab in closedTabIds. This will happen unless SnackbarManager#removeFromStackForData(Object) is called | showUndoCloseAllBar | {
"repo_name": "Chilledheart/chromium",
"path": "chrome/android/java/src/org/chromium/chrome/browser/snackbar/undo/UndoBarPopupController.java",
"license": "bsd-3-clause",
"size": 8548
} | [
"java.util.List",
"java.util.Locale",
"org.chromium.chrome.browser.snackbar.Snackbar"
] | import java.util.List; import java.util.Locale; import org.chromium.chrome.browser.snackbar.Snackbar; | import java.util.*; import org.chromium.chrome.browser.snackbar.*; | [
"java.util",
"org.chromium.chrome"
] | java.util; org.chromium.chrome; | 137,439 |
@Override
protected void addInputValidation() {
srcPort.setTextFormatter(Util.getNumberFilter(5));
dstPort.setTextFormatter(Util.getNumberFilter(5));
length.setTextFormatter(Util.getNumberFilter(5));
} | void function() { srcPort.setTextFormatter(Util.getNumberFilter(5)); dstPort.setTextFormatter(Util.getNumberFilter(5)); length.setTextFormatter(Util.getNumberFilter(5)); } | /**
* add input field validation
*/ | add input field validation | addInputValidation | {
"repo_name": "cisco-system-traffic-generator/trex-stateless-gui",
"path": "src/main/java/com/exalttech/trex/ui/views/streams/builder/UDPProtocolView.java",
"license": "apache-2.0",
"size": 4096
} | [
"com.exalttech.trex.util.Util"
] | import com.exalttech.trex.util.Util; | import com.exalttech.trex.util.*; | [
"com.exalttech.trex"
] | com.exalttech.trex; | 1,025,487 |
private JLabel getplayerOneScoreLabel() {
if (playerOneScoreLabel == null) {
playerOneScoreLabel = new JLabel("Choose a New Game");
playerOneScoreLabel.setFont(new Font("Lucida Grande", Font.PLAIN, 16));
playerOneScoreLabel.setBounds(54, 382, 161, 50);
}
return playerOneScoreLabel;
}
| JLabel function() { if (playerOneScoreLabel == null) { playerOneScoreLabel = new JLabel(STR); playerOneScoreLabel.setFont(new Font(STR, Font.PLAIN, 16)); playerOneScoreLabel.setBounds(54, 382, 161, 50); } return playerOneScoreLabel; } | /**
* Gets the player one score label.
*
* @return the player one score label
*/ | Gets the player one score label | getplayerOneScoreLabel | {
"repo_name": "raga007/Blackjack",
"path": "src/GameEngineTwoPlayer.java",
"license": "mit",
"size": 25752
} | [
"java.awt.Font",
"javax.swing.JLabel"
] | import java.awt.Font; import javax.swing.JLabel; | import java.awt.*; import javax.swing.*; | [
"java.awt",
"javax.swing"
] | java.awt; javax.swing; | 1,850,845 |
public Object[] listMapsForOrg(User loggedInUser) {
return ChannelFactory.listAllDistChannelMapsByOrg(loggedInUser.getOrg()).toArray();
} | Object[] function(User loggedInUser) { return ChannelFactory.listAllDistChannelMapsByOrg(loggedInUser.getOrg()).toArray(); } | /**
* Lists distribution channel maps valid for the user's organization
* @param loggedInUser The current user
* @return List of dist channel maps
*
* @xmlrpc.doc Lists distribution channel maps valid for the user's organization
* @xmlrpc.param #session_key()
* @xmlrpc.returntype
* #array()
* $DistChannelMapSerializer
* #array_end()
*/ | Lists distribution channel maps valid for the user's organization | listMapsForOrg | {
"repo_name": "xkollar/spacewalk",
"path": "java/code/src/com/redhat/rhn/frontend/xmlrpc/distchannel/DistChannelHandler.java",
"license": "gpl-2.0",
"size": 6142
} | [
"com.redhat.rhn.domain.channel.ChannelFactory",
"com.redhat.rhn.domain.user.User"
] | import com.redhat.rhn.domain.channel.ChannelFactory; import com.redhat.rhn.domain.user.User; | import com.redhat.rhn.domain.channel.*; import com.redhat.rhn.domain.user.*; | [
"com.redhat.rhn"
] | com.redhat.rhn; | 2,892,951 |
public CaptureRequest.Builder createCaptureRequest(int template) throws CameraAccessException {
CameraDevice device = mCameraDevice;
if (device == null) {
throw new IllegalStateException("Can't get requests when no camera is open");
}
return device.createCaptureRequest(template);
} | CaptureRequest.Builder function(int template) throws CameraAccessException { CameraDevice device = mCameraDevice; if (device == null) { throw new IllegalStateException(STR); } return device.createCaptureRequest(template); } | /**
* Get a request builder for the current camera.
*/ | Get a request builder for the current camera | createCaptureRequest | {
"repo_name": "android/camera-samples",
"path": "HdrViewfinder/Application/src/main/java/com/example/android/hdrviewfinder/CameraOps.java",
"license": "apache-2.0",
"size": 9764
} | [
"android.hardware.camera2.CameraAccessException",
"android.hardware.camera2.CameraDevice",
"android.hardware.camera2.CaptureRequest"
] | import android.hardware.camera2.CameraAccessException; import android.hardware.camera2.CameraDevice; import android.hardware.camera2.CaptureRequest; | import android.hardware.camera2.*; | [
"android.hardware"
] | android.hardware; | 1,737,653 |
public static void setDisableCachingHttpHeaders(HttpServletRequest oRequest,
HttpServletResponse oResponse)
{
if (oRequest.getProtocol().equalsIgnoreCase("HTTP/1.0"))
{
oResponse.setHeader("Pragma", "no-cache");
}
else if (oRequest.getProtocol().equalsIgnoreCase("HTTP/1.1"))
{
oResponse.setHeader("Cache-Control",
"no-store, no-cache, must-revalidate");
}
//for proxy caching
oResponse.setHeader("Expires", "-1");
}
| static void function(HttpServletRequest oRequest, HttpServletResponse oResponse) { if (oRequest.getProtocol().equalsIgnoreCase(STR)) { oResponse.setHeader(STR, STR); } else if (oRequest.getProtocol().equalsIgnoreCase(STR)) { oResponse.setHeader(STR, STR); } oResponse.setHeader(STR, "-1"); } | /**
* Disable the HTTP 1.0 and HTTP 1.1 caching.
*
* Sets the following headers in the response:
* <ul>
* <li>protocol 'HTTP/1.0': Pragma: no-cache</li>
* <li>protocol 'HTTP/1.1': Cache-Control: no-store, no-cache, must-revalidate</li>
* <li>protocol independant: Expires: -1</li>
* </ul>
*
* @param oRequest The servlet request
* @param oResponse The servlet repsonse
* @see <a href="http://www.w3.org/Protocols/rfc1945/rfc1945">
* Hypertext Transfer Protocol -- HTTP/1.0</a>
* @see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616">
* Hypertext Transfer Protocol -- HTTP/1.1</a>
*/ | Disable the HTTP 1.0 and HTTP 1.1 caching. Sets the following headers in the response: protocol 'HTTP/1.0': Pragma: no-cache protocol 'HTTP/1.1': Cache-Control: no-store, no-cache, must-revalidate protocol independant: Expires: -1 | setDisableCachingHttpHeaders | {
"repo_name": "GluuFederation/gluu-Asimba",
"path": "asimba-utility/src/main/java/com/alfaariss/oa/util/web/HttpUtils.java",
"license": "agpl-3.0",
"size": 4297
} | [
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse"
] | import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.*; | [
"javax.servlet"
] | javax.servlet; | 2,437,793 |
SetupEncryptionDialogFragment fragment = new SetupEncryptionDialogFragment();
Bundle args = new Bundle();
args.putParcelable(ARG_ACCOUNT, account);
args.putInt(ARG_POSITION, position);
fragment.setArguments(args);
return fragment;
} | SetupEncryptionDialogFragment fragment = new SetupEncryptionDialogFragment(); Bundle args = new Bundle(); args.putParcelable(ARG_ACCOUNT, account); args.putInt(ARG_POSITION, position); fragment.setArguments(args); return fragment; } | /**
* Public factory method to create new SetupEncryptionDialogFragment instance
*
* @return Dialog ready to show.
*/ | Public factory method to create new SetupEncryptionDialogFragment instance | newInstance | {
"repo_name": "jsargent7089/android",
"path": "src/main/java/com/owncloud/android/ui/dialog/SetupEncryptionDialogFragment.java",
"license": "gpl-2.0",
"size": 18285
} | [
"android.os.Bundle"
] | import android.os.Bundle; | import android.os.*; | [
"android.os"
] | android.os; | 1,091,153 |
@Test
public void testWildcardKeys() {
Processor top = new Processor();
top.setProperty("a.3", "a.3");
top.setProperty("a.1", "a.1");
top.setProperty("a.2", "a.2");
top.setProperty("a.4", "a.4");
top.setProperty("aa", "${a.*}");
assertEquals("a.1,a.2,a.3,a.4", top.getProperty("a.*"));
assertEquals("a.1,a.2,a.3,a.4", top.getProperty("aa"));
} | void function() { Processor top = new Processor(); top.setProperty("a.3", "a.3"); top.setProperty("a.1", "a.1"); top.setProperty("a.2", "a.2"); top.setProperty("a.4", "a.4"); top.setProperty("aa", STR); assertEquals(STR, top.getProperty("a.*")); assertEquals(STR, top.getProperty("aa")); } | /**
* Test the combine macro that groups properties
*/ | Test the combine macro that groups properties | testWildcardKeys | {
"repo_name": "psoreide/bnd",
"path": "biz.aQute.bndlib.tests/test/test/MacroTest.java",
"license": "apache-2.0",
"size": 62632
} | [
"org.junit.jupiter.api.Assertions"
] | import org.junit.jupiter.api.Assertions; | import org.junit.jupiter.api.*; | [
"org.junit.jupiter"
] | org.junit.jupiter; | 1,811,210 |
@Test
public void testMultipleTimestampsInSingleDelete() throws Exception {
HTable primary = createSetupTables(fam1);
// do a put to the primary table
Put p = new Put(row1);
long ts1 = 10, ts2 = 11, ts3 = 12;
p.add(FAM, indexed_qualifer, ts1, value1);
// our group indexes all columns in the this family, so any qualifier here is ok
p.add(FAM2, regular_qualifer, ts2, value3);
primary.put(p);
primary.flushCommits();
// check to make sure everything we expect is there
HTable index1 = new HTable(UTIL.getConfiguration(), fam1.getTable());
// ts1, we just have v1
List<Pair<byte[], CoveredColumn>> pairs = new ArrayList<Pair<byte[], CoveredColumn>>();
pairs.clear();
pairs.add(new Pair<byte[], CoveredColumn>(value1, col1));
pairs.add(new Pair<byte[], CoveredColumn>(EMPTY_BYTES, col2));
List<KeyValue> expected = CoveredColumnIndexCodec.getIndexKeyValueForTesting(row1, ts1, pairs);
IndexTestingUtils.verifyIndexTableAtTimestamp(index1, expected, ts1, value1);
// at ts2, don't have the above anymore
pairs.clear();
expected = Collections.emptyList();
IndexTestingUtils.verifyIndexTableAtTimestamp(index1, expected, ts2, ts2 + 1, value1, value1);
// but we do have the new entry at ts2
pairs.clear();
pairs.add(new Pair<byte[], CoveredColumn>(value1, col1));
pairs.add(new Pair<byte[], CoveredColumn>(value3, col2));
expected = CoveredColumnIndexCodec.getIndexKeyValueForTesting(row1, ts2, pairs);
IndexTestingUtils.verifyIndexTableAtTimestamp(index1, expected, ts2, value1);
// now build up a delete with a couple different timestamps
Delete d = new Delete(row1);
// these deletes have to match the exact ts since we are doing an exact match (deleteColumn).
d.deleteColumn(FAM, indexed_qualifer, ts1);
// since this doesn't match exactly, we actually shouldn't see a change in table state
d.deleteColumn(FAM2, regular_qualifer, ts3);
primary.delete(d);
// at ts1, we should have the put covered exactly by the delete and into the entire future
expected = Collections.emptyList();
IndexTestingUtils.verifyIndexTableAtTimestamp(index1, expected, ts1, Long.MAX_VALUE, value1,
value1);
// at ts2, we should just see value3
pairs.clear();
pairs.add(new Pair<byte[], CoveredColumn>(EMPTY_BYTES, col1));
pairs.add(new Pair<byte[], CoveredColumn>(value3, col2));
expected = CoveredColumnIndexCodec.getIndexKeyValueForTesting(row1, ts2, pairs);
IndexTestingUtils.verifyIndexTableAtTimestamp(index1, expected, ts2, value1);
// the later delete is a point delete, so we shouldn't see any change at ts3
IndexTestingUtils.verifyIndexTableAtTimestamp(index1, expected, ts2, ts3, value1,
HConstants.EMPTY_END_ROW);
// cleanup
closeAndCleanupTables(primary, index1);
} | void function() throws Exception { HTable primary = createSetupTables(fam1); Put p = new Put(row1); long ts1 = 10, ts2 = 11, ts3 = 12; p.add(FAM, indexed_qualifer, ts1, value1); p.add(FAM2, regular_qualifer, ts2, value3); primary.put(p); primary.flushCommits(); HTable index1 = new HTable(UTIL.getConfiguration(), fam1.getTable()); List<Pair<byte[], CoveredColumn>> pairs = new ArrayList<Pair<byte[], CoveredColumn>>(); pairs.clear(); pairs.add(new Pair<byte[], CoveredColumn>(value1, col1)); pairs.add(new Pair<byte[], CoveredColumn>(EMPTY_BYTES, col2)); List<KeyValue> expected = CoveredColumnIndexCodec.getIndexKeyValueForTesting(row1, ts1, pairs); IndexTestingUtils.verifyIndexTableAtTimestamp(index1, expected, ts1, value1); pairs.clear(); expected = Collections.emptyList(); IndexTestingUtils.verifyIndexTableAtTimestamp(index1, expected, ts2, ts2 + 1, value1, value1); pairs.clear(); pairs.add(new Pair<byte[], CoveredColumn>(value1, col1)); pairs.add(new Pair<byte[], CoveredColumn>(value3, col2)); expected = CoveredColumnIndexCodec.getIndexKeyValueForTesting(row1, ts2, pairs); IndexTestingUtils.verifyIndexTableAtTimestamp(index1, expected, ts2, value1); Delete d = new Delete(row1); d.deleteColumn(FAM, indexed_qualifer, ts1); d.deleteColumn(FAM2, regular_qualifer, ts3); primary.delete(d); expected = Collections.emptyList(); IndexTestingUtils.verifyIndexTableAtTimestamp(index1, expected, ts1, Long.MAX_VALUE, value1, value1); pairs.clear(); pairs.add(new Pair<byte[], CoveredColumn>(EMPTY_BYTES, col1)); pairs.add(new Pair<byte[], CoveredColumn>(value3, col2)); expected = CoveredColumnIndexCodec.getIndexKeyValueForTesting(row1, ts2, pairs); IndexTestingUtils.verifyIndexTableAtTimestamp(index1, expected, ts2, value1); IndexTestingUtils.verifyIndexTableAtTimestamp(index1, expected, ts2, ts3, value1, HConstants.EMPTY_END_ROW); closeAndCleanupTables(primary, index1); } | /**
* Similar to the {@link #testMultipleTimestampsInSinglePut()}, this check the same with deletes
* @throws Exception on failure
*/ | Similar to the <code>#testMultipleTimestampsInSinglePut()</code>, this check the same with deletes | testMultipleTimestampsInSingleDelete | {
"repo_name": "pboado/phoenix-for-cloudera",
"path": "phoenix-core/src/it/java/org/apache/phoenix/hbase/index/covered/example/EndToEndCoveredIndexingIT.java",
"license": "apache-2.0",
"size": 36129
} | [
"java.util.ArrayList",
"java.util.Collections",
"java.util.List",
"org.apache.hadoop.hbase.HConstants",
"org.apache.hadoop.hbase.KeyValue",
"org.apache.hadoop.hbase.client.Delete",
"org.apache.hadoop.hbase.client.HTable",
"org.apache.hadoop.hbase.client.Put",
"org.apache.hadoop.hbase.util.Pair",
"... | import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.HTable; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.util.Pair; import org.apache.phoenix.hbase.index.IndexTestingUtils; | import java.util.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.util.*; import org.apache.phoenix.hbase.index.*; | [
"java.util",
"org.apache.hadoop",
"org.apache.phoenix"
] | java.util; org.apache.hadoop; org.apache.phoenix; | 735,184 |
public void setAllow(XSBooleanValue allow); | void function(XSBooleanValue allow); | /**
* Sets the wst:Renewing/@Allow attribute value.
*
* @param allow the Allow attribute value.
*/ | Sets the wst:Renewing/@Allow attribute value | setAllow | {
"repo_name": "lamsfoundation/lams",
"path": "3rdParty_sources/openws/org/opensaml/ws/wstrust/Renewing.java",
"license": "gpl-2.0",
"size": 3179
} | [
"org.opensaml.xml.schema.XSBooleanValue"
] | import org.opensaml.xml.schema.XSBooleanValue; | import org.opensaml.xml.schema.*; | [
"org.opensaml.xml"
] | org.opensaml.xml; | 2,078,248 |
public void delete(java.lang.Integer id, Session s)
throws org.hibernate.HibernateException {
delete((Object) load(id, s), s);
}
| void function(java.lang.Integer id, Session s) throws org.hibernate.HibernateException { delete((Object) load(id, s), s); } | /**
* Remove a persistent instance from the datastore. The argument may be an instance associated with the receiving
* Session or a transient instance with an identifier associated with existing persistent state.
* Use the Session given.
* @param id the instance ID to be removed
* @param s the Session
*/ | Remove a persistent instance from the datastore. The argument may be an instance associated with the receiving Session or a transient instance with an identifier associated with existing persistent state. Use the Session given | delete | {
"repo_name": "meyerdg/floreant",
"path": "src/com/floreantpos/model/dao/BaseUserDAO.java",
"license": "gpl-2.0",
"size": 7944
} | [
"org.hibernate.Session"
] | import org.hibernate.Session; | import org.hibernate.*; | [
"org.hibernate"
] | org.hibernate; | 501,230 |
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller<PollResult<Void>, Void> beginManualFailover(
String iotHubName, String resourceGroupName, FailoverInput failoverInput, Context context) {
return beginManualFailoverAsync(iotHubName, resourceGroupName, failoverInput, context).getSyncPoller();
} | @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller<PollResult<Void>, Void> function( String iotHubName, String resourceGroupName, FailoverInput failoverInput, Context context) { return beginManualFailoverAsync(iotHubName, resourceGroupName, failoverInput, context).getSyncPoller(); } | /**
* Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see
* https://aka.ms/manualfailover.
*
* @param iotHubName Name of the IoT hub to failover.
* @param resourceGroupName Name of the resource group containing the IoT hub resource.
* @param failoverInput Region to failover to. Must be the Azure paired region. Get the value from the secondary
* location in the locations property. To learn more, see https://aka.ms/manualfailover/region.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ErrorDetailsException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link Response} on successful completion of {@link Mono}.
*/ | Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see HREF | beginManualFailover | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubsClientImpl.java",
"license": "mit",
"size": 19154
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.management.polling.PollResult",
"com.azure.core.util.Context",
"com.azure.core.util.polling.SyncPoller",
"com.azure.resourcemanager.iothub.models.FailoverInput"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.iothub.models.FailoverInput; | import com.azure.core.annotation.*; import com.azure.core.management.polling.*; import com.azure.core.util.*; import com.azure.core.util.polling.*; import com.azure.resourcemanager.iothub.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 1,362,551 |
private String chooseClientAliasForKey(String preferredAlias, String keyType, Principal[] issuers, Socket socket)
{
String[] aliases = getClientAliases(keyType, issuers);
if (aliases != null && aliases.length > 0) {
for (int i=0; i<aliases.length;i++) {
if (preferredAlias.equals(aliases[i])) {
return aliases[i];
}
}
}
return null;
} | String function(String preferredAlias, String keyType, Principal[] issuers, Socket socket) { String[] aliases = getClientAliases(keyType, issuers); if (aliases != null && aliases.length > 0) { for (int i=0; i<aliases.length;i++) { if (preferredAlias.equals(aliases[i])) { return aliases[i]; } } } return null; } | /**
* Attempts to find a keystore
* @param keyType
* @param issuers
* @param socket
* @return
*/ | Attempts to find a keystore | chooseClientAliasForKey | {
"repo_name": "oehf/ipf-oht-atna",
"path": "nodeauth/src/main/java/org/openhealthtools/ihe/atna/nodeauth/utils/AliasSensitiveX509KeyManager.java",
"license": "epl-1.0",
"size": 4637
} | [
"java.net.Socket",
"java.security.Principal"
] | import java.net.Socket; import java.security.Principal; | import java.net.*; import java.security.*; | [
"java.net",
"java.security"
] | java.net; java.security; | 740,145 |
public static double maxScale(final FeatureTypeStyle fts) {
if (fts == null || fts.rules().size() == 0) { return Double.NaN; }
final Rule r = fts.rules().get(0);
return r.getMaxScaleDenominator();
}
public static final String GENERIC_FEATURE_TYPENAME = "Feature"; | static double function(final FeatureTypeStyle fts) { if (fts == null fts.rules().size() == 0) { return Double.NaN; } final Rule r = fts.rules().get(0); return r.getMaxScaleDenominator(); } public static final String GENERIC_FEATURE_TYPENAME = STR; | /**
* Returns the max scale of the default rule, or Double#NaN if none is set
*/ | Returns the max scale of the default rule, or Double#NaN if none is set | maxScale | {
"repo_name": "gama-platform/gama",
"path": "ummisco.gama.ui.viewers/src/ummisco/gama/ui/viewers/gis/geotools/styling/SLDs.java",
"license": "gpl-3.0",
"size": 8144
} | [
"org.geotools.styling.FeatureTypeStyle",
"org.geotools.styling.Rule"
] | import org.geotools.styling.FeatureTypeStyle; import org.geotools.styling.Rule; | import org.geotools.styling.*; | [
"org.geotools.styling"
] | org.geotools.styling; | 1,132,709 |
@Test
public void testIsLocallyRenderableWithLazyLoadedFacet() throws QuickFixException {
DefDescriptor<ComponentDef> facetDesc = addSourceAutoCleanup(ComponentDef.class,
"<aura:component> <aura:text aura:load='LAZY'/></aura:component>");
T baseComponentDef = define(baseTag, "", String.format("<%s/>", facetDesc.getDescriptorName()));
assertEquals("Rendering detection logic is not on.", RenderType.AUTO, baseComponentDef.getRender());
assertFalse(
"When a component has a inner component set to lazy load, the parent should be rendered clientside.",
baseComponentDef.isLocallyRenderable());
} | void function() throws QuickFixException { DefDescriptor<ComponentDef> facetDesc = addSourceAutoCleanup(ComponentDef.class, STR); T baseComponentDef = define(baseTag, STR<%s/>STRRendering detection logic is not on.STRWhen a component has a inner component set to lazy load, the parent should be rendered clientside.", baseComponentDef.isLocallyRenderable()); } | /**
* isLocallyRenderable is false when a facet of a component has a component marked for LAZY loading, the component
* should always be rendered client side. Test method for {@link BaseComponentDef#isLocallyRenderable()}.
*/ | isLocallyRenderable is false when a facet of a component has a component marked for LAZY loading, the component should always be rendered client side. Test method for <code>BaseComponentDef#isLocallyRenderable()</code> | testIsLocallyRenderableWithLazyLoadedFacet | {
"repo_name": "madmax983/aura",
"path": "aura-impl/src/test/java/org/auraframework/impl/root/component/BaseComponentDefTest.java",
"license": "apache-2.0",
"size": 103783
} | [
"org.auraframework.def.ComponentDef",
"org.auraframework.def.DefDescriptor",
"org.auraframework.throwable.quickfix.QuickFixException"
] | import org.auraframework.def.ComponentDef; import org.auraframework.def.DefDescriptor; import org.auraframework.throwable.quickfix.QuickFixException; | import org.auraframework.def.*; import org.auraframework.throwable.quickfix.*; | [
"org.auraframework.def",
"org.auraframework.throwable"
] | org.auraframework.def; org.auraframework.throwable; | 248,251 |
public String getUnixSymlink(ZipArchiveEntry entry) throws IOException {
if (entry != null && entry.isUnixSymlink()) {
InputStream in = null;
try {
in = getInputStream(entry);
byte[] symlinkBytes = IOUtils.toByteArray(in);
return zipEncoding.decode(symlinkBytes);
} finally {
if (in != null) {
in.close();
}
}
} else {
return null;
}
} | String function(ZipArchiveEntry entry) throws IOException { if (entry != null && entry.isUnixSymlink()) { InputStream in = null; try { in = getInputStream(entry); byte[] symlinkBytes = IOUtils.toByteArray(in); return zipEncoding.decode(symlinkBytes); } finally { if (in != null) { in.close(); } } } else { return null; } } | /**
* <p>
* Convenience method to return the entry's content as a String if isUnixSymlink()
* returns true for it, otherwise returns null.
* </p>
*
* <p>This method assumes the symbolic link's file name uses the
* same encoding that as been specified for this ZipFile.</p>
*
* @param entry ZipArchiveEntry object that represents the symbolic link
* @return entry's content as a String
* @throws IOException problem with content's input stream
* @since 1.5
*/ | Convenience method to return the entry's content as a String if isUnixSymlink() returns true for it, otherwise returns null. This method assumes the symbolic link's file name uses the same encoding that as been specified for this ZipFile | getUnixSymlink | {
"repo_name": "eugenegardner/tenXMEIPolisher",
"path": "src/org/apache/commons/compress/archivers/zip/ZipFile.java",
"license": "gpl-3.0",
"size": 39314
} | [
"java.io.IOException",
"java.io.InputStream",
"org.apache.commons.compress.utils.IOUtils"
] | import java.io.IOException; import java.io.InputStream; import org.apache.commons.compress.utils.IOUtils; | import java.io.*; import org.apache.commons.compress.utils.*; | [
"java.io",
"org.apache.commons"
] | java.io; org.apache.commons; | 1,350,229 |
public static String getText(String docPath, String mimeType, String encoding, InputStream isContent)
throws IOException {
log.debug("getText({}, {}, {}, {})", new Object[] { docPath, mimeType, encoding, isContent });
long begin = System.currentTimeMillis();
String failureMessage = "Unknown error";
boolean failure = false;
String text = null;
try {
text = getText(mimeType, encoding, isContent);
// Check for minimum text extraction size
if (text.length() < MIN_EXTRACTION) {
failureMessage = "Too few text extracted";
failure = true;
}
} catch (Exception e) {
log.warn("Text extraction failure: {}", e.getMessage());
failureMessage = e.getMessage();
failure = true;
}
log.trace("getText.Time: {} ms for {}", System.currentTimeMillis() - begin, docPath);
if (failure) {
throw new IOException(failureMessage);
}
log.debug("getText: {}", text);
return text;
}
| static String function(String docPath, String mimeType, String encoding, InputStream isContent) throws IOException { log.debug(STR, new Object[] { docPath, mimeType, encoding, isContent }); long begin = System.currentTimeMillis(); String failureMessage = STR; boolean failure = false; String text = null; try { text = getText(mimeType, encoding, isContent); if (text.length() < MIN_EXTRACTION) { failureMessage = STR; failure = true; } } catch (Exception e) { log.warn(STR, e.getMessage()); failureMessage = e.getMessage(); failure = true; } log.trace(STR, System.currentTimeMillis() - begin, docPath); if (failure) { throw new IOException(failureMessage); } log.debug(STR, text); return text; } | /**
* Extract text to be indexed
*/ | Extract text to be indexed | getText | {
"repo_name": "papamas/DMS-KANGREG-XI-MANADO",
"path": "src/main/java/com/openkm/extractor/RegisteredExtractors.java",
"license": "gpl-3.0",
"size": 9826
} | [
"java.io.IOException",
"java.io.InputStream"
] | import java.io.IOException; import java.io.InputStream; | import java.io.*; | [
"java.io"
] | java.io; | 2,719,991 |
private EClass getMappedEClass(Type type) {
EClass res = null;
if (type != null) {
// retrieve from currently converted kinds
res = occiKind2emfEclass.get(type);
if (res == null) {
// retrieve from installed extensions.
EPackage p = ConverterUtils.getEPackage(type);
res = (EClass) p.getEClassifier(ConverterUtils.toU1Case(ConverterUtils.formatName(type.getTerm())));
// Cache it for optimizing next searches.
occiKind2emfEclass.put(type, res);
}
}
return res;
}
private Map<DataType, EClassifier> occiType2emfType = new HashMap<DataType, EClassifier>(); | EClass function(Type type) { EClass res = null; if (type != null) { res = occiKind2emfEclass.get(type); if (res == null) { EPackage p = ConverterUtils.getEPackage(type); res = (EClass) p.getEClassifier(ConverterUtils.toU1Case(ConverterUtils.formatName(type.getTerm()))); occiKind2emfEclass.put(type, res); } } return res; } private Map<DataType, EClassifier> occiType2emfType = new HashMap<DataType, EClassifier>(); | /**
* Get the EClass associated to an OCCI Kind.
*
* @param kind the given OCCI kind.
* @return the EClass.
*/ | Get the EClass associated to an OCCI Kind | getMappedEClass | {
"repo_name": "occiware/OCCI-Studio",
"path": "plugins/org.eclipse.cmf.occi.core.gen.emf/src/org/eclipse/cmf/occi/core/gen/emf/OCCIExtension2Ecore.java",
"license": "epl-1.0",
"size": 35427
} | [
"java.util.HashMap",
"java.util.Map",
"org.eclipse.cmf.occi.core.DataType",
"org.eclipse.cmf.occi.core.Type",
"org.eclipse.emf.ecore.EClass",
"org.eclipse.emf.ecore.EClassifier",
"org.eclipse.emf.ecore.EPackage"
] | import java.util.HashMap; import java.util.Map; import org.eclipse.cmf.occi.core.DataType; import org.eclipse.cmf.occi.core.Type; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EClassifier; import org.eclipse.emf.ecore.EPackage; | import java.util.*; import org.eclipse.cmf.occi.core.*; import org.eclipse.emf.ecore.*; | [
"java.util",
"org.eclipse.cmf",
"org.eclipse.emf"
] | java.util; org.eclipse.cmf; org.eclipse.emf; | 1,020,559 |
public List<JSONObject> getArticlesByArchiveDate(final String archiveDateId, final int currentPageNum,
final int pageSize) throws ServiceException {
try {
JSONObject result = archiveDateArticleDao.getByArchiveDateId(archiveDateId, currentPageNum, pageSize);
final JSONArray relations = result.getJSONArray(Keys.RESULTS);
if (0 == relations.length()) {
return Collections.emptyList();
}
final Set<String> articleIds = new HashSet<>();
for (int i = 0; i < relations.length(); i++) {
final JSONObject relation = relations.getJSONObject(i);
final String articleId = relation.getString(Article.ARTICLE + "_" + Keys.OBJECT_ID);
articleIds.add(articleId);
}
final List<JSONObject> ret = new ArrayList<>();
final Query query = new Query().setFilter(new PropertyFilter(Keys.OBJECT_ID, FilterOperator.IN, articleIds))
.setPageCount(1).index(Article.ARTICLE_PERMALINK);
result = articleDao.get(query);
final JSONArray articles = result.getJSONArray(Keys.RESULTS);
for (int i = 0; i < articles.length(); i++) {
final JSONObject article = articles.getJSONObject(i);
if (!article.getBoolean(Article.ARTICLE_IS_PUBLISHED)) {
// Skips the unpublished article
continue;
}
article.put(ARTICLE_CREATE_TIME, ((Date) article.get(ARTICLE_CREATE_DATE)).getTime());
ret.add(article);
}
return ret;
} catch (final Exception e) {
logger.error("Gets articles by archive date[id=" + archiveDateId + "] failed", e);
throw new ServiceException(e);
}
} | List<JSONObject> function(final String archiveDateId, final int currentPageNum, final int pageSize) throws ServiceException { try { JSONObject result = archiveDateArticleDao.getByArchiveDateId(archiveDateId, currentPageNum, pageSize); final JSONArray relations = result.getJSONArray(Keys.RESULTS); if (0 == relations.length()) { return Collections.emptyList(); } final Set<String> articleIds = new HashSet<>(); for (int i = 0; i < relations.length(); i++) { final JSONObject relation = relations.getJSONObject(i); final String articleId = relation.getString(Article.ARTICLE + "_" + Keys.OBJECT_ID); articleIds.add(articleId); } final List<JSONObject> ret = new ArrayList<>(); final Query query = new Query().setFilter(new PropertyFilter(Keys.OBJECT_ID, FilterOperator.IN, articleIds)) .setPageCount(1).index(Article.ARTICLE_PERMALINK); result = articleDao.get(query); final JSONArray articles = result.getJSONArray(Keys.RESULTS); for (int i = 0; i < articles.length(); i++) { final JSONObject article = articles.getJSONObject(i); if (!article.getBoolean(Article.ARTICLE_IS_PUBLISHED)) { continue; } article.put(ARTICLE_CREATE_TIME, ((Date) article.get(ARTICLE_CREATE_DATE)).getTime()); ret.add(article); } return ret; } catch (final Exception e) { logger.error(STR + archiveDateId + STR, e); throw new ServiceException(e); } } | /**
* Gets a list of published articles with the specified archive date id,
* current page number and page size.
*
* @param archiveDateId
* the specified archive date id
* @param currentPageNum
* the specified current page number
* @param pageSize
* the specified page size
* @return a list of articles, returns an empty list if not found
* @throws ServiceException
* service exception
*/ | Gets a list of published articles with the specified archive date id, current page number and page size | getArticlesByArchiveDate | {
"repo_name": "daima/solo-spring",
"path": "src/main/java/org/b3log/solo/service/ArticleQueryService.java",
"license": "apache-2.0",
"size": 41220
} | [
"java.util.ArrayList",
"java.util.Collections",
"java.util.Date",
"java.util.HashSet",
"java.util.List",
"java.util.Set",
"org.b3log.solo.Keys",
"org.b3log.solo.dao.repository.FilterOperator",
"org.b3log.solo.dao.repository.PropertyFilter",
"org.b3log.solo.dao.repository.Query",
"org.b3log.solo.... | import java.util.ArrayList; import java.util.Collections; import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Set; import org.b3log.solo.Keys; import org.b3log.solo.dao.repository.FilterOperator; import org.b3log.solo.dao.repository.PropertyFilter; import org.b3log.solo.dao.repository.Query; import org.b3log.solo.model.Article; import org.json.JSONArray; import org.json.JSONObject; | import java.util.*; import org.b3log.solo.*; import org.b3log.solo.dao.repository.*; import org.b3log.solo.model.*; import org.json.*; | [
"java.util",
"org.b3log.solo",
"org.json"
] | java.util; org.b3log.solo; org.json; | 2,680,161 |
EClass getBoundingBoxType(); | EClass getBoundingBoxType(); | /**
* Returns the meta object for class '{@link net.opengis.ows11.BoundingBoxType <em>Bounding Box Type</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Bounding Box Type</em>'.
* @see net.opengis.ows11.BoundingBoxType
* @generated
*/ | Returns the meta object for class '<code>net.opengis.ows11.BoundingBoxType Bounding Box Type</code>'. | getBoundingBoxType | {
"repo_name": "geotools/geotools",
"path": "modules/ogc/net.opengis.ows/src/net/opengis/ows11/Ows11Package.java",
"license": "lgpl-2.1",
"size": 292282
} | [
"org.eclipse.emf.ecore.EClass"
] | import org.eclipse.emf.ecore.EClass; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,256,795 |
private boolean normalizeAttrValue(XMLAttributes attributes, int index) {
// vars
boolean leadingSpace = true;
boolean spaceStart = false;
boolean readingNonSpace = false;
int count = 0;
int eaten = 0;
String attrValue = attributes.getValue(index);
char[] attValue = new char[attrValue.length()];
fBuffer.setLength(0);
attrValue.getChars(0, attrValue.length(), attValue, 0);
for (int i = 0; i < attValue.length; i++) {
if (attValue[i] == ' ') {
// now the tricky part
if (readingNonSpace) {
spaceStart = true;
readingNonSpace = false;
}
if (spaceStart && !leadingSpace) {
spaceStart = false;
fBuffer.append(attValue[i]);
count++;
}
else {
if (leadingSpace || !spaceStart) {
eaten ++;
}
}
}
else {
readingNonSpace = true;
spaceStart = false;
leadingSpace = false;
fBuffer.append(attValue[i]);
count++;
}
}
// check if the last appended character is a space.
if (count > 0 && fBuffer.charAt(count-1) == ' ') {
fBuffer.setLength(count-1);
}
String newValue = fBuffer.toString();
attributes.setValue(index, newValue);
return ! attrValue.equals(newValue);
} | boolean function(XMLAttributes attributes, int index) { boolean leadingSpace = true; boolean spaceStart = false; boolean readingNonSpace = false; int count = 0; int eaten = 0; String attrValue = attributes.getValue(index); char[] attValue = new char[attrValue.length()]; fBuffer.setLength(0); attrValue.getChars(0, attrValue.length(), attValue, 0); for (int i = 0; i < attValue.length; i++) { if (attValue[i] == ' ') { if (readingNonSpace) { spaceStart = true; readingNonSpace = false; } if (spaceStart && !leadingSpace) { spaceStart = false; fBuffer.append(attValue[i]); count++; } else { if (leadingSpace !spaceStart) { eaten ++; } } } else { readingNonSpace = true; spaceStart = false; leadingSpace = false; fBuffer.append(attValue[i]); count++; } } if (count > 0 && fBuffer.charAt(count-1) == ' ') { fBuffer.setLength(count-1); } String newValue = fBuffer.toString(); attributes.setValue(index, newValue); return ! attrValue.equals(newValue); } | /**
* Normalize the attribute value of a non CDATA attributes collapsing
* sequences of space characters (x20)
*
* @param attributes The list of attributes
* @param index The index of the attribute to normalize
*/ | Normalize the attribute value of a non CDATA attributes collapsing sequences of space characters (x20) | normalizeAttrValue | {
"repo_name": "haikuowuya/android_system_code",
"path": "src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidator.java",
"license": "apache-2.0",
"size": 84048
} | [
"com.sun.org.apache.xerces.internal.xni.XMLAttributes"
] | import com.sun.org.apache.xerces.internal.xni.XMLAttributes; | import com.sun.org.apache.xerces.internal.xni.*; | [
"com.sun.org"
] | com.sun.org; | 2,893,973 |
final protected String getReturnHref(BusinessObject businessObject, Map fieldConversions, String lookupImpl, List returnKeys) {
if (StringUtils.isNotBlank(backLocation)) {
return UrlFactory.parameterizeUrl(backLocation, getParameters(
businessObject, fieldConversions, lookupImpl, returnKeys));
}
return "";
}
| final String function(BusinessObject businessObject, Map fieldConversions, String lookupImpl, List returnKeys) { if (StringUtils.isNotBlank(backLocation)) { return UrlFactory.parameterizeUrl(backLocation, getParameters( businessObject, fieldConversions, lookupImpl, returnKeys)); } return ""; } | /**
* This method is for lookupable implementations
*
* @param businessObject
* @param fieldConversions
* @param lookupImpl
* @param returnKeys
* @return
*/ | This method is for lookupable implementations | getReturnHref | {
"repo_name": "kuali/kc-rice",
"path": "rice-middleware/kns/src/main/java/org/kuali/rice/kns/lookup/AbstractLookupableHelperServiceImpl.java",
"license": "apache-2.0",
"size": 71764
} | [
"java.util.List",
"java.util.Map",
"org.apache.commons.lang.StringUtils",
"org.kuali.rice.krad.bo.BusinessObject",
"org.kuali.rice.krad.util.UrlFactory"
] | import java.util.List; import java.util.Map; import org.apache.commons.lang.StringUtils; import org.kuali.rice.krad.bo.BusinessObject; import org.kuali.rice.krad.util.UrlFactory; | import java.util.*; import org.apache.commons.lang.*; import org.kuali.rice.krad.bo.*; import org.kuali.rice.krad.util.*; | [
"java.util",
"org.apache.commons",
"org.kuali.rice"
] | java.util; org.apache.commons; org.kuali.rice; | 255,668 |
public NoteItem makeAndStoreDummyItem()
throws Exception {
return makeAndStoreDummyItem(homeCollection);
} | NoteItem function() throws Exception { return makeAndStoreDummyItem(homeCollection); } | /**
* Makes and stores dummy item.
* @return The note item
* @throws Exception - if something is wrong this exception is thrown.
*/ | Makes and stores dummy item | makeAndStoreDummyItem | {
"repo_name": "Eisler/cosmo",
"path": "cosmo-core/src/test/unit/java/org/unitedinternet/cosmo/MockHelper.java",
"license": "apache-2.0",
"size": 13689
} | [
"org.unitedinternet.cosmo.model.NoteItem"
] | import org.unitedinternet.cosmo.model.NoteItem; | import org.unitedinternet.cosmo.model.*; | [
"org.unitedinternet.cosmo"
] | org.unitedinternet.cosmo; | 2,490,686 |
protected String escapeJson(final String input)
{
if (input == null)
{
return null;
}
else
{
return String.valueOf(JsonStringEncoder.getInstance().quoteAsString(input));
}
} | String function(final String input) { if (input == null) { return null; } else { return String.valueOf(JsonStringEncoder.getInstance().quoteAsString(input)); } } | /**
* JSON escapes a specified string. This method is null-safe.
*
* @param input the input string
*
* @return the XML escaped string
*/ | JSON escapes a specified string. This method is null-safe | escapeJson | {
"repo_name": "FINRAOS/herd",
"path": "herd-code/herd-service/src/main/java/org/finra/herd/service/helper/notification/AbstractNotificationMessageBuilder.java",
"license": "apache-2.0",
"size": 15664
} | [
"com.fasterxml.jackson.core.io.JsonStringEncoder"
] | import com.fasterxml.jackson.core.io.JsonStringEncoder; | import com.fasterxml.jackson.core.io.*; | [
"com.fasterxml.jackson"
] | com.fasterxml.jackson; | 1,457,030 |
EList<DirectedTopoSolidPropertyType> getDirectedTopoSolid(); | EList<DirectedTopoSolidPropertyType> getDirectedTopoSolid(); | /**
* Returns the value of the '<em><b>Directed Topo Solid</b></em>' containment reference list.
* The list contents are of type {@link net.opengis.gml311.DirectedTopoSolidPropertyType}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Directed Topo Solid</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Directed Topo Solid</em>' containment reference list.
* @see net.opengis.gml311.Gml311Package#getTopoVolumeType_DirectedTopoSolid()
* @model containment="true" required="true"
* extendedMetaData="kind='element' name='directedTopoSolid' namespace='##targetNamespace'"
* @generated
*/ | Returns the value of the 'Directed Topo Solid' containment reference list. The list contents are of type <code>net.opengis.gml311.DirectedTopoSolidPropertyType</code>. If the meaning of the 'Directed Topo Solid' containment reference list isn't clear, there really should be more of a description here... | getDirectedTopoSolid | {
"repo_name": "geotools/geotools",
"path": "modules/ogc/net.opengis.wmts/src/net/opengis/gml311/TopoVolumeType.java",
"license": "lgpl-2.1",
"size": 2087
} | [
"org.eclipse.emf.common.util.EList"
] | import org.eclipse.emf.common.util.EList; | import org.eclipse.emf.common.util.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,536,383 |
private void collectScoreNodes(MultiColumnQueryHits hits,
List<ScoreNode[]> collector,
long maxResults)
throws IOException, RepositoryException {
while (collector.size() < maxResults) {
ScoreNode[] sn = hits.nextScoreNodes();
if (sn == null) {
// no more results
break;
}
// check access
if (isAccessGranted(sn)) {
collector.add(sn);
} else {
invalid++;
}
}
} | void function(MultiColumnQueryHits hits, List<ScoreNode[]> collector, long maxResults) throws IOException, RepositoryException { while (collector.size() < maxResults) { ScoreNode[] sn = hits.nextScoreNodes(); if (sn == null) { break; } if (isAccessGranted(sn)) { collector.add(sn); } else { invalid++; } } } | /**
* Collect score nodes from <code>hits</code> into the <code>collector</code>
* list until the size of <code>collector</code> reaches <code>maxResults</code>
* or there are not more results.
*
* @param hits the raw hits.
* @param collector where the access checked score nodes are collected.
* @param maxResults the maximum number of results in the collector.
* @throws IOException if an error occurs while reading from hits.
* @throws RepositoryException if an error occurs while checking access rights.
*/ | Collect score nodes from <code>hits</code> into the <code>collector</code> list until the size of <code>collector</code> reaches <code>maxResults</code> or there are not more results | collectScoreNodes | {
"repo_name": "tripodsan/jackrabbit",
"path": "jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryResultImpl.java",
"license": "apache-2.0",
"size": 20336
} | [
"java.io.IOException",
"java.util.List",
"javax.jcr.RepositoryException"
] | import java.io.IOException; import java.util.List; import javax.jcr.RepositoryException; | import java.io.*; import java.util.*; import javax.jcr.*; | [
"java.io",
"java.util",
"javax.jcr"
] | java.io; java.util; javax.jcr; | 577,831 |
public static AlertLevel forName(String name) {
for (int i = 0; i < VALUES.length; i++) {
AlertLevel level = VALUES[i];
if (level.getName().equalsIgnoreCase(name)) {
return level;
}
}
throw new IllegalArgumentException(
LocalizedStrings.AlertLevel_THERE_IS_NO_ALERT_LEVEL_0.toLocalizedString(name));
} | static AlertLevel function(String name) { for (int i = 0; i < VALUES.length; i++) { AlertLevel level = VALUES[i]; if (level.getName().equalsIgnoreCase(name)) { return level; } } throw new IllegalArgumentException( LocalizedStrings.AlertLevel_THERE_IS_NO_ALERT_LEVEL_0.toLocalizedString(name)); } | /**
* Returns the <code>AlertLevel</code> with the given name
*
* @throws IllegalArgumentException If there is no alert level named <code>name</code>
*/ | Returns the <code>AlertLevel</code> with the given name | forName | {
"repo_name": "charliemblack/geode",
"path": "geode-core/src/main/java/org/apache/geode/admin/AlertLevel.java",
"license": "apache-2.0",
"size": 5275
} | [
"org.apache.geode.internal.i18n.LocalizedStrings"
] | import org.apache.geode.internal.i18n.LocalizedStrings; | import org.apache.geode.internal.i18n.*; | [
"org.apache.geode"
] | org.apache.geode; | 1,265,895 |
@Override
public void run() {
int opsProcessed = 0;
Op op = null;
try {
dataXceiverServer.addPeer(peer, Thread.currentThread(), this);
peer.setWriteTimeout(datanode.getDnConf().socketWriteTimeout);
InputStream input = socketIn;
try {
IOStreamPair saslStreams = datanode.saslServer.receive(peer, socketOut,
socketIn, datanode.getXferAddress().getPort(),
datanode.getDatanodeId());
input = new BufferedInputStream(saslStreams.in,
HdfsConstants.SMALL_BUFFER_SIZE);
socketOut = saslStreams.out;
} catch (InvalidMagicNumberException imne) {
if (imne.isHandshake4Encryption()) {
LOG.info("Failed to read expected encryption handshake from client " +
"at " + peer.getRemoteAddressString() + ". Perhaps the client " +
"is running an older version of Hadoop which does not support " +
"encryption");
} else {
LOG.info("Failed to read expected SASL data transfer protection " +
"handshake from client at " + peer.getRemoteAddressString() +
". Perhaps the client is running an older version of Hadoop " +
"which does not support SASL data transfer protection");
}
return;
}
super.initialize(new DataInputStream(input));
// We process requests in a loop, and stay around for a short timeout.
// This optimistic behaviour allows the other end to reuse connections.
// Setting keepalive timeout to 0 disable this behavior.
do {
updateCurrentThreadName("Waiting for operation #" + (opsProcessed + 1));
try {
if (opsProcessed != 0) {
assert dnConf.socketKeepaliveTimeout > 0;
peer.setReadTimeout(dnConf.socketKeepaliveTimeout);
} else {
peer.setReadTimeout(dnConf.socketTimeout);
}
op = readOp();
} catch (InterruptedIOException ignored) {
// Time out while we wait for client rpc
break;
} catch (IOException err) {
// Since we optimistically expect the next op, it's quite normal to get EOF here.
if (opsProcessed > 0 &&
(err instanceof EOFException || err instanceof ClosedChannelException)) {
if (LOG.isDebugEnabled()) {
LOG.debug("Cached " + peer + " closing after " + opsProcessed + " ops");
}
} else {
incrDatanodeNetworkErrors();
throw err;
}
break;
}
// restore normal timeout
if (opsProcessed != 0) {
peer.setReadTimeout(dnConf.socketTimeout);
}
opStartTime = monotonicNow();
processOp(op);
++opsProcessed;
} while ((peer != null) &&
(!peer.isClosed() && dnConf.socketKeepaliveTimeout > 0));
} catch (Throwable t) {
String s = datanode.getDisplayName() + ":DataXceiver error processing "
+ ((op == null) ? "unknown" : op.name()) + " operation "
+ " src: " + remoteAddress + " dst: " + localAddress;
if (op == Op.WRITE_BLOCK && t instanceof ReplicaAlreadyExistsException) {
// For WRITE_BLOCK, it is okay if the replica already exists since
// client and replication may write the same block to the same datanode
// at the same time.
if (LOG.isTraceEnabled()) {
LOG.trace(s, t);
} else {
LOG.info(s + "; " + t);
}
} else if (op == Op.READ_BLOCK && t instanceof SocketTimeoutException) {
String s1 =
"Likely the client has stopped reading, disconnecting it";
s1 += " (" + s + ")";
if (LOG.isTraceEnabled()) {
LOG.trace(s1, t);
} else {
LOG.info(s1 + "; " + t);
}
} else {
LOG.error(s, t);
}
} finally {
if (LOG.isDebugEnabled()) {
LOG.debug(datanode.getDisplayName() + ":Number of active connections is: "
+ datanode.getXceiverCount());
}
updateCurrentThreadName("Cleaning up");
if (peer != null) {
dataXceiverServer.closePeer(peer);
IOUtils.closeStream(in);
}
}
} | void function() { int opsProcessed = 0; Op op = null; try { dataXceiverServer.addPeer(peer, Thread.currentThread(), this); peer.setWriteTimeout(datanode.getDnConf().socketWriteTimeout); InputStream input = socketIn; try { IOStreamPair saslStreams = datanode.saslServer.receive(peer, socketOut, socketIn, datanode.getXferAddress().getPort(), datanode.getDatanodeId()); input = new BufferedInputStream(saslStreams.in, HdfsConstants.SMALL_BUFFER_SIZE); socketOut = saslStreams.out; } catch (InvalidMagicNumberException imne) { if (imne.isHandshake4Encryption()) { LOG.info(STR + STR + peer.getRemoteAddressString() + STR + STR + STR); } else { LOG.info(STR + STR + peer.getRemoteAddressString() + STR + STR); } return; } super.initialize(new DataInputStream(input)); do { updateCurrentThreadName(STR + (opsProcessed + 1)); try { if (opsProcessed != 0) { assert dnConf.socketKeepaliveTimeout > 0; peer.setReadTimeout(dnConf.socketKeepaliveTimeout); } else { peer.setReadTimeout(dnConf.socketTimeout); } op = readOp(); } catch (InterruptedIOException ignored) { break; } catch (IOException err) { if (opsProcessed > 0 && (err instanceof EOFException err instanceof ClosedChannelException)) { if (LOG.isDebugEnabled()) { LOG.debug(STR + peer + STR + opsProcessed + STR); } } else { incrDatanodeNetworkErrors(); throw err; } break; } if (opsProcessed != 0) { peer.setReadTimeout(dnConf.socketTimeout); } opStartTime = monotonicNow(); processOp(op); ++opsProcessed; } while ((peer != null) && (!peer.isClosed() && dnConf.socketKeepaliveTimeout > 0)); } catch (Throwable t) { String s = datanode.getDisplayName() + STR + ((op == null) ? STR : op.name()) + STR + STR + remoteAddress + STR + localAddress; if (op == Op.WRITE_BLOCK && t instanceof ReplicaAlreadyExistsException) { if (LOG.isTraceEnabled()) { LOG.trace(s, t); } else { LOG.info(s + STR + t); } } else if (op == Op.READ_BLOCK && t instanceof SocketTimeoutException) { String s1 = STR; s1 += STR + s + ")"; if (LOG.isTraceEnabled()) { LOG.trace(s1, t); } else { LOG.info(s1 + STR + t); } } else { LOG.error(s, t); } } finally { if (LOG.isDebugEnabled()) { LOG.debug(datanode.getDisplayName() + STR + datanode.getXceiverCount()); } updateCurrentThreadName(STR); if (peer != null) { dataXceiverServer.closePeer(peer); IOUtils.closeStream(in); } } } | /**
* Read/write data from/to the DataXceiverServer.
*/ | Read/write data from/to the DataXceiverServer | run | {
"repo_name": "VicoWu/hadoop-2.7.3",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataXceiver.java",
"license": "apache-2.0",
"size": 52413
} | [
"java.io.BufferedInputStream",
"java.io.DataInputStream",
"java.io.EOFException",
"java.io.IOException",
"java.io.InputStream",
"java.io.InterruptedIOException",
"java.net.SocketTimeoutException",
"java.nio.channels.ClosedChannelException",
"org.apache.hadoop.hdfs.protocol.HdfsConstants",
"org.apa... | import java.io.BufferedInputStream; import java.io.DataInputStream; import java.io.EOFException; import java.io.IOException; import java.io.InputStream; import java.io.InterruptedIOException; import java.net.SocketTimeoutException; import java.nio.channels.ClosedChannelException; import org.apache.hadoop.hdfs.protocol.HdfsConstants; import org.apache.hadoop.hdfs.protocol.datatransfer.IOStreamPair; import org.apache.hadoop.hdfs.protocol.datatransfer.Op; import org.apache.hadoop.hdfs.protocol.datatransfer.sasl.InvalidMagicNumberException; import org.apache.hadoop.io.IOUtils; import org.apache.hadoop.util.Time; | import java.io.*; import java.net.*; import java.nio.channels.*; import org.apache.hadoop.hdfs.protocol.*; import org.apache.hadoop.hdfs.protocol.datatransfer.*; import org.apache.hadoop.hdfs.protocol.datatransfer.sasl.*; import org.apache.hadoop.io.*; import org.apache.hadoop.util.*; | [
"java.io",
"java.net",
"java.nio",
"org.apache.hadoop"
] | java.io; java.net; java.nio; org.apache.hadoop; | 1,628,246 |
protected int invalidateSessions(ContextName cn, String[] sessionIds,
StringManager smClient) throws IOException {
if (null == sessionIds) {
return 0;
}
int nbAffectedSessions = 0;
for (int i = 0; i < sessionIds.length; ++i) {
String sessionId = sessionIds[i];
HttpSession session =
getSessionForNameAndId(cn, sessionId, smClient).getSession();
if (null == session) {
// Shouldn't happen, but let's play nice...
if (debug >= 1) {
log("WARNING: can't invalidate null session " + sessionId);
}
continue;
}
try {
session.invalidate();
++nbAffectedSessions;
if (debug >= 1) {
log("Invalidating session id " + sessionId);
}
} catch (IllegalStateException ise) {
if (debug >= 1) {
log("Can't invalidate already invalidated session id " + sessionId);
}
}
}
return nbAffectedSessions;
} | int function(ContextName cn, String[] sessionIds, StringManager smClient) throws IOException { if (null == sessionIds) { return 0; } int nbAffectedSessions = 0; for (int i = 0; i < sessionIds.length; ++i) { String sessionId = sessionIds[i]; HttpSession session = getSessionForNameAndId(cn, sessionId, smClient).getSession(); if (null == session) { if (debug >= 1) { log(STR + sessionId); } continue; } try { session.invalidate(); ++nbAffectedSessions; if (debug >= 1) { log(STR + sessionId); } } catch (IllegalStateException ise) { if (debug >= 1) { log(STR + sessionId); } } } return nbAffectedSessions; } | /**
* Invalidate HttpSessions
* @param cn Name of the application for which sessions are to be
* invalidated
* @param sessionIds
* @param smClient StringManager for the client's locale
* @return number of invalidated sessions
* @throws IOException
*/ | Invalidate HttpSessions | invalidateSessions | {
"repo_name": "mayonghui2112/helloWorld",
"path": "sourceCode/apache-tomcat-7.0.82-src/java/org/apache/catalina/manager/HTMLManagerServlet.java",
"license": "apache-2.0",
"size": 53431
} | [
"java.io.IOException",
"javax.servlet.http.HttpSession",
"org.apache.catalina.util.ContextName",
"org.apache.tomcat.util.res.StringManager"
] | import java.io.IOException; import javax.servlet.http.HttpSession; import org.apache.catalina.util.ContextName; import org.apache.tomcat.util.res.StringManager; | import java.io.*; import javax.servlet.http.*; import org.apache.catalina.util.*; import org.apache.tomcat.util.res.*; | [
"java.io",
"javax.servlet",
"org.apache.catalina",
"org.apache.tomcat"
] | java.io; javax.servlet; org.apache.catalina; org.apache.tomcat; | 1,784,290 |
private void immutableSetMockDataSource(final MockDataSource mockDataSource)
{
m__MockDataSource = mockDataSource;
} | void function(final MockDataSource mockDataSource) { m__MockDataSource = mockDataSource; } | /**
* Sets the mock data source.
* @param mockDataSource the mock data source.
*/ | Sets the mock data source | immutableSetMockDataSource | {
"repo_name": "rydnr/queryj-sql",
"path": "src/main/java/org/acmsl/queryj/sql/dao/MockConnection.java",
"license": "gpl-3.0",
"size": 85579
} | [
"org.acmsl.queryj.sql.dao.MockDataSource"
] | import org.acmsl.queryj.sql.dao.MockDataSource; | import org.acmsl.queryj.sql.dao.*; | [
"org.acmsl.queryj"
] | org.acmsl.queryj; | 824,274 |
Service getService(); | Service getService(); | /**
* A LoadDriver instance can only be associated with a service at a time.
*/ | A LoadDriver instance can only be associated with a service at a time | getService | {
"repo_name": "NovaOrdis/gld",
"path": "core/api/src/main/java/io/novaordis/gld/api/LoadDriver.java",
"license": "apache-2.0",
"size": 3918
} | [
"io.novaordis.gld.api.service.Service"
] | import io.novaordis.gld.api.service.Service; | import io.novaordis.gld.api.service.*; | [
"io.novaordis.gld"
] | io.novaordis.gld; | 604,471 |
@Override
public String toString() {
byte[] entity = buffer.toByteArray();
return new HttpLogBuilder(id).responseEntity(entity, entity.length, entitySize > MAX_ENTITY_SIZE);
} | String function() { byte[] entity = buffer.toByteArray(); return new HttpLogBuilder(id).responseEntity(entity, entity.length, entitySize > MAX_ENTITY_SIZE); } | /**
* Writes entity to a string.
*
* @return A new String instance.
*/ | Writes entity to a string | toString | {
"repo_name": "elasticlib/elasticlib",
"path": "elasticlib-node/src/main/java/org/elasticlib/node/providers/LoggingFilter.java",
"license": "apache-2.0",
"size": 6422
} | [
"org.elasticlib.common.util.HttpLogBuilder"
] | import org.elasticlib.common.util.HttpLogBuilder; | import org.elasticlib.common.util.*; | [
"org.elasticlib.common"
] | org.elasticlib.common; | 1,437,167 |
static String validateAgainstAliases(SearchRequest source, IndexRequest destination,
IndexNameExpressionResolver indexNameExpressionResolver, AutoCreateIndex autoCreateIndex, ClusterState clusterState) {
String target = destination.index();
if (false == autoCreateIndex.shouldAutoCreate(target, clusterState)) {
target = indexNameExpressionResolver.concreteIndices(clusterState, destination)[0];
}
for (String sourceIndex: indexNameExpressionResolver.concreteIndices(clusterState, source)) {
if (sourceIndex.equals(target)) {
ActionRequestValidationException e = new ActionRequestValidationException();
e.addValidationError("reindex cannot write into an index its reading from [" + target + ']');
throw e;
}
}
return target;
}
static class AsyncIndexBySearchAction extends AbstractAsyncBulkIndexByScrollAction<ReindexRequest, ReindexResponse> {
public AsyncIndexBySearchAction(BulkByScrollTask task, ESLogger logger, ScriptService scriptService, Client client,
ThreadPool threadPool, ReindexRequest request, ActionListener<ReindexResponse> listener) {
super(task, logger, scriptService, client, threadPool, request, request.getSearchRequest(), listener);
} | static String validateAgainstAliases(SearchRequest source, IndexRequest destination, IndexNameExpressionResolver indexNameExpressionResolver, AutoCreateIndex autoCreateIndex, ClusterState clusterState) { String target = destination.index(); if (false == autoCreateIndex.shouldAutoCreate(target, clusterState)) { target = indexNameExpressionResolver.concreteIndices(clusterState, destination)[0]; } for (String sourceIndex: indexNameExpressionResolver.concreteIndices(clusterState, source)) { if (sourceIndex.equals(target)) { ActionRequestValidationException e = new ActionRequestValidationException(); e.addValidationError(STR + target + ']'); throw e; } } return target; } static class AsyncIndexBySearchAction extends AbstractAsyncBulkIndexByScrollAction<ReindexRequest, ReindexResponse> { public AsyncIndexBySearchAction(BulkByScrollTask task, ESLogger logger, ScriptService scriptService, Client client, ThreadPool threadPool, ReindexRequest request, ActionListener<ReindexResponse> listener) { super(task, logger, scriptService, client, threadPool, request, request.getSearchRequest(), listener); } | /**
* Throws an ActionRequestValidationException if the request tries to index
* back into the same index or into an index that points to two indexes.
* This cannot be done during request validation because the cluster state
* isn't available then. Package private for testing.
*/ | Throws an ActionRequestValidationException if the request tries to index back into the same index or into an index that points to two indexes. This cannot be done during request validation because the cluster state isn't available then. Package private for testing | validateAgainstAliases | {
"repo_name": "episerver/elasticsearch",
"path": "modules/reindex/src/main/java/org/elasticsearch/index/reindex/TransportReindexAction.java",
"license": "apache-2.0",
"size": 12103
} | [
"org.elasticsearch.action.ActionListener",
"org.elasticsearch.action.ActionRequestValidationException",
"org.elasticsearch.action.index.IndexRequest",
"org.elasticsearch.action.search.SearchRequest",
"org.elasticsearch.action.support.AutoCreateIndex",
"org.elasticsearch.client.Client",
"org.elasticsearc... | import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.support.AutoCreateIndex; import org.elasticsearch.client.Client; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.script.ScriptService; import org.elasticsearch.threadpool.ThreadPool; | import org.elasticsearch.action.*; import org.elasticsearch.action.index.*; import org.elasticsearch.action.search.*; import org.elasticsearch.action.support.*; import org.elasticsearch.client.*; import org.elasticsearch.cluster.*; import org.elasticsearch.cluster.metadata.*; import org.elasticsearch.common.logging.*; import org.elasticsearch.script.*; import org.elasticsearch.threadpool.*; | [
"org.elasticsearch.action",
"org.elasticsearch.client",
"org.elasticsearch.cluster",
"org.elasticsearch.common",
"org.elasticsearch.script",
"org.elasticsearch.threadpool"
] | org.elasticsearch.action; org.elasticsearch.client; org.elasticsearch.cluster; org.elasticsearch.common; org.elasticsearch.script; org.elasticsearch.threadpool; | 2,575,979 |
void rotateVcenterPassword(Context context); | void rotateVcenterPassword(Context context); | /**
* Rotate the vCenter password.
*
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/ | Rotate the vCenter password | rotateVcenterPassword | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloud.java",
"license": "mit",
"size": 22797
} | [
"com.azure.core.util.Context"
] | import com.azure.core.util.Context; | import com.azure.core.util.*; | [
"com.azure.core"
] | com.azure.core; | 1,235,678 |
protected void preRenderCallback(EntityShulker entitylivingbaseIn, float partialTickTime)
{
float f = 0.999F;
GlStateManager.scale(0.999F, 0.999F, 0.999F);
}
@SideOnly(Side.CLIENT)
class HeadLayer implements LayerRenderer<EntityShulker>
{
private HeadLayer()
{
} | void function(EntityShulker entitylivingbaseIn, float partialTickTime) { float f = 0.999F; GlStateManager.scale(0.999F, 0.999F, 0.999F); } @SideOnly(Side.CLIENT) class HeadLayer implements LayerRenderer<EntityShulker> { private HeadLayer() { } | /**
* Allows the render to do state modifications necessary before the model is rendered.
*/ | Allows the render to do state modifications necessary before the model is rendered | preRenderCallback | {
"repo_name": "boredherobrine13/morefuelsmod-1.10",
"path": "build/tmp/recompileMc/sources/net/minecraft/client/renderer/entity/RenderShulker.java",
"license": "lgpl-2.1",
"size": 7619
} | [
"net.minecraft.client.renderer.GlStateManager",
"net.minecraft.client.renderer.entity.layers.LayerRenderer",
"net.minecraft.entity.monster.EntityShulker",
"net.minecraftforge.fml.relauncher.Side",
"net.minecraftforge.fml.relauncher.SideOnly"
] | import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.layers.LayerRenderer; import net.minecraft.entity.monster.EntityShulker; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; | import net.minecraft.client.renderer.*; import net.minecraft.client.renderer.entity.layers.*; import net.minecraft.entity.monster.*; import net.minecraftforge.fml.relauncher.*; | [
"net.minecraft.client",
"net.minecraft.entity",
"net.minecraftforge.fml"
] | net.minecraft.client; net.minecraft.entity; net.minecraftforge.fml; | 2,547,392 |
private static RMIServer objectToBind(
RMIServerImpl rmiServer, Map<String, ?> env)
throws IOException {
return (RMIServer)rmiServer.toStub();
} | static RMIServer function( RMIServerImpl rmiServer, Map<String, ?> env) throws IOException { return (RMIServer)rmiServer.toStub(); } | /**
* Object that we will bind to the registry.
* This object is a stub connected to our RMIServerImpl.
**/ | Object that we will bind to the registry. This object is a stub connected to our RMIServerImpl | objectToBind | {
"repo_name": "md-5/jdk10",
"path": "src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnectorServer.java",
"license": "gpl-2.0",
"size": 35062
} | [
"java.io.IOException",
"java.util.Map"
] | import java.io.IOException; import java.util.Map; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 1,612,321 |
@Override
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public BuildConfigSetRecord saveBuildConfigSetRecord(BuildConfigSetRecord buildConfigSetRecord) {
return buildConfigSetRecordRepository.save(buildConfigSetRecord);
} | @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) BuildConfigSetRecord function(BuildConfigSetRecord buildConfigSetRecord) { return buildConfigSetRecordRepository.save(buildConfigSetRecord); } | /**
* Save a build config set record to the db. This requires a new transaction to ensure that the record is
* immediately committed to the database so that it's available to use by the foreign keys set in the individual
* build records.
*/ | Save a build config set record to the db. This requires a new transaction to ensure that the record is immediately committed to the database so that it's available to use by the foreign keys set in the individual build records | saveBuildConfigSetRecord | {
"repo_name": "matedo1/pnc",
"path": "datastore/src/main/java/org/jboss/pnc/datastore/DefaultDatastore.java",
"license": "apache-2.0",
"size": 24220
} | [
"javax.ejb.TransactionAttribute",
"javax.ejb.TransactionAttributeType",
"org.jboss.pnc.model.BuildConfigSetRecord"
] | import javax.ejb.TransactionAttribute; import javax.ejb.TransactionAttributeType; import org.jboss.pnc.model.BuildConfigSetRecord; | import javax.ejb.*; import org.jboss.pnc.model.*; | [
"javax.ejb",
"org.jboss.pnc"
] | javax.ejb; org.jboss.pnc; | 1,079,968 |
@Override
public void process(Exchange exchange) throws Exception {
if (log.isTraceEnabled()) {
log.trace(exchange.toString());
}
KuraGPIOAction messageAction = exchange.getIn().getHeader(KuraGPIOConstants.CAMEL_KURA_GPIO_ACTION, getAction(),
KuraGPIOAction.class);
if (messageAction == null) {
log.trace("No action pick up body");
output(exchange);
} else {
log.trace("action= {} ", action);
switch (messageAction) {
case TOGGLE:
pin.setValue(!pin.getValue());
break;
case LOW:
pin.setValue(false);
break;
case HIGH:
pin.setValue(true);
break;
case BLINK:
pool.submit(new Runnable() { | void function(Exchange exchange) throws Exception { if (log.isTraceEnabled()) { log.trace(exchange.toString()); } KuraGPIOAction messageAction = exchange.getIn().getHeader(KuraGPIOConstants.CAMEL_KURA_GPIO_ACTION, getAction(), KuraGPIOAction.class); if (messageAction == null) { log.trace(STR); output(exchange); } else { log.trace(STR, action); switch (messageAction) { case TOGGLE: pin.setValue(!pin.getValue()); break; case LOW: pin.setValue(false); break; case HIGH: pin.setValue(true); break; case BLINK: pool.submit(new Runnable() { | /**
* Process the message
*/ | Process the message | process | {
"repo_name": "finiteloopme/rhiot",
"path": "gateway/components/camel-kura/src/main/java/io/rhiot/component/kura/gpio/KuraGPIOProducer.java",
"license": "apache-2.0",
"size": 5302
} | [
"org.apache.camel.Exchange"
] | import org.apache.camel.Exchange; | import org.apache.camel.*; | [
"org.apache.camel"
] | org.apache.camel; | 403,540 |
@Override
public void begin() throws NotSupportedException, SystemException {
Transaction currentTransaction = getTransaction();
try {
if (currentTransaction instanceof DataSourceTransaction)
((DataSourceTransaction) currentTransaction).begin();
} catch (IllegalStateException | XAException e) {
throw new SystemException(e.getMessage());
}
}
/**
* <p>Commit active transaction and create a new one for the current thread.</p>
* @throws RollbackException
* @throws HeuristicMixedException
* @throws HeuristicRollbackException
* @throws SecurityException
* @throws IllegalStateException It there is no current transaction or transaction status is any of {STATUS_NO_TRANSACTION, STATUS_COMMITTED, STATUS_ROLLEDBACK }
| void function() throws NotSupportedException, SystemException { Transaction currentTransaction = getTransaction(); try { if (currentTransaction instanceof DataSourceTransaction) ((DataSourceTransaction) currentTransaction).begin(); } catch (IllegalStateException XAException e) { throw new SystemException(e.getMessage()); } } /** * <p>Commit active transaction and create a new one for the current thread.</p> * @throws RollbackException * @throws HeuristicMixedException * @throws HeuristicRollbackException * @throws SecurityException * @throws IllegalStateException It there is no current transaction or transaction status is any of {STATUS_NO_TRANSACTION, STATUS_COMMITTED, STATUS_ROLLEDBACK } | /**
* <p>Begin transaction./<p>
* Create a new instance of the transaction class injected in the constructor (or org.judal.transaction.DataSourceTransaction if the default constructor was used to create this instance).
* For the new transaction, call Transaction.begin()
* @throws NotSupportedException
* @throws SystemException
*/ | Begin transaction./ Create a new instance of the transaction class injected in the constructor (or org.judal.transaction.DataSourceTransaction if the default constructor was used to create this instance). For the new transaction, call Transaction.begin() | begin | {
"repo_name": "sergiomt/judal",
"path": "core/src/main/java/org/judal/transaction/DataSourceTransactionManager.java",
"license": "apache-2.0",
"size": 8347
} | [
"javax.transaction.HeuristicMixedException",
"javax.transaction.HeuristicRollbackException",
"javax.transaction.NotSupportedException",
"javax.transaction.RollbackException",
"javax.transaction.SystemException",
"javax.transaction.Transaction",
"javax.transaction.xa.XAException"
] | import javax.transaction.HeuristicMixedException; import javax.transaction.HeuristicRollbackException; import javax.transaction.NotSupportedException; import javax.transaction.RollbackException; import javax.transaction.SystemException; import javax.transaction.Transaction; import javax.transaction.xa.XAException; | import javax.transaction.*; import javax.transaction.xa.*; | [
"javax.transaction"
] | javax.transaction; | 933,715 |
@Test
public void testGetCurrentPage() {
final int currentPage = 12;
WTable table = new WTable();
table.setLocked(true);
setActiveContext(createUIContext());
table.setCurrentPage(currentPage);
Assert.assertEquals("Too high currentPage should be set back to maxPage", 0, table.
getCurrentPage());
resetContext();
Assert.assertEquals("Incorrect default page", 0, table.getCurrentPage());
}
| void function() { final int currentPage = 12; WTable table = new WTable(); table.setLocked(true); setActiveContext(createUIContext()); table.setCurrentPage(currentPage); Assert.assertEquals(STR, 0, table. getCurrentPage()); resetContext(); Assert.assertEquals(STR, 0, table.getCurrentPage()); } | /**
* Test getCurrentPage - set back to maxPage.
*/ | Test getCurrentPage - set back to maxPage | testGetCurrentPage | {
"repo_name": "Joshua-Barclay/wcomponents",
"path": "wcomponents-core/src/test/java/com/github/bordertech/wcomponents/WTable_Test.java",
"license": "gpl-3.0",
"size": 39702
} | [
"junit.framework.Assert"
] | import junit.framework.Assert; | import junit.framework.*; | [
"junit.framework"
] | junit.framework; | 2,189,654 |
public HttpServletResponse getOriginalPortalResponse(PortletRequest portletRequest); | HttpServletResponse function(PortletRequest portletRequest); | /**
* Useful for container service callbacks and service portlets that are provided with
* the portlet's request but need access to the portal's HttpServletResponse.
*
* @param portletRequest The request targeted to the portlet
* @return The portal's response, not scoped to a particular portlet
*/ | Useful for container service callbacks and service portlets that are provided with the portlet's request but need access to the portal's HttpServletResponse | getOriginalPortalResponse | {
"repo_name": "apetro/uPortal",
"path": "uportal-war/src/main/java/org/apereo/portal/url/IPortalRequestUtils.java",
"license": "apache-2.0",
"size": 3198
} | [
"javax.portlet.PortletRequest",
"javax.servlet.http.HttpServletResponse"
] | import javax.portlet.PortletRequest; import javax.servlet.http.HttpServletResponse; | import javax.portlet.*; import javax.servlet.http.*; | [
"javax.portlet",
"javax.servlet"
] | javax.portlet; javax.servlet; | 690,279 |
public void dispatch(Remote obj, RemoteCall call) throws IOException {
// positive operation number in 1.1 stubs;
// negative version number in 1.2 stubs and beyond...
int num;
long op;
try {
// read remote call header
ObjectInput in;
try {
in = call.getInputStream();
num = in.readInt();
if (num >= 0) {
if (skel != null) {
oldDispatch(obj, call, num);
return;
} else {
throw new UnmarshalException(
"skeleton class not found but required " +
"for client version");
}
}
op = in.readLong();
} catch (Exception readEx) {
throw new UnmarshalException("error unmarshalling call header",
readEx);
}
MarshalInputStream marshalStream = (MarshalInputStream) in;
marshalStream.skipDefaultResolveClass();
Method method = hashToMethod_Map.get(op);
if (method == null) {
throw new UnmarshalException("unrecognized method hash: " +
"method not supported by remote object");
}
// if calls are being logged, write out object id and operation
logCall(obj, method);
// unmarshal parameters
Class[] types = method.getParameterTypes();
Object[] params = new Object[types.length];
try {
unmarshalCustomCallData(in);
for (int i = 0; i < types.length; i++) {
params[i] = unmarshalValue(types[i], in);
}
} catch (java.io.IOException e) {
throw new UnmarshalException(
"error unmarshalling arguments", e);
} catch (ClassNotFoundException e) {
throw new UnmarshalException(
"error unmarshalling arguments", e);
} finally {
call.releaseInputStream();
}
// make upcall on remote object
Object result;
try {
result = method.invoke(obj, params);
} catch (InvocationTargetException e) {
throw e.getTargetException();
}
// marshal return value
try {
ObjectOutput out = call.getResultStream(true);
Class rtype = method.getReturnType();
if (rtype != void.class) {
marshalValue(rtype, result, out);
}
} catch (IOException ex) {
throw new MarshalException("error marshalling return", ex);
}
} catch (Throwable e) {
logCallException(e);
ObjectOutput out = call.getResultStream(false);
if (e instanceof Error) {
e = new ServerError(
"Error occurred in server thread", (Error) e);
} else if (e instanceof RemoteException) {
e = new ServerException(
"RemoteException occurred in server thread",
(Exception) e);
}
if (suppressStackTraces) {
clearStackTraces(e);
}
out.writeObject(e);
} finally {
call.releaseInputStream(); // in case skeleton doesn't
call.releaseOutputStream();
}
} | void function(Remote obj, RemoteCall call) throws IOException { int num; long op; try { ObjectInput in; try { in = call.getInputStream(); num = in.readInt(); if (num >= 0) { if (skel != null) { oldDispatch(obj, call, num); return; } else { throw new UnmarshalException( STR + STR); } } op = in.readLong(); } catch (Exception readEx) { throw new UnmarshalException(STR, readEx); } MarshalInputStream marshalStream = (MarshalInputStream) in; marshalStream.skipDefaultResolveClass(); Method method = hashToMethod_Map.get(op); if (method == null) { throw new UnmarshalException(STR + STR); } logCall(obj, method); Class[] types = method.getParameterTypes(); Object[] params = new Object[types.length]; try { unmarshalCustomCallData(in); for (int i = 0; i < types.length; i++) { params[i] = unmarshalValue(types[i], in); } } catch (java.io.IOException e) { throw new UnmarshalException( STR, e); } catch (ClassNotFoundException e) { throw new UnmarshalException( STR, e); } finally { call.releaseInputStream(); } Object result; try { result = method.invoke(obj, params); } catch (InvocationTargetException e) { throw e.getTargetException(); } try { ObjectOutput out = call.getResultStream(true); Class rtype = method.getReturnType(); if (rtype != void.class) { marshalValue(rtype, result, out); } } catch (IOException ex) { throw new MarshalException(STR, ex); } } catch (Throwable e) { logCallException(e); ObjectOutput out = call.getResultStream(false); if (e instanceof Error) { e = new ServerError( STR, (Error) e); } else if (e instanceof RemoteException) { e = new ServerException( STR, (Exception) e); } if (suppressStackTraces) { clearStackTraces(e); } out.writeObject(e); } finally { call.releaseInputStream(); call.releaseOutputStream(); } } | /**
* Call to dispatch to the remote object (on the server side).
* The up-call to the server and the marshalling of return result
* (or exception) should be handled before returning from this
* method.
* @param obj the target remote object for the call
* @param call the "remote call" from which operation and
* method arguments can be obtained.
* @exception IOException If unable to marshal return result or
* release input or output streams
*/ | Call to dispatch to the remote object (on the server side). The up-call to the server and the marshalling of return result (or exception) should be handled before returning from this method | dispatch | {
"repo_name": "TheTypoMaster/Scaper",
"path": "openjdk/jdk/src/share/classes/sun/rmi/server/UnicastServerRef.java",
"license": "gpl-2.0",
"size": 20907
} | [
"java.io.IOException",
"java.io.ObjectInput",
"java.io.ObjectOutput",
"java.lang.reflect.InvocationTargetException",
"java.lang.reflect.Method",
"java.rmi.MarshalException",
"java.rmi.Remote",
"java.rmi.RemoteException",
"java.rmi.ServerError",
"java.rmi.ServerException",
"java.rmi.UnmarshalExce... | import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.rmi.MarshalException; import java.rmi.Remote; import java.rmi.RemoteException; import java.rmi.ServerError; import java.rmi.ServerException; import java.rmi.UnmarshalException; import java.rmi.server.RemoteCall; import java.util.Map; | import java.io.*; import java.lang.reflect.*; import java.rmi.*; import java.rmi.server.*; import java.util.*; | [
"java.io",
"java.lang",
"java.rmi",
"java.util"
] | java.io; java.lang; java.rmi; java.util; | 1,072,102 |
@Override
protected void innerToNetwork(ObjectContainer container, ClientContext context) {
if(persistent()) {
container.activate(ctx, 1);
container.activate(ctx.eventProducer, 1);
}
ctx.eventProducer.produceEvent(new SendingToNetworkEvent(), container, context);
} | void function(ObjectContainer container, ClientContext context) { if(persistent()) { container.activate(ctx, 1); container.activate(ctx.eventProducer, 1); } ctx.eventProducer.produceEvent(new SendingToNetworkEvent(), container, context); } | /**
* Notify clients that some part of the request has been sent to the network i.e. we have finished
* checking the datastore for at least some part of the request. Sent once only for any given request.
*/ | Notify clients that some part of the request has been sent to the network i.e. we have finished checking the datastore for at least some part of the request. Sent once only for any given request | innerToNetwork | {
"repo_name": "spencerjackson/fred-staging",
"path": "src/freenet/client/async/ClientGetter.java",
"license": "gpl-2.0",
"size": 24456
} | [
"com.db4o.ObjectContainer"
] | import com.db4o.ObjectContainer; | import com.db4o.*; | [
"com.db4o"
] | com.db4o; | 1,791,938 |
public void stopParsing() {
timer.stop();
running = false;
}
private static class NoticeHighlightPair {
public ParserNotice notice;
public HighlightInfo highlight;
public NoticeHighlightPair(ParserNotice notice, HighlightInfo highlight) {
this.notice = notice;
this.highlight = highlight;
}
}
static {
boolean debugParsing = false;
try {
debugParsing = Boolean.getBoolean(PROPERTY_DEBUG_PARSING);
} catch (AccessControlException ace) {
// Likely an applet's security manager.
debugParsing = false; // FindBugs
}
DEBUG_PARSING = debugParsing;
}
| void function() { timer.stop(); running = false; } private static class NoticeHighlightPair { public ParserNotice notice; public HighlightInfo highlight; public NoticeHighlightPair(ParserNotice notice, HighlightInfo highlight) { this.notice = notice; this.highlight = highlight; } } static { boolean debugParsing = false; try { debugParsing = Boolean.getBoolean(PROPERTY_DEBUG_PARSING); } catch (AccessControlException ace) { debugParsing = false; } DEBUG_PARSING = debugParsing; } | /**
* Stops parsing the document.
*
* @see #restartParsing()
*/ | Stops parsing the document | stopParsing | {
"repo_name": "curiosag/ftc",
"path": "RSyntaxTextArea/src/main/java/org/fife/ui/rsyntaxtextarea/ParserManager.java",
"license": "gpl-3.0",
"size": 22568
} | [
"java.security.AccessControlException",
"org.fife.ui.rsyntaxtextarea.parser.ParserNotice",
"org.fife.ui.rtextarea.RTextAreaHighlighter"
] | import java.security.AccessControlException; import org.fife.ui.rsyntaxtextarea.parser.ParserNotice; import org.fife.ui.rtextarea.RTextAreaHighlighter; | import java.security.*; import org.fife.ui.rsyntaxtextarea.parser.*; import org.fife.ui.rtextarea.*; | [
"java.security",
"org.fife.ui"
] | java.security; org.fife.ui; | 1,451,641 |
public void addExclusion(Zone zone) {
exclusions.add(zone);
}
public Shape(Zone zone) {
this.zone = zone;
exclusions = new LinkedHashSet<>();
}
private Shape() {
} | void function(Zone zone) { exclusions.add(zone); } public Shape(Zone zone) { this.zone = zone; exclusions = new LinkedHashSet<>(); } private Shape() { } | /**
* Add exclusion.
*
* @param zone the zone
*/ | Add exclusion | addExclusion | {
"repo_name": "jspresso/jspresso-ce",
"path": "util/src/main/java/org/jspresso/framework/util/gui/map/Shape.java",
"license": "lgpl-3.0",
"size": 3435
} | [
"java.util.LinkedHashSet"
] | import java.util.LinkedHashSet; | import java.util.*; | [
"java.util"
] | java.util; | 2,069,120 |
void sendNotification() {
if ( this.commInfo == ImAndWorkerCommunicationInfo.START ) {
this.ingest.open(this.providerDesc);
} else if ( this.commInfo == ImAndWorkerCommunicationInfo.FINISH ) {
this.ingest.close(null);
} else if ( this.commInfo == ImAndWorkerCommunicationInfo.PAUSE ) {
this.ingest.pause();
} else {
throw new DbcException("Invalid command: " + this.commInfo);
}
} | void sendNotification() { if ( this.commInfo == ImAndWorkerCommunicationInfo.START ) { this.ingest.open(this.providerDesc); } else if ( this.commInfo == ImAndWorkerCommunicationInfo.FINISH ) { this.ingest.close(null); } else if ( this.commInfo == ImAndWorkerCommunicationInfo.PAUSE ) { this.ingest.pause(); } else { throw new DbcException(STR + this.commInfo); } } | /**
* send a notification to the ingestor. This is either a START or a PAUSE notification.<br>
* The method is used by the worker threads.
*/ | send a notification to the ingestor. This is either a START or a PAUSE notification. The method is used by the worker threads | sendNotification | {
"repo_name": "Deutsche-Digitale-Bibliothek/ddb-backend",
"path": "IngestMultiplexerServer/src/main/java/de/fhg/iais/cortex/im/worker/ImWorkerCommData.java",
"license": "apache-2.0",
"size": 8507
} | [
"de.fhg.iais.commons.dbc.DbcException"
] | import de.fhg.iais.commons.dbc.DbcException; | import de.fhg.iais.commons.dbc.*; | [
"de.fhg.iais"
] | de.fhg.iais; | 1,554,916 |
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux<FeatureResultInner> listAllAsync() {
return new PagedFlux<>(() -> listAllSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink));
} | @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux<FeatureResultInner> function() { return new PagedFlux<>(() -> listAllSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); } | /**
* Gets all the preview features that are available through AFEC for the subscription.
*
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return all the preview features that are available through AFEC for the subscription.
*/ | Gets all the preview features that are available through AFEC for the subscription | listAllAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/FeaturesClientImpl.java",
"license": "mit",
"size": 48107
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.PagedFlux",
"com.azure.resourcemanager.resources.fluent.models.FeatureResultInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedFlux; import com.azure.resourcemanager.resources.fluent.models.FeatureResultInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.resourcemanager.resources.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 1,029,506 |
VendorFragment fragment = new VendorFragment();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
} | VendorFragment fragment = new VendorFragment(); Bundle args = new Bundle(); args.putString(ARG_PARAM1, param1); args.putString(ARG_PARAM2, param2); fragment.setArguments(args); return fragment; } | /**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment VendorFragment.
*/ | Use this factory method to create a new instance of this fragment using the provided parameters | newInstance | {
"repo_name": "nh-gurunath/GESEventManager",
"path": "app/src/main/java/com/globaledgesoft/eventmanagerges/VendorFragment.java",
"license": "apache-2.0",
"size": 5728
} | [
"android.os.Bundle"
] | import android.os.Bundle; | import android.os.*; | [
"android.os"
] | android.os; | 552,394 |
public void setBusinessObjectService(BusinessObjectService businessObjectService) {
this.businessObjectService = businessObjectService;
} | void function(BusinessObjectService businessObjectService) { this.businessObjectService = businessObjectService; } | /**
* Set the Business Object Service.
* @param businessObjectService
*/ | Set the Business Object Service | setBusinessObjectService | {
"repo_name": "mukadder/kc",
"path": "coeus-impl/src/main/java/org/kuali/kra/iacuc/actions/submit/IacucProtocolSubmitActionServiceImpl.java",
"license": "agpl-3.0",
"size": 10603
} | [
"org.kuali.rice.krad.service.BusinessObjectService"
] | import org.kuali.rice.krad.service.BusinessObjectService; | import org.kuali.rice.krad.service.*; | [
"org.kuali.rice"
] | org.kuali.rice; | 2,821,139 |
Document post() throws IOException; | Document post() throws IOException; | /**
* Execute the request as a POST, 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 POST, and parse the result | post | {
"repo_name": "ngocbd/jsoup",
"path": "src/main/java/org/jsoup/Connection.java",
"license": "mit",
"size": 24127
} | [
"java.io.IOException",
"org.jsoup.nodes.Document"
] | import java.io.IOException; import org.jsoup.nodes.Document; | import java.io.*; import org.jsoup.nodes.*; | [
"java.io",
"org.jsoup.nodes"
] | java.io; org.jsoup.nodes; | 513,823 |
public static TypeInformation<Boolean> BOOLEAN() {
return org.apache.flink.api.common.typeinfo.Types.BOOLEAN;
} | static TypeInformation<Boolean> function() { return org.apache.flink.api.common.typeinfo.Types.BOOLEAN; } | /**
* Returns type information for a Table API boolean or SQL BOOLEAN type.
*/ | Returns type information for a Table API boolean or SQL BOOLEAN type | BOOLEAN | {
"repo_name": "shaoxuan-wang/flink",
"path": "flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Types.java",
"license": "apache-2.0",
"size": 9167
} | [
"org.apache.flink.api.common.typeinfo.TypeInformation"
] | import org.apache.flink.api.common.typeinfo.TypeInformation; | import org.apache.flink.api.common.typeinfo.*; | [
"org.apache.flink"
] | org.apache.flink; | 218,390 |
public void selectionChanged(JavaTextSelection selection) {
try {
setEnabled(RefactoringAvailabilityTester.isInlineMethodAvailable(selection));
} catch (JavaScriptModelException e) {
setEnabled(false);
}
}
| void function(JavaTextSelection selection) { try { setEnabled(RefactoringAvailabilityTester.isInlineMethodAvailable(selection)); } catch (JavaScriptModelException e) { setEnabled(false); } } | /**
* Note: This method is for internal use only. Clients should not call this method.
* @param selection
*/ | Note: This method is for internal use only. Clients should not call this method | selectionChanged | {
"repo_name": "boniatillo-com/PhaserEditor",
"path": "source/thirdparty/jsdt/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/actions/InlineMethodAction.java",
"license": "epl-1.0",
"size": 5921
} | [
"org.eclipse.wst.jsdt.core.JavaScriptModelException",
"org.eclipse.wst.jsdt.internal.corext.refactoring.RefactoringAvailabilityTester",
"org.eclipse.wst.jsdt.internal.ui.javaeditor.JavaTextSelection"
] | import org.eclipse.wst.jsdt.core.JavaScriptModelException; import org.eclipse.wst.jsdt.internal.corext.refactoring.RefactoringAvailabilityTester; import org.eclipse.wst.jsdt.internal.ui.javaeditor.JavaTextSelection; | import org.eclipse.wst.jsdt.core.*; import org.eclipse.wst.jsdt.internal.corext.refactoring.*; import org.eclipse.wst.jsdt.internal.ui.javaeditor.*; | [
"org.eclipse.wst"
] | org.eclipse.wst; | 1,782,044 |
@SuppressWarnings("rawtypes")
protected List getDeletionAwareUseTaxItems() {
List<PurApItemUseTax> deletionAwareUseTaxItems = new ArrayList<PurApItemUseTax>();
List<PurApItemBase> subManageList = this.getItems();
for (PurApItemBase subManage : subManageList) {
deletionAwareUseTaxItems.addAll(subManage.getUseTaxItems());
}
return deletionAwareUseTaxItems;
}
/**
* @see org.kuali.kfs.sys.document.AccountingDocumentBase#buildListOfDeletionAwareLists()
*
@Override
public List buildListOfDeletionAwareLists() {
List managedLists = new ArrayList();
if (allowDeleteAwareCollection) {
List<PurApAccountingLine> purapAccountsList = new ArrayList<PurApAccountingLine>();
for (Object itemAsObject : this.getItems()) {
final PurApItem item = (PurApItem)itemAsObject;
purapAccountsList.addAll(item.getSourceAccountingLines());
}
managedLists.add(purapAccountsList);
managedLists.add(this.getItems());
}
return managedLists;
}
| @SuppressWarnings(STR) List function() { List<PurApItemUseTax> deletionAwareUseTaxItems = new ArrayList<PurApItemUseTax>(); List<PurApItemBase> subManageList = this.getItems(); for (PurApItemBase subManage : subManageList) { deletionAwareUseTaxItems.addAll(subManage.getUseTaxItems()); } return deletionAwareUseTaxItems; } /** * @see org.kuali.kfs.sys.document.AccountingDocumentBase#buildListOfDeletionAwareLists() * public List buildListOfDeletionAwareLists() { List managedLists = new ArrayList(); if (allowDeleteAwareCollection) { List<PurApAccountingLine> purapAccountsList = new ArrayList<PurApAccountingLine>(); for (Object itemAsObject : this.getItems()) { final PurApItem item = (PurApItem)itemAsObject; purapAccountsList.addAll(item.getSourceAccountingLines()); } managedLists.add(purapAccountsList); managedLists.add(this.getItems()); } return managedLists; } | /**
* Build deletion list of use tax items for PurAp generic use.
*
* @return
*/ | Build deletion list of use tax items for PurAp generic use | getDeletionAwareUseTaxItems | {
"repo_name": "ua-eas/ua-kfs-5.3",
"path": "work/src/org/kuali/kfs/module/purap/document/PurchasingAccountsPayableDocumentBase.java",
"license": "agpl-3.0",
"size": 53766
} | [
"java.util.ArrayList",
"java.util.List",
"org.kuali.kfs.module.purap.businessobject.PurApAccountingLine",
"org.kuali.kfs.module.purap.businessobject.PurApItem",
"org.kuali.kfs.module.purap.businessobject.PurApItemBase",
"org.kuali.kfs.module.purap.businessobject.PurApItemUseTax",
"org.kuali.kfs.sys.docu... | import java.util.ArrayList; import java.util.List; import org.kuali.kfs.module.purap.businessobject.PurApAccountingLine; import org.kuali.kfs.module.purap.businessobject.PurApItem; import org.kuali.kfs.module.purap.businessobject.PurApItemBase; import org.kuali.kfs.module.purap.businessobject.PurApItemUseTax; import org.kuali.kfs.sys.document.AccountingDocumentBase; | import java.util.*; import org.kuali.kfs.module.purap.businessobject.*; import org.kuali.kfs.sys.document.*; | [
"java.util",
"org.kuali.kfs"
] | java.util; org.kuali.kfs; | 1,018,437 |
private void cmd_archive ()
{
boolean success = false;
byte[] data = Document.getPDFAsArray(m_reportEngine.getLayout().getPageable(false)); // No Copy
if (data != null)
{
MArchive archive = new MArchive (Env.getCtx(), m_reportEngine.getPrintInfo(), null);
archive.setBinaryData(data);
success = archive.save();
}
if (success)
ADialog.info(m_WindowNo, this, "Archived");
else
ADialog.error(m_WindowNo, this, "ArchiveError");
} // cmd_archive
| void function () { boolean success = false; byte[] data = Document.getPDFAsArray(m_reportEngine.getLayout().getPageable(false)); if (data != null) { MArchive archive = new MArchive (Env.getCtx(), m_reportEngine.getPrintInfo(), null); archive.setBinaryData(data); success = archive.save(); } if (success) ADialog.info(m_WindowNo, this, STR); else ADialog.error(m_WindowNo, this, STR); } | /**
* Archive Report directly
*/ | Archive Report directly | cmd_archive | {
"repo_name": "armenrz/adempiere",
"path": "client/src/org/compiere/print/Viewer.java",
"license": "gpl-2.0",
"size": 45716
} | [
"org.adempiere.pdf.Document",
"org.compiere.apps.ADialog",
"org.compiere.model.MArchive",
"org.compiere.util.Env"
] | import org.adempiere.pdf.Document; import org.compiere.apps.ADialog; import org.compiere.model.MArchive; import org.compiere.util.Env; | import org.adempiere.pdf.*; import org.compiere.apps.*; import org.compiere.model.*; import org.compiere.util.*; | [
"org.adempiere.pdf",
"org.compiere.apps",
"org.compiere.model",
"org.compiere.util"
] | org.adempiere.pdf; org.compiere.apps; org.compiere.model; org.compiere.util; | 199,009 |
public DataSet reverse() {
if (sort == null) {
throw new GroovyRuntimeException("reverse() only allowed immediately after a sort()");
}
return new DataSet(this);
} | DataSet function() { if (sort == null) { throw new GroovyRuntimeException(STR); } return new DataSet(this); } | /**
* Return a lazy-implemented reverse-ordered view of this DataSet.
*
* @return the view DataSet
*/ | Return a lazy-implemented reverse-ordered view of this DataSet | reverse | {
"repo_name": "avafanasiev/groovy",
"path": "subprojects/groovy-sql/src/main/java/groovy/sql/DataSet.java",
"license": "apache-2.0",
"size": 17977
} | [
"groovy.lang.GroovyRuntimeException"
] | import groovy.lang.GroovyRuntimeException; | import groovy.lang.*; | [
"groovy.lang"
] | groovy.lang; | 1,057,703 |
@Test
public void testCorruptedData() throws Exception {
LongStateStorage stateStorage = new LongStateStorage();
ZooKeeperStateHandleStore<Long> store = new ZooKeeperStateHandleStore<>(
ZooKeeper.getClient(),
stateStorage,
Executors.directExecutor());
final Collection<Long> input = new HashSet<>();
input.add(1L);
input.add(2L);
input.add(3L);
for (Long aLong : input) {
store.add("/" + aLong, aLong);
}
// corrupt one of the entries
ZooKeeper.getClient().setData().forPath("/" + 2, new byte[2]);
List<Tuple2<RetrievableStateHandle<Long>, String>> allEntries = store.getAll();
Collection<Long> expected = new HashSet<>(input);
expected.remove(2L);
Collection<Long> actual = new HashSet<>(expected.size());
for (Tuple2<RetrievableStateHandle<Long>, String> entry : allEntries) {
actual.add(entry.f0.retrieveState());
}
assertEquals(expected, actual);
// check the same for the all sorted by name call
allEntries = store.getAllSortedByName();
actual.clear();
for (Tuple2<RetrievableStateHandle<Long>, String> entry : allEntries) {
actual.add(entry.f0.retrieveState());
}
assertEquals(expected, actual);
}
// ---------------------------------------------------------------------------------------------
// Simple test helpers
// ---------------------------------------------------------------------------------------------
private static class LongStateStorage implements RetrievableStateStorageHelper<Long> {
private final List<LongRetrievableStateHandle> stateHandles = new ArrayList<>(); | void function() throws Exception { LongStateStorage stateStorage = new LongStateStorage(); ZooKeeperStateHandleStore<Long> store = new ZooKeeperStateHandleStore<>( ZooKeeper.getClient(), stateStorage, Executors.directExecutor()); final Collection<Long> input = new HashSet<>(); input.add(1L); input.add(2L); input.add(3L); for (Long aLong : input) { store.add("/" + aLong, aLong); } ZooKeeper.getClient().setData().forPath("/" + 2, new byte[2]); List<Tuple2<RetrievableStateHandle<Long>, String>> allEntries = store.getAll(); Collection<Long> expected = new HashSet<>(input); expected.remove(2L); Collection<Long> actual = new HashSet<>(expected.size()); for (Tuple2<RetrievableStateHandle<Long>, String> entry : allEntries) { actual.add(entry.f0.retrieveState()); } assertEquals(expected, actual); allEntries = store.getAllSortedByName(); actual.clear(); for (Tuple2<RetrievableStateHandle<Long>, String> entry : allEntries) { actual.add(entry.f0.retrieveState()); } assertEquals(expected, actual); } private static class LongStateStorage implements RetrievableStateStorageHelper<Long> { private final List<LongRetrievableStateHandle> stateHandles = new ArrayList<>(); | /**
* Tests that the ZooKeeperStateHandleStore can handle corrupted data by ignoring the respective
* ZooKeeper ZNodes.
*/ | Tests that the ZooKeeperStateHandleStore can handle corrupted data by ignoring the respective ZooKeeper ZNodes | testCorruptedData | {
"repo_name": "DieBauer/flink",
"path": "flink-runtime/src/test/java/org/apache/flink/runtime/zookeeper/ZooKeeperStateHandleStoreITCase.java",
"license": "apache-2.0",
"size": 19399
} | [
"java.util.ArrayList",
"java.util.Collection",
"java.util.HashSet",
"java.util.List",
"org.apache.flink.api.java.tuple.Tuple2",
"org.apache.flink.runtime.concurrent.Executors",
"org.apache.flink.runtime.state.RetrievableStateHandle",
"org.junit.Assert"
] | import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.List; import org.apache.flink.api.java.tuple.Tuple2; import org.apache.flink.runtime.concurrent.Executors; import org.apache.flink.runtime.state.RetrievableStateHandle; import org.junit.Assert; | import java.util.*; import org.apache.flink.api.java.tuple.*; import org.apache.flink.runtime.concurrent.*; import org.apache.flink.runtime.state.*; import org.junit.*; | [
"java.util",
"org.apache.flink",
"org.junit"
] | java.util; org.apache.flink; org.junit; | 1,357,511 |
@Override
public SubscriptionGetResponse get() throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException {
// Validate
// Tracing
boolean shouldTrace = CloudTracing.getIsEnabled();
String invocationId = null;
if (shouldTrace) {
invocationId = Long.toString(CloudTracing.getNextInvocationId());
HashMap<String, Object> tracingParameters = new HashMap<String, Object>();
CloudTracing.enter(invocationId, this, "getAsync", tracingParameters);
}
// Construct URL
String url = "/" + (this.getClient().getCredentials().getSubscriptionId() != null ? this.getClient().getCredentials().getSubscriptionId().trim() : "");
String baseUrl = this.getClient().getBaseUri().toString();
// Trim '/' character from the end of baseUrl and beginning of url.
if (baseUrl.charAt(baseUrl.length() - 1) == '/') {
baseUrl = baseUrl.substring(0, (baseUrl.length() - 1) + 0);
}
if (url.charAt(0) == '/') {
url = url.substring(1);
}
url = baseUrl + "/" + url;
url = url.replace(" ", "%20");
// Create HTTP transport objects
HttpGet httpRequest = new HttpGet(url);
// Set Headers
httpRequest.setHeader("x-ms-version", "2014-10-01");
// Send Request
HttpResponse httpResponse = null;
try {
if (shouldTrace) {
CloudTracing.sendRequest(invocationId, httpRequest);
}
httpResponse = this.getClient().getHttpClient().execute(httpRequest);
if (shouldTrace) {
CloudTracing.receiveResponse(invocationId, httpResponse);
}
int statusCode = httpResponse.getStatusLine().getStatusCode();
if (statusCode != HttpStatus.SC_OK) {
ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity());
if (shouldTrace) {
CloudTracing.error(invocationId, ex);
}
throw ex;
}
// Create Result
SubscriptionGetResponse result = null;
// Deserialize Response
InputStream responseContent = httpResponse.getEntity().getContent();
result = new SubscriptionGetResponse();
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
documentBuilderFactory.setNamespaceAware(true);
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
Document responseDoc = documentBuilder.parse(new BOMInputStream(responseContent));
Element subscriptionElement = XmlUtility.getElementByTagNameNS(responseDoc, "http://schemas.microsoft.com/windowsazure", "Subscription");
if (subscriptionElement != null) {
Element subscriptionIDElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "SubscriptionID");
if (subscriptionIDElement != null) {
String subscriptionIDInstance;
subscriptionIDInstance = subscriptionIDElement.getTextContent();
result.setSubscriptionID(subscriptionIDInstance);
}
Element subscriptionNameElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "SubscriptionName");
if (subscriptionNameElement != null) {
String subscriptionNameInstance;
subscriptionNameInstance = subscriptionNameElement.getTextContent();
result.setSubscriptionName(subscriptionNameInstance);
}
Element subscriptionStatusElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "SubscriptionStatus");
if (subscriptionStatusElement != null) {
SubscriptionStatus subscriptionStatusInstance;
subscriptionStatusInstance = SubscriptionStatus.valueOf(subscriptionStatusElement.getTextContent());
result.setSubscriptionStatus(subscriptionStatusInstance);
}
Element accountAdminLiveEmailIdElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "AccountAdminLiveEmailId");
if (accountAdminLiveEmailIdElement != null) {
String accountAdminLiveEmailIdInstance;
accountAdminLiveEmailIdInstance = accountAdminLiveEmailIdElement.getTextContent();
result.setAccountAdminLiveEmailId(accountAdminLiveEmailIdInstance);
}
Element serviceAdminLiveEmailIdElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "ServiceAdminLiveEmailId");
if (serviceAdminLiveEmailIdElement != null) {
String serviceAdminLiveEmailIdInstance;
serviceAdminLiveEmailIdInstance = serviceAdminLiveEmailIdElement.getTextContent();
result.setServiceAdminLiveEmailId(serviceAdminLiveEmailIdInstance);
}
Element maxCoreCountElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "MaxCoreCount");
if (maxCoreCountElement != null) {
int maxCoreCountInstance;
maxCoreCountInstance = DatatypeConverter.parseInt(maxCoreCountElement.getTextContent());
result.setMaximumCoreCount(maxCoreCountInstance);
}
Element maxStorageAccountsElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "MaxStorageAccounts");
if (maxStorageAccountsElement != null) {
int maxStorageAccountsInstance;
maxStorageAccountsInstance = DatatypeConverter.parseInt(maxStorageAccountsElement.getTextContent());
result.setMaximumStorageAccounts(maxStorageAccountsInstance);
}
Element maxHostedServicesElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "MaxHostedServices");
if (maxHostedServicesElement != null) {
int maxHostedServicesInstance;
maxHostedServicesInstance = DatatypeConverter.parseInt(maxHostedServicesElement.getTextContent());
result.setMaximumHostedServices(maxHostedServicesInstance);
}
Element currentCoreCountElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "CurrentCoreCount");
if (currentCoreCountElement != null) {
int currentCoreCountInstance;
currentCoreCountInstance = DatatypeConverter.parseInt(currentCoreCountElement.getTextContent());
result.setCurrentCoreCount(currentCoreCountInstance);
}
Element currentStorageAccountsElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "CurrentStorageAccounts");
if (currentStorageAccountsElement != null) {
int currentStorageAccountsInstance;
currentStorageAccountsInstance = DatatypeConverter.parseInt(currentStorageAccountsElement.getTextContent());
result.setCurrentStorageAccounts(currentStorageAccountsInstance);
}
Element currentHostedServicesElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "CurrentHostedServices");
if (currentHostedServicesElement != null) {
int currentHostedServicesInstance;
currentHostedServicesInstance = DatatypeConverter.parseInt(currentHostedServicesElement.getTextContent());
result.setCurrentHostedServices(currentHostedServicesInstance);
}
Element maxVirtualNetworkSitesElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "MaxVirtualNetworkSites");
if (maxVirtualNetworkSitesElement != null) {
int maxVirtualNetworkSitesInstance;
maxVirtualNetworkSitesInstance = DatatypeConverter.parseInt(maxVirtualNetworkSitesElement.getTextContent());
result.setMaximumVirtualNetworkSites(maxVirtualNetworkSitesInstance);
}
Element currentVirtualNetworkSitesElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "CurrentVirtualNetworkSites");
if (currentVirtualNetworkSitesElement != null) {
int currentVirtualNetworkSitesInstance;
currentVirtualNetworkSitesInstance = DatatypeConverter.parseInt(currentVirtualNetworkSitesElement.getTextContent());
result.setCurrentVirtualNetworkSites(currentVirtualNetworkSitesInstance);
}
Element maxLocalNetworkSitesElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "MaxLocalNetworkSites");
if (maxLocalNetworkSitesElement != null) {
int maxLocalNetworkSitesInstance;
maxLocalNetworkSitesInstance = DatatypeConverter.parseInt(maxLocalNetworkSitesElement.getTextContent());
result.setMaximumLocalNetworkSites(maxLocalNetworkSitesInstance);
}
Element maxDnsServersElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "MaxDnsServers");
if (maxDnsServersElement != null) {
int maxDnsServersInstance;
maxDnsServersInstance = DatatypeConverter.parseInt(maxDnsServersElement.getTextContent());
result.setMaximumDnsServers(maxDnsServersInstance);
}
Element currentLocalNetworkSitesElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "CurrentLocalNetworkSites");
if (currentLocalNetworkSitesElement != null) {
int currentLocalNetworkSitesInstance;
currentLocalNetworkSitesInstance = DatatypeConverter.parseInt(currentLocalNetworkSitesElement.getTextContent());
result.setCurrentLocalNetworkSites(currentLocalNetworkSitesInstance);
}
Element currentDnsServersElement = XmlUtility.getElementByTagNameNS(subscriptionElement, "http://schemas.microsoft.com/windowsazure", "CurrentDnsServers");
if (currentDnsServersElement != null) {
int currentDnsServersInstance;
currentDnsServersInstance = DatatypeConverter.parseInt(currentDnsServersElement.getTextContent());
result.setCurrentDnsServers(currentDnsServersInstance);
}
}
result.setStatusCode(statusCode);
if (httpResponse.getHeaders("x-ms-request-id").length > 0) {
result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue());
}
if (shouldTrace) {
CloudTracing.exit(invocationId, result);
}
return result;
} finally {
if (httpResponse != null && httpResponse.getEntity() != null) {
httpResponse.getEntity().getContent().close();
}
}
} | SubscriptionGetResponse function() throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException { boolean shouldTrace = CloudTracing.getIsEnabled(); String invocationId = null; if (shouldTrace) { invocationId = Long.toString(CloudTracing.getNextInvocationId()); HashMap<String, Object> tracingParameters = new HashMap<String, Object>(); CloudTracing.enter(invocationId, this, STR, tracingParameters); } String url = "/" + (this.getClient().getCredentials().getSubscriptionId() != null ? this.getClient().getCredentials().getSubscriptionId().trim() : STR/STR STR%20STRx-ms-versionSTR2014-10-01STRhttp: if (subscriptionElement != null) { Element subscriptionIDElement = XmlUtility.getElementByTagNameNS(subscriptionElement, STRhttp: if (subscriptionNameElement != null) { String subscriptionNameInstance; subscriptionNameInstance = subscriptionNameElement.getTextContent(); result.setSubscriptionName(subscriptionNameInstance); } Element subscriptionStatusElement = XmlUtility.getElementByTagNameNS(subscriptionElement, STRhttp: if (accountAdminLiveEmailIdElement != null) { String accountAdminLiveEmailIdInstance; accountAdminLiveEmailIdInstance = accountAdminLiveEmailIdElement.getTextContent(); result.setAccountAdminLiveEmailId(accountAdminLiveEmailIdInstance); } Element serviceAdminLiveEmailIdElement = XmlUtility.getElementByTagNameNS(subscriptionElement, STRhttp: if (maxCoreCountElement != null) { int maxCoreCountInstance; maxCoreCountInstance = DatatypeConverter.parseInt(maxCoreCountElement.getTextContent()); result.setMaximumCoreCount(maxCoreCountInstance); } Element maxStorageAccountsElement = XmlUtility.getElementByTagNameNS(subscriptionElement, STRhttp: if (maxHostedServicesElement != null) { int maxHostedServicesInstance; maxHostedServicesInstance = DatatypeConverter.parseInt(maxHostedServicesElement.getTextContent()); result.setMaximumHostedServices(maxHostedServicesInstance); } Element currentCoreCountElement = XmlUtility.getElementByTagNameNS(subscriptionElement, STRhttp: if (currentStorageAccountsElement != null) { int currentStorageAccountsInstance; currentStorageAccountsInstance = DatatypeConverter.parseInt(currentStorageAccountsElement.getTextContent()); result.setCurrentStorageAccounts(currentStorageAccountsInstance); } Element currentHostedServicesElement = XmlUtility.getElementByTagNameNS(subscriptionElement, STRhttp: if (maxVirtualNetworkSitesElement != null) { int maxVirtualNetworkSitesInstance; maxVirtualNetworkSitesInstance = DatatypeConverter.parseInt(maxVirtualNetworkSitesElement.getTextContent()); result.setMaximumVirtualNetworkSites(maxVirtualNetworkSitesInstance); } Element currentVirtualNetworkSitesElement = XmlUtility.getElementByTagNameNS(subscriptionElement, STRhttp: if (maxLocalNetworkSitesElement != null) { int maxLocalNetworkSitesInstance; maxLocalNetworkSitesInstance = DatatypeConverter.parseInt(maxLocalNetworkSitesElement.getTextContent()); result.setMaximumLocalNetworkSites(maxLocalNetworkSitesInstance); } Element maxDnsServersElement = XmlUtility.getElementByTagNameNS(subscriptionElement, STRhttp: if (currentLocalNetworkSitesElement != null) { int currentLocalNetworkSitesInstance; currentLocalNetworkSitesInstance = DatatypeConverter.parseInt(currentLocalNetworkSitesElement.getTextContent()); result.setCurrentLocalNetworkSites(currentLocalNetworkSitesInstance); } Element currentDnsServersElement = XmlUtility.getElementByTagNameNS(subscriptionElement, STRx-ms-request-idSTRx-ms-request-id").getValue()); } if (shouldTrace) { CloudTracing.exit(invocationId, result); } return result; } finally { if (httpResponse != null && httpResponse.getEntity() != null) { httpResponse.getEntity().getContent().close(); } } } | /**
* The Get Subscription operation returns account and resource allocation
* information for the specified subscription. (see
* http://msdn.microsoft.com/en-us/library/windowsazure/hh403995.aspx for
* more information)
*
* @throws IOException Signals that an I/O exception of some sort has
* occurred. This class is the general class of exceptions produced by
* failed or interrupted I/O operations.
* @throws ServiceException Thrown if an unexpected response is found.
* @throws ParserConfigurationException Thrown if there was a serious
* configuration error with the document parser.
* @throws SAXException Thrown if there was an error parsing the XML
* response.
* @throws URISyntaxException Thrown if there was an error parsing a URI in
* the response.
* @return The Get Subscription operation response.
*/ | The Get Subscription operation returns account and resource allocation information for the specified subscription. (see HREF for more information) | get | {
"repo_name": "manikandan-palaniappan/azure-sdk-for-java",
"path": "management/src/main/java/com/microsoft/windowsazure/management/SubscriptionOperationsImpl.java",
"license": "apache-2.0",
"size": 42813
} | [
"com.microsoft.windowsazure.core.utils.XmlUtility",
"com.microsoft.windowsazure.exception.ServiceException",
"com.microsoft.windowsazure.management.models.SubscriptionGetResponse",
"com.microsoft.windowsazure.tracing.CloudTracing",
"java.io.IOException",
"java.net.URISyntaxException",
"java.util.HashMap... | import com.microsoft.windowsazure.core.utils.XmlUtility; import com.microsoft.windowsazure.exception.ServiceException; import com.microsoft.windowsazure.management.models.SubscriptionGetResponse; import com.microsoft.windowsazure.tracing.CloudTracing; import java.io.IOException; import java.net.URISyntaxException; import java.util.HashMap; import javax.xml.bind.DatatypeConverter; import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Element; import org.xml.sax.SAXException; | import com.microsoft.windowsazure.core.utils.*; import com.microsoft.windowsazure.exception.*; import com.microsoft.windowsazure.management.models.*; import com.microsoft.windowsazure.tracing.*; import java.io.*; import java.net.*; import java.util.*; import javax.xml.bind.*; import javax.xml.parsers.*; import org.w3c.dom.*; import org.xml.sax.*; | [
"com.microsoft.windowsazure",
"java.io",
"java.net",
"java.util",
"javax.xml",
"org.w3c.dom",
"org.xml.sax"
] | com.microsoft.windowsazure; java.io; java.net; java.util; javax.xml; org.w3c.dom; org.xml.sax; | 1,413,344 |
public void scrollToRow(int rowIndex, ScrollDestination destination)
throws IllegalArgumentException {
scrollToRow(rowIndex, destination,
destination == ScrollDestination.MIDDLE ? 0
: GridConstants.DEFAULT_PADDING);
}
/**
* Scrolls to a certain row using only user-specified parameters.
* <p>
* If the details for that row are visible, those will be taken into account
* as well.
*
* @param rowIndex
* zero-based index of the row to scroll to.
* @param destination
* desired destination placement of scrolled-to-row. See
* {@link ScrollDestination} for more information.
* @param paddingPx
* number of pixels to overscroll. Behavior depends on
* destination.
* @throws IllegalArgumentException
* if {@code destination} is {@link ScrollDestination#MIDDLE} | void function(int rowIndex, ScrollDestination destination) throws IllegalArgumentException { scrollToRow(rowIndex, destination, destination == ScrollDestination.MIDDLE ? 0 : GridConstants.DEFAULT_PADDING); } /** * Scrolls to a certain row using only user-specified parameters. * <p> * If the details for that row are visible, those will be taken into account * as well. * * @param rowIndex * zero-based index of the row to scroll to. * @param destination * desired destination placement of scrolled-to-row. See * {@link ScrollDestination} for more information. * @param paddingPx * number of pixels to overscroll. Behavior depends on * destination. * @throws IllegalArgumentException * if {@code destination} is {@link ScrollDestination#MIDDLE} | /**
* Scrolls to a certain row, using user-specified scroll destination.
* <p>
* If the details for that row are visible, those will be taken into account
* as well.
*
* @param rowIndex
* zero-based index of the row to scroll to.
* @param destination
* desired destination placement of scrolled-to-row. See
* {@link ScrollDestination} for more information.
* @throws IllegalArgumentException
* if rowIndex is below zero, or above the maximum value
* supported by the data source.
*/ | Scrolls to a certain row, using user-specified scroll destination. If the details for that row are visible, those will be taken into account as well | scrollToRow | {
"repo_name": "peterl1084/framework",
"path": "client/src/main/java/com/vaadin/client/widgets/Grid.java",
"license": "apache-2.0",
"size": 332371
} | [
"com.vaadin.shared.ui.grid.GridConstants",
"com.vaadin.shared.ui.grid.ScrollDestination"
] | import com.vaadin.shared.ui.grid.GridConstants; import com.vaadin.shared.ui.grid.ScrollDestination; | import com.vaadin.shared.ui.grid.*; | [
"com.vaadin.shared"
] | com.vaadin.shared; | 1,349,306 |
@Override
protected final void renderGame(final GameContainer container, final StateBasedGame game, final Graphics g) {
g.clear();
}
| final void function(final GameContainer container, final StateBasedGame game, final Graphics g) { g.clear(); } | /**
* Rendering the GUI only requires that the display is cleared before rendering the screen.
*/ | Rendering the GUI only requires that the display is cleared before rendering the screen | renderGame | {
"repo_name": "xranby/nifty-gui",
"path": "nifty-renderer-slick/src/main/java/de/lessvoid/nifty/slick2d/NiftyGameState.java",
"license": "bsd-2-clause",
"size": 2386
} | [
"org.newdawn.slick.GameContainer",
"org.newdawn.slick.Graphics",
"org.newdawn.slick.state.StateBasedGame"
] | import org.newdawn.slick.GameContainer; import org.newdawn.slick.Graphics; import org.newdawn.slick.state.StateBasedGame; | import org.newdawn.slick.*; import org.newdawn.slick.state.*; | [
"org.newdawn.slick"
] | org.newdawn.slick; | 572,147 |
public ParticleSystem addModifier(ParticleModifier modifier) {
mModifiers.add(modifier);
return this;
} | ParticleSystem function(ParticleModifier modifier) { mModifiers.add(modifier); return this; } | /**
* Adds a modifier to the Particle system, it will be executed on each update.
*
* @param modifier modifier to be added to the ParticleSystem
*/ | Adds a modifier to the Particle system, it will be executed on each update | addModifier | {
"repo_name": "DanDits/WhatsThat",
"path": "leonidlib/src/main/java/com/plattysoft/leonids/ParticleSystem.java",
"license": "apache-2.0",
"size": 25060
} | [
"com.plattysoft.leonids.modifiers.ParticleModifier"
] | import com.plattysoft.leonids.modifiers.ParticleModifier; | import com.plattysoft.leonids.modifiers.*; | [
"com.plattysoft.leonids"
] | com.plattysoft.leonids; | 1,221,692 |
@SuppressWarnings("unchecked")
public List<Commander> listByPositionNation(final Position thisPosition, final Nation nation) {
final Session session = getSessionFactory().getCurrentSession();
final Criteria criteria = session.createCriteria(Commander.class);
criteria.add(Restrictions.eq("nation", nation));
if (thisPosition.getGame() == null) {
criteria.add(Restrictions.isNull("position.game"));
} else {
criteria.add(Restrictions.eq("position.game", thisPosition.getGame()));
}
criteria.add(Restrictions.eq("position.region", thisPosition.getRegion()));
criteria.add(Restrictions.eq("position.x", thisPosition.getX()));
criteria.add(Restrictions.eq("position.y", thisPosition.getY()));
criteria.addOrder(Order.asc("intId"));
return criteria.list();
} | @SuppressWarnings(STR) List<Commander> function(final Position thisPosition, final Nation nation) { final Session session = getSessionFactory().getCurrentSession(); final Criteria criteria = session.createCriteria(Commander.class); criteria.add(Restrictions.eq(STR, nation)); if (thisPosition.getGame() == null) { criteria.add(Restrictions.isNull(STR)); } else { criteria.add(Restrictions.eq(STR, thisPosition.getGame())); } criteria.add(Restrictions.eq(STR, thisPosition.getRegion())); criteria.add(Restrictions.eq(STR, thisPosition.getX())); criteria.add(Restrictions.eq(STR, thisPosition.getY())); criteria.addOrder(Order.asc("intId")); return criteria.list(); } | /**
* Listing all the Commanders from the database at the specific position owned by the specific nation.
*
* @param thisPosition the position to select.
* @param nation the nation to select.
* @return a list of all the Commanders.
*/ | Listing all the Commanders from the database at the specific position owned by the specific nation | listByPositionNation | {
"repo_name": "EaW1805/data",
"path": "src/main/java/com/eaw1805/data/managers/army/CommanderManager.java",
"license": "mit",
"size": 10549
} | [
"com.eaw1805.data.model.Nation",
"com.eaw1805.data.model.army.Commander",
"com.eaw1805.data.model.map.Position",
"java.util.List",
"org.hibernate.Criteria",
"org.hibernate.Session",
"org.hibernate.criterion.Order",
"org.hibernate.criterion.Restrictions"
] | import com.eaw1805.data.model.Nation; import com.eaw1805.data.model.army.Commander; import com.eaw1805.data.model.map.Position; import java.util.List; import org.hibernate.Criteria; import org.hibernate.Session; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; | import com.eaw1805.data.model.*; import com.eaw1805.data.model.army.*; import com.eaw1805.data.model.map.*; import java.util.*; import org.hibernate.*; import org.hibernate.criterion.*; | [
"com.eaw1805.data",
"java.util",
"org.hibernate",
"org.hibernate.criterion"
] | com.eaw1805.data; java.util; org.hibernate; org.hibernate.criterion; | 1,556,379 |
public NestedSet<LinkerInput> getTransitiveCcNativeLibraries() {
return transitiveCcNativeLibraries;
} | NestedSet<LinkerInput> function() { return transitiveCcNativeLibraries; } | /**
* Collects native libraries in the transitive closure of its deps that are needed for executing
* C/C++ code.
*
* <p>In effect, returns all dynamic library (.so) artifacts provided by the transitive closure.
*/ | Collects native libraries in the transitive closure of its deps that are needed for executing C/C++ code. In effect, returns all dynamic library (.so) artifacts provided by the transitive closure | getTransitiveCcNativeLibraries | {
"repo_name": "dropbox/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/cpp/CcNativeLibraryProvider.java",
"license": "apache-2.0",
"size": 1763
} | [
"com.google.devtools.build.lib.collect.nestedset.NestedSet"
] | import com.google.devtools.build.lib.collect.nestedset.NestedSet; | import com.google.devtools.build.lib.collect.nestedset.*; | [
"com.google.devtools"
] | com.google.devtools; | 1,911,550 |
@Test
public void updateProductTest() {
ProductEntity entity = data.get(0);
ProductEntity pojoEntity = factory.manufacturePojo(ProductEntity.class);
pojoEntity.setId(entity.getId());
productLogic.updateProduct(pojoEntity);
ProductEntity resp = em.find(ProductEntity.class, entity.getId());
Assert.assertEquals(pojoEntity.getId(), resp.getId());
Assert.assertEquals(pojoEntity.getName(), resp.getName());
Assert.assertEquals(pojoEntity.getPrice(), resp.getPrice());
} | void function() { ProductEntity entity = data.get(0); ProductEntity pojoEntity = factory.manufacturePojo(ProductEntity.class); pojoEntity.setId(entity.getId()); productLogic.updateProduct(pojoEntity); ProductEntity resp = em.find(ProductEntity.class, entity.getId()); Assert.assertEquals(pojoEntity.getId(), resp.getId()); Assert.assertEquals(pojoEntity.getName(), resp.getName()); Assert.assertEquals(pojoEntity.getPrice(), resp.getPrice()); } | /**
* Prueba para actualizar un Product
*
* @generated
*/ | Prueba para actualizar un Product | updateProductTest | {
"repo_name": "Uniandes-MISO4203/artwork-201620-2",
"path": "artwork-logic/src/test/java/co/edu/uniandes/csw/artwork/test/logic/ProductLogicTest.java",
"license": "mit",
"size": 6820
} | [
"co.edu.uniandes.csw.artwork.entities.ProductEntity",
"org.junit.Assert"
] | import co.edu.uniandes.csw.artwork.entities.ProductEntity; import org.junit.Assert; | import co.edu.uniandes.csw.artwork.entities.*; import org.junit.*; | [
"co.edu.uniandes",
"org.junit"
] | co.edu.uniandes; org.junit; | 806,868 |
Player player = Bukkit.getPlayer(uuid);
World world = ((CraftWorld) player.getWorld()).getHandle();
EnderCrystal enderCrystal = new EnderCrystal(world, EnumEntityType.BUFF);
Block b = Bukkit.getWorlds().get(0).getHighestBlockAt((int) player.getLocation().getX(), (int) player.getLocation().getZ());
if (b.getLocation().distanceSquared(player.getLocation()) < 25) {
enderCrystal.setLocation(b.getX(), b.getY(), b.getZ(), 0, 0);
world.addEntity(enderCrystal, CreatureSpawnEvent.SpawnReason.CUSTOM);
enderCrystal.setLocation(b.getX(), b.getY(), b.getZ(), 0, 0);
} else {
enderCrystal.setLocation(player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getZ(), 0, 0);
world.addEntity(enderCrystal, CreatureSpawnEvent.SpawnReason.CUSTOM);
enderCrystal.setLocation(player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getZ(), 0, 0);
}
player.playSound(player.getLocation(), Sound.ENTITY_ENDERDRAGON_FLAP, 1f, 63f);
MetadataUtils.registerBuffMetadata(enderCrystal, getRandomPotionEffect(), 10, 600);
return enderCrystal;
} | Player player = Bukkit.getPlayer(uuid); World world = ((CraftWorld) player.getWorld()).getHandle(); EnderCrystal enderCrystal = new EnderCrystal(world, EnumEntityType.BUFF); Block b = Bukkit.getWorlds().get(0).getHighestBlockAt((int) player.getLocation().getX(), (int) player.getLocation().getZ()); if (b.getLocation().distanceSquared(player.getLocation()) < 25) { enderCrystal.setLocation(b.getX(), b.getY(), b.getZ(), 0, 0); world.addEntity(enderCrystal, CreatureSpawnEvent.SpawnReason.CUSTOM); enderCrystal.setLocation(b.getX(), b.getY(), b.getZ(), 0, 0); } else { enderCrystal.setLocation(player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getZ(), 0, 0); world.addEntity(enderCrystal, CreatureSpawnEvent.SpawnReason.CUSTOM); enderCrystal.setLocation(player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getZ(), 0, 0); } player.playSound(player.getLocation(), Sound.ENTITY_ENDERDRAGON_FLAP, 1f, 63f); MetadataUtils.registerBuffMetadata(enderCrystal, getRandomPotionEffect(), 10, 600); return enderCrystal; } | /**
* Adds the buff to a Endercrystal entity, takes a player UUID.
*
* @param uuid
* @since 1.0
*/ | Adds the buff to a Endercrystal entity, takes a player UUID | spawnBuff | {
"repo_name": "TheSecretLife/DR-API",
"path": "game/src/main/java/net/dungeonrealms/game/world/entity/util/BuffUtils.java",
"license": "gpl-3.0",
"size": 5766
} | [
"net.dungeonrealms.game.mastery.MetadataUtils",
"net.dungeonrealms.game.world.entity.EnumEntityType",
"net.dungeonrealms.game.world.entity.type.EnderCrystal",
"net.minecraft.server.v1_9_R2.World",
"org.bukkit.Bukkit",
"org.bukkit.Sound",
"org.bukkit.block.Block",
"org.bukkit.craftbukkit.v1_9_R2.CraftW... | import net.dungeonrealms.game.mastery.MetadataUtils; import net.dungeonrealms.game.world.entity.EnumEntityType; import net.dungeonrealms.game.world.entity.type.EnderCrystal; import net.minecraft.server.v1_9_R2.World; import org.bukkit.Bukkit; import org.bukkit.Sound; import org.bukkit.block.Block; import org.bukkit.craftbukkit.v1_9_R2.CraftWorld; import org.bukkit.entity.Player; import org.bukkit.event.entity.CreatureSpawnEvent; | import net.dungeonrealms.game.mastery.*; import net.dungeonrealms.game.world.entity.*; import net.dungeonrealms.game.world.entity.type.*; import net.minecraft.server.*; import org.bukkit.*; import org.bukkit.block.*; import org.bukkit.craftbukkit.*; import org.bukkit.entity.*; import org.bukkit.event.entity.*; | [
"net.dungeonrealms.game",
"net.minecraft.server",
"org.bukkit",
"org.bukkit.block",
"org.bukkit.craftbukkit",
"org.bukkit.entity",
"org.bukkit.event"
] | net.dungeonrealms.game; net.minecraft.server; org.bukkit; org.bukkit.block; org.bukkit.craftbukkit; org.bukkit.entity; org.bukkit.event; | 1,987,571 |
public PermissionsDescriptor getPermissionDescriptor(String authid, DataDictionary dd)
throws StandardException
{
return null;
} | PermissionsDescriptor function(String authid, DataDictionary dd) throws StandardException { return null; } | /**
* Schema level permission is never required as list of privileges required
* for triggers/constraints/views and hence we don't do any work here, but
* simply return null
*
* @see StatementPermission#check
*/ | Schema level permission is never required as list of privileges required for triggers/constraints/views and hence we don't do any work here, but simply return null | getPermissionDescriptor | {
"repo_name": "lpxz/grail-derby104",
"path": "java/engine/org/apache/derby/iapi/sql/dictionary/StatementSchemaPermission.java",
"license": "apache-2.0",
"size": 3662
} | [
"org.apache.derby.iapi.error.StandardException"
] | import org.apache.derby.iapi.error.StandardException; | import org.apache.derby.iapi.error.*; | [
"org.apache.derby"
] | org.apache.derby; | 442,571 |
public void update()
{
this.checkForAdjacentChests();
int i = this.pos.getX();
int j = this.pos.getY();
int k = this.pos.getZ();
++this.ticksSinceSync;
if (!this.worldObj.isRemote && this.numPlayersUsing != 0 && (this.ticksSinceSync + i + j + k) % 200 == 0)
{
this.numPlayersUsing = 0;
float f = 5.0F;
for (EntityPlayer entityplayer : this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB((double)((float)i - 5.0F), (double)((float)j - 5.0F), (double)((float)k - 5.0F), (double)((float)(i + 1) + 5.0F), (double)((float)(j + 1) + 5.0F), (double)((float)(k + 1) + 5.0F))))
{
if (entityplayer.openContainer instanceof ContainerChest)
{
IInventory iinventory = ((ContainerChest)entityplayer.openContainer).getLowerChestInventory();
if (iinventory == this || iinventory instanceof InventoryLargeChest && ((InventoryLargeChest)iinventory).isPartOfLargeChest(this))
{
++this.numPlayersUsing;
}
}
}
}
this.prevLidAngle = this.lidAngle;
float f1 = 0.1F;
if (this.numPlayersUsing > 0 && this.lidAngle == 0.0F && this.adjacentChestZNeg == null && this.adjacentChestXNeg == null)
{
double d1 = (double)i + 0.5D;
double d2 = (double)k + 0.5D;
if (this.adjacentChestZPos != null)
{
d2 += 0.5D;
}
if (this.adjacentChestXPos != null)
{
d1 += 0.5D;
}
this.worldObj.playSound((EntityPlayer)null, d1, (double)j + 0.5D, d2, SoundEvents.BLOCK_CHEST_OPEN, SoundCategory.BLOCKS, 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
}
if (this.numPlayersUsing == 0 && this.lidAngle > 0.0F || this.numPlayersUsing > 0 && this.lidAngle < 1.0F)
{
float f2 = this.lidAngle;
if (this.numPlayersUsing > 0)
{
this.lidAngle += 0.1F;
}
else
{
this.lidAngle -= 0.1F;
}
if (this.lidAngle > 1.0F)
{
this.lidAngle = 1.0F;
}
float f3 = 0.5F;
if (this.lidAngle < 0.5F && f2 >= 0.5F && this.adjacentChestZNeg == null && this.adjacentChestXNeg == null)
{
double d3 = (double)i + 0.5D;
double d0 = (double)k + 0.5D;
if (this.adjacentChestZPos != null)
{
d0 += 0.5D;
}
if (this.adjacentChestXPos != null)
{
d3 += 0.5D;
}
this.worldObj.playSound((EntityPlayer)null, d3, (double)j + 0.5D, d0, SoundEvents.BLOCK_CHEST_CLOSE, SoundCategory.BLOCKS, 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
}
if (this.lidAngle < 0.0F)
{
this.lidAngle = 0.0F;
}
}
} | void function() { this.checkForAdjacentChests(); int i = this.pos.getX(); int j = this.pos.getY(); int k = this.pos.getZ(); ++this.ticksSinceSync; if (!this.worldObj.isRemote && this.numPlayersUsing != 0 && (this.ticksSinceSync + i + j + k) % 200 == 0) { this.numPlayersUsing = 0; float f = 5.0F; for (EntityPlayer entityplayer : this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB((double)((float)i - 5.0F), (double)((float)j - 5.0F), (double)((float)k - 5.0F), (double)((float)(i + 1) + 5.0F), (double)((float)(j + 1) + 5.0F), (double)((float)(k + 1) + 5.0F)))) { if (entityplayer.openContainer instanceof ContainerChest) { IInventory iinventory = ((ContainerChest)entityplayer.openContainer).getLowerChestInventory(); if (iinventory == this iinventory instanceof InventoryLargeChest && ((InventoryLargeChest)iinventory).isPartOfLargeChest(this)) { ++this.numPlayersUsing; } } } } this.prevLidAngle = this.lidAngle; float f1 = 0.1F; if (this.numPlayersUsing > 0 && this.lidAngle == 0.0F && this.adjacentChestZNeg == null && this.adjacentChestXNeg == null) { double d1 = (double)i + 0.5D; double d2 = (double)k + 0.5D; if (this.adjacentChestZPos != null) { d2 += 0.5D; } if (this.adjacentChestXPos != null) { d1 += 0.5D; } this.worldObj.playSound((EntityPlayer)null, d1, (double)j + 0.5D, d2, SoundEvents.BLOCK_CHEST_OPEN, SoundCategory.BLOCKS, 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); } if (this.numPlayersUsing == 0 && this.lidAngle > 0.0F this.numPlayersUsing > 0 && this.lidAngle < 1.0F) { float f2 = this.lidAngle; if (this.numPlayersUsing > 0) { this.lidAngle += 0.1F; } else { this.lidAngle -= 0.1F; } if (this.lidAngle > 1.0F) { this.lidAngle = 1.0F; } float f3 = 0.5F; if (this.lidAngle < 0.5F && f2 >= 0.5F && this.adjacentChestZNeg == null && this.adjacentChestXNeg == null) { double d3 = (double)i + 0.5D; double d0 = (double)k + 0.5D; if (this.adjacentChestZPos != null) { d0 += 0.5D; } if (this.adjacentChestXPos != null) { d3 += 0.5D; } this.worldObj.playSound((EntityPlayer)null, d3, (double)j + 0.5D, d0, SoundEvents.BLOCK_CHEST_CLOSE, SoundCategory.BLOCKS, 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); } if (this.lidAngle < 0.0F) { this.lidAngle = 0.0F; } } } | /**
* Like the old updateEntity(), except more generic.
*/ | Like the old updateEntity(), except more generic | update | {
"repo_name": "Im-Jrotica/forge_latest",
"path": "build/tmp/recompileMc/sources/net/minecraft/tileentity/TileEntityChest.java",
"license": "lgpl-2.1",
"size": 16800
} | [
"net.minecraft.entity.player.EntityPlayer",
"net.minecraft.init.SoundEvents",
"net.minecraft.inventory.ContainerChest",
"net.minecraft.inventory.IInventory",
"net.minecraft.inventory.InventoryLargeChest",
"net.minecraft.util.SoundCategory",
"net.minecraft.util.math.AxisAlignedBB"
] | import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.SoundEvents; import net.minecraft.inventory.ContainerChest; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.InventoryLargeChest; import net.minecraft.util.SoundCategory; import net.minecraft.util.math.AxisAlignedBB; | import net.minecraft.entity.player.*; import net.minecraft.init.*; import net.minecraft.inventory.*; import net.minecraft.util.*; import net.minecraft.util.math.*; | [
"net.minecraft.entity",
"net.minecraft.init",
"net.minecraft.inventory",
"net.minecraft.util"
] | net.minecraft.entity; net.minecraft.init; net.minecraft.inventory; net.minecraft.util; | 99,226 |
private long readUntilEnd(FSDataInputStream in, byte[] buffer, long size,
String fname, long pos, long visibleLen, boolean positionReadOption)
throws IOException {
if (pos >= visibleLen || visibleLen <= 0)
return 0;
int chunkNumber = 0;
long totalByteRead = 0;
long currentPosition = pos;
int byteRead = 0;
long byteLeftToRead = visibleLen - pos;
int byteToReadThisRound = 0;
if (!positionReadOption) {
in.seek(pos);
currentPosition = in.getPos();
}
if (verboseOption)
LOG.info("reader begin: position: " + pos + " ; currentOffset = "
+ currentPosition + " ; bufferSize =" + buffer.length
+ " ; Filename = " + fname);
try {
while (byteLeftToRead > 0 && currentPosition < visibleLen) {
byteToReadThisRound = (int) (byteLeftToRead >= buffer.length
? buffer.length : byteLeftToRead);
if (positionReadOption) {
byteRead = in.read(currentPosition, buffer, 0, byteToReadThisRound);
} else {
byteRead = in.read(buffer, 0, byteToReadThisRound);
}
if (byteRead <= 0)
break;
chunkNumber++;
totalByteRead += byteRead;
currentPosition += byteRead;
byteLeftToRead -= byteRead;
if (verboseOption) {
LOG.info("reader: Number of byte read: " + byteRead
+ " ; totalByteRead = " + totalByteRead + " ; currentPosition="
+ currentPosition + " ; chunkNumber =" + chunkNumber
+ "; File name = " + fname);
}
}
} catch (IOException e) {
throw new IOException(
"#### Exception caught in readUntilEnd: reader currentOffset = "
+ currentPosition + " ; totalByteRead =" + totalByteRead
+ " ; latest byteRead = " + byteRead + "; visibleLen= "
+ visibleLen + " ; bufferLen = " + buffer.length
+ " ; Filename = " + fname, e);
}
if (verboseOption)
LOG.info("reader end: position: " + pos + " ; currentOffset = "
+ currentPosition + " ; totalByteRead =" + totalByteRead
+ " ; Filename = " + fname);
return totalByteRead;
} | long function(FSDataInputStream in, byte[] buffer, long size, String fname, long pos, long visibleLen, boolean positionReadOption) throws IOException { if (pos >= visibleLen visibleLen <= 0) return 0; int chunkNumber = 0; long totalByteRead = 0; long currentPosition = pos; int byteRead = 0; long byteLeftToRead = visibleLen - pos; int byteToReadThisRound = 0; if (!positionReadOption) { in.seek(pos); currentPosition = in.getPos(); } if (verboseOption) LOG.info(STR + pos + STR + currentPosition + STR + buffer.length + STR + fname); try { while (byteLeftToRead > 0 && currentPosition < visibleLen) { byteToReadThisRound = (int) (byteLeftToRead >= buffer.length ? buffer.length : byteLeftToRead); if (positionReadOption) { byteRead = in.read(currentPosition, buffer, 0, byteToReadThisRound); } else { byteRead = in.read(buffer, 0, byteToReadThisRound); } if (byteRead <= 0) break; chunkNumber++; totalByteRead += byteRead; currentPosition += byteRead; byteLeftToRead -= byteRead; if (verboseOption) { LOG.info(STR + byteRead + STR + totalByteRead + STR + currentPosition + STR + chunkNumber + STR + fname); } } } catch (IOException e) { throw new IOException( STR + currentPosition + STR + totalByteRead + STR + byteRead + STR + visibleLen + STR + buffer.length + STR + fname, e); } if (verboseOption) LOG.info(STR + pos + STR + currentPosition + STR + totalByteRead + STR + fname); return totalByteRead; } | /**
* read chunks into buffer repeatedly until total of VisibleLen byte are read.
* Return total number of bytes read
*/ | read chunks into buffer repeatedly until total of VisibleLen byte are read. Return total number of bytes read | readUntilEnd | {
"repo_name": "ronny-macmaster/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestWriteRead.java",
"license": "apache-2.0",
"size": 18295
} | [
"java.io.IOException",
"org.apache.hadoop.fs.FSDataInputStream"
] | import java.io.IOException; import org.apache.hadoop.fs.FSDataInputStream; | import java.io.*; import org.apache.hadoop.fs.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 1,301,354 |
public static SSTableReader openForBatch(Descriptor descriptor, Set<Component> components, CFMetaData metadata, IPartitioner partitioner) throws IOException
{
// Minimum components without which we can't do anything
assert components.contains(Component.DATA) : "Data component is missing for sstable" + descriptor;
assert components.contains(Component.PRIMARY_INDEX) : "Primary index component is missing for sstable " + descriptor;
Map<MetadataType, MetadataComponent> sstableMetadata = descriptor.getMetadataSerializer().deserialize(descriptor,
EnumSet.of(MetadataType.VALIDATION, MetadataType.STATS));
ValidationMetadata validationMetadata = (ValidationMetadata) sstableMetadata.get(MetadataType.VALIDATION);
StatsMetadata statsMetadata = (StatsMetadata) sstableMetadata.get(MetadataType.STATS);
// Check if sstable is created using same partitioner.
// Partitioner can be null, which indicates older version of sstable or no stats available.
// In that case, we skip the check.
String partitionerName = partitioner.getClass().getCanonicalName();
if (validationMetadata != null && !partitionerName.equals(validationMetadata.partitioner))
{
logger.error(String.format("Cannot open %s; partitioner %s does not match system partitioner %s. Note that the default partitioner starting with Cassandra 1.2 is Murmur3Partitioner, so you will need to edit that to match your old partitioner if upgrading.",
descriptor, validationMetadata.partitioner, partitionerName));
System.exit(1);
}
logger.info("Opening {} ({} bytes)", descriptor, new File(descriptor.filenameFor(Component.DATA)).length());
SSTableReader sstable = new SSTableReader(descriptor,
components,
metadata,
partitioner,
System.currentTimeMillis(),
statsMetadata,
false);
// special implementation of load to use non-pooled SegmentedFile builders
SegmentedFile.Builder ibuilder = new BufferedSegmentedFile.Builder();
SegmentedFile.Builder dbuilder = sstable.compression
? new CompressedSegmentedFile.Builder(null)
: new BufferedSegmentedFile.Builder();
if (!sstable.loadSummary(ibuilder, dbuilder))
sstable.buildSummary(false, ibuilder, dbuilder, false, Downsampling.BASE_SAMPLING_LEVEL);
sstable.ifile = ibuilder.complete(sstable.descriptor.filenameFor(Component.PRIMARY_INDEX));
sstable.dfile = dbuilder.complete(sstable.descriptor.filenameFor(Component.DATA));
sstable.bf = FilterFactory.AlwaysPresent;
return sstable;
} | static SSTableReader function(Descriptor descriptor, Set<Component> components, CFMetaData metadata, IPartitioner partitioner) throws IOException { assert components.contains(Component.DATA) : STR + descriptor; assert components.contains(Component.PRIMARY_INDEX) : STR + descriptor; Map<MetadataType, MetadataComponent> sstableMetadata = descriptor.getMetadataSerializer().deserialize(descriptor, EnumSet.of(MetadataType.VALIDATION, MetadataType.STATS)); ValidationMetadata validationMetadata = (ValidationMetadata) sstableMetadata.get(MetadataType.VALIDATION); StatsMetadata statsMetadata = (StatsMetadata) sstableMetadata.get(MetadataType.STATS); String partitionerName = partitioner.getClass().getCanonicalName(); if (validationMetadata != null && !partitionerName.equals(validationMetadata.partitioner)) { logger.error(String.format(STR, descriptor, validationMetadata.partitioner, partitionerName)); System.exit(1); } logger.info(STR, descriptor, new File(descriptor.filenameFor(Component.DATA)).length()); SSTableReader sstable = new SSTableReader(descriptor, components, metadata, partitioner, System.currentTimeMillis(), statsMetadata, false); SegmentedFile.Builder ibuilder = new BufferedSegmentedFile.Builder(); SegmentedFile.Builder dbuilder = sstable.compression ? new CompressedSegmentedFile.Builder(null) : new BufferedSegmentedFile.Builder(); if (!sstable.loadSummary(ibuilder, dbuilder)) sstable.buildSummary(false, ibuilder, dbuilder, false, Downsampling.BASE_SAMPLING_LEVEL); sstable.ifile = ibuilder.complete(sstable.descriptor.filenameFor(Component.PRIMARY_INDEX)); sstable.dfile = dbuilder.complete(sstable.descriptor.filenameFor(Component.DATA)); sstable.bf = FilterFactory.AlwaysPresent; return sstable; } | /**
* Open SSTable reader to be used in batch mode(such as sstableloader).
*
* @param descriptor
* @param components
* @param metadata
* @param partitioner
* @return opened SSTableReader
* @throws IOException
*/ | Open SSTable reader to be used in batch mode(such as sstableloader) | openForBatch | {
"repo_name": "daidong/GraphTrek",
"path": "src/java/org/apache/cassandra/io/sstable/SSTableReader.java",
"license": "apache-2.0",
"size": 78515
} | [
"java.io.File",
"java.io.IOException",
"java.util.EnumSet",
"java.util.Map",
"java.util.Set",
"org.apache.cassandra.config.CFMetaData",
"org.apache.cassandra.dht.IPartitioner",
"org.apache.cassandra.io.sstable.metadata.MetadataComponent",
"org.apache.cassandra.io.sstable.metadata.MetadataType",
"o... | import java.io.File; import java.io.IOException; import java.util.EnumSet; import java.util.Map; import java.util.Set; import org.apache.cassandra.config.CFMetaData; import org.apache.cassandra.dht.IPartitioner; import org.apache.cassandra.io.sstable.metadata.MetadataComponent; import org.apache.cassandra.io.sstable.metadata.MetadataType; import org.apache.cassandra.io.sstable.metadata.StatsMetadata; import org.apache.cassandra.io.sstable.metadata.ValidationMetadata; import org.apache.cassandra.io.util.BufferedSegmentedFile; import org.apache.cassandra.io.util.CompressedSegmentedFile; import org.apache.cassandra.io.util.SegmentedFile; import org.apache.cassandra.utils.FilterFactory; | import java.io.*; import java.util.*; import org.apache.cassandra.config.*; import org.apache.cassandra.dht.*; import org.apache.cassandra.io.sstable.metadata.*; import org.apache.cassandra.io.util.*; import org.apache.cassandra.utils.*; | [
"java.io",
"java.util",
"org.apache.cassandra"
] | java.io; java.util; org.apache.cassandra; | 2,063,131 |
private static void onContextCreated(QDataContext dc) {
InterceptorFactory factory = m_interceptorFactory;
if(null != factory) {
var interceptor = factory.create((BuggyHibernateBaseContext) dc);
dc.setAttribute(Interceptor.class, interceptor);
}
} | static void function(QDataContext dc) { InterceptorFactory factory = m_interceptorFactory; if(null != factory) { var interceptor = factory.create((BuggyHibernateBaseContext) dc); dc.setAttribute(Interceptor.class, interceptor); } } | /**
* Called whenever a QDataContext is created, this adds whatever is needed to the QDataContext.
*/ | Called whenever a QDataContext is created, this adds whatever is needed to the QDataContext | onContextCreated | {
"repo_name": "fjalvingh/domui",
"path": "integrations/to.etc.domui.hibutil/src/main/java/to/etc/domui/hibernate/config/HibernateConfigurator.java",
"license": "lgpl-2.1",
"size": 19242
} | [
"org.hibernate.Interceptor",
"to.etc.domui.hibernate.generic.BuggyHibernateBaseContext",
"to.etc.webapp.query.QDataContext"
] | import org.hibernate.Interceptor; import to.etc.domui.hibernate.generic.BuggyHibernateBaseContext; import to.etc.webapp.query.QDataContext; | import org.hibernate.*; import to.etc.domui.hibernate.generic.*; import to.etc.webapp.query.*; | [
"org.hibernate",
"to.etc.domui",
"to.etc.webapp"
] | org.hibernate; to.etc.domui; to.etc.webapp; | 2,790,778 |
private void checkLine(int aLineno, String aLine, Matcher aMatcher,
int aStartPosition)
{
final boolean foundMatch = aMatcher.find(aStartPosition);
if (!foundMatch) {
return;
}
// match is found, check for intersection with comment
final int startCol = aMatcher.start(0);
final int endCol = aMatcher.end(0);
// Note that Matcher.end(int) returns the offset AFTER the
// last matched character, but shouldSuppress()
// needs column number of the last character.
// So we need to use (endCol - 1) here.
if (mOptions.getSuppressor()
.shouldSuppress(aLineno, startCol, aLineno, endCol - 1))
{
if (endCol < aLine.length()) {
// check if the expression is on the rest of the line
checkLine(aLineno, aLine, aMatcher, endCol);
}
return; // end processing here
}
mCurrentMatches++;
if (mCurrentMatches > mOptions.getMaximum()) {
if ("".equals(mOptions.getMessage())) {
mOptions.getReporter().log(aLineno, "regexp.exceeded",
aMatcher.pattern().toString());
}
else {
mOptions.getReporter().log(aLineno, mOptions.getMessage());
}
}
}
| void function(int aLineno, String aLine, Matcher aMatcher, int aStartPosition) { final boolean foundMatch = aMatcher.find(aStartPosition); if (!foundMatch) { return; } final int startCol = aMatcher.start(0); final int endCol = aMatcher.end(0); if (mOptions.getSuppressor() .shouldSuppress(aLineno, startCol, aLineno, endCol - 1)) { if (endCol < aLine.length()) { checkLine(aLineno, aLine, aMatcher, endCol); } return; } mCurrentMatches++; if (mCurrentMatches > mOptions.getMaximum()) { if (STRregexp.exceeded", aMatcher.pattern().toString()); } else { mOptions.getReporter().log(aLineno, mOptions.getMessage()); } } } | /**
* Check a line for matches.
* @param aLineno the line number of the line to check
* @param aLine the line to check
* @param aMatcher the matcher to use
* @param aStartPosition the position to start searching from.
*/ | Check a line for matches | checkLine | {
"repo_name": "maikelsteneker/checkstyle-throwsIndent",
"path": "src/checkstyle/com/puppycrawl/tools/checkstyle/checks/regexp/SinglelineDetector.java",
"license": "lgpl-2.1",
"size": 4305
} | [
"java.util.regex.Matcher"
] | import java.util.regex.Matcher; | import java.util.regex.*; | [
"java.util"
] | java.util; | 1,209,469 |
protected void put(String key, DataProvider provider) {
if (mCombinedProviders.containsKey(key)) {
throw new IllegalArgumentException("The key[" + key + "] has been registered.");
}
mCombinedProviders.put(key, provider);
} | void function(String key, DataProvider provider) { if (mCombinedProviders.containsKey(key)) { throw new IllegalArgumentException(STR + key + STR); } mCombinedProviders.put(key, provider); } | /**
* It should only be called in your constructor.
*
* @param key
* @param provider
*/ | It should only be called in your constructor | put | {
"repo_name": "kifile/Cornerstone",
"path": "framework/src/main/java/com/kifile/android/cornerstone/impl/providers/CombinedDataProvider.java",
"license": "apache-2.0",
"size": 3282
} | [
"com.kifile.android.cornerstone.core.DataProvider"
] | import com.kifile.android.cornerstone.core.DataProvider; | import com.kifile.android.cornerstone.core.*; | [
"com.kifile.android"
] | com.kifile.android; | 2,673,400 |
String getLocaleName(Locale locale) {
String localeString = locale.toString();
String localeName = Toolkit.getProperty("AWT.InputMethodLanguage." + localeString, null);
if (localeName == null) {
localeName = locale.getDisplayName();
if (localeName == null || localeName.length() == 0)
localeName = localeString;
}
return localeName;
} | String getLocaleName(Locale locale) { String localeString = locale.toString(); String localeName = Toolkit.getProperty(STR + localeString, null); if (localeName == null) { localeName = locale.getDisplayName(); if (localeName == null localeName.length() == 0) localeName = localeString; } return localeName; } | /**
* Returns a localized locale name for input methods with the
* given locale. It falls back to Locale.getDisplayName() and
* then to Locale.toString() if no localized locale name is found.
*
* @param locale Locale for which localized locale name is obtained
*/ | Returns a localized locale name for input methods with the given locale. It falls back to Locale.getDisplayName() and then to Locale.toString() if no localized locale name is found | getLocaleName | {
"repo_name": "TheTypoMaster/Scaper",
"path": "openjdk/jdk/src/share/classes/sun/awt/im/InputMethodPopupMenu.java",
"license": "gpl-2.0",
"size": 9325
} | [
"java.awt.Toolkit",
"java.util.Locale"
] | import java.awt.Toolkit; import java.util.Locale; | import java.awt.*; import java.util.*; | [
"java.awt",
"java.util"
] | java.awt; java.util; | 2,869,303 |
int purgeCollisionMarkers(RevisionContext context) {
Map<Revision, String> valueMap = getLocalMap(COLLISIONS);
UpdateOp op = new UpdateOp(getId(), false);
int purgeCount = 0;
for (Map.Entry<Revision, String> commit : valueMap.entrySet()) {
Revision r = commit.getKey();
if (r.getClusterId() == context.getClusterId()) {
purgeCount++;
removeCollision(op, r);
}
}
if (op.hasChanges()) {
store.findAndUpdate(Collection.NODES, op);
}
return purgeCount;
} | int purgeCollisionMarkers(RevisionContext context) { Map<Revision, String> valueMap = getLocalMap(COLLISIONS); UpdateOp op = new UpdateOp(getId(), false); int purgeCount = 0; for (Map.Entry<Revision, String> commit : valueMap.entrySet()) { Revision r = commit.getKey(); if (r.getClusterId() == context.getClusterId()) { purgeCount++; removeCollision(op, r); } } if (op.hasChanges()) { store.findAndUpdate(Collection.NODES, op); } return purgeCount; } | /**
* Purge collision markers with the local clusterId on this document. Use
* only on start when there are no ongoing or pending commits.
*
* @param context the revision context.
* @return the number of removed collision markers.
*/ | Purge collision markers with the local clusterId on this document. Use only on start when there are no ongoing or pending commits | purgeCollisionMarkers | {
"repo_name": "joansmith/jackrabbit-oak",
"path": "oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/NodeDocument.java",
"license": "apache-2.0",
"size": 87655
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,170,019 |
public static void killProcessGroup(String pgrpId, Signal signal) {
//If process tree is not alive then return immediately.
if(!ProcessTree.isProcessGroupAlive(pgrpId)) {
return;
}
String[] args = { "kill", "-" + signal.getValue() , "-"+pgrpId };
ShellCommandExecutor shexec = new ShellCommandExecutor(args);
try {
shexec.execute();
} catch (IOException e) {
LOG.warn("Error sending signal " + signal + " to process group "+
pgrpId + " ."+
StringUtils.stringifyException(e));
} finally {
LOG.info("Killing process group" + pgrpId + " with signal " + signal +
". Exit code " + shexec.getExitCode());
}
} | static void function(String pgrpId, Signal signal) { if(!ProcessTree.isProcessGroupAlive(pgrpId)) { return; } String[] args = { "kill", "-" + signal.getValue() , "-"+pgrpId }; ShellCommandExecutor shexec = new ShellCommandExecutor(args); try { shexec.execute(); } catch (IOException e) { LOG.warn(STR + signal + STR+ pgrpId + STR+ StringUtils.stringifyException(e)); } finally { LOG.info(STR + pgrpId + STR + signal + STR + shexec.getExitCode()); } } | /**
* Sends signal to all process belonging to same process group,
* forcefully terminating the process group.
*
* @param pgrpId process group id
* @param signal the signal number to send
*/ | Sends signal to all process belonging to same process group, forcefully terminating the process group | killProcessGroup | {
"repo_name": "gndpig/hadoop",
"path": "src/core/org/apache/hadoop/util/ProcessTree.java",
"license": "apache-2.0",
"size": 7108
} | [
"java.io.IOException",
"org.apache.hadoop.util.Shell"
] | import java.io.IOException; import org.apache.hadoop.util.Shell; | import java.io.*; import org.apache.hadoop.util.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 252,076 |
public void removeMessage() throws IOException
{
System.out.println("Preparing to remove a message");
String hostAddress = getApiHost() + "/chat.delete";
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType,
slackInfo.getTokenURL()
+ slackInfo.getChannelURL()
+ slackInfo.getDeleteMessageURL());
postAPI(hostAddress, body);
} | void function() throws IOException { System.out.println(STR); String hostAddress = getApiHost() + STR; MediaType mediaType = MediaType.parse(STR); RequestBody body = RequestBody.create(mediaType, slackInfo.getTokenURL() + slackInfo.getChannelURL() + slackInfo.getDeleteMessageURL()); postAPI(hostAddress, body); } | /**
* Removes a message or a group of messages from the Channel or Group
* @throws IOException
*/ | Removes a message or a group of messages from the Channel or Group | removeMessage | {
"repo_name": "Disorientedart/SlackBot",
"path": "src/main/java/slackAPI/APICalls.java",
"license": "mit",
"size": 8876
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 243,105 |
public static void unzipFileToDirectory(String fullFilePath, String directoryPath, boolean deleteAfterUnzip) {
// at this point we should have the zip downloaded and on the local filesystem
// now we want to unzip it
try {
ZipFile zf = new ZipFile(fullFilePath);
Enumeration list = zf.entries();
while (list.hasMoreElements()) {
ZipEntry ze = (ZipEntry)list.nextElement();
if (ze.isDirectory()) {
continue;
}
try {
dumpZipEntry(directoryPath, zf, ze);
} catch (IOException e) {
e.printStackTrace();
MesquiteMessage.warnUser("problem dumping zip entry: " + ze.getName());
}
}
// Clean up the zip file once the individual entries have been written out.
File zip = new File(fullFilePath);
if (deleteAfterUnzip && zip.exists()) {
zip.delete();
}
zf.close();
} catch (ZipException e1) {
e1.printStackTrace();
} catch (IOException e2) {
e2.printStackTrace();
}
}
| static void function(String fullFilePath, String directoryPath, boolean deleteAfterUnzip) { try { ZipFile zf = new ZipFile(fullFilePath); Enumeration list = zf.entries(); while (list.hasMoreElements()) { ZipEntry ze = (ZipEntry)list.nextElement(); if (ze.isDirectory()) { continue; } try { dumpZipEntry(directoryPath, zf, ze); } catch (IOException e) { e.printStackTrace(); MesquiteMessage.warnUser(STR + ze.getName()); } } File zip = new File(fullFilePath); if (deleteAfterUnzip && zip.exists()) { zip.delete(); } zf.close(); } catch (ZipException e1) { e1.printStackTrace(); } catch (IOException e2) { e2.printStackTrace(); } } | /**
* Unzips the zip file at the specified path to the specified directory
* optionally deletes the zip afterwards
* @param fullFilePath The full path to the zip file
* @param directoryPath The path to the directory where things should be unzipped
* @param deleteAfterUnzip Whether to delete the original zip after unzipping
*/ | Unzips the zip file at the specified path to the specified directory optionally deletes the zip afterwards | unzipFileToDirectory | {
"repo_name": "MesquiteProject/MesquiteArchive",
"path": "releases/Mesquite2.73/Mesquite Project/Source/mesquite/lib/ZipUtil.java",
"license": "lgpl-3.0",
"size": 5257
} | [
"java.io.File",
"java.io.IOException",
"java.util.Enumeration",
"java.util.zip.ZipEntry",
"java.util.zip.ZipException",
"java.util.zip.ZipFile"
] | import java.io.File; import java.io.IOException; import java.util.Enumeration; import java.util.zip.ZipEntry; import java.util.zip.ZipException; import java.util.zip.ZipFile; | import java.io.*; import java.util.*; import java.util.zip.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 2,165,391 |
private void writeObject(ObjectOutputStream oos) throws IOException {
oos.defaultWriteObject();
oos.writeInt(array.length);
for (int i = 0; i < array.length; i++) {
oos.writeObject(array[i]);
}
} | void function(ObjectOutputStream oos) throws IOException { oos.defaultWriteObject(); oos.writeInt(array.length); for (int i = 0; i < array.length; i++) { oos.writeObject(array[i]); } } | /**
* Writes objects to the stream from
* the transient {@code Object[] array} field.
*
* @serialData
* A nonnegative int, indicating the count of objects,
* followed by that many objects.
*
* @param oos the ObjectOutputStream to which data is written
* @throws IOException if an I/O error occurs
* @since 9
*/ | Writes objects to the stream from the transient Object[] array field | writeObject | {
"repo_name": "streamsupport/streamsupport",
"path": "src/literal/java/java8/util/Unmodifiable.java",
"license": "gpl-2.0",
"size": 31964
} | [
"java.io.IOException",
"java.io.ObjectOutputStream"
] | import java.io.IOException; import java.io.ObjectOutputStream; | import java.io.*; | [
"java.io"
] | java.io; | 1,211,495 |
// <editor-fold defaultstate="collapsed" desc=" Generated Code
// ">//GEN-BEGIN:initComponents
private void initComponents() {
java.awt.GridBagConstraints gridBagConstraints;
blackrevertedGroup = new javax.swing.ButtonGroup();
BColumnGroup = new javax.swing.ButtonGroup();
blackdeletedGroup = new javax.swing.ButtonGroup();
watchdeletedGroup = new javax.swing.ButtonGroup();
watchwarnedGroup = new javax.swing.ButtonGroup();
jPanel1 = new javax.swing.JPanel();
statusLabel = new javax.swing.JLabel();
tab = new javax.swing.JTabbedPane();
userlistPanel2 = new javax.swing.JPanel();
userListPanel = new javax.swing.JPanel();
watchlistPanel = new javax.swing.JPanel();
watchlists = new javax.swing.JPanel();
watchlistButtons = new javax.swing.JPanel();
lists = new javax.swing.JPanel();
jScrollPane6 = new javax.swing.JScrollPane();
whitelistList = new javax.swing.JList();
jScrollPane7 = new javax.swing.JScrollPane();
blacklistList = new javax.swing.JList();
greylistList = new javax.swing.JList();
buttons = new javax.swing.JPanel();
jLabel26 = new javax.swing.JLabel();
userlistField = new javax.swing.JTextField();
whitelistAdd = new javax.swing.JButton();
blacklistAdd = new javax.swing.JButton();
greylistAdd = new javax.swing.JButton();
whitelistRemove = new javax.swing.JButton();
blacklistRemove = new javax.swing.JButton();
greylistRemove = new javax.swing.JButton();
sortwhitelistButton = new javax.swing.JButton();
sortblacklistButton = new javax.swing.JButton();
sortgreylistButton = new javax.swing.JButton();
jLabel27 = new javax.swing.JLabel();
importbotsButton = new javax.swing.JButton();
whitelistimportField = new javax.swing.JTextField();
importadminsButton = new javax.swing.JButton();
jPanel26 = new javax.swing.JPanel();
jPanel32 = new javax.swing.JPanel();
jPanel31 = new javax.swing.JPanel();
jLabel28 = new javax.swing.JLabel();
articleField = new javax.swing.JTextField();
watchlistAdd = new javax.swing.JButton();
watchlistRemove = new javax.swing.JButton();
sortarticlesButton = new javax.swing.JButton();
watchlistimportButton = new javax.swing.JButton();
jScrollPane8 = new javax.swing.JScrollPane();
watchlistList = new javax.swing.JList();
temporaryPanel = new javax.swing.JPanel();
jPanel24 = new javax.swing.JPanel();
jScrollPane3 = new javax.swing.JScrollPane();
tempwhitelistList = new javax.swing.JList();
jScrollPane4 = new javax.swing.JScrollPane();
tempblacklistList = new javax.swing.JList();
jScrollPane5 = new javax.swing.JScrollPane();
jScrollPane11 = new javax.swing.JScrollPane();
tempwatchlistList = new javax.swing.JList();
jPanel25 = new javax.swing.JPanel();
jLabel24 = new javax.swing.JLabel();
templistField = new javax.swing.JTextField();
jLabel25 = new javax.swing.JLabel();
tempwhitelistAdd = new javax.swing.JButton();
tempblacklistAdd = new javax.swing.JButton();
tempwatchlistAdd = new javax.swing.JButton();
tempwhitelistRemove = new javax.swing.JButton();
tempblacklistRemove = new javax.swing.JButton();
tempwatchlistRemove = new javax.swing.JButton();
sorttempwhitelistButton = new javax.swing.JButton();
sorttempblacklistButton = new javax.swing.JButton();
sorttempwatchlistButton = new javax.swing.JButton();
regexPanel = new javax.swing.JPanel();
jPanel21 = new javax.swing.JPanel();
jPanel22 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
regexpwhiteList = new javax.swing.JList();
jScrollPane2 = new javax.swing.JScrollPane();
regexpblackList = new javax.swing.JList();
jPanel23 = new javax.swing.JPanel();
jLabel23 = new javax.swing.JLabel();
regexpField = new javax.swing.JTextField();
regexpwhiteAdd = new javax.swing.JButton();
regexpblackAdd = new javax.swing.JButton();
regexpwhiteRemove = new javax.swing.JButton();
regexpblackRemove = new javax.swing.JButton();
sortregexpwhitelistButton = new javax.swing.JButton();
sortregexpblacklistButton = new javax.swing.JButton();
configPanel1 = new javax.swing.JPanel();
miscConfigPanel = new javax.swing.JPanel();
miscConfigLabel = new JLabel();
localizeConfigPanel = new javax.swing.JPanel();
localizeConfigLabel = new JLabel();
jLabel2 = new javax.swing.JLabel();
langList = new JComboBox(langStrings);
timeZoneList = new JComboBox(timeZoneStrings);
jLabel29 = new javax.swing.JLabel();
jLabel30 = new javax.swing.JLabel();
feelList = new JComboBox(feelStrings);
themeLabel = new javax.swing.JLabel();
themeList = new JComboBox(themeStrings);
langList.setSelectedIndex(getLangInt());
timeZoneList.setSelectedIndex(getTimeZoneInt());
feelList.setSelectedIndex(getFeelInt());
themeList.setEnabled(feelList.getSelectedIndex() == 0);
themeLabel.setEnabled(feelList.getSelectedIndex() == 0);
themeList.setSelectedIndex(getThemeInt());
olddeleted = new javax.swing.JCheckBox();
registerdeleted = new javax.swing.JCheckBox();
autoscroll = new javax.swing.JCheckBox();
singleclick = new javax.swing.JCheckBox();
queueedits = new javax.swing.JCheckBox();
removereviewed = new javax.swing.JCheckBox();
stripformatting = new javax.swing.JCheckBox();
newversion = new javax.swing.JCheckBox();
connectatstart = new javax.swing.JCheckBox();
reversetable = new javax.swing.JCheckBox();
jPanel3 = new javax.swing.JPanel();
DefaultProject = new javax.swing.JLabel();
defaultProjectField = new javax.swing.JTextField();
jPanel12 = new javax.swing.JPanel();
browserpick = new javax.swing.JCheckBox();
browser2 = new javax.swing.JPanel();
browserchooserButton = new javax.swing.JButton();
browserField = new javax.swing.JTextField();
jPanel11 = new javax.swing.JPanel();
BColumnTakesYouTo = new javax.swing.JLabel();
blockRadioPanel = new javax.swing.JPanel();
blockButton = new javax.swing.JRadioButton();
vipButton = new javax.swing.JRadioButton();
vipeditButton = new javax.swing.JRadioButton();
jSeparator1 = new javax.swing.JSeparator();
showips = new javax.swing.JCheckBox();
newpages = new javax.swing.JCheckBox();
showwatch = new javax.swing.JCheckBox();
jSeparator2 = new javax.swing.JSeparator();
listprecedence = new javax.swing.JCheckBox();
watchuserpages = new javax.swing.JCheckBox();
watchmasschanges = new javax.swing.JCheckBox();
watchpagemoves = new javax.swing.JCheckBox();
watchnewpages = new javax.swing.JCheckBox();
beeptempblack = new javax.swing.JCheckBox();
beeppermblack = new javax.swing.JCheckBox();
beeptempwatch = new javax.swing.JCheckBox();
beeppermwatch = new javax.swing.JCheckBox();
beepregexpblack = new javax.swing.JCheckBox();
beepcollaborationwarning = new javax.swing.JCheckBox();
jSeparator3 = new javax.swing.JSeparator();
rwhiteuser = new javax.swing.JCheckBox();
rwhitepage = new javax.swing.JCheckBox();
rwhitesummary = new javax.swing.JCheckBox();
rblackuser = new javax.swing.JCheckBox();
rblackpage = new javax.swing.JCheckBox();
rblacksummary = new javax.swing.JCheckBox();
jSeparator4 = new javax.swing.JSeparator();
blackreverted = new javax.swing.JCheckBox();
revertedUsers = new javax.swing.JPanel();
revertpermButton = new javax.swing.JRadioButton();
reverttempButton = new javax.swing.JRadioButton();
blackdeleted = new javax.swing.JCheckBox();
speediedUsers = new javax.swing.JPanel();
delpagepermButton = new javax.swing.JRadioButton();
delpagetempButton = new javax.swing.JRadioButton();
watchdeleted = new javax.swing.JCheckBox();
watchspeediedArticles = new javax.swing.JPanel();
watchdelpermButton = new javax.swing.JRadioButton();
watchdeltempButton = new javax.swing.JRadioButton();
watchwarned = new javax.swing.JCheckBox();
watchwarnedPanel = new javax.swing.JPanel();
watchwarnedpermButton = new javax.swing.JRadioButton();
watchwarnedtempButton = new javax.swing.JRadioButton();
jSeparator5 = new javax.swing.JSeparator();
jPanel15 = new javax.swing.JPanel();
exportchooserButton1 = new javax.swing.JButton();
exportField1 = new javax.swing.JTextField();
exportButton1 = new javax.swing.JButton();
jPanel14 = new javax.swing.JPanel();
importchooserButton = new javax.swing.JButton();
importField = new javax.swing.JTextField();
importButton = new javax.swing.JButton();
jSeparator6 = new javax.swing.JSeparator();
risk = new javax.swing.JCheckBox();
jPanel2 = new javax.swing.JPanel();
colorblist = new javax.swing.JCheckBox();
colorblistButton = new javax.swing.JButton();
jPanel4 = new javax.swing.JPanel();
colorwatch = new javax.swing.JCheckBox();
colorwatchButton = new javax.swing.JButton();
jPanel5 = new javax.swing.JPanel();
colorchanged = new javax.swing.JCheckBox();
changedField = new javax.swing.JTextField();
changedField.setText(config.getProperty("changedField"));
colorchangedButton = new javax.swing.JButton();
jPanel6 = new javax.swing.JPanel();
colornew = new javax.swing.JCheckBox();
colornewButton = new javax.swing.JButton();
jPanel7 = new javax.swing.JPanel();
jPanel78 = new javax.swing.JPanel();
colorips = new javax.swing.JCheckBox();
coloripsButton = new javax.swing.JButton();
colornewusers = new javax.swing.JCheckBox();
colornewusersButton = new javax.swing.JButton();
jPanel8 = new javax.swing.JPanel();
coloruserpage = new javax.swing.JCheckBox();
coloruserpageButton = new javax.swing.JButton();
jPanel9 = new javax.swing.JPanel();
colormoves = new javax.swing.JCheckBox();
colormovesButton = new javax.swing.JButton();
configCtrlsPanel = new javax.swing.JPanel();
configDefaults = new javax.swing.JButton();
configCancel = new javax.swing.JButton();
configSave = new javax.swing.JButton();
IRCPannel = new javax.swing.JPanel();
connectionsPanel = new ConnectionsPanel(this);
irctoptopPanel1 = new javax.swing.JPanel();
jPanel19 = new javax.swing.JPanel();
jPanel10 = new javax.swing.JPanel();
vandalism_nl_box = new javax.swing.JCheckBox();
vandalism_fr_box = new javax.swing.JCheckBox();
vandalism_en_box = new javax.swing.JCheckBox();
vandalism_it_box = new javax.swing.JCheckBox();
vandalism_cs_box = new javax.swing.JCheckBox();
jPanel20 = new javax.swing.JPanel();
VandalismStreamButton = new javax.swing.JButton();
jLabel21 = new javax.swing.JLabel();
jSeparator7 = new javax.swing.JSeparator();
jLabel22 = new javax.swing.JLabel();
jPanel13 = new javax.swing.JPanel();
mediawikistreamCheckbox = new javax.swing.JCheckBox();
jPanel16 = new javax.swing.JPanel();
jLabel3 = new javax.swing.JLabel();
channelField = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
serverField = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
portField = new javax.swing.JTextField();
jPanel17 = new javax.swing.JPanel();
jPanel27 = new javax.swing.JPanel();
jPanel40 = new javax.swing.JPanel();
jPanel41 = new javax.swing.JPanel();
ircconButton = new javax.swing.JButton();
ircdisconnectButton = new javax.swing.JButton();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
jLabel13 = new javax.swing.JLabel();
jLabel14 = new javax.swing.JLabel();
jLabel15 = new javax.swing.JLabel();
editorPane1 = new JEditorPane();
aboutPanel = new javax.swing.JPanel();
jScrollPane10 = new javax.swing.JScrollPane();
jTextPane1 = new javax.swing.JTextPane();
colorConfigPanel = new javax.swing.JPanel();
colorConfigLabel = new JLabel();
regexpConfigPanel = new javax.swing.JPanel();
regexpConfigLabel = new JLabel();
listsConfigPanel = new javax.swing.JPanel();
listsConfigLabel = new JLabel();
automaticConfigPanel = new javax.swing.JPanel();
automaticConfigLabel = new JLabel();
showConfigPanel = new javax.swing.JPanel();
showConfigLabel = new JLabel();
beepConfigPanel = new javax.swing.JPanel();
beepConfigLabel = new JLabel();
startConfigPanel = new javax.swing.JPanel();
startConfigLabel = new JLabel();
browserConfigPanel = new javax.swing.JPanel();
browserConfigLabel = new JLabel();
userPopupMenu = new JPopupMenu();
userContributionsPopupItem = new JMenuItem(messages
.getString("UserContributionsMenu"));
userTalkPagePopupItem = new JMenuItem(messages
.getString("UserTalkPageMenu"));
userBlockPopupItem = new JMenuItem(messages.getString("UserBlockMenu"));
user2WhitelistPopupItem = new JMenuItem(messages
.getString("User2WhitelistMenu"));
user2GreylistPopupItem = new JMenuItem(messages
.getString("User2GreylistMenu"));
user2BlacklistPopupItem = new JMenuItem(messages
.getString("User2BlacklistMenu"));
// user2WatchlistPopupItem = new JMenuItem(messages
// .getString("User2WatchlistMenu"));
user2TempWhitelistPopupItem = new JMenuItem(messages
.getString("User2TempWhitelistMenu"));
user2TempBlacklistPopupItem = new JMenuItem(messages
.getString("User2TempBlacklistMenu"));
// user2TempWatchlistPopupItem = new JMenuItem(messages
// .getString("User2TempWatchlistMenu"));
userNamePopupLabel = new JLabel();
userNamePopupLabel.setBorder(javax.swing.BorderFactory.createEmptyBorder(0,
14, 0, 0));
userPopupMenu.add(userContributionsPopupItem);
userPopupMenu.add(userTalkPagePopupItem);
userPopupMenu.add(userBlockPopupItem);
userPopupMenu.addSeparator();
userPopupMenu.add(user2WhitelistPopupItem);
userPopupMenu.add(user2GreylistPopupItem);
userPopupMenu.add(user2BlacklistPopupItem);
// userPopupMenu.add(user2WatchlistPopupItem);
userPopupMenu.addSeparator();
userPopupMenu.add(user2TempWhitelistPopupItem);
userPopupMenu.add(user2TempBlacklistPopupItem);
// userPopupMenu.add(user2TempWatchlistPopupItem);
userPopupMenu.addSeparator();
{
JPanel mjp = new JPanel();
mjp.setLayout(new FlowLayout(FlowLayout.LEFT));
userPopupMenu.add(mjp);
mjp.add(userNamePopupLabel);
} | void function() { java.awt.GridBagConstraints gridBagConstraints; blackrevertedGroup = new javax.swing.ButtonGroup(); BColumnGroup = new javax.swing.ButtonGroup(); blackdeletedGroup = new javax.swing.ButtonGroup(); watchdeletedGroup = new javax.swing.ButtonGroup(); watchwarnedGroup = new javax.swing.ButtonGroup(); jPanel1 = new javax.swing.JPanel(); statusLabel = new javax.swing.JLabel(); tab = new javax.swing.JTabbedPane(); userlistPanel2 = new javax.swing.JPanel(); userListPanel = new javax.swing.JPanel(); watchlistPanel = new javax.swing.JPanel(); watchlists = new javax.swing.JPanel(); watchlistButtons = new javax.swing.JPanel(); lists = new javax.swing.JPanel(); jScrollPane6 = new javax.swing.JScrollPane(); whitelistList = new javax.swing.JList(); jScrollPane7 = new javax.swing.JScrollPane(); blacklistList = new javax.swing.JList(); greylistList = new javax.swing.JList(); buttons = new javax.swing.JPanel(); jLabel26 = new javax.swing.JLabel(); userlistField = new javax.swing.JTextField(); whitelistAdd = new javax.swing.JButton(); blacklistAdd = new javax.swing.JButton(); greylistAdd = new javax.swing.JButton(); whitelistRemove = new javax.swing.JButton(); blacklistRemove = new javax.swing.JButton(); greylistRemove = new javax.swing.JButton(); sortwhitelistButton = new javax.swing.JButton(); sortblacklistButton = new javax.swing.JButton(); sortgreylistButton = new javax.swing.JButton(); jLabel27 = new javax.swing.JLabel(); importbotsButton = new javax.swing.JButton(); whitelistimportField = new javax.swing.JTextField(); importadminsButton = new javax.swing.JButton(); jPanel26 = new javax.swing.JPanel(); jPanel32 = new javax.swing.JPanel(); jPanel31 = new javax.swing.JPanel(); jLabel28 = new javax.swing.JLabel(); articleField = new javax.swing.JTextField(); watchlistAdd = new javax.swing.JButton(); watchlistRemove = new javax.swing.JButton(); sortarticlesButton = new javax.swing.JButton(); watchlistimportButton = new javax.swing.JButton(); jScrollPane8 = new javax.swing.JScrollPane(); watchlistList = new javax.swing.JList(); temporaryPanel = new javax.swing.JPanel(); jPanel24 = new javax.swing.JPanel(); jScrollPane3 = new javax.swing.JScrollPane(); tempwhitelistList = new javax.swing.JList(); jScrollPane4 = new javax.swing.JScrollPane(); tempblacklistList = new javax.swing.JList(); jScrollPane5 = new javax.swing.JScrollPane(); jScrollPane11 = new javax.swing.JScrollPane(); tempwatchlistList = new javax.swing.JList(); jPanel25 = new javax.swing.JPanel(); jLabel24 = new javax.swing.JLabel(); templistField = new javax.swing.JTextField(); jLabel25 = new javax.swing.JLabel(); tempwhitelistAdd = new javax.swing.JButton(); tempblacklistAdd = new javax.swing.JButton(); tempwatchlistAdd = new javax.swing.JButton(); tempwhitelistRemove = new javax.swing.JButton(); tempblacklistRemove = new javax.swing.JButton(); tempwatchlistRemove = new javax.swing.JButton(); sorttempwhitelistButton = new javax.swing.JButton(); sorttempblacklistButton = new javax.swing.JButton(); sorttempwatchlistButton = new javax.swing.JButton(); regexPanel = new javax.swing.JPanel(); jPanel21 = new javax.swing.JPanel(); jPanel22 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); regexpwhiteList = new javax.swing.JList(); jScrollPane2 = new javax.swing.JScrollPane(); regexpblackList = new javax.swing.JList(); jPanel23 = new javax.swing.JPanel(); jLabel23 = new javax.swing.JLabel(); regexpField = new javax.swing.JTextField(); regexpwhiteAdd = new javax.swing.JButton(); regexpblackAdd = new javax.swing.JButton(); regexpwhiteRemove = new javax.swing.JButton(); regexpblackRemove = new javax.swing.JButton(); sortregexpwhitelistButton = new javax.swing.JButton(); sortregexpblacklistButton = new javax.swing.JButton(); configPanel1 = new javax.swing.JPanel(); miscConfigPanel = new javax.swing.JPanel(); miscConfigLabel = new JLabel(); localizeConfigPanel = new javax.swing.JPanel(); localizeConfigLabel = new JLabel(); jLabel2 = new javax.swing.JLabel(); langList = new JComboBox(langStrings); timeZoneList = new JComboBox(timeZoneStrings); jLabel29 = new javax.swing.JLabel(); jLabel30 = new javax.swing.JLabel(); feelList = new JComboBox(feelStrings); themeLabel = new javax.swing.JLabel(); themeList = new JComboBox(themeStrings); langList.setSelectedIndex(getLangInt()); timeZoneList.setSelectedIndex(getTimeZoneInt()); feelList.setSelectedIndex(getFeelInt()); themeList.setEnabled(feelList.getSelectedIndex() == 0); themeLabel.setEnabled(feelList.getSelectedIndex() == 0); themeList.setSelectedIndex(getThemeInt()); olddeleted = new javax.swing.JCheckBox(); registerdeleted = new javax.swing.JCheckBox(); autoscroll = new javax.swing.JCheckBox(); singleclick = new javax.swing.JCheckBox(); queueedits = new javax.swing.JCheckBox(); removereviewed = new javax.swing.JCheckBox(); stripformatting = new javax.swing.JCheckBox(); newversion = new javax.swing.JCheckBox(); connectatstart = new javax.swing.JCheckBox(); reversetable = new javax.swing.JCheckBox(); jPanel3 = new javax.swing.JPanel(); DefaultProject = new javax.swing.JLabel(); defaultProjectField = new javax.swing.JTextField(); jPanel12 = new javax.swing.JPanel(); browserpick = new javax.swing.JCheckBox(); browser2 = new javax.swing.JPanel(); browserchooserButton = new javax.swing.JButton(); browserField = new javax.swing.JTextField(); jPanel11 = new javax.swing.JPanel(); BColumnTakesYouTo = new javax.swing.JLabel(); blockRadioPanel = new javax.swing.JPanel(); blockButton = new javax.swing.JRadioButton(); vipButton = new javax.swing.JRadioButton(); vipeditButton = new javax.swing.JRadioButton(); jSeparator1 = new javax.swing.JSeparator(); showips = new javax.swing.JCheckBox(); newpages = new javax.swing.JCheckBox(); showwatch = new javax.swing.JCheckBox(); jSeparator2 = new javax.swing.JSeparator(); listprecedence = new javax.swing.JCheckBox(); watchuserpages = new javax.swing.JCheckBox(); watchmasschanges = new javax.swing.JCheckBox(); watchpagemoves = new javax.swing.JCheckBox(); watchnewpages = new javax.swing.JCheckBox(); beeptempblack = new javax.swing.JCheckBox(); beeppermblack = new javax.swing.JCheckBox(); beeptempwatch = new javax.swing.JCheckBox(); beeppermwatch = new javax.swing.JCheckBox(); beepregexpblack = new javax.swing.JCheckBox(); beepcollaborationwarning = new javax.swing.JCheckBox(); jSeparator3 = new javax.swing.JSeparator(); rwhiteuser = new javax.swing.JCheckBox(); rwhitepage = new javax.swing.JCheckBox(); rwhitesummary = new javax.swing.JCheckBox(); rblackuser = new javax.swing.JCheckBox(); rblackpage = new javax.swing.JCheckBox(); rblacksummary = new javax.swing.JCheckBox(); jSeparator4 = new javax.swing.JSeparator(); blackreverted = new javax.swing.JCheckBox(); revertedUsers = new javax.swing.JPanel(); revertpermButton = new javax.swing.JRadioButton(); reverttempButton = new javax.swing.JRadioButton(); blackdeleted = new javax.swing.JCheckBox(); speediedUsers = new javax.swing.JPanel(); delpagepermButton = new javax.swing.JRadioButton(); delpagetempButton = new javax.swing.JRadioButton(); watchdeleted = new javax.swing.JCheckBox(); watchspeediedArticles = new javax.swing.JPanel(); watchdelpermButton = new javax.swing.JRadioButton(); watchdeltempButton = new javax.swing.JRadioButton(); watchwarned = new javax.swing.JCheckBox(); watchwarnedPanel = new javax.swing.JPanel(); watchwarnedpermButton = new javax.swing.JRadioButton(); watchwarnedtempButton = new javax.swing.JRadioButton(); jSeparator5 = new javax.swing.JSeparator(); jPanel15 = new javax.swing.JPanel(); exportchooserButton1 = new javax.swing.JButton(); exportField1 = new javax.swing.JTextField(); exportButton1 = new javax.swing.JButton(); jPanel14 = new javax.swing.JPanel(); importchooserButton = new javax.swing.JButton(); importField = new javax.swing.JTextField(); importButton = new javax.swing.JButton(); jSeparator6 = new javax.swing.JSeparator(); risk = new javax.swing.JCheckBox(); jPanel2 = new javax.swing.JPanel(); colorblist = new javax.swing.JCheckBox(); colorblistButton = new javax.swing.JButton(); jPanel4 = new javax.swing.JPanel(); colorwatch = new javax.swing.JCheckBox(); colorwatchButton = new javax.swing.JButton(); jPanel5 = new javax.swing.JPanel(); colorchanged = new javax.swing.JCheckBox(); changedField = new javax.swing.JTextField(); changedField.setText(config.getProperty(STR)); colorchangedButton = new javax.swing.JButton(); jPanel6 = new javax.swing.JPanel(); colornew = new javax.swing.JCheckBox(); colornewButton = new javax.swing.JButton(); jPanel7 = new javax.swing.JPanel(); jPanel78 = new javax.swing.JPanel(); colorips = new javax.swing.JCheckBox(); coloripsButton = new javax.swing.JButton(); colornewusers = new javax.swing.JCheckBox(); colornewusersButton = new javax.swing.JButton(); jPanel8 = new javax.swing.JPanel(); coloruserpage = new javax.swing.JCheckBox(); coloruserpageButton = new javax.swing.JButton(); jPanel9 = new javax.swing.JPanel(); colormoves = new javax.swing.JCheckBox(); colormovesButton = new javax.swing.JButton(); configCtrlsPanel = new javax.swing.JPanel(); configDefaults = new javax.swing.JButton(); configCancel = new javax.swing.JButton(); configSave = new javax.swing.JButton(); IRCPannel = new javax.swing.JPanel(); connectionsPanel = new ConnectionsPanel(this); irctoptopPanel1 = new javax.swing.JPanel(); jPanel19 = new javax.swing.JPanel(); jPanel10 = new javax.swing.JPanel(); vandalism_nl_box = new javax.swing.JCheckBox(); vandalism_fr_box = new javax.swing.JCheckBox(); vandalism_en_box = new javax.swing.JCheckBox(); vandalism_it_box = new javax.swing.JCheckBox(); vandalism_cs_box = new javax.swing.JCheckBox(); jPanel20 = new javax.swing.JPanel(); VandalismStreamButton = new javax.swing.JButton(); jLabel21 = new javax.swing.JLabel(); jSeparator7 = new javax.swing.JSeparator(); jLabel22 = new javax.swing.JLabel(); jPanel13 = new javax.swing.JPanel(); mediawikistreamCheckbox = new javax.swing.JCheckBox(); jPanel16 = new javax.swing.JPanel(); jLabel3 = new javax.swing.JLabel(); channelField = new javax.swing.JTextField(); jLabel4 = new javax.swing.JLabel(); serverField = new javax.swing.JTextField(); jLabel5 = new javax.swing.JLabel(); portField = new javax.swing.JTextField(); jPanel17 = new javax.swing.JPanel(); jPanel27 = new javax.swing.JPanel(); jPanel40 = new javax.swing.JPanel(); jPanel41 = new javax.swing.JPanel(); ircconButton = new javax.swing.JButton(); ircdisconnectButton = new javax.swing.JButton(); jLabel6 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); jLabel9 = new javax.swing.JLabel(); jLabel10 = new javax.swing.JLabel(); jLabel11 = new javax.swing.JLabel(); jLabel12 = new javax.swing.JLabel(); jLabel13 = new javax.swing.JLabel(); jLabel14 = new javax.swing.JLabel(); jLabel15 = new javax.swing.JLabel(); editorPane1 = new JEditorPane(); aboutPanel = new javax.swing.JPanel(); jScrollPane10 = new javax.swing.JScrollPane(); jTextPane1 = new javax.swing.JTextPane(); colorConfigPanel = new javax.swing.JPanel(); colorConfigLabel = new JLabel(); regexpConfigPanel = new javax.swing.JPanel(); regexpConfigLabel = new JLabel(); listsConfigPanel = new javax.swing.JPanel(); listsConfigLabel = new JLabel(); automaticConfigPanel = new javax.swing.JPanel(); automaticConfigLabel = new JLabel(); showConfigPanel = new javax.swing.JPanel(); showConfigLabel = new JLabel(); beepConfigPanel = new javax.swing.JPanel(); beepConfigLabel = new JLabel(); startConfigPanel = new javax.swing.JPanel(); startConfigLabel = new JLabel(); browserConfigPanel = new javax.swing.JPanel(); browserConfigLabel = new JLabel(); userPopupMenu = new JPopupMenu(); userContributionsPopupItem = new JMenuItem(messages .getString(STR)); userTalkPagePopupItem = new JMenuItem(messages .getString(STR)); userBlockPopupItem = new JMenuItem(messages.getString(STR)); user2WhitelistPopupItem = new JMenuItem(messages .getString(STR)); user2GreylistPopupItem = new JMenuItem(messages .getString(STR)); user2BlacklistPopupItem = new JMenuItem(messages .getString(STR)); user2TempWhitelistPopupItem = new JMenuItem(messages .getString(STR)); user2TempBlacklistPopupItem = new JMenuItem(messages .getString(STR)); userNamePopupLabel = new JLabel(); userNamePopupLabel.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 14, 0, 0)); userPopupMenu.add(userContributionsPopupItem); userPopupMenu.add(userTalkPagePopupItem); userPopupMenu.add(userBlockPopupItem); userPopupMenu.addSeparator(); userPopupMenu.add(user2WhitelistPopupItem); userPopupMenu.add(user2GreylistPopupItem); userPopupMenu.add(user2BlacklistPopupItem); userPopupMenu.addSeparator(); userPopupMenu.add(user2TempWhitelistPopupItem); userPopupMenu.add(user2TempBlacklistPopupItem); userPopupMenu.addSeparator(); { JPanel mjp = new JPanel(); mjp.setLayout(new FlowLayout(FlowLayout.LEFT)); userPopupMenu.add(mjp); mjp.add(userNamePopupLabel); } | /**
* 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": "fluffis/VandalFighter",
"path": "src/gui/Vf.java",
"license": "gpl-2.0",
"size": 236798
} | [
"java.awt.FlowLayout",
"java.awt.GridBagConstraints",
"javax.swing.JButton",
"javax.swing.JComboBox",
"javax.swing.JEditorPane",
"javax.swing.JLabel",
"javax.swing.JList",
"javax.swing.JMenuItem",
"javax.swing.JPanel",
"javax.swing.JPopupMenu",
"javax.swing.JScrollPane",
"javax.swing.JTextFiel... | import java.awt.FlowLayout; import java.awt.GridBagConstraints; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JEditorPane; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JMenuItem; import javax.swing.JPanel; import javax.swing.JPopupMenu; import javax.swing.JScrollPane; import javax.swing.JTextField; | import java.awt.*; import javax.swing.*; | [
"java.awt",
"javax.swing"
] | java.awt; javax.swing; | 2,385,624 |
public static Point worldToMiniMap(Client client, int x, int y, int distance)
{
int angle = client.getMapAngle() & 0x7FF;
LocalPoint localLocation = client.getLocalPlayer().getLocalLocation();
x = x / 32 - localLocation.getX() / 32;
y = y / 32 - localLocation.getY() / 32;
int dist = x * x + y * y;
if (dist < distance)
{
int sin = SINE[angle];
int cos = COSINE[angle];
int xx = y * sin + cos * x >> 16;
int yy = sin * x - y * cos >> 16;
int miniMapX = client.isResized()
? client.getCanvas().getWidth() - 167
: Constants.GAME_FIXED_WIDTH - 208;
x = (miniMapX + 167 / 2) + xx;
y = (167 / 2 - 1) + yy;
return new Point(x, y);
}
return null;
} | static Point function(Client client, int x, int y, int distance) { int angle = client.getMapAngle() & 0x7FF; LocalPoint localLocation = client.getLocalPlayer().getLocalLocation(); x = x / 32 - localLocation.getX() / 32; y = y / 32 - localLocation.getY() / 32; int dist = x * x + y * y; if (dist < distance) { int sin = SINE[angle]; int cos = COSINE[angle]; int xx = y * sin + cos * x >> 16; int yy = sin * x - y * cos >> 16; int miniMapX = client.isResized() ? client.getCanvas().getWidth() - 167 : Constants.GAME_FIXED_WIDTH - 208; x = (miniMapX + 167 / 2) + xx; y = (167 / 2 - 1) + yy; return new Point(x, y); } return null; } | /**
* Translates two-dimensional ground coordinates within the 3D world to
* their corresponding coordinates on the Minimap.
*
* @param client
* @param x ground coordinate on the x axis
* @param y ground coordinate on the y axis
* @param distance max distance from local player to minimap point
* @return a {@link Point} on screen corresponding to the position in
* 3D-space
*/ | Translates two-dimensional ground coordinates within the 3D world to their corresponding coordinates on the Minimap | worldToMiniMap | {
"repo_name": "UniquePassive/runelite",
"path": "runelite-api/src/main/java/net/runelite/api/Perspective.java",
"license": "bsd-2-clause",
"size": 20638
} | [
"net.runelite.api.coords.LocalPoint"
] | import net.runelite.api.coords.LocalPoint; | import net.runelite.api.coords.*; | [
"net.runelite.api"
] | net.runelite.api; | 2,585,107 |
public boolean assignFromViewIfValid(View child, RecyclerView.State state) {
RecyclerView.LayoutParams lp = (RecyclerView.LayoutParams) child.getLayoutParams();
if (!lp.isItemRemoved() && lp.getViewPosition() >= 0
&& lp.getViewPosition() < state.getItemCount()) {
assignFromView(child);
return true;
}
return false;
} | boolean function(View child, RecyclerView.State state) { RecyclerView.LayoutParams lp = (RecyclerView.LayoutParams) child.getLayoutParams(); if (!lp.isItemRemoved() && lp.getViewPosition() >= 0 && lp.getViewPosition() < state.getItemCount()) { assignFromView(child); return true; } return false; } | /**
* Assign anchor position information from the provided view if it is valid as a reference
* child.
*/ | Assign anchor position information from the provided view if it is valid as a reference child | assignFromViewIfValid | {
"repo_name": "weiwenqiang/GitHub",
"path": "Subentry/vlayout-master/vlayout/src/main/java/com/alibaba/android/vlayout/ExposeLinearLayoutManagerEx.java",
"license": "apache-2.0",
"size": 79060
} | [
"android.support.v7.widget.RecyclerView",
"android.view.View"
] | import android.support.v7.widget.RecyclerView; import android.view.View; | import android.support.v7.widget.*; import android.view.*; | [
"android.support",
"android.view"
] | android.support; android.view; | 2,717,716 |
public StorageFile getParentDir()
{
return realFile.getParentDir();
} | StorageFile function() { return realFile.getParentDir(); } | /**
* Get the name of the parent directory if this name includes a parent.
*
* @return An StorageFile denoting the parent directory of this StorageFile,
* if it has a parent, null if it does not have a parent.
*/ | Get the name of the parent directory if this name includes a parent | getParentDir | {
"repo_name": "apache/derby",
"path": "java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/util/corruptio/CorruptFile.java",
"license": "apache-2.0",
"size": 12127
} | [
"org.apache.derby.io.StorageFile"
] | import org.apache.derby.io.StorageFile; | import org.apache.derby.io.*; | [
"org.apache.derby"
] | org.apache.derby; | 258,279 |
public void onNewDataReceived(T value) {
behaviorSubject.onNext(Notification.createOnNext(value));
} | void function(T value) { behaviorSubject.onNext(Notification.createOnNext(value)); } | /**
* Method is called when new data is received form firebase.
* @param value new fresh data.
*/ | Method is called when new data is received form firebase | onNewDataReceived | {
"repo_name": "Link184/Respiration",
"path": "respiration-core/src/main/java/com/link184/respiration/repository/base/Repository.java",
"license": "gpl-3.0",
"size": 2664
} | [
"io.reactivex.Notification"
] | import io.reactivex.Notification; | import io.reactivex.*; | [
"io.reactivex"
] | io.reactivex; | 2,308,668 |
protected void createBonusChest()
{
WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest();
for (int i = 0; i < 10; ++i)
{
int j = this.worldInfo.getSpawnX() + this.rand.nextInt(6) - this.rand.nextInt(6);
int k = this.worldInfo.getSpawnZ() + this.rand.nextInt(6) - this.rand.nextInt(6);
BlockPos blockpos = this.getTopSolidOrLiquidBlock(new BlockPos(j, 0, k)).up();
if (worldgeneratorbonuschest.generate(this, this.rand, blockpos))
{
break;
}
}
} | void function() { WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest(); for (int i = 0; i < 10; ++i) { int j = this.worldInfo.getSpawnX() + this.rand.nextInt(6) - this.rand.nextInt(6); int k = this.worldInfo.getSpawnZ() + this.rand.nextInt(6) - this.rand.nextInt(6); BlockPos blockpos = this.getTopSolidOrLiquidBlock(new BlockPos(j, 0, k)).up(); if (worldgeneratorbonuschest.generate(this, this.rand, blockpos)) { break; } } } | /**
* Creates the bonus chest in the world.
*/ | Creates the bonus chest in the world | createBonusChest | {
"repo_name": "SuperUnitato/UnLonely",
"path": "build/tmp/recompileMc/sources/net/minecraft/world/WorldServer.java",
"license": "lgpl-2.1",
"size": 54853
} | [
"net.minecraft.util.math.BlockPos",
"net.minecraft.world.gen.feature.WorldGeneratorBonusChest"
] | import net.minecraft.util.math.BlockPos; import net.minecraft.world.gen.feature.WorldGeneratorBonusChest; | import net.minecraft.util.math.*; import net.minecraft.world.gen.feature.*; | [
"net.minecraft.util",
"net.minecraft.world"
] | net.minecraft.util; net.minecraft.world; | 1,035,221 |
public static boolean addLinks(@NonNull Spannable spannable, @NonNull Pattern pattern,
@Nullable String defaultScheme, @Nullable String[] schemes,
@Nullable MatchFilter matchFilter, @Nullable TransformFilter transformFilter) {
if (shouldAddLinksFallbackToFramework()) {
return Api24Impl.addLinks(spannable, pattern, defaultScheme, schemes, matchFilter,
transformFilter);
}
final String[] schemesCopy;
if (defaultScheme == null) defaultScheme = "";
if (schemes == null || schemes.length < 1) {
schemes = EMPTY_STRING;
}
schemesCopy = new String[schemes.length + 1];
schemesCopy[0] = defaultScheme.toLowerCase(Locale.ROOT);
for (int index = 0; index < schemes.length; index++) {
String scheme = schemes[index];
schemesCopy[index + 1] = (scheme == null) ? "" : scheme.toLowerCase(Locale.ROOT);
}
boolean hasMatches = false;
Matcher m = pattern.matcher(spannable);
while (m.find()) {
int start = m.start();
int end = m.end();
String match = m.group(0);
boolean allowed = true;
if (matchFilter != null) {
allowed = matchFilter.acceptMatch(spannable, start, end);
}
if (allowed && match != null) {
String url = makeUrl(match, schemesCopy, m, transformFilter);
applyLink(url, start, end, spannable);
hasMatches = true;
}
}
return hasMatches;
} | static boolean function(@NonNull Spannable spannable, @NonNull Pattern pattern, @Nullable String defaultScheme, @Nullable String[] schemes, @Nullable MatchFilter matchFilter, @Nullable TransformFilter transformFilter) { if (shouldAddLinksFallbackToFramework()) { return Api24Impl.addLinks(spannable, pattern, defaultScheme, schemes, matchFilter, transformFilter); } final String[] schemesCopy; if (defaultScheme == null) defaultScheme = STR" : scheme.toLowerCase(Locale.ROOT); } boolean hasMatches = false; Matcher m = pattern.matcher(spannable); while (m.find()) { int start = m.start(); int end = m.end(); String match = m.group(0); boolean allowed = true; if (matchFilter != null) { allowed = matchFilter.acceptMatch(spannable, start, end); } if (allowed && match != null) { String url = makeUrl(match, schemesCopy, m, transformFilter); applyLink(url, start, end, spannable); hasMatches = true; } } return hasMatches; } | /**
* Applies a regex to a Spannable turning the matches into links.
*
* @param spannable Spannable whose text is to be marked-up with links.
* @param pattern Regex pattern to be used for finding links.
* @param defaultScheme The default scheme to be prepended to links if the link does not
* start with one of the <code>schemes</code> given.
* @param schemes Array of schemes (eg <code>http://</code>) to check if the link found
* contains a scheme. Passing a null or empty value means prepend defaultScheme
* to all links.
* @param matchFilter The filter that is used to allow the client code additional control
* over which pattern matches are to be converted into links.
* @param transformFilter Filter to allow the client code to update the link found.
*
* @return True if at least one link is found and applied.
*/ | Applies a regex to a Spannable turning the matches into links | addLinks | {
"repo_name": "AndroidX/androidx",
"path": "core/core/src/main/java/androidx/core/text/util/LinkifyCompat.java",
"license": "apache-2.0",
"size": 20796
} | [
"android.text.Spannable",
"android.text.util.Linkify",
"androidx.annotation.NonNull",
"androidx.annotation.Nullable",
"java.util.Locale",
"java.util.regex.Matcher",
"java.util.regex.Pattern"
] | import android.text.Spannable; import android.text.util.Linkify; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import java.util.Locale; import java.util.regex.Matcher; import java.util.regex.Pattern; | import android.text.*; import android.text.util.*; import androidx.annotation.*; import java.util.*; import java.util.regex.*; | [
"android.text",
"androidx.annotation",
"java.util"
] | android.text; androidx.annotation; java.util; | 422,509 |
public static void validateOperation(StockOperation operation) {
if (operation == null) {
throw new IllegalArgumentException("The operation to submit must be defined.");
}
if (operation.getInstanceType() == null) {
throw new APIException("The operation instance type must be defined.");
}
if (operation.getStatus() == null) {
throw new APIException("The operation status must be defined.");
}
IStockOperationType type = operation.getInstanceType();
if (type.getHasSource() && operation.getSource() == null) {
throw new APIException("The operation type (" + type.getName() + ") requires a source stockroom " +
"but one has not been defined.");
}
if (type.getHasDestination() && operation.getDestination() == null) {
throw new APIException("The operation type (" + type.getName() + ") requires a destination " +
"stockroom but one has not been defined.");
}
if (type.getRecipientRequired() && (operation.getPatient() == null && operation.getInstitution() == null)) {
throw new APIException("The operation type (" + type.getName() + ") requires a patient or institution " +
"but one has not been associated.");
}
} | static void function(StockOperation operation) { if (operation == null) { throw new IllegalArgumentException(STR); } if (operation.getInstanceType() == null) { throw new APIException(STR); } if (operation.getStatus() == null) { throw new APIException(STR); } IStockOperationType type = operation.getInstanceType(); if (type.getHasSource() && operation.getSource() == null) { throw new APIException(STR + type.getName() + STR + STR); } if (type.getHasDestination() && operation.getDestination() == null) { throw new APIException(STR + type.getName() + STR + STR); } if (type.getRecipientRequired() && (operation.getPatient() == null && operation.getInstitution() == null)) { throw new APIException(STR + type.getName() + STR + STR); } } | /**
* Validates the stock operation.
* @param operation The stock operation to validate.
* @throws org.openmrs.api.APIException
* @should throw an APIException if the type requires a source and the source is null
* @should throw an APIException if the type requires a destination and the destination is null
* @should throw an APIException if the type requires a patient and the patient is null
*/ | Validates the stock operation | validateOperation | {
"repo_name": "k-joseph/openmrs-module-openhmis.inventory",
"path": "api/src/main/java/org/openmrs/module/openhmis/inventory/api/impl/StockOperationServiceImpl.java",
"license": "mpl-2.0",
"size": 37928
} | [
"org.openmrs.api.APIException",
"org.openmrs.module.openhmis.inventory.api.model.IStockOperationType",
"org.openmrs.module.openhmis.inventory.api.model.StockOperation"
] | import org.openmrs.api.APIException; import org.openmrs.module.openhmis.inventory.api.model.IStockOperationType; import org.openmrs.module.openhmis.inventory.api.model.StockOperation; | import org.openmrs.api.*; import org.openmrs.module.openhmis.inventory.api.model.*; | [
"org.openmrs.api",
"org.openmrs.module"
] | org.openmrs.api; org.openmrs.module; | 1,583,091 |
public GridData getGridData_Station(int vIdx, String stID) {
try {
GridData gData = new GridData();
gData.missingValue = this.getMissingValue();
RandomAccessFile br = new RandomAccessFile(DSET, "r");
int i, stNum, tNum;
STDataHead aSTDH = new STDataHead();
STLevData aSTLevData = new STLevData();
STData aSTData = new STData();
Variable aVar = getUpperVariables().get(vIdx);
int varNum = VARDEF.getVNum();
int uVarNum = getUpperVariables().size();
if (uVarNum > 0) {
varNum = varNum - uVarNum;
}
byte[] aBytes;
gData.xArray = new double[this.getTimeNum()];
for (i = 0; i < this.getTimeNum(); i++) {
gData.xArray[i] = DateUtil.toOADate(this.getTimes().get(i));
}
gData.yArray = new double[aVar.getLevelNum()];
for (i = 0; i < aVar.getLevelNum(); i++) {
gData.yArray[i] = i + 1;
}
gData.data = new double[aVar.getLevelNum()][this.getTimeNum()];
stNum = 0;
tNum = 0;
do {
aBytes = getByteArray(br, 8);
//aSTDH.STID = System.Text.Encoding.Default.GetString(aBytes);
aSTDH.STID = new String(aBytes, "UTF-8");
aBytes = getByteArray(br, 4);
aSTDH.Lat = DataConvert.bytes2Float(aBytes, _byteOrder);
aBytes = getByteArray(br, 4);
aSTDH.Lon = DataConvert.bytes2Float(aBytes, _byteOrder);
aBytes = getByteArray(br, 4);
aSTDH.T = DataConvert.bytes2Float(aBytes, _byteOrder);
aBytes = getByteArray(br, 4);
aSTDH.NLev = DataConvert.bytes2Int(aBytes);
aBytes = getByteArray(br, 4);
aSTDH.Flag = DataConvert.bytes2Int(aBytes);
if (aSTDH.NLev > 0) {
stNum += 1;
aSTData.STHead = aSTDH;
aSTData.dataList = new ArrayList<>();
if (aSTDH.Flag == 1) //Has ground level
{
if (aSTDH.STID.equals(stID)) {
aSTLevData.data = new float[varNum];
for (i = 0; i < varNum; i++) {
aBytes = getByteArray(br, 4);
aSTLevData.data[i] = DataConvert.bytes2Float(aBytes, _byteOrder);
}
aSTLevData.lev = 0;
aSTData.dataList.add(aSTLevData);
} else {
br.skipBytes(varNum * 4);
}
}
if (aSTDH.NLev - aSTDH.Flag > 0) //Has upper level
{
if (aSTDH.STID.equals(stID)) {
for (i = 0; i < aSTDH.NLev - aSTDH.Flag; i++) {
br.skipBytes(4 + vIdx * 4);
aBytes = getByteArray(br, 4);
gData.data[i][tNum] = DataConvert.bytes2Float(aBytes, _byteOrder);
br.skipBytes((uVarNum - vIdx - 1) * 4);
}
} else {
br.skipBytes((aSTDH.NLev - aSTDH.Flag) * (uVarNum + 1) * 4);
}
}
} else //End of time seriel
{
stNum = 0;
if (tNum == getTimes().size() - 1) {
break;
}
tNum += 1;
if (br.getFilePointer() + 28 >= br.length()) {
break;
}
}
} while (true);
br.close();
return gData;
} catch (FileNotFoundException ex) {
Logger.getLogger(GrADSDataInfo.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(GrADSDataInfo.class.getName()).log(Level.SEVERE, null, ex);
}
return null;
}
| GridData function(int vIdx, String stID) { try { GridData gData = new GridData(); gData.missingValue = this.getMissingValue(); RandomAccessFile br = new RandomAccessFile(DSET, "r"); int i, stNum, tNum; STDataHead aSTDH = new STDataHead(); STLevData aSTLevData = new STLevData(); STData aSTData = new STData(); Variable aVar = getUpperVariables().get(vIdx); int varNum = VARDEF.getVNum(); int uVarNum = getUpperVariables().size(); if (uVarNum > 0) { varNum = varNum - uVarNum; } byte[] aBytes; gData.xArray = new double[this.getTimeNum()]; for (i = 0; i < this.getTimeNum(); i++) { gData.xArray[i] = DateUtil.toOADate(this.getTimes().get(i)); } gData.yArray = new double[aVar.getLevelNum()]; for (i = 0; i < aVar.getLevelNum(); i++) { gData.yArray[i] = i + 1; } gData.data = new double[aVar.getLevelNum()][this.getTimeNum()]; stNum = 0; tNum = 0; do { aBytes = getByteArray(br, 8); aSTDH.STID = new String(aBytes, "UTF-8"); aBytes = getByteArray(br, 4); aSTDH.Lat = DataConvert.bytes2Float(aBytes, _byteOrder); aBytes = getByteArray(br, 4); aSTDH.Lon = DataConvert.bytes2Float(aBytes, _byteOrder); aBytes = getByteArray(br, 4); aSTDH.T = DataConvert.bytes2Float(aBytes, _byteOrder); aBytes = getByteArray(br, 4); aSTDH.NLev = DataConvert.bytes2Int(aBytes); aBytes = getByteArray(br, 4); aSTDH.Flag = DataConvert.bytes2Int(aBytes); if (aSTDH.NLev > 0) { stNum += 1; aSTData.STHead = aSTDH; aSTData.dataList = new ArrayList<>(); if (aSTDH.Flag == 1) { if (aSTDH.STID.equals(stID)) { aSTLevData.data = new float[varNum]; for (i = 0; i < varNum; i++) { aBytes = getByteArray(br, 4); aSTLevData.data[i] = DataConvert.bytes2Float(aBytes, _byteOrder); } aSTLevData.lev = 0; aSTData.dataList.add(aSTLevData); } else { br.skipBytes(varNum * 4); } } if (aSTDH.NLev - aSTDH.Flag > 0) { if (aSTDH.STID.equals(stID)) { for (i = 0; i < aSTDH.NLev - aSTDH.Flag; i++) { br.skipBytes(4 + vIdx * 4); aBytes = getByteArray(br, 4); gData.data[i][tNum] = DataConvert.bytes2Float(aBytes, _byteOrder); br.skipBytes((uVarNum - vIdx - 1) * 4); } } else { br.skipBytes((aSTDH.NLev - aSTDH.Flag) * (uVarNum + 1) * 4); } } } else { stNum = 0; if (tNum == getTimes().size() - 1) { break; } tNum += 1; if (br.getFilePointer() + 28 >= br.length()) { break; } } } while (true); br.close(); return gData; } catch (FileNotFoundException ex) { Logger.getLogger(GrADSDataInfo.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(GrADSDataInfo.class.getName()).log(Level.SEVERE, null, ex); } return null; } | /**
* Get GrADS station data
*
* @param vIdx Variable index
* @param stID Station identifer
* @return Grid data
*/ | Get GrADS station data | getGridData_Station | {
"repo_name": "meteoinfo/meteoinfolib",
"path": "src/org/meteoinfo/data/meteodata/grads/GrADSDataInfo.java",
"license": "lgpl-3.0",
"size": 115651
} | [
"java.io.FileNotFoundException",
"java.io.IOException",
"java.io.RandomAccessFile",
"java.util.ArrayList",
"java.util.logging.Level",
"java.util.logging.Logger",
"org.meteoinfo.data.GridData",
"org.meteoinfo.data.meteodata.Variable",
"org.meteoinfo.global.DataConvert",
"org.meteoinfo.global.util.D... | import java.io.FileNotFoundException; import java.io.IOException; import java.io.RandomAccessFile; import java.util.ArrayList; import java.util.logging.Level; import java.util.logging.Logger; import org.meteoinfo.data.GridData; import org.meteoinfo.data.meteodata.Variable; import org.meteoinfo.global.DataConvert; import org.meteoinfo.global.util.DateUtil; | import java.io.*; import java.util.*; import java.util.logging.*; import org.meteoinfo.data.*; import org.meteoinfo.data.meteodata.*; import org.meteoinfo.global.*; import org.meteoinfo.global.util.*; | [
"java.io",
"java.util",
"org.meteoinfo.data",
"org.meteoinfo.global"
] | java.io; java.util; org.meteoinfo.data; org.meteoinfo.global; | 561,807 |
@RequestMapping(method = RequestMethod.GET, value = CONCEPT_REFERENCE_TERM_FORM_URL)
public String showForm() {
return CONCEPT_REFERENCE_TERM_FORM;
}
| @RequestMapping(method = RequestMethod.GET, value = CONCEPT_REFERENCE_TERM_FORM_URL) String function() { return CONCEPT_REFERENCE_TERM_FORM; } | /**
* Processes requests to display the form
*/ | Processes requests to display the form | showForm | {
"repo_name": "pselle/openmrs-core",
"path": "web/src/main/java/org/openmrs/web/controller/concept/ConceptReferenceTermFormController.java",
"license": "mpl-2.0",
"size": 13256
} | [
"org.springframework.web.bind.annotation.RequestMapping",
"org.springframework.web.bind.annotation.RequestMethod"
] | import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; | import org.springframework.web.bind.annotation.*; | [
"org.springframework.web"
] | org.springframework.web; | 224,855 |
public UserLocalService getUserLocalService() {
return userLocalService;
} | UserLocalService function() { return userLocalService; } | /**
* Returns the user local service.
*
* @return the user local service
*/ | Returns the user local service | getUserLocalService | {
"repo_name": "iucn-whp/world-heritage-outlook",
"path": "portlets/iucn-dbservice-portlet/docroot/WEB-INF/src/com/iucn/whp/dbservice/service/base/understanding_benefitsLocalServiceBaseImpl.java",
"license": "gpl-2.0",
"size": 165788
} | [
"com.liferay.portal.service.UserLocalService"
] | import com.liferay.portal.service.UserLocalService; | import com.liferay.portal.service.*; | [
"com.liferay.portal"
] | com.liferay.portal; | 500,242 |
void performPersonMassChange(PersonMassChange personMassChange, List<IacucProtocol> iacucProtocolChangeCandidates); | void performPersonMassChange(PersonMassChange personMassChange, List<IacucProtocol> iacucProtocolChangeCandidates); | /**
* Performs the Person Mass Change on the IACUC Protocols.
*
* @param personMassChange the Person Mass Change to be performed
* @param iacucProtocolChangeCandidates the IACUC Protocols to perform a Person Mass Change on
*/ | Performs the Person Mass Change on the IACUC Protocols | performPersonMassChange | {
"repo_name": "sanjupolus/KC6.oLatest",
"path": "coeus-impl/src/main/java/org/kuali/kra/personmasschange/service/IacucProtocolPersonMassChangeService.java",
"license": "agpl-3.0",
"size": 1889
} | [
"java.util.List",
"org.kuali.kra.iacuc.IacucProtocol",
"org.kuali.kra.personmasschange.bo.PersonMassChange"
] | import java.util.List; import org.kuali.kra.iacuc.IacucProtocol; import org.kuali.kra.personmasschange.bo.PersonMassChange; | import java.util.*; import org.kuali.kra.iacuc.*; import org.kuali.kra.personmasschange.bo.*; | [
"java.util",
"org.kuali.kra"
] | java.util; org.kuali.kra; | 406,942 |
public List<VolatileJavaFile> getEmitted() {
return emitted;
} | List<VolatileJavaFile> function() { return emitted; } | /**
* Returns the emitted files.
* @return the emitted files
*/ | Returns the emitted files | getEmitted | {
"repo_name": "akirakw/asakusafw",
"path": "sandbox-project/asakusa-windgate-dmdl-ext/src/test/java/com/asakusafw/dmdl/windgate/stream/driver/VolatileEmitter.java",
"license": "apache-2.0",
"size": 2007
} | [
"com.asakusafw.utils.java.jsr199.testing.VolatileJavaFile",
"java.util.List"
] | import com.asakusafw.utils.java.jsr199.testing.VolatileJavaFile; import java.util.List; | import com.asakusafw.utils.java.jsr199.testing.*; import java.util.*; | [
"com.asakusafw.utils",
"java.util"
] | com.asakusafw.utils; java.util; | 1,920,929 |
@Test
public void testOldConverter284() {
ICodePage cp = CharMappings.getCodePage("284");
assertNotNull("At least an ASCII Codepage should be available.", cp);
for (int i = 0; i < TESTSTRING.length; i++) {
final char beginvalue = TESTSTRING[i];
final byte converted = cp.uni2ebcdic(beginvalue);
final char afterall = cp.ebcdic2uni(converted & 0xFF);
assertEquals("Testing item #" + i, beginvalue, afterall);
}
}
| void function() { ICodePage cp = CharMappings.getCodePage("284"); assertNotNull(STR, cp); for (int i = 0; i < TESTSTRING.length; i++) { final char beginvalue = TESTSTRING[i]; final byte converted = cp.uni2ebcdic(beginvalue); final char afterall = cp.ebcdic2uni(converted & 0xFF); assertEquals(STR + i, beginvalue, afterall); } } | /**
* Correctness test for old implementation ....
*/ | Correctness test for old implementation ... | testOldConverter284 | {
"repo_name": "tn5250j/tn5250j",
"path": "tests/org/tn5250j/encoding/builtin/CCSID284Test.java",
"license": "gpl-2.0",
"size": 3691
} | [
"org.junit.Assert",
"org.tn5250j.encoding.CharMappings",
"org.tn5250j.encoding.ICodePage"
] | import org.junit.Assert; import org.tn5250j.encoding.CharMappings; import org.tn5250j.encoding.ICodePage; | import org.junit.*; import org.tn5250j.encoding.*; | [
"org.junit",
"org.tn5250j.encoding"
] | org.junit; org.tn5250j.encoding; | 2,080,738 |
TestSuite suite = new TestSuite ( ServerActiveHtmlAttributesTest.class );
return suite;
}
| TestSuite suite = new TestSuite ( ServerActiveHtmlAttributesTest.class ); return suite; } | /**
* A <code>TestSuite</code> is a <code>Composite</code> of Tests.
* It runs a collection of test cases.
*
* This constructor creates a suite with all the methods
* starting with "test" that take no arguments.
*/ | A <code>TestSuite</code> is a <code>Composite</code> of Tests. It runs a collection of test cases. This constructor creates a suite with all the methods starting with "test" that take no arguments | suite | {
"repo_name": "janekdb/ntropa",
"path": "presentation/wps/src/tests/org/ntropa/build/html/ServerActiveHtmlAttributesTest.java",
"license": "apache-2.0",
"size": 4291
} | [
"junit.framework.TestSuite"
] | import junit.framework.TestSuite; | import junit.framework.*; | [
"junit.framework"
] | junit.framework; | 2,879,439 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.