signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Clock { /** * Defines the Paint object that will be used to draw the border of the clock . * Usually this is a Color object . * @ param PAINT */ public void setBorderPaint ( final Paint PAINT ) { } }
if ( null == borderPaint ) { _borderPaint = PAINT ; fireUpdateEvent ( REDRAW_EVENT ) ; } else { borderPaint . set ( PAINT ) ; }
public class RsXslt { /** * Make a transformer from this stylesheet . * @ param factory Transformer factory * @ param stylesheet The stylesheet * @ return Transformer * @ throws TransformerConfigurationException If fails */ private static Transformer transformer ( final TransformerFactory factory , final Source stylesheet ) throws TransformerConfigurationException { } }
final Transformer tnfr = factory . newTransformer ( stylesheet ) ; if ( tnfr == null ) { throw new TransformerConfigurationException ( String . format ( "%s failed to create new XSL transformer for '%s'" , factory . getClass ( ) , stylesheet . getSystemId ( ) ) ) ; } return tnfr ;
public class GaussianGmm_F64 { /** * Helper function for computing Gaussian parameters . Adds the point to mean and weight . */ public void addMean ( double [ ] point , double responsibility ) { } }
for ( int i = 0 ; i < mean . numRows ; i ++ ) { mean . data [ i ] += responsibility * point [ i ] ; } weight += responsibility ;
public class FlakeView { /** * Subtract the specified number of droidflakes . We just take them off the end of the * list , leaving the others unchanged . */ void subtractFlakes ( int quantity ) { } }
for ( int i = 0 ; i < quantity ; ++ i ) { int index = numFlakes - i - 1 ; flakes . remove ( index ) ; } setNumFlakes ( numFlakes - quantity ) ;
public class WhitelistWarningsGuard { /** * TODO ( nicksantos ) : This is a weird API . */ static Set < String > loadWhitelistedJsWarnings ( Reader reader ) throws IOException { } }
checkNotNull ( reader ) ; Set < String > result = new HashSet < > ( ) ; result . addAll ( CharStreams . readLines ( reader ) ) ; return result ;
public class Base64VLQ { /** * Decodes the next base 64 VLQ value from the given string and returns the value and the rest of the string via the out parameter . * @ return */ static Base64VLQResult decode ( String aStr , int aIndex ) { } }
int strLen = aStr . length ( ) ; int result = 0 ; int shift = 0 ; boolean continuation ; int digit ; do { if ( aIndex >= strLen ) { throw new Error ( "Expected more digits in base 64 VLQ value." ) ; } digit = Base64 . decode ( aStr . charAt ( aIndex ++ ) ) ; if ( digit == - 1 ) { throw new Error ( "Invalid base64 digit: " + aStr . charAt ( aIndex - 1 ) ) ; } continuation = ( digit & VLQ_CONTINUATION_BIT ) != 0 ; digit &= VLQ_BASE_MASK ; result = result + ( digit << shift ) ; shift += VLQ_BASE_SHIFT ; } while ( continuation ) ; return new Base64VLQResult ( fromVLQSigned ( result ) , aIndex ) ;
public class PdfCollectionSort { /** * Defines the sort order of the field ( ascending or descending ) . * @ param ascendingtrue is the default , use false for descending order */ public void setSortOrder ( boolean ascending ) { } }
PdfObject o = get ( PdfName . S ) ; if ( o instanceof PdfName ) { put ( PdfName . A , new PdfBoolean ( ascending ) ) ; } else { throw new IllegalArgumentException ( "You have to define a boolean array for this collection sort dictionary." ) ; }
public class AcraToChiliprojectSyncer { /** * Starts the synchronization between Acra reports Google spreadsheet and Chiliproject * bugtracker . * @ throws IOException * @ throws ServiceException * @ throws RedmineException * @ throws NotFoundException * @ throws AuthenticationException * @ throws ParseException */ public void startSynchronization ( ) throws IOException , ServiceException , AuthenticationException , NotFoundException , RedmineException , ParseException { } }
// retrieve new issues final List < EditableAcraReport > listReports = retrieveUnsyncedElements ( ) ; // update Chiliproject for ( final EditableAcraReport report : listReports ) { final Issue issue = getIssueForStack ( report . getStacktraceMD5 ( ) ) ; try { if ( null == issue ) { LOGGER . debug ( "Got a new bugreport: reportId={}" , report . getId ( ) ) ; for ( final AcraReportHandler handler : reportHandlers ) { handler . onNewReport ( report ) ; } } else if ( ChiliprojectUtils . isSynchronized ( report , issue ) ) { LOGGER . debug ( "Got a bugreport already synchronized: reportId={}" , report . getId ( ) ) ; for ( final AcraReportHandler handler : reportHandlers ) { handler . onKnownIssueAlreadySynchronized ( report , issue ) ; } } else { LOGGER . debug ( "Got a new bugreport with a stacktrace similar to an existing ticket: reportId={}" , report . getId ( ) ) ; for ( final AcraReportHandler handler : reportHandlers ) { handler . onKnownIssueNotSynchronized ( report , issue ) ; } } } catch ( final SynchronizationException e ) { report . mergeSyncStatus ( SyncStatus . FAILURE ) ; LOGGER . error ( "Unable to synchronize ACRA report " + report . getId ( ) , e ) ; } } try { for ( final AcraReportHandler handler : reportHandlers ) { handler . onFinishReceivingNewReports ( ) ; } } catch ( final SynchronizationException e ) { for ( final EditableAcraReport report : listReports ) { report . mergeSyncStatus ( SyncStatus . FAILURE ) ; } LOGGER . error ( "Unable to finalize ACRA report synchronization" ) ; } // update / set stack _ trace _ md5 cells for ( final EditableAcraReport report : listReports ) { if ( SyncStatus . SUCCESS . equals ( report . getStatus ( ) ) ) { report . commitStacktraceMD5 ( ) ; } }
public class HTODDependencyTable { /** * This reduces the DependencyToEntryTable size by offloading some dependencies to the disk . */ private int reduceTableSize ( ) { } }
int returnCode = HTODDynacache . NO_EXCEPTION ; int count = this . entryRemove ; if ( count > 0 ) { int removeSize = 5 ; while ( count > 0 ) { int minSize = Integer . MAX_VALUE ; Iterator < Map . Entry < Object , Set < Object > > > e = dependencyToEntryTable . entrySet ( ) . iterator ( ) ; while ( e . hasNext ( ) ) { Map . Entry entry = ( Map . Entry ) e . next ( ) ; Object id = entry . getKey ( ) ; ValueSet vs = ( ValueSet ) entry . getValue ( ) ; int vsSize = vs . size ( ) ; if ( vsSize < removeSize ) { if ( this . type == DEP_ID_TABLE ) { returnCode = this . htod . writeValueSet ( HTODDynacache . DEP_ID_DATA , id , vs , HTODDynacache . ALL ) ; // valueSet may be empty after writeValueSet this . htod . cache . getCacheStatisticsListener ( ) . depIdsOffloadedToDisk ( id ) ; Tr . debug ( tc , " reduceTableSize dependency id=" + id + " vs=" + vs . size ( ) + " returnCode=" + returnCode ) ; } else { returnCode = this . htod . writeValueSet ( HTODDynacache . TEMPLATE_ID_DATA , id , vs , HTODDynacache . ALL ) ; // valueSet may be empty after writeValueSet this . htod . cache . getCacheStatisticsListener ( ) . templatesOffloadedToDisk ( id ) ; Tr . debug ( tc , "reduceTableSize template id=" + id + " vs=" + vs . size ( ) + " returnCode=" + returnCode ) ; } dependencyToEntryTable . remove ( id ) ; dependencyNotUpdatedTable . remove ( id ) ; count -- ; if ( returnCode == HTODDynacache . DISK_EXCEPTION ) { return returnCode ; } else if ( returnCode == HTODDynacache . DISK_SIZE_OVER_LIMIT_EXCEPTION ) { this . htod . delCacheEntry ( vs , CachePerf . DISK_OVERFLOW , CachePerf . LOCAL , ! Cache . FROM_DEPID_TEMPLATE_INVALIDATION , HTODInvalidationBuffer . FIRE_EVENT ) ; returnCode = HTODDynacache . NO_EXCEPTION ; return returnCode ; } } else { minSize = vsSize < minSize ? vsSize : minSize ; } if ( count == 0 ) { break ; } } removeSize = minSize ; removeSize += 3 ; } } return returnCode ;
public class FieldMask { /** * Creates a FieldMask from the provided field paths . * @ param fieldPaths A list of field paths . * @ return A { @ code FieldMask } that describes a subset of fields . */ @ Nonnull public static FieldMask of ( String ... fieldPaths ) { } }
List < FieldPath > paths = new ArrayList < > ( ) ; for ( String fieldPath : fieldPaths ) { paths . add ( FieldPath . fromDotSeparatedString ( fieldPath ) ) ; } return new FieldMask ( paths ) ;
public class AbstractBlueprintBeanDefinitionParser { /** * < p > addPropertyReferenceForMap . < / p > * @ param id a { @ link java . lang . String } object . * @ param context a { @ link org . apache . aries . blueprint . ParserContext } object . * @ param beanMetadata a { @ link org . apache . aries . blueprint . mutable . MutableBeanMetadata } object . * @ param values a { @ link java . util . Map } object . */ protected void addPropertyReferenceForMap ( String id , ParserContext context , MutableBeanMetadata beanMetadata , Map < String , String > values ) { } }
MutableMapMetadata mapMetadata = context . createMetadata ( MutableMapMetadata . class ) ; for ( Entry < String , String > value : values . entrySet ( ) ) { mapMetadata . addEntry ( createStringValue ( context , value . getKey ( ) ) , createStringValue ( context , value . getValue ( ) ) ) ; } beanMetadata . addProperty ( id , mapMetadata ) ;
public class OpenAPIConnection { /** * Downloads contents of URL and converts them to a string * @ return string containing contents of a url */ public String download ( ) { } }
try { HttpURLConnection conn = getConnection ( ) ; return readConnection ( conn ) ; } catch ( Exception e ) { Assert . fail ( e . getMessage ( ) ) ; } return null ;
public class Pattern { /** * matchMany , false if it was ended by running out of tokens . */ private boolean getClause ( Iterator tokens , List clause ) { } }
while ( tokens . hasNext ( ) ) { Object token = tokens . next ( ) ; if ( token == matchMany ) return true ; clause . add ( token ) ; } return false ;
public class MtasDataCollectorResult { /** * Gets the list . * @ param reduce the reduce * @ return the list * @ throws IOException Signals that an I / O exception has occurred . */ public final SortedMap < String , MtasDataItem < T1 , T2 > > getList ( boolean reduce ) throws IOException { } }
if ( collectorType . equals ( DataCollector . COLLECTOR_TYPE_LIST ) ) { if ( reduce && startKey != null && endKey != null ) { return list . subMap ( startKey , endKey ) ; } else { return list ; } } else { throw new IOException ( "type " + collectorType + " not supported" ) ; }
public class NetworkEnvironmentConfiguration { /** * Parses the configuration to get the page size and validates the value . * @ param configuration configuration object * @ return size of memory segment */ public static int getPageSize ( Configuration configuration ) { } }
final int pageSize = checkedDownCast ( MemorySize . parse ( configuration . getString ( TaskManagerOptions . MEMORY_SEGMENT_SIZE ) ) . getBytes ( ) ) ; // check page size of for minimum size ConfigurationParserUtils . checkConfigParameter ( pageSize >= MemoryManager . MIN_PAGE_SIZE , pageSize , TaskManagerOptions . MEMORY_SEGMENT_SIZE . key ( ) , "Minimum memory segment size is " + MemoryManager . MIN_PAGE_SIZE ) ; // check page size for power of two ConfigurationParserUtils . checkConfigParameter ( MathUtils . isPowerOf2 ( pageSize ) , pageSize , TaskManagerOptions . MEMORY_SEGMENT_SIZE . key ( ) , "Memory segment size must be a power of 2." ) ; return pageSize ;
public class SmbNamedPipe { /** * Return the < code > InputStream < / code > used to read information * from this pipe instance . Presumably data would first be written * to the < code > OutputStream < / code > associated with this Named * Pipe instance although this is not a requirement ( e . g . a * read - only named pipe would write data to this stream on * connection ) . Reading from this stream may block . Therefore it * may be necessary that an addition thread be used to read and * write to a Named Pipe . */ public InputStream getNamedPipeInputStream ( ) throws IOException { } }
if ( pipeIn == null ) { if ( ( pipeType & PIPE_TYPE_CALL ) == PIPE_TYPE_CALL || ( pipeType & PIPE_TYPE_TRANSACT ) == PIPE_TYPE_TRANSACT ) { pipeIn = new TransactNamedPipeInputStream ( this ) ; } else { pipeIn = new SmbFileInputStream ( this , ( pipeType & 0xFFFF00FF ) | SmbFile . O_EXCL ) ; } } return pipeIn ;
public class SwitchableObservable { /** * { @ inheritDoc } */ @ Override public void removeObservableListener ( ObservableListener < T > listener ) { } }
support . removeObservableListener ( listener ) ; super . removeObservableListener ( listener ) ;
public class CnvBnRsToEntity { /** * < p > Get from RS simple ID - able value . < / p > * @ param pFieldType Field Type * @ param pFrom from RS * @ param pColumnAlias Column Alias * @ return simple ID value * @ throws Exception - an exception */ public final Object getSimpleId ( final Class < ? > pFieldType , final IRecordSet < RS > pFrom , final String pColumnAlias ) throws Exception { } }
if ( Integer . class == pFieldType ) { return pFrom . getInteger ( pColumnAlias ) ; } else if ( Long . class == pFieldType ) { return pFrom . getLong ( pColumnAlias ) ; } else if ( String . class == pFieldType ) { return pFrom . getString ( pColumnAlias ) ; } else { String msg = "There is no rule to get column ID-able " + pColumnAlias + " of " + pFieldType ; throw new ExceptionWithCode ( ExceptionWithCode . NOT_YET_IMPLEMENTED , msg ) ; }
public class FrameworkManager { /** * Attach a shutdown hook to make sure that the framework is shutdown nicely * in most cases . There are ways of shutting a JVM down that don ' t use the * shutdown hook , but this catches most cases . */ private void addShutdownHook ( boolean isClient ) { } }
if ( shutdownHook == null ) { shutdownHook = new ShutdownHook ( isClient ) ; Runtime . getRuntime ( ) . addShutdownHook ( shutdownHook ) ; }
public class ModifyInstanceCreditSpecificationResult { /** * Information about the instances whose credit option for CPU usage was successfully modified . * @ param successfulInstanceCreditSpecifications * Information about the instances whose credit option for CPU usage was successfully modified . */ public void setSuccessfulInstanceCreditSpecifications ( java . util . Collection < SuccessfulInstanceCreditSpecificationItem > successfulInstanceCreditSpecifications ) { } }
if ( successfulInstanceCreditSpecifications == null ) { this . successfulInstanceCreditSpecifications = null ; return ; } this . successfulInstanceCreditSpecifications = new com . amazonaws . internal . SdkInternalList < SuccessfulInstanceCreditSpecificationItem > ( successfulInstanceCreditSpecifications ) ;
public class ConvertNumberHandler { /** * Returns a new NumberConverter * @ see NumberConverter * @ see org . apache . myfaces . view . facelets . tag . jsf . ConverterHandler # createConverter ( javax . faces . view . facelets . FaceletContext ) */ protected Converter createConverter ( FaceletContext ctx ) throws FacesException , ELException , FaceletException { } }
return ctx . getFacesContext ( ) . getApplication ( ) . createConverter ( NumberConverter . CONVERTER_ID ) ;
public class JournalImpl { /** * Writes the send to the journal . The queryRef values are not * saved , because restoring them does not make sense . */ @ Override public void writeSend ( StubAmp actor , String methodName , Object [ ] args , InboxAmp inbox ) { } }
try ( OutputStream os = openItem ( inbox ) ) { // XXX : should keep open try ( OutH3 out = _serializer . out ( os ) ) { String key = actor . journalKey ( ) ; out . writeLong ( CODE_SEND ) ; out . writeString ( key ) ; out . writeString ( methodName ) ; out . writeLong ( args . length ) ; for ( Object arg : args ) { out . writeObject ( arg ) ; } } // _ count + + ; } catch ( IOException e ) { log . log ( Level . FINER , e . toString ( ) , e ) ; }
public class CommerceAccountUserRelUtil { /** * Returns the last commerce account user rel in the ordered set where commerceAccountId = & # 63 ; . * @ param commerceAccountId the commerce account ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the last matching commerce account user rel , or < code > null < / code > if a matching commerce account user rel could not be found */ public static CommerceAccountUserRel fetchByCommerceAccountId_Last ( long commerceAccountId , OrderByComparator < CommerceAccountUserRel > orderByComparator ) { } }
return getPersistence ( ) . fetchByCommerceAccountId_Last ( commerceAccountId , orderByComparator ) ;
public class PsLinkedin { /** * Make identity from JSON object . * @ param json JSON received from Github * @ return Identity found */ private static Identity parse ( final JsonObject json ) { } }
final String fname = "firstName" ; final String lname = "lastName" ; final String unknown = "?" ; final Map < String , String > props = new HashMap < > ( json . size ( ) ) ; props . put ( fname , json . getString ( fname , unknown ) ) ; props . put ( lname , json . getString ( lname , unknown ) ) ; return new Identity . Simple ( String . format ( "urn:linkedin:%s" , json . getString ( "id" ) ) , props ) ;
public class DelimitedInputFormat { /** * Opens the given input split . This method opens the input stream to the specified file , allocates read buffers * and positions the stream at the correct position , making sure that any partial record at the beginning is skipped . * @ param split The input split to open . * @ see eu . stratosphere . api . common . io . FileInputFormat # open ( eu . stratosphere . core . fs . FileInputSplit ) */ @ Override public void open ( FileInputSplit split ) throws IOException { } }
super . open ( split ) ; this . bufferSize = this . bufferSize <= 0 ? DEFAULT_READ_BUFFER_SIZE : this . bufferSize ; if ( this . readBuffer == null || this . readBuffer . length != this . bufferSize ) { this . readBuffer = new byte [ this . bufferSize ] ; } if ( this . wrapBuffer == null || this . wrapBuffer . length < 256 ) { this . wrapBuffer = new byte [ 256 ] ; } this . readPos = 0 ; this . limit = 0 ; this . overLimit = false ; this . end = false ; if ( this . splitStart != 0 ) { this . stream . seek ( this . splitStart ) ; readLine ( ) ; // if the first partial record already pushes the stream over the limit of our split , then no // record starts within this split if ( this . overLimit ) { this . end = true ; } } else { fillBuffer ( ) ; }
public class PriorityBlockingQueue { /** * Inserts item x at position k , maintaining heap invariant by * demoting x down the tree repeatedly until it is less than or * equal to its children or is a leaf . * @ param k the position to fill * @ param x the item to insert * @ param array the heap array * @ param n heap size */ private static < T > void siftDownComparable ( int k , T x , Object [ ] array , int n ) { } }
if ( n > 0 ) { Comparable < ? super T > key = ( Comparable < ? super T > ) x ; int half = n >>> 1 ; // loop while a non - leaf while ( k < half ) { int child = ( k << 1 ) + 1 ; // assume left child is least Object c = array [ child ] ; int right = child + 1 ; if ( right < n && ( ( Comparable < ? super T > ) c ) . compareTo ( ( T ) array [ right ] ) > 0 ) c = array [ child = right ] ; if ( key . compareTo ( ( T ) c ) <= 0 ) break ; array [ k ] = c ; k = child ; } array [ k ] = key ; }
public class NameSpaceBinderImpl { /** * This method is provided for tWas and is not used for Liberty . * Just return the bindingObject for now . */ @ Override public EJBBinding createJavaBindingObject ( HomeRecord hr , HomeWrapperSet homeSet , String interfaceName , int interfaceIndex , boolean local , EJBBinding bindingObject ) { } }
return bindingObject ;
public class JBBPMapper { /** * Set a value to a field of a class instance . Can ' t be used for static * fields ! * @ param classInstance a class instance * @ param classField a mapping class field which should be set by the value , * must not be null * @ param binField a parsed bin field which value will be set , can be null * @ param value a value to be set to the class field */ private static void setFieldValue ( final Object classInstance , final Field classField , final JBBPAbstractField binField , final Object value ) { } }
try { classField . set ( classInstance , value ) ; } catch ( IllegalArgumentException ex ) { throw new JBBPMapperException ( "Can't set value to a mapping field" , binField , classInstance . getClass ( ) , classField , ex ) ; } catch ( IllegalAccessException ex ) { throw new JBBPMapperException ( "Can't get access to a mapping field" , binField , classInstance . getClass ( ) , classField , ex ) ; }
public class ParameterReplacer { /** * - - - - - JDBC 2.0 - - - - - */ public void registerOutParameter ( int parameterIndex , int sqlType , String typeName ) { } }
record ( parameterIndex , getDeclaredMethod ( CallableStatement . class , "registerOutParameter" , int . class , int . class , int . class ) , parameterIndex , sqlType , typeName ) ;
public class TopicTemplate { /** * Create a topic definition from this template */ public TopicDefinition createTopicDefinition ( String topicName , boolean temporary ) { } }
TopicDefinition def = new TopicDefinition ( ) ; def . setName ( topicName ) ; def . setTemporary ( temporary ) ; copyAttributesTo ( def ) ; def . setSubscriberFailurePolicy ( subscriberFailurePolicy ) ; def . setSubscriberOverflowPolicy ( subscriberOverflowPolicy ) ; def . setPartitionsKeysToIndex ( partitionsKeysToIndex ) ; return def ;
public class StringUtils { /** * Encodes an array of bytes as String representation of hexadecimal . * @ param bytes an array of bytes to convert to a hex string . * @ return generated hex string . */ public static String encodeHex ( byte [ ] bytes ) { } }
char [ ] hexChars = new char [ bytes . length * 2 ] ; for ( int j = 0 ; j < bytes . length ; j ++ ) { int v = bytes [ j ] & 0xFF ; hexChars [ j * 2 ] = HEX_CHARS [ v >>> 4 ] ; hexChars [ j * 2 + 1 ] = HEX_CHARS [ v & 0x0F ] ; } return new String ( hexChars ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcDimensionalExponents ( ) { } }
if ( ifcDimensionalExponentsEClass == null ) { ifcDimensionalExponentsEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 174 ) ; } return ifcDimensionalExponentsEClass ;
public class DocumentQuery { /** * TBD expr public IDocumentQuery < T > WhereGreaterThanOrEqual < TValue > ( Expression < Func < T , TValue > > propertySelector , TValue value , bool exact = false ) */ public IDocumentQuery < T > whereLessThan ( String fieldName , Object value ) { } }
return whereLessThan ( fieldName , value , false ) ;
public class AIStream { /** * Insert a get request at tick t . Every tick from latestTick + 1 to t - 1 is set to rejected . In general , * trying to insert the tick could be denied because there may be a previous L / R in the stream * that needs to turn to L / D . However , in the latest design the RME does not reject any ticks while * the consumer is connected , waiting instead until it disconnects to reject all ticks . * @ param tick The point in the stream to insert the request * @ param selector The selector associated with the request * @ param timeout The timeout on the request , either provided by the consumer or assigned by default by the RCD * @ return The reject start tick or - 1 if no ticks rejected */ public long insertRequest ( AIRequestedTick rt , long tick , long timeout ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "insertRequest" , new Object [ ] { rt , Long . valueOf ( tick ) , Long . valueOf ( timeout ) } ) ; long rejectStart = _latestTick + 1 ; if ( rejectStart < tick ) { // Notice that the ticks have recovery = false , but the request sent over does not writeRejected ( rejectStart , tick - 1 , 0 ) ; } else { rejectStart = tick ; } TickRange requestRange = new TickRange ( TickRange . Requested , tick , tick ) ; // Associate the tick with the requesting consumer key so that , when the data message arrives , // we can tell the RCD what consumer it is for requestRange . value = rt ; requestRange . valuestamp = tick ; _targetStream . writeRange ( requestRange ) ; // Start the get repetition ( eager get ) timeout , only if timeout is not zero ( i . e . , it ' s not a NoWait ) if ( timeout > 0L || timeout == _mp . getCustomProperties ( ) . get_infinite_timeout ( ) ) { _eagerGetTOM . addTimeoutEntry ( rt ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "insertRequest" , Long . valueOf ( rejectStart ) ) ; return rejectStart ;
public class ManagedInstanceTdeCertificatesInner { /** * Creates a TDE certificate for a given server . * @ 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 managedInstanceName The name of the managed instance . * @ param parameters The requested TDE certificate to be created or updated . * @ 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 < Void > beginCreateAsync ( String resourceGroupName , String managedInstanceName , TdeCertificateInner parameters , final ServiceCallback < Void > serviceCallback ) { } }
return ServiceFuture . fromResponse ( beginCreateWithServiceResponseAsync ( resourceGroupName , managedInstanceName , parameters ) , serviceCallback ) ;
public class StorageAccountCredentialsInner { /** * Creates or updates the storage account credential . * @ param deviceName The device name . * @ param name The storage account credential name . * @ param resourceGroupName The resource group name . * @ param storageAccountCredential The storage account credential . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the StorageAccountCredentialInner object if successful . */ public StorageAccountCredentialInner createOrUpdate ( String deviceName , String name , String resourceGroupName , StorageAccountCredentialInner storageAccountCredential ) { } }
return createOrUpdateWithServiceResponseAsync ( deviceName , name , resourceGroupName , storageAccountCredential ) . toBlocking ( ) . last ( ) . body ( ) ;
public class XRTreeFragSelectWrapper { /** * For support of literal objects in xpaths . * @ param xctxt The XPath execution context . * @ return the result of executing the select expression * @ throws javax . xml . transform . TransformerException */ public XObject execute ( XPathContext xctxt ) throws javax . xml . transform . TransformerException { } }
XObject m_selected ; m_selected = ( ( Expression ) m_obj ) . execute ( xctxt ) ; m_selected . allowDetachToRelease ( m_allowRelease ) ; if ( m_selected . getType ( ) == CLASS_STRING ) return m_selected ; else return new XString ( m_selected . str ( ) ) ;
public class ToDoubleBiFunctions { /** * Composes the given functions * @ param < T > The first argument type * @ param < U > The second argument type * @ param < R > The first result type * @ param biFunction The { @ link BiFunction } * @ param function The { @ link ToDoubleFunction } * @ return The resulting { @ link ToDoubleBiFunction } */ public static < T , U , R > ToDoubleBiFunction < T , U > compose ( final BiFunction < ? super T , ? super U , ? extends R > biFunction , final ToDoubleFunction < ? super R > function ) { } }
return ( x , y ) -> function . applyAsDouble ( biFunction . apply ( x , y ) ) ;
public class AlipayLogger { /** * 通讯错误日志 */ private static void _logCommError ( Exception e , HttpURLConnection conn , String url , String appKey , String method , Map < String , String > params ) { } }
DateFormat df = new SimpleDateFormat ( AlipayConstants . DATE_TIME_FORMAT ) ; df . setTimeZone ( TimeZone . getTimeZone ( AlipayConstants . DATE_TIMEZONE ) ) ; String sdkName = AlipayConstants . SDK_VERSION ; String urlStr = null ; String rspCode = "" ; if ( conn != null ) { try { urlStr = conn . getURL ( ) . toString ( ) ; rspCode = "HTTP_ERROR_" + conn . getResponseCode ( ) ; } catch ( IOException ioe ) { } } else { urlStr = url ; rspCode = "" ; } StringBuilder sb = new StringBuilder ( ) ; sb . append ( df . format ( new Date ( ) ) ) ; // 时间 sb . append ( "^_^" ) ; sb . append ( method ) ; // API sb . append ( "^_^" ) ; sb . append ( appKey ) ; // APP sb . append ( "^_^" ) ; sb . append ( getIp ( ) ) ; // IP地址 sb . append ( "^_^" ) ; sb . append ( osName ) ; // 操作系统 sb . append ( "^_^" ) ; sb . append ( sdkName ) ; // SDK名字 , 这是例子 , 请换成其他名字 sb . append ( "^_^" ) ; sb . append ( urlStr ) ; // 请求URL sb . append ( "^_^" ) ; sb . append ( rspCode ) ; sb . append ( "^_^" ) ; sb . append ( ( e . getMessage ( ) + "" ) . replaceAll ( "\r\n" , " " ) ) ; clog . error ( sb . toString ( ) ) ;
public class MazeDecoratorImplementation { /** * Calculate the number of cells on the shortest path between ( x1 , z1 ) and ( x2 , z2) * @ param x1 * @ param z1 * @ param x2 * @ param z2 * @ param bAllowDiags Whether the cells are 8 - connected or 4 - connected . * @ return The number of cells on the shortest path , including start and end cells . */ private int distBetweenPoints ( int x1 , int z1 , int x2 , int z2 , boolean bAllowDiags ) { } }
// Total cells is the sum of the distances we need to travel along the x and the z axes , plus one for the end cell . int w = Math . abs ( x2 - x1 ) ; int h = Math . abs ( z2 - z1 ) ; if ( bAllowDiags ) { // Diagonal movement allows us ignore the shorter of w and h : if ( w < h ) w = 0 ; else h = 0 ; } return w + h + 1 ;
public class Pattern4 { /** * Creates a pattern that matches when all four observable sequences have an available element . * @ param other * Observable sequence to match with the three previous sequences . * @ return Pattern object that matches when all observable sequences have an available element . */ public < T5 > Pattern5 < T1 , T2 , T3 , T4 , T5 > and ( Observable < T5 > other ) { } }
if ( other == null ) { throw new NullPointerException ( ) ; } return new Pattern5 < T1 , T2 , T3 , T4 , T5 > ( o1 , o2 , o3 , o4 , other ) ;
public class Alignments { /** * Factory method which constructs a pairwise sequence aligner . * @ param < S > each { @ link Sequence } of an alignment pair is of type S * @ param < C > each element of an { @ link AlignedSequence } is a { @ link Compound } of type C * @ param query the first { @ link Sequence } to align * @ param target the second { @ link Sequence } to align * @ param type chosen type from list of pairwise sequence alignment routines * @ param gapPenalty the gap penalties used during alignment * @ param subMatrix the set of substitution scores used during alignment * @ return pairwise sequence aligner */ public static < S extends Sequence < C > , C extends Compound > PairwiseSequenceAligner < S , C > getPairwiseAligner ( S query , S target , PairwiseSequenceAlignerType type , GapPenalty gapPenalty , SubstitutionMatrix < C > subMatrix ) { } }
if ( ! query . getCompoundSet ( ) . equals ( target . getCompoundSet ( ) ) ) { throw new IllegalArgumentException ( "Sequence compound sets must be the same" ) ; } switch ( type ) { default : case GLOBAL : return new NeedlemanWunsch < S , C > ( query , target , gapPenalty , subMatrix ) ; case LOCAL : return new SmithWaterman < S , C > ( query , target , gapPenalty , subMatrix ) ; case GLOBAL_LINEAR_SPACE : case LOCAL_LINEAR_SPACE : // TODO other alignment options ( Myers - Miller , Thompson ) throw new UnsupportedOperationException ( Alignments . class . getSimpleName ( ) + " does not yet support " + type + " alignment" ) ; }
public class Base64Coder { /** * Encodes a byte array into Base64 format . * No blanks or line breaks are inserted . * @ param in an array containing the data bytes to be encoded . * @ param ilen number of bytes to process in < code > in < / code > . * @ return A character array with the Base64 encoded data . */ @ Pure @ SuppressWarnings ( "checkstyle:magicnumber" ) public static char [ ] encode ( byte [ ] in , int ilen ) { } }
// output length without padding final int oDataLen = ( ilen * 4 + 2 ) / 3 ; // output length including padding final int oLen = ( ( ilen + 2 ) / 3 ) * 4 ; final char [ ] out = new char [ oLen ] ; int ip = 0 ; int op = 0 ; while ( ip < ilen ) { final int i0 = in [ ip ++ ] & 0xff ; final int i1 = ip < ilen ? in [ ip ++ ] & 0xff : 0 ; final int i2 = ip < ilen ? in [ ip ++ ] & 0xff : 0 ; final int o0 = i0 >>> 2 ; final int o1 = ( ( i0 & 3 ) << 4 ) | ( i1 >>> 4 ) ; final int o2 = ( ( i1 & 0xf ) << 2 ) | ( i2 >>> 6 ) ; final int o3 = i2 & 0x3F ; out [ op ++ ] = map1 [ o0 ] ; out [ op ++ ] = map1 [ o1 ] ; out [ op ] = op < oDataLen ? map1 [ o2 ] : '=' ; ++ op ; out [ op ] = op < oDataLen ? map1 [ o3 ] : '=' ; ++ op ; } return out ;
public class ResourceInformation { /** * Converts the given id to a string . * @ param id id * @ return stringified id */ public String toIdString ( Object id ) { } }
if ( id == null ) { return null ; } return idStringMapper . toString ( id ) ;
public class AutomaticTimerBean { /** * F743-506 , F743-14447 RTC109678 */ public ParsedScheduleExpression parseScheduleExpression ( TimerMethodData . AutomaticTimer timer ) { } }
ScheduleExpression schedule = timer . getSchedule ( ) ; String start = timer . getStart ( ) ; String end = timer . getEnd ( ) ; try { if ( start != null ) { schedule . start ( parseXSDDateTime ( "start" , start ) ) ; } if ( end != null ) { schedule . end ( parseXSDDateTime ( "end" , end ) ) ; } return ScheduleExpressionParser . parse ( schedule ) ; } catch ( ScheduleExpressionParserException ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".parseScheduleExpression" , "541" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "failed to parse schedule expression" , ex ) ; // Use the exception to call Tr . error ( ) . ex . logError ( ivBMD . j2eeName . getModule ( ) , ivBMD . j2eeName . getComponent ( ) , timer . getMethod ( ) . getMethod ( ) . getName ( ) ) ; throw ex ; }
public class StringPickerDialogFragment { /** * Create a new instance of that picker dialog * @ param pickerId The id of the item picker * @ param title The title for the dialog * @ param positiveButtonText The text of the positive button * @ param negativeButtonText The text of the negative button * @ param enableMultipleSelection Whether or not to allow selecting multiple items * @ param selectedItemIndices The positions of the items already selected * @ param availableItems The collection of items that can be picked * @ return A new instance of the picker dialog */ public static StringPickerDialogFragment newInstance ( int pickerId , String title , String positiveButtonText , String negativeButtonText , boolean enableMultipleSelection , int [ ] selectedItemIndices , ArrayList < String > availableItems ) { } }
StringPickerDialogFragment f = new StringPickerDialogFragment ( ) ; Bundle args = buildCommonArgsBundle ( pickerId , title , positiveButtonText , negativeButtonText , enableMultipleSelection , selectedItemIndices ) ; args . putStringArrayList ( ARG_AVAILABLE_ITEMS , availableItems ) ; f . setArguments ( args ) ; return f ;
public class Common { /** * Format a balance to a readable string . * @ param worldName The world Name associated with this balance * @ param currency The currency instance associated with this balance . * @ param balance The balance . * @ param format the display format to use * @ return A pretty String showing the balance . Returns a empty string if currency is invalid . */ public String format ( String worldName , Currency currency , double balance , DisplayFormat format ) { } }
StringBuilder string = new StringBuilder ( ) ; if ( worldName != null && ! worldName . equals ( WorldGroupsManager . DEFAULT_GROUP_NAME ) ) { // We put the world name if the conf is true string . append ( worldName ) . append ( ": " ) ; } if ( currency != null ) { // We removes some cents if it ' s something like 20.20381 it would set it // to 20.20 String [ ] theAmount = BigDecimal . valueOf ( balance ) . toPlainString ( ) . split ( "\\." ) ; DecimalFormatSymbols unusualSymbols = new DecimalFormatSymbols ( ) ; unusualSymbols . setGroupingSeparator ( ',' ) ; DecimalFormat decimalFormat = new DecimalFormat ( "###,###" , unusualSymbols ) ; String name = currency . getName ( ) ; if ( balance > 1.0 || balance < 1.0 ) { name = currency . getPlural ( ) ; } String coin ; if ( theAmount . length == 2 ) { if ( theAmount [ 1 ] . length ( ) >= 2 ) { coin = theAmount [ 1 ] . substring ( 0 , 2 ) ; } else { coin = theAmount [ 1 ] + "0" ; } } else { coin = "0" ; } String amount ; try { amount = decimalFormat . format ( Double . parseDouble ( theAmount [ 0 ] ) ) ; } catch ( NumberFormatException e ) { amount = theAmount [ 0 ] ; } // Do we seperate money and dollar or not ? if ( format == DisplayFormat . LONG ) { String subName = currency . getMinor ( ) ; if ( Long . parseLong ( coin ) > 1 ) { subName = currency . getMinorPlural ( ) ; } string . append ( amount ) . append ( " " ) . append ( name ) . append ( " " ) . append ( coin ) . append ( " " ) . append ( subName ) ; } else if ( format == DisplayFormat . SMALL ) { string . append ( amount ) . append ( "." ) . append ( coin ) . append ( " " ) . append ( name ) ; } else if ( format == DisplayFormat . SIGN ) { string . append ( currency . getSign ( ) ) . append ( amount ) . append ( "." ) . append ( coin ) ; } else if ( format == DisplayFormat . SIGNFRONT ) { string . append ( amount ) . append ( "." ) . append ( coin ) . append ( currency . getSign ( ) ) ; } else if ( format == DisplayFormat . MAJORONLY ) { string . append ( amount ) . append ( " " ) . append ( name ) ; } } return string . toString ( ) ;
public class AspectJSimulatorAdapterImpl { /** * { @ inheritDoc } */ public Object invoke ( ProceedingJoinPoint pjp , Class < ? extends Object > testClass , boolean useRootRelativePath ) throws Exception { } }
String resource = new StringBuilder ( ) . append ( testClass . getSimpleName ( ) ) . append ( ".class" ) . toString ( ) ; return invoke ( pjp , new File ( testClass . getResource ( resource ) . getPath ( ) ) . getParentFile ( ) . getPath ( ) , useRootRelativePath ) ;
public class BasicThreadInformation { /** * Format the StackTraceElements . * @ param sb The StringBuilder . * @ param trace The stack trace element array to format . */ @ Override public void printStack ( final StringBuilder sb , final StackTraceElement [ ] trace ) { } }
for ( final StackTraceElement element : trace ) { sb . append ( "\tat " ) . append ( element ) . append ( '\n' ) ; }
public class UserCredentialsFileRepository { /** * Parses a file of credentials * @ throws IOException Error reading the file */ private void readFile ( ) throws IOException { } }
BufferedReader reader = null ; try { reader = new BufferedReader ( new InputStreamReader ( new FileInputStream ( file ) , PcsUtils . UTF8 ) ) ; LOGGER . debug ( "Reading credentials file {}" , file ) ; String line ; int index = 1 ; while ( ( line = reader . readLine ( ) ) != null ) { line = line . trim ( ) ; if ( line . startsWith ( "#" ) || line . length ( ) == 0 ) { continue ; } String [ ] userCredentialsArray = line . split ( "=" , 2 ) ; if ( userCredentialsArray . length != 2 ) { throw new IllegalArgumentException ( "Not parsable line #" + index ) ; } // Key final String key = userCredentialsArray [ 0 ] . trim ( ) ; final Credentials value = Credentials . createFromJson ( userCredentialsArray [ 1 ] . trim ( ) ) ; credentialsMap . put ( key , value ) ; index ++ ; } } finally { PcsUtils . closeQuietly ( reader ) ; }
public class GVRSceneObject { /** * Tests the { @ link GVRSceneObject } s hierarchical bounding volume against * the specified ray . * The ray is defined by its origin { @ code [ ox , oy , oz ] } and its direction * { @ code [ dx , dy , dz ] } . * The ray origin may be [ 0 , 0 , 0 ] and the direction components should be * normalized from - 1 to 1 : Note that the y direction runs from - 1 at the * bottom to 1 at the top . * @ param ox * The x coordinate of the ray origin . * @ param oy * The y coordinate of the ray origin . * @ param oz * The z coordinate of the ray origin . * @ param dx * The x vector of the ray direction . * @ param dy * The y vector of the ray direction . * @ param dz * The z vector of the ray direction . * @ return < code > true < / code > if the input ray intersects with the * { @ link GVRSceneObject } s hierarchical bounding volume , * < code > false < / code > otherwise . */ public boolean intersectsBoundingVolume ( float ox , float oy , float oz , float dx , float dy , float dz ) { } }
return NativeSceneObject . rayIntersectsBoundingVolume ( getNative ( ) , ox , oy , oz , dx , dy , dz ) ;
public class InternalPureXbaseParser { /** * InternalPureXbase . g : 1884:1 : ruleXMultiplicativeExpression returns [ EObject current = null ] : ( this _ XUnaryOperation _ 0 = ruleXUnaryOperation ( ( ( ( ( ) ( ( ruleOpMulti ) ) ) ) = > ( ( ) ( ( ruleOpMulti ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ruleXUnaryOperation ) ) ) * ) ; */ public final EObject ruleXMultiplicativeExpression ( ) throws RecognitionException { } }
EObject current = null ; EObject this_XUnaryOperation_0 = null ; EObject lv_rightOperand_3_0 = null ; enterRule ( ) ; try { // InternalPureXbase . g : 1890:2 : ( ( this _ XUnaryOperation _ 0 = ruleXUnaryOperation ( ( ( ( ( ) ( ( ruleOpMulti ) ) ) ) = > ( ( ) ( ( ruleOpMulti ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ruleXUnaryOperation ) ) ) * ) ) // InternalPureXbase . g : 1891:2 : ( this _ XUnaryOperation _ 0 = ruleXUnaryOperation ( ( ( ( ( ) ( ( ruleOpMulti ) ) ) ) = > ( ( ) ( ( ruleOpMulti ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ruleXUnaryOperation ) ) ) * ) { // InternalPureXbase . g : 1891:2 : ( this _ XUnaryOperation _ 0 = ruleXUnaryOperation ( ( ( ( ( ) ( ( ruleOpMulti ) ) ) ) = > ( ( ) ( ( ruleOpMulti ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ruleXUnaryOperation ) ) ) * ) // InternalPureXbase . g : 1892:3 : this _ XUnaryOperation _ 0 = ruleXUnaryOperation ( ( ( ( ( ) ( ( ruleOpMulti ) ) ) ) = > ( ( ) ( ( ruleOpMulti ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ruleXUnaryOperation ) ) ) * { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXMultiplicativeExpressionAccess ( ) . getXUnaryOperationParserRuleCall_0 ( ) ) ; } pushFollow ( FOLLOW_29 ) ; this_XUnaryOperation_0 = ruleXUnaryOperation ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current = this_XUnaryOperation_0 ; afterParserOrEnumRuleCall ( ) ; } // InternalPureXbase . g : 1900:3 : ( ( ( ( ( ) ( ( ruleOpMulti ) ) ) ) = > ( ( ) ( ( ruleOpMulti ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ruleXUnaryOperation ) ) ) * loop34 : do { int alt34 = 2 ; switch ( input . LA ( 1 ) ) { case 46 : { int LA34_2 = input . LA ( 2 ) ; if ( ( synpred19_InternalPureXbase ( ) ) ) { alt34 = 1 ; } } break ; case 47 : { int LA34_3 = input . LA ( 2 ) ; if ( ( synpred19_InternalPureXbase ( ) ) ) { alt34 = 1 ; } } break ; case 48 : { int LA34_4 = input . LA ( 2 ) ; if ( ( synpred19_InternalPureXbase ( ) ) ) { alt34 = 1 ; } } break ; case 49 : { int LA34_5 = input . LA ( 2 ) ; if ( ( synpred19_InternalPureXbase ( ) ) ) { alt34 = 1 ; } } break ; } switch ( alt34 ) { case 1 : // InternalPureXbase . g : 1901:4 : ( ( ( ( ) ( ( ruleOpMulti ) ) ) ) = > ( ( ) ( ( ruleOpMulti ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ruleXUnaryOperation ) ) { // InternalPureXbase . g : 1901:4 : ( ( ( ( ) ( ( ruleOpMulti ) ) ) ) = > ( ( ) ( ( ruleOpMulti ) ) ) ) // InternalPureXbase . g : 1902:5 : ( ( ( ) ( ( ruleOpMulti ) ) ) ) = > ( ( ) ( ( ruleOpMulti ) ) ) { // InternalPureXbase . g : 1912:5 : ( ( ) ( ( ruleOpMulti ) ) ) // InternalPureXbase . g : 1913:6 : ( ) ( ( ruleOpMulti ) ) { // InternalPureXbase . g : 1913:6 : ( ) // InternalPureXbase . g : 1914:7: { if ( state . backtracking == 0 ) { current = forceCreateModelElementAndSet ( grammarAccess . getXMultiplicativeExpressionAccess ( ) . getXBinaryOperationLeftOperandAction_1_0_0_0 ( ) , current ) ; } } // InternalPureXbase . g : 1920:6 : ( ( ruleOpMulti ) ) // InternalPureXbase . g : 1921:7 : ( ruleOpMulti ) { // InternalPureXbase . g : 1921:7 : ( ruleOpMulti ) // InternalPureXbase . g : 1922:8 : ruleOpMulti { if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElement ( grammarAccess . getXMultiplicativeExpressionRule ( ) ) ; } } if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXMultiplicativeExpressionAccess ( ) . getFeatureJvmIdentifiableElementCrossReference_1_0_0_1_0 ( ) ) ; } pushFollow ( FOLLOW_3 ) ; ruleOpMulti ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { afterParserOrEnumRuleCall ( ) ; } } } } } // InternalPureXbase . g : 1938:4 : ( ( lv _ rightOperand _ 3_0 = ruleXUnaryOperation ) ) // InternalPureXbase . g : 1939:5 : ( lv _ rightOperand _ 3_0 = ruleXUnaryOperation ) { // InternalPureXbase . g : 1939:5 : ( lv _ rightOperand _ 3_0 = ruleXUnaryOperation ) // InternalPureXbase . g : 1940:6 : lv _ rightOperand _ 3_0 = ruleXUnaryOperation { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXMultiplicativeExpressionAccess ( ) . getRightOperandXUnaryOperationParserRuleCall_1_1_0 ( ) ) ; } pushFollow ( FOLLOW_29 ) ; lv_rightOperand_3_0 = ruleXUnaryOperation ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getXMultiplicativeExpressionRule ( ) ) ; } set ( current , "rightOperand" , lv_rightOperand_3_0 , "org.eclipse.xtext.xbase.Xbase.XUnaryOperation" ) ; afterParserOrEnumRuleCall ( ) ; } } } } break ; default : break loop34 ; } } while ( true ) ; } } if ( state . backtracking == 0 ) { leaveRule ( ) ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ;
public class rewriteglobal_rewritepolicy_binding { /** * Use this API to fetch a rewriteglobal _ rewritepolicy _ binding resources . */ public static rewriteglobal_rewritepolicy_binding [ ] get ( nitro_service service ) throws Exception { } }
rewriteglobal_rewritepolicy_binding obj = new rewriteglobal_rewritepolicy_binding ( ) ; rewriteglobal_rewritepolicy_binding response [ ] = ( rewriteglobal_rewritepolicy_binding [ ] ) obj . get_resources ( service ) ; return response ;
public class ManagedDatabaseVulnerabilityAssessmentRuleBaselinesInner { /** * Creates or updates a database ' s vulnerability assessment rule baseline . * @ 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 managedInstanceName The name of the managed instance . * @ param databaseName The name of the database for which the vulnerability assessment rule baseline is defined . * @ param ruleId The vulnerability assessment rule ID . * @ param baselineName The name of the vulnerability assessment rule baseline ( default implies a baseline on a database level rule and master for server level rule ) . Possible values include : ' master ' , ' default ' * @ param baselineResults The rule baseline result * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the DatabaseVulnerabilityAssessmentRuleBaselineInner object if successful . */ public DatabaseVulnerabilityAssessmentRuleBaselineInner createOrUpdate ( String resourceGroupName , String managedInstanceName , String databaseName , String ruleId , VulnerabilityAssessmentPolicyBaselineName baselineName , List < DatabaseVulnerabilityAssessmentRuleBaselineItem > baselineResults ) { } }
return createOrUpdateWithServiceResponseAsync ( resourceGroupName , managedInstanceName , databaseName , ruleId , baselineName , baselineResults ) . toBlocking ( ) . single ( ) . body ( ) ;
public class DefaultBlitz4jConfig { /** * ( non - Javadoc ) * @ see com . netflix . blitz4j . BlitzConfig # shouldGenerateBlitz4jLocationInfo ( ) */ @ Override public boolean shouldGenerateBlitz4jLocationInfo ( ) { } }
return CONFIGURATION . getBooleanProperty ( GENERATE_BLITZ4J_LOCATIONINFO , Boolean . valueOf ( this . getPropertyValue ( GENERATE_BLITZ4J_LOCATIONINFO , "true" ) ) ) . get ( ) ;
public class NumericEditText { /** * Return numeric value represented by the text field * @ return numeric value */ public double getNumericValue ( ) { } }
String original = getText ( ) . toString ( ) . replaceAll ( mNumberFilterRegex , "" ) ; if ( hasCustomDecimalSeparator ) { // swap custom decimal separator with locale one to allow parsing original = StringUtils . replace ( original , String . valueOf ( mDecimalSeparator ) , String . valueOf ( DECIMAL_SEPARATOR ) ) ; } try { return NumberFormat . getInstance ( ) . parse ( original ) . doubleValue ( ) ; } catch ( ParseException e ) { return Double . NaN ; }
public class ExtSSInfoImpl { /** * ( non - Javadoc ) * @ see org . restcomm . protocols . ss7 . map . primitives . MAPAsnPrimitive # getTag ( ) */ public int getTag ( ) throws MAPException { } }
if ( forwardingInfo != null ) { return _TAG_forwardingInfo ; } else if ( callBarringInfo != null ) { return _TAG_callBarringInfo ; } else if ( cugInfo != null ) { return _TAG_cugInfo ; } else if ( ssData != null ) { return _TAG_ssData ; } else if ( emlppInfo != null ) { return _TAG_emlppInfo ; } else { throw new MAPException ( "No of choices are supplied" ) ; }
public class RequestSigning { /** * Signs a set of request parameters . * Generates additional parameters to represent the timestamp and generated signature . * Uses the supplied pre - shared secret key to generate the signature . * @ param params List of NameValuePair instances containing the query parameters for the request that is to be signed * @ param secretKey the pre - shared secret key held by the client * @ param currentTimeSeconds the current time in seconds since 1970-01-01 */ protected static void constructSignatureForRequestParameters ( List < NameValuePair > params , String secretKey , long currentTimeSeconds ) { } }
// First , inject a ' timestamp = ' parameter containing the current time in seconds since Jan 1st 1970 params . add ( new BasicNameValuePair ( PARAM_TIMESTAMP , Long . toString ( currentTimeSeconds ) ) ) ; Map < String , String > sortedParams = new TreeMap < > ( ) ; for ( NameValuePair param : params ) { String name = param . getName ( ) ; String value = param . getValue ( ) ; if ( name . equals ( PARAM_SIGNATURE ) ) continue ; if ( value == null ) value = "" ; if ( ! value . trim ( ) . equals ( "" ) ) sortedParams . put ( name , value ) ; } // Now , walk through the sorted list of parameters and construct a string StringBuilder sb = new StringBuilder ( ) ; for ( Map . Entry < String , String > param : sortedParams . entrySet ( ) ) { String name = param . getKey ( ) ; String value = param . getValue ( ) ; sb . append ( "&" ) . append ( clean ( name ) ) . append ( "=" ) . append ( clean ( value ) ) ; } // Now , append the secret key , and calculate an MD5 signature of the resultant string sb . append ( secretKey ) ; String str = sb . toString ( ) ; String md5 = "no signature" ; try { md5 = MD5Util . calculateMd5 ( str ) ; } catch ( Exception e ) { log . error ( "error..." , e ) ; } log . debug ( "SECURITY-KEY-GENERATION -- String [ " + str + " ] Signature [ " + md5 + " ] " ) ; params . add ( new BasicNameValuePair ( PARAM_SIGNATURE , md5 ) ) ;
public class MeasureSetType { /** * Gets the value of the measure property . * This accessor method returns a reference to the live list , * not a snapshot . Therefore any modification you make to the * returned list will be present inside the JAXB object . * This is why there is not a < CODE > set < / CODE > method for the measure property . * For example , to add a new item , do as follows : * < pre > * getMeasure ( ) . add ( newItem ) ; * < / pre > * Objects of the following type ( s ) are allowed in the list * { @ link MeasureSetType . Measure } */ public List < MeasureSetType . Measure > getMeasure ( ) { } }
if ( measure == null ) { measure = new ArrayList < MeasureSetType . Measure > ( ) ; } return this . measure ;
public class BiLevelCacheMap { /** * This operation is very expensive . A full copy of the Map is created */ public Object remove ( Object key ) { } }
synchronized ( _cacheL2 ) { if ( ! _cacheL1 . containsKey ( key ) && ! _cacheL2 . containsKey ( key ) ) { // nothing to remove return null ; } Object retval ; Map newMap ; synchronized ( _cacheL1 ) { // " dummy " synchronization to guarantee _ cacheL1 will be assigned after fully initialized // at least until JVM 1.5 where this should be guaranteed by the volatile keyword newMap = HashMapUtils . merge ( _cacheL1 , _cacheL2 ) ; retval = newMap . remove ( key ) ; } _cacheL1 = newMap ; _cacheL2 . clear ( ) ; _missCount = 0 ; return retval ; }
public class VirtualMachineExtensionImagesInner { /** * Gets a list of virtual machine extension image versions . * @ param location The name of a supported Azure region . * @ param publisherName the String value * @ param type the String value * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the List & lt ; VirtualMachineExtensionImageInner & gt ; object */ public Observable < List < VirtualMachineExtensionImageInner > > listVersionsAsync ( String location , String publisherName , String type ) { } }
return listVersionsWithServiceResponseAsync ( location , publisherName , type ) . map ( new Func1 < ServiceResponse < List < VirtualMachineExtensionImageInner > > , List < VirtualMachineExtensionImageInner > > ( ) { @ Override public List < VirtualMachineExtensionImageInner > call ( ServiceResponse < List < VirtualMachineExtensionImageInner > > response ) { return response . body ( ) ; } } ) ;
public class CommerceShipmentItemPersistenceImpl { /** * Returns all the commerce shipment items . * @ return the commerce shipment items */ @ Override public List < CommerceShipmentItem > findAll ( ) { } }
return findAll ( QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ;
public class CookieManager { /** * Retrieves and stores cookies returned by the host on the other side of the the open * java . net . URLConnection . * The connection MUST have been opened using the connect ( ) method or a IOException will be * thrown . * @ param conn a java . net . URLConnection - must be open , or IOException will be thrown * @ throws java . io . IOException Thrown if conn is not open . */ public void storeCookies ( URLConnection conn ) throws IOException { } }
// let ' s determine the domain from where these cookies are being sent String domain = getDomainFromHost ( conn . getURL ( ) . getHost ( ) ) ; Map < String , Map < String , String > > domainStore ; // this is where we will store cookies for this domain // now let ' s check the store to see if we have an entry for this domain if ( store . containsKey ( domain ) ) { // we do , so lets retrieve it from the store domainStore = store . get ( domain ) ; } else { // we don ' t , so let ' s create it and put it in the store domainStore = new HashMap < > ( ) ; store . put ( domain , domainStore ) ; } // OK , now we are ready to get the cookies out of the URLConnection String headerName = null ; for ( int i = 1 ; ( headerName = conn . getHeaderFieldKey ( i ) ) != null ; i ++ ) { if ( headerName . equalsIgnoreCase ( SET_COOKIE ) ) { Map < String , String > cookie = new HashMap < > ( ) ; StringTokenizer st = new StringTokenizer ( conn . getHeaderField ( i ) , COOKIE_VALUE_DELIMITER ) ; // the specification dictates that the first name / value pair // in the string is the cookie name and value , so let ' s handle // them as a special case : if ( st . hasMoreTokens ( ) ) { String token = st . nextToken ( ) ; String name = token . substring ( 0 , token . indexOf ( NAME_VALUE_SEPARATOR ) ) ; String value = token . substring ( token . indexOf ( NAME_VALUE_SEPARATOR ) + 1 , token . length ( ) ) ; domainStore . put ( name , cookie ) ; cookie . put ( name , value ) ; } while ( st . hasMoreTokens ( ) ) { String token = st . nextToken ( ) . toLowerCase ( ) ; int idx = token . indexOf ( NAME_VALUE_SEPARATOR ) ; if ( idx > 0 && idx < token . length ( ) - 1 ) { cookie . put ( token . substring ( 0 , idx ) . toLowerCase ( ) , token . substring ( idx + 1 , token . length ( ) ) ) ; } } } }
public class TaskTagsHandler { /** * Returns the defined priorities . * @ return the defined priorities . */ public Collection < String > getAvailablePriorities ( ) { } }
// FIXME : l10n ArrayList < String > priorities = new ArrayList < String > ( ) ; if ( StringUtils . isNotEmpty ( high ) ) { priorities . add ( StringUtils . capitalize ( StringUtils . lowerCase ( Priority . HIGH . name ( ) ) ) ) ; } if ( StringUtils . isNotEmpty ( normal ) ) { priorities . add ( StringUtils . capitalize ( StringUtils . lowerCase ( Priority . NORMAL . name ( ) ) ) ) ; } if ( StringUtils . isNotEmpty ( low ) ) { priorities . add ( StringUtils . capitalize ( StringUtils . lowerCase ( Priority . LOW . name ( ) ) ) ) ; } return priorities ;
public class AssetsInner { /** * List the Asset URLs . * Lists storage container URLs with shared access signatures ( SAS ) for uploading and downloading Asset content . The signatures are derived from the storage account keys . * @ param resourceGroupName The name of the resource group within the Azure subscription . * @ param accountName The Media Services account name . * @ param assetName The Asset name . * @ param parameters The request parameters * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the AssetContainerSasInner object */ public Observable < ServiceResponse < AssetContainerSasInner > > listContainerSasWithServiceResponseAsync ( String resourceGroupName , String accountName , String assetName , ListContainerSasInput parameters ) { } }
if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( accountName == null ) { throw new IllegalArgumentException ( "Parameter accountName is required and cannot be null." ) ; } if ( assetName == null ) { throw new IllegalArgumentException ( "Parameter assetName is required and cannot be null." ) ; } if ( parameters == null ) { throw new IllegalArgumentException ( "Parameter parameters is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null." ) ; } Validator . validate ( parameters ) ; return service . listContainerSas ( this . client . subscriptionId ( ) , resourceGroupName , accountName , assetName , parameters , this . client . apiVersion ( ) , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < AssetContainerSasInner > > > ( ) { @ Override public Observable < ServiceResponse < AssetContainerSasInner > > call ( Response < ResponseBody > response ) { try { ServiceResponse < AssetContainerSasInner > clientResponse = listContainerSasDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class RtfProperty { /** * Set the value of the property identified by the parameter . * @ param propertyName The property name to set * @ param propertyValueNew The object to set the property value to * @ return < code > true < / code > for handled or < code > false < / code > if < code > propertyName < / code > is < code > null < / code > */ private boolean setProperty ( String propertyName , int propertyValueNew ) { } }
if ( propertyName == null ) return false ; Object propertyValueOld = getProperty ( propertyName ) ; if ( propertyValueOld instanceof Integer ) { int valueOld = ( ( Integer ) propertyValueOld ) . intValue ( ) ; if ( valueOld == propertyValueNew ) return true ; } beforeChange ( propertyName ) ; properties . put ( propertyName , Integer . valueOf ( propertyValueNew ) ) ; afterChange ( propertyName ) ; setModified ( propertyName , true ) ; return true ;
public class StringContext { /** * Tokenize the given string with the given token . This will return an array * of strings containing each token delimited by the given value . * @ param string The string to tokenize * @ param token The token delimiter to delimit on * @ return The array of tokens based on the delimiter * @ see StringTokenizer */ public String [ ] tokenize ( String string , String token ) { } }
String [ ] result ; try { StringTokenizer st = new StringTokenizer ( string , token ) ; List < String > list = new ArrayList < String > ( ) ; while ( st . hasMoreTokens ( ) ) { list . add ( st . nextToken ( ) ) ; } result = list . toArray ( new String [ list . size ( ) ] ) ; } catch ( Exception e ) { result = null ; } return result ;
public class SQLMultiScopeRecoveryLog { /** * This method retrieves a system property named * com . ibm . ws . recoverylog . custom . jdbc . impl . TransientRetrySleepTime * which allows a value to be specified for the time we should * sleep between attempts to get a connection and retry SQL work * in the face of transient sql error conditions . */ private Integer getTransientSQLErrorRetrySleepTime ( ) { } }
if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getTransientSQLErrorRetrySleepTime" ) ; Integer transientSqlRetrySleepTime = null ; try { transientSqlRetrySleepTime = AccessController . doPrivileged ( new PrivilegedExceptionAction < Integer > ( ) { @ Override public Integer run ( ) { return Integer . getInteger ( "com.ibm.ws.recoverylog.custom.jdbc.impl.TransientRetrySleepTime" , DEFAULT_TRANSIENT_RETRY_SLEEP_TIME ) ; } } ) ; } catch ( PrivilegedActionException e ) { FFDCFilter . processException ( e , "com.ibm.ws.recoverylog.custom.jdbc.impl.SqlMultiScopeRecoveryLog.getTransientSQLErrorRetrySleepTime" , "132" ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Exception setting transient SQL retry sleep time" , e ) ; transientSqlRetrySleepTime = null ; } if ( transientSqlRetrySleepTime == null ) transientSqlRetrySleepTime = Integer . valueOf ( DEFAULT_TRANSIENT_RETRY_SLEEP_TIME ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getTransientSQLErrorRetrySleepTime" , transientSqlRetrySleepTime ) ; return transientSqlRetrySleepTime ;
public class IntentUtils { /** * Checks whether there are applications installed which are able to handle the given action / type . * @ param context the current context * @ param action the action to check * @ param mimeType the MIME type of the content ( may be null ) * @ return true if there are apps which will respond to this action / type */ public static boolean isIntentAvailable ( Context context , String action , String mimeType ) { } }
final Intent intent = new Intent ( action ) ; if ( mimeType != null ) { intent . setType ( mimeType ) ; } List < ResolveInfo > list = context . getPackageManager ( ) . queryIntentActivities ( intent , PackageManager . MATCH_DEFAULT_ONLY ) ; return ! list . isEmpty ( ) ;
public class SDMath { /** * As per { @ link # eye ( String , int , int , int . . . ) } bit with the number of rows / columns specified as scalar SDVariables , * and the batch dimension specified as a 1D SDVariable */ public SDVariable eye ( String name , SDVariable rows , SDVariable cols , SDVariable batchDimension ) { } }
SDVariable eye = new Eye ( sd , rows , cols , batchDimension ) . outputVariable ( ) ; return updateVariableNameAndReference ( eye , name ) ;
public class AbstractAddStepHandler { /** * Populate the given resource in the persistent configuration model based on the values in the given operation . * This method is invoked during { @ link org . jboss . as . controller . OperationContext . Stage # MODEL } . * This default implementation simply calls { @ link # populateModel ( ModelNode , org . jboss . dmr . ModelNode ) } . * @ param operation the operation * @ param resource the resource that corresponds to the address of { @ code operation } * @ throws OperationFailedException if { @ code operation } is invalid or populating the model otherwise fails */ protected void populateModel ( final ModelNode operation , final Resource resource ) throws OperationFailedException { } }
populateModel ( operation , resource . getModel ( ) ) ;
public class XStringForFSB { /** * Copies characters from this string into the destination character * array . * @ param srcBegin index of the first character in the string * to copy . * @ param srcEnd index after the last character in the string * to copy . * @ param dst the destination array . * @ param dstBegin the start offset in the destination array . * @ exception IndexOutOfBoundsException If any of the following * is true : * < ul > < li > < code > srcBegin < / code > is negative . * < li > < code > srcBegin < / code > is greater than < code > srcEnd < / code > * < li > < code > srcEnd < / code > is greater than the length of this * string * < li > < code > dstBegin < / code > is negative * < li > < code > dstBegin + ( srcEnd - srcBegin ) < / code > is larger than * < code > dst . length < / code > < / ul > * @ exception NullPointerException if < code > dst < / code > is < code > null < / code > */ public void getChars ( int srcBegin , int srcEnd , char dst [ ] , int dstBegin ) { } }
// % OPT % Need to call this on FSB when it is implemented . // % UNTESTED % ( I don ' t think anyone calls this yet ? ) int n = srcEnd - srcBegin ; if ( n > m_length ) n = m_length ; if ( n > ( dst . length - dstBegin ) ) n = ( dst . length - dstBegin ) ; int end = srcBegin + m_start + n ; int d = dstBegin ; FastStringBuffer fsb = fsb ( ) ; for ( int i = srcBegin + m_start ; i < end ; i ++ ) { dst [ d ++ ] = fsb . charAt ( i ) ; }
public class BTreeDir { /** * Returns the block number of the B - tree leaf block that contains the * specified search key . * @ param searchKey * the search key * @ param leafFileName * the file name of the B - tree leaf file * @ param purpose * the purpose of searching ( defined in BTreeIndex ) * @ return the BlockId of the leaf block containing that search key */ public BlockId search ( SearchKey searchKey , String leafFileName , SearchPurpose purpose ) { } }
if ( purpose == SearchPurpose . READ ) return searchForRead ( searchKey , leafFileName ) ; else if ( purpose == SearchPurpose . INSERT ) return searchForInsert ( searchKey , leafFileName ) ; else if ( purpose == SearchPurpose . DELETE ) return searchForDelete ( searchKey , leafFileName ) ; else throw new UnsupportedOperationException ( ) ;
public class OmsJsonFeatureReader { /** * Fast read access mode . * @ param path the properties file path . * @ return the read { @ link FeatureCollection } . * @ throws Exception */ public static SimpleFeatureCollection readJsonfile ( String path ) throws Exception { } }
OmsJsonFeatureReader reader = new OmsJsonFeatureReader ( ) ; reader . file = path ; reader . readFeatureCollection ( ) ; return reader . geodata ;
public class NumericNameLexer { /** * Check if the next token provided by yylex ( ) is null . * @ return true or false */ public boolean hasNextToken ( ) { } }
if ( this . nextToken == null ) { try { this . nextToken = this . jlexer . yylex ( ) ; } catch ( final IOException e ) { // TODO Auto - generated catch block e . printStackTrace ( ) ; } } return this . nextToken != null ;
public class IIMFile { /** * Checks all data sets in a given record for constraint violations . * @ param record * IIM record ( 1,2,3 , . . . ) to check * @ return list of constraint violations , empty set if IIM file is valid */ public Set < ConstraintViolation > validate ( int record ) { } }
Set < ConstraintViolation > errors = new LinkedHashSet < ConstraintViolation > ( ) ; for ( int ds = 0 ; ds < 250 ; ++ ds ) { try { DataSetInfo dataSetInfo = dsiFactory . create ( IIM . DS ( record , ds ) ) ; errors . addAll ( validate ( dataSetInfo ) ) ; } catch ( InvalidDataSetException ignored ) { // DataSetFactory doesn ' t know about this ds , so will skip it } } return errors ;
public class ApiOvhEmaildomain { /** * Get this object properties * REST : GET / email / domain / { domain } / task / mailinglist / { id } * @ param domain [ required ] Name of your domain name * @ param id [ required ] */ public OvhTaskMl domain_task_mailinglist_id_GET ( String domain , Long id ) throws IOException { } }
String qPath = "/email/domain/{domain}/task/mailinglist/{id}" ; StringBuilder sb = path ( qPath , domain , id ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhTaskMl . class ) ;
public class nsevents { /** * Use this API to fetch all the nsevents resources that are configured on netscaler . */ public static nsevents [ ] get ( nitro_service service , options option ) throws Exception { } }
nsevents obj = new nsevents ( ) ; nsevents [ ] response = ( nsevents [ ] ) obj . get_resources ( service , option ) ; return response ;
public class CalligraphyUtils { /** * Tries to pull the Font Path from the Text Appearance . * @ param context Activity Context * @ param attrs View Attributes * @ param attributeId if - 1 returns null . * @ return returns null if attribute is not defined or if no TextAppearance is found . */ static String pullFontPathFromTextAppearance ( final Context context , AttributeSet attrs , int [ ] attributeId ) { } }
if ( attributeId == null || attrs == null ) { return null ; } int textAppearanceId = - 1 ; final TypedArray typedArrayAttr = context . obtainStyledAttributes ( attrs , ANDROID_ATTR_TEXT_APPEARANCE ) ; if ( typedArrayAttr != null ) { try { textAppearanceId = typedArrayAttr . getResourceId ( 0 , - 1 ) ; } catch ( Exception ignored ) { // Failed for some reason return null ; } finally { typedArrayAttr . recycle ( ) ; } } final TypedArray textAppearanceAttrs = context . obtainStyledAttributes ( textAppearanceId , attributeId ) ; if ( textAppearanceAttrs != null ) { try { return textAppearanceAttrs . getString ( 0 ) ; } catch ( Exception ignore ) { // Failed for some reason . return null ; } finally { textAppearanceAttrs . recycle ( ) ; } } return null ;
public class CmsDateBox { /** * Returns the value of the date box as String in form of a long . < p > * @ see org . opencms . gwt . client . ui . input . I _ CmsFormWidget # getFormValueAsString ( ) */ public String getFormValueAsString ( ) { } }
Date value = getValue ( ) ; if ( value == null ) { return "" ; } else if ( allowInvalidValue ( ) && value . equals ( INVALID_DATE ) ) { return "INVALID_DATE" ; } return String . valueOf ( getValue ( ) . getTime ( ) ) ;
public class SchemaGeneratorHelper { /** * We support the basic types as directive types * @ param value the value to use * @ return a graphql input type */ public GraphQLInputType buildDirectiveInputType ( Value value ) { } }
if ( value instanceof NullValue ) { return Scalars . GraphQLString ; } if ( value instanceof FloatValue ) { return Scalars . GraphQLFloat ; } if ( value instanceof StringValue ) { return Scalars . GraphQLString ; } if ( value instanceof IntValue ) { return Scalars . GraphQLInt ; } if ( value instanceof BooleanValue ) { return Scalars . GraphQLBoolean ; } if ( value instanceof ArrayValue ) { ArrayValue arrayValue = ( ArrayValue ) value ; return list ( buildDirectiveInputType ( getArrayValueWrappedType ( arrayValue ) ) ) ; } return assertShouldNeverHappen ( "Directive values of type '%s' are not supported yet" , value . getClass ( ) . getSimpleName ( ) ) ;
public class BeanId { /** * d145400.1 */ protected static byte [ ] getJ2EENameBytes ( byte [ ] bytes ) throws CSIException { } }
// * * * * Important Note * * * * * : Much of this code was copied to com . ibm . ejs . oa . EJBOAKeyImpl . java // in ecutils and modified slightly . Changes to this code may also // require corresponding changes to that code . boolean isHome = false ; byte [ ] j2eeNameBytes = null ; // Match up the header with the new format . If it does not match // then we have an incoming type 1 BeanId . for ( int i = 0 ; i < HEADER_LEN ; i ++ ) { if ( bytes [ i ] != header [ i ] ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Header mismatch, attempting to deserialize BeanId" ) ; // Should be rare that we get an old beanid throw new CSIException ( "Parser Error: header mismatch" ) ; } } // Make sure this is a valid bean type , and if so , then read the // Java EE Name bytes from the key bytes . switch ( bytes [ HEADER_LEN ] ) { case HOME_BEAN : isHome = true ; // LI2281-3 case STATEFUL_BEAN : case STATEFUL_BEAN + USES_BEAN_MANAGED_TX : case ENTITY_BEAN : case SINGLETON_BEAN : case SINGLETON_BEAN + USES_BEAN_MANAGED_TX : case STATELESS_BEAN : case STATELESS_BEAN + USES_BEAN_MANAGED_TX : case MESSAGEDRIVEN_BEAN : // d176974 case MESSAGEDRIVEN_BEAN + USES_BEAN_MANAGED_TX : // d176974 j2eeNameBytes = readJ2EENameBytes ( bytes ) ; break ; default : if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Unable to parse bean id: unsupported EJB type: " + bytes [ HEADER_LEN ] ) ; throw new CSIException ( "Unsupported EJB Type: " + bytes [ HEADER_LEN ] ) ; } // For Home beans , the ' J2EEName ' is for HomeOfHomes , and the // primary key is the real J2EEName . . . LI2281-3 if ( isHome ) { try { int pkeyIndex = HEADER_LEN + BEAN_TYPE_LEN + J2EE_NAME_LEN + j2eeNameBytes . length ; j2eeNameBytes = ( byte [ ] ) readPKey ( bytes , pkeyIndex , null ) ; } catch ( Throwable th ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Unable to parse bean id: home j2eeName: " + th ) ; throw new CSIException ( "Unable to read j2eeName bytes" , th ) ; } } return j2eeNameBytes ;
public class CmsSessionManager { /** * Returns the OpenCms user session info for the given request , * or < code > null < / code > if no user session is available . < p > * @ param req the current request * @ return the OpenCms user session info for the given request , or < code > null < / code > if no user session is available */ public CmsSessionInfo getSessionInfo ( HttpServletRequest req ) { } }
HttpSession session = req . getSession ( false ) ; if ( session == null ) { // special case for accessing a session from " outside " requests ( e . g . upload applet ) String sessionId = req . getHeader ( CmsRequestUtil . HEADER_JSESSIONID ) ; return sessionId == null ? null : getSessionInfo ( sessionId ) ; } return getSessionInfo ( session ) ;
public class CardinalityCompositeSpec { /** * Recursively walk the spec input tree . */ private static List < CardinalitySpec > createChildren ( Map < String , Object > rawSpec ) { } }
List < CardinalitySpec > children = new ArrayList < > ( ) ; Set < String > actualKeys = new HashSet < > ( ) ; for ( String keyString : rawSpec . keySet ( ) ) { Object rawRhs = rawSpec . get ( keyString ) ; CardinalitySpec childSpec ; if ( rawRhs instanceof Map ) { childSpec = new CardinalityCompositeSpec ( keyString , ( Map < String , Object > ) rawRhs ) ; } else { childSpec = new CardinalityLeafSpec ( keyString , rawRhs ) ; } String childCanonicalString = childSpec . pathElement . getCanonicalForm ( ) ; if ( actualKeys . contains ( childCanonicalString ) ) { throw new IllegalArgumentException ( "Duplicate canonical CardinalityTransform key found : " + childCanonicalString ) ; } actualKeys . add ( childCanonicalString ) ; children . add ( childSpec ) ; } return children ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link Object } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link Object } { @ code > } */ @ XmlElementDecl ( namespace = "http://www.opengis.net/citygml/appearance/1.0" , name = "_GenericApplicationPropertyOfTexture" ) public JAXBElement < Object > create_GenericApplicationPropertyOfTexture ( Object value ) { } }
return new JAXBElement < Object > ( __GenericApplicationPropertyOfTexture_QNAME , Object . class , null , value ) ;
public class SubFileFilter { /** * Called when a change is the record status is about to happen / has happened . * On an add or lock , makes sure the main key field is set to the current main target field * so it will be a child of the current main record . * @ param field If this file change is due to a field , this is the field . * @ param iChangeType The type of change that occurred . * @ param bDisplayOption If true , display any changes . * @ return an error code . * Before an add , set the key back to the original value . */ public int doRecordChange ( FieldInfo field , int iChangeType , boolean bDisplayOption ) { } }
// Read a valid record int iErrorCode = DBConstants . NORMAL_RETURN ; switch ( iChangeType ) { case DBConstants . LOCK_TYPE : if ( this . getMainRecord ( ) != null ) iErrorCode = this . getMainRecord ( ) . handleRecordChange ( this . getMainFileKeyField ( false ) , DBConstants . FIELD_CHANGED_TYPE , bDisplayOption ) ; // Tell the main file that I changed ( so it can lock / whatever ) break ; // case DBConstants . AFTER _ REFRESH _ TYPE : case DBConstants . UPDATE_TYPE : // If refresh is set , it is possible that first add is UPDATE _ TYPE if ( ! this . getOwner ( ) . isRefreshedRecord ( ) ) break ; // No first add case DBConstants . ADD_TYPE : boolean bOldSelect = this . enableReselect ( false ) ; if ( this . getMainRecord ( ) != null ) { if ( this . getMainRecord ( ) . getEditMode ( ) == DBConstants . EDIT_ADD ) { if ( ! m_bAddNewHeaderOnAdd ) return this . getOwner ( ) . getTask ( ) . setLastError ( "Can't add detail without a header record" ) ; m_bMainRecordChanged = true ; } iErrorCode = this . getMainRecord ( ) . handleRecordChange ( this . getMainFileKeyField ( false ) , DBConstants . FIELD_CHANGED_TYPE , bDisplayOption ) ; // Tell the main file that I changed ( so it can lock / whatever ) iErrorCode = DBConstants . NORMAL_RETURN ; // Ignore error on lock main ! } this . enableReselect ( bOldSelect ) ; break ; case DBConstants . AFTER_ADD_TYPE : // Note : This code is not necessary , since the newly added record is now a member of the new header record a refresh is not necessary ! // if ( m _ bMainRecordChanged ) // iErrorCode = this . getMainFileKeyField ( true ) . handleFieldChanged ( bDisplayOption , DBConstants . SCREEN _ MOVE ) ; / / Tell the main file that I changed ( so it can lock / whatever ) break ; default : m_bMainRecordChanged = false ; break ; } if ( iErrorCode != DBConstants . NORMAL_RETURN ) return iErrorCode ; return super . doRecordChange ( field , iChangeType , bDisplayOption ) ; // Initialize the record
public class TileBasedLayerClient { /** * Create a new OSM layer with the given ID and tile configuration . The layer will be configured * with the default OSM tile services so you don ' t have to specify these URLs yourself . * @ param id The unique ID of the layer . * @ param conf The tile configuration . * @ return A new OSM layer . * @ since 2.2.1 */ public OsmLayer createDefaultOsmLayer ( String id , int nrOfLevels ) { } }
OsmLayer layer = new OsmLayer ( id , createOsmTileConfiguration ( nrOfLevels ) ) ; layer . addUrls ( Arrays . asList ( DEFAULT_OSM_URLS ) ) ; return layer ;
public class GetDocumentationVersionRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetDocumentationVersionRequest getDocumentationVersionRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getDocumentationVersionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getDocumentationVersionRequest . getRestApiId ( ) , RESTAPIID_BINDING ) ; protocolMarshaller . marshall ( getDocumentationVersionRequest . getDocumentationVersion ( ) , DOCUMENTATIONVERSION_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class PassiveRole { /** * Truncates uncommitted entries from the log . */ private void truncateUncommittedEntries ( ) { } }
if ( role ( ) == RaftServer . Role . PASSIVE ) { final RaftLogWriter writer = raft . getLogWriter ( ) ; writer . truncate ( raft . getCommitIndex ( ) ) ; }
public class Utils { /** * Creates a { @ link ResourceLocation } from the specified name . < br > * The name is split on ' : ' to find the modid . < br > * If the modid is not specified , the current active mod container is used , or " minecraft " if none is found . * @ param name the name * @ return the resource location */ public static ResourceLocation getResourceLocation ( String name ) { } }
int index = name . lastIndexOf ( ':' ) ; String res = null ; String modid = null ; if ( index == - 1 ) { ModContainer container = Loader . instance ( ) . activeModContainer ( ) ; modid = container != null ? container . getModId ( ) : "minecraft" ; res = name ; } else { modid = name . substring ( 0 , index ) ; res = name . substring ( index + 1 ) ; } return new ResourceLocation ( modid , res ) ;
public class BaseCountdown { /** * get all view width * @ return all view width */ public int getAllContentWidth ( ) { } }
float width = getAllContentWidthBase ( mTimeTextWidth ) ; if ( ! isConvertDaysToHours && isShowDay ) { if ( isDayLargeNinetyNine ) { Rect rect = new Rect ( ) ; String tempDay = String . valueOf ( mDay ) ; mTimeTextPaint . getTextBounds ( tempDay , 0 , tempDay . length ( ) , rect ) ; mDayTimeTextWidth = rect . width ( ) ; width += mDayTimeTextWidth ; } else { mDayTimeTextWidth = mTimeTextWidth ; width += mTimeTextWidth ; } } return ( int ) Math . ceil ( width ) ;
public class WrappedByteBuffer { /** * Set the byte order for this buffer * @ param o ByteOrder * @ return the ByteOrder specified * @ deprecated Will return WrappedByteBuffer in future releases to match java . nio . ByteBuffer */ public ByteOrder order ( ByteOrder o ) { } }
// TODO : In the next release , return WrappedByteBuffer - use return _ buf . order ( o ) _isBigEndian = "BIG_ENDIAN" . equals ( o . toString ( ) ) ; _buf . order ( o ) ; return o ;
public class DefaultPageBook { /** * Page registration ( internal ) APIs */ public Page serviceAt ( String uri , Class < ? > pageClass ) { } }
// Handle subpaths , registering each as a separate instance of the page // tuple . for ( Method method : pageClass . getDeclaredMethods ( ) ) { if ( method . isAnnotationPresent ( At . class ) ) { // This is a subpath expression . At at = method . getAnnotation ( At . class ) ; String subpath = at . value ( ) ; // Validate subpath if ( ! subpath . startsWith ( "/" ) || subpath . isEmpty ( ) || subpath . length ( ) == 1 ) { throw new IllegalArgumentException ( String . format ( "Subpath At(\"%s\") on %s.%s() must begin with a \"/\" and must not be empty" , subpath , pageClass . getName ( ) , method . getName ( ) ) ) ; } subpath = uri + subpath ; // Register as headless web service . doAt ( subpath , pageClass , true ) ; } } return doAt ( uri , pageClass , true ) ;
public class Binder { /** * Specifies the master properties that are part of the binding . * @ param masters Master properties . * @ param < MO > Type of value to be read from the master properties . * @ return DSL object . */ public static < MO > MultipleMasterBinding < MO , Collection < MO > > read ( Collection < ReadableProperty < MO > > masters ) { } }
return new MultipleMasterBinding < MO , Collection < MO > > ( masters , null ) ;
public class TypesafeConfigUtils { /** * Get a configuration as String . Return { @ code null } if missing or wrong type . * @ param config * @ param path * @ return */ public static Optional < String > getStringOptional ( Config config , String path ) { } }
return Optional . ofNullable ( getString ( config , path ) ) ;
public class RestApiExceptionHandler { /** * TODO - Figure out why this method is not being called */ @ ExceptionHandler ( UnrecognizedPropertyException . class ) public ResponseEntity < ? > handleUnrecognizedProperty ( UnrecognizedPropertyException ex , HttpServletRequest request ) { } }
ErrorResponse response = new ErrorResponse ( ) ; response . addFieldError ( ex . getPropertyName ( ) , ex . getMessage ( ) ) ; return ResponseEntity . status ( HttpStatus . BAD_REQUEST ) . body ( response ) ;
public class CursorUtils { /** * Checks if the column value is null or not . * @ see android . database . Cursor # isNull ( int ) . * @ see android . database . Cursor # getColumnIndex ( String ) . * @ param cursor the cursor . * @ param columnName the column name . * @ return true if the column value is null . */ public static boolean isNull ( Cursor cursor , String columnName ) { } }
return cursor != null && cursor . isNull ( cursor . getColumnIndex ( columnName ) ) ;
public class MockServletContext { /** * ( non - Javadoc ) * @ see javax . servlet . ServletContext # getResourceAsStream ( java . lang . String ) */ public InputStream getResourceAsStream ( String path ) { } }
path = path . replace ( '/' , File . separatorChar ) ; InputStream is = null ; try { is = new FileInputStream ( new File ( baseDir , path ) ) ; } catch ( FileNotFoundException e ) { logger . info ( "File for path : '" + path + "' not found using baseDir '" + baseDir + "'" ) ; } return is ;
public class StreamExecutionEnvironment { /** * Creates a new data stream that contains the strings received infinitely from a socket . Received strings are * decoded by the system ' s default character set . On the termination of the socket server connection retries can be * initiated . * < p > Let us note that the socket itself does not report on abort and as a consequence retries are only initiated when * the socket was gracefully terminated . * @ param hostname * The host name which a server socket binds * @ param port * The port number which a server socket binds . A port number of 0 means that the port number is automatically * allocated . * @ param delimiter * A character which splits received strings into records * @ param maxRetry * The maximal retry interval in seconds while the program waits for a socket that is temporarily down . * Reconnection is initiated every second . A number of 0 means that the reader is immediately terminated , * while * anegative value ensures retrying forever . * @ return A data stream containing the strings received from the socket * @ deprecated Use { @ link # socketTextStream ( String , int , String , long ) } instead . */ @ Deprecated public DataStreamSource < String > socketTextStream ( String hostname , int port , char delimiter , long maxRetry ) { } }
return socketTextStream ( hostname , port , String . valueOf ( delimiter ) , maxRetry ) ;
public class TransitionsConfig { /** * Import all tiles from their nodes . * @ param nodesTileRef The tiles nodes ( must not be < code > null < / code > ) . * @ return The imported tiles ref . */ private static Collection < TileRef > importTiles ( Collection < Xml > nodesTileRef ) { } }
final Collection < TileRef > tilesRef = new HashSet < > ( nodesTileRef . size ( ) ) ; for ( final Xml nodeTileRef : nodesTileRef ) { final TileRef tileRef = TileConfig . imports ( nodeTileRef ) ; tilesRef . add ( tileRef ) ; } return tilesRef ;