signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class SegmentTransactionalInsertAction { /** * Behaves similarly to
* { @ link org . apache . druid . indexing . overlord . IndexerMetadataStorageCoordinator # announceHistoricalSegments ( Set , DataSourceMetadata , DataSourceMetadata ) } . */
@ Override public SegmentPublishResult perform ( Task task , TaskAc... | TaskActionPreconditions . checkLockCoversSegments ( task , toolbox . getTaskLockbox ( ) , segments ) ; final SegmentPublishResult retVal ; try { retVal = toolbox . getTaskLockbox ( ) . doInCriticalSection ( task , segments . stream ( ) . map ( DataSegment :: getInterval ) . collect ( Collectors . toList ( ) ) , Critica... |
public class CmsContentService { /** * Decodes the newlink request parameter if possible . < p >
* @ param newLink the parameter to decode
* @ return the decoded value */
protected String decodeNewLink ( String newLink ) { } } | String result = newLink ; if ( result == null ) { return null ; } try { result = CmsEncoder . decode ( result ) ; try { result = CmsEncoder . decode ( result ) ; } catch ( Throwable e ) { LOG . info ( e . getLocalizedMessage ( ) , e ) ; } } catch ( Throwable e ) { LOG . info ( e . getLocalizedMessage ( ) , e ) ; } retu... |
public class AbstractHibernateCriteriaBuilder { /** * Adds a sql projection to the criteria
* @ param sql SQL projecting
* @ param columnAliases List of column aliases for the projected values
* @ param types List of types for the projected values */
protected void sqlProjection ( String sql , List < String > col... | projectionList . add ( Projections . sqlProjection ( sql , columnAliases . toArray ( new String [ columnAliases . size ( ) ] ) , types . toArray ( new Type [ types . size ( ) ] ) ) ) ; |
public class UpdateScheduleRequest { /** * Rotations of schedule */
public List < ScheduleRotation > getRotations ( ) { } } | if ( getTimeZone ( ) != null && rotations != null ) for ( ScheduleRotation scheduleRotation : rotations ) scheduleRotation . setScheduleTimeZone ( getTimeZone ( ) ) ; return rotations ; |
public class JaegerConfiguration { /** * Sets the reporter configuration .
* @ param reporterConfiguration The reporter configuration */
@ Inject public void setReporterConfiguration ( @ Nullable JaegerReporterConfiguration reporterConfiguration ) { } } | if ( reporterConfiguration != null ) { configuration . withReporter ( reporterConfiguration . configuration ) ; } |
public class AbstractX509FileSystemStore { /** * Return a unique identifier appropriate for a file name . If the certificate as a subject key identifier , the
* result is this encoded identifier . Else , use the concatenation of the certificate serial number and the issuer
* name .
* @ param publicKey the certifi... | byte [ ] keyId = publicKey . getSubjectKeyIdentifier ( ) ; if ( keyId != null ) { return this . hex . encode ( keyId ) ; } return publicKey . getSerialNumber ( ) . toString ( ) + ", " + publicKey . getIssuer ( ) . getName ( ) ; |
public class NLPSeg { /** * internal method to define the composed entity
* for numeric and unit word composed word
* @ paramnumeric
* @ paramunitWord
* @ returnIWord */
private IWord getNumericUnitComposedWord ( String numeric , IWord unitWord ) { } } | IStringBuffer sb = new IStringBuffer ( ) ; sb . clear ( ) . append ( numeric ) . append ( unitWord . getValue ( ) ) ; IWord wd = new Word ( sb . toString ( ) , IWord . T_CJK_WORD ) ; String [ ] entity = unitWord . getEntity ( ) ; int eIdx = ArrayUtil . startsWith ( Entity . E_TIME_P , entity ) ; if ( eIdx > - 1 ) { sb ... |
public class ProgramMeta { /** * The program type definition
* @ return Optional of the < code > program < / code > field value . */
@ javax . annotation . Nonnull public java . util . Optional < net . morimekta . providence . model . ProgramType > optionalProgram ( ) { } } | return java . util . Optional . ofNullable ( mProgram ) ; |
public class Cob2Xsd { /** * Parses a COBOL source into an in - memory model .
* @ param cobolReader reads the raw COBOL source
* @ return a list of root COBOL data items
* @ throws RecognizerException if COBOL recognition fails */
public List < CobolDataItem > toModel ( final Reader cobolReader ) throws Recogniz... | return emitModel ( parse ( lex ( clean ( cobolReader ) ) ) ) ; |
public class DefaultGroovyMethods { /** * Creates a new List by inserting all of the elements in the given Iterable
* to the elements from this List at the specified index .
* @ param self an original list
* @ param additions an Iterable containing elements to be merged with the elements from the original List
... | return plus ( self , index , toList ( additions ) ) ; |
public class AccessPoint { /** * If closest
* @ param currRequest
* @ param revisitRecord
* @ param closest
* @ return the payload resource
* @ throws ResourceNotAvailableException
* @ throws ConfigurationException
* @ throws AccessControlException
* @ throws BadQueryException
* @ throws ResourceNotIn... | if ( ! closest . isRevisitDigest ( ) ) { LOGGER . warning ( "Revisit: record is not a revisit by identical content digest " + closest . getCaptureTimestamp ( ) + " " + closest . getOriginalUrl ( ) ) ; return null ; } CaptureSearchResult payloadLocation = null ; // Revisit from same url - - should have been found by the... |
public class CDIUtils { /** * public static BeanManager getBeanManagerFromJNDI ( )
* try
* in an application server
* return ( BeanManager ) InitialContext . doLookup ( " java : comp / BeanManager " ) ;
* catch ( NamingException e )
* silently ignore
* try
* in a servlet container
* return ( BeanManager... | Iterator < Bean < ? > > iter = bm . getBeans ( clazz ) . iterator ( ) ; if ( ! iter . hasNext ( ) ) { throw new IllegalStateException ( "CDI BeanManager cannot find an instance of requested type " + clazz . getName ( ) ) ; } Bean < T > bean = ( Bean < T > ) iter . next ( ) ; CreationalContext < T > ctx = bm . createCre... |
public class ClassDescSupport { /** * インポート名を追加します 。
* @ param classDesc クラス記述
* @ param importedClass インポートされるクラス */
public void addImportName ( ClassDesc classDesc , ClassConstants importedClass ) { } } | String packageName = importedClass . getPackageName ( ) ; if ( isImportTargetPackage ( classDesc , packageName ) ) { classDesc . addImportName ( importedClass . getQualifiedName ( ) ) ; } |
public class DumpProcessingController { /** * Processes the most recent dump of the given type using the given dump
* processor .
* @ see DumpProcessingController # processMostRecentMainDump ( )
* @ see DumpProcessingController # processAllRecentRevisionDumps ( )
* @ param dumpContentType
* the type of dump t... | MwDumpFile dumpFile = getMostRecentDump ( dumpContentType ) ; if ( dumpFile != null ) { processDumpFile ( dumpFile , dumpFileProcessor ) ; } |
public class RedisClientFactory { /** * Gets or Creates a { @ link IRedisClient } object .
* @ param host
* @ param port
* @ return */
public IRedisClient getRedisClient ( String host , int port ) { } } | return getRedisClient ( host , port , null , null ) ; |
public class StoryRunner { /** * Runs a Story with the given configuration and steps , applying the given
* meta filter .
* @ param configuration the Configuration used to run story
* @ param candidateSteps the List of CandidateSteps containing the candidate
* steps methods
* @ param story the Story to run
... | run ( configuration , candidateSteps , story , filter , null ) ; |
public class FastMathCalc { /** * Recompute a split .
* @ param a input / out array containing the split , changed
* on output */
private static void resplit ( final double a [ ] ) { } } | final double c = a [ 0 ] + a [ 1 ] ; final double d = - ( c - a [ 0 ] - a [ 1 ] ) ; if ( c < 8e298 && c > - 8e298 ) { // MAGIC NUMBER
double z = c * HEX_40000000 ; a [ 0 ] = ( c + z ) - z ; a [ 1 ] = c - a [ 0 ] + d ; } else { double z = c * 9.31322574615478515625E-10 ; a [ 0 ] = ( c + z - c ) * HEX_40000000 ; a [ 1 ] ... |
public class ProjectMarshaller { /** * Marshall the given parameter object . */
public void marshall ( Project project , ProtocolMarshaller protocolMarshaller ) { } } | if ( project == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( project . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( project . getArn ( ) , ARN_BINDING ) ; protocolMarshaller . marshall ( project . getDescription ( ) , DE... |
public class SourceStreamManager { /** * Process an Ack control message but use the specified ack prefix to decide if the
* ack prefix can be advanced .
* @ param ackMsg The Ack message
* @ param ackPrefix The new ack prefix
* @ return List of messages which are now completed and may be deleted
* @ throws SIR... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "processAck" , new Object [ ] { ackMsg , new Long ( ackPrefix ) } ) ; List indexList = null ; // Short circuit if incoming message has wrong stream ID
if ( ! hasStream ( ackMsg . getGuaranteedStreamUUID ( ) ) ) { // Bogus st... |
public class SCoverageReportMojo { /** * Generates SCoverage report .
* @ throws MojoExecutionException if unexpected problem occurs */
@ Override public void execute ( ) throws MojoExecutionException { } } | if ( ! canGenerateReport ( ) ) { getLog ( ) . info ( "Skipping SCoverage report generation" ) ; return ; } try { RenderingContext context = new RenderingContext ( outputDirectory , getOutputName ( ) + ".html" ) ; SiteRendererSink sink = new SiteRendererSink ( context ) ; Locale locale = Locale . getDefault ( ) ; genera... |
public class HystrixPlugins { /** * Reset all of the HystrixPlugins to null . You may invoke this directly , or it also gets invoked via < code > Hystrix . reset ( ) < / code > */
public static void reset ( ) { } } | getInstance ( ) . notifier . set ( null ) ; getInstance ( ) . concurrencyStrategy . set ( null ) ; getInstance ( ) . metricsPublisher . set ( null ) ; getInstance ( ) . propertiesFactory . set ( null ) ; getInstance ( ) . commandExecutionHook . set ( null ) ; HystrixMetricsPublisherFactory . reset ( ) ; |
public class ApiOvhOrder { /** * Retrieve configuration item
* REST : GET / order / cart / { cartId } / item / { itemId } / configuration / { configurationId }
* @ param cartId [ required ] Cart identifier
* @ param itemId [ required ] Product item identifier
* @ param configurationId [ required ] Configuration... | String qPath = "/order/cart/{cartId}/item/{itemId}/configuration/{configurationId}" ; StringBuilder sb = path ( qPath , cartId , itemId , configurationId ) ; String resp = execN ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhConfigurationItem . class ) ; |
public class URLEncoder { /** * Translates a string into < code > x - www - form - urlencoded < / code > format . This method uses the
* platform ' s default encoding as the encoding scheme to obtain the bytes for unsafe characters .
* @ param s < code > String < / code > to be translated .
* @ deprecated The res... | s = java . net . URLEncoder . encode ( s ) ; if ( s . indexOf ( '+' ) != - 1 ) s = StringUtil . replace ( s , "+" , "%20" , false ) ; return s ; |
public class HttpPostMultipartRequestDecoder { /** * This getMethod will parse as much as possible data and fill the list and map
* @ throws ErrorDataDecoderException
* if there is a problem with the charset decoding or other
* errors */
private void parseBody ( ) { } } | if ( currentStatus == MultiPartStatus . PREEPILOGUE || currentStatus == MultiPartStatus . EPILOGUE ) { if ( isLastChunk ) { currentStatus = MultiPartStatus . EPILOGUE ; } return ; } parseBodyMultipart ( ) ; |
public class ImageLoader { /** * Checks if the item is available in the cache .
* @ param requestUrl The url of the remote image
* @ param maxWidth The maximum width of the returned image .
* @ param maxHeight The maximum height of the returned image .
* @ return True if the item exists in cache , false otherwi... | return isCached ( requestUrl , maxWidth , maxHeight , ScaleType . CENTER_INSIDE ) ; |
public class ReportTaskProgressRequest { /** * Key - value pairs that define the properties of the ReportTaskProgressInput object .
* @ param fields
* Key - value pairs that define the properties of the ReportTaskProgressInput object . */
public void setFields ( java . util . Collection < Field > fields ) { } } | if ( fields == null ) { this . fields = null ; return ; } this . fields = new com . amazonaws . internal . SdkInternalList < Field > ( fields ) ; |
public class ExamplesImpl { /** * Returns examples to be reviewed .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ param listOptionalParameter the object representing the optional parameters to be set before calling this API
* @ throws IllegalArgumentException thrown if parameters... | return listWithServiceResponseAsync ( appId , versionId , listOptionalParameter ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class ArrayUtils { /** * Counts the number of elements in the array matching the criteria ( rules ) defined by the { @ link Filter } .
* @ param < T > Class type of the elements in the array .
* @ param array array to search .
* @ param filter { @ link Filter } used to match elements in the array and tally... | Assert . notNull ( filter , "Filter is required" ) ; return stream ( nullSafeArray ( array ) ) . filter ( filter :: accept ) . count ( ) ; |
public class HandlerContainer { /** * Dispatch message received from the remote to proper event handler .
* @ param value Remote message , encoded as byte [ ] . */
@ Override @ SuppressWarnings ( "checkstyle:diamondoperatorforvariabledefinition" ) public synchronized void onNext ( final RemoteEvent < byte [ ] > value... | LOG . log ( Level . FINER , "RemoteManager: {0} value: {1}" , new Object [ ] { this . name , value } ) ; final T decodedEvent = this . codec . decode ( value . getEvent ( ) ) ; final Class < ? extends T > clazz = ( Class < ? extends T > ) decodedEvent . getClass ( ) ; LOG . log ( Level . FINEST , "RemoteManager: {0} de... |
public class OutputElementBase { /** * Method called to reuse a pooled instance . */
protected void relink ( OutputElementBase parent ) { } } | mNsMapping = parent . mNsMapping ; mNsMapShared = ( mNsMapping != null ) ; mDefaultNsURI = parent . mDefaultNsURI ; mRootNsContext = parent . mRootNsContext ; |
public class AttributeList { /** * print detail */
public void print ( ) { } } | System . out . println ( "========================= attrs =========================" ) ; for ( Map . Entry < String , Attribute > entry : this . attributes . entrySet ( ) ) { Attribute attr = entry . getValue ( ) ; System . out . println ( entry . getKey ( ) + ": " + attr . getName ( ) + ": " + entry . getValue ( ) ) ;... |
public class GroupHandlerImpl { /** * { @ inheritDoc } */
public Collection < Group > findGroups ( Group parent ) throws Exception { } } | Session session = service . getStorageSession ( ) ; try { return findGroups ( session , parent , false ) ; } finally { session . logout ( ) ; } |
public class PerformanceLogger { /** * Log line of measured performance of single operation specifying by performance metrics parameter .
* @ param marker log marker
* @ param metrics PerformanceMetrics a result of measurement */
public static void log ( Marker marker , PerformanceMetrics metrics ) { } } | if ( log . isDebugEnabled ( ) ) { log . debug ( marker , getEndMetrics ( metrics ) ) ; } |
public class HttpUtil { /** * Some calls in the Heroku API decode strings in a different way from URLEncoder . This is a method for handling those
* special cases . First , urlencode ( ) is called . Then , . - * _ are replaced with their hexadecimal equivalent .
* @ param toEncode string to encode
* @ return A st... | String encoded = urlencode ( toEncode , "Unable to urlencode " + toEncode ) ; for ( Map . Entry < String , String > s : specialChars . entrySet ( ) ) { encoded = encoded . replace ( s . getKey ( ) , s . getValue ( ) ) ; } return encoded ; |
public class BucketConfig { /** * Returns an abbreviation for the Bucket ' s TimeUnit . */
public String getTimeUnitAbbreviation ( ) { } } | switch ( timeUnit ) { case DAYS : return "day" ; case HOURS : return "hr" ; case MICROSECONDS : return "\u00B5s" ; case MILLISECONDS : return "ms" ; case MINUTES : return "min" ; case NANOSECONDS : return "ns" ; case SECONDS : return "s" ; default : return "unkwn" ; } |
public class JsonParser { /** * 获取String
* @ param key 例如 : country . province [ 13 ] . name
* @ return { @ link String } */
public String getStringUseEval ( String key ) { } } | Object object = eval ( key ) ; return Checker . isNull ( object ) ? null : object . toString ( ) ; |
public class CassandraUtils { /** * Get a list of the existing keyspaces in Cassandra .
* @ return { @ code List < String > } */
public List < String > getKeyspaces ( ) { } } | ArrayList < String > result = new ArrayList < String > ( ) ; this . metadata = this . cluster . getMetadata ( ) ; if ( ! ( metadata . getKeyspaces ( ) . isEmpty ( ) ) ) { for ( KeyspaceMetadata k : this . metadata . getKeyspaces ( ) ) { result . add ( k . getName ( ) ) ; } } return result ; |
public class CmsListCsvExportDialog { /** * Generates the CSV file for the given list . < p >
* @ return CSV file
* @ throws ClassNotFoundException if the list dialog class is not found */
public String generateCsv ( ) throws ClassNotFoundException { } } | CmsHtmlList list = A_CmsListDialog . getListObject ( Class . forName ( getParamListclass ( ) ) , getSettings ( ) ) ; return list . listCsv ( ) ; |
public class JCudaDriver { /** * Query attributes of a given memory range . < br >
* < br >
* Query attributes of the memory range starting at devPtr with a size of
* count bytes . The memory range must refer to managed memory allocated via
* cuMemAllocManaged or declared via _ _ managed _ _ variables . The att... | return checkResult ( cuMemRangeGetAttributesNative ( data , dataSizes , attributes , numAttributes , devPtr , count ) ) ; |
public class AtomContainer { /** * { @ inheritDoc } */
@ Override public void addSingleElectron ( ISingleElectron singleElectron ) { } } | ensureElectronCapacity ( singleElectronCount + 1 ) ; singleElectrons [ singleElectronCount ++ ] = singleElectron ; notifyChanged ( ) ; |
public class BufferedISPNCache { /** * { @ inheritDoc } */
public void putAll ( Map < ? extends CacheKey , ? extends Object > map , long lifespan , TimeUnit unit ) { } } | parentCache . putAll ( map , lifespan , unit ) ; |
public class ValidationUtilities { /** * Determine if the given value is valid as defined by the specified
* { @ link AnnotationDefinition } . A valid value is one that is valid for the
* specified domain of the { @ link AnnotationDefinition } .
* @ param annoDef
* a < code > non - null < / code > { @ link Anno... | if ( annoDef == null ) { throw new InvalidArgument ( "annoDef" , annoDef ) ; } if ( annoDef . getType ( ) == null ) { return false ; } switch ( annoDef . getType ( ) ) { case ENUMERATION : return validateEnumeration ( annoDef . getEnums ( ) , value ) ; case REGULAR_EXPRESSION : return validateRegExp ( annoDef . getValu... |
public class LoggingHelper { /** * Enable logging using String . format internally only if debug level is
* enabled .
* @ param logger
* the logger that will be used to log the message
* @ param format
* the format string ( the template string )
* @ param throwable
* a throwable object that holds the thro... | if ( logger . isTraceEnabled ( ) ) { Object [ ] formatParams = params ; if ( converter != null ) { formatParams = converter . convert ( params ) ; } final String message = String . format ( format , formatParams ) ; logger . trace ( message , throwable ) ; } |
public class SingleLinePatternLayout { /** * Method to prevent log forging .
* @ param logMsg
* @ return Encoded message */
private String preventLogForging ( String logMsg ) { } } | String result = logMsg ; // use precompiled pattern for performance reasons
result = LINEBREAK_PATTERN . matcher ( logMsg ) . replaceAll ( SingleLinePatternLayout . LINE_SEP ) ; return result ; |
public class ConfigSettings { /** * ( non - Javadoc )
* @ see
* nyla . solutions . core . util . Settings # setProperties ( java . util . Properties ) */
@ Override public synchronized void setProperties ( Map < Object , Object > properties ) { } } | if ( this . properties == null ) this . properties = new Properties ( ) ; this . properties . putAll ( properties ) ; |
public class Postconditions { /** * < p > Evaluate all of the given { @ code conditions } using { @ code value } as
* input . < / p >
* < p > All of the conditions are evaluated and the function throws { @ link
* PostconditionViolationException } if any of the conditions are false , or
* raise an exception that... | final Violations violations = innerCheckAll ( value , conditions ) ; if ( violations != null ) { throw failed ( null , value , violations ) ; } return value ; |
public class TextFormat { /** * Like { @ code print ( ) } , but writes directly to a { @ code String } and
* returns it . */
public static String printToString ( final MessageOrBuilder message ) { } } | try { final StringBuilder text = new StringBuilder ( ) ; print ( message , text ) ; return text . toString ( ) ; } catch ( IOException e ) { throw new IllegalStateException ( e ) ; } |
public class StringMan { /** * Returns true if the string is ' TRUE ' or ' YES ' or ' 1 ' , case insensitive .
* False for null , empty , etc . */
public static boolean isStringTrue ( String in ) { } } | if ( in == null ) return false ; return in . equalsIgnoreCase ( "TRUE" ) || in . equalsIgnoreCase ( "YES" ) || in . equals ( "1" ) ; |
public class RDFReader { /** * create graph doc
* return ContentPermission [ ] for the graph */
public ContentPermission [ ] insertGraphDoc ( String graph ) throws IOException { } } | ArrayList < ContentPermission > perms = new ArrayList < ContentPermission > ( ) ; ContentPermission [ ] permissions = defaultPerms ; StringBuilder sb = graphQry ; if ( countPerBatch >= MAXGRAPHSPERREQUEST ) { countPerBatch = 0 ; submitGraphQuery ( ) ; graphQry . setLength ( 0 ) ; } String escapedGraph = escapeXml ( gra... |
public class AbstractQueryProtocol { /** * Specific execution for batch rewrite that has specific query for memory .
* @ param results result
* @ param prepareResult prepareResult
* @ param parameterList parameters
* @ param rewriteValues is rewritable flag
* @ throws SQLException exception */
private void ex... | cmdPrologue ( ) ; ParameterHolder [ ] parameters ; int currentIndex = 0 ; int totalParameterList = parameterList . size ( ) ; try { do { currentIndex = ComQuery . sendRewriteCmd ( writer , prepareResult . getQueryParts ( ) , currentIndex , prepareResult . getParamCount ( ) , parameterList , rewriteValues ) ; getResult ... |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EEnum getIfcSoundScaleEnum ( ) { } } | if ( ifcSoundScaleEnumEEnum == null ) { ifcSoundScaleEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 899 ) ; } return ifcSoundScaleEnumEEnum ; |
public class SignedJarBuilder { /** * Adds an entry to the output jar , and write its content from the { @ link InputStream }
* @ param input The input stream from where to write the entry content .
* @ param entry the entry to write in the jar .
* @ throws IOException */
private void writeEntry ( InputStream inp... | // add the entry to the jar archive
mOutputJar . putNextEntry ( entry ) ; // read the content of the entry from the input stream , and write it into the archive .
int count ; while ( ( count = input . read ( mBuffer ) ) != - 1 ) { mOutputJar . write ( mBuffer , 0 , count ) ; // update the digest
if ( mMessageDigest != ... |
public class Template { /** * Merge this template .
* @ param vars
* @ param out
* @ return Context
* @ throws ScriptRuntimeException
* @ throws ParseException */
public Context merge ( final Vars vars , final OutputStream out ) { } } | return merge ( vars , new OutputStreamOut ( out , engine ) ) ; |
public class TrainingsImpl { /** * Get the list of exports for a specific iteration .
* @ param projectId The project id
* @ param iterationId The iteration id
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the List & lt ; Export & gt ; object */
public... | return getExportsWithServiceResponseAsync ( projectId , iterationId ) . map ( new Func1 < ServiceResponse < List < Export > > , List < Export > > ( ) { @ Override public List < Export > call ( ServiceResponse < List < Export > > response ) { return response . body ( ) ; } } ) ; |
public class TaxServiceDeserializer { /** * { @ inheritDoc } } */
@ SuppressWarnings ( "deprecation" ) @ Override public TaxService deserialize ( JsonParser jp , DeserializationContext desContext ) throws IOException { } } | ObjectMapper mapper = new ObjectMapper ( ) ; TaxService taxService = new TaxService ( ) ; // Make the mapper JAXB annotations aware
AnnotationIntrospector primary = new JaxbAnnotationIntrospector ( ) ; AnnotationIntrospector secondary = new JacksonAnnotationIntrospector ( ) ; AnnotationIntrospector pair = new Annotatio... |
public class LogicFile { /** * Set up the key areas . */
public void setupKeys ( ) { } } | KeyAreaInfo keyArea = null ; keyArea = new KeyAreaInfo ( this , Constants . UNIQUE , ID_KEY ) ; keyArea . addKeyField ( ID , Constants . ASCENDING ) ; keyArea = new KeyAreaInfo ( this , Constants . UNIQUE , METHOD_CLASS_NAME_KEY ) ; keyArea . addKeyField ( METHOD_CLASS_NAME , Constants . ASCENDING ) ; keyArea . addKeyF... |
public class ModulePlaybackImpl { /** * { @ inheritDoc } */
public SetTimeSeekVodOperation buildSetTimeSeekVodOperation ( int hours , int minutes , int seconds ) { } } | return new SetTimeSeekVodOperation ( getOperationFactory ( ) , hours , minutes , seconds ) ; |
public class EtherNetIpShared { /** * Release / shutdown / cleanup any shared resources that were created . */
public static synchronized void releaseSharedResources ( ) { } } | if ( SHARED_EVENT_LOOP != null ) { SHARED_EVENT_LOOP . shutdownGracefully ( ) ; SHARED_EVENT_LOOP = null ; } if ( SHARED_WHEEL_TIMER != null ) { SHARED_WHEEL_TIMER . stop ( ) ; SHARED_WHEEL_TIMER = null ; } if ( SHARED_EXECUTOR != null ) { SHARED_EXECUTOR . shutdown ( ) ; SHARED_EXECUTOR = null ; } if ( SHARED_SCHEDULE... |
public class CoreRepositorySetupService { /** * nodes */
protected Node makeNodeAvailable ( @ Nonnull final Session session , @ Nonnull final String path , @ Nonnull final String primaryType ) throws RepositoryException { } } | Node node ; try { node = session . getNode ( StringUtils . isNotBlank ( path ) ? path : "/" ) ; } catch ( PathNotFoundException nf ) { LOG . info ( "createNode({},{})" , path , primaryType ) ; Node parent = makeNodeAvailable ( session , StringUtils . substringBeforeLast ( path , "/" ) , primaryType ) ; node = parent . ... |
public class JavaLexer { /** * $ ANTLR start " T _ _ 114" */
public final void mT__114 ( ) throws RecognitionException { } } | try { int _type = T__114 ; int _channel = DEFAULT_TOKEN_CHANNEL ; // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 95:8 : ( ' transient ' )
// src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 95:10 : ' transient '
{ match ( "transient"... |
public class DM { /** * This method does training on previously unseen paragraph , and returns inferred vector
* @ param sequence
* @ param nr
* @ param learningRate
* @ return */
@ Override public INDArray inferSequence ( Sequence < T > sequence , long nr , double learningRate , double minLearningRate , int it... | AtomicLong nextRandom = new AtomicLong ( nr ) ; // we probably don ' t want subsampling here
// Sequence < T > seq = cbow . applySubsampling ( sequence , nextRandom ) ;
// if ( sequence . getSequenceLabel ( ) = = null ) throw new IllegalStateException ( " Label is NULL " ) ;
if ( sequence . isEmpty ( ) ) return null ; ... |
public class ActionValidator { /** * similar logic is on action response reflector */
public static boolean cannotBeValidatable ( Object value ) { } } | // called by e . g . ResponseBeanValidator
return value instanceof String // yes - yes - yes
|| value instanceof Number // e . g . Integer
|| DfTypeUtil . isAnyLocalDate ( value ) // e . g . LocalDate
|| value instanceof Boolean // of course
|| value instanceof Classification // e . g . CDef
|| value . getClass ( ) . i... |
public class JSPExtensionFactory { /** * Inject an < code > WrapperExpressionFactory < / code > service instance .
* @ param expressionFactoryService
* an expressionFactory service to wrap the default ExpressionFactory */
@ Reference ( cardinality = ReferenceCardinality . OPTIONAL , policyOption = ReferencePolicyOp... | this . expressionFactoryService . setReference ( expressionFactoryService ) ; |
public class KeyTranslatorImpl { /** * Adds a mapping from a key release to an action command string . Overwrites any existing
* mapping that may already have been registered . */
public void addReleaseCommand ( int keyCode , String command ) { } } | KeyRecord krec = getKeyRecord ( keyCode ) ; krec . releaseCommand = command ; |
public class XPathContext { /** * Get the ErrorListener where errors and warnings are to be reported .
* @ return A non - null ErrorListener reference . */
public final ErrorListener getErrorListener ( ) { } } | if ( null != m_errorListener ) return m_errorListener ; ErrorListener retval = null ; try { if ( null != m_ownerGetErrorListener ) retval = ( ErrorListener ) m_ownerGetErrorListener . invoke ( m_owner , new Object [ ] { } ) ; } catch ( Exception e ) { } if ( null == retval ) { if ( null == m_defaultErrorListener ) m_de... |
public class WSubMenuRenderer { /** * Paints the given WSubMenu .
* @ param component the WSubMenu to paint .
* @ param renderContext the RenderContext to paint to . */
@ Override public void doRender ( final WComponent component , final WebXmlRenderContext renderContext ) { } } | WSubMenu menu = ( WSubMenu ) component ; XmlStringBuilder xml = renderContext . getWriter ( ) ; xml . appendTagOpen ( "ui:submenu" ) ; xml . appendAttribute ( "id" , component . getId ( ) ) ; xml . appendOptionalAttribute ( "class" , component . getHtmlClass ( ) ) ; xml . appendOptionalAttribute ( "track" , component .... |
public class VTimeZone { /** * Writes the closing section of zone properties */
private static void endZoneProps ( Writer writer , boolean isDst ) throws IOException { } } | // END : STANDARD or END : DAYLIGHT
writer . write ( ICAL_END ) ; writer . write ( COLON ) ; if ( isDst ) { writer . write ( ICAL_DAYLIGHT ) ; } else { writer . write ( ICAL_STANDARD ) ; } writer . write ( NEWLINE ) ; |
public class TiffDocument { /** * Adds the tag .
* @ param tagName the tag name
* @ param tagValue the tag value
* @ return true , if successful */
public boolean addTag ( String tagName , String tagValue ) { } } | boolean result = false ; if ( firstIFD != null ) { if ( firstIFD . containsTagId ( TiffTags . getTagId ( tagName ) ) ) { firstIFD . removeTag ( tagName ) ; } firstIFD . addTag ( tagName , tagValue ) ; createMetadataDictionary ( ) ; } return result ; |
public class DefaultGroovyMethods { /** * Sorts all Iterable members into groups determined by the supplied mapping closure .
* The closure should return the key that this item should be grouped by . The returned
* LinkedHashMap will have an entry for each distinct key returned from the closure ,
* with each valu... | Map < K , List < T > > answer = new LinkedHashMap < K , List < T > > ( ) ; for ( T element : self ) { K value = closure . call ( element ) ; groupAnswer ( answer , element , value ) ; } return answer ; |
public class SameSizeKMeansAlgorithm { /** * Compute the distances of each object to all means . Update
* { @ link Meta # secondary } to point to the best cluster number except the
* current cluster assignment
* @ param relation Data relation
* @ param means Means
* @ param metas Metadata storage
* @ param ... | for ( DBIDIter id = relation . iterDBIDs ( ) ; id . valid ( ) ; id . advance ( ) ) { Meta c = metas . get ( id ) ; V fv = relation . get ( id ) ; // Update distances to means .
c . secondary = - 1 ; for ( int i = 0 ; i < k ; i ++ ) { c . dists [ i ] = df . distance ( fv , DoubleVector . wrap ( means [ i ] ) ) ; if ( c ... |
public class FrameMetadata { /** * count of rows with nas */
public long rowsWithNa ( ) { } } | if ( _rowsWithNa != - 1 ) return _rowsWithNa ; String x = String . format ( "(na.omit %s)" , _fr . _key ) ; Val res = Rapids . exec ( x ) ; Frame f = res . getFrame ( ) ; long cnt = _fr . numRows ( ) - f . numRows ( ) ; f . delete ( ) ; return ( _rowsWithNa = cnt ) ; |
public class BlobServicesInner { /** * Sets the properties of a storage account ’ s Blob service , including properties for Storage Analytics and CORS ( Cross - Origin Resource Sharing ) rules .
* @ param resourceGroupName The name of the resource group within the user ' s subscription . The name is case insensitive ... | if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( accountName == null ) { throw new IllegalArgumentException ( "Parameter accountName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { ... |
public class HttpRedirectBindingUtil { /** * Validates a signature in the specified { @ link AggregatedHttpMessage } . */
private static void validateSignature ( Credential validationCredential , SamlParameters parameters , String messageParamName ) { } } | requireNonNull ( validationCredential , "validationCredential" ) ; requireNonNull ( parameters , "parameters" ) ; requireNonNull ( messageParamName , "messageParamName" ) ; final String signature = parameters . getFirstValue ( SIGNATURE ) ; final String sigAlg = parameters . getFirstValue ( SIGNATURE_ALGORITHM ) ; // T... |
public class CmsParameterConfiguration { /** * Returns the integer associated with the given parameter ,
* or the default value in case there is no integer value for this parameter . < p >
* @ param key the parameter to look up the value for
* @ param defaultValue the default value
* @ return the integer associ... | Object value = m_configurationObjects . get ( key ) ; if ( value instanceof Integer ) { return ( ( Integer ) value ) . intValue ( ) ; } else if ( value instanceof String ) { Integer i = new Integer ( ( String ) value ) ; m_configurationObjects . put ( key , i ) ; return i . intValue ( ) ; } else { return defaultValue ;... |
public class CuratorUtils { /** * Create znode if it does not already exist . If it does already exist , update the payload ( but not the create mode ) .
* If someone deletes the znode while we ' re trying to set it , just let it stay deleted .
* @ param curatorFramework curator
* @ param path path
* @ param mo... | verifySize ( path , rawBytes , maxZnodeBytes ) ; boolean created = false ; if ( curatorFramework . checkExists ( ) . forPath ( path ) == null ) { try { curatorFramework . create ( ) . creatingParentsIfNeeded ( ) . withMode ( mode ) . forPath ( path , rawBytes ) ; created = true ; } catch ( KeeperException . NodeExistsE... |
public class Trestle { /** * Set multiple spans */
public static CharSequence getFormattedText ( List < Span > spans ) { } } | CharSequence formattedText = null ; if ( spans != null ) { int size = spans . size ( ) ; List < SpannableString > spannableStrings = new ArrayList < > ( size ) ; for ( Span span : spans ) { SpannableString ss = setUpSpannableString ( span ) ; spannableStrings . add ( ss ) ; } formattedText = TextUtils . concat ( spanna... |
public class FDBigInt { /** * Compare FDBigInt with another FDBigInt . Return an integer
* > 0 : this > other
* 0 : this = = other
* < 0 : this < other */
public int cmp ( FDBigInt other ) { } } | int i ; if ( this . nWords > other . nWords ) { // if any of my high - order words is non - zero ,
// then the answer is evident
int j = other . nWords - 1 ; for ( i = this . nWords - 1 ; i > j ; i -- ) if ( this . data [ i ] != 0 ) return 1 ; } else if ( this . nWords < other . nWords ) { // if any of other ' s high -... |
public class ArtifactCollector { /** * Get base name for artifact files for the specified test result .
* < br > < br >
* < b > NOTE < / b > : The base name is derived from the name of the current test .
* If the method is parameterized , a hash code is computed from the parameter
* values and appended to the b... | int hashcode = getParameters ( ) . hashCode ( ) ; if ( hashcode != 0 ) { String hashStr = String . format ( "%08X" , hashcode ) ; return getDescription ( ) . getMethodName ( ) + "-" + hashStr ; } else { return getDescription ( ) . getMethodName ( ) ; } |
public class TagFilter { /** * The tag values .
* @ param tagValues
* The tag values . */
public void setTagValues ( java . util . Collection < String > tagValues ) { } } | if ( tagValues == null ) { this . tagValues = null ; return ; } this . tagValues = new java . util . ArrayList < String > ( tagValues ) ; |
public class SessionBeanO { /** * d367572.1 added entire method . */
protected void callLifecycleInterceptors ( InterceptorProxy [ ] proxies , int methodId ) { } } | final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; try { if ( isTraceOn ) // d527372
{ if ( TEBeanLifeCycleInfo . isTraceEnabled ( ) ) TEBeanLifeCycleInfo . traceEJBCallEntry ( LifecycleInterceptorWrapper . TRACE_NAMES [ methodId ] ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "callLifecycleInt... |
public class SchemaTool { /** * Scans the schemaDirectory for avro schemas , and creates or migrates HBase
* Common managed schemas managed by this instances entity manager .
* @ param schemaDirectory
* The directory to recursively scan for avro schema files . This
* directory can be a directory on the classpat... | List < String > schemaStrings ; if ( schemaDirectory . startsWith ( CLASSPATH_PREFIX ) ) { URL dirURL = getClass ( ) . getClassLoader ( ) . getResource ( schemaDirectory . substring ( CLASSPATH_PREFIX . length ( ) ) ) ; if ( dirURL != null && dirURL . getProtocol ( ) . equals ( "file" ) ) { try { schemaStrings = getSch... |
public class BooleanIOSetting { /** * Sets the setting for a certain question . The setting
* is a boolean , and it accepts only " true " and " false " . */
@ Override public void setSetting ( String setting ) throws CDKException { } } | if ( setting . equals ( "true" ) || setting . equals ( "false" ) ) { this . setting = setting ; } else if ( setting . equals ( "yes" ) || setting . equals ( "y" ) ) { this . setting = "true" ; } else if ( setting . equals ( "no" ) || setting . equals ( "n" ) ) { this . setting = "false" ; } else { throw new CDKExceptio... |
public class SuspiciousLoopSearch { /** * overrides the visitor to initialize and tear down the opcode stack
* @ param classContext
* the context object of the currently parsed class */
@ Override public void visitClassContext ( ClassContext classContext ) { } } | try { ifBlocks = new ArrayList < > ( ) ; loadedRegs = new HashMap < > ( ) ; loopLocations = new BitSet ( ) ; stack = new OpcodeStack ( ) ; super . visitClassContext ( classContext ) ; } finally { ifBlocks = null ; loadedRegs = null ; loopLocations = null ; stack = null ; } |
public class PlayerAbstract { /** * Audio */
@ Override public void play ( ) { } } | final String name = media . getPath ( ) ; if ( Medias . getResourcesLoader ( ) . isPresent ( ) ) { if ( cache == null ) { cache = extractFromJar ( media ) ; } play ( cache , name ) ; } else { play ( media . getFile ( ) . getAbsolutePath ( ) , name ) ; } |
public class VirtualMachineScaleSetExtensionsInner { /** * The operation to create or update an extension .
* @ param resourceGroupName The name of the resource group .
* @ param vmScaleSetName The name of the VM scale set where the extension should be create or updated .
* @ param vmssExtensionName The name of t... | return createOrUpdateWithServiceResponseAsync ( resourceGroupName , vmScaleSetName , vmssExtensionName , extensionParameters ) . map ( new Func1 < ServiceResponse < VirtualMachineScaleSetExtensionInner > , VirtualMachineScaleSetExtensionInner > ( ) { @ Override public VirtualMachineScaleSetExtensionInner call ( Service... |
public class SARLSourceViewerPreferenceAccess { /** * Enable or disable the auto - formatting feature into the SARL editor .
* @ param enable is { @ code true } if it is enabled ; { @ code false } if it is disable ; { @ code null }
* to restore the default value .
* @ since 0.8
* @ see # getWritablePreferenceSt... | final IPreferenceStore store = getWritablePreferenceStore ( null ) ; if ( enable == null ) { store . setToDefault ( AUTOFORMATTING_PROPERTY ) ; } else { store . setValue ( AUTOFORMATTING_PROPERTY , enable . booleanValue ( ) ) ; } |
public class SwaggerBuilder { /** * Determines if a parameter is Required or not .
* @ param parameter
* @ return true if the parameter is required */
protected boolean isRequired ( Parameter parameter ) { } } | return parameter . isAnnotationPresent ( Body . class ) || parameter . isAnnotationPresent ( Required . class ) || parameter . isAnnotationPresent ( NotNull . class ) ; |
public class OcAgentTraceServiceConfigRpcHandler { /** * subsequent updated library configs , unless the stream is interrupted . */
synchronized void sendInitialMessage ( Node node ) { } } | io . opencensus . proto . trace . v1 . TraceConfig currentTraceConfigProto = TraceProtoUtils . getCurrentTraceConfig ( traceConfig ) ; // First config must have Node set .
CurrentLibraryConfig firstConfig = CurrentLibraryConfig . newBuilder ( ) . setNode ( node ) . setConfig ( currentTraceConfigProto ) . build ( ) ; se... |
public class SqlInsertBuilder { /** * Generate insert used in content provider class .
* @ param classBuilder
* the class builder
* @ param method
* the method
* @ param insertResultType
* the insert result type */
private static void generateInsertForContentProvider ( TypeSpec . Builder classBuilder , fina... | final SQLiteDaoDefinition daoDefinition = method . getParent ( ) ; final SQLiteEntity entity = method . getEntity ( ) ; final Set < String > columns = new LinkedHashSet < > ( ) ; MethodSpec . Builder methodBuilder = MethodSpec . methodBuilder ( method . contentProviderMethodName ) ; if ( ! method . getParent ( ) . hasS... |
public class AnimationFactory { /** * Create push down animation for entering .
* @ return Animation */
public static Animation pushDownIn ( ) { } } | AnimationSet animationSet = new AnimationSet ( true ) ; animationSet . setFillAfter ( true ) ; animationSet . addAnimation ( new TranslateAnimation ( 0 , 0 , - 100 , 0 ) ) ; animationSet . addAnimation ( new AlphaAnimation ( 0.0f , 1.0f ) ) ; return animationSet ; |
public class StreamTransformation { /** * Returns the output type of this { @ code StreamTransformation } as a { @ link TypeInformation } . Once
* this is used once the output type cannot be changed anymore using { @ link # setOutputType } .
* @ return The output type of this { @ code StreamTransformation } */
publ... | if ( outputType instanceof MissingTypeInfo ) { MissingTypeInfo typeInfo = ( MissingTypeInfo ) this . outputType ; throw new InvalidTypesException ( "The return type of function '" + typeInfo . getFunctionName ( ) + "' could not be determined automatically, due to type erasure. " + "You can give type information hints b... |
public class SqlDatabase { /** * / * ( non - Javadoc )
* @ see org . parosproxy . paros . db . DatabaseIF # open ( java . lang . String ) */
@ Override public final void open ( String path ) throws Exception { } } | // ZAP : Added log statement .
logger . debug ( "open " + path ) ; setDatabaseServer ( createDatabaseServer ( path ) ) ; notifyListenersDatabaseOpen ( internalDatabaseListeners , getDatabaseServer ( ) ) ; notifyListenersDatabaseOpen ( getDatabaseServer ( ) ) ; |
public class ProxyQueueConversationGroupImpl { /** * If a session is failed to be created then we need to bury it so
* that it never bothers us again . The queue is simply removed from
* the conversation group - no attempt is made to remove messages .
* It is assumed that if something went wrong in the creation t... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "bury" ) ; // Get the proxy queue id
short id = queue . getId ( ) ; // Remove it from the table
mutableId . setValue ( id ) ; idToProxyQueueMap . remove ( mutableId ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . i... |
public class MetricRegistryImpl { /** * Returns a map of all the timers in the registry and their names which match the given filter .
* @ param filter the metric filter to match
* @ return all the timers in the registry */
@ Override public SortedMap < String , Timer > getTimers ( MetricFilter filter ) { } } | return getMetrics ( Timer . class , filter ) ; |
public class CommandBuilder { /** * Adds new option and checks if option overlaps with existing options
* @ param option to be added
* @ throws IllegalArgumentException in case option overlaps with existing options by name , long name or setting */
public void add ( CommandOption option ) { } } | Assert . notNull ( option , "Missing command line option" ) ; CommandOption found = find ( option ) ; Assert . isNull ( found , "Given option: " + option + " overlaps with: " + found ) ; options . add ( option ) ; |
public class ArrayCoreMap { /** * { @ inheritDoc } */
public Set < Class < ? > > keySet ( ) { } } | return new AbstractSet < Class < ? > > ( ) { @ Override public Iterator < Class < ? > > iterator ( ) { return new Iterator < Class < ? > > ( ) { private int i ; public boolean hasNext ( ) { return i < size ; } public Class < ? > next ( ) { try { return keys [ i ++ ] ; } catch ( ArrayIndexOutOfBoundsException aioobe ) {... |
public class ScheduledService { /** * 停止执行定时任务 , 还可以重新start */
public synchronized void stop ( ) { } } | if ( ! started ) { return ; } try { if ( future != null ) { future . cancel ( true ) ; future = null ; } if ( scheduledExecutorService != null ) { scheduledExecutorService . shutdownNow ( ) ; scheduledExecutorService = null ; } } catch ( Throwable t ) { LOGGER . warn ( t . getMessage ( ) , t ) ; } finally { SCHEDULED_S... |
public class S3CryptoModuleAE { /** * Returns an updated object where the object content input stream contains the decrypted contents .
* @ param wrapper
* The object whose contents are to be decrypted .
* @ param cekMaterial
* The instruction that will be used to decrypt the object data .
* @ return
* The ... | S3ObjectInputStream objectContent = wrapper . getObjectContent ( ) ; wrapper . setObjectContent ( new S3ObjectInputStream ( new CipherLiteInputStream ( objectContent , cekMaterial . getCipherLite ( ) , DEFAULT_BUFFER_SIZE ) , objectContent . getHttpRequest ( ) ) ) ; return wrapper ; |
public class AutomationAccountsInner { /** * Retrieve a list of accounts within a given resource group .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList... | return listByResourceGroupNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < AutomationAccountInner > > , Page < AutomationAccountInner > > ( ) { @ Override public Page < AutomationAccountInner > call ( ServiceResponse < Page < AutomationAccountInner > > response ) { return respo... |
public class SimpleDistanceConstraint { /** * Add an [ lb , ub ] interval between the two { @ link TimePoint } s of this constraint .
* @ param i The interval to add .
* @ return < code > true < / code > if the interval was added , < code > false < / code > if it is malformed . */
public boolean addInterval ( Bound... | if ( i . max < this . minimum || i . min > this . maximum ) { return false ; } bs . add ( i ) ; return true ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.