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
|
|---|---|---|---|---|---|---|---|---|---|---|---|
protected void reportFatalError(String msgId, Object[] args)
throws XNIException {
fErrorReporter.reportError(fEntityScanner, XMLMessageFormatter.XML_DOMAIN,
msgId, args,
XMLErrorReporter.SEVERITY_FATAL_ERROR);
}
|
void function(String msgId, Object[] args) throws XNIException { fErrorReporter.reportError(fEntityScanner, XMLMessageFormatter.XML_DOMAIN, msgId, args, XMLErrorReporter.SEVERITY_FATAL_ERROR); }
|
/**
* Convenience function used in all XML scanners.
*/
|
Convenience function used in all XML scanners
|
reportFatalError
|
{
"repo_name": "lostdj/Jaklin-OpenJDK-JAXP",
"path": "src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLScanner.java",
"license": "gpl-2.0",
"size": 57955
}
|
[
"com.sun.org.apache.xerces.internal.impl.XMLErrorReporter",
"com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter",
"com.sun.org.apache.xerces.internal.xni.XNIException"
] |
import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter; import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter; import com.sun.org.apache.xerces.internal.xni.XNIException;
|
import com.sun.org.apache.xerces.internal.impl.*; import com.sun.org.apache.xerces.internal.impl.msg.*; import com.sun.org.apache.xerces.internal.xni.*;
|
[
"com.sun.org"
] |
com.sun.org;
| 1,556,899
|
protected void setTransformerException(TransformerException e) {
this.transformerException = e;
}
|
void function(TransformerException e) { this.transformerException = e; }
|
/**
* Sets transformer exception thrown at the end of processing.
*/
|
Sets transformer exception thrown at the end of processing
|
setTransformerException
|
{
"repo_name": "backslash47/jzkit",
"path": "attic/jzkit_webapp/src/main/java/com/dawidweiss/xsltfilter/TransformingDocumentHandler.java",
"license": "agpl-3.0",
"size": 16984
}
|
[
"javax.xml.transform.TransformerException"
] |
import javax.xml.transform.TransformerException;
|
import javax.xml.transform.*;
|
[
"javax.xml"
] |
javax.xml;
| 890,931
|
protected void finishRefresh() {
// Initialize lifecycle processor for this context.
initLifecycleProcessor();
// Propagate refresh to lifecycle processor first.
getLifecycleProcessor().onRefresh();
// Publish the final event.
publishEvent(new ContextRefreshedEvent(this));
// Participate in LiveBeansView MBean, if active.
LiveBeansView.registerApplicationContext(this);
}
|
void function() { initLifecycleProcessor(); getLifecycleProcessor().onRefresh(); publishEvent(new ContextRefreshedEvent(this)); LiveBeansView.registerApplicationContext(this); }
|
/**
* Finish the refresh of this context, invoking the LifecycleProcessor's
* onRefresh() method and publishing the
* {@link org.springframework.context.event.ContextRefreshedEvent}.
*/
|
Finish the refresh of this context, invoking the LifecycleProcessor's onRefresh() method and publishing the <code>org.springframework.context.event.ContextRefreshedEvent</code>
|
finishRefresh
|
{
"repo_name": "qobel/esoguproject",
"path": "spring-framework/spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java",
"license": "apache-2.0",
"size": 47683
}
|
[
"org.springframework.context.event.ContextRefreshedEvent"
] |
import org.springframework.context.event.ContextRefreshedEvent;
|
import org.springframework.context.event.*;
|
[
"org.springframework.context"
] |
org.springframework.context;
| 2,564,314
|
protected void addMimeTypePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_FileType_mimeType_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_FileType_mimeType_feature", "_UI_FileType_type"),
GmlPackage.eINSTANCE.getFileType_MimeType(),
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
|
void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), GmlPackage.eINSTANCE.getFileType_MimeType(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); }
|
/**
* This adds a property descriptor for the Mime Type feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
|
This adds a property descriptor for the Mime Type feature.
|
addMimeTypePropertyDescriptor
|
{
"repo_name": "markus1978/citygml4emf",
"path": "de.hub.citygml.emf.ecore.edit/src/net/opengis/gml/provider/FileTypeItemProvider.java",
"license": "apache-2.0",
"size": 8429
}
|
[
"net.opengis.gml.GmlPackage",
"org.eclipse.emf.edit.provider.ComposeableAdapterFactory",
"org.eclipse.emf.edit.provider.ItemPropertyDescriptor"
] |
import net.opengis.gml.GmlPackage; import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
|
import net.opengis.gml.*; import org.eclipse.emf.edit.provider.*;
|
[
"net.opengis.gml",
"org.eclipse.emf"
] |
net.opengis.gml; org.eclipse.emf;
| 370,686
|
void removeJoint(final GJoint pJointToRemove);
void updateConnectors(final GNode pNode);
|
void removeJoint(final GJoint pJointToRemove); void updateConnectors(final GNode pNode);
|
/**
* Calls {@link GNodeSkin#setConnectorSkins(List)} to update a nodes list of
* connectors.
*
* @param pNode
* node to update
* @since 10.02.2016
*/
|
Calls <code>GNodeSkin#setConnectorSkins(List)</code> to update a nodes list of connectors
|
updateConnectors
|
{
"repo_name": "eckig/graph-editor",
"path": "core/src/main/java/de/tesis/dynaware/grapheditor/core/skins/SkinManager.java",
"license": "epl-1.0",
"size": 3483
}
|
[
"de.tesis.dynaware.grapheditor.model.GJoint",
"de.tesis.dynaware.grapheditor.model.GNode"
] |
import de.tesis.dynaware.grapheditor.model.GJoint; import de.tesis.dynaware.grapheditor.model.GNode;
|
import de.tesis.dynaware.grapheditor.model.*;
|
[
"de.tesis.dynaware"
] |
de.tesis.dynaware;
| 109,620
|
@Override
public int addOrReplaceDocumentWithException(String documentURI, VersionContext pipelineDescription, RepositoryDocument document, String authorityNameString, IOutputAddActivity activities)
throws ManifoldCFException, ServiceInterruption, IOException {
HDFSOutputSpecs specs = new HDFSOutputSpecs(getSpecNode(pipelineDescription.getSpecification()));
try {
StringBuffer strBuff = new StringBuffer();
if (specs.getRootPath() != null) {
strBuff.append(specs.getRootPath());
}
strBuff.append("/");
strBuff.append(documentURItoFilePath(documentURI));
Path path = new Path(strBuff.toString());
Long startTime = new Long(System.currentTimeMillis());
createFile(path, document.getBinaryStream(),activities,documentURI);
activities.recordActivity(startTime, INGEST_ACTIVITY, new Long(document.getBinaryLength()), documentURI, "OK", null);
return DOCUMENTSTATUS_ACCEPTED;
} catch (URISyntaxException e) {
activities.recordActivity(null,INGEST_ACTIVITY,new Long(document.getBinaryLength()),documentURI,e.getClass().getSimpleName().toUpperCase(Locale.ROOT),"Failed to write document due to: " + e.getMessage());
handleURISyntaxException(e);
return DOCUMENTSTATUS_REJECTED;
}
}
|
int function(String documentURI, VersionContext pipelineDescription, RepositoryDocument document, String authorityNameString, IOutputAddActivity activities) throws ManifoldCFException, ServiceInterruption, IOException { HDFSOutputSpecs specs = new HDFSOutputSpecs(getSpecNode(pipelineDescription.getSpecification())); try { StringBuffer strBuff = new StringBuffer(); if (specs.getRootPath() != null) { strBuff.append(specs.getRootPath()); } strBuff.append("/"); strBuff.append(documentURItoFilePath(documentURI)); Path path = new Path(strBuff.toString()); Long startTime = new Long(System.currentTimeMillis()); createFile(path, document.getBinaryStream(),activities,documentURI); activities.recordActivity(startTime, INGEST_ACTIVITY, new Long(document.getBinaryLength()), documentURI, "OK", null); return DOCUMENTSTATUS_ACCEPTED; } catch (URISyntaxException e) { activities.recordActivity(null,INGEST_ACTIVITY,new Long(document.getBinaryLength()),documentURI,e.getClass().getSimpleName().toUpperCase(Locale.ROOT),STR + e.getMessage()); handleURISyntaxException(e); return DOCUMENTSTATUS_REJECTED; } }
|
/** Add (or replace) a document in the output data store using the connector.
* This method presumes that the connector object has been configured, and it is thus able to communicate with the output data store should that be
* necessary.
*@param documentURI is the URI of the document. The URI is presumed to be the unique identifier which the output data store will use to process
* and serve the document. This URI is constructed by the repository connector which fetches the document, and is thus universal across all output connectors.
*@param pipelineDescription includes the description string that was constructed for this document by the getOutputDescription() method.
*@param document is the document data to be processed (handed to the output data store).
*@param authorityNameString is the name of the authority responsible for authorizing any access tokens passed in with the repository document. May be null.
*@param activities is the handle to an object that the implementer of a pipeline connector may use to perform operations, such as logging processing activity,
* or sending a modified document to the next stage in the pipeline.
*@return the document status (accepted or permanently rejected).
*@throws IOException only if there's a stream error reading the document data.
*/
|
Add (or replace) a document in the output data store using the connector. This method presumes that the connector object has been configured, and it is thus able to communicate with the output data store should that be necessary
|
addOrReplaceDocumentWithException
|
{
"repo_name": "gladyscarrizales/manifoldcf",
"path": "connectors/hdfs/connector/src/main/java/org/apache/manifoldcf/agents/output/hdfs/HDFSOutputConnector.java",
"license": "apache-2.0",
"size": 38664
}
|
[
"java.io.IOException",
"java.net.URISyntaxException",
"java.util.Locale",
"org.apache.hadoop.fs.Path",
"org.apache.manifoldcf.agents.interfaces.IOutputAddActivity",
"org.apache.manifoldcf.agents.interfaces.RepositoryDocument",
"org.apache.manifoldcf.agents.interfaces.ServiceInterruption",
"org.apache.manifoldcf.core.interfaces.ManifoldCFException",
"org.apache.manifoldcf.core.interfaces.VersionContext"
] |
import java.io.IOException; import java.net.URISyntaxException; import java.util.Locale; import org.apache.hadoop.fs.Path; import org.apache.manifoldcf.agents.interfaces.IOutputAddActivity; import org.apache.manifoldcf.agents.interfaces.RepositoryDocument; import org.apache.manifoldcf.agents.interfaces.ServiceInterruption; import org.apache.manifoldcf.core.interfaces.ManifoldCFException; import org.apache.manifoldcf.core.interfaces.VersionContext;
|
import java.io.*; import java.net.*; import java.util.*; import org.apache.hadoop.fs.*; import org.apache.manifoldcf.agents.interfaces.*; import org.apache.manifoldcf.core.interfaces.*;
|
[
"java.io",
"java.net",
"java.util",
"org.apache.hadoop",
"org.apache.manifoldcf"
] |
java.io; java.net; java.util; org.apache.hadoop; org.apache.manifoldcf;
| 2,861,675
|
@SuppressWarnings("unchecked")
private Map<String, Object> safeSerialize(ObjectMapper mapper, Object bean, String prefix) {
try {
return new HashMap<>(mapper.convertValue(bean, Map.class));
}
catch (Exception ex) {
return new HashMap<>(Collections.singletonMap("error", "Cannot serialize '" + prefix + "'"));
}
}
/**
* Configure Jackson's {@link ObjectMapper} to be used to serialize the
* {@link ConfigurationProperties @ConfigurationProperties} objects into a {@link Map}
|
@SuppressWarnings(STR) Map<String, Object> function(ObjectMapper mapper, Object bean, String prefix) { try { return new HashMap<>(mapper.convertValue(bean, Map.class)); } catch (Exception ex) { return new HashMap<>(Collections.singletonMap("error", STR + prefix + "'")); } } /** * Configure Jackson's {@link ObjectMapper} to be used to serialize the * {@link ConfigurationProperties @ConfigurationProperties} objects into a {@link Map}
|
/**
* Cautiously serialize the bean to a map (returning a map with an error message
* instead of throwing an exception if there is a problem).
* @param mapper the object mapper
* @param bean the source bean
* @param prefix the prefix
* @return the serialized instance
*/
|
Cautiously serialize the bean to a map (returning a map with an error message instead of throwing an exception if there is a problem)
|
safeSerialize
|
{
"repo_name": "wilkinsona/spring-boot",
"path": "spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java",
"license": "apache-2.0",
"size": 15189
}
|
[
"com.fasterxml.jackson.databind.ObjectMapper",
"java.util.Collections",
"java.util.HashMap",
"java.util.Map",
"org.springframework.boot.context.properties.ConfigurationProperties"
] |
import com.fasterxml.jackson.databind.ObjectMapper; import java.util.Collections; import java.util.HashMap; import java.util.Map; import org.springframework.boot.context.properties.ConfigurationProperties;
|
import com.fasterxml.jackson.databind.*; import java.util.*; import org.springframework.boot.context.properties.*;
|
[
"com.fasterxml.jackson",
"java.util",
"org.springframework.boot"
] |
com.fasterxml.jackson; java.util; org.springframework.boot;
| 1,043,362
|
public final Property<ViewProcessor> viewProcessor() {
return metaBean().viewProcessor().createProperty(this);
}
|
final Property<ViewProcessor> function() { return metaBean().viewProcessor().createProperty(this); }
|
/**
* Gets the the {@code viewProcessor} property.
* @return the property, not null
*/
|
Gets the the viewProcessor property
|
viewProcessor
|
{
"repo_name": "McLeodMoores/starling",
"path": "projects/component/src/main/java/com/opengamma/component/factory/engine/JmxManagementServiceFactory.java",
"license": "apache-2.0",
"size": 11772
}
|
[
"com.opengamma.engine.view.ViewProcessor",
"org.joda.beans.Property"
] |
import com.opengamma.engine.view.ViewProcessor; import org.joda.beans.Property;
|
import com.opengamma.engine.view.*; import org.joda.beans.*;
|
[
"com.opengamma.engine",
"org.joda.beans"
] |
com.opengamma.engine; org.joda.beans;
| 866,591
|
public EffectiveNetworkSecurityGroup withNetworkSecurityGroup(SubResource networkSecurityGroup) {
this.networkSecurityGroup = networkSecurityGroup;
return this;
}
|
EffectiveNetworkSecurityGroup function(SubResource networkSecurityGroup) { this.networkSecurityGroup = networkSecurityGroup; return this; }
|
/**
* Set the ID of network security group that is applied.
*
* @param networkSecurityGroup the networkSecurityGroup value to set
* @return the EffectiveNetworkSecurityGroup object itself.
*/
|
Set the ID of network security group that is applied
|
withNetworkSecurityGroup
|
{
"repo_name": "navalev/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/EffectiveNetworkSecurityGroup.java",
"license": "mit",
"size": 3653
}
|
[
"com.microsoft.azure.SubResource"
] |
import com.microsoft.azure.SubResource;
|
import com.microsoft.azure.*;
|
[
"com.microsoft.azure"
] |
com.microsoft.azure;
| 2,130,585
|
public void openActivityOrFragment(Intent intent) {
// Default implementation simply calls startActivity
startActivity(intent);
}
|
void function(Intent intent) { startActivity(intent); }
|
/**
* Takes a given intent and either starts a new activity to handle it (the default behavior),
* or creates/updates a fragment (in the case of a multi-pane activity) that can handle the
* intent.
*
* Must be called from the main (UI) thread.
*/
|
Takes a given intent and either starts a new activity to handle it (the default behavior), or creates/updates a fragment (in the case of a multi-pane activity) that can handle the intent. Must be called from the main (UI) thread
|
openActivityOrFragment
|
{
"repo_name": "HeneryH/AquaNotesBU",
"path": "src/com/heneryh/aquanotes/ui/BaseActivity.java",
"license": "apache-2.0",
"size": 3933
}
|
[
"android.content.Intent"
] |
import android.content.Intent;
|
import android.content.*;
|
[
"android.content"
] |
android.content;
| 1,090,157
|
private void storeFrontChannelSLOParticipantInfo(SAMLSSOServiceProviderDO logoutRequestIssuingSP,
String originalLogoutRequestIssuer,
LogoutRequest logoutRequest, String initialLogoutRequestId,
String sessionIndex, boolean isIdPInitSLO, String relayState,
String returnToURL) {
FrontChannelSLOParticipantInfo frontChannelSLOParticipantInfo =
new FrontChannelSLOParticipantInfo(initialLogoutRequestId, originalLogoutRequestIssuer,
logoutRequestIssuingSP.getIssuer(), sessionIndex, isIdPInitSLO, relayState, returnToURL);
FrontChannelSLOParticipantStore.getInstance().addToCache(logoutRequest.getID(), frontChannelSLOParticipantInfo);
}
|
void function(SAMLSSOServiceProviderDO logoutRequestIssuingSP, String originalLogoutRequestIssuer, LogoutRequest logoutRequest, String initialLogoutRequestId, String sessionIndex, boolean isIdPInitSLO, String relayState, String returnToURL) { FrontChannelSLOParticipantInfo frontChannelSLOParticipantInfo = new FrontChannelSLOParticipantInfo(initialLogoutRequestId, originalLogoutRequestIssuer, logoutRequestIssuingSP.getIssuer(), sessionIndex, isIdPInitSLO, relayState, returnToURL); FrontChannelSLOParticipantStore.getInstance().addToCache(logoutRequest.getID(), frontChannelSLOParticipantInfo); }
|
/**
* Stores information of front-channel session participants in single logout.
*
* @param logoutRequestIssuingSP Logout request issuing service provider
* @param originalLogoutRequestIssuer Original logout request issuer
* @param logoutRequest Logout request
* @param initialLogoutRequestId Logout request id of the original issuer
* @param sessionIndex Session index
* @param isIdPInitSLO is IdP Initiated Single logout
* @param relayState Relay State
* @param returnToURL Return to URL
*/
|
Stores information of front-channel session participants in single logout
|
storeFrontChannelSLOParticipantInfo
|
{
"repo_name": "wso2-extensions/identity-inbound-auth-saml",
"path": "components/org.wso2.carbon.identity.sso.saml/src/main/java/org/wso2/carbon/identity/sso/saml/servlet/SAMLSSOProviderServlet.java",
"license": "apache-2.0",
"size": 110187
}
|
[
"org.opensaml.saml.saml2.core.LogoutRequest",
"org.wso2.carbon.identity.core.model.SAMLSSOServiceProviderDO",
"org.wso2.carbon.identity.sso.saml.FrontChannelSLOParticipantInfo",
"org.wso2.carbon.identity.sso.saml.FrontChannelSLOParticipantStore"
] |
import org.opensaml.saml.saml2.core.LogoutRequest; import org.wso2.carbon.identity.core.model.SAMLSSOServiceProviderDO; import org.wso2.carbon.identity.sso.saml.FrontChannelSLOParticipantInfo; import org.wso2.carbon.identity.sso.saml.FrontChannelSLOParticipantStore;
|
import org.opensaml.saml.saml2.core.*; import org.wso2.carbon.identity.core.model.*; import org.wso2.carbon.identity.sso.saml.*;
|
[
"org.opensaml.saml",
"org.wso2.carbon"
] |
org.opensaml.saml; org.wso2.carbon;
| 2,203,770
|
public void testInstanceName() {
// Flush event list of the event tracker
m_eventTracker.clearEvents();
// Send donuts and check the sender instance name
Event receivedEvent;
for (int i = 0; i < NUMBER_OF_EAH_PROVIDERS; i++) {
m_eahProviders[i].sellDonut();
receivedEvent = m_eventTracker.waitForEvent();
assertEquals(
"The instance name property of the received message must be the same as the sender instance name.",
m_eahProvidersInstances[i].getInstanceName(), receivedEvent
.getProperty("publisher.instance.name"));
}
}
|
void function() { m_eventTracker.clearEvents(); Event receivedEvent; for (int i = 0; i < NUMBER_OF_EAH_PROVIDERS; i++) { m_eahProviders[i].sellDonut(); receivedEvent = m_eventTracker.waitForEvent(); assertEquals( STR, m_eahProvidersInstances[i].getInstanceName(), receivedEvent .getProperty(STR)); } }
|
/**
* Test that the received events contains the instance name of the sender.
*/
|
Test that the received events contains the instance name of the sender
|
testInstanceName
|
{
"repo_name": "boneman1231/org.apache.felix",
"path": "trunk/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/GoodTests.java",
"license": "apache-2.0",
"size": 27827
}
|
[
"org.osgi.service.event.Event"
] |
import org.osgi.service.event.Event;
|
import org.osgi.service.event.*;
|
[
"org.osgi.service"
] |
org.osgi.service;
| 2,093,510
|
public boolean clearResourcePermissions(AuthorizedRolesInformation[] infoList) throws AxisFault {
try {
return cassandraAdminStub.clearResourcePermissions(infoList);
} catch (Exception e) {
throw new AxisFault("Error clear authorization for a resource !", e);
}
}
|
boolean function(AuthorizedRolesInformation[] infoList) throws AxisFault { try { return cassandraAdminStub.clearResourcePermissions(infoList); } catch (Exception e) { throw new AxisFault(STR, e); } }
|
/**
* Clear permissions for a resource
*
* @param infoList AuthorizedRolesInformation List
* @return true if the operation was successful.
* @throws AxisFault For errors during sharing the resource
*/
|
Clear permissions for a resource
|
clearResourcePermissions
|
{
"repo_name": "maheshika/product-ss",
"path": "modules/integration/tests-common/admin-clients/src/main/java/org/wso2/ss/integration/common/clients/CassandraKeyspaceAdminClient.java",
"license": "apache-2.0",
"size": 14920
}
|
[
"org.apache.axis2.AxisFault",
"org.wso2.carbon.cassandra.mgt.stub.ks.xsd.AuthorizedRolesInformation"
] |
import org.apache.axis2.AxisFault; import org.wso2.carbon.cassandra.mgt.stub.ks.xsd.AuthorizedRolesInformation;
|
import org.apache.axis2.*; import org.wso2.carbon.cassandra.mgt.stub.ks.xsd.*;
|
[
"org.apache.axis2",
"org.wso2.carbon"
] |
org.apache.axis2; org.wso2.carbon;
| 1,614,433
|
public static FibexMessage getInstance(Object instancesRepresentation, Object docReference)
{
if(instancesRepresentation instanceof net.asam.xml.fbx.SIGNALINSTANCETYPE)
{
for (int i = 0; i < ((FIBEXDocument)docReference).getFIBEX().getELEMENTS().getSIGNALS().getSIGNALArray().length; i++)
{
if(((FIBEXDocument)docReference).getFIBEX().getELEMENTS().getSIGNALS().getSIGNALArray(i).getID().equals(((SIGNALINSTANCETYPE)instancesRepresentation).getSIGNALREF().getIDREF()))
{
for (int j = 0; j < ((FIBEXDocument)docReference).getFIBEX().getPROCESSINGINFORMATION().getCODINGS().getCODINGArray().length; j++)
{
if(((FIBEXDocument)docReference).getFIBEX().getPROCESSINGINFORMATION().getCODINGS().getCODINGArray(i).getID().equals(((FIBEXDocument)docReference).getFIBEX().getELEMENTS().getSIGNALS().getSIGNALArray(i).getCODINGREF().getIDREF()))
{
return new FibexSignal2_0_1(((FIBEXDocument)docReference).getFIBEX().getELEMENTS().getSIGNALS().getSIGNALArray(i),
instancesRepresentation,
((FIBEXDocument)docReference).getFIBEX().getPROCESSINGINFORMATION().getCODINGS().getCODINGArray(i),
docReference);
}
}
}
}
return null;
}
else
{
return null;
}
}
|
static FibexMessage function(Object instancesRepresentation, Object docReference) { if(instancesRepresentation instanceof net.asam.xml.fbx.SIGNALINSTANCETYPE) { for (int i = 0; i < ((FIBEXDocument)docReference).getFIBEX().getELEMENTS().getSIGNALS().getSIGNALArray().length; i++) { if(((FIBEXDocument)docReference).getFIBEX().getELEMENTS().getSIGNALS().getSIGNALArray(i).getID().equals(((SIGNALINSTANCETYPE)instancesRepresentation).getSIGNALREF().getIDREF())) { for (int j = 0; j < ((FIBEXDocument)docReference).getFIBEX().getPROCESSINGINFORMATION().getCODINGS().getCODINGArray().length; j++) { if(((FIBEXDocument)docReference).getFIBEX().getPROCESSINGINFORMATION().getCODINGS().getCODINGArray(i).getID().equals(((FIBEXDocument)docReference).getFIBEX().getELEMENTS().getSIGNALS().getSIGNALArray(i).getCODINGREF().getIDREF())) { return new FibexSignal2_0_1(((FIBEXDocument)docReference).getFIBEX().getELEMENTS().getSIGNALS().getSIGNALArray(i), instancesRepresentation, ((FIBEXDocument)docReference).getFIBEX().getPROCESSINGINFORMATION().getCODINGS().getCODINGArray(i), docReference); } } } } return null; } else { return null; } }
|
/**
* This method creates and returns a new instance of signal
*
* @param instancesRepresentation
* reference to the instances node
* @param docReference
* reference to the FIBEX document
* @return
* newly created signal
*/
|
This method creates and returns a new instance of signal
|
getInstance
|
{
"repo_name": "PhilippMundhenk/FIBEX-Import-Export",
"path": "FIBEX2.0.1/src/fibex/structures/FibexSignal2_0_1.java",
"license": "mit",
"size": 8564
}
|
[
"net.asam.xml.fbx.FIBEXDocument"
] |
import net.asam.xml.fbx.FIBEXDocument;
|
import net.asam.xml.fbx.*;
|
[
"net.asam.xml"
] |
net.asam.xml;
| 2,061,339
|
private static void validateSslSettings(String exporter, Settings settings) {
final List<String> secureSettings = SSLConfigurationSettings.withoutPrefix()
.getSecureSettingsInUse(settings)
.stream()
.map(Setting::getKey)
.collect(Collectors.toList());
if (secureSettings.isEmpty() == false) {
throw new IllegalStateException("Cannot dynamically update SSL settings for the exporter [" + exporter
+ "] as it depends on the secure setting(s) [" + Strings.collectionToCommaDelimitedString(secureSettings) + "]");
}
}
|
static void function(String exporter, Settings settings) { final List<String> secureSettings = SSLConfigurationSettings.withoutPrefix() .getSecureSettingsInUse(settings) .stream() .map(Setting::getKey) .collect(Collectors.toList()); if (secureSettings.isEmpty() == false) { throw new IllegalStateException(STR + exporter + STR + Strings.collectionToCommaDelimitedString(secureSettings) + "]"); } }
|
/**
* Validates that secure settings are not being used to rebuild the {@link SSLIOSessionStrategy}.
*
* @param exporter Name of the exporter to validate
* @param settings Settings for the exporter
* @throws IllegalStateException if any secure settings are used in the SSL configuration
*/
|
Validates that secure settings are not being used to rebuild the <code>SSLIOSessionStrategy</code>
|
validateSslSettings
|
{
"repo_name": "gingerwizard/elasticsearch",
"path": "x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporter.java",
"license": "apache-2.0",
"size": 45817
}
|
[
"java.util.List",
"java.util.stream.Collectors",
"org.elasticsearch.common.Strings",
"org.elasticsearch.common.settings.Setting",
"org.elasticsearch.common.settings.Settings",
"org.elasticsearch.xpack.core.ssl.SSLConfigurationSettings"
] |
import java.util.List; import java.util.stream.Collectors; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.xpack.core.ssl.SSLConfigurationSettings;
|
import java.util.*; import java.util.stream.*; import org.elasticsearch.common.*; import org.elasticsearch.common.settings.*; import org.elasticsearch.xpack.core.ssl.*;
|
[
"java.util",
"org.elasticsearch.common",
"org.elasticsearch.xpack"
] |
java.util; org.elasticsearch.common; org.elasticsearch.xpack;
| 832,388
|
private void addsuccessors( final DoubleMatrix1D p_nextjumpnode, final ArrayList<DoubleMatrix1D> p_closedlist,
final Set<CJumpPoint> p_openlist, final CJumpPoint p_curnode, final DoubleMatrix1D p_target )
{
if ( !( p_nextjumpnode != null && !p_curnode.coordinate().equals( p_nextjumpnode ) && ( !p_closedlist.contains( p_nextjumpnode ) ) ) )
return;
final CJumpPoint l_jumpnode = new CJumpPoint( p_nextjumpnode, p_curnode );
this.calculateScore( l_jumpnode, p_target );
p_openlist.removeIf( s -> s.coordinate().equals( p_nextjumpnode ) && s.fscore() > l_jumpnode.fscore() );
//checking that the jump point is already exists in open list or not, if yes then check their fscore to make decision
if ( !p_openlist.parallelStream().filter( s -> s.coordinate().equals( p_nextjumpnode ) ).anyMatch( s -> s.fscore() < l_jumpnode.fscore() ) )
p_openlist.add( l_jumpnode );
}
|
void function( final DoubleMatrix1D p_nextjumpnode, final ArrayList<DoubleMatrix1D> p_closedlist, final Set<CJumpPoint> p_openlist, final CJumpPoint p_curnode, final DoubleMatrix1D p_target ) { if ( !( p_nextjumpnode != null && !p_curnode.coordinate().equals( p_nextjumpnode ) && ( !p_closedlist.contains( p_nextjumpnode ) ) ) ) return; final CJumpPoint l_jumpnode = new CJumpPoint( p_nextjumpnode, p_curnode ); this.calculateScore( l_jumpnode, p_target ); p_openlist.removeIf( s -> s.coordinate().equals( p_nextjumpnode ) && s.fscore() > l_jumpnode.fscore() ); if ( !p_openlist.parallelStream().filter( s -> s.coordinate().equals( p_nextjumpnode ) ).anyMatch( s -> s.fscore() < l_jumpnode.fscore() ) ) p_openlist.add( l_jumpnode ); }
|
/**
* Validated successors are added to open list
* @param p_nextjumpnode successors that need to be validated
* @param p_closedlist the list of coordinate that already explored
* @param p_openlist the set of CJumpPoint that will be explored
* @param p_curnode the current node to search for successors
* @param p_target the goal node
*/
|
Validated successors are added to open list
|
addsuccessors
|
{
"repo_name": "flashpixx/RoutingSimulation",
"path": "src/main/java/org/lightjason/examples/pokemon/simulation/algorithm/routing/CJPSPlus.java",
"license": "lgpl-3.0",
"size": 19203
}
|
[
"java.util.ArrayList",
"java.util.Set"
] |
import java.util.ArrayList; import java.util.Set;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,165,385
|
public static String[] toStringArray(Collection<String> collection) {
if (collection == null) {
return null;
}
return collection.toArray(new String[collection.size()]);
}
|
static String[] function(Collection<String> collection) { if (collection == null) { return null; } return collection.toArray(new String[collection.size()]); }
|
/**
* Copy the given Collection into a String array.
* The Collection must contain String elements only.
* @param collection the Collection to copy
* @return the String array ({@code null} if the passed-in
* Collection was {@code null})
*/
|
Copy the given Collection into a String array. The Collection must contain String elements only
|
toStringArray
|
{
"repo_name": "cnlinjie/infrastructure",
"path": "util/src/main/java/com/github/cnlinjie/infrastructure/util/spring/StringUtils.java",
"license": "apache-2.0",
"size": 39809
}
|
[
"java.util.Collection"
] |
import java.util.Collection;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,370,053
|
public static Statistics statisticsOf(List<Statistics> data) {
if (data.isEmpty())
return null;
Iterator<Statistics> iterator = data.iterator();
if (!iterator.hasNext()) {
return null;
}
Statistics first = null;
while (first == null && iterator.hasNext()) {
first = iterator.next();
}
if (first == null)
return null;
int count = first.getCount();
Range range = first.getRange();
double total = first.getAverage() * first.getCount();
double totalSquare = (first.getStdDev() * first.getStdDev() + first.getAverage() * first.getAverage()) * first.getCount();
while (iterator.hasNext()) {
Statistics stats = iterator.next();
range = range.combine(stats.getRange());
total += stats.getAverage() * stats.getCount();
totalSquare += ( stats.getStdDev() * stats.getStdDev() + stats.getAverage() * stats.getAverage() ) * stats.getCount();
count += stats.getCount();
}
double average = total/count;
double stdDev = Math.sqrt(totalSquare / count - average * average);
return new StatisticsImpl(range, count, average, stdDev);
}
|
static Statistics function(List<Statistics> data) { if (data.isEmpty()) return null; Iterator<Statistics> iterator = data.iterator(); if (!iterator.hasNext()) { return null; } Statistics first = null; while (first == null && iterator.hasNext()) { first = iterator.next(); } if (first == null) return null; int count = first.getCount(); Range range = first.getRange(); double total = first.getAverage() * first.getCount(); double totalSquare = (first.getStdDev() * first.getStdDev() + first.getAverage() * first.getAverage()) * first.getCount(); while (iterator.hasNext()) { Statistics stats = iterator.next(); range = range.combine(stats.getRange()); total += stats.getAverage() * stats.getCount(); totalSquare += ( stats.getStdDev() * stats.getStdDev() + stats.getAverage() * stats.getAverage() ) * stats.getCount(); count += stats.getCount(); } double average = total/count; double stdDev = Math.sqrt(totalSquare / count - average * average); return new StatisticsImpl(range, count, average, stdDev); }
|
/**
* Aggregates statistical information.
*
* @param data a list of statistical information
* @return the aggregate of all
*/
|
Aggregates statistical information
|
statisticsOf
|
{
"repo_name": "diirt/diirt",
"path": "util/src/main/java/org/diirt/util/stats/StatisticsUtil.java",
"license": "mit",
"size": 5228
}
|
[
"java.util.Iterator",
"java.util.List"
] |
import java.util.Iterator; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 37,145
|
public void clearCacheEntry(K key) {
Cache<K, V> cache = getBaseCache();
if (cache != null) {
cache.remove(key);
}
}
|
void function(K key) { Cache<K, V> cache = getBaseCache(); if (cache != null) { cache.remove(key); } }
|
/**
* Clears a cache entry.
*
* @param key Key to clear cache.
*/
|
Clears a cache entry
|
clearCacheEntry
|
{
"repo_name": "cdwijayarathna/carbon-identity",
"path": "components/oauth/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth/cache/BaseCache.java",
"license": "apache-2.0",
"size": 2635
}
|
[
"javax.cache.Cache"
] |
import javax.cache.Cache;
|
import javax.cache.*;
|
[
"javax.cache"
] |
javax.cache;
| 1,083,432
|
public static void delete(String path)
{
File deleteFileObj = new File(path);
if (!deleteFileObj.exists())
Dialog.errorBox("Cannot delete file "+path+" because that file\n"+
"doesn't exist!", true);
if (!deleteFileObj.canWrite())
Dialog.errorBox("Cannot delete file "+path+" because that file\n"+
"is write-protected.", true);
if (deleteFileObj.isDirectory())
{//Check to make sure the folder has no files in it.
int filesInDirectory = deleteFileObj.list().length;
if (filesInDirectory > 0)
Dialog.errorBox("Cannot delete folder "+path+" because there\n"+
"are still files in the folder.",true);
}
boolean deleteStatus = deleteFileObj.delete();
if (!deleteStatus)
//Our delete failed, even after all that checking!
Dialog.errorBox("Cannot delete file "+path+" for unknown reason.",
true);
}
|
static void function(String path) { File deleteFileObj = new File(path); if (!deleteFileObj.exists()) Dialog.errorBox(STR+path+STR+ STR, true); if (!deleteFileObj.canWrite()) Dialog.errorBox(STR+path+STR+ STR, true); if (deleteFileObj.isDirectory()) { int filesInDirectory = deleteFileObj.list().length; if (filesInDirectory > 0) Dialog.errorBox(STR+path+STR+ STR,true); } boolean deleteStatus = deleteFileObj.delete(); if (!deleteStatus) Dialog.errorBox(STR+path+STR, true); }
|
/**
* Deletes the file or directory determined by path.
* @param path
*/
|
Deletes the file or directory determined by path
|
delete
|
{
"repo_name": "Carrotlord/MintChime-Editor",
"path": "tools/FileIO.java",
"license": "gpl-3.0",
"size": 14647
}
|
[
"java.io.File"
] |
import java.io.File;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 569,086
|
private void buildHelpDatabase() {
setDataAttribute(getDisplay().getHistory(), ServiceConstants.HELP_TOPICS.TOPIC_REVISIONS.getId());
setDataAttribute(getDisplay().getHistoryDown(), ServiceConstants.HELP_TOPICS.TOPIC_REVISIONS.getId());
setDataAttribute(getDisplay().getSave(), ServiceConstants.HELP_TOPICS.TOPIC_SAVE.getId());
setDataAttribute(getDisplay().getSave(), ServiceConstants.HELP_TOPICS.TOPIC_SAVE.getId());
setDataAttribute(getDisplay().getCsps(), ServiceConstants.HELP_TOPICS.TOPIC_CONTENT_SPECS.getId());
setDataAttribute(getDisplay().getCspsDown(), ServiceConstants.HELP_TOPICS.TOPIC_CONTENT_SPECS.getId());
setDataAttribute(topicViewPresenter.getDisplay().getEditor().titleEditor(), ServiceConstants.HELP_TOPICS.TOPIC_PROPERTY_TITLE.getId());
setDataAttribute(topicViewPresenter.getDisplay().getEditor().getRestTopicDetails(), ServiceConstants.HELP_TOPICS.TOPIC_PROPERTY_REST_ENDPOINT.getId());
setDataAttribute(topicViewPresenter.getDisplay().getEditor().getRestTopicXML(), ServiceConstants.HELP_TOPICS.TOPIC_PROPERTY_REST_XML_ENDPOINT.getId());
setDataAttribute(topicViewPresenter.getDisplay().getEditor().getRestTopicWebDav(), ServiceConstants.HELP_TOPICS.TOPIC_PROPERTY_WEBDAV_URL.getId());
setDataAttribute(topicViewPresenter.getDisplay().getEditor().descriptionEditor(), ServiceConstants.HELP_TOPICS.TOPIC_PROPERTY_DESCRIPTION.getId());
setDataAttribute(topicViewPresenter.getDisplay().getEditor().localeEditor(), ServiceConstants.HELP_TOPICS.TOPIC_PROPERTY_LOCALE.getId());
setDataAttribute(getTopicPropertyTagPresenter().getDisplay().getPossibleChildrenResultsPanel(), ServiceConstants.HELP_TOPICS.TOPIC_AVAILABLE_EXTENDED_PROPERTIES.getId());
setDataAttribute(getTopicPropertyTagPresenter().getDisplay().getExistingChildrenResultsPanel(), ServiceConstants.HELP_TOPICS.TOPIC_EXISTING_EXTENDED_PROPERTIES.getId());
setDataAttribute(searchResultPresenter.getDisplay().getCreate(), ServiceConstants.HELP_TOPICS.TOPIC_CREATE_TOPIC.getId());
setDataAttribute(searchResultPresenter.getDisplay().getBulkImport(), ServiceConstants.HELP_TOPICS.BULK_TOPIC_IMPORT.getId());
setDataAttribute(searchResultPresenter.getDisplay().getBulkOverwrite(), ServiceConstants.HELP_TOPICS.BULK_TOPIC_OVERWRITE.getId());
setDataAttribute(searchResultPresenter.getDisplay().getAtomFeed(), ServiceConstants.HELP_TOPICS.TOPIC_ATOM_FEED.getId());
setDataAttribute(topicRevisionsPresenter.getDisplay().getSearchResultsPanel(), ServiceConstants.HELP_TOPICS.TOPIC_REVISION_TABLE.getId());
setDataAttribute(topicRevisionsPresenter.getDisplay().getDone(), ServiceConstants.HELP_TOPICS.DIFF_DONE.getId());
setDataAttribute(topicRevisionsPresenter.getDisplay().getCancel(), ServiceConstants.HELP_TOPICS.DIFF_CANCEL.getId());
setDataAttribute(topicRevisionsPresenter.getDisplay().getHTMLDone(), ServiceConstants.HELP_TOPICS.RENDERED_DIFF_DONE.getId());
setDataAttribute(topicRevisionsPresenter.getDisplay().getHtmlOpenDiff(), ServiceConstants.HELP_TOPICS.RENDERED_DIFF_NEW_WINDOW.getId());
setDataAttribute(topicRevisionsPresenter.getDisplay().getDiffParent(), ServiceConstants.HELP_TOPICS.TOPIC_DIFF_PANE.getId());
}
|
void function() { setDataAttribute(getDisplay().getHistory(), ServiceConstants.HELP_TOPICS.TOPIC_REVISIONS.getId()); setDataAttribute(getDisplay().getHistoryDown(), ServiceConstants.HELP_TOPICS.TOPIC_REVISIONS.getId()); setDataAttribute(getDisplay().getSave(), ServiceConstants.HELP_TOPICS.TOPIC_SAVE.getId()); setDataAttribute(getDisplay().getSave(), ServiceConstants.HELP_TOPICS.TOPIC_SAVE.getId()); setDataAttribute(getDisplay().getCsps(), ServiceConstants.HELP_TOPICS.TOPIC_CONTENT_SPECS.getId()); setDataAttribute(getDisplay().getCspsDown(), ServiceConstants.HELP_TOPICS.TOPIC_CONTENT_SPECS.getId()); setDataAttribute(topicViewPresenter.getDisplay().getEditor().titleEditor(), ServiceConstants.HELP_TOPICS.TOPIC_PROPERTY_TITLE.getId()); setDataAttribute(topicViewPresenter.getDisplay().getEditor().getRestTopicDetails(), ServiceConstants.HELP_TOPICS.TOPIC_PROPERTY_REST_ENDPOINT.getId()); setDataAttribute(topicViewPresenter.getDisplay().getEditor().getRestTopicXML(), ServiceConstants.HELP_TOPICS.TOPIC_PROPERTY_REST_XML_ENDPOINT.getId()); setDataAttribute(topicViewPresenter.getDisplay().getEditor().getRestTopicWebDav(), ServiceConstants.HELP_TOPICS.TOPIC_PROPERTY_WEBDAV_URL.getId()); setDataAttribute(topicViewPresenter.getDisplay().getEditor().descriptionEditor(), ServiceConstants.HELP_TOPICS.TOPIC_PROPERTY_DESCRIPTION.getId()); setDataAttribute(topicViewPresenter.getDisplay().getEditor().localeEditor(), ServiceConstants.HELP_TOPICS.TOPIC_PROPERTY_LOCALE.getId()); setDataAttribute(getTopicPropertyTagPresenter().getDisplay().getPossibleChildrenResultsPanel(), ServiceConstants.HELP_TOPICS.TOPIC_AVAILABLE_EXTENDED_PROPERTIES.getId()); setDataAttribute(getTopicPropertyTagPresenter().getDisplay().getExistingChildrenResultsPanel(), ServiceConstants.HELP_TOPICS.TOPIC_EXISTING_EXTENDED_PROPERTIES.getId()); setDataAttribute(searchResultPresenter.getDisplay().getCreate(), ServiceConstants.HELP_TOPICS.TOPIC_CREATE_TOPIC.getId()); setDataAttribute(searchResultPresenter.getDisplay().getBulkImport(), ServiceConstants.HELP_TOPICS.BULK_TOPIC_IMPORT.getId()); setDataAttribute(searchResultPresenter.getDisplay().getBulkOverwrite(), ServiceConstants.HELP_TOPICS.BULK_TOPIC_OVERWRITE.getId()); setDataAttribute(searchResultPresenter.getDisplay().getAtomFeed(), ServiceConstants.HELP_TOPICS.TOPIC_ATOM_FEED.getId()); setDataAttribute(topicRevisionsPresenter.getDisplay().getSearchResultsPanel(), ServiceConstants.HELP_TOPICS.TOPIC_REVISION_TABLE.getId()); setDataAttribute(topicRevisionsPresenter.getDisplay().getDone(), ServiceConstants.HELP_TOPICS.DIFF_DONE.getId()); setDataAttribute(topicRevisionsPresenter.getDisplay().getCancel(), ServiceConstants.HELP_TOPICS.DIFF_CANCEL.getId()); setDataAttribute(topicRevisionsPresenter.getDisplay().getHTMLDone(), ServiceConstants.HELP_TOPICS.RENDERED_DIFF_DONE.getId()); setDataAttribute(topicRevisionsPresenter.getDisplay().getHtmlOpenDiff(), ServiceConstants.HELP_TOPICS.RENDERED_DIFF_NEW_WINDOW.getId()); setDataAttribute(topicRevisionsPresenter.getDisplay().getDiffParent(), ServiceConstants.HELP_TOPICS.TOPIC_DIFF_PANE.getId()); }
|
/**
* Assign help info to the UI elements exposed by this presenter.
*/
|
Assign help info to the UI elements exposed by this presenter
|
buildHelpDatabase
|
{
"repo_name": "pressgang-ccms/PressGangCCMSUI",
"path": "src/main/java/org/jboss/pressgang/ccms/ui/client/local/mvp/presenter/topic/searchresults/topics/TopicFilteredResultsAndDetailsPresenter.java",
"license": "gpl-3.0",
"size": 214511
}
|
[
"org.jboss.pressgang.ccms.ui.client.local.constants.ServiceConstants"
] |
import org.jboss.pressgang.ccms.ui.client.local.constants.ServiceConstants;
|
import org.jboss.pressgang.ccms.ui.client.local.constants.*;
|
[
"org.jboss.pressgang"
] |
org.jboss.pressgang;
| 2,436,875
|
public static void launchToMarketplace(final Context context, final String action)
{
final Uri intentUri = Uri.parse("market://search?q=pname:" + action);
final Intent intent = new Intent(Intent.ACTION_VIEW, intentUri);
context.startActivity(intent);
}
|
static void function(final Context context, final String action) { final Uri intentUri = Uri.parse("market: final Intent intent = new Intent(Intent.ACTION_VIEW, intentUri); context.startActivity(intent); }
|
/**
* Launches to the specific app in the Android Marketplace.
*
* @param context Application or Activity context
* @param action Desired action
*/
|
Launches to the specific app in the Android Marketplace
|
launchToMarketplace
|
{
"repo_name": "nicjansma/com.nicjansma.library",
"path": "src/com/nicjansma/library/android/AndroidUtils.java",
"license": "mit",
"size": 4528
}
|
[
"android.content.Context",
"android.content.Intent",
"android.net.Uri"
] |
import android.content.Context; import android.content.Intent; import android.net.Uri;
|
import android.content.*; import android.net.*;
|
[
"android.content",
"android.net"
] |
android.content; android.net;
| 1,282,367
|
public void setFromReference(EntityReferenceDefinition reference, String mapId) {
setName(reference.name);
id = String.format("%s@%s(%d,%d)", reference.name, mapId, reference.x, reference.y);
position.x = reference.x * Config.tileWidth + Config.tileWidth / 2;
position.y = reference.y * Config.tileWidth + Config.tileWidth / 2;
args.clear();
args.addAll(reference.arg1, reference.arg2, reference.arg3);
}
|
void function(EntityReferenceDefinition reference, String mapId) { setName(reference.name); id = String.format(STR, reference.name, mapId, reference.x, reference.y); position.x = reference.x * Config.tileWidth + Config.tileWidth / 2; position.y = reference.y * Config.tileWidth + Config.tileWidth / 2; args.clear(); args.addAll(reference.arg1, reference.arg2, reference.arg3); }
|
/** Given an {@link EntityReferenceDefinition}, sets the relevant fields of
* the entity.
* @param reference an {@link EntityReferenceDefinition} to use when
* updating this entity.
* @param mapId */
|
Given an <code>EntityReferenceDefinition</code>, sets the relevant fields of the entity
|
setFromReference
|
{
"repo_name": "adketuri/umbracraft",
"path": "core/src/net/alcuria/umbracraft/engine/entities/Entity.java",
"license": "mit",
"size": 6411
}
|
[
"net.alcuria.umbracraft.Config",
"net.alcuria.umbracraft.definitions.map.EntityReferenceDefinition"
] |
import net.alcuria.umbracraft.Config; import net.alcuria.umbracraft.definitions.map.EntityReferenceDefinition;
|
import net.alcuria.umbracraft.*; import net.alcuria.umbracraft.definitions.map.*;
|
[
"net.alcuria.umbracraft"
] |
net.alcuria.umbracraft;
| 1,769,058
|
@Generated
@Selector("startTaskToRender:toDestination:error:")
public native CIRenderTask startTaskToRenderToDestinationError(CIImage image, CIRenderDestination destination,
@ReferenceInfo(type = NSError.class) Ptr<NSError> error);
|
@Selector(STR) native CIRenderTask function(CIImage image, CIRenderDestination destination, @ReferenceInfo(type = NSError.class) Ptr<NSError> error);
|
/**
* Renders an image to a destination so that point (0,0) of image.
* is placed at point (0,0) of the destination.
*/
|
Renders an image to a destination so that point (0,0) of image. is placed at point (0,0) of the destination
|
startTaskToRenderToDestinationError
|
{
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/coreimage/CIContext.java",
"license": "apache-2.0",
"size": 28137
}
|
[
"org.moe.natj.general.ann.ReferenceInfo",
"org.moe.natj.general.ptr.Ptr",
"org.moe.natj.objc.ann.Selector"
] |
import org.moe.natj.general.ann.ReferenceInfo; import org.moe.natj.general.ptr.Ptr; import org.moe.natj.objc.ann.Selector;
|
import org.moe.natj.general.ann.*; import org.moe.natj.general.ptr.*; import org.moe.natj.objc.ann.*;
|
[
"org.moe.natj"
] |
org.moe.natj;
| 1,447,646
|
public Collection<BudgetConstructionSubFundPick> retrieveSubFundList(String principalId);
|
Collection<BudgetConstructionSubFundPick> function(String principalId);
|
/**
* Retrieves sub funds that are available for selection by the given user.
*
* @param principalId - current user who is running the report
* @return Collection<BudgetConstructionSubFundPick> that are selected by the given user
*/
|
Retrieves sub funds that are available for selection by the given user
|
retrieveSubFundList
|
{
"repo_name": "Ariah-Group/Finance",
"path": "af_webapp/src/main/java/org/kuali/kfs/module/bc/document/service/BudgetReportsControlListService.java",
"license": "apache-2.0",
"size": 5106
}
|
[
"java.util.Collection",
"org.kuali.kfs.module.bc.businessobject.BudgetConstructionSubFundPick"
] |
import java.util.Collection; import org.kuali.kfs.module.bc.businessobject.BudgetConstructionSubFundPick;
|
import java.util.*; import org.kuali.kfs.module.bc.businessobject.*;
|
[
"java.util",
"org.kuali.kfs"
] |
java.util; org.kuali.kfs;
| 1,734,760
|
@Override
protected DataObject getFixture() {
return (DataObject) fixture;
}
|
DataObject function() { return (DataObject) fixture; }
|
/**
* Returns the fixture for this Data Object test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
|
Returns the fixture for this Data Object test case.
|
getFixture
|
{
"repo_name": "adbrucker/SecureBPMN",
"path": "designer/src/org.activiti.designer.model.tests/src/org/eclipse/bpmn2/tests/DataObjectTest.java",
"license": "apache-2.0",
"size": 1825
}
|
[
"org.eclipse.bpmn2.DataObject"
] |
import org.eclipse.bpmn2.DataObject;
|
import org.eclipse.bpmn2.*;
|
[
"org.eclipse.bpmn2"
] |
org.eclipse.bpmn2;
| 2,660,381
|
public void onWakeLockReleased(int flags, String tag, String packageName,
int ownerUid, int ownerPid, WorkSource workSource, String historyTag) {
if (DEBUG) {
Slog.d(TAG, "onWakeLockReleased: flags=" + flags + ", tag=\"" + tag
+ "\", packageName=" + packageName
+ ", ownerUid=" + ownerUid + ", ownerPid=" + ownerPid
+ ", workSource=" + workSource);
}
final int monitorType = getBatteryStatsWakeLockMonitorType(flags);
if (monitorType >= 0) {
try {
if (workSource != null) {
mBatteryStats.noteStopWakelockFromSource(workSource, ownerPid, tag,
historyTag, monitorType);
} else {
mBatteryStats.noteStopWakelock(ownerUid, ownerPid, tag,
historyTag, monitorType);
mAppOps.finishOperation(AppOpsManager.getToken(mAppOps),
AppOpsManager.OP_WAKE_LOCK, ownerUid, packageName);
}
} catch (RemoteException ex) {
// Ignore
}
}
}
|
void function(int flags, String tag, String packageName, int ownerUid, int ownerPid, WorkSource workSource, String historyTag) { if (DEBUG) { Slog.d(TAG, STR + flags + STRSTR\STR + packageName + STR + ownerUid + STR + ownerPid + STR + workSource); } final int monitorType = getBatteryStatsWakeLockMonitorType(flags); if (monitorType >= 0) { try { if (workSource != null) { mBatteryStats.noteStopWakelockFromSource(workSource, ownerPid, tag, historyTag, monitorType); } else { mBatteryStats.noteStopWakelock(ownerUid, ownerPid, tag, historyTag, monitorType); mAppOps.finishOperation(AppOpsManager.getToken(mAppOps), AppOpsManager.OP_WAKE_LOCK, ownerUid, packageName); } } catch (RemoteException ex) { } } }
|
/**
* Called when a wake lock is released.
*/
|
Called when a wake lock is released
|
onWakeLockReleased
|
{
"repo_name": "Ant-Droid/android_frameworks_base_OLD",
"path": "services/core/java/com/android/server/power/Notifier.java",
"license": "apache-2.0",
"size": 27303
}
|
[
"android.app.AppOpsManager",
"android.os.RemoteException",
"android.os.WorkSource",
"android.util.Slog"
] |
import android.app.AppOpsManager; import android.os.RemoteException; import android.os.WorkSource; import android.util.Slog;
|
import android.app.*; import android.os.*; import android.util.*;
|
[
"android.app",
"android.os",
"android.util"
] |
android.app; android.os; android.util;
| 130,029
|
private void processPartition(GridDhtLocalPartition part, SchemaIndexCacheVisitorClosure clo)
throws IgniteCheckedException {
checkCancelled();
boolean reserved = false;
if (part != null && part.state() != EVICTED)
reserved = (part.state() == OWNING || part.state() == RENTING) && part.reserve();
if (!reserved)
return;
try {
GridCursor<? extends CacheDataRow> cursor = part.dataStore().cursor(cctx.cacheId(), null, null,
CacheDataRowAdapter.RowData.KEY_ONLY);
boolean locked = false;
try {
int cntr = 0;
while (cursor.next() && !stop) {
KeyCacheObject key = cursor.get().key();
if (!locked) {
cctx.shared().database().checkpointReadLock();
locked = true;
}
processKey(key, clo);
if (++cntr % BATCH_SIZE == 0) {
cctx.shared().database().checkpointReadUnlock();
locked = false;
}
if (part.state() == RENTING)
break;
}
}
finally {
if (locked)
cctx.shared().database().checkpointReadUnlock();
}
}
finally {
part.release();
}
}
|
void function(GridDhtLocalPartition part, SchemaIndexCacheVisitorClosure clo) throws IgniteCheckedException { checkCancelled(); boolean reserved = false; if (part != null && part.state() != EVICTED) reserved = (part.state() == OWNING part.state() == RENTING) && part.reserve(); if (!reserved) return; try { GridCursor<? extends CacheDataRow> cursor = part.dataStore().cursor(cctx.cacheId(), null, null, CacheDataRowAdapter.RowData.KEY_ONLY); boolean locked = false; try { int cntr = 0; while (cursor.next() && !stop) { KeyCacheObject key = cursor.get().key(); if (!locked) { cctx.shared().database().checkpointReadLock(); locked = true; } processKey(key, clo); if (++cntr % BATCH_SIZE == 0) { cctx.shared().database().checkpointReadUnlock(); locked = false; } if (part.state() == RENTING) break; } } finally { if (locked) cctx.shared().database().checkpointReadUnlock(); } } finally { part.release(); } }
|
/**
* Process partition.
*
* @param part Partition.
* @param clo Index closure.
* @throws IgniteCheckedException If failed.
*/
|
Process partition
|
processPartition
|
{
"repo_name": "amirakhmedov/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/query/schema/SchemaIndexCacheVisitorImpl.java",
"license": "apache-2.0",
"size": 10767
}
|
[
"org.apache.ignite.IgniteCheckedException",
"org.apache.ignite.internal.processors.cache.KeyCacheObject",
"org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLocalPartition",
"org.apache.ignite.internal.processors.cache.persistence.CacheDataRow",
"org.apache.ignite.internal.processors.cache.persistence.CacheDataRowAdapter",
"org.apache.ignite.internal.util.lang.GridCursor"
] |
import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.internal.processors.cache.KeyCacheObject; import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLocalPartition; import org.apache.ignite.internal.processors.cache.persistence.CacheDataRow; import org.apache.ignite.internal.processors.cache.persistence.CacheDataRowAdapter; import org.apache.ignite.internal.util.lang.GridCursor;
|
import org.apache.ignite.*; import org.apache.ignite.internal.processors.cache.*; import org.apache.ignite.internal.processors.cache.distributed.dht.*; import org.apache.ignite.internal.processors.cache.persistence.*; import org.apache.ignite.internal.util.lang.*;
|
[
"org.apache.ignite"
] |
org.apache.ignite;
| 440,114
|
public static List execute(ExecutablePool pool,
String region,
List keys,
InterestResultPolicy policy,
boolean isDurable,
boolean receiveUpdatesAsInvalidates,
byte regionDataPolicy)
{
AbstractOp op = new RegisterInterestListOpImpl(pool.getLoggerI18n(),
region, keys, policy, isDurable, receiveUpdatesAsInvalidates,
regionDataPolicy);
return (List) pool.executeOnQueuesAndReturnPrimaryResult(op);
}
private RegisterInterestListOp() {
// no instances allowed
}
|
static List function(ExecutablePool pool, String region, List keys, InterestResultPolicy policy, boolean isDurable, boolean receiveUpdatesAsInvalidates, byte regionDataPolicy) { AbstractOp op = new RegisterInterestListOpImpl(pool.getLoggerI18n(), region, keys, policy, isDurable, receiveUpdatesAsInvalidates, regionDataPolicy); return (List) pool.executeOnQueuesAndReturnPrimaryResult(op); } private RegisterInterestListOp() { }
|
/**
* Does a region registerInterestList on a server using connections from the given pool
* to communicate with the server.
* @param pool the pool to use to communicate with the server.
* @param region the name of the region to do the registerInterestList on
* @param keys list of keys we are interested in
* @param policy the interest result policy for this registration
* @param isDurable true if this registration is durable
* @param regionDataPolicy the data policy ordinal of the region
* @return list of keys
*/
|
Does a region registerInterestList on a server using connections from the given pool to communicate with the server
|
execute
|
{
"repo_name": "papicella/snappy-store",
"path": "gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/internal/RegisterInterestListOp.java",
"license": "apache-2.0",
"size": 6634
}
|
[
"com.gemstone.gemfire.cache.InterestResultPolicy",
"java.util.List"
] |
import com.gemstone.gemfire.cache.InterestResultPolicy; import java.util.List;
|
import com.gemstone.gemfire.cache.*; import java.util.*;
|
[
"com.gemstone.gemfire",
"java.util"
] |
com.gemstone.gemfire; java.util;
| 1,331,471
|
public int updateProgress() {
PlayerControl playerControl = getLayerManager().getControl();
if (playerControl == null || isSeekbarDragging) {
return 0;
}
int position = playerControl.getCurrentPosition();
int duration = playerControl.getDuration();
if (seekBar != null) {
if (duration > 0) {
long pos = 1000L * position / duration;
seekBar.setProgress((int) pos);
}
int percent = playerControl.getBufferPercentage();
seekBar.setSecondaryProgress(percent * 10);
}
if (endTime != null) {
endTime.setText(stringForTime(duration));
}
if (currentTime != null) {
currentTime.setText(stringForTime(position));
}
return position;
}
|
int function() { PlayerControl playerControl = getLayerManager().getControl(); if (playerControl == null isSeekbarDragging) { return 0; } int position = playerControl.getCurrentPosition(); int duration = playerControl.getDuration(); if (seekBar != null) { if (duration > 0) { long pos = 1000L * position / duration; seekBar.setProgress((int) pos); } int percent = playerControl.getBufferPercentage(); seekBar.setSecondaryProgress(percent * 10); } if (endTime != null) { endTime.setText(stringForTime(duration)); } if (currentTime != null) { currentTime.setText(stringForTime(position)); } return position; }
|
/**
* Adjust the position of the action bar to reflect the progress of the video.
*/
|
Adjust the position of the action bar to reflect the progress of the video
|
updateProgress
|
{
"repo_name": "kaltura/player-sdk-native-android",
"path": "googlemediaframework/src/main/java/com/google/android/libraries/mediaframework/layeredvideo/PlaybackControlLayer.java",
"license": "agpl-3.0",
"size": 35742
}
|
[
"com.google.android.exoplayer.util.PlayerControl"
] |
import com.google.android.exoplayer.util.PlayerControl;
|
import com.google.android.exoplayer.util.*;
|
[
"com.google.android"
] |
com.google.android;
| 1,140,104
|
public String getMethodSpecifierAttributeName(Function m) {
return suffixName(Suffix.$specifier$, m.getName());
}
|
String function(Function m) { return suffixName(Suffix.$specifier$, m.getName()); }
|
/**
* Makes a name for a local attribute where we store a method specifier
*/
|
Makes a name for a local attribute where we store a method specifier
|
getMethodSpecifierAttributeName
|
{
"repo_name": "ceylon/ceylon-compiler",
"path": "src/com/redhat/ceylon/compiler/java/codegen/Naming.java",
"license": "gpl-2.0",
"size": 79137
}
|
[
"com.redhat.ceylon.model.typechecker.model.Function"
] |
import com.redhat.ceylon.model.typechecker.model.Function;
|
import com.redhat.ceylon.model.typechecker.model.*;
|
[
"com.redhat.ceylon"
] |
com.redhat.ceylon;
| 2,167,283
|
public boolean isKnownPublisher(URI sourceURI) {
if (nonJMSPublishers.contains(sourceURI.getAuthority())) {
return true;
}
else {
JMSConnectionInfo connInfo = publisherJMSConnInfoMap.get(sourceURI.getAuthority());
return connInfo == null ? (getJMSConnectionInfo(sourceURI) != null) : true;
}
}
|
boolean function(URI sourceURI) { if (nonJMSPublishers.contains(sourceURI.getAuthority())) { return true; } else { JMSConnectionInfo connInfo = publisherJMSConnInfoMap.get(sourceURI.getAuthority()); return connInfo == null ? (getJMSConnectionInfo(sourceURI) != null) : true; } }
|
/**
* Determine whether a given source URI publishes JMS messages
*
* @param sourceURI URI of the publisher
* @return true if we have JMS connection information for the source URI, else false
*/
|
Determine whether a given source URI publishes JMS messages
|
isKnownPublisher
|
{
"repo_name": "cbaenziger/oozie",
"path": "core/src/main/java/org/apache/oozie/service/HCatAccessorService.java",
"license": "apache-2.0",
"size": 11089
}
|
[
"org.apache.oozie.jms.JMSConnectionInfo"
] |
import org.apache.oozie.jms.JMSConnectionInfo;
|
import org.apache.oozie.jms.*;
|
[
"org.apache.oozie"
] |
org.apache.oozie;
| 298,478
|
YarnApplicationAttemptState createApplicationAttemptState();
/**
* Create the Application attempt report from the {@link RMAppAttempt}
*
* @return {@link ApplicationAttemptReport}
|
YarnApplicationAttemptState createApplicationAttemptState(); /** * Create the Application attempt report from the {@link RMAppAttempt} * * @return {@link ApplicationAttemptReport}
|
/**
* Create the external user-facing state of the attempt of ApplicationMaster
* from the current state of the {@link RMAppAttempt}.
*
* @return the external user-facing state of the attempt ApplicationMaster.
*/
|
Create the external user-facing state of the attempt of ApplicationMaster from the current state of the <code>RMAppAttempt</code>
|
createApplicationAttemptState
|
{
"repo_name": "JingchengDu/hadoop",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/attempt/RMAppAttempt.java",
"license": "apache-2.0",
"size": 8983
}
|
[
"org.apache.hadoop.yarn.api.records.ApplicationAttemptReport",
"org.apache.hadoop.yarn.api.records.YarnApplicationAttemptState"
] |
import org.apache.hadoop.yarn.api.records.ApplicationAttemptReport; import org.apache.hadoop.yarn.api.records.YarnApplicationAttemptState;
|
import org.apache.hadoop.yarn.api.records.*;
|
[
"org.apache.hadoop"
] |
org.apache.hadoop;
| 705,796
|
public void init(ServletConfig config)
throws ServletException {
super.init(config);
if (handlerMap == null) {
initHandlers();
}
}
|
void function(ServletConfig config) throws ServletException { super.init(config); if (handlerMap == null) { initHandlers(); } }
|
/**
* Init this servlet, before any request.
*/
|
Init this servlet, before any request
|
init
|
{
"repo_name": "stephaneperry/Silverpeas-Components",
"path": "process-manager/process-manager-war/src/main/java/com/silverpeas/processManager/servlets/ProcessManagerRequestRouter.java",
"license": "agpl-3.0",
"size": 59867
}
|
[
"javax.servlet.ServletConfig",
"javax.servlet.ServletException"
] |
import javax.servlet.ServletConfig; import javax.servlet.ServletException;
|
import javax.servlet.*;
|
[
"javax.servlet"
] |
javax.servlet;
| 518,540
|
private String htmlColorizeToDoLine(String line) {
if (line == null) {
return null;
} else {
int idx;
String prefix;
final int EXTRA_INDENTATION=1; // for twiki it is 3
if (Pattern.matches("^[ ]+o .*", line)) {
idx = line.indexOf('o');
line = line.substring(idx + 1);
prefix = "";
for (int i = 0; i < idx * EXTRA_INDENTATION; i++) {
prefix += " ";
}
line = prefix + "o" + line;
} else {
if (Pattern.matches("^[ ]+! .*", line)) {
prefix = "";
while (line.startsWith(" ")) {
prefix += " ";
line = line.substring(1);
}
line = prefix + "! <b><font color='#dd6060'>" + line.substring(1) + "</font></b>";
} else {
if (Pattern.matches("^[ ]+x .*", line)) {
idx = line.indexOf('x');
line = line.substring(idx + 1);
prefix = "";
for (int i = 0; i < idx * EXTRA_INDENTATION; i++) {
prefix += " ";
}
line = prefix + "x <i><font color='gray'>" + line + "</font></i>";
} else {
if (Pattern.matches("^[ ]+\\? .*", line)) {
idx = line.indexOf('?');
line = line.substring(idx + 1);
prefix = "";
for (int i = 0; i < idx * EXTRA_INDENTATION; i++) {
prefix += " ";
}
line = prefix + "? <b><font color='blue'>" + line + "</font></b>";
}
}
}
}
return line+"\n";
}
}
|
String function(String line) { if (line == null) { return null; } else { int idx; String prefix; final int EXTRA_INDENTATION=1; if (Pattern.matches(STR, line)) { idx = line.indexOf('o'); line = line.substring(idx + 1); prefix = STR STRoSTR^[ ]+! .*STRSTR STR STR! <b><font color='#dd6060'>STR</font></b>STR^[ ]+x .*", line)) { idx = line.indexOf('x'); line = line.substring(idx + 1); prefix = STR STRx <i><font color='gray'>STR</font></i>STR^[ ]+\\? .*", line)) { idx = line.indexOf('?'); line = line.substring(idx + 1); prefix = STR STR? <b><font color='blue'>STR</font></b>STR\n"; } }
|
/**
* Content based colorization of the annotation - mainly todos:
* <ul>
* <li>o normal
* <li>x done (gray)
* <li>! important (red)
* <li>? question (blue)
* <ul>
*
* @param annotation
* @return
*/
|
Content based colorization of the annotation - mainly todos: o normal x done (gray) ! important (red) ? question (blue)
|
htmlColorizeToDoLine
|
{
"repo_name": "dvorka/mindraider",
"path": "mr7/src/main/java/com/mindcognition/mindraider/ui/swing/concept/annotation/transformer/RichTextToHtmlTransformer.java",
"license": "apache-2.0",
"size": 6267
}
|
[
"java.util.regex.Pattern"
] |
import java.util.regex.Pattern;
|
import java.util.regex.*;
|
[
"java.util"
] |
java.util;
| 1,654,678
|
public static void delete( File f, Log log )
throws MojoExecutionException
{
if ( f.isDirectory() )
{
log.info( Messages.getString( "EclipseCleanMojo.deletingDirectory", f.getName() ) ); //$NON-NLS-1$
}
else
{
log.info( Messages.getString( "EclipseCleanMojo.deletingFile", f.getName() ) ); //$NON-NLS-1$
}
if ( f.exists() )
{
if ( !f.delete() )
{
try
{
FileUtils.forceDelete( f );
}
catch ( IOException e )
{
throw new MojoExecutionException( Messages.getString( "EclipseCleanMojo.failedtodelete", //$NON-NLS-1$
new Object[] { f.getName(),
f.getAbsolutePath() } ) );
}
}
}
else
{
log.debug( Messages.getString( "EclipseCleanMojo.nofilefound", f.getName() ) ); //$NON-NLS-1$
}
}
|
static void function( File f, Log log ) throws MojoExecutionException { if ( f.isDirectory() ) { log.info( Messages.getString( STR, f.getName() ) ); } else { log.info( Messages.getString( STR, f.getName() ) ); } if ( f.exists() ) { if ( !f.delete() ) { try { FileUtils.forceDelete( f ); } catch ( IOException e ) { throw new MojoExecutionException( Messages.getString( STR, new Object[] { f.getName(), f.getAbsolutePath() } ) ); } } } else { log.debug( Messages.getString( STR, f.getName() ) ); } }
|
/**
* Delete a file, handling log messages and exceptions
*
* @param f File to be deleted
* @throws MojoExecutionException only if a file exists and can't be deleted
*/
|
Delete a file, handling log messages and exceptions
|
delete
|
{
"repo_name": "kidaa/maven-plugins",
"path": "maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/ide/IdeUtils.java",
"license": "apache-2.0",
"size": 27038
}
|
[
"java.io.File",
"java.io.IOException",
"org.apache.maven.plugin.MojoExecutionException",
"org.apache.maven.plugin.eclipse.Messages",
"org.apache.maven.plugin.logging.Log",
"org.codehaus.plexus.util.FileUtils"
] |
import java.io.File; import java.io.IOException; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.eclipse.Messages; import org.apache.maven.plugin.logging.Log; import org.codehaus.plexus.util.FileUtils;
|
import java.io.*; import org.apache.maven.plugin.*; import org.apache.maven.plugin.eclipse.*; import org.apache.maven.plugin.logging.*; import org.codehaus.plexus.util.*;
|
[
"java.io",
"org.apache.maven",
"org.codehaus.plexus"
] |
java.io; org.apache.maven; org.codehaus.plexus;
| 1,584,817
|
URL getBaseUrl() throws IOException {
// Find URL pointing to Finalizer.class file.
String finalizerPath = FINALIZER_CLASS_NAME.replace('.', '/') + ".class";
URL finalizerUrl = getClass().getClassLoader().getResource(finalizerPath);
if (finalizerUrl == null) {
throw new FileNotFoundException(finalizerPath);
}
// Find URL pointing to base of class path.
String urlString = finalizerUrl.toString();
if (!urlString.endsWith(finalizerPath)) {
throw new IOException("Unsupported path style: " + urlString);
}
urlString = urlString.substring(0,
urlString.length() - finalizerPath.length());
return new URL(urlString);
}
|
URL getBaseUrl() throws IOException { String finalizerPath = FINALIZER_CLASS_NAME.replace('.', '/') + STR; URL finalizerUrl = getClass().getClassLoader().getResource(finalizerPath); if (finalizerUrl == null) { throw new FileNotFoundException(finalizerPath); } String urlString = finalizerUrl.toString(); if (!urlString.endsWith(finalizerPath)) { throw new IOException(STR + urlString); } urlString = urlString.substring(0, urlString.length() - finalizerPath.length()); return new URL(urlString); }
|
/**
* Gets URL for base of path containing Finalizer.class.
*/
|
Gets URL for base of path containing Finalizer.class
|
getBaseUrl
|
{
"repo_name": "msf-ch/msf-malnutrition",
"path": "msf-malnutrition/srcdoc/guice-3.0-sources/com/google/inject/internal/util/FinalizableReferenceQueue.java",
"license": "gpl-3.0",
"size": 10570
}
|
[
"java.io.FileNotFoundException",
"java.io.IOException"
] |
import java.io.FileNotFoundException; import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,644,716
|
@RequestMapping(value = "/update" ) // GET or POST
public String update(@Valid Entry entry, BindingResult bindingResult, Model model, RedirectAttributes redirectAttributes, HttpServletRequest httpServletRequest) {
log("Action 'update'");
try {
if (!bindingResult.hasErrors()) {
//--- Perform database operations
Entry entrySaved = entryService.update(entry);
model.addAttribute(MAIN_ENTITY_NAME, entrySaved);
//--- Set the result message
messageHelper.addMessage(redirectAttributes, new Message(MessageType.SUCCESS,"save.ok"));
log("Action 'update' : update done - redirect");
return redirectToForm(httpServletRequest, entry.getIdentry());
} else {
log("Action 'update' : binding errors");
populateModel( model, entry, FormMode.UPDATE);
return JSP_FORM;
}
} catch(Exception e) {
messageHelper.addException(model, "entry.error.update", e);
log("Action 'update' : Exception - " + e.getMessage() );
populateModel( model, entry, FormMode.UPDATE);
return JSP_FORM;
}
}
|
@RequestMapping(value = STR ) String function(@Valid Entry entry, BindingResult bindingResult, Model model, RedirectAttributes redirectAttributes, HttpServletRequest httpServletRequest) { log(STR); try { if (!bindingResult.hasErrors()) { Entry entrySaved = entryService.update(entry); model.addAttribute(MAIN_ENTITY_NAME, entrySaved); messageHelper.addMessage(redirectAttributes, new Message(MessageType.SUCCESS,STR)); log(STR); return redirectToForm(httpServletRequest, entry.getIdentry()); } else { log(STR); populateModel( model, entry, FormMode.UPDATE); return JSP_FORM; } } catch(Exception e) { messageHelper.addException(model, STR, e); log(STR + e.getMessage() ); populateModel( model, entry, FormMode.UPDATE); return JSP_FORM; } }
|
/**
* 'UPDATE' action processing. <br>
* This action is based on the 'Post/Redirect/Get (PRG)' pattern, so it ends by 'http redirect'<br>
* @param entry entity to be updated
* @param bindingResult Spring MVC binding result
* @param model Spring MVC model
* @param redirectAttributes Spring MVC redirect attributes
* @param httpServletRequest
* @return
*/
|
'UPDATE' action processing. This action is based on the 'Post/Redirect/Get (PRG)' pattern, so it ends by 'http redirect'
|
update
|
{
"repo_name": "obasola/master",
"path": "src/main/java/com/kumasi/journal/web/controller/EntryController.java",
"license": "mit",
"size": 8639
}
|
[
"com.kumasi.journal.domain.Entry",
"com.kumasi.journal.web.common.FormMode",
"com.kumasi.journal.web.common.Message",
"com.kumasi.journal.web.common.MessageType",
"javax.servlet.http.HttpServletRequest",
"javax.validation.Valid",
"org.springframework.ui.Model",
"org.springframework.validation.BindingResult",
"org.springframework.web.bind.annotation.RequestMapping",
"org.springframework.web.servlet.mvc.support.RedirectAttributes"
] |
import com.kumasi.journal.domain.Entry; import com.kumasi.journal.web.common.FormMode; import com.kumasi.journal.web.common.Message; import com.kumasi.journal.web.common.MessageType; import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; import org.springframework.ui.Model; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
import com.kumasi.journal.domain.*; import com.kumasi.journal.web.common.*; import javax.servlet.http.*; import javax.validation.*; import org.springframework.ui.*; import org.springframework.validation.*; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.mvc.support.*;
|
[
"com.kumasi.journal",
"javax.servlet",
"javax.validation",
"org.springframework.ui",
"org.springframework.validation",
"org.springframework.web"
] |
com.kumasi.journal; javax.servlet; javax.validation; org.springframework.ui; org.springframework.validation; org.springframework.web;
| 277,282
|
void preDisableTable(final ObserverContext<MasterCoprocessorEnvironment> ctx,
final TableName tableName) throws IOException;
|
void preDisableTable(final ObserverContext<MasterCoprocessorEnvironment> ctx, final TableName tableName) throws IOException;
|
/**
* Called prior to disabling a table. Called as part of disable table RPC
* call.
* It can't bypass the default action, e.g., ctx.bypass() won't have effect.
* @param ctx the environment to interact with the framework and master
* @param tableName the name of the table
*/
|
Called prior to disabling a table. Called as part of disable table RPC call. It can't bypass the default action, e.g., ctx.bypass() won't have effect
|
preDisableTable
|
{
"repo_name": "toshimasa-nasu/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/MasterObserver.java",
"license": "apache-2.0",
"size": 40832
}
|
[
"java.io.IOException",
"org.apache.hadoop.hbase.TableName"
] |
import java.io.IOException; import org.apache.hadoop.hbase.TableName;
|
import java.io.*; import org.apache.hadoop.hbase.*;
|
[
"java.io",
"org.apache.hadoop"
] |
java.io; org.apache.hadoop;
| 2,151,188
|
public static long discardStreamCount(InputStream is) throws IOException {
return discardStreamCount(is, BUFFER_SIZE);
}
|
static long function(InputStream is) throws IOException { return discardStreamCount(is, BUFFER_SIZE); }
|
/**
* throw away all bytes from stream argument, and count how many bytes were
* discarded before reaching the end of the stream.
* @param is InputStream to read and discard
* @return the number of bytes discarded
* @throws IOException when is throws one
*/
|
throw away all bytes from stream argument, and count how many bytes were discarded before reaching the end of the stream
|
discardStreamCount
|
{
"repo_name": "nlnwa/openwayback",
"path": "wayback-core/src/main/java/org/archive/wayback/util/ByteOp.java",
"license": "apache-2.0",
"size": 4619
}
|
[
"java.io.IOException",
"java.io.InputStream"
] |
import java.io.IOException; import java.io.InputStream;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 697,497
|
public LearningMethod getMethod() {
return method;
}
|
LearningMethod function() { return method; }
|
/**
* Returns a learner object
*
* @return a learner object
*/
|
Returns a learner object
|
getMethod
|
{
"repo_name": "gitpan/uplug-main",
"path": "share/ext/parser/malt/src/org/maltparser/parser/guide/instance/AtomicModel.java",
"license": "gpl-3.0",
"size": 10212
}
|
[
"org.maltparser.ml.LearningMethod"
] |
import org.maltparser.ml.LearningMethod;
|
import org.maltparser.ml.*;
|
[
"org.maltparser.ml"
] |
org.maltparser.ml;
| 658,965
|
private FileDataDescriptor getScenarioSpecificOutputFile(ScenarioExecution scenario)
{
StringBuilder fName = new StringBuilder();
if (this.prependScenarioName)
{
fName.append(scenario.getScenarioName());
}
String resourceName = this.file.getResourceName();
if (this.appendSwacVersion)
{
int extensionIdx = this.file.getResourceName().lastIndexOf('.');
fName.append(resourceName.substring(0,extensionIdx));
fName.append(scenario.getParent().getSwacVersion());
fName.append(resourceName.substring(extensionIdx));
}
else
{
fName.append(this.file.getResourceName());
}
FileDataDescriptor retVal=null;
try {
retVal = new FileDataDescriptor(this.file,"");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw new IllegalStateException(e);
}
retVal.setResourceName(fName.toString());
return retVal;
}
///
/// Flag normal setters & getters for TaskConfiguration as illegal
///
|
FileDataDescriptor function(ScenarioExecution scenario) { StringBuilder fName = new StringBuilder(); if (this.prependScenarioName) { fName.append(scenario.getScenarioName()); } String resourceName = this.file.getResourceName(); if (this.appendSwacVersion) { int extensionIdx = this.file.getResourceName().lastIndexOf('.'); fName.append(resourceName.substring(0,extensionIdx)); fName.append(scenario.getParent().getSwacVersion()); fName.append(resourceName.substring(extensionIdx)); } else { fName.append(this.file.getResourceName()); } FileDataDescriptor retVal=null; try { retVal = new FileDataDescriptor(this.file,""); } catch (Exception e) { e.printStackTrace(); throw new IllegalStateException(e); } retVal.setResourceName(fName.toString()); return retVal; }
|
/**
* Workaround for parameterized output file names
* @return
*/
|
Workaround for parameterized output file names
|
getScenarioSpecificOutputFile
|
{
"repo_name": "csmith932/uas-schedule-generator",
"path": "swac-controller/src/main/java/gov/faa/ang/swac/controller/core/GenericFileOutputTaskConfiguration.java",
"license": "apache-2.0",
"size": 4955
}
|
[
"gov.faa.ang.swac.datalayer.identity.FileDataDescriptor"
] |
import gov.faa.ang.swac.datalayer.identity.FileDataDescriptor;
|
import gov.faa.ang.swac.datalayer.identity.*;
|
[
"gov.faa.ang"
] |
gov.faa.ang;
| 48,895
|
private SessionPanel getSession() {
if (session == null) {
session = new SessionPanel(false,false);
}
return session;
}
|
SessionPanel function() { if (session == null) { session = new SessionPanel(false,false); } return session; }
|
/**
* This method initializes session
*
* @return javax.swing.JPanel
*/
|
This method initializes session
|
getSession
|
{
"repo_name": "NCIP/cagrid",
"path": "cagrid/Software/core/caGrid/projects/gaards-ui/src/org/cagrid/gaards/ui/dorian/federation/HostCertificatesWindow.java",
"license": "bsd-3-clause",
"size": 21756
}
|
[
"org.cagrid.gaards.ui.dorian.SessionPanel"
] |
import org.cagrid.gaards.ui.dorian.SessionPanel;
|
import org.cagrid.gaards.ui.dorian.*;
|
[
"org.cagrid.gaards"
] |
org.cagrid.gaards;
| 2,102,039
|
int select();
String askName(String question);
String askId(String question);
String askDescription(String question);
long askCreate(String question);
int ask(String question, ArrayList<Integer> range);
|
int select(); String askName(String question); String askId(String question); String askDescription(String question); long askCreate(String question); int ask(String question, ArrayList<Integer> range);
|
/**
* method ask.
* @param question first
* @param range second
* @return int
*/
|
method ask
|
ask
|
{
"repo_name": "SergeyI88/InduikovS",
"path": "chapter_002/src/main/java/ru/job4j/start/Input.java",
"license": "apache-2.0",
"size": 811
}
|
[
"java.util.ArrayList"
] |
import java.util.ArrayList;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,480,117
|
public static void checkOrder(double[] val) throws NonMonotonicSequenceException {
checkOrder(val, OrderDirection.INCREASING, true);
}
|
static void function(double[] val) throws NonMonotonicSequenceException { checkOrder(val, OrderDirection.INCREASING, true); }
|
/**
* Check that the given array is sorted in strictly increasing order.
*
* @param val Values.
* @throws NonMonotonicSequenceException if the array is not sorted.
* @since 2.2
*/
|
Check that the given array is sorted in strictly increasing order
|
checkOrder
|
{
"repo_name": "cesarramirez/GearVRf",
"path": "GVRf/Framework/contrib/commons-math3-3.2-src/src/main/java/org/apache/commons/math3/util/MathArrays.java",
"license": "apache-2.0",
"size": 52837
}
|
[
"org.apache.commons.math3.exception.NonMonotonicSequenceException"
] |
import org.apache.commons.math3.exception.NonMonotonicSequenceException;
|
import org.apache.commons.math3.exception.*;
|
[
"org.apache.commons"
] |
org.apache.commons;
| 2,091,894
|
void removeBackendListener(BackendListener<E> listener);
|
void removeBackendListener(BackendListener<E> listener);
|
/**
* Unregisters a listener so that changes to the backend are no longer sent.
*
* @param listener
* a {@link BackendListener}.
*/
|
Unregisters a listener so that changes to the backend are no longer sent
|
removeBackendListener
|
{
"repo_name": "eurekaclinical/protempa",
"path": "protempa-framework/src/main/java/org/protempa/backend/Backend.java",
"license": "apache-2.0",
"size": 2727
}
|
[
"org.protempa.BackendListener"
] |
import org.protempa.BackendListener;
|
import org.protempa.*;
|
[
"org.protempa"
] |
org.protempa;
| 627,516
|
public static StopServerRequest buildStopServerRequest(final String reason) {
StopServerRequest.Builder builder = StopServerRequest.newBuilder();
builder.setReason(reason);
return builder.build();
}
//End utilities for Admin
|
static StopServerRequest function(final String reason) { StopServerRequest.Builder builder = StopServerRequest.newBuilder(); builder.setReason(reason); return builder.build(); }
|
/**
* Create a new StopServerRequest
* @param reason the reason to stop the server
* @return a StopServerRequest
*/
|
Create a new StopServerRequest
|
buildStopServerRequest
|
{
"repo_name": "apurtell/hbase",
"path": "hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/RequestConverter.java",
"license": "apache-2.0",
"size": 79432
}
|
[
"org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos"
] |
import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos;
|
import org.apache.hadoop.hbase.shaded.protobuf.generated.*;
|
[
"org.apache.hadoop"
] |
org.apache.hadoop;
| 1,913,979
|
public void downloadDependencyTree(DefaultArtifact artifact, boolean javadoc, boolean sources)
throws DependencyCollectionException, DependencyResolutionException {
log.info("Resolving: {} with these dependencies ...", artifact.toString());
Dependency dependency = new Dependency(artifact, JavaScopes.COMPILE);
DependencyNode jarNode = repoSystemHelper.collectDependencies(dependency);
DependencyFilter classpathFilter = DependencyFilterUtils.classpathFilter(JavaScopes.TEST);
jarNode.accept(new TreeDependencyVisitor(new FilteringDependencyVisitor(new DependencyGraphPrinter(), classpathFilter)));
DependencyRequest dependencyRequest = new DependencyRequest(jarNode, classpathFilter);
DependencyResult dependencyResult = repoSystemHelper.resolveDependencies(dependencyRequest);
if (javadoc) {
downloadAttachments(dependencyResult, "javadoc");
}
if (sources) {
downloadAttachments(dependencyResult, "sources");
}
}
|
void function(DefaultArtifact artifact, boolean javadoc, boolean sources) throws DependencyCollectionException, DependencyResolutionException { log.info(STR, artifact.toString()); Dependency dependency = new Dependency(artifact, JavaScopes.COMPILE); DependencyNode jarNode = repoSystemHelper.collectDependencies(dependency); DependencyFilter classpathFilter = DependencyFilterUtils.classpathFilter(JavaScopes.TEST); jarNode.accept(new TreeDependencyVisitor(new FilteringDependencyVisitor(new DependencyGraphPrinter(), classpathFilter))); DependencyRequest dependencyRequest = new DependencyRequest(jarNode, classpathFilter); DependencyResult dependencyResult = repoSystemHelper.resolveDependencies(dependencyRequest); if (javadoc) { downloadAttachments(dependencyResult, STR); } if (sources) { downloadAttachments(dependencyResult, STR); } }
|
/**
* Resolves and downloads an artifact with its dependencies.
*
* @param artifact
* artifact to resolve
* @param javadoc
* <code>true</code> if javadoc attachment should be retrieved too
* @param sources
* <code>true</code> if sources attachment should be retrieved too
* @throws DependencyCollectionException
* if the dependency graph could not be properly assembled
* @throws DependencyResolutionException
* if a dependency is not resolvable
*/
|
Resolves and downloads an artifact with its dependencies
|
downloadDependencyTree
|
{
"repo_name": "Gemba/mvn-dd",
"path": "src/main/java/com/github/gemba/artifactresolver/DependencyResolver.java",
"license": "epl-1.0",
"size": 4863
}
|
[
"org.eclipse.aether.artifact.DefaultArtifact",
"org.eclipse.aether.collection.DependencyCollectionException",
"org.eclipse.aether.graph.Dependency",
"org.eclipse.aether.graph.DependencyFilter",
"org.eclipse.aether.graph.DependencyNode",
"org.eclipse.aether.resolution.DependencyRequest",
"org.eclipse.aether.resolution.DependencyResolutionException",
"org.eclipse.aether.resolution.DependencyResult",
"org.eclipse.aether.util.artifact.JavaScopes",
"org.eclipse.aether.util.filter.DependencyFilterUtils",
"org.eclipse.aether.util.graph.visitor.FilteringDependencyVisitor",
"org.eclipse.aether.util.graph.visitor.TreeDependencyVisitor"
] |
import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.collection.DependencyCollectionException; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.DependencyFilter; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.resolution.DependencyRequest; import org.eclipse.aether.resolution.DependencyResolutionException; import org.eclipse.aether.resolution.DependencyResult; import org.eclipse.aether.util.artifact.JavaScopes; import org.eclipse.aether.util.filter.DependencyFilterUtils; import org.eclipse.aether.util.graph.visitor.FilteringDependencyVisitor; import org.eclipse.aether.util.graph.visitor.TreeDependencyVisitor;
|
import org.eclipse.aether.artifact.*; import org.eclipse.aether.collection.*; import org.eclipse.aether.graph.*; import org.eclipse.aether.resolution.*; import org.eclipse.aether.util.artifact.*; import org.eclipse.aether.util.filter.*; import org.eclipse.aether.util.graph.visitor.*;
|
[
"org.eclipse.aether"
] |
org.eclipse.aether;
| 3,205
|
@ExternalBody
public static <P1 extends Port<I1, I2>, C extends ConnectorEnd<?, P2>, P2 extends Port<I1, I2>, I1 extends Interface, I2 extends Interface> void connect(
P1 parentPort, Class<C> childEnd, P2 childPort) {
ExecutorThread exec = ExecutorThread.current();
exec.requireOwned(parentPort);
exec.requireOwned(childPort);
exec.getModelRuntime().connect(parentPort, childEnd, childPort);
}
|
static <P1 extends Port<I1, I2>, C extends ConnectorEnd<?, P2>, P2 extends Port<I1, I2>, I1 extends Interface, I2 extends Interface> void function( P1 parentPort, Class<C> childEnd, P2 childPort) { ExecutorThread exec = ExecutorThread.current(); exec.requireOwned(parentPort); exec.requireOwned(childPort); exec.getModelRuntime().connect(parentPort, childEnd, childPort); }
|
/**
* Connects two ports through the specified delegation connector.
* <p>
* None of the parameters should be <code>null</code>.
*
* @param parentPort
* the port instance of the container object
* @param childEnd
* the end at the contained object
* @param childPort
* the port instance of the contained object
* @throws NullPointerException
* if either <code>leftPort</code> or <code>rightPort</code> is
* <code>null</code>
*/
|
Connects two ports through the specified delegation connector. None of the parameters should be <code>null</code>
|
connect
|
{
"repo_name": "ELTE-Soft/txtUML",
"path": "dev/plugins/hu.elte.txtuml.api.model/src/hu/elte/txtuml/api/model/Action.java",
"license": "epl-1.0",
"size": 13975
}
|
[
"hu.elte.txtuml.api.model.ConnectorBase",
"hu.elte.txtuml.api.model.ModelClass",
"hu.elte.txtuml.api.model.impl.ExecutorThread"
] |
import hu.elte.txtuml.api.model.ConnectorBase; import hu.elte.txtuml.api.model.ModelClass; import hu.elte.txtuml.api.model.impl.ExecutorThread;
|
import hu.elte.txtuml.api.model.*; import hu.elte.txtuml.api.model.impl.*;
|
[
"hu.elte.txtuml"
] |
hu.elte.txtuml;
| 541,585
|
public String toString() {
if (keyCode == KeyEvent.VK_UNDEFINED) {
return getModifiersText(modifiers) + "typed " + keyChar;
} else {
return getModifiersText(modifiers) +
(onKeyRelease ? "released" : "pressed") + " " +
getVKText(keyCode);
}
}
|
String function() { if (keyCode == KeyEvent.VK_UNDEFINED) { return getModifiersText(modifiers) + STR + keyChar; } else { return getModifiersText(modifiers) + (onKeyRelease ? STR : STR) + " " + getVKText(keyCode); } }
|
/**
* Returns a string that displays and identifies this object's properties.
* The <code>String</code> returned by this method can be passed
* as a parameter to <code>getAWTKeyStroke(String)</code> to produce
* a key stroke equal to this key stroke.
*
* @return a String representation of this object
* @see #getAWTKeyStroke(String)
*/
|
Returns a string that displays and identifies this object's properties. The <code>String</code> returned by this method can be passed as a parameter to <code>getAWTKeyStroke(String)</code> to produce a key stroke equal to this key stroke
|
toString
|
{
"repo_name": "jgaltidor/VarJ",
"path": "analyzed_libs/jdk1.6.0_06_src/java/awt/AWTKeyStroke.java",
"license": "mit",
"size": 29659
}
|
[
"java.awt.event.KeyEvent"
] |
import java.awt.event.KeyEvent;
|
import java.awt.event.*;
|
[
"java.awt"
] |
java.awt;
| 1,102,663
|
private void addRawContent(String rawContent, SolrInputDocument solrInputDocument) {
if (rawContent != null && StringUtils.isNotEmpty(rawContent)) {
solrInputDocument.addField(IndexingConstants.FIELD_TEXT, rawContent, 1.0f);
}
}
|
void function(String rawContent, SolrInputDocument solrInputDocument) { if (rawContent != null && StringUtils.isNotEmpty(rawContent)) { solrInputDocument.addField(IndexingConstants.FIELD_TEXT, rawContent, 1.0f); } }
|
/**
* Method for add raw content of the resource
* @param rawContent raw content
* @param solrInputDocument Solr InputDocument
*/
|
Method for add raw content of the resource
|
addRawContent
|
{
"repo_name": "daneshk/carbon-registry",
"path": "components/registry/org.wso2.carbon.registry.indexing/src/main/java/org/wso2/carbon/registry/indexing/solr/SolrClient.java",
"license": "apache-2.0",
"size": 69901
}
|
[
"org.apache.commons.lang.StringUtils",
"org.apache.solr.common.SolrInputDocument",
"org.wso2.carbon.registry.indexing.IndexingConstants"
] |
import org.apache.commons.lang.StringUtils; import org.apache.solr.common.SolrInputDocument; import org.wso2.carbon.registry.indexing.IndexingConstants;
|
import org.apache.commons.lang.*; import org.apache.solr.common.*; import org.wso2.carbon.registry.indexing.*;
|
[
"org.apache.commons",
"org.apache.solr",
"org.wso2.carbon"
] |
org.apache.commons; org.apache.solr; org.wso2.carbon;
| 1,806,802
|
public void downloadPhonebooks(int phonebookid) {
Document pb = downloadPhonebook(phonebookid);
if (pb != null) {
NodeList nlContacts = pb.getElementsByTagName("contact");
for (int i = 0; i < nlContacts.getLength(); i++) {
PhoneBookEntry pbe = new PhoneBookEntry();
Node nContact = nlContacts.item(i);
if (pbe.parseFromNode(nContact)) {
_alEntries.add(pbe);
} else {
logger.warn("could not parse phonebook entry: {}", nContact.toString());
}
}
} else {
logger.warn("Could not download phonebook");
}
}
|
void function(int phonebookid) { Document pb = downloadPhonebook(phonebookid); if (pb != null) { NodeList nlContacts = pb.getElementsByTagName(STR); for (int i = 0; i < nlContacts.getLength(); i++) { PhoneBookEntry pbe = new PhoneBookEntry(); Node nContact = nlContacts.item(i); if (pbe.parseFromNode(nContact)) { _alEntries.add(pbe); } else { logger.warn(STR, nContact.toString()); } } } else { logger.warn(STR); } }
|
/**
* Downloads and parses phonebooks from fbox.
*/
|
Downloads and parses phonebooks from fbox
|
downloadPhonebooks
|
{
"repo_name": "idserda/openhab",
"path": "bundles/binding/org.openhab.binding.fritzboxtr064/src/main/java/org/openhab/binding/fritzboxtr064/internal/PhonebookManager.java",
"license": "epl-1.0",
"size": 4793
}
|
[
"org.w3c.dom.Document",
"org.w3c.dom.Node",
"org.w3c.dom.NodeList"
] |
import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList;
|
import org.w3c.dom.*;
|
[
"org.w3c.dom"
] |
org.w3c.dom;
| 630,231
|
JsonObject msgJSON = new JsonObject();
msgJSON.addProperty(KEY_SENDER_ID, senderId);
msgJSON.addProperty(KEY_RECEIVER_ID, receiverId);
msgJSON.addProperty(KEY_TIMESTAMP, sequenceNumber);
msgJSON.addProperty(KEY_MSG_TYPE, type);
msgJSON.add(KEY_MSG_CONTENT, msgContent);
Gson g = new Gson();
return g.toJson(msgJSON);
}
|
JsonObject msgJSON = new JsonObject(); msgJSON.addProperty(KEY_SENDER_ID, senderId); msgJSON.addProperty(KEY_RECEIVER_ID, receiverId); msgJSON.addProperty(KEY_TIMESTAMP, sequenceNumber); msgJSON.addProperty(KEY_MSG_TYPE, type); msgJSON.add(KEY_MSG_CONTENT, msgContent); Gson g = new Gson(); return g.toJson(msgJSON); }
|
/**
* Returns the string representation for this message.
*/
|
Returns the string representation for this message
|
toString
|
{
"repo_name": "deib-polimi/SPF2",
"path": "sPFWFDMid/src/main/java/it/polimi/spf/wfd/WfdMessage.java",
"license": "lgpl-3.0",
"size": 7515
}
|
[
"com.google.gson.Gson",
"com.google.gson.JsonObject"
] |
import com.google.gson.Gson; import com.google.gson.JsonObject;
|
import com.google.gson.*;
|
[
"com.google.gson"
] |
com.google.gson;
| 2,283,635
|
void addAlias(String alias, String definition);
}
static final AliasTransformationHandler NULL_ALIAS_TRANSFORMATION_HANDLER =
new NullAliasTransformationHandler();
private static class NullAliasTransformationHandler
implements AliasTransformationHandler, Serializable {
private static final long serialVersionUID = 0L;
private static final AliasTransformation NULL_ALIAS_TRANSFORMATION =
new NullAliasTransformation();
|
void addAlias(String alias, String definition); } static final AliasTransformationHandler NULL_ALIAS_TRANSFORMATION_HANDLER = new NullAliasTransformationHandler(); private static class NullAliasTransformationHandler implements AliasTransformationHandler, Serializable { private static final long serialVersionUID = 0L; private static final AliasTransformation NULL_ALIAS_TRANSFORMATION = new NullAliasTransformation();
|
/**
* Adds an alias definition to the AliasTransformation instance.
* <p>
* Last definition for a given alias is kept if an alias is inserted
* multiple times (since this is generally the behavior in JavaScript code).
*
* @param alias the name of the alias.
* @param definition the definition of the alias.
*/
|
Adds an alias definition to the AliasTransformation instance. Last definition for a given alias is kept if an alias is inserted multiple times (since this is generally the behavior in JavaScript code)
|
addAlias
|
{
"repo_name": "PrashntS/jmulate",
"path": "closure-compiler/src/com/google/javascript/jscomp/CompilerOptions.java",
"license": "bsd-2-clause",
"size": 69526
}
|
[
"java.io.Serializable"
] |
import java.io.Serializable;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 280,581
|
private static void displayTopics(
ArrayList<String> labelVocab,
ArrayList<String> wordVocab,
double[][] phis) {
for (int ll = 0; ll < phis.length; ll++) {
ArrayList<RankingItem<Integer>> rankWords = new ArrayList<>();
for (int vv = 0; vv < phis[ll].length; vv++) {
rankWords.add(new RankingItem<Integer>(vv, phis[ll][vv]));
}
Collections.sort(rankWords);
if (labelVocab != null && ll < labelVocab.size()) {
System.out.println("Topic " + ll + ": " + labelVocab.get(ll));
} else {
System.out.println("Topic " + ll);
}
for (int ii = 0; ii < 20; ii++) {
RankingItem<Integer> item = rankWords.get(ii);
System.out.print("\t" + wordVocab.get(item.getObject())
+ ":" + MiscUtils.formatDouble(item.getPrimaryValue()));
}
System.out.println("\n");
for (int ii = 0; ii < 20; ii++) {
RankingItem<Integer> item = rankWords.get(ii);
System.out.print("; " + wordVocab.get(item.getObject()));
}
System.out.println("\n");
}
}
|
static void function( ArrayList<String> labelVocab, ArrayList<String> wordVocab, double[][] phis) { for (int ll = 0; ll < phis.length; ll++) { ArrayList<RankingItem<Integer>> rankWords = new ArrayList<>(); for (int vv = 0; vv < phis[ll].length; vv++) { rankWords.add(new RankingItem<Integer>(vv, phis[ll][vv])); } Collections.sort(rankWords); if (labelVocab != null && ll < labelVocab.size()) { System.out.println(STR + ll + STR + labelVocab.get(ll)); } else { System.out.println(STR + ll); } for (int ii = 0; ii < 20; ii++) { RankingItem<Integer> item = rankWords.get(ii); System.out.print("\t" + wordVocab.get(item.getObject()) + ":" + MiscUtils.formatDouble(item.getPrimaryValue())); } System.out.println("\n"); for (int ii = 0; ii < 20; ii++) { RankingItem<Integer> item = rankWords.get(ii); System.out.print(STR + wordVocab.get(item.getObject())); } System.out.println("\n"); } }
|
/**
* Display prior topics.
*
* @param labelVocab
* @param wordVocab
* @param phis
*/
|
Display prior topics
|
displayTopics
|
{
"repo_name": "vietansegan/herbal",
"path": "src/experiment/percongress/VotePredExpt.java",
"license": "apache-2.0",
"size": 233354
}
|
[
"java.util.ArrayList",
"java.util.Collections"
] |
import java.util.ArrayList; import java.util.Collections;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,529,695
|
public InetAddress getAddress() {
return this.address;
}
|
InetAddress function() { return this.address; }
|
/**
* Returns the IP address.
*
* @return the address
*/
|
Returns the IP address
|
getAddress
|
{
"repo_name": "jvermillard/Californium",
"path": "californium/src/main/java/ch/ethz/inf/vs/californium/coap/EndpointAddress.java",
"license": "bsd-3-clause",
"size": 4383
}
|
[
"java.net.InetAddress"
] |
import java.net.InetAddress;
|
import java.net.*;
|
[
"java.net"
] |
java.net;
| 2,328,805
|
@MixedCopyright(
copyright = "Apache compress commons",
license = License.APACHE2,
url = "http://commons.apache.org/compress/apidocs/org/apache/commons/compress/compressors/CompressorStreamFactory.html"
)
public static String compress(File inputFile, int buffer, File outputFile, boolean removeInput) {
String result;
FileInputStream in;
FileOutputStream fos;
CompressorOutputStream out;
String msg;
in = null;
out = null;
fos = null;
result = null;
try {
// does file already exist?
if (outputFile.exists())
System.err.println("WARNING: overwriting '" + outputFile + "'!");
in = new FileInputStream(inputFile.getAbsolutePath());
fos = new FileOutputStream(outputFile.getAbsolutePath());
out = new CompressorStreamFactory().createCompressorOutputStream(CompressorStreamFactory.GZIP, fos);
IOUtils.copy(in, out, buffer);
FileUtils.closeQuietly(in);
FileUtils.closeQuietly(out);
FileUtils.closeQuietly(fos);
in = null;
out = null;
fos = null;
// remove input file?
if (removeInput) {
if (!inputFile.delete())
result = "Failed to delete input file '" + inputFile + "' after successful compression!";
}
}
catch (Exception e) {
msg = "Failed to compress '" + inputFile + "': ";
LOGGER.log(Level.SEVERE, msg, e);
result = msg + e;
}
finally {
FileUtils.closeQuietly(in);
FileUtils.closeQuietly(out);
FileUtils.closeQuietly(fos);
}
return result;
}
|
@MixedCopyright( copyright = STR, license = License.APACHE2, url = STRWARNING: overwriting 'STR'!STRFailed to delete input file 'STR' after successful compression!STRFailed to compress 'STR': "; LOGGER.log(Level.SEVERE, msg, e); result = msg + e; } finally { FileUtils.closeQuietly(in); FileUtils.closeQuietly(out); FileUtils.closeQuietly(fos); } return result; }
|
/**
* Compresses the specified gzip archive.
*
* @param inputFile the gzip file to compress
* @param buffer the buffer size to use
* @param outputFile the destination file (the archive)
* @param removeInput whether to remove the input file
* @return the error message, null if everything OK
*/
|
Compresses the specified gzip archive
|
compress
|
{
"repo_name": "waikato-datamining/adams-base",
"path": "adams-core/src/main/java/adams/core/io/GzipUtils.java",
"license": "gpl-3.0",
"size": 10085
}
|
[
"java.util.logging.Level"
] |
import java.util.logging.Level;
|
import java.util.logging.*;
|
[
"java.util"
] |
java.util;
| 1,016,038
|
public void exportAsExtension(Path fileName){
ResourceModelExtension extension = getAsExtension();
//serialize them
try {
XMLHelper.serialize(extension, ResourceModelExtension.class, new FileOutputStream(fileName.toFile()));
} catch (JAXBException e) {
logger.error("The generated solution is not valid",e);
} catch (FileNotFoundException e) {
logger.error("Error exporting the solution",e);
}
}
|
void function(Path fileName){ ResourceModelExtension extension = getAsExtension(); try { XMLHelper.serialize(extension, ResourceModelExtension.class, new FileOutputStream(fileName.toFile())); } catch (JAXBException e) { logger.error(STR,e); } catch (FileNotFoundException e) { logger.error(STR,e); } }
|
/**
* Export the solution in the format of the extension used as input for space4cloud
*/
|
Export the solution in the format of the extension used as input for space4cloud
|
exportAsExtension
|
{
"repo_name": "deib-polimi/modaclouds-space4cloud-privatecloud",
"path": "src/it/polimi/modaclouds/space4cloud/privatecloud/solution/SolutionMulti.java",
"license": "apache-2.0",
"size": 19046
}
|
[
"it.polimi.modaclouds.qos_models.schema.ResourceModelExtension",
"it.polimi.modaclouds.qos_models.util.XMLHelper",
"java.io.FileNotFoundException",
"java.io.FileOutputStream",
"java.nio.file.Path",
"javax.xml.bind.JAXBException"
] |
import it.polimi.modaclouds.qos_models.schema.ResourceModelExtension; import it.polimi.modaclouds.qos_models.util.XMLHelper; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.nio.file.Path; import javax.xml.bind.JAXBException;
|
import it.polimi.modaclouds.qos_models.schema.*; import it.polimi.modaclouds.qos_models.util.*; import java.io.*; import java.nio.file.*; import javax.xml.bind.*;
|
[
"it.polimi.modaclouds",
"java.io",
"java.nio",
"javax.xml"
] |
it.polimi.modaclouds; java.io; java.nio; javax.xml;
| 2,292,873
|
private void loadFSImage(File curFile, MD5Hash expectedMd5,
FSNamesystem target, MetaRecoveryContext recovery,
boolean requireSameLayoutVersion) throws IOException {
// BlockPoolId is required when the FsImageLoader loads the rolling upgrade
// information. Make sure the ID is properly set.
target.setBlockPoolId(this.getBlockPoolID());
FSImageFormat.LoaderDelegator loader = FSImageFormat.newLoader(conf, target);
loader.load(curFile, requireSameLayoutVersion);
// Check that the image digest we loaded matches up with what
// we expected
MD5Hash readImageMd5 = loader.getLoadedImageMd5();
if (expectedMd5 != null &&
!expectedMd5.equals(readImageMd5)) {
throw new IOException("Image file " + curFile +
" is corrupt with MD5 checksum of " + readImageMd5 +
" but expecting " + expectedMd5);
}
long txId = loader.getLoadedImageTxId();
LOG.info("Loaded image for txid " + txId + " from " + curFile);
lastAppliedTxId = txId;
storage.setMostRecentCheckpointInfo(txId, curFile.lastModified());
}
|
void function(File curFile, MD5Hash expectedMd5, FSNamesystem target, MetaRecoveryContext recovery, boolean requireSameLayoutVersion) throws IOException { target.setBlockPoolId(this.getBlockPoolID()); FSImageFormat.LoaderDelegator loader = FSImageFormat.newLoader(conf, target); loader.load(curFile, requireSameLayoutVersion); MD5Hash readImageMd5 = loader.getLoadedImageMd5(); if (expectedMd5 != null && !expectedMd5.equals(readImageMd5)) { throw new IOException(STR + curFile + STR + readImageMd5 + STR + expectedMd5); } long txId = loader.getLoadedImageTxId(); LOG.info(STR + txId + STR + curFile); lastAppliedTxId = txId; storage.setMostRecentCheckpointInfo(txId, curFile.lastModified()); }
|
/**
* Load in the filesystem image from file. It's a big list of
* filenames and blocks.
*/
|
Load in the filesystem image from file. It's a big list of filenames and blocks
|
loadFSImage
|
{
"repo_name": "bysslord/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java",
"license": "apache-2.0",
"size": 57081
}
|
[
"java.io.File",
"java.io.IOException",
"org.apache.hadoop.io.MD5Hash"
] |
import java.io.File; import java.io.IOException; import org.apache.hadoop.io.MD5Hash;
|
import java.io.*; import org.apache.hadoop.io.*;
|
[
"java.io",
"org.apache.hadoop"
] |
java.io; org.apache.hadoop;
| 834,398
|
public final DenseDoubleMatrix2D getU() {
final int min = Math.min(m, n);
final double[][] U = new double[min][n];
for (int i = 0; i < min; i++) {
for (int j = 0; j < n; j++) {
if (i <= j) {
U[i][j] = LU[i][j];
}
}
}
return Matrix.Factory.linkToArray(U);
}
|
final DenseDoubleMatrix2D function() { final int min = Math.min(m, n); final double[][] U = new double[min][n]; for (int i = 0; i < min; i++) { for (int j = 0; j < n; j++) { if (i <= j) { U[i][j] = LU[i][j]; } } } return Matrix.Factory.linkToArray(U); }
|
/**
* Return upper triangular factor
*
* @return U
*/
|
Return upper triangular factor
|
getU
|
{
"repo_name": "ujmp/universal-java-matrix-package",
"path": "ujmp-core/src/main/java/org/ujmp/core/doublematrix/calculation/general/decomposition/LU.java",
"license": "lgpl-3.0",
"size": 13127
}
|
[
"org.ujmp.core.Matrix",
"org.ujmp.core.doublematrix.DenseDoubleMatrix2D"
] |
import org.ujmp.core.Matrix; import org.ujmp.core.doublematrix.DenseDoubleMatrix2D;
|
import org.ujmp.core.*; import org.ujmp.core.doublematrix.*;
|
[
"org.ujmp.core"
] |
org.ujmp.core;
| 1,271,616
|
private BranchTarget appendTargetInstruction(Instruction inst) {
String[] types = m_stackState.toArray();
InstructionHandle hand = m_instructionList.append(inst);
return new BranchTarget(hand, types);
}
|
BranchTarget function(Instruction inst) { String[] types = m_stackState.toArray(); InstructionHandle hand = m_instructionList.append(inst); return new BranchTarget(hand, types); }
|
/**
* Append an instruction to the list as a branch target.
*
* @param inst instruction to be appended as branch target
* @return branch target information
*/
|
Append an instruction to the list as a branch target
|
appendTargetInstruction
|
{
"repo_name": "vkorbut/jibx",
"path": "jibx/build/src/org/jibx/binding/classes/MethodBuilder.java",
"license": "bsd-3-clause",
"size": 60081
}
|
[
"org.apache.bcel.generic.Instruction",
"org.apache.bcel.generic.InstructionHandle"
] |
import org.apache.bcel.generic.Instruction; import org.apache.bcel.generic.InstructionHandle;
|
import org.apache.bcel.generic.*;
|
[
"org.apache.bcel"
] |
org.apache.bcel;
| 2,503,183
|
@Test
public void testRemoveOutfit() {
Outfit orig = new Outfit(12345678);
Outfit result = orig.removeOutfit(new Outfit(12, null, null, null, null));
assertEquals(Integer.valueOf(0), result.getDetail());
assertEquals(Integer.valueOf(12), result.getHair());
assertEquals(Integer.valueOf(34), result.getHead());
assertEquals(Integer.valueOf(56), result.getDress());
assertEquals(Integer.valueOf(78), result.getBody());
orig = new Outfit(null, 12, 34, 56, null);
result = orig.removeOutfit(new Outfit(1, null, null, null, null));
assertEquals(12345600, result.getCode());
orig = new Outfit(12345678);
result = orig.removeOutfit(new Outfit(12345678));
assertEquals(0, result.getCode());
}
|
void function() { Outfit orig = new Outfit(12345678); Outfit result = orig.removeOutfit(new Outfit(12, null, null, null, null)); assertEquals(Integer.valueOf(0), result.getDetail()); assertEquals(Integer.valueOf(12), result.getHair()); assertEquals(Integer.valueOf(34), result.getHead()); assertEquals(Integer.valueOf(56), result.getDress()); assertEquals(Integer.valueOf(78), result.getBody()); orig = new Outfit(null, 12, 34, 56, null); result = orig.removeOutfit(new Outfit(1, null, null, null, null)); assertEquals(12345600, result.getCode()); orig = new Outfit(12345678); result = orig.removeOutfit(new Outfit(12345678)); assertEquals(0, result.getCode()); }
|
/**
* Tests for removeOutfit
*/
|
Tests for removeOutfit
|
testRemoveOutfit
|
{
"repo_name": "acsid/stendhal",
"path": "tests/games/stendhal/server/entity/OutfitTest.java",
"license": "gpl-2.0",
"size": 7300
}
|
[
"org.junit.Assert"
] |
import org.junit.Assert;
|
import org.junit.*;
|
[
"org.junit"
] |
org.junit;
| 2,718,467
|
public static Populator createPopulator() {
WeldContainer container = new Weld().initialize();
return container.instance().select(Populator.class).get();
}
|
static Populator function() { WeldContainer container = new Weld().initialize(); return container.instance().select(Populator.class).get(); }
|
/**
* Metodo de fabrica que encapsula a criacao de um Populator.
*
* @return Populator
*/
|
Metodo de fabrica que encapsula a criacao de um Populator
|
createPopulator
|
{
"repo_name": "org-wave/Old-Populator",
"path": "src/org/wave/populator/core/PopulatorFactory.java",
"license": "apache-2.0",
"size": 688
}
|
[
"org.jboss.weld.environment.se.Weld",
"org.jboss.weld.environment.se.WeldContainer"
] |
import org.jboss.weld.environment.se.Weld; import org.jboss.weld.environment.se.WeldContainer;
|
import org.jboss.weld.environment.se.*;
|
[
"org.jboss.weld"
] |
org.jboss.weld;
| 19,408
|
public ActionForward customData(ActionMapping mapping, ActionForm form
, HttpServletRequest request, HttpServletResponse response) {
AwardForm awardForm = (AwardForm) form;
awardForm.getCustomDataHelper().prepareCustomData();
return mapping.findForward(Constants.MAPPING_AWARD_CUSTOM_DATA_PAGE);
}
|
ActionForward function(ActionMapping mapping, ActionForm form , HttpServletRequest request, HttpServletResponse response) { AwardForm awardForm = (AwardForm) form; awardForm.getCustomDataHelper().prepareCustomData(); return mapping.findForward(Constants.MAPPING_AWARD_CUSTOM_DATA_PAGE); }
|
/**
*
* This method gets called upon navigation to Special Review tab.
*/
|
This method gets called upon navigation to Special Review tab
|
customData
|
{
"repo_name": "rashikpolus/MIT_KC",
"path": "coeus-impl/src/main/java/org/kuali/kra/award/web/struts/action/AwardAction.java",
"license": "agpl-3.0",
"size": 109987
}
|
[
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse",
"org.apache.struts.action.ActionForm",
"org.apache.struts.action.ActionForward",
"org.apache.struts.action.ActionMapping",
"org.kuali.kra.award.AwardForm",
"org.kuali.kra.infrastructure.Constants"
] |
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.kuali.kra.award.AwardForm; import org.kuali.kra.infrastructure.Constants;
|
import javax.servlet.http.*; import org.apache.struts.action.*; import org.kuali.kra.award.*; import org.kuali.kra.infrastructure.*;
|
[
"javax.servlet",
"org.apache.struts",
"org.kuali.kra"
] |
javax.servlet; org.apache.struts; org.kuali.kra;
| 1,987,701
|
public BlocksWithLocations getBlocks(DatanodeID datanode, long size
) throws IOException {
namesystem.checkOperation(OperationCategory.READ);
namesystem.readLock();
try {
namesystem.checkOperation(OperationCategory.READ);
return getBlocksWithLocations(datanode, size);
} finally {
namesystem.readUnlock();
}
}
|
BlocksWithLocations function(DatanodeID datanode, long size ) throws IOException { namesystem.checkOperation(OperationCategory.READ); namesystem.readLock(); try { namesystem.checkOperation(OperationCategory.READ); return getBlocksWithLocations(datanode, size); } finally { namesystem.readUnlock(); } }
|
/**
* return a list of blocks & their locations on <code>datanode</code> whose
* total size is <code>size</code>
*
* @param datanode on which blocks are located
* @param size total size of blocks
*/
|
return a list of blocks & their locations on <code>datanode</code> whose total size is <code>size</code>
|
getBlocks
|
{
"repo_name": "Wajihulhassan/Hadoop-2.7.0",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java",
"license": "apache-2.0",
"size": 146618
}
|
[
"java.io.IOException",
"org.apache.hadoop.hdfs.protocol.DatanodeID",
"org.apache.hadoop.hdfs.server.namenode.NameNode",
"org.apache.hadoop.hdfs.server.protocol.BlocksWithLocations"
] |
import java.io.IOException; import org.apache.hadoop.hdfs.protocol.DatanodeID; import org.apache.hadoop.hdfs.server.namenode.NameNode; import org.apache.hadoop.hdfs.server.protocol.BlocksWithLocations;
|
import java.io.*; import org.apache.hadoop.hdfs.protocol.*; import org.apache.hadoop.hdfs.server.namenode.*; import org.apache.hadoop.hdfs.server.protocol.*;
|
[
"java.io",
"org.apache.hadoop"
] |
java.io; org.apache.hadoop;
| 384,533
|
public Value eval(Env env)
{
return env.getConstant(_var);
}
|
Value function(Env env) { return env.getConstant(_var); }
|
/**
* Evaluates the expression.
*
* @param env the calling environment.
*
* @return the expression value.
*/
|
Evaluates the expression
|
eval
|
{
"repo_name": "smba/oak",
"path": "quercus/src/main/java/com/caucho/quercus/expr/ConstExpr.java",
"license": "lgpl-3.0",
"size": 5946
}
|
[
"com.caucho.quercus.env.Env",
"com.caucho.quercus.env.Value"
] |
import com.caucho.quercus.env.Env; import com.caucho.quercus.env.Value;
|
import com.caucho.quercus.env.*;
|
[
"com.caucho.quercus"
] |
com.caucho.quercus;
| 31,012
|
private void rollbackTemp(int count) {
for(int i = 0; i < count; i++) {
if(swapIds.get(i) != EMPTY_INPUT) {
File tmp = tempFile.getTempFile(fileList.get(i));
rollback(tmp, fileList.get(i));
}
}
}
|
void function(int count) { for(int i = 0; i < count; i++) { if(swapIds.get(i) != EMPTY_INPUT) { File tmp = tempFile.getTempFile(fileList.get(i)); rollback(tmp, fileList.get(i)); } } }
|
/**
* Attempts to roll back the temporary files to their original location
* @param count number of files to roll back. 0 < count <= fileList.size()
*/
|
Attempts to roll back the temporary files to their original location
|
rollbackTemp
|
{
"repo_name": "samicemalone/swapf",
"path": "src/swapf/Swapper.java",
"license": "bsd-3-clause",
"size": 14332
}
|
[
"java.io.File"
] |
import java.io.File;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,798,908
|
public static Path getRegionSnaphshotDirectory(SnapshotDescription desc, Path rootDir,
String regionName) {
Path snapshotDir = SnapshotDescriptionUtils.getWorkingSnapshotDir(desc, rootDir);
return HRegion.getRegionDir(snapshotDir, regionName);
}
/**
* Get the home directory for store-level snapshot files.
* <p>
* Specific files per store are kept in a similar layout as per the current directory layout.
* @param regionDir snapshot directory for the parent region, <b>not</b> the standard region
* directory. See {@link #getRegionSnaphshotDirectory(SnapshotDescription, Path, String)}
|
static Path function(SnapshotDescription desc, Path rootDir, String regionName) { Path snapshotDir = SnapshotDescriptionUtils.getWorkingSnapshotDir(desc, rootDir); return HRegion.getRegionDir(snapshotDir, regionName); } /** * Get the home directory for store-level snapshot files. * <p> * Specific files per store are kept in a similar layout as per the current directory layout. * @param regionDir snapshot directory for the parent region, <b>not</b> the standard region * directory. See {@link #getRegionSnaphshotDirectory(SnapshotDescription, Path, String)}
|
/**
* Get the per-region snapshot description location.
* <p>
* Under the per-snapshot directory, specific files per-region are kept in a similar layout as per
* the current directory layout.
* @param desc description of the snapshot
* @param rootDir root directory for the hbase installation
* @param regionName encoded name of the region (see {@link HRegionInfo#encodeRegionName(byte[])})
* @return path to the per-region directory for the snapshot
*/
|
Get the per-region snapshot description location. Under the per-snapshot directory, specific files per-region are kept in a similar layout as per the current directory layout
|
getRegionSnaphshotDirectory
|
{
"repo_name": "matteobertozzi/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/server/snapshot/TakeSnapshotUtils.java",
"license": "apache-2.0",
"size": 11087
}
|
[
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.hbase.protobuf.generated.HBaseProtos",
"org.apache.hadoop.hbase.regionserver.HRegion",
"org.apache.hadoop.hbase.snapshot.SnapshotDescriptionUtils"
] |
import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos; import org.apache.hadoop.hbase.regionserver.HRegion; import org.apache.hadoop.hbase.snapshot.SnapshotDescriptionUtils;
|
import org.apache.hadoop.fs.*; import org.apache.hadoop.hbase.protobuf.generated.*; import org.apache.hadoop.hbase.regionserver.*; import org.apache.hadoop.hbase.snapshot.*;
|
[
"org.apache.hadoop"
] |
org.apache.hadoop;
| 2,527,702
|
public void checkClosed() throws IllegalStateException {
if (closed) {
throw new IllegalStateException("Connection is closed");
}
}
|
void function() throws IllegalStateException { if (closed) { throw new IllegalStateException(STR); } }
|
/**
* Checks if the connection close is already completed.
*
* @throws IllegalStateException
* If the connection close is already completed.
*/
|
Checks if the connection close is already completed
|
checkClosed
|
{
"repo_name": "awslabs/amazon-sqs-java-messaging-lib",
"path": "src/main/java/com/amazon/sqs/javamessaging/SQSConnection.java",
"license": "apache-2.0",
"size": 20068
}
|
[
"javax.jms.IllegalStateException"
] |
import javax.jms.IllegalStateException;
|
import javax.jms.*;
|
[
"javax.jms"
] |
javax.jms;
| 2,379,298
|
public void printM() {
updateData();
System.out.println("Membership Matrix M: " + M.size() + " rows (scs) / " + n + " columns (instances)");
System.out.println();
HashMap<Integer, Integer> tmp = new HashMap<Integer, Integer>();
for (int instanceid : I.keySet()) {
tmp.put(I.get(instanceid), instanceid);
}
System.out.printf("%9s", "sc_id");
for (int i = 0; i < n; i++) {
System.out.printf("%9d", (int) tmp.get(i));
}
System.out.printf("%9s\n", "weight");
for (int scid : M.keySet()) {
double weight = getWeight(scid);
if (weight <= 0.0f)
continue;
double[] m = M.get(scid);
System.out.printf("%9d", scid);
for (int i = 0; i < n; i++) {
System.out.printf("%9f", m[i]);
}
System.out.printf("%9f\n", weight);
}
System.out.println();
System.out.printf("%9s", "");
for (int i = 0; i < n; i++) {
System.out.printf("%9f", K[i]);
}
System.out.println();
}
|
void function() { updateData(); System.out.println(STR + M.size() + STR + n + STR); System.out.println(); HashMap<Integer, Integer> tmp = new HashMap<Integer, Integer>(); for (int instanceid : I.keySet()) { tmp.put(I.get(instanceid), instanceid); } System.out.printf("%9s", "sc_id"); for (int i = 0; i < n; i++) { System.out.printf("%9d", (int) tmp.get(i)); } System.out.printf("%9s\n", STR); for (int scid : M.keySet()) { double weight = getWeight(scid); if (weight <= 0.0f) continue; double[] m = M.get(scid); System.out.printf("%9d", scid); for (int i = 0; i < n; i++) { System.out.printf("%9f", m[i]); } System.out.printf("%9f\n", weight); } System.out.println(); System.out.printf("%9s", STR%9f", K[i]); } System.out.println(); }
|
/**
* Prints the membership matrix in a formatted way.
*/
|
Prints the membership matrix in a formatted way
|
printM
|
{
"repo_name": "EDACC/edacc_aac",
"path": "src/edacc/configurator/aac/solvercreator/Clustering.java",
"license": "mit",
"size": 35489
}
|
[
"java.util.HashMap"
] |
import java.util.HashMap;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 482,456
|
public void deleteBookmark(BookmarkId bookmarkId) {
nativeDeleteBookmark(mNativeBookmarksBridge, bookmarkId);
}
|
void function(BookmarkId bookmarkId) { nativeDeleteBookmark(mNativeBookmarksBridge, bookmarkId); }
|
/**
* Deletes a specified bookmark node.
* @param bookmarkId The ID of the bookmark to be deleted.
*/
|
Deletes a specified bookmark node
|
deleteBookmark
|
{
"repo_name": "s20121035/rk3288_android5.1_repo",
"path": "external/chromium_org/chrome/android/java/src/org/chromium/chrome/browser/BookmarksBridge.java",
"license": "gpl-3.0",
"size": 29162
}
|
[
"org.chromium.components.bookmarks.BookmarkId"
] |
import org.chromium.components.bookmarks.BookmarkId;
|
import org.chromium.components.bookmarks.*;
|
[
"org.chromium.components"
] |
org.chromium.components;
| 580,163
|
//@author A0119446B
private static String display(String userCommand, List<Date> showDate) {
assert (userCommand != null);
if (!showDate.isEmpty()) {
listOfTasks.setNotShowingDone();
try {
return displayTasks(listOfTasks.getDateRangeTask(showDate));
} catch (TaskInvalidDateException e) {
return MESSAGE_INVALID_DATE;
}
}
if (userCommand.equals(CMD_ALL)) {
listOfTasks.setNotShowingDone();
return displayTasks(listOfTasks.prepareDisplayList(false));
} else if (userCommand.equals(CMD_ADDED)) {
listOfTasks.setNotShowingDone();
return displayTasks(listOfTasks.prepareDisplayList(true));
} else if (userCommand.equals(CMD_DONE)) {
return displayTasks(listOfTasks.getFinishedTasks());
} else if (userCommand.equals(CMD_OVERDUE)) {
return displayTasks(listOfTasks.getOverdueTask());
} else {
listOfTasks.setNotShowingDone();
try {
return String.format(MESSAGE_TASKTAG_RETURNED, userCommand,
displayTasks(listOfTasks.prepareDisplayList(userCommand)));
} catch (TaskNoSuchTagException e) {
return MESSAGE_INVALID_TAG_NONEXISTENT;
}
}
}
|
static String function(String userCommand, List<Date> showDate) { assert (userCommand != null); if (!showDate.isEmpty()) { listOfTasks.setNotShowingDone(); try { return displayTasks(listOfTasks.getDateRangeTask(showDate)); } catch (TaskInvalidDateException e) { return MESSAGE_INVALID_DATE; } } if (userCommand.equals(CMD_ALL)) { listOfTasks.setNotShowingDone(); return displayTasks(listOfTasks.prepareDisplayList(false)); } else if (userCommand.equals(CMD_ADDED)) { listOfTasks.setNotShowingDone(); return displayTasks(listOfTasks.prepareDisplayList(true)); } else if (userCommand.equals(CMD_DONE)) { return displayTasks(listOfTasks.getFinishedTasks()); } else if (userCommand.equals(CMD_OVERDUE)) { return displayTasks(listOfTasks.getOverdueTask()); } else { listOfTasks.setNotShowingDone(); try { return String.format(MESSAGE_TASKTAG_RETURNED, userCommand, displayTasks(listOfTasks.prepareDisplayList(userCommand))); } catch (TaskNoSuchTagException e) { return MESSAGE_INVALID_TAG_NONEXISTENT; } } }
|
/**
* This method displays the user's tasks information, specified by the user command.
*
* @param userCommand The specific type of show command.
* @param showDate The given date period for displaying.
* @return User's task information.
*/
|
This method displays the user's tasks information, specified by the user command
|
display
|
{
"repo_name": "CS2103TAug2014-W15-4J/main",
"path": "src/controller/Logic.java",
"license": "mit",
"size": 25139
}
|
[
"java.util.Date",
"java.util.List"
] |
import java.util.Date; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 612,693
|
public List<WarningMessage> getWarnings() {
return warnings;
}
|
List<WarningMessage> function() { return warnings; }
|
/**
* Returns the list of warnings, or null if there are none.
*/
|
Returns the list of warnings, or null if there are none
|
getWarnings
|
{
"repo_name": "paulk-asert/groovy",
"path": "src/main/java/org/codehaus/groovy/control/ErrorCollector.java",
"license": "apache-2.0",
"size": 10756
}
|
[
"java.util.List",
"org.codehaus.groovy.control.messages.WarningMessage"
] |
import java.util.List; import org.codehaus.groovy.control.messages.WarningMessage;
|
import java.util.*; import org.codehaus.groovy.control.messages.*;
|
[
"java.util",
"org.codehaus.groovy"
] |
java.util; org.codehaus.groovy;
| 662,358
|
public static String dash(int len) {
char[] dash = new char[len];
Arrays.fill(dash, '-');
dash[0] = dash[len - 1] = '+';
return new String(dash);
}
|
static String function(int len) { char[] dash = new char[len]; Arrays.fill(dash, '-'); dash[0] = dash[len - 1] = '+'; return new String(dash); }
|
/**
* Makes a {@code '+---+'} dash line.
*
* @param len Length of the dash line to make.
* @return Dash line.
*/
|
Makes a '+---+' dash line
|
dash
|
{
"repo_name": "WilliamDo/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java",
"license": "apache-2.0",
"size": 325083
}
|
[
"java.util.Arrays"
] |
import java.util.Arrays;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,202,611
|
@Override
protected IPath checkBinaryDetails(final ILaunchConfiguration config) throws CoreException {
boolean doStartServer = true;
try {
doStartServer = Configuration.getDoStartGdbServer(config);
} catch (CoreException e) {
;
}
if (doStartServer) {
// If we should start the server, there must be a device name
// present, otherwise refuse to start.
String deviceName = "";
try {
deviceName = Configuration.getGdbServerDeviceName(config);
} catch (CoreException e) {
;
}
if (deviceName.isEmpty()) {
throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID,
"Missing mandatory device name. " + "Fill-in the 'Device name:' field in the Debugger tab.")); //$NON-NLS-2$
}
}
IPath path = super.checkBinaryDetails(config);
return path;
}
|
IPath function(final ILaunchConfiguration config) throws CoreException { boolean doStartServer = true; try { doStartServer = Configuration.getDoStartGdbServer(config); } catch (CoreException e) { ; } if (doStartServer) { String deviceName = STRMissing mandatory device name. STRFill-in the 'Device name:' field in the Debugger tab.")); } } IPath path = super.checkBinaryDetails(config); return path; }
|
/**
* Perform some local validations before starting the debug session.
*/
|
Perform some local validations before starting the debug session
|
checkBinaryDetails
|
{
"repo_name": "gnuarmeclipse/plug-ins",
"path": "plugins/ilg.gnumcueclipse.debug.gdbjtag.jlink/src/ilg/gnumcueclipse/debug/gdbjtag/jlink/dsf/LaunchConfigurationDelegate.java",
"license": "epl-1.0",
"size": 19386
}
|
[
"org.eclipse.core.runtime.CoreException",
"org.eclipse.core.runtime.IPath",
"org.eclipse.debug.core.ILaunchConfiguration"
] |
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.debug.core.ILaunchConfiguration;
|
import org.eclipse.core.runtime.*; import org.eclipse.debug.core.*;
|
[
"org.eclipse.core",
"org.eclipse.debug"
] |
org.eclipse.core; org.eclipse.debug;
| 2,557,023
|
public void execute() {
WasmStack<Object> stack = instance.stack();
//Pop the value t.const value2 from the stack.
if ((stack.peek() instanceof I32) == false) {
throw new WasmRuntimeException(UUID.fromString("533f0b47-5b00-4b38-a235-55b47a00e411"),
opCodeName + ": Value2 type is incorrect. Value should be of type " + t1Type);
}
I32 value2 = (I32) stack.pop();
//Pop the value t.const value1 from the stack.
if ((stack.peek() instanceof I32) == false) {
throw new WasmRuntimeException(UUID.fromString("6b807dd8-b620-4e94-a937-e2160ee7ba80"),
opCodeName + ": Value1 type is incorrect. Value should be of type " + t2Type);
}
I32 value1 = (I32) stack.pop();
// Let c(i.e. result) be a possible result of computing binopt(value1,value2).
I32 result = new I32(value1.integerValue() ^ value2.integerValue());
// Push the value t.const c(i.e. result) to the stack.
stack.push(result);
}
|
void function() { WasmStack<Object> stack = instance.stack(); if ((stack.peek() instanceof I32) == false) { throw new WasmRuntimeException(UUID.fromString(STR), opCodeName + STR + t1Type); } I32 value2 = (I32) stack.pop(); if ((stack.peek() instanceof I32) == false) { throw new WasmRuntimeException(UUID.fromString(STR), opCodeName + STR + t2Type); } I32 value1 = (I32) stack.pop(); I32 result = new I32(value1.integerValue() ^ value2.integerValue()); stack.push(result); }
|
/**
* Execute the opcode.
*/
|
Execute the opcode
|
execute
|
{
"repo_name": "fishjd/HappyNewMoonWithReport",
"path": "src/main/java/happynewmoonwithreport/opcode/logic/I32_xor.java",
"license": "apache-2.0",
"size": 3542
}
|
[
"java.util.UUID"
] |
import java.util.UUID;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 302,513
|
public static Map<String, Object> load(String filename) throws XmlParseException, IOException {
return load(new File(filename));
}
Plist() {
m_dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
m_dateFormat.setTimeZone(TimeZone.getTimeZone("Z"));
m_simpleTypes = new HashMap<Class<?>, ElementType>();
m_simpleTypes.put(Integer.class, ElementType.INTEGER);
m_simpleTypes.put(Byte.class, ElementType.INTEGER);
m_simpleTypes.put(Short.class, ElementType.INTEGER);
m_simpleTypes.put(Short.class, ElementType.INTEGER);
m_simpleTypes.put(Long.class, ElementType.INTEGER);
m_simpleTypes.put(String.class, ElementType.STRING);
m_simpleTypes.put(Float.class, ElementType.REAL);
m_simpleTypes.put(Double.class, ElementType.REAL);
m_simpleTypes.put(byte[].class, ElementType.DATA);
m_simpleTypes.put(Boolean.class, ElementType.TRUE);
m_simpleTypes.put(Date.class, ElementType.DATE);
}
|
static Map<String, Object> function(String filename) throws XmlParseException, IOException { return load(new File(filename)); } Plist() { m_dateFormat = new SimpleDateFormat(STR); m_dateFormat.setTimeZone(TimeZone.getTimeZone("Z")); m_simpleTypes = new HashMap<Class<?>, ElementType>(); m_simpleTypes.put(Integer.class, ElementType.INTEGER); m_simpleTypes.put(Byte.class, ElementType.INTEGER); m_simpleTypes.put(Short.class, ElementType.INTEGER); m_simpleTypes.put(Short.class, ElementType.INTEGER); m_simpleTypes.put(Long.class, ElementType.INTEGER); m_simpleTypes.put(String.class, ElementType.STRING); m_simpleTypes.put(Float.class, ElementType.REAL); m_simpleTypes.put(Double.class, ElementType.REAL); m_simpleTypes.put(byte[].class, ElementType.DATA); m_simpleTypes.put(Boolean.class, ElementType.TRUE); m_simpleTypes.put(Date.class, ElementType.DATE); }
|
/**
* Create a nested {@code map<String, Object>} from a plist xml file using the default mapping.
*
* @param filename the file containing the the plist xml.
* @return the resulting map as read from the plist data.
* @throws XmlParseException if the plist could not be properly parsed.
* @throws IOException if there was an issue reading the plist file.
*/
|
Create a nested map from a plist xml file using the default mapping
|
load
|
{
"repo_name": "archienz/universal-media-server",
"path": "src/main/java/net/pms/xmlwise/Plist.java",
"license": "gpl-2.0",
"size": 14158
}
|
[
"java.io.File",
"java.io.IOException",
"java.text.SimpleDateFormat",
"java.util.Date",
"java.util.HashMap",
"java.util.Map",
"java.util.TimeZone"
] |
import java.io.File; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.TimeZone;
|
import java.io.*; import java.text.*; import java.util.*;
|
[
"java.io",
"java.text",
"java.util"
] |
java.io; java.text; java.util;
| 1,649,080
|
private String getValue(Object value)
throws RepositoryException
{
String strValue = session.getTypeConverter().convert(String.class, value);
return encodeBlanks(strValue);
}
|
String function(Object value) throws RepositoryException { String strValue = session.getTypeConverter().convert(String.class, value); return encodeBlanks(strValue); }
|
/**
* Get single-valued property
*
* @param value
* @return
*/
|
Get single-valued property
|
getValue
|
{
"repo_name": "loftuxab/community-edition-old",
"path": "projects/repository/source/java/org/alfresco/jcr/exporter/JCRDocumentXMLExporter.java",
"license": "lgpl-3.0",
"size": 17149
}
|
[
"javax.jcr.RepositoryException"
] |
import javax.jcr.RepositoryException;
|
import javax.jcr.*;
|
[
"javax.jcr"
] |
javax.jcr;
| 1,623,005
|
public ArrayList getDateTypeList() {
return new ArrayList(dateTypeList);
}
|
ArrayList function() { return new ArrayList(dateTypeList); }
|
/**
* Get list of data type variable
*
* @return list of data type variable
*/
|
Get list of data type variable
|
getDateTypeList
|
{
"repo_name": "MengZhang/translator-dssat",
"path": "src/main/java/org/agmip/translators/dssat/DssatObservedData.java",
"license": "bsd-3-clause",
"size": 28958
}
|
[
"java.util.ArrayList"
] |
import java.util.ArrayList;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,016,310
|
public static void normalizeVector2(FloatBuffer buf, int index) {
TempVars vars = TempVars.get();
Vector2f tempVec2 = vars.vect2d;
populateFromBuffer(tempVec2, buf, index);
tempVec2.normalizeLocal();
setInBuffer(tempVec2, buf, index);
vars.release();
}
|
static void function(FloatBuffer buf, int index) { TempVars vars = TempVars.get(); Vector2f tempVec2 = vars.vect2d; populateFromBuffer(tempVec2, buf, index); tempVec2.normalizeLocal(); setInBuffer(tempVec2, buf, index); vars.release(); }
|
/**
* Normalize a Vector2f in-buffer.
*
* @param buf
* the buffer to find the Vector2f within
* @param index
* the position (in terms of vectors, not floats) of the vector
* to normalize
*/
|
Normalize a Vector2f in-buffer
|
normalizeVector2
|
{
"repo_name": "asiermarzo/Ultraino",
"path": "AcousticFieldSim/src/acousticfield3d/utils/BufferUtils.java",
"license": "mit",
"size": 44937
}
|
[
"java.nio.FloatBuffer"
] |
import java.nio.FloatBuffer;
|
import java.nio.*;
|
[
"java.nio"
] |
java.nio;
| 2,063,804
|
private void printMetrics()
{
for(String metricName : metrics.keySet())
{
MetricWriter metricWriter = getMetricWriter(metricPath + metricName,
MetricWriter.METRIC_AGGREGATION_TYPE_OBSERVATION,
MetricWriter.METRIC_TIME_ROLLUP_TYPE_CURRENT,
MetricWriter.METRIC_CLUSTER_ROLLUP_TYPE_COLLECTIVE);
metricWriter.printMetric(String.valueOf(metrics.get(metricName)));
}
}
|
void function() { for(String metricName : metrics.keySet()) { MetricWriter metricWriter = getMetricWriter(metricPath + metricName, MetricWriter.METRIC_AGGREGATION_TYPE_OBSERVATION, MetricWriter.METRIC_TIME_ROLLUP_TYPE_CURRENT, MetricWriter.METRIC_CLUSTER_ROLLUP_TYPE_COLLECTIVE); metricWriter.printMetric(String.valueOf(metrics.get(metricName))); } }
|
/**
* Returns the metric to the AppDynamics Controller.
* @param metricValue Value of the Metric
*/
|
Returns the metric to the AppDynamics Controller
|
printMetrics
|
{
"repo_name": "Appdynamics/static-monitoring-extension",
"path": "src/main/java/com/appdynamics/monitors/staticmonitor/StaticMonitor.java",
"license": "apache-2.0",
"size": 5509
}
|
[
"com.singularity.ee.agent.systemagent.api.MetricWriter"
] |
import com.singularity.ee.agent.systemagent.api.MetricWriter;
|
import com.singularity.ee.agent.systemagent.api.*;
|
[
"com.singularity.ee"
] |
com.singularity.ee;
| 2,026,764
|
protected final void setView(View view)
{
rootView.setView(view);
textComponent.revalidate();
textComponent.repaint();
}
|
final void function(View view) { rootView.setView(view); textComponent.revalidate(); textComponent.repaint(); }
|
/**
* Sets the root view for the text component.
*
* @param view the <code>View</code> to be set as root view
*/
|
Sets the root view for the text component
|
setView
|
{
"repo_name": "SanDisk-Open-Source/SSD_Dashboard",
"path": "uefi/gcc/gcc-4.6.3/libjava/classpath/javax/swing/plaf/basic/BasicTextUI.java",
"license": "gpl-2.0",
"size": 47133
}
|
[
"javax.swing.text.View"
] |
import javax.swing.text.View;
|
import javax.swing.text.*;
|
[
"javax.swing"
] |
javax.swing;
| 1,580,243
|
private static boolean sieve(BigInteger b) {
if(!b.testBit(0)) {
return false;
}
for(int i = 3; i < 65000; i += 2) {
if(b.mod(new BigInteger(Integer.toString(i))).equals(BigInteger.ZERO)) {
return false;
}
}
return true;
}
|
static boolean function(BigInteger b) { if(!b.testBit(0)) { return false; } for(int i = 3; i < 65000; i += 2) { if(b.mod(new BigInteger(Integer.toString(i))).equals(BigInteger.ZERO)) { return false; } } return true; }
|
/**
* A very simple sieve to check a potential prime.
*
* @param b
* the potential prime
* @return
* true if not divisible by anything between 0 and 65000
* false if composite
*/
|
A very simple sieve to check a potential prime
|
sieve
|
{
"repo_name": "gustavjp/EDA625",
"path": "Projekt1/src/Test3.java",
"license": "mit",
"size": 5902
}
|
[
"java.math.BigInteger"
] |
import java.math.BigInteger;
|
import java.math.*;
|
[
"java.math"
] |
java.math;
| 1,705,611
|
void processHeadlessEvents(List<EventObject> headless);
|
void processHeadlessEvents(List<EventObject> headless);
|
/**
* Process a list of events that have been collected earlier. Has
* no affect if the component is running in headless mode.
*
* @param headless a list of EventObjects to process.
*/
|
Process a list of events that have been collected earlier. Has no affect if the component is running in headless mode
|
processHeadlessEvents
|
{
"repo_name": "dsibournemouth/autoweka",
"path": "weka-3.7.7/src/main/java/weka/gui/beans/HeadlessEventCollector.java",
"license": "gpl-3.0",
"size": 2012
}
|
[
"java.util.EventObject",
"java.util.List"
] |
import java.util.EventObject; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,156,884
|
public static synchronized void mockStatic(Class<?> type, Class<?>... types) {
MockCreator.mock(type, true, false, null, null, (Method[]) null);
if(types != null && types.length > 0) {
for (Class<?> aClass : types) {
MockCreator.mock(aClass, true, false, null, null, (Method[]) null);
}
}
}
|
static synchronized void function(Class<?> type, Class<?>... types) { MockCreator.mock(type, true, false, null, null, (Method[]) null); if(types != null && types.length > 0) { for (Class<?> aClass : types) { MockCreator.mock(aClass, true, false, null, null, (Method[]) null); } } }
|
/**
* Enable static mocking for all methods of a class.
*
* @param type
* the class to enable static mocking
*/
|
Enable static mocking for all methods of a class
|
mockStatic
|
{
"repo_name": "gauee/powermock",
"path": "api/mockito/src/main/java/org/powermock/api/mockito/PowerMockito.java",
"license": "apache-2.0",
"size": 30823
}
|
[
"java.lang.reflect.Method",
"org.powermock.api.mockito.internal.mockcreation.MockCreator"
] |
import java.lang.reflect.Method; import org.powermock.api.mockito.internal.mockcreation.MockCreator;
|
import java.lang.reflect.*; import org.powermock.api.mockito.internal.mockcreation.*;
|
[
"java.lang",
"org.powermock.api"
] |
java.lang; org.powermock.api;
| 1,525,862
|
public static Reader createXMLDocumentReader(InputStream is)
throws IOException {
PushbackInputStream pbis = new PushbackInputStream(is, 128);
byte[] buf = new byte[4];
int len = pbis.read(buf);
if (len > 0) {
pbis.unread(buf, 0, len);
}
if (len == 4) {
switch (buf[0] & 0x00FF) {
case 0:
if (buf[1] == 0x003c && buf[2] == 0x0000 && buf[3] == 0x003f) {
return new InputStreamReader(pbis, "UnicodeBig");
}
break;
case '<':
switch (buf[1] & 0x00FF) {
case 0:
if (buf[2] == 0x003f && buf[3] == 0x0000) {
return new InputStreamReader(pbis, "UnicodeLittle");
}
break;
case '?':
if (buf[2] == 'x' && buf[3] == 'm') {
Reader r = createXMLDeclarationReader(pbis, "UTF8");
String enc = getXMLDeclarationEncoding(r, "UTF8");
return new InputStreamReader(pbis, enc);
}
}
break;
case 0x004C:
if (buf[1] == 0x006f &&
(buf[2] & 0x00FF) == 0x00a7 &&
(buf[3] & 0x00FF) == 0x0094) {
Reader r = createXMLDeclarationReader(pbis, "CP037");
String enc = getXMLDeclarationEncoding(r, "CP037");
return new InputStreamReader(pbis, enc);
}
break;
case 0x00FE:
if ((buf[1] & 0x00FF) == 0x00FF) {
return new InputStreamReader(pbis, "Unicode");
}
break;
case 0x00FF:
if ((buf[1] & 0x00FF) == 0x00FE) {
return new InputStreamReader(pbis, "Unicode");
}
}
}
return new InputStreamReader(pbis, "UTF8");
}
|
static Reader function(InputStream is) throws IOException { PushbackInputStream pbis = new PushbackInputStream(is, 128); byte[] buf = new byte[4]; int len = pbis.read(buf); if (len > 0) { pbis.unread(buf, 0, len); } if (len == 4) { switch (buf[0] & 0x00FF) { case 0: if (buf[1] == 0x003c && buf[2] == 0x0000 && buf[3] == 0x003f) { return new InputStreamReader(pbis, STR); } break; case '<': switch (buf[1] & 0x00FF) { case 0: if (buf[2] == 0x003f && buf[3] == 0x0000) { return new InputStreamReader(pbis, STR); } break; case '?': if (buf[2] == 'x' && buf[3] == 'm') { Reader r = createXMLDeclarationReader(pbis, "UTF8"); String enc = getXMLDeclarationEncoding(r, "UTF8"); return new InputStreamReader(pbis, enc); } } break; case 0x004C: if (buf[1] == 0x006f && (buf[2] & 0x00FF) == 0x00a7 && (buf[3] & 0x00FF) == 0x0094) { Reader r = createXMLDeclarationReader(pbis, "CP037"); String enc = getXMLDeclarationEncoding(r, "CP037"); return new InputStreamReader(pbis, enc); } break; case 0x00FE: if ((buf[1] & 0x00FF) == 0x00FF) { return new InputStreamReader(pbis, STR); } break; case 0x00FF: if ((buf[1] & 0x00FF) == 0x00FE) { return new InputStreamReader(pbis, STR); } } } return new InputStreamReader(pbis, "UTF8"); }
|
/**
* Creates a Reader initialized to scan the characters in the given
* XML document's InputStream.
* @param is The input stream positionned at the beginning of an
* XML document.
* @return a Reader positionned at the beginning of the XML document
* It is created from an encoding figured out from the first
* few bytes of the document. As a consequence the given
* input stream is not positionned anymore at the beginning
* of the document when this method returns.
*/
|
Creates a Reader initialized to scan the characters in the given XML document's InputStream
|
createXMLDocumentReader
|
{
"repo_name": "srnsw/xena",
"path": "plugins/image/ext/src/batik-1.7/sources/org/apache/batik/xml/XMLUtilities.java",
"license": "gpl-3.0",
"size": 10673
}
|
[
"java.io.IOException",
"java.io.InputStream",
"java.io.InputStreamReader",
"java.io.PushbackInputStream",
"java.io.Reader"
] |
import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PushbackInputStream; import java.io.Reader;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,618,109
|
public long restartTime(long now) {
if (mNumFailed == 0) {
return now;
}
if (mRetryAfter > 0) {
return mLastMod + mRetryAfter;
}
return mLastMod +
Constants.RETRY_FIRST_DELAY *
(1000 + mFuzz) * (1 << (mNumFailed - 1));
}
|
long function(long now) { if (mNumFailed == 0) { return now; } if (mRetryAfter > 0) { return mLastMod + mRetryAfter; } return mLastMod + Constants.RETRY_FIRST_DELAY * (1000 + mFuzz) * (1 << (mNumFailed - 1)); }
|
/**
* Returns the time when a download should be restarted.
*/
|
Returns the time when a download should be restarted
|
restartTime
|
{
"repo_name": "islamsamak/janadroid",
"path": "apk-expansion/src/main/java/com/jana/android/expansion/downloader/impl/DownloadInfo.java",
"license": "gpl-2.0",
"size": 2900
}
|
[
"com.jana.android.expansion.downloader.Constants"
] |
import com.jana.android.expansion.downloader.Constants;
|
import com.jana.android.expansion.downloader.*;
|
[
"com.jana.android"
] |
com.jana.android;
| 1,710,908
|
public void testDeepClone() {
Collection c1 = new ArrayList();
Collection c2 = null;
// empty list
try {
c2 = ObjectUtilities.deepClone(c1);
assertTrue(c2.isEmpty());
}
catch (CloneNotSupportedException e) {
assertTrue(false);
}
// list containing Cloneable objects
c1 = new ArrayList();
c1.add(new Point(1, 2));
c1.add(new Point(3, 4));
try {
c2 = ObjectUtilities.deepClone(c1);
assertEquals(2, c2.size());
assertTrue(c2.contains(new Point(1, 2)));
assertTrue(c2.contains(new Point(3, 4)));
}
catch (CloneNotSupportedException e) {
assertTrue(false);
}
// list containing Cloneable and null objects
c1 = new ArrayList();
c1.add(new Point(1, 2));
c1.add(null);
c1.add(new Point(3, 4));
try {
c2 = ObjectUtilities.deepClone(c1);
assertEquals(3, c2.size());
assertTrue(c2.contains(new Point(1, 2)));
assertTrue(c2.contains(new Point(3, 4)));
}
catch (CloneNotSupportedException e) {
assertTrue(false);
}
// list containing non-Cloneable objects
c1.clear();
c1.add("S1");
c1.add("S2");
try {
c2 = ObjectUtilities.deepClone(c1);
assertTrue(false); // if we get to here, the test has failed
}
catch (CloneNotSupportedException e) {
assertTrue(true);
}
// null list
try {
c2 = ObjectUtilities.deepClone(null);
assertTrue(false); // if we get to here, the test has failed
}
catch (IllegalArgumentException e) {
assertTrue(true);
}
catch (CloneNotSupportedException e) {
assertTrue(false);
}
}
|
void function() { Collection c1 = new ArrayList(); Collection c2 = null; try { c2 = ObjectUtilities.deepClone(c1); assertTrue(c2.isEmpty()); } catch (CloneNotSupportedException e) { assertTrue(false); } c1 = new ArrayList(); c1.add(new Point(1, 2)); c1.add(new Point(3, 4)); try { c2 = ObjectUtilities.deepClone(c1); assertEquals(2, c2.size()); assertTrue(c2.contains(new Point(1, 2))); assertTrue(c2.contains(new Point(3, 4))); } catch (CloneNotSupportedException e) { assertTrue(false); } c1 = new ArrayList(); c1.add(new Point(1, 2)); c1.add(null); c1.add(new Point(3, 4)); try { c2 = ObjectUtilities.deepClone(c1); assertEquals(3, c2.size()); assertTrue(c2.contains(new Point(1, 2))); assertTrue(c2.contains(new Point(3, 4))); } catch (CloneNotSupportedException e) { assertTrue(false); } c1.clear(); c1.add("S1"); c1.add("S2"); try { c2 = ObjectUtilities.deepClone(c1); assertTrue(false); } catch (CloneNotSupportedException e) { assertTrue(true); } try { c2 = ObjectUtilities.deepClone(null); assertTrue(false); } catch (IllegalArgumentException e) { assertTrue(true); } catch (CloneNotSupportedException e) { assertTrue(false); } }
|
/**
* Some checks for the deepClone(Collection) method.
*/
|
Some checks for the deepClone(Collection) method
|
testDeepClone
|
{
"repo_name": "tekkies/jcommon-serialdate-refactor",
"path": "source/org/jfree/util/junit/ObjectUtilitiesTests.java",
"license": "lgpl-2.1",
"size": 6068
}
|
[
"java.awt.Point",
"java.util.ArrayList",
"java.util.Collection",
"org.jfree.util.ObjectUtilities"
] |
import java.awt.Point; import java.util.ArrayList; import java.util.Collection; import org.jfree.util.ObjectUtilities;
|
import java.awt.*; import java.util.*; import org.jfree.util.*;
|
[
"java.awt",
"java.util",
"org.jfree.util"
] |
java.awt; java.util; org.jfree.util;
| 131,031
|
@Query(value = "g.v(tech).in('TECHNOLOGY').filter{(it.dismantleTime > tick) && ((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.dismantleTime > tick)}", type = QueryType.Gremlin)
Iterable<PowerPlant> findOperationalPowerPlantsByTechnology(@Param("tech") PowerGeneratingTechnology technology,
@Param("tick") long tick);
|
@Query(value = STR, type = QueryType.Gremlin) Iterable<PowerPlant> findOperationalPowerPlantsByTechnology(@Param("tech") PowerGeneratingTechnology technology, @Param("tick") long tick);
|
/**
* Finds plants by owner and selects only operational plants.
*
* @param owner
* of the plants
* @param tick
* at which the operationality it is checked
* @return the list of plants
*/
|
Finds plants by owner and selects only operational plants
|
findOperationalPowerPlantsByTechnology
|
{
"repo_name": "asmkhan/emlab-generation",
"path": "emlab-generation/src/main/java/emlab/gen/repository/PowerPlantRepository.java",
"license": "apache-2.0",
"size": 28744
}
|
[
"org.springframework.data.neo4j.annotation.Query",
"org.springframework.data.neo4j.annotation.QueryType",
"org.springframework.data.repository.query.Param"
] |
import org.springframework.data.neo4j.annotation.Query; import org.springframework.data.neo4j.annotation.QueryType; import org.springframework.data.repository.query.Param;
|
import org.springframework.data.neo4j.annotation.*; import org.springframework.data.repository.query.*;
|
[
"org.springframework.data"
] |
org.springframework.data;
| 1,407,475
|
private Object readResolve() throws InvalidObjectException {
try {
return WeekFields.of(firstDayOfWeek, minimalDays);
} catch (IllegalArgumentException ex) {
throw new InvalidObjectException("Invalid WeekFields" + ex.getMessage());
}
}
|
Object function() throws InvalidObjectException { try { return WeekFields.of(firstDayOfWeek, minimalDays); } catch (IllegalArgumentException ex) { throw new InvalidObjectException(STR + ex.getMessage()); } }
|
/**
* Ensure valid singleton.
*
* @return the valid week fields instance, not null
* @throws InvalidObjectException if invalid
*/
|
Ensure valid singleton
|
readResolve
|
{
"repo_name": "seratch/java-time-backport",
"path": "src/main/java/java/time/temporal/WeekFields.java",
"license": "bsd-3-clause",
"size": 47135
}
|
[
"java.io.InvalidObjectException"
] |
import java.io.InvalidObjectException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,669,227
|
public void release(Savepoint savepoint) throws SQLException {
if (connection != null) {
connection.releaseSavepoint(savepoint);
}
}
|
void function(Savepoint savepoint) throws SQLException { if (connection != null) { connection.releaseSavepoint(savepoint); } }
|
/**
* Removes the savepoint and any subsequent savepoints from the transaction.
* Any reference to a removed savepoint will cause a SQL exception to be
* thrown. If the transaction is dormant releasing a savepoint has no effect
* and the state of the transaction is unchanged.
*
* @param savepoint
* the savepoint to release.
* @throws SQLException
* if a database access error occurs or a removed savepoint was
* referenced.
*/
|
Removes the savepoint and any subsequent savepoints from the transaction. Any reference to a removed savepoint will cause a SQL exception to be thrown. If the transaction is dormant releasing a savepoint has no effect and the state of the transaction is unchanged
|
release
|
{
"repo_name": "jajja/jorm",
"path": "src/main/java/com/jajja/jorm/Transaction.java",
"license": "mit",
"size": 84462
}
|
[
"java.sql.SQLException",
"java.sql.Savepoint"
] |
import java.sql.SQLException; import java.sql.Savepoint;
|
import java.sql.*;
|
[
"java.sql"
] |
java.sql;
| 2,420,959
|
Object copy(Object entity) throws DataAccessException;
|
Object copy(Object entity) throws DataAccessException;
|
/**
* Create a detached copy of the given entity object,
* using TopLink's default ObjectCopyingPolicy.
* @param entity the entity object to copy
* @return the copy of the entity object
* @throws org.springframework.dao.DataAccessException in case of TopLink errors
* @see oracle.toplink.sessions.Session#copyObject(Object)
*/
|
Create a detached copy of the given entity object, using TopLink's default ObjectCopyingPolicy
|
copy
|
{
"repo_name": "codeApeFromChina/resource",
"path": "frame_packages/java_libs/spring-2.5.6-src/src/org/springframework/orm/toplink/TopLinkOperations.java",
"license": "unlicense",
"size": 36791
}
|
[
"org.springframework.dao.DataAccessException"
] |
import org.springframework.dao.DataAccessException;
|
import org.springframework.dao.*;
|
[
"org.springframework.dao"
] |
org.springframework.dao;
| 234,489
|
public void clear() {
// We currently just clear the references, and leave all the previous layouts returned
// in their default state of the loading view.
mReferences.clear();
mViewToLinkedList.clear();
}
}
private static class RemoteViewsMetaData {
int count;
int viewTypeCount;
boolean hasStableIds;
// Used to determine how to construct loading views. If a loading view is not specified
// by the user, then we try and load the first view, and use its height as the height for
// the default loading view.
RemoteViews mUserLoadingView;
RemoteViews mFirstView;
int mFirstViewHeight;
// A mapping from type id to a set of unique type ids
private final HashMap<Integer, Integer> mTypeIdIndexMap = new HashMap<Integer, Integer>();
public RemoteViewsMetaData() {
reset();
}
|
void function() { mReferences.clear(); mViewToLinkedList.clear(); } } private static class RemoteViewsMetaData { int count; int viewTypeCount; boolean hasStableIds; RemoteViews mUserLoadingView; RemoteViews mFirstView; int mFirstViewHeight; private final HashMap<Integer, Integer> mTypeIdIndexMap = new HashMap<Integer, Integer>(); public RemoteViewsMetaData() { reset(); }
|
/**
* Removes all references to all RemoteViewsFrameLayouts returned by the adapter.
*/
|
Removes all references to all RemoteViewsFrameLayouts returned by the adapter
|
clear
|
{
"repo_name": "JSDemos/android-sdk-20",
"path": "src/android/widget/RemoteViewsAdapter.java",
"license": "apache-2.0",
"size": 57978
}
|
[
"java.util.HashMap"
] |
import java.util.HashMap;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,918,908
|
protected void updatePromptVisible() {
// check if our currently-visible terminalbridge is requesting any prompt services
TerminalView view = adapter.getCurrentTerminalView();
// Hide all the prompts in case a prompt request was canceled
hideAllPrompts();
if (view == null) {
// we dont have an active view, so hide any prompts
return;
}
PromptHelper prompt = view.bridge.promptHelper;
if (String.class.equals(prompt.promptRequested)) {
stringPromptGroup.setVisibility(View.VISIBLE);
String instructions = prompt.promptInstructions;
if (instructions != null && instructions.length() > 0) {
stringPromptInstructions.setVisibility(View.VISIBLE);
stringPromptInstructions.setText(instructions);
} else
stringPromptInstructions.setVisibility(View.GONE);
stringPrompt.setText("");
stringPrompt.setHint(prompt.promptHint);
stringPrompt.requestFocus();
} else if (Boolean.class.equals(prompt.promptRequested)) {
booleanPromptGroup.setVisibility(View.VISIBLE);
booleanPrompt.setText(prompt.promptHint);
booleanYes.requestFocus();
} else {
hideAllPrompts();
view.requestFocus();
}
}
private class URLItemListener implements OnItemClickListener {
private WeakReference<Context> contextRef;
URLItemListener(Context context) {
this.contextRef = new WeakReference<Context>(context);
}
|
void function() { TerminalView view = adapter.getCurrentTerminalView(); hideAllPrompts(); if (view == null) { return; } PromptHelper prompt = view.bridge.promptHelper; if (String.class.equals(prompt.promptRequested)) { stringPromptGroup.setVisibility(View.VISIBLE); String instructions = prompt.promptInstructions; if (instructions != null && instructions.length() > 0) { stringPromptInstructions.setVisibility(View.VISIBLE); stringPromptInstructions.setText(instructions); } else stringPromptInstructions.setVisibility(View.GONE); stringPrompt.setText(""); stringPrompt.setHint(prompt.promptHint); stringPrompt.requestFocus(); } else if (Boolean.class.equals(prompt.promptRequested)) { booleanPromptGroup.setVisibility(View.VISIBLE); booleanPrompt.setText(prompt.promptHint); booleanYes.requestFocus(); } else { hideAllPrompts(); view.requestFocus(); } } private class URLItemListener implements OnItemClickListener { private WeakReference<Context> contextRef; URLItemListener(Context context) { this.contextRef = new WeakReference<Context>(context); }
|
/**
* Show any prompts requested by the currently visible {@link TerminalView}.
*/
|
Show any prompts requested by the currently visible <code>TerminalView</code>
|
updatePromptVisible
|
{
"repo_name": "khorimoto/connectbot",
"path": "app/src/main/java/org/connectbot/ConsoleActivity.java",
"license": "apache-2.0",
"size": 40254
}
|
[
"android.content.Context",
"android.view.View",
"android.widget.AdapterView",
"java.lang.ref.WeakReference",
"org.connectbot.service.PromptHelper"
] |
import android.content.Context; import android.view.View; import android.widget.AdapterView; import java.lang.ref.WeakReference; import org.connectbot.service.PromptHelper;
|
import android.content.*; import android.view.*; import android.widget.*; import java.lang.ref.*; import org.connectbot.service.*;
|
[
"android.content",
"android.view",
"android.widget",
"java.lang",
"org.connectbot.service"
] |
android.content; android.view; android.widget; java.lang; org.connectbot.service;
| 31,570
|
public void incrementLaunchCounter(final RepositoryEntry re) {
taskQueueManager.addTask(new IncrementLaunchCounterBackgroundTask(re));
}
|
void function(final RepositoryEntry re) { taskQueueManager.addTask(new IncrementLaunchCounterBackgroundTask(re)); }
|
/**
* Increment the launch counter.
*
* @param re
*/
|
Increment the launch counter
|
incrementLaunchCounter
|
{
"repo_name": "RLDevOps/Demo",
"path": "src/main/java/org/olat/repository/RepositoryManager.java",
"license": "apache-2.0",
"size": 42875
}
|
[
"org.olat.repository.async.IncrementLaunchCounterBackgroundTask"
] |
import org.olat.repository.async.IncrementLaunchCounterBackgroundTask;
|
import org.olat.repository.async.*;
|
[
"org.olat.repository"
] |
org.olat.repository;
| 1,415,836
|
public List<Element> elementsByPartialLinkText(String partialLinkText) throws Exception {
JSONObject jsonObject = new JSONObject();
jsonObject.put("value", partialLinkText);
jsonObject.put("using", "partial link text");
JSONArray jsonArray = findElements(jsonObject);
if (jsonArray.size() > 0) {
return getElements(jsonArray);
} else {
return null;
}
}
|
List<Element> function(String partialLinkText) throws Exception { JSONObject jsonObject = new JSONObject(); jsonObject.put("value", partialLinkText); jsonObject.put("using", STR); JSONArray jsonArray = findElements(jsonObject); if (jsonArray.size() > 0) { return getElements(jsonArray); } else { return null; } }
|
/**
* <p>
* Search for multiple elements on the page, starting from the document
* root.<br>
* Support: Android iOS Web(WebView)
*
* @param partialLinkText The partial link text attribute of elements
* @return List<Element> elements
* @throws Exception
*/
|
Search for multiple elements on the page, starting from the document root. Support: Android iOS Web(WebView)
|
elementsByPartialLinkText
|
{
"repo_name": "macacajs/wd.java",
"path": "src/main/java/macaca/client/MacacaClient.java",
"license": "mit",
"size": 51693
}
|
[
"com.alibaba.fastjson.JSONArray",
"com.alibaba.fastjson.JSONObject",
"java.util.List"
] |
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import java.util.List;
|
import com.alibaba.fastjson.*; import java.util.*;
|
[
"com.alibaba.fastjson",
"java.util"
] |
com.alibaba.fastjson; java.util;
| 2,588,360
|
public void setBackgroundColor(Color BackgroundColor) {
this.BackgroundColor = BackgroundColor;
}
|
void function(Color BackgroundColor) { this.BackgroundColor = BackgroundColor; }
|
/**
* setBackgroundColor
* Sets Color
* @param BackgroundColor Color
*/
|
setBackgroundColor Sets Color
|
setBackgroundColor
|
{
"repo_name": "asposepdfcloud/Aspose.Pdf_Cloud_SDK_For_Java",
"path": "src/main/java/com/aspose/pdf/model/TextState.java",
"license": "mit",
"size": 2289
}
|
[
"com.aspose.pdf.model.Color"
] |
import com.aspose.pdf.model.Color;
|
import com.aspose.pdf.model.*;
|
[
"com.aspose.pdf"
] |
com.aspose.pdf;
| 1,531,198
|
public static void write(OutputStream output, int value)
{
output.write_ulong(value);
}
|
static void function(OutputStream output, int value) { output.write_ulong(value); }
|
/**
* Write the int (policy type) to the CDR output stream.
*
* @param output a org.omg.CORBA.portable stream stream to write into.
* @param value a value to write.
*/
|
Write the int (policy type) to the CDR output stream
|
write
|
{
"repo_name": "shaotuanchen/sunflower_exp",
"path": "tools/source/gcc-4.2.4/libjava/classpath/org/omg/CORBA/PolicyTypeHelper.java",
"license": "bsd-3-clause",
"size": 3928
}
|
[
"org.omg.CORBA"
] |
import org.omg.CORBA;
|
import org.omg.*;
|
[
"org.omg"
] |
org.omg;
| 1,834,003
|
public LsaWrapper getLsa(int lsType, String linkStateID, String advertisingRouter) throws Exception {
String lsaKey = lsType + "-" + linkStateID + "-" + advertisingRouter;
if (lsType == OspfParameters.LINK_LOCAL_OPAQUE_LSA || lsType == OspfParameters.AREA_LOCAL_OPAQUE_LSA ||
lsType == OspfParameters.AS_OPAQUE_LSA) {
byte[] linkStateAsBytes = InetAddress.getByName(linkStateID).getAddress();
int opaqueType = linkStateAsBytes[0];
int opaqueId = OspfUtil.byteToInteger(Arrays.copyOfRange(linkStateAsBytes, 1,
linkStateAsBytes.length));
lsaKey = lsType + "-" + opaqueType + opaqueId + "-" + advertisingRouter;
}
return database.findLsa(lsType, lsaKey);
}
|
LsaWrapper function(int lsType, String linkStateID, String advertisingRouter) throws Exception { String lsaKey = lsType + "-" + linkStateID + "-" + advertisingRouter; if (lsType == OspfParameters.LINK_LOCAL_OPAQUE_LSA lsType == OspfParameters.AREA_LOCAL_OPAQUE_LSA lsType == OspfParameters.AS_OPAQUE_LSA) { byte[] linkStateAsBytes = InetAddress.getByName(linkStateID).getAddress(); int opaqueType = linkStateAsBytes[0]; int opaqueId = OspfUtil.byteToInteger(Arrays.copyOfRange(linkStateAsBytes, 1, linkStateAsBytes.length)); lsaKey = lsType + "-" + opaqueType + opaqueId + "-" + advertisingRouter; } return database.findLsa(lsType, lsaKey); }
|
/**
* Gets the LSA from LSDB based on the input.
*
* @param lsType type of lsa to form the key
* @param linkStateID link state id to form the key
* @param advertisingRouter advertising router to form the key
* @return lsa wrapper instance which contains the Lsa
* @throws Exception might throws exception
*/
|
Gets the LSA from LSDB based on the input
|
getLsa
|
{
"repo_name": "Shashikanth-Huawei/bmp",
"path": "protocols/ospf/ctl/src/main/java/org/onosproject/ospf/controller/area/OspfAreaImpl.java",
"license": "apache-2.0",
"size": 27712
}
|
[
"java.net.InetAddress",
"java.util.Arrays",
"org.onosproject.ospf.controller.LsaWrapper",
"org.onosproject.ospf.protocol.util.OspfParameters",
"org.onosproject.ospf.protocol.util.OspfUtil"
] |
import java.net.InetAddress; import java.util.Arrays; import org.onosproject.ospf.controller.LsaWrapper; import org.onosproject.ospf.protocol.util.OspfParameters; import org.onosproject.ospf.protocol.util.OspfUtil;
|
import java.net.*; import java.util.*; import org.onosproject.ospf.controller.*; import org.onosproject.ospf.protocol.util.*;
|
[
"java.net",
"java.util",
"org.onosproject.ospf"
] |
java.net; java.util; org.onosproject.ospf;
| 1,941,551
|
protected void printReportGroupForIncomeEndowmentTotal(TreeMap<Integer, TreeMap<String, List<ReportGroupData>>> reportGroupsForIncomeTotal, BigDecimal totalHistoryIncomeCash, Document docuement, PdfPTable table, Font cellFont) throws Exception {
table.addCell(new Paragraph("Income Cash", cellFont));
table.addCell("");
table.addCell(getAmountCell(totalHistoryIncomeCash, cellFont));
table.addCell("");
table.addCell("");
table.addCell("");
if (reportGroupsForIncomeTotal == null || reportGroupsForIncomeTotal.isEmpty()) {
table.addCell(new Paragraph("TOTAL CASH AND\nEQUIVALENTS", titleFont));
table.addCell("");
table.addCell(getAmountCell(totalHistoryIncomeCash, cellFont));
table.addCell("");
table.addCell("");
table.addCell("");
return;
}
// Cash and equivalents
BigDecimal grandTotalMarketValue1 = BigDecimal.ZERO;
BigDecimal grandTotalEstimatedAnnualIncome1 = BigDecimal.ZERO;
BigDecimal grandTotalFyRemainderEAI1 = BigDecimal.ZERO;
BigDecimal grandTotalNextFyEAI1 = BigDecimal.ZERO;
TreeMap<String, List<ReportGroupData>> cashEquivalentsData = reportGroupsForIncomeTotal.get(1);
if (cashEquivalentsData != null && !cashEquivalentsData.isEmpty()) {
Iterator<String> secirutyIdSet = cashEquivalentsData.keySet().iterator();
while (secirutyIdSet.hasNext()) {
// get securityId
String securityId = secirutyIdSet.next();
List<ReportGroupData> dataList = cashEquivalentsData.get(securityId);
BigDecimal totalUnits = BigDecimal.ZERO;
BigDecimal totalMarketValue = BigDecimal.ZERO;
BigDecimal totalEstimatedAnnualIncome = BigDecimal.ZERO;
BigDecimal totalFyRemainderEAI = BigDecimal.ZERO;
BigDecimal totalNextFyEAI = BigDecimal.ZERO;
for (ReportGroupData data : dataList) {
totalUnits = totalUnits.add(data.getSumOfUnits());
totalMarketValue = totalMarketValue.add(data.getSumOfMarketValue());
totalEstimatedAnnualIncome = totalEstimatedAnnualIncome.add(data.getSumOfEstimatedIncome());
totalFyRemainderEAI = totalFyRemainderEAI.add(data.getSumOfRemainderOfFYEstimated());
totalNextFyEAI = totalNextFyEAI.add(data.getSumOfNextFYEstimatedIncome());
}
table.addCell(new Paragraph(dataList.get(0).getSecurityDesc(), cellFont));
table.addCell(getAmountCell(totalUnits, cellFont, FORMAT164));
table.addCell(getAmountCell(totalMarketValue, cellFont));
table.addCell(getAmountCell(totalEstimatedAnnualIncome, cellFont));
table.addCell(getAmountCell(totalFyRemainderEAI, cellFont));
table.addCell(getAmountCell(totalNextFyEAI, cellFont));
grandTotalMarketValue1 = grandTotalMarketValue1.add(totalMarketValue);
grandTotalEstimatedAnnualIncome1 = grandTotalEstimatedAnnualIncome1.add(totalEstimatedAnnualIncome);
grandTotalFyRemainderEAI1 = grandTotalFyRemainderEAI1.add(totalFyRemainderEAI);
grandTotalNextFyEAI1 = grandTotalNextFyEAI1.add(totalNextFyEAI);
}
}
table.addCell(new Paragraph("TOTAL CASH AND\nEQUIVALENTS", titleFont));
table.addCell("");
table.addCell(getAmountCell(grandTotalMarketValue1.add(totalHistoryIncomeCash), cellFont));
table.addCell("");
table.addCell("");
table.addCell("");
// Other report groups
BigDecimal grandTotalMarketValueN = BigDecimal.ZERO;
BigDecimal grandTotalEstimatedAnnualIncomeN = BigDecimal.ZERO;
BigDecimal grandTotalFyRemainderEAIN = BigDecimal.ZERO;
BigDecimal grandTotalNextFyEAIN = BigDecimal.ZERO;
Iterator<Integer> reportGroupOrderSet = reportGroupsForIncomeTotal.keySet().iterator();
while (reportGroupOrderSet.hasNext()) {
Integer reportGroupOrder = reportGroupOrderSet.next();
if (reportGroupOrder.intValue() > 1) {
TreeMap<String, List<ReportGroupData>> reportGroupDataBySecurity = reportGroupsForIncomeTotal.get(reportGroupOrder);
// print report group description
String reportGroupDesc = reportGroupDataBySecurity.firstEntry().getValue().get(0).getReportGroupDesc();
PdfPCell groupDescCell = new PdfPCell(new Paragraph(reportGroupDesc, titleFont));
groupDescCell.setColspan(6);
table.addCell(groupDescCell);
// print totals per security id
BigDecimal totalGroupMarketValue = BigDecimal.ZERO;
Iterator<String> securityIdSet = reportGroupDataBySecurity.keySet().iterator();
while (securityIdSet.hasNext()) {
String securityId = securityIdSet.next();
List<ReportGroupData> dataList = reportGroupDataBySecurity.get(securityId);
BigDecimal totalUnits = BigDecimal.ZERO;
BigDecimal totalMarketValue = BigDecimal.ZERO;
BigDecimal totalEstimatedAnnualIncome = BigDecimal.ZERO;
BigDecimal totalFyRemainderEAI = BigDecimal.ZERO;
BigDecimal totalNextFyEAI = BigDecimal.ZERO;
for (ReportGroupData data : dataList) {
totalUnits = totalUnits.add(data.getSumOfUnits());
totalMarketValue = totalMarketValue.add(data.getSumOfMarketValue());
totalGroupMarketValue = totalGroupMarketValue.add(data.getSumOfMarketValue());
totalEstimatedAnnualIncome = totalEstimatedAnnualIncome.add(data.getSumOfEstimatedIncome());
totalFyRemainderEAI = totalFyRemainderEAI.add(data.getSumOfRemainderOfFYEstimated());
totalNextFyEAI = totalNextFyEAI.add(data.getSumOfNextFYEstimatedIncome());
}
table.addCell(new Paragraph(dataList.get(0).getSecurityDesc(), cellFont));
table.addCell(getAmountCell(totalUnits, cellFont, FORMAT164));
table.addCell(getAmountCell(totalMarketValue, cellFont));
table.addCell(getAmountCell(totalEstimatedAnnualIncome, cellFont));
table.addCell(getAmountCell(totalFyRemainderEAI, cellFont));
table.addCell(getAmountCell(totalNextFyEAI, cellFont));
grandTotalMarketValueN = grandTotalMarketValueN.add(totalMarketValue);
grandTotalEstimatedAnnualIncomeN = grandTotalEstimatedAnnualIncomeN.add(totalEstimatedAnnualIncome);
grandTotalFyRemainderEAIN = grandTotalFyRemainderEAIN.add(totalFyRemainderEAI);
grandTotalNextFyEAIN = grandTotalNextFyEAIN.add(totalNextFyEAI);
}
// totals
table.addCell(new Paragraph("TOTAL " + convertToUpperCase(reportGroupDesc), cellFont));
table.addCell("");
table.addCell(getAmountCell(totalGroupMarketValue, cellFont));
table.addCell("");
table.addCell("");
table.addCell("");
}
}
// total expendable funds
table.addCell(new Paragraph("TOTAL EXPENDABLE FUNDS", titleFont));
table.addCell("");
table.addCell(getAmountCell(grandTotalMarketValue1.add(grandTotalMarketValueN).add(totalHistoryIncomeCash), cellFont));
table.addCell(getAmountCell(grandTotalEstimatedAnnualIncome1.add(grandTotalEstimatedAnnualIncomeN), cellFont));
table.addCell(getAmountCell(grandTotalFyRemainderEAI1.add(grandTotalFyRemainderEAIN), cellFont));
table.addCell(getAmountCell(grandTotalNextFyEAI1.add(grandTotalNextFyEAIN), cellFont));
}
|
void function(TreeMap<Integer, TreeMap<String, List<ReportGroupData>>> reportGroupsForIncomeTotal, BigDecimal totalHistoryIncomeCash, Document docuement, PdfPTable table, Font cellFont) throws Exception { table.addCell(new Paragraph(STR, cellFont)); table.addCell(STRSTRSTRSTRTOTAL CASH AND\nEQUIVALENTS", titleFont)); table.addCell(STRSTRSTRSTRTOTAL CASH AND\nEQUIVALENTSSTRSTRSTRSTRSTRTOTAL STRSTRSTRSTRSTRTOTAL EXPENDABLE FUNDSSTR"); table.addCell(getAmountCell(grandTotalMarketValue1.add(grandTotalMarketValueN).add(totalHistoryIncomeCash), cellFont)); table.addCell(getAmountCell(grandTotalEstimatedAnnualIncome1.add(grandTotalEstimatedAnnualIncomeN), cellFont)); table.addCell(getAmountCell(grandTotalFyRemainderEAI1.add(grandTotalFyRemainderEAIN), cellFont)); table.addCell(getAmountCell(grandTotalNextFyEAI1.add(grandTotalNextFyEAIN), cellFont)); }
|
/**
* Generates report group income non-endowed total
*
* @param reportGroupsForIncomeTotal
* @param totalHistoryIncomeCash
* @param docuement
* @param table
* @param cellFont
* @throws Exception
*/
|
Generates report group income non-endowed total
|
printReportGroupForIncomeEndowmentTotal
|
{
"repo_name": "Ariah-Group/Finance",
"path": "af_webapp/src/main/java/org/kuali/kfs/module/endow/report/util/AssetStatementReportPrint.java",
"license": "apache-2.0",
"size": 86911
}
|
[
"com.lowagie.text.Document",
"com.lowagie.text.Font",
"com.lowagie.text.Paragraph",
"com.lowagie.text.pdf.PdfPTable",
"java.math.BigDecimal",
"java.util.List",
"java.util.TreeMap",
"org.kuali.kfs.module.endow.report.util.AssetStatementReportDataHolder"
] |
import com.lowagie.text.Document; import com.lowagie.text.Font; import com.lowagie.text.Paragraph; import com.lowagie.text.pdf.PdfPTable; import java.math.BigDecimal; import java.util.List; import java.util.TreeMap; import org.kuali.kfs.module.endow.report.util.AssetStatementReportDataHolder;
|
import com.lowagie.text.*; import com.lowagie.text.pdf.*; import java.math.*; import java.util.*; import org.kuali.kfs.module.endow.report.util.*;
|
[
"com.lowagie.text",
"java.math",
"java.util",
"org.kuali.kfs"
] |
com.lowagie.text; java.math; java.util; org.kuali.kfs;
| 1,897,233
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.