signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ServerJFapCommunicator { /** * Validates the conversation state by ensuring we have a local cache of it here in this class . */ private void validateConversationState ( ) { } }
if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "validateConversationState" ) ; if ( sConState == null ) { sConState = ( ConversationState ) getConversation ( ) . getAttachment ( ) ; if ( tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Using Client Conversation State:" , sConState ) ; } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "validateConversationState" ) ;
public class QueryExecutorImpl { /** * To prevent client / server protocol deadlocks , we try to manage the estimated recv buffer size * and force a sync + flush and process results if we think it might be getting too full . * See the comments above MAX _ BUFFERED _ RECV _ BYTES ' s declaration for details . */ private void flushIfDeadlockRisk ( Query query , boolean disallowBatching , ResultHandler resultHandler , BatchResultHandler batchHandler , final int flags ) throws IOException { } }
// Assume all statements need at least this much reply buffer space , // plus params estimatedReceiveBufferBytes += NODATA_QUERY_RESPONSE_SIZE_BYTES ; SimpleQuery sq = ( SimpleQuery ) query ; if ( sq . isStatementDescribed ( ) ) { /* * Estimate the response size of the fields and add it to the expected response size . * It ' s impossible for us to estimate the rowcount . We ' ll assume one row , as that ' s the common * case for batches and we ' re leaving plenty of breathing room in this approach . It ' s still * not deadlock - proof though ; see pgjdbc github issues # 194 and # 195. */ int maxResultRowSize = sq . getMaxResultRowSize ( ) ; if ( maxResultRowSize >= 0 ) { estimatedReceiveBufferBytes += maxResultRowSize ; } else { LOGGER . log ( Level . FINEST , "Couldn't estimate result size or result size unbounded, " + "disabling batching for this query." ) ; disallowBatching = true ; } } else { /* * We only describe a statement if we ' re expecting results from it , so it ' s legal to batch * unprepared statements . We ' ll abort later if we get any uresults from them where none are * expected . For now all we can do is hope the user told us the truth and assume that * NODATA _ QUERY _ RESPONSE _ SIZE _ BYTES is enough to cover it . */ } if ( disallowBatching || estimatedReceiveBufferBytes >= MAX_BUFFERED_RECV_BYTES ) { LOGGER . log ( Level . FINEST , "Forcing Sync, receive buffer full or batching disallowed" ) ; sendSync ( ) ; processResults ( resultHandler , flags ) ; estimatedReceiveBufferBytes = 0 ; if ( batchHandler != null ) { batchHandler . secureProgress ( ) ; } }
public class UkaseController { /** * = = = = = private utilities = = = = = */ private ResponseEntity < Object > translateState ( boolean selectedTemplateUpdated ) { } }
if ( selectedTemplateUpdated ) { return new ResponseEntity < > ( "updated" , HttpStatus . OK ) ; } else { return new ResponseEntity < > ( HttpStatus . NOT_MODIFIED ) ; }
public class RemoteTopicSpaceControl { /** * / * ( non - Javadoc ) * @ see com . ibm . ws . sib . processor . runtime . AbstractControlAdapter # getUuid ( ) */ public String getUuid ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getUuid" ) ; String uuid = null ; if ( _outputHandler != null ) { uuid = _outputHandler . getTopicSpaceUuid ( ) . toString ( ) ; } else { uuid = _anycastInputHandler . getBaseDestinationHandler ( ) . getUuid ( ) . toString ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getUuid" , uuid ) ; return uuid ;
public class HtmlRadioRendererBase { /** * Renders the input item * @ return the ' id ' value of the rendered element */ protected String renderRadio ( FacesContext facesContext , UIInput uiComponent , String value , boolean disabled , boolean checked , boolean renderId , Integer itemNum ) throws IOException { } }
String clientId = uiComponent . getClientId ( facesContext ) ; String itemId = ( itemNum == null ) ? null : clientId + facesContext . getNamingContainerSeparatorChar ( ) + itemNum ; ResponseWriter writer = facesContext . getResponseWriter ( ) ; writer . startElement ( HTML . INPUT_ELEM , uiComponent ) ; if ( itemId != null ) { writer . writeAttribute ( HTML . ID_ATTR , itemId , null ) ; } else if ( renderId ) { writer . writeAttribute ( HTML . ID_ATTR , clientId , null ) ; } writer . writeAttribute ( HTML . TYPE_ATTR , HTML . INPUT_TYPE_RADIO , null ) ; writer . writeAttribute ( HTML . NAME_ATTR , clientId , null ) ; if ( disabled ) { writer . writeAttribute ( HTML . DISABLED_ATTR , HTML . DISABLED_ATTR , null ) ; } if ( checked ) { writer . writeAttribute ( HTML . CHECKED_ATTR , HTML . CHECKED_ATTR , null ) ; } if ( value != null ) { writer . writeAttribute ( HTML . VALUE_ATTR , value , null ) ; } else { writer . writeAttribute ( HTML . VALUE_ATTR , "" , null ) ; } Map < String , List < ClientBehavior > > behaviors = null ; if ( uiComponent instanceof ClientBehaviorHolder ) { behaviors = ( ( ClientBehaviorHolder ) uiComponent ) . getClientBehaviors ( ) ; long commonPropertiesMarked = 0L ; if ( isCommonPropertiesOptimizationEnabled ( facesContext ) ) { commonPropertiesMarked = CommonPropertyUtils . getCommonPropertiesMarked ( uiComponent ) ; } if ( behaviors . isEmpty ( ) && isCommonPropertiesOptimizationEnabled ( facesContext ) ) { CommonPropertyUtils . renderChangeEventProperty ( writer , commonPropertiesMarked , uiComponent ) ; CommonPropertyUtils . renderEventProperties ( writer , commonPropertiesMarked , uiComponent ) ; CommonPropertyUtils . renderFieldEventPropertiesWithoutOnchange ( writer , commonPropertiesMarked , uiComponent ) ; } else { HtmlRendererUtils . renderBehaviorizedOnchangeEventHandler ( facesContext , writer , uiComponent , behaviors ) ; if ( isCommonEventsOptimizationEnabled ( facesContext ) ) { Long commonEventsMarked = CommonEventUtils . getCommonEventsMarked ( uiComponent ) ; CommonEventUtils . renderBehaviorizedEventHandlers ( facesContext , writer , commonPropertiesMarked , commonEventsMarked , uiComponent , behaviors ) ; CommonEventUtils . renderBehaviorizedFieldEventHandlersWithoutOnchange ( facesContext , writer , commonPropertiesMarked , commonEventsMarked , uiComponent , behaviors ) ; } else { HtmlRendererUtils . renderBehaviorizedEventHandlers ( facesContext , writer , uiComponent , behaviors ) ; HtmlRendererUtils . renderBehaviorizedFieldEventHandlersWithoutOnchange ( facesContext , writer , uiComponent , behaviors ) ; } } HtmlRendererUtils . renderHTMLAttributes ( writer , uiComponent , HTML . INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_STYLE_AND_EVENTS ) ; } else { HtmlRendererUtils . renderHTMLAttributes ( writer , uiComponent , HTML . INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_STYLE ) ; } if ( isDisabled ( facesContext , uiComponent ) ) { writer . writeAttribute ( org . apache . myfaces . shared . renderkit . html . HTML . DISABLED_ATTR , Boolean . TRUE , null ) ; } writer . endElement ( HTML . INPUT_ELEM ) ; return itemId ;
public class AmazonNeptuneClient { /** * Returns a list of orderable DB instance options for the specified engine . * @ param describeOrderableDBInstanceOptionsRequest * @ return Result of the DescribeOrderableDBInstanceOptions operation returned by the service . * @ sample AmazonNeptune . DescribeOrderableDBInstanceOptions * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / neptune - 2014-10-31 / DescribeOrderableDBInstanceOptions " * target = " _ top " > AWS API Documentation < / a > */ @ Override public DescribeOrderableDBInstanceOptionsResult describeOrderableDBInstanceOptions ( DescribeOrderableDBInstanceOptionsRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeDescribeOrderableDBInstanceOptions ( request ) ;
public class JAXBData { /** * Respond with the Object of type { @ literal < T > } if it exists , or unmarshal from String * and pass the result back . < p > * Explicitly use a specific Env for logging purposes * @ param env * @ return T * @ throws APIException */ public T asObject ( EnvJAXB env ) throws APIException { } }
if ( dataAsObject != null ) { return dataAsObject ; } else { // Some Java compilers need two statements here dataAsObject = objectifier . objectify ( env , dataAsString ) ; return dataAsObject ; }
public class CommonUtils { /** * - - - LOCAL HOST NAME - - - */ public static final String getHostName ( ) { } }
if ( cachedHostName != null ) { return cachedHostName ; } // User - defined public hostname String name = System . getProperty ( "hostname" ) ; if ( name == null || name . isEmpty ( ) ) { try { name = InetAddress . getLocalHost ( ) . getHostName ( ) ; } catch ( Exception ignored ) { name = null ; } } if ( name == null || name . isEmpty ( ) || name . contains ( "localhost" ) ) { try { name = System . getenv ( ) . get ( "COMPUTERNAME" ) ; } catch ( Exception ignored ) { name = null ; } } if ( name == null || name . isEmpty ( ) ) { cachedHostName = "localhost" ; } else { cachedHostName = name . toLowerCase ( ) ; } return cachedHostName ;
public class AgreementsInner { /** * Gets an integration account agreement . * @ param resourceGroupName The resource group name . * @ param integrationAccountName The integration account name . * @ param agreementName The integration account agreement name . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < IntegrationAccountAgreementInner > getAsync ( String resourceGroupName , String integrationAccountName , String agreementName , final ServiceCallback < IntegrationAccountAgreementInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( getWithServiceResponseAsync ( resourceGroupName , integrationAccountName , agreementName ) , serviceCallback ) ;
public class JettyServiceBuilder { /** * Sets the factory that creates a new instance of { @ link SessionIdManager } for the Jetty { @ link Server } . * @ see Server # setSessionIdManager ( SessionIdManager ) */ public JettyServiceBuilder sessionIdManagerFactory ( Function < ? super Server , ? extends SessionIdManager > sessionIdManagerFactory ) { } }
requireNonNull ( sessionIdManagerFactory , "sessionIdManagerFactory" ) ; this . sessionIdManagerFactory = sessionIdManagerFactory ; return this ;
public class ArrayUtils { /** * 裁剪数组 。 Returns a new array if array is not empty and start greater or equals * 0 and less than end and end less than array length ; array self otherwise ; * @ param array 源数组 。 array to be handed . * @ param start 裁剪的起始位置的索引 。 start index number . * @ param end 裁剪的结束位置的索引 。 end index number . * @ return * 一个新的数组 , 包含从指定索引开始到指定索引结束的所有元素 。 如果数组为空或起始索引小于0 , 或起始索引大于结束索引 , 或结束大于数组本身索引长度 * , 则返回数组本身 。 a new array if array is not empty and start greater or * equals 0 and less than end and end less than array length ; array * self otherwise ; */ public static < T > T [ ] subArray ( final T [ ] array , final int start , final int end ) { } }
if ( isEmpty ( array ) || start < 0 || start > end || end >= array . length ) { return array ; } @ SuppressWarnings ( "unchecked" ) Class < T > componentClass = ( Class < T > ) ClassUtils . getComponentClass ( array ) ; int newArraySize = end - start + 1 ; T [ ] newArray = buildArray ( componentClass , newArraySize , null ) ; System . arraycopy ( array , start , newArray , 0 , newArraySize ) ; return newArray ;
public class NodeUtil { /** * Gets the value of a node as a String , or null if it cannot be converted . * When it returns a non - null String , this method effectively emulates the * < code > String ( ) < / code > JavaScript cast function . */ public static String getStringValue ( Node n ) { } }
// TODO ( user ) : regex literals as well . switch ( n . getToken ( ) ) { case STRING : case STRING_KEY : return n . getString ( ) ; case TEMPLATELIT : // Only convert a template literal if all its expressions can be converted . String string = "" ; for ( Node child = n . getFirstChild ( ) ; child != null ; child = child . getNext ( ) ) { Node expression = child ; if ( child . isTemplateLitSub ( ) ) { expression = child . getFirstChild ( ) ; } String expressionString = getStringValue ( expression ) ; if ( expressionString == null ) { // Cannot convert . return null ; } string = string + expressionString ; } return string ; case TEMPLATELIT_STRING : return n . getCookedString ( ) ; case NAME : String name = n . getString ( ) ; if ( "undefined" . equals ( name ) || "Infinity" . equals ( name ) || "NaN" . equals ( name ) ) { return name ; } break ; case NUMBER : return DToA . numberToString ( n . getDouble ( ) ) ; case FALSE : return "false" ; case TRUE : return "true" ; case NULL : return "null" ; case VOID : return "undefined" ; case NOT : TernaryValue child = getPureBooleanValue ( n . getFirstChild ( ) ) ; if ( child != TernaryValue . UNKNOWN ) { return child . toBoolean ( true ) ? "false" : "true" ; // reversed . } break ; case ARRAYLIT : return arrayToString ( n ) ; case OBJECTLIT : return "[object Object]" ; default : break ; } return null ;
public class SECImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setCOLSIZE2 ( Integer newCOLSIZE2 ) { } }
Integer oldCOLSIZE2 = colsize2 ; colsize2 = newCOLSIZE2 ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . SEC__COLSIZE2 , oldCOLSIZE2 , colsize2 ) ) ;
public class PageFilterAdapter { /** * { @ inheritDoc } */ @ Override public FilterSupportStatus isFilterSupported ( FilterAdapterContext context , PageFilter filter ) { } }
Optional < FilterList > currentList = context . getCurrentFilterList ( ) ; if ( ( currentList . isPresent ( ) && ! isFilterListSupported ( currentList . get ( ) , filter ) ) || context . getFilterListDepth ( ) > 1 ) { return TOP_LEVEL_ONLY ; } return FilterSupportStatus . SUPPORTED ;
public class AbstractStandardTransformationOperation { /** * Get the parameter with the given parameter name from the parameter map . If the parameters does not contain such a * parameter , take the default value instead . */ protected String getParameterOrDefault ( Map < String , String > parameters , String paramName , String defaultValue ) throws TransformationOperationException { } }
return getParameter ( parameters , paramName , false , defaultValue ) ;
public class Expressive { /** * Report whether the condition is satisfied during a poll . */ public boolean the ( Condition condition , Ticker ticker ) { } }
try { poll ( ticker , condition ) ; return true ; } catch ( PollTimeoutException ignored ) { return false ; }
public class ConnectorDescriptorImpl { /** * Adds a new namespace * @ return the current instance of < code > ConnectorDescriptor < / code > */ public ConnectorDescriptor addNamespace ( String name , String value ) { } }
model . attribute ( name , value ) ; return this ;
public class AbstractHtmlLabelConverter { /** * Converts the model data to a string representation of the presentation * label that is used on client - side to style the label . * @ param status * model data * @ return string representation of label */ private String convert ( final T status ) { } }
if ( adapter == null ) { throw new IllegalStateException ( "Adapter must be set before usage! Convertion without adapter is not possible!" ) ; } final StatusFontIcon statusProps = adapter . adapt ( status ) ; // fail fast if ( statusProps == null ) { return "" ; } final String codePoint = getCodePoint ( statusProps ) ; final String title = statusProps . getTitle ( ) ; return getStatusLabelDetailsInString ( codePoint , statusProps . getStyle ( ) , title , statusProps . getId ( ) , statusProps . isDisabled ( ) ) ;
public class ArrowConverter { /** * Convert a set of input strings to arrow columns * for a time series . * @ param bufferAllocator the buffer allocator to use * @ param schema the schema to use * @ param dataVecRecord the collection of input strings to process * @ return the created vectors */ public static < T > List < FieldVector > toArrowColumnsTimeSeriesHelper ( final BufferAllocator bufferAllocator , final Schema schema , List < List < List < T > > > dataVecRecord ) { } }
// time series length * number of columns int numRows = 0 ; for ( List < List < T > > timeStep : dataVecRecord ) { numRows += timeStep . get ( 0 ) . size ( ) * timeStep . size ( ) ; } numRows /= schema . numColumns ( ) ; List < FieldVector > ret = createFieldVectors ( bufferAllocator , schema , numRows ) ; Map < Integer , Integer > currIndex = new HashMap < > ( ret . size ( ) ) ; for ( int i = 0 ; i < ret . size ( ) ; i ++ ) { currIndex . put ( i , 0 ) ; } for ( int i = 0 ; i < dataVecRecord . size ( ) ; i ++ ) { List < List < T > > record = dataVecRecord . get ( i ) ; for ( int j = 0 ; j < record . size ( ) ; j ++ ) { List < T > curr = record . get ( j ) ; for ( int k = 0 ; k < curr . size ( ) ; k ++ ) { Integer idx = currIndex . get ( k ) ; FieldVector fieldVector = ret . get ( k ) ; T writable = curr . get ( k ) ; setValue ( schema . getType ( k ) , fieldVector , writable , idx ) ; currIndex . put ( k , idx + 1 ) ; } } } return ret ;
public class MapFileHelper { /** * Attempts to delete all Minecraft Worlds with " TEMP _ " in front of the name * @ param currentWorld excludes this world from deletion , can be null */ public static void cleanupTemporaryWorlds ( String currentWorld ) { } }
List < WorldSummary > saveList ; ISaveFormat isaveformat = Minecraft . getMinecraft ( ) . getSaveLoader ( ) ; isaveformat . flushCache ( ) ; try { saveList = isaveformat . getSaveList ( ) ; } catch ( AnvilConverterException e ) { e . printStackTrace ( ) ; return ; } String searchString = tempMark + AddressHelper . getMissionControlPort ( ) + "_" ; for ( WorldSummary s : saveList ) { String folderName = s . getFileName ( ) ; if ( folderName . startsWith ( searchString ) && ! folderName . equals ( currentWorld ) ) { isaveformat . deleteWorldDirectory ( folderName ) ; } }
public class AdminParserUtils { /** * Adds OPT _ D | OPT _ DIR option to OptionParser , with one argument . * @ param parser OptionParser to be modified * @ param required Tells if this option is required or optional */ public static void acceptsDir ( OptionParser parser ) { } }
parser . acceptsAll ( Arrays . asList ( OPT_D , OPT_DIR ) , "directory path for input/output" ) . withRequiredArg ( ) . describedAs ( "dir-path" ) . ofType ( String . class ) ;
public class AuthorizationApi { /** * Build query parameters * @ param clientId The ID of the application or service that is registered as the client . You & # 39 ; ll need to get this value from your PureEngage Cloud representative . * @ param redirectUri The URI that you want users to be redirected to after entering valid credentials during an Implicit or Authorization Code grant . The Authentication API includes this as part of the URI it returns in the & # 39 ; Location & # 39 ; header . * @ param responseType The response type to let the Authentication API know which grant flow you & # 39 ; re using . Possible values are & # x60 ; code & # x60 ; for Authorization Code Grant or & # x60 ; token & # x60 ; for Implicit Grant . For more information about this parameter , see [ Response Type ] ( https : / / tools . ietf . org / html / rfc6749 # section - 3.1.1 ) . * @ param hideTenant Hide the * * tenant * * field in the UI for Authorization Code Grant . ( optional , default to false ) * @ param scope The scope of the access request . The Authentication API supports only the & # x60 ; * & # x60 ; value . ( optional ) * @ throws IllegalArgumentException if required query parameters are missed */ public static Map < String , String > createQueryParamsList ( String clientId , String redirectUri , String responseType , String hideTenant , String scope ) { } }
if ( clientId == null ) { throw new IllegalArgumentException ( "Missing the required parameter 'client_id'" ) ; } if ( redirectUri == null ) { throw new IllegalArgumentException ( "Missing the required parameter 'redirect_uri'" ) ; } if ( responseType == null ) { throw new IllegalArgumentException ( "Missing the required parameter 'response_type'" ) ; } Map < String , String > queryParams = new HashMap < > ( ) ; queryParams . put ( "client_id" , clientId ) ; queryParams . put ( "redirect_uri" , redirectUri ) ; queryParams . put ( "response_type" , responseType ) ; if ( hideTenant != null ) queryParams . put ( "hideTenant" , hideTenant ) ; if ( scope != null ) queryParams . put ( "scope" , scope ) ; return queryParams ;
public class AbstractZealotConfig { /** * 配置Zealot的普通配置信息 ( 默认配置方法 , 开发者可覆盖此方法来做一些自定义配置 ) . * @ param normalConfig 普通配置实例 */ public void configNormal ( NormalConfig normalConfig ) { } }
normalConfig . setDebug ( false ) . setPrintBanner ( true ) . setPrintSqlInfo ( true ) ;
public class ReviewsImpl { /** * Use this method to add frames for a video review . Timescale : This parameter is a factor which is used to convert the timestamp on a frame into milliseconds . Timescale is provided in the output of the Content Moderator video media processor on the Azure Media Services platform . Timescale in the Video Moderation output is Ticks / Second . * @ param teamName Your team name . * @ param reviewId Id of the review . * @ param contentType The content type . * @ param frameImageZip Zip file containing frame images . * @ param frameMetadata Metadata of the frame . * @ param timescale Timescale of the video . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceResponse } object if successful . */ public Observable < ServiceResponse < Void > > addVideoFrameStreamWithServiceResponseAsync ( String teamName , String reviewId , String contentType , byte [ ] frameImageZip , String frameMetadata , Integer timescale ) { } }
if ( this . client . baseUrl ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.baseUrl() is required and cannot be null." ) ; } if ( teamName == null ) { throw new IllegalArgumentException ( "Parameter teamName is required and cannot be null." ) ; } if ( reviewId == null ) { throw new IllegalArgumentException ( "Parameter reviewId is required and cannot be null." ) ; } if ( contentType == null ) { throw new IllegalArgumentException ( "Parameter contentType is required and cannot be null." ) ; } if ( frameImageZip == null ) { throw new IllegalArgumentException ( "Parameter frameImageZip is required and cannot be null." ) ; } if ( frameMetadata == null ) { throw new IllegalArgumentException ( "Parameter frameMetadata is required and cannot be null." ) ; } String parameterizedHost = Joiner . on ( ", " ) . join ( "{baseUrl}" , this . client . baseUrl ( ) ) ; RequestBody frameImageZipConverted = RequestBody . create ( MediaType . parse ( "multipart/form-data" ) , frameImageZip ) ; return service . addVideoFrameStream ( teamName , reviewId , contentType , timescale , frameImageZipConverted , frameMetadata , this . client . acceptLanguage ( ) , parameterizedHost , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < Void > > > ( ) { @ Override public Observable < ServiceResponse < Void > > call ( Response < ResponseBody > response ) { try { ServiceResponse < Void > clientResponse = addVideoFrameStreamDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class OAuth2ConnectionFactory { /** * Create a OAuth2 - based { @ link Connection } from the { @ link AccessGrant } returned after { @ link # getOAuthOperations ( ) completing the OAuth2 flow } . * @ param accessGrant the access grant * @ return the new service provider connection * @ see OAuth2Operations # exchangeForAccess ( String , String , org . springframework . util . MultiValueMap ) */ public Connection < S > createConnection ( AccessGrant accessGrant ) { } }
return new OAuth2Connection < S > ( getProviderId ( ) , extractProviderUserId ( accessGrant ) , accessGrant . getAccessToken ( ) , accessGrant . getRefreshToken ( ) , accessGrant . getExpireTime ( ) , getOAuth2ServiceProvider ( ) , getApiAdapter ( ) ) ;
public class DatabaseVulnerabilityAssessmentScansInner { /** * Lists the vulnerability assessment scans of a database . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server . * @ param databaseName The name of the database . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; VulnerabilityAssessmentScanRecordInner & gt ; object */ public Observable < ServiceResponse < Page < VulnerabilityAssessmentScanRecordInner > > > listByDatabaseWithServiceResponseAsync ( final String resourceGroupName , final String serverName , final String databaseName ) { } }
return listByDatabaseSinglePageAsync ( resourceGroupName , serverName , databaseName ) . concatMap ( new Func1 < ServiceResponse < Page < VulnerabilityAssessmentScanRecordInner > > , Observable < ServiceResponse < Page < VulnerabilityAssessmentScanRecordInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < VulnerabilityAssessmentScanRecordInner > > > call ( ServiceResponse < Page < VulnerabilityAssessmentScanRecordInner > > page ) { String nextPageLink = page . body ( ) . nextPageLink ( ) ; if ( nextPageLink == null ) { return Observable . just ( page ) ; } return Observable . just ( page ) . concatWith ( listByDatabaseNextWithServiceResponseAsync ( nextPageLink ) ) ; } } ) ;
public class SecurityModule { /** * Applies the new configuration to this module . */ public void reconfigure ( SecurityConfig config ) { } }
this . config = config ; LOGGER . debug ( "reconfiguring with {} rules" , config . getRules ( ) . size ( ) ) ; Map < String , Map < String , ResourcePermission > > newPermissions = new HashMap < > ( ) ; for ( SecurityRule rule : config . getRules ( ) ) { String resourceType = rule . getResourceType ( ) ; if ( resourceType == null ) { Class < ? > resourceClass = rule . getResourceClass ( ) ; if ( resourceClass != null ) { resourceType = toType ( resourceClass ) ; } } if ( resourceType == null ) { Collection < RegistryEntry > entries = context . getResourceRegistry ( ) . getEntries ( ) ; for ( RegistryEntry entry : entries ) { String entryResourceType = entry . getResourceInformation ( ) . getResourceType ( ) ; configureRule ( newPermissions , entryResourceType , rule . getRole ( ) , rule . getPermission ( ) ) ; } } else { ResourceRegistry resourceRegistry = context . getResourceRegistry ( ) ; RegistryEntry entry = resourceRegistry . getEntry ( resourceType ) ; if ( entry == null ) { throw new RepositoryNotFoundException ( resourceType ) ; } configureRule ( newPermissions , resourceType , rule . getRole ( ) , rule . getPermission ( ) ) ; } } this . permissions = newPermissions ;
public class AsciiTable { /** * Sets the left padding character for all cells in the table . * @ param paddingLeftChar new padding character , ignored if null * @ return this to allow chaining */ public AsciiTable setPaddingLeftChar ( Character paddingLeftChar ) { } }
for ( AT_Row row : this . rows ) { if ( row . getType ( ) == TableRowType . CONTENT ) { row . setPaddingLeftChar ( paddingLeftChar ) ; } } return this ;
public class MarkupEngine { /** * Process the body of the file . * @ param context the parser context */ private void processDefaultBody ( ParserContext context ) { } }
StringBuilder body = new StringBuilder ( ) ; boolean inBody = false ; for ( String line : context . getFileLines ( ) ) { if ( inBody ) { body . append ( line ) . append ( "\n" ) ; } if ( line . equals ( configuration . getHeaderSeparator ( ) ) ) { inBody = true ; } } if ( body . length ( ) == 0 ) { for ( String line : context . getFileLines ( ) ) { body . append ( line ) . append ( "\n" ) ; } } context . setBody ( body . toString ( ) ) ;
public class SignatureAlgorithmConverter { /** * Converts an OpenSSL algorithm name to a Java algorithm name and return it , * or return { @ code null } if the conversation failed because the format is not known . */ static String toJavaName ( String opensslName ) { } }
if ( opensslName == null ) { return null ; } Matcher matcher = PATTERN . matcher ( opensslName ) ; if ( matcher . matches ( ) ) { String group1 = matcher . group ( 1 ) ; if ( group1 != null ) { return group1 . toUpperCase ( Locale . ROOT ) + "with" + matcher . group ( 2 ) . toUpperCase ( Locale . ROOT ) ; } if ( matcher . group ( 3 ) != null ) { return matcher . group ( 4 ) . toUpperCase ( Locale . ROOT ) + "with" + matcher . group ( 3 ) . toUpperCase ( Locale . ROOT ) ; } if ( matcher . group ( 5 ) != null ) { return matcher . group ( 6 ) . toUpperCase ( Locale . ROOT ) + "with" + matcher . group ( 5 ) . toUpperCase ( Locale . ROOT ) ; } } return null ;
public class CurrencyPair { /** * Given another CurrencyPair find the common Currency ( if any ) or the first if both are identical * @ param otherPair * @ return the common ccy or Empty optional */ public Optional < String > findCommonCcy ( final CurrencyPair otherPair ) { } }
if ( containsCcy ( otherPair . getCcy1 ( ) ) ) { return Optional . of ( otherPair . getCcy1 ( ) ) ; } return containsCcy ( otherPair . getCcy2 ( ) ) ? Optional . of ( otherPair . getCcy2 ( ) ) : Optional . empty ( ) ;
public class ListTaskDefinitionsResult { /** * The list of task definition Amazon Resource Name ( ARN ) entries for the < code > ListTaskDefinitions < / code > request . * @ return The list of task definition Amazon Resource Name ( ARN ) entries for the < code > ListTaskDefinitions < / code > * request . */ public java . util . List < String > getTaskDefinitionArns ( ) { } }
if ( taskDefinitionArns == null ) { taskDefinitionArns = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return taskDefinitionArns ;
public class Discrete { /** * Creates a list of scalars from a list of Pair given in the form * ` \ left ( \ { x _ 1 , y _ 1 \ } , . . . , \ { x _ n , y _ n \ } \ right ) ` * @ param xyValues is the list of Pair * @ return a vector of scalars as ` ( x _ 1 , y _ 1 , . . . , x _ n , y _ n ) ` */ public static List < Double > toList ( List < Pair > xyValues ) { } }
List < Double > result = new ArrayList < Double > ( xyValues . size ( ) * 2 ) ; for ( Pair pair : xyValues ) { result . add ( pair . getX ( ) ) ; result . add ( pair . getY ( ) ) ; } return result ;
public class MPPReader { /** * This method validates all relationships for a task , removing * any which have been incorrectly read from the MPP file and * point to a parent task . * @ param task task under test */ private void validationRelations ( Task task ) { } }
List < Relation > predecessors = task . getPredecessors ( ) ; if ( ! predecessors . isEmpty ( ) ) { ArrayList < Relation > invalid = new ArrayList < Relation > ( ) ; for ( Relation relation : predecessors ) { Task sourceTask = relation . getSourceTask ( ) ; Task targetTask = relation . getTargetTask ( ) ; String sourceOutlineNumber = sourceTask . getOutlineNumber ( ) ; String targetOutlineNumber = targetTask . getOutlineNumber ( ) ; if ( sourceOutlineNumber != null && targetOutlineNumber != null && sourceOutlineNumber . startsWith ( targetOutlineNumber + '.' ) ) { invalid . add ( relation ) ; } } for ( Relation relation : invalid ) { relation . getSourceTask ( ) . removePredecessor ( relation . getTargetTask ( ) , relation . getType ( ) , relation . getLag ( ) ) ; } }
public class OverlapResolver { /** * Calculates a score based on the overlap of atoms and intersection of bonds . * The overlap is calculated by summing up the distances between all pairs of * atoms , if they are less than half the standard bondlength apart . * @ param ac The Atomcontainer to work on * @ param overlappingAtoms Description of the Parameter * @ param overlappingBonds Description of the Parameter * @ return The overlapScore value */ public double getOverlapScore ( IAtomContainer ac , Vector overlappingAtoms , Vector overlappingBonds ) { } }
double overlapScore = 0 ; overlapScore = getAtomOverlapScore ( ac , overlappingAtoms ) ; // overlapScore + = getBondOverlapScore ( ac , overlappingBonds ) ; return overlapScore ;
public class ConfigUtil { /** * Normalizes key - value properties from Yaml in the normalized format of the Table API . */ public static DescriptorProperties normalizeYaml ( Map < String , Object > yamlMap ) { } }
final Map < String , String > normalized = new HashMap < > ( ) ; yamlMap . forEach ( ( k , v ) -> normalizeYamlObject ( normalized , k , v ) ) ; final DescriptorProperties properties = new DescriptorProperties ( true ) ; properties . putProperties ( normalized ) ; return properties ;
public class FailoverGroupsInner { /** * Updates a failover group . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server containing the failover group . * @ param failoverGroupName The name of the failover group . * @ param parameters The failover group parameters . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the FailoverGroupInner object */ public Observable < FailoverGroupInner > beginUpdateAsync ( String resourceGroupName , String serverName , String failoverGroupName , FailoverGroupUpdate parameters ) { } }
return beginUpdateWithServiceResponseAsync ( resourceGroupName , serverName , failoverGroupName , parameters ) . map ( new Func1 < ServiceResponse < FailoverGroupInner > , FailoverGroupInner > ( ) { @ Override public FailoverGroupInner call ( ServiceResponse < FailoverGroupInner > response ) { return response . body ( ) ; } } ) ;
public class OLAPSession { /** * Perform an aggregate query for the given table and query parameters . The table must * belong to this session ' s application . Query parameters are specific to the storage * service managing the application . Common parameters are : * < table > * < tr > < td > Name < / td > < td > Value < / td > < td > Description < / td > < / tr > * < tr > < td > m < / td > * < td > metric list < / td > * < td > Required . Comma - separated list of metric expression ( s ) to compute . < / td > * < / tr > * < tr > < td > q < / td > * < td > query expression < / td > * < td > Optional . Query expression that selects objects in the table . Default is * " * " , which selects all objects . < / td > * < / tr > * < tr > < td > f < / td > * < td > grouping parameter < / td > * < td > Optional . Comma - separated list of grouping field expressions . When present , * creates a grouped aggregate query instead of a global aggregate query . < / td > * < / tr > * < tr > < td > pair < / td > * < td > pair list < / td > * < td > Optiona . A comma - separated of pair of link paths that define a special * < i > dual role < / i > query . See OLAP documentation about the operation of this * special query type . < / td > * < / tr > * < tr > < td > shards < / td > * < td > shard list < / td > * < td > Comma - separated list of shards to query . Either this or the " range " * parameter must be provided , but not both . < / td > * < / tr > * < tr > < td > range < / td > * < td > < i > shard - from < / i > [ , < i > shard - to < / i > ] < / td > * < td > Defines a range of shards to query beginning with shards whose name is * greater than or equal to the < i > shard - from < / i > name . If a < i > shard - to < / i > * name is given , shard names must also be less than or equal to that name . * Either this or the " shards " parameter must be provided , but not both . < / td > * < / tr > * < tr > < td > xshards < / td > * < td > shard list < / td > * < td > Comma - separated list of shards that define the search scope of xlinks . This * parameter is only meaningful when the aggregate query uses xlinks . Either * this or the " xrange " parameter can be provided , but not both . If neither * " xshards " nor " xrange " is specified , the search scope of xlinks is defined * by the " shards " or " range " parameter . < / td > * < / tr > * < tr > < td > xrange < / td > * < td > < i > shard - from < / i > [ , < i > shard - to < / i > ] < / td > * < td > Defines a range of shards to query for xlink values beginning with shards * whose name is greater than or equal to the < i > shard - from < / i > name . If a * < i > shard - to < / i > name is given , shard names must also be less than or equal * to that name . Either this or the " xshards " parameter can be provided , but * not both . If neither " xshards " nor " xrange " is specified , the search scope * of xlinks is defined by the " shards " or " range " parameter . < / td > * < / tr > * < / table > * Results are turned in the given { @ link AggregateResult } object . An exception is thrown * if a parameter is invalid or a database error occurs . * @ param tableName Name of table to query . * @ param params Names and values of aggregate query parameters . * @ return { @ link AggregateResult } containing results . */ @ Override public AggregateResult aggregateQuery ( String tableName , Map < String , String > params ) { } }
// Prerequisites : Utils . require ( ! Utils . isEmpty ( tableName ) , "tableName" ) ; Utils . require ( params != null && params . size ( ) > 0 , "params" ) ; TableDefinition tableDef = m_appDef . getTableDef ( tableName ) ; Utils . require ( tableDef != null , "Table is not defined for application '%s': %s" , m_appDef . getAppName ( ) , tableName ) ; // Form the URI , which has the general form : GET / { application } / { table } / _ aggregate ? { params } StringBuilder uri = new StringBuilder ( Utils . isEmpty ( m_restClient . getApiPrefix ( ) ) ? "" : "/" + m_restClient . getApiPrefix ( ) ) ; uri . append ( "/" ) ; uri . append ( Utils . urlEncode ( m_appDef . getAppName ( ) ) ) ; uri . append ( "/" ) ; uri . append ( Utils . urlEncode ( tableDef . getTableName ( ) ) ) ; uri . append ( "/_aggregate?" ) ; Utils . require ( params . containsKey ( "m" ) , "Metric ('m') parameter is required" ) ; uri . append ( "m=" ) ; uri . append ( Utils . urlEncode ( params . get ( "m" ) ) ) ; for ( String name : params . keySet ( ) ) { String value = params . get ( name ) ; switch ( name ) { case "q" : case "f" : case "pair" : case "shards" : case "range" : case "xshards" : case "xrange" : uri . append ( "&" ) ; uri . append ( name ) ; uri . append ( "=" ) ; uri . append ( Utils . urlEncode ( value ) ) ; break ; case "m" : // already added above break ; default : Utils . require ( false , "Unknown parameter name: %s" , name ) ; } } // Send the query and capture the response . try { RESTResponse response = m_restClient . sendRequest ( HttpMethod . GET , uri . toString ( ) ) ; m_logger . debug ( "aggregateQuery() response: {}" , response . toString ( ) ) ; // If the response is not " OK " , create a failed - query response and return . AggregateResult result = new AggregateResult ( ) ; if ( response . getCode ( ) != HttpCode . OK ) { result . setErrorMessage ( response . getBody ( ) ) ; } else { result . parse ( UNode . parse ( response . getBody ( ) , response . getContentType ( ) ) ) ; } return result ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; }
public class Verifies { /** * MD5验证通知参数签名是否合法 ( WEB , WAP , 退款服务器通知 ) * @ param notifyParams 通知参数 * @ return 合法返回true , 反之false */ public Boolean md5 ( Map < String , String > notifyParams ) { } }
Map < String , String > validParams = filterSigningParams ( notifyParams ) ; String signing = buildSignString ( validParams ) ; String signed = md5 ( signing ) ; return Objects . equals ( notifyParams . get ( AlipayField . SIGN . field ( ) ) , signed ) ;
public class SpaceGroup { /** * Given a transformation matrix containing a rotation returns the type of rotation : * 1 for identity , 2 for 2 - fold rotation , 3 for 3 - fold rotation , 4 for 4 - fold rotation , * 6 for 6 - fold rotation , * - 1 for inversions , - 2 for mirror planes , - 3 for 3 - fold improper rotation , * - 4 for 4 - fold improper rotation and - 6 for 6 - fold improper rotation * @ param m * @ return */ public static int getRotAxisType ( Matrix4d m ) { } }
int axisType = 0 ; Matrix3d rot = new Matrix3d ( m . m00 , m . m01 , m . m02 , m . m10 , m . m11 , m . m12 , m . m20 , m . m21 , m . m22 ) ; double determinant = rot . determinant ( ) ; if ( ! deltaComp ( determinant , 1.0 , DELTA ) && ! deltaComp ( determinant , - 1.0 , DELTA ) ) { throw new IllegalArgumentException ( "Given matrix does not seem to be a rotation matrix." ) ; } int trace = ( int ) ( rot . m00 + rot . m11 + rot . m22 ) ; if ( determinant > 0 ) { switch ( trace ) { case 3 : axisType = 1 ; break ; case - 1 : axisType = 2 ; break ; case 0 : axisType = 3 ; break ; case 1 : axisType = 4 ; break ; case 2 : axisType = 6 ; break ; default : throw new RuntimeException ( "Trace of transform does not correspond to one of the expected types. This is most likely a bug" ) ; } } else { switch ( trace ) { case - 3 : axisType = - 1 ; break ; case 1 : axisType = - 2 ; break ; case 0 : axisType = - 3 ; break ; case - 1 : axisType = - 4 ; break ; case - 2 : axisType = - 6 ; break ; default : throw new RuntimeException ( "Trace of transform does not correspond to one of the expected types. This is most likely a bug" ) ; } } return axisType ;
public class QueryExecuter { /** * Adds equivalents and parent complexes of the given PhysicalEntity to the parameter set . This * method traverses homologies only to one direction ( either towards parents or to the * children ) . * @ param pe The PhysicalEntity to add its equivalents and complexes * @ param outer Give true if towards parents , false if to the children * @ param pes Set to collect equivalents and complexes */ private static void addEquivalentsComplexes ( PhysicalEntity pe , boolean outer , Set < PhysicalEntity > pes ) { } }
Set < PhysicalEntity > set = outer ? pe . getMemberPhysicalEntityOf ( ) : pe . getMemberPhysicalEntity ( ) ; for ( PhysicalEntity related : set ) { for ( Complex cmp : related . getComponentOf ( ) ) { getRelatedPhysicalEntities ( cmp , pes ) ; } addEquivalentsComplexes ( related , outer , pes ) ; }
public class AmqpProperties { /** * Sets the value of " correlationId " property . If a null value is passed * in , it indicates that the property is not set . * @ param correlationId value of " correlationId " property */ public void setCorrelationId ( String correlationId ) { } }
if ( correlationId == null ) { _properties . remove ( AMQP_PROP_CORRELATION_ID ) ; return ; } _properties . put ( AMQP_PROP_CORRELATION_ID , correlationId ) ;
public class SessionLogsToFileRepository { /** * This creates log file object which represents logs in file form . This opens ObjectOutputStream * which is used to write logRecords to log file and opens a ObjectInputStream which is used to * read logRecords from the file . * @ param sessionId session - id for the log file entry needs to be created . * @ throws IOException file i / o exception can occur because of a temp file created */ public void createLogFileAndAddToMap ( SessionId sessionId ) throws IOException { } }
File rcLogFile ; // create logFile ; rcLogFile = File . createTempFile ( sessionId . toString ( ) , ".rclog" ) ; rcLogFile . deleteOnExit ( ) ; LogFile logFile = new LogFile ( rcLogFile . getAbsolutePath ( ) ) ; sessionToLogFileMap . put ( sessionId , logFile ) ;
public class EngineHeadless { /** * Start engine . Has to be called before anything and only one time , in the main . * @ param name The program name ( must not be < code > null < / code > ) . * @ param version The program version ( must not be < code > null < / code > ) . * @ throws LionEngineException If arguments error . */ public static void start ( String name , Version version ) { } }
Engine . start ( new EngineHeadless ( name , version , Constant . EMPTY_STRING ) ) ;
public class LinearSearch { /** * Search for the value in the char array and return the index of the first occurrence from the * end of the array . * @ param charArray array that we are searching in . * @ param value value that is being searched in the array . * @ param occurrence number of times we have seen the value before returning the index . * @ return the index where the value is found in the array , else - 1. */ public static int searchLast ( char [ ] charArray , char value , int occurrence ) { } }
if ( occurrence <= 0 || occurrence > charArray . length ) { throw new IllegalArgumentException ( "Occurrence must be greater or equal to 1 and less than " + "the array length: " + occurrence ) ; } int valuesSeen = 0 ; for ( int i = charArray . length - 1 ; i >= 0 ; i -- ) { if ( charArray [ i ] == value ) { valuesSeen ++ ; if ( valuesSeen == occurrence ) { return i ; } } } return - 1 ;
public class MultiMinMaxSerializerStrategy { /** * Serialize a MultiNormalizerMinMaxScaler to a output stream * @ param normalizer the normalizer * @ param stream the output stream to write to * @ throws IOException */ public void write ( @ NonNull MultiNormalizerMinMaxScaler normalizer , @ NonNull OutputStream stream ) throws IOException { } }
try ( DataOutputStream dos = new DataOutputStream ( stream ) ) { dos . writeBoolean ( normalizer . isFitLabel ( ) ) ; dos . writeInt ( normalizer . numInputs ( ) ) ; dos . writeInt ( normalizer . isFitLabel ( ) ? normalizer . numOutputs ( ) : - 1 ) ; dos . writeDouble ( normalizer . getTargetMin ( ) ) ; dos . writeDouble ( normalizer . getTargetMax ( ) ) ; for ( int i = 0 ; i < normalizer . numInputs ( ) ; i ++ ) { Nd4j . write ( normalizer . getMin ( i ) , dos ) ; Nd4j . write ( normalizer . getMax ( i ) , dos ) ; } if ( normalizer . isFitLabel ( ) ) { for ( int i = 0 ; i < normalizer . numOutputs ( ) ; i ++ ) { Nd4j . write ( normalizer . getLabelMin ( i ) , dos ) ; Nd4j . write ( normalizer . getLabelMax ( i ) , dos ) ; } } dos . flush ( ) ; }
public class BaseLayoutHelper { /** * Helper methods to handle focus states for views * @ param result * @ param views */ protected void handleStateOnResult ( LayoutChunkResult result , View [ ] views ) { } }
if ( views == null ) return ; for ( int i = 0 ; i < views . length ; i ++ ) { View view = views [ i ] ; if ( view == null ) { continue ; } RecyclerView . LayoutParams params = ( RecyclerView . LayoutParams ) view . getLayoutParams ( ) ; // Consume the available space if the view is not removed OR changed if ( params . isItemRemoved ( ) || params . isItemChanged ( ) ) { result . mIgnoreConsumed = true ; } // used when search a focusable view result . mFocusable = result . mFocusable || view . isFocusable ( ) ; if ( result . mFocusable && result . mIgnoreConsumed ) { break ; } }
public class FileSystemUtilities { /** * If the supplied path refers to a file or directory below the supplied basedir , the returned * path is identical to the part below the basedir . * @ param path The path to strip off basedir path from , and return . * @ param parentDir The maven project basedir . * @ param removeInitialFileSep If true , an initial { @ code File # separator } is removed before returning . * @ return The path relative to basedir , if it is situated below the basedir . Otherwise the supplied path . */ public static String relativize ( final String path , final File parentDir , final boolean removeInitialFileSep ) { } }
// Check sanity Validate . notNull ( path , "path" ) ; Validate . notNull ( parentDir , "parentDir" ) ; final String basedirPath = FileSystemUtilities . getCanonicalPath ( parentDir ) ; String toReturn = path ; // Compare case insensitive if ( path . toLowerCase ( ) . startsWith ( basedirPath . toLowerCase ( ) ) ) { toReturn = path . substring ( basedirPath . length ( ) ) ; } // Handle whitespace in the argument . return removeInitialFileSep && toReturn . startsWith ( File . separator ) ? toReturn . substring ( File . separator . length ( ) ) : toReturn ;
public class XmlReport { /** * { @ inheritDoc } */ public void generate ( com . greenpepper . document . Document document ) { } }
this . document = document ; createEmptyDocument ( ) ; Statistics compiler = document . getStatistics ( ) ; Element element = dom . createElement ( DOCUMENT ) ; root . appendChild ( element ) ; if ( ! StringUtil . isEmpty ( document . getName ( ) ) ) { addTextValue ( element , DOCUMENT_NAME , document . getName ( ) , true ) ; } if ( ! StringUtil . isEmpty ( document . getExternalLink ( ) ) ) { addTextValue ( element , DOCUMENT_EXTERNAL_LINK , document . getExternalLink ( ) , true ) ; } if ( document . getSections ( ) != null && document . getSections ( ) . length > 0 ) { Element sections = dom . createElement ( SECTIONS ) ; root . appendChild ( sections ) ; for ( String section : document . getSections ( ) ) { addTextValue ( sections , SECTION , section , true ) ; } } Element time = dom . createElement ( TIME ) ; element . appendChild ( time ) ; Element stats = dom . createElement ( STATISTICS ) ; element . appendChild ( stats ) ; StringWriter buffer = new StringWriter ( ) ; PrintWriter writer = new PrintWriter ( buffer ) ; document . print ( writer ) ; writer . flush ( ) ; addNumberValue ( time , EXECUTION_TIME , document . getTimeStatistics ( ) . getExecution ( ) ) ; addNumberValue ( time , TOTAL_TIME , document . getTimeStatistics ( ) . getTotal ( ) ) ; addTextValue ( element , RESULTS , buffer . toString ( ) , true ) ; addNumberValue ( stats , SUCCESS , compiler . rightCount ( ) ) ; addNumberValue ( stats , FAILURE , compiler . wrongCount ( ) ) ; addNumberValue ( stats , ERROR , compiler . exceptionCount ( ) ) ; addNumberValue ( stats , IGNORED , compiler . ignoredCount ( ) ) ;
public class PrefsTransformer { /** * Get Java primitive wrapping type Transformable . * @ param type the type * @ return the language transform */ static PrefsTransform getLanguageTransform ( TypeName type ) { } }
String typeName = type . toString ( ) ; if ( Integer . class . getCanonicalName ( ) . equals ( typeName ) ) { return new IntegerPrefsTransform ( true ) ; } if ( Boolean . class . getCanonicalName ( ) . equals ( typeName ) ) { return new BooleanPrefsTransform ( true ) ; } if ( Long . class . getCanonicalName ( ) . equals ( typeName ) ) { return new LongPrefsTransform ( true ) ; } if ( Double . class . getCanonicalName ( ) . equals ( typeName ) ) { return new DoublePrefsTransform ( true ) ; } if ( Float . class . getCanonicalName ( ) . equals ( typeName ) ) { return new FloatPrefsTransform ( true ) ; } if ( Short . class . getCanonicalName ( ) . equals ( typeName ) ) { return new ShortPrefsTransform ( true ) ; } if ( Byte . class . getCanonicalName ( ) . equals ( typeName ) ) { return new BytePrefsTransform ( true ) ; } if ( Character . class . getCanonicalName ( ) . equals ( typeName ) ) { return new CharacterPrefsTransform ( true ) ; } if ( String . class . getCanonicalName ( ) . equals ( typeName ) ) { return new StringPrefsTransform ( ) ; } return null ;
public class AbstractGeneratorConfigurationBlock { /** * Replies the image descriptor . * @ param imagePath the image path . * @ return the image descriptor . */ @ SuppressWarnings ( "static-method" ) protected ImageDescriptor getImageDescriptor ( String imagePath ) { } }
final LangActivator activator = LangActivator . getInstance ( ) ; final ImageRegistry registry = activator . getImageRegistry ( ) ; ImageDescriptor descriptor = registry . getDescriptor ( imagePath ) ; if ( descriptor == null ) { descriptor = AbstractUIPlugin . imageDescriptorFromPlugin ( activator . getBundle ( ) . getSymbolicName ( ) , imagePath ) ; if ( descriptor != null ) { registry . put ( imagePath , descriptor ) ; } } return descriptor ;
public class TokenList { /** * Checks whether both tokens have the same texts . * @ param token1 The first token to check . * @ param token2 The second token to check . * @ return { @ literal true } if the tokens do not have the same texts , and { @ literal false } otherwise . */ private boolean tokenTextsDoNotMatch ( Token token1 , Token token2 ) { } }
return ! token1 . getText ( ) . equals ( token2 . getText ( ) ) ;
public class DirectedGraph { /** * Returns the set of all children of the requested node , or null if the node does not exist in the graph . * @ param n the node to obtain the children of * @ return the set of parents , or null if the node is not in the graph */ public Set < N > getChildren ( N n ) { } }
Pair < HashSet < N > , HashSet < N > > p = nodes . get ( n ) ; if ( p == null ) return null ; return p . getOutgoing ( ) ;
public class WhileyFileParser { /** * Attempt to match a given token on the * same * line , whilst ignoring any * whitespace in between . Note that , in the case it fails to match , then the * index will be unchanged . This latter point is important , otherwise we * could accidentally gobble up some important indentation . * @ param kind * @ return */ private Token tryAndMatchOnLine ( Token . Kind kind ) { } }
int next = skipLineSpace ( index ) ; if ( next < tokens . size ( ) ) { Token t = tokens . get ( next ) ; if ( t . kind == kind ) { index = next + 1 ; return t ; } } return null ;
public class CommonDialogWindow { /** * saves the original values in a Map so we can use them for detecting * changes */ public final void setOrginaleValues ( ) { } }
for ( final AbstractField < ? > field : allComponents ) { Object value = field . getValue ( ) ; if ( field instanceof Table ) { value = ( ( Table ) field ) . getContainerDataSource ( ) . getItemIds ( ) ; } orginalValues . put ( field , value ) ; } saveButton . setEnabled ( isSaveButtonEnabledAfterValueChange ( null , null ) ) ;
public class ContentStoreServiceImpl { /** * { @ inheritDoc } */ @ Override public boolean destroyContext ( Context context ) throws InvalidContextException , StoreException , AuthenticationException { } }
if ( contexts . containsKey ( context . getId ( ) ) ) { context . getStoreAdapter ( ) . destroyContext ( context ) ; cacheTemplate . getCacheService ( ) . removeScope ( context ) ; contexts . remove ( context . getId ( ) ) ; return true ; } else { return false ; }
public class DDPStateSingleton { /** * Logs in using access token - - this breaks the current convention , * but the method call is dependent on some of this class ' s variables * @ param serviceName service name i . e facebook , google * @ param accessToken short - lived one - time code received , or long - lived access token for Facebook login * For some logins , such as Facebook , login with OAuth may only work after customizing the accounts - x packages , * until meteor decides to change the packages themselves . * use https : / / github . com / jasper - lu / accounts - facebook - ddp and * https : / / github . com / jasper - lu / facebook - ddp for reference * If an sdk only allows login returns long - lived token , modify your accounts - x package , * and add the service to the accessTokenServices list */ public void loginWithOAuth ( String serviceName , String accessToken ) { } }
sendOAuthHTTPRequest ( serviceName , accessToken , randomSecret ( ) , new Response . Listener < String > ( ) { @ Override public void onResponse ( String response ) { // json is stored inside an html object in the response Matcher matcher = Pattern . compile ( "<div id=\"config\" style=\"display:none;\">(.*?)</div>" ) . matcher ( response ) ; try { JSONObject jsonResponse = new JSONObject ( matcher . group ( 1 ) ) ; Map < String , Object > options = new HashMap < > ( ) ; Map < String , String > oauth = new HashMap < > ( ) ; oauth . put ( "credentialSecret" , ( String ) jsonResponse . get ( "credentialSecret" ) ) ; oauth . put ( "credentialToken" , ( String ) jsonResponse . get ( "credentialToken" ) ) ; options . put ( "oauth" , oauth ) ; Object [ ] methodArgs = new Object [ 1 ] ; methodArgs [ 0 ] = options ; getDDP ( ) . call ( "login" , methodArgs , new DDPListener ( ) { @ Override public void onResult ( Map < String , Object > jsonFields ) { if ( BuildConfig . DEBUG ) { log . debug ( jsonFields . toString ( ) ) ; } handleLoginResult ( jsonFields ) ; } } ) ; } catch ( JSONException e ) { e . printStackTrace ( ) ; } } } ) ;
public class LazyObject { /** * Returns the double value stored in this object for the given key . * Returns 0.0 if there is no such key . * @ param key the name of the field on this object * @ return the requested double value or 0.0 if there was no such key */ public double optDouble ( String key ) { } }
LazyNode token = getOptionalFieldToken ( key ) ; if ( token == null ) return 0.0 ; if ( token . type == LazyNode . VALUE_NULL ) return 0.0 ; return token . getDoubleValue ( ) ;
public class StringSearch { /** * Checks for identical match * @ param start offset of possible match * @ param end offset of possible match * @ return TRUE if identical match is found */ private boolean checkIdentical ( int start , int end ) { } }
if ( strength_ != Collator . IDENTICAL ) { return true ; } // Note : We could use Normalizer : : compare ( ) or similar , but for short strings // which may not be in FCD it might be faster to just NFD them . String textstr = getString ( targetText , start , end - start ) ; if ( Normalizer . quickCheck ( textstr , Normalizer . NFD , 0 ) == Normalizer . NO ) { textstr = Normalizer . decompose ( textstr , false ) ; } String patternstr = pattern_ . text_ ; if ( Normalizer . quickCheck ( patternstr , Normalizer . NFD , 0 ) == Normalizer . NO ) { patternstr = Normalizer . decompose ( patternstr , false ) ; } return textstr . equals ( patternstr ) ;
public class AggregatorUtil { /** * Only one of fieldName and fieldExpression should be non - null */ static BaseLongColumnValueSelector makeColumnValueSelectorWithLongDefault ( final ColumnSelectorFactory metricFactory , final ExprMacroTable macroTable , @ Nullable final String fieldName , @ Nullable final String fieldExpression , final long nullValue ) { } }
if ( ( fieldName == null ) == ( fieldExpression == null ) ) { throw new IllegalArgumentException ( "Only one of fieldName and fieldExpression should be non-null" ) ; } if ( fieldName != null ) { return metricFactory . makeColumnValueSelector ( fieldName ) ; } else { final Expr expr = Parser . parse ( fieldExpression , macroTable ) ; final ColumnValueSelector < ExprEval > baseSelector = ExpressionSelectors . makeExprEvalSelector ( metricFactory , expr ) ; class ExpressionLongColumnSelector implements LongColumnSelector { @ Override public long getLong ( ) { final ExprEval exprEval = baseSelector . getObject ( ) ; return exprEval . isNumericNull ( ) ? nullValue : exprEval . asLong ( ) ; } @ Override public void inspectRuntimeShape ( RuntimeShapeInspector inspector ) { inspector . visit ( "baseSelector" , baseSelector ) ; } @ Override public boolean isNull ( ) { final ExprEval exprEval = baseSelector . getObject ( ) ; return exprEval == null || exprEval . isNumericNull ( ) ; } } return new ExpressionLongColumnSelector ( ) ; }
public class TransactionSynchronizationFuture { /** * Verify that the transaction id of the data provider is greater or equal to the transaction id in * the given message . * @ param message the return value of the internal future * @ return true if the transaction id of the data provider is greater or equal than the one in the internal message * @ throws CouldNotPerformException if the transaction id of the data provider is not available */ @ Override protected boolean check ( T message ) throws CouldNotPerformException { } }
// get transaction id from message final long transactionId = ( long ) message . getField ( transactionIdField ) ; // to work with older versions where no transaction id has been accept empty ids and print a warning if ( ! message . hasField ( transactionIdField ) || transactionId == 0 ) { logger . warn ( "Received return value without transactionId" ) ; return true ; } // logger . warn ( " Check { } - { } of { } " , transactionId , dataProvider . getTransactionId ( ) , dataProvider . toString ( ) ) ; // check that the received transaction id has been reached by the provider return dataProvider . getTransactionId ( ) >= transactionId ;
public class DbsUtilities { /** * Quick method to convert a query to a map with geometry values . * @ param db the db to use . * @ param sql the query to run . It has to have at least 2 parameters , of which the second has to be a geometry field . The first will be used as key , the second as value . * @ param optionalType can be null . Optional parameter in case one needs a { @ link TreeMap } or something the like . * @ return the map of values from the query . * @ throws Exception */ public static Map < String , Geometry > queryToGeomMap ( ADb db , String sql , Map < String , Geometry > optionalType ) throws Exception { } }
Map < String , Geometry > map = optionalType ; if ( map == null ) { map = new HashMap < > ( ) ; } IGeometryParser gp = db . getType ( ) . getGeometryParser ( ) ; Map < String , Geometry > _map = map ; return db . execOnConnection ( connection -> { try ( IHMStatement stmt = connection . createStatement ( ) ; IHMResultSet rs = stmt . executeQuery ( sql ) ) { while ( rs . next ( ) ) { String key = rs . getObject ( 1 ) . toString ( ) ; Geometry geometry = gp . fromResultSet ( rs , 2 ) ; _map . put ( key , geometry ) ; } return _map ; } } ) ;
public class CachedResultSet { /** * Renames the columns of a CachedResultSet . * @ param names the new names of the columns , starting from the first column . If not enought new names are provided , * the rest columns keep their original name . * @ return this object */ public CachedResultSet rename ( String ... names ) { } }
for ( int i = 0 ; i < names . length ; ++ i ) { this . columns [ i ] = names [ i ] ; } return this ;
public class CircularQueue { /** * Adds a new element to the queue . If the queue isn ' t large enough to store this value then its internal data * array will grow * @ param value Value which is to be added */ public void add ( T value ) { } }
// see if it needs to grow the queue if ( size >= data . length ) { growInnerArray ( ) ; } data [ ( start + size ) % data . length ] = value ; size ++ ;
public class GetPolicyVersionRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetPolicyVersionRequest getPolicyVersionRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getPolicyVersionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getPolicyVersionRequest . getPolicyName ( ) , POLICYNAME_BINDING ) ; protocolMarshaller . marshall ( getPolicyVersionRequest . getPolicyVersionId ( ) , POLICYVERSIONID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class PluginManager { /** * Discover all the service provider implementations of the given class , * via { @ code META - INF / services } . * @ deprecated Use { @ link ServiceLoader } instead , or ( more commonly ) { @ link ExtensionList } . */ @ Deprecated public < T > Collection < Class < ? extends T > > discover ( Class < T > spi ) { } }
Set < Class < ? extends T > > result = new HashSet < > ( ) ; for ( PluginWrapper p : activePlugins ) { Service . load ( spi , p . classLoader , result ) ; } return result ;
public class ViewPropertyAnimatorPreHC { /** * Utility function , called by the various x ( ) , y ( ) , etc . methods . This stores the * constant name for the property along with the from / delta values that will be used to * calculate and set the property during the animation . This structure is added to the * pending animations , awaiting the eventual start ( ) of the underlying animator . A * Runnable is posted to start the animation , and any pending such Runnable is canceled * ( which enables us to end up starting just one animator for all of the properties * specified at one time ) . * @ param constantName The specifier for the property being animated * @ param toValue The value to which the property will animate */ private void animateProperty ( int constantName , float toValue ) { } }
float fromValue = getValue ( constantName ) ; float deltaValue = toValue - fromValue ; animatePropertyBy ( constantName , fromValue , deltaValue ) ;
public class LocaleIDParser { /** * Advance index past script . * Index must be immediately after the language and IDSeparator . * If the item at this position is not a script ( is not four characters * long ) leave index . Otherwise index is left at a terminator or * id separator . */ private void skipScript ( ) { } }
if ( ! atTerminator ( ) ) { int oldIndex = index ; ++ index ; char c ; while ( ! isTerminatorOrIDSeparator ( c = next ( ) ) && AsciiUtil . isAlpha ( c ) ) ; -- index ; if ( index - oldIndex != 5 ) { // + 1 to account for separator index = oldIndex ; } }
public class ConcatVectorNamespace { /** * This adds a dense feature to a vector , setting the appropriate component of the given vector to the passed in * value . * @ param vector the vector * @ param featureName the feature whose value to set * @ param value the value we want to set this vector to */ public void setDenseFeature ( ConcatVector vector , String featureName , double [ ] value ) { } }
vector . setDenseComponent ( ensureFeature ( featureName ) , value ) ;
public class CylinderRenderer { /** * Draws a cylinder to represent one data item . * @ param g2 the graphics device . * @ param state the renderer state . * @ param dataArea the area for plotting the data . * @ param plot the plot . * @ param domainAxis the domain axis . * @ param rangeAxis the range axis . * @ param dataset the dataset . * @ param row the row index ( zero - based ) . * @ param column the column index ( zero - based ) . * @ param pass the pass index . */ public void drawItem ( Graphics2D g2 , CategoryItemRendererState state , Rectangle2D dataArea , CategoryPlot plot , CategoryAxis domainAxis , ValueAxis rangeAxis , CategoryDataset dataset , int row , int column , int pass ) { } }
// check the value we are plotting . . . Number dataValue = dataset . getValue ( row , column ) ; if ( dataValue == null ) { return ; } double value = dataValue . doubleValue ( ) ; Rectangle2D adjusted = new Rectangle2D . Double ( dataArea . getX ( ) , dataArea . getY ( ) + getYOffset ( ) , dataArea . getWidth ( ) - getXOffset ( ) , dataArea . getHeight ( ) - getYOffset ( ) ) ; PlotOrientation orientation = plot . getOrientation ( ) ; double barW0 = calculateBarW0 ( plot , orientation , adjusted , domainAxis , state , row , column ) ; double [ ] barL0L1 = calculateBarL0L1 ( value ) ; if ( barL0L1 == null ) { return ; // the bar is not visible } RectangleEdge edge = plot . getRangeAxisEdge ( ) ; float transL0 = ( float ) rangeAxis . valueToJava2D ( barL0L1 [ 0 ] , adjusted , edge ) ; float transL1 = ( float ) rangeAxis . valueToJava2D ( barL0L1 [ 1 ] , adjusted , edge ) ; float barL0 = Math . min ( transL0 , transL1 ) ; float barLength = Math . abs ( transL1 - transL0 ) ; // draw the bar . . . GeneralPath bar = new GeneralPath ( ) ; if ( orientation == PlotOrientation . HORIZONTAL ) { bar . moveTo ( barL0 , ( float ) barW0 ) ; bar . lineTo ( barL0 , ( float ) ( barW0 + state . getBarWidth ( ) ) ) ; bar . lineTo ( barL0 + barLength , ( float ) ( barW0 + state . getBarWidth ( ) ) ) ; bar . lineTo ( barL0 + barLength , ( float ) barW0 ) ; bar . closePath ( ) ; } else { bar . moveTo ( ( float ) barW0 , ( float ) ( barL0 - getYOffset ( ) / 2 ) ) ; bar . lineTo ( ( float ) barW0 , ( float ) ( barL0 + barLength - getYOffset ( ) / 2 ) ) ; Arc2D arc = new Arc2D . Double ( barW0 , ( barL0 + barLength - getYOffset ( ) ) , state . getBarWidth ( ) , getYOffset ( ) , 180 , 180 , Arc2D . OPEN ) ; bar . append ( arc , true ) ; bar . lineTo ( ( float ) ( barW0 + state . getBarWidth ( ) ) , ( float ) ( barL0 - getYOffset ( ) / 2 ) ) ; arc = new Arc2D . Double ( barW0 , ( barL0 - getYOffset ( ) ) , state . getBarWidth ( ) , getYOffset ( ) , 0 , - 180 , Arc2D . OPEN ) ; bar . append ( arc , true ) ; bar . closePath ( ) ; } Paint itemPaint = getItemPaint ( row , column ) ; if ( getGradientPaintTransformer ( ) != null && itemPaint instanceof GradientPaint ) { GradientPaint gp = ( GradientPaint ) itemPaint ; itemPaint = getGradientPaintTransformer ( ) . transform ( gp , bar ) ; } g2 . setPaint ( itemPaint ) ; g2 . fill ( bar ) ; Shape bar3dTop = new Ellipse2D . Double ( barW0 , barL0 - getYOffset ( ) , state . getBarWidth ( ) , getYOffset ( ) ) ; if ( itemPaint instanceof GradientPaint ) { g2 . setPaint ( ( ( GradientPaint ) itemPaint ) . getColor2 ( ) ) ; } g2 . fill ( bar3dTop ) ; if ( isDrawBarOutline ( ) && state . getBarWidth ( ) > BAR_OUTLINE_WIDTH_THRESHOLD ) { g2 . setStroke ( getItemOutlineStroke ( row , column ) ) ; g2 . setPaint ( getItemOutlinePaint ( row , column ) ) ; g2 . draw ( bar ) ; if ( bar3dTop != null ) { g2 . draw ( bar3dTop ) ; } } CategoryItemLabelGenerator generator = getItemLabelGenerator ( row , column ) ; if ( generator != null && isItemLabelVisible ( row , column ) ) { drawItemLabel ( g2 , dataset , row , column , plot , generator , bar . getBounds2D ( ) , ( value < 0.0 ) ) ; } // collect entity and tool tip information . . . if ( state . getInfo ( ) != null ) { EntityCollection entities = state . getEntityCollection ( ) ; if ( entities != null ) { String tip = null ; CategoryToolTipGenerator tipster = getToolTipGenerator ( row , column ) ; if ( tipster != null ) { tip = tipster . generateToolTip ( dataset , row , column ) ; } String url = null ; if ( getItemURLGenerator ( row , column ) != null ) { url = getItemURLGenerator ( row , column ) . generateURL ( dataset , row , column ) ; } CategoryItemEntity entity = new CategoryItemEntity ( bar . getBounds2D ( ) , tip , url , dataset , dataset . getRowKey ( row ) , dataset . getColumnKey ( column ) ) ; entities . add ( entity ) ; } }
public class XmlRuleSet { /** * Parses the file at the given location and creates a { @ link Document } instance to read the rules from . * @ param location location of the XML file * @ return { @ link Document } instance representing the XML file */ private Document buildDocument ( String location ) { } }
try { return documentBuilderFactory . newDocumentBuilder ( ) . parse ( ClassPathResource . asInputStream ( location ) ) ; } catch ( ParserConfigurationException | SAXException | IOException | RuntimeException e ) { throw new XmlRuleSetException ( "Could not parse RuleSet from given location '" + location + "'." , e ) ; }
public class ListAssessmentRunAgentsResult { /** * A list of ARNs that specifies the agents returned by the action . * @ param assessmentRunAgents * A list of ARNs that specifies the agents returned by the action . */ public void setAssessmentRunAgents ( java . util . Collection < AssessmentRunAgent > assessmentRunAgents ) { } }
if ( assessmentRunAgents == null ) { this . assessmentRunAgents = null ; return ; } this . assessmentRunAgents = new java . util . ArrayList < AssessmentRunAgent > ( assessmentRunAgents ) ;
public class GeneralUtils { /** * Converts an expression into the String source . Only some specific expressions like closure expression * support this . * @ param readerSource a source * @ param expression an expression . Can ' t be null * @ return the source the closure was created from * @ throws java . lang . IllegalArgumentException when expression is null * @ throws java . lang . Exception when closure can ' t be read from source */ public static String convertASTToSource ( ReaderSource readerSource , ASTNode expression ) throws Exception { } }
if ( expression == null ) throw new IllegalArgumentException ( "Null: expression" ) ; StringBuilder result = new StringBuilder ( ) ; for ( int x = expression . getLineNumber ( ) ; x <= expression . getLastLineNumber ( ) ; x ++ ) { String line = readerSource . getLine ( x , null ) ; if ( line == null ) { throw new Exception ( "Error calculating source code for expression. Trying to read line " + x + " from " + readerSource . getClass ( ) ) ; } if ( x == expression . getLastLineNumber ( ) ) { line = line . substring ( 0 , expression . getLastColumnNumber ( ) - 1 ) ; } if ( x == expression . getLineNumber ( ) ) { line = line . substring ( expression . getColumnNumber ( ) - 1 ) ; } // restoring line breaks is important b / c of lack of semicolons result . append ( line ) . append ( '\n' ) ; } String source = result . toString ( ) . trim ( ) ; return source ;
public class MessageManager { /** * Starts an AsyncTask to pre - fetch messages . This is to be called as part of Push notification action * when push is received on the device . */ public void startMessagePreFetchTask ( ) { } }
try { boolean updateMC = isMessageCenterInForeground ( ) ; fetchAndStoreMessages ( updateMC , false , null ) ; } catch ( final Exception e ) { ApptentiveLog . w ( MESSAGES , e , "Unhandled Exception thrown from fetching new message task" ) ; logException ( e ) ; }
public class Interpreter { /** * Evaluate zero or more conditional expressions , and check whether any is * false . If so , raise an exception indicating a runtime fault . * @ param frame * @ param context * @ param invariants */ public void checkInvariants ( CallStack frame , Expr ... invariants ) { } }
for ( int i = 0 ; i != invariants . length ; ++ i ) { RValue . Bool b = executeExpression ( BOOL_T , invariants [ i ] , frame ) ; if ( b == RValue . False ) { // FIXME : need to do more here throw new AssertionError ( ) ; } }
public class Analyser { /** * USE _ INFINITE _ REPEAT _ MONOMANIAC _ MEM _ STATUS _ CHECK */ private int quantifiersMemoryInfo ( Node node ) { } }
int info = 0 ; switch ( node . getType ( ) ) { case NodeType . LIST : case NodeType . ALT : ListNode can = ( ListNode ) node ; do { int v = quantifiersMemoryInfo ( can . value ) ; if ( v > info ) info = v ; } while ( ( can = can . tail ) != null ) ; break ; case NodeType . CALL : if ( Config . USE_SUBEXP_CALL ) { CallNode cn = ( CallNode ) node ; if ( cn . isRecursion ( ) ) { return TargetInfo . IS_EMPTY_REC ; /* tiny version */ } else { info = quantifiersMemoryInfo ( cn . target ) ; } } // USE _ SUBEXP _ CALL break ; case NodeType . QTFR : QuantifierNode qn = ( QuantifierNode ) node ; if ( qn . upper != 0 ) { info = quantifiersMemoryInfo ( qn . target ) ; } break ; case NodeType . ENCLOSE : EncloseNode en = ( EncloseNode ) node ; switch ( en . type ) { case EncloseType . MEMORY : return TargetInfo . IS_EMPTY_MEM ; case EncloseType . OPTION : case EncloseNode . STOP_BACKTRACK : case EncloseNode . CONDITION : case EncloseNode . ABSENT : info = quantifiersMemoryInfo ( en . target ) ; break ; default : break ; } // inner switch break ; case NodeType . BREF : case NodeType . STR : case NodeType . CTYPE : case NodeType . CCLASS : case NodeType . CANY : case NodeType . ANCHOR : default : break ; } // switch return info ;
public class SQLiteExecutor { /** * Returns values from all rows associated with the specified < code > targetClass < / code > if the specified < code > targetClass < / code > is an entity class , otherwise , only returns values from first column . * @ param targetClass entity class or specific column type . * @ param cursor * @ param offset * @ param count * @ return */ static < T > List < T > toList ( Class < T > targetClass , Cursor cursor , int offset , int count ) { } }
if ( N . isEntity ( targetClass ) ) { final DataSet ds = extractData ( targetClass , cursor , offset , count ) ; if ( ds == null || ds . isEmpty ( ) ) { return new ArrayList < > ( ) ; } else { return ds . toList ( targetClass ) ; } } else { return toList ( targetClass , cursor , 0 , offset , count ) ; }
public class BinaryJedis { /** * Atomically renames the key oldkey to newkey . If the source and destination name are the same an * error is returned . If newkey already exists it is overwritten . * Time complexity : O ( 1) * @ param oldkey * @ param newkey * @ return Status code repy */ @ Override public String rename ( final byte [ ] oldkey , final byte [ ] newkey ) { } }
checkIsInMultiOrPipeline ( ) ; client . rename ( oldkey , newkey ) ; return client . getStatusCodeReply ( ) ;
public class MGORGImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . MGORG__RG_LENGTH : return RG_LENGTH_EDEFAULT == null ? rgLength != null : ! RG_LENGTH_EDEFAULT . equals ( rgLength ) ; case AfplibPackage . MGORG__TRIPLETS : return triplets != null && ! triplets . isEmpty ( ) ; } return super . eIsSet ( featureID ) ;
public class Version { /** * See ISO 18004:2006 6.5.1 Table 9 */ private static Version [ ] buildVersions ( ) { } }
return new Version [ ] { new Version ( 1 , new int [ ] { } , new ECBlocks ( 7 , new ECB ( 1 , 19 ) ) , new ECBlocks ( 10 , new ECB ( 1 , 16 ) ) , new ECBlocks ( 13 , new ECB ( 1 , 13 ) ) , new ECBlocks ( 17 , new ECB ( 1 , 9 ) ) ) , new Version ( 2 , new int [ ] { 6 , 18 } , new ECBlocks ( 10 , new ECB ( 1 , 34 ) ) , new ECBlocks ( 16 , new ECB ( 1 , 28 ) ) , new ECBlocks ( 22 , new ECB ( 1 , 22 ) ) , new ECBlocks ( 28 , new ECB ( 1 , 16 ) ) ) , new Version ( 3 , new int [ ] { 6 , 22 } , new ECBlocks ( 15 , new ECB ( 1 , 55 ) ) , new ECBlocks ( 26 , new ECB ( 1 , 44 ) ) , new ECBlocks ( 18 , new ECB ( 2 , 17 ) ) , new ECBlocks ( 22 , new ECB ( 2 , 13 ) ) ) , new Version ( 4 , new int [ ] { 6 , 26 } , new ECBlocks ( 20 , new ECB ( 1 , 80 ) ) , new ECBlocks ( 18 , new ECB ( 2 , 32 ) ) , new ECBlocks ( 26 , new ECB ( 2 , 24 ) ) , new ECBlocks ( 16 , new ECB ( 4 , 9 ) ) ) , new Version ( 5 , new int [ ] { 6 , 30 } , new ECBlocks ( 26 , new ECB ( 1 , 108 ) ) , new ECBlocks ( 24 , new ECB ( 2 , 43 ) ) , new ECBlocks ( 18 , new ECB ( 2 , 15 ) , new ECB ( 2 , 16 ) ) , new ECBlocks ( 22 , new ECB ( 2 , 11 ) , new ECB ( 2 , 12 ) ) ) , new Version ( 6 , new int [ ] { 6 , 34 } , new ECBlocks ( 18 , new ECB ( 2 , 68 ) ) , new ECBlocks ( 16 , new ECB ( 4 , 27 ) ) , new ECBlocks ( 24 , new ECB ( 4 , 19 ) ) , new ECBlocks ( 28 , new ECB ( 4 , 15 ) ) ) , new Version ( 7 , new int [ ] { 6 , 22 , 38 } , new ECBlocks ( 20 , new ECB ( 2 , 78 ) ) , new ECBlocks ( 18 , new ECB ( 4 , 31 ) ) , new ECBlocks ( 18 , new ECB ( 2 , 14 ) , new ECB ( 4 , 15 ) ) , new ECBlocks ( 26 , new ECB ( 4 , 13 ) , new ECB ( 1 , 14 ) ) ) , new Version ( 8 , new int [ ] { 6 , 24 , 42 } , new ECBlocks ( 24 , new ECB ( 2 , 97 ) ) , new ECBlocks ( 22 , new ECB ( 2 , 38 ) , new ECB ( 2 , 39 ) ) , new ECBlocks ( 22 , new ECB ( 4 , 18 ) , new ECB ( 2 , 19 ) ) , new ECBlocks ( 26 , new ECB ( 4 , 14 ) , new ECB ( 2 , 15 ) ) ) , new Version ( 9 , new int [ ] { 6 , 26 , 46 } , new ECBlocks ( 30 , new ECB ( 2 , 116 ) ) , new ECBlocks ( 22 , new ECB ( 3 , 36 ) , new ECB ( 2 , 37 ) ) , new ECBlocks ( 20 , new ECB ( 4 , 16 ) , new ECB ( 4 , 17 ) ) , new ECBlocks ( 24 , new ECB ( 4 , 12 ) , new ECB ( 4 , 13 ) ) ) , new Version ( 10 , new int [ ] { 6 , 28 , 50 } , new ECBlocks ( 18 , new ECB ( 2 , 68 ) , new ECB ( 2 , 69 ) ) , new ECBlocks ( 26 , new ECB ( 4 , 43 ) , new ECB ( 1 , 44 ) ) , new ECBlocks ( 24 , new ECB ( 6 , 19 ) , new ECB ( 2 , 20 ) ) , new ECBlocks ( 28 , new ECB ( 6 , 15 ) , new ECB ( 2 , 16 ) ) ) , new Version ( 11 , new int [ ] { 6 , 30 , 54 } , new ECBlocks ( 20 , new ECB ( 4 , 81 ) ) , new ECBlocks ( 30 , new ECB ( 1 , 50 ) , new ECB ( 4 , 51 ) ) , new ECBlocks ( 28 , new ECB ( 4 , 22 ) , new ECB ( 4 , 23 ) ) , new ECBlocks ( 24 , new ECB ( 3 , 12 ) , new ECB ( 8 , 13 ) ) ) , new Version ( 12 , new int [ ] { 6 , 32 , 58 } , new ECBlocks ( 24 , new ECB ( 2 , 92 ) , new ECB ( 2 , 93 ) ) , new ECBlocks ( 22 , new ECB ( 6 , 36 ) , new ECB ( 2 , 37 ) ) , new ECBlocks ( 26 , new ECB ( 4 , 20 ) , new ECB ( 6 , 21 ) ) , new ECBlocks ( 28 , new ECB ( 7 , 14 ) , new ECB ( 4 , 15 ) ) ) , new Version ( 13 , new int [ ] { 6 , 34 , 62 } , new ECBlocks ( 26 , new ECB ( 4 , 107 ) ) , new ECBlocks ( 22 , new ECB ( 8 , 37 ) , new ECB ( 1 , 38 ) ) , new ECBlocks ( 24 , new ECB ( 8 , 20 ) , new ECB ( 4 , 21 ) ) , new ECBlocks ( 22 , new ECB ( 12 , 11 ) , new ECB ( 4 , 12 ) ) ) , new Version ( 14 , new int [ ] { 6 , 26 , 46 , 66 } , new ECBlocks ( 30 , new ECB ( 3 , 115 ) , new ECB ( 1 , 116 ) ) , new ECBlocks ( 24 , new ECB ( 4 , 40 ) , new ECB ( 5 , 41 ) ) , new ECBlocks ( 20 , new ECB ( 11 , 16 ) , new ECB ( 5 , 17 ) ) , new ECBlocks ( 24 , new ECB ( 11 , 12 ) , new ECB ( 5 , 13 ) ) ) , new Version ( 15 , new int [ ] { 6 , 26 , 48 , 70 } , new ECBlocks ( 22 , new ECB ( 5 , 87 ) , new ECB ( 1 , 88 ) ) , new ECBlocks ( 24 , new ECB ( 5 , 41 ) , new ECB ( 5 , 42 ) ) , new ECBlocks ( 30 , new ECB ( 5 , 24 ) , new ECB ( 7 , 25 ) ) , new ECBlocks ( 24 , new ECB ( 11 , 12 ) , new ECB ( 7 , 13 ) ) ) , new Version ( 16 , new int [ ] { 6 , 26 , 50 , 74 } , new ECBlocks ( 24 , new ECB ( 5 , 98 ) , new ECB ( 1 , 99 ) ) , new ECBlocks ( 28 , new ECB ( 7 , 45 ) , new ECB ( 3 , 46 ) ) , new ECBlocks ( 24 , new ECB ( 15 , 19 ) , new ECB ( 2 , 20 ) ) , new ECBlocks ( 30 , new ECB ( 3 , 15 ) , new ECB ( 13 , 16 ) ) ) , new Version ( 17 , new int [ ] { 6 , 30 , 54 , 78 } , new ECBlocks ( 28 , new ECB ( 1 , 107 ) , new ECB ( 5 , 108 ) ) , new ECBlocks ( 28 , new ECB ( 10 , 46 ) , new ECB ( 1 , 47 ) ) , new ECBlocks ( 28 , new ECB ( 1 , 22 ) , new ECB ( 15 , 23 ) ) , new ECBlocks ( 28 , new ECB ( 2 , 14 ) , new ECB ( 17 , 15 ) ) ) , new Version ( 18 , new int [ ] { 6 , 30 , 56 , 82 } , new ECBlocks ( 30 , new ECB ( 5 , 120 ) , new ECB ( 1 , 121 ) ) , new ECBlocks ( 26 , new ECB ( 9 , 43 ) , new ECB ( 4 , 44 ) ) , new ECBlocks ( 28 , new ECB ( 17 , 22 ) , new ECB ( 1 , 23 ) ) , new ECBlocks ( 28 , new ECB ( 2 , 14 ) , new ECB ( 19 , 15 ) ) ) , new Version ( 19 , new int [ ] { 6 , 30 , 58 , 86 } , new ECBlocks ( 28 , new ECB ( 3 , 113 ) , new ECB ( 4 , 114 ) ) , new ECBlocks ( 26 , new ECB ( 3 , 44 ) , new ECB ( 11 , 45 ) ) , new ECBlocks ( 26 , new ECB ( 17 , 21 ) , new ECB ( 4 , 22 ) ) , new ECBlocks ( 26 , new ECB ( 9 , 13 ) , new ECB ( 16 , 14 ) ) ) , new Version ( 20 , new int [ ] { 6 , 34 , 62 , 90 } , new ECBlocks ( 28 , new ECB ( 3 , 107 ) , new ECB ( 5 , 108 ) ) , new ECBlocks ( 26 , new ECB ( 3 , 41 ) , new ECB ( 13 , 42 ) ) , new ECBlocks ( 30 , new ECB ( 15 , 24 ) , new ECB ( 5 , 25 ) ) , new ECBlocks ( 28 , new ECB ( 15 , 15 ) , new ECB ( 10 , 16 ) ) ) , new Version ( 21 , new int [ ] { 6 , 28 , 50 , 72 , 94 } , new ECBlocks ( 28 , new ECB ( 4 , 116 ) , new ECB ( 4 , 117 ) ) , new ECBlocks ( 26 , new ECB ( 17 , 42 ) ) , new ECBlocks ( 28 , new ECB ( 17 , 22 ) , new ECB ( 6 , 23 ) ) , new ECBlocks ( 30 , new ECB ( 19 , 16 ) , new ECB ( 6 , 17 ) ) ) , new Version ( 22 , new int [ ] { 6 , 26 , 50 , 74 , 98 } , new ECBlocks ( 28 , new ECB ( 2 , 111 ) , new ECB ( 7 , 112 ) ) , new ECBlocks ( 28 , new ECB ( 17 , 46 ) ) , new ECBlocks ( 30 , new ECB ( 7 , 24 ) , new ECB ( 16 , 25 ) ) , new ECBlocks ( 24 , new ECB ( 34 , 13 ) ) ) , new Version ( 23 , new int [ ] { 6 , 30 , 54 , 78 , 102 } , new ECBlocks ( 30 , new ECB ( 4 , 121 ) , new ECB ( 5 , 122 ) ) , new ECBlocks ( 28 , new ECB ( 4 , 47 ) , new ECB ( 14 , 48 ) ) , new ECBlocks ( 30 , new ECB ( 11 , 24 ) , new ECB ( 14 , 25 ) ) , new ECBlocks ( 30 , new ECB ( 16 , 15 ) , new ECB ( 14 , 16 ) ) ) , new Version ( 24 , new int [ ] { 6 , 28 , 54 , 80 , 106 } , new ECBlocks ( 30 , new ECB ( 6 , 117 ) , new ECB ( 4 , 118 ) ) , new ECBlocks ( 28 , new ECB ( 6 , 45 ) , new ECB ( 14 , 46 ) ) , new ECBlocks ( 30 , new ECB ( 11 , 24 ) , new ECB ( 16 , 25 ) ) , new ECBlocks ( 30 , new ECB ( 30 , 16 ) , new ECB ( 2 , 17 ) ) ) , new Version ( 25 , new int [ ] { 6 , 32 , 58 , 84 , 110 } , new ECBlocks ( 26 , new ECB ( 8 , 106 ) , new ECB ( 4 , 107 ) ) , new ECBlocks ( 28 , new ECB ( 8 , 47 ) , new ECB ( 13 , 48 ) ) , new ECBlocks ( 30 , new ECB ( 7 , 24 ) , new ECB ( 22 , 25 ) ) , new ECBlocks ( 30 , new ECB ( 22 , 15 ) , new ECB ( 13 , 16 ) ) ) , new Version ( 26 , new int [ ] { 6 , 30 , 58 , 86 , 114 } , new ECBlocks ( 28 , new ECB ( 10 , 114 ) , new ECB ( 2 , 115 ) ) , new ECBlocks ( 28 , new ECB ( 19 , 46 ) , new ECB ( 4 , 47 ) ) , new ECBlocks ( 28 , new ECB ( 28 , 22 ) , new ECB ( 6 , 23 ) ) , new ECBlocks ( 30 , new ECB ( 33 , 16 ) , new ECB ( 4 , 17 ) ) ) , new Version ( 27 , new int [ ] { 6 , 34 , 62 , 90 , 118 } , new ECBlocks ( 30 , new ECB ( 8 , 122 ) , new ECB ( 4 , 123 ) ) , new ECBlocks ( 28 , new ECB ( 22 , 45 ) , new ECB ( 3 , 46 ) ) , new ECBlocks ( 30 , new ECB ( 8 , 23 ) , new ECB ( 26 , 24 ) ) , new ECBlocks ( 30 , new ECB ( 12 , 15 ) , new ECB ( 28 , 16 ) ) ) , new Version ( 28 , new int [ ] { 6 , 26 , 50 , 74 , 98 , 122 } , new ECBlocks ( 30 , new ECB ( 3 , 117 ) , new ECB ( 10 , 118 ) ) , new ECBlocks ( 28 , new ECB ( 3 , 45 ) , new ECB ( 23 , 46 ) ) , new ECBlocks ( 30 , new ECB ( 4 , 24 ) , new ECB ( 31 , 25 ) ) , new ECBlocks ( 30 , new ECB ( 11 , 15 ) , new ECB ( 31 , 16 ) ) ) , new Version ( 29 , new int [ ] { 6 , 30 , 54 , 78 , 102 , 126 } , new ECBlocks ( 30 , new ECB ( 7 , 116 ) , new ECB ( 7 , 117 ) ) , new ECBlocks ( 28 , new ECB ( 21 , 45 ) , new ECB ( 7 , 46 ) ) , new ECBlocks ( 30 , new ECB ( 1 , 23 ) , new ECB ( 37 , 24 ) ) , new ECBlocks ( 30 , new ECB ( 19 , 15 ) , new ECB ( 26 , 16 ) ) ) , new Version ( 30 , new int [ ] { 6 , 26 , 52 , 78 , 104 , 130 } , new ECBlocks ( 30 , new ECB ( 5 , 115 ) , new ECB ( 10 , 116 ) ) , new ECBlocks ( 28 , new ECB ( 19 , 47 ) , new ECB ( 10 , 48 ) ) , new ECBlocks ( 30 , new ECB ( 15 , 24 ) , new ECB ( 25 , 25 ) ) , new ECBlocks ( 30 , new ECB ( 23 , 15 ) , new ECB ( 25 , 16 ) ) ) , new Version ( 31 , new int [ ] { 6 , 30 , 56 , 82 , 108 , 134 } , new ECBlocks ( 30 , new ECB ( 13 , 115 ) , new ECB ( 3 , 116 ) ) , new ECBlocks ( 28 , new ECB ( 2 , 46 ) , new ECB ( 29 , 47 ) ) , new ECBlocks ( 30 , new ECB ( 42 , 24 ) , new ECB ( 1 , 25 ) ) , new ECBlocks ( 30 , new ECB ( 23 , 15 ) , new ECB ( 28 , 16 ) ) ) , new Version ( 32 , new int [ ] { 6 , 34 , 60 , 86 , 112 , 138 } , new ECBlocks ( 30 , new ECB ( 17 , 115 ) ) , new ECBlocks ( 28 , new ECB ( 10 , 46 ) , new ECB ( 23 , 47 ) ) , new ECBlocks ( 30 , new ECB ( 10 , 24 ) , new ECB ( 35 , 25 ) ) , new ECBlocks ( 30 , new ECB ( 19 , 15 ) , new ECB ( 35 , 16 ) ) ) , new Version ( 33 , new int [ ] { 6 , 30 , 58 , 86 , 114 , 142 } , new ECBlocks ( 30 , new ECB ( 17 , 115 ) , new ECB ( 1 , 116 ) ) , new ECBlocks ( 28 , new ECB ( 14 , 46 ) , new ECB ( 21 , 47 ) ) , new ECBlocks ( 30 , new ECB ( 29 , 24 ) , new ECB ( 19 , 25 ) ) , new ECBlocks ( 30 , new ECB ( 11 , 15 ) , new ECB ( 46 , 16 ) ) ) , new Version ( 34 , new int [ ] { 6 , 34 , 62 , 90 , 118 , 146 } , new ECBlocks ( 30 , new ECB ( 13 , 115 ) , new ECB ( 6 , 116 ) ) , new ECBlocks ( 28 , new ECB ( 14 , 46 ) , new ECB ( 23 , 47 ) ) , new ECBlocks ( 30 , new ECB ( 44 , 24 ) , new ECB ( 7 , 25 ) ) , new ECBlocks ( 30 , new ECB ( 59 , 16 ) , new ECB ( 1 , 17 ) ) ) , new Version ( 35 , new int [ ] { 6 , 30 , 54 , 78 , 102 , 126 , 150 } , new ECBlocks ( 30 , new ECB ( 12 , 121 ) , new ECB ( 7 , 122 ) ) , new ECBlocks ( 28 , new ECB ( 12 , 47 ) , new ECB ( 26 , 48 ) ) , new ECBlocks ( 30 , new ECB ( 39 , 24 ) , new ECB ( 14 , 25 ) ) , new ECBlocks ( 30 , new ECB ( 22 , 15 ) , new ECB ( 41 , 16 ) ) ) , new Version ( 36 , new int [ ] { 6 , 24 , 50 , 76 , 102 , 128 , 154 } , new ECBlocks ( 30 , new ECB ( 6 , 121 ) , new ECB ( 14 , 122 ) ) , new ECBlocks ( 28 , new ECB ( 6 , 47 ) , new ECB ( 34 , 48 ) ) , new ECBlocks ( 30 , new ECB ( 46 , 24 ) , new ECB ( 10 , 25 ) ) , new ECBlocks ( 30 , new ECB ( 2 , 15 ) , new ECB ( 64 , 16 ) ) ) , new Version ( 37 , new int [ ] { 6 , 28 , 54 , 80 , 106 , 132 , 158 } , new ECBlocks ( 30 , new ECB ( 17 , 122 ) , new ECB ( 4 , 123 ) ) , new ECBlocks ( 28 , new ECB ( 29 , 46 ) , new ECB ( 14 , 47 ) ) , new ECBlocks ( 30 , new ECB ( 49 , 24 ) , new ECB ( 10 , 25 ) ) , new ECBlocks ( 30 , new ECB ( 24 , 15 ) , new ECB ( 46 , 16 ) ) ) , new Version ( 38 , new int [ ] { 6 , 32 , 58 , 84 , 110 , 136 , 162 } , new ECBlocks ( 30 , new ECB ( 4 , 122 ) , new ECB ( 18 , 123 ) ) , new ECBlocks ( 28 , new ECB ( 13 , 46 ) , new ECB ( 32 , 47 ) ) , new ECBlocks ( 30 , new ECB ( 48 , 24 ) , new ECB ( 14 , 25 ) ) , new ECBlocks ( 30 , new ECB ( 42 , 15 ) , new ECB ( 32 , 16 ) ) ) , new Version ( 39 , new int [ ] { 6 , 26 , 54 , 82 , 110 , 138 , 166 } , new ECBlocks ( 30 , new ECB ( 20 , 117 ) , new ECB ( 4 , 118 ) ) , new ECBlocks ( 28 , new ECB ( 40 , 47 ) , new ECB ( 7 , 48 ) ) , new ECBlocks ( 30 , new ECB ( 43 , 24 ) , new ECB ( 22 , 25 ) ) , new ECBlocks ( 30 , new ECB ( 10 , 15 ) , new ECB ( 67 , 16 ) ) ) , new Version ( 40 , new int [ ] { 6 , 30 , 58 , 86 , 114 , 142 , 170 } , new ECBlocks ( 30 , new ECB ( 19 , 118 ) , new ECB ( 6 , 119 ) ) , new ECBlocks ( 28 , new ECB ( 18 , 47 ) , new ECB ( 31 , 48 ) ) , new ECBlocks ( 30 , new ECB ( 34 , 24 ) , new ECB ( 34 , 25 ) ) , new ECBlocks ( 30 , new ECB ( 20 , 15 ) , new ECB ( 61 , 16 ) ) ) } ;
public class SQLStore { /** * { @ inheritDoc } */ @ Override public void reset ( ) { } }
ensureOpen ( ) ; String sql = String . format ( "Delete from %s_property" , className ) ; database . execSQL ( sql ) ;
public class HurlStack { /** * Opens an { @ link HttpURLConnection } with parameters . * @ param url * @ return an open connection * @ throws IOException */ private HttpURLConnection openConnection ( URL url , Request < ? > request ) throws IOException { } }
HttpURLConnection connection = createConnection ( url ) ; int timeoutMs = request . getTimeoutMs ( ) ; connection . setConnectTimeout ( timeoutMs ) ; connection . setReadTimeout ( timeoutMs ) ; connection . setUseCaches ( false ) ; connection . setDoInput ( true ) ; // use caller - provided custom SslSocketFactory , if any , for HTTPS if ( "https" . equals ( url . getProtocol ( ) ) && mSslSocketFactory != null ) { ( ( HttpsURLConnection ) connection ) . setSSLSocketFactory ( mSslSocketFactory ) ; } return connection ;
public class SQLTimeAccessor { /** * ( non - Javadoc ) * @ see * com . impetus . kundera . property . PropertyAccessor # fromString ( java . lang . String */ @ Override public Time fromString ( Class targetClass , String s ) { } }
if ( s == null ) { return null ; } if ( StringUtils . isNumeric ( s ) ) { return new Time ( Long . parseLong ( s ) ) ; } Time t = Time . valueOf ( s ) ; return t ;
public class LibraryUtils { /** * Convert an * < a href = " http : / / docs . oracle . com / javase / 7 / docs / api / java / io / InputStream . html " > InputSteam < / a > to a byte array . * @ param inputStream the < code > InputStream < / code > to convert . * @ return a byte array containing the data from the input stream . * @ throws IOException if the < code > InputStream < / code > could not be converted . */ public static byte [ ] toByteArray ( InputStream inputStream ) throws IOException { } }
ByteArrayOutputStream buffer = new ByteArrayOutputStream ( ) ; int nRead ; byte [ ] bytes = new byte [ 1024 ] ; while ( ( nRead = inputStream . read ( bytes , 0 , 1024 ) ) != - 1 ) { buffer . write ( bytes , 0 , nRead ) ; } return buffer . toByteArray ( ) ;
public class CrateDigger { /** * Send a database announcement to all registered listeners . * @ param slot the media slot whose database availability has changed * @ param database the database whose relevance has changed * @ param available if { @ code } true , the database is newly available , otherwise it is no longer relevant */ private void deliverDatabaseUpdate ( SlotReference slot , Database database , boolean available ) { } }
for ( final DatabaseListener listener : getDatabaseListeners ( ) ) { try { if ( available ) { listener . databaseMounted ( slot , database ) ; } else { listener . databaseUnmounted ( slot , database ) ; } } catch ( Throwable t ) { logger . warn ( "Problem delivering rekordbox database availability update to listener" , t ) ; } }
public class BulkEmailDestination { /** * A list of tags , in the form of name / value pairs , to apply to an email that you send using * < code > SendBulkTemplatedEmail < / code > . Tags correspond to characteristics of the email that you define , so that you * can publish email sending events . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setReplacementTags ( java . util . Collection ) } or { @ link # withReplacementTags ( java . util . Collection ) } if you * want to override the existing values . * @ param replacementTags * A list of tags , in the form of name / value pairs , to apply to an email that you send using * < code > SendBulkTemplatedEmail < / code > . Tags correspond to characteristics of the email that you define , so * that you can publish email sending events . * @ return Returns a reference to this object so that method calls can be chained together . */ public BulkEmailDestination withReplacementTags ( MessageTag ... replacementTags ) { } }
if ( this . replacementTags == null ) { setReplacementTags ( new com . amazonaws . internal . SdkInternalList < MessageTag > ( replacementTags . length ) ) ; } for ( MessageTag ele : replacementTags ) { this . replacementTags . add ( ele ) ; } return this ;
public class FilePathProcessor { /** * Apply a function to the files under a given directory and * perhaps its subdirectories . If the path is a directory then only * files within the directory ( perhaps recursively ) that satisfy the * filter are processed . If the < code > path < / code > is a file , then * that file is processed regardless of whether it satisfies the * filter . ( This semantics was adopted , since otherwise there was no * easy way to go through all the files in a directory without * descending recursively via the specification of a * < code > FileFilter < / code > . ) * @ param path file or directory to load from * @ param filter a FileFilter of files to load . The filter may be null , * and then all files are processed . * @ param processor The < code > FileProcessor < / code > to apply to each * < code > File < / code > */ public static void processPath ( File path , FileFilter filter , FileProcessor processor ) { } }
if ( path . isDirectory ( ) ) { // if path is a directory , look into it File [ ] directoryListing = path . listFiles ( filter ) ; if ( directoryListing == null ) { throw new IllegalArgumentException ( "Directory access problem for: " + path ) ; } for ( File file : directoryListing ) { processPath ( file , filter , processor ) ; } } else { // it ' s already passed the filter or was uniquely specified // if ( filter . accept ( path ) ) processor . processFile ( path ) ; }
public class CmsSubscriptionDriver { /** * Build the whole WHERE SQL statement part for the given visit entry filter . < p > * @ param filter the filter * @ return a pair containing both the SQL and the parameters for it */ protected CmsPair < String , List < I_CmsPreparedStatementParameter > > prepareVisitConditions ( CmsVisitEntryFilter filter ) { } }
List < I_CmsPreparedStatementParameter > params = new ArrayList < I_CmsPreparedStatementParameter > ( ) ; StringBuffer conditions = new StringBuffer ( ) ; // user id filter if ( filter . getUserId ( ) != null ) { if ( conditions . length ( ) == 0 ) { conditions . append ( BEGIN_CONDITION ) ; } else { conditions . append ( BEGIN_INCLUDE_CONDITION ) ; } conditions . append ( m_sqlManager . readQuery ( "C_VISIT_FILTER_USER_ID" ) ) ; params . add ( new CmsPreparedStatementStringParameter ( filter . getUserId ( ) . toString ( ) ) ) ; conditions . append ( END_CONDITION ) ; } // resource id filter if ( filter . getStructureId ( ) != null ) { if ( conditions . length ( ) == 0 ) { conditions . append ( BEGIN_CONDITION ) ; } else { conditions . append ( BEGIN_INCLUDE_CONDITION ) ; } conditions . append ( m_sqlManager . readQuery ( "C_VISIT_FILTER_STRUCTURE_ID" ) ) ; params . add ( new CmsPreparedStatementStringParameter ( filter . getStructureId ( ) . toString ( ) ) ) ; conditions . append ( END_CONDITION ) ; } // date from filter if ( filter . getDateFrom ( ) != CmsResource . DATE_RELEASED_DEFAULT ) { if ( conditions . length ( ) == 0 ) { conditions . append ( BEGIN_CONDITION ) ; } else { conditions . append ( BEGIN_INCLUDE_CONDITION ) ; } conditions . append ( m_sqlManager . readQuery ( "C_VISIT_FILTER_DATE_FROM" ) ) ; params . add ( new CmsPreparedStatementLongParameter ( filter . getDateFrom ( ) ) ) ; conditions . append ( END_CONDITION ) ; } // date to filter if ( filter . getDateTo ( ) != CmsResource . DATE_RELEASED_DEFAULT ) { if ( conditions . length ( ) == 0 ) { conditions . append ( BEGIN_CONDITION ) ; } else { conditions . append ( BEGIN_INCLUDE_CONDITION ) ; } conditions . append ( m_sqlManager . readQuery ( "C_VISIT_FILTER_DATE_TO" ) ) ; params . add ( new CmsPreparedStatementLongParameter ( filter . getDateTo ( ) ) ) ; conditions . append ( END_CONDITION ) ; } return CmsPair . create ( conditions . toString ( ) , params ) ;
public class SoyTypeRegistry { /** * Factory function which creates a map type , given a key and value type . This folds map types * with identical key / value types together , so asking for the same key / value type twice will * return a pointer to the same type object . * @ param keyType The key type of the map . * @ param valueType The value type of the map . * @ return The map type . */ public MapType getOrCreateMapType ( SoyType keyType , SoyType valueType ) { } }
return mapTypes . intern ( MapType . of ( keyType , valueType ) ) ;
public class KriptonContentValues { /** * Bind . * @ param statement the statement */ public void bind ( SQLiteStatement statement ) { } }
if ( this . compiledStatement != null ) { // already binded return ; } int index = 1 ; statement . clearBindings ( ) ; Object value ; for ( int j = 0 ; j < args . size ( ) ; j ++ ) { value = args . get ( j ) ; switch ( valueType . get ( index - 1 ) ) { case BOOLEAN : statement . bindLong ( index , ( long ) ( ( ( Boolean ) value ) == true ? 1 : 0 ) ) ; break ; case BYTE : statement . bindLong ( index , ( byte ) value ) ; break ; case SHORT : statement . bindLong ( index , ( short ) value ) ; break ; case INTEGER : statement . bindLong ( index , ( int ) value ) ; break ; case CHARACTER : statement . bindLong ( index , Character . getNumericValue ( ( char ) value ) ) ; break ; case LONG : statement . bindLong ( index , ( long ) value ) ; break ; case BYTE_ARRAY : statement . bindBlob ( index , ( byte [ ] ) value ) ; break ; case FLOAT : statement . bindDouble ( index , ( float ) value ) ; break ; case DOUBLE : statement . bindDouble ( index , ( double ) value ) ; break ; case NULL : statement . bindNull ( index ) ; break ; case STRING : statement . bindString ( index , ( String ) value ) ; break ; } index ++ ; } for ( int i = 0 ; i < whereArgs . size ( ) ; i ++ , index ++ ) { statement . bindString ( index , whereArgs . get ( i ) ) ; }
public class DirectCompactSketch { /** * restricted methods */ @ Override long [ ] getCache ( ) { } }
final int curCount = getRetainedEntries ( true ) ; if ( curCount > 0 ) { final long [ ] cache = new long [ curCount ] ; final int preLongs = getCurrentPreambleLongs ( true ) ; mem_ . getLongArray ( preLongs << 3 , cache , 0 , curCount ) ; return cache ; } return new long [ 0 ] ;
public class UniverseApi { /** * Get solar system information ( asynchronously ) Get information on a solar * system . - - - This route expires daily at 11:05 * @ param systemId * system _ id integer ( required ) * @ param acceptLanguage * Language to use in the response ( optional , default to en - us ) * @ param datasource * The server name you would like data from ( optional , default to * tranquility ) * @ param ifNoneMatch * ETag from a previous request . A 304 will be returned if this * matches the current ETag ( optional ) * @ param language * Language to use in the response , takes precedence over * Accept - Language ( optional , default to en - us ) * @ param callback * The callback to be executed when the API call finishes * @ return The request call * @ throws ApiException * If fail to process the API call , e . g . serializing the request * body object */ public com . squareup . okhttp . Call getUniverseSystemsSystemIdAsync ( Integer systemId , String acceptLanguage , String datasource , String ifNoneMatch , String language , final ApiCallback < SystemResponse > callback ) throws ApiException { } }
com . squareup . okhttp . Call call = getUniverseSystemsSystemIdValidateBeforeCall ( systemId , acceptLanguage , datasource , ifNoneMatch , language , callback ) ; Type localVarReturnType = new TypeToken < SystemResponse > ( ) { } . getType ( ) ; apiClient . executeAsync ( call , localVarReturnType , callback ) ; return call ;
public class Start { /** * { @ inheritDoc } */ public void execute ( ) throws MojoExecutionException , MojoFailureException { } }
if ( getHome ( ) == null ) throw new MojoFailureException ( "Home isn't set" ) ; try { ProcessController pc = ProcessController . getInstance ( ) ; if ( ! pc . start ( getHome ( ) , options ) ) throw new MojoFailureException ( "IronJacamar instance couldn't be started from: " + getHome ( ) ) ; getLog ( ) . info ( "Started IronJacamar instance from: " + getHome ( ) ) ; } catch ( Throwable t ) { throw new MojoFailureException ( t . getMessage ( ) , t ) ; }
public class TitlePaneCloseButtonPainter { /** * Create the shape for the mark border . * @ param width the width . * @ param height the height . * @ return the shape of the mark border . */ private Shape decodeMarkBorder ( int width , int height ) { } }
int left = ( width - 3 ) / 2 - 5 ; int top = ( height - 2 ) / 2 - 5 ; path . reset ( ) ; path . moveTo ( left + 1 , top + 0 ) ; path . lineTo ( left + 3 , top + 0 ) ; path . pointAt ( left + 4 , top + 1 ) ; path . pointAt ( left + 5 , top + 2 ) ; path . pointAt ( left + 6 , top + 1 ) ; path . moveTo ( left + 7 , top + 0 ) ; path . lineTo ( left + 9 , top + 0 ) ; path . pointAt ( left + 10 , top + 1 ) ; path . pointAt ( left + 9 , top + 2 ) ; path . pointAt ( left + 8 , top + 3 ) ; path . moveTo ( left + 7 , top + 4 ) ; path . lineTo ( left + 7 , top + 5 ) ; path . pointAt ( left + 8 , top + 6 ) ; path . pointAt ( left + 9 , top + 7 ) ; path . pointAt ( left + 10 , top + 8 ) ; path . moveTo ( left + 9 , top + 9 ) ; path . lineTo ( left + 7 , top + 9 ) ; path . pointAt ( left + 6 , top + 8 ) ; path . pointAt ( left + 5 , top + 7 ) ; path . pointAt ( left + 4 , top + 8 ) ; path . moveTo ( left + 3 , top + 9 ) ; path . lineTo ( left + 1 , top + 9 ) ; path . pointAt ( left + 0 , top + 8 ) ; path . pointAt ( left + 1 , top + 7 ) ; path . pointAt ( left + 2 , top + 6 ) ; path . moveTo ( left + 3 , top + 5 ) ; path . lineTo ( left + 3 , top + 4 ) ; path . pointAt ( left + 2 , top + 3 ) ; path . pointAt ( left + 1 , top + 2 ) ; path . pointAt ( left + 0 , top + 1 ) ; return path ;
public class PolicyEventsInner { /** * Queries policy events for the resources under the management group . * @ param managementGroupName Management group name . * @ param queryOptions Additional parameters for the operation * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws QueryFailureException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the PolicyEventsQueryResultsInner object if successful . */ public PolicyEventsQueryResultsInner listQueryResultsForManagementGroup ( String managementGroupName , QueryOptions queryOptions ) { } }
return listQueryResultsForManagementGroupWithServiceResponseAsync ( managementGroupName , queryOptions ) . toBlocking ( ) . single ( ) . body ( ) ;
public class CmsADEManager { /** * Processes a HTML redirect content . < p > * This needs to be in the ADE manager because the user for whom the HTML redirect is being loaded * does not necessarily have read permissions for the redirect target , so we read the redirect target * with admin privileges . < p > * @ param userCms the CMS context of the current user * @ param request the servlet request * @ param response the servlet response * @ param htmlRedirect the path of the HTML redirect resource * @ throws CmsException if something goes wrong */ public void handleHtmlRedirect ( CmsObject userCms , HttpServletRequest request , HttpServletResponse response , String htmlRedirect ) throws CmsException { } }
CmsObject cms = OpenCms . initCmsObject ( m_offlineCms ) ; CmsRequestContext userContext = userCms . getRequestContext ( ) ; CmsRequestContext currentContext = cms . getRequestContext ( ) ; currentContext . setCurrentProject ( userContext . getCurrentProject ( ) ) ; currentContext . setSiteRoot ( userContext . getSiteRoot ( ) ) ; currentContext . setLocale ( userContext . getLocale ( ) ) ; currentContext . setUri ( userContext . getUri ( ) ) ; CmsFile file = cms . readFile ( htmlRedirect ) ; CmsXmlContent content = CmsXmlContentFactory . unmarshal ( cms , file ) ; // find out the locale to use for reading values from the redirect List < Locale > candidates = new ArrayList < Locale > ( ) ; candidates . add ( currentContext . getLocale ( ) ) ; candidates . add ( CmsLocaleManager . getDefaultLocale ( ) ) ; candidates . add ( Locale . ENGLISH ) ; candidates . addAll ( content . getLocales ( ) ) ; Locale contentLocale = currentContext . getLocale ( ) ; for ( Locale candidateLocale : candidates ) { if ( content . hasLocale ( candidateLocale ) ) { contentLocale = candidateLocale ; break ; } } String typeValue = content . getValue ( N_TYPE , contentLocale ) . getStringValue ( cms ) ; String lnkUri = "" ; Integer errorCode ; if ( "sublevel" . equals ( typeValue ) ) { // use the nav builder to get the first sub level entry CmsJspNavBuilder navBuilder = new CmsJspNavBuilder ( cms ) ; if ( navBuilder . getNavigationForFolder ( ) . size ( ) > 0 ) { CmsJspNavElement target = navBuilder . getNavigationForFolder ( ) . get ( 0 ) ; lnkUri = CmsJspTagLink . linkTagAction ( target . getResourceName ( ) , request ) ; errorCode = Integer . valueOf ( HttpServletResponse . SC_MOVED_TEMPORARILY ) ; } else { // send error 404 if no sub entry available errorCode = Integer . valueOf ( HttpServletResponse . SC_NOT_FOUND ) ; } } else { I_CmsXmlContentValue contentValue = content . getValue ( N_LINK , contentLocale ) ; if ( contentValue != null ) { String linkValue = contentValue . getStringValue ( cms ) ; lnkUri = OpenCms . getLinkManager ( ) . substituteLinkForUnknownTarget ( cms , linkValue ) ; try { errorCode = Integer . valueOf ( typeValue ) ; } catch ( NumberFormatException e ) { LOG . error ( e . getMessage ( ) , e ) ; // fall back to default errorCode = Integer . valueOf ( 307 ) ; } } else { // send error 404 if no link value is set errorCode = Integer . valueOf ( HttpServletResponse . SC_NOT_FOUND ) ; } } request . setAttribute ( CmsRequestUtil . ATTRIBUTE_ERRORCODE , errorCode ) ; response . setHeader ( "Location" , CmsEncoder . convertHostToPunycode ( lnkUri ) ) ; response . setHeader ( "Connection" , "close" ) ; response . setStatus ( errorCode . intValue ( ) ) ;
public class AmazonAppStreamClient { /** * Starts the specified image builder . * @ param startImageBuilderRequest * @ return Result of the StartImageBuilder operation returned by the service . * @ throws ResourceNotAvailableException * The specified resource exists and is not in use , but isn ' t available . * @ throws ResourceNotFoundException * The specified resource was not found . * @ throws ConcurrentModificationException * An API error occurred . Wait a few minutes and try again . * @ throws InvalidAccountStatusException * The resource cannot be created because your AWS account is suspended . For assistance , contact AWS * Support . * @ throws IncompatibleImageException * The image does not support storage connectors . * @ sample AmazonAppStream . StartImageBuilder * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / appstream - 2016-12-01 / StartImageBuilder " target = " _ top " > AWS * API Documentation < / a > */ @ Override public StartImageBuilderResult startImageBuilder ( StartImageBuilderRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeStartImageBuilder ( request ) ;
public class SloppyMath { /** * Find a 2x2 chi - square value . * Note : could do this more neatly using simplified formula for 2x2 case . * @ param k The number of black balls drawn * @ param n The total number of balls * @ param r The number of black balls * @ param m The number of balls drawn * @ return The Fisher ' s exact p - value */ public static double chiSquare2by2 ( int k , int n , int r , int m ) { } }
int [ ] [ ] cg = { { k , r - k } , { m - k , n - ( k + ( r - k ) + ( m - k ) ) } } ; int [ ] cgr = { r , n - r } ; int [ ] cgc = { m , n - m } ; double total = 0.0 ; for ( int i = 0 ; i < 2 ; i ++ ) { for ( int j = 0 ; j < 2 ; j ++ ) { double exp = ( double ) cgr [ i ] * cgc [ j ] / n ; total += ( cg [ i ] [ j ] - exp ) * ( cg [ i ] [ j ] - exp ) / exp ; } } return total ;
public class DRL6Expressions { /** * src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 723:1 : expressionList returns [ java . util . List < String > exprs ] : f = expression ( COMMA s = expression ) * ; */ public final java . util . List < String > expressionList ( ) throws RecognitionException { } }
java . util . List < String > exprs = null ; ParserRuleReturnScope f = null ; ParserRuleReturnScope s = null ; exprs = new java . util . ArrayList < String > ( ) ; try { // src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 725:3 : ( f = expression ( COMMA s = expression ) * ) // src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 725:7 : f = expression ( COMMA s = expression ) * { pushFollow ( FOLLOW_expression_in_expressionList4553 ) ; f = expression ( ) ; state . _fsp -- ; if ( state . failed ) return exprs ; if ( state . backtracking == 0 ) { exprs . add ( ( f != null ? input . toString ( f . start , f . stop ) : null ) ) ; } // src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 726:7 : ( COMMA s = expression ) * loop96 : while ( true ) { int alt96 = 2 ; int LA96_0 = input . LA ( 1 ) ; if ( ( LA96_0 == COMMA ) ) { alt96 = 1 ; } switch ( alt96 ) { case 1 : // src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 726:8 : COMMA s = expression { match ( input , COMMA , FOLLOW_COMMA_in_expressionList4564 ) ; if ( state . failed ) return exprs ; pushFollow ( FOLLOW_expression_in_expressionList4568 ) ; s = expression ( ) ; state . _fsp -- ; if ( state . failed ) return exprs ; if ( state . backtracking == 0 ) { exprs . add ( ( s != null ? input . toString ( s . start , s . stop ) : null ) ) ; } } break ; default : break loop96 ; } } } } catch ( RecognitionException re ) { throw re ; } finally { // do for sure before leaving } return exprs ;
public class auditsyslogpolicy_lbvserver_binding { /** * Use this API to fetch auditsyslogpolicy _ lbvserver _ binding resources of given name . */ public static auditsyslogpolicy_lbvserver_binding [ ] get ( nitro_service service , String name ) throws Exception { } }
auditsyslogpolicy_lbvserver_binding obj = new auditsyslogpolicy_lbvserver_binding ( ) ; obj . set_name ( name ) ; auditsyslogpolicy_lbvserver_binding response [ ] = ( auditsyslogpolicy_lbvserver_binding [ ] ) obj . get_resources ( service ) ; return response ;