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
public void generarReporte(AdpRun adpRun) throws Exception{ String funcName = DemodaUtil.currentMethodName(); Session session = null; Transaction tx = null; if (log.isDebugEnabled()) log.debug(funcName + ": enter"); try { session = SiatHibernateUtil.currentSession(); tx = session.beginTransaction(); String ID_PROCESOMASIVO_PARAM = "idProcesoMasivo"; String USER_NAME_PARAM = "UserName"; String USER_ID_PARAM = "UserId"; AdpParameter paramIdProcesoMasivo = adpRun.getAdpParameter(ID_PROCESOMASIVO_PARAM); AdpParameter paramUserName = adpRun.getAdpParameter(USER_NAME_PARAM); AdpParameter paramUserId = adpRun.getAdpParameter(USER_ID_PARAM); Long idProcesoMasivo = NumberUtil.getLong(paramIdProcesoMasivo.getValue()); String userName = paramUserName.getValue(); String userId = paramUserId.getValue(); // Seteamos el UserName en el UserContext para que al modificarse la corrida quede grabado. DemodaUtil.currentUserContext().setUserName(userName); ProcesoMasivo procesoMasivo = ProcesoMasivo.getByIdNull(idProcesoMasivo); if(procesoMasivo == null){ adpRun.changeState(AdpRunState.FIN_ERROR, "No se encontro el Proceso Masivo pasado como parametro", false); adpRun.logError("No se encontro el Proceso Masivo pasado como parametro"); return; } InformeRespuestaOperativos informe = new InformeRespuestaOperativos(); informe.setFechaProceso(DateUtil.formatDate(procesoMasivo.getFechaEnvio(), DateUtil.dd_MM_YYYY_MASK)); informe.setFechaReporte(DateUtil.formatDate(new Date(), DateUtil.dd_MM_YYYY_MASK)); informe.setDesTipoProceso(procesoMasivo.getTipProMas().getDesTipProMas()); informe.setDesCorrida(procesoMasivo.getCorrida().getDesCorrida()); informe.setCantDeudas(GdeDAOFactory.getProMasDeuIncDAO().getCantidadDeuda(procesoMasivo)); informe.setCantDeudasPagas(GdeDAOFactory.getProMasDeuIncDAO().getCantidadDeudasPagas(procesoMasivo)); informe.setCantConvenios(GdeDAOFactory.getProMasDeuIncDAO().getCantidadConveniosFormalizados(procesoMasivo)); informe.setCantRecibos(GdeDAOFactory.getProMasDeuIncDAO().getCantidadRecibosGenerados(procesoMasivo)); informe.setCantDeudaEnConvenio(GdeDAOFactory.getProMasDeuIncDAO().getCantidadDeudaEnConvenio(procesoMasivo)); informe.setCantDeudaEnRecibo(GdeDAOFactory.getProMasDeuIncDAO().getCantidadDeudaEnRecibo(procesoMasivo)); // Generamos el printModel PrintModel print =null; print = Formulario.getPrintModelForPDF(Formulario.COD_FRM_RESPUESTA_OPERATIVOS); print.putCabecera("TituloReporte", "Reporte de Respuesta Operativos"); print.putCabecera("Fecha", DateUtil.formatDate(new Date(), DateUtil.dd_MM_YYYY_MASK)); print.putCabecera("Hora", DateUtil.formatDate(new Date(), DateUtil.HOUR_MINUTE_MASK)); print.putCabecera("Usuario", userName); print.setData(informe); print.setTopeProfundidad(2); //String fileSharePath = SiatParam.getString("FileSharePath"); String fileDir = adpRun.getProcessDir(AdpRunDirEnum.SALIDA)+File.separator;//fileSharePath + "/tmp"; // Archivo pdf a generar String fileNamePdf = adpRun.getId()+"RespuestaOperativos"+ userId +".pdf"; File pdfFile = new File(fileDir+fileNamePdf); OutputStream out = new java.io.FileOutputStream(pdfFile); out.write(print.getByteArray()); String nombre = "Reporte de Respuesta Operativos"; String descripcion = "Consulta Pagos, Convenios Formalizados y Recibos Generados sobre la Deuda incluida en el Proceso Masivo posterior a la fecha de Envio."; // Levanto la Corrida y guardamos el archivo generado en como archivo de salida del proceso. Corrida corrida = Corrida.getByIdNull(adpRun.getId()); if(corrida == null){ adpRun.changeState(AdpRunState.FIN_ERROR, "Error al leer la corrida del proceso", false); adpRun.logError("Error al leer la corrida del proceso"); return; } corrida.addOutputFile(nombre, descripcion, fileDir+fileNamePdf); if (corrida.hasError()) { tx.rollback(); if(log.isDebugEnabled()){log.debug(funcName + ": tx.rollback");} String error = "Error al generar PDF para el formulario"; adpRun.changeState(AdpRunState.FIN_ERROR, error, false); adpRun.logError(error); } else { tx.commit(); if(log.isDebugEnabled()){log.debug(funcName + ": tx.commit");} adpRun.changeState(AdpRunState.FIN_OK, "Reporte Generado Ok", true); String adpMessage = "Resultado de la peticion del usuario "+userName +" hecha el "+DateUtil.formatDate(new Date(), DateUtil.ddSMMSYYYY_HH_MM_MASK); adpRun.changeDesCorrida(adpMessage); } log.debug(funcName + ": exit"); } catch (Exception e) { log.error("Service Error: ", e); if(tx != null) tx.rollback(); throw new DemodaServiceException(e); } finally { SiatHibernateUtil.closeSession(); } }
void function(AdpRun adpRun) throws Exception{ String funcName = DemodaUtil.currentMethodName(); Session session = null; Transaction tx = null; if (log.isDebugEnabled()) log.debug(funcName + STR); try { session = SiatHibernateUtil.currentSession(); tx = session.beginTransaction(); String ID_PROCESOMASIVO_PARAM = STR; String USER_NAME_PARAM = STR; String USER_ID_PARAM = STR; AdpParameter paramIdProcesoMasivo = adpRun.getAdpParameter(ID_PROCESOMASIVO_PARAM); AdpParameter paramUserName = adpRun.getAdpParameter(USER_NAME_PARAM); AdpParameter paramUserId = adpRun.getAdpParameter(USER_ID_PARAM); Long idProcesoMasivo = NumberUtil.getLong(paramIdProcesoMasivo.getValue()); String userName = paramUserName.getValue(); String userId = paramUserId.getValue(); DemodaUtil.currentUserContext().setUserName(userName); ProcesoMasivo procesoMasivo = ProcesoMasivo.getByIdNull(idProcesoMasivo); if(procesoMasivo == null){ adpRun.changeState(AdpRunState.FIN_ERROR, STR, false); adpRun.logError(STR); return; } InformeRespuestaOperativos informe = new InformeRespuestaOperativos(); informe.setFechaProceso(DateUtil.formatDate(procesoMasivo.getFechaEnvio(), DateUtil.dd_MM_YYYY_MASK)); informe.setFechaReporte(DateUtil.formatDate(new Date(), DateUtil.dd_MM_YYYY_MASK)); informe.setDesTipoProceso(procesoMasivo.getTipProMas().getDesTipProMas()); informe.setDesCorrida(procesoMasivo.getCorrida().getDesCorrida()); informe.setCantDeudas(GdeDAOFactory.getProMasDeuIncDAO().getCantidadDeuda(procesoMasivo)); informe.setCantDeudasPagas(GdeDAOFactory.getProMasDeuIncDAO().getCantidadDeudasPagas(procesoMasivo)); informe.setCantConvenios(GdeDAOFactory.getProMasDeuIncDAO().getCantidadConveniosFormalizados(procesoMasivo)); informe.setCantRecibos(GdeDAOFactory.getProMasDeuIncDAO().getCantidadRecibosGenerados(procesoMasivo)); informe.setCantDeudaEnConvenio(GdeDAOFactory.getProMasDeuIncDAO().getCantidadDeudaEnConvenio(procesoMasivo)); informe.setCantDeudaEnRecibo(GdeDAOFactory.getProMasDeuIncDAO().getCantidadDeudaEnRecibo(procesoMasivo)); PrintModel print =null; print = Formulario.getPrintModelForPDF(Formulario.COD_FRM_RESPUESTA_OPERATIVOS); print.putCabecera(STR, STR); print.putCabecera("Fecha", DateUtil.formatDate(new Date(), DateUtil.dd_MM_YYYY_MASK)); print.putCabecera("Hora", DateUtil.formatDate(new Date(), DateUtil.HOUR_MINUTE_MASK)); print.putCabecera(STR, userName); print.setData(informe); print.setTopeProfundidad(2); String fileDir = adpRun.getProcessDir(AdpRunDirEnum.SALIDA)+File.separator; String fileNamePdf = adpRun.getId()+STR+ userId +".pdf"; File pdfFile = new File(fileDir+fileNamePdf); OutputStream out = new java.io.FileOutputStream(pdfFile); out.write(print.getByteArray()); String nombre = STR; String descripcion = STR; Corrida corrida = Corrida.getByIdNull(adpRun.getId()); if(corrida == null){ adpRun.changeState(AdpRunState.FIN_ERROR, STR, false); adpRun.logError(STR); return; } corrida.addOutputFile(nombre, descripcion, fileDir+fileNamePdf); if (corrida.hasError()) { tx.rollback(); if(log.isDebugEnabled()){log.debug(funcName + STR);} String error = STR; adpRun.changeState(AdpRunState.FIN_ERROR, error, false); adpRun.logError(error); } else { tx.commit(); if(log.isDebugEnabled()){log.debug(funcName + STR);} adpRun.changeState(AdpRunState.FIN_OK, STR, true); String adpMessage = STR+userName +STR+DateUtil.formatDate(new Date(), DateUtil.ddSMMSYYYY_HH_MM_MASK); adpRun.changeDesCorrida(adpMessage); } log.debug(funcName + STR); } catch (Exception e) { log.error(STR, e); if(tx != null) tx.rollback(); throw new DemodaServiceException(e); } finally { SiatHibernateUtil.closeSession(); } }
/** * Generar Reporte de Respuesta Operativos (PDF). * * @param adpRun * @throws Exception */
Generar Reporte de Respuesta Operativos (PDF)
generarReporte
{ "repo_name": "avdata99/SIAT", "path": "siat-1.0-SOURCE/src/adpsiat/src/WEB-INF/src/ar/gov/rosario/siat/proceso/gde/ReporteRespuestaOperativosWorker.java", "license": "gpl-3.0", "size": 7181 }
[ "ar.gov.rosario.siat.base.buss.dao.SiatHibernateUtil", "ar.gov.rosario.siat.frm.buss.bean.Formulario", "ar.gov.rosario.siat.gde.buss.bean.ProcesoMasivo", "ar.gov.rosario.siat.gde.buss.dao.GdeDAOFactory", "ar.gov.rosario.siat.gde.iface.model.InformeRespuestaOperativos", "ar.gov.rosario.siat.pro.buss.bean.C...
import ar.gov.rosario.siat.base.buss.dao.SiatHibernateUtil; import ar.gov.rosario.siat.frm.buss.bean.Formulario; import ar.gov.rosario.siat.gde.buss.bean.ProcesoMasivo; import ar.gov.rosario.siat.gde.buss.dao.GdeDAOFactory; import ar.gov.rosario.siat.gde.iface.model.InformeRespuestaOperativos; import ar.gov.rosario.siat.pro.buss.bean.Corrida; import coop.tecso.adpcore.AdpRun; import coop.tecso.adpcore.AdpRunDirEnum; import coop.tecso.adpcore.AdpRunState; import coop.tecso.adpcore.engine.AdpParameter; import coop.tecso.demoda.iface.DemodaServiceException; import coop.tecso.demoda.iface.helper.DateUtil; import coop.tecso.demoda.iface.helper.DemodaUtil; import coop.tecso.demoda.iface.helper.NumberUtil; import coop.tecso.demoda.iface.model.PrintModel; import java.io.File; import java.io.OutputStream; import java.util.Date; import org.hibernate.Session; import org.hibernate.Transaction;
import ar.gov.rosario.siat.base.buss.dao.*; import ar.gov.rosario.siat.frm.buss.bean.*; import ar.gov.rosario.siat.gde.buss.bean.*; import ar.gov.rosario.siat.gde.buss.dao.*; import ar.gov.rosario.siat.gde.iface.model.*; import ar.gov.rosario.siat.pro.buss.bean.*; import coop.tecso.adpcore.*; import coop.tecso.adpcore.engine.*; import coop.tecso.demoda.iface.*; import coop.tecso.demoda.iface.helper.*; import coop.tecso.demoda.iface.model.*; import java.io.*; import java.util.*; import org.hibernate.*;
[ "ar.gov.rosario", "coop.tecso.adpcore", "coop.tecso.demoda", "java.io", "java.util", "org.hibernate" ]
ar.gov.rosario; coop.tecso.adpcore; coop.tecso.demoda; java.io; java.util; org.hibernate;
1,020,894
void replaceElement(@NotNull PsiElement element, String replacementText);
void replaceElement(@NotNull PsiElement element, String replacementText);
/** * Creates a replacement box for the specified element with the specified initial value. * * @param element the element to replace. * @param replacementText the initial value for the replacement. */
Creates a replacement box for the specified element with the specified initial value
replaceElement
{ "repo_name": "romankagan/DDBWorkbench", "path": "platform/lang-api/src/com/intellij/codeInsight/template/TemplateBuilder.java", "license": "apache-2.0", "size": 2991 }
[ "com.intellij.psi.PsiElement", "org.jetbrains.annotations.NotNull" ]
import com.intellij.psi.PsiElement; import org.jetbrains.annotations.NotNull;
import com.intellij.psi.*; import org.jetbrains.annotations.*;
[ "com.intellij.psi", "org.jetbrains.annotations" ]
com.intellij.psi; org.jetbrains.annotations;
690,844
public static void addJavaReservedWordsTo(Collection collection) { CollectionTools.addAll(collection, JAVA_RESERVED_WORDS); }
static void function(Collection collection) { CollectionTools.addAll(collection, JAVA_RESERVED_WORDS); }
/** * Return a set of the Java programming language reserved words. * These words cannot be used as identifiers (i.e. names). * http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html */
Return a set of the Java programming language reserved words. These words cannot be used as identifiers (i.e. names). HREF
addJavaReservedWordsTo
{ "repo_name": "gameduell/eclipselink.runtime", "path": "utils/eclipselink.utils.workbench/utility/source/org/eclipse/persistence/tools/workbench/utility/NameTools.java", "license": "epl-1.0", "size": 9191 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
719,353
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { return null; }
AxisAlignedBB function(World par1World, int par2, int par3, int par4) { return null; }
/** * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been * cleared to be reused) */
Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been cleared to be reused)
getCollisionBoundingBoxFromPool
{ "repo_name": "OwnAgePau/Soul-Forest", "path": "src/main/java/com/Mod_Ores/Blocks/Special/SoulTorch.java", "license": "lgpl-2.1", "size": 11315 }
[ "net.minecraft.util.AxisAlignedBB", "net.minecraft.world.World" ]
import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World;
import net.minecraft.util.*; import net.minecraft.world.*;
[ "net.minecraft.util", "net.minecraft.world" ]
net.minecraft.util; net.minecraft.world;
1,330,299
static void reset() { config = null; recordingOn = false; databaseRecorders = new ArrayList<>(); }
static void reset() { config = null; recordingOn = false; databaseRecorders = new ArrayList<>(); }
/** * Only used for testing: Resets Skuldsku to its initial state. */
Only used for testing: Resets Skuldsku to its initial state
reset
{ "repo_name": "steria/skuldsku", "path": "skuldsku-prod/src/main/java/no/steria/skuldsku/recorder/Skuldsku.java", "license": "lgpl-2.1", "size": 5401 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
2,120,562
private String generateNextFilename_withPlaceholderSubstitution(String pattern) throws FileNotFoundException { // First, determine the highest number in use so far. int highest_in_use = determineHighestNumberInUse(pattern); if (highest_number <= highest_in_use) { throw new FileNotFoundException(MSG__HIGHEST_NUMBER_REACHED); } return pattern.replace(PLACEHOLDER__RUNNING_NUMBER, String.valueOf(highest_in_use + 1)); }
String function(String pattern) throws FileNotFoundException { int highest_in_use = determineHighestNumberInUse(pattern); if (highest_number <= highest_in_use) { throw new FileNotFoundException(MSG__HIGHEST_NUMBER_REACHED); } return pattern.replace(PLACEHOLDER__RUNNING_NUMBER, String.valueOf(highest_in_use + 1)); }
/** * Generate a new filename by subsituting the placeholder for the next higher number. * <p> * The next higher number one plus the highest in use. * * @param pattern The pattern that contains a placeholder. * @return a file name, never {@code null}. */
Generate a new filename by subsituting the placeholder for the next higher number. The next higher number one plus the highest in use
generateNextFilename_withPlaceholderSubstitution
{ "repo_name": "mknecht/profiler4j", "path": "src/java/net/sf/profiler4j/console/util/export/FilenameGenerator.java", "license": "apache-2.0", "size": 11422 }
[ "java.io.FileNotFoundException" ]
import java.io.FileNotFoundException;
import java.io.*;
[ "java.io" ]
java.io;
385,161
@Test public void getCredit() { Assert.assertEquals(1.00, this.refund.getCredit(), 0.01); }
void function() { Assert.assertEquals(1.00, this.refund.getCredit(), 0.01); }
/** * Tests the amount refunded */
Tests the amount refunded
getCredit
{ "repo_name": "dataBaseError/FirstVu", "path": "back_end/src/testSuite/RefundTest.java", "license": "mit", "size": 1263 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
2,831,255
private static CacheConfiguration atomicsSystemCache(AtomicConfiguration cfg) { CacheConfiguration ccfg = new CacheConfiguration(); ccfg.setName(CU.ATOMICS_CACHE_NAME); ccfg.setAtomicityMode(TRANSACTIONAL); ccfg.setRebalanceMode(SYNC); ccfg.setWriteSynchronizationMode(FULL_SYNC); ccfg.setCacheMode(cfg.getCacheMode()); ccfg.setNodeFilter(CacheConfiguration.ALL_NODES); ccfg.setRebalanceOrder(-1); //Prior to user caches. if (cfg.getCacheMode() == PARTITIONED) ccfg.setBackups(cfg.getBackups()); return ccfg; }
static CacheConfiguration function(AtomicConfiguration cfg) { CacheConfiguration ccfg = new CacheConfiguration(); ccfg.setName(CU.ATOMICS_CACHE_NAME); ccfg.setAtomicityMode(TRANSACTIONAL); ccfg.setRebalanceMode(SYNC); ccfg.setWriteSynchronizationMode(FULL_SYNC); ccfg.setCacheMode(cfg.getCacheMode()); ccfg.setNodeFilter(CacheConfiguration.ALL_NODES); ccfg.setRebalanceOrder(-1); if (cfg.getCacheMode() == PARTITIONED) ccfg.setBackups(cfg.getBackups()); return ccfg; }
/** * Creates cache configuration for atomic data structures. * * @param cfg Atomic configuration. * @return Cache configuration for atomic data structures. */
Creates cache configuration for atomic data structures
atomicsSystemCache
{ "repo_name": "pperalta/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java", "license": "apache-2.0", "size": 107467 }
[ "org.apache.ignite.configuration.AtomicConfiguration", "org.apache.ignite.configuration.CacheConfiguration" ]
import org.apache.ignite.configuration.AtomicConfiguration; import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.*;
[ "org.apache.ignite" ]
org.apache.ignite;
560,465
synchronized public void sendConfiguration(net.sf.jaer.biasgen.Biasgen biasgen) throws HardwareInterfaceException { // log.info("sending biases for "+biasgen); if(gUsbIo==null) { // log.warning("gUusbIo=null, trying to open device"); try{ open(); }catch(HardwareInterfaceException e){ log.warning(e.getMessage()); return; // may not have been constructed yet. } } if(biasgen.getPotArray()==null) { log.warning("BiasgenUSBInterface.send(): potArray=null"); return; // may not have been constructed yet. } byte[] toSend=formatConfigurationBytes(biasgen); sendBiasBytes(toSend); HardwareInterfaceException.clearException(); }
synchronized void function(net.sf.jaer.biasgen.Biasgen biasgen) throws HardwareInterfaceException { if(gUsbIo==null) { try{ open(); }catch(HardwareInterfaceException e){ log.warning(e.getMessage()); return; } } if(biasgen.getPotArray()==null) { log.warning(STR); return; } byte[] toSend=formatConfigurationBytes(biasgen); sendBiasBytes(toSend); HardwareInterfaceException.clearException(); }
/** sends the ipot values. @param biasgen the biasgen which has the values to send */
sends the ipot values
sendConfiguration
{ "repo_name": "viktorbahr/jaer", "path": "src/net/sf/jaer/hardwareinterface/usb/cypressfx2/CypressFX2Biasgen.java", "license": "lgpl-2.1", "size": 7982 }
[ "net.sf.jaer.biasgen.Biasgen", "net.sf.jaer.hardwareinterface.HardwareInterfaceException" ]
import net.sf.jaer.biasgen.Biasgen; import net.sf.jaer.hardwareinterface.HardwareInterfaceException;
import net.sf.jaer.biasgen.*; import net.sf.jaer.hardwareinterface.*;
[ "net.sf.jaer" ]
net.sf.jaer;
739,290
public DeploymentSpi getDeploymentSpi() { return deploySpi; }
DeploymentSpi function() { return deploySpi; }
/** * Should return fully configured deployment SPI implementation. If not provided, * {@link LocalDeploymentSpi} will be used. * * @return Grid deployment SPI implementation or {@code null} to use default implementation. */
Should return fully configured deployment SPI implementation. If not provided, <code>LocalDeploymentSpi</code> will be used
getDeploymentSpi
{ "repo_name": "NSAmelchev/ignite", "path": "modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java", "license": "apache-2.0", "size": 127983 }
[ "org.apache.ignite.spi.deployment.DeploymentSpi" ]
import org.apache.ignite.spi.deployment.DeploymentSpi;
import org.apache.ignite.spi.deployment.*;
[ "org.apache.ignite" ]
org.apache.ignite;
924,900
public void addArtigo(Artigo artigo) { if(this.artigos == null){ this.artigos = new ArrayList<Artigo>(); } this.artigos.add(artigo); }
void function(Artigo artigo) { if(this.artigos == null){ this.artigos = new ArrayList<Artigo>(); } this.artigos.add(artigo); }
/** * Adiciona artigo na lista * @param artigo */
Adiciona artigo na lista
addArtigo
{ "repo_name": "FASAM-ES/projeto-global", "path": "ProjetoIntegracaoGlobal/src/main/java/br/com/fasam/projetointegracaoglobal/entidades/Usuario.java", "license": "gpl-2.0", "size": 3918 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
1,348,607
public BgpDpid add(final NodeDescriptors value) { log.debug("BgpDpid :: add function"); if (value != null) { List<BgpValueType> subTlvs = value.getSubTlvs(); ListIterator<BgpValueType> listIterator = subTlvs.listIterator(); while (listIterator.hasNext()) { BgpValueType tlv = listIterator.next(); if (tlv.getType() == AutonomousSystemTlv.TYPE) { this.stringBuilder.append(":ASN=").append(((AutonomousSystemTlv) tlv).getAsNum()); } else if (tlv.getType() == BgpLSIdentifierTlv.TYPE) { this.stringBuilder.append(":DOMAINID=").append(((BgpLSIdentifierTlv) tlv).getBgpLsIdentifier()); } else if (tlv.getType() == NodeDescriptors.IGP_ROUTERID_TYPE) { if (tlv instanceof IsIsNonPseudonode) { this.stringBuilder.append(":ISOID=").append( isoNodeIdString(((IsIsNonPseudonode) tlv).getIsoNodeId())); } else if (tlv instanceof IsIsPseudonode) { IsIsPseudonode isisPseudonode = ((IsIsPseudonode) tlv); this.stringBuilder.append(":ISOID=").append( isoNodeIdString(((IsIsPseudonode) tlv).getIsoNodeId())); this.stringBuilder.append(":PSN=").append(isisPseudonode.getPsnIdentifier()); } else if (tlv instanceof OspfNonPseudonode) { this.stringBuilder.append(":RID=").append(((OspfNonPseudonode) tlv).getrouterID()); } else if (tlv instanceof OspfPseudonode) { this.stringBuilder.append(":RID=").append(((OspfPseudonode) tlv).getrouterID()); } } } } return this; }
BgpDpid function(final NodeDescriptors value) { log.debug(STR); if (value != null) { List<BgpValueType> subTlvs = value.getSubTlvs(); ListIterator<BgpValueType> listIterator = subTlvs.listIterator(); while (listIterator.hasNext()) { BgpValueType tlv = listIterator.next(); if (tlv.getType() == AutonomousSystemTlv.TYPE) { this.stringBuilder.append(":ASN=").append(((AutonomousSystemTlv) tlv).getAsNum()); } else if (tlv.getType() == BgpLSIdentifierTlv.TYPE) { this.stringBuilder.append(STR).append(((BgpLSIdentifierTlv) tlv).getBgpLsIdentifier()); } else if (tlv.getType() == NodeDescriptors.IGP_ROUTERID_TYPE) { if (tlv instanceof IsIsNonPseudonode) { this.stringBuilder.append(STR).append( isoNodeIdString(((IsIsNonPseudonode) tlv).getIsoNodeId())); } else if (tlv instanceof IsIsPseudonode) { IsIsPseudonode isisPseudonode = ((IsIsPseudonode) tlv); this.stringBuilder.append(STR).append( isoNodeIdString(((IsIsPseudonode) tlv).getIsoNodeId())); this.stringBuilder.append(":PSN=").append(isisPseudonode.getPsnIdentifier()); } else if (tlv instanceof OspfNonPseudonode) { this.stringBuilder.append(":RID=").append(((OspfNonPseudonode) tlv).getrouterID()); } else if (tlv instanceof OspfPseudonode) { this.stringBuilder.append(":RID=").append(((OspfPseudonode) tlv).getrouterID()); } } } } return this; }
/** * Obtains instance of this class by appending stringBuilder with node descriptor value. * * @param value node descriptor * @return instance of this class */
Obtains instance of this class by appending stringBuilder with node descriptor value
add
{ "repo_name": "LorenzReinhart/ONOSnew", "path": "protocols/bgp/api/src/main/java/org/onosproject/bgp/controller/BgpDpid.java", "license": "apache-2.0", "size": 6827 }
[ "java.util.List", "java.util.ListIterator", "org.onosproject.bgpio.protocol.linkstate.NodeDescriptors", "org.onosproject.bgpio.types.AutonomousSystemTlv", "org.onosproject.bgpio.types.BgpLSIdentifierTlv", "org.onosproject.bgpio.types.BgpValueType", "org.onosproject.bgpio.types.IsIsNonPseudonode", "org...
import java.util.List; import java.util.ListIterator; import org.onosproject.bgpio.protocol.linkstate.NodeDescriptors; import org.onosproject.bgpio.types.AutonomousSystemTlv; import org.onosproject.bgpio.types.BgpLSIdentifierTlv; import org.onosproject.bgpio.types.BgpValueType; import org.onosproject.bgpio.types.IsIsNonPseudonode; import org.onosproject.bgpio.types.IsIsPseudonode; import org.onosproject.bgpio.types.OspfNonPseudonode; import org.onosproject.bgpio.types.OspfPseudonode;
import java.util.*; import org.onosproject.bgpio.protocol.linkstate.*; import org.onosproject.bgpio.types.*;
[ "java.util", "org.onosproject.bgpio" ]
java.util; org.onosproject.bgpio;
1,253,801
public Collection<V> getValues();
Collection<V> function();
/** * All values cached * @return a collection */
All values cached
getValues
{ "repo_name": "dilshadmustafa/bigqueue", "path": "src/main/java/com/leansoft/bigqueue/cache/ILRUCache.java", "license": "apache-2.0", "size": 2441 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
2,273,817
void disable(KnowledgeBase knowledgeBase, Object processorClass);
void disable(KnowledgeBase knowledgeBase, Object processorClass);
/** * Disables a processor. * * @param knowledgeBase knowledge base. * @param processorClass processor class. */
Disables a processor
disable
{ "repo_name": "softelnet/sponge", "path": "sponge-api/src/main/java/org/openksavi/sponge/engine/ProcessorManager.java", "license": "apache-2.0", "size": 4590 }
[ "org.openksavi.sponge.kb.KnowledgeBase" ]
import org.openksavi.sponge.kb.KnowledgeBase;
import org.openksavi.sponge.kb.*;
[ "org.openksavi.sponge" ]
org.openksavi.sponge;
322,846
public static <E> Closure<E> ifClosure(final Predicate<? super E> predicate, final Closure<? super E> trueClosure, final Closure<? super E> falseClosure) { if (predicate == null) { throw new NullPointerException("Predicate must not be null"); } if (trueClosure == null || falseClosure == null) { throw new NullPointerException("Closures must not be null"); } return new IfClosure<E>(predicate, trueClosure, falseClosure); } public IfClosure(final Predicate<? super E> predicate, final Closure<? super E> trueClosure) { this(predicate, trueClosure, NOPClosure.nopClosure()); } public IfClosure(final Predicate<? super E> predicate, final Closure<? super E> trueClosure, final Closure<? super E> falseClosure) { super(); iPredicate = predicate; iTrueClosure = trueClosure; iFalseClosure = falseClosure; }
static <E> Closure<E> function(final Predicate<? super E> predicate, final Closure<? super E> trueClosure, final Closure<? super E> falseClosure) { if (predicate == null) { throw new NullPointerException(STR); } if (trueClosure == null falseClosure == null) { throw new NullPointerException(STR); } return new IfClosure<E>(predicate, trueClosure, falseClosure); } public IfClosure(final Predicate<? super E> predicate, final Closure<? super E> trueClosure) { this(predicate, trueClosure, NOPClosure.nopClosure()); } public IfClosure(final Predicate<? super E> predicate, final Closure<? super E> trueClosure, final Closure<? super E> falseClosure) { super(); iPredicate = predicate; iTrueClosure = trueClosure; iFalseClosure = falseClosure; }
/** * Factory method that performs validation. * * @param <E> the type that the closure acts on * @param predicate predicate to switch on * @param trueClosure closure used if true * @param falseClosure closure used if false * @return the <code>if</code> closure * @throws NullPointerException if any argument is null */
Factory method that performs validation
ifClosure
{ "repo_name": "MuShiiii/commons-collections", "path": "src/main/java/org/apache/commons/collections4/functors/IfClosure.java", "license": "apache-2.0", "size": 5221 }
[ "org.apache.commons.collections4.Closure", "org.apache.commons.collections4.Predicate" ]
import org.apache.commons.collections4.Closure; import org.apache.commons.collections4.Predicate;
import org.apache.commons.collections4.*;
[ "org.apache.commons" ]
org.apache.commons;
1,740,207
public void stopAndAwaitTask(ConnectorTaskId taskId) { stopTask(taskId); awaitStopTasks(Collections.singletonList(taskId)); }
void function(ConnectorTaskId taskId) { stopTask(taskId); awaitStopTasks(Collections.singletonList(taskId)); }
/** * Stop a task that belongs to this worker and await its termination. * * @param taskId the ID of the task to be stopped. */
Stop a task that belongs to this worker and await its termination
stopAndAwaitTask
{ "repo_name": "rhauch/kafka", "path": "connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Worker.java", "license": "apache-2.0", "size": 20754 }
[ "java.util.Collections", "org.apache.kafka.connect.util.ConnectorTaskId" ]
import java.util.Collections; import org.apache.kafka.connect.util.ConnectorTaskId;
import java.util.*; import org.apache.kafka.connect.util.*;
[ "java.util", "org.apache.kafka" ]
java.util; org.apache.kafka;
1,572,616
void removeThing(ThingUID thingUID);
void removeThing(ThingUID thingUID);
/** * A thing with the given {@link Thing} UID was removed. * * @param thingUID * thing UID of the removed object */
A thing with the given <code>Thing</code> UID was removed
removeThing
{ "repo_name": "phxql/smarthome", "path": "bundles/core/org.eclipse.smarthome.core.thing/src/main/java/org/eclipse/smarthome/core/thing/binding/ThingHandlerFactory.java", "license": "epl-1.0", "size": 2575 }
[ "org.eclipse.smarthome.core.thing.ThingUID" ]
import org.eclipse.smarthome.core.thing.ThingUID;
import org.eclipse.smarthome.core.thing.*;
[ "org.eclipse.smarthome" ]
org.eclipse.smarthome;
2,267,442
@Deprecated public static Ports getInstance(BlockPos pos) { DefaultPorts ports = new DefaultPorts(); ports.setBlockPosition1(pos); return ports; }
static Ports function(BlockPos pos) { DefaultPorts ports = new DefaultPorts(); ports.setBlockPosition1(pos); return ports; }
/** * Factory method. * * @param pos block position. * * @return ports. */
Factory method
getInstance
{ "repo_name": "athrane/bassebombecraft", "path": "src/main/java/bassebombecraft/operator/DefaultPorts.java", "license": "gpl-3.0", "size": 20192 }
[ "net.minecraft.util.math.BlockPos" ]
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.*;
[ "net.minecraft.util" ]
net.minecraft.util;
623,900
public boolean attackEntityFrom(DamageSource source, float amount) { if (this.isEntityInvulnerable(source)) { return false; } else { if (!this.isDead && !this.world.isRemote) { this.setDead(); this.setBeenAttacked(); this.onBroken(source.getTrueSource()); } return true; } }
boolean function(DamageSource source, float amount) { if (this.isEntityInvulnerable(source)) { return false; } else { if (!this.isDead && !this.world.isRemote) { this.setDead(); this.setBeenAttacked(); this.onBroken(source.getTrueSource()); } return true; } }
/** * Called when the entity is attacked. */
Called when the entity is attacked
attackEntityFrom
{ "repo_name": "TheGreatAndPowerfulWeegee/wipunknown", "path": "build/tmp/recompileMc/sources/net/minecraft/entity/EntityHanging.java", "license": "gpl-3.0", "size": 11406 }
[ "net.minecraft.util.DamageSource" ]
import net.minecraft.util.DamageSource;
import net.minecraft.util.*;
[ "net.minecraft.util" ]
net.minecraft.util;
431,472
public List<Node<E>> getChildren() { return children; } }
List<Node<E>> function() { return children; } }
/** * Add getter childen. * * @return tag. */
Add getter childen
getChildren
{ "repo_name": "1Evgeny/java-a-to-z", "path": "chapter_005_Pro/src/main/java/by/vorokhobko/Tree/Tree.java", "license": "apache-2.0", "size": 4087 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
876,933
public static Uri getContentUri(String level) { return Uri.parse(CONTENT_UNIVERSAL_APPLICATIONS_AUTHORITY_SLASH + level); } public static final Uri CONTENT_URI = getContentUri("applications"); public static final Uri CONTENT_URI_ITEM = getContentUri("applications/#"); public static final String CONTENT_TYPE = "vnd.android.cursor.dir/applications"; public static final String CONTENT_TYPE_ITEM = "vnd.android.cursor.item/applications"; } }
static Uri function(String level) { return Uri.parse(CONTENT_UNIVERSAL_APPLICATIONS_AUTHORITY_SLASH + level); } static final Uri CONTENT_URI = function(STR); static final Uri CONTENT_URI_ITEM = function(STR); public static final String CONTENT_TYPE = STR; public static final String CONTENT_TYPE_ITEM = STR; } }
/** * Get the content:// style URI for the video media table on the * given volume. * * @param volumeName * the name of the volume to get the URI for * @return the URI to the video media table on the given volume */
Get the content:// style URI for the video media table on the given volume
getContentUri
{ "repo_name": "13922841464/frostwire-android", "path": "src/core/com/frostwire/android/core/providers/UniversalStore.java", "license": "gpl-3.0", "size": 6770 }
[ "android.net.Uri" ]
import android.net.Uri;
import android.net.*;
[ "android.net" ]
android.net;
1,226,950
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
/** * Handles the HTTP * <code>GET</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */
Handles the HTTP <code>GET</code> method
doGet
{ "repo_name": "NodoSoftware/Bridge", "path": "Bridge_Primera_iteracion/src/java/Servlets/saveAporte.java", "license": "mit", "size": 2897 }
[ "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;
1,327,669
public void insert(final Pair<Integer, T>... indexItemPairs) { insert(Arrays.asList(indexItemPairs)); }
void function(final Pair<Integer, T>... indexItemPairs) { insert(Arrays.asList(indexItemPairs)); }
/** * Inserts items at given indexes. Will show an entrance animation for the new items if the newly added item is visible. * Will also call {@link Insertable#add(int, Object)} of the root {@link android.widget.BaseAdapter}. * * @param indexItemPairs the index-item pairs to insert. The first argument of the {@code Pair} is the index, the second argument is the item. */
Inserts items at given indexes. Will show an entrance animation for the new items if the newly added item is visible. Will also call <code>Insertable#add(int, Object)</code> of the root <code>android.widget.BaseAdapter</code>
insert
{ "repo_name": "MichaelArchangel/ArchangelKit", "path": "listViewAnimation/src/main/java/com/nhaarman/listviewanimations/itemmanipulation/animateaddition/AnimateAdditionAdapter.java", "license": "mit", "size": 13472 }
[ "android.util.Pair", "java.util.Arrays" ]
import android.util.Pair; import java.util.Arrays;
import android.util.*; import java.util.*;
[ "android.util", "java.util" ]
android.util; java.util;
2,853,976
public Builder addStream(OutputStreamContext stream) { context.streams.add(DefaultOutputStreamContext.Builder.newBuilder(stream).build().setPortContext(context)); return this; }
Builder function(OutputStreamContext stream) { context.streams.add(DefaultOutputStreamContext.Builder.newBuilder(stream).build().setPortContext(context)); return this; }
/** * Adds a connection to the port. * * @param connection A port connection to add. * @return The context builder. */
Adds a connection to the port
addStream
{ "repo_name": "kuujo/vertigo", "path": "core/src/main/java/net/kuujo/vertigo/io/port/impl/DefaultOutputPortContext.java", "license": "apache-2.0", "size": 7814 }
[ "net.kuujo.vertigo.io.stream.OutputStreamContext", "net.kuujo.vertigo.io.stream.impl.DefaultOutputStreamContext" ]
import net.kuujo.vertigo.io.stream.OutputStreamContext; import net.kuujo.vertigo.io.stream.impl.DefaultOutputStreamContext;
import net.kuujo.vertigo.io.stream.*; import net.kuujo.vertigo.io.stream.impl.*;
[ "net.kuujo.vertigo" ]
net.kuujo.vertigo;
967,364
public static AnimationCompletable translateQuicklyBy(@NonNull View view, float translationXBy, float translationYBy, Interpolator interpolator) { return translateBy(view, translationXBy, translationYBy, AnimationConstants.DURATION_QUICK, interpolator); }
static AnimationCompletable function(@NonNull View view, float translationXBy, float translationYBy, Interpolator interpolator) { return translateBy(view, translationXBy, translationYBy, AnimationConstants.DURATION_QUICK, interpolator); }
/** * Quickly translates the given view by the specified values. * @param view View to translate. * @param translationXBy Target horizontal translation value difference of the view. * @param translationYBy Target vertical translation value difference of the view. * @param interpolator Interpolator to use with the animation. * @return Completable which starts animation once subscribed to. */
Quickly translates the given view by the specified values
translateQuicklyBy
{ "repo_name": "PSPDFKit-labs/VanGogh", "path": "vangogh/src/main/java/com/pspdfkit/labs/vangogh/api/TranslateAnimations.java", "license": "mit", "size": 11084 }
[ "android.view.View", "android.view.animation.Interpolator", "com.pspdfkit.labs.vangogh.rx.AnimationCompletable", "io.reactivex.annotations.NonNull" ]
import android.view.View; import android.view.animation.Interpolator; import com.pspdfkit.labs.vangogh.rx.AnimationCompletable; import io.reactivex.annotations.NonNull;
import android.view.*; import android.view.animation.*; import com.pspdfkit.labs.vangogh.rx.*; import io.reactivex.annotations.*;
[ "android.view", "com.pspdfkit.labs", "io.reactivex.annotations" ]
android.view; com.pspdfkit.labs; io.reactivex.annotations;
1,256,608
private Number getIdColumnData(ResultSet resultSet, ResultSetMetaData metaData, int columnIndex) throws SQLException { int typeVal = metaData.getColumnType(columnIndex); switch (typeVal) { case Types.BIGINT : case Types.DECIMAL : case Types.NUMERIC : return (Number) resultSet.getLong(columnIndex); case Types.INTEGER : return (Number) resultSet.getInt(columnIndex); default : String columnName = metaData.getColumnName(columnIndex); throw new SQLException("Unexpected ID column type " + TypeValMapper.getSqlTypeForTypeVal(typeVal) + " (typeVal " + typeVal + ") in column " + columnName + "(#" + columnIndex + ") is not a number"); } }
Number function(ResultSet resultSet, ResultSetMetaData metaData, int columnIndex) throws SQLException { int typeVal = metaData.getColumnType(columnIndex); switch (typeVal) { case Types.BIGINT : case Types.DECIMAL : case Types.NUMERIC : return (Number) resultSet.getLong(columnIndex); case Types.INTEGER : return (Number) resultSet.getInt(columnIndex); default : String columnName = metaData.getColumnName(columnIndex); throw new SQLException(STR + TypeValMapper.getSqlTypeForTypeVal(typeVal) + STR + typeVal + STR + columnName + "(#" + columnIndex + STR); } }
/** * Return the id associated with the column. */
Return the id associated with the column
getIdColumnData
{ "repo_name": "dankito/ormlite-jpa-jdbc", "path": "src/main/java/com/j256/ormlite/jdbc/JdbcDatabaseConnection.java", "license": "isc", "size": 11580 }
[ "java.sql.ResultSet", "java.sql.ResultSetMetaData", "java.sql.SQLException", "java.sql.Types" ]
import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Types;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,896,085
List<List<PrioritisedRule>> apply();
List<List<PrioritisedRule>> apply();
/** * <p>This method applies {@code policyPriorityRoles}s and afterwards * {@code rulePriorityRoles}s. * * @return {@code List} of {@code List} of {@code FlowControlRuleMethod}s, * sorted according to the priorityRoles. */
This method applies policyPriorityRoless and afterwards rulePriorityRoless
apply
{ "repo_name": "0nse/Polsearchine", "path": "Polsearchine-ejb/src/java/de/uni_koblenz/aggrimm/icp/facades/local/infoAlgorithmProcessors/IPriorityProcessorLocal.java", "license": "gpl-3.0", "size": 1719 }
[ "de.uni_koblenz.aggrimm.icp.policyProcessing.algorithmProcessors.prioritisation.wrappers.PrioritisedRule", "java.util.List" ]
import de.uni_koblenz.aggrimm.icp.policyProcessing.algorithmProcessors.prioritisation.wrappers.PrioritisedRule; import java.util.List;
import de.uni_koblenz.aggrimm.icp.*; import java.util.*;
[ "de.uni_koblenz.aggrimm", "java.util" ]
de.uni_koblenz.aggrimm; java.util;
819,715
public void setCountExpression(String expression) { _countExpression = Val.chkStr(expression); }
void function(String expression) { _countExpression = Val.chkStr(expression); }
/** * Sets the selection expression. * @param expression the selection expression */
Sets the selection expression
setCountExpression
{ "repo_name": "usgin/usgin-geoportal", "path": "src/com/esri/gpt/catalog/schema/Interrogation.java", "license": "apache-2.0", "size": 6152 }
[ "com.esri.gpt.framework.util.Val" ]
import com.esri.gpt.framework.util.Val;
import com.esri.gpt.framework.util.*;
[ "com.esri.gpt" ]
com.esri.gpt;
2,827,570
// TODO remove this method once all Students have been migrated to CourseStudents @Deprecated public List<StudentAttributes> getAllStudents() { Map<String, StudentAttributes> result = new LinkedHashMap<>(); for (StudentAttributes student : getAllCourseStudents()) { result.put(student.getId(), student); } return new ArrayList<>(result.values()); }
List<StudentAttributes> function() { Map<String, StudentAttributes> result = new LinkedHashMap<>(); for (StudentAttributes student : getAllCourseStudents()) { result.put(student.getId(), student); } return new ArrayList<>(result.values()); }
/** * This method is not scalable. Not to be used unless for admin features. * @return the list of all students in the database. */
This method is not scalable. Not to be used unless for admin features
getAllStudents
{ "repo_name": "Mynk96/teammates", "path": "src/main/java/teammates/storage/api/StudentsDb.java", "license": "gpl-2.0", "size": 24718 }
[ "java.util.ArrayList", "java.util.LinkedHashMap", "java.util.List", "java.util.Map" ]
import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
808,395
return sendAsync(HttpMethod.GET, null); }
return sendAsync(HttpMethod.GET, null); }
/** * Gets the WindowsInformationProtectionNetworkLearningSummary from the service * * @return a future with the result */
Gets the WindowsInformationProtectionNetworkLearningSummary from the service
getAsync
{ "repo_name": "microsoftgraph/msgraph-sdk-java", "path": "src/main/java/com/microsoft/graph/requests/WindowsInformationProtectionNetworkLearningSummaryRequest.java", "license": "mit", "size": 7866 }
[ "com.microsoft.graph.http.HttpMethod" ]
import com.microsoft.graph.http.HttpMethod;
import com.microsoft.graph.http.*;
[ "com.microsoft.graph" ]
com.microsoft.graph;
2,021,396
public static byte[] convertObjectToJsonBytes(Object object) throws IOException { ObjectMapper mapper = new ObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); JodaModule module = new JodaModule(); module.addSerializer(DateTime.class, new CustomDateTimeSerializer()); module.addSerializer(LocalDate.class, new CustomLocalDateSerializer()); mapper.registerModule(module); return mapper.writeValueAsBytes(object); }
static byte[] function(Object object) throws IOException { ObjectMapper mapper = new ObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); JodaModule module = new JodaModule(); module.addSerializer(DateTime.class, new CustomDateTimeSerializer()); module.addSerializer(LocalDate.class, new CustomLocalDateSerializer()); mapper.registerModule(module); return mapper.writeValueAsBytes(object); }
/** * Convert an object to JSON byte array. * * @param object * the object to convert * @return the JSON byte array * @throws IOException */
Convert an object to JSON byte array
convertObjectToJsonBytes
{ "repo_name": "dalbelap/flipper-reverse-image-search", "path": "src/test/java/gal/udc/fic/muei/tfm/dap/flipper/web/rest/TestUtil.java", "license": "gpl-3.0", "size": 1964 }
[ "com.fasterxml.jackson.annotation.JsonInclude", "com.fasterxml.jackson.databind.ObjectMapper", "com.fasterxml.jackson.datatype.joda.JodaModule", "java.io.IOException", "org.joda.time.DateTime", "org.joda.time.LocalDate" ]
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.joda.JodaModule; import java.io.IOException; import org.joda.time.DateTime; import org.joda.time.LocalDate;
import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.datatype.joda.*; import java.io.*; import org.joda.time.*;
[ "com.fasterxml.jackson", "java.io", "org.joda.time" ]
com.fasterxml.jackson; java.io; org.joda.time;
768,434
@Test public void testGetMasterForNull() { expect(mockService.getMasterFor(anyObject())).andReturn(null).anyTimes(); replay(mockService); final WebTarget wt = target(); final Response response = wt.path("mastership/" + deviceId1.toString() + "/master").request().get(); assertEquals(404, response.getStatus()); }
void function() { expect(mockService.getMasterFor(anyObject())).andReturn(null).anyTimes(); replay(mockService); final WebTarget wt = target(); final Response response = wt.path(STR + deviceId1.toString() + STR).request().get(); assertEquals(404, response.getStatus()); }
/** * Tests the result of the REST API GET when there is no active master. */
Tests the result of the REST API GET when there is no active master
testGetMasterForNull
{ "repo_name": "kuujo/onos", "path": "web/api/src/test/java/org/onosproject/rest/resources/MastershipResourceTest.java", "license": "apache-2.0", "size": 13242 }
[ "javax.ws.rs.client.WebTarget", "javax.ws.rs.core.Response", "org.easymock.EasyMock", "org.junit.Assert" ]
import javax.ws.rs.client.WebTarget; import javax.ws.rs.core.Response; import org.easymock.EasyMock; import org.junit.Assert;
import javax.ws.rs.client.*; import javax.ws.rs.core.*; import org.easymock.*; import org.junit.*;
[ "javax.ws", "org.easymock", "org.junit" ]
javax.ws; org.easymock; org.junit;
2,479,580
public boolean validatePassword(final char[] password, final String correctHash) throws NoSuchAlgorithmException, InvalidKeySpecException { // Decode the hash into its parameters if (ValidationUtils.isValid(correctHash)) { final String[] params = correctHash.split(":"); final int iterations = FastNumberUtils.parseIntWithCheck(params[ITERATION_INDEX]); final byte[] salt = fromDecoding(params[SALT_INDEX]); final byte[] hash = fromDecoding(params[PBKDF2_INDEX]); // Compute the hash of the provided password, using the same salt, // iteration count, and hash length final byte[] testHash = pbkdf2(password, salt, iterations, hash.length); // Compare the hashes in constant time. The password is correct if // both hashes match. return slowEquals(hash, testHash); } else { System.err.println("Error, null or empty password hash provided."); return false; } }
boolean function(final char[] password, final String correctHash) throws NoSuchAlgorithmException, InvalidKeySpecException { if (ValidationUtils.isValid(correctHash)) { final String[] params = correctHash.split(":"); final int iterations = FastNumberUtils.parseIntWithCheck(params[ITERATION_INDEX]); final byte[] salt = fromDecoding(params[SALT_INDEX]); final byte[] hash = fromDecoding(params[PBKDF2_INDEX]); final byte[] testHash = pbkdf2(password, salt, iterations, hash.length); return slowEquals(hash, testHash); } else { System.err.println(STR); return false; } }
/** * Validates a password using a hash. * * @param password * the password to check * @param correctHash * the hash of the valid password * @return true if the password is correct, false if not */
Validates a password using a hash
validatePassword
{ "repo_name": "danieljue/graphene", "path": "graphene-parent/graphene-util/src/main/java/graphene/util/crypto/PasswordHash.java", "license": "apache-2.0", "size": 9822 }
[ "java.security.NoSuchAlgorithmException", "java.security.spec.InvalidKeySpecException" ]
import java.security.NoSuchAlgorithmException; import java.security.spec.InvalidKeySpecException;
import java.security.*; import java.security.spec.*;
[ "java.security" ]
java.security;
750,003
@Test public void whenSelectShowTaskTrackerTest() throws IOException { Item one = new Item("name1", "desc1"); this.tracker.add(one); this.tracker.addComment(one, "comment1"); final List<String> answers = new ArrayList<>(); answers.add("4"); answers.add("6"); answers.add("y"); final Input stubInput = new StubInput(answers); final Main main = new Main(stubInput, this.tracker); main.init(); assertThat(one.toString(), is(this.tracker.getAll().get(0).toString())); }
void function() throws IOException { Item one = new Item("name1", "desc1"); this.tracker.add(one); this.tracker.addComment(one, STR); final List<String> answers = new ArrayList<>(); answers.add("4"); answers.add("6"); answers.add("y"); final Input stubInput = new StubInput(answers); final Main main = new Main(stubInput, this.tracker); main.init(); assertThat(one.toString(), is(this.tracker.getAll().get(0).toString())); }
/** * method show All task. * @throws IOException IOException */
method show All task
whenSelectShowTaskTrackerTest
{ "repo_name": "RomanLotnyk/lotnyk", "path": "chapter_002/src/test/java/ru/lotnyk/start/MainTest.java", "license": "apache-2.0", "size": 6076 }
[ "java.io.IOException", "java.util.ArrayList", "java.util.List", "org.hamcrest.CoreMatchers", "org.hamcrest.MatcherAssert", "ru.lotnyk.model.Item" ]
import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.hamcrest.CoreMatchers; import org.hamcrest.MatcherAssert; import ru.lotnyk.model.Item;
import java.io.*; import java.util.*; import org.hamcrest.*; import ru.lotnyk.model.*;
[ "java.io", "java.util", "org.hamcrest", "ru.lotnyk.model" ]
java.io; java.util; org.hamcrest; ru.lotnyk.model;
2,280,842
public void testOnlyNewlines() throws IOException { compareStyled("\n\n\n"); }
void function() throws IOException { compareStyled(STR); }
/** * Test styler for file with only newlines * * @throws IOException */
Test styler for file with only newlines
testOnlyNewlines
{ "repo_name": "DeLaSalleUniversity-Manila/ForkHub-macexcel", "path": "app/src/androidTest/java/com/github/zion/tests/commit/DiffStylerTest.java", "license": "apache-2.0", "size": 4185 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,935,872
public static Uri getUri(File file) { if (file != null) { return Uri.fromFile(file); } return null; }
static Uri function(File file) { if (file != null) { return Uri.fromFile(file); } return null; }
/** * Convert File into Uri. * * @param file * @return uri */
Convert File into Uri
getUri
{ "repo_name": "zulip/zulip-android", "path": "app/src/main/java/com/zulip/android/util/FileUtils.java", "license": "apache-2.0", "size": 19227 }
[ "android.net.Uri", "java.io.File" ]
import android.net.Uri; import java.io.File;
import android.net.*; import java.io.*;
[ "android.net", "java.io" ]
android.net; java.io;
2,072,690
public void setTime(long time) { final long curtime = getTime(); final long offset = time - curtime; mEndTime += offset; mStartTime += offset; // enforceMinimum(); invalidate(); notifyListener(); } private static final int DATE_FORMAT_ARGS = DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_YEAR | DateUtils.FORMAT_SHOW_WEEKDAY;
void function(long time) { final long curtime = getTime(); final long offset = time - curtime; mEndTime += offset; mStartTime += offset; invalidate(); notifyListener(); } private static final int DATE_FORMAT_ARGS = DateUtils.FORMAT_SHOW_TIME DateUtils.FORMAT_SHOW_DATE DateUtils.FORMAT_SHOW_YEAR DateUtils.FORMAT_SHOW_WEEKDAY;
/** * Sets the current time. * * @param time * the time in milliseconds */
Sets the current time
setTime
{ "repo_name": "xxv/DearFutureSelf", "path": "src/info/staticfree/android/widget/TimelineEntry.java", "license": "gpl-3.0", "size": 29979 }
[ "android.text.format.DateUtils" ]
import android.text.format.DateUtils;
import android.text.format.*;
[ "android.text" ]
android.text;
748,811
private static void writeMetadataDownloadId(final Context context, final String uri, final long downloadId) { MetadataDbHelper.registerMetadataDownloadId(context, uri, downloadId); } public static final int DOWNLOAD_OVER_METERED_SETTING_UNKNOWN = 0; public static final int DOWNLOAD_OVER_METERED_ALLOWED = 1; public static final int DOWNLOAD_OVER_METERED_DISALLOWED = 2;
static void function(final Context context, final String uri, final long downloadId) { MetadataDbHelper.registerMetadataDownloadId(context, uri, downloadId); } public static final int DOWNLOAD_OVER_METERED_SETTING_UNKNOWN = 0; public static final int DOWNLOAD_OVER_METERED_ALLOWED = 1; public static final int DOWNLOAD_OVER_METERED_DISALLOWED = 2;
/** * Write the DownloadManager ID of the currently downloading metadata to permanent storage. * * @param context to open shared prefs * @param uri the uri of the metadata * @param downloadId the id returned by DownloadManager */
Write the DownloadManager ID of the currently downloading metadata to permanent storage
writeMetadataDownloadId
{ "repo_name": "s20121035/rk3288_android5.1_repo", "path": "packages/inputmethods/LatinIME/java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java", "license": "gpl-3.0", "size": 57118 }
[ "android.content.Context" ]
import android.content.Context;
import android.content.*;
[ "android.content" ]
android.content;
1,517,169
Date value = (Date) getValue(); return value != null ? new LocalDateTime(value).toString(formatter) : ""; }
Date value = (Date) getValue(); return value != null ? new LocalDateTime(value).toString(formatter) : ""; }
/** * Format the YearMonthDay as String, using the specified format. * * @return DateTime formatted string */
Format the YearMonthDay as String, using the specified format
getAsText
{ "repo_name": "markquinn12/springBoot-JHipster-AJP-Port", "path": "src/main/java/mark/quinn/web/propertyeditors/LocaleDateTimeEditor.java", "license": "mit", "size": 2016 }
[ "java.util.Date", "org.joda.time.LocalDateTime" ]
import java.util.Date; import org.joda.time.LocalDateTime;
import java.util.*; import org.joda.time.*;
[ "java.util", "org.joda.time" ]
java.util; org.joda.time;
2,107,717
public static void importRedirectionList(Context context, THashMap<String, String> redirectionList) { ContentValues[] values = new ContentValues[redirectionList.size()]; int i = 0; for (HashMap.Entry<String, String> item : redirectionList.entrySet()) { values[i] = new ContentValues(); values[i].put(RedirectionList.HOSTNAME, item.getKey()); values[i].put(RedirectionList.IP, item.getValue()); values[i].put(RedirectionList.ENABLED, true); // default is enabled i++; } // insert as bulk operation context.getContentResolver().bulkInsert(RedirectionList.CONTENT_URI, values); }
static void function(Context context, THashMap<String, String> redirectionList) { ContentValues[] values = new ContentValues[redirectionList.size()]; int i = 0; for (HashMap.Entry<String, String> item : redirectionList.entrySet()) { values[i] = new ContentValues(); values[i].put(RedirectionList.HOSTNAME, item.getKey()); values[i].put(RedirectionList.IP, item.getValue()); values[i].put(RedirectionList.ENABLED, true); i++; } context.getContentResolver().bulkInsert(RedirectionList.CONTENT_URI, values); }
/** * Imports redirection list from THashMap<String, String> into database of AdAway, where keys are * hostnames and values are ip addresses. * * @param context * @param whitelist */
Imports redirection list from THashMap into database of AdAway, where keys are hostnames and values are ip addresses
importRedirectionList
{ "repo_name": "LorDClockaN/AdAway", "path": "AdAway/src/main/java/org/adaway/provider/ProviderHelper.java", "license": "gpl-3.0", "size": 14818 }
[ "android.content.ContentValues", "android.content.Context", "gnu.trove.map.hash.THashMap", "java.util.HashMap", "org.adaway.provider.AdAwayContract" ]
import android.content.ContentValues; import android.content.Context; import gnu.trove.map.hash.THashMap; import java.util.HashMap; import org.adaway.provider.AdAwayContract;
import android.content.*; import gnu.trove.map.hash.*; import java.util.*; import org.adaway.provider.*;
[ "android.content", "gnu.trove.map", "java.util", "org.adaway.provider" ]
android.content; gnu.trove.map; java.util; org.adaway.provider;
2,569,705
public DateTime lastUpdatedTime() { return this.lastUpdatedTime; }
DateTime function() { return this.lastUpdatedTime; }
/** * Get last time the rule was updated in IS08601 format. * * @return the lastUpdatedTime value */
Get last time the rule was updated in IS08601 format
lastUpdatedTime
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/monitor/mgmt-v2018_04_16/src/main/java/com/microsoft/azure/management/monitor/v2018_04_16/implementation/LogSearchRuleResourceInner.java", "license": "mit", "size": 5629 }
[ "org.joda.time.DateTime" ]
import org.joda.time.DateTime;
import org.joda.time.*;
[ "org.joda.time" ]
org.joda.time;
2,549,023
public void testMetaDataIsWritable() throws Exception { // Query with valid rows this.rs = this.stmt.executeQuery("SHOW VARIABLES LIKE 'version'"); ResultSetMetaData rsmd = this.rs.getMetaData(); int numColumns = rsmd.getColumnCount(); for (int i = 1; i <= numColumns; i++) { assertTrue("rsmd.isWritable() should != rsmd.isReadOnly()", rsmd.isWritable(i) != rsmd.isReadOnly(i)); } }
void function() throws Exception { this.rs = this.stmt.executeQuery(STR); ResultSetMetaData rsmd = this.rs.getMetaData(); int numColumns = rsmd.getColumnCount(); for (int i = 1; i <= numColumns; i++) { assertTrue(STR, rsmd.isWritable(i) != rsmd.isReadOnly(i)); } }
/** * Tests a bug where ResultSet.isBefireFirst() would return true when the * result set was empty (which is incorrect) * * @throws Exception * if an error occurs. */
Tests a bug where ResultSet.isBefireFirst() would return true when the result set was empty (which is incorrect)
testMetaDataIsWritable
{ "repo_name": "seadsystem/SchemaSpy", "path": "src/testsuite/regression/ResultSetRegressionTest.java", "license": "gpl-2.0", "size": 158956 }
[ "java.sql.ResultSetMetaData" ]
import java.sql.ResultSetMetaData;
import java.sql.*;
[ "java.sql" ]
java.sql;
548,869
void enterProperty(@NotNull dataParser.PropertyContext ctx); void exitProperty(@NotNull dataParser.PropertyContext ctx);
void enterProperty(@NotNull dataParser.PropertyContext ctx); void exitProperty(@NotNull dataParser.PropertyContext ctx);
/** * Exit a parse tree produced by {@link dataParser#property}. * @param ctx the parse tree */
Exit a parse tree produced by <code>dataParser#property</code>
exitProperty
{ "repo_name": "smogpill/dataspace", "path": "src/grammars/data/dataListener.java", "license": "gpl-3.0", "size": 4667 }
[ "org.antlr.v4.runtime.misc.NotNull" ]
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.misc.*;
[ "org.antlr.v4" ]
org.antlr.v4;
2,624,826
@Override protected void noMessageReceived(Object invoker, Session session) { ((AsyncMessageListenerInvoker) invoker).setIdle(true); }
void function(Object invoker, Session session) { ((AsyncMessageListenerInvoker) invoker).setIdle(true); }
/** * Marks the affected invoker as idle. */
Marks the affected invoker as idle
noMessageReceived
{ "repo_name": "boggad/jdk9-sample", "path": "sample-catalog/spring-jdk9/src/spring.jms/org/springframework/jms/listener/DefaultMessageListenerContainer.java", "license": "mit", "size": 47292 }
[ "javax.jms.Session" ]
import javax.jms.Session;
import javax.jms.*;
[ "javax.jms" ]
javax.jms;
937,429
public void init(Object objectName) throws StandardException { initAndCheck(objectName); truncateTable = true; schemaDescriptor = getSchemaDescriptor(); }
void function(Object objectName) throws StandardException { initAndCheck(objectName); truncateTable = true; schemaDescriptor = getSchemaDescriptor(); }
/** * Initializer for a TRUNCATE TABLE * * @param objectName The name of the table being truncated * @exception StandardException Thrown on error */
Initializer for a TRUNCATE TABLE
init
{ "repo_name": "papicella/snappy-store", "path": "gemfirexd/core/src/main/java/com/pivotal/gemfirexd/internal/impl/sql/compile/AlterTableNode.java", "license": "apache-2.0", "size": 14580 }
[ "com.pivotal.gemfirexd.internal.iapi.error.StandardException" ]
import com.pivotal.gemfirexd.internal.iapi.error.StandardException;
import com.pivotal.gemfirexd.internal.iapi.error.*;
[ "com.pivotal.gemfirexd" ]
com.pivotal.gemfirexd;
1,021,470
public void putDate(DateWrapper complexBody) throws ErrorException, IOException, IllegalArgumentException { putDateWithServiceResponseAsync(complexBody).toBlocking().single().getBody(); }
void function(DateWrapper complexBody) throws ErrorException, IOException, IllegalArgumentException { putDateWithServiceResponseAsync(complexBody).toBlocking().single().getBody(); }
/** * Put complex types with date properties. * * @param complexBody Please put '0001-01-01' and '2016-02-29' * @throws ErrorException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters */
Put complex types with date properties
putDate
{ "repo_name": "tbombach/autorest", "path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/bodycomplex/implementation/PrimitivesImpl.java", "license": "mit", "size": 69852 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,508,767
public final MetaProperty<String> name() { return _name; }
final MetaProperty<String> function() { return _name; }
/** * The meta-property for the {@code name} property. * @return the meta-property, not null */
The meta-property for the name property
name
{ "repo_name": "McLeodMoores/starling", "path": "projects/master/src/main/java/com/opengamma/master/convention/ManageableConvention.java", "license": "apache-2.0", "size": 15820 }
[ "org.joda.beans.MetaProperty" ]
import org.joda.beans.MetaProperty;
import org.joda.beans.*;
[ "org.joda.beans" ]
org.joda.beans;
2,321,030
public ClassNode getClassNode() { return cn; }
public ClassNode getClassNode() { return cn; }
/** * returns the SourceUnit */
returns the SourceUnit
getSourceUnit
{ "repo_name": "Selventa/model-builder", "path": "tools/groovy/src/src/main/org/codehaus/groovy/control/ClassNodeResolver.java", "license": "apache-2.0", "size": 11583 }
[ "org.codehaus.groovy.ast.ClassNode" ]
import org.codehaus.groovy.ast.ClassNode;
import org.codehaus.groovy.ast.*;
[ "org.codehaus.groovy" ]
org.codehaus.groovy;
685,531
public String getCompleteStatus() throws IOException { return getField("completed"); }
String function() throws IOException { return getField(STR); }
/** * The status of a job once it is completed. */
The status of a job once it is completed
getCompleteStatus
{ "repo_name": "hortonworks/templeton", "path": "src/java/org/apache/hcatalog/templeton/tool/JobState.java", "license": "apache-2.0", "size": 9114 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,333,230
Map<String, String> getAttributes(PerunSession sess, ExtSource extSource) throws PrivilegeException, ExtSourceNotExistsException;
Map<String, String> getAttributes(PerunSession sess, ExtSource extSource) throws PrivilegeException, ExtSourceNotExistsException;
/** * Gets attributes for external source. Must be Perun Admin. * * @param sess Current Session * @param extSource External Source * @return Map of attributes for external source */
Gets attributes for external source. Must be Perun Admin
getAttributes
{ "repo_name": "zlamalp/perun", "path": "perun-core/src/main/java/cz/metacentrum/perun/core/api/ExtSourcesManager.java", "license": "bsd-2-clause", "size": 7249 }
[ "cz.metacentrum.perun.core.api.exceptions.ExtSourceNotExistsException", "cz.metacentrum.perun.core.api.exceptions.PrivilegeException", "java.util.Map" ]
import cz.metacentrum.perun.core.api.exceptions.ExtSourceNotExistsException; import cz.metacentrum.perun.core.api.exceptions.PrivilegeException; import java.util.Map;
import cz.metacentrum.perun.core.api.exceptions.*; import java.util.*;
[ "cz.metacentrum.perun", "java.util" ]
cz.metacentrum.perun; java.util;
1,526,267
public static <T> T retryS3Operation(Callable<T> f) throws Exception { final int maxTries = 10; return RetryUtils.retry(f, S3RETRY, maxTries); }
static <T> T function(Callable<T> f) throws Exception { final int maxTries = 10; return RetryUtils.retry(f, S3RETRY, maxTries); }
/** * Retries S3 operations that fail due to io-related exceptions. Service-level exceptions (access denied, file not * found, etc) are not retried. */
Retries S3 operations that fail due to io-related exceptions. Service-level exceptions (access denied, file not found, etc) are not retried
retryS3Operation
{ "repo_name": "andy256/druid", "path": "extensions-core/s3-extensions/src/main/java/io/druid/storage/s3/S3Utils.java", "license": "apache-2.0", "size": 6094 }
[ "io.druid.java.util.common.RetryUtils", "java.util.concurrent.Callable" ]
import io.druid.java.util.common.RetryUtils; import java.util.concurrent.Callable;
import io.druid.java.util.common.*; import java.util.concurrent.*;
[ "io.druid.java", "java.util" ]
io.druid.java; java.util;
1,605,665
public void setApprovalDate(DateTime approvalDate) { this.approvalDate = approvalDate; } private DateTime expirationDate; @Column(name = "EXPIRATIONDATE") @org.hibernate.annotations.Type(type = "org.joda.time.contrib.hibernate.PersistentDateTime")
void function(DateTime approvalDate) { this.approvalDate = approvalDate; } private DateTime expirationDate; @Column(name = STR) @org.hibernate.annotations.Type(type = STR)
/** * Sets the value of approvalDate attribute. * @param approvalDate . **/
Sets the value of approvalDate attribute
setApprovalDate
{ "repo_name": "NCIP/calims", "path": "calims2-model/src/java/gov/nih/nci/calims2/domain/administration/customerservice/Quotation.java", "license": "bsd-3-clause", "size": 7251 }
[ "javax.persistence.Column", "org.joda.time.DateTime" ]
import javax.persistence.Column; import org.joda.time.DateTime;
import javax.persistence.*; import org.joda.time.*;
[ "javax.persistence", "org.joda.time" ]
javax.persistence; org.joda.time;
790,260
@Override public String getText(Object object) { MessageView messageView = (MessageView) object; String label = null; Operation operation = messageView.getSpecifies(); if (operation != null) { label = EMFEditUtil.stripTypeName(operation, RAMEditUtil.getOperationSignature(getAdapterFactory(), operation, true)); } return label == null || label.length() == 0 ? getString("_UI_MessageView_type") : getString("_UI_MessageView_type") + " " + label; }
String function(Object object) { MessageView messageView = (MessageView) object; String label = null; Operation operation = messageView.getSpecifies(); if (operation != null) { label = EMFEditUtil.stripTypeName(operation, RAMEditUtil.getOperationSignature(getAdapterFactory(), operation, true)); } return label == null label.length() == 0 ? getString(STR) : getString(STR) + " " + label; }
/** * This returns the label text for the adapted class. * <!-- begin-user-doc --> * @param object the object a textual representation to get for * @return the textual representation for the given object * <!-- end-user-doc --> * @generated NOT */
This returns the label text for the adapted class.
getText
{ "repo_name": "mschoettle/ecse429-fall15-project", "path": "ca.mcgill.sel.ram.edit/src/ca/mcgill/sel/ram/provider/MessageViewItemProvider.java", "license": "gpl-2.0", "size": 11849 }
[ "ca.mcgill.sel.commons.emf.util.EMFEditUtil", "ca.mcgill.sel.ram.MessageView", "ca.mcgill.sel.ram.Operation", "ca.mcgill.sel.ram.provider.util.RAMEditUtil" ]
import ca.mcgill.sel.commons.emf.util.EMFEditUtil; import ca.mcgill.sel.ram.MessageView; import ca.mcgill.sel.ram.Operation; import ca.mcgill.sel.ram.provider.util.RAMEditUtil;
import ca.mcgill.sel.commons.emf.util.*; import ca.mcgill.sel.ram.*; import ca.mcgill.sel.ram.provider.util.*;
[ "ca.mcgill.sel" ]
ca.mcgill.sel;
1,512,647
protected Config getConfig() { return new Config(); }
Config function() { return new Config(); }
/** * Override this method to provide custom configuration for test drivers * * @return */
Override this method to provide custom configuration for test drivers
getConfig
{ "repo_name": "emrahkocaman/hazelcast", "path": "hazelcast/src/test/java/com/hazelcast/test/bounce/MemberDriverFactory.java", "license": "apache-2.0", "size": 2333 }
[ "com.hazelcast.config.Config" ]
import com.hazelcast.config.Config;
import com.hazelcast.config.*;
[ "com.hazelcast.config" ]
com.hazelcast.config;
2,578,004
public void onSeekBarStartTrackingTouch(SeekBar seekBar) { // interrupt position Observer, restart later cancelPositionObserver(); }
void function(SeekBar seekBar) { cancelPositionObserver(); }
/** * Should be used by classes which implement the OnSeekBarChanged interface. */
Should be used by classes which implement the OnSeekBarChanged interface
onSeekBarStartTrackingTouch
{ "repo_name": "repat/AntennaPod", "path": "src/de/danoeh/antennapod/util/playback/PlaybackController.java", "license": "mit", "size": 19313 }
[ "android.widget.SeekBar" ]
import android.widget.SeekBar;
import android.widget.*;
[ "android.widget" ]
android.widget;
2,802,973
@CalledInAwt public void dispose(@Nullable Runnable callback) { LOG.assertTrue(ApplicationManager.getApplication().isDispatchThread()); myTabsLogRefresher.closeLogTabs(); Disposer.dispose(myTabsLogRefresher); ApplicationManager.getApplication().executeOnPooledThread(() -> { Disposer.dispose(this); if (callback != null) { callback.run(); } }); }
void function(@Nullable Runnable callback) { LOG.assertTrue(ApplicationManager.getApplication().isDispatchThread()); myTabsLogRefresher.closeLogTabs(); Disposer.dispose(myTabsLogRefresher); ApplicationManager.getApplication().executeOnPooledThread(() -> { Disposer.dispose(this); if (callback != null) { callback.run(); } }); }
/** * Dispose VcsLogManager and execute some activity after it. * * @param callback activity to run after log is disposed. Is executed in background thread. null means execution of additional activity after dispose is not required. */
Dispose VcsLogManager and execute some activity after it
dispose
{ "repo_name": "goodwinnk/intellij-community", "path": "platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsLogManager.java", "license": "apache-2.0", "size": 9636 }
[ "com.intellij.openapi.application.ApplicationManager", "com.intellij.openapi.util.Disposer", "org.jetbrains.annotations.Nullable" ]
import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.util.Disposer; import org.jetbrains.annotations.Nullable;
import com.intellij.openapi.application.*; import com.intellij.openapi.util.*; import org.jetbrains.annotations.*;
[ "com.intellij.openapi", "org.jetbrains.annotations" ]
com.intellij.openapi; org.jetbrains.annotations;
839,302
private void transformParticipantReferencesFromPools( Document document, Node parent) { for (Iterator<Pool> it = this.diagram.getPools().iterator(); it.hasNext();) { Pool pool = it.next(); Element ref = createReferenceElement(document, pool); if (ref == null) { this.output.addError("There are multiple pools defining "+ "the same participant or pool name.", pool.getId()); } else { parent.appendChild(ref); } } }
void function( Document document, Node parent) { for (Iterator<Pool> it = this.diagram.getPools().iterator(); it.hasNext();) { Pool pool = it.next(); Element ref = createReferenceElement(document, pool); if (ref == null) { this.output.addError(STR+ STR, pool.getId()); } else { parent.appendChild(ref); } } }
/** * Determines the BPEL4Chor "participant" elements from each pool * in the diagram and appends them to the childs of the parent node. * * @param document the document to create the elements for. * @param parent the parent node for the created "participant" elements * (should be a "participants" element) */
Determines the BPEL4Chor "participant" elements from each pool in the diagram and appends them to the childs of the parent node
transformParticipantReferencesFromPools
{ "repo_name": "grasscrm/gdesigner", "path": "editor/server/src/de/hpi/bpel4chor/transformation/factories/ParticipantsFactory.java", "license": "apache-2.0", "size": 51114 }
[ "de.hpi.bpel4chor.model.Pool", "java.util.Iterator", "org.w3c.dom.Document", "org.w3c.dom.Element", "org.w3c.dom.Node" ]
import de.hpi.bpel4chor.model.Pool; import java.util.Iterator; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node;
import de.hpi.bpel4chor.model.*; import java.util.*; import org.w3c.dom.*;
[ "de.hpi.bpel4chor", "java.util", "org.w3c.dom" ]
de.hpi.bpel4chor; java.util; org.w3c.dom;
1,825,810
public OffsetDateTime date() { if (this.date == null) { return null; } return this.date.dateTime(); }
OffsetDateTime function() { if (this.date == null) { return null; } return this.date.dateTime(); }
/** * Get the date value. * * @return the date value. */
Get the date value
date
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/storage/microsoft-azure-storage-blob/src/main/java/com/microsoft/azure/storage/blob/models/ServiceGetStatisticsHeaders.java", "license": "mit", "size": 2873 }
[ "java.time.OffsetDateTime" ]
import java.time.OffsetDateTime;
import java.time.*;
[ "java.time" ]
java.time;
408,927
public Frequency getAccrualFrequency() { return accrualFrequency != null ? accrualFrequency : Frequency.of(index.getTenor().getPeriod()); }
Frequency function() { return accrualFrequency != null ? accrualFrequency : Frequency.of(index.getTenor().getPeriod()); }
/** * Gets the periodic frequency of accrual. * <p> * Interest will be accrued over periods at the specified periodic frequency, such as every 3 months. * <p> * This will default to the tenor of the index if not specified. * * @return the accrual frequency, not null */
Gets the periodic frequency of accrual. Interest will be accrued over periods at the specified periodic frequency, such as every 3 months. This will default to the tenor of the index if not specified
getAccrualFrequency
{ "repo_name": "OpenGamma/Strata", "path": "modules/product/src/main/java/com/opengamma/strata/product/swap/type/IborRateSwapLegConvention.java", "license": "apache-2.0", "size": 59483 }
[ "com.opengamma.strata.basics.schedule.Frequency" ]
import com.opengamma.strata.basics.schedule.Frequency;
import com.opengamma.strata.basics.schedule.*;
[ "com.opengamma.strata" ]
com.opengamma.strata;
17,142
public String getXML() { StringBuffer xml= new StringBuffer(); xml.append("<"+XML_TAG+">"); for (int i=0;i<size();i++) { xml.append(getValue(i).getXML()); } xml.append("</"+XML_TAG+">"); return xml.toString(); } public Row(Node rowNode) { int nrValues = XMLHandler.countNodes(rowNode, Value.XML_TAG); for (int i=0;i<nrValues;i++) { Node valueNode = XMLHandler.getSubNodeByNr(rowNode, Value.XML_TAG, i); addValue(new Value(valueNode)); } }
String function() { StringBuffer xml= new StringBuffer(); xml.append("<"+XML_TAG+">"); for (int i=0;i<size();i++) { xml.append(getValue(i).getXML()); } xml.append("</"+XML_TAG+">"); return xml.toString(); } public Row(Node rowNode) { int nrValues = XMLHandler.countNodes(rowNode, Value.XML_TAG); for (int i=0;i<nrValues;i++) { Node valueNode = XMLHandler.getSubNodeByNr(rowNode, Value.XML_TAG, i); addValue(new Value(valueNode)); } }
/** * Return the XML representation of a row. * * @return The XML representation of this row */
Return the XML representation of a row
getXML
{ "repo_name": "ontometrics/ontokettle", "path": "src/be/ibridge/kettle/core/Row.java", "license": "lgpl-2.1", "size": 22714 }
[ "be.ibridge.kettle.core.value.Value", "org.w3c.dom.Node" ]
import be.ibridge.kettle.core.value.Value; import org.w3c.dom.Node;
import be.ibridge.kettle.core.value.*; import org.w3c.dom.*;
[ "be.ibridge.kettle", "org.w3c.dom" ]
be.ibridge.kettle; org.w3c.dom;
1,336,983
public Map<String, String> getMessages(String language) { Properties messages = new Properties(); // load properties sequentially // (default,custom,default language,custom language) PropertiesPair pair = this.messages.get(null); if (pair != null) { messages.putAll(pair.defaultProperties); messages.putAll(pair.customProperties); } if (language != null) { language = language.toLowerCase(); pair = this.messages.get(language); if (pair != null) { messages.putAll(pair.defaultProperties); messages.putAll(pair.customProperties); } } Map<String, String> result = new HashMap<String, String>(); for(Object key : messages.keySet()) { result.put(key.toString(), messages.getProperty(key.toString())); } return Collections.unmodifiableMap(result); }
Map<String, String> function(String language) { Properties messages = new Properties(); PropertiesPair pair = this.messages.get(null); if (pair != null) { messages.putAll(pair.defaultProperties); messages.putAll(pair.customProperties); } if (language != null) { language = language.toLowerCase(); pair = this.messages.get(language); if (pair != null) { messages.putAll(pair.defaultProperties); messages.putAll(pair.customProperties); } } Map<String, String> result = new HashMap<String, String>(); for(Object key : messages.keySet()) { result.put(key.toString(), messages.getProperty(key.toString())); } return Collections.unmodifiableMap(result); }
/** * Get all messages. */
Get all messages
getMessages
{ "repo_name": "saaconsltd/mina-ftpserver", "path": "core/src/main/java/org/apache/ftpserver/message/impl/DefaultMessageResource.java", "license": "apache-2.0", "size": 8254 }
[ "java.util.Collections", "java.util.HashMap", "java.util.Map", "java.util.Properties" ]
import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Properties;
import java.util.*;
[ "java.util" ]
java.util;
2,314,821
public Writer getFileObjectWriter(String path, String filename) throws IOException { File dir = new File(path); if (!dir.exists()) { dir.mkdirs(); } return new FileWriter(new File(dir, filename)); }
Writer function(String path, String filename) throws IOException { File dir = new File(path); if (!dir.exists()) { dir.mkdirs(); } return new FileWriter(new File(dir, filename)); }
/** * Create writer from file path/filename * * @param path * @param filename * @return * @throws IOException */
Create writer from file path/filename
getFileObjectWriter
{ "repo_name": "hhdevelopment/ocelot", "path": "ocelot-processor/src/main/java/org/ocelotds/FileWriterServices.java", "license": "mpl-2.0", "size": 3066 }
[ "java.io.File", "java.io.FileWriter", "java.io.IOException", "java.io.Writer" ]
import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.Writer;
import java.io.*;
[ "java.io" ]
java.io;
2,781,727
protected String getCapptainActivityName() { return CapptainAgentUtils.buildCapptainActivityName(getClass()); }
String function() { return CapptainAgentUtils.buildCapptainActivityName(getClass()); }
/** * Override this to specify the name reported by your activity. The default * implementation returns the simple name of the class and removes the * "Activity" suffix if any (e.g. "com.mycompany.MainActivity" -> "Main"). * * @return the activity name reported by the Capptain service. */
Override this to specify the name reported by your activity. The default implementation returns the simple name of the class and removes the "Activity" suffix if any (e.g. "com.mycompany.MainActivity" -> "Main")
getCapptainActivityName
{ "repo_name": "ridem/fr.lemet", "path": "TransportsCommun/src/fr/lemet/transportscommun/activity/commun/CapptainFragmentActivity.java", "license": "gpl-3.0", "size": 1658 }
[ "com.ubikod.capptain.android.sdk.CapptainAgentUtils" ]
import com.ubikod.capptain.android.sdk.CapptainAgentUtils;
import com.ubikod.capptain.android.sdk.*;
[ "com.ubikod.capptain" ]
com.ubikod.capptain;
2,803,331
void unsuspendMember(PerunSession sess, Member member) throws InternalErrorException;
void unsuspendMember(PerunSession sess, Member member) throws InternalErrorException;
/** * Remove suspend state from Member - remove date to which member should be considered as suspended in the VO. * * WARNING: this method will always succeed if member exists, because it will set date for suspension to null * * @param sess * @param member member for which the suspend state will be removed * @throws InternalErrorException */
Remove suspend state from Member - remove date to which member should be considered as suspended in the VO
unsuspendMember
{ "repo_name": "stavamichal/perun", "path": "perun-core/src/main/java/cz/metacentrum/perun/core/bl/MembersManagerBl.java", "license": "bsd-2-clause", "size": 66169 }
[ "cz.metacentrum.perun.core.api.Member", "cz.metacentrum.perun.core.api.PerunSession", "cz.metacentrum.perun.core.api.exceptions.InternalErrorException" ]
import cz.metacentrum.perun.core.api.Member; import cz.metacentrum.perun.core.api.PerunSession; import cz.metacentrum.perun.core.api.exceptions.InternalErrorException;
import cz.metacentrum.perun.core.api.*; import cz.metacentrum.perun.core.api.exceptions.*;
[ "cz.metacentrum.perun" ]
cz.metacentrum.perun;
1,842,861
public static void sendTempFile(File file, HttpServletResponse response) throws IOException { String mimeType = null; String filename = file.getName(); if (filename.length() > 5) { if (filename.substring(filename.length() - 5, filename.length()).equals(".jpeg")) { mimeType = "image/jpeg"; } else if (filename.substring(filename.length() - 4, filename.length()).equals(".png")) { mimeType = "image/png"; } } ServletUtilities.sendTempFile(file, response, mimeType); }
static void function(File file, HttpServletResponse response) throws IOException { String mimeType = null; String filename = file.getName(); if (filename.length() > 5) { if (filename.substring(filename.length() - 5, filename.length()).equals(".jpeg")) { mimeType = STR; } else if (filename.substring(filename.length() - 4, filename.length()).equals(".png")) { mimeType = STR; } } ServletUtilities.sendTempFile(file, response, mimeType); }
/** * Binary streams the specified file to the HTTP response in 1KB chunks. * * @param file the file to be streamed. * @param response the HTTP response object. * * @throws IOException if there is an I/O problem. */
Binary streams the specified file to the HTTP response in 1KB chunks
sendTempFile
{ "repo_name": "greearb/jfreechart-fse-ct", "path": "src/main/java/org/jfree/chart/servlet/ServletUtilities.java", "license": "lgpl-2.1", "size": 17354 }
[ "java.io.File", "java.io.IOException", "javax.servlet.http.HttpServletResponse" ]
import java.io.File; import java.io.IOException; import javax.servlet.http.HttpServletResponse;
import java.io.*; import javax.servlet.http.*;
[ "java.io", "javax.servlet" ]
java.io; javax.servlet;
1,538,129
public Stroke getBaseOutlineStroke();
Stroke function();
/** * Returns the base outline stroke. * * @return The stroke (never <code>null</code>). * * @see #setBaseOutlineStroke(Stroke) */
Returns the base outline stroke
getBaseOutlineStroke
{ "repo_name": "sebkur/JFreeChart", "path": "src/main/java/org/jfree/chart/renderer/xy/XYItemRenderer.java", "license": "lgpl-3.0", "size": 64436 }
[ "java.awt.Stroke" ]
import java.awt.Stroke;
import java.awt.*;
[ "java.awt" ]
java.awt;
1,960,018
protected List<ComplexTypeSample> createComplexTypeListSample() { return asList(createComplexType("Simple 1", "Inherited 1"), createComplexType("Simple 2", "Inherited 2")); }
List<ComplexTypeSample> function() { return asList(createComplexType(STR, STR), createComplexType(STR, STR)); }
/** * Create a predefined list of {@link ComplexTypeSample} types. * * @return The predefined list of {@link ComplexTypeSample} types. */
Create a predefined list of <code>ComplexTypeSample</code> types
createComplexTypeListSample
{ "repo_name": "sdl/odata", "path": "odata_renderer/src/test/java/com/sdl/odata/renderer/WriterTest.java", "license": "apache-2.0", "size": 11669 }
[ "com.sdl.odata.test.model.ComplexTypeSample", "java.util.Arrays", "java.util.List" ]
import com.sdl.odata.test.model.ComplexTypeSample; import java.util.Arrays; import java.util.List;
import com.sdl.odata.test.model.*; import java.util.*;
[ "com.sdl.odata", "java.util" ]
com.sdl.odata; java.util;
729,622
// ----------------------------------------------- private int create_zoom_levels( String s_zoom_levels, String s_zoom_levels_url ) { zoom_levels = new ArrayList<Integer>(); if (add_zoom_from_to(s_zoom_levels_url, 0) != 0) return zoom_levels.size(); int indexOfS = s_zoom_levels.indexOf(","); int i_zoom_level = 0; if (indexOfS != -1) { String[] sa_string = s_zoom_levels.split(","); for (String s_zoom_level : sa_string) { indexOfS = s_zoom_level.indexOf("-"); if (indexOfS != -1) { if (add_zoom_from_to(s_zoom_levels, 1) != 0) return zoom_levels.size(); } else { try { i_zoom_level = Integer.parseInt(s_zoom_levels); } catch (NumberFormatException e) { zoom_levels.clear(); return zoom_levels.size(); } if (!zoom_levels.contains(i_zoom_level)) { if ((i_zoom_level >= this.i_url_zoom_min) && (i_zoom_level <= this.i_url_zoom_max)) { if (i_zoom_level < this.i_request_zoom_min) this.i_request_zoom_min = i_zoom_level; if (i_zoom_level > this.i_request_zoom_max) this.i_request_zoom_max = i_zoom_level; zoom_levels.add(i_zoom_level); } } } } } else { indexOfS = s_zoom_levels.indexOf("-"); if (indexOfS != -1) { if (add_zoom_from_to(s_zoom_levels, 1) != 0) return zoom_levels.size(); } else { try { i_zoom_level = Integer.parseInt(s_zoom_levels); } catch (NumberFormatException e) { zoom_levels.clear(); return zoom_levels.size(); } if (!zoom_levels.contains(i_zoom_level)) { if ((i_zoom_level >= this.i_url_zoom_min) && (i_zoom_level <= this.i_url_zoom_max)) { if (i_zoom_level < this.i_request_zoom_min) this.i_request_zoom_min = i_zoom_level; if (i_zoom_level > this.i_request_zoom_max) this.i_request_zoom_max = i_zoom_level; zoom_levels.add(i_zoom_level); } } } } Collections.sort(zoom_levels); return zoom_levels.size(); }
int function( String s_zoom_levels, String s_zoom_levels_url ) { zoom_levels = new ArrayList<Integer>(); if (add_zoom_from_to(s_zoom_levels_url, 0) != 0) return zoom_levels.size(); int indexOfS = s_zoom_levels.indexOf(","); int i_zoom_level = 0; if (indexOfS != -1) { String[] sa_string = s_zoom_levels.split(","); for (String s_zoom_level : sa_string) { indexOfS = s_zoom_level.indexOf("-"); if (indexOfS != -1) { if (add_zoom_from_to(s_zoom_levels, 1) != 0) return zoom_levels.size(); } else { try { i_zoom_level = Integer.parseInt(s_zoom_levels); } catch (NumberFormatException e) { zoom_levels.clear(); return zoom_levels.size(); } if (!zoom_levels.contains(i_zoom_level)) { if ((i_zoom_level >= this.i_url_zoom_min) && (i_zoom_level <= this.i_url_zoom_max)) { if (i_zoom_level < this.i_request_zoom_min) this.i_request_zoom_min = i_zoom_level; if (i_zoom_level > this.i_request_zoom_max) this.i_request_zoom_max = i_zoom_level; zoom_levels.add(i_zoom_level); } } } } } else { indexOfS = s_zoom_levels.indexOf("-"); if (indexOfS != -1) { if (add_zoom_from_to(s_zoom_levels, 1) != 0) return zoom_levels.size(); } else { try { i_zoom_level = Integer.parseInt(s_zoom_levels); } catch (NumberFormatException e) { zoom_levels.clear(); return zoom_levels.size(); } if (!zoom_levels.contains(i_zoom_level)) { if ((i_zoom_level >= this.i_url_zoom_min) && (i_zoom_level <= this.i_url_zoom_max)) { if (i_zoom_level < this.i_request_zoom_min) this.i_request_zoom_min = i_zoom_level; if (i_zoom_level > this.i_request_zoom_max) this.i_request_zoom_max = i_zoom_level; zoom_levels.add(i_zoom_level); } } } } Collections.sort(zoom_levels); return zoom_levels.size(); }
/** * Parse zoom-level string * - Sample of supported formats: * -- '17' * -- '15-17' * -- '2,5,9-10,12' * -- '5-3,7-8,6' * -- order is not important, mixing up min/max will be corrected * -- only unique values will be stored * - valid zoom-levels: 0-22 * - result will sorted from min to max * @param s_zoom_levels list of zoom levels * @return zoom_levels.size() [ amount of valid,sorted zoom_levels found] */
Parse zoom-level string - Sample of supported formats: -- '17' -- '15-17' -- '2,5,9-10,12' -- '5-3,7-8,6' -- order is not important, mixing up min/max will be corrected -- only unique values will be stored - valid zoom-levels: 0-22 - result will sorted from min to max
create_zoom_levels
{ "repo_name": "Huertix/geopaparazzi", "path": "geopaparazzispatialitelibrary/src/eu/geopaparazzi/spatialite/database/spatial/core/mbtiles/MBtilesAsync.java", "license": "gpl-3.0", "size": 50636 }
[ "java.util.ArrayList", "java.util.Collections" ]
import java.util.ArrayList; import java.util.Collections;
import java.util.*;
[ "java.util" ]
java.util;
2,850,571
public Map<String, String> getAttributes();
Map<String, String> function();
/** * This method returns a list of custom/remote attributes associated with the * agenda. * <p> * The attributes of the NaturalLanguageUsage * </p> * @return a list of custom/remote attribute of the agenda. */
This method returns a list of custom/remote attributes associated with the agenda. The attributes of the NaturalLanguageUsage
getAttributes
{ "repo_name": "mztaylor/rice-git", "path": "rice-middleware/krms/api/src/main/java/org/kuali/rice/krms/api/repository/language/NaturalLanguageTemplateContract.java", "license": "apache-2.0", "size": 2434 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
648,773
interface OnMapClickListener { void onMapClick(LatLong coord); }
interface OnMapClickListener { void onMapClick(LatLong coord); }
/** * Triggered when the map is clicked. * * @param coord * location where the map was clicked. */
Triggered when the map is clicked
onMapClick
{ "repo_name": "giorgioDonnie91/AndroidAgriPerizia", "path": "Android/src/org/droidplanner/android/maps/DPMap.java", "license": "gpl-3.0", "size": 11606 }
[ "com.o3dr.services.android.lib.coordinate.LatLong" ]
import com.o3dr.services.android.lib.coordinate.LatLong;
import com.o3dr.services.android.lib.coordinate.*;
[ "com.o3dr.services" ]
com.o3dr.services;
2,284,995
public DrawView setLineCap(SerializablePaint.Cap lineCap) { this.mLineCap = lineCap; return this; }
DrawView function(SerializablePaint.Cap lineCap) { this.mLineCap = lineCap; return this; }
/** * Set the current line cap like round, square or butt * * @param lineCap * @return this instance of the view */
Set the current line cap like round, square or butt
setLineCap
{ "repo_name": "rosenpin/QuickDrawEverywhere", "path": "drawview/src/main/java/com/byox/drawview/views/DrawView.java", "license": "gpl-3.0", "size": 56120 }
[ "com.byox.drawview.utils.SerializablePaint" ]
import com.byox.drawview.utils.SerializablePaint;
import com.byox.drawview.utils.*;
[ "com.byox.drawview" ]
com.byox.drawview;
170,273
public int showOptionDialog(final String title, final String description, final Object[] options) { final Object ans = JOptionPane.showInputDialog( this, description, title, JOptionPane.PLAIN_MESSAGE, null, options, options[0].toString()); if (ans == null) return -1; for (int i = 0; i < options.length; i++) if (ans == options[i]) return i; return -1; }
int function(final String title, final String description, final Object[] options) { final Object ans = JOptionPane.showInputDialog( this, description, title, JOptionPane.PLAIN_MESSAGE, null, options, options[0].toString()); if (ans == null) return -1; for (int i = 0; i < options.length; i++) if (ans == options[i]) return i; return -1; }
/** * Shows an option dialog with a droplist for the user to select from a certain range of options. * @param title the title of the dialog * @param description the description, which should be longer than the title * @param options the possible options that would appear in the droplist * @return the id of the option that was selected or -1 if nothing was selected */
Shows an option dialog with a droplist for the user to select from a certain range of options
showOptionDialog
{ "repo_name": "martinmarinov/HonProj", "path": "src/martin/gui/quantum/Visualizer.java", "license": "gpl-3.0", "size": 14732 }
[ "javax.swing.JOptionPane" ]
import javax.swing.JOptionPane;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
319,700
public static String renderEbxml(Object ebXml) { try { StringWriter writer = new StringWriter(); Marshaller marshaller = JAXB_CONTEXT.createMarshaller(); marshaller.setAttachmentMarshaller(new NonReadingAttachmentMarshaller()); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); marshaller.marshal(ebXml, writer); return writer.toString(); } catch (JAXBException e) { throw new RuntimeException(e); } }
static String function(Object ebXml) { try { StringWriter writer = new StringWriter(); Marshaller marshaller = JAXB_CONTEXT.createMarshaller(); marshaller.setAttachmentMarshaller(new NonReadingAttachmentMarshaller()); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); marshaller.marshal(ebXml, writer); return writer.toString(); } catch (JAXBException e) { throw new RuntimeException(e); } }
/** * Returns marshaled XML representation of the given ebXML POJO. * @param ebXml * ebXML POJO. * @return * XML string representing the given POJO. */
Returns marshaled XML representation of the given ebXML POJO
renderEbxml
{ "repo_name": "krasserm/ipf", "path": "platform-camel/ihe/xds/src/main/java/org/openehealth/ipf/platform/camel/ihe/xds/core/converters/XdsRenderingUtils.java", "license": "apache-2.0", "size": 10669 }
[ "java.io.StringWriter", "javax.xml.bind.JAXBException", "javax.xml.bind.Marshaller" ]
import java.io.StringWriter; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller;
import java.io.*; import javax.xml.bind.*;
[ "java.io", "javax.xml" ]
java.io; javax.xml;
324,872
public void addWriter(PdfWriter writer) throws DocumentException { if (this.writer == null) { this.writer = writer; acroForm = new PdfAcroForm(writer); return; } throw new DocumentException("You can only add a writer to a PdfDocument once."); }
void function(PdfWriter writer) throws DocumentException { if (this.writer == null) { this.writer = writer; acroForm = new PdfAcroForm(writer); return; } throw new DocumentException(STR); }
/** * Adds a <CODE>PdfWriter</CODE> to the <CODE>PdfDocument</CODE>. * * @param writer the <CODE>PdfWriter</CODE> that writes everything * what is added to this document to an outputstream. * @throws DocumentException on error */
Adds a <code>PdfWriter</code> to the <code>PdfDocument</code>
addWriter
{ "repo_name": "MesquiteProject/MesquiteArchive", "path": "trunk/Mesquite Project/LibrarySource/com/lowagie/text/pdf/PdfDocument.java", "license": "lgpl-3.0", "size": 115660 }
[ "com.lowagie.text.DocumentException" ]
import com.lowagie.text.DocumentException;
import com.lowagie.text.*;
[ "com.lowagie.text" ]
com.lowagie.text;
2,801,978
public void testSimpleQuery() throws Exception { createDatabase( "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+ "<database name='ddlutils'>\n"+ " <table name='TestTable'>\n"+ " <column name='TheId' type='INTEGER' primaryKey='true' required='true'/>\n"+ " <column name='TheText' type='VARCHAR' size='15'/>\n"+ " </table>\n"+ "</database>"); insertData( "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+ "<data>\n"+ " <TestTable TheId='1' TheText='Text 1'/>\n"+ " <TestTable TheId='2' TheText='Text 2'/>\n"+ " <TestTable TheId='3' TheText='Text 3'/>"+ "</data>"); ModelBasedResultSetIterator it = (ModelBasedResultSetIterator)getPlatform().query(getModel(), "SELECT * FROM TestTable", new Table[] { getModel().getTable(0) }); assertTrue(it.hasNext()); // we call the method a second time to assert that the result set does not get advanced twice assertTrue(it.hasNext()); DynaBean bean = (DynaBean)it.next(); assertEquals(new Integer(1), getPropertyValue(bean, "TheId")); assertEquals("Text 1", getPropertyValue(bean, "TheText")); assertTrue(it.hasNext()); bean = (DynaBean)it.next(); assertEquals(new Integer(2), getPropertyValue(bean, "TheId")); assertEquals("Text 2", getPropertyValue(bean, "TheText")); assertTrue(it.hasNext()); bean = (DynaBean)it.next(); assertEquals(new Integer(3), getPropertyValue(bean, "TheId")); assertEquals("Text 3", getPropertyValue(bean, "TheText")); assertFalse(it.hasNext()); assertFalse(it.isConnectionOpen()); }
void function() throws Exception { createDatabase( STR+ STR+ STR+ STR+ STR+ STR+ STR); insertData( STR+ STR+ STR+ STR+ STR+ STR); ModelBasedResultSetIterator it = (ModelBasedResultSetIterator)getPlatform().query(getModel(), STR, new Table[] { getModel().getTable(0) }); assertTrue(it.hasNext()); assertTrue(it.hasNext()); DynaBean bean = (DynaBean)it.next(); assertEquals(new Integer(1), getPropertyValue(bean, "TheId")); assertEquals(STR, getPropertyValue(bean, STR)); assertTrue(it.hasNext()); bean = (DynaBean)it.next(); assertEquals(new Integer(2), getPropertyValue(bean, "TheId")); assertEquals(STR, getPropertyValue(bean, STR)); assertTrue(it.hasNext()); bean = (DynaBean)it.next(); assertEquals(new Integer(3), getPropertyValue(bean, "TheId")); assertEquals(STR, getPropertyValue(bean, STR)); assertFalse(it.hasNext()); assertFalse(it.isConnectionOpen()); }
/** * Tests a simple SELECT query. */
Tests a simple SELECT query
testSimpleQuery
{ "repo_name": "etiago/apache-ddlutils", "path": "src/test/org/apache/ddlutils/dynabean/TestDynaSqlQueries.java", "license": "apache-2.0", "size": 11893 }
[ "org.apache.commons.beanutils.DynaBean", "org.apache.ddlutils.model.Table", "org.apache.ddlutils.platform.ModelBasedResultSetIterator" ]
import org.apache.commons.beanutils.DynaBean; import org.apache.ddlutils.model.Table; import org.apache.ddlutils.platform.ModelBasedResultSetIterator;
import org.apache.commons.beanutils.*; import org.apache.ddlutils.model.*; import org.apache.ddlutils.platform.*;
[ "org.apache.commons", "org.apache.ddlutils" ]
org.apache.commons; org.apache.ddlutils;
756,579
public static List<ClickableString> getNodeClickableStrings(AccessibilityNodeInfoCompat node) { return getNodeClickableElements( node, ClickableSpan.class, input -> ClickableString.create(input.first, input.second)); }
static List<ClickableString> function(AccessibilityNodeInfoCompat node) { return getNodeClickableElements( node, ClickableSpan.class, input -> ClickableString.create(input.first, input.second)); }
/** * Gets a list of ClickableSpans paired with the String they span within a node's text. * * @param node The node that will be searched for spans * @return A list of Clickable elements found within the Node. */
Gets a list of ClickableSpans paired with the String they span within a node's text
getNodeClickableStrings
{ "repo_name": "google/talkback", "path": "utils/src/main/java/com/google/android/accessibility/utils/AccessibilityNodeInfoUtils.java", "license": "apache-2.0", "size": 105305 }
[ "android.text.style.ClickableSpan", "androidx.core.view.accessibility.AccessibilityNodeInfoCompat", "java.util.List" ]
import android.text.style.ClickableSpan; import androidx.core.view.accessibility.AccessibilityNodeInfoCompat; import java.util.List;
import android.text.style.*; import androidx.core.view.accessibility.*; import java.util.*;
[ "android.text", "androidx.core", "java.util" ]
android.text; androidx.core; java.util;
1,400,589
public void annotationSelected(NOMObjectModelElement annotation);
void function(NOMObjectModelElement annotation);
/** * <p>Called when an existing annotation has been selected.</p> * * @param annotation the selected annotation */
Called when an existing annotation has been selected
annotationSelected
{ "repo_name": "boompieman/iim_project", "path": "nxt_1.4.4/src/net/sourceforge/nite/tools/videolabeler/AnnotationSelectionListener.java", "license": "gpl-3.0", "size": 846 }
[ "net.sourceforge.nite.nxt.NOMObjectModelElement" ]
import net.sourceforge.nite.nxt.NOMObjectModelElement;
import net.sourceforge.nite.nxt.*;
[ "net.sourceforge.nite" ]
net.sourceforge.nite;
353,153
public String getMeasurementSetsForDestination(String nrtCollectionTaskId) { List<MeasurementSet> measurementSets = m_nrtBroker.receiveMeasurementSets(nrtCollectionTaskId); StringBuffer buffer = new StringBuffer(); for (MeasurementSet measurementSet : measurementSets) { if (buffer.length() > 0) { buffer.append(", "); } buffer.append(measurementSet.toString()); } return "{\"measurement_sets\":[" + buffer.toString() + "]}"; }
String function(String nrtCollectionTaskId) { List<MeasurementSet> measurementSets = m_nrtBroker.receiveMeasurementSets(nrtCollectionTaskId); StringBuffer buffer = new StringBuffer(); for (MeasurementSet measurementSet : measurementSets) { if (buffer.length() > 0) { buffer.append(STR); } buffer.append(measurementSet.toString()); } return "{\"measurement_sets\":[" + buffer.toString() + "]}"; }
/** * Will be called by the JS-Graphing-Frontend as http/GET Get Measurements from NrtBroker, transform them into Json and return * them to the JS-Graphing-Frontend * * @param nrtCollectionTaskId * @return Json Representation of MeasurementeSets for the given nrtCollectionTaskId */
Will be called by the JS-Graphing-Frontend as http/GET Get Measurements from NrtBroker, transform them into Json and return them to the JS-Graphing-Frontend
getMeasurementSetsForDestination
{ "repo_name": "rfdrake/opennms", "path": "features/nrtg/web/src/main/java/org/opennms/nrtg/web/internal/NrtController.java", "license": "gpl-2.0", "size": 16651 }
[ "java.util.List", "org.opennms.nrtg.api.model.MeasurementSet" ]
import java.util.List; import org.opennms.nrtg.api.model.MeasurementSet;
import java.util.*; import org.opennms.nrtg.api.model.*;
[ "java.util", "org.opennms.nrtg" ]
java.util; org.opennms.nrtg;
388,232
public Color getTransparentColor() { Color color = null; if (!this.isTransparent) { return color; } if (this.cm.getNumColorComponents() == 3) { color = new Color(this.redTransparentAlpha, this.greenTransparentAlpha, this.blueTransparentAlpha); } else { color = new Color(this.grayTransparentAlpha, 0, 0); } return color; }
Color function() { Color color = null; if (!this.isTransparent) { return color; } if (this.cm.getNumColorComponents() == 3) { color = new Color(this.redTransparentAlpha, this.greenTransparentAlpha, this.blueTransparentAlpha); } else { color = new Color(this.grayTransparentAlpha, 0, 0); } return color; }
/** * The color of the transparent pixel. * * @return the color of the transparent pixel. */
The color of the transparent pixel
getTransparentColor
{ "repo_name": "Guronzan/Apache-XmlGraphics", "path": "src/main/java/org/apache/xmlgraphics/image/loader/impl/ImageRawPNG.java", "license": "apache-2.0", "size": 4912 }
[ "java.awt.Color" ]
import java.awt.Color;
import java.awt.*;
[ "java.awt" ]
java.awt;
745,321
public static DataSet<Boolean> reduce(DataSet<Boolean> d) { return d.reduce(new Or()); }
static DataSet<Boolean> function(DataSet<Boolean> d) { return d.reduce(new Or()); }
/** * Performs a logical disjunction on a data set of boolean values. * * @param d boolean set * @return disjunction */
Performs a logical disjunction on a data set of boolean values
reduce
{ "repo_name": "rostam/gradoop", "path": "gradoop-flink/src/main/java/org/gradoop/flink/model/impl/functions/bool/Or.java", "license": "apache-2.0", "size": 2184 }
[ "org.apache.flink.api.java.DataSet" ]
import org.apache.flink.api.java.DataSet;
import org.apache.flink.api.java.*;
[ "org.apache.flink" ]
org.apache.flink;
1,027,786
void setDescription(Translations value);
void setDescription(Translations value);
/** * Sets the value of the '{@link com.odcgroup.t24.enquiry.enquiry.DrillDown#getDescription <em>Description</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Description</em>' containment reference. * @see #getDescription() * @generated */
Sets the value of the '<code>com.odcgroup.t24.enquiry.enquiry.DrillDown#getDescription Description</code>' containment reference.
setDescription
{ "repo_name": "debabratahazra/DS", "path": "designstudio/components/t24/core/com.odcgroup.t24.enquiry.model/src-gen/com/odcgroup/t24/enquiry/enquiry/DrillDown.java", "license": "epl-1.0", "size": 8164 }
[ "com.odcgroup.translation.translationDsl.Translations" ]
import com.odcgroup.translation.translationDsl.Translations;
import com.odcgroup.translation.*;
[ "com.odcgroup.translation" ]
com.odcgroup.translation;
1,424,538
public boolean seek(long time, TimeUnit unit) { return seek(1.0, Format.TIME, SeekFlags.FLUSH | SeekFlags.KEY_UNIT, SeekType.SET, TimeUnit.NANOSECONDS.convert(time, unit), SeekType.NONE, -1); }
boolean function(long time, TimeUnit unit) { return seek(1.0, Format.TIME, SeekFlags.FLUSH SeekFlags.KEY_UNIT, SeekType.SET, TimeUnit.NANOSECONDS.convert(time, unit), SeekType.NONE, -1); }
/** * Sets the current position in the media stream. * * @param time the time to change the position to. * @param unit the {@code TimeUnit} the <tt>time</tt> is expressed in. * @return true if seek is successful */
Sets the current position in the media stream
seek
{ "repo_name": "gstreamer-java/gstreamer1.x-java", "path": "src/org/gstreamer/Pipeline.java", "license": "gpl-3.0", "size": 15257 }
[ "java.util.concurrent.TimeUnit" ]
import java.util.concurrent.TimeUnit;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
2,870,407
public Integer getBankFitmentRating(final int wbTypeId, final double stationLength, final CidsBean kaBean, final boolean left) { final CidsBean bankFitmentBean = (CidsBean)kaBean.getProperty(fieldFromCode("PROP_BANK_FITMENT", "", left)); // NOI18N final CidsBean zBankFitmentBean = (CidsBean)kaBean.getProperty(fieldFromCode("PROP_Z_BANK_FITMENT", "", left)); // NOI18N return cache.getBankFitmentRating(bankFitmentBean.getMetaObject().getId(), zBankFitmentBean.getMetaObject().getId(), wbTypeId); }
Integer function(final int wbTypeId, final double stationLength, final CidsBean kaBean, final boolean left) { final CidsBean bankFitmentBean = (CidsBean)kaBean.getProperty(fieldFromCode(STR, STRPROP_Z_BANK_FITMENTSTR", left)); return cache.getBankFitmentRating(bankFitmentBean.getMetaObject().getId(), zBankFitmentBean.getMetaObject().getId(), wbTypeId); }
/** * DOCUMENT ME! * * @param wbTypeId DOCUMENT ME! * @param stationLength DOCUMENT ME! * @param kaBean DOCUMENT ME! * @param left DOCUMENT ME! * * @return DOCUMENT ME! */
DOCUMENT ME
getBankFitmentRating
{ "repo_name": "cismet/cids-custom-wrrl-db-mv", "path": "src/main/java/de/cismet/cids/custom/wrrl_db_mv/fgsk/Calc.java", "license": "lgpl-3.0", "size": 78568 }
[ "de.cismet.cids.dynamics.CidsBean" ]
import de.cismet.cids.dynamics.CidsBean;
import de.cismet.cids.dynamics.*;
[ "de.cismet.cids" ]
de.cismet.cids;
211,018
public void moveUp(PortfolioStructure structure, AbstractArtefact artefact) { move(structure, artefact, true); }
void function(PortfolioStructure structure, AbstractArtefact artefact) { move(structure, artefact, true); }
/** * Move up an artefact in the list * @param structure * @param artefact */
Move up an artefact in the list
moveUp
{ "repo_name": "stevenhva/InfoLearn_OpenOLAT", "path": "src/main/java/org/olat/portfolio/manager/EPStructureManager.java", "license": "apache-2.0", "size": 75865 }
[ "org.olat.portfolio.model.artefacts.AbstractArtefact", "org.olat.portfolio.model.structel.PortfolioStructure" ]
import org.olat.portfolio.model.artefacts.AbstractArtefact; import org.olat.portfolio.model.structel.PortfolioStructure;
import org.olat.portfolio.model.artefacts.*; import org.olat.portfolio.model.structel.*;
[ "org.olat.portfolio" ]
org.olat.portfolio;
1,045,227
List<ViewManager> createAllViewManagers( ReactApplicationContext catalystApplicationContext) { List<ViewManager> allViewManagers = new ArrayList<>(); for (ReactPackage reactPackage : mPackages) { allViewManagers.addAll(reactPackage.createViewManagers(catalystApplicationContext)); } return allViewManagers; }
List<ViewManager> createAllViewManagers( ReactApplicationContext catalystApplicationContext) { List<ViewManager> allViewManagers = new ArrayList<>(); for (ReactPackage reactPackage : mPackages) { allViewManagers.addAll(reactPackage.createViewManagers(catalystApplicationContext)); } return allViewManagers; }
/** * Uses configured {@link ReactPackage} instances to create all view managers */
Uses configured <code>ReactPackage</code> instances to create all view managers
createAllViewManagers
{ "repo_name": "hzgnpu/react-native", "path": "ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java", "license": "bsd-3-clause", "size": 26463 }
[ "com.facebook.react.bridge.ReactApplicationContext", "com.facebook.react.uimanager.ViewManager", "java.util.ArrayList", "java.util.List" ]
import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.uimanager.ViewManager; import java.util.ArrayList; import java.util.List;
import com.facebook.react.bridge.*; import com.facebook.react.uimanager.*; import java.util.*;
[ "com.facebook.react", "java.util" ]
com.facebook.react; java.util;
512,725
public SubResource remoteVirtualNetwork() { return this.remoteVirtualNetwork; }
SubResource function() { return this.remoteVirtualNetwork; }
/** * Get reference to the remote virtual network. * * @return the remoteVirtualNetwork value */
Get reference to the remote virtual network
remoteVirtualNetwork
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/network/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/network/v2020_03_01/implementation/HubVirtualNetworkConnectionInner.java", "license": "mit", "size": 5927 }
[ "com.microsoft.azure.SubResource" ]
import com.microsoft.azure.SubResource;
import com.microsoft.azure.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
1,569,251
final Map<String, String> expected = new HashMap<String, String>() {{ put("/data/economy/inflationandpriceindices", "/economy/inflationandpriceindices"); }}; for (String uri : expected.keySet()) { String newUri = URIUtil.removeEndpoint(uri); assertEquals(newUri, expected.get(uri)); } }
final Map<String, String> expected = new HashMap<String, String>() {{ put(STR, STR); }}; for (String uri : expected.keySet()) { String newUri = URIUtil.removeEndpoint(uri); assertEquals(newUri, expected.get(uri)); } }
/** * Tests that the first URI segment is properly removed, i.e * /data/economy/inflationandpriceindices becomes /economy/inflationandpriceindices */
Tests that the first URI segment is properly removed, i.e data/economy/inflationandpriceindices becomes /economy/inflationandpriceindices
testRemoveEndpoint
{ "repo_name": "ONSdigital/babbage", "path": "src/test/java/com/github/onsdigital/babbage/util/TestURIUtil.java", "license": "mit", "size": 3218 }
[ "java.util.HashMap", "java.util.Map", "org.junit.Assert" ]
import java.util.HashMap; import java.util.Map; import org.junit.Assert;
import java.util.*; import org.junit.*;
[ "java.util", "org.junit" ]
java.util; org.junit;
2,080,449
@Override void run() throws AsynchronousExecution; /** * Estimate of how long will it take to execute this executable. * Measured in milliseconds. * * Please, consider using {@link Executables#getEstimatedDurationFor(Queue.Executable)}
@Override void run() throws AsynchronousExecution; /** * Estimate of how long will it take to execute this executable. * Measured in milliseconds. * * Please, consider using {@link Executables#getEstimatedDurationFor(Queue.Executable)}
/** * Called by {@link Executor} to perform the task. * @throws AsynchronousExecution if you would like to continue without consuming a thread */
Called by <code>Executor</code> to perform the task
run
{ "repo_name": "1and1/jenkins", "path": "core/src/main/java/hudson/model/Queue.java", "license": "mit", "size": 97663 }
[ "hudson.model.queue.Executables" ]
import hudson.model.queue.Executables;
import hudson.model.queue.*;
[ "hudson.model.queue" ]
hudson.model.queue;
758,538
private void formatButton(JToggleButton button, String text) { button.setOpaque(false); button.setBackground(UIUtilities.BACKGROUND_COLOR); button.setBorder(new EmptyBorder(2, 2, 2, 2)); button.setToolTipText(text); }
void function(JToggleButton button, String text) { button.setOpaque(false); button.setBackground(UIUtilities.BACKGROUND_COLOR); button.setBorder(new EmptyBorder(2, 2, 2, 2)); button.setToolTipText(text); }
/** * Formats the specified button. * * @param button The button to handle. * @param text The tool tip text. * @param actionID The action command id. */
Formats the specified button
formatButton
{ "repo_name": "stelfrich/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/editor/PropertiesUI.java", "license": "gpl-2.0", "size": 54678 }
[ "javax.swing.JToggleButton", "javax.swing.border.EmptyBorder", "org.openmicroscopy.shoola.util.ui.UIUtilities" ]
import javax.swing.JToggleButton; import javax.swing.border.EmptyBorder; import org.openmicroscopy.shoola.util.ui.UIUtilities;
import javax.swing.*; import javax.swing.border.*; import org.openmicroscopy.shoola.util.ui.*;
[ "javax.swing", "org.openmicroscopy.shoola" ]
javax.swing; org.openmicroscopy.shoola;
130,824
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { MessagePull info = (MessagePull)o; super.looseMarshal(wireFormat, o, dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut); looseMarshalLong(wireFormat, info.getTimeout(), dataOut); looseMarshalString(info.getCorrelationId(), dataOut); looseMarshalNestedObject(wireFormat, (DataStructure)info.getMessageId(), dataOut); }
void function(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { MessagePull info = (MessagePull)o; super.looseMarshal(wireFormat, o, dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut); looseMarshalLong(wireFormat, info.getTimeout(), dataOut); looseMarshalString(info.getCorrelationId(), dataOut); looseMarshalNestedObject(wireFormat, (DataStructure)info.getMessageId(), dataOut); }
/** * Write the booleans that this object uses to a BooleanStream */
Write the booleans that this object uses to a BooleanStream
looseMarshal
{ "repo_name": "Mark-Booth/daq-eclipse", "path": "uk.ac.diamond.org.apache.activemq/org/apache/activemq/openwire/v3/MessagePullMarshaller.java", "license": "epl-1.0", "size": 6919 }
[ "java.io.DataOutput", "java.io.IOException", "org.apache.activemq.command.DataStructure", "org.apache.activemq.command.MessagePull", "org.apache.activemq.openwire.OpenWireFormat" ]
import java.io.DataOutput; import java.io.IOException; import org.apache.activemq.command.DataStructure; import org.apache.activemq.command.MessagePull; import org.apache.activemq.openwire.OpenWireFormat;
import java.io.*; import org.apache.activemq.command.*; import org.apache.activemq.openwire.*;
[ "java.io", "org.apache.activemq" ]
java.io; org.apache.activemq;
1,106,956
public static String toSlug(String source) { return replaceNonAlphaGroups(trimNonAlpha(removeDiacritics(source)), '_').toLowerCase(Locale.US); }
static String function(String source) { return replaceNonAlphaGroups(trimNonAlpha(removeDiacritics(source)), '_').toLowerCase(Locale.US); }
/** * Transforms a name to a slug identifier to be used in a FOSDEM URL. * * @param source * @return */
Transforms a name to a slug identifier to be used in a FOSDEM URL
toSlug
{ "repo_name": "flowolf/glt-companion", "path": "app/src/main/java/at/linuxtage/companion/utils/StringUtils.java", "license": "apache-2.0", "size": 3620 }
[ "java.util.Locale" ]
import java.util.Locale;
import java.util.*;
[ "java.util" ]
java.util;
1,586,060
private void writeOut(List<Integer> closedset, int support) throws IOException { // increase the number of closed itemsets closedCount++; StringBuffer buffer = new StringBuffer(); // for each item in the closed itemset Iterator<Integer> iterItem = closedset.iterator(); while(iterItem.hasNext()){ // append the item buffer.append(iterItem.next()); // if it is not the last item, append a space if(iterItem.hasNext()){ buffer.append(' '); }else{ break; } } // append the support buffer.append(" #SUP: "); buffer.append(support); // append the buffer writer.write(buffer.toString()); writer.newLine(); }
void function(List<Integer> closedset, int support) throws IOException { closedCount++; StringBuffer buffer = new StringBuffer(); Iterator<Integer> iterItem = closedset.iterator(); while(iterItem.hasNext()){ buffer.append(iterItem.next()); if(iterItem.hasNext()){ buffer.append(' '); }else{ break; } } buffer.append(STR); buffer.append(support); writer.write(buffer.toString()); writer.newLine(); }
/** * Write a frequent closed itemset that is found to the output file. */
Write a frequent closed itemset that is found to the output file
writeOut
{ "repo_name": "YinYanfei/CadalWorkspace", "path": "ca/pfv/spmf/algorithms/frequentpatterns/dci_closed_optimized/AlgoDCI_Closed_Optimized.java", "license": "gpl-3.0", "size": 15253 }
[ "java.io.IOException", "java.util.Iterator", "java.util.List" ]
import java.io.IOException; import java.util.Iterator; import java.util.List;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,343,611
public void setStanzaId(String id) { if (id != null) { requireNotNullOrEmpty(id, "id must either be null or not the empty String"); } this.id = id; }
void function(String id) { if (id != null) { requireNotNullOrEmpty(id, STR); } this.id = id; }
/** * Sets the unique ID of the packet. To indicate that a stanza(/packet) has no id * pass <code>null</code> as the packet's id value. * * @param id the unique ID for the packet. */
Sets the unique ID of the packet. To indicate that a stanza(/packet) has no id pass <code>null</code> as the packet's id value
setStanzaId
{ "repo_name": "vanitasvitae/smack-omemo", "path": "smack-core/src/main/java/org/jivesoftware/smack/packet/Stanza.java", "license": "apache-2.0", "size": 17532 }
[ "org.jivesoftware.smack.util.StringUtils" ]
import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smack.util.*;
[ "org.jivesoftware.smack" ]
org.jivesoftware.smack;
845,868
// Mantém o valor informado no escopo da classe para utilização // posterior // pelo método DecimalFormat desta mesma classe. valorMonetario = dec; // Se o valor informado for negativo ou maior que 999 septilhões, // dispara uma exceção. BigDecimal maxNumber = new BigDecimal("999999999999999999999999999.99"); if ((dec.signum() == -1) || (dec.compareTo(maxNumber) == 1)) { throw new NumberFormatException( "\nNao sao suportados numeros negativos ou maiores que 999 septilhoes para a conversao de valores monetarios." + "\nNumeros validos vao de 0,00 até 999.999.999.999.999.999.999.999.999,99" + "\nO numero informado foi: " + DecimalFormat()); } // Converte para inteiro arredondando os centavos. num = dec.setScale(2, BigDecimal.ROUND_HALF_UP).multiply( BigDecimal.valueOf(100)).toBigInteger(); // Adiciona valores. nro.clear(); if (num.equals(BigInteger.ZERO)) { // Centavos. nro.add(new Integer(0)); // Valor. nro.add(new Integer(0)); } else { // Adiciona centavos. addRemainder(100); // Adiciona grupos de 1000. while (!num.equals(BigInteger.ZERO)) { addRemainder(1000); } } }
valorMonetario = dec; BigDecimal maxNumber = new BigDecimal(STR); if ((dec.signum() == -1) (dec.compareTo(maxNumber) == 1)) { throw new NumberFormatException( STR + STR + STR + DecimalFormat()); } num = dec.setScale(2, BigDecimal.ROUND_HALF_UP).multiply( BigDecimal.valueOf(100)).toBigInteger(); nro.clear(); if (num.equals(BigInteger.ZERO)) { nro.add(new Integer(0)); nro.add(new Integer(0)); } else { addRemainder(100); while (!num.equals(BigInteger.ZERO)) { addRemainder(1000); } } }
/** * <p> * Seta o atributo Number. * </p> * * @param dec O novo valor para Number. * @since JDK 1.5 */
Seta o atributo Number.
setNumber
{ "repo_name": "barcellosLuizFernando/facilitador", "path": "src/ferramentas/Extenso.java", "license": "mit", "size": 13598 }
[ "java.math.BigDecimal", "java.math.BigInteger" ]
import java.math.BigDecimal; import java.math.BigInteger;
import java.math.*;
[ "java.math" ]
java.math;
546,581
@Test public void testInterpolationROINoData() { // Following constant is pixel size (in degrees). // This constant must be identical to the one defined in 'getRandomCoverage()' GridCoverage2D coverage = getRandomCoverage(); final Hints hints = new Hints(Hints.TILE_ENCODING, "raw"); final GridCoverageFactory factory = CoverageFactoryFinder.getGridCoverageFactory(hints); Map<String, Object> properties = new HashMap<>(); RenderedImage src = coverage.getRenderedImage(); // Setting ROI and NoData ROIShape roi = new ROIShape( new Rectangle( src.getMinX(), src.getMinY(), src.getWidth() / 2, src.getHeight() / 2)); CoverageUtilities.setROIProperty(properties, roi); NoDataContainer noDataContainer = new NoDataContainer(15); properties.put("GC_NODATA", noDataContainer); coverage = factory.create( "Test2", src, coverage.getEnvelope(), coverage.getSampleDimensions(), null, properties); final double PIXEL_SIZE = XAffineTransform.getScale( (AffineTransform) coverage.getGridGeometry().getGridToCRS()); final Interpolation interpolation = Interpolation.getInstance(Interpolation.INTERP_NEAREST); coverage = Interpolator2D.create(coverage, new Interpolation[] {interpolation}); final int band = 0; // Band to test. double[] buffer = null; final BorderExtender be = BorderExtender.createInstance(BorderExtender.BORDER_COPY); Rectangle rectangle = PlanarImage.wrapRenderedImage(coverage.getRenderedImage()).getBounds(); rectangle = new Rectangle( rectangle.x, rectangle.y, rectangle.width + interpolation.getWidth(), rectangle.height + interpolation.getHeight()); final Raster data = PlanarImage.wrapRenderedImage(coverage.getRenderedImage()) .getExtendedData(rectangle, be); final Envelope envelope = coverage.getEnvelope(); final GridEnvelope range = coverage.getGridGeometry().getGridRange(); final double left = envelope.getMinimum(0); final double upper = envelope.getMaximum(1); final Point2D.Double point = new Point2D.Double(); // Will maps to pixel upper-left corner // ROI and NOdata Range nodata = noDataContainer.getAsRange(); double bkg = nodata.getMin(true).doubleValue(); for (int j = range.getSpan(1); j >= 0; --j) { for (int i = range.getSpan(0); i >= 0; --i) { point.x = left + PIXEL_SIZE * i; point.y = upper - PIXEL_SIZE * j; buffer = coverage.evaluate(point, buffer); double t = buffer[band]; if (!roi.contains(i, j)) { assertEquals(bkg, t, EPS); } else { // Computes the expected value: double s00 = data.getSampleDouble(i, j, band); if (nodata.contains(s00)) { assertEquals(bkg, t, EPS); } else { double s = interpolation.interpolate(new double[][] {{s00}}, 0, 0); assertEquals(s, t, EPS); } } } } }
void function() { GridCoverage2D coverage = getRandomCoverage(); final Hints hints = new Hints(Hints.TILE_ENCODING, "raw"); final GridCoverageFactory factory = CoverageFactoryFinder.getGridCoverageFactory(hints); Map<String, Object> properties = new HashMap<>(); RenderedImage src = coverage.getRenderedImage(); ROIShape roi = new ROIShape( new Rectangle( src.getMinX(), src.getMinY(), src.getWidth() / 2, src.getHeight() / 2)); CoverageUtilities.setROIProperty(properties, roi); NoDataContainer noDataContainer = new NoDataContainer(15); properties.put(STR, noDataContainer); coverage = factory.create( "Test2", src, coverage.getEnvelope(), coverage.getSampleDimensions(), null, properties); final double PIXEL_SIZE = XAffineTransform.getScale( (AffineTransform) coverage.getGridGeometry().getGridToCRS()); final Interpolation interpolation = Interpolation.getInstance(Interpolation.INTERP_NEAREST); coverage = Interpolator2D.create(coverage, new Interpolation[] {interpolation}); final int band = 0; double[] buffer = null; final BorderExtender be = BorderExtender.createInstance(BorderExtender.BORDER_COPY); Rectangle rectangle = PlanarImage.wrapRenderedImage(coverage.getRenderedImage()).getBounds(); rectangle = new Rectangle( rectangle.x, rectangle.y, rectangle.width + interpolation.getWidth(), rectangle.height + interpolation.getHeight()); final Raster data = PlanarImage.wrapRenderedImage(coverage.getRenderedImage()) .getExtendedData(rectangle, be); final Envelope envelope = coverage.getEnvelope(); final GridEnvelope range = coverage.getGridGeometry().getGridRange(); final double left = envelope.getMinimum(0); final double upper = envelope.getMaximum(1); final Point2D.Double point = new Point2D.Double(); Range nodata = noDataContainer.getAsRange(); double bkg = nodata.getMin(true).doubleValue(); for (int j = range.getSpan(1); j >= 0; --j) { for (int i = range.getSpan(0); i >= 0; --i) { point.x = left + PIXEL_SIZE * i; point.y = upper - PIXEL_SIZE * j; buffer = coverage.evaluate(point, buffer); double t = buffer[band]; if (!roi.contains(i, j)) { assertEquals(bkg, t, EPS); } else { double s00 = data.getSampleDouble(i, j, band); if (nodata.contains(s00)) { assertEquals(bkg, t, EPS); } else { double s = interpolation.interpolate(new double[][] {{s00}}, 0, 0); assertEquals(s, t, EPS); } } } } }
/** * Tests bilinear intersection at pixel edges. It should be equals to the average of the four * pixels around. */
Tests bilinear intersection at pixel edges. It should be equals to the average of the four pixels around
testInterpolationROINoData
{ "repo_name": "geotools/geotools", "path": "modules/library/coverage/src/test/java/org/geotools/coverage/grid/InterpolatorTest.java", "license": "lgpl-2.1", "size": 10112 }
[ "it.geosolutions.jaiext.range.NoDataContainer", "it.geosolutions.jaiext.range.Range", "java.awt.Rectangle", "java.awt.geom.AffineTransform", "java.awt.geom.Point2D", "java.awt.image.Raster", "java.awt.image.RenderedImage", "java.util.HashMap", "java.util.Map", "javax.media.jai.BorderExtender", "...
import it.geosolutions.jaiext.range.NoDataContainer; import it.geosolutions.jaiext.range.Range; import java.awt.Rectangle; import java.awt.geom.AffineTransform; import java.awt.geom.Point2D; import java.awt.image.Raster; import java.awt.image.RenderedImage; import java.util.HashMap; import java.util.Map; import javax.media.jai.BorderExtender; import javax.media.jai.Interpolation; import javax.media.jai.PlanarImage; import javax.media.jai.ROIShape; import org.geotools.coverage.CoverageFactoryFinder; import org.geotools.coverage.util.CoverageUtilities; import org.geotools.referencing.operation.matrix.XAffineTransform; import org.geotools.util.factory.Hints; import org.junit.Assert; import org.opengis.coverage.grid.GridEnvelope; import org.opengis.geometry.Envelope;
import it.geosolutions.jaiext.range.*; import java.awt.*; import java.awt.geom.*; import java.awt.image.*; import java.util.*; import javax.media.jai.*; import org.geotools.coverage.*; import org.geotools.coverage.util.*; import org.geotools.referencing.operation.matrix.*; import org.geotools.util.factory.*; import org.junit.*; import org.opengis.coverage.grid.*; import org.opengis.geometry.*;
[ "it.geosolutions.jaiext", "java.awt", "java.util", "javax.media", "org.geotools.coverage", "org.geotools.referencing", "org.geotools.util", "org.junit", "org.opengis.coverage", "org.opengis.geometry" ]
it.geosolutions.jaiext; java.awt; java.util; javax.media; org.geotools.coverage; org.geotools.referencing; org.geotools.util; org.junit; org.opengis.coverage; org.opengis.geometry;
290,836
public void processRequest(RequestEvent requestEvent) { try { Request request = requestEvent.getRequest(); //System.out.println("GOT REQUEST: " + request); CallIdHeader callIdHeader = (CallIdHeader) request.getHeader(CallIdHeader.NAME); String sipCallId = callIdHeader.getCallId(); SipListener sipListener = findSipListener(requestEvent); if (sipListener != null) { if (request.getMethod().equals(Request.INVITE)) { duplicateInvite(request); return; } sipListener.processRequest(requestEvent); return; } else { if (request.getMethod().equals(Request.REGISTER)) { handleRegister(request, requestEvent); } else if (!request.getMethod().equals(Request.INVITE)) { Logger.writeFile("sipListener could not be found for " + sipCallId + " " + request.getMethod() + ". Ignoring"); return; } } if (request.getMethod().equals(Request.INVITE)) { if (SipIncomingCallAgent.addSipCallId(sipCallId) == false) { duplicateInvite(request); return; } CallParticipant cp = new CallParticipant(); String s = SipUtil.getCallIdFromSdp(request); if (s != null) { if (Logger.logLevel >= Logger.LOG_MOREINFO) { Logger.println("Using callId from SDP in INVITE: " + s); } cp.setCallId(s); } s = SipUtil.getConferenceIdFromSdp(request); if (s != null) { String[] tokens = s.split(":"); String conferenceId = tokens[0].trim(); if (conferenceId.length() == 0) { conferenceId = null; } cp.setConferenceId(conferenceId); if (tokens.length > 1) { cp.setMediaPreference(tokens[1]); } if (tokens.length > 2) { cp.setConferenceDisplayName(tokens[2]); } } if (SipUtil.getUserNameFromSdp(request) != null) { cp.setName(SipUtil.getUserNameFromSdp(request)); } else { cp.setName(SipUtil.getFromName(requestEvent)); } cp.setDistributedBridge( SipUtil.getDistributedBridgeFromSdp(request)); if (SipUtil.getToPhoneNumber(requestEvent).equals("6666")) { cp.setPhoneNumber("sip:6666@" + SipUtil.getFromHost(requestEvent)); } else { cp.setPhoneNumber( SipUtil.getFromPhoneNumber(requestEvent)); } new IncomingCallHandler(cp, requestEvent); return; } } catch (Exception e) { Logger.exception("processRequest", e); } }
void function(RequestEvent requestEvent) { try { Request request = requestEvent.getRequest(); CallIdHeader callIdHeader = (CallIdHeader) request.getHeader(CallIdHeader.NAME); String sipCallId = callIdHeader.getCallId(); SipListener sipListener = findSipListener(requestEvent); if (sipListener != null) { if (request.getMethod().equals(Request.INVITE)) { duplicateInvite(request); return; } sipListener.processRequest(requestEvent); return; } else { if (request.getMethod().equals(Request.REGISTER)) { handleRegister(request, requestEvent); } else if (!request.getMethod().equals(Request.INVITE)) { Logger.writeFile(STR + sipCallId + " " + request.getMethod() + STR); return; } } if (request.getMethod().equals(Request.INVITE)) { if (SipIncomingCallAgent.addSipCallId(sipCallId) == false) { duplicateInvite(request); return; } CallParticipant cp = new CallParticipant(); String s = SipUtil.getCallIdFromSdp(request); if (s != null) { if (Logger.logLevel >= Logger.LOG_MOREINFO) { Logger.println(STR + s); } cp.setCallId(s); } s = SipUtil.getConferenceIdFromSdp(request); if (s != null) { String[] tokens = s.split(":"); String conferenceId = tokens[0].trim(); if (conferenceId.length() == 0) { conferenceId = null; } cp.setConferenceId(conferenceId); if (tokens.length > 1) { cp.setMediaPreference(tokens[1]); } if (tokens.length > 2) { cp.setConferenceDisplayName(tokens[2]); } } if (SipUtil.getUserNameFromSdp(request) != null) { cp.setName(SipUtil.getUserNameFromSdp(request)); } else { cp.setName(SipUtil.getFromName(requestEvent)); } cp.setDistributedBridge( SipUtil.getDistributedBridgeFromSdp(request)); if (SipUtil.getToPhoneNumber(requestEvent).equals("6666")) { cp.setPhoneNumber(STR + SipUtil.getFromHost(requestEvent)); } else { cp.setPhoneNumber( SipUtil.getFromPhoneNumber(requestEvent)); } new IncomingCallHandler(cp, requestEvent); return; } } catch (Exception e) { Logger.exception(STR, e); } }
/** * Process requests received. Forwards the request to * the appropriate SipListener. * @param requestEvent the request event */
Process requests received. Forwards the request to the appropriate SipListener
processRequest
{ "repo_name": "damirkusar/jvoicebridge", "path": "voip/src/com/sun/voip/server/SipServer.java", "license": "gpl-2.0", "size": 20331 }
[ "com.sun.voip.CallParticipant", "com.sun.voip.Logger" ]
import com.sun.voip.CallParticipant; import com.sun.voip.Logger;
import com.sun.voip.*;
[ "com.sun.voip" ]
com.sun.voip;
1,762,407
public static Request getReadRequest(Set<String> propertyIds, Map<String, String> requestInfoProperties, Map<String, TemporalInfo> mapTemporalInfo, PageRequest pageRequest, SortRequest sortRequest) { return new RequestImpl(propertyIds, null, requestInfoProperties, mapTemporalInfo, sortRequest, pageRequest); }
static Request function(Set<String> propertyIds, Map<String, String> requestInfoProperties, Map<String, TemporalInfo> mapTemporalInfo, PageRequest pageRequest, SortRequest sortRequest) { return new RequestImpl(propertyIds, null, requestInfoProperties, mapTemporalInfo, sortRequest, pageRequest); }
/** * Factory method to create a read request from the given set of property ids. * The set of property ids represents the properties of interest for the * query. * * @param propertyIds * the property ids associated with the request; may be null * @param requestInfoProperties * request info properties * @param mapTemporalInfo * the temporal info * @param pageRequest * an optional page request, or {@code null} for none. * @param sortRequest * an optional sort request, or {@code null} for none. */
Factory method to create a read request from the given set of property ids. The set of property ids represents the properties of interest for the query
getReadRequest
{ "repo_name": "radicalbit/ambari", "path": "ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/PropertyHelper.java", "license": "apache-2.0", "size": 26945 }
[ "java.util.Map", "java.util.Set", "org.apache.ambari.server.controller.internal.RequestImpl", "org.apache.ambari.server.controller.spi.PageRequest", "org.apache.ambari.server.controller.spi.Request", "org.apache.ambari.server.controller.spi.SortRequest", "org.apache.ambari.server.controller.spi.Temporal...
import java.util.Map; import java.util.Set; import org.apache.ambari.server.controller.internal.RequestImpl; import org.apache.ambari.server.controller.spi.PageRequest; import org.apache.ambari.server.controller.spi.Request; import org.apache.ambari.server.controller.spi.SortRequest; import org.apache.ambari.server.controller.spi.TemporalInfo;
import java.util.*; import org.apache.ambari.server.controller.internal.*; import org.apache.ambari.server.controller.spi.*;
[ "java.util", "org.apache.ambari" ]
java.util; org.apache.ambari;
1,300,417
private void runTests(Problem problem, CommandLine commandLine) { int trials = 5; if (commandLine.getOptionValue("test") != null) { trials = Integer.parseInt(commandLine.getOptionValue("test")); } try { int count = 0; RandomInitialization initialization = new RandomInitialization( problem, trials); Solution[] solutions = initialization.initialize(); for (Solution solution : solutions) { System.out.println("Running test " + (++count) + ":"); for (int j = 0; j < solution.getNumberOfVariables(); j++) { System.out.print(" Variable "); System.out.print(j+1); System.out.print(" = "); System.out.println(solution.getVariable(j)); } System.out.println(" * Evaluating solution *"); problem.evaluate(solution); System.out.println(" * Evaluation complete *"); for (int j = 0; j < solution.getNumberOfObjectives(); j++) { System.out.print(" Objective "); System.out.print(j+1); System.out.print(" = "); System.out.println(solution.getObjective(j)); } for (int j = 0; j < solution.getNumberOfConstraints(); j++) { System.out.print(" Constraint "); System.out.print(j+1); System.out.print(" = "); System.out.println(solution.getConstraint(j)); } if ((solution.getNumberOfConstraints() > 0) && solution.violatesConstraints()) { System.out.println(" Solution is infeasible (non-zero " + "constraint value)!"); } } System.out.println("Test succeeded!"); } catch (Exception e) { e.printStackTrace(); System.out.println("Test failed! Please see the error message " + "above for details."); } }
void function(Problem problem, CommandLine commandLine) { int trials = 5; if (commandLine.getOptionValue("test") != null) { trials = Integer.parseInt(commandLine.getOptionValue("test")); } try { int count = 0; RandomInitialization initialization = new RandomInitialization( problem, trials); Solution[] solutions = initialization.initialize(); for (Solution solution : solutions) { System.out.println(STR + (++count) + ":"); for (int j = 0; j < solution.getNumberOfVariables(); j++) { System.out.print(STR); System.out.print(j+1); System.out.print(STR); System.out.println(solution.getVariable(j)); } System.out.println(STR); problem.evaluate(solution); System.out.println(STR); for (int j = 0; j < solution.getNumberOfObjectives(); j++) { System.out.print(STR); System.out.print(j+1); System.out.print(STR); System.out.println(solution.getObjective(j)); } for (int j = 0; j < solution.getNumberOfConstraints(); j++) { System.out.print(STR); System.out.print(j+1); System.out.print(STR); System.out.println(solution.getConstraint(j)); } if ((solution.getNumberOfConstraints() > 0) && solution.violatesConstraints()) { System.out.println(STR + STR); } } System.out.println(STR); } catch (Exception e) { e.printStackTrace(); System.out.println(STR + STR); } }
/** * Runs a number of trials as a way to quickly test if the connection * between this solver and the problem is functional. * * @param problem the problem * @param commandLine the command line arguments */
Runs a number of trials as a way to quickly test if the connection between this solver and the problem is functional
runTests
{ "repo_name": "Matsemann/eamaster", "path": "code/src/main/java/org/moeaframework/analysis/tools/Solve.java", "license": "mit", "size": 18186 }
[ "org.apache.commons.cli.CommandLine", "org.moeaframework.core.Problem", "org.moeaframework.core.Solution", "org.moeaframework.core.operator.RandomInitialization" ]
import org.apache.commons.cli.CommandLine; import org.moeaframework.core.Problem; import org.moeaframework.core.Solution; import org.moeaframework.core.operator.RandomInitialization;
import org.apache.commons.cli.*; import org.moeaframework.core.*; import org.moeaframework.core.operator.*;
[ "org.apache.commons", "org.moeaframework.core" ]
org.apache.commons; org.moeaframework.core;
1,249,184
HistoryStep step = instance.getMostRecentStep(actionName); if (step != null) { return new DateRoField(step.getActionDate()); } else { return new DateRoField(null); } } private final String actionName;
HistoryStep step = instance.getMostRecentStep(actionName); if (step != null) { return new DateRoField(step.getActionDate()); } else { return new DateRoField(null); } } private final String actionName;
/** * Returns a field built from this template and filled from the given process instance. */
Returns a field built from this template and filled from the given process instance
getField
{ "repo_name": "auroreallibe/Silverpeas-Core", "path": "core-services/workflow/src/main/java/org/silverpeas/core/workflow/engine/datarecord/ActionDateTemplate.java", "license": "agpl-3.0", "size": 2270 }
[ "org.silverpeas.core.workflow.api.instance.HistoryStep" ]
import org.silverpeas.core.workflow.api.instance.HistoryStep;
import org.silverpeas.core.workflow.api.instance.*;
[ "org.silverpeas.core" ]
org.silverpeas.core;
202,854
protected int calcVertexColor(Vertex vertex, int[][] aoMatrix) { int color = params.usePerVertexColor.get() ? vertex.getColor() : params.colorMultiplier.get(); if (drawMode == GL11.GL_LINE) return color; if (renderType != TYPE_ISBRH_WORLD && renderType != TYPE_TESR_WORLD) return color; if (!params.calculateAOColor.get() || aoMatrix == null) return color; float factor = getBlockAmbientOcclusion(world, x + params.direction.get().offsetX, y + params.direction.get().offsetY, z + params.direction.get().offsetZ); for (int i = 0; i < aoMatrix.length; i++) factor += getBlockAmbientOcclusion(world, x + aoMatrix[i][0], y + aoMatrix[i][1], z + aoMatrix[i][2]); factor *= params.colorFactor.get(); int r = (int) ((color >> 16 & 255) * factor / (aoMatrix.length + 1)); int g = (int) ((color >> 8 & 255) * factor / (aoMatrix.length + 1)); int b = (int) ((color & 255) * factor / (aoMatrix.length + 1)); color = r << 16 | g << 8 | b; return color; }
int function(Vertex vertex, int[][] aoMatrix) { int color = params.usePerVertexColor.get() ? vertex.getColor() : params.colorMultiplier.get(); if (drawMode == GL11.GL_LINE) return color; if (renderType != TYPE_ISBRH_WORLD && renderType != TYPE_TESR_WORLD) return color; if (!params.calculateAOColor.get() aoMatrix == null) return color; float factor = getBlockAmbientOcclusion(world, x + params.direction.get().offsetX, y + params.direction.get().offsetY, z + params.direction.get().offsetZ); for (int i = 0; i < aoMatrix.length; i++) factor += getBlockAmbientOcclusion(world, x + aoMatrix[i][0], y + aoMatrix[i][1], z + aoMatrix[i][2]); factor *= params.colorFactor.get(); int r = (int) ((color >> 16 & 255) * factor / (aoMatrix.length + 1)); int g = (int) ((color >> 8 & 255) * factor / (aoMatrix.length + 1)); int b = (int) ((color & 255) * factor / (aoMatrix.length + 1)); color = r << 16 g << 8 b; return color; }
/** * Calculate the ambient occlusion for a vertex and also apply the side dependent shade.<br /> * <b>aoMatrix</b> is the list of block coordinates necessary to compute AO. If it's empty, only the global face shade is applied.<br /> * Also, <i>params.colorMultiplier</i> is applied as well. * * @param vertex * @param aoMatrix */
Calculate the ambient occlusion for a vertex and also apply the side dependent shade. aoMatrix is the list of block coordinates necessary to compute AO. If it's empty, only the global face shade is applied. Also, params.colorMultiplier is applied as well
calcVertexColor
{ "repo_name": "Phenix246/Blaze_Land_Libs", "path": "common/fr/blaze_empire/phenix246/libs/client/renderer/BaseRenderer.java", "license": "mit", "size": 23968 }
[ "fr.blaze_empire.phenix246.libs.client.renderer.elements.Vertex" ]
import fr.blaze_empire.phenix246.libs.client.renderer.elements.Vertex;
import fr.blaze_empire.phenix246.libs.client.renderer.elements.*;
[ "fr.blaze_empire.phenix246" ]
fr.blaze_empire.phenix246;
587,514