signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class TimeFinder { /** * Checks whether a CDJ status update seems to be close enough to a cue that if we just jumped there ( or just
* loaded the track ) it would be a reasonable assumption that we jumped to the cue .
* @ param update the status update to check for proximity to hot cues and memory points
*... | if ( ! MetadataFinder . getInstance ( ) . isRunning ( ) ) return null ; final TrackMetadata metadata = MetadataFinder . getInstance ( ) . getLatestMetadataFor ( update ) ; final int newBeat = update . getBeatNumber ( ) ; if ( metadata != null && metadata . getCueList ( ) != null ) { for ( CueList . Entry entry : metada... |
public class CommerceNotificationTemplateUserSegmentRelPersistenceImpl { /** * Clears the cache for all commerce notification template user segment rels .
* The { @ link EntityCache } and { @ link FinderCache } are both cleared by this method . */
@ Override public void clearCache ( ) { } } | entityCache . clearCache ( CommerceNotificationTemplateUserSegmentRelImpl . class ) ; finderCache . clearCache ( FINDER_CLASS_NAME_ENTITY ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITH_PAGINATION ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION ) ; |
public class RIWordsiMain { /** * { @ inheritDoc } */
protected ContextExtractor getExtractor ( ) { } } | // Create the new context generator .
ContextGenerator generator = new RandomIndexingContextGenerator ( indexMap , permFunction , indexVectorLength ) ; return contextExtractorFromGenerator ( generator ) ; |
public class Quantifier { /** * Implement UnicodeMatcher API */
public String toPattern ( boolean escapeUnprintable ) { } } | StringBuilder result = new StringBuilder ( ) ; result . append ( matcher . toPattern ( escapeUnprintable ) ) ; if ( minCount == 0 ) { if ( maxCount == 1 ) { return result . append ( '?' ) . toString ( ) ; } else if ( maxCount == MAX ) { return result . append ( '*' ) . toString ( ) ; } // else fall through
} else if ( ... |
public class URLCodec { /** * Convenience method for { @ link # decode ( CharSequence , Charset , Appendable ) } . */
public static void decode ( CharSequence in , Appendable out ) throws IOException { } } | decode ( in , UTF_8 , out ) ; |
public class GitHubClientCacheOps { /** * To accept for cleaning only not active cache dirs
* @ param caches set of active cache names , extracted with help of { @ link # cacheToName ( ) }
* @ return filter to accept only names not in set */
public static DirectoryStream . Filter < Path > notInCaches ( Set < String... | checkNotNull ( caches , "set of active caches can't be null" ) ; return new NotInCachesFilter ( caches ) ; |
public class FormFieldValidator { /** * Sends out a string error message that indicates an error ,
* by formatting it with { @ link String # format ( String , Object [ ] ) } */
public void error ( String format , Object ... args ) throws IOException , ServletException { } } | error ( String . format ( format , args ) ) ; |
public class UpdateSecurityProfileResult { /** * Where the alerts are sent . ( Alerts are always sent to the console . )
* @ param alertTargets
* Where the alerts are sent . ( Alerts are always sent to the console . )
* @ return Returns a reference to this object so that method calls can be chained together . */
... | setAlertTargets ( alertTargets ) ; return this ; |
public class CmsSetupBean { /** * Creates an string out of the given array to store back in the property file . < p >
* @ param values the array with the values to create a string from
* @ return a string with the values of the array which is ready to store in the property file */
private String createValueString (... | StringBuffer buf = new StringBuffer ( ) ; for ( int i = 0 ; i < values . length ; i ++ ) { // escape commas and equals in value
values [ i ] = CmsStringUtil . substitute ( values [ i ] , "," , "\\," ) ; values [ i ] = CmsStringUtil . substitute ( values [ i ] , "=" , "\\=" ) ; buf . append ( "\t" + values [ i ] + ( ( i... |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcGridAxis ( ) { } } | if ( ifcGridAxisEClass == null ) { ifcGridAxisEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 308 ) ; } return ifcGridAxisEClass ; |
public class AbstractMessage { /** * Get a hash code for given fields and values , using the given seed . */
@ SuppressWarnings ( "unchecked" ) protected int hashFields ( int hash , Map < FieldDescriptor , Object > map ) { } } | for ( Map . Entry < FieldDescriptor , Object > entry : map . entrySet ( ) ) { FieldDescriptor field = entry . getKey ( ) ; Object value = entry . getValue ( ) ; hash = ( 37 * hash ) + field . getNumber ( ) ; if ( field . getType ( ) != FieldDescriptor . Type . ENUM ) { hash = ( 53 * hash ) + value . hashCode ( ) ; } el... |
public class RawTextContextUpdater { /** * A transition to the given state . */
private static Transition makeTransitionToStateLiteral ( String literal , final HtmlContext state ) { } } | return new Transition ( literal ) { @ Override Context computeNextContext ( Context prior , Matcher matcher ) { return prior . transitionToState ( state ) ; } } ; |
public class AbstractClassHierarchyMap { /** * This method determines if the given { @ code element } should be { @ link # get ( Class ) associated } with
* { @ code currentType } in preference to the element { @ code existing } that is already registered and will be replaced
* according to the result of this metho... | return false ; |
public class MarkdownNotebookOutput { /** * Code file string .
* @ param file the file
* @ return the string
* @ throws IOException the io exception */
public String codeFile ( @ javax . annotation . Nonnull File file ) throws IOException { } } | Path path = pathToCodeFile ( file ) ; if ( null != getAbsoluteUrl ( ) ) { try { return new URI ( getAbsoluteUrl ( ) ) . resolve ( path . normalize ( ) . toString ( ) . replaceAll ( "\\\\" , "/" ) ) . normalize ( ) . toString ( ) ; } catch ( URISyntaxException e ) { throw new RuntimeException ( e ) ; } } else { return p... |
public class CPFriendlyURLEntryLocalServiceBaseImpl { /** * Returns the number of rows matching the dynamic query .
* @ param dynamicQuery the dynamic query
* @ param projection the projection to apply to the query
* @ return the number of rows matching the dynamic query */
@ Override public long dynamicQueryCoun... | return cpFriendlyURLEntryPersistence . countWithDynamicQuery ( dynamicQuery , projection ) ; |
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EObject create ( EClass eClass ) { } } | switch ( eClass . getClassifierID ( ) ) { case AfplibPackage . LINE_DATA : return createLineData ( ) ; case AfplibPackage . BAG : return createBAG ( ) ; case AfplibPackage . BBC : return createBBC ( ) ; case AfplibPackage . BCA : return createBCA ( ) ; case AfplibPackage . BCF : return createBCF ( ) ; case AfplibPackag... |
public class require { /** * Check if the specified value is not negative .
* @ param value the value to check .
* @ param message the exception message .
* @ return the given value .
* @ throws IllegalArgumentException if { @ code value < 0 } . */
public static double nonNegative ( final double value , final S... | if ( value < 0 ) { throw new IllegalArgumentException ( format ( "%s must not be negative: %f." , message , value ) ) ; } return value ; |
public class AssertEqualsArgumentOrderChecker { /** * This function looks explicitly for parameters named expected and actual . All other pairs with
* parameters other than these are given a distance of 0 if they are in their original position
* and Inf otherwise ( i . e . they will not be considered for moving ) .... | return new Function < ParameterPair , Double > ( ) { @ Override public Double apply ( ParameterPair parameterPair ) { Parameter formal = parameterPair . formal ( ) ; Parameter actual = parameterPair . actual ( ) ; String formalName = formal . name ( ) ; String actualName = actual . name ( ) ; if ( formalName . equals (... |
public class ArrayPropertiesSummaryMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ArrayPropertiesSummary arrayPropertiesSummary , ProtocolMarshaller protocolMarshaller ) { } } | if ( arrayPropertiesSummary == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( arrayPropertiesSummary . getSize ( ) , SIZE_BINDING ) ; protocolMarshaller . marshall ( arrayPropertiesSummary . getIndex ( ) , INDEX_BINDING ) ; } catch ( Except... |
public class AWSGlueClient { /** * Retrieves a connection definition from the Data Catalog .
* @ param getConnectionRequest
* @ return Result of the GetConnection operation returned by the service .
* @ throws EntityNotFoundException
* A specified entity does not exist
* @ throws OperationTimeoutException
*... | request = beforeClientExecution ( request ) ; return executeGetConnection ( request ) ; |
public class VirtualMachineScaleSetsInner { /** * Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set .
* @ param resourceGroupName The name of the resource group .
* @ param vmScaleSetName The name of the VM scale set .
* @ param platformUpdateDomain The pl... | return ServiceFuture . fromResponse ( forceRecoveryServiceFabricPlatformUpdateDomainWalkWithServiceResponseAsync ( resourceGroupName , vmScaleSetName , platformUpdateDomain ) , serviceCallback ) ; |
public class SetupWizard { /** * Gets the suggested plugin list from the update sites , falling back to a local version
* @ return JSON array with the categorized plugin list */
@ CheckForNull /* package */
JSONArray getPlatformPluginList ( ) { } } | Jenkins . get ( ) . checkPermission ( Jenkins . ADMINISTER ) ; JSONArray initialPluginList = null ; updateSiteList : for ( UpdateSite updateSite : Jenkins . get ( ) . getUpdateCenter ( ) . getSiteList ( ) ) { String updateCenterJsonUrl = updateSite . getUrl ( ) ; String suggestedPluginUrl = updateCenterJsonUrl . replac... |
public class DescribeVpcEndpointConnectionNotificationsResult { /** * One or more notifications .
* @ param connectionNotificationSet
* One or more notifications . */
public void setConnectionNotificationSet ( java . util . Collection < ConnectionNotification > connectionNotificationSet ) { } } | if ( connectionNotificationSet == null ) { this . connectionNotificationSet = null ; return ; } this . connectionNotificationSet = new com . amazonaws . internal . SdkInternalList < ConnectionNotification > ( connectionNotificationSet ) ; |
public class CreateRemoteAccessSessionConfigurationMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CreateRemoteAccessSessionConfiguration createRemoteAccessSessionConfiguration , ProtocolMarshaller protocolMarshaller ) { } } | if ( createRemoteAccessSessionConfiguration == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createRemoteAccessSessionConfiguration . getBillingMethod ( ) , BILLINGMETHOD_BINDING ) ; protocolMarshaller . marshall ( createRemoteAccessSessio... |
public class EditText { /** * Retrieves the value set in { @ link # setCustomSelectionActionModeCallback } . Default is null .
* @ return The current custom selection callback . */
@ TargetApi ( Build . VERSION_CODES . HONEYCOMB ) public ActionMode . Callback getCustomSelectionActionModeCallback ( ) { } } | if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . HONEYCOMB ) return mInputView . getCustomSelectionActionModeCallback ( ) ; return null ; |
public class KernelDistance { /** * Returns the square of the distance function expanded as kernel methods .
* < br >
* d < sup > 2 < / sup > ( x , y ) = K ( x , x ) - 2 * K ( x , y ) + K ( y , y )
* < br > < br >
* Special Notes : < br >
* The use of { @ link RBFKernel } or { @ link PolynomialKernel } of deg... | return kf . eval ( a , a ) - 2 * kf . eval ( a , b ) + kf . eval ( b , b ) ; |
public class DefaultPlatformManager { /** * Loads configuration information for a module from mod . json . */
private ModuleInfo loadModuleInfo ( ModuleIdentifier modID , File modJsonFile ) { } } | return new ModuleInfo ( modID , new ModuleFields ( loadModuleConfig ( modID , modJsonFile ) ) ) ; |
public class InternalSARLLexer { /** * $ ANTLR start " RULE _ WS " */
public final void mRULE_WS ( ) throws RecognitionException { } } | try { int _type = RULE_WS ; int _channel = DEFAULT_TOKEN_CHANNEL ; // InternalSARL . g : 16936:9 : ( ( ' ' | ' \ \ t ' | ' \ \ r ' | ' \ \ n ' ) + )
// InternalSARL . g : 16936:11 : ( ' ' | ' \ \ t ' | ' \ \ r ' | ' \ \ n ' ) +
{ // InternalSARL . g : 16936:11 : ( ' ' | ' \ \ t ' | ' \ \ r ' | ' \ \ n ' ) +
int cnt53 =... |
public class GSLWImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eSet ( int featureID , Object newValue ) { } } | switch ( featureID ) { case AfplibPackage . GSLW__MH : setMH ( ( Integer ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ; |
public class MagicMimeEntry { /** * Match string .
* @ param bbuf the bbuf
* @ return true , if successful
* @ throws IOException Signals that an I / O exception has occurred . */
private boolean matchString ( final ByteBuffer bbuf ) throws IOException { } } | if ( this . isBetween ) { final String buffer = new String ( bbuf . array ( ) ) ; if ( buffer . contains ( getContent ( ) ) ) { return true ; } return false ; } final int read = getContent ( ) . length ( ) ; for ( int j = 0 ; j < read ; j ++ ) { if ( ( bbuf . get ( j ) & 0xFF ) != getContent ( ) . charAt ( j ) ) { retu... |
public class ParsedScheduleExpression { /** * Returns the next day of the month after < tt > day < / tt > that satisfies
* the lastDaysOfWeekInMonth constraint .
* @ param day the current 0 - based day of the month
* @ param lastDay the current 0 - based last day of the month
* @ param dayOfWeek the current 0 -... | for ( ; ; ) { if ( lastDay - day < 7 && contains ( lastDaysOfWeekInMonth , dayOfWeek ) ) { return day ; } day ++ ; if ( day > lastDay ) { return ADVANCE_TO_NEXT_MONTH ; } dayOfWeek = ( dayOfWeek + 1 ) % 7 ; } |
public class ImplicitNamingStrategyShogunCore { /** * Transforms a singular form to the plural form , based on these rules :
* http : / / www . edufind . com / english - grammar / plural - nouns / Only some irregular nouns are
* respected in this implementation .
* @ param singular
* @ return */
private String ... | String lowercaseSingular = singular . toLowerCase ( ) ; if ( IRREGULAR_NOUNS . containsKey ( lowercaseSingular ) ) { // e . g . " Woman " - > " Women " , " Ox " - > " Oxen " . . .
String plural = IRREGULAR_NOUNS . get ( lowercaseSingular ) ; if ( Character . isUpperCase ( singular . charAt ( 0 ) ) && plural . length ( ... |
public class FastMathCalc { /** * Add two numbers in split form .
* @ param a first term of addition
* @ param b second term of addition
* @ param ans placeholder where to put the result */
private static void splitAdd ( final double a [ ] , final double b [ ] , final double ans [ ] ) { } } | ans [ 0 ] = a [ 0 ] + b [ 0 ] ; ans [ 1 ] = a [ 1 ] + b [ 1 ] ; resplit ( ans ) ; |
public class ProxyDataSourceBuilder { /** * Register { @ link SLF4JSlowQueryListener } .
* @ param thresholdTime slow query threshold time
* @ param timeUnit slow query threshold time unit
* @ return builder
* @ since 1.4.1 */
public ProxyDataSourceBuilder logSlowQueryBySlf4j ( long thresholdTime , TimeUnit tim... | return logSlowQueryBySlf4j ( thresholdTime , timeUnit , null , null ) ; |
public class MessageFilterLexer { /** * $ ANTLR start " GE " */
public final void mGE ( ) throws RecognitionException { } } | try { int _type = GE ; int _channel = DEFAULT_TOKEN_CHANNEL ; // MessageFilter . g : 38:4 : ( ' > = ' )
// MessageFilter . g : 38:6 : ' > = '
{ match ( ">=" ) ; } state . type = _type ; state . channel = _channel ; } finally { // do for sure before leaving
} |
public class LinearSolverChol_DDRM { /** * Sets the matrix to the inverse using a lower triangular matrix . */
public void setToInverseL ( double a [ ] ) { } } | // TODO reorder these operations to avoid cache misses
// inverts the lower triangular system and saves the result
// in the upper triangle to minimize cache misses
for ( int i = 0 ; i < n ; i ++ ) { double el_ii = t [ i * n + i ] ; for ( int j = 0 ; j <= i ; j ++ ) { double sum = ( i == j ) ? 1.0 : 0 ; for ( int k = i... |
public class GetConnectionsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetConnectionsRequest getConnectionsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getConnectionsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getConnectionsRequest . getCatalogId ( ) , CATALOGID_BINDING ) ; protocolMarshaller . marshall ( getConnectionsRequest . getFilter ( ) , FILTER_BINDING ) ; protoco... |
public class ChatroomSipServlet { /** * This is called by the container when a MESSAGE message arrives . */
protected void doMessage ( SipServletRequest request ) throws ServletException , IOException { } } | request . createResponse ( SipServletResponse . SC_OK ) . send ( ) ; Object message = request . getContent ( ) ; String from = request . getFrom ( ) . getURI ( ) . toString ( ) ; logger . info ( "from is " + from ) ; // A user asked to quit .
if ( message . toString ( ) . equalsIgnoreCase ( "/quit" ) ) { sendToUser ( f... |
public class Record { /** * Are all the fields selected ?
* @ return true if all selected . */
public boolean isAllSelected ( ) { } } | boolean bAllSelected = true ; for ( int iFieldSeq = DBConstants . MAIN_FIELD ; iFieldSeq <= this . getFieldCount ( ) + DBConstants . MAIN_FIELD - 1 ; iFieldSeq ++ ) { if ( this . getField ( iFieldSeq ) . isSelected ( ) == false ) bAllSelected = false ; } return bAllSelected ; |
public class BicubicInterpolation { /** * Bicubic interpolation within a grid square . */
private static double bcuint ( double [ ] y , double [ ] y1 , double [ ] y2 , double [ ] y12 , double x1l , double x1u , double x2l , double x2u , double x1p , double x2p ) { } } | if ( x1u == x1l ) { throw new IllegalArgumentException ( "Nearby control points take same value: " + x1u ) ; } if ( x2u == x2l ) { throw new IllegalArgumentException ( "Nearby control points take same value: " + x2u ) ; } double t , u , d1 = x1u - x1l , d2 = x2u - x2l ; double [ ] [ ] c = bcucof ( y , y1 , y2 , y12 , d... |
public class SpiceManager { /** * Returns the last date of storage of a given data into the cache .
* @ param clazz
* the class of the result to retrieve from cache .
* @ param cacheKey
* the key used to store and retrieve the result of the request
* in the cache
* @ return the date at which data has been s... | return executeCommand ( new GetDateOfDataInCacheCommand ( this , clazz , cacheKey ) ) ; |
public class ResourceTypeCounter { /** * Return the count of the ResourceType
* @ param resourceType
* @ return Count of the resource type */
public Integer getCount ( ResourceType resourceType ) { } } | Integer count = typeToCountMap . get ( resourceType ) ; if ( count == null ) { return 0 ; } else { return count ; } |
public class JvmIntAnnotationValueImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public void eSet ( int featureID , Object newValue ) { } } | switch ( featureID ) { case TypesPackage . JVM_INT_ANNOTATION_VALUE__VALUES : getValues ( ) . clear ( ) ; getValues ( ) . addAll ( ( Collection < ? extends Integer > ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ; |
public class JITDeploy { /** * Returns the name of the Stub class that needs to be loaded for the
* specified remote interface class . < p >
* Basically , the name of the Stub class for any remote interface is
* the simple name of the remote interface class , with an ' _ ' prepended ,
* and ' _ Stub ' appended ... | final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getStubClassName : " + remoteInterface . getName ( ) ) ; String result = JIT_Stub . getStubClassName ( remoteInterface . getName ( ) ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . ex... |
public class ApiOvhIp { /** * Delete mitigation profile
* REST : DELETE / ip / { ip } / mitigationProfiles / { ipMitigationProfile }
* @ param ip [ required ]
* @ param ipMitigationProfile [ required ] */
public void ip_mitigationProfiles_ipMitigationProfile_DELETE ( String ip , String ipMitigationProfile ) throw... | String qPath = "/ip/{ip}/mitigationProfiles/{ipMitigationProfile}" ; StringBuilder sb = path ( qPath , ip , ipMitigationProfile ) ; exec ( qPath , "DELETE" , sb . toString ( ) , null ) ; |
public class JsonParser { /** * Parses a json string , returning either a { @ code Map < String , ? > } , { @ code List < ? > } ,
* { @ code String } , { @ code Double } , { @ code Boolean } , or { @ code null } . */
@ SuppressWarnings ( "unchecked" ) public static Object parse ( String raw ) throws IOException { } } | JsonReader jr = new JsonReader ( new StringReader ( raw ) ) ; try { return parseRecursive ( jr ) ; } finally { try { jr . close ( ) ; } catch ( IOException e ) { logger . log ( Level . WARNING , "Failed to close" , e ) ; } } |
public class JobProcBiz { /** * 这里情况一般是发送失败 , 重新发送的 */
private void multiResultsProcess ( List < JobRunResult > results ) { } } | List < JobRunResult > retryResults = null ; // 过滤出来需要通知客户端的
List < JobRunResult > feedbackResults = null ; // 不需要反馈的
List < JobRunResult > finishResults = null ; for ( JobRunResult result : results ) { if ( needRetry ( result ) ) { // 需要加入到重试队列的
retryResults = CollectionUtils . newArrayListOnNull ( retryResults ) ; ret... |
public class RecommendationsInner { /** * Get all recommendations for an app .
* Get all recommendations for an app .
* ServiceResponse < PageImpl < RecommendationInner > > * @ param resourceGroupName Name of the resource group to which the resource belongs .
* ServiceResponse < PageImpl < RecommendationInner > >... | if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( siteName == null ) { throw new IllegalArgumentException ( "Parameter siteName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { throw ... |
public class ServiceRegistry { /** * Returns an { @ code Iterator } containing all categories in this registry
* the given { @ code pProvider } < em > is currently registered with < / em > .
* The iterator supports removal .
* < small >
* NOTE : Removing a category from the iterator , de - registers
* { @ cod... | // TODO : Is removal using the iterator really a good idea ?
return new FilterIterator < Class < ? > > ( categories ( ) , new FilterIterator . Filter < Class < ? > > ( ) { public boolean accept ( Class < ? > pElement ) { return getRegistry ( pElement ) . contains ( pProvider ) ; } } ) { Class < ? > current ; public Cla... |
public class WeldCollections { /** * Fluent version of { @ link Collections # sort ( List , Comparator ) } */
public static < T > List < T > sort ( List < T > list , Comparator < ? super T > comparator ) { } } | Collections . sort ( list , comparator ) ; return list ; |
public class IntTupleCollections { /** * Computes the component - wise sum of the given collection
* of tuples . < br >
* < br >
* If the given collection is not empty , and the given result is
* < code > null < / code > , then a new tuple with the same
* { @ link Tuple # getSize ( ) size } as the first tuple... | if ( tuples . isEmpty ( ) ) { return null ; } int size = getSize ( result , tuples ) ; MutableIntTuple localResult = tuples . parallelStream ( ) . collect ( ( ) -> IntTuples . create ( size ) , ( r , t ) -> IntTuples . add ( r , t , r ) , ( r0 , r1 ) -> IntTuples . add ( r0 , r1 , r0 ) ) ; if ( result == null ) { retur... |
public class ClientRegistry { /** * Gets the { @ link ItemRendererOverride } for the { @ link ItemStack } .
* @ param itemStack the item stack
* @ return the item renderer override */
private IItemRenderer getItemRendererOverride ( ItemStack itemStack ) { } } | for ( ItemRendererOverride overrides : itemRendererOverrides ) { IItemRenderer renderer = overrides . get ( itemStack ) ; if ( renderer != null ) return renderer ; } return null ; |
public class XmlStreamReaderUtils { /** * Returns the value of an attribute as a long . If the attribute is empty , this method throws an
* exception .
* @ param reader
* < code > XMLStreamReader < / code > that contains attribute values .
* @ param namespace
* namespace
* @ param localName
* the local na... | final String value = reader . getAttributeValue ( namespace , localName ) ; if ( value != null ) { return Long . parseLong ( value ) ; } throw new XMLStreamException ( MessageFormat . format ( "Attribute {0}:{1} is required" , namespace , localName ) ) ; |
import java . util . Arrays ; class ContainsElement { /** * The function checks if the provided array contains the specific element .
* Args :
* arr : An array that may contain various numbers .
* element : The number to be checked within the array .
* Returns :
* A boolean value showing whether the element e... | return Arrays . stream ( arr ) . anyMatch ( e -> e == element ) ; |
public class PrefixCondition { /** * { @ inheritDoc } */
@ Override public Query doQuery ( SingleColumnMapper < ? > mapper , Analyzer analyzer ) { } } | if ( mapper . base == String . class ) { Term term = new Term ( field , value ) ; return new PrefixQuery ( term ) ; } else { throw new IndexException ( "Prefix queries are not supported by mapper '{}'" , mapper ) ; } |
public class DraggableView { /** * Handles when a drag gesture has been ended by the user . */
private void handleRelease ( ) { } } | float speed = Math . max ( dragHelper . getDragSpeed ( ) , animationSpeed ) ; if ( getTopMargin ( ) > initialMargin || ( dragHelper . getDragSpeed ( ) > animationSpeed && dragHelper . getDragDistance ( ) > 0 ) || ( getDeviceType ( getContext ( ) ) == DeviceType . TABLET && isMaximized ( ) && getTopMargin ( ) > minMargi... |
public class ThreadPoolManager { /** * 监控api */
public static int poolSize ( ) { } } | int poolSize = 0 ; for ( ExecutorService pool : EXECUTORS ) { if ( pool instanceof ThreadPoolExecutor ) { poolSize += ( ( ThreadPoolExecutor ) pool ) . getPoolSize ( ) ; } } for ( ExecutorService pool : EXPLICIT_EXECUTORS ) { if ( pool instanceof ThreadPoolExecutor ) { poolSize += ( ( ThreadPoolExecutor ) pool ) . getP... |
public class Reflection { /** * Allows to gracefully create a new instance of class , without having to try - catch exceptions .
* @ param ofClass instance of this class will be constructed using reflection .
* @ param defaultValue will be returned if unable to construct new instance .
* @ return a new instance o... | try { return ClassReflection . newInstance ( ofClass ) ; } catch ( final Throwable exception ) { Exceptions . ignore ( exception ) ; return defaultValue ; } |
public class ClassUtils { /** * Returns given class primitive class or self class . < br >
* if given class is 8 wrapper class then return primitive class . < br >
* if given class is null return null .
* @ param clazz class to handle .
* @ return given class primitive class or self class . */
public static Cla... | if ( clazz == null ) { return null ; } int index = ArrayUtils . indexOf ( WRAPPER_CLASSES , clazz ) ; if ( index != ArrayUtils . INDEX_OF_NOT_FOUND ) { return PRIMITIVE_CLASSES [ index ] ; } return clazz ; |
public class AffiliateLocationFeedData { /** * Gets the chains value for this AffiliateLocationFeedData .
* @ return chains * The list of chains that the Affiliate Location Feed will sync
* the locations from . */
public com . google . api . ads . adwords . axis . v201809 . cm . Chain [ ] getChains ( ) { } } | return chains ; |
public class DocumentRootImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setOnExitScript ( OnExitScriptType newOnExitScript ) { } } | ( ( FeatureMap . Internal ) getMixed ( ) ) . set ( DroolsPackage . Literals . DOCUMENT_ROOT__ON_EXIT_SCRIPT , newOnExitScript ) ; |
public class ServletHandler { public String getRealPath ( String path ) { } } | if ( log . isDebugEnabled ( ) ) log . debug ( "getRealPath of " + path + " in " + this ) ; if ( __Slosh2Slash ) path = path . replace ( '\\' , '/' ) ; path = URI . canonicalPath ( path ) ; if ( path == null ) return null ; Resource baseResource = getHttpContext ( ) . getBaseResource ( ) ; if ( baseResource == null ) re... |
public class BoundedLinkedList { /** * ( non - Javadoc )
* @ see java . util . LinkedList # add ( int , java . lang . Object ) */
@ Override public void add ( int location , E object ) { } } | if ( size ( ) == maxSize ) { removeFirst ( ) ; } super . add ( location , object ) ; |
public class CaseInsensitiveIntMap { /** * Puts a new value in the property table with the appropriate flags */
public void put ( String key , int value ) { } } | put ( key . toCharArray ( ) , key . length ( ) , value ) ; |
public class CardMultilineWidget { /** * Gets a { @ link Card } object from the user input , if all fields are valid . If not , returns
* { @ code null } .
* @ return a valid { @ link Card } object based on user input , or { @ code null } if any field is
* invalid */
@ Nullable public Card getCard ( ) { } } | if ( validateAllFields ( ) ) { String cardNumber = mCardNumberEditText . getCardNumber ( ) ; int [ ] cardDate = mExpiryDateEditText . getValidDateFields ( ) ; String cvcValue = mCvcEditText . getText ( ) . toString ( ) ; Card card = new Card ( cardNumber , cardDate [ 0 ] , cardDate [ 1 ] , cvcValue ) ; if ( mShouldShow... |
public class TriggerManager { /** * Returns a consolidated trigger to call for update operations , or null if
* none . If not null , the consolidated trigger is not a snapshot - - it will
* change as the set of triggers in this manager changes . */
public Trigger < ? super S > getUpdateTrigger ( ) { } } | ForUpdate < S > forUpdate = mForUpdate ; return forUpdate . isEmpty ( ) ? null : forUpdate ; |
public class AutoValueOrOneOfProcessor { /** * Returns the { @ code @ AutoValue } or { @ code @ AutoOneOf } type parameters , with a ? for every type .
* If we have { @ code @ AutoValue abstract class Foo < T extends Something > } then this method will
* return just { @ code < ? > } . */
private static String wildc... | List < ? extends TypeParameterElement > typeParameters = type . getTypeParameters ( ) ; if ( typeParameters . isEmpty ( ) ) { return "" ; } else { return typeParameters . stream ( ) . map ( e -> "?" ) . collect ( joining ( ", " , "<" , ">" ) ) ; } |
public class ArrayListSerializer { /** * We need to implement this method as a { @ link TypeSerializerConfigSnapshot . SelfResolvingTypeSerializer }
* because this serializer was previously returning a shared { @ link CollectionSerializerConfigSnapshot }
* as its snapshot .
* < p > When the { @ link CollectionSer... | if ( deprecatedConfigSnapshot instanceof CollectionSerializerConfigSnapshot ) { CollectionSerializerConfigSnapshot < ArrayList < T > , T > castedLegacySnapshot = ( CollectionSerializerConfigSnapshot < ArrayList < T > , T > ) deprecatedConfigSnapshot ; ArrayListSerializerSnapshot < T > newSnapshot = new ArrayListSeriali... |
public class ItemStream { /** * Add an { @ link Item } to an item stream under a transaction . An Item
* can only be added onto one stream at a time . .
* < p > This method can be overridden by subclass implementors in order to
* customize the behaviour of the stream . Any override should call the superclass
* ... | // default lock id
long lockId = NO_LOCK_ID ; // delivery delay is set , hence DELIVERY _ DELAY _ LOCK _ ID will be used to lock the Item
if ( item . getDeliveryDelay ( ) > 0 ) lockId = DELIVERY_DELAY_LOCK_ID ; addItem ( item , lockId , transaction ) ; |
public class ProductPackageItem { /** * Gets the archiveStatus value for this ProductPackageItem .
* @ return archiveStatus * The archival status of the { @ link ProductPackageItem } .
* < p > This attribute is read - only . */
public com . google . api . ads . admanager . axis . v201805 . ArchiveStatus getArchiveS... | return archiveStatus ; |
public class DB { /** * Updates a user metadata value , replacing the value of the first existing match , or creating if none exists .
* Note that there is not a unique key , e . g . ( user _ id , meta _ key ) , so users may have multiple metadata
* with the same name .
* @ param userId The user id .
* @ param ... | Connection conn = null ; PreparedStatement stmt = null ; ResultSet rs = null ; try { conn = connectionSupplier . getConnection ( ) ; stmt = conn . prepareStatement ( firstUserMetaIdSQL ) ; stmt . setLong ( 1 , userId ) ; stmt . setString ( 2 , key ) ; rs = stmt . executeQuery ( ) ; if ( rs . next ( ) ) { long umetaId =... |
public class RowAVLDisk { /** * Writes the Nodes , immediately after the row size .
* @ param out
* @ throws IOException */
private void writeNodes ( RowOutputInterface out ) throws IOException { } } | out . writeSize ( storageSize ) ; NodeAVL n = nPrimaryNode ; while ( n != null ) { n . write ( out ) ; n = n . nNext ; } hasNodesChanged = false ; |
public class PayMchAPI { /** * 企业付款 < br >
* 接口调用规则 : < br >
* 给同一个实名用户付款 , 单笔单日限额2W / 2W < br >
* 给同一个非实名用户付款 , 单笔单日限额2000/2000 < br >
* 一个商户同一日付款总额限额100W < br >
* 单笔最小金额默认为1元 < br >
* 每个用户每天最多可付款10次 , 可以在商户平台 - - API安全进行设置 < br >
* 给同一个用户付款时间间隔不得低于15秒 < br >
* @ param transfers
* transfers
* @ par... | Map < String , String > map = MapUtil . objectToMap ( transfers ) ; String sign = SignatureUtil . generateSign ( map , transfers . getSign_type ( ) , key ) ; transfers . setSign ( sign ) ; String secapiPayRefundXML = XMLConverUtil . convertToXML ( transfers ) ; HttpUriRequest httpUriRequest = RequestBuilder . post ( ) ... |
public class appfwprofile_fieldconsistency_binding { /** * Use this API to fetch appfwprofile _ fieldconsistency _ binding resources of given name . */
public static appfwprofile_fieldconsistency_binding [ ] get ( nitro_service service , String name ) throws Exception { } } | appfwprofile_fieldconsistency_binding obj = new appfwprofile_fieldconsistency_binding ( ) ; obj . set_name ( name ) ; appfwprofile_fieldconsistency_binding response [ ] = ( appfwprofile_fieldconsistency_binding [ ] ) obj . get_resources ( service ) ; return response ; |
public class ListAliasesRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ListAliasesRequest listAliasesRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( listAliasesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listAliasesRequest . getRoutingStrategyType ( ) , ROUTINGSTRATEGYTYPE_BINDING ) ; protocolMarshaller . marshall ( listAliasesRequest . getName ( ) , NAME_BINDING ) ; ... |
public class Step { /** * Update a html select with a text value .
* @ param pageElement
* Is target element
* @ param textOrKey
* Is the new data ( text or text in context ( after a save ) )
* @ throws TechnicalException
* is thrown if you have a technical error ( format , configuration , datas , . . . ) i... | String value = getTextOrKey ( textOrKey ) ; try { setDropDownValue ( pageElement , value ) ; } catch ( final Exception e ) { new Result . Failure < > ( e . getMessage ( ) , Messages . format ( Messages . getMessage ( Messages . FAIL_MESSAGE_ERROR_ON_INPUT ) , pageElement , pageElement . getPage ( ) . getApplication ( )... |
public class TabbedPaneDemo { /** * Initializes the frame by creating its contents . */
private void init ( ) { } } | setTitle ( "Validation Framework Test" ) ; setDefaultCloseOperation ( WindowConstants . EXIT_ON_CLOSE ) ; // Create content pane
JPanel contentPane = new JPanel ( new MigLayout ( "fill, wrap 1" , "[]" , "[]related[]unrelated[]unrelated[]" ) ) ; setContentPane ( contentPane ) ; // Checkbox to enable the tabbed pane
JChe... |
public class CommonUtils { /** * Check if the two of the given objects are equal with their { @ link Object # equals ( Object ) }
* methods . It ' s safe to pass NULL as the objects , and when they are both NULL they will be
* considered equal .
* @ param obj1
* @ param obj2
* @ return */
public static boolea... | boolean equal = false ; if ( obj1 == null && obj2 == null ) { equal = true ; } else { if ( obj1 != null ) { if ( obj1 . equals ( obj2 ) ) { equal = true ; } } } return equal ; |
public class CmsXmlContainerPage { /** * Gets the container page content as a bean . < p >
* @ param cms the current CMS context
* @ return the bean containing the container page data */
public CmsContainerPageBean getContainerPage ( CmsObject cms ) { } } | Locale masterLocale = CmsLocaleManager . MASTER_LOCALE ; Locale localeToLoad = null ; // always use master locale if possible , otherwise use the first locale .
// this is important for ' legacy ' container pages which were created before container pages became locale independent
if ( m_cntPages . containsKey ( masterL... |
public class AbstractTicketRegistry { /** * Encode ticket id into a SHA - 512.
* @ param ticketId the ticket id
* @ return the ticket */
protected String encodeTicketId ( final String ticketId ) { } } | if ( ! isCipherExecutorEnabled ( ) ) { LOGGER . trace ( MESSAGE ) ; return ticketId ; } if ( StringUtils . isBlank ( ticketId ) ) { return ticketId ; } val encodedId = DigestUtils . sha512 ( ticketId ) ; LOGGER . debug ( "Encoded original ticket id [{}] to [{}]" , ticketId , encodedId ) ; return encodedId ; |
public class RootBeer { /** * Checks if device has ReadAccess to the Native Library
* Precondition : canLoadNativeLibrary ( ) ran before this and returned true
* Description : RootCloak automatically blocks read access to the Native Libraries , however
* allows for them to be loaded into memory . This check is an... | RootBeerNative rootBeerNative = new RootBeerNative ( ) ; try { rootBeerNative . setLogDebugMessages ( loggingEnabled ) ; return true ; } catch ( UnsatisfiedLinkError e ) { return false ; } |
public class ProxyInvocationHandlerImpl { /** * Checks if the connector was set successfully . Returns immediately and does not block until the connector is
* finished .
* @ return true if a connector was successfully set . */
public boolean isConnectorReady ( ) { } } | connectorStatusLock . lock ( ) ; try { if ( connectorStatus == ConnectorStatus . ConnectorSuccesful ) { return true ; } return false ; } finally { connectorStatusLock . unlock ( ) ; } |
public class DataSet { /** * Returns a distinct set of a { @ link DataSet } using a { @ link KeySelector } function .
* < p > The KeySelector function is called for each element of the DataSet and extracts a single key value on which the
* decision is made if two items are distinct or not .
* @ param keyExtractor... | TypeInformation < K > keyType = TypeExtractor . getKeySelectorTypes ( keyExtractor , getType ( ) ) ; return new DistinctOperator < > ( this , new Keys . SelectorFunctionKeys < > ( keyExtractor , getType ( ) , keyType ) , Utils . getCallLocationName ( ) ) ; |
public class CORSConfigBuilder { /** * < p > Specifies which headers ( aside from " simple " headers ) are allowed to be accessed by JavaScript in responses . < / p >
* < p > The " simple " headers are : < code > Cache - Control < / code > , < code > Content - Language < / code > ,
* < code > Content - Type < / cod... | Mutils . notNull ( "headerNames" , headerNames ) ; this . exposedHeaders = headerNames ; return this ; |
public class ResourceEntry { /** * setter for entryId - sets The identifier of the entry , C
* @ generated
* @ param v value to set into the feature */
public void setEntryId ( String v ) { } } | if ( ResourceEntry_Type . featOkTst && ( ( ResourceEntry_Type ) jcasType ) . casFeat_entryId == null ) jcasType . jcas . throwFeatMissing ( "entryId" , "de.julielab.jules.types.ResourceEntry" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( ResourceEntry_Type ) jcasType ) . casFeatCode_entryId , v ) ; |
public class AmazonAppStreamClient { /** * Disables the specified user in the user pool . Users can ' t sign in to AppStream 2.0 until they are re - enabled .
* This action does not delete the user .
* @ param disableUserRequest
* @ return Result of the DisableUser operation returned by the service .
* @ throws... | request = beforeClientExecution ( request ) ; return executeDisableUser ( request ) ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < }
* { @ link CmisExtensionType } { @ code > } */
@ XmlElementDecl ( namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/" , name = "extension" , scope = DeleteTree . class ) public JAXBElement < CmisExtensionType >... | return new JAXBElement < CmisExtensionType > ( _GetPropertiesExtension_QNAME , CmisExtensionType . class , DeleteTree . class , value ) ; |
public class LRUCache { /** * Sets the maximum size of this cache .
* @ param cacheSize the cache size to be set */
public void setCacheSize ( int cacheSize ) { } } | this . cacheSize = cacheSize ; long toDelete = map . size ( ) - this . cacheSize ; if ( toDelete <= 0 ) { return ; } List < Integer > keys = new ArrayList < > ( map . keySet ( ) ) ; Collections . reverse ( keys ) ; for ( Integer id : keys ) { P page = map . remove ( id ) ; file . writePage ( page ) ; } |
public class ActiveRepaintManager { /** * Returns the root component for the supplied component or null if it is not part of a rooted
* hierarchy or if any parent along the way is found to be hidden or without a peer . */
protected Component getRoot ( Component comp ) { } } | for ( Component c = comp ; c != null ; c = c . getParent ( ) ) { boolean hidden = ! c . isDisplayable ( ) ; // on the mac , the JRootPane is invalidated before it is visible and is never again
// invalidated or repainted , so we punt and allow all invisible components to be
// invalidated and revalidated
if ( ! RunAnyw... |
public class Services { /** * Get the service name of a top - level deployment unit .
* @ param name the simple name of the deployment
* @ param phase the deployment phase
* @ return the service name */
public static ServiceName deploymentUnitName ( String name , Phase phase ) { } } | return JBOSS_DEPLOYMENT_UNIT . append ( name , phase . name ( ) ) ; |
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public CPDEncScheme createCPDEncSchemeFromString ( EDataType eDataType , String initialValue ) { } } | CPDEncScheme result = CPDEncScheme . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class SARLValidator { /** * Replies if the given annotation is an active annotation for agent - oriented elements .
* @ param container the container to test .
* @ return { @ code true } if the container could receive an active annotation .
* @ see # isOOActiveAnnotation ( XAnnotation )
* @ see # isAOAct... | return container instanceof SarlAgent || container instanceof SarlBehavior || container instanceof SarlSkill ; |
public class ResourceadapterTypeImpl { /** * If not already created , a new < code > security - permission < / code > element will be created and returned .
* Otherwise , the first existing < code > security - permission < / code > element will be returned .
* @ return the instance defined for the element < code > ... | List < Node > nodeList = childNode . get ( "security-permission" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new SecurityPermissionTypeImpl < ResourceadapterType < T > > ( this , "security-permission" , childNode , nodeList . get ( 0 ) ) ; } return createSecurityPermission ( ) ; |
public class NodeLocatorHelper { /** * Returns the target replica node { @ link InetAddress } for a given document ID and replica number on the bucket .
* @ param id the document id to convert .
* @ param replicaNum the replica number .
* @ return the node for the given document id . */
public InetAddress replica... | if ( replicaNum < 1 || replicaNum > 3 ) { throw new IllegalArgumentException ( "Replica number must be between 1 and 3." ) ; } BucketConfig config = bucketConfig . get ( ) ; if ( config instanceof CouchbaseBucketConfig ) { CouchbaseBucketConfig cbc = ( CouchbaseBucketConfig ) config ; int partitionId = ( int ) hashId (... |
public class ExceptionUtil { /** * / * public */
static void launder ( final Throwable pThrowable , Class < ? extends Throwable > ... pExpectedTypes ) { } } | if ( pThrowable instanceof Error ) { throw ( Error ) pThrowable ; } if ( pThrowable instanceof RuntimeException ) { throw ( RuntimeException ) pThrowable ; } for ( Class < ? extends Throwable > expectedType : pExpectedTypes ) { if ( expectedType . isInstance ( pThrowable ) ) { throw new RuntimeException ( pThrowable ) ... |
public class GreenPepperXmlRpcServer { /** * { @ inheritDoc } */
public Vector < Object > runReference ( Vector < Object > referenceParams , String locale ) { } } | try { Reference reference = XmlRpcDataMarshaller . toReference ( referenceParams ) ; reference = service . runReference ( reference , locale ) ; log . debug ( "Runned Reference: " + reference . getRequirement ( ) . getName ( ) + "," + reference . getSpecification ( ) . getName ( ) + " ON System: " + reference . getSyst... |
public class EventRepositoryImpl { /** * / * ( non - Javadoc )
* @ see org . talend . esb . sam . common . event . persistence . EventRepository # writeEvent ( org . talend . esb . sam . common . event . Event ) */
@ Override public void writeEvent ( Event event ) { } } | Originator originator = event . getOriginator ( ) ; MessageInfo messageInfo = event . getMessageInfo ( ) ; long id = dbDialect . getIncrementer ( ) . nextLongValue ( ) ; event . setPersistedId ( id ) ; getJdbcTemplate ( ) . update ( "insert into EVENTS (ID, EI_TIMESTAMP, EI_EVENT_TYPE," + " ORIG_PROCESS_ID, ORIG_IP, OR... |
public class JKTableModel { public int getColunmIndex ( final String name ) { } } | for ( int i = 0 ; i < getColumnCount ( ) ; i ++ ) { if ( getActualColumnName ( i ) . trim ( ) . equalsIgnoreCase ( name ) ) { return i ; } } return - 1 ; |
public class MetaKeywords { /** * Get the package keywords . */
public List < String > getMetaKeywords ( PackageElement packageElement ) { } } | List < String > result = new ArrayList < > ( 1 ) ; if ( config . keywords ) { String pkgName = config . utils . getPackageName ( packageElement ) ; result . add ( pkgName + " " + "package" ) ; } return result ; |
public class Matrix4d { /** * / * ( non - Javadoc )
* @ see org . joml . Matrix4dc # positiveX ( org . joml . Vector3d ) */
public Vector3d positiveX ( Vector3d dest ) { } } | dest . x = m11 * m22 - m12 * m21 ; dest . y = m02 * m21 - m01 * m22 ; dest . z = m01 * m12 - m02 * m11 ; return dest . normalize ( dest ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.