signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class HyperionClient { /** * Build the URL for the specified request * @ param request the data service request * @ return The URL string */ protected String buildUrl ( Request request ) { } }
StringBuilder sb = new StringBuilder ( 512 ) ; sb . append ( baseUrl ) . append ( request . getEntityName ( ) ) . append ( "/" ) ; if ( request . getPath ( ) != null ) sb . append ( request . getPath ( ) ) ; String queryString = buildQueryString ( request ) ; if ( queryString . length ( ) > 0 ) { sb . append ( "?" ) . append ( queryString ) ; } return sb . toString ( ) ;
public class AttackProperty { /** * The array of < a > Contributor < / a > objects that includes the top five contributors to an attack . * @ param topContributors * The array of < a > Contributor < / a > objects that includes the top five contributors to an attack . */ public void setTopContributors ( java . util . Collection < Contributor > topContributors ) { } }
if ( topContributors == null ) { this . topContributors = null ; return ; } this . topContributors = new java . util . ArrayList < Contributor > ( topContributors ) ;
public class CountMap { /** * Get the count for the specified key . If the key is not present , 0 is returned . */ public int getCount ( K key ) { } }
CountEntry < K > entry = _backing . get ( key ) ; return ( entry == null ) ? 0 : entry . count ;
public class Coordination { /** * setter for elliptical - sets * @ generated * @ param v value to set into the feature */ public void setElliptical ( boolean v ) { } }
if ( Coordination_Type . featOkTst && ( ( Coordination_Type ) jcasType ) . casFeat_elliptical == null ) jcasType . jcas . throwFeatMissing ( "elliptical" , "de.julielab.jules.types.Coordination" ) ; jcasType . ll_cas . ll_setBooleanValue ( addr , ( ( Coordination_Type ) jcasType ) . casFeatCode_elliptical , v ) ;
public class JDBC4ClientConnection { /** * Used by the pool to indicate a thread / user has stopped using the connection ( and optionally * close the underlying client if there are no more users against it ) . */ protected synchronized void dispose ( ) { } }
this . users -- ; if ( this . users == 0 ) { try { Client currentClient = this . client . get ( ) ; if ( currentClient != null ) { currentClient . close ( ) ; } } catch ( Exception x ) { // ignore } }
public class MapIndexConfig { /** * Validates index attribute content . * @ param attribute attribute to validate * @ return the attribute for fluent assignment */ public static String validateIndexAttribute ( String attribute ) { } }
checkHasText ( attribute , "Map index attribute must contain text" ) ; String keyPrefix = KEY_ATTRIBUTE_NAME . value ( ) ; if ( attribute . startsWith ( keyPrefix ) && attribute . length ( ) > keyPrefix . length ( ) ) { if ( attribute . charAt ( keyPrefix . length ( ) ) != '#' ) { LOG . warning ( KEY_ATTRIBUTE_NAME . value ( ) + " used without a following '#' char in index attribute '" + attribute + "'. Don't you want to index a key?" ) ; } } return attribute ;
public class PatternToken { /** * Checks whether an exception for a previous token matches ( in case the exception had scope = = * " previous " ) . * @ param token { @ link AnalyzedToken } to check matching against . * @ return True if any of the exceptions matches . */ public boolean isMatchedByPreviousException ( AnalyzedToken token ) { } }
if ( exceptionValidPrevious ) { for ( PatternToken testException : previousExceptionList ) { if ( ! testException . exceptionValidNext ) { if ( testException . isMatched ( token ) ) { return true ; } } } } return false ;
public class HttpSender { /** * Sets the maximum number of redirects that will be followed before failing with an exception . * The default maximum number of redirects is 100. * @ param maxRedirects the maximum number of redirects * @ throws IllegalArgumentException if { @ code maxRedirects } is negative . * @ since 2.4.0 */ public void setMaxRedirects ( int maxRedirects ) { } }
if ( maxRedirects < 0 ) { throw new IllegalArgumentException ( "Parameter maxRedirects must be greater or equal to zero." ) ; } client . getParams ( ) . setIntParameter ( HttpClientParams . MAX_REDIRECTS , maxRedirects ) ; clientViaProxy . getParams ( ) . setIntParameter ( HttpClientParams . MAX_REDIRECTS , maxRedirects ) ;
public class ConnectionFactory { /** * Constructs a new database connection object per the database * configuration . * @ return a database connection object * @ throws DatabaseException thrown if there is an exception loading the * database connection */ public synchronized Connection getConnection ( ) throws DatabaseException { } }
initialize ( ) ; Connection conn = null ; try { conn = DriverManager . getConnection ( connectionString , userName , password ) ; } catch ( SQLException ex ) { LOGGER . debug ( "" , ex ) ; throw new DatabaseException ( "Unable to connect to the database" , ex ) ; } return conn ;
public class DRL6StrictParser { /** * lhsOr : = LEFT _ PAREN OR lhsAnd + RIGHT _ PAREN * | lhsAnd ( OR lhsAnd ) * * @ param ce * @ param allowOr * @ throws org . antlr . runtime . RecognitionException */ private BaseDescr lhsOr ( final CEDescrBuilder < ? , ? > ce , boolean allowOr ) throws RecognitionException { } }
BaseDescr result = null ; if ( allowOr && input . LA ( 1 ) == DRL6Lexer . LEFT_PAREN && helper . validateLT ( 2 , DroolsSoftKeywords . OR ) ) { // prefixed OR CEDescrBuilder < ? , OrDescr > or = null ; if ( state . backtracking == 0 ) { or = ce . or ( ) ; result = or . getDescr ( ) ; helper . start ( or , CEDescrBuilder . class , null ) ; } try { match ( input , DRL6Lexer . LEFT_PAREN , null , null , DroolsEditorType . SYMBOL ) ; if ( state . failed ) return null ; match ( input , DRL6Lexer . ID , DroolsSoftKeywords . OR , null , DroolsEditorType . KEYWORD ) ; if ( state . failed ) return null ; if ( state . backtracking == 0 ) { helper . emit ( Location . LOCATION_LHS_BEGIN_OF_CONDITION_AND_OR ) ; } while ( input . LA ( 1 ) != DRL6Lexer . RIGHT_PAREN ) { lhsAnd ( or , allowOr ) ; if ( state . failed ) return null ; } match ( input , DRL6Lexer . RIGHT_PAREN , null , null , DroolsEditorType . SYMBOL ) ; if ( state . failed ) return null ; } finally { if ( state . backtracking == 0 ) { helper . end ( CEDescrBuilder . class , or ) ; } } } else { // infix OR // create an OR anyway , as if it is not an OR we remove it later CEDescrBuilder < ? , OrDescr > or = null ; if ( state . backtracking == 0 ) { or = ce . or ( ) ; result = or . getDescr ( ) ; helper . start ( or , CEDescrBuilder . class , null ) ; } try { lhsAnd ( or , allowOr ) ; if ( state . failed ) return null ; if ( allowOr && ( helper . validateIdentifierKey ( DroolsSoftKeywords . OR ) || input . LA ( 1 ) == DRL6Lexer . DOUBLE_PIPE ) ) { while ( helper . validateIdentifierKey ( DroolsSoftKeywords . OR ) || input . LA ( 1 ) == DRL6Lexer . DOUBLE_PIPE ) { if ( input . LA ( 1 ) == DRL6Lexer . DOUBLE_PIPE ) { match ( input , DRL6Lexer . DOUBLE_PIPE , null , null , DroolsEditorType . SYMBOL ) ; } else { match ( input , DRL6Lexer . ID , DroolsSoftKeywords . OR , null , DroolsEditorType . KEYWORD ) ; } if ( state . failed ) return null ; if ( state . backtracking == 0 ) { helper . emit ( Location . LOCATION_LHS_BEGIN_OF_CONDITION_AND_OR ) ; } lhsAnd ( or , allowOr ) ; if ( state . failed ) return null ; } } else if ( allowOr ) { if ( state . backtracking == 0 ) { // if no OR present , then remove it and add children to parent ( ( ConditionalElementDescr ) ce . getDescr ( ) ) . getDescrs ( ) . remove ( or . getDescr ( ) ) ; for ( BaseDescr base : or . getDescr ( ) . getDescrs ( ) ) { ( ( ConditionalElementDescr ) ce . getDescr ( ) ) . addDescr ( base ) ; } result = ce . getDescr ( ) ; } } } finally { if ( state . backtracking == 0 ) { helper . end ( CEDescrBuilder . class , or ) ; } } } return result ;
public class From { /** * Create and chain a WHERE component for specifying the WHERE clause of the query . * @ param expression the WHERE clause expression . * @ return the WHERE component . */ @ NonNull @ Override public Where where ( @ NonNull Expression expression ) { } }
if ( expression == null ) { throw new IllegalArgumentException ( "expression cannot be null." ) ; } return new Where ( this , expression ) ;
public class CudaZeroHandler { /** * This method moves specific object from zero - copy memory to device memory * PLEASE NOTE : DO NOT EVER USE THIS METHOD MANUALLY , UNLESS YOU 100 % HAVE TO * @ return */ @ Override public boolean promoteObject ( DataBuffer buffer ) { } }
AllocationPoint dstPoint = AtomicAllocator . getInstance ( ) . getAllocationPoint ( buffer ) ; if ( dstPoint . getAllocationStatus ( ) != AllocationStatus . HOST ) return false ; if ( configuration . getMemoryModel ( ) == Configuration . MemoryModel . DELAYED && dstPoint . getAllocationStatus ( ) == AllocationStatus . HOST ) { // if we have constant buffer ( aka shapeInfo or other constant stuff ) if ( buffer . isConstant ( ) ) { Nd4j . getConstantHandler ( ) . moveToConstantSpace ( buffer ) ; } else { PointersPair pair = memoryProvider . malloc ( dstPoint . getShape ( ) , dstPoint , AllocationStatus . DEVICE ) ; if ( pair != null ) { Integer deviceId = getDeviceId ( ) ; // log . info ( " Promoting object to device : [ { } ] " , deviceId ) ; dstPoint . getPointers ( ) . setDevicePointer ( pair . getDevicePointer ( ) ) ; dstPoint . setAllocationStatus ( AllocationStatus . DEVICE ) ; deviceAllocations . get ( deviceId ) . put ( dstPoint . getObjectId ( ) , dstPoint . getObjectId ( ) ) ; zeroAllocations . get ( dstPoint . getBucketId ( ) ) . remove ( dstPoint . getObjectId ( ) ) ; deviceMemoryTracker . addToAllocation ( Thread . currentThread ( ) . getId ( ) , deviceId , AllocationUtils . getRequiredMemory ( dstPoint . getShape ( ) ) ) ; dstPoint . tickHostWrite ( ) ; } else throw new RuntimeException ( "PewPew" ) ; } } return true ;
public class ThreadProperty { /** * Set a string to share in other class . * @ param key * @ param value */ public static void set ( String key , String value ) { } }
PROPS . get ( ) . setProperty ( key , value ) ;
public class JDBCPersistenceManagerImpl { /** * / * ( non - Javadoc ) * @ see com . ibm . jbatch . container . services . IPersistenceManagerService # updateStepExecution ( com . ibm . jbatch . container . context . impl . StepContextImpl ) */ @ Override public void updateStepExecution ( StepContextImpl stepContext ) { } }
Metric [ ] metrics = stepContext . getMetrics ( ) ; long readCount = 0 ; long writeCount = 0 ; long commitCount = 0 ; long rollbackCount = 0 ; long readSkipCount = 0 ; long processSkipCount = 0 ; long filterCount = 0 ; long writeSkipCount = 0 ; for ( int i = 0 ; i < metrics . length ; i ++ ) { if ( metrics [ i ] . getType ( ) . equals ( MetricImpl . MetricType . READ_COUNT ) ) { readCount = metrics [ i ] . getValue ( ) ; } else if ( metrics [ i ] . getType ( ) . equals ( MetricImpl . MetricType . WRITE_COUNT ) ) { writeCount = metrics [ i ] . getValue ( ) ; } else if ( metrics [ i ] . getType ( ) . equals ( MetricImpl . MetricType . PROCESS_SKIP_COUNT ) ) { processSkipCount = metrics [ i ] . getValue ( ) ; } else if ( metrics [ i ] . getType ( ) . equals ( MetricImpl . MetricType . COMMIT_COUNT ) ) { commitCount = metrics [ i ] . getValue ( ) ; } else if ( metrics [ i ] . getType ( ) . equals ( MetricImpl . MetricType . ROLLBACK_COUNT ) ) { rollbackCount = metrics [ i ] . getValue ( ) ; } else if ( metrics [ i ] . getType ( ) . equals ( MetricImpl . MetricType . READ_SKIP_COUNT ) ) { readSkipCount = metrics [ i ] . getValue ( ) ; } else if ( metrics [ i ] . getType ( ) . equals ( MetricImpl . MetricType . FILTER_COUNT ) ) { filterCount = metrics [ i ] . getValue ( ) ; } else if ( metrics [ i ] . getType ( ) . equals ( MetricImpl . MetricType . WRITE_SKIP_COUNT ) ) { writeSkipCount = metrics [ i ] . getValue ( ) ; } } updateStepExecutionWithMetrics ( stepContext , readCount , writeCount , commitCount , rollbackCount , readSkipCount , processSkipCount , filterCount , writeSkipCount ) ;
public class lbpersistentsessions { /** * Use this API to fetch filtered set of lbpersistentsessions resources . * filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */ public static lbpersistentsessions [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } }
lbpersistentsessions obj = new lbpersistentsessions ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; lbpersistentsessions [ ] response = ( lbpersistentsessions [ ] ) obj . getfiltered ( service , option ) ; return response ;
public class DocletSerializer { /** * Overrides the default implementation to set the language to " no - highlight " no * language is specified . If highlighting is disabled or auto - highlighting is enabled , * this method just calls the default implementation . * @ param node The AST node . */ @ Override public void visit ( VerbatimNode node ) { } }
if ( options . isHighlightEnabled ( ) && ! options . isAutoHighlightEnabled ( ) && node . getType ( ) . isEmpty ( ) ) { VerbatimNode noHighlightNode = new VerbatimNode ( node . getText ( ) , "no-highlight" ) ; noHighlightNode . setStartIndex ( node . getStartIndex ( ) ) ; noHighlightNode . setEndIndex ( node . getEndIndex ( ) ) ; super . visit ( noHighlightNode ) ; } else { super . visit ( node ) ; }
public class AmountFormats { /** * Formats a duration to a string in a localized word - based format . * This returns a word - based format for the duration . * The words are configured in a resource bundle text file - * { @ code org . threeten . extra . wordbased . properties } - with overrides per language . * @ param duration the duration to format * @ param locale the locale to use * @ return the localized word - based format for the duration */ public static String wordBased ( Duration duration , Locale locale ) { } }
Objects . requireNonNull ( duration , "duration must not be null" ) ; Objects . requireNonNull ( locale , "locale must not be null" ) ; ResourceBundle bundle = ResourceBundle . getBundle ( BUNDLE_NAME , locale ) ; UnitFormat [ ] formats = { UnitFormat . of ( bundle , WORDBASED_HOUR ) , UnitFormat . of ( bundle , WORDBASED_MINUTE ) , UnitFormat . of ( bundle , WORDBASED_SECOND ) , UnitFormat . of ( bundle , WORDBASED_MILLISECOND ) } ; WordBased wb = new WordBased ( formats , bundle . getString ( WORDBASED_COMMASPACE ) , bundle . getString ( WORDBASED_SPACEANDSPACE ) ) ; long hours = duration . toHours ( ) ; long mins = duration . toMinutes ( ) % MINUTES_PER_HOUR ; long secs = duration . getSeconds ( ) % SECONDS_PER_MINUTE ; int millis = duration . getNano ( ) / NANOS_PER_MILLIS ; int [ ] values = { ( int ) hours , ( int ) mins , ( int ) secs , millis } ; return wb . format ( values ) ;
public class BugInstance { /** * Add a field annotation for a FieldVariable matched in a ByteCodePattern . * @ param field * the FieldVariable * @ return this object */ @ Nonnull public BugInstance addField ( FieldVariable field ) { } }
return addField ( field . getClassName ( ) , field . getFieldName ( ) , field . getFieldSig ( ) , field . isStatic ( ) ) ;
public class AbstractDefinitionDeployer { /** * per default we increment the latest definition version by one - but you * might want to hook in some own logic here , e . g . to align definition * versions with deployment / build versions . */ protected int getNextVersion ( DeploymentEntity deployment , DefinitionEntity newDefinition , DefinitionEntity latestDefinition ) { } }
int result = 1 ; if ( latestDefinition != null ) { int latestVersion = latestDefinition . getVersion ( ) ; result = latestVersion + 1 ; } return result ;
public class CmsVfsService { /** * Returns the preview info for the given resource . < p > * @ param cms the CMS context * @ param resource the resource * @ param locale the requested locale * @ return the preview info */ private CmsPreviewInfo getPreviewInfo ( CmsObject cms , CmsResource resource , Locale locale ) { } }
String title = "" ; try { CmsProperty titleProperty = cms . readPropertyObject ( resource , CmsPropertyDefinition . PROPERTY_TITLE , false ) ; title = titleProperty . getValue ( "" ) ; } catch ( CmsException e ) { LOG . warn ( e . getLocalizedMessage ( ) , e ) ; } String noPreviewReason = getNoPreviewReason ( cms , resource ) ; String previewContent = null ; int height = 0 ; int width = 0 ; LinkedHashMap < String , String > locales = getAvailableLocales ( resource ) ; if ( noPreviewReason != null ) { previewContent = "<div>" + noPreviewReason + "</div>" ; return new CmsPreviewInfo ( "<div>" + noPreviewReason + "</div>" , null , false , title , cms . getSitePath ( resource ) , locale . toString ( ) ) ; } else if ( OpenCms . getResourceManager ( ) . matchResourceType ( CmsResourceTypeImage . getStaticTypeName ( ) , resource . getTypeId ( ) ) ) { CmsImageScaler scaler = new CmsImageScaler ( cms , resource ) ; String imageLink = null ; if ( resource instanceof I_CmsHistoryResource ) { int version = ( ( I_CmsHistoryResource ) resource ) . getVersion ( ) ; imageLink = OpenCms . getLinkManager ( ) . substituteLinkForUnknownTarget ( cms , CmsHistoryListUtil . getHistoryLink ( cms , resource . getStructureId ( ) , "" + version ) ) ; } else { imageLink = OpenCms . getLinkManager ( ) . substituteLinkForUnknownTarget ( cms , resource . getRootPath ( ) ) ; } imageLink = CmsRequestUtil . appendParameter ( imageLink , "random" , "" + Math . random ( ) ) ; previewContent = "<img src=\"" + imageLink + "\" title=\"" + title + "\" style=\"display:block\" />" ; height = scaler . getHeight ( ) ; width = scaler . getWidth ( ) ; } else if ( CmsResourceTypeXmlContainerPage . isContainerPage ( resource ) || CmsResourceTypeXmlPage . isXmlPage ( resource ) ) { String link = "" ; if ( resource instanceof I_CmsHistoryResource ) { int version = ( ( I_CmsHistoryResource ) resource ) . getVersion ( ) ; link = OpenCms . getLinkManager ( ) . substituteLinkForUnknownTarget ( cms , CmsHistoryListUtil . getHistoryLink ( cms , resource . getStructureId ( ) , "" + version ) ) ; } else { link = OpenCms . getLinkManager ( ) . substituteLinkForUnknownTarget ( cms , resource . getRootPath ( ) ) ; } return new CmsPreviewInfo ( null , link , true , null , cms . getSitePath ( resource ) , locale . toString ( ) ) ; } else if ( CmsResourceTypeXmlContent . isXmlContent ( resource ) ) { if ( ! locales . containsKey ( locale . toString ( ) ) ) { locale = CmsLocaleManager . getMainLocale ( cms , resource ) ; } previewContent = CmsPreviewService . getPreviewContent ( getRequest ( ) , getResponse ( ) , cms , resource , locale ) ; } else if ( CmsResourceTypePlain . getStaticTypeId ( ) == resource . getTypeId ( ) ) { try { previewContent = "<pre><code>" + new String ( cms . readFile ( resource ) . getContents ( ) ) + "</code></pre>" ; } catch ( CmsException e ) { LOG . warn ( e . getLocalizedMessage ( ) , e ) ; previewContent = "<div>" + Messages . get ( ) . getBundle ( OpenCms . getWorkplaceManager ( ) . getWorkplaceLocale ( cms ) ) . key ( Messages . GUI_NO_PREVIEW_CAN_T_READ_CONTENT_0 ) + "</div>" ; } } if ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( previewContent ) ) { CmsPreviewInfo result = new CmsPreviewInfo ( previewContent , null , false , title , cms . getSitePath ( resource ) , locale . toString ( ) ) ; result . setHeight ( height ) ; result . setWidth ( width ) ; result . setLocales ( locales ) ; return result ; } if ( CmsResourceTypeXmlContainerPage . isContainerPage ( resource ) || CmsResourceTypeXmlPage . isXmlPage ( resource ) ) { CmsPreviewInfo result = new CmsPreviewInfo ( null , OpenCms . getLinkManager ( ) . substituteLinkForUnknownTarget ( cms , resource . getRootPath ( ) ) + "?" + CmsGwtConstants . PARAM_DISABLE_DIRECT_EDIT + "=true" + "&__locale=" + locale . toString ( ) , false , title , cms . getSitePath ( resource ) , locale . toString ( ) ) ; result . setLocales ( locales ) ; return result ; } return new CmsPreviewInfo ( null , OpenCms . getLinkManager ( ) . substituteLinkForUnknownTarget ( cms , resource . getRootPath ( ) ) + "?" + CmsGwtConstants . PARAM_DISABLE_DIRECT_EDIT + "=true" , true , title , cms . getSitePath ( resource ) , locale . toString ( ) ) ;
public class URLUtil { /** * 获得path部分 < br > * @ param uriStr URI路径 * @ return path * @ exception UtilException 包装URISyntaxException */ public static String getPath ( String uriStr ) { } }
URI uri = null ; try { uri = new URI ( uriStr ) ; } catch ( URISyntaxException e ) { throw new UtilException ( e ) ; } return uri . getPath ( ) ;
public class AwsSecurityFindingFilters { /** * The destination IPv4 address of network - related information about a finding . * @ param networkDestinationIpV4 * The destination IPv4 address of network - related information about a finding . */ public void setNetworkDestinationIpV4 ( java . util . Collection < IpFilter > networkDestinationIpV4 ) { } }
if ( networkDestinationIpV4 == null ) { this . networkDestinationIpV4 = null ; return ; } this . networkDestinationIpV4 = new java . util . ArrayList < IpFilter > ( networkDestinationIpV4 ) ;
public class MindMapPanel { /** * Try lock the panel if it is not disposed . * @ return true if the panel is locked successfully , false if the panel has * been disposed . */ public boolean lockIfNotDisposed ( ) { } }
boolean result = false ; if ( this . panelLocker != null ) { this . panelLocker . lock ( ) ; if ( this . disposed . get ( ) ) { this . panelLocker . unlock ( ) ; } else { result = true ; } } return result ;
public class diff_match_patch { /** * Does a substring of shorttext exist within longtext such that the * substring is at least half the length of longtext ? * @ param longtext * Longer string . * @ param shorttext * Shorter string . * @ param i * Start index of quarter length substring within longtext . * @ return Five element String array , containing the prefix of longtext , the * suffix of longtext , the prefix of shorttext , the suffix of * shorttext and the common middle . Or null if there was no match . */ private String [ ] diff_halfMatchI ( String longtext , String shorttext , int i ) { } }
// Start with a 1/4 length substring at position i as a seed . String seed = longtext . substring ( i , i + longtext . length ( ) / 4 ) ; int j = - 1 ; String best_common = "" ; String best_longtext_a = "" , best_longtext_b = "" ; String best_shorttext_a = "" , best_shorttext_b = "" ; while ( ( j = shorttext . indexOf ( seed , j + 1 ) ) != - 1 ) { int prefixLength = diff_commonPrefix ( longtext . substring ( i ) , shorttext . substring ( j ) ) ; int suffixLength = diff_commonSuffix ( longtext . substring ( 0 , i ) , shorttext . substring ( 0 , j ) ) ; if ( best_common . length ( ) < suffixLength + prefixLength ) { best_common = shorttext . substring ( j - suffixLength , j ) + shorttext . substring ( j , j + prefixLength ) ; best_longtext_a = longtext . substring ( 0 , i - suffixLength ) ; best_longtext_b = longtext . substring ( i + prefixLength ) ; best_shorttext_a = shorttext . substring ( 0 , j - suffixLength ) ; best_shorttext_b = shorttext . substring ( j + prefixLength ) ; } } if ( best_common . length ( ) * 2 >= longtext . length ( ) ) { return new String [ ] { best_longtext_a , best_longtext_b , best_shorttext_a , best_shorttext_b , best_common } ; } else { return null ; }
public class PluginAdapterUtility { /** * Set instance field value for the given property , returns true if the field value was set , false otherwise */ private static boolean setValueForProperty ( final Property property , final Object value , final Object object ) { } }
final Field field = fieldForPropertyName ( property . getName ( ) , object ) ; if ( null == field ) { return false ; } final Property . Type type = property . getType ( ) ; final Property . Type ftype = propertyTypeFromFieldType ( field . getType ( ) ) ; if ( ftype != property . getType ( ) && ! ( ftype == Property . Type . String && ( property . getType ( ) == Property . Type . Select || property . getType ( ) == Property . Type . FreeSelect || property . getType ( ) == Property . Type . Options ) ) ) { throw new IllegalStateException ( String . format ( "cannot map property {%s type: %s} to field {%s type: %s}" , property . getName ( ) , property . getType ( ) , field . getName ( ) , ftype ) ) ; } final Object resolvedValue ; if ( type == Property . Type . Integer ) { final Integer intvalue ; if ( value instanceof String ) { intvalue = Integer . parseInt ( ( String ) value ) ; } else if ( value instanceof Integer ) { intvalue = ( Integer ) value ; } else { // XXX return false ; } resolvedValue = intvalue ; } else if ( type == Property . Type . Long ) { final Long longvalue ; if ( value instanceof String ) { longvalue = Long . parseLong ( ( String ) value ) ; } else if ( value instanceof Long ) { longvalue = ( Long ) value ; } else if ( value instanceof Integer ) { final int val = ( Integer ) value ; longvalue = ( long ) val ; } else { // XXX return false ; } resolvedValue = longvalue ; } else if ( type == Property . Type . Boolean ) { final Boolean boolvalue ; if ( value instanceof String ) { boolvalue = Boolean . parseBoolean ( ( String ) value ) ; } else if ( value instanceof Boolean ) { boolvalue = ( Boolean ) value ; } else { // XXX return false ; } resolvedValue = boolvalue ; } else if ( type == Property . Type . Options ) { final List < String > splitList ; if ( value instanceof String ) { String valstring = ( String ) value ; splitList = Arrays . asList ( valstring . split ( ", *" ) ) ; } else if ( value instanceof List ) { splitList = ( List < String > ) value ; } else if ( value instanceof Set ) { splitList = new ArrayList < > ( ( Set ) value ) ; } else if ( value . getClass ( ) == String [ ] . class ) { splitList = Arrays . asList ( ( String [ ] ) value ) ; } else { return false ; } Set < String > resolvedValueSet = null ; // not a String field if ( field . getType ( ) . isAssignableFrom ( Set . class ) ) { HashSet < String > strings = new HashSet < > ( ) ; strings . addAll ( splitList ) ; resolvedValueSet = strings ; resolvedValue = strings ; } else if ( field . getType ( ) . isAssignableFrom ( List . class ) ) { ArrayList < String > strings = new ArrayList < > ( ) ; strings . addAll ( splitList ) ; resolvedValueSet = new HashSet < > ( strings ) ; resolvedValue = strings ; } else if ( field . getType ( ) == String [ ] . class ) { ArrayList < String > strings = new ArrayList < > ( ) ; strings . addAll ( splitList ) ; resolvedValueSet = new HashSet < > ( strings ) ; resolvedValue = strings . toArray ( new String [ strings . size ( ) ] ) ; } else if ( field . getType ( ) == String . class ) { resolvedValueSet = new HashSet < > ( ) ; resolvedValueSet . addAll ( splitList ) ; resolvedValue = value ; } else { return false ; } if ( property . getSelectValues ( ) != null && ! property . getSelectValues ( ) . containsAll ( resolvedValueSet ) ) { throw new RuntimeException ( String . format ( "Some options values were not allowed for property %s: %s" , property . getName ( ) , resolvedValue ) ) ; } } else if ( type == Property . Type . String || type == Property . Type . FreeSelect ) { if ( value instanceof String ) { resolvedValue = value ; } else { // XXX return false ; } } else if ( type == Property . Type . Select ) { if ( value instanceof String ) { resolvedValue = value ; if ( ! field . getAnnotation ( SelectValues . class ) . dynamicValues ( ) && ! property . getSelectValues ( ) . contains ( ( String ) resolvedValue ) ) { throw new RuntimeException ( "value not allowed for property " + property . getName ( ) + ": " + resolvedValue ) ; } } else { // XXX return false ; } } else { // XXX return false ; } try { setFieldValue ( field , resolvedValue , object ) ; } catch ( IllegalAccessException e ) { throw new RuntimeException ( "Unable to configure plugin: " + e . getMessage ( ) , e ) ; } return true ;
public class OptimizationRequestHandler { /** * Number of equalities . */ protected final int getMeq ( ) { } }
if ( meq < 0 ) { meq = ( this . request . getA ( ) == null ) ? 0 : this . request . getA ( ) . rows ( ) ; } return meq ;
public class GeometrySerializer { /** * This method will return , for each of its dimension , the lowest value followed by its highest value . * Suppose the dimension is 3 ( eg xyz ) , the method will return [ xmin , xmax , ymin , ymax , zmin , zmax ] in that order . * < br > * Since the presence of boundingbox coordinates is not required by the specification , the subclass may decide * whether or not the information is to be included . If this method returns null , the bbox information will not be * part of the final geojson representation . * @ param jgen the jsongenerator used for the geojson construction * @ param shape the geometry for which the bbox coordinates must be retrieved * @ param provider provider to retrieve other serializers ( for recursion ) * @ return boundingbox coordinates of this geojson or null if none are to be specified * @ throws JsonMappingException If for some reason a provider could not be found * ( recursion ) */ protected double [ ] getBboxCoordinates ( JsonGenerator jgen , T shape , SerializerProvider provider ) throws JsonMappingException { } }
return envelopeToCoordinates ( shape . getEnvelope ( ) ) ;
public class MolaDbClient { /** * The < i > GetItem < / i > operation returns a set of attributes for the item * with the given primary key . If there is no matching item , * < i > GetItem < / i > does not return any data . * < i > GetItem < / i > provides an eventually consistent read by default . If * your application requires a strongly consistent read , set * < i > ConsistentRead < / i > to < code > true < / code > . Although a strongly * consistent read might take more time than an eventually consistent * read , it always returns the last updated value . * @ param request Container for the necessary parameters to execute the * GetItem request . * @ return The responseContent from the GetItem service method , as returned by * Moladb . * @ throws BceClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the responseContent . For example * if a network connection is not available . * @ throws BceServiceException * If an error responseContent is returned by Moladb indicating * either a problem with the data in the request , or a server side issue . */ public GetItemResponse getItem ( GetItemRequest request ) throws BceClientException , BceServiceException { } }
checkNotNull ( request , "request should not be null." ) ; HttpMethodName method = HttpMethodName . GET ; InternalRequest httpRequest = createRequestUnderInstance ( method , MolaDbConstants . URI_TABLE , request . getTableName ( ) , MolaDbConstants . URI_ITEM ) ; buildGetItemRequest ( httpRequest , request ) ; GetItemResponse ret = this . invokeHttpClient ( httpRequest , GetItemResponse . class ) ; return ret ;
public class AsciiSet { /** * Returns a set that matches ascii control characters . */ public static AsciiSet control ( ) { } }
final boolean [ ] members = new boolean [ 128 ] ; for ( char c = 0 ; c < members . length ; ++ c ) { members [ c ] = Character . isISOControl ( c ) ; } return new AsciiSet ( members ) ;
public class XMLWikiPrinter { /** * Convert provided table into { @ link Attributes } to use in xml writer . */ private Attributes createAttributes ( String [ ] [ ] parameters ) { } }
AttributesImpl attributes = new AttributesImpl ( ) ; if ( parameters != null && parameters . length > 0 ) { for ( String [ ] entry : parameters ) { attributes . addAttribute ( null , null , entry [ 0 ] , null , entry [ 1 ] ) ; } } return attributes ;
public class TimeZoneFormat { /** * Returns a < code > TimeZone < / code > for the given text . * < b > Note < / b > : The behavior of this method is equivalent to { @ link # parse ( String , ParsePosition ) } . * @ param text the time zone string * @ return A < code > TimeZone < / code > . * @ throws ParseException when the input could not be parsed as a time zone string . * @ see # parse ( String , ParsePosition ) */ public final TimeZone parse ( String text ) throws ParseException { } }
ParsePosition pos = new ParsePosition ( 0 ) ; TimeZone tz = parse ( text , pos ) ; if ( pos . getErrorIndex ( ) >= 0 ) { throw new ParseException ( "Unparseable time zone: \"" + text + "\"" , 0 ) ; } assert ( tz != null ) ; return tz ;
public class ActivityUtils { /** * Returns the current { @ code Activity } . * @ param shouldSleepFirst whether to sleep a default pause first * @ param waitForActivity whether to wait for the activity * @ return the current { @ code Activity } */ public Activity getCurrentActivity ( boolean shouldSleepFirst , boolean waitForActivity ) { } }
if ( shouldSleepFirst ) { sleeper . sleep ( ) ; } if ( ! config . trackActivities ) { return activity ; } if ( waitForActivity ) { waitForActivityIfNotAvailable ( ) ; } if ( ! activityStack . isEmpty ( ) ) { activity = activityStack . peek ( ) . get ( ) ; } return activity ;
public class SSLComponent { /** * DS method to activate this component . * @ param context * @ param properties */ @ Activate protected synchronized void activate ( ComponentContext ctx , Map < String , Object > properties ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Activated: " + properties ) ; } Set < String > installedFeatures = provisionerService . getInstalledFeatures ( ) ; if ( installedFeatures . contains ( "transportSecurity-1.0" ) ) { transportSecurityEnabled = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "transportSecurityEnable installed" ) ; } } else { transportSecurityEnabled = false ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "transportSecurityEnable is not installed" ) ; } } super . activate ( MY_ALIAS , properties ) ; this . componentContext = ( ExtComponentContext ) ctx ; processConfig ( true ) ;
public class LongStreamEx { /** * Returns the maximum element of this stream according to the provided key * extractor function . * This is a terminal operation . * @ param keyExtractor a non - interfering , stateless function * @ return an { @ code OptionalLong } describing the first element of this * stream for which the highest value was returned by key extractor , * or an empty { @ code OptionalLong } if the stream is empty * @ since 0.1.2 */ public OptionalLong maxByDouble ( LongToDoubleFunction keyExtractor ) { } }
return collect ( PrimitiveBox :: new , ( box , l ) -> { double key = keyExtractor . applyAsDouble ( l ) ; if ( ! box . b || Double . compare ( box . d , key ) < 0 ) { box . b = true ; box . d = key ; box . l = l ; } } , PrimitiveBox . MAX_DOUBLE ) . asLong ( ) ;
public class ColumnFamilyMetrics { /** * Creates a counter that will also have a global counter thats the sum of all counters across * different column families */ protected Counter createColumnFamilyCounter ( final String name ) { } }
Counter cfCounter = Metrics . newCounter ( factory . createMetricName ( name ) ) ; if ( register ( name , cfCounter ) ) { Metrics . newGauge ( globalNameFactory . createMetricName ( name ) , new Gauge < Long > ( ) { public Long value ( ) { long total = 0 ; for ( Metric cfGauge : allColumnFamilyMetrics . get ( name ) ) { total += ( ( Counter ) cfGauge ) . count ( ) ; } return total ; } } ) ; } return cfCounter ;
public class StatFsHelper { /** * Gets the information about the free storage space , including reserved blocks , * either internal or external depends on the given input * @ param storageType Internal or external storage type * @ return available space in bytes , - 1 if no information is available */ @ SuppressLint ( "DeprecatedMethod" ) public long getFreeStorageSpace ( StorageType storageType ) { } }
ensureInitialized ( ) ; maybeUpdateStats ( ) ; StatFs statFS = storageType == StorageType . INTERNAL ? mInternalStatFs : mExternalStatFs ; if ( statFS != null ) { long blockSize , availableBlocks ; if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . JELLY_BEAN_MR2 ) { blockSize = statFS . getBlockSizeLong ( ) ; availableBlocks = statFS . getFreeBlocksLong ( ) ; } else { blockSize = statFS . getBlockSize ( ) ; availableBlocks = statFS . getFreeBlocks ( ) ; } return blockSize * availableBlocks ; } return - 1 ;
public class CPFriendlyURLEntryPersistenceImpl { /** * Clears the cache for the cp friendly url entry . * The { @ link EntityCache } and { @ link FinderCache } are both cleared by this method . */ @ Override public void clearCache ( CPFriendlyURLEntry cpFriendlyURLEntry ) { } }
entityCache . removeResult ( CPFriendlyURLEntryModelImpl . ENTITY_CACHE_ENABLED , CPFriendlyURLEntryImpl . class , cpFriendlyURLEntry . getPrimaryKey ( ) ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITH_PAGINATION ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION ) ; clearUniqueFindersCache ( ( CPFriendlyURLEntryModelImpl ) cpFriendlyURLEntry , true ) ;
public class LogTable { /** * Update this record ( Always called from the record class ) . * @ exception DBException File exception . */ public void set ( Rec fieldList ) throws DBException { } }
super . set ( fieldList ) ; this . logTrx ( ( FieldList ) fieldList , ProxyConstants . SET ) ;
public class OCommandExecutorSQLAlterProperty { /** * Execute the ALTER PROPERTY . */ public Object execute ( final Map < Object , Object > iArgs ) { } }
if ( attribute == null ) throw new OCommandExecutionException ( "Cannot execute the command because it has not yet been parsed" ) ; final OClassImpl sourceClass = ( OClassImpl ) getDatabase ( ) . getMetadata ( ) . getSchema ( ) . getClass ( className ) ; if ( sourceClass == null ) throw new OCommandExecutionException ( "Source class '" + className + "' not found" ) ; final OPropertyImpl prop = ( OPropertyImpl ) sourceClass . getProperty ( fieldName ) ; if ( prop == null ) throw new OCommandExecutionException ( "Property '" + className + "." + fieldName + "' not exists" ) ; prop . setInternalAndSave ( attribute , value ) ; return null ;
public class CMAClient { /** * Configures CMA core endpoint . */ private Retrofit . Builder setEndpoint ( Retrofit . Builder retrofitBuilder , String endpoint ) { } }
if ( endpoint != null ) { return retrofitBuilder . baseUrl ( endpoint ) ; } return retrofitBuilder ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcRelConnectsPorts ( ) { } }
if ( ifcRelConnectsPortsEClass == null ) { ifcRelConnectsPortsEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 460 ) ; } return ifcRelConnectsPortsEClass ;
public class ContactsInterface { /** * Get the collection of public contacts for the specified user ID . * This method does not require authentication . * @ param userId * The user ID * @ return The Collection of Contact objects * @ throws FlickrException */ public Collection < Contact > getPublicList ( String userId ) throws FlickrException { } }
List < Contact > contacts = new ArrayList < Contact > ( ) ; Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_PUBLIC_LIST ) ; parameters . put ( "user_id" , userId ) ; Response response = transportAPI . get ( transportAPI . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { throw new FlickrException ( response . getErrorCode ( ) , response . getErrorMessage ( ) ) ; } Element contactsElement = response . getPayload ( ) ; NodeList contactNodes = contactsElement . getElementsByTagName ( "contact" ) ; for ( int i = 0 ; i < contactNodes . getLength ( ) ; i ++ ) { Element contactElement = ( Element ) contactNodes . item ( i ) ; Contact contact = new Contact ( ) ; contact . setId ( contactElement . getAttribute ( "nsid" ) ) ; contact . setUsername ( contactElement . getAttribute ( "username" ) ) ; contact . setIgnored ( "1" . equals ( contactElement . getAttribute ( "ignored" ) ) ) ; contact . setOnline ( OnlineStatus . fromType ( contactElement . getAttribute ( "online" ) ) ) ; contact . setIconFarm ( contactElement . getAttribute ( "iconfarm" ) ) ; contact . setIconServer ( contactElement . getAttribute ( "iconserver" ) ) ; if ( contact . getOnline ( ) == OnlineStatus . AWAY ) { contactElement . normalize ( ) ; contact . setAwayMessage ( XMLUtilities . getValue ( contactElement ) ) ; } contacts . add ( contact ) ; } return contacts ;
public class Assistant { /** * Create intent . * Create a new intent . * This operation is limited to 2000 requests per 30 minutes . For more information , see * * Rate limiting * * . * @ param createIntentOptions the { @ link CreateIntentOptions } containing the options for the call * @ return a { @ link ServiceCall } with a response type of { @ link Intent } */ public ServiceCall < Intent > createIntent ( CreateIntentOptions createIntentOptions ) { } }
Validator . notNull ( createIntentOptions , "createIntentOptions cannot be null" ) ; String [ ] pathSegments = { "v1/workspaces" , "intents" } ; String [ ] pathParameters = { createIntentOptions . workspaceId ( ) } ; RequestBuilder builder = RequestBuilder . post ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) , pathSegments , pathParameters ) ) ; builder . query ( "version" , versionDate ) ; Map < String , String > sdkHeaders = SdkCommon . getSdkHeaders ( "conversation" , "v1" , "createIntent" ) ; for ( Entry < String , String > header : sdkHeaders . entrySet ( ) ) { builder . header ( header . getKey ( ) , header . getValue ( ) ) ; } builder . header ( "Accept" , "application/json" ) ; final JsonObject contentJson = new JsonObject ( ) ; contentJson . addProperty ( "intent" , createIntentOptions . intent ( ) ) ; if ( createIntentOptions . description ( ) != null ) { contentJson . addProperty ( "description" , createIntentOptions . description ( ) ) ; } if ( createIntentOptions . examples ( ) != null ) { contentJson . add ( "examples" , GsonSingleton . getGson ( ) . toJsonTree ( createIntentOptions . examples ( ) ) ) ; } builder . bodyJson ( contentJson ) ; return createServiceCall ( builder . build ( ) , ResponseConverterUtils . getObject ( Intent . class ) ) ;
public class CacheAwareServlet { /** * Check if the if - modified - since condition is satisfied . * @ param request * The servlet request we are processing * @ param response * The servlet response we are creating * @ param resourceAttributes * File object * @ return boolean true if the resource meets the specified condition , and * false if the condition is not satisfied , in which case request * processing is stopped */ protected boolean checkIfModifiedSince ( final HttpServletRequest request , final HttpServletResponse response , final Attributes resourceAttributes ) { } }
try { final long headerValue = request . getDateHeader ( "If-Modified-Since" ) ; final long lastModified = resourceAttributes . getLastModified ( ) ; if ( headerValue != - 1 ) { // If an If - None - Match header has been specified , if modified // since // is ignored . if ( ( request . getHeader ( "If-None-Match" ) == null ) && ( lastModified < headerValue + 1000 ) ) { // The entity has not been modified since the date // specified by the client . This is not an error case . response . setStatus ( HttpServletResponse . SC_NOT_MODIFIED ) ; response . setHeader ( "ETag" , resourceAttributes . getETag ( ) ) ; return false ; } } } catch ( final IllegalArgumentException illegalArgument ) { return true ; } return true ;
public class ObjectOutputStream { /** * Dumps the parameter { @ code obj } only if it is { @ code null } * or an object that has already been dumped previously . * @ param obj * Object to check if an instance previously dumped by this * stream . * @ return - 1 if it is an instance which has not been dumped yet ( and this * method does nothing ) . The handle if { @ code obj } is an * instance which has been dumped already . * @ throws IOException * If an error occurs attempting to save { @ code null } or * a cyclic reference . */ private int dumpCycle ( Object obj ) throws IOException { } }
// If the object has been saved already , save its handle only int handle = objectsWritten . get ( obj ) ; if ( handle != - 1 ) { writeCyclicReference ( handle ) ; return handle ; } return - 1 ;
public class TypeOfAddress { /** * Creates a TypeOfAddress from a GSM - encoded type of address byte . * @ return */ public static TypeOfAddress valueOf ( byte b ) { } }
// bits 0-3 are the ton ( shift over 0 , then only the first 4 bits ) int ton = ( b & 0x0F ) ; // bits 4-7 are the npi ( shift over 4 , then only the first 3 bits ) int npi = ( ( b >> 4 ) & 0x07 ) ; // create our type of address now return new TypeOfAddress ( Ton . fromInt ( ton ) , Npi . fromInt ( npi ) ) ;
public class InventoryTargeting { /** * Sets the targetedAdUnits value for this InventoryTargeting . * @ param targetedAdUnits * A list of targeted { @ link AdUnitTargeting } . */ public void setTargetedAdUnits ( com . google . api . ads . admanager . axis . v201808 . AdUnitTargeting [ ] targetedAdUnits ) { } }
this . targetedAdUnits = targetedAdUnits ;
public class AppServiceEnvironmentsInner { /** * List all currently running operations on the App Service Environment . * List all currently running operations on the App Service Environment . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param name Name of the App Service Environment . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the List & lt ; OperationInner & gt ; object */ public Observable < ServiceResponse < List < OperationInner > > > listOperationsWithServiceResponseAsync ( String resourceGroupName , String name ) { } }
if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( name == null ) { throw new IllegalArgumentException ( "Parameter name is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null." ) ; } return service . listOperations ( resourceGroupName , name , this . client . subscriptionId ( ) , this . client . apiVersion ( ) , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < List < OperationInner > > > > ( ) { @ Override public Observable < ServiceResponse < List < OperationInner > > > call ( Response < ResponseBody > response ) { try { ServiceResponse < List < OperationInner > > clientResponse = listOperationsDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class RunsInner { /** * Gets the detailed information for a given run . * @ param resourceGroupName The name of the resource group to which the container registry belongs . * @ param registryName The name of the container registry . * @ param runId The run ID . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the RunInner object */ public Observable < RunInner > getAsync ( String resourceGroupName , String registryName , String runId ) { } }
return getWithServiceResponseAsync ( resourceGroupName , registryName , runId ) . map ( new Func1 < ServiceResponse < RunInner > , RunInner > ( ) { @ Override public RunInner call ( ServiceResponse < RunInner > response ) { return response . body ( ) ; } } ) ;
public class JCellCalendarButton { /** * Creates new CalendarButton . * @ param strDateParam The name of the date property ( defaults to " date " ) . * @ param dateTarget The initial date for this button . * @ param strLanguage The language to use . */ public void init ( Convert converter ) { } }
m_converter = converter ; Date dateTarget = ( Date ) m_converter . getData ( ) ; String strLanguage = null ; super . init ( JCalendarPopup . DATE_PARAM , dateTarget , strLanguage ) ;
public class RedisClusterClient { /** * Returns { @ literal true } if { @ link ClusterTopologyRefreshOptions # useDynamicRefreshSources ( ) dynamic refresh sources } are * enabled . * Subclasses of { @ link RedisClusterClient } may override that method . * @ return { @ literal true } if dynamic refresh sources are used . * @ see ClusterTopologyRefreshOptions # useDynamicRefreshSources ( ) */ protected boolean useDynamicRefreshSources ( ) { } }
if ( getClusterClientOptions ( ) != null ) { ClusterTopologyRefreshOptions topologyRefreshOptions = getClusterClientOptions ( ) . getTopologyRefreshOptions ( ) ; return topologyRefreshOptions . useDynamicRefreshSources ( ) ; } return true ;
public class FrameworkManager { /** * Register core services and perform initial provisioning . * Separate method to allow test to avoid / swap out the behavior . */ @ FFDCIgnore ( { } }
InvalidBundleContextException . class , LaunchException . class } ) protected void innerLaunchFramework ( boolean isClient ) { try { // Register services registerInstrumentationService ( systemBundleCtx ) ; registerLibertyProcessService ( systemBundleCtx , config ) ; preRegisterMBeanServerPipelineService ( systemBundleCtx ) ; openThreadIdentityTracker ( systemBundleCtx ) ; registerPauseableComponentController ( systemBundleCtx ) ; // Initialize the repo registry : we can use caches AND logging for messages BundleRepositoryRegistry . initializeDefaults ( config . getProcessName ( ) , true , isClient ) ; Provisioner provisioner = new ProvisionerImpl ( ) ; provisioner . initialProvisioning ( systemBundleCtx , config ) ; // All of our kernel provisioning activities are complete ! config . getKernelResolver ( ) . dispose ( ) ; } catch ( LaunchException le ) { // this is one of ours , no need to wrap again , just rethrow throw le ; } catch ( InvalidBundleContextException e ) { // no - op : the framework was shutdown while bundles were being // installed - - things should stop gracefully w / no ugly error // messages . }
public class AbstractDataStore { /** * ( non - Javadoc ) * @ see net . timewalker . ffmq4 . utils . store . LinkedDataStore # isLocked ( int ) */ @ Override public final boolean isLocked ( int handle ) throws DataStoreException { } }
if ( SAFE_MODE ) checkHandle ( handle ) ; return locks . get ( handle ) ;
public class OSecurityHelper { /** * Check that all required permissions present for specified { @ link OClass } * @ param oClass { @ link OClass } to check security rights for * @ param permissions { @ link OrientPermission } s to check * @ return true of all permissions are allowable */ public static boolean isAllowed ( OClass oClass , OrientPermission ... permissions ) { } }
return isAllowed ( ORule . ResourceGeneric . CLASS , oClass . getName ( ) , permissions ) ;
public class DocTreeScanner { /** * { @ inheritDoc } This implementation scans the children in left to right order . * @ param node { @ inheritDoc } * @ param p { @ inheritDoc } * @ return the result of scanning */ @ Override public R visitThrows ( ThrowsTree node , P p ) { } }
R r = scan ( node . getExceptionName ( ) , p ) ; r = scanAndReduce ( node . getDescription ( ) , p , r ) ; return r ;
public class DateTimeFormatterBuilder { /** * Appends all the elements of a formatter to the builder . * This method has the same effect as appending each of the constituent * parts of the formatter directly to this builder . * @ param formatter the formatter to add , not null * @ return this , for chaining , not null */ public DateTimeFormatterBuilder append ( DateTimeFormatter formatter ) { } }
Jdk8Methods . requireNonNull ( formatter , "formatter" ) ; appendInternal ( formatter . toPrinterParser ( false ) ) ; return this ;
public class DoubleTuples { /** * Returns the harmonic mean of the given tuple * @ param t The input tuple * @ return The mean */ public static double harmonicMean ( DoubleTuple t ) { } }
double s = DoubleTupleFunctions . reduce ( t , 0.0 , ( a , b ) -> ( a + ( 1.0 / b ) ) ) ; return t . getSize ( ) / s ;
public class DynamicMatrix { /** * Checks if the given col - key is already known and optionally generates a new key mapping . < br > * @ param key Col - value of indexing type */ protected void ensureColKey ( E key ) { } }
if ( ! colKeys . containsKey ( key ) ) { colKeys . put ( key , colKeys . size ( ) ) ; addCol ( ) ; }
public class AbstractRequestContext { /** * Resolves an IdMessage into an SimpleProxyId . */ SimpleProxyId < BaseProxy > getId ( final IdMessage op ) { } }
if ( Strength . SYNTHETIC . equals ( op . getStrength ( ) ) ) { return this . allocateSyntheticId ( op . getTypeToken ( ) , op . getSyntheticId ( ) ) ; } return this . state . requestFactory . getId ( op . getTypeToken ( ) , op . getServerId ( ) , op . getClientId ( ) ) ;
public class DisassociateServiceActionFromProvisioningArtifactRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DisassociateServiceActionFromProvisioningArtifactRequest disassociateServiceActionFromProvisioningArtifactRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( disassociateServiceActionFromProvisioningArtifactRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( disassociateServiceActionFromProvisioningArtifactRequest . getProductId ( ) , PRODUCTID_BINDING ) ; protocolMarshaller . marshall ( disassociateServiceActionFromProvisioningArtifactRequest . getProvisioningArtifactId ( ) , PROVISIONINGARTIFACTID_BINDING ) ; protocolMarshaller . marshall ( disassociateServiceActionFromProvisioningArtifactRequest . getServiceActionId ( ) , SERVICEACTIONID_BINDING ) ; protocolMarshaller . marshall ( disassociateServiceActionFromProvisioningArtifactRequest . getAcceptLanguage ( ) , ACCEPTLANGUAGE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class AppConfiguration { /** * config local cache setting . * @ param imFileDir * @ param docDir * @ param fileDir * @ param queryResultDir * @ param commandDir * @ param analyticsDir * @ param setting */ public static void configCacheSettings ( String imFileDir , String docDir , String fileDir , String queryResultDir , String commandDir , String analyticsDir , SystemSetting setting ) { } }
importantFileDir = imFileDir ; if ( ! importantFileDir . endsWith ( "/" ) ) { importantFileDir += "/" ; } documentDir = docDir ; if ( ! documentDir . endsWith ( "/" ) ) { documentDir += "/" ; } fileCacheDir = fileDir ; if ( ! fileCacheDir . endsWith ( "/" ) ) { fileCacheDir += "/" ; } queryResultCacheDir = queryResultDir ; if ( ! queryResultCacheDir . endsWith ( "/" ) ) { queryResultCacheDir += "/" ; } commandCacheDir = commandDir ; if ( ! commandCacheDir . endsWith ( "/" ) ) { commandCacheDir += "/" ; } analyticsCacheDir = analyticsDir ; if ( ! analyticsCacheDir . endsWith ( "/" ) ) { analyticsCacheDir += "/" ; } makeSureCacheDirWorkable ( ) ; defaultSetting = setting ;
public class XSwitchExpressions { /** * Determine whether the given switch expression is valid for Java version 6 or lower . */ public boolean isJavaSwitchExpression ( final XSwitchExpression it ) { } }
boolean _xblockexpression = false ; { final LightweightTypeReference switchType = this . getSwitchVariableType ( it ) ; if ( ( switchType == null ) ) { return false ; } boolean _isSubtypeOf = switchType . isSubtypeOf ( Integer . TYPE ) ; if ( _isSubtypeOf ) { return true ; } boolean _isSubtypeOf_1 = switchType . isSubtypeOf ( Enum . class ) ; if ( _isSubtypeOf_1 ) { return true ; } _xblockexpression = false ; } return _xblockexpression ;
public class StateIdsBuilder { /** * Appends the specified state token and a zero - based document index range to this instance , returning { @ code this } . * @ param stateToken The state token to append * @ param start The start index of the range * @ param end The end index of the range * @ return { @ code this } */ @ Override public StateIdsBuilder append ( final String stateToken , final int start , final int end ) { } }
return doAppend ( Collections . singletonList ( new StateId ( stateToken , start , end ) ) ) ;
public class EldaRouterRestletSupport { /** * Create a new Router initialised with the configs appropriate to the * contextPath . */ public static Router createRouterFor ( ServletContext con ) { } }
String contextName = EldaRouterRestletSupport . flatContextPath ( con . getContextPath ( ) ) ; List < PrefixAndFilename > pfs = prefixAndFilenames ( con , contextName ) ; Router result = new DefaultRouter ( ) ; String baseFilePath = ServletUtils . withTrailingSlash ( con . getRealPath ( "/" ) ) ; AuthMap am = AuthMap . loadAuthMap ( EldaFileManager . get ( ) , noNamesAndValues ) ; ModelLoader modelLoader = new APIModelLoader ( baseFilePath ) ; addBaseFilepath ( baseFilePath ) ; SpecManagerImpl sm = new SpecManagerImpl ( result , modelLoader ) ; SpecManagerFactory . set ( sm ) ; for ( PrefixAndFilename pf : pfs ) { loadOneConfigFile ( result , am , modelLoader , pf . prefixPath , pf . fileName ) ; } int count = result . countTemplates ( ) ; return count == 0 ? RouterFactory . getDefaultRouter ( ) : result ;
public class Utf8 { /** * Tells whether the given byte array slice is a well - formed , * malformed , or incomplete UTF - 8 byte sequence . The range of bytes * to be checked extends from index { @ code index } , inclusive , to * { @ code limit } , exclusive . * @ param state either { @ link Utf8 # COMPLETE } ( if this is the initial decoding * operation ) or the value returned from a call to a partial decoding method * for the previous bytes * @ return { @ link # MALFORMED } if the partial byte sequence is * definitely not well - formed , { @ link # COMPLETE } if it is well - formed * ( no additional input needed ) , or if the byte sequence is * " incomplete " , i . e . apparently terminated in the middle of a character , * an opaque integer " state " value containing enough information to * decode the character when passed to a subsequent invocation of a * partial decoding method . */ public static int partialIsValidUtf8 ( int state , byte [ ] bytes , int index , int limit ) { } }
if ( state != COMPLETE ) { // The previous decoding operation was incomplete ( or malformed ) . // We look for a well - formed sequence consisting of bytes from // the previous decoding operation ( stored in state ) together // with bytes from the array slice . // We expect such " straddler characters " to be rare . if ( index >= limit ) { // No bytes ? No progress . return state ; } int byte1 = ( byte ) state ; // byte1 is never ASCII . if ( byte1 < ( byte ) 0xE0 ) { // two - byte form // Simultaneously checks for illegal trailing - byte in // leading position and overlong 2 - byte form . if ( byte1 < ( byte ) 0xC2 || // byte2 trailing - byte test bytes [ index ++ ] > ( byte ) 0xBF ) { return MALFORMED ; } } else if ( byte1 < ( byte ) 0xF0 ) { // three - byte form // Get byte2 from saved state or array int byte2 = ( byte ) ~ ( state >> 8 ) ; if ( byte2 == 0 ) { byte2 = bytes [ index ++ ] ; if ( index >= limit ) { return incompleteStateFor ( byte1 , byte2 ) ; } } if ( byte2 > ( byte ) 0xBF || // overlong ? 5 most significant bits must not all be zero ( byte1 == ( byte ) 0xE0 && byte2 < ( byte ) 0xA0 ) || // illegal surrogate codepoint ? ( byte1 == ( byte ) 0xED && byte2 >= ( byte ) 0xA0 ) || // byte3 trailing - byte test bytes [ index ++ ] > ( byte ) 0xBF ) { return MALFORMED ; } } else { // four - byte form // Get byte2 and byte3 from saved state or array int byte2 = ( byte ) ~ ( state >> 8 ) ; int byte3 = 0 ; if ( byte2 == 0 ) { byte2 = bytes [ index ++ ] ; if ( index >= limit ) { return incompleteStateFor ( byte1 , byte2 ) ; } } else { byte3 = ( byte ) ( state >> 16 ) ; } if ( byte3 == 0 ) { byte3 = bytes [ index ++ ] ; if ( index >= limit ) { return incompleteStateFor ( byte1 , byte2 , byte3 ) ; } } // If we were called with state = = MALFORMED , then byte1 is 0xFF , // which never occurs in well - formed UTF - 8 , and so we will return // MALFORMED again below . if ( byte2 > ( byte ) 0xBF || // Check that 1 < = plane < = 16 . Tricky optimized form of : // if ( byte1 > ( byte ) 0xF4 | | // byte1 = = ( byte ) 0xF0 & & byte2 < ( byte ) 0x90 | | // byte1 = = ( byte ) 0xF4 & & byte2 > ( byte ) 0x8F ) ( ( ( byte1 << 28 ) + ( byte2 - ( byte ) 0x90 ) ) >> 30 ) != 0 || // byte3 trailing - byte test byte3 > ( byte ) 0xBF || // byte4 trailing - byte test bytes [ index ++ ] > ( byte ) 0xBF ) { return MALFORMED ; } } } return partialIsValidUtf8 ( bytes , index , limit ) ;
public class Logger { /** * Log a warning message with a throwable . */ public void warn ( Throwable throwable , String msg , Object [ ] argArray ) { } }
logIfEnabled ( Level . WARNING , throwable , msg , UNKNOWN_ARG , UNKNOWN_ARG , UNKNOWN_ARG , argArray ) ;
public class JsMessageFactoryImpl { /** * ( non - Javadoc ) * @ see com . ibm . ws . sib . mfp . JsMessageFactory # createInboundWebMessage ( String ) */ public JsMessage createInboundWebMessage ( String data ) throws MessageDecodeFailedException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createInboundWebMessage" , data ) ; JsMessage message = WebJsMessageFactoryImpl . createInboundWebMessage ( data ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createInboundWebMessage" , message ) ; return message ;
public class TextInShEncoder { /** * Encodes a single character and returns its String representation * or null if no modification is necessary . Implemented as * < a href = " https : / / www . gnu . org / software / bash / manual / html _ node / ANSI _ 002dC - Quoting . html " > ANSI - C quoting < / a > . * The only character not supported is NULL ( \ x00 ) . * @ see ShValidator # checkCharacter ( char ) * @ throws IOException if any text character cannot be converted for use in a shell script */ private static String getEscapedCharacter ( char c ) throws IOException { } }
switch ( c ) { case '\\' : return "\\\\" ; case '\'' : return "\\'" ; case '"' : return "\\\"" ; case '?' : return "\\?" ; } if ( ( c >= 0x20 && c <= 0x7E ) // common case first || ( c >= 0xA0 && c <= 0xFFFD ) ) return null ; // 01 to 1F - control characters if ( c >= 0x01 && c <= 0x1F ) return LOW_CONTROL [ c - 0x01 ] ; // 7F to 9F - control characters if ( c >= 0x7F && c <= 0x9F ) return HIGH_CONTROL [ c - 0x7F ] ; if ( c == 0xFFFE ) return "\\uFFFE" ; if ( c == 0xFFFF ) return "\\uFFFF" ; assert c == 0 : "The only character not supported is NULL (\\x00), got " + Integer . toHexString ( c ) ; throw new IOException ( ApplicationResources . accessor . getMessage ( "ShValidator.invalidCharacter" , Integer . toHexString ( c ) ) ) ;
public class PortletAppTypeImpl { /** * If not already created , a new < code > portlet < / code > element will be created and returned . * Otherwise , the first existing < code > portlet < / code > element will be returned . * @ return the instance defined for the element < code > portlet < / code > */ public PortletType < PortletAppType < T > > getOrCreatePortlet ( ) { } }
List < Node > nodeList = childNode . get ( "portlet" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new PortletTypeImpl < PortletAppType < T > > ( this , "portlet" , childNode , nodeList . get ( 0 ) ) ; } return createPortlet ( ) ;
public class EipClient { /** * The method to generate a default Billing with default Reservation which default ReservationLength is 1. * @ return The Billing object with default Reservation which default ReservationLength is 1 */ private Billing generateDefaultReservation ( ) { } }
Billing billing = new Billing ( ) ; Billing . Reservation reservation = new Billing . Reservation ( ) ; billing . setReservation ( reservation ) ; reservation . setReservationLength ( 1 ) ; return billing ;
public class ApiOvhDedicatedCloud { /** * Get this object properties * REST : GET / dedicatedCloud / { serviceName } / datacenter / { datacenterId } / vm / { vmId } * @ param serviceName [ required ] Domain of the service * @ param datacenterId [ required ] * @ param vmId [ required ] Id of the virtual machine . * API beta */ public OvhVm serviceName_datacenter_datacenterId_vm_vmId_GET ( String serviceName , Long datacenterId , Long vmId ) throws IOException { } }
String qPath = "/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}" ; StringBuilder sb = path ( qPath , serviceName , datacenterId , vmId ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhVm . class ) ;
public class AbstractBeanDefinition { /** * Obtains a bean definition for the field at the given index and the argument at the given index * Warning : this method is used by internal generated code and should not be called by user code . * @ param resolutionContext The resolution context * @ param context The context * @ param injectionPoint The field injection point * @ return The resolved bean */ @ SuppressWarnings ( "WeakerAccess" ) @ Internal protected final Provider getBeanProviderForField ( BeanResolutionContext resolutionContext , BeanContext context , FieldInjectionPoint injectionPoint ) { } }
return resolveBeanWithGenericsForField ( resolutionContext , injectionPoint , ( beanType , qualifier ) -> ( ( DefaultBeanContext ) context ) . getBeanProvider ( resolutionContext , beanType , qualifier ) ) ;
public class ServerSentEvents { /** * Creates a new Server - Sent Events stream from the specified { @ link Stream } . * @ param headers the HTTP headers supposed to send * @ param contentStream the { @ link Stream } which publishes the objects supposed to send as contents * @ param trailingHeaders the trailing HTTP headers supposed to send * @ param executor the executor which iterates the stream */ public static HttpResponse fromStream ( HttpHeaders headers , Stream < ? extends ServerSentEvent > contentStream , HttpHeaders trailingHeaders , Executor executor ) { } }
requireNonNull ( headers , "headers" ) ; requireNonNull ( contentStream , "contentStream" ) ; requireNonNull ( trailingHeaders , "trailingHeaders" ) ; requireNonNull ( executor , "executor" ) ; return streamingFrom ( contentStream , sanitizeHeaders ( headers ) , trailingHeaders , ServerSentEvents :: toHttpData , executor ) ;
public class TrieNode { /** * Gets debug token . * @ return the debug token */ public String getDebugToken ( ) { } }
char asChar = getChar ( ) ; if ( asChar == NodewalkerCodec . FALLBACK ) return "<STOP>" ; if ( asChar == NodewalkerCodec . END_OF_STRING ) return "<NULL>" ; if ( asChar == NodewalkerCodec . ESCAPE ) return "<ESC>" ; if ( asChar == '\\' ) return "\\\\" ; if ( asChar == '\n' ) return "\\n" ; return new String ( new char [ ] { asChar } ) ;
public class P2sVpnGatewaysInner { /** * Creates a virtual wan p2s vpn gateway if it doesn ' t exist else updates the existing gateway . * @ param resourceGroupName The resource group name of the P2SVpnGateway . * @ param gatewayName The name of the gateway . * @ param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable for the request */ public Observable < P2SVpnGatewayInner > createOrUpdateAsync ( String resourceGroupName , String gatewayName , P2SVpnGatewayInner p2SVpnGatewayParameters ) { } }
return createOrUpdateWithServiceResponseAsync ( resourceGroupName , gatewayName , p2SVpnGatewayParameters ) . map ( new Func1 < ServiceResponse < P2SVpnGatewayInner > , P2SVpnGatewayInner > ( ) { @ Override public P2SVpnGatewayInner call ( ServiceResponse < P2SVpnGatewayInner > response ) { return response . body ( ) ; } } ) ;
public class KuduDBClient { /** * Adds the predicates to scanner builder . * @ param scannerBuilder * the scanner builder * @ param embeddable * the embeddable * @ param fields * the fields * @ param metaModel * the meta model * @ param key * the key */ private void addPredicatesToScannerBuilder ( KuduScannerBuilder scannerBuilder , EmbeddableType embeddable , Field [ ] fields , MetamodelImpl metaModel , Object key ) { } }
for ( Field f : fields ) { if ( ! ReflectUtils . isTransientOrStatic ( f ) ) { Object value = PropertyAccessorHelper . getObject ( key , f ) ; if ( f . getType ( ) . isAnnotationPresent ( Embeddable . class ) ) { // nested addPredicatesToScannerBuilder ( scannerBuilder , ( EmbeddableType ) metaModel . embeddable ( f . getType ( ) ) , f . getType ( ) . getDeclaredFields ( ) , metaModel , value ) ; } else { Attribute attribute = embeddable . getAttribute ( f . getName ( ) ) ; Type type = KuduDBValidationClassMapper . getValidTypeForClass ( f . getType ( ) ) ; ColumnSchema column = new ColumnSchema . ColumnSchemaBuilder ( ( ( AbstractAttribute ) attribute ) . getJPAColumnName ( ) , type ) . build ( ) ; KuduPredicate predicate = KuduDBDataHandler . getEqualComparisonPredicate ( column , type , value ) ; scannerBuilder . addPredicate ( predicate ) ; } } }
public class BNFHeadersImpl { /** * Allocate a buffer according to the requested input size . * @ param size * @ return WsByteBuffer */ public WsByteBuffer allocateBuffer ( int size ) { } }
WsByteBufferPoolManager mgr = HttpDispatcher . getBufferManager ( ) ; WsByteBuffer wsbb = ( this . useDirectBuffer ) ? mgr . allocateDirect ( size ) : mgr . allocate ( size ) ; addToCreatedBuffer ( wsbb ) ; return wsbb ;
public class LockingLazyVar { /** * Clears the variable , forcing the next call to { @ link # get ( ) } to re - calculate * the value . */ public final T clear ( ) { } }
T hold ; _lock . lock ( ) ; try { hold = _val ; _val = null ; } finally { _lock . unlock ( ) ; } return hold ;
public class MoreMath { /** * Returns numerical integral between x1 and x2 * @ param x1 * @ param x2 * @ param points * @ return */ public static double integral ( DoubleUnaryOperator f , double x1 , double x2 , int points ) { } }
double delta = ( x2 - x1 ) / points ; double delta2 = delta / 2.0 ; double sum = 0 ; double y1 = f . applyAsDouble ( x1 ) ; double y2 ; for ( int ii = 1 ; ii <= points ; ii ++ ) { x1 += delta ; y2 = f . applyAsDouble ( x1 ) ; sum += ( y1 + y2 ) * delta2 ; y1 = y2 ; } return sum ;
public class JmsDestinationImpl { /** * This method should be called by all setter methods if they alter the state * information of this destination . Doing so will cause the string encoded version * of this destination to be recreated when necessary . */ private void clearCachedEncodings ( ) { } }
cachedEncodedString = null ; cachedPartialEncodedString = null ; for ( int i = 0 ; i < cachedEncoding . length ; i ++ ) cachedEncoding [ i ] = null ;
public class Constants { /** * Set urlPara separator . The default value is " - " * @ param urlParaSeparator the urlPara separator */ public void setUrlParaSeparator ( String urlParaSeparator ) { } }
if ( StrKit . isBlank ( urlParaSeparator ) || urlParaSeparator . contains ( "/" ) ) { throw new IllegalArgumentException ( "urlParaSepartor can not be blank and can not contains \"/\"" ) ; } this . urlParaSeparator = urlParaSeparator ;
public class CrsWktExtension { /** * Get the extension definition * @ param srsId * srs id * @ return definition */ public String getDefinition ( long srsId ) { } }
String definition = connection . querySingleTypedResult ( "SELECT " + COLUMN_NAME + " FROM " + SpatialReferenceSystem . TABLE_NAME + " WHERE " + SpatialReferenceSystem . COLUMN_SRS_ID + " = ?" , new String [ ] { String . valueOf ( srsId ) } ) ; return definition ;
public class HtmlDocletWriter { /** * According to * < cite > The Java & trade ; Language Specification < / cite > , * all the outer classes and static nested classes are core classes . */ public boolean isCoreClass ( TypeElement typeElement ) { } }
return utils . getEnclosingTypeElement ( typeElement ) == null || utils . isStatic ( typeElement ) ;
public class JavaReturnValueEvaluatorBuilder { /** * / * ( non - Javadoc ) * @ see org . drools . semantics . java . builder . ConsequenceBuilder # buildConsequence ( org . drools . semantics . java . builder . BuildContext , org . drools . semantics . java . builder . BuildUtils , RuleDescr ) */ public void build ( final PackageBuildContext context , final ReturnValueConstraintEvaluator constraintNode , final ReturnValueDescr descr , final ContextResolver contextResolver ) { } }
final String className = getClassName ( context ) ; AnalysisResult analysis = getAnalysis ( context , descr ) ; if ( analysis == null ) { // not possible to get the analysis results return ; } buildReturnValueEvaluator ( context , constraintNode , descr , contextResolver , className , analysis ) ;
public class Char { /** * Decodes all backslash characters in the string */ public static String decodeBackslash ( String s ) { } }
if ( s == null || s . indexOf ( '\\' ) == - 1 ) return ( s ) ; StringBuilder result = new StringBuilder ( ) ; int [ ] eatLength = new int [ 1 ] ; while ( s . length ( ) != 0 ) { char c = eatBackslash ( s , eatLength ) ; if ( eatLength [ 0 ] > 1 ) { result . append ( c ) ; s = s . substring ( eatLength [ 0 ] ) ; } else { result . append ( s . charAt ( 0 ) ) ; s = s . substring ( 1 ) ; } } return ( result . toString ( ) ) ;
public class ExposeLinearLayoutManagerEx { /** * Converts a focusDirection to orientation . * @ param focusDirection One of { @ link View # FOCUS _ UP } , { @ link View # FOCUS _ DOWN } , * { @ link View # FOCUS _ LEFT } , { @ link View # FOCUS _ RIGHT } , * { @ link View # FOCUS _ BACKWARD } , { @ link View # FOCUS _ FORWARD } * or 0 for not applicable * @ return { @ link LayoutState # LAYOUT _ START } or { @ link LayoutState # LAYOUT _ END } if focus direction * is applicable to current state , { @ link LayoutState # INVALID _ LAYOUT } otherwise . */ private int convertFocusDirectionToLayoutDirectionExpose ( int focusDirection ) { } }
int orientation = getOrientation ( ) ; switch ( focusDirection ) { case View . FOCUS_BACKWARD : return LayoutState . LAYOUT_START ; case View . FOCUS_FORWARD : return LayoutState . LAYOUT_END ; case View . FOCUS_UP : return orientation == VERTICAL ? LayoutState . LAYOUT_START : LayoutState . INVALID_LAYOUT ; case View . FOCUS_DOWN : return orientation == VERTICAL ? LayoutState . LAYOUT_END : LayoutState . INVALID_LAYOUT ; case View . FOCUS_LEFT : return orientation == HORIZONTAL ? LayoutState . LAYOUT_START : LayoutState . INVALID_LAYOUT ; case View . FOCUS_RIGHT : return orientation == HORIZONTAL ? LayoutState . LAYOUT_END : LayoutState . INVALID_LAYOUT ; default : if ( DEBUG ) { Log . d ( TAG , "Unknown focus request:" + focusDirection ) ; } return LayoutState . INVALID_LAYOUT ; }
public class GuildController { /** * Modifies the positional order of { @ link net . dv8tion . jda . core . entities . Category # getVoiceChannels ( ) Category # getVoiceChannels ( ) } * using an extension of { @ link net . dv8tion . jda . core . requests . restaction . order . ChannelOrderAction ChannelOrderAction } * specialized for ordering the nested { @ link net . dv8tion . jda . core . entities . VoiceChannel VoiceChannels } of this * { @ link net . dv8tion . jda . core . entities . Category Category } . * < br > Like { @ code ChannelOrderAction } , the returned { @ link net . dv8tion . jda . core . requests . restaction . order . CategoryOrderAction CategoryOrderAction } * can be used to move VoiceChannels { @ link net . dv8tion . jda . core . requests . restaction . order . OrderAction # moveUp ( int ) up } , * { @ link net . dv8tion . jda . core . requests . restaction . order . OrderAction # moveDown ( int ) down } , or * { @ link net . dv8tion . jda . core . requests . restaction . order . OrderAction # moveTo ( int ) to } a specific position . * < br > This uses < b > ascending < / b > order with a 0 based index . * < p > Possible { @ link net . dv8tion . jda . core . requests . ErrorResponse ErrorResponses } include : * < ul > * < li > { @ link net . dv8tion . jda . core . requests . ErrorResponse # UNKNOWN _ CHANNEL UNNKOWN _ CHANNEL } * < br > One of the channels has been deleted before the completion of the task . < / li > * < li > { @ link net . dv8tion . jda . core . requests . ErrorResponse # MISSING _ ACCESS MISSING _ ACCESS } * < br > The currently logged in account was removed from the Guild . < / li > * < / ul > * @ param category * The { @ link net . dv8tion . jda . core . entities . Category Category } to order * { @ link net . dv8tion . jda . core . entities . VoiceChannel VoiceChannels } from . * @ return { @ link net . dv8tion . jda . core . requests . restaction . order . CategoryOrderAction CategoryOrderAction } - Type : { @ link net . dv8tion . jda . core . entities . VoiceChannel VoiceChannels } */ @ CheckReturnValue public CategoryOrderAction < VoiceChannel > modifyVoiceChannelPositions ( Category category ) { } }
Checks . notNull ( category , "Category" ) ; checkGuild ( category . getGuild ( ) , "Category" ) ; return new CategoryOrderAction < > ( category , ChannelType . VOICE ) ;
public class RtmpClient { /** * Send a remote procedure call . * @ param endpoint The endpoint of the call * @ param service The service handling the call * @ param method The method to call * @ param args Optional args to the call * @ return The id of the callback * @ deprecated Due to method resolution ambiguities , this method is due to be removed within the next couple * of releases . Use the explicit { @ link # sendRpcWithEndpoint ( String , String , String , Object . . . ) } instead . */ @ Deprecated public int sendRpc ( String endpoint , String service , String method , Object ... args ) { } }
RemotingMessage message = createRemotingMessage ( endpoint , service , method , args ) ; Invoke invoke = createAmf3InvokeSkeleton ( null , message ) ; send ( invoke ) ; return invoke . getInvokeId ( ) ;
public class CSVConfig { /** * Return a Credentials object if either tenant or user is set ( or both ) . If neither * is set , null is returned . * @ return Credentials to use with Client or null if there are no credentials to set . */ public Credentials getCredentials ( ) { } }
if ( ! Utils . isEmpty ( tenant ) || ! Utils . isEmpty ( user ) ) { return new Credentials ( tenant , user , password ) ; } return null ;
public class BeanUtils { /** * 将sourceList中的对象与targetClass同名的字段从source中复制到targetClass的实例中 , 使用前请对参数进行非空校验 * @ param sourceList 被复制的源对象的数组 * @ param targetClass 要复制的目标对象的class对象 * @ param < S > 数组中数据的实际类型 * @ param < E > 目标对象的实际类型 * @ return targetClass的实例的数组 */ public static < E , S > List < E > copy ( List < S > sourceList , Class < E > targetClass ) { } }
if ( sourceList == null || sourceList . isEmpty ( ) ) { return Collections . emptyList ( ) ; } List < E > list = new ArrayList < > ( sourceList . size ( ) ) ; if ( ! ( sourceList instanceof ArrayList ) ) { sourceList = new ArrayList < > ( sourceList ) ; } for ( S source : sourceList ) { E e = copy ( source , targetClass ) ; if ( e != null ) { list . add ( e ) ; } } return list ;
public class RocksDBOperationUtils { /** * Creates a state info from a new meta info to use with a k / v state . * < p > Creates the column family for the state . * Sets TTL compaction filter if { @ code ttlCompactFiltersManager } is not { @ code null } . */ public static RocksDBKeyedStateBackend . RocksDbKvStateInfo createStateInfo ( RegisteredStateMetaInfoBase metaInfoBase , RocksDB db , Function < String , ColumnFamilyOptions > columnFamilyOptionsFactory , @ Nullable RocksDbTtlCompactFiltersManager ttlCompactFiltersManager ) { } }
ColumnFamilyDescriptor columnFamilyDescriptor = createColumnFamilyDescriptor ( metaInfoBase , columnFamilyOptionsFactory , ttlCompactFiltersManager ) ; return new RocksDBKeyedStateBackend . RocksDbKvStateInfo ( createColumnFamily ( columnFamilyDescriptor , db ) , metaInfoBase ) ;
public class StringObservable { /** * Splits the { @ link Observable } of Strings by line ending characters in a platform independent way . It is equivalent to * < pre > split ( src , " ( \ \ r \ \ n ) | \ \ n | \ \ r | \ \ u0085 | \ \ u2028 | \ \ u2029 " ) < / pre > * < img width = " 640 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / St . byLine . png " alt = " " > * @ param source * @ return the Observable conaining the split lines of the source * @ see StringObservable # split ( Observable , Pattern ) */ public static Observable < String > byLine ( Observable < String > source ) { } }
return split ( source , ByLinePatternHolder . BY_LINE ) ;
public class AbstractOpenPgpStore { /** * OpenPgpMetadataStore */ @ Override public Map < OpenPgpV4Fingerprint , Date > getAnnouncedFingerprintsOf ( BareJid contact ) throws IOException { } }
return metadataStore . getAnnouncedFingerprintsOf ( contact ) ;
public class GetRemoteAccessSessionRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetRemoteAccessSessionRequest getRemoteAccessSessionRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getRemoteAccessSessionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getRemoteAccessSessionRequest . getArn ( ) , ARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class SibRaEndpointInvokerImpl { /** * ( non - Javadoc ) * @ see com . ibm . ws . sib . ra . inbound . SibRaEndpointStrategy # getMdbMethod ( ) */ public Method getEndpointMethod ( ) throws ResourceAdapterInternalException { } }
final String methodName = "getEndpointMethod" ; if ( TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName ) ; } if ( ON_MESSAGE_METHOD == null ) { try { ON_MESSAGE_METHOD = SibRaMessageListener . class . getMethod ( "onMessage" , new Class [ ] { SIBusMessage . class , AbstractConsumerSession . class , SITransaction . class } ) ; } catch ( final Exception exception ) { FFDCFilter . processException ( exception , CLASS_NAME + "." + methodName , FFDC_PROBE_2 ) ; if ( TRACE . isEntryEnabled ( ) ) { SibTr . exception ( TRACE , exception ) ; } throw new ResourceAdapterInternalException ( NLS . getFormattedMessage ( "ON_MESSAGE_CWSIV0851" , new Object [ ] { exception } , null ) , exception ) ; } } if ( TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName , ON_MESSAGE_METHOD ) ; } return ON_MESSAGE_METHOD ;
public class ImportTerminologyRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ImportTerminologyRequest importTerminologyRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( importTerminologyRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( importTerminologyRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( importTerminologyRequest . getMergeStrategy ( ) , MERGESTRATEGY_BINDING ) ; protocolMarshaller . marshall ( importTerminologyRequest . getDescription ( ) , DESCRIPTION_BINDING ) ; protocolMarshaller . marshall ( importTerminologyRequest . getTerminologyData ( ) , TERMINOLOGYDATA_BINDING ) ; protocolMarshaller . marshall ( importTerminologyRequest . getEncryptionKey ( ) , ENCRYPTIONKEY_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class Futures { /** * Returns a { @ code Future } whose result is taken from the given primary { @ code input } or , if the * primary input fails with the given { @ code exceptionType } , from the result provided by the * { @ code fallback } . { @ link AsyncFunction # apply } is not invoked until the primary input has * failed , so if the primary input succeeds , it is never invoked . If , during the invocation of * { @ code fallback } , an exception is thrown , this exception is used as the result of the output * { @ code Future } . * < p > Usage examples : * < pre > { @ code * ListenableFuture < Integer > fetchCounterFuture = . . . ; * / / Falling back to a zero counter in case an exception happens when * / / processing the RPC to fetch counters . * ListenableFuture < Integer > faultTolerantFuture = Futures . catchingAsync ( * fetchCounterFuture , FetchException . class , * new AsyncFunction < FetchException , Integer > ( ) { * public ListenableFuture < Integer > apply ( FetchException e ) { * return immediateFuture ( 0 ) ; * } ) ; } < / pre > * < p > The fallback can also choose to propagate the original exception when desired : * < pre > { @ code * ListenableFuture < Integer > fetchCounterFuture = . . . ; * / / Falling back to a zero counter only in case the exception was a * / / TimeoutException . * ListenableFuture < Integer > faultTolerantFuture = Futures . catchingAsync ( * fetchCounterFuture , FetchException . class , * new AsyncFunction < FetchException , Integer > ( ) { * public ListenableFuture < Integer > apply ( FetchException e ) * throws FetchException { * if ( omitDataOnFetchFailure ) { * return immediateFuture ( 0 ) ; * throw e ; * } ) ; } < / pre > * < p > This overload , which does not accept an executor , uses { @ code directExecutor } , a dangerous * choice in some cases . See the discussion in the { @ link ListenableFuture # addListener * ListenableFuture . addListener } documentation . The documentation ' s warnings about " lightweight * listeners " refer here to the work done during { @ code AsyncFunction . apply } , not to any work done * to complete the returned { @ code Future } . * @ param input the primary input { @ code Future } * @ param exceptionType the exception type that triggers use of { @ code fallback } . The exception * type is matched against the input ' s exception . " The input ' s exception " means the cause of * the { @ link ExecutionException } thrown by { @ code input . get ( ) } or , if { @ code get ( ) } throws a * different kind of exception , that exception itself . To avoid hiding bugs and other * unrecoverable errors , callers should prefer more specific types , avoiding { @ code * Throwable . class } in particular . * @ param fallback the { @ link AsyncFunction } to be called if { @ code input } fails with the expected * exception type . The function ' s argument is the input ' s exception . " The input ' s exception " * means the cause of the { @ link ExecutionException } thrown by { @ code input . get ( ) } or , if * { @ code get ( ) } throws a different kind of exception , that exception itself . * @ since 19.0 ( similar functionality in 14.0 as { @ code withFallback } ) */ @ CanIgnoreReturnValue // TODO ( kak ) : @ CheckReturnValue @ Partially . GwtIncompatible ( "AVAILABLE but requires exceptionType to be Throwable.class" ) public static < V , X extends Throwable > ListenableFuture < V > catchingAsync ( ListenableFuture < ? extends V > input , Class < X > exceptionType , AsyncFunction < ? super X , ? extends V > fallback ) { } }
return AbstractCatchingFuture . create ( input , exceptionType , fallback ) ;
public class FileBuffer { /** * Allocates a file buffer with the given initial capacity . * If the underlying file is empty , the file count will expand dynamically as bytes are written to the file . * The underlying { @ link FileBytes } will be initialized to the nearest power of { @ code 2 } . * @ param file The file to allocate . * @ param initialCapacity The initial capacity of the bytes to allocate . * @ return The allocated buffer . * @ see FileBuffer # allocate ( java . io . File ) * @ see FileBuffer # allocate ( java . io . File , long , long ) * @ see FileBuffer # allocate ( java . io . File , String , long , long ) */ public static FileBuffer allocate ( File file , long initialCapacity ) { } }
return allocate ( file , FileBytes . DEFAULT_MODE , initialCapacity , Long . MAX_VALUE ) ;
public class JoinNode { /** * an inverted tree inverts the core relationship path , but leaves the dangling paths alone . * Legend : S = start , E = end , D = dangling ( existence ) clause , M = middle join ( e . g . many - to - many ) * S E * / becomes / * E S * S E * / becomes / * M M * E S * S E S * / becomes / \ Note : the initial tree in memory is really setup as : / * E S D but E has the isEndNode flag set on it E * D D * S E * / \ becomes / Note : again , the result tree has isEndNode set on the new S node . * E D S * S E * / becomes / * M M * E D S D */ public JoinNode invert ( ) { } }
List < JoinNode > toInvert = new ArrayList ( ) ; JoinNode cur = this ; while ( ! cur . isEndNode ) { toInvert . add ( cur ) ; cur = cur . getFurtherJoins ( ) . get ( 0 ) ; } // cur is now the ultimate end node JoinNode inverted = new JoinNode ( cur . left , true ) ; inverted . furtherJoins . addAll ( cur . furtherJoins ) ; JoinNode curInverted = inverted ; for ( int i = toInvert . size ( ) - 1 ; i >= 0 ; i -- ) { JoinNode nextToInvert = toInvert . get ( i ) ; JoinNode nextInverted = new JoinNode ( nextToInvert . left , false ) ; if ( nextToInvert . furtherJoins . size ( ) > 1 ) { nextInverted . furtherJoins . addAll ( nextToInvert . furtherJoins . subList ( 1 , nextToInvert . furtherJoins . size ( ) ) ) ; } nextInverted . parentJoin = cur . parentJoin . getReverseJoin ( ) ; curInverted . furtherJoins . add ( 0 , nextInverted ) ; curInverted = nextInverted ; cur = nextToInvert ; } curInverted . isEndNode = true ; return inverted ;
public class AbstractSelectableChannel { /** * Registers this channel with the given selector , returning a selection key . * < p > This method first verifies that this channel is open and that the * given initial interest set is valid . * < p > If this channel is already registered with the given selector then * the selection key representing that registration is returned after * setting its interest set to the given value . * < p > Otherwise this channel has not yet been registered with the given * selector , so the { @ link AbstractSelector # register register } method of * the selector is invoked while holding the appropriate locks . The * resulting key is added to this channel ' s key set before being returned . * @ throws ClosedSelectorException { @ inheritDoc } * @ throws IllegalBlockingModeException { @ inheritDoc } * @ throws IllegalSelectorException { @ inheritDoc } * @ throws CancelledKeyException { @ inheritDoc } * @ throws IllegalArgumentException { @ inheritDoc } */ public final SelectionKey register ( Selector sel , int ops , Object att ) throws ClosedChannelException { } }
synchronized ( regLock ) { if ( ! isOpen ( ) ) throw new ClosedChannelException ( ) ; if ( ( ops & ~ validOps ( ) ) != 0 ) throw new IllegalArgumentException ( ) ; if ( blocking ) throw new IllegalBlockingModeException ( ) ; SelectionKey k = findKey ( sel ) ; if ( k != null ) { k . interestOps ( ops ) ; k . attach ( att ) ; } if ( k == null ) { // New registration synchronized ( keyLock ) { if ( ! isOpen ( ) ) throw new ClosedChannelException ( ) ; k = ( ( AbstractSelector ) sel ) . register ( this , ops , att ) ; addKey ( k ) ; } } return k ; }