signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ArrowConverter { /** * Create a field given the input { @ link ColumnType } * and name * @ param name the name of the field * @ param columnType the column type to add * @ return */ public static Field getFieldForColumn ( String name , ColumnType columnType ) { } }
switch ( columnType ) { case Long : return field ( name , new ArrowType . Int ( 64 , false ) ) ; case Integer : return field ( name , new ArrowType . Int ( 32 , false ) ) ; case Double : return field ( name , new ArrowType . FloatingPoint ( FloatingPointPrecision . DOUBLE ) ) ; case Float : return field ( name , new Ar...
public class StencilEngine { /** * Loads a template from the given path * @ param path Path to load template from * @ return Loaded template * @ throws IOException * @ throws ParseException */ public Template load ( String path ) throws IOException , ParseException { } }
try ( TemplateSource source = sourceLoader . find ( path ) ) { if ( source != null ) { return load ( path , source ) ; } } return null ;
public class FacebookRestClient { /** * Retrieves whether the logged - in user has granted the specified permission * to this application . * @ param permission an extended permission ( e . g . FacebookExtendedPerm . MARKETPLACE , * " photo _ upload " ) * @ return boolean indicating whether the user has the per...
return extractBoolean ( this . callMethod ( FacebookMethod . USERS_HAS_APP_PERMISSION , new Pair < String , CharSequence > ( "ext_perm" , permission ) ) ) ;
public class AbstractFontManager { /** * Move the font size pointer up . If this would move the pointer past * the maximum font size , track this increase with a virtual size . */ public void increaseFontSize ( ) { } }
// move INTO range if we have just moved OUT of lower virtual if ( inRange ( ) || ( atMin ( ) && atLowerBoundary ( ) ) ) { currentFontIndex ++ ; } else if ( atMax ( ) ) { upperVirtualCount ++ ; } else if ( atMin ( ) && inLower ( ) ) { lowerVirtualCount ++ ; }
public class IbanUtil { /** * format iban to four character blocks . * @ param pstring string to format * @ return formated string */ public static String ibanFormat ( final String pstring ) { } }
if ( pstring == null ) { return null ; } final ValueWithPos < String > formatedValue = ibanFormatWithPos ( new ValueWithPos < > ( pstring , - 1 ) ) ; return formatedValue . getValue ( ) ;
public class PaymentSession { /** * Returns a future that will be notified with a PaymentSession object after it is fetched using the provided url . * url is an address where the { @ link Protos . PaymentRequest } object may be fetched . * If the payment request object specifies a PKI method , then the system trust...
if ( url == null ) throw new PaymentProtocolException . InvalidPaymentRequestURL ( "null paymentRequestUrl" ) ; try { return fetchPaymentRequest ( new URI ( url ) , verifyPki , trustStoreLoader ) ; } catch ( URISyntaxException e ) { throw new PaymentProtocolException . InvalidPaymentRequestURL ( e ) ; }
public class RuleOrganizer { /** * Finds out cluster names . * @ param cluster the cluster . * @ return pattern names . */ private ArrayList < String > getNameInCluster ( Cluster cluster ) { } }
ArrayList < String > itemsInCluster = new ArrayList < String > ( ) ; String nodeName ; if ( cluster . isLeaf ( ) ) { nodeName = cluster . getName ( ) ; itemsInCluster . add ( nodeName ) ; } else { // String [ ] clusterName = cluster . getName ( ) . split ( " # " ) ; // nodeName = clusterName [ 1 ] ; } for ( Cluster chi...
public class ListPopupWindow { /** * Show the popup list . If the list is already showing , this method * will recalculate the popup ' s size and position . */ public void show ( ) { } }
int height = buildDropDown ( ) ; int widthSpec = 0 ; int heightSpec = 0 ; boolean noInputMethod = isInputMethodNotNeeded ( ) ; if ( mPopup . isShowing ( ) ) { if ( mDropDownWidth == ViewGroup . LayoutParams . MATCH_PARENT ) { // The call to PopupWindow ' s update method below can accept - 1 for any // value you do not ...
public class AWSElasticsearchClient { /** * Creates a new Elasticsearch domain . For more information , see < a href = * " http : / / docs . aws . amazon . com / elasticsearch - service / latest / developerguide / es - createupdatedomains . html # es - createdomains " * target = " _ blank " > Creating Elasticsearch...
request = beforeClientExecution ( request ) ; return executeCreateElasticsearchDomain ( request ) ;
public class PaginatedDbService { /** * Get the { @ link DTO } for the given ID . * @ param id the ID of the object * @ return an Optional containing the found object or an empty Optional if no object can be found for the given ID */ public Optional < DTO > get ( String id ) { } }
return Optional . ofNullable ( db . findOneById ( new ObjectId ( id ) ) ) ;
public class OperationManager { /** * 根据persistentId查询任务状态 * 返回结果的 class */ public < T > T prefop ( String persistentId , Class < T > retClass ) throws QiniuException { } }
StringMap params = new StringMap ( ) . put ( "id" , persistentId ) ; byte [ ] data = StringUtils . utf8Bytes ( params . formString ( ) ) ; String url = String . format ( "%s/status/get/prefop" , configuration . apiHost ( ) ) ; Response response = this . client . post ( url , data , null , Client . FormMime ) ; if ( ! r...
public class StoredChannel { /** * Sets the opaque ID for the subscribed resource that is stable across API versions or * { @ code null } for none . */ public StoredChannel setTopicId ( String topicId ) { } }
lock . lock ( ) ; try { this . topicId = topicId ; } finally { lock . unlock ( ) ; } return this ;
public class Monetary { /** * Access a new instance based on the { @ link Locale } . Currencies are * available as provided by { @ link CurrencyProviderSpi } instances registered * with the { @ link javax . money . spi . Bootstrap } . * @ param locale the target { @ link Locale } , typically representing an ISO ...
return Optional . ofNullable ( MONETARY_CURRENCIES_SINGLETON_SPI ( ) ) . orElseThrow ( ( ) -> new MonetaryException ( "No MonetaryCurrenciesSingletonSpi loaded, check your system setup." ) ) . getCurrencies ( locale , providers ) ;
public class PersistenceApi { /** * Bulk Save Relationships * This is used to batch save an entity & # 39 ; s relationship in order to offer more throughput than persisting . * @ param request Save Relationships Request ( required ) * @ return ApiResponse & lt ; Void & gt ; * @ throws ApiException If fail to ca...
com . squareup . okhttp . Call call = saveRelationshipsPostValidateBeforeCall ( request , null , null ) ; return apiClient . execute ( call ) ;
public class AbstractQueue { /** * { @ inheritDoc } * @ since 0.6.0 */ @ Override public IQueueMessage < ID , DATA > createMessage ( DATA content ) { } }
return messageFactory . createMessage ( content ) ;
public class ExtendableService { /** * Installs a list of service filters . This method is designed to facilitate Spring bean assembly . */ public void setFilters ( List < Service . Filter > filters ) { } }
for ( Service . Filter filter : filters ) setFilter ( filter ) ;
public class SQLRunner { /** * Execute SQL stmt . * @ param _ sqlProvider the sql provider * @ param _ complStmt the compl stmt * @ return true , if successful * @ throws EFapsException the e faps exception */ @ SuppressWarnings ( "unchecked" ) protected boolean executeSQLStmt ( final ISelectionProvider _sqlPro...
SQLRunner . LOG . debug ( "SQL-Statement: {}" , _complStmt ) ; boolean ret = false ; List < Object [ ] > rows = new ArrayList < > ( ) ; boolean cached = false ; if ( runnable . has ( StmtFlag . REQCACHED ) ) { final QueryKey querykey = QueryKey . get ( Context . getThreadContext ( ) . getRequestId ( ) , _complStmt ) ; ...
public class AmazonCloudDirectoryClient { /** * Creates a new < a > Facet < / a > in a schema . Facet creation is allowed only in development or applied schemas . * @ param createFacetRequest * @ return Result of the CreateFacet operation returned by the service . * @ throws InternalServiceException * Indicates...
request = beforeClientExecution ( request ) ; return executeCreateFacet ( request ) ;
public class ValueTransformer { /** * / * ( non - Javadoc ) * @ see com . oath . cyclops . types . MonadicValue # forEach3 ( java . util . function . Function , java . util . function . BiFunction , com . oath . cyclops . util . function . TriFunction ) */ public < T2 , R1 , R2 , R > ValueTransformer < W , R > forEac...
return unitAnyM ( this . transformerStream ( ) . map ( v -> v . forEach3 ( value1 , value2 , yieldingFunction ) ) ) ;
public class SsmlSayAs { /** * Attributes to set on the generated XML element * @ return A Map of attribute keys to values */ protected Map < String , String > getElementAttributes ( ) { } }
// Preserve order of attributes Map < String , String > attrs = new HashMap < > ( ) ; if ( this . getInterpretAs ( ) != null ) { attrs . put ( "interpret-as" , this . getInterpretAs ( ) . toString ( ) ) ; } if ( this . getRole ( ) != null ) { attrs . put ( "role" , this . getRole ( ) . toString ( ) ) ; } return attrs ;
public class Governator { /** * Add Guice modules to Governator . * @ param modules Guice modules to add . * @ return this */ public Governator addModules ( List < Module > modules ) { } }
if ( modules != null ) { this . modules . addAll ( modules ) ; } return this ;
public class HttpServerBuilder { /** * Defines a file to be hosted on the specified path . The file ' s content is provided by the specified URL . * @ param path * the path where the file is accessible from the server * @ param resource * the resource providing the content for the file * @ return * this bui...
resources . put ( path , resource ) ; return this ;
public class ScriptRuntime { /** * If d is exact int value , return its value wrapped as Integer * and othewise return d converted to String . */ static Object getIndexObject ( double d ) { } }
int i = ( int ) d ; if ( i == d ) { return Integer . valueOf ( i ) ; } return toString ( d ) ;
public class ExtendedBufferedReader { /** * Non - blocking reading of len chars into buffer buf starting * at bufferposition off . * performs an iteratative read on the underlying stream * as long as the following conditions hold : * - less than len chars have been read * - end of stream has not been reached ...
// do not claim if len = = 0 if ( len == 0 ) { return 0 ; } // init lookahead , but do not block ! ! if ( lookaheadChar == UNDEFINED ) { if ( ready ( ) ) { lookaheadChar = super . read ( ) ; } else { return - 1 ; } } // ' first read of underlying stream ' if ( lookaheadChar == - 1 ) { return - 1 ; } // continue until t...
public class ApiOvhOverTheBox { /** * Delete a remote access * REST : DELETE / overTheBox / { serviceName } / remoteAccesses / { remoteAccessId } * @ param serviceName [ required ] The internal name of your overTheBox offer * @ param remoteAccessId [ required ] The id of the remote access */ public void serviceNa...
String qPath = "/overTheBox/{serviceName}/remoteAccesses/{remoteAccessId}" ; StringBuilder sb = path ( qPath , serviceName , remoteAccessId ) ; exec ( qPath , "DELETE" , sb . toString ( ) , null ) ;
public class JBBPUtils { /** * Check that an object is null and throw NullPointerException in the case . * @ param object an object to be checked * @ param message message to be used as the exception message * @ throws NullPointerException it will be thrown if the object is null */ public static void assertNotNul...
if ( object == null ) { throw new NullPointerException ( message == null ? "Object is null" : message ) ; }
public class PrivateTaskScheduler { /** * Constructor . * @ param application The parent application . * @ param iMaxThreads The maximum number of threads to run ( - 1 = default ) . * @ param bKeepAlive Keep the task alive after execution . */ public void init ( App application , int iMaxThreads , boolean bKeepAl...
iMaxThreads = 0 ; super . init ( application , iMaxThreads ) ; m_vPrivateJobs = new Vector < Object > ( ) ; // List of my private jobs m_bKeepAlive = bKeepAlive ; // Keep the task alive after execution . if ( m_bKeepAlive ) new Thread ( this , "KeepAliveThread" ) . start ( ) ;
public class RelationalOperations { /** * Returns true if polygon _ a crosses envelope _ b . */ private static boolean polygonCrossesEnvelope_ ( Polygon polygon_a , Envelope envelope_b , double tolerance , ProgressTracker progress_tracker ) { } }
Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; polygon_a . queryEnvelope2D ( env_a ) ; envelope_b . queryEnvelope2D ( env_b ) ; if ( envelopeInfContainsEnvelope_ ( env_b , env_a , tolerance ) ) return false ; if ( env_b . getHeight ( ) > tolerance && env_b . getWidth ( ) > tolerance ) return false...
public class Compiler { /** * Simplistic implementation of the java . nio . file . Path resolveSibling method that works with GWT . * @ param fromPath - must be a file ( not directory ) * @ param toPath - must be a file ( not directory ) */ private static String resolveSibling ( String fromPath , String toPath ) { ...
// If the destination is an absolute path , nothing to do . if ( toPath . startsWith ( "/" ) ) { return toPath ; } List < String > fromPathParts = new ArrayList < > ( Arrays . asList ( fromPath . split ( "/" ) ) ) ; List < String > toPathParts = new ArrayList < > ( Arrays . asList ( toPath . split ( "/" ) ) ) ; if ( ! ...
public class RtfColorList { /** * Returns the index of the given RtfColor in the color list . If the RtfColor * is not in the list of colors , then it is added . * @ param color The RtfColor for which to get the index * @ return The index of the RtfColor */ public int getColorNumber ( RtfColor color ) { } }
int colorIndex = - 1 ; for ( int i = 0 ; i < colorList . size ( ) ; i ++ ) { if ( colorList . get ( i ) . equals ( color ) ) { colorIndex = i ; } } if ( colorIndex == - 1 ) { colorIndex = colorList . size ( ) ; colorList . add ( color ) ; } return colorIndex ;
public class FormatUtilities { /** * Returns the given date formatted using the given format . * @ param dt The date to be formatted * @ param format The format to use to display the date * @ param tolerance The tolerance for the date to be formatted * @ return The given date formatted using the given format */...
return getFormattedDateTime ( dt , format , true , tolerance ) ;
public class CommerceDiscountRelPersistenceImpl { /** * Returns an ordered range of all the commerce discount rels where commerceDiscountId = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not pri...
return findByCommerceDiscountId ( commerceDiscountId , start , end , orderByComparator , true ) ;
public class CasConfigurationEventListener { /** * Handle configuration modified event . * @ param event the event */ @ EventListener public void handleConfigurationModifiedEvent ( final CasConfigurationModifiedEvent event ) { } }
if ( this . contextRefresher == null ) { LOGGER . warn ( "Unable to refresh application context, since no refresher is available" ) ; return ; } if ( event . isEligibleForContextRefresh ( ) ) { LOGGER . info ( "Received event [{}]. Refreshing CAS configuration..." , event ) ; Collection < String > keys = null ; try { k...
public class CmsGalleryControllerHandler { /** * Updates the gallery data . < p > * @ param searchObj the current search object * @ param dialogBean the gallery data * @ param controller he gallery controller */ public void updateGalleryData ( CmsGallerySearchBean searchObj , CmsGalleryDataBean dialogBean , CmsGa...
if ( ( m_galleryDialog . getGalleriesTab ( ) != null ) && ( dialogBean . getGalleries ( ) != null ) ) { Collections . sort ( dialogBean . getGalleries ( ) , new CmsComparatorTitle ( true ) ) ; setGalleriesTabContent ( dialogBean . getGalleries ( ) , searchObj . getGalleries ( ) ) ; } if ( ( m_galleryDialog . getTypesTa...
public class EffectSize { /** * Original Cohen ' s d formulation , as in Cohen ( 1988 ) , Statistical power * analysis for the behavioral sciences . * @ param < V > type of the keys of each map . * @ param baselineN number of samples of baseline method . * @ param baselineMean mean of baseline method . * @ pa...
double pooledStd = Math . sqrt ( ( ( testN - 1 ) * Math . pow ( testStd , 2 ) + ( baselineN - 1 ) * Math . pow ( baselineStd , 2 ) ) / ( baselineN + testN ) ) ; double d = Math . abs ( testMean - baselineMean ) / pooledStd ; return d ;
public class CommunicationManager { /** * Adds torrent to storage with any storage and metadata source * @ param metadataProvider specified metadata source * @ param pieceStorage specified storage of pieces * @ return { @ link TorrentManager } instance for monitoring torrent state * @ throws IOException if IO e...
return addTorrent ( metadataProvider , pieceStorage , Collections . < TorrentListener > emptyList ( ) ) ;
public class EnumBindTransform { /** * / * ( non - Javadoc ) * @ see com . abubusoft . kripton . processor . bind . transform . BindTransform # generateParseOnJackson ( com . abubusoft . kripton . processor . bind . BindTypeContext , com . squareup . javapoet . MethodSpec . Builder , java . lang . String , com . squa...
if ( property . isNullable ( ) ) { methodBuilder . beginControlFlow ( "if ($L.currentToken()!=$T.VALUE_NULL)" , parserName , JsonToken . class ) ; } else { methodBuilder . beginControlFlow ( "" ) ; } methodBuilder . addStatement ( "String tempEnum=$L.getText()" , parserName ) ; methodBuilder . addStatement ( setter ( b...
public class TxRecoveryAgentImpl { /** * Creates a Filesystem TranLogConfiguration object appropriate for storing transaction logs in a filesystem . * @ param recoveredServerIdentity * @ param fs * @ param logDir * @ param logSize * @ param isPeerRecoverySupported * @ return * @ throws URISyntaxException ...
if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "createFileTranLogConfiguration" , new java . lang . Object [ ] { recoveredServerIdentity , fs , logDir , logSize , this } ) ; TranLogConfiguration tlc = null ; if ( _isPeerRecoverySupported ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Work with server recovery ...
public class LUnaryOperatorBuilder { /** * One of ways of creating builder . This is possibly the least verbose way where compiler should be able to guess the generic parameters . */ @ Nonnull public static < T > LUnaryOperator < T > unaryOperatorFrom ( Consumer < LUnaryOperatorBuilder < T > > buildingFunction ) { } }
LUnaryOperatorBuilder builder = new LUnaryOperatorBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ;
public class SelectExtension { /** * selects an item by it ' s identifier * @ param identifier the identifier of the item to select * @ param fireEvent true if the onClick listener should be called * @ param considerSelectableFlag true if the select method should not select an item if its not selectable */ public...
mFastAdapter . recursive ( new AdapterPredicate < Item > ( ) { @ Override public boolean apply ( @ NonNull IAdapter < Item > lastParentAdapter , int lastParentPosition , Item item , int position ) { if ( item . getIdentifier ( ) == identifier ) { select ( lastParentAdapter , item , position , fireEvent , considerSelect...
public class JavacFileManager { /** * container is a directory , a zip file , or a non - existant path . * Insert all files in subdirectory subdirectory of container which * match fileKinds into resultList */ private void listContainer ( File container , RelativeDirectory subdirectory , Set < JavaFileObject . Kind ...
Archive archive = archives . get ( container ) ; if ( archive == null ) { // archives are not created for directories . if ( fsInfo . isDirectory ( container ) ) { listDirectory ( container , subdirectory , fileKinds , recurse , resultList ) ; return ; } // Not a directory ; either a file or non - existant , create the...
public class FormValidation { /** * Makes sure that the given string is a base64 encoded text . * @ param allowWhitespace * if you allow whitespace ( CR , LF , etc ) in base64 encoding * @ param allowEmpty * Is empty string allowed ? * @ param errorMessage * Error message . * @ since 1.305 */ public stati...
try { String v = value ; if ( ! allowWhitespace ) { if ( v . indexOf ( ' ' ) >= 0 || v . indexOf ( '\n' ) >= 0 ) return error ( errorMessage ) ; } v = v . trim ( ) ; if ( ! allowEmpty && v . length ( ) == 0 ) return error ( errorMessage ) ; Base64 . getDecoder ( ) . decode ( v . getBytes ( StandardCharsets . UTF_8 ) ) ...
public class AdminDevice { /** * remove logging to a device * @ param argin * @ throws DevFailed */ @ Command ( name = "RemoveLoggingTarget" , inTypeDesc = "Str[i]=Device-name. Str[i+1]=Target-type::Target-name" ) public void removeLoggingTarget ( final String [ ] argin ) throws DevFailed { } }
if ( argin . length % 2 != 0 ) { throw DevFailedUtils . newDevFailed ( INPUT_ERROR , "argin must be of even size" ) ; } for ( int i = 0 ; i < argin . length - 1 ; i = i + 2 ) { final String deviceName = argin [ i ] ; final String [ ] config = argin [ i + 1 ] . split ( LoggingManager . LOGGING_TARGET_SEPARATOR ) ; if ( ...
public class GlobalSuffixFinders { /** * Returns all suffixes of the counterexample word as distinguishing suffixes , as suggested by Maler & amp ; Pnueli . * @ param ceQuery * the counterexample query * @ return all suffixes of the counterexample input */ public static < I , D > List < Word < I > > findMalerPnue...
return ceQuery . getInput ( ) . suffixes ( false ) ;
public class Grid { /** * Replies the grid cells that are intersecting the specified bounds . * @ param bounds the bounds * @ param createCells indicates if the not already created cells should be created . * @ return the grid cells . */ protected Iterable < GridCell < P > > getGridCellsOn ( Rectangle2afp < ? , ?...
if ( bounds . intersects ( this . bounds ) ) { final int c1 = getColumnFor ( bounds . getMinX ( ) ) ; final int r1 = getRowFor ( bounds . getMinY ( ) ) ; final int c2 = getColumnFor ( bounds . getMaxX ( ) ) ; final int r2 = getRowFor ( bounds . getMaxY ( ) ) ; return new CellIterable ( r1 , c1 , r2 , c2 , createCells )...
public class IfcSurfaceStyleWithTexturesImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public EList < IfcSurfaceTexture > getTextures ( ) { } }
return ( EList < IfcSurfaceTexture > ) eGet ( Ifc4Package . Literals . IFC_SURFACE_STYLE_WITH_TEXTURES__TEXTURES , true ) ;
public class InvokeDynamicBytecodeGeneratingVisitor { /** * @ Override * public void visit ( ExecutionContext context , AssignmentExpression expr , boolean strict ) { * LabelNode throwRefError = new LabelNode ( ) ; * LabelNode end = new LabelNode ( ) ; * LabelNode isUnresolvableRef = new LabelNode ( ) ; * Lab...
LabelNode end = new LabelNode ( ) ; LabelNode throwRef = new LabelNode ( ) ; CodeBlock codeBlock = new CodeBlock ( ) // IN : reference . dup ( ) // ref ref . instance_of ( p ( Reference . class ) ) // ref isref ? . iffalse ( end ) . checkcast ( p ( Reference . class ) ) // ref . dup ( ) // ref ref . invokevirtual ( p (...
public class AWSBackupClient { /** * Returns the backup plan that is specified by the plan ID as a backup template . * @ param exportBackupPlanTemplateRequest * @ return Result of the ExportBackupPlanTemplate operation returned by the service . * @ throws InvalidParameterValueException * Indicates that somethin...
request = beforeClientExecution ( request ) ; return executeExportBackupPlanTemplate ( request ) ;
public class MarginalLogLikelihood { /** * Gets the " expected " feature counts . */ public static FeatureVector getExpectedFeatureCounts ( FgExampleList data , FgInferencerFactory infFactory , FgModel model , double [ ] params ) { } }
model . updateModelFromDoubles ( params ) ; FgModel feats = model . getDenseCopy ( ) ; feats . zero ( ) ; for ( int i = 0 ; i < data . size ( ) ; i ++ ) { LFgExample ex = data . get ( i ) ; FactorGraph fgLatPred = ex . getFactorGraph ( ) ; fgLatPred . updateFromModel ( model ) ; FgInferencer infLatPred = infFactory . g...
public class CssEscape { /** * Perform a ( configurable ) CSS String < strong > escape < / strong > operation on a < tt > String < / tt > input . * This method will perform an escape operation according to the specified * { @ link CssStringEscapeType } and * { @ link CssStringEscapeLevel } argument values . * A...
if ( type == null ) { throw new IllegalArgumentException ( "The 'type' argument cannot be null" ) ; } if ( level == null ) { throw new IllegalArgumentException ( "The 'level' argument cannot be null" ) ; } return CssStringEscapeUtil . escape ( text , type , level ) ;
public class SwaggerBuilder { /** * Register authentication security . * @ param swagger * @ param operation * @ param method */ protected void registerSecurity ( Swagger swagger , Operation operation , Method method ) { } }
RequireToken requireToken = ClassUtil . getAnnotation ( method , RequireToken . class ) ; if ( requireToken != null ) { String apiKeyName = requireToken . value ( ) ; if ( swagger . getSecurityDefinitions ( ) == null || ! swagger . getSecurityDefinitions ( ) . containsKey ( apiKeyName ) ) { ApiKeyAuthDefinition securit...
public class Sql { /** * Creates a new Sql instance given a JDBC connection URL * and a driver class name . * @ param url a database url of the form * < code > jdbc : < em > subprotocol < / em > : < em > subname < / em > < / code > * @ param driverClassName the fully qualified class name of the driver class *...
loadDriver ( driverClassName ) ; return newInstance ( url ) ;
public class AgentInput { /** * Return an array of bytes from the ssh - agent representing data signed by a private SSH key . * @ return An array of signed bytes . */ byte [ ] readSignResponse ( ) throws IOException { } }
// Read the first 9 bytes from the InputStream which are the SSH2 _ AGENT _ SIGN _ RESPONSE headers . final byte [ ] headerBytes = readBytes ( 9 , "SSH2_AGENT_SIGN_RESPONSE" ) ; log . debug ( "Received SSH2_AGENT_SIGN_RESPONSE message from ssh-agent." ) ; final SignResponseHeaders headers = SignResponseHeaders . from (...
public class StringParser { /** * Checks if the given string is a numeric string that can be converted to an * unsigned long value with radix { @ value # DEFAULT _ RADIX } . * @ param sStr * The string to check . May be < code > null < / code > . * @ return < code > true < / code > if the value can be converted...
if ( sStr != null ) try { final long ret = Long . parseLong ( sStr , DEFAULT_RADIX ) ; return ret >= 0 ; } catch ( final NumberFormatException ex ) { // fall through } return false ;
public class DescribeComplianceByConfigRuleResult { /** * Indicates whether each of the specified AWS Config rules is compliant . * @ return Indicates whether each of the specified AWS Config rules is compliant . */ public java . util . List < ComplianceByConfigRule > getComplianceByConfigRules ( ) { } }
if ( complianceByConfigRules == null ) { complianceByConfigRules = new com . amazonaws . internal . SdkInternalList < ComplianceByConfigRule > ( ) ; } return complianceByConfigRules ;
public class Viewport { /** * Adds a { @ link FocusEvent } handler . * @ param handler the handler * @ return returns the handler registration */ @ Override public HandlerRegistration addFocusHandler ( FocusHandler handler ) { } }
return ensureHandlers ( ) . addHandler ( FocusEvent . getType ( ) , handler ) ;
public class CmsElementUtil { /** * Returns the rendered element content for all the given containers . * @ param element the element to render * @ param containers the containers the element appears in * @ return a map from container names to rendered page contents */ private Map < String , String > getContentsB...
CmsFormatterConfiguration configs = getFormatterConfiguration ( element . getResource ( ) ) ; Map < String , String > result = new HashMap < String , String > ( ) ; for ( CmsContainer container : containers ) { String content = getContentByContainer ( element , container , configs ) ; if ( content != null ) { content =...
public class InjectionUtils { /** * Liberty Change for CXF End */ public static Class < ? > updateParamClassToTypeIfNeeded ( Class < ? > paramCls , Type type ) { } }
if ( paramCls != type && type instanceof Class ) { Class < ? > clsType = ( Class < ? > ) type ; if ( paramCls . isAssignableFrom ( clsType ) || clsType != Object . class && ! clsType . isInterface ( ) && clsType . isAssignableFrom ( paramCls ) ) { paramCls = clsType ; } } return paramCls ;
public class HttpInputStreamImpl { /** * ( non - Javadoc ) * @ see java . io . InputStream # close ( ) */ @ Override public void close ( ) throws IOException { } }
if ( isClosed ( ) ) { return ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Closing stream: " + this ) ; } // adding MultiRead option if ( ! this . enableMultiReadofPostData ) { if ( null != this . buffer ) { this . buffer . release ( ) ; this . buffer = null ; } val...
public class Table { /** * If there is an identity column in the table , sets * the max identity value . */ protected void systemUpdateIdentityValue ( Object [ ] data ) { } }
if ( identityColumn != - 1 ) { Number id = ( Number ) data [ identityColumn ] ; if ( id != null ) { identitySequence . systemUpdate ( id . longValue ( ) ) ; } }
public class Status { /** * Converts a < code > String < / code > name to a status . * @ param name the name of the status * @ return the status or < code > UNDEFINDED < / code > if the conversion fails . */ public static Status valueOf ( String name ) { } }
if ( name == null ) { return UNDEFINED ; } for ( Status status : INSTANCES . values ( ) ) { if ( name . equals ( status . getName ( ) ) ) { return status ; } } return UNDEFINED ;
public class Schema { /** * Get ColumnFamily metadata by its identifier * @ param cfId The ColumnFamily identifier * @ return metadata about ColumnFamily */ public CFMetaData getCFMetaData ( UUID cfId ) { } }
Pair < String , String > cf = getCF ( cfId ) ; return ( cf == null ) ? null : getCFMetaData ( cf . left , cf . right ) ;
public class ZoneOffsetTransition { /** * Obtains an instance defining a transition between two offsets . * Applications should normally obtain an instance from { @ link ZoneRules } . * This factory is only intended for use when creating { @ link ZoneRules } . * @ param transition the transition date - time at th...
Jdk8Methods . requireNonNull ( transition , "transition" ) ; Jdk8Methods . requireNonNull ( offsetBefore , "offsetBefore" ) ; Jdk8Methods . requireNonNull ( offsetAfter , "offsetAfter" ) ; if ( offsetBefore . equals ( offsetAfter ) ) { throw new IllegalArgumentException ( "Offsets must not be equal" ) ; } if ( transiti...
public class StylesheetHandler { /** * Resolve an external entity . * @ param publicId The public identifer , or null if none is * available . * @ param systemId The system identifier provided in the XML * document . * @ return The new input source , or null to require the * default behaviour . * @ throws...
return getCurrentProcessor ( ) . resolveEntity ( this , publicId , systemId ) ;
public class Dialog { /** * Set the title of this Dialog . * @ param title The title text . * @ return The Dialog for chaining methods . */ public Dialog title ( CharSequence title ) { } }
mTitle . setText ( title ) ; mTitle . setVisibility ( TextUtils . isEmpty ( title ) ? View . GONE : View . VISIBLE ) ; return this ;
public class SimpleXMLParser { /** * Does the actual parsing . Perform this immediately * after creating the parser object . */ private void go ( Reader r ) throws IOException { } }
BufferedReader reader ; if ( r instanceof BufferedReader ) reader = ( BufferedReader ) r ; else reader = new BufferedReader ( r ) ; doc . startDocument ( ) ; while ( true ) { // read a new character if ( previousCharacter == - 1 ) { character = reader . read ( ) ; } // or re - examine the previous character else { char...
public class RequestSpotFleetRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional * parameters to enable operation dry - run . */ @ Override public Request < RequestSpotFleetRequest > getDryRunRequest ( ) { } }
Request < RequestSpotFleetRequest > request = new RequestSpotFleetRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ;
public class JdbcQueue { /** * Take a message from queue , retry if deadlock . * Note : http : / / dev . mysql . com / doc / refman / 5.0 / en / innodb - deadlocks . html * InnoDB uses automatic row - level locking . You can get deadlocks even in * the case of transactions that just insert or delete a single row ...
try { jdbcHelper . startTransaction ( conn ) ; conn . setTransactionIsolation ( transactionIsolationLevel ) ; boolean result = true ; IQueueMessage < ID , DATA > msg = readFromQueueStorage ( conn ) ; if ( msg != null ) { result = result && removeFromQueueStorage ( conn , msg ) ; if ( ! isEphemeralDisabled ( ) ) { try {...
public class SingleLaneProcessor { /** * Processes the batch by calling the { @ link # process ( Batch , SingleLaneBatchMaker ) } method . * @ param batch the batch of records to process . * @ param batchMaker records created by the < code > Processor < / code > stage must be added to the < code > BatchMaker < / co...
SingleLaneBatchMaker slBatchMaker = new SingleLaneBatchMaker ( ) { @ Override public void addRecord ( Record record ) { batchMaker . addRecord ( record , outputLane ) ; } } ; process ( batch , slBatchMaker ) ;
public class MetricsServlet { /** * Prints metrics data in a multi - line text form . */ void printMap ( PrintWriter out , Map < String , Map < String , List < TagsMetricsPair > > > map ) { } }
for ( Map . Entry < String , Map < String , List < TagsMetricsPair > > > context : map . entrySet ( ) ) { out . println ( context . getKey ( ) ) ; for ( Map . Entry < String , List < TagsMetricsPair > > record : context . getValue ( ) . entrySet ( ) ) { indent ( out , 1 ) ; out . println ( record . getKey ( ) ) ; for (...
public class PythonDualInputSender { /** * Extracts records from an iterator and writes them to the memory - mapped file . This method assumes that all values * in the iterator are of the same type . This method does NOT take care of synchronization . The caller must * guarantee that the file may be written to befo...
if ( serializer1 == null ) { IN1 value = input . next ( ) ; serializer1 = getSerializer ( value ) ; input . pushBack ( value ) ; } return sendBuffer ( input , serializer1 ) ;
public class XMLReader { /** * * * * * * EVERYTHING BELOW HERE IS FOR TESTING PURPOSES AND NOT CRITICAL * * * * * */ static public void main ( String ... args ) throws Exception { } }
FileInputStream fin = new FileInputStream ( args [ 0 ] ) ; XMLReader < Sample > reader = new XMLReader < Sample > ( ) ; for ( Map < String , Object > map : reader . read ( fin , Sample . class ) ) { System . out . println ( "Next..." ) ; for ( Map . Entry < String , Object > entry : map . entrySet ( ) ) { System . out ...
public class MessageUtil { /** * A convenience method for calling { @ link # compose ( String , String [ ] ) } with an array of argument * that will be automatically tainted . */ public static String tcompose ( String key , String ... args ) { } }
for ( int ii = 0 , nn = args . length ; ii < nn ; ii ++ ) { args [ ii ] = taint ( args [ ii ] ) ; } return compose ( key , args ) ;
public class MavenJDOMWriter { /** * Method updateExtension . * @ param value * @ param element * @ param counter * @ param xmlTag */ protected void updateExtension ( Extension value , String xmlTag , Counter counter , Element element ) { } }
Element root = element ; Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndReplaceSimpleElement ( innerCount , root , "groupId" , value . getGroupId ( ) , null ) ; findAndReplaceSimpleElement ( innerCount , root , "artifactId" , value . getArtifactId ( ) , null ) ; findAndReplaceSimpleElement ( i...
public class NaryTree { /** * Gets the lexical item ids comprising the sentence . */ public int [ ] getSentenceIds ( IntObjectBimap < String > lexAlphabet ) { } }
ArrayList < NaryTree > leaves = getLexicalLeaves ( ) ; int [ ] sent = new int [ leaves . size ( ) ] ; for ( int i = 0 ; i < sent . length ; i ++ ) { sent [ i ] = lexAlphabet . lookupIndex ( leaves . get ( i ) . symbol ) ; } return sent ;
public class CmsAliasErrorColumn { /** * Static helper method to get the value to display in the column from a row . < p > * @ param row the row * @ return the value to display */ protected static String getValueInternal ( CmsAliasTableRow row ) { } }
if ( row . getAliasError ( ) != null ) { return row . getAliasError ( ) ; } if ( row . getPathError ( ) != null ) { return row . getPathError ( ) ; } return null ;
public class RaftLock { /** * Releases the lock if the current lock holder ' s session is closed . */ @ Override protected void onSessionClose ( long sessionId , Map < Long , Object > responses ) { } }
removeInvocationRefUids ( sessionId ) ; if ( owner != null && owner . sessionId ( ) == sessionId ) { ReleaseResult result = doRelease ( owner . endpoint ( ) , newUnsecureUUID ( ) , lockCount ) ; for ( LockInvocationKey key : result . completedWaitKeys ( ) ) { responses . put ( key . commitIndex ( ) , result . ownership...
public class JSATData { /** * This loads a JSAT dataset from an input stream , and will not do any of * its own buffering . The DataSet will be returned as either a * { @ link SimpleDataSet } , { @ link ClassificationDataSet } , or * { @ link RegressionDataSet } depending on what type of dataset was * originall...
return load ( inRaw , false , backingStore ) ;
public class FactoryInterpolation { /** * Creates an interpolation class of the specified type for the specified image type . * @ param min Minimum possible pixel value . Inclusive . * @ param max Maximum possible pixel value . Inclusive . * @ param type Interpolation type * @ param borderType Border type . If ...
InterpolatePixelS < T > alg ; switch ( type ) { case NEAREST_NEIGHBOR : alg = nearestNeighborPixelS ( imageType ) ; break ; case BILINEAR : return bilinearPixelS ( imageType , borderType ) ; case BICUBIC : alg = bicubicS ( - 0.5f , ( float ) min , ( float ) max , imageType ) ; break ; case POLYNOMIAL4 : alg = polynomia...
public class UpdateTrustRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UpdateTrustRequest updateTrustRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( updateTrustRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateTrustRequest . getTrustId ( ) , TRUSTID_BINDING ) ; protocolMarshaller . marshall ( updateTrustRequest . getSelectiveAuth ( ) , SELECTIVEAUTH_BINDING ) ; } catc...
public class TrailerDocumentRepositoryMongoImpl { /** * { @ inheritDoc } */ @ Override public final TrailerDocument findByFileAndString ( final String filename , final String string ) { } }
final Query searchQuery = new Query ( Criteria . where ( "string" ) . is ( string ) . and ( "filename" ) . is ( filename ) ) ; final TrailerDocument trailerDocument = mongoTemplate . findOne ( searchQuery , TrailerDocumentMongo . class ) ; if ( trailerDocument == null ) { return null ; } final Trailer trailer = ( Trail...
public class Position { /** * TODO add unit test */ public LongitudePair getLongitudeOnGreatCircle ( Position position , double latitudeDegrees ) { } }
double lat3 = toRadians ( latitudeDegrees ) ; double lat1 = toRadians ( lat ) ; double lon1 = toRadians ( lon ) ; double lat2 = toRadians ( position . getLat ( ) ) ; double lon2 = toRadians ( position . getLon ( ) ) ; double l12 = lon1 - lon2 ; double sinLat1 = sin ( lat1 ) ; double cosLat2 = cos ( lat2 ) ; double cosL...
public class ListTargetsForPolicyRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ListTargetsForPolicyRequest listTargetsForPolicyRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( listTargetsForPolicyRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listTargetsForPolicyRequest . getPolicyId ( ) , POLICYID_BINDING ) ; protocolMarshaller . marshall ( listTargetsForPolicyRequest . getNextToken ( ) , NEXTTOK...
public class ApiOvhDomain { /** * List all your SMD files * REST : GET / domain / data / smd * @ param protectedLabels _ label [ required ] Filter the value of protectedLabels . label property ( = ) */ public ArrayList < Long > data_smd_GET ( String protectedLabels_label ) throws IOException { } }
String qPath = "/domain/data/smd" ; StringBuilder sb = path ( qPath ) ; query ( sb , "protectedLabels.label" , protectedLabels_label ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t1 ) ;
public class SlicedFileConsumer { /** * Initialization * @ throws IOException * I / O exception */ private void init ( ) throws IOException { } }
if ( initialized . compareAndSet ( false , true ) ) { log . debug ( "Init: {}" , mode ) ; // instance an executor for queue handling scheduledExecutorService = Executors . newScheduledThreadPool ( schedulerThreadSize , new CustomizableThreadFactory ( "FileConsumerExecutor-" ) ) ; // if the path is null , the consumer h...
public class SoundManager { /** * removes the LocaleDateTime and Thread ( if exisiting ) */ private void endWaitingForUsage ( ) { } }
synchronized ( permanentUserReadWriteLock ) { if ( permissionWithoutUsageLimit != null ) permissionWithoutUsageLimit = null ; if ( permissionWithoutUsageCloseThread != null ) { permissionWithoutUsageCloseThread . cancel ( true ) ; permissionWithoutUsageLimit = null ; } }
public class DefaultOperationCandidatesProvider { /** * package for testing purpose */ static Property getProperty ( String propName , ModelNode attrs ) { } }
String [ ] arr = propName . split ( "\\." ) ; ModelNode attrDescr = attrs ; for ( String item : arr ) { // Remove list part . if ( item . endsWith ( "]" ) ) { int i = item . indexOf ( "[" ) ; if ( i < 0 ) { return null ; } item = item . substring ( 0 , i ) ; } ModelNode descr = attrDescr . get ( item ) ; if ( ! descr ....
public class SparseMatrixT { /** * 将多维索引转换为列排序索引 * @ param indices * @ return * Jul 29 , 2009 */ public long getIdx ( int [ ] indices ) { } }
long idx = 0 ; int i = indices . length - 1 ; for ( int j = 0 ; i > 0 && j < indices . length - 1 ; i -- , j ++ ) idx += indices [ i ] * dim [ j ] ; idx += indices [ 0 ] ; return idx ;
public class NetUtil { /** * Checks if given String is either a valid IPv4 or IPv6 address . * @ param _ ipAddress * @ return true if valid address , false otherwise */ public static boolean isIPv4orIPv6Address ( String _ipAddress ) { } }
return IPV4_PATTERN . matcher ( _ipAddress ) . matches ( ) || IPV6_PATTERN . matcher ( _ipAddress ) . matches ( ) ;
public class JsonSerializer { /** * Writes the object out as json . * @ param out * output writer * @ param json * a { @ link JsonElement } * @ param pretty * if true , a properly indented version of the json is written * @ throws IOException * if there is a problem writing to the stream */ public stati...
Validate . notNull ( out ) ; BufferedOutputStream bufferedOut = new BufferedOutputStream ( out ) ; OutputStreamWriter w = new OutputStreamWriter ( bufferedOut , UTF8 ) ; if ( pretty ) { serialize ( w , json , pretty ) ; } else { json . serialize ( w ) ; // subtle bug where not flushing this results in empty string when...
public class MarcField { /** * A MARC field can be denoted by a key , independent of values . * This key is a string , consisting of tag and indicator delimited by a dollar sign . * @ return the tag / indicator - based key of this MARC field */ public String toTagIndicatorKey ( ) { } }
return ( tag == null ? EMPTY_STRING : tag ) + KEY_DELIMITER + ( indicator == null ? EMPTY_STRING : indicator ) ;
public class PDBStatus { /** * Gets the PDB which superseded oldPdbId . For CURRENT IDs , this will * be itself . For obsolete IDs , the behavior depends on the recursion * parameter . If false , only IDs which directly supersede oldPdbId are * returned . If true , the replacements for obsolete records are recurs...
List < Map < String , String > > attrList = getStatusIdRecords ( new String [ ] { oldPdbId } ) ; // Expect a single record if ( attrList == null || attrList . size ( ) != 1 ) { logger . error ( "Error getting Status for {} from the PDB website." , oldPdbId ) ; return null ; } Map < String , String > attrs = attrList . ...
public class BarPlot { /** * Create a plot canvas with the bar plot of given data . * @ param id the id of the plot . * @ param data a vector of which values will determine the heights of bars . */ public static PlotCanvas plot ( String id , double [ ] data ) { } }
double [ ] lowerBound = { 0 , Math . min ( data ) } ; double [ ] upperBound = { data . length , Math . max ( data ) } ; PlotCanvas canvas = new PlotCanvas ( lowerBound , upperBound ) ; BarPlot plot = new BarPlot ( data ) ; plot . setID ( id ) ; canvas . add ( plot ) ; canvas . getAxis ( 0 ) . setGridVisible ( false ) ;...
public class PasswordEditText { /** * Returns the color of the helper text , which corresponds to a specific password strength . * @ param score * The password strength as a { @ link Float } value between 0.0 and 1.0 , which represents * the fraction of constraints , which are satisfied * @ return The color of ...
if ( ! helperTextColors . isEmpty ( ) ) { float interval = 1.0f / helperTextColors . size ( ) ; int index = ( int ) Math . floor ( score / interval ) - 1 ; index = Math . max ( index , 0 ) ; index = Math . min ( index , helperTextColors . size ( ) - 1 ) ; return helperTextColors . get ( index ) ; } return regularHelper...
public class PermissionsInner { /** * Gets all permissions the caller has for a resource . * @ 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 & lt ; Permis...
return listForResourceNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < PermissionInner > > , Page < PermissionInner > > ( ) { @ Override public Page < PermissionInner > call ( ServiceResponse < Page < PermissionInner > > response ) { return response . body ( ) ; } } ) ;
public class JDBC4DatabaseMetaData { /** * Retrieves a description of the system and user functions available in the given catalog . */ @ Override public ResultSet getFunctions ( String catalog , String schemaPattern , String functionNamePattern ) throws SQLException { } }
checkClosed ( ) ; throw SQLError . noSupport ( ) ;
public class POIUtils { /** * 座標をExcelのアドレス形式 ' A1 ' になどに変換する 。 * @ param cellAddress セルの位置情報 * @ return * @ throws IllegalArgumentException address = = null . */ public static String formatCellAddress ( final Point cellAddress ) { } }
ArgUtils . notNull ( cellAddress , "cellAddress" ) ; return formatCellAddress ( cellAddress . y , cellAddress . x ) ;
public class RegExFileFilter { /** * Checks whether a file satisfies the selection filter . * @ param file The file * @ return true if the file is acceptable */ public boolean accept ( File file ) { } }
Matcher m = pattern . matcher ( file . getName ( ) ) ; return m . matches ( ) ;
public class Address { /** * Appends the given address to this address . * This lets you build up addresses in a step - wise fashion . * @ param address new address to appen to this address . * @ return this address ( which now has the new address appended ) . */ public Address add ( Address address ) { } }
// if address is null or is the root address then there is nothing to append if ( address == null || address . isRoot ( ) ) { return this ; } // if we are the root address then the given address just is our new address , // otherwise , append all parts from " address " to us . if ( isRoot ( ) ) { this . addressNode = a...
public class CmsNewResourceTypeDialog { /** * Gets the message bundle . < p > * @ return Message bundle resource */ private CmsResource getMessageBundle ( ) { } }
OpenCms . getLocaleManager ( ) ; String localString = CmsLocaleManager . getDefaultLocale ( ) . toString ( ) ; List < String > moduleResource = m_module . getResources ( ) ; for ( String resourcePath : moduleResource ) { if ( resourcePath . contains ( PATH_I18N ) && resourcePath . endsWith ( localString ) ) { try { ret...