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
|
|---|---|---|---|---|---|---|---|---|---|---|---|
@Handler
public void handle(Exchange exchange) throws Exception {
onExchange(exchange);
}
|
void function(Exchange exchange) throws Exception { onExchange(exchange); }
|
/**
* Handles the incoming exchange.
* <p/>
* This method turns this mock endpoint into a bean which you can use
* in the Camel routes, which allows you to inject MockEndpoint as beans
* in your routes and use the features of the mock to control the bean.
*
* @param exchange the exchange
* @throws Exception can be thrown
*/
|
Handles the incoming exchange. This method turns this mock endpoint into a bean which you can use in the Camel routes, which allows you to inject MockEndpoint as beans in your routes and use the features of the mock to control the bean
|
handle
|
{
"repo_name": "engagepoint/camel",
"path": "camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java",
"license": "apache-2.0",
"size": 52988
}
|
[
"org.apache.camel.Exchange"
] |
import org.apache.camel.Exchange;
|
import org.apache.camel.*;
|
[
"org.apache.camel"
] |
org.apache.camel;
| 1,963,514
|
public String getClazzName(Properties saoData) {
return saoData.getProperty(ApplicationFinder.CLASS_NAME_PROPNAME);
}
|
String function(Properties saoData) { return saoData.getProperty(ApplicationFinder.CLASS_NAME_PROPNAME); }
|
/**
* Return the name of the class to use for this name or null if the name
* is not in the <code>Properties</code> object.
*
*
* @param saoData
* A <code>Properties</code> object which may or may not
* contain the class name
*
* @return A <code>String</code> representing the name of the
* ServerActiveHtml object to look up the corressponding class
* name for.
*/
|
Return the name of the class to use for this name or null if the name is not in the <code>Properties</code> object
|
getClazzName
|
{
"repo_name": "janekdb/ntropa",
"path": "presentation/wps/src/tests/org/ntropa/build/html/ServerActiveHtmlTest.java",
"license": "apache-2.0",
"size": 13381
}
|
[
"java.util.Properties",
"org.ntropa.build.jsp.ApplicationFinder"
] |
import java.util.Properties; import org.ntropa.build.jsp.ApplicationFinder;
|
import java.util.*; import org.ntropa.build.jsp.*;
|
[
"java.util",
"org.ntropa.build"
] |
java.util; org.ntropa.build;
| 360,174
|
@SuppressWarnings("unchecked")
public <S, D> Type<? extends D> getConcreteClass(Type<S> sourceType, Type<D> destinationType) {
if (isNew) {
return null;
}
final Type<?> type = mapping.get(sourceType);
if (type != null && destinationType.isAssignableFrom(type)) {
return (Type<? extends D>) type;
}
return null;
}
|
@SuppressWarnings(STR) <S, D> Type<? extends D> function(Type<S> sourceType, Type<D> destinationType) { if (isNew) { return null; } final Type<?> type = mapping.get(sourceType); if (type != null && destinationType.isAssignableFrom(type)) { return (Type<? extends D>) type; } return null; }
|
/**
* Searches for a concrete class that has been registered for the given
* abstract class or interface within this mapping session.
*
* @param sourceType
* @param destinationType
* @return a concrete class that has been registered for the given abstract
* class or interface within this mapping session, if any
*/
|
Searches for a concrete class that has been registered for the given abstract class or interface within this mapping session
|
getConcreteClass
|
{
"repo_name": "andreabertagnolli/orika",
"path": "core/src/main/java/ma/glasnost/orika/MappingContext.java",
"license": "apache-2.0",
"size": 18820
}
|
[
"ma.glasnost.orika.metadata.Type"
] |
import ma.glasnost.orika.metadata.Type;
|
import ma.glasnost.orika.metadata.*;
|
[
"ma.glasnost.orika"
] |
ma.glasnost.orika;
| 1,829,881
|
public static void print(LoadBalancer resource) {
StringBuilder info = new StringBuilder();
info.append("Load balancer: ").append(resource.id())
.append("Name: ").append(resource.name())
.append("\n\tResource group: ").append(resource.resourceGroupName())
.append("\n\tRegion: ").append(resource.region())
.append("\n\tTags: ").append(resource.tags())
.append("\n\tBackends: ").append(resource.backends().keySet().toString());
// Show public IP addresses
info.append("\n\tPublic IP address IDs: ")
.append(resource.publicIPAddressIds().size());
for (String pipId : resource.publicIPAddressIds()) {
info.append("\n\t\tPIP id: ").append(pipId);
}
// Show TCP probes
info.append("\n\tTCP probes: ")
.append(resource.tcpProbes().size());
for (LoadBalancerTcpProbe probe : resource.tcpProbes().values()) {
info.append("\n\t\tProbe name: ").append(probe.name())
.append("\n\t\t\tPort: ").append(probe.port())
.append("\n\t\t\tInterval in seconds: ").append(probe.intervalInSeconds())
.append("\n\t\t\tRetries before unhealthy: ").append(probe.numberOfProbes());
// Show associated load balancing rules
info.append("\n\t\t\tReferenced from load balancing rules: ")
.append(probe.loadBalancingRules().size());
for (LoadBalancingRule rule : probe.loadBalancingRules().values()) {
info.append("\n\t\t\t\tName: ").append(rule.name());
}
}
// Show HTTP probes
info.append("\n\tHTTP probes: ")
.append(resource.httpProbes().size());
for (LoadBalancerHttpProbe probe : resource.httpProbes().values()) {
info.append("\n\t\tProbe name: ").append(probe.name())
.append("\n\t\t\tPort: ").append(probe.port())
.append("\n\t\t\tInterval in seconds: ").append(probe.intervalInSeconds())
.append("\n\t\t\tRetries before unhealthy: ").append(probe.numberOfProbes())
.append("\n\t\t\tHTTP request path: ").append(probe.requestPath());
// Show associated load balancing rules
info.append("\n\t\t\tReferenced from load balancing rules: ")
.append(probe.loadBalancingRules().size());
for (LoadBalancingRule rule : probe.loadBalancingRules().values()) {
info.append("\n\t\t\t\tName: ").append(rule.name());
}
}
// Show load balancing rules
info.append("\n\tLoad balancing rules: ")
.append(resource.loadBalancingRules().size());
for (LoadBalancingRule rule : resource.loadBalancingRules().values()) {
info.append("\n\t\tLB rule name: ").append(rule.name())
.append("\n\t\t\tProtocol: ").append(rule.protocol())
.append("\n\t\t\tFloating IP enabled? ").append(rule.floatingIPEnabled())
.append("\n\t\t\tIdle timeout in minutes: ").append(rule.idleTimeoutInMinutes())
.append("\n\t\t\tLoad distribution method: ").append(rule.loadDistribution().toString());
LoadBalancerFrontend frontend = rule.frontend();
info.append("\n\t\t\tFrontend: ");
if (frontend != null) {
info.append(frontend.name());
} else {
info.append("(None)");
}
info.append("\n\t\t\tFrontend port: ").append(rule.frontendPort());
LoadBalancerBackend backend = rule.backend();
info.append("\n\t\t\tBackend: ");
if (backend != null) {
info.append(backend.name());
} else {
info.append("(None)");
}
info.append("\n\t\t\tBackend port: ").append(rule.backendPort());
LoadBalancerProbe probe = rule.probe();
info.append("\n\t\t\tProbe: ");
if (probe == null) {
info.append("(None)");
} else {
info.append(probe.name()).append(" [").append(probe.protocol().toString()).append("]");
}
}
// Show frontends
info.append("\n\tFrontends: ")
.append(resource.frontends().size());
for (LoadBalancerFrontend frontend : resource.frontends().values()) {
info.append("\n\t\tFrontend name: ").append(frontend.name())
.append("\n\t\t\tInternet facing: ").append(frontend.isPublic());
if (frontend.isPublic()) {
info.append("\n\t\t\tPublic IP Address ID: ").append(((LoadBalancerPublicFrontend) frontend).publicIPAddressId());
} else {
info.append("\n\t\t\tVirtual network ID: ").append(((LoadBalancerPrivateFrontend) frontend).networkId())
.append("\n\t\t\tSubnet name: ").append(((LoadBalancerPrivateFrontend) frontend).subnetName())
.append("\n\t\t\tPrivate IP address: ").append(((LoadBalancerPrivateFrontend) frontend).privateIPAddress())
.append("\n\t\t\tPrivate IP allocation method: ").append(((LoadBalancerPrivateFrontend) frontend).privateIPAllocationMethod());
}
// Inbound NAT pool references
info.append("\n\t\t\tReferenced inbound NAT pools: ")
.append(frontend.inboundNatPools().size());
for (LoadBalancerInboundNatPool pool : frontend.inboundNatPools().values()) {
info.append("\n\t\t\t\tName: ").append(pool.name());
}
// Inbound NAT rule references
info.append("\n\t\t\tReferenced inbound NAT rules: ")
.append(frontend.inboundNatRules().size());
for (LoadBalancerInboundNatRule rule : frontend.inboundNatRules().values()) {
info.append("\n\t\t\t\tName: ").append(rule.name());
}
// Load balancing rule references
info.append("\n\t\t\tReferenced load balancing rules: ")
.append(frontend.loadBalancingRules().size());
for (LoadBalancingRule rule : frontend.loadBalancingRules().values()) {
info.append("\n\t\t\t\tName: ").append(rule.name());
}
}
// Show inbound NAT rules
info.append("\n\tInbound NAT rules: ")
.append(resource.inboundNatRules().size());
for (LoadBalancerInboundNatRule natRule : resource.inboundNatRules().values()) {
info.append("\n\t\tInbound NAT rule name: ").append(natRule.name())
.append("\n\t\t\tProtocol: ").append(natRule.protocol().toString())
.append("\n\t\t\tFrontend: ").append(natRule.frontend().name())
.append("\n\t\t\tFrontend port: ").append(natRule.frontendPort())
.append("\n\t\t\tBackend port: ").append(natRule.backendPort())
.append("\n\t\t\tBackend NIC ID: ").append(natRule.backendNetworkInterfaceId())
.append("\n\t\t\tBackend NIC IP config name: ").append(natRule.backendNicIPConfigurationName())
.append("\n\t\t\tFloating IP? ").append(natRule.floatingIPEnabled())
.append("\n\t\t\tIdle timeout in minutes: ").append(natRule.idleTimeoutInMinutes());
}
// Show inbound NAT pools
info.append("\n\tInbound NAT pools: ")
.append(resource.inboundNatPools().size());
for (LoadBalancerInboundNatPool natPool : resource.inboundNatPools().values()) {
info.append("\n\t\tInbound NAT pool name: ").append(natPool.name())
.append("\n\t\t\tProtocol: ").append(natPool.protocol().toString())
.append("\n\t\t\tFrontend: ").append(natPool.frontend().name())
.append("\n\t\t\tFrontend port range: ")
.append(natPool.frontendPortRangeStart())
.append("-")
.append(natPool.frontendPortRangeEnd())
.append("\n\t\t\tBackend port: ").append(natPool.backendPort());
}
// Show backends
info.append("\n\tBackends: ")
.append(resource.backends().size());
for (LoadBalancerBackend backend : resource.backends().values()) {
info.append("\n\t\tBackend name: ").append(backend.name());
// Show assigned backend NICs
info.append("\n\t\t\tReferenced NICs: ")
.append(backend.backendNicIPConfigurationNames().entrySet().size());
for (Map.Entry<String, String> entry : backend.backendNicIPConfigurationNames().entrySet()) {
info.append("\n\t\t\t\tNIC ID: ").append(entry.getKey())
.append(" - IP Config: ").append(entry.getValue());
}
// Show assigned virtual machines
Set<String> vmIds = backend.getVirtualMachineIds();
info.append("\n\t\t\tReferenced virtual machine ids: ")
.append(vmIds.size());
for (String vmId : vmIds) {
info.append("\n\t\t\t\tVM ID: ").append(vmId);
}
// Show assigned load balancing rules
info.append("\n\t\t\tReferenced load balancing rules: ")
.append(new ArrayList<String>(backend.loadBalancingRules().keySet()));
}
System.out.println(info.toString());
}
|
static void function(LoadBalancer resource) { StringBuilder info = new StringBuilder(); info.append(STR).append(resource.id()) .append(STR).append(resource.name()) .append(STR).append(resource.resourceGroupName()) .append(STR).append(resource.region()) .append(STR).append(resource.tags()) .append(STR).append(resource.backends().keySet().toString()); info.append(STR) .append(resource.publicIPAddressIds().size()); for (String pipId : resource.publicIPAddressIds()) { info.append(STR).append(pipId); } info.append(STR) .append(resource.tcpProbes().size()); for (LoadBalancerTcpProbe probe : resource.tcpProbes().values()) { info.append(STR).append(probe.name()) .append(STR).append(probe.port()) .append(STR).append(probe.intervalInSeconds()) .append(STR).append(probe.numberOfProbes()); info.append(STR) .append(probe.loadBalancingRules().size()); for (LoadBalancingRule rule : probe.loadBalancingRules().values()) { info.append(STR).append(rule.name()); } } info.append(STR) .append(resource.httpProbes().size()); for (LoadBalancerHttpProbe probe : resource.httpProbes().values()) { info.append(STR).append(probe.name()) .append(STR).append(probe.port()) .append(STR).append(probe.intervalInSeconds()) .append(STR).append(probe.numberOfProbes()) .append(STR).append(probe.requestPath()); info.append(STR) .append(probe.loadBalancingRules().size()); for (LoadBalancingRule rule : probe.loadBalancingRules().values()) { info.append(STR).append(rule.name()); } } info.append(STR) .append(resource.loadBalancingRules().size()); for (LoadBalancingRule rule : resource.loadBalancingRules().values()) { info.append(STR).append(rule.name()) .append(STR).append(rule.protocol()) .append(STR).append(rule.floatingIPEnabled()) .append(STR).append(rule.idleTimeoutInMinutes()) .append(STR).append(rule.loadDistribution().toString()); LoadBalancerFrontend frontend = rule.frontend(); info.append(STR); if (frontend != null) { info.append(frontend.name()); } else { info.append(STR); } info.append(STR).append(rule.frontendPort()); LoadBalancerBackend backend = rule.backend(); info.append(STR); if (backend != null) { info.append(backend.name()); } else { info.append(STR); } info.append(STR).append(rule.backendPort()); LoadBalancerProbe probe = rule.probe(); info.append(STR); if (probe == null) { info.append(STR); } else { info.append(probe.name()).append(STR).append(probe.protocol().toString()).append("]"); } } info.append(STR) .append(resource.frontends().size()); for (LoadBalancerFrontend frontend : resource.frontends().values()) { info.append(STR).append(frontend.name()) .append(STR).append(frontend.isPublic()); if (frontend.isPublic()) { info.append(STR).append(((LoadBalancerPublicFrontend) frontend).publicIPAddressId()); } else { info.append(STR).append(((LoadBalancerPrivateFrontend) frontend).networkId()) .append(STR).append(((LoadBalancerPrivateFrontend) frontend).subnetName()) .append(STR).append(((LoadBalancerPrivateFrontend) frontend).privateIPAddress()) .append(STR).append(((LoadBalancerPrivateFrontend) frontend).privateIPAllocationMethod()); } info.append(STR) .append(frontend.inboundNatPools().size()); for (LoadBalancerInboundNatPool pool : frontend.inboundNatPools().values()) { info.append(STR).append(pool.name()); } info.append(STR) .append(frontend.inboundNatRules().size()); for (LoadBalancerInboundNatRule rule : frontend.inboundNatRules().values()) { info.append(STR).append(rule.name()); } info.append(STR) .append(frontend.loadBalancingRules().size()); for (LoadBalancingRule rule : frontend.loadBalancingRules().values()) { info.append(STR).append(rule.name()); } } info.append(STR) .append(resource.inboundNatRules().size()); for (LoadBalancerInboundNatRule natRule : resource.inboundNatRules().values()) { info.append(STR).append(natRule.name()) .append(STR).append(natRule.protocol().toString()) .append(STR).append(natRule.frontend().name()) .append(STR).append(natRule.frontendPort()) .append(STR).append(natRule.backendPort()) .append(STR).append(natRule.backendNetworkInterfaceId()) .append(STR).append(natRule.backendNicIPConfigurationName()) .append(STR).append(natRule.floatingIPEnabled()) .append(STR).append(natRule.idleTimeoutInMinutes()); } info.append(STR) .append(resource.inboundNatPools().size()); for (LoadBalancerInboundNatPool natPool : resource.inboundNatPools().values()) { info.append(STR).append(natPool.name()) .append(STR).append(natPool.protocol().toString()) .append(STR).append(natPool.frontend().name()) .append(STR) .append(natPool.frontendPortRangeStart()) .append("-") .append(natPool.frontendPortRangeEnd()) .append(STR).append(natPool.backendPort()); } info.append(STR) .append(resource.backends().size()); for (LoadBalancerBackend backend : resource.backends().values()) { info.append(STR).append(backend.name()); info.append(STR) .append(backend.backendNicIPConfigurationNames().entrySet().size()); for (Map.Entry<String, String> entry : backend.backendNicIPConfigurationNames().entrySet()) { info.append(STR).append(entry.getKey()) .append(STR).append(entry.getValue()); } Set<String> vmIds = backend.getVirtualMachineIds(); info.append(STR) .append(vmIds.size()); for (String vmId : vmIds) { info.append(STR).append(vmId); } info.append(STR) .append(new ArrayList<String>(backend.loadBalancingRules().keySet())); } System.out.println(info.toString()); }
|
/**
* Print load balancer.
*
* @param resource a load balancer
*/
|
Print load balancer
|
print
|
{
"repo_name": "martinsawicki/azure-sdk-for-java",
"path": "azure-samples/src/main/java/com/microsoft/azure/management/samples/Utils.java",
"license": "mit",
"size": 124123
}
|
[
"com.microsoft.azure.management.network.LoadBalancer",
"com.microsoft.azure.management.network.LoadBalancerBackend",
"com.microsoft.azure.management.network.LoadBalancerFrontend",
"com.microsoft.azure.management.network.LoadBalancerHttpProbe",
"com.microsoft.azure.management.network.LoadBalancerInboundNatPool",
"com.microsoft.azure.management.network.LoadBalancerInboundNatRule",
"com.microsoft.azure.management.network.LoadBalancerPrivateFrontend",
"com.microsoft.azure.management.network.LoadBalancerProbe",
"com.microsoft.azure.management.network.LoadBalancerPublicFrontend",
"com.microsoft.azure.management.network.LoadBalancerTcpProbe",
"com.microsoft.azure.management.network.LoadBalancingRule",
"java.util.ArrayList",
"java.util.Map",
"java.util.Set"
] |
import com.microsoft.azure.management.network.LoadBalancer; import com.microsoft.azure.management.network.LoadBalancerBackend; import com.microsoft.azure.management.network.LoadBalancerFrontend; import com.microsoft.azure.management.network.LoadBalancerHttpProbe; import com.microsoft.azure.management.network.LoadBalancerInboundNatPool; import com.microsoft.azure.management.network.LoadBalancerInboundNatRule; import com.microsoft.azure.management.network.LoadBalancerPrivateFrontend; import com.microsoft.azure.management.network.LoadBalancerProbe; import com.microsoft.azure.management.network.LoadBalancerPublicFrontend; import com.microsoft.azure.management.network.LoadBalancerTcpProbe; import com.microsoft.azure.management.network.LoadBalancingRule; import java.util.ArrayList; import java.util.Map; import java.util.Set;
|
import com.microsoft.azure.management.network.*; import java.util.*;
|
[
"com.microsoft.azure",
"java.util"
] |
com.microsoft.azure; java.util;
| 1,270,153
|
@Override
public void drawLegendShape(Canvas canvas, SimpleSeriesRenderer renderer, float x, float y, int seriesIndex,
Paint paint)
{
canvas.drawLine(x, y, x + SHAPE_WIDTH, y, paint);
if (isRenderPoints(renderer))
{
pointsChart.drawLegendShape(canvas, renderer, x + 5, y, seriesIndex, paint);
}
}
|
void function(Canvas canvas, SimpleSeriesRenderer renderer, float x, float y, int seriesIndex, Paint paint) { canvas.drawLine(x, y, x + SHAPE_WIDTH, y, paint); if (isRenderPoints(renderer)) { pointsChart.drawLegendShape(canvas, renderer, x + 5, y, seriesIndex, paint); } }
|
/**
* The graphical representation of the legend shape.
*
* @param canvas the canvas to paint to
* @param renderer the series renderer
* @param x the x value of the point the shape should be drawn at
* @param y the y value of the point the shape should be drawn at
* @param seriesIndex the series index
* @param paint the paint to be used for drawing
*/
|
The graphical representation of the legend shape
|
drawLegendShape
|
{
"repo_name": "panthole/AndroidChart",
"path": "src/com/panthole/androidchart/chart/LineChart.java",
"license": "mit",
"size": 10785
}
|
[
"android.graphics.Canvas",
"android.graphics.Paint",
"com.panthole.androidchart.renderer.SimpleSeriesRenderer"
] |
import android.graphics.Canvas; import android.graphics.Paint; import com.panthole.androidchart.renderer.SimpleSeriesRenderer;
|
import android.graphics.*; import com.panthole.androidchart.renderer.*;
|
[
"android.graphics",
"com.panthole.androidchart"
] |
android.graphics; com.panthole.androidchart;
| 1,438,029
|
public List<GridH2Table> tablesForDml() throws IgniteSQLException {
Collection<?> parserObjects = h2ObjToGridObj.values();
List<GridH2Table> tbls = new ArrayList<>(parserObjects.size());
// check all involved caches
for (Object o : parserObjects) {
if (o instanceof GridSqlMerge)
o = ((GridSqlMerge)o).into();
else if (o instanceof GridSqlInsert)
o = ((GridSqlInsert)o).into();
else if (o instanceof GridSqlUpdate)
o = ((GridSqlUpdate)o).target();
else if (o instanceof GridSqlDelete)
o = ((GridSqlDelete)o).from();
if (o instanceof GridSqlAlias)
o = GridSqlAlias.unwrap((GridSqlAst)o);
if (o instanceof GridSqlTable) {
GridH2Table h2tbl = ((GridSqlTable)o).dataTable();
if (h2tbl == null) { // Check for virtual tables.
throw new IgniteSQLException("Operation not supported for table '" +
((GridSqlTable)o).tableName() + "'", IgniteQueryErrorCode.UNSUPPORTED_OPERATION);
}
tbls.add(h2tbl);
}
}
return tbls;
}
|
List<GridH2Table> function() throws IgniteSQLException { Collection<?> parserObjects = h2ObjToGridObj.values(); List<GridH2Table> tbls = new ArrayList<>(parserObjects.size()); for (Object o : parserObjects) { if (o instanceof GridSqlMerge) o = ((GridSqlMerge)o).into(); else if (o instanceof GridSqlInsert) o = ((GridSqlInsert)o).into(); else if (o instanceof GridSqlUpdate) o = ((GridSqlUpdate)o).target(); else if (o instanceof GridSqlDelete) o = ((GridSqlDelete)o).from(); if (o instanceof GridSqlAlias) o = GridSqlAlias.unwrap((GridSqlAst)o); if (o instanceof GridSqlTable) { GridH2Table h2tbl = ((GridSqlTable)o).dataTable(); if (h2tbl == null) { throw new IgniteSQLException(STR + ((GridSqlTable)o).tableName() + "'", IgniteQueryErrorCode.UNSUPPORTED_OPERATION); } tbls.add(h2tbl); } } return tbls; }
|
/**
* Extract all tables participating in DML statement.
*
* @return List of tables participate at query.
* @throws IgniteSQLException in case query contains virtual tables.
*/
|
Extract all tables participating in DML statement
|
tablesForDml
|
{
"repo_name": "NSAmelchev/ignite",
"path": "modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQueryParser.java",
"license": "apache-2.0",
"size": 89869
}
|
[
"java.util.ArrayList",
"java.util.Collection",
"java.util.List",
"org.apache.ignite.internal.processors.cache.query.IgniteQueryErrorCode",
"org.apache.ignite.internal.processors.query.IgniteSQLException",
"org.apache.ignite.internal.processors.query.h2.opt.GridH2Table"
] |
import java.util.ArrayList; import java.util.Collection; import java.util.List; import org.apache.ignite.internal.processors.cache.query.IgniteQueryErrorCode; import org.apache.ignite.internal.processors.query.IgniteSQLException; import org.apache.ignite.internal.processors.query.h2.opt.GridH2Table;
|
import java.util.*; import org.apache.ignite.internal.processors.cache.query.*; import org.apache.ignite.internal.processors.query.*; import org.apache.ignite.internal.processors.query.h2.opt.*;
|
[
"java.util",
"org.apache.ignite"
] |
java.util; org.apache.ignite;
| 44,576
|
EReference getDocumentRoot_OtherSource();
|
EReference getDocumentRoot_OtherSource();
|
/**
* Returns the meta object for the containment reference '{@link net.opengis.ows20.DocumentRoot#getOtherSource <em>Other Source</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference '<em>Other Source</em>'.
* @see net.opengis.ows20.DocumentRoot#getOtherSource()
* @see #getDocumentRoot()
* @generated
*/
|
Returns the meta object for the containment reference '<code>net.opengis.ows20.DocumentRoot#getOtherSource Other Source</code>'.
|
getDocumentRoot_OtherSource
|
{
"repo_name": "geotools/geotools",
"path": "modules/ogc/net.opengis.ows/src/net/opengis/ows20/Ows20Package.java",
"license": "lgpl-2.1",
"size": 356067
}
|
[
"org.eclipse.emf.ecore.EReference"
] |
import org.eclipse.emf.ecore.EReference;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 1,706,308
|
public void sendBinaryMessage(long senderId, long receiverId, String content, int type)
{
EntityDao<MessageEntity> dao = PersistContext.CTX.getEntityDao(MessageEntity.class);
MessageEntity me = new MessageEntity();
me.setContent(content);
me.setReceiverId(receiverId);
me.setSenderId(senderId);
me.setSendTime(TimeUtil.getYYYYMMDDHHMMSSTime());
me.setType(type);
if (IMServer.CTX.isOnline(receiverId))
{
me.setIsRead(1);
// 通知好友信息
Protocol notify = new Protocol(Actions.ReceiveMsgHandler);
notify.receiver = receiverId;
notify.setParameter("msg", JSON.toJSONString(me));
IMServer.CTX.push(notify);
}
else
{
me.setIsRead(0);
}
dao.persist(me);
}
|
void function(long senderId, long receiverId, String content, int type) { EntityDao<MessageEntity> dao = PersistContext.CTX.getEntityDao(MessageEntity.class); MessageEntity me = new MessageEntity(); me.setContent(content); me.setReceiverId(receiverId); me.setSenderId(senderId); me.setSendTime(TimeUtil.getYYYYMMDDHHMMSSTime()); me.setType(type); if (IMServer.CTX.isOnline(receiverId)) { me.setIsRead(1); Protocol notify = new Protocol(Actions.ReceiveMsgHandler); notify.receiver = receiverId; notify.setParameter("msg", JSON.toJSONString(me)); IMServer.CTX.push(notify); } else { me.setIsRead(0); } dao.persist(me); }
|
/**
* send binary message to client
* @param senderId
* @param receiverId
* @param content
* @param type
*/
|
send binary message to client
|
sendBinaryMessage
|
{
"repo_name": "seanzwx/tmp",
"path": "seatalk/im/im-friend/im-friend-impl/src/main/java/com/sean/im/friend/service/MessageServiceImpl.java",
"license": "apache-2.0",
"size": 5236
}
|
[
"com.alibaba.fastjson.JSON",
"com.sean.commom.util.TimeUtil",
"com.sean.im.commom.constant.Actions",
"com.sean.im.commom.core.Protocol",
"com.sean.im.friend.entity.MessageEntity",
"com.sean.im.server.push.IMServer",
"com.sean.persist.core.EntityDao",
"com.sean.persist.core.PersistContext"
] |
import com.alibaba.fastjson.JSON; import com.sean.commom.util.TimeUtil; import com.sean.im.commom.constant.Actions; import com.sean.im.commom.core.Protocol; import com.sean.im.friend.entity.MessageEntity; import com.sean.im.server.push.IMServer; import com.sean.persist.core.EntityDao; import com.sean.persist.core.PersistContext;
|
import com.alibaba.fastjson.*; import com.sean.commom.util.*; import com.sean.im.commom.constant.*; import com.sean.im.commom.core.*; import com.sean.im.friend.entity.*; import com.sean.im.server.push.*; import com.sean.persist.core.*;
|
[
"com.alibaba.fastjson",
"com.sean.commom",
"com.sean.im",
"com.sean.persist"
] |
com.alibaba.fastjson; com.sean.commom; com.sean.im; com.sean.persist;
| 1,847,956
|
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
switch (notification.getFeatureID(OutPort.class)) {
case SimulinkPackage.OUT_PORT__CONNECTION:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
return;
}
super.notifyChanged(notification);
}
|
void function(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(OutPort.class)) { case SimulinkPackage.OUT_PORT__CONNECTION: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } super.notifyChanged(notification); }
|
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
|
This handles model notifications by calling <code>#updateChildren</code> to update any cached children and by creating a viewer notification, which it passes to <code>#fireNotifyChanged</code>.
|
notifyChanged
|
{
"repo_name": "FTSRG/massif",
"path": "plugins/hu.bme.mit.massif.simulink.edit/src/hu/bme/mit/massif/simulink/provider/OutPortItemProvider.java",
"license": "epl-1.0",
"size": 5306
}
|
[
"hu.bme.mit.massif.simulink.OutPort",
"hu.bme.mit.massif.simulink.SimulinkPackage",
"org.eclipse.emf.common.notify.Notification",
"org.eclipse.emf.edit.provider.ViewerNotification"
] |
import hu.bme.mit.massif.simulink.OutPort; import hu.bme.mit.massif.simulink.SimulinkPackage; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.edit.provider.ViewerNotification;
|
import hu.bme.mit.massif.simulink.*; import org.eclipse.emf.common.notify.*; import org.eclipse.emf.edit.provider.*;
|
[
"hu.bme.mit",
"org.eclipse.emf"
] |
hu.bme.mit; org.eclipse.emf;
| 980,680
|
ServiceResponse<Void> updatePetWithForm(String petId) throws ServiceException, IOException, IllegalArgumentException;
|
ServiceResponse<Void> updatePetWithForm(String petId) throws ServiceException, IOException, IllegalArgumentException;
|
/**
* Updates a pet in the store with form data.
*
* @param petId ID of pet that needs to be updated
* @throws ServiceException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @throws IllegalArgumentException exception thrown from invalid parameters
* @return the {@link ServiceResponse} object if successful.
*/
|
Updates a pet in the store with form data
|
updatePetWithForm
|
{
"repo_name": "tbombach/autorest",
"path": "Samples/petstore/Java/SwaggerPetstore.java",
"license": "mit",
"size": 38331
}
|
[
"com.microsoft.rest.ServiceException",
"com.microsoft.rest.ServiceResponse",
"java.io.IOException"
] |
import com.microsoft.rest.ServiceException; import com.microsoft.rest.ServiceResponse; import java.io.IOException;
|
import com.microsoft.rest.*; import java.io.*;
|
[
"com.microsoft.rest",
"java.io"
] |
com.microsoft.rest; java.io;
| 1,685,351
|
@Override
public void afterPropertiesSet() throws Exception {
loadAutonomiccsSystemVmServiceOffering();
if (autonomiccsSystemVmServiceOffering == null) {
throw new CloudRuntimeException("Could not register the Autonomiccs system VMs service offering.");
}
}
|
void function() throws Exception { loadAutonomiccsSystemVmServiceOffering(); if (autonomiccsSystemVmServiceOffering == null) { throw new CloudRuntimeException(STR); } }
|
/**
* This method is used to load the default service offering for the Autonomiccs system VM.
*/
|
This method is used to load the default service offering for the Autonomiccs system VM
|
afterPropertiesSet
|
{
"repo_name": "Autonomiccs/autonomiccs-platform",
"path": "autonomic-plugin-common/src/main/java/br/com/autonomiccs/autonomic/plugin/common/services/AutonomiccsSystemVmDeploymentService.java",
"license": "apache-2.0",
"size": 32250
}
|
[
"com.cloud.utils.exception.CloudRuntimeException"
] |
import com.cloud.utils.exception.CloudRuntimeException;
|
import com.cloud.utils.exception.*;
|
[
"com.cloud.utils"
] |
com.cloud.utils;
| 1,267,320
|
@GET
@Path("/containers/json")
List<Container> containers(@QueryParam("all") Integer all, @QueryParam("limit") Integer limit, @QueryParam("since") String since, @QueryParam("before") String before, @QueryParam("size") Integer size);
|
@Path(STR) List<Container> containers(@QueryParam("all") Integer all, @QueryParam("limit") Integer limit, @QueryParam("since") String since, @QueryParam(STR) String before, @QueryParam("size") Integer size);
|
/**
* Get the list of {@link Container} instances.
*
* @param all 1/True/true or 0/False/false, Show all containers. Only running containers are shown by default.
* @param limit Show limit last created containers, include non-running ones.
* @param since Show only containers created since Id, include non-running ones.
* @param before Show only containers created before Id, include non-running ones.
* @param size 1/True/true or 0/False/false, Show the containers sizes.
* @return
*/
|
Get the list of <code>Container</code> instances
|
containers
|
{
"repo_name": "hekonsek/fabric8",
"path": "components/docker-api/src/main/java/io/fabric8/docker/api/Docker.java",
"license": "apache-2.0",
"size": 9552
}
|
[
"java.util.List",
"javax.ws.rs.Path",
"javax.ws.rs.QueryParam"
] |
import java.util.List; import javax.ws.rs.Path; import javax.ws.rs.QueryParam;
|
import java.util.*; import javax.ws.rs.*;
|
[
"java.util",
"javax.ws"
] |
java.util; javax.ws;
| 2,685,351
|
Observable<ServiceResponse<Boolean>> head404WithServiceResponseAsync();
|
Observable<ServiceResponse<Boolean>> head404WithServiceResponseAsync();
|
/**
* Return 404 status code if successful.
*
* @return the observable to the boolean object
*/
|
Return 404 status code if successful
|
head404WithServiceResponseAsync
|
{
"repo_name": "tbombach/autorest",
"path": "src/generator/AutoRest.Java.Azure.Tests/src/main/java/fixtures/head/HttpSuccess.java",
"license": "mit",
"size": 3626
}
|
[
"com.microsoft.rest.ServiceResponse"
] |
import com.microsoft.rest.ServiceResponse;
|
import com.microsoft.rest.*;
|
[
"com.microsoft.rest"
] |
com.microsoft.rest;
| 2,370,669
|
@PUT
@Path("kill")
@Produces("application/json")
boolean killScheduler(@HeaderParam("sessionid")
final String sessionId) throws NotConnectedRestException, PermissionRestException;
|
@Path("kill") @Produces(STR) boolean killScheduler(@HeaderParam(STR) final String sessionId) throws NotConnectedRestException, PermissionRestException;
|
/**
* kills and shutdowns the scheduler
*
* @param sessionId
* a valid session id
* @return true if success, false if not
* @throws NotConnectedRestException
* @throws PermissionRestException
*/
|
kills and shutdowns the scheduler
|
killScheduler
|
{
"repo_name": "zeineb/scheduling",
"path": "rest/rest-api/src/main/java/org/ow2/proactive_grid_cloud_portal/common/SchedulerRestInterface.java",
"license": "agpl-3.0",
"size": 79398
}
|
[
"javax.ws.rs.HeaderParam",
"javax.ws.rs.Path",
"javax.ws.rs.Produces",
"org.ow2.proactive_grid_cloud_portal.scheduler.exception.NotConnectedRestException",
"org.ow2.proactive_grid_cloud_portal.scheduler.exception.PermissionRestException"
] |
import javax.ws.rs.HeaderParam; import javax.ws.rs.Path; import javax.ws.rs.Produces; import org.ow2.proactive_grid_cloud_portal.scheduler.exception.NotConnectedRestException; import org.ow2.proactive_grid_cloud_portal.scheduler.exception.PermissionRestException;
|
import javax.ws.rs.*; import org.ow2.proactive_grid_cloud_portal.scheduler.exception.*;
|
[
"javax.ws",
"org.ow2.proactive_grid_cloud_portal"
] |
javax.ws; org.ow2.proactive_grid_cloud_portal;
| 1,736,545
|
public static List<double[]> coordSplit(List<Double> vector) {
if (vector == null) return null;
List<double[]> ret = new ArrayList<double[]>();
double[] xVals = new double[vector.size() / 2];
double[] yVals = new double[vector.size() / 2];
int xTracker = 0;
int yTracker = 0;
for (int i = 0; i < vector.size(); i++) {
//even value, x coordinate
if (i % 2 == 0) xVals[xTracker++] = vector.get(i);
//y coordinate
else yVals[yTracker++] = vector.get(i);
}
ret.add(xVals);
ret.add(yVals);
return ret;
}//end coordSplit
|
static List<double[]> function(List<Double> vector) { if (vector == null) return null; List<double[]> ret = new ArrayList<double[]>(); double[] xVals = new double[vector.size() / 2]; double[] yVals = new double[vector.size() / 2]; int xTracker = 0; int yTracker = 0; for (int i = 0; i < vector.size(); i++) { if (i % 2 == 0) xVals[xTracker++] = vector.get(i); else yVals[yTracker++] = vector.get(i); } ret.add(xVals); ret.add(yVals); return ret; }
|
/**
* This returns the coordinate split in a list of coordinates
* such that the values for ret[0] are the x values
* and ret[1] are the y values
*
* @param vector the vector to split with x and y values
* Note that the list will be more stable due to the size operator.
* The array version will have extraneous values if not monitored
* properly.
* @return a coordinate split for the given vector of values.
* if null, is passed in null is returned
*/
|
This returns the coordinate split in a list of coordinates such that the values for ret[0] are the x values and ret[1] are the y values
|
coordSplit
|
{
"repo_name": "drlebedev/nd4j",
"path": "nd4j-common/src/main/java/org/nd4j/linalg/util/MathUtils.java",
"license": "apache-2.0",
"size": 40239
}
|
[
"java.util.ArrayList",
"java.util.List"
] |
import java.util.ArrayList; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 73,754
|
private void defaultSettings(View quantityLayout, View
descriptionLayout, View descriptionDivider) {
category = Category.MISCELLANEOUS;
subCategory = SubCategory.OTHERS;
quantityLayout.setVisibility(View.VISIBLE);
descriptionLayout.setVisibility(View.VISIBLE);
descriptionDivider.setVisibility(View.VISIBLE);
}
|
void function(View quantityLayout, View descriptionLayout, View descriptionDivider) { category = Category.MISCELLANEOUS; subCategory = SubCategory.OTHERS; quantityLayout.setVisibility(View.VISIBLE); descriptionLayout.setVisibility(View.VISIBLE); descriptionDivider.setVisibility(View.VISIBLE); }
|
/**
* set up the default setting for the options
*/
|
set up the default setting for the options
|
defaultSettings
|
{
"repo_name": "SnehankurChakraborty/Roomies",
"path": "app/src/main/java/com/phaseii/rxm/roomies/ui/dialogs/AddExpenseDialog.java",
"license": "apache-2.0",
"size": 32717
}
|
[
"android.view.View",
"com.phaseii.rxm.roomies.utils.Category",
"com.phaseii.rxm.roomies.utils.SubCategory"
] |
import android.view.View; import com.phaseii.rxm.roomies.utils.Category; import com.phaseii.rxm.roomies.utils.SubCategory;
|
import android.view.*; import com.phaseii.rxm.roomies.utils.*;
|
[
"android.view",
"com.phaseii.rxm"
] |
android.view; com.phaseii.rxm;
| 2,123,294
|
protected static ResultSet getEncountersUth(String table, Date beginDate, Date endDate, Connection conn, boolean groupBy) throws ServletException {
ResultSet rs = null;
try {
// Retrieve all Encounter records for this form
String sql = "SELECT * FROM " + table + " " +
"JOIN encounter ON encounter.id = " + table + ".id " +
"JOIN site ON site.id = encounter.site_id " +
"AND date_visit >= ? AND date_visit <= ? " +
"AND site_type_id = 2";
if (groupBy) {
sql = sql + " GROUP BY patient_id";
}
PreparedStatement ps = conn.prepareStatement(sql);
ps.setDate(1, beginDate);
ps.setDate(2, endDate);
rs = ps.executeQuery();
} catch (Exception ex) {
throw new ServletException(ex);
}
return rs;
}
|
static ResultSet function(String table, Date beginDate, Date endDate, Connection conn, boolean groupBy) throws ServletException { ResultSet rs = null; try { String sql = STR + table + " " + STR + table + STR + STR + STR + STR; if (groupBy) { sql = sql + STR; } PreparedStatement ps = conn.prepareStatement(sql); ps.setDate(1, beginDate); ps.setDate(2, endDate); rs = ps.executeQuery(); } catch (Exception ex) { throw new ServletException(ex); } return rs; }
|
/**
* This search all UTH sites
* @param table The table that stores the form's submissions
* @param beginDate The first date of the report's time frame
* @param endDate The last date of the report's time frame
* @param groupBy Use groupby to fetch only one record per patient?
* @param conn
* @param groupBy
* @return Returns a ResultSet containing all patient Encounters pertaining
* to this form during the time frame
* @throws ServletException
*/
|
This search all UTH sites
|
getEncountersUth
|
{
"repo_name": "chrisekelley/zeprs",
"path": "src/zeprs/org/cidrz/project/zeprs/report/ZEPRSUtils.java",
"license": "apache-2.0",
"size": 79024
}
|
[
"java.sql.Connection",
"java.sql.Date",
"java.sql.PreparedStatement",
"java.sql.ResultSet",
"javax.servlet.ServletException"
] |
import java.sql.Connection; import java.sql.Date; import java.sql.PreparedStatement; import java.sql.ResultSet; import javax.servlet.ServletException;
|
import java.sql.*; import javax.servlet.*;
|
[
"java.sql",
"javax.servlet"
] |
java.sql; javax.servlet;
| 2,582,686
|
public void increment(View view) {
if (quantity == 100) {
// Show an error message as a toast
Toast.makeText(this, getString(R.string.more_than_100), Toast.LENGTH_SHORT).show();
// Exit this method early because there's nothing left to do
return;
}
quantity = quantity + 1;
displayQuantity(quantity);
}
|
void function(View view) { if (quantity == 100) { Toast.makeText(this, getString(R.string.more_than_100), Toast.LENGTH_SHORT).show(); return; } quantity = quantity + 1; displayQuantity(quantity); }
|
/**
* This method is called when the plus button is clicked.
*/
|
This method is called when the plus button is clicked
|
increment
|
{
"repo_name": "zuaq/Udacity",
"path": "Android Development for Beginners/JustJava/app/src/main/java/com/example/android/justjava/MainActivity.java",
"license": "apache-2.0",
"size": 5652
}
|
[
"android.view.View",
"android.widget.Toast"
] |
import android.view.View; import android.widget.Toast;
|
import android.view.*; import android.widget.*;
|
[
"android.view",
"android.widget"
] |
android.view; android.widget;
| 861,917
|
public Player getPlayer() {
return player;
}
|
Player function() { return player; }
|
/**
* Gets the found player.
*
* @return the found player.
*/
|
Gets the found player
|
getPlayer
|
{
"repo_name": "pdinklag/SpigotMCPlugins",
"path": "Common/src/com/dvgaming/spigotmc/common/check/TargetPlayerOnlineCheck.java",
"license": "mit",
"size": 972
}
|
[
"org.bukkit.entity.Player"
] |
import org.bukkit.entity.Player;
|
import org.bukkit.entity.*;
|
[
"org.bukkit.entity"
] |
org.bukkit.entity;
| 1,336,472
|
@Nonnull
public WorkbookChartDataLabelFormatRequest expand(@Nonnull final String value) {
addExpandOption(value);
return this;
}
|
WorkbookChartDataLabelFormatRequest function(@Nonnull final String value) { addExpandOption(value); return this; }
|
/**
* Sets the expand clause for the request
*
* @param value the expand clause
* @return the updated request
*/
|
Sets the expand clause for the request
|
expand
|
{
"repo_name": "microsoftgraph/msgraph-sdk-java",
"path": "src/main/java/com/microsoft/graph/requests/WorkbookChartDataLabelFormatRequest.java",
"license": "mit",
"size": 6793
}
|
[
"javax.annotation.Nonnull"
] |
import javax.annotation.Nonnull;
|
import javax.annotation.*;
|
[
"javax.annotation"
] |
javax.annotation;
| 2,154,027
|
@Override
public void destroy()
{
super.destroy();
ArrayList<StatefulProxy> values = new ArrayList<StatefulProxy>();
if (_sessionMap != null) {
Iterator<StatefulProxy> iter = _sessionMap.values().iterator();
while (iter.hasNext()) {
values.add(iter.next());
}
}
_sessionMap = null;
for (StatefulProxy obj : values) {
try {
// obj.remove();
} catch (Throwable e) {
log.log(Level.WARNING, e.toString(), e);
}
}
log.fine(this + " closed");
}
|
void function() { super.destroy(); ArrayList<StatefulProxy> values = new ArrayList<StatefulProxy>(); if (_sessionMap != null) { Iterator<StatefulProxy> iter = _sessionMap.values().iterator(); while (iter.hasNext()) { values.add(iter.next()); } } _sessionMap = null; for (StatefulProxy obj : values) { try { } catch (Throwable e) { log.log(Level.WARNING, e.toString(), e); } } log.fine(this + STR); }
|
/**
* Cleans up the entity server nicely.
*/
|
Cleans up the entity server nicely
|
destroy
|
{
"repo_name": "dlitz/resin",
"path": "modules/resin/src/com/caucho/ejb/session/StatefulManager.java",
"license": "gpl-2.0",
"size": 11593
}
|
[
"java.util.ArrayList",
"java.util.Iterator",
"java.util.logging.Level"
] |
import java.util.ArrayList; import java.util.Iterator; import java.util.logging.Level;
|
import java.util.*; import java.util.logging.*;
|
[
"java.util"
] |
java.util;
| 1,848,800
|
public int getLocalPort() {
TcpDiscoveryNode locNode0 = locNode;
return locNode0 != null ? locNode0.discoveryPort() : 0;
}
|
int function() { TcpDiscoveryNode locNode0 = locNode; return locNode0 != null ? locNode0.discoveryPort() : 0; }
|
/**
* Gets local TCP port SPI listens to.
*
* @return Local port range.
*/
|
Gets local TCP port SPI listens to
|
getLocalPort
|
{
"repo_name": "vadopolski/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java",
"license": "apache-2.0",
"size": 76666
}
|
[
"org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode"
] |
import org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode;
|
import org.apache.ignite.spi.discovery.tcp.internal.*;
|
[
"org.apache.ignite"
] |
org.apache.ignite;
| 1,260,283
|
public boolean skipPast(String to) throws JSONException {
boolean b;
char c;
int i;
int j;
int offset = 0;
int length = to.length();
char[] circle = new char[length];
for (i = 0; i < length; i += 1) {
c = next();
if (c == 0) {
return false;
}
circle[i] = c;
}
for (;;) {
j = offset;
b = true;
for (i = 0; i < length; i += 1) {
if (circle[j] != to.charAt(i)) {
b = false;
break;
}
j += 1;
if (j >= length) {
j -= length;
}
}
if (b) {
return true;
}
c = next();
if (c == 0) {
return false;
}
circle[offset] = c;
offset += 1;
if (offset >= length) {
offset -= length;
}
}
}
|
boolean function(String to) throws JSONException { boolean b; char c; int i; int j; int offset = 0; int length = to.length(); char[] circle = new char[length]; for (i = 0; i < length; i += 1) { c = next(); if (c == 0) { return false; } circle[i] = c; } for (;;) { j = offset; b = true; for (i = 0; i < length; i += 1) { if (circle[j] != to.charAt(i)) { b = false; break; } j += 1; if (j >= length) { j -= length; } } if (b) { return true; } c = next(); if (c == 0) { return false; } circle[offset] = c; offset += 1; if (offset >= length) { offset -= length; } } }
|
/**
* Skip characters until past the requested string.
* If it is not found, we are left at the end of the source with a result of false.
* @param to A string to skip past.
* @throws JSONException
*/
|
Skip characters until past the requested string. If it is not found, we are left at the end of the source with a result of false
|
skipPast
|
{
"repo_name": "mojo1643/margarita",
"path": "app/src/main/java/com/example/root/margarita/util/XMLTokener.java",
"license": "mit",
"size": 9975
}
|
[
"org.json.JSONException"
] |
import org.json.JSONException;
|
import org.json.*;
|
[
"org.json"
] |
org.json;
| 2,191,254
|
@Nullable
protected java.util.List<KeyValuePair> templateParameters;
@Nonnull
public ChatSendActivityNotificationParameterSetBuilder withTemplateParameters(@Nullable final java.util.List<KeyValuePair> val) {
this.templateParameters = val;
return this;
}
|
java.util.List<KeyValuePair> templateParameters; public ChatSendActivityNotificationParameterSetBuilder function(@Nullable final java.util.List<KeyValuePair> val) { this.templateParameters = val; return this; }
|
/**
* Sets the TemplateParameters
* @param val the value to set it to
* @return the current builder object
*/
|
Sets the TemplateParameters
|
withTemplateParameters
|
{
"repo_name": "microsoftgraph/msgraph-sdk-java",
"path": "src/main/java/com/microsoft/graph/models/ChatSendActivityNotificationParameterSet.java",
"license": "mit",
"size": 8000
}
|
[
"com.microsoft.graph.models.KeyValuePair",
"javax.annotation.Nullable"
] |
import com.microsoft.graph.models.KeyValuePair; import javax.annotation.Nullable;
|
import com.microsoft.graph.models.*; import javax.annotation.*;
|
[
"com.microsoft.graph",
"javax.annotation"
] |
com.microsoft.graph; javax.annotation;
| 2,310,537
|
@WebMethod
CheckSubstanceResult checkSubstanceById(@WebParam(name = "auId") String auId)
throws LockssWebServicesFault;
|
CheckSubstanceResult checkSubstanceById(@WebParam(name = "auId") String auId) throws LockssWebServicesFault;
|
/**
* Provides an indication of whether an archival unit has substance.
*
* @param auId
* A String with the identifier (auid) of the archival unit.
* @return a CheckSubstanceResult with the result of the operation.
* @throws LockssWebServicesFault
*/
|
Provides an indication of whether an archival unit has substance
|
checkSubstanceById
|
{
"repo_name": "lockss/lockss-daemon",
"path": "src/org/lockss/ws/control/AuControlService.java",
"license": "bsd-3-clause",
"size": 10376
}
|
[
"javax.jws.WebParam",
"org.lockss.ws.entities.CheckSubstanceResult",
"org.lockss.ws.entities.LockssWebServicesFault"
] |
import javax.jws.WebParam; import org.lockss.ws.entities.CheckSubstanceResult; import org.lockss.ws.entities.LockssWebServicesFault;
|
import javax.jws.*; import org.lockss.ws.entities.*;
|
[
"javax.jws",
"org.lockss.ws"
] |
javax.jws; org.lockss.ws;
| 2,192,354
|
public void setSASL(String mechanism, String authorizationId,
CallbackHandler cbh)
{
this.saslMechanism = mechanism;
this.saslAuthorizationId = authorizationId;
this.callbackHandler = cbh;
clearUpDesires();
this.saslDesired = true;
}
|
void function(String mechanism, String authorizationId, CallbackHandler cbh) { this.saslMechanism = mechanism; this.saslAuthorizationId = authorizationId; this.callbackHandler = cbh; clearUpDesires(); this.saslDesired = true; }
|
/**
* Set the mechanism and other parameters for SASL Client
* @param mechanism
* @param authorizationId
* @param cbh
*/
|
Set the mechanism and other parameters for SASL Client
|
setSASL
|
{
"repo_name": "picketbox/picketbox",
"path": "security-spi/spi/src/main/java/org/jboss/security/client/SecurityClient.java",
"license": "lgpl-2.1",
"size": 5069
}
|
[
"javax.security.auth.callback.CallbackHandler"
] |
import javax.security.auth.callback.CallbackHandler;
|
import javax.security.auth.callback.*;
|
[
"javax.security"
] |
javax.security;
| 2,743,854
|
public native void release();
private HIDManager() throws IOException
{
init();
}
|
native void function(); private HIDManager() throws IOException { init(); }
|
/**
* Release underlying HID layer. This method must be called when
* <code>HIDManager<code> object is no longer needed. Failure to
* do so could cause memory leaks or unterminated threads. It is
* safe to call this method multiple times.
*
*/
|
Release underlying HID layer. This method must be called when <code>HIDManager<code> object is no longer needed. Failure to do so could cause memory leaks or unterminated threads. It is safe to call this method multiple times
|
release
|
{
"repo_name": "rohitdubey12/kura",
"path": "target-platform/com.codeminders.hidapi/src/main/java/com/codeminders/hidapi/HIDManager.java",
"license": "epl-1.0",
"size": 3621
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,186,081
|
String processPid = Integer.toString(mPid);
String cpuStatPath = "/proc/" + processPid + "/stat";
try {
// monitor cpu stat of certain process
RandomAccessFile processCpuInfo = new RandomAccessFile(cpuStatPath, "r");
String line = "";
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.setLength(0);
while ((line = processCpuInfo.readLine()) != null) {
stringBuffer.append(line + "\n");
}
String[] tok = stringBuffer.toString().split(" ");
mProcessCpu = Long.parseLong(tok[13]) + Long.parseLong(tok[14]);
processCpuInfo.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
try {
// monitor total and idle cpu stat of certain process
RandomAccessFile cpuInfo = new RandomAccessFile(STAT_PATH, "r");
String[] toks = cpuInfo.readLine().split(" ");
mIdleCpu = Long.parseLong(toks[5]);
mTotalCpu = Long.parseLong(toks[2]) + Long.parseLong(toks[3]) + Long.parseLong(toks[4])
+ Long.parseLong(toks[5]) + Long.parseLong(toks[6]) + Long.parseLong(toks[7])
+ Long.parseLong(toks[8]);
cpuInfo.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
|
String processPid = Integer.toString(mPid); String cpuStatPath = STR + processPid + "/stat"; try { RandomAccessFile processCpuInfo = new RandomAccessFile(cpuStatPath, "r"); String line = STR\nSTR STRrSTR "); mIdleCpu = Long.parseLong(toks[5]); mTotalCpu = Long.parseLong(toks[2]) + Long.parseLong(toks[3]) + Long.parseLong(toks[4]) + Long.parseLong(toks[5]) + Long.parseLong(toks[6]) + Long.parseLong(toks[7]) + Long.parseLong(toks[8]); cpuInfo.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } }
|
/**
* read the status of CPU
*
* @throws FileNotFoundException
*/
|
read the status of CPU
|
readCpuStat
|
{
"repo_name": "seker/monitor",
"path": "src/seker/monitor/status/CpuInfo.java",
"license": "apache-2.0",
"size": 10888
}
|
[
"java.io.FileNotFoundException",
"java.io.IOException",
"java.io.RandomAccessFile"
] |
import java.io.FileNotFoundException; import java.io.IOException; import java.io.RandomAccessFile;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,865,356
|
public void buildObservableScenarioValues() {
MarketDataFactory factory = MarketDataFactory.of(
new TestObservableDataProvider(),
new TestTimeSeriesProvider(ImmutableMap.of()));
BuiltScenarioMarketData suppliedData = BuiltScenarioMarketData.builder(date(2011, 3, 8)).build();
TestObservableId id1 = TestObservableId.of(StandardId.of("reqs", "a"));
TestObservableId id2 = TestObservableId.of(StandardId.of("reqs", "b"));
MarketDataRequirements requirements = MarketDataRequirements.builder().addValues(id1, id2).build();
// This mapping doesn't perturb any data but it causes three scenarios to be built
PerturbationMapping<Double> mapping =
PerturbationMapping.of(
Double.class,
new FalseFilter<>(TestObservableId.class),
new AbsoluteDoubleShift(1, 2, 3));
ScenarioDefinition scenarioDefinition = ScenarioDefinition.ofMappings(ImmutableList.of(mapping));
BuiltScenarioMarketData marketData = factory.createMultiScenario(
requirements,
MARKET_DATA_CONFIG,
suppliedData,
REF_DATA, scenarioDefinition);
assertThat(marketData.getValue(id1)).isEqualTo(MarketDataBox.ofSingleValue(1d));
assertThat(marketData.getValue(id2)).isEqualTo(MarketDataBox.ofSingleValue(2d));
}
|
void function() { MarketDataFactory factory = MarketDataFactory.of( new TestObservableDataProvider(), new TestTimeSeriesProvider(ImmutableMap.of())); BuiltScenarioMarketData suppliedData = BuiltScenarioMarketData.builder(date(2011, 3, 8)).build(); TestObservableId id1 = TestObservableId.of(StandardId.of("reqs", "a")); TestObservableId id2 = TestObservableId.of(StandardId.of("reqs", "b")); MarketDataRequirements requirements = MarketDataRequirements.builder().addValues(id1, id2).build(); PerturbationMapping<Double> mapping = PerturbationMapping.of( Double.class, new FalseFilter<>(TestObservableId.class), new AbsoluteDoubleShift(1, 2, 3)); ScenarioDefinition scenarioDefinition = ScenarioDefinition.ofMappings(ImmutableList.of(mapping)); BuiltScenarioMarketData marketData = factory.createMultiScenario( requirements, MARKET_DATA_CONFIG, suppliedData, REF_DATA, scenarioDefinition); assertThat(marketData.getValue(id1)).isEqualTo(MarketDataBox.ofSingleValue(1d)); assertThat(marketData.getValue(id2)).isEqualTo(MarketDataBox.ofSingleValue(2d)); }
|
/**
* Tests building multiple observable values for scenarios where the values aren't perturbed.
*/
|
Tests building multiple observable values for scenarios where the values aren't perturbed
|
buildObservableScenarioValues
|
{
"repo_name": "jmptrader/Strata",
"path": "modules/calc/src/test/java/com/opengamma/strata/calc/marketdata/DefaultMarketDataFactoryTest.java",
"license": "apache-2.0",
"size": 50250
}
|
[
"com.google.common.collect.ImmutableList",
"com.google.common.collect.ImmutableMap",
"com.opengamma.strata.basics.StandardId",
"com.opengamma.strata.data.scenario.MarketDataBox",
"org.assertj.core.api.Assertions"
] |
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.opengamma.strata.basics.StandardId; import com.opengamma.strata.data.scenario.MarketDataBox; import org.assertj.core.api.Assertions;
|
import com.google.common.collect.*; import com.opengamma.strata.basics.*; import com.opengamma.strata.data.scenario.*; import org.assertj.core.api.*;
|
[
"com.google.common",
"com.opengamma.strata",
"org.assertj.core"
] |
com.google.common; com.opengamma.strata; org.assertj.core;
| 1,819,011
|
@Override
public SemanticBuilder<? extends SemanticChronology> getDynamicBuilder(
int referencedComponentNid,
int assemblageConceptNid) {
return new SemanticBuilderImpl(referencedComponentNid, assemblageConceptNid, VersionType.DYNAMIC);
}
|
SemanticBuilder<? extends SemanticChronology> function( int referencedComponentNid, int assemblageConceptNid) { return new SemanticBuilderImpl(referencedComponentNid, assemblageConceptNid, VersionType.DYNAMIC); }
|
/**
* Gets the dynamic builder.
*
* @param referencedComponentNid the referenced component nid
* @param assemblageConceptNid the assemblage concept nid
* @return the dynamic builder
*/
|
Gets the dynamic builder
|
getDynamicBuilder
|
{
"repo_name": "OSEHRA/ISAAC",
"path": "core/model/src/main/java/sh/isaac/model/builder/SemanticBuilderProvider.java",
"license": "apache-2.0",
"size": 15583
}
|
[
"sh.isaac.api.chronicle.VersionType",
"sh.isaac.api.component.semantic.SemanticBuilder",
"sh.isaac.api.component.semantic.SemanticChronology"
] |
import sh.isaac.api.chronicle.VersionType; import sh.isaac.api.component.semantic.SemanticBuilder; import sh.isaac.api.component.semantic.SemanticChronology;
|
import sh.isaac.api.chronicle.*; import sh.isaac.api.component.semantic.*;
|
[
"sh.isaac.api"
] |
sh.isaac.api;
| 1,938,175
|
List<TimerData> getAggregatedTimerData(TimerData timerData);
|
List<TimerData> getAggregatedTimerData(TimerData timerData);
|
/**
* Returns a list of the aggregated timer data for a given template. In this template, only the
* platform id is extracted.
*
* @param timerData
* The template containing the platform id.
* @return The list of the aggregated timer data object.
*/
|
Returns a list of the aggregated timer data for a given template. In this template, only the platform id is extracted
|
getAggregatedTimerData
|
{
"repo_name": "ivansenic/inspectIT",
"path": "inspectit.server/src/main/java/rocks/inspectit/server/dao/TimerDataDao.java",
"license": "agpl-3.0",
"size": 1075
}
|
[
"java.util.List",
"rocks.inspectit.shared.all.communication.data.TimerData"
] |
import java.util.List; import rocks.inspectit.shared.all.communication.data.TimerData;
|
import java.util.*; import rocks.inspectit.shared.all.communication.data.*;
|
[
"java.util",
"rocks.inspectit.shared"
] |
java.util; rocks.inspectit.shared;
| 1,617,223
|
public List<IFileSpec> taskEditSubmitTestFiles(IServer server, String[] filePaths, int returnType, String fileType) throws Exception {
List<IFileSpec> editFSpecs = FileSpecBuilder.makeFileSpecList(filePaths);
return taskEditSubmitTestFiles(server, editFSpecs, false, returnType, fileType);
}
|
List<IFileSpec> function(IServer server, String[] filePaths, int returnType, String fileType) throws Exception { List<IFileSpec> editFSpecs = FileSpecBuilder.makeFileSpecList(filePaths); return taskEditSubmitTestFiles(server, editFSpecs, false, returnType, fileType); }
|
/**
* Opens files for Edit and Submits the passed in fileSpecs and returns the list of submitted fileSpecs.
* No actual modification of the file takes place before submitting.
*/
|
Opens files for Edit and Submits the passed in fileSpecs and returns the list of submitted fileSpecs. No actual modification of the file takes place before submitting
|
taskEditSubmitTestFiles
|
{
"repo_name": "groboclown/p4ic4idea",
"path": "p4java/src/test/java/com/perforce/p4java/tests/dev/unit/endtoend/ClientEditSubmitE2ETest.java",
"license": "apache-2.0",
"size": 52979
}
|
[
"com.perforce.p4java.core.file.FileSpecBuilder",
"com.perforce.p4java.core.file.IFileSpec",
"com.perforce.p4java.server.IServer",
"java.util.List"
] |
import com.perforce.p4java.core.file.FileSpecBuilder; import com.perforce.p4java.core.file.IFileSpec; import com.perforce.p4java.server.IServer; import java.util.List;
|
import com.perforce.p4java.core.file.*; import com.perforce.p4java.server.*; import java.util.*;
|
[
"com.perforce.p4java",
"java.util"
] |
com.perforce.p4java; java.util;
| 731,697
|
Resource getSource();
|
Resource getSource();
|
/**
* Get the resource that holds the index source (setting / mapping)
*
* @return the resource
*/
|
Get the resource that holds the index source (setting / mapping)
|
getSource
|
{
"repo_name": "mgargadennec/blossom",
"path": "blossom-core/blossom-core-common/src/main/java/com/blossomproject/core/common/search/IndexationEngineConfiguration.java",
"license": "apache-2.0",
"size": 1191
}
|
[
"org.springframework.core.io.Resource"
] |
import org.springframework.core.io.Resource;
|
import org.springframework.core.io.*;
|
[
"org.springframework.core"
] |
org.springframework.core;
| 516,790
|
public static OfflinePageItem getOfflinePage(Tab tab) {
WebContents webContents = tab.getWebContents();
if (webContents == null) return null;
OfflinePageBridge offlinePageBridge = getInstance().getOfflinePageBridge(tab.getProfile());
if (offlinePageBridge == null) return null;
return offlinePageBridge.getOfflinePage(webContents);
}
|
static OfflinePageItem function(Tab tab) { WebContents webContents = tab.getWebContents(); if (webContents == null) return null; OfflinePageBridge offlinePageBridge = getInstance().getOfflinePageBridge(tab.getProfile()); if (offlinePageBridge == null) return null; return offlinePageBridge.getOfflinePage(webContents); }
|
/**
* Retrieves the offline page that is shown for the tab.
* @param tab The tab to be reloaded.
* @return The offline page if tab currently displays it, null otherwise.
*/
|
Retrieves the offline page that is shown for the tab
|
getOfflinePage
|
{
"repo_name": "mogoweb/365browser",
"path": "app/src/main/java/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java",
"license": "apache-2.0",
"size": 38527
}
|
[
"org.chromium.chrome.browser.tab.Tab",
"org.chromium.content_public.browser.WebContents"
] |
import org.chromium.chrome.browser.tab.Tab; import org.chromium.content_public.browser.WebContents;
|
import org.chromium.chrome.browser.tab.*; import org.chromium.content_public.browser.*;
|
[
"org.chromium.chrome",
"org.chromium.content_public"
] |
org.chromium.chrome; org.chromium.content_public;
| 1,625,169
|
public void setBuffer (ByteBuffer buffer) {
setBuffer(buffer, buffer.capacity());
}
|
void function (ByteBuffer buffer) { setBuffer(buffer, buffer.capacity()); }
|
/** Sets the buffer that will be written to. maxCapacity is set to the specified buffer's capacity.
* @see #setBuffer(ByteBuffer, int) */
|
Sets the buffer that will be written to. maxCapacity is set to the specified buffer's capacity
|
setBuffer
|
{
"repo_name": "romix/kryo",
"path": "src/com/esotericsoftware/kryo/io/ByteBufferOutput.java",
"license": "bsd-3-clause",
"size": 28843
}
|
[
"java.nio.ByteBuffer"
] |
import java.nio.ByteBuffer;
|
import java.nio.*;
|
[
"java.nio"
] |
java.nio;
| 2,295,151
|
public String text() {
return
"("+CodeGenFct.getName(returnType,testeeType)+")null";
}
|
String function() { return "("+CodeGenFct.getName(returnType,testeeType)+")null"; }
|
/**
* How to reproduce this value=object? (Type) null
*/
|
How to reproduce this value=object? (Type) null
|
text
|
{
"repo_name": "happylyy/jcrasher",
"path": "jcrasher-core/edu/gatech/cc/jcrasher/plans/expr/literals/NullLiteral.java",
"license": "mit",
"size": 1412
}
|
[
"edu.gatech.cc.jcrasher.writer.CodeGenFct"
] |
import edu.gatech.cc.jcrasher.writer.CodeGenFct;
|
import edu.gatech.cc.jcrasher.writer.*;
|
[
"edu.gatech.cc"
] |
edu.gatech.cc;
| 827,906
|
Properties properties = new Properties();
properties.put("agent1.channels", "ch0");
properties.put("agent1.channels.ch0.type", "memory");
properties.put("agent1.sources", "src0");
properties.put("agent1.sources.src0.type", "multiport_syslogtcp");
properties.put("agent1.sources.src0.channels", "ch0");
properties.put("agent1.sources.src0.host", "localhost");
properties.put("agent1.sources.src0.ports", "10001 10002 10003");
properties.put("agent1.sources.src0.portHeader", "port");
properties.put("agent1.sinks", "sink0");
properties.put("agent1.sinks.sink0.type", "null");
properties.put("agent1.sinks.sink0.channel", "ch0");
FlumeConfiguration conf = new FlumeConfiguration(properties);
AgentConfiguration agentConfiguration = conf.getConfigurationFor("agent1");
Assert.assertEquals(String.valueOf(agentConfiguration.getSourceSet()), 1,
agentConfiguration.getSourceSet().size());
Assert.assertEquals(String.valueOf(agentConfiguration.getChannelSet()), 1,
agentConfiguration.getChannelSet().size());
Assert.assertEquals(String.valueOf(agentConfiguration.getSinkSet()), 1,
agentConfiguration.getSinkSet().size());
Assert.assertTrue(agentConfiguration.getSourceSet().contains("src0"));
Assert.assertTrue(agentConfiguration.getChannelSet().contains("ch0"));
Assert.assertTrue(agentConfiguration.getSinkSet().contains("sink0"));
}
|
Properties properties = new Properties(); properties.put(STR, "ch0"); properties.put(STR, STR); properties.put(STR, "src0"); properties.put(STR, STR); properties.put(STR, "ch0"); properties.put(STR, STR); properties.put(STR, STR); properties.put(STR, "port"); properties.put(STR, "sink0"); properties.put(STR, "null"); properties.put(STR, "ch0"); FlumeConfiguration conf = new FlumeConfiguration(properties); AgentConfiguration agentConfiguration = conf.getConfigurationFor(STR); Assert.assertEquals(String.valueOf(agentConfiguration.getSourceSet()), 1, agentConfiguration.getSourceSet().size()); Assert.assertEquals(String.valueOf(agentConfiguration.getChannelSet()), 1, agentConfiguration.getChannelSet().size()); Assert.assertEquals(String.valueOf(agentConfiguration.getSinkSet()), 1, agentConfiguration.getSinkSet().size()); Assert.assertTrue(agentConfiguration.getSourceSet().contains("src0")); Assert.assertTrue(agentConfiguration.getChannelSet().contains("ch0")); Assert.assertTrue(agentConfiguration.getSinkSet().contains("sink0")); }
|
/**
* Test fails without FLUME-1743
*/
|
Test fails without FLUME-1743
|
testFLUME1743
|
{
"repo_name": "wangcy6/storm_app",
"path": "frame/apache-flume-1.7.0-src/flume-ng-configuration/src/test/java/org/apache/flume/conf/TestFlumeConfiguration.java",
"license": "apache-2.0",
"size": 2565
}
|
[
"java.util.Properties",
"junit.framework.Assert",
"org.apache.flume.conf.FlumeConfiguration"
] |
import java.util.Properties; import junit.framework.Assert; import org.apache.flume.conf.FlumeConfiguration;
|
import java.util.*; import junit.framework.*; import org.apache.flume.conf.*;
|
[
"java.util",
"junit.framework",
"org.apache.flume"
] |
java.util; junit.framework; org.apache.flume;
| 1,057,633
|
public String transmitIccLogicalChannelGemini(int cla, int command, int channel,
int p1, int p2, int p3, String data, int simId) throws android.os.RemoteException {
if (EncapsulationConstant.USE_MTK_PLATFORM) {
return sTelephony.transmitIccLogicalChannelGemini(cla, command, channel, p1,
p2, p3, data, simId);
} else {
return null;
}
}
|
String function(int cla, int command, int channel, int p1, int p2, int p3, String data, int simId) throws android.os.RemoteException { if (EncapsulationConstant.USE_MTK_PLATFORM) { return sTelephony.transmitIccLogicalChannelGemini(cla, command, channel, p1, p2, p3, data, simId); } else { return null; } }
|
/**
* Returns the response APDU for a command APDU sent to a logical channel for Gemini-Card
*/
|
Returns the response APDU for a command APDU sent to a logical channel for Gemini-Card
|
transmitIccLogicalChannelGemini
|
{
"repo_name": "rex-xxx/mt6572_x201",
"path": "packages/apps/Mms/src/com/mediatek/encapsulation/com/android/internal/telephony/EncapsulatedTelephonyService.java",
"license": "gpl-2.0",
"size": 46897
}
|
[
"com.mediatek.encapsulation.EncapsulationConstant"
] |
import com.mediatek.encapsulation.EncapsulationConstant;
|
import com.mediatek.encapsulation.*;
|
[
"com.mediatek.encapsulation"
] |
com.mediatek.encapsulation;
| 1,383,661
|
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<PagedResponse<UsageInner>> listByLocationNextSinglePageAsync(String nextLink) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listByLocationNext(nextLink, this.client.getEndpoint(), accept, context))
.<PagedResponse<UsageInner>>map(
res ->
new PagedResponseBase<>(
res.getRequest(),
res.getStatusCode(),
res.getHeaders(),
res.getValue().value(),
res.getValue().nextLink(),
null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
|
@ServiceMethod(returns = ReturnType.SINGLE) Mono<PagedResponse<UsageInner>> function(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException(STR)); } if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } final String accept = STR; return FluxUtil .withContext(context -> service.listByLocationNext(nextLink, this.client.getEndpoint(), accept, context)) .<PagedResponse<UsageInner>>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); }
|
/**
* Get the next page of items.
*
* @param nextLink The nextLink parameter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return list of Core Usages along with {@link PagedResponse} on successful completion of {@link Mono}.
*/
|
Get the next page of items
|
listByLocationNextSinglePageAsync
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsagesClientImpl.java",
"license": "mit",
"size": 15955
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.PagedResponse",
"com.azure.core.http.rest.PagedResponseBase",
"com.azure.core.util.FluxUtil",
"com.azure.resourcemanager.labservices.fluent.models.UsageInner"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.labservices.fluent.models.UsageInner;
|
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.labservices.fluent.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 2,156,275
|
@Override
public RemoteGroup join(long groupId, long userId, MessageReceiver messageReceiver) throws RemoteException {
synchronized (this) {
LocalGroup group;
if (shutDown) throw new ServiceException("Service has shutdown");
RemoteUserImpl user = userStore.getUserById(userId);
if (user == null) throw new ServiceException("User does not exist");
if ((group = groups.get(groupId)) == null) {
throw new ServiceException("Group doesn't exist");
}
boolean added = group.addUser(userId, user.getNicknameLocal(), messageReceiver);
if (!added) throw new ServiceException("Already in group");
return group;
}
}
|
RemoteGroup function(long groupId, long userId, MessageReceiver messageReceiver) throws RemoteException { synchronized (this) { LocalGroup group; if (shutDown) throw new ServiceException(STR); RemoteUserImpl user = userStore.getUserById(userId); if (user == null) throw new ServiceException(STR); if ((group = groups.get(groupId)) == null) { throw new ServiceException(STR); } boolean added = group.addUser(userId, user.getNicknameLocal(), messageReceiver); if (!added) throw new ServiceException(STR); return group; } }
|
/**
* Socket opcode -- 0x3
*
* @param groupId Group id to join
* @param userId user id
* @param messageReceiver Controller to receive events from the server
* @return
* @throws RemoteException
*/
|
Socket opcode -- 0x3
|
join
|
{
"repo_name": "kkroboth/GroupChats",
"path": "src/main/java/group_chats/server/ChatService.java",
"license": "mit",
"size": 9838
}
|
[
"java.rmi.RemoteException"
] |
import java.rmi.RemoteException;
|
import java.rmi.*;
|
[
"java.rmi"
] |
java.rmi;
| 1,800,578
|
private javax.swing.JScrollPane getJScrollPane() {
if (jScrollPane == null) {
jScrollPane = new javax.swing.JScrollPane();
jScrollPane.setSize(new Dimension(600,600));
jScrollPane.setPreferredSize( new Dimension(600,600));
jScrollPane.setViewportView(getLayerListPanel());
}
return jScrollPane;
}
|
javax.swing.JScrollPane function() { if (jScrollPane == null) { jScrollPane = new javax.swing.JScrollPane(); jScrollPane.setSize(new Dimension(600,600)); jScrollPane.setPreferredSize( new Dimension(600,600)); jScrollPane.setViewportView(getLayerListPanel()); } return jScrollPane; }
|
/**
* This method initializes jScrollPane
*
* @return javax.swing.JScrollPane
*/
|
This method initializes jScrollPane
|
getJScrollPane
|
{
"repo_name": "iCarto/siga",
"path": "appgvSIG/src/com/iver/cit/gvsig/project/documents/view/info/gui/InfoToolViewer.java",
"license": "gpl-3.0",
"size": 9233
}
|
[
"java.awt.Dimension"
] |
import java.awt.Dimension;
|
import java.awt.*;
|
[
"java.awt"
] |
java.awt;
| 1,315,476
|
public void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException
{
this.proxy.mouseClicked(mouseX, mouseY, mouseButton);
super.mouseClicked(mouseX, mouseY, mouseButton);
}
|
void function(int mouseX, int mouseY, int mouseButton) throws IOException { this.proxy.mouseClicked(mouseX, mouseY, mouseButton); super.mouseClicked(mouseX, mouseY, mouseButton); }
|
/**
* Called when the mouse is clicked. Args : mouseX, mouseY, clickedButton
*/
|
Called when the mouse is clicked. Args : mouseX, mouseY, clickedButton
|
mouseClicked
|
{
"repo_name": "danielyc/test-1.9.4",
"path": "build/tmp/recompileMc/sources/net/minecraft/client/gui/GuiScreenRealmsProxy.java",
"license": "gpl-3.0",
"size": 7475
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,616,909
|
private static final void processCellCartesianProduct(final CnfGrammar grammar, final Chart chart, final int start,
final int end, final ChartCell cell, final Scorer scorer) {
// Apply binary rules.
for (int mid = start + 1; mid <= end - 1; mid++) {
ChartCell leftCell = chart.getCell(start, mid);
ChartCell rightCell = chart.getCell(mid, end);
// Loop through all possible pairs of left/right non-terminals.
for (final int leftChildNt : leftCell.getNts()) {
double leftScoreForNt = leftCell.getScore(leftChildNt);
for (final int rightChildNt : rightCell.getNts()) {
double rightScoreForNt = rightCell.getScore(rightChildNt);
// Lookup the rules with those left/right children.
for (final Rule r : grammar.getBinaryRulesWithChildren(leftChildNt, rightChildNt)) {
double score = scorer.score(r, start, mid, end)
+ leftScoreForNt
+ rightScoreForNt;
cell.updateCell(r.getParent(), score, mid, r);
}
}
}
}
}
|
static final void function(final CnfGrammar grammar, final Chart chart, final int start, final int end, final ChartCell cell, final Scorer scorer) { for (int mid = start + 1; mid <= end - 1; mid++) { ChartCell leftCell = chart.getCell(start, mid); ChartCell rightCell = chart.getCell(mid, end); for (final int leftChildNt : leftCell.getNts()) { double leftScoreForNt = leftCell.getScore(leftChildNt); for (final int rightChildNt : rightCell.getNts()) { double rightScoreForNt = rightCell.getScore(rightChildNt); for (final Rule r : grammar.getBinaryRulesWithChildren(leftChildNt, rightChildNt)) { double score = scorer.score(r, start, mid, end) + leftScoreForNt + rightScoreForNt; cell.updateCell(r.getParent(), score, mid, r); } } } } }
|
/**
* Process a cell (binary rules only) using the Cartesian product of the children's rules.
*
* This follows the description in (Dunlop et al., 2010).
*/
|
Process a cell (binary rules only) using the Cartesian product of the children's rules. This follows the description in (Dunlop et al., 2010)
|
processCellCartesianProduct
|
{
"repo_name": "mgormley/pacaya",
"path": "src/main/java/edu/jhu/pacaya/parse/cky/CkyPcfgParser.java",
"license": "apache-2.0",
"size": 10670
}
|
[
"edu.jhu.pacaya.parse.cky.chart.Chart",
"edu.jhu.pacaya.parse.cky.chart.ChartCell"
] |
import edu.jhu.pacaya.parse.cky.chart.Chart; import edu.jhu.pacaya.parse.cky.chart.ChartCell;
|
import edu.jhu.pacaya.parse.cky.chart.*;
|
[
"edu.jhu.pacaya"
] |
edu.jhu.pacaya;
| 641,305
|
public static String timeToString(Timestamp ts, String format)
{
if(format == null || format.length() == 0)
format = "yyyyMMdd";
// Se a data for nula retorna a qtd de zeros respectivos
// a quantidade de digitos do formato.
if(ts == null)
return lPad("", '0', format.length());
SimpleDateFormat f = new SimpleDateFormat(format);
return f.format(ts);
} // timeToString
|
static String function(Timestamp ts, String format) { if(format == null format.length() == 0) format = STR; if(ts == null) return lPad("", '0', format.length()); SimpleDateFormat f = new SimpleDateFormat(format); return f.format(ts); }
|
/**
* Retorna a data formatada de acordo com o formato
* <BR>Dia: dd, Mes: mm, Ano: yyyy
*
* @param Timestamp Data
* @param String Formato da data
* @return String Data Formatada
* */
|
Retorna a data formatada de acordo com o formato Dia: dd, Mes: mm, Ano: yyyy
|
timeToString
|
{
"repo_name": "arthurmelo88/palmetalADP",
"path": "adempierelbr/base/src/org/adempierelbr/util/TextUtil.java",
"license": "gpl-2.0",
"size": 24715
}
|
[
"java.sql.Timestamp",
"java.text.SimpleDateFormat"
] |
import java.sql.Timestamp; import java.text.SimpleDateFormat;
|
import java.sql.*; import java.text.*;
|
[
"java.sql",
"java.text"
] |
java.sql; java.text;
| 1,424,764
|
public static void recursivelyDeleteDir(File customProfileDir) {
FileHandler.delete(customProfileDir);
}
|
static void function(File customProfileDir) { FileHandler.delete(customProfileDir); }
|
/**
* Delete a directory and all subdirectories
*/
|
Delete a directory and all subdirectories
|
recursivelyDeleteDir
|
{
"repo_name": "virajs/selenium-1",
"path": "java/client/src/org/openqa/selenium/browserlaunchers/LauncherUtils.java",
"license": "apache-2.0",
"size": 14217
}
|
[
"java.io.File",
"org.openqa.selenium.io.FileHandler"
] |
import java.io.File; import org.openqa.selenium.io.FileHandler;
|
import java.io.*; import org.openqa.selenium.io.*;
|
[
"java.io",
"org.openqa.selenium"
] |
java.io; org.openqa.selenium;
| 271,538
|
return (Action[]) actions.toArray(new Action[actions.size()]);
}
|
return (Action[]) actions.toArray(new Action[actions.size()]); }
|
/**
* Returns the actions which are assigned tothis transition.
* @return An array of actions.
*/
|
Returns the actions which are assigned tothis transition
|
getActions
|
{
"repo_name": "apache/lenya",
"path": "src/java/org/apache/lenya/workflow/impl/TransitionImpl.java",
"license": "apache-2.0",
"size": 5493
}
|
[
"org.apache.lenya.workflow.Action"
] |
import org.apache.lenya.workflow.Action;
|
import org.apache.lenya.workflow.*;
|
[
"org.apache.lenya"
] |
org.apache.lenya;
| 545,162
|
public LogRegressionMultiClassTrainer withUpdatesStgy(UpdatesStrategy updatesStgy) {
this.updatesStgy = updatesStgy;
return this;
}
|
LogRegressionMultiClassTrainer function(UpdatesStrategy updatesStgy) { this.updatesStgy = updatesStgy; return this; }
|
/**
* Set up the regularization parameter.
*
* @param updatesStgy Update strategy.
* @return Trainer with new update strategy parameter value.
*/
|
Set up the regularization parameter
|
withUpdatesStgy
|
{
"repo_name": "alexzaitzev/ignite",
"path": "modules/ml/src/main/java/org/apache/ignite/ml/regressions/logistic/multiclass/LogRegressionMultiClassTrainer.java",
"license": "apache-2.0",
"size": 7563
}
|
[
"org.apache.ignite.ml.nn.UpdatesStrategy"
] |
import org.apache.ignite.ml.nn.UpdatesStrategy;
|
import org.apache.ignite.ml.nn.*;
|
[
"org.apache.ignite"
] |
org.apache.ignite;
| 1,324,278
|
private boolean sameFile(final FileStatus inputStat, final FileStatus outputStat) {
// Not matching length
if (inputStat.getLen() != outputStat.getLen()) return false;
// Mark files as equals, since user asked for no checksum verification
if (!verifyChecksum) return true;
// If checksums are not available, files are not the same.
FileChecksum inChecksum = getFileChecksum(inputFs, inputStat.getPath());
if (inChecksum == null) return false;
FileChecksum outChecksum = getFileChecksum(outputFs, outputStat.getPath());
if (outChecksum == null) return false;
return inChecksum.equals(outChecksum);
}
|
boolean function(final FileStatus inputStat, final FileStatus outputStat) { if (inputStat.getLen() != outputStat.getLen()) return false; if (!verifyChecksum) return true; FileChecksum inChecksum = getFileChecksum(inputFs, inputStat.getPath()); if (inChecksum == null) return false; FileChecksum outChecksum = getFileChecksum(outputFs, outputStat.getPath()); if (outChecksum == null) return false; return inChecksum.equals(outChecksum); }
|
/**
* Check if the two files are equal by looking at the file length,
* and at the checksum (if user has specified the verifyChecksum flag).
*/
|
Check if the two files are equal by looking at the file length, and at the checksum (if user has specified the verifyChecksum flag)
|
sameFile
|
{
"repo_name": "francisliu/hbase_namespace",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java",
"license": "apache-2.0",
"size": 27393
}
|
[
"org.apache.hadoop.fs.FileChecksum",
"org.apache.hadoop.fs.FileStatus"
] |
import org.apache.hadoop.fs.FileChecksum; import org.apache.hadoop.fs.FileStatus;
|
import org.apache.hadoop.fs.*;
|
[
"org.apache.hadoop"
] |
org.apache.hadoop;
| 97,306
|
public static SortedSet<Integer> findAvailableUdpPorts(int numRequested) {
return findAvailableUdpPorts(numRequested, PORT_RANGE_MIN, PORT_RANGE_MAX);
}
|
static SortedSet<Integer> function(int numRequested) { return findAvailableUdpPorts(numRequested, PORT_RANGE_MIN, PORT_RANGE_MAX); }
|
/**
* Find the requested number of available UDP ports, each randomly selected
* from the range [{@value #PORT_RANGE_MIN}, {@value #PORT_RANGE_MAX}].
*
* @param numRequested
* the number of available ports to find
*
* @return a sorted set of available UDP port numbers
*
* @throws IllegalStateException
* if the requested number of available ports could not be found
*/
|
Find the requested number of available UDP ports, each randomly selected from the range [#PORT_RANGE_MIN, #PORT_RANGE_MAX]
|
findAvailableUdpPorts
|
{
"repo_name": "Kixeye/kixmpp",
"path": "kixmpp-server/src/test/java/com/kixeye/kixmpp/server/utils/SocketUtils.java",
"license": "apache-2.0",
"size": 15961
}
|
[
"java.util.SortedSet"
] |
import java.util.SortedSet;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 675,981
|
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
HttpServletRequest httpRequest = (HttpServletRequest) request;
HttpSession session = httpRequest.getSession();
//System.out.println("Doing stuff...");
// if this request is excluded from the filter, then just process it
if (!isFilteredRequest(httpRequest)) {
chain.doFilter(request, response);
return;
}
synchronized (getSynchronizationObject(session)) {
// if another request is being processed, then wait
if (isRequestInProcess(session)) {
// Put this request in the queue and wait
enqueueRequest(httpRequest);
if (!waitForRelease(httpRequest)) {
// this request was replaced in the queue by another request,
// so it need not be processed
return;
}
}
// lock the session, so that no other requests are processed until this
// one finishes
setRequestInProgress(httpRequest);
}
// process this request, and then release the session lock regardless of
// any exceptions thrown farther down the chain.
try {
chain.doFilter(request, response);
}
finally {
releaseQueuedRequest(httpRequest);
}
}
|
void function(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest httpRequest = (HttpServletRequest) request; HttpSession session = httpRequest.getSession(); if (!isFilteredRequest(httpRequest)) { chain.doFilter(request, response); return; } synchronized (getSynchronizationObject(session)) { if (isRequestInProcess(session)) { enqueueRequest(httpRequest); if (!waitForRelease(httpRequest)) { return; } } setRequestInProgress(httpRequest); } try { chain.doFilter(request, response); } finally { releaseQueuedRequest(httpRequest); } }
|
/**
* Synchronize the request and then either process it or skip it, depending on
* what other requests current exist for this session. See the description of
* this class for more details.
*/
|
Synchronize the request and then either process it or skip it, depending on what other requests current exist for this session. See the description of this class for more details
|
doFilter
|
{
"repo_name": "idega/com.idega.core",
"path": "src/java/com/idega/servlet/filter/RequestControlFilter.java",
"license": "gpl-3.0",
"size": 11996
}
|
[
"java.io.IOException",
"javax.servlet.FilterChain",
"javax.servlet.ServletException",
"javax.servlet.ServletRequest",
"javax.servlet.ServletResponse",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpSession"
] |
import java.io.IOException; import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession;
|
import java.io.*; import javax.servlet.*; import javax.servlet.http.*;
|
[
"java.io",
"javax.servlet"
] |
java.io; javax.servlet;
| 24,670
|
public String getLocalizedTextFromDatabase(String localeString,
long objectKey, LocalizedObjectTypes objectType);
|
String function(String localeString, long objectKey, LocalizedObjectTypes objectType);
|
/**
* Returns the localized resource from the database.
*
* @param localeString
* The locale to be used.
* @param objectKey
* The object key for the requested information.
* @param objectType
* The type of the resource.
* @return - the localized value if present, or an empty string otherwise.
*/
|
Returns the localized resource from the database
|
getLocalizedTextFromDatabase
|
{
"repo_name": "opetrovski/development",
"path": "oscm-i18n-intsvc/javasrc/org/oscm/i18nservice/local/LocalizerServiceLocal.java",
"license": "apache-2.0",
"size": 10550
}
|
[
"org.oscm.domobjects.enums.LocalizedObjectTypes"
] |
import org.oscm.domobjects.enums.LocalizedObjectTypes;
|
import org.oscm.domobjects.enums.*;
|
[
"org.oscm.domobjects"
] |
org.oscm.domobjects;
| 1,645,685
|
private static JsonArray retrieveDeploymentLabelsFromArchive(String pathToArchive, boolean dependentAPIFromProduct)
throws APIManagementException {
try {
//If the artifact is a dependent API from a API Product, instead of the artifact's deployment environments,
//products deployment environments are used.
String jsonContent = (dependentAPIFromProduct) ?
getFileContentAsJson(new File(pathToArchive).getParentFile().getParent()
+ File.separator + ImportExportConstants.DEPLOYMENT_INFO_LOCATION) :
getFileContentAsJson(pathToArchive + ImportExportConstants.DEPLOYMENT_INFO_LOCATION);
if (jsonContent == null) {
return null;
}
return new Gson().fromJson(jsonContent, JsonArray.class);
} catch (IOException e) {
throw new APIManagementException("Error while reading deployment environments info from path: "
+ pathToArchive, e, ExceptionCodes.ERROR_READING_META_DATA);
}
}
|
static JsonArray function(String pathToArchive, boolean dependentAPIFromProduct) throws APIManagementException { try { String jsonContent = (dependentAPIFromProduct) ? getFileContentAsJson(new File(pathToArchive).getParentFile().getParent() + File.separator + ImportExportConstants.DEPLOYMENT_INFO_LOCATION) : getFileContentAsJson(pathToArchive + ImportExportConstants.DEPLOYMENT_INFO_LOCATION); if (jsonContent == null) { return null; } return new Gson().fromJson(jsonContent, JsonArray.class); } catch (IOException e) { throw new APIManagementException(STR + pathToArchive, e, ExceptionCodes.ERROR_READING_META_DATA); } }
|
/**
* Retrieve the deployment information from the file
*
* @param pathToArchive Path to API/API Product archive
* @return a JsonArray of the deployed gateway environments
* @throws APIManagementException If an error occurs while reading the file
*/
|
Retrieve the deployment information from the file
|
retrieveDeploymentLabelsFromArchive
|
{
"repo_name": "chamindias/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/common/mappings/ImportUtils.java",
"license": "apache-2.0",
"size": 122878
}
|
[
"com.google.gson.Gson",
"com.google.gson.JsonArray",
"java.io.File",
"java.io.IOException",
"org.wso2.carbon.apimgt.api.APIManagementException",
"org.wso2.carbon.apimgt.api.ExceptionCodes",
"org.wso2.carbon.apimgt.impl.importexport.ImportExportConstants"
] |
import com.google.gson.Gson; import com.google.gson.JsonArray; import java.io.File; import java.io.IOException; import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.api.ExceptionCodes; import org.wso2.carbon.apimgt.impl.importexport.ImportExportConstants;
|
import com.google.gson.*; import java.io.*; import org.wso2.carbon.apimgt.api.*; import org.wso2.carbon.apimgt.impl.importexport.*;
|
[
"com.google.gson",
"java.io",
"org.wso2.carbon"
] |
com.google.gson; java.io; org.wso2.carbon;
| 2,684,268
|
public static IAST QuantityMagnitude(final IExpr quantity, final IExpr unit) {
return new AST2(QuantityMagnitude, quantity, unit);
}
|
static IAST function(final IExpr quantity, final IExpr unit) { return new AST2(QuantityMagnitude, quantity, unit); }
|
/**
* Returns the value of the <code>quantity</code> for the given <code>unit</code>
*
* <p>
* See: <a href=
* "https://raw.githubusercontent.com/axkr/symja_android_library/master/symja_android_library/doc/functions/QuantityMagnitude.md">QuantityMagnitude</a>
*
* @param quantity
* @param unit
* @return
*/
|
Returns the value of the <code>quantity</code> for the given <code>unit</code> See: QuantityMagnitude
|
QuantityMagnitude
|
{
"repo_name": "axkr/symja_android_library",
"path": "symja_android_library/matheclipse-core/src/main/java/org/matheclipse/core/expression/F.java",
"license": "gpl-3.0",
"size": 283472
}
|
[
"org.matheclipse.core.interfaces.IExpr"
] |
import org.matheclipse.core.interfaces.IExpr;
|
import org.matheclipse.core.interfaces.*;
|
[
"org.matheclipse.core"
] |
org.matheclipse.core;
| 140,891
|
Date getEndDate();
|
Date getEndDate();
|
/**
* Return the value associated with the column: endDate.
* @return A Date object (this.endDate)
*/
|
Return the value associated with the column: endDate
|
getEndDate
|
{
"repo_name": "rpgm/mi15",
"path": "rpgm/modules/repository/src/main/java/org/yarlithub/yschool/repository/model/obj/yschool/iface/IStaffHasRole.java",
"license": "apache-2.0",
"size": 5383
}
|
[
"java.util.Date"
] |
import java.util.Date;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,332,760
|
private Map collectUsage() {
Map<ClassDoc,Map<PackageDoc,Map<UsageType,Set<Doc>>>> _usedClassToPackagesMap =
new HashMap<ClassDoc,Map<PackageDoc,Map<UsageType,Set<Doc>>>>();
ClassDoc[] classes = rootDoc.classes();
for (int i = 0, ilim = classes.length; i < ilim; ++ i) {
ClassDoc clazz = classes[i];
if (clazz.isInterface()) {
// classes implementing
InterfaceRelation relation
= (InterfaceRelation)getInterfaceRelations().get(clazz);
Iterator<ClassDoc> it = relation.implementingClasses.iterator();
while (it.hasNext()) {
ClassDoc implementor = it.next();
addUsedBy(_usedClassToPackagesMap,
clazz, UsageType.CLASS_IMPLEMENTING, implementor, implementor.containingPackage());
}
}
else {
// classes derived from
for (ClassDoc superclass = clazz.superclass(); superclass != null;
superclass = superclass.superclass()) {
addUsedBy(_usedClassToPackagesMap,
superclass, UsageType.CLASS_DERIVED_FROM, clazz, clazz.containingPackage());
}
}
FieldDoc[] fields = clazz.fields();
for (int j = 0, jlim = fields.length; j < jlim; ++ j) {
FieldDoc field = fields[j];
// fields of type
ClassDoc fieldType = field.type().asClassDoc();
if (null != fieldType) {
addUsedBy(_usedClassToPackagesMap,
fieldType, UsageType.FIELD_OF_TYPE,
field, clazz.containingPackage());
}
}
MethodDoc[] methods = clazz.methods();
for (int j = 0, jlim = methods.length; j < jlim; ++ j) {
MethodDoc method = methods[j];
// methods with return type
ClassDoc returnType = method.returnType().asClassDoc();
if (null != returnType) {
addUsedBy(_usedClassToPackagesMap,
returnType, UsageType.METHOD_WITH_RETURN_TYPE,
method, clazz.containingPackage());
}
Parameter[] parameters = method.parameters();
for (int k=0; k<parameters.length; ++k) {
// methods with parameter type
Parameter parameter = parameters[k];
ClassDoc parameterType = parameter.type().asClassDoc();
if (null != parameterType) {
addUsedBy(_usedClassToPackagesMap,
parameterType, UsageType.METHOD_WITH_PARAMETER_TYPE,
method, clazz.containingPackage());
}
}
// methods which throw
ClassDoc[] thrownExceptions = method.thrownExceptions();
for (int k = 0, klim = thrownExceptions.length; k < klim; ++ k) {
ClassDoc thrownException = thrownExceptions[k];
addUsedBy(_usedClassToPackagesMap,
thrownException, UsageType.METHOD_WITH_THROWN_TYPE,
method, clazz.containingPackage());
}
}
ConstructorDoc[] constructors = clazz.constructors();
for (int j = 0, jlim = constructors.length; j < jlim; ++ j) {
ConstructorDoc constructor = constructors[j];
Parameter[] parameters = constructor.parameters();
for (int k = 0, klim = parameters.length; k < klim; ++ k) {
// constructors with parameter type
Parameter parameter = parameters[k];
ClassDoc parameterType = parameter.type().asClassDoc();
if (null != parameterType) {
addUsedBy(_usedClassToPackagesMap,
parameterType, UsageType.CONSTRUCTOR_WITH_PARAMETER_TYPE,
constructor, clazz.containingPackage());
}
}
// constructors which throw
ClassDoc[] thrownExceptions = constructor.thrownExceptions();
for (int k = 0, klim = thrownExceptions.length; k < klim; ++ k) {
ClassDoc thrownException = thrownExceptions[k];
addUsedBy(_usedClassToPackagesMap,
thrownException, UsageType.CONSTRUCTOR_WITH_THROWN_TYPE,
constructor, clazz.containingPackage());
}
}
}
return _usedClassToPackagesMap;
}
private Map<ClassDoc,Map<PackageDoc,Map<UsageType,Set<Doc>>>> usedClassToPackagesMap = null;
|
Map function() { Map<ClassDoc,Map<PackageDoc,Map<UsageType,Set<Doc>>>> _usedClassToPackagesMap = new HashMap<ClassDoc,Map<PackageDoc,Map<UsageType,Set<Doc>>>>(); ClassDoc[] classes = rootDoc.classes(); for (int i = 0, ilim = classes.length; i < ilim; ++ i) { ClassDoc clazz = classes[i]; if (clazz.isInterface()) { InterfaceRelation relation = (InterfaceRelation)getInterfaceRelations().get(clazz); Iterator<ClassDoc> it = relation.implementingClasses.iterator(); while (it.hasNext()) { ClassDoc implementor = it.next(); addUsedBy(_usedClassToPackagesMap, clazz, UsageType.CLASS_IMPLEMENTING, implementor, implementor.containingPackage()); } } else { for (ClassDoc superclass = clazz.superclass(); superclass != null; superclass = superclass.superclass()) { addUsedBy(_usedClassToPackagesMap, superclass, UsageType.CLASS_DERIVED_FROM, clazz, clazz.containingPackage()); } } FieldDoc[] fields = clazz.fields(); for (int j = 0, jlim = fields.length; j < jlim; ++ j) { FieldDoc field = fields[j]; ClassDoc fieldType = field.type().asClassDoc(); if (null != fieldType) { addUsedBy(_usedClassToPackagesMap, fieldType, UsageType.FIELD_OF_TYPE, field, clazz.containingPackage()); } } MethodDoc[] methods = clazz.methods(); for (int j = 0, jlim = methods.length; j < jlim; ++ j) { MethodDoc method = methods[j]; ClassDoc returnType = method.returnType().asClassDoc(); if (null != returnType) { addUsedBy(_usedClassToPackagesMap, returnType, UsageType.METHOD_WITH_RETURN_TYPE, method, clazz.containingPackage()); } Parameter[] parameters = method.parameters(); for (int k=0; k<parameters.length; ++k) { Parameter parameter = parameters[k]; ClassDoc parameterType = parameter.type().asClassDoc(); if (null != parameterType) { addUsedBy(_usedClassToPackagesMap, parameterType, UsageType.METHOD_WITH_PARAMETER_TYPE, method, clazz.containingPackage()); } } ClassDoc[] thrownExceptions = method.thrownExceptions(); for (int k = 0, klim = thrownExceptions.length; k < klim; ++ k) { ClassDoc thrownException = thrownExceptions[k]; addUsedBy(_usedClassToPackagesMap, thrownException, UsageType.METHOD_WITH_THROWN_TYPE, method, clazz.containingPackage()); } } ConstructorDoc[] constructors = clazz.constructors(); for (int j = 0, jlim = constructors.length; j < jlim; ++ j) { ConstructorDoc constructor = constructors[j]; Parameter[] parameters = constructor.parameters(); for (int k = 0, klim = parameters.length; k < klim; ++ k) { Parameter parameter = parameters[k]; ClassDoc parameterType = parameter.type().asClassDoc(); if (null != parameterType) { addUsedBy(_usedClassToPackagesMap, parameterType, UsageType.CONSTRUCTOR_WITH_PARAMETER_TYPE, constructor, clazz.containingPackage()); } } ClassDoc[] thrownExceptions = constructor.thrownExceptions(); for (int k = 0, klim = thrownExceptions.length; k < klim; ++ k) { ClassDoc thrownException = thrownExceptions[k]; addUsedBy(_usedClassToPackagesMap, thrownException, UsageType.CONSTRUCTOR_WITH_THROWN_TYPE, constructor, clazz.containingPackage()); } } } return _usedClassToPackagesMap; } private Map<ClassDoc,Map<PackageDoc,Map<UsageType,Set<Doc>>>> usedClassToPackagesMap = null;
|
/**
* Create the cross reference database.
*/
|
Create the cross reference database
|
collectUsage
|
{
"repo_name": "cfriedt/classpath",
"path": "tools/gnu/classpath/tools/doclets/AbstractDoclet.java",
"license": "gpl-2.0",
"size": 42203
}
|
[
"com.sun.javadoc.ClassDoc",
"com.sun.javadoc.ConstructorDoc",
"com.sun.javadoc.Doc",
"com.sun.javadoc.FieldDoc",
"com.sun.javadoc.MethodDoc",
"com.sun.javadoc.PackageDoc",
"com.sun.javadoc.Parameter",
"java.util.HashMap",
"java.util.Iterator",
"java.util.Map",
"java.util.Set"
] |
import com.sun.javadoc.ClassDoc; import com.sun.javadoc.ConstructorDoc; import com.sun.javadoc.Doc; import com.sun.javadoc.FieldDoc; import com.sun.javadoc.MethodDoc; import com.sun.javadoc.PackageDoc; import com.sun.javadoc.Parameter; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Set;
|
import com.sun.javadoc.*; import java.util.*;
|
[
"com.sun.javadoc",
"java.util"
] |
com.sun.javadoc; java.util;
| 376,638
|
public static PaginatedResult<Artist> getRecommendedArtists(int page, Session session) {
Result result = Caller.getInstance().call("user.getRecommendedArtists", session, "page", String.valueOf(page));
if (!result.isSuccessful())
return new PaginatedResult<Artist>(0, 0, Collections.<Artist>emptyList());
DomElement element = result.getContentElement();
Collection<DomElement> children = element.getChildren("artist");
List<Artist> artists = new ArrayList<Artist>(children.size());
for (DomElement domElement : children) {
artists.add(Artist.artistFromElement(domElement));
}
page = Integer.parseInt(element.getAttribute("page"));
int total = Integer.parseInt(element.getAttribute("totalPages"));
return new PaginatedResult<Artist>(page, total, artists);
}
|
static PaginatedResult<Artist> function(int page, Session session) { Result result = Caller.getInstance().call(STR, session, "page", String.valueOf(page)); if (!result.isSuccessful()) return new PaginatedResult<Artist>(0, 0, Collections.<Artist>emptyList()); DomElement element = result.getContentElement(); Collection<DomElement> children = element.getChildren(STR); List<Artist> artists = new ArrayList<Artist>(children.size()); for (DomElement domElement : children) { artists.add(Artist.artistFromElement(domElement)); } page = Integer.parseInt(element.getAttribute("page")); int total = Integer.parseInt(element.getAttribute(STR)); return new PaginatedResult<Artist>(page, total, artists); }
|
/**
* Get Last.fm artist recommendations for a user.
*
* @param page The page to fetch
* @param session A Session instance
* @return a list of {@link Artist}s
*/
|
Get Last.fm artist recommendations for a user
|
getRecommendedArtists
|
{
"repo_name": "iolsen/harmonium",
"path": "net/roarsoftware/lastfm/User.java",
"license": "agpl-3.0",
"size": 17302
}
|
[
"java.util.ArrayList",
"java.util.Collection",
"java.util.Collections",
"java.util.List",
"net.roarsoftware.xml.DomElement"
] |
import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import net.roarsoftware.xml.DomElement;
|
import java.util.*; import net.roarsoftware.xml.*;
|
[
"java.util",
"net.roarsoftware.xml"
] |
java.util; net.roarsoftware.xml;
| 871,484
|
public RouteDefinition errorHandler(ErrorHandlerFactory errorHandlerBuilder) {
setErrorHandlerBuilder(errorHandlerBuilder);
// we are now using a route scoped error handler
contextScopedErrorHandler = false;
return this;
}
|
RouteDefinition function(ErrorHandlerFactory errorHandlerBuilder) { setErrorHandlerBuilder(errorHandlerBuilder); contextScopedErrorHandler = false; return this; }
|
/**
* Installs the given <a href="http://camel.apache.org/error-handler.html">error handler</a> builder.
*
* @param errorHandlerBuilder the error handler to be used by default for all child routes
* @return the current builder with the error handler configured
*/
|
Installs the given error handler builder
|
errorHandler
|
{
"repo_name": "jonmcewen/camel",
"path": "camel-core/src/main/java/org/apache/camel/model/RouteDefinition.java",
"license": "apache-2.0",
"size": 44503
}
|
[
"org.apache.camel.ErrorHandlerFactory"
] |
import org.apache.camel.ErrorHandlerFactory;
|
import org.apache.camel.*;
|
[
"org.apache.camel"
] |
org.apache.camel;
| 1,538,185
|
protected final void write(Element element)
throws IOException {
// treat empty elements differently to avoid an
// instanceof test
if (element.getChildCount() == 0) {
writeStartTag(element, false);
writeEndTag(element);
}
else {
Node current = element;
boolean end = false;
int index = -1;
int[] indexes = new int[10];
int top = 0;
indexes[0] = -1;
while (true) {
if (!end && current.getChildCount() > 0) {
writeStartTag((Element) current, false);
current = current.getChild(0);
index = 0;
top++;
indexes = grow(indexes, top);
indexes[top] = 0;
}
else {
if (end) {
writeEndTag((Element) current);
if (current == element) break;
}
else {
writeChild(current);
}
end = false;
ParentNode parent = current.getParent();
if (parent.getChildCount() - 1 == index) {
current = parent;
top--;
if (current != element) {
index = indexes[top];
}
end = true;
}
else {
index++;
indexes[top] = index;
current = parent.getChild(index);
}
}
}
}
}
|
final void function(Element element) throws IOException { if (element.getChildCount() == 0) { writeStartTag(element, false); writeEndTag(element); } else { Node current = element; boolean end = false; int index = -1; int[] indexes = new int[10]; int top = 0; indexes[0] = -1; while (true) { if (!end && current.getChildCount() > 0) { writeStartTag((Element) current, false); current = current.getChild(0); index = 0; top++; indexes = grow(indexes, top); indexes[top] = 0; } else { if (end) { writeEndTag((Element) current); if (current == element) break; } else { writeChild(current); } end = false; ParentNode parent = current.getParent(); if (parent.getChildCount() - 1 == index) { current = parent; top--; if (current != element) { index = indexes[top]; } end = true; } else { index++; indexes[top] = index; current = parent.getChild(index); } } } } }
|
/**
* <p>
* Serializes an element onto the output stream using the canonical
* XML algorithm. The result is guaranteed to be well-formed.
* If <code>element</code> does not have a parent element, it will
* also be namespace well-formed.
* </p>
*
* @param element the <code>Element</code> to serialize
*
* @throws IOException if the underlying <code>OutputStream</code>
* encounters an I/O error
*/
|
Serializes an element onto the output stream using the canonical XML algorithm. The result is guaranteed to be well-formed. If <code>element</code> does not have a parent element, it will also be namespace well-formed.
|
write
|
{
"repo_name": "mmohan01/ReFactory",
"path": "data/xom/xom-1.2b2/nu/xom/canonical/Canonicalizer.java",
"license": "mit",
"size": 38844
}
|
[
"java.io.IOException",
"nu.xom.Element",
"nu.xom.Node",
"nu.xom.ParentNode"
] |
import java.io.IOException; import nu.xom.Element; import nu.xom.Node; import nu.xom.ParentNode;
|
import java.io.*; import nu.xom.*;
|
[
"java.io",
"nu.xom"
] |
java.io; nu.xom;
| 1,473,601
|
public void mergeOptionsFromJs(JSONObject jsOptions) throws JSONException {
if (jsOptions.has(XmlTags.CONFIG_FILE_TAG)) {
String configUrl = jsOptions.getString(XmlTags.CONFIG_FILE_TAG);
if (!TextUtils.isEmpty(configUrl)) {
setConfigUrl(configUrl);
}
}
if (jsOptions.has(XmlTags.AUTO_INSTALLATION_TAG)) {
allowUpdatesAutoInstall(jsOptions.getBoolean(XmlTags.AUTO_INSTALLATION_TAG));
}
if (jsOptions.has(XmlTags.AUTO_DOWNLOAD_TAG)) {
allowUpdatesAutoDownload(jsOptions.getBoolean(XmlTags.AUTO_DOWNLOAD_TAG));
}
}
|
void function(JSONObject jsOptions) throws JSONException { if (jsOptions.has(XmlTags.CONFIG_FILE_TAG)) { String configUrl = jsOptions.getString(XmlTags.CONFIG_FILE_TAG); if (!TextUtils.isEmpty(configUrl)) { setConfigUrl(configUrl); } } if (jsOptions.has(XmlTags.AUTO_INSTALLATION_TAG)) { allowUpdatesAutoInstall(jsOptions.getBoolean(XmlTags.AUTO_INSTALLATION_TAG)); } if (jsOptions.has(XmlTags.AUTO_DOWNLOAD_TAG)) { allowUpdatesAutoDownload(jsOptions.getBoolean(XmlTags.AUTO_DOWNLOAD_TAG)); } }
|
/**
* Apply and save options that has been send from web page.
* Using this we can change plugin config from JavaScript.
*
* @param jsOptions options from web
* @throws JSONException
*/
|
Apply and save options that has been send from web page. Using this we can change plugin config from JavaScript
|
mergeOptionsFromJs
|
{
"repo_name": "mnewmedia/cordova-hot-code-push",
"path": "src/android/src/com/nordnetab/chcp/main/config/ChcpXmlConfig.java",
"license": "mit",
"size": 4169
}
|
[
"android.text.TextUtils",
"org.json.JSONException",
"org.json.JSONObject"
] |
import android.text.TextUtils; import org.json.JSONException; import org.json.JSONObject;
|
import android.text.*; import org.json.*;
|
[
"android.text",
"org.json"
] |
android.text; org.json;
| 741,737
|
private static String xaState(int xaState)
{
switch (xaState) {
case Status.STATUS_ACTIVE:
return "ACTIVE";
case Status.STATUS_MARKED_ROLLBACK:
return "MARKED-ROLLBACK";
case Status.STATUS_PREPARED:
return "PREPARED";
case Status.STATUS_COMMITTED:
return "COMITTED";
case Status.STATUS_ROLLEDBACK:
return "ROLLEDBACK";
case Status.STATUS_PREPARING:
return "PREPARING";
case Status.STATUS_COMMITTING:
return "COMMITTING";
case Status.STATUS_ROLLING_BACK:
return "ROLLING_BACK";
case Status.STATUS_NO_TRANSACTION:
return "NO_TRANSACTION";
default:
return "XA-STATE(" + xaState + ")";
}
}
|
static String function(int xaState) { switch (xaState) { case Status.STATUS_ACTIVE: return STR; case Status.STATUS_MARKED_ROLLBACK: return STR; case Status.STATUS_PREPARED: return STR; case Status.STATUS_COMMITTED: return STR; case Status.STATUS_ROLLEDBACK: return STR; case Status.STATUS_PREPARING: return STR; case Status.STATUS_COMMITTING: return STR; case Status.STATUS_ROLLING_BACK: return STR; case Status.STATUS_NO_TRANSACTION: return STR; default: return STR + xaState + ")"; } }
|
/**
* Converts XA state code to string.
*/
|
Converts XA state code to string
|
xaState
|
{
"repo_name": "christianchristensen/resin",
"path": "modules/resin/src/com/caucho/transaction/TransactionImpl.java",
"license": "gpl-2.0",
"size": 39106
}
|
[
"javax.transaction.Status"
] |
import javax.transaction.Status;
|
import javax.transaction.*;
|
[
"javax.transaction"
] |
javax.transaction;
| 1,743,813
|
private Map<String, List<Object>> parseWhereValuesByExample(final Class<?> type, final Object... beans)
{
final Map<String, List<Object>> result = new Hashtable<String, List<Object>>();
final StorableInfo sinfo = EntityUtils.info(type);
for (final Object bean : beans)
{
for (final ElementInfo einfo : sinfo.nonVirtualElements())
{
final String name = einfo.firstAliasForTarget(DEFAULT_TARGET_NAME);
final Object value = EntityUtils.value(bean, einfo.name());
if (value != null)
{
if (result.containsKey(name))
result.get(name).add(value);
else
{
List<Object> colValues = new ArrayList<Object>();
colValues.add(value);
result.put(name, colValues);
}
}
}
}
return result;
}
// private String parseTableName(final StorableInfo sinfo)
// {
// assert (sinfo != null);
//
// String schema = sinfo.schema();
// String name = sinfo.firstAliasForTarget(DEFAULT_TARGET_NAME);
//
// if (name == null)
// name = sinfo.name();
//
// return schema == null ? name.toLowerCase() : schema.toLowerCase() + "." + name.toLowerCase();
// }
/**
* Parses the column name for the given {@link ElementInfo}.
* <p>
* It will try for the target alias first and if not present it will use the element name as the
* column name.
*
* @param einfo
* the {@link ElementInfo}
|
Map<String, List<Object>> function(final Class<?> type, final Object... beans) { final Map<String, List<Object>> result = new Hashtable<String, List<Object>>(); final StorableInfo sinfo = EntityUtils.info(type); for (final Object bean : beans) { for (final ElementInfo einfo : sinfo.nonVirtualElements()) { final String name = einfo.firstAliasForTarget(DEFAULT_TARGET_NAME); final Object value = EntityUtils.value(bean, einfo.name()); if (value != null) { if (result.containsKey(name)) result.get(name).add(value); else { List<Object> colValues = new ArrayList<Object>(); colValues.add(value); result.put(name, colValues); } } } } return result; } /** * Parses the column name for the given {@link ElementInfo}. * <p> * It will try for the target alias first and if not present it will use the element name as the * column name. * * @param einfo * the {@link ElementInfo}
|
/**
* Parses the values for the where clause.
*
* @param type
* the bean type
* @param beans
* sample beans to use as example
*
* @return the where values
*/
|
Parses the values for the where clause
|
parseWhereValuesByExample
|
{
"repo_name": "perbone/udao",
"path": "udao-provider-jdbc/src/main/java/io/perbone/udao/provider/jdbc/JdbcDataSourceImpl.java",
"license": "apache-2.0",
"size": 106396
}
|
[
"io.perbone.udao.util.ElementInfo",
"io.perbone.udao.util.EntityUtils",
"io.perbone.udao.util.StorableInfo",
"java.util.ArrayList",
"java.util.Hashtable",
"java.util.List",
"java.util.Map"
] |
import io.perbone.udao.util.ElementInfo; import io.perbone.udao.util.EntityUtils; import io.perbone.udao.util.StorableInfo; import java.util.ArrayList; import java.util.Hashtable; import java.util.List; import java.util.Map;
|
import io.perbone.udao.util.*; import java.util.*;
|
[
"io.perbone.udao",
"java.util"
] |
io.perbone.udao; java.util;
| 2,690,831
|
EOperation getPowerSystemResource__IsApplicable_solveCsp_FWD__IsApplicableMatch_PowerSystemResource_Location_MeterAsset_Location_LocationToLocation_MeterAssetMMXUPair();
|
EOperation getPowerSystemResource__IsApplicable_solveCsp_FWD__IsApplicableMatch_PowerSystemResource_Location_MeterAsset_Location_LocationToLocation_MeterAssetMMXUPair();
|
/**
* Returns the meta object for the '{@link rgse.ttc17.emoflon.tgg.task2.Rules.PowerSystemResource#isApplicable_solveCsp_FWD(org.moflon.tgg.runtime.IsApplicableMatch, gluemodel.CIM.IEC61970.Core.PowerSystemResource, outagePreventionJointarget.Location, gluemodel.CIM.IEC61968.Metering.MeterAsset, gluemodel.CIM.IEC61968.Common.Location, rgse.ttc17.emoflon.tgg.task2.LocationToLocation, gluemodel.MeterAssetMMXUPair) <em>Is Applicable solve Csp FWD</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the '<em>Is Applicable solve Csp FWD</em>' operation.
* @see rgse.ttc17.emoflon.tgg.task2.Rules.PowerSystemResource#isApplicable_solveCsp_FWD(org.moflon.tgg.runtime.IsApplicableMatch, gluemodel.CIM.IEC61970.Core.PowerSystemResource, outagePreventionJointarget.Location, gluemodel.CIM.IEC61968.Metering.MeterAsset, gluemodel.CIM.IEC61968.Common.Location, rgse.ttc17.emoflon.tgg.task2.LocationToLocation, gluemodel.MeterAssetMMXUPair)
* @generated
*/
|
Returns the meta object for the '<code>rgse.ttc17.emoflon.tgg.task2.Rules.PowerSystemResource#isApplicable_solveCsp_FWD(org.moflon.tgg.runtime.IsApplicableMatch, gluemodel.CIM.IEC61970.Core.PowerSystemResource, outagePreventionJointarget.Location, gluemodel.CIM.IEC61968.Metering.MeterAsset, gluemodel.CIM.IEC61968.Common.Location, rgse.ttc17.emoflon.tgg.task2.LocationToLocation, gluemodel.MeterAssetMMXUPair) Is Applicable solve Csp FWD</code>' operation.
|
getPowerSystemResource__IsApplicable_solveCsp_FWD__IsApplicableMatch_PowerSystemResource_Location_MeterAsset_Location_LocationToLocation_MeterAssetMMXUPair
|
{
"repo_name": "georghinkel/ttc2017smartGrids",
"path": "solutions/eMoflon/rgse.ttc17.emoflon.tgg.task2/gen/rgse/ttc17/emoflon/tgg/task2/Rules/RulesPackage.java",
"license": "mit",
"size": 437406
}
|
[
"org.eclipse.emf.ecore.EOperation"
] |
import org.eclipse.emf.ecore.EOperation;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 2,727,890
|
public static List<FieldDescriptor> getKeyFields(Map<String, List<FieldDescriptor>> classKeys,
String clsName) {
String className = TypeUtil.unqualifiedName(clsName);
return classKeys.get(className);
}
|
static List<FieldDescriptor> function(Map<String, List<FieldDescriptor>> classKeys, String clsName) { String className = TypeUtil.unqualifiedName(clsName); return classKeys.get(className); }
|
/**
* Return the key fields of a given class.
* @param classKeys map of classname to set of keys
* @param clsName the class name to look up
* @return the fields that are class keys for the class
*/
|
Return the key fields of a given class
|
getKeyFields
|
{
"repo_name": "drhee/toxoMine",
"path": "intermine/api/main/src/org/intermine/api/config/ClassKeyHelper.java",
"license": "lgpl-2.1",
"size": 9384
}
|
[
"java.util.List",
"java.util.Map",
"org.intermine.metadata.FieldDescriptor",
"org.intermine.util.TypeUtil"
] |
import java.util.List; import java.util.Map; import org.intermine.metadata.FieldDescriptor; import org.intermine.util.TypeUtil;
|
import java.util.*; import org.intermine.metadata.*; import org.intermine.util.*;
|
[
"java.util",
"org.intermine.metadata",
"org.intermine.util"
] |
java.util; org.intermine.metadata; org.intermine.util;
| 1,894,516
|
public static List<Worker> getAllWorkers() {
return getList("FROM Worker ORDER BY LASTNAME ASC", Worker.class, false);
}
|
static List<Worker> function() { return getList(STR, Worker.class, false); }
|
/**
* Get all of the workers
* @return a List of type Worker
*/
|
Get all of the workers
|
getAllWorkers
|
{
"repo_name": "rorrell/workermanagement",
"path": "src/workermanagement/model/WorkHelper.java",
"license": "bsd-3-clause",
"size": 16073
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,292,976
|
protected void executionComplete(ExecutionContextImpl executionContext, Throwable t) {
executionContext.onFullExecutionComplete(t);
}
|
void function(ExecutionContextImpl executionContext, Throwable t) { executionContext.onFullExecutionComplete(t); }
|
/**
* Run after execution is complete (including all fault tolerance processing)
* <p>
* Subclasses can override this if they require different end of execution behaviour
*
* @param executionContext the execution context
* @param t the exception thrown, or {@code null} if no exception was thrown
*/
|
Run after execution is complete (including all fault tolerance processing) Subclasses can override this if they require different end of execution behaviour
|
executionComplete
|
{
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.microprofile.faulttolerance.1.0/src/com/ibm/ws/microprofile/faulttolerance/executor/impl/sync/SynchronousExecutorImpl.java",
"license": "epl-1.0",
"size": 8882
}
|
[
"com.ibm.ws.microprofile.faulttolerance.executor.impl.ExecutionContextImpl"
] |
import com.ibm.ws.microprofile.faulttolerance.executor.impl.ExecutionContextImpl;
|
import com.ibm.ws.microprofile.faulttolerance.executor.impl.*;
|
[
"com.ibm.ws"
] |
com.ibm.ws;
| 2,095,800
|
public Set<Keyword> flatten() {
return Stream.concat(
Stream.of(this),
OptionalUtil.toStream(getChild()).flatMap(child -> child.flatten().stream()))
.collect(Collectors.toSet());
}
|
Set<Keyword> function() { return Stream.concat( Stream.of(this), OptionalUtil.toStream(getChild()).flatMap(child -> child.flatten().stream())) .collect(Collectors.toSet()); }
|
/**
* Returns all nodes in this chain as separate keywords.
* E.g, for "A > B > C" we get {"A", "B", "C"}.
*/
|
Returns all nodes in this chain as separate keywords. E.g, for "A > B > C" we get {"A", "B", "C"}
|
flatten
|
{
"repo_name": "sauliusg/jabref",
"path": "src/main/java/org/jabref/model/entry/Keyword.java",
"license": "mit",
"size": 4094
}
|
[
"java.util.Set",
"java.util.stream.Collectors",
"java.util.stream.Stream",
"org.jabref.model.util.OptionalUtil"
] |
import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; import org.jabref.model.util.OptionalUtil;
|
import java.util.*; import java.util.stream.*; import org.jabref.model.util.*;
|
[
"java.util",
"org.jabref.model"
] |
java.util; org.jabref.model;
| 947,847
|
@Override
public void saveRootMap(File f, HashMap<UUID, String> rootmap) throws FileNotFoundException{
RootMap.saveRootMap(f, rootmap,1,max);
}
|
void function(File f, HashMap<UUID, String> rootmap) throws FileNotFoundException{ RootMap.saveRootMap(f, rootmap,1,max); }
|
/**
* Exact Safe Command for RootMap
* @param f File of RootMap
* @param rootmap RootMap
* @throws FileNotFoundException
*/
|
Exact Safe Command for RootMap
|
saveRootMap
|
{
"repo_name": "Jack5496/TreeSpirit",
"path": "src/main/java/com/jack/treespirit/filemanager/FileManager.java",
"license": "gpl-3.0",
"size": 3605
}
|
[
"java.io.File",
"java.io.FileNotFoundException",
"java.util.HashMap"
] |
import java.io.File; import java.io.FileNotFoundException; import java.util.HashMap;
|
import java.io.*; import java.util.*;
|
[
"java.io",
"java.util"
] |
java.io; java.util;
| 2,347,450
|
EList<Relation> getRelationname();
|
EList<Relation> getRelationname();
|
/**
* Returns the value of the '<em><b>Relationname</b></em>' reference list.
* The list contents are of type {@link org.xtext.nv.dsl.mMDSL.Relation}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Relationname</em>' reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Relationname</em>' reference list.
* @see org.xtext.nv.dsl.mMDSL.MMDSLPackage#getModelType_Relationname()
* @model
* @generated
*/
|
Returns the value of the 'Relationname' reference list. The list contents are of type <code>org.xtext.nv.dsl.mMDSL.Relation</code>. If the meaning of the 'Relationname' reference list isn't clear, there really should be more of a description here...
|
getRelationname
|
{
"repo_name": "niksavis/mm-dsl",
"path": "org.xtext.nv.dsl/src-gen/org/xtext/nv/dsl/mMDSL/ModelType.java",
"license": "epl-1.0",
"size": 3386
}
|
[
"org.eclipse.emf.common.util.EList"
] |
import org.eclipse.emf.common.util.EList;
|
import org.eclipse.emf.common.util.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 2,536,061
|
private void readObject(ObjectInputStream stream) throws InvalidObjectException {
throw new InvalidObjectException("Proxy required.");
}
private static class SerializationProxy implements Serializable {
private static final long serialVersionUID = -6056026042294082359L;
// array lists are serializable
private final ArrayList<Serializable> serializableInstances;
public SerializationProxy(InstanceCache cache) {
serializableInstances = extractSerializableValues(cache);
}
|
void function(ObjectInputStream stream) throws InvalidObjectException { throw new InvalidObjectException(STR); } private static class SerializationProxy implements Serializable { private static final long serialVersionUID = -6056026042294082359L; private final ArrayList<Serializable> serializableInstances; public SerializationProxy(InstanceCache cache) { serializableInstances = extractSerializableValues(cache); }
|
/**
* Ensure that no instance of {@link InstanceCache} is created because it was present in the stream. A correct
* stream should only contain instances of the proxy.
*/
|
Ensure that no instance of <code>InstanceCache</code> is created because it was present in the stream. A correct stream should only contain instances of the proxy
|
readObject
|
{
"repo_name": "CodeFX-org/demo-serialization-proxy-pattern",
"path": "src/org/codefx/lab/serialization/proxypattern/InstanceCache.java",
"license": "unlicense",
"size": 5283
}
|
[
"java.io.InvalidObjectException",
"java.io.ObjectInputStream",
"java.io.Serializable",
"java.util.ArrayList"
] |
import java.io.InvalidObjectException; import java.io.ObjectInputStream; import java.io.Serializable; import java.util.ArrayList;
|
import java.io.*; import java.util.*;
|
[
"java.io",
"java.util"
] |
java.io; java.util;
| 1,209,540
|
public List<Cheese> getCopyOfCheeseList() {
if(cheesesInStock.isEmpty()) {
return Collections.emptyList();
}
else {
return new ArrayList<Cheese>(cheesesInStock);
}
}
|
List<Cheese> function() { if(cheesesInStock.isEmpty()) { return Collections.emptyList(); } else { return new ArrayList<Cheese>(cheesesInStock); } }
|
/**
* CORRECT WAY to return a copy of a collection
*
* - Collections.emptyList() returns an empty list
* there is also emptySet() and emptyMap()
* - new ArrayList(cheesesInStock) makes a copy
*/
|
CORRECT WAY to return a copy of a collection - Collections.emptyList() returns an empty list there is also emptySet() and emptyMap() - new ArrayList(cheesesInStock) makes a copy
|
getCopyOfCheeseList
|
{
"repo_name": "briandang714/effective-java",
"path": "src/main/java/methods/ReturnEmptyCollectionsNotNull/ExampleEmptyCollections.java",
"license": "apache-2.0",
"size": 2666
}
|
[
"java.util.ArrayList",
"java.util.Collections",
"java.util.List"
] |
import java.util.ArrayList; import java.util.Collections; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,096,667
|
@POST
@Path(ExportResourceApi.DESA_PATH)
@Produces({MediaType.APPLICATION_JSON})
public SmartGwtResponse<ExportResult> newDesaExport(
@FormParam(ExportResourceApi.DESA_PID_PARAM) List<String> pids,
@FormParam(ExportResourceApi.DESA_HIERARCHY_PARAM) @DefaultValue("false") boolean hierarchy,
@FormParam(ExportResourceApi.DESA_FORDOWNLOAD_PARAM) @DefaultValue("false") boolean forDownload,
@FormParam(ExportResourceApi.DESA_DRYRUN_PARAM) @DefaultValue("false") boolean dryRun
) throws IOException, ExportException {
if (pids.isEmpty()) {
throw RestException.plainText(Status.BAD_REQUEST, "Missing " + ExportResourceApi.DESA_PID_PARAM);
}
DesaExport export = new DesaExport(RemoteStorage.getInstance(appConfig),
appConfig.getDesaServices(), MetaModelRepository.getInstance(), appConfig.getExportOptions());
URI exportUri = user.getExportFolder();
File exportFolder = new File(exportUri);
List<ExportResult> result = new ArrayList<>(pids.size());
if (forDownload) {
Result r = export.exportDownload(exportFolder, pids.get(0));
result.add(r.getValidationError() != null
? new ExportResult(r.getValidationError().getExceptions())
: new ExportResult(r.getDownloadToken()));
} else {
if (dryRun) {
for (String pid : pids) {
List<MetsExportExceptionElement> errors = export.validate(exportFolder, pid, hierarchy);
result.add(new ExportResult(errors));
}
} else {
for (String pid : pids) {
Result r = export.export(exportFolder, pid, null, false, hierarchy, false, session.asFedoraLog(), user);
if (r.getValidationError() != null) {
result.add(new ExportResult(r.getValidationError().getExceptions()));
} else {
// XXX not used for now
result.add(new ExportResult((Integer) null, "done"));
}
}
}
}
return new SmartGwtResponse<>(result);
}
|
@Path(ExportResourceApi.DESA_PATH) @Produces({MediaType.APPLICATION_JSON}) SmartGwtResponse<ExportResult> function( @FormParam(ExportResourceApi.DESA_PID_PARAM) List<String> pids, @FormParam(ExportResourceApi.DESA_HIERARCHY_PARAM) @DefaultValue("false") boolean hierarchy, @FormParam(ExportResourceApi.DESA_FORDOWNLOAD_PARAM) @DefaultValue("false") boolean forDownload, @FormParam(ExportResourceApi.DESA_DRYRUN_PARAM) @DefaultValue("false") boolean dryRun ) throws IOException, ExportException { if (pids.isEmpty()) { throw RestException.plainText(Status.BAD_REQUEST, STR + ExportResourceApi.DESA_PID_PARAM); } DesaExport export = new DesaExport(RemoteStorage.getInstance(appConfig), appConfig.getDesaServices(), MetaModelRepository.getInstance(), appConfig.getExportOptions()); URI exportUri = user.getExportFolder(); File exportFolder = new File(exportUri); List<ExportResult> result = new ArrayList<>(pids.size()); if (forDownload) { Result r = export.exportDownload(exportFolder, pids.get(0)); result.add(r.getValidationError() != null ? new ExportResult(r.getValidationError().getExceptions()) : new ExportResult(r.getDownloadToken())); } else { if (dryRun) { for (String pid : pids) { List<MetsExportExceptionElement> errors = export.validate(exportFolder, pid, hierarchy); result.add(new ExportResult(errors)); } } else { for (String pid : pids) { Result r = export.export(exportFolder, pid, null, false, hierarchy, false, session.asFedoraLog(), user); if (r.getValidationError() != null) { result.add(new ExportResult(r.getValidationError().getExceptions())); } else { result.add(new ExportResult((Integer) null, "done")); } } } } return new SmartGwtResponse<>(result); }
|
/**
* Starts a new export to DESA repository.
*
* @param pids PIDs to export
* @param hierarchy export also children hierarchy of requested PIDs. Default is {@code false}.
* @param forDownload export to file system for later client download. If {@code true} dryRun is ignored.
* Default is {@code false}.
* @param dryRun use to build packages without sending to the repository. Default is {@code false}.
* @return the list of results for requested PIDs
* @throws IOException unexpected failure
* @throws ExportException unexpected failure
*/
|
Starts a new export to DESA repository
|
newDesaExport
|
{
"repo_name": "proarc/proarc",
"path": "proarc-webapp/src/main/java/cz/cas/lib/proarc/webapp/server/rest/ExportResource.java",
"license": "gpl-3.0",
"size": 40175
}
|
[
"cz.cas.lib.proarc.common.export.DesaExport",
"cz.cas.lib.proarc.common.export.ExportException",
"cz.cas.lib.proarc.common.export.mets.MetsExportException",
"cz.cas.lib.proarc.common.fedora.RemoteStorage",
"cz.cas.lib.proarc.common.object.model.MetaModelRepository",
"cz.cas.lib.proarc.webapp.shared.rest.ExportResourceApi",
"java.io.File",
"java.io.IOException",
"java.util.ArrayList",
"java.util.List",
"javax.ws.rs.DefaultValue",
"javax.ws.rs.FormParam",
"javax.ws.rs.Path",
"javax.ws.rs.Produces",
"javax.ws.rs.core.MediaType",
"javax.ws.rs.core.Response"
] |
import cz.cas.lib.proarc.common.export.DesaExport; import cz.cas.lib.proarc.common.export.ExportException; import cz.cas.lib.proarc.common.export.mets.MetsExportException; import cz.cas.lib.proarc.common.fedora.RemoteStorage; import cz.cas.lib.proarc.common.object.model.MetaModelRepository; import cz.cas.lib.proarc.webapp.shared.rest.ExportResourceApi; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; import javax.ws.rs.DefaultValue; import javax.ws.rs.FormParam; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response;
|
import cz.cas.lib.proarc.common.export.*; import cz.cas.lib.proarc.common.export.mets.*; import cz.cas.lib.proarc.common.fedora.*; import cz.cas.lib.proarc.common.object.model.*; import cz.cas.lib.proarc.webapp.shared.rest.*; import java.io.*; import java.util.*; import javax.ws.rs.*; import javax.ws.rs.core.*;
|
[
"cz.cas.lib",
"java.io",
"java.util",
"javax.ws"
] |
cz.cas.lib; java.io; java.util; javax.ws;
| 2,115,115
|
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
root = new javax.swing.JPanel();
panelTitolo = new javax.swing.JPanel();
containerTitle = new javax.swing.JPanel();
titolo = new javax.swing.JLabel();
panelUser = new javax.swing.JPanel();
sectionUsername = new javax.swing.JPanel();
sectionRequest = new javax.swing.JPanel();
setTitle("Aggiungi amico");
setMinimumSize(new java.awt.Dimension(400, 300));
setResizable(false);
root.setBackground(new java.awt.Color(255, 255, 255));
panelTitolo.setBackground(new java.awt.Color(255, 255, 255));
panelTitolo.setMaximumSize(new java.awt.Dimension(400, 50));
panelTitolo.setMinimumSize(new java.awt.Dimension(400, 50));
panelTitolo.setPreferredSize(new java.awt.Dimension(400, 50));
containerTitle.setBackground(new java.awt.Color(33, 150, 243));
titolo.setBackground(new java.awt.Color(33, 150, 243));
titolo.setFont(new java.awt.Font("Microsoft YaHei UI Light", 1, 24)); // NOI18N
titolo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
titolo.setText("Aggiungi un amico");
titolo.setPreferredSize(new java.awt.Dimension(400, 50));
javax.swing.GroupLayout containerTitleLayout = new javax.swing.GroupLayout(containerTitle);
containerTitle.setLayout(containerTitleLayout);
containerTitleLayout.setHorizontalGroup(
containerTitleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(containerTitleLayout.createSequentialGroup()
.addContainerGap()
.addComponent(titolo, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
.addContainerGap())
);
containerTitleLayout.setVerticalGroup(
containerTitleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(containerTitleLayout.createSequentialGroup()
.addContainerGap()
.addComponent(titolo, javax.swing.GroupLayout.DEFAULT_SIZE, 32, Short.MAX_VALUE)
.addContainerGap())
);
javax.swing.GroupLayout panelTitoloLayout = new javax.swing.GroupLayout(panelTitolo);
panelTitolo.setLayout(panelTitoloLayout);
panelTitoloLayout.setHorizontalGroup(
panelTitoloLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(containerTitle, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
panelTitoloLayout.setVerticalGroup(
panelTitoloLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(containerTitle, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
JScrollPane scrollPane = new JScrollPane(panelUser);
root.add(scrollPane);
panelUser.setBackground(new java.awt.Color(255, 255, 255));
panelUser.setMaximumSize(new java.awt.Dimension(400, 300));
panelUser.setMinimumSize(new java.awt.Dimension(400, 300));
panelUser.setPreferredSize(new java.awt.Dimension(400, 300));
sectionUsername.setBackground(new java.awt.Color(255, 255, 255));
sectionUsername.setMaximumSize(new java.awt.Dimension(200, 300));
sectionUsername.setMinimumSize(new java.awt.Dimension(200, 300));
sectionUsername.setPreferredSize(new java.awt.Dimension(200, 300));
sectionUsername.setLayout(new FlowLayout(FlowLayout.LEADING, 0, 0));
sectionRequest.setBackground(new java.awt.Color(255, 255, 255));
sectionRequest.setMaximumSize(new java.awt.Dimension(200, 300));
sectionRequest.setMinimumSize(new java.awt.Dimension(200, 300));
sectionRequest.setPreferredSize(new java.awt.Dimension(200, 300));
sectionRequest.setLayout(new FlowLayout(FlowLayout.LEADING, 0, 0));
javax.swing.GroupLayout panelUserLayout = new javax.swing.GroupLayout(panelUser);
panelUser.setLayout(panelUserLayout);
panelUserLayout.setHorizontalGroup(
panelUserLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panelUserLayout.createSequentialGroup()
.addComponent(sectionUsername, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(sectionRequest, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
panelUserLayout.setVerticalGroup(
panelUserLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(sectionUsername, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(sectionRequest, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
javax.swing.GroupLayout rootLayout = new javax.swing.GroupLayout(root);
root.setLayout(rootLayout);
rootLayout.setHorizontalGroup(
rootLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(panelTitolo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(panelUser, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
rootLayout.setVerticalGroup(
rootLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(rootLayout.createSequentialGroup()
.addComponent(panelTitolo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(panelUser, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(root, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(root, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
pack();
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JPanel containerTitle;
private javax.swing.JPanel panelTitolo;
private javax.swing.JPanel panelUser;
private javax.swing.JPanel root;
private javax.swing.JPanel sectionRequest;
private javax.swing.JPanel sectionUsername;
private javax.swing.JLabel titolo;
// End of variables declaration//GEN-END:variables
private static ArrayList listaUtenti;
|
@SuppressWarnings(STR) void function() { root = new javax.swing.JPanel(); panelTitolo = new javax.swing.JPanel(); containerTitle = new javax.swing.JPanel(); titolo = new javax.swing.JLabel(); panelUser = new javax.swing.JPanel(); sectionUsername = new javax.swing.JPanel(); sectionRequest = new javax.swing.JPanel(); setTitle(STR); setMinimumSize(new java.awt.Dimension(400, 300)); setResizable(false); root.setBackground(new java.awt.Color(255, 255, 255)); panelTitolo.setBackground(new java.awt.Color(255, 255, 255)); panelTitolo.setMaximumSize(new java.awt.Dimension(400, 50)); panelTitolo.setMinimumSize(new java.awt.Dimension(400, 50)); panelTitolo.setPreferredSize(new java.awt.Dimension(400, 50)); containerTitle.setBackground(new java.awt.Color(33, 150, 243)); titolo.setBackground(new java.awt.Color(33, 150, 243)); titolo.setFont(new java.awt.Font(STR, 1, 24)); titolo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); titolo.setText(STR); titolo.setPreferredSize(new java.awt.Dimension(400, 50)); javax.swing.GroupLayout containerTitleLayout = new javax.swing.GroupLayout(containerTitle); containerTitle.setLayout(containerTitleLayout); containerTitleLayout.setHorizontalGroup( containerTitleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(containerTitleLayout.createSequentialGroup() .addContainerGap() .addComponent(titolo, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) .addContainerGap()) ); containerTitleLayout.setVerticalGroup( containerTitleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(containerTitleLayout.createSequentialGroup() .addContainerGap() .addComponent(titolo, javax.swing.GroupLayout.DEFAULT_SIZE, 32, Short.MAX_VALUE) .addContainerGap()) ); javax.swing.GroupLayout panelTitoloLayout = new javax.swing.GroupLayout(panelTitolo); panelTitolo.setLayout(panelTitoloLayout); panelTitoloLayout.setHorizontalGroup( panelTitoloLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(containerTitle, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); panelTitoloLayout.setVerticalGroup( panelTitoloLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(containerTitle, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); JScrollPane scrollPane = new JScrollPane(panelUser); root.add(scrollPane); panelUser.setBackground(new java.awt.Color(255, 255, 255)); panelUser.setMaximumSize(new java.awt.Dimension(400, 300)); panelUser.setMinimumSize(new java.awt.Dimension(400, 300)); panelUser.setPreferredSize(new java.awt.Dimension(400, 300)); sectionUsername.setBackground(new java.awt.Color(255, 255, 255)); sectionUsername.setMaximumSize(new java.awt.Dimension(200, 300)); sectionUsername.setMinimumSize(new java.awt.Dimension(200, 300)); sectionUsername.setPreferredSize(new java.awt.Dimension(200, 300)); sectionUsername.setLayout(new FlowLayout(FlowLayout.LEADING, 0, 0)); sectionRequest.setBackground(new java.awt.Color(255, 255, 255)); sectionRequest.setMaximumSize(new java.awt.Dimension(200, 300)); sectionRequest.setMinimumSize(new java.awt.Dimension(200, 300)); sectionRequest.setPreferredSize(new java.awt.Dimension(200, 300)); sectionRequest.setLayout(new FlowLayout(FlowLayout.LEADING, 0, 0)); javax.swing.GroupLayout panelUserLayout = new javax.swing.GroupLayout(panelUser); panelUser.setLayout(panelUserLayout); panelUserLayout.setHorizontalGroup( panelUserLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelUserLayout.createSequentialGroup() .addComponent(sectionUsername, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0) .addComponent(sectionRequest, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); panelUserLayout.setVerticalGroup( panelUserLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(sectionUsername, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(sectionRequest, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); javax.swing.GroupLayout rootLayout = new javax.swing.GroupLayout(root); root.setLayout(rootLayout); rootLayout.setHorizontalGroup( rootLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(panelTitolo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(panelUser, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); rootLayout.setVerticalGroup( rootLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(rootLayout.createSequentialGroup() .addComponent(panelTitolo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(panelUser, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(root, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(root, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); pack(); } private javax.swing.JPanel containerTitle; private javax.swing.JPanel panelTitolo; private javax.swing.JPanel panelUser; private javax.swing.JPanel root; private javax.swing.JPanel sectionRequest; private javax.swing.JPanel sectionUsername; private javax.swing.JLabel titolo; private static ArrayList listaUtenti;
|
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
|
This method is called from within the constructor to initialize the form. regenerated by the Form Editor
|
initComponents
|
{
"repo_name": "mattia98tr/indixis",
"path": "src/server/AddFriend.java",
"license": "gpl-3.0",
"size": 13513
}
|
[
"java.awt.Dimension",
"java.awt.FlowLayout",
"java.awt.Font",
"java.util.ArrayList",
"javax.swing.JLabel",
"javax.swing.JScrollPane"
] |
import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Font; import java.util.ArrayList; import javax.swing.JLabel; import javax.swing.JScrollPane;
|
import java.awt.*; import java.util.*; import javax.swing.*;
|
[
"java.awt",
"java.util",
"javax.swing"
] |
java.awt; java.util; javax.swing;
| 2,790,553
|
public static BugAnnotation fromMethodDescriptor(MethodDescriptor methodDescriptor) {
return fromForeignMethod(
methodDescriptor.getSlashedClassName(),
methodDescriptor.getName(),
methodDescriptor.getSignature(),
methodDescriptor.isStatic());
}
|
static BugAnnotation function(MethodDescriptor methodDescriptor) { return fromForeignMethod( methodDescriptor.getSlashedClassName(), methodDescriptor.getName(), methodDescriptor.getSignature(), methodDescriptor.isStatic()); }
|
/**
* Create a MethodAnnotation from a MethodDescriptor.
*
* @param methodDescriptor the MethodDescriptor
* @return the MethodAnnotation
*/
|
Create a MethodAnnotation from a MethodDescriptor
|
fromMethodDescriptor
|
{
"repo_name": "optivo-org/fingbugs-1.3.9-optivo",
"path": "src/java/edu/umd/cs/findbugs/MethodAnnotation.java",
"license": "lgpl-2.1",
"size": 16781
}
|
[
"edu.umd.cs.findbugs.classfile.MethodDescriptor"
] |
import edu.umd.cs.findbugs.classfile.MethodDescriptor;
|
import edu.umd.cs.findbugs.classfile.*;
|
[
"edu.umd.cs"
] |
edu.umd.cs;
| 2,127,423
|
public void setReleaseTagsAfterEnd(String configValue) {
OpenCms.getSystemInfo().getServletContainerSettings().setReleaseTagsAfterEnd(
Boolean.valueOf(configValue).booleanValue());
}
|
void function(String configValue) { OpenCms.getSystemInfo().getServletContainerSettings().setReleaseTagsAfterEnd( Boolean.valueOf(configValue).booleanValue()); }
|
/**
* Sets the servlet container specific setting.<p>
*
* @param configValue the configuration value
*/
|
Sets the servlet container specific setting
|
setReleaseTagsAfterEnd
|
{
"repo_name": "sbonoc/opencms-core",
"path": "src/org/opencms/configuration/CmsSystemConfiguration.java",
"license": "lgpl-2.1",
"size": 113574
}
|
[
"org.opencms.main.OpenCms"
] |
import org.opencms.main.OpenCms;
|
import org.opencms.main.*;
|
[
"org.opencms.main"
] |
org.opencms.main;
| 2,045,803
|
public void setIconFromPixbuf(EntryIconPosition position, Pixbuf pixbuf) {
GtkEntry.setIconFromPixbuf(this, position, pixbuf);
}
/**
* Set the icon to a given <code>position</code> using a {@link Stock}
|
void function(EntryIconPosition position, Pixbuf pixbuf) { GtkEntry.setIconFromPixbuf(this, position, pixbuf); } /** * Set the icon to a given <code>position</code> using a {@link Stock}
|
/**
* Set the icon to a given <code>position</code> using a {@link Pixbuf}.
* If <code>pixbuf</code> is <code>null</code>, no icon will be shown.
*
* @since 4.0.13
*/
|
Set the icon to a given <code>position</code> using a <code>Pixbuf</code>. If <code>pixbuf</code> is <code>null</code>, no icon will be shown
|
setIconFromPixbuf
|
{
"repo_name": "severinh/java-gnome",
"path": "src/bindings/org/gnome/gtk/Entry.java",
"license": "gpl-2.0",
"size": 21241
}
|
[
"org.gnome.gdk.Pixbuf"
] |
import org.gnome.gdk.Pixbuf;
|
import org.gnome.gdk.*;
|
[
"org.gnome.gdk"
] |
org.gnome.gdk;
| 1,841,108
|
@Test
public void testDecommissionStatus() throws IOException, InterruptedException {
InetSocketAddress addr = new InetSocketAddress("localhost", cluster
.getNameNodePort());
DFSClient client = new DFSClient(addr, conf);
DatanodeInfo[] info = client.datanodeReport(DatanodeReportType.LIVE);
assertEquals("Number of Datanodes ", 2, info.length);
FileSystem fileSys = cluster.getFileSystem();
short replicas = 2;
//
// Decommission one node. Verify the decommission status
//
Path file1 = new Path("decommission.dat");
writeFile(fileSys, file1, replicas);
Path file2 = new Path("decommission1.dat");
FSDataOutputStream st1 = writeIncompleteFile(fileSys, file2, replicas);
Thread.sleep(5000);
FSNamesystem fsn = cluster.getNameNode().getNamesystem();
for (int iteration = 0; iteration < numDatanodes; iteration++) {
String downnode = decommissionNode(fsn, conf, client, localFileSys,
iteration);
decommissionedNodes.add(downnode);
Thread.sleep(5000);
ArrayList<DatanodeDescriptor> decommissioningNodes = fsn
.getDecommissioningNodesList();
if (iteration == 0) {
assertEquals(decommissioningNodes.size(), 1);
DatanodeDescriptor decommNode = decommissioningNodes.get(0);
checkDecommissionStatus(decommNode, 4, 0, 2);
} else {
assertEquals(decommissioningNodes.size(), 2);
DatanodeDescriptor decommNode1 = decommissioningNodes.get(0);
DatanodeDescriptor decommNode2 = decommissioningNodes.get(1);
checkDecommissionStatus(decommNode1, 4, 4, 2);
checkDecommissionStatus(decommNode2, 4, 4, 2);
}
}
// Call refreshNodes on FSNamesystem with empty exclude file.
// This will remove the datanodes from decommissioning list and
// make them available again.
writeConfigFile(localFileSys, excludeFile, null);
fsn.refreshNodes(conf);
st1.close();
cleanupFile(fileSys, file1);
cleanupFile(fileSys, file2);
cleanupFile(localFileSys, dir);
}
|
void function() throws IOException, InterruptedException { InetSocketAddress addr = new InetSocketAddress(STR, cluster .getNameNodePort()); DFSClient client = new DFSClient(addr, conf); DatanodeInfo[] info = client.datanodeReport(DatanodeReportType.LIVE); assertEquals(STR, 2, info.length); FileSystem fileSys = cluster.getFileSystem(); short replicas = 2; Path file1 = new Path(STR); writeFile(fileSys, file1, replicas); Path file2 = new Path(STR); FSDataOutputStream st1 = writeIncompleteFile(fileSys, file2, replicas); Thread.sleep(5000); FSNamesystem fsn = cluster.getNameNode().getNamesystem(); for (int iteration = 0; iteration < numDatanodes; iteration++) { String downnode = decommissionNode(fsn, conf, client, localFileSys, iteration); decommissionedNodes.add(downnode); Thread.sleep(5000); ArrayList<DatanodeDescriptor> decommissioningNodes = fsn .getDecommissioningNodesList(); if (iteration == 0) { assertEquals(decommissioningNodes.size(), 1); DatanodeDescriptor decommNode = decommissioningNodes.get(0); checkDecommissionStatus(decommNode, 4, 0, 2); } else { assertEquals(decommissioningNodes.size(), 2); DatanodeDescriptor decommNode1 = decommissioningNodes.get(0); DatanodeDescriptor decommNode2 = decommissioningNodes.get(1); checkDecommissionStatus(decommNode1, 4, 4, 2); checkDecommissionStatus(decommNode2, 4, 4, 2); } } writeConfigFile(localFileSys, excludeFile, null); fsn.refreshNodes(conf); st1.close(); cleanupFile(fileSys, file1); cleanupFile(fileSys, file2); cleanupFile(localFileSys, dir); }
|
/**
* Tests Decommissioning Status in DFS.
*/
|
Tests Decommissioning Status in DFS
|
testDecommissionStatus
|
{
"repo_name": "nvoron23/hadoop-20",
"path": "src/test/org/apache/hadoop/hdfs/server/namenode/TestDecommissioningStatus.java",
"license": "apache-2.0",
"size": 8423
}
|
[
"java.io.IOException",
"java.net.InetSocketAddress",
"java.util.ArrayList",
"org.apache.hadoop.fs.FSDataOutputStream",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.hdfs.DFSClient",
"org.apache.hadoop.hdfs.protocol.DatanodeInfo",
"org.apache.hadoop.hdfs.protocol.FSConstants",
"org.apache.hadoop.hdfs.server.namenode.DatanodeDescriptor",
"org.apache.hadoop.hdfs.server.namenode.FSNamesystem",
"org.junit.Assert"
] |
import java.io.IOException; import java.net.InetSocketAddress; import java.util.ArrayList; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hdfs.DFSClient; import org.apache.hadoop.hdfs.protocol.DatanodeInfo; import org.apache.hadoop.hdfs.protocol.FSConstants; import org.apache.hadoop.hdfs.server.namenode.DatanodeDescriptor; import org.apache.hadoop.hdfs.server.namenode.FSNamesystem; import org.junit.Assert;
|
import java.io.*; import java.net.*; import java.util.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hdfs.*; import org.apache.hadoop.hdfs.protocol.*; import org.apache.hadoop.hdfs.server.namenode.*; import org.junit.*;
|
[
"java.io",
"java.net",
"java.util",
"org.apache.hadoop",
"org.junit"
] |
java.io; java.net; java.util; org.apache.hadoop; org.junit;
| 2,549,574
|
@Override
public void operationSetLowerBound(QueryExecutionContext context,
IndexScanOperation op, boolean lastColumn) {
property.operationSetBounds(lower.getParameterValue(context),
IndexScanOperation.BoundType.BoundLE, op);
}
|
void function(QueryExecutionContext context, IndexScanOperation op, boolean lastColumn) { property.operationSetBounds(lower.getParameterValue(context), IndexScanOperation.BoundType.BoundLE, op); }
|
/** Set the lower bound for the operation.
* Delegate to the property to actually call the setBounds
* for the lower bound.
* @param context the query context that contains the parameter values
* @param op the index scan operation on which to set bounds
*/
|
Set the lower bound for the operation. Delegate to the property to actually call the setBounds for the lower bound
|
operationSetLowerBound
|
{
"repo_name": "pdutta777/mysql56",
"path": "storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/query/BetweenPredicateImpl.java",
"license": "gpl-2.0",
"size": 5417
}
|
[
"com.mysql.clusterj.core.spi.QueryExecutionContext",
"com.mysql.clusterj.core.store.IndexScanOperation"
] |
import com.mysql.clusterj.core.spi.QueryExecutionContext; import com.mysql.clusterj.core.store.IndexScanOperation;
|
import com.mysql.clusterj.core.spi.*; import com.mysql.clusterj.core.store.*;
|
[
"com.mysql.clusterj"
] |
com.mysql.clusterj;
| 338,107
|
public synchronized void start(Xid xid, int flag) throws XAException {
if (flag == XAResource.TMNOFLAGS) {
// first time in this transaction
// make sure we aren't already in another tx
if (this.xid != null) {
throw new XAException("Already enlisted in another transaction with xid " + xid);
}
// save off the current auto commit flag so it can be restored after the transaction completes
try {
originalAutoCommit = connection.getAutoCommit();
} catch (SQLException ignored) {
// no big deal, just assume it was off
originalAutoCommit = true;
}
// update the auto commit flag
try {
connection.setAutoCommit(false);
} catch (SQLException e) {
throw (XAException) new XAException("Count not turn off auto commit for a XA transaction").initCause(e);
}
this.xid = xid;
} else if (flag == XAResource.TMRESUME) {
if (xid != this.xid) {
throw new XAException("Attempting to resume in different transaction: expected " + this.xid + ", but was " + xid);
}
} else {
throw new XAException("Unknown start flag " + flag);
}
}
|
synchronized void function(Xid xid, int flag) throws XAException { if (flag == XAResource.TMNOFLAGS) { if (this.xid != null) { throw new XAException(STR + xid); } try { originalAutoCommit = connection.getAutoCommit(); } catch (SQLException ignored) { originalAutoCommit = true; } try { connection.setAutoCommit(false); } catch (SQLException e) { throw (XAException) new XAException(STR).initCause(e); } this.xid = xid; } else if (flag == XAResource.TMRESUME) { if (xid != this.xid) { throw new XAException(STR + this.xid + STR + xid); } } else { throw new XAException(STR + flag); } }
|
/**
* Signals that a the connection has been enrolled in a transaction. This method saves off the
* current auto commit flag, and then disables auto commit. The original auto commit setting is
* restored when the transaction completes.
*
* @param xid the id of the transaction branch for this connection
* @param flag either XAResource.TMNOFLAGS or XAResource.TMRESUME
* @throws XAException if the connection is already elisted in another tranction, or if auto-commit
* could not be disabled
*/
|
Signals that a the connection has been enrolled in a transaction. This method saves off the current auto commit flag, and then disables auto commit. The original auto commit setting is restored when the transaction completes
|
start
|
{
"repo_name": "optivo-org/commons-dbcp",
"path": "src/java/org/apache/commons/dbcp/managed/LocalXAConnectionFactory.java",
"license": "apache-2.0",
"size": 12986
}
|
[
"java.sql.SQLException",
"javax.transaction.xa.XAException",
"javax.transaction.xa.XAResource",
"javax.transaction.xa.Xid"
] |
import java.sql.SQLException; import javax.transaction.xa.XAException; import javax.transaction.xa.XAResource; import javax.transaction.xa.Xid;
|
import java.sql.*; import javax.transaction.xa.*;
|
[
"java.sql",
"javax.transaction"
] |
java.sql; javax.transaction;
| 1,988,152
|
public Object singleLineText(FormObject formObject);
|
Object function(FormObject formObject);
|
/**
* setup and return a single line Text component, from the specified formObject
* @see FormObject
*/
|
setup and return a single line Text component, from the specified formObject
|
singleLineText
|
{
"repo_name": "srnsw/xena",
"path": "plugins/pdf/ext/src/jpedal_lgpl-3.83b38/src/org/jpedal/objects/acroforms/creation/FormFactory.java",
"license": "gpl-3.0",
"size": 4576
}
|
[
"org.jpedal.objects.raw.FormObject"
] |
import org.jpedal.objects.raw.FormObject;
|
import org.jpedal.objects.raw.*;
|
[
"org.jpedal.objects"
] |
org.jpedal.objects;
| 2,752,577
|
public com.mozu.api.contracts.mzdb.EntityList getEntityList(String entityListFullName, String responseFields) throws Exception
{
MozuClient<com.mozu.api.contracts.mzdb.EntityList> client = com.mozu.api.clients.platform.EntityListClient.getEntityListClient( entityListFullName, responseFields);
client.setContext(_apiContext);
client.executeRequest();
return client.getResult();
}
|
com.mozu.api.contracts.mzdb.EntityList function(String entityListFullName, String responseFields) throws Exception { MozuClient<com.mozu.api.contracts.mzdb.EntityList> client = com.mozu.api.clients.platform.EntityListClient.getEntityListClient( entityListFullName, responseFields); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); }
|
/**
* Get an existing EntityList definition for a specific tenant
* <p><pre><code>
* EntityList entitylist = new EntityList();
* EntityList entityList = entitylist.getEntityList( entityListFullName, responseFields);
* </code></pre></p>
* @param entityListFullName The full name of the EntityList including namespace in name@nameSpace format
* @param responseFields Use this field to include those fields which are not included by default.
* @return com.mozu.api.contracts.mzdb.EntityList
* @see com.mozu.api.contracts.mzdb.EntityList
*/
|
Get an existing EntityList definition for a specific tenant <code><code> EntityList entitylist = new EntityList(); EntityList entityList = entitylist.getEntityList( entityListFullName, responseFields); </code></code>
|
getEntityList
|
{
"repo_name": "sanjaymandadi/mozu-java",
"path": "mozu-javaasync-core/src/main/java/com/mozu/api/resources/platform/EntityListResource.java",
"license": "mit",
"size": 20283
}
|
[
"com.mozu.api.MozuClient"
] |
import com.mozu.api.MozuClient;
|
import com.mozu.api.*;
|
[
"com.mozu.api"
] |
com.mozu.api;
| 2,265,639
|
public void initWorkerNum(WorkerAgentProtocol workerAgent) {
this.workerMangerNum = workerAgent.getNumberWorkers(this.getJobId(),
this.getSid());
displayFirstRoute();
}
|
void function(WorkerAgentProtocol workerAgent) { this.workerMangerNum = workerAgent.getNumberWorkers(this.getJobId(), this.getSid()); displayFirstRoute(); }
|
/**
* Initialize the number of workers of the same job.
*
* @param hostName
*/
|
Initialize the number of workers of the same job
|
initWorkerNum
|
{
"repo_name": "LiuJianan/Graduate-Graph",
"path": "src/java/com/chinamobile/bcbsp/bspstaff/BSPStaff.java",
"license": "apache-2.0",
"size": 138171
}
|
[
"com.chinamobile.bcbsp.workermanager.WorkerAgentProtocol"
] |
import com.chinamobile.bcbsp.workermanager.WorkerAgentProtocol;
|
import com.chinamobile.bcbsp.workermanager.*;
|
[
"com.chinamobile.bcbsp"
] |
com.chinamobile.bcbsp;
| 1,144,006
|
public static QDataSet unbundle( QDataSet ds, int i ) {
return DataSetOps.unbundle(ds, i);
}
|
static QDataSet function( QDataSet ds, int i ) { return DataSetOps.unbundle(ds, i); }
|
/**
* Extract a bundled dataset from a bundle of datasets. The input should
* be a rank 2 dataset with the property BUNDLE_1 set to a bundle descriptor
* dataset. See BundleDataSet for more semantics. Note we support the case
* where DEPEND_1 has EnumerationUnits, and this is the same as slice1.
*
* @param ds the bundle dataset.
* @param i index of the dataset to extract. If the index is within a high-rank dataset, then the entire dataset is returned.
* @throws IndexOutOfBoundsException if the index is invalid.
* @throws IllegalArgumentException if the dataset is not a bundle dataset, with either BUNDLE_1 or DEPEND_1 set.
* @return the i-th dataset from the bundle.
*/
|
Extract a bundled dataset from a bundle of datasets. The input should be a rank 2 dataset with the property BUNDLE_1 set to a bundle descriptor dataset. See BundleDataSet for more semantics. Note we support the case where DEPEND_1 has EnumerationUnits, and this is the same as slice1
|
unbundle
|
{
"repo_name": "autoplot/app",
"path": "QDataSet/src/org/das2/qds/ops/Ops.java",
"license": "gpl-2.0",
"size": 492716
}
|
[
"org.das2.qds.DataSetOps",
"org.das2.qds.QDataSet"
] |
import org.das2.qds.DataSetOps; import org.das2.qds.QDataSet;
|
import org.das2.qds.*;
|
[
"org.das2.qds"
] |
org.das2.qds;
| 525,087
|
final void convertAndProcess(
Package.Builder pkgBuilder, Location location, Object value)
throws EvalException {
T typedValue = type.convert(value, "'package' argument", pkgBuilder.getBuildFileLabel());
process(pkgBuilder, location, typedValue);
}
/**
* Processes an argument.
*
* @param pkgBuilder the package builder to be mutated
* @param location the location of the {@code package} function for error reporting
* @param value the value of the argument. Typically passed to {@link Type#convert}
|
final void convertAndProcess( Package.Builder pkgBuilder, Location location, Object value) throws EvalException { T typedValue = type.convert(value, STR, pkgBuilder.getBuildFileLabel()); process(pkgBuilder, location, typedValue); } /** * Processes an argument. * * @param pkgBuilder the package builder to be mutated * @param location the location of the {@code package} function for error reporting * @param value the value of the argument. Typically passed to {@link Type#convert}
|
/**
* Converts an untyped argument to a typed one, then calls the user-provided {@link #process}.
*
* Note that the location is used not just for exceptions (for which null would do), but also for
* reporting events.
*/
|
Converts an untyped argument to a typed one, then calls the user-provided <code>#process</code>. Note that the location is used not just for exceptions (for which null would do), but also for reporting events
|
convertAndProcess
|
{
"repo_name": "davidzchen/bazel",
"path": "src/main/java/com/google/devtools/build/lib/packages/PackageArgument.java",
"license": "apache-2.0",
"size": 1979
}
|
[
"net.starlark.java.eval.EvalException",
"net.starlark.java.syntax.Location"
] |
import net.starlark.java.eval.EvalException; import net.starlark.java.syntax.Location;
|
import net.starlark.java.eval.*; import net.starlark.java.syntax.*;
|
[
"net.starlark.java"
] |
net.starlark.java;
| 1,132,020
|
public IDataBinding createDataBinding( )
{
ComputedColumn c = new ComputedColumn( );
IDataBinding binding = new DataBindingImpl( c );
return binding;
}
|
IDataBinding function( ) { ComputedColumn c = new ComputedColumn( ); IDataBinding binding = new DataBindingImpl( c ); return binding; }
|
/**
* Create <code>IDataBinding</code>
*
* @return instance
*/
|
Create <code>IDataBinding</code>
|
createDataBinding
|
{
"repo_name": "Charling-Huang/birt",
"path": "engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/script/internal/element/ScriptAPIBaseFactory.java",
"license": "epl-1.0",
"size": 2723
}
|
[
"org.eclipse.birt.report.engine.api.script.element.IDataBinding",
"org.eclipse.birt.report.model.api.elements.structures.ComputedColumn"
] |
import org.eclipse.birt.report.engine.api.script.element.IDataBinding; import org.eclipse.birt.report.model.api.elements.structures.ComputedColumn;
|
import org.eclipse.birt.report.engine.api.script.element.*; import org.eclipse.birt.report.model.api.elements.structures.*;
|
[
"org.eclipse.birt"
] |
org.eclipse.birt;
| 1,147,065
|
@Override
public ObjectSpecification valueSpec() {
final Class<?> valueType = value();
return valueType != null ? getSpecificationLoader().loadSpecification(valueType) : null;
}
|
ObjectSpecification function() { final Class<?> valueType = value(); return valueType != null ? getSpecificationLoader().loadSpecification(valueType) : null; }
|
/**
* The {@link ObjectSpecification} of the {@link #value()}.
*/
|
The <code>ObjectSpecification</code> of the <code>#value()</code>
|
valueSpec
|
{
"repo_name": "niv0/isis",
"path": "core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/SingleClassValueFacetAbstract.java",
"license": "apache-2.0",
"size": 2230
}
|
[
"org.apache.isis.core.metamodel.spec.ObjectSpecification"
] |
import org.apache.isis.core.metamodel.spec.ObjectSpecification;
|
import org.apache.isis.core.metamodel.spec.*;
|
[
"org.apache.isis"
] |
org.apache.isis;
| 2,041,566
|
@CheckForNull
MetricsAccessKey getAccessKey(String accessKey);
}
@Extension
public static class DescriptorImpl extends Descriptor<MetricsAccessKey> {
private static final SecureRandom entropy = new SecureRandom();
private static final char[] keyChars =
"ABCEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".toCharArray();
private static boolean keyConverted = false;
@GuardedBy("this")
private List<MetricsAccessKey> accessKeys;
private transient volatile Set<String> accessKeySet;
public DescriptorImpl() {
super();
keyIsNotConverted();
load();
if (keyConverted) {
Logger.getLogger(MetricsAccessKey.class.getName()).info("Saving encrypted Metrics access key(s)");
Timer.get().submit(this::save);
}
}
|
MetricsAccessKey getAccessKey(String accessKey); } public static class DescriptorImpl extends Descriptor<MetricsAccessKey> { private static final SecureRandom entropy = new SecureRandom(); private static final char[] keyChars = STR.toCharArray(); private static boolean keyConverted = false; @GuardedBy("this") private List<MetricsAccessKey> accessKeys; private transient volatile Set<String> accessKeySet; public DescriptorImpl() { super(); keyIsNotConverted(); load(); if (keyConverted) { Logger.getLogger(MetricsAccessKey.class.getName()).info(STR); Timer.get().submit(this::save); } }
|
/**
* Returns the definition of the specific access key. Note that all entries in {@link #getAccessKeys()} must
* be returned by this method, but it may also return additional entries.
*
* @param accessKey the access key to retrieve.
* @return the access key.
*/
|
Returns the definition of the specific access key. Note that all entries in <code>#getAccessKeys()</code> must be returned by this method, but it may also return additional entries
|
getAccessKey
|
{
"repo_name": "jenkinsci/metrics-plugin",
"path": "src/main/java/jenkins/metrics/api/MetricsAccessKey.java",
"license": "mit",
"size": 25130
}
|
[
"hudson.model.Descriptor",
"java.security.SecureRandom",
"java.util.List",
"java.util.Set",
"java.util.logging.Logger",
"net.jcip.annotations.GuardedBy"
] |
import hudson.model.Descriptor; import java.security.SecureRandom; import java.util.List; import java.util.Set; import java.util.logging.Logger; import net.jcip.annotations.GuardedBy;
|
import hudson.model.*; import java.security.*; import java.util.*; import java.util.logging.*; import net.jcip.annotations.*;
|
[
"hudson.model",
"java.security",
"java.util",
"net.jcip.annotations"
] |
hudson.model; java.security; java.util; net.jcip.annotations;
| 2,846,682
|
public String getConfirmMessage()
{
String fileConfirmMsg = Application.getMessage(FacesContext.getCurrentInstance(),
getConfirmMessageId());
Node node = this.browseBean.getActionSpace();
if (node != null)
{
return MessageFormat.format(fileConfirmMsg, new Object[] {node.getName()});
}
else
{
return Application.getMessage(FacesContext.getCurrentInstance(),
"delete_node_not_found");
}
}
|
String function() { String fileConfirmMsg = Application.getMessage(FacesContext.getCurrentInstance(), getConfirmMessageId()); Node node = this.browseBean.getActionSpace(); if (node != null) { return MessageFormat.format(fileConfirmMsg, new Object[] {node.getName()}); } else { return Application.getMessage(FacesContext.getCurrentInstance(), STR); } }
|
/**
* Returns the confirmation to display to the user before deleting the content.
*
* @return The formatted message to display
*/
|
Returns the confirmation to display to the user before deleting the content
|
getConfirmMessage
|
{
"repo_name": "Tybion/community-edition",
"path": "projects/web-client/source/java/org/alfresco/web/bean/spaces/DeleteSpaceDialog.java",
"license": "lgpl-3.0",
"size": 11191
}
|
[
"java.text.MessageFormat",
"javax.faces.context.FacesContext",
"org.alfresco.web.app.Application",
"org.alfresco.web.bean.repository.Node"
] |
import java.text.MessageFormat; import javax.faces.context.FacesContext; import org.alfresco.web.app.Application; import org.alfresco.web.bean.repository.Node;
|
import java.text.*; import javax.faces.context.*; import org.alfresco.web.app.*; import org.alfresco.web.bean.repository.*;
|
[
"java.text",
"javax.faces",
"org.alfresco.web"
] |
java.text; javax.faces; org.alfresco.web;
| 263,359
|
public List<FrdParameterRule19> findByFrdParameterRule19Like(FrdParameterRule19 frdParameterRule19,
JPQLAdvancedQueryCriteria criteria, int firstResult, int maxResults);
|
List<FrdParameterRule19> function(FrdParameterRule19 frdParameterRule19, JPQLAdvancedQueryCriteria criteria, int firstResult, int maxResults);
|
/**
* findByFrdParameterRule19Like - finds a list of FrdParameterRule19 Like
*
* @param frdParameterRule19
* @return the list of FrdParameterRule19 found
*/
|
findByFrdParameterRule19Like - finds a list of FrdParameterRule19 Like
|
findByFrdParameterRule19Like
|
{
"repo_name": "yauritux/venice-legacy",
"path": "Venice/Venice-Interface-Model/src/main/java/com/gdn/venice/facade/FrdParameterRule19SessionEJBRemote.java",
"license": "apache-2.0",
"size": 2780
}
|
[
"com.djarum.raf.utilities.JPQLAdvancedQueryCriteria",
"com.gdn.venice.persistence.FrdParameterRule19",
"java.util.List"
] |
import com.djarum.raf.utilities.JPQLAdvancedQueryCriteria; import com.gdn.venice.persistence.FrdParameterRule19; import java.util.List;
|
import com.djarum.raf.utilities.*; import com.gdn.venice.persistence.*; import java.util.*;
|
[
"com.djarum.raf",
"com.gdn.venice",
"java.util"
] |
com.djarum.raf; com.gdn.venice; java.util;
| 1,984,138
|
public List<FilterColumn> getColumns() {
return columns;
}
|
List<FilterColumn> function() { return columns; }
|
/**
* Get the list of {@link FilterColumn} displayed by this {@link Filter}.
*
* @return this columns
*/
|
Get the list of <code>FilterColumn</code> displayed by this <code>Filter</code>
|
getColumns
|
{
"repo_name": "jblievremont/sonarqube",
"path": "sonar-plugin-api/src/main/java/org/sonar/api/web/Filter.java",
"license": "lgpl-3.0",
"size": 4514
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,055,170
|
public void waitTheNth(int n) {
PAFuture.waitFor(this.memberList.get(n));
}
|
void function(int n) { PAFuture.waitFor(this.memberList.get(n)); }
|
/**
* Waits for the member at the specified rank is arrived.
*
* @param n
* - the rank of the awaited member.
*/
|
Waits for the member at the specified rank is arrived
|
waitTheNth
|
{
"repo_name": "lpellegr/programming",
"path": "programming-core/src/main/java/org/objectweb/proactive/core/group/ProxyForGroup.java",
"license": "agpl-3.0",
"size": 55367
}
|
[
"org.objectweb.proactive.api.PAFuture"
] |
import org.objectweb.proactive.api.PAFuture;
|
import org.objectweb.proactive.api.*;
|
[
"org.objectweb.proactive"
] |
org.objectweb.proactive;
| 2,622,703
|
@Nullable
public ValidationResult getValidationResult() {
return ValidationResultImpl.create(this);
}
|
ValidationResult function() { return ValidationResultImpl.create(this); }
|
/**
* Tries to validate file.
*
* @return file validation info or null if file is junk or list of commands is unknown (see {@link #setCommands(List)})
*/
|
Tries to validate file
|
getValidationResult
|
{
"repo_name": "allotria/intellij-community",
"path": "python/src/com/jetbrains/commandInterface/commandLine/psi/CommandLineFile.java",
"license": "apache-2.0",
"size": 3942
}
|
[
"com.jetbrains.commandInterface.commandLine.ValidationResult"
] |
import com.jetbrains.commandInterface.commandLine.ValidationResult;
|
import com.jetbrains.*;
|
[
"com.jetbrains"
] |
com.jetbrains;
| 2,195,686
|
public void link(Map<String, Object> model) throws Exception {
// Iterate class by class
for (String link : annotatedLinkFields.keySet()) {
List<Field> linkFields = annotatedLinkFields.get(link);
// Iterate through Link fields list
for (Field field : linkFields) {
// Change protection for private field
field.setAccessible(true);
// Retrieve linked object
String toClassName = field.getType().getName();
Object to = model.get(toClassName);
org.apache.camel.util.ObjectHelper.notNull(to, "No @link annotation has been defined for the object to link");
field.set(model.get(field.getDeclaringClass().getName()), to);
}
}
}
|
void function(Map<String, Object> model) throws Exception { for (String link : annotatedLinkFields.keySet()) { List<Field> linkFields = annotatedLinkFields.get(link); for (Field field : linkFields) { field.setAccessible(true); String toClassName = field.getType().getName(); Object to = model.get(toClassName); org.apache.camel.util.ObjectHelper.notNull(to, STR); field.set(model.get(field.getDeclaringClass().getName()), to); } } }
|
/**
* Link objects together
*/
|
Link objects together
|
link
|
{
"repo_name": "Fabryprog/camel",
"path": "components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyAbstractFactory.java",
"license": "apache-2.0",
"size": 9242
}
|
[
"java.lang.reflect.Field",
"java.util.List",
"java.util.Map",
"org.apache.camel.support.ObjectHelper"
] |
import java.lang.reflect.Field; import java.util.List; import java.util.Map; import org.apache.camel.support.ObjectHelper;
|
import java.lang.reflect.*; import java.util.*; import org.apache.camel.support.*;
|
[
"java.lang",
"java.util",
"org.apache.camel"
] |
java.lang; java.util; org.apache.camel;
| 986,909
|
public static long getNextGenerationId() {
return UniqueIdGenerator.makeIdFromComponents(System.currentTimeMillis(),
m_generationId.incrementAndGet(),
MpInitiator.MP_INIT_PID);
}
|
static long function() { return UniqueIdGenerator.makeIdFromComponents(System.currentTimeMillis(), m_generationId.incrementAndGet(), MpInitiator.MP_INIT_PID); }
|
/**
* Get a unique id for the next generation for export.
* @return next generation id (a unique long value)
*/
|
Get a unique id for the next generation for export
|
getNextGenerationId
|
{
"repo_name": "deerwalk/voltdb",
"path": "src/frontend/org/voltdb/sysprocs/UpdateApplicationBase.java",
"license": "agpl-3.0",
"size": 27437
}
|
[
"org.voltdb.iv2.MpInitiator",
"org.voltdb.iv2.UniqueIdGenerator"
] |
import org.voltdb.iv2.MpInitiator; import org.voltdb.iv2.UniqueIdGenerator;
|
import org.voltdb.iv2.*;
|
[
"org.voltdb.iv2"
] |
org.voltdb.iv2;
| 1,999,064
|
private long getTimeout(final Ticket t) {
if (t instanceof TicketGrantingTicket) {
return this.ticketGrantingTicketTimeoutInSeconds;
}
if (t instanceof ServiceTicket) {
return this.serviceTicketTimeoutInSeconds;
}
throw new IllegalArgumentException(
String.format("Invalid ticket type [%s]. Expecting either [TicketGrantingTicket] or [ServiceTicket]",
t.getClass().getName()));
}
|
long function(final Ticket t) { if (t instanceof TicketGrantingTicket) { return this.ticketGrantingTicketTimeoutInSeconds; } if (t instanceof ServiceTicket) { return this.serviceTicketTimeoutInSeconds; } throw new IllegalArgumentException( String.format(STR, t.getClass().getName())); }
|
/**
* A method to get the starting TTL for a ticket based upon type.
*
* @param t Ticket to get starting TTL for
* @return Initial TTL for ticket
*/
|
A method to get the starting TTL for a ticket based upon type
|
getTimeout
|
{
"repo_name": "moghaddam/cas",
"path": "cas-server-integration-hazelcast/src/main/java/org/jasig/cas/ticket/registry/HazelcastTicketRegistry.java",
"license": "apache-2.0",
"size": 6439
}
|
[
"org.jasig.cas.ticket.ServiceTicket",
"org.jasig.cas.ticket.Ticket",
"org.jasig.cas.ticket.TicketGrantingTicket"
] |
import org.jasig.cas.ticket.ServiceTicket; import org.jasig.cas.ticket.Ticket; import org.jasig.cas.ticket.TicketGrantingTicket;
|
import org.jasig.cas.ticket.*;
|
[
"org.jasig.cas"
] |
org.jasig.cas;
| 1,976,604
|
public Bound from(String tableSpec) {
return from(StaticValueProvider.of(tableSpec));
}
|
Bound function(String tableSpec) { return from(StaticValueProvider.of(tableSpec)); }
|
/**
* Returns a copy of this transform that reads from the specified table. Refer to
* {@link #parseTableSpec(String)} for the specification format.
*
* <p>Does not modify this object.
*/
|
Returns a copy of this transform that reads from the specified table. Refer to <code>#parseTableSpec(String)</code> for the specification format. Does not modify this object
|
from
|
{
"repo_name": "sammcveety/DataflowJavaSDK",
"path": "sdk/src/main/java/com/google/cloud/dataflow/sdk/io/BigQueryIO.java",
"license": "apache-2.0",
"size": 118912
}
|
[
"com.google.cloud.dataflow.sdk.options.ValueProvider"
] |
import com.google.cloud.dataflow.sdk.options.ValueProvider;
|
import com.google.cloud.dataflow.sdk.options.*;
|
[
"com.google.cloud"
] |
com.google.cloud;
| 908,883
|
Optional<JobKey> getJobKey(long id);
|
Optional<JobKey> getJobKey(long id);
|
/**
* Gets the job key for a job id
*/
|
Gets the job key for a job id
|
getJobKey
|
{
"repo_name": "flesire/ontrack",
"path": "ontrack-job/src/main/java/net/nemerosa/ontrack/job/JobScheduler.java",
"license": "mit",
"size": 3280
}
|
[
"java.util.Optional"
] |
import java.util.Optional;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,310,441
|
private static ModulePatcher initModulePatcher() {
Map<String, List<String>> map = decode("jdk.module.patch.",
File.pathSeparator,
false);
return new ModulePatcher(map);
}
|
static ModulePatcher function() { Map<String, List<String>> map = decode(STR, File.pathSeparator, false); return new ModulePatcher(map); }
|
/**
* Initialize the module patcher for the initial configuration passed on the
* value of the --patch-module options.
*/
|
Initialize the module patcher for the initial configuration passed on the value of the --patch-module options
|
initModulePatcher
|
{
"repo_name": "md-5/jdk10",
"path": "src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java",
"license": "gpl-2.0",
"size": 41334
}
|
[
"java.io.File",
"java.util.List",
"java.util.Map"
] |
import java.io.File; import java.util.List; import java.util.Map;
|
import java.io.*; import java.util.*;
|
[
"java.io",
"java.util"
] |
java.io; java.util;
| 1,689,994
|
protected void notifyLoggingOut() {
// copy listeners to array to avoid ConcurrentModificationException
List<SessionListener> copy =
new ArrayList<SessionListener>(listeners.values());
for (SessionListener listener : copy) {
if (listener != null) {
listener.loggingOut(this);
}
}
}
|
void function() { List<SessionListener> copy = new ArrayList<SessionListener>(listeners.values()); for (SessionListener listener : copy) { if (listener != null) { listener.loggingOut(this); } } }
|
/**
* Notify the listeners that this session is about to be closed.
*/
|
Notify the listeners that this session is about to be closed
|
notifyLoggingOut
|
{
"repo_name": "Kast0rTr0y/jackrabbit",
"path": "jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java",
"license": "apache-2.0",
"size": 47987
}
|
[
"java.util.ArrayList",
"java.util.List"
] |
import java.util.ArrayList; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 241,608
|
@Nullable public static SchemaOperationException wrapIfNeeded(@Nullable Exception e) {
if (e == null)
return null;
if (e instanceof SchemaOperationException)
return (SchemaOperationException)e;
return new SchemaOperationException("Unexpected exception.", e);
}
|
@Nullable static SchemaOperationException function(@Nullable Exception e) { if (e == null) return null; if (e instanceof SchemaOperationException) return (SchemaOperationException)e; return new SchemaOperationException(STR, e); }
|
/**
* Wrap schema exception if needed.
*
* @param e Original exception.
* @return Schema exception.
*/
|
Wrap schema exception if needed
|
wrapIfNeeded
|
{
"repo_name": "mcherkasov/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryUtils.java",
"license": "apache-2.0",
"size": 33066
}
|
[
"org.apache.ignite.internal.processors.query.schema.SchemaOperationException",
"org.jetbrains.annotations.Nullable"
] |
import org.apache.ignite.internal.processors.query.schema.SchemaOperationException; import org.jetbrains.annotations.Nullable;
|
import org.apache.ignite.internal.processors.query.schema.*; import org.jetbrains.annotations.*;
|
[
"org.apache.ignite",
"org.jetbrains.annotations"
] |
org.apache.ignite; org.jetbrains.annotations;
| 1,995,052
|
@DataProvider (name = DATA_SET_FOR_DEFAULT_CONFIG)
public Object[][] dataSetForDefaultConfiguration() throws IOException {
return new Object[][] {
{ "/mock/get", defaultGetResponse("get-3-for-ConfigurationManagerTest.json") },
{ "/mock/*/get", defaultGetResponse("get-3-for-ConfigurationManagerTest.json") },
{ "/mock/1/get", defaultGetResponse("get-3-for-ConfigurationManagerTest.json") },
{ "/mock/2/get", defaultGetResponse("get-3-for-ConfigurationManagerTest.json") },
{ "/mock/3/get", defaultGetResponse("get-3-for-ConfigurationManagerTest.json") },
{ "/mock/4/get", defaultGetResponse("get-3-for-ConfigurationManagerTest.json") },
};
}
|
@DataProvider (name = DATA_SET_FOR_DEFAULT_CONFIG) Object[][] function() throws IOException { return new Object[][] { { STR, defaultGetResponse(STR) }, { STR, defaultGetResponse(STR) }, { STR, defaultGetResponse(STR) }, { STR, defaultGetResponse(STR) }, { STR, defaultGetResponse(STR) }, { STR, defaultGetResponse(STR) }, }; }
|
/**
* Auxiliary method to declare a data set to support testing of a configuration. An entry is specified
* with two elements, each meaning:
*
* [0] : The HTTP uri
* [1] : The expected message
*
* @return
* The data set.
*/
|
Auxiliary method to declare a data set to support testing of a configuration. An entry is specified with two elements, each meaning: [0] : The HTTP uri [1] : The expected message
|
dataSetForDefaultConfiguration
|
{
"repo_name": "Technolords/microservice-mock",
"path": "src/test/java/net/technolords/micro/config/ConfigurationManagerTest.java",
"license": "mit",
"size": 10052
}
|
[
"java.io.IOException",
"org.testng.annotations.DataProvider"
] |
import java.io.IOException; import org.testng.annotations.DataProvider;
|
import java.io.*; import org.testng.annotations.*;
|
[
"java.io",
"org.testng.annotations"
] |
java.io; org.testng.annotations;
| 2,747,869
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.