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
|
|---|---|---|---|---|---|---|---|---|---|---|---|
TezCounters getAllCounters();
|
TezCounters getAllCounters();
|
/**
* Get all the counters of this vertex.
* @return aggregate task-counters
*/
|
Get all the counters of this vertex
|
getAllCounters
|
{
"repo_name": "zjffdu/tez",
"path": "tez-dag/src/main/java/org/apache/tez/dag/app/dag/Vertex.java",
"license": "apache-2.0",
"size": 6531
}
|
[
"org.apache.tez.common.counters.TezCounters"
] |
import org.apache.tez.common.counters.TezCounters;
|
import org.apache.tez.common.counters.*;
|
[
"org.apache.tez"
] |
org.apache.tez;
| 1,151,220
|
public ServiceFuture<ExpressRouteConnectionInner> createOrUpdateAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName, ExpressRouteConnectionInner putExpressRouteConnectionParameters, final ServiceCallback<ExpressRouteConnectionInner> serviceCallback) {
return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters), serviceCallback);
}
|
ServiceFuture<ExpressRouteConnectionInner> function(String resourceGroupName, String expressRouteGatewayName, String connectionName, ExpressRouteConnectionInner putExpressRouteConnectionParameters, final ServiceCallback<ExpressRouteConnectionInner> serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters), serviceCallback); }
|
/**
* Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit.
*
* @param resourceGroupName The name of the resource group.
* @param expressRouteGatewayName The name of the ExpressRoute gateway.
* @param connectionName The name of the connection subresource.
* @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation.
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
|
Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit
|
createOrUpdateAsync
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/network/v2019_04_01/implementation/ExpressRouteConnectionsInner.java",
"license": "mit",
"size": 39006
}
|
[
"com.microsoft.rest.ServiceCallback",
"com.microsoft.rest.ServiceFuture"
] |
import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture;
|
import com.microsoft.rest.*;
|
[
"com.microsoft.rest"
] |
com.microsoft.rest;
| 2,163,638
|
private void onPreDelete() {
List<Association> associations =
AssociationFinder.findAssociations(this.getClass());
for (Association assoc : associations) {
// Ignore if the class has the ignore on the field
if (assoc.clazz.getAnnotation(CascadeIgnore.class) == null &&
assoc.field.getAnnotation(CascadeIgnore.class) == null) {
List<? extends Model> childModels =
Ebean.createQuery(assoc.clazz).where().eq(assoc.field.getName() + ".id", getId()).findList();
for (Model child : childModels) {
// If it is required, delete it, otherwise set it to null
if (assoc.required) {
child.delete();
} else {
try {
assoc.field.set(child, null);
Set<String> set = new HashSet<String>();
set.add(assoc.field.getName());
Ebean.update(child, set);
} catch (IllegalAccessException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
}
}
}
}
}
|
void function() { List<Association> associations = AssociationFinder.findAssociations(this.getClass()); for (Association assoc : associations) { if (assoc.clazz.getAnnotation(CascadeIgnore.class) == null && assoc.field.getAnnotation(CascadeIgnore.class) == null) { List<? extends Model> childModels = Ebean.createQuery(assoc.clazz).where().eq(assoc.field.getName() + ".id", getId()).findList(); for (Model child : childModels) { if (assoc.required) { child.delete(); } else { try { assoc.field.set(child, null); Set<String> set = new HashSet<String>(); set.add(assoc.field.getName()); Ebean.update(child, set); } catch (IllegalAccessException e) { e.printStackTrace(); } } } } } }
|
/**
* Function to be called before delete
*/
|
Function to be called before delete
|
onPreDelete
|
{
"repo_name": "atsid/play-crud",
"path": "app/com/atsid/play/models/AbstractBaseModel.java",
"license": "apache-2.0",
"size": 2746
}
|
[
"com.avaje.ebean.Ebean",
"java.util.HashSet",
"java.util.List",
"java.util.Set"
] |
import com.avaje.ebean.Ebean; import java.util.HashSet; import java.util.List; import java.util.Set;
|
import com.avaje.ebean.*; import java.util.*;
|
[
"com.avaje.ebean",
"java.util"
] |
com.avaje.ebean; java.util;
| 857,265
|
private Model getStatementsAboutEntity() {
Model m = runConstructQuery(String
.format("CONSTRUCT { <%1$s> ?predicate ?object . } "
+ "WHERE { <%1$s> ?predicate ?object } ", individualUri));
m.add(runConstructQuery(String.format(
"CONSTRUCT { ?s ?predicate <%1$s> . } "
+ "WHERE { ?s ?predicate <%1$s> } ", individualUri)));
if (log.isDebugEnabled()) {
StringWriter sw = new StringWriter();
m.write(sw);
log.debug("Statements about '" + individualUri + "': " + sw);
}
return m;
}
|
Model function() { Model m = runConstructQuery(String .format(STR + STR, individualUri)); m.add(runConstructQuery(String.format( STR + STR, individualUri))); if (log.isDebugEnabled()) { StringWriter sw = new StringWriter(); m.write(sw); log.debug(STR + individualUri + STR + sw); } return m; }
|
/**
* Get all statements that have the entity as either the subject or the
* object.
*/
|
Get all statements that have the entity as either the subject or the object
|
getStatementsAboutEntity
|
{
"repo_name": "vivo-project/Vitro",
"path": "api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/individual/IndividualRdfAssembler.java",
"license": "bsd-3-clause",
"size": 12515
}
|
[
"java.io.StringWriter",
"org.apache.jena.rdf.model.Model"
] |
import java.io.StringWriter; import org.apache.jena.rdf.model.Model;
|
import java.io.*; import org.apache.jena.rdf.model.*;
|
[
"java.io",
"org.apache.jena"
] |
java.io; org.apache.jena;
| 377,967
|
void setNotificationListeners(Collection<NotificationListener> v)
{
listeners = v;
}
/**
* {@inheritDoc}
|
void setNotificationListeners(Collection<NotificationListener> v) { listeners = v; } /** * {@inheritDoc}
|
/**
* Set the listeners
* @param v The value
*/
|
Set the listeners
|
setNotificationListeners
|
{
"repo_name": "ironjacamar/ironjacamar",
"path": "core/impl/src/main/java/org/jboss/jca/core/workmanager/DistributedWorkManagerImpl.java",
"license": "lgpl-2.1",
"size": 21252
}
|
[
"java.util.Collection",
"org.jboss.jca.core.spi.workmanager.notification.NotificationListener"
] |
import java.util.Collection; import org.jboss.jca.core.spi.workmanager.notification.NotificationListener;
|
import java.util.*; import org.jboss.jca.core.spi.workmanager.notification.*;
|
[
"java.util",
"org.jboss.jca"
] |
java.util; org.jboss.jca;
| 1,633,760
|
public ListCellRenderer getDefaultCompletionCellRenderer();
|
ListCellRenderer function();
|
/**
* Returns the default list cell renderer to install for all text areas
* with this language support installed.
*
* @return The renderer. This will never be <code>null</code>.
* @see #setDefaultCompletionCellRenderer(ListCellRenderer)
*/
|
Returns the default list cell renderer to install for all text areas with this language support installed
|
getDefaultCompletionCellRenderer
|
{
"repo_name": "ZenHarbinger/RSTALanguageSupport",
"path": "src/main/java/org/fife/rsta/ac/LanguageSupport.java",
"license": "bsd-3-clause",
"size": 5924
}
|
[
"javax.swing.ListCellRenderer"
] |
import javax.swing.ListCellRenderer;
|
import javax.swing.*;
|
[
"javax.swing"
] |
javax.swing;
| 1,943,265
|
@Deprecated
public static <K, V> SetMultimap<K, V> unmodifiableSetMultimap(
ImmutableSetMultimap<K, V> delegate) {
return checkNotNull(delegate);
}
|
static <K, V> SetMultimap<K, V> function( ImmutableSetMultimap<K, V> delegate) { return checkNotNull(delegate); }
|
/**
* Simply returns its argument.
*
* @deprecated no need to use this
* @since 10.0
*/
|
Simply returns its argument
|
unmodifiableSetMultimap
|
{
"repo_name": "tli2/guava",
"path": "guava/src/com/google/common/collect/Multimaps.java",
"license": "apache-2.0",
"size": 83553
}
|
[
"com.google.common.base.Preconditions"
] |
import com.google.common.base.Preconditions;
|
import com.google.common.base.*;
|
[
"com.google.common"
] |
com.google.common;
| 521,432
|
public static DigestInputStream getMD5IODigest(InputStream is) {
return wrapDigestInputStream(new MD5Digest(), is);
}
|
static DigestInputStream function(InputStream is) { return wrapDigestInputStream(new MD5Digest(), is); }
|
/**
* Helper method that returns an IODigestUtility configured for MD5 Digest.
*
* @return IODigestUtility
*/
|
Helper method that returns an IODigestUtility configured for MD5 Digest
|
getMD5IODigest
|
{
"repo_name": "MastekLtd/JBEAM",
"path": "supporting_libraries/stg-commons/src/main/java/com/stg/crypto/IODigestUtility.java",
"license": "lgpl-3.0",
"size": 2629
}
|
[
"java.io.InputStream",
"org.bouncycastle.crypto.digests.MD5Digest",
"org.bouncycastle.crypto.io.DigestInputStream"
] |
import java.io.InputStream; import org.bouncycastle.crypto.digests.MD5Digest; import org.bouncycastle.crypto.io.DigestInputStream;
|
import java.io.*; import org.bouncycastle.crypto.digests.*; import org.bouncycastle.crypto.io.*;
|
[
"java.io",
"org.bouncycastle.crypto"
] |
java.io; org.bouncycastle.crypto;
| 372,592
|
public void setScheduledPersistedActionService(ScheduledPersistedActionService scheduledPersistedActionService)
{
this.scheduledPersistedActionService = scheduledPersistedActionService;
}
|
void function(ScheduledPersistedActionService scheduledPersistedActionService) { this.scheduledPersistedActionService = scheduledPersistedActionService; }
|
/**
* Injects the Scheduled Persisted Action Service bean
* @param scheduledPersistedActionService
*/
|
Injects the Scheduled Persisted Action Service bean
|
setScheduledPersistedActionService
|
{
"repo_name": "daniel-he/community-edition",
"path": "projects/repository/source/java/org/alfresco/repo/replication/ReplicationServiceImpl.java",
"license": "lgpl-3.0",
"size": 9146
}
|
[
"org.alfresco.service.cmr.action.scheduled.ScheduledPersistedActionService"
] |
import org.alfresco.service.cmr.action.scheduled.ScheduledPersistedActionService;
|
import org.alfresco.service.cmr.action.scheduled.*;
|
[
"org.alfresco.service"
] |
org.alfresco.service;
| 339,339
|
private void dynInit()
{
ArrayList<BankInfo> bankAccountData = getBankAccountData();
for(BankInfo bi : bankAccountData)
fieldBankAccount.addItem(bi);
if (fieldBankAccount.getItemCount() == 0)
ADialog.error(m_WindowNo, panel, "VPaySelectNoBank");
else
fieldBankAccount.setSelectedIndex(0);
ArrayList<KeyNamePair> bpartnerData = getBPartnerData();
for(KeyNamePair pp : bpartnerData)
fieldBPartner.addItem(pp);
fieldBPartner.setSelectedIndex(0);
ArrayList<KeyNamePair> docTypeData = getDocTypeData();
for(KeyNamePair pp : docTypeData)
fieldDtype.addItem(pp);
prepareTable(miniTable);
miniTable.getModel().addTableModelListener(this);
//
fieldPayDate.setMandatory(true);
fieldPayDate.setValue(new Timestamp(System.currentTimeMillis()));
} // dynInit
|
void function() { ArrayList<BankInfo> bankAccountData = getBankAccountData(); for(BankInfo bi : bankAccountData) fieldBankAccount.addItem(bi); if (fieldBankAccount.getItemCount() == 0) ADialog.error(m_WindowNo, panel, STR); else fieldBankAccount.setSelectedIndex(0); ArrayList<KeyNamePair> bpartnerData = getBPartnerData(); for(KeyNamePair pp : bpartnerData) fieldBPartner.addItem(pp); fieldBPartner.setSelectedIndex(0); ArrayList<KeyNamePair> docTypeData = getDocTypeData(); for(KeyNamePair pp : docTypeData) fieldDtype.addItem(pp); prepareTable(miniTable); miniTable.getModel().addTableModelListener(this); fieldPayDate.setMandatory(true); fieldPayDate.setValue(new Timestamp(System.currentTimeMillis())); }
|
/**
* Dynamic Init.
* - Load Bank Info
* - Load BPartner
* - Load Document Type
* - Init Table
*/
|
Dynamic Init. - Load Bank Info - Load BPartner - Load Document Type - Init Table
|
dynInit
|
{
"repo_name": "geneos/adempiere",
"path": "client/src/org/compiere/apps/form/VPaySelect.java",
"license": "gpl-2.0",
"size": 15426
}
|
[
"java.sql.Timestamp",
"java.util.ArrayList",
"org.compiere.apps.ADialog",
"org.compiere.util.KeyNamePair"
] |
import java.sql.Timestamp; import java.util.ArrayList; import org.compiere.apps.ADialog; import org.compiere.util.KeyNamePair;
|
import java.sql.*; import java.util.*; import org.compiere.apps.*; import org.compiere.util.*;
|
[
"java.sql",
"java.util",
"org.compiere.apps",
"org.compiere.util"
] |
java.sql; java.util; org.compiere.apps; org.compiere.util;
| 1,310,236
|
@Override
public void onDestroy() {
ArrayList<SimpleMediaPlayer> mediaPlayers = new ArrayList<SimpleMediaPlayer>(SimpleMediaPlayer.mediaPlayers);
for (SimpleMediaPlayer mediaPlayer : mediaPlayers){
mediaPlayer.destroy();
}
if (NETWORKING){
try{
CacheTidy.removeUnusedStudentFiles(tableIdentity);
}catch(Db4oIOException e){
AdditionalSynergyNetUtilities.logInfo("Cannot clean user resources - database not online.");
}
}
if (sync != null)sync.stop();
if (NETWORKING){
SynergyNetCluster.get().shutdown();
}
}
///////////////// Projector Interaction //////////////////////////
|
void function() { ArrayList<SimpleMediaPlayer> mediaPlayers = new ArrayList<SimpleMediaPlayer>(SimpleMediaPlayer.mediaPlayers); for (SimpleMediaPlayer mediaPlayer : mediaPlayers){ mediaPlayer.destroy(); } if (NETWORKING){ try{ CacheTidy.removeUnusedStudentFiles(tableIdentity); }catch(Db4oIOException e){ AdditionalSynergyNetUtilities.logInfo(STR); } } if (sync != null)sync.stop(); if (NETWORKING){ SynergyNetCluster.get().shutdown(); } }
|
/**
* Actions to be performed when the SynergyNetApp window is closed.
*/
|
Actions to be performed when the SynergyNetApp window is closed
|
onDestroy
|
{
"repo_name": "synergynet/synergynet3",
"path": "synergynet3-parent/synergynet3-appsystem-core/src/main/java/synergynet3/SynergyNetApp.java",
"license": "bsd-3-clause",
"size": 28273
}
|
[
"com.db4o.ext.Db4oIOException",
"java.util.ArrayList"
] |
import com.db4o.ext.Db4oIOException; import java.util.ArrayList;
|
import com.db4o.ext.*; import java.util.*;
|
[
"com.db4o.ext",
"java.util"
] |
com.db4o.ext; java.util;
| 1,423,060
|
public static FormatStep dateFormatStep(final String formatString, final boolean leftJustify, final int minimumWidth, final int maximumWidth) {
return dateFormatStep(TimeZone.getDefault(), formatString, leftJustify, minimumWidth, maximumWidth);
}
|
static FormatStep function(final String formatString, final boolean leftJustify, final int minimumWidth, final int maximumWidth) { return dateFormatStep(TimeZone.getDefault(), formatString, leftJustify, minimumWidth, maximumWidth); }
|
/**
* Create a format step which emits the date of the log record with the given justification rules.
*
* @param formatString the date format string
* @param leftJustify {@code true} to left justify, {@code false} to right justify
* @param minimumWidth the minimum field width, or 0 for none
* @param maximumWidth the maximum field width (must be greater than {@code minimumFieldWidth}), or 0 for none
* @return the format step
*/
|
Create a format step which emits the date of the log record with the given justification rules
|
dateFormatStep
|
{
"repo_name": "doctau/jboss-logmanager",
"path": "src/main/java/org/jboss/logmanager/formatters/Formatters.java",
"license": "apache-2.0",
"size": 66094
}
|
[
"java.util.TimeZone"
] |
import java.util.TimeZone;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,717,746
|
public static String optimise(String query, Database database, QueryOptimiserContext context)
throws SQLException {
return optimise(query, null, database, null, context).getBestQueryString();
}
|
static String function(String query, Database database, QueryOptimiserContext context) throws SQLException { return optimise(query, null, database, null, context).getBestQueryString(); }
|
/**
* Runs the optimiser through the query represented in the String, given the database. If
* anything goes wrong, then the original String is returned.
*
* @param query the query to optimise
* @param database the database to use to find precomputed tables
* @param context a QueryOptimiserContext, to alter settings
* @return a String representing the optimised query
* @throws SQLException if a database error occurs
*/
|
Runs the optimiser through the query represented in the String, given the database. If anything goes wrong, then the original String is returned
|
optimise
|
{
"repo_name": "tomck/intermine",
"path": "intermine/objectstore/main/src/org/intermine/sql/precompute/QueryOptimiser.java",
"license": "lgpl-2.1",
"size": 67813
}
|
[
"java.sql.SQLException",
"org.intermine.sql.Database"
] |
import java.sql.SQLException; import org.intermine.sql.Database;
|
import java.sql.*; import org.intermine.sql.*;
|
[
"java.sql",
"org.intermine.sql"
] |
java.sql; org.intermine.sql;
| 995,514
|
XMLEvent2 event;
XMLEventReader2 xmlReader = StaxUtil.newXMLEventReader(reader);
xmlReader.nextEvent(); // start document;
event = xmlReader.nextEvent(); // start element
String name = event.asStartElement().getName().getLocalPart();
Attribute2 typeAttribute = event.asStartElement().getAttributeByName(XmlFormatParser.M_TYPE);
Attribute2 nullAttribute = event.asStartElement().getAttributeByName(XmlFormatParser.M_NULL);
boolean isNull = nullAttribute != null && "true".equals(nullAttribute.getValue());
if (isNull) {
return null;
}
System.out.println("the complex type name is:"+name);
Iterable<OProperty<?>> props = AtomFeedFormatParser.parseProperties(xmlReader, event.asStartElement(), settings.metadata, (EdmComplexType) settings.parseType);
return createCT(props, (EdmComplexType) this.settings.parseType);
}
|
XMLEvent2 event; XMLEventReader2 xmlReader = StaxUtil.newXMLEventReader(reader); xmlReader.nextEvent(); event = xmlReader.nextEvent(); String name = event.asStartElement().getName().getLocalPart(); Attribute2 typeAttribute = event.asStartElement().getAttributeByName(XmlFormatParser.M_TYPE); Attribute2 nullAttribute = event.asStartElement().getAttributeByName(XmlFormatParser.M_NULL); boolean isNull = nullAttribute != null && "true".equals(nullAttribute.getValue()); if (isNull) { return null; } System.out.println(STR+name); Iterable<OProperty<?>> props = AtomFeedFormatParser.parseProperties(xmlReader, event.asStartElement(), settings.metadata, (EdmComplexType) settings.parseType); return createCT(props, (EdmComplexType) this.settings.parseType); }
|
/**
* Parse a complex type from function/action response.
*/
|
Parse a complex type from function/action response
|
parse
|
{
"repo_name": "delkyd/oreva",
"path": "odata-core/src/main/java/org/odata4j/format/xml/AtomComplexFormatParser.java",
"license": "apache-2.0",
"size": 3039
}
|
[
"org.odata4j.core.OProperty",
"org.odata4j.edm.EdmComplexType",
"org.odata4j.stax2.Attribute2",
"org.odata4j.stax2.XMLEvent2",
"org.odata4j.stax2.XMLEventReader2",
"org.odata4j.stax2.util.StaxUtil"
] |
import org.odata4j.core.OProperty; import org.odata4j.edm.EdmComplexType; import org.odata4j.stax2.Attribute2; import org.odata4j.stax2.XMLEvent2; import org.odata4j.stax2.XMLEventReader2; import org.odata4j.stax2.util.StaxUtil;
|
import org.odata4j.core.*; import org.odata4j.edm.*; import org.odata4j.stax2.*; import org.odata4j.stax2.util.*;
|
[
"org.odata4j.core",
"org.odata4j.edm",
"org.odata4j.stax2"
] |
org.odata4j.core; org.odata4j.edm; org.odata4j.stax2;
| 1,723,409
|
@Test(expected = BadRequestException.class)
public void testRequestInvalidUserFilterAdminFilter() {
ApplicationContext adminContext = getAdminContext().getBuilder()
.client(ClientType.Implicit)
.authenticator(AuthenticatorType.Test)
.bearerToken(Scope.APPLICATION)
.user()
.build();
Mockito.doReturn(adminContext.getToken())
.when(mockContext).getUserPrincipal();
Mockito.doReturn(true).when(mockContext)
.isUserInRole(Scope.APPLICATION_ADMIN);
service.resolveOwnershipFilter(IdUtil.next());
}
|
@Test(expected = BadRequestException.class) void function() { ApplicationContext adminContext = getAdminContext().getBuilder() .client(ClientType.Implicit) .authenticator(AuthenticatorType.Test) .bearerToken(Scope.APPLICATION) .user() .build(); Mockito.doReturn(adminContext.getToken()) .when(mockContext).getUserPrincipal(); Mockito.doReturn(true).when(mockContext) .isUserInRole(Scope.APPLICATION_ADMIN); service.resolveOwnershipFilter(IdUtil.next()); }
|
/**
* Assert that an admin, when passing an invalid ownerID, gets an error.
*/
|
Assert that an admin, when passing an invalid ownerID, gets an error
|
testRequestInvalidUserFilterAdminFilter
|
{
"repo_name": "kangaroo-server/kangaroo",
"path": "kangaroo-server-authz/src/test/java/net/krotscheck/kangaroo/authz/admin/v1/resource/AbstractServiceTest.java",
"license": "apache-2.0",
"size": 26802
}
|
[
"javax.ws.rs.BadRequestException",
"net.krotscheck.kangaroo.authz.admin.Scope",
"net.krotscheck.kangaroo.authz.common.authenticator.AuthenticatorType",
"net.krotscheck.kangaroo.authz.common.database.entity.ClientType",
"net.krotscheck.kangaroo.authz.test.ApplicationBuilder",
"net.krotscheck.kangaroo.common.hibernate.id.IdUtil",
"org.junit.Test",
"org.mockito.Mockito"
] |
import javax.ws.rs.BadRequestException; import net.krotscheck.kangaroo.authz.admin.Scope; import net.krotscheck.kangaroo.authz.common.authenticator.AuthenticatorType; import net.krotscheck.kangaroo.authz.common.database.entity.ClientType; import net.krotscheck.kangaroo.authz.test.ApplicationBuilder; import net.krotscheck.kangaroo.common.hibernate.id.IdUtil; import org.junit.Test; import org.mockito.Mockito;
|
import javax.ws.rs.*; import net.krotscheck.kangaroo.authz.admin.*; import net.krotscheck.kangaroo.authz.common.authenticator.*; import net.krotscheck.kangaroo.authz.common.database.entity.*; import net.krotscheck.kangaroo.authz.test.*; import net.krotscheck.kangaroo.common.hibernate.id.*; import org.junit.*; import org.mockito.*;
|
[
"javax.ws",
"net.krotscheck.kangaroo",
"org.junit",
"org.mockito"
] |
javax.ws; net.krotscheck.kangaroo; org.junit; org.mockito;
| 583,363
|
@RequestMapping( value = "/{id}", method = RequestMethod.PUT )
@ResponseBody
public Style updateAction(
@PathVariable( "id" )
Long id,
@RequestBody
@Valid
Style style,
HttpServletResponse response
) {
//- Search origin style -//
Style styleOrigin = this.styleService.find( id );
if ( styleOrigin == null ) {
//- Failure. Style not found -//
response.setStatus( HttpStatus.NOT_FOUND.value() );
return null;
}
//- Update style -//
try {
//- Set new data -//
styleOrigin.setCode( style.getCode() );
styleOrigin.setTitle( style.getTitle() );
styleOrigin.setDescription( style.getDescription() );
//- Success. Return created style -//
return this.styleService.update( styleOrigin );
} catch ( DataIntegrityViolationException e ) {
//- Failure. Can not to create video type -//
response.setStatus( HttpStatus.FORBIDDEN.value() );
}
return null;
}
|
@RequestMapping( value = "/{id}", method = RequestMethod.PUT ) Style function( @PathVariable( "id" ) Long id, Style style, HttpServletResponse response ) { Style styleOrigin = this.styleService.find( id ); if ( styleOrigin == null ) { response.setStatus( HttpStatus.NOT_FOUND.value() ); return null; } try { styleOrigin.setCode( style.getCode() ); styleOrigin.setTitle( style.getTitle() ); styleOrigin.setDescription( style.getDescription() ); return this.styleService.update( styleOrigin ); } catch ( DataIntegrityViolationException e ) { response.setStatus( HttpStatus.FORBIDDEN.value() ); } return null; }
|
/**
* Update already exist style.
*
* @param id ID of style
* @param style Updated data
* @param response Use for set HTTP status
*
* @return Updated style.
*/
|
Update already exist style
|
updateAction
|
{
"repo_name": "coffeine-009/Virtuoso",
"path": "src/main/java/com/thecoffeine/virtuoso/music/controller/StyleController.java",
"license": "mit",
"size": 5730
}
|
[
"com.thecoffeine.virtuoso.music.model.entity.Style",
"javax.servlet.http.HttpServletResponse",
"org.springframework.dao.DataIntegrityViolationException",
"org.springframework.http.HttpStatus",
"org.springframework.web.bind.annotation.PathVariable",
"org.springframework.web.bind.annotation.RequestMapping",
"org.springframework.web.bind.annotation.RequestMethod"
] |
import com.thecoffeine.virtuoso.music.model.entity.Style; import javax.servlet.http.HttpServletResponse; import org.springframework.dao.DataIntegrityViolationException; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod;
|
import com.thecoffeine.virtuoso.music.model.entity.*; import javax.servlet.http.*; import org.springframework.dao.*; import org.springframework.http.*; import org.springframework.web.bind.annotation.*;
|
[
"com.thecoffeine.virtuoso",
"javax.servlet",
"org.springframework.dao",
"org.springframework.http",
"org.springframework.web"
] |
com.thecoffeine.virtuoso; javax.servlet; org.springframework.dao; org.springframework.http; org.springframework.web;
| 240,656
|
public Rectangle getPerimetro() {
return new Rectangle(getPosX(), getPosY(), getAncho(), getAlto());
}
|
Rectangle function() { return new Rectangle(getPosX(), getPosY(), getAncho(), getAlto()); }
|
/**
* Metodo de acceso que regresa un nuevo rectangulo
*
* @return un objeto de la clase <code>Rectangle</code> que es el perimetro
* del rectangulo
*/
|
Metodo de acceso que regresa un nuevo rectangulo
|
getPerimetro
|
{
"repo_name": "betoesquivel/Atacando",
"path": "src/huyendodelasteroide/CuerpoCeleste.java",
"license": "mit",
"size": 4171
}
|
[
"java.awt.Rectangle"
] |
import java.awt.Rectangle;
|
import java.awt.*;
|
[
"java.awt"
] |
java.awt;
| 1,385,587
|
public static Registry getRegistry(String host, int port,
RMIClientSocketFactory csf)
throws RemoteException
{
Registry registry = null;
if (port <= 0)
port = Registry.REGISTRY_PORT;
if (host == null || host.length() == 0) {
// If host is blank (as returned by "file:" URL in 1.0.2 used in
// java.rmi.Naming), try to convert to real local host name so
// that the RegistryImpl's checkAccess will not fail.
try {
host = java.net.InetAddress.getLocalHost().getHostAddress();
} catch (Exception e) {
// If that failed, at least try "" (localhost) anyway...
host = "";
}
}
LiveRef liveRef =
new LiveRef(new ObjID(ObjID.REGISTRY_ID),
new TCPEndpoint(host, port, csf, null),
false);
RemoteRef ref =
(csf == null) ? new UnicastRef(liveRef) : new UnicastRef2(liveRef);
return (Registry) Util.createProxy(RegistryImpl.class, ref, false);
}
/**
* Creates and exports a <code>Registry</code> instance on the local
* host that accepts requests on the specified <code>port</code>.
*
* <p>The <code>Registry</code> instance is exported as if the static
* {@link UnicastRemoteObject#exportObject(Remote,int)
* UnicastRemoteObject.exportObject} method is invoked, passing the
* <code>Registry</code> instance and the specified <code>port</code> as
* arguments, except that the <code>Registry</code> instance is
* exported with a well-known object identifier, an {@link ObjID}
|
static Registry function(String host, int port, RMIClientSocketFactory csf) throws RemoteException { Registry registry = null; if (port <= 0) port = Registry.REGISTRY_PORT; if (host == null host.length() == 0) { try { host = java.net.InetAddress.getLocalHost().getHostAddress(); } catch (Exception e) { host = ""; } } LiveRef liveRef = new LiveRef(new ObjID(ObjID.REGISTRY_ID), new TCPEndpoint(host, port, csf, null), false); RemoteRef ref = (csf == null) ? new UnicastRef(liveRef) : new UnicastRef2(liveRef); return (Registry) Util.createProxy(RegistryImpl.class, ref, false); } /** * Creates and exports a <code>Registry</code> instance on the local * host that accepts requests on the specified <code>port</code>. * * <p>The <code>Registry</code> instance is exported as if the static * {@link UnicastRemoteObject#exportObject(Remote,int) * UnicastRemoteObject.exportObject} method is invoked, passing the * <code>Registry</code> instance and the specified <code>port</code> as * arguments, except that the <code>Registry</code> instance is * exported with a well-known object identifier, an {@link ObjID}
|
/**
* Returns a locally created remote reference to the remote object
* <code>Registry</code> on the specified <code>host</code> and
* <code>port</code>. Communication with this remote registry will
* use the supplied <code>RMIClientSocketFactory</code> <code>csf</code>
* to create <code>Socket</code> connections to the registry on the
* remote <code>host</code> and <code>port</code>.
*
* @param host host for the remote registry
* @param port port on which the registry accepts requests
* @param csf client-side <code>Socket</code> factory used to
* make connections to the registry. If <code>csf</code>
* is null, then the default client-side <code>Socket</code>
* factory will be used in the registry stub.
* @return reference (a stub) to the remote registry
* @exception RemoteException if the reference could not be created
* @since 1.2
*/
|
Returns a locally created remote reference to the remote object <code>Registry</code> on the specified <code>host</code> and <code>port</code>. Communication with this remote registry will use the supplied <code>RMIClientSocketFactory</code> <code>csf</code> to create <code>Socket</code> connections to the registry on the remote <code>host</code> and <code>port</code>
|
getRegistry
|
{
"repo_name": "flyzsd/java-code-snippets",
"path": "ibm.jdk8/src/java/rmi/registry/LocateRegistry.java",
"license": "mit",
"size": 9679
}
|
[
"java.rmi.RemoteException",
"java.rmi.server.ObjID",
"java.rmi.server.RMIClientSocketFactory",
"java.rmi.server.RemoteRef",
"java.rmi.server.UnicastRemoteObject"
] |
import java.rmi.RemoteException; import java.rmi.server.ObjID; import java.rmi.server.RMIClientSocketFactory; import java.rmi.server.RemoteRef; import java.rmi.server.UnicastRemoteObject;
|
import java.rmi.*; import java.rmi.server.*;
|
[
"java.rmi"
] |
java.rmi;
| 2,209,775
|
@Override
public void onResume() {
super.onResume();
if (booRecreate) {
Handler hndRecreate = new Handler();
hndRecreate.postDelayed(new Runnable() {
|
void function() { super.onResume(); if (booRecreate) { Handler hndRecreate = new Handler(); hndRecreate.postDelayed(new Runnable() {
|
/**
* Forces the activity to recreate all the preferences after the activity
* was paused A handler is used for recreating an activity. Calling recreate
* directly from the the onResume causes a runtime exception
*
* @see android.app.Activity#onResume()
*/
|
Forces the activity to recreate all the preferences after the activity was paused A handler is used for recreating an activity. Calling recreate directly from the the onResume causes a runtime exception
|
onResume
|
{
"repo_name": "mridang/dashclock-warning",
"path": "src/main/java/com/mridang/warning/WarningActivity.java",
"license": "apache-2.0",
"size": 8725
}
|
[
"android.os.Handler"
] |
import android.os.Handler;
|
import android.os.*;
|
[
"android.os"
] |
android.os;
| 507,854
|
public static YearRangeRandomizer aNewYearRangeRandomizer(final Year min, final Year max) {
return new YearRangeRandomizer(min, max);
}
|
static YearRangeRandomizer function(final Year min, final Year max) { return new YearRangeRandomizer(min, max); }
|
/**
* Create a new {@link YearRangeRandomizer}.
*
* @param min min value
* @param max max value
* @return a new {@link YearRangeRandomizer}.
*/
|
Create a new <code>YearRangeRandomizer</code>
|
aNewYearRangeRandomizer
|
{
"repo_name": "benas/jPopulator",
"path": "easy-random-core/src/main/java/org/jeasy/random/randomizers/range/YearRangeRandomizer.java",
"license": "mit",
"size": 3477
}
|
[
"java.time.Year"
] |
import java.time.Year;
|
import java.time.*;
|
[
"java.time"
] |
java.time;
| 2,097,832
|
public Collection<ErasureCodingPolicyInfo> getAllErasureCodingPolicies()
throws IOException {
return Arrays.asList(dfs.getErasureCodingPolicies());
}
|
Collection<ErasureCodingPolicyInfo> function() throws IOException { return Arrays.asList(dfs.getErasureCodingPolicies()); }
|
/**
* Retrieve all the erasure coding policies supported by this file system,
* including enabled, disabled and removed policies, but excluding
* REPLICATION policy.
*
* @return all erasure coding policies supported by this file system.
* @throws IOException
*/
|
Retrieve all the erasure coding policies supported by this file system, including enabled, disabled and removed policies, but excluding REPLICATION policy
|
getAllErasureCodingPolicies
|
{
"repo_name": "GeLiXin/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java",
"license": "apache-2.0",
"size": 115559
}
|
[
"java.io.IOException",
"java.util.Arrays",
"java.util.Collection",
"org.apache.hadoop.hdfs.protocol.ErasureCodingPolicyInfo"
] |
import java.io.IOException; import java.util.Arrays; import java.util.Collection; import org.apache.hadoop.hdfs.protocol.ErasureCodingPolicyInfo;
|
import java.io.*; import java.util.*; import org.apache.hadoop.hdfs.protocol.*;
|
[
"java.io",
"java.util",
"org.apache.hadoop"
] |
java.io; java.util; org.apache.hadoop;
| 292,059
|
private void visitPackageDef(DetailAST pkg) {
final FullIdent ident = FullIdent.createFullIdent(pkg.getLastChild()
.getPreviousSibling());
packageName = ident.getText();
}
|
void function(DetailAST pkg) { final FullIdent ident = FullIdent.createFullIdent(pkg.getLastChild() .getPreviousSibling()); packageName = ident.getText(); }
|
/**
* Stores package of current class we check.
* @param pkg package definition.
*/
|
Stores package of current class we check
|
visitPackageDef
|
{
"repo_name": "Godin/checkstyle",
"path": "src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/AbstractClassCouplingCheck.java",
"license": "lgpl-2.1",
"size": 10368
}
|
[
"com.puppycrawl.tools.checkstyle.api.DetailAST",
"com.puppycrawl.tools.checkstyle.api.FullIdent"
] |
import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.FullIdent;
|
import com.puppycrawl.tools.checkstyle.api.*;
|
[
"com.puppycrawl.tools"
] |
com.puppycrawl.tools;
| 879,049
|
public Rectangle2D getScreenDataArea() {
Rectangle2D dataArea = this.info.getPlotInfo().getDataArea();
Insets insets = getInsets();
double x = dataArea.getX() * this.scaleX + insets.left;
double y = dataArea.getY() * this.scaleY + insets.top;
double w = dataArea.getWidth() * this.scaleX;
double h = dataArea.getHeight() * this.scaleY;
return new Rectangle2D.Double(x, y, w, h);
}
|
Rectangle2D function() { Rectangle2D dataArea = this.info.getPlotInfo().getDataArea(); Insets insets = getInsets(); double x = dataArea.getX() * this.scaleX + insets.left; double y = dataArea.getY() * this.scaleY + insets.top; double w = dataArea.getWidth() * this.scaleX; double h = dataArea.getHeight() * this.scaleY; return new Rectangle2D.Double(x, y, w, h); }
|
/**
* Returns the data area for the chart (the area inside the axes) with the
* current scaling applied (that is, the area as it appears on screen).
*
* @return The scaled data area.
*/
|
Returns the data area for the chart (the area inside the axes) with the current scaling applied (that is, the area as it appears on screen)
|
getScreenDataArea
|
{
"repo_name": "tomkren/pikater",
"path": "lib/jfreechart/src/org/jfree/chart/ChartPanel.java",
"license": "apache-2.0",
"size": 119636
}
|
[
"java.awt.Insets",
"java.awt.geom.Rectangle2D"
] |
import java.awt.Insets; import java.awt.geom.Rectangle2D;
|
import java.awt.*; import java.awt.geom.*;
|
[
"java.awt"
] |
java.awt;
| 2,186,859
|
public static boolean isFileURL(String sUrl) throws MalformedURLException {
if (isArchiveURL(sUrl)) return false;
URL url = FileUtils.getFileURL(sUrl);
return isFileURL(url);
}
|
static boolean function(String sUrl) throws MalformedURLException { if (isArchiveURL(sUrl)) return false; URL url = FileUtils.getFileURL(sUrl); return isFileURL(url); }
|
/**
* Returns true if the URL is file URL.
* @param sUrl
* @return
* @throws MalformedURLException
*/
|
Returns true if the URL is file URL
|
isFileURL
|
{
"repo_name": "CloverETL/CloverETL-Engine",
"path": "cloveretl.engine/src/org/jetel/util/file/FileURLParser.java",
"license": "lgpl-2.1",
"size": 10042
}
|
[
"java.net.MalformedURLException"
] |
import java.net.MalformedURLException;
|
import java.net.*;
|
[
"java.net"
] |
java.net;
| 2,489,637
|
public Printable getPrintable(int pageIndex) throws IndexOutOfBoundsException {
return ((Imprimir)AL.get(vez++));
// return ((Imprimir)AL.get(pageIndex));
}
|
Printable function(int pageIndex) throws IndexOutOfBoundsException { return ((Imprimir)AL.get(vez++)); }
|
/**
* Returns the <code>Printable</code> instance responsible for
* rendering the page specified by <code>pageIndex</code>.
*
* @param pageIndex the zero based index of the page whose
* <code>Printable</code> is being requested
* @return the <code>Printable</code> that renders the page.
* @throws IndexOutOfBoundsException if
* the <code>Pageable</code> does not contain the requested
* page.
*/
|
Returns the <code>Printable</code> instance responsible for rendering the page specified by <code>pageIndex</code>
|
getPrintable
|
{
"repo_name": "Esleelkartea/hermes",
"path": "hermes_v1.0.0_src/bgc/gui/proy/nuevo/PrintLabel.java",
"license": "gpl-2.0",
"size": 5822
}
|
[
"java.awt.print.Printable"
] |
import java.awt.print.Printable;
|
import java.awt.print.*;
|
[
"java.awt"
] |
java.awt;
| 53,146
|
public void addImageCache(FragmentActivity activity, String diskCacheDirectoryName) {
mImageCacheParams = new ImageCache.ImageCacheParams(activity, diskCacheDirectoryName);
mImageCache = ImageCache.getInstance(activity.getSupportFragmentManager(), mImageCacheParams);
new CacheAsyncTask().execute(MESSAGE_INIT_DISK_CACHE);
}
|
void function(FragmentActivity activity, String diskCacheDirectoryName) { mImageCacheParams = new ImageCache.ImageCacheParams(activity, diskCacheDirectoryName); mImageCache = ImageCache.getInstance(activity.getSupportFragmentManager(), mImageCacheParams); new CacheAsyncTask().execute(MESSAGE_INIT_DISK_CACHE); }
|
/**
* Adds an {@link ImageCache} to this {@link ImageWorker} to handle disk and memory bitmap
* caching.
* @param activity
* @param diskCacheDirectoryName See
* {@link ImageCache.ImageCacheParams#ImageCacheParams(Context, String)}.
*/
|
Adds an <code>ImageCache</code> to this <code>ImageWorker</code> to handle disk and memory bitmap caching
|
addImageCache
|
{
"repo_name": "dgrlucky/Awesome",
"path": "library/src/main/java/com/library/common/image/ImageWorker.java",
"license": "apache-2.0",
"size": 17770
}
|
[
"android.support.v4.app.FragmentActivity"
] |
import android.support.v4.app.FragmentActivity;
|
import android.support.v4.app.*;
|
[
"android.support"
] |
android.support;
| 2,383,683
|
public static Operation createOperation(String name, Visibility visibility,
Type returnType, List<Parameter> parameters) {
Operation operation = RamFactory.eINSTANCE.createOperation();
operation.setName(name);
operation.setVisibility(visibility);
operation.setReturnType(returnType);
if (parameters != null) {
operation.getParameters().addAll(parameters);
}
return operation;
}
|
static Operation function(String name, Visibility visibility, Type returnType, List<Parameter> parameters) { Operation operation = RamFactory.eINSTANCE.createOperation(); operation.setName(name); operation.setVisibility(visibility); operation.setReturnType(returnType); if (parameters != null) { operation.getParameters().addAll(parameters); } return operation; }
|
/**
* Creates a new operation with the given properties.
*
* @param name the name of the operation
* @param visibility the {@link Visibility} of the operation
* @param returnType the return type of the operation
* @param parameters a list of parameters for the operation
* @return a new {@link Operation} with the given properties set
*/
|
Creates a new operation with the given properties
|
createOperation
|
{
"repo_name": "mjorod/textram",
"path": "tool/ca.mcgill.sel.ram/src/ca/mcgill/cs/sel/ram/util/RAMModelUtil.java",
"license": "mit",
"size": 14833
}
|
[
"ca.mcgill.cs.sel.ram.Operation",
"ca.mcgill.cs.sel.ram.Parameter",
"ca.mcgill.cs.sel.ram.RamFactory",
"ca.mcgill.cs.sel.ram.Type",
"ca.mcgill.cs.sel.ram.Visibility",
"java.util.List"
] |
import ca.mcgill.cs.sel.ram.Operation; import ca.mcgill.cs.sel.ram.Parameter; import ca.mcgill.cs.sel.ram.RamFactory; import ca.mcgill.cs.sel.ram.Type; import ca.mcgill.cs.sel.ram.Visibility; import java.util.List;
|
import ca.mcgill.cs.sel.ram.*; import java.util.*;
|
[
"ca.mcgill.cs",
"java.util"
] |
ca.mcgill.cs; java.util;
| 941,928
|
protected Collection<String> getInitialObjectNames() {
if (initialObjectNames == null) {
initialObjectNames = new ArrayList<String>();
for (EStructuralFeature eStructuralFeature : ExtendedMetaData.INSTANCE.getAllElements(ExtendedMetaData.INSTANCE.getDocumentRoot(dbchangelogPackage))) {
if (eStructuralFeature.isChangeable()) {
EClassifier eClassifier = eStructuralFeature.getEType();
if (eClassifier instanceof EClass) {
EClass eClass = (EClass)eClassifier;
if (!eClass.isAbstract()) {
initialObjectNames.add(eStructuralFeature.getName());
}
}
}
}
Collections.sort(initialObjectNames, java.text.Collator.getInstance());
}
return initialObjectNames;
}
|
Collection<String> function() { if (initialObjectNames == null) { initialObjectNames = new ArrayList<String>(); for (EStructuralFeature eStructuralFeature : ExtendedMetaData.INSTANCE.getAllElements(ExtendedMetaData.INSTANCE.getDocumentRoot(dbchangelogPackage))) { if (eStructuralFeature.isChangeable()) { EClassifier eClassifier = eStructuralFeature.getEType(); if (eClassifier instanceof EClass) { EClass eClass = (EClass)eClassifier; if (!eClass.isAbstract()) { initialObjectNames.add(eStructuralFeature.getName()); } } } } Collections.sort(initialObjectNames, java.text.Collator.getInstance()); } return initialObjectNames; }
|
/**
* Returns the names of the features representing global elements.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
|
Returns the names of the features representing global elements.
|
getInitialObjectNames
|
{
"repo_name": "dzonekl/LiquibaseEditor",
"path": "plugins/org.liquidbase.model.editor/src/org/liquibase/xml/ns/dbchangelog/presentation/DbchangelogModelWizard.java",
"license": "mit",
"size": 16410
}
|
[
"java.util.ArrayList",
"java.util.Collection",
"java.util.Collections",
"org.eclipse.emf.ecore.EClass",
"org.eclipse.emf.ecore.EClassifier",
"org.eclipse.emf.ecore.EStructuralFeature",
"org.eclipse.emf.ecore.util.ExtendedMetaData"
] |
import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EClassifier; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.ecore.util.ExtendedMetaData;
|
import java.util.*; import org.eclipse.emf.ecore.*; import org.eclipse.emf.ecore.util.*;
|
[
"java.util",
"org.eclipse.emf"
] |
java.util; org.eclipse.emf;
| 135,276
|
public List<NodeTuple> getValue() {
return value;
}
|
List<NodeTuple> function() { return value; }
|
/**
* Returns the entries of this map.
*
* @return List of entries.
*/
|
Returns the entries of this map
|
getValue
|
{
"repo_name": "sonologic/jingleboard",
"path": "src/org/yaml/snakeyaml/nodes/MappingNode.java",
"license": "gpl-3.0",
"size": 3234
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 999,768
|
EmployeeDTO findByName(String name);
|
EmployeeDTO findByName(String name);
|
/**
* Finds employee by name
* @param name name of employee
* @return employee
* @throws javax.persistence.NoResultException if no employee
* was found
*/
|
Finds employee by name
|
findByName
|
{
"repo_name": "samgau-repos/course_v1",
"path": "service/src/main/java/com/samgau/start/service/api/EmployeeService.java",
"license": "apache-2.0",
"size": 1297
}
|
[
"com.samgau.start.model.dto.EmployeeDTO"
] |
import com.samgau.start.model.dto.EmployeeDTO;
|
import com.samgau.start.model.dto.*;
|
[
"com.samgau.start"
] |
com.samgau.start;
| 1,072,647
|
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
this.doPost(request, response);
}
|
void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { this.doPost(request, response); }
|
/**
* The doGet method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to get.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
|
The doGet method of the servlet. This method is called when a form has its tag value method equals to get
|
doGet
|
{
"repo_name": "zaoming/fox_shopping",
"path": "src/com/fox/sp/servlet/GoodsTypeView.java",
"license": "apache-2.0",
"size": 4024
}
|
[
"java.io.IOException",
"javax.servlet.ServletException",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse"
] |
import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
|
import java.io.*; import javax.servlet.*; import javax.servlet.http.*;
|
[
"java.io",
"javax.servlet"
] |
java.io; javax.servlet;
| 2,555,756
|
private boolean writeField(IFeedRecord r,Map<String, IFeedAttribute> index,DcatField dcatField, String delimiter, boolean before) {
String indexFieldName = dcatField.getIndex();
String dcatFieldName = dcatField.getName();
String fieldType = dcatField.getType();
String fldValues = "";
String[] flds = indexFieldName.split(",");
for (String fld : flds) {
IFeedAttribute indexValue = index.get(fld);
String val = "";
if (indexValue == null) {
if(dcatField.isRequired()){
if(dcatFieldName.equalsIgnoreCase("accessURL")){
ResourceLinks links = r.getResourceLinks();
for (int j = 0; j < links.size(); j++) {
ResourceLink link = links.get(j);
if (link.getTag().equals(ResourceLink.TAG_METADATA)) {
val = link.getUrl();
break;
}
}
}else{
val = defaultValues.get(dcatFieldName);
}
}else{
continue;
}
}else{
val = "" + indexValue.simplify();
if(dcatFieldName.equalsIgnoreCase("format") && val.equalsIgnoreCase("[\"unknown\"]")){
val = defaultValues.get(dcatFieldName);
}
}
String cleanedVal = cleanValue(val,fieldType,dcatFieldName,dcatField);
if(dcatFieldName.equalsIgnoreCase("dataDictionary") && !(cleanedVal.startsWith("http://") || cleanedVal.startsWith("https://"))){
continue;
}
if(!fldValues.contains(cleanedVal)){
if (fldValues.length() > 0) {
StringBuilder sb = new StringBuilder();
if(fieldType.equalsIgnoreCase("array")){
if(!cleanedVal.equalsIgnoreCase(defaultValues.get(dcatFieldName))){
if(fldValues.startsWith("[") && fldValues.endsWith("]")){
fldValues = fldValues.replace("[", "").replace("]", "");
}
if(cleanedVal.startsWith("[") && cleanedVal.endsWith("]")){
cleanedVal = cleanedVal.replace("[", "").replace("]", "");
}
sb.append("[").append(fldValues).append(delimiter).append(cleanedVal).append("]");
fldValues = sb.toString();
}
}else{
if(fldValues.startsWith("\"") && fldValues.endsWith("\"")){
fldValues = fldValues.replace("\"", "").replace("\"", "");
}
if(cleanedVal.startsWith("\"") && cleanedVal.endsWith("\"")){
cleanedVal = cleanedVal.replace("\"", "").replace("\"", "");
}
sb.append("\"").append(fldValues).append(delimiter).append(cleanedVal).append("\"");
fldValues = sb.toString();
}
}else{
fldValues += cleanedVal;
}
}
}
if (fldValues.length() == 0) {
fldValues = defaultValues.get(dcatFieldName);
if (fldValues == null) {
fldValues = "";
}
}
if (fldValues.length() > 0) {
if (fieldType.equalsIgnoreCase("array")) {
fldValues = fldValues.replaceAll(",", ", ");
}
if (before) {
print(false, ",");
print(false, "\r\n");
}
if(!fldValues.startsWith("\"") && !fldValues.startsWith("[") && !fldValues.endsWith("\"") && !fldValues.endsWith("]")){
fldValues = "\"" + fldValues + "\"";
}
print(before, "\"" + dcatFieldName + "\"" + sp() + ":" + sp() + fldValues);
before = true;
}
return before;
}
|
boolean function(IFeedRecord r,Map<String, IFeedAttribute> index,DcatField dcatField, String delimiter, boolean before) { String indexFieldName = dcatField.getIndex(); String dcatFieldName = dcatField.getName(); String fieldType = dcatField.getType(); String fldValues = STR,STRSTRaccessURLSTRSTRformatSTR[\STR]STRdataDictionarySTRhttp: continue; } if(!fldValues.contains(cleanedVal)){ if (fldValues.length() > 0) { StringBuilder sb = new StringBuilder(); if(fieldType.equalsIgnoreCase("array")){ if(!cleanedVal.equalsIgnoreCase(defaultValues.get(dcatFieldName))){ if(fldValues.startsWith("[") && fldValues.endsWith("]")){ fldValues = fldValues.replace("[", STR]STRSTR[STR]STR[", STR]STRSTR[STR]STR\STR\STR\"", STR\"STRSTR\"STR\"STR\"", STR\"STRSTR\"STR\STRSTRarraySTR,STR, STR,STR\r\nSTR\STR[STR\"STR]STR\STR\STR\STR\STR:" + sp() + fldValues); before = true; } return before; }
|
/**
* Writes fields value to response using field mappings.
*
* @param index the lucene index records
* @param fieldName the lucene field
* @param jsonKey the dcat field
* @param delimiter the delimiter in lucene field
* @param before the indentation flag
* @param isDate true if date field
* @return always <code>true</code>
*/
|
Writes fields value to response using field mappings
|
writeField
|
{
"repo_name": "treejames/GeoprocessingAppstore",
"path": "src/com/esri/gpt/control/georss/DcatJsonFeedWriter.java",
"license": "apache-2.0",
"size": 24855
}
|
[
"java.util.Map"
] |
import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,159,164
|
@Override
public void write(final char[] buffer, int offset, int length) throws IOException
{
synchronized (lock)
{
while (length-- > 0) {
write(buffer[offset++]);
}
}
}
|
void function(final char[] buffer, int offset, int length) throws IOException { synchronized (lock) { while (length-- > 0) { write(buffer[offset++]); } } }
|
/**
* Writes a number of characters from a character array to the output
* starting from a given offset.
*
* @param buffer The character array to write.
* @param offset The offset into the array at which to start copying data.
* @param length The number of characters to write.
* @throws IOException If an error occurs while writing to the underlying
* output.
*/
|
Writes a number of characters from a character array to the output starting from a given offset
|
write
|
{
"repo_name": "apache/commons-net",
"path": "src/main/java/org/apache/commons/net/io/DotTerminatedMessageWriter.java",
"license": "apache-2.0",
"size": 6636
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 169,352
|
public void testEncodeLocale() {
Class<Locale> type = Locale.class;
UjoManager manager = UjoManager.getInstance();
Locale expected;
Locale result ;
//
expected = Locale.getDefault();
result = manager.decodeValue(type, manager.encodeValue(expected, false));
assertEquals("1", expected, result);
//
expected = new Locale("cs", "CZ");
result = manager.decodeValue(type, manager.encodeValue(expected, false));
assertEquals("2", expected, result);
//
expected = new Locale("en", "GB");
result = manager.decodeValue(type, manager.encodeValue(expected, false));
assertEquals("2", expected, result);
//
//
expected = new Locale("cs");
result = manager.decodeValue(type, manager.encodeValue(expected, false));
assertEquals("2", expected, result);
//
expected = new Locale("en");
result = manager.decodeValue(type, manager.encodeValue(expected, false));
assertEquals("2", expected, result);
//
expected = new Locale("cs", "CZ", "XX");
result = manager.decodeValue(type, manager.encodeValue(expected, false));
assertEquals("2", expected, result);
//
expected = new Locale("en", "GB", "XX");
result = manager.decodeValue(type, manager.encodeValue(expected, false));
assertEquals("2", expected, result);
}
|
void function() { Class<Locale> type = Locale.class; UjoManager manager = UjoManager.getInstance(); Locale expected; Locale result ; expected = Locale.getDefault(); result = manager.decodeValue(type, manager.encodeValue(expected, false)); assertEquals("1", expected, result); expected = new Locale("cs", "CZ"); result = manager.decodeValue(type, manager.encodeValue(expected, false)); assertEquals("2", expected, result); expected = new Locale("en", "GB"); result = manager.decodeValue(type, manager.encodeValue(expected, false)); assertEquals("2", expected, result); expected = new Locale("cs"); result = manager.decodeValue(type, manager.encodeValue(expected, false)); assertEquals("2", expected, result); expected = new Locale("en"); result = manager.decodeValue(type, manager.encodeValue(expected, false)); assertEquals("2", expected, result); expected = new Locale("cs", "CZ", "XX"); result = manager.decodeValue(type, manager.encodeValue(expected, false)); assertEquals("2", expected, result); expected = new Locale("en", "GB", "XX"); result = manager.decodeValue(type, manager.encodeValue(expected, false)); assertEquals("2", expected, result); }
|
/**
* Test of encodeBytes method, of class org.ujorm.core.UjoManager.
*/
|
Test of encodeBytes method, of class org.ujorm.core.UjoManager
|
testEncodeLocale
|
{
"repo_name": "pponec/ujorm",
"path": "project-m2/ujo-core/src/test/java/org/ujorm/core/UjoManagerTest.java",
"license": "apache-2.0",
"size": 16967
}
|
[
"java.util.Locale"
] |
import java.util.Locale;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,473,193
|
@ServiceMethod(returns = ReturnType.SINGLE)
Response<PricingInner> getWithResponse(String pricingName, Context context);
|
@ServiceMethod(returns = ReturnType.SINGLE) Response<PricingInner> getWithResponse(String pricingName, Context context);
|
/**
* Gets a provided Security Center pricing configuration in the subscription.
*
* @param pricingName name of the pricing configuration.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a provided Security Center pricing configuration in the subscription.
*/
|
Gets a provided Security Center pricing configuration in the subscription
|
getWithResponse
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/PricingsClient.java",
"license": "mit",
"size": 4795
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.core.util.Context",
"com.azure.resourcemanager.security.fluent.models.PricingInner"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.security.fluent.models.PricingInner;
|
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.security.fluent.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 2,360,927
|
public ThrustCurveMotorSetDatabase getDatabase() {
blockUntilLoaded();
return database;
}
|
ThrustCurveMotorSetDatabase function() { blockUntilLoaded(); return database; }
|
/**
* Returns the loaded database. If the database has not fully loaded,
* this blocks until it is.
*
* @return the motor database
*/
|
Returns the loaded database. If the database has not fully loaded, this blocks until it is
|
getDatabase
|
{
"repo_name": "joebowen/landing_zone_project",
"path": "openrocket-release-15.03/swing/src/net/sf/openrocket/database/MotorDatabaseLoader.java",
"license": "gpl-2.0",
"size": 4596
}
|
[
"net.sf.openrocket.database.motor.ThrustCurveMotorSetDatabase"
] |
import net.sf.openrocket.database.motor.ThrustCurveMotorSetDatabase;
|
import net.sf.openrocket.database.motor.*;
|
[
"net.sf.openrocket"
] |
net.sf.openrocket;
| 1,394,716
|
public NeuronAllele newNeuronAllele( NeuronType type ) {
ActivationFunctionType act;
if ( NeuronType.INPUT.equals( type ) )
act = inputActivationType;
else if ( NeuronType.OUTPUT.equals( type ) )
act = outputActivationType;
else
act = hiddenActivationType;
NeuronGene gene = new NeuronGene( type, nextInnovationId(), act );
return new NeuronAllele( gene );
}
|
NeuronAllele function( NeuronType type ) { ActivationFunctionType act; if ( NeuronType.INPUT.equals( type ) ) act = inputActivationType; else if ( NeuronType.OUTPUT.equals( type ) ) act = outputActivationType; else act = hiddenActivationType; NeuronGene gene = new NeuronGene( type, nextInnovationId(), act ); return new NeuronAllele( gene ); }
|
/**
* factory method to construct new neuron allele with unique innovation ID of specified
* <code>type</code>
*
* @param type
* @return NeuronAllele
*/
|
factory method to construct new neuron allele with unique innovation ID of specified <code>type</code>
|
newNeuronAllele
|
{
"repo_name": "RaeveSpam/ANJIProject",
"path": "src/com/anji/neat/NeatConfiguration.java",
"license": "gpl-2.0",
"size": 15518
}
|
[
"com.anji.nn.ActivationFunctionType"
] |
import com.anji.nn.ActivationFunctionType;
|
import com.anji.nn.*;
|
[
"com.anji.nn"
] |
com.anji.nn;
| 378,635
|
public static DaoSession newDevSession(Context context, String name) {
Database db = new DevOpenHelper(context, name).getWritableDb();
DaoMaster daoMaster = new DaoMaster(db);
return daoMaster.newSession();
}
public DaoMaster(SQLiteDatabase db) {
this(new StandardDatabase(db));
}
public DaoMaster(Database db) {
super(db, SCHEMA_VERSION);
registerDaoClass(TextMessageDao.class);
}
|
static DaoSession function(Context context, String name) { Database db = new DevOpenHelper(context, name).getWritableDb(); DaoMaster daoMaster = new DaoMaster(db); return daoMaster.newSession(); } public DaoMaster(SQLiteDatabase db) { this(new StandardDatabase(db)); } public DaoMaster(Database db) { super(db, SCHEMA_VERSION); registerDaoClass(TextMessageDao.class); }
|
/**
* WARNING: Drops all table on Upgrade! Use only during development.
* Convenience method using a {@link DevOpenHelper}.
*/
|
Convenience method using a <code>DevOpenHelper</code>
|
newDevSession
|
{
"repo_name": "adrygll2/literacyapp-chat",
"path": "app/src/main/java/org/literacyapp/chat/dao/DaoMaster.java",
"license": "apache-2.0",
"size": 3266
}
|
[
"android.content.Context",
"android.database.sqlite.SQLiteDatabase",
"org.greenrobot.greendao.database.Database",
"org.greenrobot.greendao.database.StandardDatabase"
] |
import android.content.Context; import android.database.sqlite.SQLiteDatabase; import org.greenrobot.greendao.database.Database; import org.greenrobot.greendao.database.StandardDatabase;
|
import android.content.*; import android.database.sqlite.*; import org.greenrobot.greendao.database.*;
|
[
"android.content",
"android.database",
"org.greenrobot.greendao"
] |
android.content; android.database; org.greenrobot.greendao;
| 2,530,019
|
protected void verifyAlerts(final WebDriver driver, final String... expectedAlerts) throws Exception {
verifyAlerts(DEFAULT_WAIT_TIME, driver, expectedAlerts);
}
|
void function(final WebDriver driver, final String... expectedAlerts) throws Exception { verifyAlerts(DEFAULT_WAIT_TIME, driver, expectedAlerts); }
|
/**
* Verifies the captured alerts.
* @param driver the driver instance
* @param expectedAlerts the expected alerts
* @throws Exception in case of failure
*/
|
Verifies the captured alerts
|
verifyAlerts
|
{
"repo_name": "SeleniumHQ/htmlunit-driver",
"path": "src/test/java/org/openqa/selenium/htmlunit/WebDriverTestCase.java",
"license": "apache-2.0",
"size": 68814
}
|
[
"org.openqa.selenium.WebDriver"
] |
import org.openqa.selenium.WebDriver;
|
import org.openqa.selenium.*;
|
[
"org.openqa.selenium"
] |
org.openqa.selenium;
| 1,077,628
|
protected void setupGL (javax.microedition.khronos.opengles.GL10 gl) {
String versionString = gl.glGetString(GL10.GL_VERSION);
String vendorString = gl.glGetString(GL10.GL_VENDOR);
String rendererString = gl.glGetString(GL10.GL_RENDERER);
glVersion = new GLVersion(Application.ApplicationType.Android, versionString, vendorString, rendererString);
if (config.useGL30 && glVersion.getMajorVersion() > 2) {
if (gl30 != null) return;
gl20 = gl30 = new AndroidGL30();
Gdx.gl = gl30;
Gdx.gl20 = gl30;
Gdx.gl30 = gl30;
} else {
if (gl20 != null) return;
gl20 = new AndroidGL20();
Gdx.gl = gl20;
Gdx.gl20 = gl20;
}
Gdx.app.log(LOG_TAG, "OGL renderer: " + gl.glGetString(GL10.GL_RENDERER));
Gdx.app.log(LOG_TAG, "OGL vendor: " + gl.glGetString(GL10.GL_VENDOR));
Gdx.app.log(LOG_TAG, "OGL version: " + gl.glGetString(GL10.GL_VERSION));
Gdx.app.log(LOG_TAG, "OGL extensions: " + gl.glGetString(GL10.GL_EXTENSIONS));
}
|
void function (javax.microedition.khronos.opengles.GL10 gl) { String versionString = gl.glGetString(GL10.GL_VERSION); String vendorString = gl.glGetString(GL10.GL_VENDOR); String rendererString = gl.glGetString(GL10.GL_RENDERER); glVersion = new GLVersion(Application.ApplicationType.Android, versionString, vendorString, rendererString); if (config.useGL30 && glVersion.getMajorVersion() > 2) { if (gl30 != null) return; gl20 = gl30 = new AndroidGL30(); Gdx.gl = gl30; Gdx.gl20 = gl30; Gdx.gl30 = gl30; } else { if (gl20 != null) return; gl20 = new AndroidGL20(); Gdx.gl = gl20; Gdx.gl20 = gl20; } Gdx.app.log(LOG_TAG, STR + gl.glGetString(GL10.GL_RENDERER)); Gdx.app.log(LOG_TAG, STR + gl.glGetString(GL10.GL_VENDOR)); Gdx.app.log(LOG_TAG, STR + gl.glGetString(GL10.GL_VERSION)); Gdx.app.log(LOG_TAG, STR + gl.glGetString(GL10.GL_EXTENSIONS)); }
|
/** This instantiates the GL10, GL11 and GL20 instances. Includes the check for certain devices that pretend to support GL11 but
* fuck up vertex buffer objects. This includes the pixelflinger which segfaults when buffers are deleted as well as the
* Motorola CLIQ and the Samsung Behold II.
*
* @param gl */
|
This instantiates the GL10, GL11 and GL20 instances. Includes the check for certain devices that pretend to support GL11 but fuck up vertex buffer objects. This includes the pixelflinger which segfaults when buffers are deleted as well as the Motorola CLIQ and the Samsung Behold II
|
setupGL
|
{
"repo_name": "MikkelTAndersen/libgdx",
"path": "backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidGraphics.java",
"license": "apache-2.0",
"size": 22461
}
|
[
"com.badlogic.gdx.Application",
"com.badlogic.gdx.Gdx",
"com.badlogic.gdx.graphics.glutils.GLVersion"
] |
import com.badlogic.gdx.Application; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.glutils.GLVersion;
|
import com.badlogic.gdx.*; import com.badlogic.gdx.graphics.glutils.*;
|
[
"com.badlogic.gdx"
] |
com.badlogic.gdx;
| 2,250,431
|
public List<Object> stepsInstances(List<CandidateSteps> candidateSteps) {
List<Object> instances = new ArrayList<>();
for (CandidateSteps steps : candidateSteps) {
if (steps instanceof Steps) {
instances.add(((Steps) steps).instance());
}
}
return instances;
}
/**
* Collects a list of step candidates from {@link CandidateSteps} instances.
*
* @param candidateSteps
* the list {@link CandidateSteps} instances
* @return A List of {@link StepCandidate}
|
List<Object> function(List<CandidateSteps> candidateSteps) { List<Object> instances = new ArrayList<>(); for (CandidateSteps steps : candidateSteps) { if (steps instanceof Steps) { instances.add(((Steps) steps).instance()); } } return instances; } /** * Collects a list of step candidates from {@link CandidateSteps} instances. * * @param candidateSteps * the list {@link CandidateSteps} instances * @return A List of {@link StepCandidate}
|
/**
* Returns the steps instances associated to CandidateSteps
*
* @param candidateSteps
* the List of CandidateSteps
* @return The List of steps instances
*/
|
Returns the steps instances associated to CandidateSteps
|
stepsInstances
|
{
"repo_name": "valfirst/jbehave-core",
"path": "jbehave-core/src/main/java/org/jbehave/core/steps/StepFinder.java",
"license": "bsd-3-clause",
"size": 8967
}
|
[
"java.util.ArrayList",
"java.util.List"
] |
import java.util.ArrayList; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,297,488
|
@Deprecated
public static void setKualiForm(KualiForm kualiForm) {
kualiForms.set(kualiForm);
}
|
static void function(KualiForm kualiForm) { kualiForms.set(kualiForm); }
|
/**
* sets the kualiForm object into the global variable for this thread
*
* @param kualiForm
*/
|
sets the kualiForm object into the global variable for this thread
|
setKualiForm
|
{
"repo_name": "ricepanda/rice-git2",
"path": "rice-middleware/kns/src/main/java/org/kuali/rice/kns/util/KNSGlobalVariables.java",
"license": "apache-2.0",
"size": 2476
}
|
[
"org.kuali.rice.kns.web.struts.form.KualiForm"
] |
import org.kuali.rice.kns.web.struts.form.KualiForm;
|
import org.kuali.rice.kns.web.struts.form.*;
|
[
"org.kuali.rice"
] |
org.kuali.rice;
| 1,856,791
|
public void init(String contextName, ContextFactory factory)
{
this.contextName = contextName;
this.factory = factory;
}
|
void function(String contextName, ContextFactory factory) { this.contextName = contextName; this.factory = factory; }
|
/**
* Initializes the context.
*/
|
Initializes the context
|
init
|
{
"repo_name": "daniarherikurniawan/Chameleon512",
"path": "src/core/org/apache/hadoop/metrics/spi/AbstractMetricsContext.java",
"license": "apache-2.0",
"size": 13080
}
|
[
"org.apache.hadoop.metrics.ContextFactory"
] |
import org.apache.hadoop.metrics.ContextFactory;
|
import org.apache.hadoop.metrics.*;
|
[
"org.apache.hadoop"
] |
org.apache.hadoop;
| 383,403
|
@SuppressWarnings({"CatchGenericClass"})
private void notifyLifecycleBeansEx(LifecycleEventType evt) {
try {
notifyLifecycleBeans(evt);
}
// Catch generic throwable to secure against user assertions.
catch (Throwable e) {
U.error(log, "Failed to notify lifecycle bean (safely ignored) [evt=" + evt +
(gridName == null ? "" : ", gridName=" + gridName) + ']', e);
if (e instanceof Error)
throw (Error)e;
}
}
|
@SuppressWarnings({STR}) void function(LifecycleEventType evt) { try { notifyLifecycleBeans(evt); } catch (Throwable e) { U.error(log, STR + evt + (gridName == null ? STR, gridName=" + gridName) + ']', e); if (e instanceof Error) throw (Error)e; } }
|
/**
* Notifies life-cycle beans of grid event.
*
* @param evt Grid event.
*/
|
Notifies life-cycle beans of grid event
|
notifyLifecycleBeansEx
|
{
"repo_name": "leveyj/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java",
"license": "apache-2.0",
"size": 119446
}
|
[
"org.apache.ignite.internal.util.typedef.internal.U",
"org.apache.ignite.lifecycle.LifecycleEventType"
] |
import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lifecycle.LifecycleEventType;
|
import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.lifecycle.*;
|
[
"org.apache.ignite"
] |
org.apache.ignite;
| 2,910,818
|
public Object methodException(Context context, Class claz, String method, Exception e, Info info)
{
boolean showTemplateInfo = rs.getBoolean(SHOW_TEMPLATE_INFO, false);
boolean showStackTrace = rs.getBoolean(SHOW_STACK_TRACE,false);
StringBuilder st = new StringBuilder();
st.append("Exception while executing method ").append(claz.toString()).append(".").append(method);
st.append(": ").append(e.getClass().getName()).append(": ").append(e.getMessage());
if (showTemplateInfo)
{
st.append(" at ").append(info.getTemplateName()).append(" (line ").append(info.getLine()).append(", column ").append(info.getColumn()).append(")");
}
if (showStackTrace)
{
st.append(System.lineSeparator()).append(getStackTrace(e));
}
return st.toString();
}
|
Object function(Context context, Class claz, String method, Exception e, Info info) { boolean showTemplateInfo = rs.getBoolean(SHOW_TEMPLATE_INFO, false); boolean showStackTrace = rs.getBoolean(SHOW_STACK_TRACE,false); StringBuilder st = new StringBuilder(); st.append(STR).append(claz.toString()).append(".").append(method); st.append(STR).append(e.getClass().getName()).append(STR).append(e.getMessage()); if (showTemplateInfo) { st.append(STR).append(info.getTemplateName()).append(STR).append(info.getLine()).append(STR).append(info.getColumn()).append(")"); } if (showStackTrace) { st.append(System.lineSeparator()).append(getStackTrace(e)); } return st.toString(); }
|
/**
* Render the method exception, and optionally the exception message and stack trace.
*
* @param context current context
* @param claz the class of the object the method is being applied to
* @param method the method
* @param e the thrown exception
* @param info template name and line, column informations
* @return an object to insert in the page
*/
|
Render the method exception, and optionally the exception message and stack trace
|
methodException
|
{
"repo_name": "apache/velocity-engine",
"path": "velocity-engine-core/src/main/java/org/apache/velocity/app/event/implement/PrintExceptions.java",
"license": "apache-2.0",
"size": 4363
}
|
[
"org.apache.velocity.context.Context",
"org.apache.velocity.util.introspection.Info"
] |
import org.apache.velocity.context.Context; import org.apache.velocity.util.introspection.Info;
|
import org.apache.velocity.context.*; import org.apache.velocity.util.introspection.*;
|
[
"org.apache.velocity"
] |
org.apache.velocity;
| 31,295
|
public static Document generateProblem (boolean soft, int nbrNodes, double density, double tightness, int nbrColors, int nbrStochNodes, boolean intensional) {
GraphColoring instance = new GraphColoring (nbrNodes, density, tightness, nbrColors, nbrStochNodes, false);
return instance.toXCSP(false, soft, intensional);
}
final public Graph graph;
final public TreeMap< String, ArrayList<Integer> > unaryCons;
final public int nbrColors;
final private HashSet<String> stochNodes;
private final String instanceName;
private double targetDensity = -1;
private final double targetTightness;
public GraphColoring (int nbrNodes, double density, final double tightness, final int nbrColors, int nbrStochNodes, boolean nbrLinks) {
this(nbrLinks ? RandGraphFactory.getSizedRandGraph(nbrNodes, (int) (density * nbrNodes), 0) :
RandGraphFactory.getSizedRandGraph(nbrNodes, (int) (density * nbrNodes * (nbrNodes - 1) / 2.0), 0),
tightness, nbrColors, nbrStochNodes);
this.targetDensity = density;
}
public GraphColoring (Graph graph, final double tightness, final int nbrColors, final int nbrStochNodes) {
this.graph = graph;
this.targetTightness = tightness;
this.nbrColors = nbrColors;
this.instanceName = "graphColoring_" + System.currentTimeMillis();
// The first nbrStochNodes nodes are selected as the uncontrollable ones
this.stochNodes = new HashSet<String> ();
for (int i = 0; i < nbrStochNodes; i++)
this.stochNodes.add(graph.nodes.get(i));
this.unaryCons = new TreeMap< String, ArrayList<Integer> > ();
if (tightness > 0) { // generate the unary constraints
for (String n : this.graph.nodes) {
if (this.stochNodes.contains(n)) // skip uncontrollable nodes
continue;
ArrayList<Integer> colors = new ArrayList<Integer> (nbrColors);
for (int i = 0; i < nbrColors; i++)
if (Math.random() <= tightness)
colors.add(i);
if (! colors.isEmpty() )
this.unaryCons.put(n, colors);
}
}
}
|
static Document function (boolean soft, int nbrNodes, double density, double tightness, int nbrColors, int nbrStochNodes, boolean intensional) { GraphColoring instance = new GraphColoring (nbrNodes, density, tightness, nbrColors, nbrStochNodes, false); return instance.toXCSP(false, soft, intensional); } final public Graph graph; final public TreeMap< String, ArrayList<Integer> > unaryCons; final public int nbrColors; final private HashSet<String> stochNodes; private final String instanceName; private double targetDensity = -1; private final double targetTightness; public GraphColoring (int nbrNodes, double density, final double tightness, final int nbrColors, int nbrStochNodes, boolean nbrLinks) { this(nbrLinks ? RandGraphFactory.getSizedRandGraph(nbrNodes, (int) (density * nbrNodes), 0) : RandGraphFactory.getSizedRandGraph(nbrNodes, (int) (density * nbrNodes * (nbrNodes - 1) / 2.0), 0), tightness, nbrColors, nbrStochNodes); this.targetDensity = density; } public GraphColoring (Graph graph, final double tightness, final int nbrColors, final int nbrStochNodes) { this.graph = graph; this.targetTightness = tightness; this.nbrColors = nbrColors; this.instanceName = STR + System.currentTimeMillis(); this.stochNodes = new HashSet<String> (); for (int i = 0; i < nbrStochNodes; i++) this.stochNodes.add(graph.nodes.get(i)); this.unaryCons = new TreeMap< String, ArrayList<Integer> > (); if (tightness > 0) { for (String n : this.graph.nodes) { if (this.stochNodes.contains(n)) continue; ArrayList<Integer> colors = new ArrayList<Integer> (nbrColors); for (int i = 0; i < nbrColors; i++) if (Math.random() <= tightness) colors.add(i); if (! colors.isEmpty() ) this.unaryCons.put(n, colors); } } }
|
/** Generates a problem instance
* @param soft whether to make it a DisCSP (\c false) or a Max-DisCSP (\c true)
* @param nbrNodes total number of nodes
* @param density graph density
* @param tightness the tightness of the unary constraints
* @param nbrColors number of colors
* @param nbrStochNodes number of uncontrollable nodes
* @param intensional whether the output should be intensional
* @return a problem instance
*/
|
Generates a problem instance
|
generateProblem
|
{
"repo_name": "heniancheng/FRODO",
"path": "src/frodo2/benchmarks/graphcoloring/GraphColoring.java",
"license": "agpl-3.0",
"size": 17740
}
|
[
"java.util.ArrayList",
"java.util.HashSet",
"java.util.TreeMap",
"org.jdom2.Document"
] |
import java.util.ArrayList; import java.util.HashSet; import java.util.TreeMap; import org.jdom2.Document;
|
import java.util.*; import org.jdom2.*;
|
[
"java.util",
"org.jdom2"
] |
java.util; org.jdom2;
| 1,084,704
|
@Override
public void handleEvent( SelectionKey key )
{
if ( key.isValid () && key.isReadable () )
{
processRead();
}
if ( key.isValid () && key.isWritable () )
{
processWrite();
}
}
|
void function( SelectionKey key ) { if ( key.isValid () && key.isReadable () ) { processRead(); } if ( key.isValid () && key.isWritable () ) { processWrite(); } }
|
/**
* Handle IO event.
*/
|
Handle IO event
|
handleEvent
|
{
"repo_name": "channelaccess/ca",
"path": "src/main/java/org/epics/ca/impl/TcpTransport.java",
"license": "gpl-3.0",
"size": 26309
}
|
[
"java.nio.channels.SelectionKey"
] |
import java.nio.channels.SelectionKey;
|
import java.nio.channels.*;
|
[
"java.nio"
] |
java.nio;
| 2,584,337
|
public int updateUpload(OCUpload ocUpload) {
Log_OC.v(TAG, "Updating " + ocUpload.getLocalPath() + " with status=" + ocUpload.getUploadStatus());
ContentValues cv = new ContentValues();
cv.put(ProviderTableMeta.UPLOADS_LOCAL_PATH, ocUpload.getLocalPath());
cv.put(ProviderTableMeta.UPLOADS_REMOTE_PATH, ocUpload.getRemotePath());
cv.put(ProviderTableMeta.UPLOADS_ACCOUNT_NAME, ocUpload.getAccountName());
cv.put(ProviderTableMeta.UPLOADS_STATUS, ocUpload.getUploadStatus().value);
cv.put(ProviderTableMeta.UPLOADS_LAST_RESULT, ocUpload.getLastResult().getValue());
cv.put(ProviderTableMeta.UPLOADS_UPLOAD_END_TIMESTAMP, ocUpload.getUploadEndTimestamp());
cv.put(ProviderTableMeta.UPLOADS_FILE_SIZE, ocUpload.getFileSize());
int result = getDB().update(ProviderTableMeta.CONTENT_URI_UPLOADS,
cv,
ProviderTableMeta._ID + "=?",
new String[]{String.valueOf(ocUpload.getUploadId())}
);
Log_OC.d(TAG, "updateUpload returns with: " + result + " for file: " + ocUpload.getLocalPath());
if (result != 1) {
Log_OC.e(TAG, "Failed to update item " + ocUpload.getLocalPath() + " into upload db.");
} else {
notifyObserversNow();
}
return result;
}
|
int function(OCUpload ocUpload) { Log_OC.v(TAG, STR + ocUpload.getLocalPath() + STR + ocUpload.getUploadStatus()); ContentValues cv = new ContentValues(); cv.put(ProviderTableMeta.UPLOADS_LOCAL_PATH, ocUpload.getLocalPath()); cv.put(ProviderTableMeta.UPLOADS_REMOTE_PATH, ocUpload.getRemotePath()); cv.put(ProviderTableMeta.UPLOADS_ACCOUNT_NAME, ocUpload.getAccountName()); cv.put(ProviderTableMeta.UPLOADS_STATUS, ocUpload.getUploadStatus().value); cv.put(ProviderTableMeta.UPLOADS_LAST_RESULT, ocUpload.getLastResult().getValue()); cv.put(ProviderTableMeta.UPLOADS_UPLOAD_END_TIMESTAMP, ocUpload.getUploadEndTimestamp()); cv.put(ProviderTableMeta.UPLOADS_FILE_SIZE, ocUpload.getFileSize()); int result = getDB().update(ProviderTableMeta.CONTENT_URI_UPLOADS, cv, ProviderTableMeta._ID + "=?", new String[]{String.valueOf(ocUpload.getUploadId())} ); Log_OC.d(TAG, STR + result + STR + ocUpload.getLocalPath()); if (result != 1) { Log_OC.e(TAG, STR + ocUpload.getLocalPath() + STR); } else { notifyObserversNow(); } return result; }
|
/**
* Update an upload object in DB.
*
* @param ocUpload Upload object with state to update
* @return num of updated uploads.
*/
|
Update an upload object in DB
|
updateUpload
|
{
"repo_name": "jsrck/android",
"path": "src/main/java/com/owncloud/android/datamodel/UploadsStorageManager.java",
"license": "gpl-2.0",
"size": 24071
}
|
[
"android.content.ContentValues",
"com.owncloud.android.db.OCUpload",
"com.owncloud.android.db.ProviderMeta"
] |
import android.content.ContentValues; import com.owncloud.android.db.OCUpload; import com.owncloud.android.db.ProviderMeta;
|
import android.content.*; import com.owncloud.android.db.*;
|
[
"android.content",
"com.owncloud.android"
] |
android.content; com.owncloud.android;
| 1,233,072
|
void refreshToken(HttpServletResponse response, String value, String userId, String tokenType) {
String[] parts = StringUtils.split(value, "@");
if (parts != null && parts.length == 5) {
long cookieTime = Long.parseLong(parts[1].substring(1));
if (System.currentTimeMillis() + (ttl / 2) > cookieTime) {
if ( debugCookies) {
LOG.info("Refreshing Token for {} cookieTime {} ttl {} CurrentTime {} ",new Object[]{userId, cookieTime, ttl, System.currentTimeMillis()});
}
addCookie(response, userId, tokenType);
}
}
}
|
void refreshToken(HttpServletResponse response, String value, String userId, String tokenType) { String[] parts = StringUtils.split(value, "@"); if (parts != null && parts.length == 5) { long cookieTime = Long.parseLong(parts[1].substring(1)); if (System.currentTimeMillis() + (ttl / 2) > cookieTime) { if ( debugCookies) { LOG.info(STR,new Object[]{userId, cookieTime, ttl, System.currentTimeMillis()}); } addCookie(response, userId, tokenType); } } }
|
/**
* Refresh the token, assumes that the cookie is valid.
*
* @param req
* @param value
* @param userId
* @param tokenType
*/
|
Refresh the token, assumes that the cookie is valid
|
refreshToken
|
{
"repo_name": "dylanswartz/nakamura",
"path": "bundles/trustedauth/src/main/java/org/sakaiproject/nakamura/auth/trusted/TrustedTokenServiceImpl.java",
"license": "apache-2.0",
"size": 22953
}
|
[
"javax.servlet.http.HttpServletResponse",
"org.apache.commons.lang.StringUtils"
] |
import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang.StringUtils;
|
import javax.servlet.http.*; import org.apache.commons.lang.*;
|
[
"javax.servlet",
"org.apache.commons"
] |
javax.servlet; org.apache.commons;
| 1,515,373
|
private void symbol() throws SugarImporterException
{
if ( this.m_cToken == '?' || this.m_cToken == '-' )
{
this.nextToken();
}
else
{
int t_iDigit = (int) this.m_cToken;;
if ( t_iDigit > 47 && t_iDigit < 58 )
{
this.number();
}
else
{
this.character();
}
}
}
|
void function() throws SugarImporterException { if ( this.m_cToken == '?' this.m_cToken == '-' ) { this.nextToken(); } else { int t_iDigit = (int) this.m_cToken;; if ( t_iDigit > 47 && t_iDigit < 58 ) { this.number(); } else { this.character(); } } }
|
/**
* symbol ::= character | "?" | "-" | number
* @throws SugarImporterException
*/
|
symbol ::= character | "?" | "-" | number
|
symbol
|
{
"repo_name": "glycoinfo/eurocarbdb",
"path": "application/MolecularFramework/src/org/eurocarbdb/MolecularFramework/io/iupac/SugarImporterIupacCondenced.java",
"license": "gpl-3.0",
"size": 11561
}
|
[
"org.eurocarbdb.MolecularFramework"
] |
import org.eurocarbdb.MolecularFramework;
|
import org.eurocarbdb.*;
|
[
"org.eurocarbdb"
] |
org.eurocarbdb;
| 2,457,516
|
public static YearRange currentYear() {
return new YearRange(LocalDate.now().getYear(), LocalDate.now().getYear());
}
|
static YearRange function() { return new YearRange(LocalDate.now().getYear(), LocalDate.now().getYear()); }
|
/**
* Just the current year
*
* @return
*/
|
Just the current year
|
currentYear
|
{
"repo_name": "jochen777/jFormchecker",
"path": "src/main/java/de/jformchecker/elements/DateInputSelectCompound.java",
"license": "mit",
"size": 7393
}
|
[
"java.time.LocalDate"
] |
import java.time.LocalDate;
|
import java.time.*;
|
[
"java.time"
] |
java.time;
| 2,124,812
|
static public byte[] getTransferEnd() {
logger.debug("Creating command message TRANSFER_END version 1");
ByteArrayOutputStream outputData = new ByteArrayOutputStream();
outputData.write(COMMAND_CLASS_KEY);
outputData.write(TRANSFER_END);
return outputData.toByteArray();
}
|
static byte[] function() { logger.debug(STR); ByteArrayOutputStream outputData = new ByteArrayOutputStream(); outputData.write(COMMAND_CLASS_KEY); outputData.write(TRANSFER_END); return outputData.toByteArray(); }
|
/**
* Creates a new message with the TRANSFER_END command.
* <p>
* Transfer End
* <p>
* SDS10264-2
*
* @return the {@link byte[]} array with the command to send
*/
|
Creates a new message with the TRANSFER_END command. Transfer End SDS10264-2
|
getTransferEnd
|
{
"repo_name": "zsmartsystems/com.zsmartsystems.zwave",
"path": "com.zsmartsystems.zwave/src/main/java/com/zsmartsystems/zwave/commandclass/impl/ZwaveCmdClassV1.java",
"license": "epl-1.0",
"size": 64368
}
|
[
"java.io.ByteArrayOutputStream"
] |
import java.io.ByteArrayOutputStream;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 561,343
|
@Bean
public SerializationConfig serializationConfig(ObjectMapper objectMapper) {
return objectMapper.getSerializationConfig();
}
|
SerializationConfig function(ObjectMapper objectMapper) { return objectMapper.getSerializationConfig(); }
|
/**
* Ensures that the {@link SerializationConfig} provided by our
* {@link ObjectMapper} bean is used throughout the application.
*/
|
Ensures that the <code>SerializationConfig</code> provided by our <code>ObjectMapper</code> bean is used throughout the application
|
serializationConfig
|
{
"repo_name": "gratiartis/qzr",
"path": "qzr-web/src/main/java/com/sctrcd/qzr/Qzr.java",
"license": "apache-2.0",
"size": 3577
}
|
[
"com.fasterxml.jackson.databind.ObjectMapper",
"com.fasterxml.jackson.databind.SerializationConfig"
] |
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationConfig;
|
import com.fasterxml.jackson.databind.*;
|
[
"com.fasterxml.jackson"
] |
com.fasterxml.jackson;
| 652,379
|
public void teleport(MinecraftServer server, int sourceDim, int targetDim, double xCoord, double yCoord, double zCoord, float yaw, float pitch, Vector3d motion) {
entity.removePassengers();
entity = handleEntityTeleport(entity, server, sourceDim, targetDim, xCoord, yCoord, zCoord, yaw, pitch, motion);
for (PassengerTeleporter passenger : passengers) {
passenger.teleport(server, sourceDim, targetDim, xCoord, yCoord, zCoord, yaw, pitch, motion);
}
}
|
void function(MinecraftServer server, int sourceDim, int targetDim, double xCoord, double yCoord, double zCoord, float yaw, float pitch, Vector3d motion) { entity.removePassengers(); entity = handleEntityTeleport(entity, server, sourceDim, targetDim, xCoord, yCoord, zCoord, yaw, pitch, motion); for (PassengerTeleporter passenger : passengers) { passenger.teleport(server, sourceDim, targetDim, xCoord, yCoord, zCoord, yaw, pitch, motion); } }
|
/**
* Recursively teleports the entity and all of its passengers after dismounting them.
* @param server The minecraft server.
* @param sourceDim The source dimension.
* @param targetDim The target dimension.
* @param xCoord The target x position.
* @param yCoord The target y position.
* @param zCoord The target z position.
* @param yaw The target yaw.
* @param pitch The target pitch.
*/
|
Recursively teleports the entity and all of its passengers after dismounting them
|
teleport
|
{
"repo_name": "Alec-WAM/CrystalMod",
"path": "src/main/java/alec_wam/CrystalMod/util/TeleportUtil.java",
"license": "mit",
"size": 12793
}
|
[
"net.minecraft.server.MinecraftServer"
] |
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.*;
|
[
"net.minecraft.server"
] |
net.minecraft.server;
| 1,211,356
|
private double getMaxCount(Map<Character, Double> frequencies) {
double maxCount = 0;
for (char alphabetSymbol : frequencies.keySet()) {
maxCount = Math.max(maxCount, frequencies.get(alphabetSymbol));
}
return maxCount;
}
|
double function(Map<Character, Double> frequencies) { double maxCount = 0; for (char alphabetSymbol : frequencies.keySet()) { maxCount = Math.max(maxCount, frequencies.get(alphabetSymbol)); } return maxCount; }
|
/**
* Search for the alphabet symbol that is most frequent in a column
* of an alignment.
*
* @param frequencies are the counts calculated for a given column
* @return the number of counts of the most common symbol.
*/
|
Search for the alphabet symbol that is most frequent in a column of an alignment
|
getMaxCount
|
{
"repo_name": "javieriserte/bioUtils",
"path": "src/seqManipulation/gapstripper/MaximumFrequencyProfiler.java",
"license": "gpl-3.0",
"size": 1680
}
|
[
"java.util.Map"
] |
import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,157,526
|
public Map<String, List<Integer>> getAllItemIdIndexMap() {
// No user context present
if (getScratchMap() == null) {
return createItemIdIndexMap(false);
}
Map<String, List<Integer>> map = (Map<String, List<Integer>>) getScratchMap().get(ALL_IDS_TO_INDEX_SCRATCH_MAP_KEY);
if (map == null) {
map = createItemIdIndexMap(false);
getScratchMap().put(ALL_IDS_TO_INDEX_SCRATCH_MAP_KEY, map);
}
return map;
}
|
Map<String, List<Integer>> function() { if (getScratchMap() == null) { return createItemIdIndexMap(false); } Map<String, List<Integer>> map = (Map<String, List<Integer>>) getScratchMap().get(ALL_IDS_TO_INDEX_SCRATCH_MAP_KEY); if (map == null) { map = createItemIdIndexMap(false); getScratchMap().put(ALL_IDS_TO_INDEX_SCRATCH_MAP_KEY, map); } return map; }
|
/**
* Map all item idsin the model to their row index. As this can be expensive save the map onto the scratch pad.
* <p>
* This can be very expensive and should be avoided. This will load all the nodes in a tree (including those already
* not expanded).
* </p>
*
* @return the map between the all the item ids in the tree model and row indexes
*/
|
Map all item idsin the model to their row index. As this can be expensive save the map onto the scratch pad. This can be very expensive and should be avoided. This will load all the nodes in a tree (including those already not expanded).
|
getAllItemIdIndexMap
|
{
"repo_name": "Joshua-Barclay/wcomponents",
"path": "wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTree.java",
"license": "gpl-3.0",
"size": 39637
}
|
[
"java.util.List",
"java.util.Map"
] |
import java.util.List; import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,073,676
|
@Generated
@Selector("didSelectMessage:conversation:")
public native void didSelectMessageConversation(MSMessage message, MSConversation conversation);
|
@Selector(STR) native void function(MSMessage message, MSConversation conversation);
|
/**
* didSelectMessage:conversation:
* <p>
* Informs the extension that a new message has been selected in the conversation.
* <p>
* This method will not be called when the `presentationStyle` is `MSMessagesAppPresentationStyleTranscript` or the `presentationContext` is `MSMessagesAppPresentationContextMedia`.
*
* @param message The message selected.
* @param conversation The conversation.
*/
|
didSelectMessage:conversation: Informs the extension that a new message has been selected in the conversation. This method will not be called when the `presentationStyle` is `MSMessagesAppPresentationStyleTranscript` or the `presentationContext` is `MSMessagesAppPresentationContextMedia`
|
didSelectMessageConversation
|
{
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/messages/MSMessagesAppViewController.java",
"license": "apache-2.0",
"size": 13145
}
|
[
"org.moe.natj.objc.ann.Selector"
] |
import org.moe.natj.objc.ann.Selector;
|
import org.moe.natj.objc.ann.*;
|
[
"org.moe.natj"
] |
org.moe.natj;
| 974,958
|
Variable[] gen = solution.getDecisionVariables();
Vector<Double> x = new Vector<Double>(numberOfVariables_) ;
Vector<Double> y = new Vector<Double>(numberOfObjectives_);
for (int i = 0; i < numberOfVariables_; i++) {
x.addElement(gen[i].getValue());
y.addElement(0.0) ;
} // for
LZ09_.objective(x, y) ;
for (int i = 0; i < numberOfObjectives_; i++)
solution.setObjective(i, y.get(i));
} // evaluate
|
Variable[] gen = solution.getDecisionVariables(); Vector<Double> x = new Vector<Double>(numberOfVariables_) ; Vector<Double> y = new Vector<Double>(numberOfObjectives_); for (int i = 0; i < numberOfVariables_; i++) { x.addElement(gen[i].getValue()); y.addElement(0.0) ; } LZ09_.objective(x, y) ; for (int i = 0; i < numberOfObjectives_; i++) solution.setObjective(i, y.get(i)); }
|
/**
* Evaluates a solution
* @param solution The solution to evaluate
* @throws JMException
*/
|
Evaluates a solution
|
evaluate
|
{
"repo_name": "JerryI00/releasing-codes-java",
"path": "src/jmetal/problems/LZ09/LZ09_F2.java",
"license": "gpl-3.0",
"size": 3449
}
|
[
"java.util.Vector"
] |
import java.util.Vector;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 681,591
|
//-----------------------------------------------------------------------
private void writeObject(final ObjectOutputStream out) throws IOException {
out.defaultWriteObject();
out.writeObject(decorated());
}
|
void function(final ObjectOutputStream out) throws IOException { out.defaultWriteObject(); out.writeObject(decorated()); }
|
/**
* Write the collection out using a custom routine.
*
* @param out the output stream
* @throws IOException if an I/O error occurs while writing to the output stream
*/
|
Write the collection out using a custom routine
|
writeObject
|
{
"repo_name": "mohanaraosv/commons-collections",
"path": "src/main/java/org/apache/commons/collections4/queue/UnmodifiableQueue.java",
"license": "apache-2.0",
"size": 4976
}
|
[
"java.io.IOException",
"java.io.ObjectOutputStream"
] |
import java.io.IOException; import java.io.ObjectOutputStream;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,387,156
|
public Serializable getParam4()
{
return getParams()[3];
}
|
Serializable function() { return getParams()[3]; }
|
/**
* Returns the receiver's fourth parameter.
*
* @return The parameter.
*/
|
Returns the receiver's fourth parameter
|
getParam4
|
{
"repo_name": "nagyist/marketcetera",
"path": "trunk/util/src/main/java/org/marketcetera/util/log/I18NBoundMessage5P.java",
"license": "apache-2.0",
"size": 2082
}
|
[
"java.io.Serializable"
] |
import java.io.Serializable;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 557,278
|
public void setCharSet(PDFObject charSet) {
this.charSet = charSet;
}
|
void function(PDFObject charSet) { this.charSet = charSet; }
|
/** Setter for property charSet.
* @param charSet New value of property charSet.
*
*/
|
Setter for property charSet
|
setCharSet
|
{
"repo_name": "erpragatisingh/androidTraining",
"path": "Android_6_weekTraning/AndroidPdfViewer/src/com/sun/pdfview/font/PDFFontDescriptor.java",
"license": "gpl-2.0",
"size": 14632
}
|
[
"com.sun.pdfview.PDFObject"
] |
import com.sun.pdfview.PDFObject;
|
import com.sun.pdfview.*;
|
[
"com.sun.pdfview"
] |
com.sun.pdfview;
| 2,383,023
|
@SuppressWarnings({"unchecked"})
public static <T> T getInstance(String propertyName, T defaultValue, Properties properties) {
String className = getString(propertyName, null, properties);
if (className == null) {
return defaultValue;
}
return (T) ReflectionUtils.createInstanceOfType(className, false);
}
|
@SuppressWarnings({STR}) static <T> T function(String propertyName, T defaultValue, Properties properties) { String className = getString(propertyName, null, properties); if (className == null) { return defaultValue; } return (T) ReflectionUtils.createInstanceOfType(className, false); }
|
/**
* Gets an instance of the type specified by the property with the given name. If no such property is found, the
* value is empty, the given default value is returned. If the instance cannot be created an exception will be raised.
*
* @param propertyName The name, not null
* @param defaultValue The default value
* @param properties The properties, not null
* @return The instance value, not null
*/
|
Gets an instance of the type specified by the property with the given name. If no such property is found, the value is empty, the given default value is returned. If the instance cannot be created an exception will be raised
|
getInstance
|
{
"repo_name": "DbMaintain/dbmaintain",
"path": "dbmaintain/src/main/java/org/dbmaintain/config/PropertyUtils.java",
"license": "apache-2.0",
"size": 12149
}
|
[
"java.util.Properties",
"org.dbmaintain.util.ReflectionUtils"
] |
import java.util.Properties; import org.dbmaintain.util.ReflectionUtils;
|
import java.util.*; import org.dbmaintain.util.*;
|
[
"java.util",
"org.dbmaintain.util"
] |
java.util; org.dbmaintain.util;
| 2,511,445
|
public double valueToJava2D(double value, Rectangle2D area,
RectangleEdge edge) {
value = this.timeline.toTimelineValue((long) value);
DateRange range = (DateRange) getRange();
double axisMin = this.timeline.toTimelineValue(range.getLowerDate());
double axisMax = this.timeline.toTimelineValue(range.getUpperDate());
double result = 0.0;
if (RectangleEdge.isTopOrBottom(edge)) {
double minX = area.getX();
double maxX = area.getMaxX();
if (isInverted()) {
result = maxX + ((value - axisMin) / (axisMax - axisMin))
* (minX - maxX);
}
else {
result = minX + ((value - axisMin) / (axisMax - axisMin))
* (maxX - minX);
}
}
else if (RectangleEdge.isLeftOrRight(edge)) {
double minY = area.getMinY();
double maxY = area.getMaxY();
if (isInverted()) {
result = minY + (((value - axisMin) / (axisMax - axisMin))
* (maxY - minY));
}
else {
result = maxY - (((value - axisMin) / (axisMax - axisMin))
* (maxY - minY));
}
}
return result;
}
|
double function(double value, Rectangle2D area, RectangleEdge edge) { value = this.timeline.toTimelineValue((long) value); DateRange range = (DateRange) getRange(); double axisMin = this.timeline.toTimelineValue(range.getLowerDate()); double axisMax = this.timeline.toTimelineValue(range.getUpperDate()); double result = 0.0; if (RectangleEdge.isTopOrBottom(edge)) { double minX = area.getX(); double maxX = area.getMaxX(); if (isInverted()) { result = maxX + ((value - axisMin) / (axisMax - axisMin)) * (minX - maxX); } else { result = minX + ((value - axisMin) / (axisMax - axisMin)) * (maxX - minX); } } else if (RectangleEdge.isLeftOrRight(edge)) { double minY = area.getMinY(); double maxY = area.getMaxY(); if (isInverted()) { result = minY + (((value - axisMin) / (axisMax - axisMin)) * (maxY - minY)); } else { result = maxY - (((value - axisMin) / (axisMax - axisMin)) * (maxY - minY)); } } return result; }
|
/**
* Translates the data value to the display coordinates (Java 2D User Space)
* of the chart.
*
* @param value the date to be plotted.
* @param area the rectangle (in Java2D space) where the data is to be
* plotted.
* @param edge the axis location.
*
* @return The coordinate corresponding to the supplied data value.
*/
|
Translates the data value to the display coordinates (Java 2D User Space) of the chart
|
valueToJava2D
|
{
"repo_name": "ibestvina/multithread-centiscape",
"path": "CentiScaPe2.1/src/main/java/org/jfree/chart/axis/DateAxis.java",
"license": "mit",
"size": 66431
}
|
[
"java.awt.geom.Rectangle2D",
"org.jfree.data.time.DateRange",
"org.jfree.ui.RectangleEdge"
] |
import java.awt.geom.Rectangle2D; import org.jfree.data.time.DateRange; import org.jfree.ui.RectangleEdge;
|
import java.awt.geom.*; import org.jfree.data.time.*; import org.jfree.ui.*;
|
[
"java.awt",
"org.jfree.data",
"org.jfree.ui"
] |
java.awt; org.jfree.data; org.jfree.ui;
| 2,456,097
|
@Override
public List<String> getPath() {
LinkedList<String> path = new LinkedList<String>();
RPObject object = getRPObject();
while (object != null) {
// Prepend the items; They'll be in a nice container-slot-content
// order for the server
path.add(0, Integer.toString(object.getID().getObjectID()));
RPSlot slot = object.getContainerSlot();
if (slot != null) {
path.add(0, slot.getName());
}
object = object.getContainer();
}
return path;
}
|
List<String> function() { LinkedList<String> path = new LinkedList<String>(); RPObject object = getRPObject(); while (object != null) { path.add(0, Integer.toString(object.getID().getObjectID())); RPSlot slot = object.getContainerSlot(); if (slot != null) { path.add(0, slot.getName()); } object = object.getContainer(); } return path; }
|
/**
* Get identifier path for the entity.
*
* @return List of object identifiers and slot names that make up the
* complete path to the entity
*/
|
Get identifier path for the entity
|
getPath
|
{
"repo_name": "acsid/stendhal",
"path": "src/games/stendhal/client/entity/Entity.java",
"license": "gpl-2.0",
"size": 16786
}
|
[
"java.util.LinkedList",
"java.util.List"
] |
import java.util.LinkedList; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,205,601
|
Set<Integer> getIds();
|
Set<Integer> getIds();
|
/**
* Returns a {@code Set} of the setting IDs.
* The set's iterator will return the IDs in ascending order.
*/
|
Returns a Set of the setting IDs. The set's iterator will return the IDs in ascending order
|
getIds
|
{
"repo_name": "jle/andy",
"path": "library/src/main/java/com/vandalsoftware/android/spdy/SpdySettingsFrame.java",
"license": "apache-2.0",
"size": 3596
}
|
[
"java.util.Set"
] |
import java.util.Set;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,741,281
|
public List<PackageOverview> advanced(String sessionKey, String luceneQuery)
throws FaultException {
return performSearch(sessionKey, luceneQuery, BaseSearchAction.OPT_FREE_FORM);
}
|
List<PackageOverview> function(String sessionKey, String luceneQuery) throws FaultException { return performSearch(sessionKey, luceneQuery, BaseSearchAction.OPT_FREE_FORM); }
|
/**
* Advanced method to search lucene indexes with a passed in query written in Lucene
* Query Parser syntax. Lucene Query Parser syntax is defined at lucene.apache.org:
* http://lucene.apache.org/java/3_5_0/queryparsersyntax.html
* Fields searchable for Packages:
* name, epoch, version, release, arch, description, summary
* Lucene Query Example: "name:kernel AND version:2.6.18 AND -description:devel"
*
* @param sessionKey The sessionKey for the logged in used
* @param luceneQuery - a search query written in the form of
* Lucene QueryParser Syntax,
* @return the package objects requested
* @throws FaultException A FaultException is thrown on error.
*
* @xmlrpc.doc Advanced method to search lucene indexes with a passed in query written
* in Lucene Query Parser syntax.<br>
* Lucene Query Parser syntax is defined at
* <a href="http://lucene.apache.org/java/3_5_0/queryparsersyntax.html" target="_blank">
* lucene.apache.org</a>.<br>
* Fields searchable for Packages:
* name, epoch, version, release, arch, description, summary<br>
* Lucene Query Example: "name:kernel AND version:2.6.18 AND -description:devel"
* @xmlrpc.param #session_key()
* @xmlrpc.param #param_desc("string", "luceneQuery",
* "a query written in the form of Lucene QueryParser Syntax")
* @xmlrpc.returntype
* #array()
* $PackageOverviewSerializer
* #array_end()
* */
|
Advanced method to search lucene indexes with a passed in query written in Lucene Query Parser syntax. Lucene Query Parser syntax is defined at lucene.apache.org: HREF Fields searchable for Packages: name, epoch, version, release, arch, description, summary Lucene Query Example: "name:kernel AND version:2.6.18 AND -description:devel"
|
advanced
|
{
"repo_name": "mcalmer/spacewalk",
"path": "java/code/src/com/redhat/rhn/frontend/xmlrpc/packages/search/PackagesSearchHandler.java",
"license": "gpl-2.0",
"size": 14836
}
|
[
"com.redhat.rhn.FaultException",
"com.redhat.rhn.frontend.action.BaseSearchAction",
"com.redhat.rhn.frontend.dto.PackageOverview",
"java.util.List"
] |
import com.redhat.rhn.FaultException; import com.redhat.rhn.frontend.action.BaseSearchAction; import com.redhat.rhn.frontend.dto.PackageOverview; import java.util.List;
|
import com.redhat.rhn.*; import com.redhat.rhn.frontend.action.*; import com.redhat.rhn.frontend.dto.*; import java.util.*;
|
[
"com.redhat.rhn",
"java.util"
] |
com.redhat.rhn; java.util;
| 1,307,921
|
//-----------------------------------------------------------------------
@Override
public LocalDate getEndDate() {
return endDate;
}
|
LocalDate function() { return endDate; }
|
/**
* Gets the end date of the payment period.
* <p>
* This is the last date in the period.
* If the schedule adjusts for business days, then this is the adjusted date.
* @return the value of the property, not null
*/
|
Gets the end date of the payment period. This is the last date in the period. If the schedule adjusts for business days, then this is the adjusted date
|
getEndDate
|
{
"repo_name": "nssales/Strata",
"path": "modules/finance/src/main/java/com/opengamma/strata/finance/rate/bond/FixedCouponBondPaymentPeriod.java",
"license": "apache-2.0",
"size": 32180
}
|
[
"java.time.LocalDate"
] |
import java.time.LocalDate;
|
import java.time.*;
|
[
"java.time"
] |
java.time;
| 2,529,682
|
List<ContainerStatus> pullJustFinishedContainers();
|
List<ContainerStatus> pullJustFinishedContainers();
|
/**
* Return a list of the last set of finished containers, resetting the
* finished containers to empty.
* @return the list of just finished containers, re setting the finished containers.
*/
|
Return a list of the last set of finished containers, resetting the finished containers to empty
|
pullJustFinishedContainers
|
{
"repo_name": "songweijia/fffs",
"path": "sources/hadoop-2.4.1-src/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/attempt/RMAppAttempt.java",
"license": "apache-2.0",
"size": 7275
}
|
[
"java.util.List",
"org.apache.hadoop.yarn.api.records.ContainerStatus"
] |
import java.util.List; import org.apache.hadoop.yarn.api.records.ContainerStatus;
|
import java.util.*; import org.apache.hadoop.yarn.api.records.*;
|
[
"java.util",
"org.apache.hadoop"
] |
java.util; org.apache.hadoop;
| 2,413,205
|
public ExecAgentPromise<T> then(Operation<T> operation) {
this.operation = operation;
return this;
}
|
ExecAgentPromise<T> function(Operation<T> operation) { this.operation = operation; return this; }
|
/**
* Register an operation which will be performed when a request is accepted
* and response is received.
* process died event.
*
* @param operation
* operation to be performed
*
* @return this instance
*/
|
Register an operation which will be performed when a request is accepted and response is received. process died event
|
then
|
{
"repo_name": "gazarenkov/che-sketch",
"path": "ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/machine/execagent/ExecAgentPromise.java",
"license": "epl-1.0",
"size": 5726
}
|
[
"org.eclipse.che.api.promises.client.Operation"
] |
import org.eclipse.che.api.promises.client.Operation;
|
import org.eclipse.che.api.promises.client.*;
|
[
"org.eclipse.che"
] |
org.eclipse.che;
| 2,756,094
|
public Builder applyToAllUnaryMethods(
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater);
return this;
}
|
Builder function( ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; }
|
/**
* Applies the given settings updater function to all of the unary API methods in this service.
*
* <p>Note: This method does not support applying settings to streaming methods.
*/
|
Applies the given settings updater function to all of the unary API methods in this service. Note: This method does not support applying settings to streaming methods
|
applyToAllUnaryMethods
|
{
"repo_name": "googleapis/java-compute",
"path": "google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServicesStubSettings.java",
"license": "apache-2.0",
"size": 51812
}
|
[
"com.google.api.core.ApiFunction",
"com.google.api.gax.rpc.UnaryCallSettings"
] |
import com.google.api.core.ApiFunction; import com.google.api.gax.rpc.UnaryCallSettings;
|
import com.google.api.core.*; import com.google.api.gax.rpc.*;
|
[
"com.google.api"
] |
com.google.api;
| 1,887,930
|
public final void setNamespaceContext(PrefixResolver pr)
{
m_prefixResolvers.setTop(pr);
}
|
final void function(PrefixResolver pr) { m_prefixResolvers.setTop(pr); }
|
/**
* Get the current namespace context for the xpath.
*
* @param pr the prefix resolver to be used for resolving prefixes to
* namespace URLs.
*/
|
Get the current namespace context for the xpath
|
setNamespaceContext
|
{
"repo_name": "md-5/jdk10",
"path": "src/java.xml/share/classes/com/sun/org/apache/xpath/internal/XPathContext.java",
"license": "gpl-2.0",
"size": 40051
}
|
[
"com.sun.org.apache.xml.internal.utils.PrefixResolver"
] |
import com.sun.org.apache.xml.internal.utils.PrefixResolver;
|
import com.sun.org.apache.xml.internal.utils.*;
|
[
"com.sun.org"
] |
com.sun.org;
| 871,866
|
@Override
public void w(@NonNull Throwable t, @NonNull String message, Object... args) {
if (Valves[W]) {
log(WARN, t, message, args);
}
}
|
void function(@NonNull Throwable t, @NonNull String message, Object... args) { if (Valves[W]) { log(WARN, t, message, args); } }
|
/**
* Log warning exception and message with optional format args.
*/
|
Log warning exception and message with optional format args
|
w
|
{
"repo_name": "harvey103565/Timber",
"path": "timber/src/main/java/woods/log/timber/Wood.java",
"license": "apache-2.0",
"size": 20102
}
|
[
"android.support.annotation.NonNull"
] |
import android.support.annotation.NonNull;
|
import android.support.annotation.*;
|
[
"android.support"
] |
android.support;
| 924,221
|
ReadableProduct getProductBySeUrl(MerchantStore store, String friendlyUrl, Language language) throws Exception;
|
ReadableProduct getProductBySeUrl(MerchantStore store, String friendlyUrl, Language language) throws Exception;
|
/**
* Get a Product by friendlyUrl (slug), store and language
*
* @param store
* @param friendlyUrl
* @param language
* @return
* @throws Exception
*/
|
Get a Product by friendlyUrl (slug), store and language
|
getProductBySeUrl
|
{
"repo_name": "shopizer-ecommerce/shopizer",
"path": "sm-shop-model/src/main/java/com/salesmanager/shop/store/controller/product/facade/ProductFacade.java",
"license": "apache-2.0",
"size": 5920
}
|
[
"com.salesmanager.core.model.merchant.MerchantStore",
"com.salesmanager.core.model.reference.language.Language",
"com.salesmanager.shop.model.catalog.product.ReadableProduct"
] |
import com.salesmanager.core.model.merchant.MerchantStore; import com.salesmanager.core.model.reference.language.Language; import com.salesmanager.shop.model.catalog.product.ReadableProduct;
|
import com.salesmanager.core.model.merchant.*; import com.salesmanager.core.model.reference.language.*; import com.salesmanager.shop.model.catalog.product.*;
|
[
"com.salesmanager.core",
"com.salesmanager.shop"
] |
com.salesmanager.core; com.salesmanager.shop;
| 673,640
|
@Deprecated
public static byte matchColor(int r, int g, int b) {
return matchColor(new Color(r, g, b));
}
|
static byte function(int r, int g, int b) { return matchColor(new Color(r, g, b)); }
|
/**
* Get the index of the closest matching color in the palette to the given
* color.
*
* @param r The red component of the color.
* @param b The blue component of the color.
* @param g The green component of the color.
* @return The index in the palette.
* @deprecated Magic value
*/
|
Get the index of the closest matching color in the palette to the given color
|
matchColor
|
{
"repo_name": "Scrik/Cauldron-1",
"path": "eclipse/cauldron/src/main/java/org/bukkit/map/MapPalette.java",
"license": "gpl-3.0",
"size": 8372
}
|
[
"java.awt.Color"
] |
import java.awt.Color;
|
import java.awt.*;
|
[
"java.awt"
] |
java.awt;
| 1,081,154
|
public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
if (bytes == null) {
return offset;
}
byte[] valueBytes = val.unscaledValue().toByteArray();
byte[] result = new byte[valueBytes.length + SIZEOF_INT];
offset = putInt(result, offset, val.scale());
return putBytes(result, offset, valueBytes, 0, valueBytes.length);
}
|
static int function(byte[] bytes, int offset, BigDecimal val) { if (bytes == null) { return offset; } byte[] valueBytes = val.unscaledValue().toByteArray(); byte[] result = new byte[valueBytes.length + SIZEOF_INT]; offset = putInt(result, offset, val.scale()); return putBytes(result, offset, valueBytes, 0, valueBytes.length); }
|
/**
* Put a BigDecimal value out to the specified byte array position.
*
* @param bytes the byte array
* @param offset position in the array
* @param val BigDecimal to write out
* @return incremented offset
*/
|
Put a BigDecimal value out to the specified byte array position
|
putBigDecimal
|
{
"repo_name": "ibmsoe/hbase",
"path": "hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java",
"license": "apache-2.0",
"size": 73824
}
|
[
"java.math.BigDecimal"
] |
import java.math.BigDecimal;
|
import java.math.*;
|
[
"java.math"
] |
java.math;
| 1,785,853
|
void onTaskFailed(ATekdaqc tekdaqc);
|
void onTaskFailed(ATekdaqc tekdaqc);
|
/**
* Called when a task has failed to complete successfully.
*
* @param tekdaqc Tekdaqc whose task failed.
*/
|
Called when a task has failed to complete successfully
|
onTaskFailed
|
{
"repo_name": "Tenkiv/Tekdaqc-JVM-Library",
"path": "src/main/java/com/tenkiv/tekdaqc/communication/tasks/ITaskComplete.java",
"license": "apache-2.0",
"size": 609
}
|
[
"com.tenkiv.tekdaqc.hardware.ATekdaqc"
] |
import com.tenkiv.tekdaqc.hardware.ATekdaqc;
|
import com.tenkiv.tekdaqc.hardware.*;
|
[
"com.tenkiv.tekdaqc"
] |
com.tenkiv.tekdaqc;
| 2,128,268
|
public AbasTime addMinutes(DbContext dbContext, AbasTime time, int minutes) {
// declares variables as in FOP
if (!getUserTextBuffer().isVarDefined(XZSTART_TIME)) {
getUserTextBuffer().defineVar(TYPE_TIME, XZSTART_TIME);
}
if (!getUserTextBuffer().isVarDefined(XZRESULT_TIME)) {
getUserTextBuffer().defineVar(TYPE_TIME, XZRESULT_TIME);
}
// initializes variables and calculates new time
getUserTextBuffer().assign(XZSTART_TIME, time);
getUserTextBuffer().formulaField(XZRESULT_TIME, userTextBuffer, XZSTART_TIME + " + " + minutes);
// corrects the day if necessary
int dayCorrect = getGlobalTextBuffer().getIntegerValue(G_DAY_CORRECT);
if (dayCorrect > 0) {
TextBox textBox = new TextBox(dbContext, TEXTBOX_HEADLINE, TEXTBOX_LINES);
textBox.show();
}
// gets the new time from UserTextBuffer and returns it
String stringValue = getUserTextBuffer().getStringValue(XZRESULT_TIME);
return AbasTime.valueOf(stringValue);
}
|
AbasTime function(DbContext dbContext, AbasTime time, int minutes) { if (!getUserTextBuffer().isVarDefined(XZSTART_TIME)) { getUserTextBuffer().defineVar(TYPE_TIME, XZSTART_TIME); } if (!getUserTextBuffer().isVarDefined(XZRESULT_TIME)) { getUserTextBuffer().defineVar(TYPE_TIME, XZRESULT_TIME); } getUserTextBuffer().assign(XZSTART_TIME, time); getUserTextBuffer().formulaField(XZRESULT_TIME, userTextBuffer, XZSTART_TIME + STR + minutes); int dayCorrect = getGlobalTextBuffer().getIntegerValue(G_DAY_CORRECT); if (dayCorrect > 0) { TextBox textBox = new TextBox(dbContext, TEXTBOX_HEADLINE, TEXTBOX_LINES); textBox.show(); } String stringValue = getUserTextBuffer().getStringValue(XZRESULT_TIME); return AbasTime.valueOf(stringValue); }
|
/**
* Adds minutes to an AbasTime correcting the day if necessary.
*
* @param dbContext The database context.
* @param time The AbasTime to add the minutes to.
* @param minutes The minutes to add.
* @return The AbasTime with the minutes added.
*/
|
Adds minutes to an AbasTime correcting the day if necessary
|
addMinutes
|
{
"repo_name": "abassoftware/ajo-examples",
"path": "src/de/abas/examples/utilities/AbasDateUtilities.java",
"license": "epl-1.0",
"size": 15491
}
|
[
"de.abas.erp.api.gui.TextBox",
"de.abas.erp.common.type.AbasTime",
"de.abas.erp.db.DbContext"
] |
import de.abas.erp.api.gui.TextBox; import de.abas.erp.common.type.AbasTime; import de.abas.erp.db.DbContext;
|
import de.abas.erp.api.gui.*; import de.abas.erp.common.type.*; import de.abas.erp.db.*;
|
[
"de.abas.erp"
] |
de.abas.erp;
| 1,608,606
|
public static MozuClient deletePublishSetClient(String publishSetCode, Boolean discardDrafts) throws Exception
{
MozuUrl url = com.mozu.api.urls.commerce.catalog.admin.PublishingScopeUrl.deletePublishSetUrl(discardDrafts, publishSetCode);
String verb = "DELETE";
MozuClient mozuClient = (MozuClient) MozuClientFactory.getInstance();
mozuClient.setVerb(verb);
mozuClient.setResourceUrl(url);
return mozuClient;
}
|
static MozuClient function(String publishSetCode, Boolean discardDrafts) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.catalog.admin.PublishingScopeUrl.deletePublishSetUrl(discardDrafts, publishSetCode); String verb = STR; MozuClient mozuClient = (MozuClient) MozuClientFactory.getInstance(); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); return mozuClient; }
|
/**
* Removes all details about a PublishSet from the product service. If the discardDrafts param is true, it also deletes the product drafts.
* <p><pre><code>
* MozuClient mozuClient=DeletePublishSetClient( publishSetCode, discardDrafts);
* client.setBaseAddress(url);
* client.executeRequest();
* </code></pre></p>
* @param discardDrafts Specifies whether to discard all the drafts assigned to the publish set when the publish set is deleted.
* @param publishSetCode The unique identifier of the publish set.
* @param dataViewMode DataViewMode
* @return Mozu.Api.MozuClient
*/
|
Removes all details about a PublishSet from the product service. If the discardDrafts param is true, it also deletes the product drafts. <code><code> MozuClient mozuClient=DeletePublishSetClient( publishSetCode, discardDrafts); client.setBaseAddress(url); client.executeRequest(); </code></code>
|
deletePublishSetClient
|
{
"repo_name": "bhewett/mozu-java",
"path": "mozu-javaasync-core/src/main/java/com/mozu/api/clients/commerce/catalog/admin/PublishingScopeClient.java",
"license": "mit",
"size": 12009
}
|
[
"com.mozu.api.MozuClient",
"com.mozu.api.MozuClientFactory",
"com.mozu.api.MozuUrl"
] |
import com.mozu.api.MozuClient; import com.mozu.api.MozuClientFactory; import com.mozu.api.MozuUrl;
|
import com.mozu.api.*;
|
[
"com.mozu.api"
] |
com.mozu.api;
| 2,027,960
|
@Fluent
StaticHandler setHttp2PushMapping(List<Http2PushMapping> http2PushMappings);
|
StaticHandler setHttp2PushMapping(List<Http2PushMapping> http2PushMappings);
|
/**
* Set the file mapping for http2push and link preload
*
* @param http2PushMappings the mapping for http2 push
* @return a reference to this, so the API can be used fluently
*/
|
Set the file mapping for http2push and link preload
|
setHttp2PushMapping
|
{
"repo_name": "aesteve/vertx-web",
"path": "vertx-web/src/main/java/io/vertx/ext/web/handler/StaticHandler.java",
"license": "apache-2.0",
"size": 9137
}
|
[
"io.vertx.ext.web.Http2PushMapping",
"java.util.List"
] |
import io.vertx.ext.web.Http2PushMapping; import java.util.List;
|
import io.vertx.ext.web.*; import java.util.*;
|
[
"io.vertx.ext",
"java.util"
] |
io.vertx.ext; java.util;
| 225,952
|
public String getURL() throws SQLException {
if (JdbcDebugCfg.entryActive)
debug[methodId_getURL].methodEntry();
try {
return connection_.url_;
} finally {
if (JdbcDebugCfg.entryActive)
debug[methodId_getURL].methodExit();
}
}
|
String function() throws SQLException { if (JdbcDebugCfg.entryActive) debug[methodId_getURL].methodEntry(); try { return connection_.url_; } finally { if (JdbcDebugCfg.entryActive) debug[methodId_getURL].methodExit(); } }
|
/**
* Retrieves the URL for this DBMS.
*
* @return the url or null if it can't be generated
* @throws SQLException
* - if a database access error occurs
**/
|
Retrieves the URL for this DBMS
|
getURL
|
{
"repo_name": "mashengchen/incubator-trafodion",
"path": "core/conn/jdbc_type2/src/main/java/org/apache/trafodion/jdbc/t2/SQLMXDatabaseMetaData.java",
"license": "apache-2.0",
"size": 191582
}
|
[
"java.sql.SQLException"
] |
import java.sql.SQLException;
|
import java.sql.*;
|
[
"java.sql"
] |
java.sql;
| 2,236,183
|
public static Server getServer() throws InitializationException {
if (server == null) {
server = RebuildServer.getRebuildInstance(
new File(Constants.FEDORA_HOME));
}
return server;
}
|
static Server function() throws InitializationException { if (server == null) { server = RebuildServer.getRebuildInstance( new File(Constants.FEDORA_HOME)); } return server; }
|
/**
* Gets the instance of the server appropriate for rebuilding.
* If no such instance has been initialized yet, initialize one.
*
* @return the server instance.
* @throws InitializationException if initialization fails.
*/
|
Gets the instance of the server appropriate for rebuilding. If no such instance has been initialized yet, initialize one
|
getServer
|
{
"repo_name": "FLVC/fcrepo-src-3.4.2",
"path": "fcrepo-server/src/main/java/org/fcrepo/server/utilities/rebuild/Rebuild.java",
"license": "apache-2.0",
"size": 16078
}
|
[
"java.io.File",
"org.fcrepo.common.Constants",
"org.fcrepo.server.Server",
"org.fcrepo.server.errors.InitializationException"
] |
import java.io.File; import org.fcrepo.common.Constants; import org.fcrepo.server.Server; import org.fcrepo.server.errors.InitializationException;
|
import java.io.*; import org.fcrepo.common.*; import org.fcrepo.server.*; import org.fcrepo.server.errors.*;
|
[
"java.io",
"org.fcrepo.common",
"org.fcrepo.server"
] |
java.io; org.fcrepo.common; org.fcrepo.server;
| 1,306,777
|
public List<BsAttribution> get_attributions() {
return (hasAttributions()) ? attributions.getAttributions() : null;
}
|
List<BsAttribution> function() { return (hasAttributions()) ? attributions.getAttributions() : null; }
|
/**
* Retrieves attributions for gene
*
* @return Attributions for this gene as an <code>Iterator</code> of
* <code>BsAttribution</code>s or <code>null</code> if no
* attributions for gene.
*/
|
Retrieves attributions for gene
|
get_attributions
|
{
"repo_name": "tair/tairwebapp",
"path": "src/org/tair/search/GeneSummary.java",
"license": "gpl-3.0",
"size": 28679
}
|
[
"java.util.List",
"org.tair.bs.community.BsAttribution"
] |
import java.util.List; import org.tair.bs.community.BsAttribution;
|
import java.util.*; import org.tair.bs.community.*;
|
[
"java.util",
"org.tair.bs"
] |
java.util; org.tair.bs;
| 1,949,376
|
protected double dotProduct(HashMap doc1, HashMap doc2) {
HashSet<String> common_tokens = findCommonTokens(doc1.keySet(), doc2.keySet());
double dot_product = 0D;
for (String key : common_tokens) {
dot_product += Double.parseDouble(doc2.get(key).toString()) * Double.parseDouble(doc1.get(key).toString());
}
return dot_product;
}
|
double function(HashMap doc1, HashMap doc2) { HashSet<String> common_tokens = findCommonTokens(doc1.keySet(), doc2.keySet()); double dot_product = 0D; for (String key : common_tokens) { dot_product += Double.parseDouble(doc2.get(key).toString()) * Double.parseDouble(doc1.get(key).toString()); } return dot_product; }
|
/**
* Calculated the dot product between the two document vectors. The dot
* product is an algebraic operation that takes two equal-length sequences
* of numbers (usually coordinate vectors) and returns a single number.
*
* @param doc1 contains all the unique terms of doc1 and the weight of each
* term
* @param doc2 contains all the unique terms of doc2 and the weight of each
* term
* @return the calculated dotProduct between the two document vectors
*/
|
Calculated the dot product between the two document vectors. The dot product is an algebraic operation that takes two equal-length sequences of numbers (usually coordinate vectors) and returns a single number
|
dotProduct
|
{
"repo_name": "vasgat/jSimilarity",
"path": "src/main/java/certh/iti/mklab/jSimilarity/stringsimilarities/CosineSimilarity.java",
"license": "apache-2.0",
"size": 4522
}
|
[
"java.util.HashMap",
"java.util.HashSet"
] |
import java.util.HashMap; import java.util.HashSet;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 671,580
|
@Test
public void testIsPersisted() {
MockRepository repository = new MockRepository();
assertFalse(repository.isPersisted(new MockIdentifiable()));
MockIdentifiable id = new MockIdentifiable();
id.setUid(22l);
assertTrue(repository.isPersisted(id));
}
}
|
void function() { MockRepository repository = new MockRepository(); assertFalse(repository.isPersisted(new MockIdentifiable())); MockIdentifiable id = new MockIdentifiable(); id.setUid(22l); assertTrue(repository.isPersisted(id)); } }
|
/**
* Test method for {@link br.com.keepitsimple.commons.repositories.AbstractRepository#isPersisted(br.com.keepitsimple.commons.representation.Identifiable)}.
*/
|
Test method for <code>br.com.keepitsimple.commons.repositories.AbstractRepository#isPersisted(br.com.keepitsimple.commons.representation.Identifiable)</code>
|
testIsPersisted
|
{
"repo_name": "kikogatto/bone-collector",
"path": "core/src/test/java/br/com/keepitsimple/commons/repositories/AbstractRepositoryTest.java",
"license": "mit",
"size": 3746
}
|
[
"br.com.keepitsimple.commons.repositories.mock.MockIdentifiable",
"org.junit.Assert"
] |
import br.com.keepitsimple.commons.repositories.mock.MockIdentifiable; import org.junit.Assert;
|
import br.com.keepitsimple.commons.repositories.mock.*; import org.junit.*;
|
[
"br.com.keepitsimple",
"org.junit"
] |
br.com.keepitsimple; org.junit;
| 443,387
|
public static Manifest getManifest(File file) throws IOException {
JarFile jar = new JarFile(file);
try {
// only handle non OSGi jar
return jar.getManifest();
} finally {
jar.close();
}
}
|
static Manifest function(File file) throws IOException { JarFile jar = new JarFile(file); try { return jar.getManifest(); } finally { jar.close(); } }
|
/**
* Returns the entry from the manifest for the given name
*/
|
Returns the entry from the manifest for the given name
|
getManifest
|
{
"repo_name": "jludvice/fabric8",
"path": "common-util/src/main/java/io/fabric8/common/util/Manifests.java",
"license": "apache-2.0",
"size": 1527
}
|
[
"java.io.File",
"java.io.IOException",
"java.util.jar.JarFile",
"java.util.jar.Manifest"
] |
import java.io.File; import java.io.IOException; import java.util.jar.JarFile; import java.util.jar.Manifest;
|
import java.io.*; import java.util.jar.*;
|
[
"java.io",
"java.util"
] |
java.io; java.util;
| 1,461,983
|
List<EntityActionConfig> centreConfigShareActions();
|
List<EntityActionConfig> centreConfigShareActions();
|
/**
* A set of domain-specific actions for centre configurations sharing.
*
* @return
*/
|
A set of domain-specific actions for centre configurations sharing
|
centreConfigShareActions
|
{
"repo_name": "fieldenms/tg",
"path": "platform-web-ui/src/main/java/ua/com/fielden/platform/web/app/IWebUiConfig.java",
"license": "mit",
"size": 5765
}
|
[
"java.util.List",
"ua.com.fielden.platform.web.centre.api.actions.EntityActionConfig"
] |
import java.util.List; import ua.com.fielden.platform.web.centre.api.actions.EntityActionConfig;
|
import java.util.*; import ua.com.fielden.platform.web.centre.api.actions.*;
|
[
"java.util",
"ua.com.fielden"
] |
java.util; ua.com.fielden;
| 407,450
|
// [TARGET create(String, InputStream, BlobWriteOption...)]
// [VARIABLE "my_blob_name"]
public Blob createBlobFromInputStream(String blobName) {
// [START createBlobFromInputStream]
InputStream content = new ByteArrayInputStream("Hello, World!".getBytes(UTF_8));
Blob blob = bucket.create(blobName, content);
// [END createBlobFromInputStream]
return blob;
}
|
Blob function(String blobName) { InputStream content = new ByteArrayInputStream(STR.getBytes(UTF_8)); Blob blob = bucket.create(blobName, content); return blob; }
|
/**
* Example of creating a blob in the bucket from an input stream.
*/
|
Example of creating a blob in the bucket from an input stream
|
createBlobFromInputStream
|
{
"repo_name": "jabubake/google-cloud-java",
"path": "google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/BucketSnippets.java",
"license": "apache-2.0",
"size": 10243
}
|
[
"com.google.cloud.storage.Blob",
"java.io.ByteArrayInputStream",
"java.io.InputStream"
] |
import com.google.cloud.storage.Blob; import java.io.ByteArrayInputStream; import java.io.InputStream;
|
import com.google.cloud.storage.*; import java.io.*;
|
[
"com.google.cloud",
"java.io"
] |
com.google.cloud; java.io;
| 572,460
|
List<Document> getDocs();
|
List<Document> getDocs();
|
/**
* <P>
* Get the document information from an _all_docs request.
* </P>
* <P>
* Note that if requesting docs using {@link AllDocsRequestBuilder#keys(Object[])} the list of
* documents may include <b>deleted</b> documents that have one of the specified ids.
* </P>
* <P>
* Note if {@link AllDocsRequestBuilder#includeDocs(boolean)} is false then attachment metadata
* will not be present.
* </P>
* @return a list of Document objects from the _all_docs request
* @since 2.0.0
*/
|
Get the document information from an _all_docs request. Note that if requesting docs using <code>AllDocsRequestBuilder#keys(Object[])</code> the list of documents may include deleted documents that have one of the specified ids. Note if <code>AllDocsRequestBuilder#includeDocs(boolean)</code> is false then attachment metadata will not be present.
|
getDocs
|
{
"repo_name": "cloudant/java-cloudant",
"path": "cloudant-client/src/main/java/com/cloudant/client/api/views/AllDocsResponse.java",
"license": "apache-2.0",
"size": 3393
}
|
[
"com.cloudant.client.api.model.Document",
"java.util.List"
] |
import com.cloudant.client.api.model.Document; import java.util.List;
|
import com.cloudant.client.api.model.*; import java.util.*;
|
[
"com.cloudant.client",
"java.util"
] |
com.cloudant.client; java.util;
| 2,648,697
|
protected boolean isContact(final Parameter _parameter)
throws EFapsException
{
return isInstance(_parameter) && _parameter.getInstance().getType().isKindOf(CIContacts.Contact);
}
|
boolean function(final Parameter _parameter) throws EFapsException { return isInstance(_parameter) && _parameter.getInstance().getType().isKindOf(CIContacts.Contact); }
|
/**
* Checks if the report is in a contact instance.
*
* @param _parameter the _parameter
* @return true, if is contact
* @throws EFapsException on error
*/
|
Checks if the report is in a contact instance
|
isContact
|
{
"repo_name": "eFaps/eFapsApp-Sales",
"path": "src/main/efaps/ESJP/org/efaps/esjp/sales/report/SalesProductReport_Base.java",
"license": "apache-2.0",
"size": 74706
}
|
[
"org.efaps.admin.event.Parameter",
"org.efaps.esjp.ci.CIContacts",
"org.efaps.util.EFapsException"
] |
import org.efaps.admin.event.Parameter; import org.efaps.esjp.ci.CIContacts; import org.efaps.util.EFapsException;
|
import org.efaps.admin.event.*; import org.efaps.esjp.ci.*; import org.efaps.util.*;
|
[
"org.efaps.admin",
"org.efaps.esjp",
"org.efaps.util"
] |
org.efaps.admin; org.efaps.esjp; org.efaps.util;
| 390,823
|
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<PagedResponse<OperationInner>> listSinglePageAsync(Context context) {
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";
context = this.client.mergeContext(context);
return service
.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)
.map(
res ->
new PagedResponseBase<>(
res.getRequest(),
res.getStatusCode(),
res.getHeaders(),
res.getValue().value(),
res.getValue().nextLink(),
null));
}
|
@ServiceMethod(returns = ReturnType.SINGLE) Mono<PagedResponse<OperationInner>> function(Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } final String accept = STR; context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) .map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); }
|
/**
* Lists all of the available REST API operations of the Microsoft.SignalRService provider.
*
* @param context The context to associate with this operation.
* @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 result of the request to list REST API operations.
*/
|
Lists all of the available REST API operations of the Microsoft.SignalRService provider
|
listSinglePageAsync
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/OperationsClientImpl.java",
"license": "mit",
"size": 12338
}
|
[
"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.Context",
"com.azure.resourcemanager.signalr.fluent.models.OperationInner"
] |
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.Context; import com.azure.resourcemanager.signalr.fluent.models.OperationInner;
|
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.signalr.fluent.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 2,225,411
|
@Test
public void testClientSubmitOptionsRetainedValuesStringConstructor() {
try {
String cOptions = null;
String defaultOptionString = "revertunchangedreopen";
ClientSubmitOptions submitOpts = new ClientSubmitOptions(defaultOptionString);
cOptions = submitOpts.toString();
String verOptions = getVerificationString(false, false, true, true, false, false);
debugPrint(defaultOptionString, verOptions, cOptions);
assertNotNull("ClientSubmitOptions.toString() returned Null Result.", cOptions);
assertEquals("ClientOption strings should match.", verOptions, cOptions);
//now set another options to see if we clear options already set.
submitOpts.setLeaveunchanged(true);
verOptions = getVerificationString(true, false, true, true, false, false);
cOptions = submitOpts.toString();
assertTrue("ClientOption should be True.", submitOpts.isLeaveunchanged());
assertNotNull("ClientSubmitOptions.toString() returned Null Result.", cOptions);
assertTrue("ClientOption strings should not match.",
!verOptions.equalsIgnoreCase(cOptions));
} catch (Exception exc){
fail("Unexpected Exception: " + exc + " - " + exc.getLocalizedMessage());
}
}
|
void function() { try { String cOptions = null; String defaultOptionString = STR; ClientSubmitOptions submitOpts = new ClientSubmitOptions(defaultOptionString); cOptions = submitOpts.toString(); String verOptions = getVerificationString(false, false, true, true, false, false); debugPrint(defaultOptionString, verOptions, cOptions); assertNotNull(STR, cOptions); assertEquals(STR, verOptions, cOptions); submitOpts.setLeaveunchanged(true); verOptions = getVerificationString(true, false, true, true, false, false); cOptions = submitOpts.toString(); assertTrue(STR, submitOpts.isLeaveunchanged()); assertNotNull(STR, cOptions); assertTrue(STR, !verOptions.equalsIgnoreCase(cOptions)); } catch (Exception exc){ fail(STR + exc + STR + exc.getLocalizedMessage()); } }
|
/**
* The testClientSubmitOptionsRetainedValuesStringConstructor verifies that passing an
* incomplete string to the ClientSubmitOptions constructor should set named options to
* the expected values and unnamed ones should remain untouched.
* Verification is via string comparison with expected value returned
* by the toString() method and via getter for updated option.
*/
|
The testClientSubmitOptionsRetainedValuesStringConstructor verifies that passing an incomplete string to the ClientSubmitOptions constructor should set named options to the expected values and unnamed ones should remain untouched. Verification is via string comparison with expected value returned by the toString() method and via getter for updated option
|
testClientSubmitOptionsRetainedValuesStringConstructor
|
{
"repo_name": "groboclown/p4ic4idea",
"path": "p4java/src/test/java/com/perforce/p4java/tests/dev/unit/feature/client/ClientSubmitOptionsTest.java",
"license": "apache-2.0",
"size": 25119
}
|
[
"com.perforce.p4java.impl.generic.client.ClientSubmitOptions",
"org.junit.Assert"
] |
import com.perforce.p4java.impl.generic.client.ClientSubmitOptions; import org.junit.Assert;
|
import com.perforce.p4java.impl.generic.client.*; import org.junit.*;
|
[
"com.perforce.p4java",
"org.junit"
] |
com.perforce.p4java; org.junit;
| 620,661
|
public T getResult(List<String> keyElements);
|
T function(List<String> keyElements);
|
/**
* Return the class corresponding to the key elements provided.
*/
|
Return the class corresponding to the key elements provided
|
getResult
|
{
"repo_name": "urieli/talismane",
"path": "talismane_machine_learning/src/main/java/com/joliciel/talismane/machineLearning/ExternalResource.java",
"license": "agpl-3.0",
"size": 1543
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,352,049
|
private void printType(SnmpNotificationGroup type, String indent) {
os.println("NOTIFICATION-GROUP");
os.print(" NOTIFICATIONS ");
printReferenceList(type.getNotifications(), " ");
os.println();
os.print(" STATUS ");
os.println(type.getStatus());
printDescription(type.getDescription());
if (type.getReference() != null) {
os.println();
os.print(" REFERENCE ");
os.print(getQuote(type.getReference()));
}
}
|
void function(SnmpNotificationGroup type, String indent) { os.println(STR); os.print(STR); printReferenceList(type.getNotifications(), " "); os.println(); os.print(STR); os.println(type.getStatus()); printDescription(type.getDescription()); if (type.getReference() != null) { os.println(); os.print(STR); os.print(getQuote(type.getReference())); } }
|
/**
* Prints an SNMP object group.
*
* @param type the type to print
* @param indent the indentation to use on new lines
*/
|
Prints an SNMP object group
|
printType
|
{
"repo_name": "tmoskun/JSNMPWalker",
"path": "lib/mibble-2.9.3/src/java/net/percederberg/mibble/MibWriter.java",
"license": "gpl-3.0",
"size": 37984
}
|
[
"net.percederberg.mibble.snmp.SnmpNotificationGroup"
] |
import net.percederberg.mibble.snmp.SnmpNotificationGroup;
|
import net.percederberg.mibble.snmp.*;
|
[
"net.percederberg.mibble"
] |
net.percederberg.mibble;
| 2,552,399
|
public DataMasking withQueryParams(List<DataMaskingEntity> queryParams) {
this.queryParams = queryParams;
return this;
}
|
DataMasking function(List<DataMaskingEntity> queryParams) { this.queryParams = queryParams; return this; }
|
/**
* Set the queryParams property: Masking settings for Url query parameters.
*
* @param queryParams the queryParams value to set.
* @return the DataMasking object itself.
*/
|
Set the queryParams property: Masking settings for Url query parameters
|
withQueryParams
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DataMasking.java",
"license": "mit",
"size": 2342
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,177,594
|
private NFeDetBean getDetProdServ(MLBRNotaFiscalLine nfLine) throws Exception {
try{
NFeDetBean det = new NFeDetBean();
det.setNItem(Integer.toString(nfLine.getLine()));
det.setProd(getProdServ(nfLine));
NFeXMLGrupoMGenerator grupoM = new NFeXMLGrupoMGenerator(nfLine);
grupoM.init();
det.setImposto(grupoM.getNFeImpostosLinha());
return det;
}catch (Exception ex){
throw new Exception("Erro ao obter as informacoes de Detalhamento de Prod e Serv. " +
"\n Msg: Linha" + nfLine.getLine() + ": "+ ex.getMessage());
}
}
|
NFeDetBean function(MLBRNotaFiscalLine nfLine) throws Exception { try{ NFeDetBean det = new NFeDetBean(); det.setNItem(Integer.toString(nfLine.getLine())); det.setProd(getProdServ(nfLine)); NFeXMLGrupoMGenerator grupoM = new NFeXMLGrupoMGenerator(nfLine); grupoM.init(); det.setImposto(grupoM.getNFeImpostosLinha()); return det; }catch (Exception ex){ throw new Exception(STR + STR + nfLine.getLine() + STR+ ex.getMessage()); } }
|
/**
* Get Detalhamento de Produtos e Servicos da NF-e
* @param nfl
* @return
*/
|
Get Detalhamento de Produtos e Servicos da NF-e
|
getDetProdServ
|
{
"repo_name": "arthurmelo88/palmetalADP",
"path": "palmetal_to_lbrk/nfe/src/org/adempierelbr/nfe/NFeXMLGenerator.java",
"license": "gpl-2.0",
"size": 35766
}
|
[
"org.adempierelbr.model.MLBRNotaFiscalLine",
"org.adempierelbr.nfe.v200.beans.infnfe.NFeDetBean"
] |
import org.adempierelbr.model.MLBRNotaFiscalLine; import org.adempierelbr.nfe.v200.beans.infnfe.NFeDetBean;
|
import org.adempierelbr.model.*; import org.adempierelbr.nfe.v200.beans.infnfe.*;
|
[
"org.adempierelbr.model",
"org.adempierelbr.nfe"
] |
org.adempierelbr.model; org.adempierelbr.nfe;
| 2,742,841
|
public static boolean readTLBool(InputStream stream) throws IOException {
int v = readInt(stream);
if (v == TLBoolTrue.CLASS_ID) {
return true;
} else if (v == TLBoolFalse.CLASS_ID) {
return false;
} else
throw new DeserializeException("Not bool value: " + Integer.toHexString(v));
}
|
static boolean function(InputStream stream) throws IOException { int v = readInt(stream); if (v == TLBoolTrue.CLASS_ID) { return true; } else if (v == TLBoolFalse.CLASS_ID) { return false; } else throw new DeserializeException(STR + Integer.toHexString(v)); }
|
/**
* Reading tl-bool from stream
*
* @param stream source stream
* @return bool
* @throws IOException reading exception
*/
|
Reading tl-bool from stream
|
readTLBool
|
{
"repo_name": "rubenlagus/TelegramApi",
"path": "src/main/java/org/telegram/tl/StreamingUtils.java",
"license": "mit",
"size": 18152
}
|
[
"java.io.IOException",
"java.io.InputStream"
] |
import java.io.IOException; import java.io.InputStream;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 465,544
|
public void remove(Operator op) throws IOException {
if (fromEdges.containsKey(op) || toEdges.containsKey(op)) {
throw new IOException("Attempt to remove operator " + op.getName()
+ " that is still connected in the plan");
}
markDirty();
ops.remove(op);
}
|
void function(Operator op) throws IOException { if (fromEdges.containsKey(op) toEdges.containsKey(op)) { throw new IOException(STR + op.getName() + STR); } markDirty(); ops.remove(op); }
|
/**
* Remove an operator from the plan.
* @param op Operator to be removed
* @throws IOException if the remove operation attempts to
* remove an operator that is still connected to other operators.
*/
|
Remove an operator from the plan
|
remove
|
{
"repo_name": "hirohanin/pig7hadoop21",
"path": "src/org/apache/pig/experimental/plan/BaseOperatorPlan.java",
"license": "apache-2.0",
"size": 9773
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,555,602
|
@Override
public boolean isFileSystem(File f) {
return true;
}
|
boolean function(File f) { return true; }
|
/**
* Checks if <code>f</code> represents a real directory or file as opposed to a special folder such as
* <code>"Desktop"</code>. Used by UI classes to decide if a folder is selectable when doing directory choosing.
*
* @param f a <code>File</code> object
* @return <code>true</code> if <code>f</code> is a real file or directory.
*/
|
Checks if <code>f</code> represents a real directory or file as opposed to a special folder such as <code>"Desktop"</code>. Used by UI classes to decide if a folder is selectable when doing directory choosing
|
isFileSystem
|
{
"repo_name": "DigitalMediaServer/DigitalMediaServer",
"path": "src/main/java/net/pms/newgui/RestrictedFileSystemView.java",
"license": "gpl-2.0",
"size": 11295
}
|
[
"java.io.File"
] |
import java.io.File;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,733,216
|
public static Object getObjectFromValue( Value value ) {
if ( value == null ) {
return null;
}
Class<?> theClass = getClassForValue( value );
if ( IRI.class == theClass ) {
return value;
}
Literal input = Literal.class.cast( value );
String val = input.getLabel();
boolean isempty = val.isEmpty();
if ( theClass == Double.class ) {
return ( isempty ? null : input.doubleValue() );
}
if ( theClass == Integer.class ) {
return ( isempty ? null : input.intValue() );
}
if ( theClass == Boolean.class ) {
return ( isempty ? null : input.booleanValue() );
}
if ( theClass == Float.class ) {
return ( isempty ? null : input.floatValue() );
}
if ( theClass == Date.class ) {
return ( isempty ? null : getDate( input.calendarValue() ) );
}
return input.stringValue();
}
|
static Object function( Value value ) { if ( value == null ) { return null; } Class<?> theClass = getClassForValue( value ); if ( IRI.class == theClass ) { return value; } Literal input = Literal.class.cast( value ); String val = input.getLabel(); boolean isempty = val.isEmpty(); if ( theClass == Double.class ) { return ( isempty ? null : input.doubleValue() ); } if ( theClass == Integer.class ) { return ( isempty ? null : input.intValue() ); } if ( theClass == Boolean.class ) { return ( isempty ? null : input.booleanValue() ); } if ( theClass == Float.class ) { return ( isempty ? null : input.floatValue() ); } if ( theClass == Date.class ) { return ( isempty ? null : getDate( input.calendarValue() ) ); } return input.stringValue(); }
|
/**
* Gets a proper native object from a given RDF value
*
* @param value The RDF Value
* @return A proper native object
*/
|
Gets a proper native object from a given RDF value
|
getObjectFromValue
|
{
"repo_name": "Ostrich-Emulators/semtool",
"path": "common/src/main/java/com/ostrichemulators/semtool/util/RDFDatatypeTools.java",
"license": "gpl-3.0",
"size": 15991
}
|
[
"com.ostrichemulators.semtool.rdf.query.util.QueryExecutorAdapter",
"java.util.Date",
"org.eclipse.rdf4j.model.Literal",
"org.eclipse.rdf4j.model.Value"
] |
import com.ostrichemulators.semtool.rdf.query.util.QueryExecutorAdapter; import java.util.Date; import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.Value;
|
import com.ostrichemulators.semtool.rdf.query.util.*; import java.util.*; import org.eclipse.rdf4j.model.*;
|
[
"com.ostrichemulators.semtool",
"java.util",
"org.eclipse.rdf4j"
] |
com.ostrichemulators.semtool; java.util; org.eclipse.rdf4j;
| 2,122,366
|
private IEntityGroup instanceFromResultSet(java.sql.ResultSet rs)
throws SQLException, GroupsException {
IEntityGroup eg = null;
String key = rs.getString(1);
String creatorID = rs.getString(2);
Integer entityTypeID = new Integer(rs.getInt(3));
Class entityType = EntityTypesLocator.getEntityTypes().getEntityTypeFromID(entityTypeID);
String groupName = rs.getString(4);
String description = rs.getString(5);
if (key != null) {
eg = newInstance(key, entityType, creatorID, groupName, description);
}
return eg;
}
|
IEntityGroup function(java.sql.ResultSet rs) throws SQLException, GroupsException { IEntityGroup eg = null; String key = rs.getString(1); String creatorID = rs.getString(2); Integer entityTypeID = new Integer(rs.getInt(3)); Class entityType = EntityTypesLocator.getEntityTypes().getEntityTypeFromID(entityTypeID); String groupName = rs.getString(4); String description = rs.getString(5); if (key != null) { eg = newInstance(key, entityType, creatorID, groupName, description); } return eg; }
|
/**
* Find and return an instance of the group.
*
* @param rs the SQL result set
* @return org.apereo.portal.groups.IEntityGroup
*/
|
Find and return an instance of the group
|
instanceFromResultSet
|
{
"repo_name": "jl1955/uPortal5",
"path": "uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/RDBMEntityGroupStore.java",
"license": "apache-2.0",
"size": 57946
}
|
[
"java.sql.ResultSet",
"java.sql.SQLException",
"org.apereo.portal.spring.locator.EntityTypesLocator"
] |
import java.sql.ResultSet; import java.sql.SQLException; import org.apereo.portal.spring.locator.EntityTypesLocator;
|
import java.sql.*; import org.apereo.portal.spring.locator.*;
|
[
"java.sql",
"org.apereo.portal"
] |
java.sql; org.apereo.portal;
| 1,250,782
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.