signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class AbstractJournalOperation { /** * Write the operation to the given journal file * @ param journalFile teh journal file */ protected void writeTo ( JournalFile journalFile ) throws JournalException { } }
journalFile . writeByte ( type ) ; journalFile . writeLong ( transactionId ) ;
public class Balancer { /** * / * Initialize balancer . It sets the value of the threshold , and * builds the communication proxies to * namenode as a client and a secondary namenode and retry proxies * when connection fails . */ private void init ( InetSocketAddress namenodeAddress ) throws IOException { } }
this . namenodeAddress = namenodeAddress ; this . myMetrics = new BalancerMetrics ( conf , namenodeAddress ) ; this . fetchBlocksSize = conf . getLong ( BalancerConfigKeys . DFS_BALANCER_FETCH_SIZE_KEY , BalancerConfigKeys . DFS_BALANCER_FETCH_SIZE_DEFAULT ) ; this . minBlockReplicas = conf . getInt ( BalancerConfigKeys . DFS_BALANCER_MIN_REPLICAS_KEY , BalancerConfigKeys . DFS_BALANCER_MIN_REPLICAS_DEFAULT ) ; this . maxFetchCount = conf . getInt ( BalancerConfigKeys . DFS_BALANCER_FETCH_COUNT_KEY , BalancerConfigKeys . DFS_BALANCER_FETCH_COUNT_DEFAULT ) ; initFS ( ) ; initNameNodes ( ) ; this . moverExecutor = Executors . newFixedThreadPool ( moveThreads ) ; int dispatchThreads = ( int ) Math . max ( 1 , moveThreads / maxConcurrentMoves ) ; this . dispatcherExecutor = Executors . newFixedThreadPool ( dispatchThreads ) ; /* Check if there is another balancer running . * Exit if there is another one running . */ this . out = checkAndMarkRunningBalancer ( ) ; if ( out == null ) { throw new IOException ( "Another balancer is running" ) ; } // get namespace id LocatedBlocksWithMetaInfo locations = client . openAndFetchMetaInfo ( BALANCER_ID_PATH . toString ( ) , 0L , 1L ) ; this . namespaceId = locations . getNamespaceID ( ) ;
public class GuidCompressor { /** * Conversion of an integer into a number with base 64 * using the table cConversionTable * @ param number * @ param code * @ param len * @ return true if no error occurred */ private static boolean cv_to_64 ( long number , char [ ] code , int len ) { } }
long act ; int iDigit , nDigits ; char [ ] result = new char [ 5 ] ; if ( len > 5 ) return false ; act = number ; nDigits = len - 1 ; for ( iDigit = 0 ; iDigit < nDigits ; iDigit ++ ) { result [ nDigits - iDigit - 1 ] = cConversionTable [ ( int ) ( act % 64 ) ] ; act /= 64 ; } result [ len - 1 ] = '\0' ; if ( act != 0 ) return false ; for ( int i = 0 ; i < result . length ; i ++ ) code [ i ] = result [ i ] ; return true ;
public class CustomScopeAnnotationConfigurer { /** * Checks how is bean defined and deduces scope name from JSF CDI annotations . * @ param definition beanDefinition */ private void registerJsfCdiToSpring ( BeanDefinition definition ) { } }
if ( definition instanceof AnnotatedBeanDefinition ) { AnnotatedBeanDefinition annDef = ( AnnotatedBeanDefinition ) definition ; String scopeName = null ; // firstly check whether bean is defined via configuration if ( annDef . getFactoryMethodMetadata ( ) != null ) { scopeName = deduceScopeName ( annDef . getFactoryMethodMetadata ( ) ) ; } else { // fallback to type scopeName = deduceScopeName ( annDef . getMetadata ( ) ) ; } if ( scopeName != null ) { definition . setScope ( scopeName ) ; log . debug ( "{} - Scope({})" , definition . getBeanClassName ( ) , scopeName . toUpperCase ( ) ) ; } }
public class Admin { /** * @ throws PageException */ private void doResetPassword ( ) throws PageException { } }
try { admin . removePassword ( getString ( "contextPath" , null ) ) ; } catch ( Exception e ) { SystemOut . printDate ( e ) ; } store ( ) ;
public class GPX { /** * Read an GPX object from the given { @ code input } stream . * @ since 1.1 * @ param input the input stream from where the GPX date is read * @ param lenient if { @ code true } , out - of - range and syntactical errors are * ignored . E . g . a { @ code WayPoint } with { @ code lat } values not in * the valid range of [ - 90 . . 90 ] are ignored / skipped . * @ return the GPX object read from the input stream * @ throws IOException if the GPX object can ' t be read * @ throws NullPointerException if the given { @ code input } stream is * { @ code null } * @ see # reader ( GPX . Version , GPX . Reader . Mode ) * @ deprecated Use { @ code GPX . reader ( Mode . LENIENT ) . read ( input ) } instead */ @ Deprecated public static GPX read ( final InputStream input , final boolean lenient ) throws IOException { } }
return reader ( Version . V11 , lenient ? Mode . LENIENT : Mode . STRICT ) . read ( input ) ;
public class CheckSum { /** * Update the underlying buffer using the short * @ param number number to be stored in checksum buffer */ public void update ( short number ) { } }
byte [ ] numberInBytes = new byte [ ByteUtils . SIZE_OF_SHORT ] ; ByteUtils . writeShort ( numberInBytes , number , 0 ) ; update ( numberInBytes ) ;
public class CmsVaadinUtils { /** * Reads the declarative design for a component and localizes it using a messages object . < p > * The design will need to be located in the same directory as the component ' s class and have ' . html ' as a file extension . * @ param component the component for which to read the design * @ param messages the message bundle to use for localization * @ param macros the macros to use on the HTML template */ @ SuppressWarnings ( "resource" ) public static void readAndLocalizeDesign ( Component component , CmsMessages messages , Map < String , String > macros ) { } }
Class < ? > componentClass = component . getClass ( ) ; List < Class < ? > > classes = Lists . newArrayList ( ) ; classes . add ( componentClass ) ; classes . addAll ( ClassUtils . getAllSuperclasses ( componentClass ) ) ; InputStream designStream = null ; for ( Class < ? > cls : classes ) { if ( cls . getName ( ) . startsWith ( "com.vaadin" ) ) { break ; } String filename = cls . getSimpleName ( ) + ".html" ; designStream = cls . getResourceAsStream ( filename ) ; if ( designStream != null ) { break ; } } if ( designStream == null ) { throw new IllegalArgumentException ( "Design not found for : " + component . getClass ( ) ) ; } readAndLocalizeDesign ( component , designStream , messages , macros ) ;
public class BaseMessagingEngineImpl { /** * Accessor method to return a destination definition . * @ param bus * @ param key * @ param newCache * @ return the destination cache */ BaseDestinationDefinition getSIBDestinationByUuid ( String bus , String key , boolean newCache ) throws SIBExceptionDestinationNotFound , SIBExceptionBase { } }
String thisMethodName = "getSIBDestinationByUuid" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , thisMethodName , new Object [ ] { bus , key , new Boolean ( newCache ) } ) ; } BaseDestinationDefinition bdd = null ; if ( oldDestCache == null || newCache ) { bdd = ( BaseDestinationDefinition ) _bus . getDestinationCache ( ) . getSIBDestinationByUuid ( bus , key ) . clone ( ) ; } else { bdd = ( BaseDestinationDefinition ) oldDestCache . getSIBDestinationByUuid ( bus , key ) . clone ( ) ; } // Resolve Exception Destination if necessary resolveExceptionDestination ( bdd ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , thisMethodName , bdd ) ; } return bdd ;
public class Panels { /** * Creates a new { @ code Panel } with a { @ code LinearLayout } layout manager in vertical mode and adds all the * components passed in * @ param components Components to be added to the new { @ code Panel } , in order * @ return The new { @ code Panel } */ public static Panel vertical ( Component ... components ) { } }
Panel panel = new Panel ( ) ; panel . setLayoutManager ( new LinearLayout ( Direction . VERTICAL ) ) ; for ( Component component : components ) { panel . addComponent ( component ) ; } return panel ;
public class StringUtil { /** * Ensures that a string includes a given substring at a given position . * Extends the string with a given string if it is not already there . * E . g an URL " www . vg . no " , to " http : / / www . vg . no " . * @ param pSource The source string . * @ param pSubstring The substring to include . * @ param pPosition The location of the fill - in , the index starts with 0. * @ return the string , with the substring at the given location . */ static String ensureIncludesAt ( String pSource , String pSubstring , int pPosition ) { } }
StringBuilder newString = new StringBuilder ( pSource ) ; try { String existingSubstring = pSource . substring ( pPosition , pPosition + pSubstring . length ( ) ) ; if ( ! existingSubstring . equalsIgnoreCase ( pSubstring ) ) { newString . insert ( pPosition , pSubstring ) ; } } catch ( Exception e ) { // Do something ! ? } return newString . toString ( ) ;
public class SIXAResourceProxy { /** * Returns the transaction timeout for this XAResource instance . * @ return int * @ throws XAException if an exception is thrown at the ME . In the * event of a comms failure , an XAException with XAER _ RMFAIL will * be thrown . */ public int getTransactionTimeout ( ) throws XAException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getTransactionTimeout" ) ; int timeout = 0 ; try { CommsByteBuffer request = getCommsByteBuffer ( ) ; request . putInt ( getTransactionId ( ) ) ; CommsByteBuffer reply = jfapExchange ( request , JFapChannelConstants . SEG_XA_GETTXTIMEOUT , JFapChannelConstants . PRIORITY_MEDIUM , true ) ; try { reply . checkXACommandCompletionStatus ( JFapChannelConstants . SEG_XA_GETTXTIMEOUT_R , getConversation ( ) ) ; timeout = reply . getInt ( ) ; } finally { if ( reply != null ) reply . release ( ) ; } } catch ( XAException xa ) { // No FFDC Code needed // Simply re - throw . . . throw xa ; } catch ( Exception e ) { FFDCFilter . processException ( e , CLASS_NAME + ".getTransactionTimeout" , CommsConstants . SIXARESOURCEPROXY_GETTXTIMEOUT_01 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Caught a comms problem:" , e ) ; throw new XAException ( XAException . XAER_RMFAIL ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getTransactionTimeout" , "" + timeout ) ; return timeout ;
public class DocumentVersionMetadata { /** * The thumbnail of the document . * @ param thumbnail * The thumbnail of the document . * @ return Returns a reference to this object so that method calls can be chained together . */ public DocumentVersionMetadata withThumbnail ( java . util . Map < String , String > thumbnail ) { } }
setThumbnail ( thumbnail ) ; return this ;
public class CalendarScanListener { /** * GetNewCalendarPath Method . */ public String getNewCalendarPath ( File file ) { } }
StringTokenizer st = new StringTokenizer ( file . getName ( ) ) ; int iPlace = 0 , iMonth = 0 , iYear = 0 ; while ( st . hasMoreTokens ( ) ) { String strToken = st . nextToken ( ) ; if ( strToken . length ( ) > 2 ) break ; // Not a date if ( ! Utility . isNumeric ( strToken ) ) break ; // Not a date if ( strToken . indexOf ( '.' ) != - 1 ) break ; int iNumber = Integer . parseInt ( strToken ) ; iPlace ++ ; if ( iPlace == 1 ) { // Month if ( ( iNumber < 1 ) || ( iNumber > 12 ) ) break ; // Invalid month iMonth = iNumber ; } else if ( iPlace == 2 ) { // day if ( ( iNumber < 1 ) || ( iNumber > 31 ) ) break ; // Invalid day } else if ( iPlace == 3 ) { // Year if ( ( iNumber < 1 ) || ( iNumber > 2020 ) ) break ; // Invalid year iYear = iNumber ; if ( iYear <= 20 ) iYear = iYear + 2000 ; return Integer . toString ( iYear ) + '/' + m_rgstrMonths [ iMonth - 1 ] ; } } return null ; // Not formatted correctly
public class CsvFileExtensions { /** * Stores a komma seperated file to a properties object . As key is the number from the counter . * @ param output * the output * @ param input * the input * @ param comments * the comments * @ throws IOException * Signals that an I / O exception has occurred . */ public static void storeFilelistToProperties ( final File output , final File input , final String comments ) throws IOException { } }
final Properties prop = readFilelistToProperties ( input ) ; try ( final OutputStream out = StreamExtensions . getOutputStream ( output , true ) ) { prop . store ( out , comments ) ; } final OutputStream out = StreamExtensions . getOutputStream ( output , true ) ; prop . store ( out , comments ) ;
public class HttpClientBuilder { /** * Configures secure schema for the HTTPS for current host * ( see { @ link # ssl ( String ) } ) . * @ param schemasecure schema ( usually , this is " https " ) * @ return this * @ see # ssl ( String ) */ public HttpClientBuilder secureSchema ( String schema ) { } }
if ( sslHostConfig == null ) { throw new IllegalStateException ( "ssl(String) must be called before this" ) ; } sslHostConfig . secureSchema = schema ; return this ;
public class NormalDistributionTypeImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setMean ( double newMean ) { } }
double oldMean = mean ; mean = newMean ; boolean oldMeanESet = meanESet ; meanESet = true ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , BpsimPackage . NORMAL_DISTRIBUTION_TYPE__MEAN , oldMean , mean , ! oldMeanESet ) ) ;
public class CodedInput { /** * START EXTRA */ @ Override public < T > int readFieldNumber ( Schema < T > schema ) throws IOException { } }
if ( isAtEnd ( ) ) { lastTag = 0 ; return 0 ; } // are we reading packed field ? if ( isCurrentFieldPacked ( ) ) { if ( packedLimit < getTotalBytesRead ( ) ) throw ProtobufException . misreportedSize ( ) ; // Return field number while reading packed field return lastTag >>> TAG_TYPE_BITS ; } packedLimit = 0 ; final int tag = readRawVarint32 ( ) ; final int fieldNumber = tag >>> TAG_TYPE_BITS ; if ( fieldNumber == 0 ) { if ( decodeNestedMessageAsGroup && WIRETYPE_TAIL_DELIMITER == ( tag & TAG_TYPE_MASK ) ) { // protostuff ' s tail delimiter for streaming // 2 options : length - delimited or tail - delimited . lastTag = 0 ; return 0 ; } // If we actually read zero , that ' s not a valid tag . throw ProtobufException . invalidTag ( ) ; } if ( decodeNestedMessageAsGroup && WIRETYPE_END_GROUP == ( tag & TAG_TYPE_MASK ) ) { lastTag = 0 ; return 0 ; } lastTag = tag ; return fieldNumber ;
public class EhcacheBase { /** * { @ inheritDoc } */ @ Override public boolean replace ( final K key , final V oldValue , final V newValue ) { } }
replaceObserver . begin ( ) ; try { statusTransitioner . checkAvailable ( ) ; checkNonNull ( key , oldValue , newValue ) ; try { Store . ReplaceStatus status = doReplace ( key , oldValue , newValue ) ; switch ( status ) { case HIT : replaceObserver . end ( ReplaceOutcome . HIT ) ; return true ; case MISS_PRESENT : replaceObserver . end ( ReplaceOutcome . MISS_PRESENT ) ; return false ; case MISS_NOT_PRESENT : replaceObserver . end ( ReplaceOutcome . MISS_NOT_PRESENT ) ; return false ; default : throw new AssertionError ( "Invalid Status:" + status ) ; } } catch ( StoreAccessException e ) { boolean success = resilienceStrategy . replaceFailure ( key , oldValue , newValue , e ) ; replaceObserver . end ( ReplaceOutcome . FAILURE ) ; return success ; } } catch ( Throwable e ) { replaceObserver . end ( ReplaceOutcome . FAILURE ) ; throw e ; }
public class MPBase { /** * Returns standard headers for all the requests * @ return a collection with headers objects */ private static Collection < Header > getStandardHeaders ( ) { } }
Collection < Header > colHeaders = new Vector < Header > ( ) ; colHeaders . add ( new BasicHeader ( HTTP . CONTENT_TYPE , "application/json" ) ) ; colHeaders . add ( new BasicHeader ( HTTP . USER_AGENT , "MercadoPago Java SDK/1.0.10" ) ) ; colHeaders . add ( new BasicHeader ( "x-product-id" , "BC32A7VTRPP001U8NHJ0" ) ) ; return colHeaders ;
public class WebGL10 { /** * < p > { @ code glBufferSubData } redefines some or all of the data store for the buffer object currently bound to * { @ code target } . Data starting at byte offset { @ code offset } and extending for { @ code size } bytes is copied to the * data store from the memory pointed to by { @ code data } . An error is thrown if { @ code offset } and { @ code size } * together define a range beyond the bounds of the buffer object ' s data store . < / p > * < p > { @ link # GL _ INVALID _ ENUM } is generated if target is not { @ link # GL _ ARRAY _ BUFFER } or { @ link * # GL _ ELEMENT _ ARRAY _ BUFFER } . < / p > * < p > { @ link # GL _ INVALID _ VALUE } is generated if offset or size is negative , or if together they define a region of * memory that extends beyond the buffer object ' s allocated data store . < / p > * < p > { @ link # GL _ INVALID _ OPERATION } is generated if the reserved buffer object name 0 is bound to target . < / p > * @ param target Specifies the target buffer object . The symbolic constant must be { @ link # GL _ ARRAY _ BUFFER } or * { @ link # GL _ ELEMENT _ ARRAY _ BUFFER } . * @ param offset Specifies the offset into the buffer object ' s data store where data replacement will begin , * measured in bytes . * @ param size Specifies the size in bytes of the data store region being replaced . * @ param data Specifies the new data that will be copied into the data store . */ public static void glBufferSubData ( int target , int offset , int size , short [ ] data ) { } }
checkContextCompatibility ( ) ; Int16Array dataBuffer = Int16ArrayNative . create ( data . length ) ; dataBuffer . set ( data ) ; nglBufferSubData ( target , offset , size , dataBuffer ) ;
public class MtasUpdateRequestProcessorResultWriter { /** * ( non - Javadoc ) * @ see java . io . Closeable # close ( ) */ @ Override public void close ( ) throws IOException { } }
if ( ! closed ) { objectOutputStream . close ( ) ; fileOutputStream . close ( ) ; closed = true ; }
public class GVRNewWrapperProvider { /** * Wraps a RGBA color . * A color consists of 4 float values ( r , g , b , a ) starting from offset * @ param buffer * the buffer to wrap * @ param offset * the offset into buffer * @ return the wrapped color */ @ Override public AiColor wrapColor ( ByteBuffer buffer , int offset ) { } }
AiColor color = new AiColor ( buffer , offset ) ; return color ;
public class ExamplesUtil { /** * Generates examples for string properties or parameters with given format * @ param format the format of the string property * @ param enumValues the enum values * @ return example */ public static String generateStringExample ( String format , List < String > enumValues ) { } }
if ( enumValues == null || enumValues . isEmpty ( ) ) { if ( format == null ) { return "string" ; } else { switch ( format ) { case "byte" : return "Ynl0ZQ==" ; case "date" : return "1970-01-01" ; case "date-time" : return "1970-01-01T00:00:00Z" ; case "email" : return "email@example.com" ; case "password" : return "secret" ; case "uuid" : return "f81d4fae-7dec-11d0-a765-00a0c91e6bf6" ; default : return "string" ; } } } else { return enumValues . get ( 0 ) ; }
public class ListAccountSettingsResult { /** * The account settings for the resource . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setSettings ( java . util . Collection ) } or { @ link # withSettings ( java . util . Collection ) } if you want to override * the existing values . * @ param settings * The account settings for the resource . * @ return Returns a reference to this object so that method calls can be chained together . */ public ListAccountSettingsResult withSettings ( Setting ... settings ) { } }
if ( this . settings == null ) { setSettings ( new com . amazonaws . internal . SdkInternalList < Setting > ( settings . length ) ) ; } for ( Setting ele : settings ) { this . settings . add ( ele ) ; } return this ;
public class TransportClient { /** * Sends an opaque message to the RpcHandler on the server - side . The callback will be invoked * with the server ' s response or upon any failure . * @ param message The message to send . * @ param callback Callback to handle the RPC ' s reply . * @ return The RPC ' s id . */ public long sendRpc ( ByteBuffer message , RpcResponseCallback callback ) { } }
if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Sending RPC to {}" , getRemoteAddress ( channel ) ) ; } long requestId = requestId ( ) ; handler . addRpcRequest ( requestId , callback ) ; RpcChannelListener listener = new RpcChannelListener ( requestId , callback ) ; channel . writeAndFlush ( new RpcRequest ( requestId , new NioManagedBuffer ( message ) ) ) . addListener ( listener ) ; return requestId ;
public class ThemeSwitcher { /** * Returns a map marker { @ link Bitmap } based on the current theme setting . * @ param context to retrieve the drawable for the given resource ID * @ return { @ link Bitmap } map marker dark or light */ public static Bitmap retrieveThemeMapMarker ( Context context ) { } }
TypedValue destinationMarkerResId = resolveAttributeFromId ( context , R . attr . navigationViewDestinationMarker ) ; int markerResId = destinationMarkerResId . resourceId ; Drawable markerDrawable = ContextCompat . getDrawable ( context , markerResId ) ; return BitmapUtils . getBitmapFromDrawable ( markerDrawable ) ;
public class SessionManager { /** * Downloads a magnet uri . * @ param magnetUri the magnet uri to download * @ param saveDir the path to save the downloaded files */ public void download ( String magnetUri , File saveDir ) { } }
if ( session == null ) { return ; } error_code ec = new error_code ( ) ; add_torrent_params p = add_torrent_params . parse_magnet_uri ( magnetUri , ec ) ; if ( ec . value ( ) != 0 ) { throw new IllegalArgumentException ( ec . message ( ) ) ; } sha1_hash info_hash = p . getInfo_hash ( ) ; torrent_handle th = session . find_torrent ( info_hash ) ; if ( th != null && th . is_valid ( ) ) { // found a download with the same hash return ; } if ( saveDir != null ) { p . setSave_path ( saveDir . getAbsolutePath ( ) ) ; } torrent_flags_t flags = p . getFlags ( ) ; flags = flags . and_ ( TorrentFlags . AUTO_MANAGED . inv ( ) ) ; p . setFlags ( flags ) ; session . async_add_torrent ( p ) ;
public class AbstractBigtableTable { /** * { @ inheritDoc } */ @ Override public void batch ( List < ? extends Row > actions , Object [ ] results ) throws IOException , InterruptedException { } }
LOG . trace ( "batch(List<>, Object[])" ) ; try ( Scope scope = TRACER . spanBuilder ( "BigtableTable.batch" ) . startScopedSpan ( ) ) { addBatchSizeAnnotation ( actions ) ; getBatchExecutor ( ) . batch ( actions , results ) ; }
public class IncrementalSAXSource_Filter { /** * DTDHandler support . */ public void notationDecl ( String a , String b , String c ) throws SAXException { } }
if ( null != clientDTDHandler ) clientDTDHandler . notationDecl ( a , b , c ) ;
public class ContainerBase { /** * { @ inheritDoc } * @ see org . jboss . shrinkwrap . api . Archive # contains ( java . lang . String ) */ @ Override public boolean contains ( final String path ) throws IllegalArgumentException { } }
Validate . notNull ( path , "Path must be specified" ) ; return this . contains ( ArchivePaths . create ( path ) ) ;
public class ResourceLoader { /** * Loads the contents of a project resource file in a string . * @ param resourceFileName The name of the resource file . * @ return A string value representing the entire content of the resource . * @ throws IOException * @ throws URISyntaxException */ public static String loadAsString ( String resourceFileName ) throws IOException , URISyntaxException { } }
try ( InputStream is = ResourceLoader . class . getClassLoader ( ) . getResourceAsStream ( resourceFileName ) ) { StringWriter stringWriter = new StringWriter ( ) ; IOUtils . copy ( is , stringWriter , StandardCharsets . UTF_8 ) ; return stringWriter . toString ( ) ; }
public class BigtableDataClientWrapper { /** * { @ inheritDoc } */ @ Override public Row readModifyWriteRow ( ReadModifyWriteRow readModifyWriteRow ) { } }
ReadModifyWriteRowResponse response = delegate . readModifyWriteRow ( readModifyWriteRow . toProto ( requestContext ) ) ; return new DefaultRowAdapter ( ) . createRowFromProto ( response . getRow ( ) ) ;
public class OverlyConcreteParameter { /** * determines whether the method is a baked in special method of the jdk * @ param methodName the method name to check * @ param methodSig the parameter signature of the method to check * @ return if it is a well known baked in method */ private static boolean methodIsSpecial ( String methodName , String methodSig ) { } }
return SignatureBuilder . SIG_READ_OBJECT . equals ( methodName + methodSig ) ;
public class ResponseDownloadPerformer { public void downloadByteData ( ResponseDownloadResource resource , HttpServletResponse response ) { } }
final byte [ ] byteData = resource . getByteData ( ) ; if ( byteData == null ) { String msg = "Either byte data or input stream is required: " + resource ; throw new IllegalArgumentException ( msg ) ; } try { final OutputStream out = response . getOutputStream ( ) ; try { out . write ( byteData ) ; } finally { closeDownloadStream ( out ) ; } } catch ( RuntimeException e ) { throw new ResponseDownloadFailureException ( "Failed to download the byte data: " + resource , e ) ; } catch ( IOException e ) { handleDownloadIOException ( resource , e ) ; }
public class StopInstanceRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( StopInstanceRequest stopInstanceRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( stopInstanceRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( stopInstanceRequest . getInstanceId ( ) , INSTANCEID_BINDING ) ; protocolMarshaller . marshall ( stopInstanceRequest . getForce ( ) , FORCE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class Strman { /** * This method returns the index within the calling String object of the last occurrence of the specified value , searching backwards from the offset . * Returns - 1 if the value is not found . The search starts from the end and case sensitive . * @ param value The input String * @ param needle The search String * @ return Return position of the last occurrence of ' needle ' . */ public static int lastIndexOf ( final String value , final String needle ) { } }
validate ( value , NULL_STRING_PREDICATE , NULL_STRING_MSG_SUPPLIER ) ; return lastIndexOf ( value , needle , value . length ( ) , true ) ;
public class RuleBasedCollator { /** * Method to set numeric collation to its default value . * @ see # getNumericCollation * @ see # setNumericCollation */ public void setNumericCollationDefault ( ) { } }
checkNotFrozen ( ) ; CollationSettings defaultSettings = getDefaultSettings ( ) ; if ( settings . readOnly ( ) == defaultSettings ) { return ; } CollationSettings ownedSettings = getOwnedSettings ( ) ; ownedSettings . setFlagDefault ( CollationSettings . NUMERIC , defaultSettings . options ) ; setFastLatinOptions ( ownedSettings ) ;
public class CsvFileExtensions { /** * Formats the List that contains String - object to a csv - file wich is plus - minus 100 characters * in every line . * @ param list * The List with the Strings . * @ return The String produced from the List . */ private static String formatListToString ( final List < String > list ) { } }
int lineLength = 0 ; final StringBuffer sb = new StringBuffer ( ) ; for ( final String str : list ) { final int length = str . length ( ) ; lineLength = length + lineLength ; sb . append ( str ) ; sb . append ( ", " ) ; if ( 100 < lineLength ) { sb . append ( "\n" ) ; lineLength = 0 ; } } return sb . toString ( ) . trim ( ) ;
public class SlopPusherJob { /** * A slop is dead if the destination node or the store does not exist * anymore on the cluster . * @ param slop * @ return */ protected boolean isSlopDead ( Cluster cluster , Set < String > storeNames , Slop slop ) { } }
// destination node , no longer exists if ( ! cluster . getNodeIds ( ) . contains ( slop . getNodeId ( ) ) ) { return true ; } // destination store , no longer exists if ( ! storeNames . contains ( slop . getStoreName ( ) ) ) { return true ; } // else . slop is alive return false ;
public class LinkedIOSubchannel { /** * Returns the linked downstream channel that has been created for the * given component and ( upstream ) subchannel . If more than one linked * subchannel has been created for a given component and subchannel , * the linked subchannel created last is returned . * @ param hub the component that manages this channel * @ param upstreamChannel the ( upstream ) channel * @ return the linked downstream subchannel created for the * given component and ( upstream ) subchannel if it exists */ public static Optional < ? extends LinkedIOSubchannel > downstreamChannel ( Manager hub , IOSubchannel upstreamChannel ) { } }
return upstreamChannel . associated ( new KeyWrapper ( hub ) , LinkedIOSubchannel . class ) ;
public class ResourceUtteranceReader { /** * { @ inheritDoc } */ @ Override public InputStream read ( final String locale ) { } }
Validate . notNull ( locale , "Locale must not be blank." ) ; final String resourcePath = leadingPath + locale + resourceLocation ; final String resourcePath2 = resourcePath . startsWith ( "/" ) ? resourcePath . substring ( 1 ) : resourcePath ; final ClassLoader cl = getClass ( ) . getClassLoader ( ) ; Validate . notNull ( cl . getResource ( resourcePath2 ) , "Resource " + resourcePath2 + " does not exist in current context." ) ; return cl . getResourceAsStream ( resourcePath2 ) ;
public class NwwPanel { /** * Set the globe as sphere . */ public void setSphereGlobe ( ) { } }
Earth globe = new Earth ( ) ; wwd . getModel ( ) . setGlobe ( globe ) ; wwd . getView ( ) . stopMovement ( ) ; wwd . redraw ( ) ;
public class JFSCheckBox { /** * Set the value . * @ param objValue The raw data ( a Boolean ) . */ public void setControlValue ( Object objValue ) { } }
boolean bSelected = false ; if ( objValue instanceof Boolean ) { bSelected = ( ( Boolean ) objValue ) . booleanValue ( ) ; } else if ( objValue instanceof String ) { String strValue = objValue . toString ( ) ; if ( strValue . length ( ) > 0 ) { if ( ( Character . toUpperCase ( strValue . charAt ( 0 ) ) == 'T' ) || ( Character . toUpperCase ( strValue . charAt ( 0 ) ) == 'Y' ) ) bSelected = true ; } } this . setSelected ( bSelected ) ;
public class BuildingType { /** * Gets the value of the genericApplicationPropertyOfBuilding 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 genericApplicationPropertyOfBuilding property . * For example , to add a new item , do as follows : * < pre > * get _ GenericApplicationPropertyOfBuilding ( ) . add ( newItem ) ; * < / pre > * Objects of the following type ( s ) are allowed in the list * { @ link JAXBElement } { @ code < } { @ link Object } { @ code > } * { @ link JAXBElement } { @ code < } { @ link Object } { @ code > } */ public List < JAXBElement < Object > > get_GenericApplicationPropertyOfBuilding ( ) { } }
if ( _GenericApplicationPropertyOfBuilding == null ) { _GenericApplicationPropertyOfBuilding = new ArrayList < JAXBElement < Object > > ( ) ; } return this . _GenericApplicationPropertyOfBuilding ;
public class Cob2Xsd { /** * Execute the translation from COBOL to XML Schema . * @ param cobolReader reads the raw COBOL source * @ param targetNamespace the generated XML schema target namespace ( null * for no namespace ) * @ param xsltFileName an optional xslt to apply on the XML Schema * @ return the XML Schema * @ throws XsdGenerationException if XML schema generation process fails */ public String translate ( final Reader cobolReader , final String targetNamespace , final String xsltFileName ) throws XsdGenerationException { } }
try { if ( _log . isDebugEnabled ( ) ) { _log . debug ( "Translating with options: {}" , getConfig ( ) . toString ( ) ) ; _log . debug ( "Target namespace: {}" , targetNamespace ) ; } return xsdToString ( emitXsd ( toModel ( cobolReader ) , targetNamespace ) , xsltFileName ) ; } catch ( RecognizerException e ) { throw new XsdGenerationException ( e ) ; }
public class ConnectionImpl { /** * ( non - Javadoc ) * @ see com . ibm . wsspi . sib . core . SICoreConnection # createTemporaryDestination ( com . ibm . ws . sib . common . Distribution , java . lang . String ) */ @ Override public SIDestinationAddress createTemporaryDestination ( Distribution distribution , String destinationPrefix ) throws SIConnectionUnavailableException , SIConnectionDroppedException , SIResourceException , SIConnectionLostException , SILimitExceededException , SIErrorException , SINotAuthorizedException , SIInvalidDestinationPrefixException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && CoreSPIConnection . tc . isEntryEnabled ( ) ) SibTr . entry ( CoreSPIConnection . tc , "createTemporaryDestination" , new Object [ ] { this , destinationPrefix , distribution } ) ; // See if this connection has been closed checkNotClosed ( ) ; // Check to make sure that the destination prefix is valid . // If it ' s not , then we can ' t continue . String result = SICoreUtils . isDestinationPrefixValid ( destinationPrefix ) ; if ( ! result . equals ( SICoreUtils . VALID ) ) // if its not valid there is something wrong { if ( result . equals ( SICoreUtils . MAX_LENGTH_EXCEEDED ) ) { // prefix length might have been exceeded if ( TraceComponent . isAnyTracingEnabled ( ) && CoreSPIConnection . tc . isEntryEnabled ( ) ) SibTr . exit ( CoreSPIConnection . tc , "createTemporaryDestination" , "SIInvalidDestinationPrefixException" ) ; throw new SIInvalidDestinationPrefixException ( nls . getFormattedMessage ( "INVALID_DESTINATION_PREFIX_MAX_LENGTH_ERROR_CWSIP0039" , null , null ) ) ; } else { // an invalid character is there in the prefix if ( TraceComponent . isAnyTracingEnabled ( ) && CoreSPIConnection . tc . isEntryEnabled ( ) ) SibTr . exit ( CoreSPIConnection . tc , "createTemporaryDestination" , "SIInvalidDestinationPrefixException" ) ; throw new SIInvalidDestinationPrefixException ( nls . getFormattedMessage ( "INVALID_DESTINATION_PREFIX_CHAR_ERROR_CWSIP0040" , new Object [ ] { destinationPrefix , result } , null ) ) ; } } SIDestinationAddress address = null ; // Synchronize on the close object , we don ' t want the connection closing // while we try to add the temporary destination . synchronized ( this ) { // Check authority to create destination // If security is disabled then we ' ll bypass the check checkTempDestinationCreation ( ( destinationPrefix == null ? "" : destinationPrefix ) , distribution ) ; // Synchronize on the temporaryDestinations list object so that we can ' t collide // on creations . This will also ensure list integrity . synchronized ( _temporaryDestinations ) { // pass this on to the destination manager try { address = _destinationManager . createTemporaryDestination ( distribution , destinationPrefix ) ; } catch ( SIMPDestinationAlreadyExistsException e ) { // FFDC FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.ConnectionImpl.createTemporaryDestination" , "1:3712:1.347.1.25" , this ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.ConnectionImpl" , "1:3718:1.347.1.25" , e } ) ; // This should never be thrown if ( TraceComponent . isAnyTracingEnabled ( ) && CoreSPIConnection . tc . isEntryEnabled ( ) ) SibTr . exit ( CoreSPIConnection . tc , "createTemporaryDestination" , "SIErrorException" ) ; throw new SIErrorException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.ConnectionImpl" , "1:3729:1.347.1.25" , e } , null ) , e ) ; } // add to list _temporaryDestinations . add ( address . getDestinationName ( ) ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && CoreSPIConnection . tc . isEntryEnabled ( ) ) SibTr . exit ( CoreSPIConnection . tc , "createTemporaryDestination" , address ) ; return address ;
public class EJSContainer { /** * LIDB2617.11 added this method . F88119 made method public */ public void preInvokeMdbAfterActivate ( EJSWrapperBase wrapper , EJSDeployedSupport s , Object eb , // d414873 Object [ ] args ) throws RemoteException { } }
// Now perform preinvoke processing that must occur after // the bean is activated . preInvokeAfterActivate ( wrapper , eb , s , args ) ; // If there is a registered message endpoint collaborator , call it for preInvoke processing . MessageEndpointCollaborator meCollaborator = getEJBRuntime ( ) . getMessageEndpointCollaborator ( wrapper . bmd ) ; if ( meCollaborator != null ) { HashMap < String , Object > contextData = new HashMap < String , Object > ( ) ; contextData . put ( MessageEndpointCollaborator . KEY_ACTIVATION_SPEC_ID , wrapper . bmd . ivActivationSpecJndiName ) ; contextData . put ( MessageEndpointCollaborator . KEY_J2EE_NAME , wrapper . bmd . j2eeName ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Invoking MECollaborator " + meCollaborator + " for preInvoke processing with the following context data: " + contextData ) ; } s . messageEndpointContext = meCollaborator . preInvoke ( contextData ) ; } // Normal path exit . if ( TraceComponent . isAnyTracingEnabled ( ) ) { if ( tc . isEntryEnabled ( ) ) { int methodId = s . methodId ; EJBMethodInfoImpl methodInfo = s . methodInfo ; ContainerTx containerTx = s . currentTx ; Tr . exit ( tc , "EJBpreInvoke(" + methodId + ":" + methodInfo . getMethodName ( ) + ") " + " Invoking method '" + methodInfo . getMethodName ( ) + "' on bean '" + wrapper . getClass ( ) . getName ( ) + "(" + wrapper . beanId + ")" + "', '" + containerTx + "', isGlobalTx=" + ( containerTx != null ? ( containerTx . isTransactionGlobal ( ) ? "true" : "false" ) : "Unknown" ) ) ; } if ( TEEJBInvocationInfo . isTraceEnabled ( ) ) TEEJBInvocationInfo . tracePreInvokeEnds ( s , wrapper ) ; }
public class Reporter { /** * Helper to recordStep , which takes in some result , and appends a time waited , if * appropriate . If timeTook is greater than zero , some time was waited along with * the action , and the returned result will reflect that * @ param actual - the actual outcome from the check * @ param timeTook - how long something took to run , provide 0 if it was an immediate check , and actual * will be returned unaltered * @ return String : the actual response , prepended with a wait time if appropriate */ private String getActual ( String actual , double timeTook ) { } }
if ( timeTook > 0 ) { String lowercase = actual . substring ( 0 , 1 ) . toLowerCase ( ) ; actual = "After waiting for " + timeTook + " seconds, " + lowercase + actual . substring ( 1 ) ; } return actual ;
public class AgreementsInner { /** * Gets a list of integration account agreements . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; IntegrationAccountAgreementInner & gt ; object */ public Observable < Page < IntegrationAccountAgreementInner > > listByIntegrationAccountsNextAsync ( final String nextPageLink ) { } }
return listByIntegrationAccountsNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < IntegrationAccountAgreementInner > > , Page < IntegrationAccountAgreementInner > > ( ) { @ Override public Page < IntegrationAccountAgreementInner > call ( ServiceResponse < Page < IntegrationAccountAgreementInner > > response ) { return response . body ( ) ; } } ) ;
public class ApiOvhPackxdsl { /** * Get the available templates * REST : GET / pack / xdsl / { packName } / siteBuilderFull / options / templates * @ param packName [ required ] The internal name of your pack */ public ArrayList < OvhSiteBuilderTemplate > packName_siteBuilderFull_options_templates_GET ( String packName ) throws IOException { } }
String qPath = "/pack/xdsl/{packName}/siteBuilderFull/options/templates" ; StringBuilder sb = path ( qPath , packName ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t8 ) ;
public class TreeWriter { /** * Generate the interface hierarchy and class hierarchy . */ public void generateTreeFile ( ) throws IOException { } }
Content body = getTreeHeader ( ) ; Content headContent = getResource ( "doclet.Hierarchy_For_All_Packages" ) ; Content heading = HtmlTree . HEADING ( HtmlConstants . TITLE_HEADING , false , HtmlStyle . title , headContent ) ; Content div = HtmlTree . DIV ( HtmlStyle . header , heading ) ; addPackageTreeLinks ( div ) ; body . addContent ( div ) ; HtmlTree divTree = new HtmlTree ( HtmlTag . DIV ) ; divTree . addStyle ( HtmlStyle . contentContainer ) ; addTree ( classtree . baseclasses ( ) , "doclet.Class_Hierarchy" , divTree ) ; addTree ( classtree . baseinterfaces ( ) , "doclet.Interface_Hierarchy" , divTree ) ; addTree ( classtree . baseAnnotationTypes ( ) , "doclet.Annotation_Type_Hierarchy" , divTree ) ; addTree ( classtree . baseEnums ( ) , "doclet.Enum_Hierarchy" , divTree ) ; body . addContent ( divTree ) ; addNavLinks ( false , body ) ; addBottom ( body ) ; printHtmlDocument ( null , true , body ) ;
public class LogUtils { /** * Zwraca logger o określonej nazwie będący implementacją interfejsu * { @ link Logger } . * @ param < T > Parametr typu klasy loggera . * @ param name Nazwa zwracanego logger ' a . * @ return Logger o wskazanej nazwie . */ @ SuppressWarnings ( "unchecked" ) public static < T , L extends LoggerInformer > L getLogger ( String name ) { } }
return ( L ) SLF4JLoggerFactory . getLogger ( name ) ;
public class StringGrabber { /** * Splits this string around matches of the given regular expression . * @ param regexp * @ return */ public StringGrabberList split ( String regexp ) { } }
final StringGrabberList retList = new StringGrabberList ( ) ; final String string = sb . toString ( ) ; String [ ] splitedStrings = string . split ( regexp ) ; for ( String str : splitedStrings ) { retList . add ( new StringGrabber ( str ) ) ; } return retList ;
public class MiniMax { /** * Find the maximum distance of one object to a set . * @ param dq Distance query * @ param i Current object * @ param cy Set of candidates * @ param maxDist Known maximum to others * @ param minMaxDist Early stopping threshold * @ return Maximum distance */ private static double findMax ( DistanceQuery < ? > dq , DBIDIter i , DBIDs cy , double maxDist , double minMaxDist ) { } }
for ( DBIDIter j = cy . iter ( ) ; j . valid ( ) ; j . advance ( ) ) { double dist = dq . distance ( i , j ) ; if ( dist > maxDist ) { // Stop early , if we already know a better candidate . if ( dist >= minMaxDist ) { return dist ; } maxDist = dist ; } } return maxDist ;
public class ChangeLog { /** * Returns a { @ link Comparator } that specifies the sort order of the { @ link ReleaseItem } s . * The default implementation returns the items in reverse order ( latest version first ) . */ protected Comparator < ReleaseItem > getChangeLogComparator ( ) { } }
return new Comparator < ReleaseItem > ( ) { @ Override public int compare ( ReleaseItem lhs , ReleaseItem rhs ) { if ( lhs . versionCode < rhs . versionCode ) { return 1 ; } else if ( lhs . versionCode > rhs . versionCode ) { return - 1 ; } else { return 0 ; } } } ;
public class CmsNewResourceTypeDialog { /** * Adjustes module config . < p > */ private void adjustModuleConfig ( ) { } }
Locale l = CmsLocaleManager . getLocale ( "en" ) ; try { CmsResource config = m_cms . readResource ( m_config . getValue ( ) ) ; CmsFile configFile = m_cms . readFile ( config ) ; CmsXmlContent xmlContent = CmsXmlContentFactory . unmarshal ( m_cms , configFile ) ; int number = xmlContent . getIndexCount ( XMLPath . CONFIG_RESOURCETYPE , l ) + 1 ; createParentXmlElements ( xmlContent , XMLPath . CONFIG_RESOURCETYPE + XMLPath . num ( number ) + XMLPath . CONFIG_RESOURCETYPE_TYPENAME , l ) ; I_CmsXmlContentValue v = xmlContent . getValue ( XMLPath . CONFIG_RESOURCETYPE + XMLPath . num ( number ) + XMLPath . CONFIG_RESOURCETYPE_TYPENAME , l ) ; v . setStringValue ( m_cms , m_typeShortName . getValue ( ) ) ; v = xmlContent . addValue ( m_cms , XMLPath . CONFIG_RESOURCETYPE + XMLPath . num ( number ) + XMLPath . CONFIG_RESOURCETYPE_NAMEPATTERN , l , CmsXmlUtils . getXpathIndexInt ( XMLPath . CONFIG_RESOURCETYPE + XMLPath . num ( number ) + XMLPath . CONFIG_RESOURCETYPE_NAMEPATTERN ) - 1 ) ; v . setStringValue ( m_cms , getNamePattern ( ) ) ; configFile . setContents ( xmlContent . marshal ( ) ) ; CmsLockUtil . ensureLock ( m_cms , configFile ) ; m_cms . writeFile ( configFile ) ; CmsLockUtil . tryUnlock ( m_cms , configFile ) ; } catch ( CmsException e ) { LOG . error ( "Can't read module config resource" , e ) ; }
public class HttpClientMockBuilder { /** * Adds action which returns provided XML in UTF - 8 and status 200 . Additionally it sets " Content - type " header to " application / xml " . * @ param response JSON to return * @ return response builder */ public HttpClientResponseBuilder doReturnXML ( String response , Charset charset ) { } }
return responseBuilder . doReturnXML ( response , charset ) ;
public class DynamicByteBuffer { /** * Adds the . * @ param array the array * @ return the dynamic byte buffer */ public DynamicByteBuffer add ( byte [ ] array ) { } }
if ( array . length + this . length < capacity ) { DynamicByteBufferHelper . _idx ( buffer , length , array ) ; } else { buffer = DynamicByteBufferHelper . grow ( buffer , buffer . length * 2 + array . length ) ; capacity = buffer . length ; DynamicByteBufferHelper . _idx ( buffer , length , array ) ; } length += array . length ; return this ;
public class MutableHashTable { /** * This method clears all partitions currently residing ( partially ) in memory . It releases all memory * and deletes all spilled partitions . * This method is intended for a hard cleanup in the case that the join is aborted . */ protected void clearPartitions ( ) { } }
for ( int i = this . partitionsBeingBuilt . size ( ) - 1 ; i >= 0 ; -- i ) { final HashPartition < BT , PT > p = this . partitionsBeingBuilt . get ( i ) ; try { p . clearAllMemory ( this . availableMemory ) ; } catch ( Exception e ) { LOG . error ( "Error during partition cleanup." , e ) ; } } this . partitionsBeingBuilt . clear ( ) ;
public class StartGameSessionPlacementRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( StartGameSessionPlacementRequest startGameSessionPlacementRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( startGameSessionPlacementRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( startGameSessionPlacementRequest . getPlacementId ( ) , PLACEMENTID_BINDING ) ; protocolMarshaller . marshall ( startGameSessionPlacementRequest . getGameSessionQueueName ( ) , GAMESESSIONQUEUENAME_BINDING ) ; protocolMarshaller . marshall ( startGameSessionPlacementRequest . getGameProperties ( ) , GAMEPROPERTIES_BINDING ) ; protocolMarshaller . marshall ( startGameSessionPlacementRequest . getMaximumPlayerSessionCount ( ) , MAXIMUMPLAYERSESSIONCOUNT_BINDING ) ; protocolMarshaller . marshall ( startGameSessionPlacementRequest . getGameSessionName ( ) , GAMESESSIONNAME_BINDING ) ; protocolMarshaller . marshall ( startGameSessionPlacementRequest . getPlayerLatencies ( ) , PLAYERLATENCIES_BINDING ) ; protocolMarshaller . marshall ( startGameSessionPlacementRequest . getDesiredPlayerSessions ( ) , DESIREDPLAYERSESSIONS_BINDING ) ; protocolMarshaller . marshall ( startGameSessionPlacementRequest . getGameSessionData ( ) , GAMESESSIONDATA_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class CopticDate { /** * Obtains a { @ code CopticDate } representing a date in the Coptic calendar * system from the proleptic - year , month - of - year and day - of - month fields . * This returns a { @ code CopticDate } with the specified fields . * The day must be valid for the year and month , otherwise an exception will be thrown . * @ param prolepticYear the Coptic proleptic - year * @ param month the Coptic month - of - year , from 1 to 13 * @ param dayOfMonth the Coptic day - of - month , from 1 to 30 * @ return the date in Coptic calendar system , not null * @ throws DateTimeException if the value of any field is out of range , * or if the day - of - month is invalid for the month - year */ public static CopticDate of ( int prolepticYear , int month , int dayOfMonth ) { } }
return CopticDate . create ( prolepticYear , month , dayOfMonth ) ;
public class AbstractConnectionFactory { /** * Creates and returns the connection to be used . * @ return The connection */ public Connection < T > createConnection ( ) { } }
// log info this . LOGGER . logInfo ( new Object [ ] { "Opening a new connection from factory type: " , this . getClass ( ) . getName ( ) } , null ) ; // create resource T resource = this . createResourceImpl ( ) ; if ( resource == null ) { throw new FaxException ( "Unable to create resource." ) ; } // create connection Connection < T > connection = this . createConnectionForResource ( resource ) ; // register connection CloseableResourceManager . registerCloseable ( connection ) ; // log info this . LOGGER . logInfo ( new Object [ ] { "New connection opened." } , null ) ; return connection ;
public class SquareNode { /** * Discards previous information */ public void reset ( ) { } }
square = null ; touch = null ; center . set ( - 1 , - 1 ) ; largestSide = 0 ; smallestSide = Double . MAX_VALUE ; graph = RESET_GRAPH ; for ( int i = 0 ; i < edges . length ; i ++ ) { if ( edges [ i ] != null ) throw new RuntimeException ( "BUG!" ) ; sideLengths [ i ] = 0 ; }
public class CompilerConfiguration { /** * Method to configure a this CompilerConfiguration by using Properties . * For a list of available properties look at { link { @ link # CompilerConfiguration ( Properties ) } . * @ param configuration The properties to get flag values from . */ public void configure ( Properties configuration ) throws ConfigurationException { } }
String text = null ; int numeric = 0 ; // Warning level numeric = getWarningLevel ( ) ; try { text = configuration . getProperty ( "groovy.warnings" , "likely errors" ) ; numeric = Integer . parseInt ( text ) ; } catch ( NumberFormatException e ) { text = text . toLowerCase ( ) ; if ( text . equals ( "none" ) ) { numeric = WarningMessage . NONE ; } else if ( text . startsWith ( "likely" ) ) { numeric = WarningMessage . LIKELY_ERRORS ; } else if ( text . startsWith ( "possible" ) ) { numeric = WarningMessage . POSSIBLE_ERRORS ; } else if ( text . startsWith ( "paranoia" ) ) { numeric = WarningMessage . PARANOIA ; } else { throw new ConfigurationException ( "unrecognized groovy.warnings: " + text ) ; } } setWarningLevel ( numeric ) ; // Source file encoding text = configuration . getProperty ( "groovy.source.encoding" ) ; if ( text == null ) { text = configuration . getProperty ( "file.encoding" , "US-ASCII" ) ; } setSourceEncoding ( text ) ; // Target directory for classes text = configuration . getProperty ( "groovy.target.directory" ) ; if ( text != null ) setTargetDirectory ( text ) ; text = configuration . getProperty ( "groovy.target.bytecode" ) ; if ( text != null ) setTargetBytecode ( text ) ; // Classpath text = configuration . getProperty ( "groovy.classpath" ) ; if ( text != null ) setClasspath ( text ) ; // Verbosity text = configuration . getProperty ( "groovy.output.verbose" ) ; if ( text != null && text . equalsIgnoreCase ( "true" ) ) setVerbose ( true ) ; // Debugging text = configuration . getProperty ( "groovy.output.debug" ) ; if ( text != null && text . equalsIgnoreCase ( "true" ) ) setDebug ( true ) ; // Tolerance numeric = 10 ; try { text = configuration . getProperty ( "groovy.errors.tolerance" , "10" ) ; numeric = Integer . parseInt ( text ) ; } catch ( NumberFormatException e ) { throw new ConfigurationException ( e ) ; } setTolerance ( numeric ) ; // Script Base Class text = configuration . getProperty ( "groovy.script.base" ) ; if ( text != null ) setScriptBaseClass ( text ) ; // recompilation options text = configuration . getProperty ( "groovy.recompile" ) ; if ( text != null ) { setRecompileGroovySource ( text . equalsIgnoreCase ( "true" ) ) ; } numeric = 100 ; try { text = configuration . getProperty ( "groovy.recompile.minimumIntervall" ) ; if ( text == null ) text = configuration . getProperty ( "groovy.recompile.minimumInterval" ) ; if ( text != null ) { numeric = Integer . parseInt ( text ) ; } else { numeric = 100 ; } } catch ( NumberFormatException e ) { throw new ConfigurationException ( e ) ; } setMinimumRecompilationInterval ( numeric ) ; // disabled global AST transformations text = configuration . getProperty ( "groovy.disabled.global.ast.transformations" ) ; if ( text != null ) { String [ ] classNames = text . split ( ",\\s*}" ) ; Set < String > blacklist = new HashSet < String > ( Arrays . asList ( classNames ) ) ; setDisabledGlobalASTTransformations ( blacklist ) ; }
public class DigestUtils { /** * Calculates digest and returns the value as a hex string . * @ param is input stream * @ param digest digest algorithm * @ return digest as a hex string * @ throws IOException On error reading from the stream */ public static String dgstHex ( InputStream is , Digest digest ) throws IOException { } }
checkNotNull ( is ) ; byte [ ] dgstBytes = dgst ( is , digest ) ; return BaseEncoding . base16 ( ) . encode ( dgstBytes ) ;
public class Reference { /** * { @ inheritDoc } */ public int compareTo ( Object o ) { } }
Reference referenceCompared = ( Reference ) o ; int compare = specification . compareTo ( referenceCompared . specification ) ; if ( compare != 0 ) { return compare ; } compare = requirement . compareTo ( referenceCompared . requirement ) ; if ( compare != 0 ) { return compare ; } compare = systemUnderTest . compareTo ( referenceCompared . systemUnderTest ) ; if ( compare != 0 ) { return compare ; } return StringUtil . compare ( sections , referenceCompared . sections ) ;
public class AwsSecurityFindingFilters { /** * An ISO8601 - formatted timestamp that indicates when the potential security issue captured by a finding was created * by the security findings provider . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setCreatedAt ( java . util . Collection ) } or { @ link # withCreatedAt ( java . util . Collection ) } if you want to * override the existing values . * @ param createdAt * An ISO8601 - formatted timestamp that indicates when the potential security issue captured by a finding was * created by the security findings provider . * @ return Returns a reference to this object so that method calls can be chained together . */ public AwsSecurityFindingFilters withCreatedAt ( DateFilter ... createdAt ) { } }
if ( this . createdAt == null ) { setCreatedAt ( new java . util . ArrayList < DateFilter > ( createdAt . length ) ) ; } for ( DateFilter ele : createdAt ) { this . createdAt . add ( ele ) ; } return this ;
public class DensePositiveMapper { @ Override public void undo ( int [ ] input , final int start , final int length ) { } }
for ( int i = start , l = length ; l > 0 ; l -- , i ++ ) { input [ i ] = backward [ input [ i ] ] ; }
public class TransliteratorParser { /** * Throw an exception indicating a syntax error . Search the rule string * for the probable end of the rule . Of course , if the error is that * the end of rule marker is missing , then the rule end will not be found . * In any case the rule start will be correctly reported . * @ param msg error description * @ param rule pattern string * @ param start position of first character of current rule */ static final void syntaxError ( String msg , String rule , int start ) { } }
int end = ruleEnd ( rule , start , rule . length ( ) ) ; throw new IllegalIcuArgumentException ( msg + " in \"" + Utility . escape ( rule . substring ( start , end ) ) + '"' ) ;
public class AtomContainerSet { /** * Removes an AtomContainer from this container . * @ param pos The position of the AtomContainer to be removed from this container */ @ Override public void removeAtomContainer ( int pos ) { } }
for ( int i = pos ; i < atomContainerCount - 1 ; i ++ ) { atomContainers [ i ] = atomContainers [ i + 1 ] ; multipliers [ i ] = multipliers [ i + 1 ] ; } atomContainers [ atomContainerCount - 1 ] = null ; atomContainerCount -- ;
public class GatewayLinkControlAdapter { /** * / * ( non - Javadoc ) * @ see com . ibm . ws . sib . processor . runtime . ControlAdapter # runtimeEventOccurred ( com . ibm . ws . sib . admin . RuntimeEvent ) */ public void runtimeEventOccurred ( RuntimeEvent event ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "runtimeEventOccurred" , new Object [ ] { event } ) ; // Call out to the real GatewayLink MBean ' s RuntimeEventListener // if we determine it to be non - null . if ( _rel != null ) { _rel . runtimeEventOccurred ( _jsme , event . getType ( ) , event . getMessage ( ) , ( Properties ) event . getUserData ( ) ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Null RuntimeEventListener, cannot fire event" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "runtimeEventOccurred" , this ) ;
public class Search { /** * Gets the list of suggestions that match the given query . * @ return * can be empty but never null . The size of the list is always smaller than * a certain threshold to avoid showing too many options . */ public SearchResult getSuggestions ( StaplerRequest req , String query ) { } }
Set < String > paths = new HashSet < > ( ) ; // paths already added , to control duplicates SearchResultImpl r = new SearchResultImpl ( ) ; int max = req . hasParameter ( "max" ) ? Integer . parseInt ( req . getParameter ( "max" ) ) : 100 ; SearchableModelObject smo = findClosestSearchableModelObject ( req ) ; for ( SuggestedItem i : suggest ( makeSuggestIndex ( req ) , query , smo ) ) { if ( r . size ( ) >= max ) { r . hasMoreResults = true ; break ; } if ( paths . add ( i . getPath ( ) ) ) r . add ( i ) ; } return r ;
public class TextComponentUtil { /** * This will return a two element array , start line pos and end line pos . * The character from the document for the startPos will be the first character of the line * The character from the document for the endPos will be the last character of the line , i . e . the char before the new * line if one is present . * @ return a two element array with the start and end positions of the given line */ public static int [ ] getLineStartAndEndPositions ( String text , int initialCaretPosition ) { } }
return new int [ ] { getLineStart ( text , initialCaretPosition ) , getLineEnd ( text , initialCaretPosition ) } ;
public class VarTensor { /** * Multiplies a factor to this one . * From libDAI : * The product of two factors is defined as follows : if * \ f $ f : \ prod _ { l \ in L } X _ l \ to [ 0 , \ infty ) \ f $ and \ f $ g : \ prod _ { m \ in M } X _ m \ to [ 0 , \ infty ) \ f $ , then * \ f [ fg : \ prod _ { l \ in L \ cup M } X _ l \ to [ 0 , \ infty ) : x \ mapsto f ( x _ L ) g ( x _ M ) . \ f ] */ public void prod ( VarTensor f ) { } }
VarTensor newFactor = applyBinOp ( this , f , new AlgebraLambda . Prod ( ) ) ; internalSet ( newFactor ) ;
public class DateUtils { /** * Test if an event date specifies a duration of one day or less . * @ param eventDate to test . * @ return true if duration is one day or less . */ public static boolean specificToDay ( String eventDate ) { } }
boolean result = false ; if ( ! isEmpty ( eventDate ) ) { Interval eventDateInterval = extractInterval ( eventDate ) ; logger . debug ( eventDateInterval ) ; logger . debug ( eventDateInterval . toDuration ( ) ) ; if ( eventDateInterval . toDuration ( ) . getStandardDays ( ) < 1l ) { result = true ; } else if ( eventDateInterval . toDuration ( ) . getStandardDays ( ) == 1l && eventDateInterval . getStart ( ) . getDayOfYear ( ) == eventDateInterval . getEnd ( ) . getDayOfYear ( ) ) { result = true ; } } return result ;
public class SequenceAlgorithms { /** * Returns the longest common sequence between two strings as a string . */ public static String longestCommonSequence ( String s1 , String s2 ) { } }
int start = 0 ; int max = 0 ; for ( int i = 0 ; i < s1 . length ( ) ; i ++ ) { for ( int j = 0 ; j < s2 . length ( ) ; j ++ ) { int x = 0 ; while ( s1 . charAt ( i + x ) == s2 . charAt ( j + x ) ) { x ++ ; if ( ( ( i + x ) >= s1 . length ( ) ) || ( ( j + x ) >= s2 . length ( ) ) ) break ; } if ( x > max ) { max = x ; start = i ; } } } return s1 . substring ( start , ( start + max ) ) ;
public class CronParser { /** * Build possible cron expressions from definitions . One is built for sure . A second one may be build if last field is optional . * @ param cronDefinition - cron definition instance */ private void buildPossibleExpressions ( final CronDefinition cronDefinition ) { } }
final List < CronParserField > sortedExpression = cronDefinition . getFieldDefinitions ( ) . stream ( ) . map ( this :: toCronParserField ) . sorted ( CronParserField . createFieldTypeComparator ( ) ) . collect ( Collectors . toList ( ) ) ; List < CronParserField > tempExpression = sortedExpression ; while ( lastFieldIsOptional ( tempExpression ) ) { int expressionLength = tempExpression . size ( ) - 1 ; ArrayList < CronParserField > possibleExpression = new ArrayList < > ( tempExpression . subList ( 0 , expressionLength ) ) ; expressions . put ( expressionLength , possibleExpression ) ; tempExpression = possibleExpression ; } expressions . put ( sortedExpression . size ( ) , sortedExpression ) ;
public class MpscBlockingConsumerArrayQueue { /** * { @ inheritDoc } * This implementation is correct for single consumer thread use only . */ @ SuppressWarnings ( "unchecked" ) @ Override public E poll ( ) { } }
final E [ ] buffer = consumerBuffer ; final long mask = consumerMask ; final long index = lpConsumerIndex ( ) ; final long offset = modifiedCalcElementOffset ( index , mask ) ; Object e = lvElement ( buffer , offset ) ; // LoadLoad if ( e == null ) { // consumer can ' t see the odd producer index if ( index != lvProducerIndex ( ) ) { // poll ( ) = = null iff queue is empty , null element is not strong enough indicator , so we must // check the producer index . If the queue is indeed not empty we spin until element is // visible . e = spinWaitForElement ( buffer , offset ) ; } else { return null ; } } soElement ( buffer , offset , null ) ; // release element null soConsumerIndex ( index + 2 ) ; // release cIndex return ( E ) e ;
public class SecurityServletConfiguratorHelper { /** * Create a list of roles that represent the security - role elements in the web . xml and / or web - fragment . xml * @ param securityRoles a list of security roles */ private void processSecurityRoles ( List < SecurityRole > securityRoles ) { } }
for ( SecurityRole securityRole : securityRoles ) { if ( ! allRoles . contains ( securityRole . getRoleName ( ) ) ) { allRoles . add ( securityRole . getRoleName ( ) ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "allRoles: " + allRoles ) ; }
public class SendQueueHolder { /** * Handle the command send from my client peer . * @ param in The ( optional ) Inputstream to get the params from . * @ param out The stream to write the results . */ public void doProcess ( InputStream in , PrintWriter out , Map < String , Object > properties ) throws RemoteException { } }
String strCommand = this . getProperty ( REMOTE_COMMAND , properties ) ; if ( SEND_MESSAGE . equals ( strCommand ) ) { BaseMessage message = ( BaseMessage ) this . getNextObjectParam ( in , MESSAGE , properties ) ; ( ( RemoteSendQueue ) m_remoteObject ) . sendMessage ( message ) ; } else super . doProcess ( in , out , properties ) ;
public class PrintJob { /** * Open an OutputStream and execute the function using the OutputStream . * @ param function the function to execute * @ return the URI and the file size */ protected PrintResult withOpenOutputStream ( final PrintAction function ) throws Exception { } }
final File reportFile = getReportFile ( ) ; final Processor . ExecutionContext executionContext ; try ( FileOutputStream out = new FileOutputStream ( reportFile ) ; BufferedOutputStream bout = new BufferedOutputStream ( out ) ) { executionContext = function . run ( bout ) ; } return new PrintResult ( reportFile . length ( ) , executionContext ) ;
public class ConnectionDialog { /** * Saves field values to preferences . */ private void save ( ) { } }
Preferences pref = Preferences . userNodeForPackage ( ConnectionDialog . class ) ; pref . put ( "host" , getHost ( ) ) ; pref . put ( "user" , getUser ( ) ) ; boolean remember = getRememberPasswordCheckBox ( ) . isSelected ( ) ; if ( remember ) { try { Cipher cipher = Cipher . getInstance ( "AES/CBC/PKCS5Padding" ) ; KeyGenerator keygen = KeyGenerator . getInstance ( "AES" ) ; SecureRandom random = SecureRandom . getInstance ( "SHA1PRNG" ) ; random . setSeed ( new byte [ ] { 0x60 , ( byte ) 0xFD , 0x28 , 0x07 , 0x35 , 0x4A , 0x0D , 0x3B } ) ; byte [ ] iv = new byte [ 16 ] ; random . nextBytes ( iv ) ; IvParameterSpec spec = new IvParameterSpec ( iv ) ; keygen . init ( 128 , random ) ; cipher . init ( Cipher . ENCRYPT_MODE , keygen . generateKey ( ) , spec ) ; byte [ ] clearText = getPassword ( ) . getBytes ( ) ; byte [ ] cipherText = cipher . doFinal ( clearText ) ; pref . putByteArray ( "password" , cipherText ) ; pref . putBoolean ( "remember" , true ) ; } catch ( Exception e ) { logger . error ( "Could not encrypt password" , e ) ; pref . remove ( "password" ) ; pref . putBoolean ( "remember" , false ) ; } } else { pref . remove ( "password" ) ; pref . putBoolean ( "remember" , false ) ; }
public class SQLSupport { /** * Create a SQL WHERE clause from the list of { @ link Filter } objects . This fragment does not begin with * WHERE . If the given list of sorts contains a Filter with filter expression " foo " , operation equals , * and value ' 42 ' , the generated SQL statement will appear as : * < pre > * foo = 42 * < / pre > * When multiple Filters in the list , the filters will be AND ' ed together in the generated SQL statement . * @ param filters the list of { @ link Filter } objects * @ return the generated SQL where clause fragment or an emtpy string if there are no filters */ public String createWhereFragment ( List /* < Filter > */ filters ) { } }
if ( filters == null || filters . size ( ) == 0 ) return EMPTY ; InternalStringBuilder sql = new InternalStringBuilder ( 64 ) ; internalCreateWhereFragment ( sql , filters ) ; return sql . toString ( ) ;
public class MissingMethodsDetector { /** * TODO : returning two types of objects , this awful , need to fix at some point */ private Object sawLoad ( int seen , Object userObject ) { } }
int reg = RegisterUtils . getALoadReg ( this , seen ) ; if ( localSpecialObjects . containsKey ( Integer . valueOf ( reg ) ) ) { return Integer . valueOf ( reg ) ; } return userObject ;
public class DscNodesInner { /** * Retrieve a list of dsc nodes . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; DscNodeInner & gt ; object */ public Observable < Page < DscNodeInner > > listByAutomationAccountNextAsync ( final String nextPageLink ) { } }
return listByAutomationAccountNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < DscNodeInner > > , Page < DscNodeInner > > ( ) { @ Override public Page < DscNodeInner > call ( ServiceResponse < Page < DscNodeInner > > response ) { return response . body ( ) ; } } ) ;
public class URBridge { private static void initializeSupportedEntities ( ) { } }
defaultSupportedEntities = new ArrayList < String > ( 2 ) ; defaultSupportedEntities . add ( Service . DO_PERSON_ACCOUNT ) ; defaultSupportedEntities . add ( Service . DO_GROUP ) ;
public class UserBS { /** * Busca usuário pelo cpf . * @ param cpf * Cpf para buscar o usuário . * @ return User Usuário que contém o cpf . */ public User existsByCpf ( String cpf ) { } }
Criteria criteria = this . dao . newCriteria ( User . class ) . add ( Restrictions . eq ( "cpf" , cpf ) ) ; return ( User ) criteria . uniqueResult ( ) ;
public class PrepareJspHelper { /** * Find all the Jsps in the doc root , and spin of threads to compile and / or Classload / JIT */ public void run ( ) { } }
if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINER ) ) { logger . logp ( Level . FINER , CLASS_NAME , "run" , "enter" ) ; } String docRoot = null , threadParam = null ; Container container = webapp . getModuleContainer ( ) ; if ( container != null ) { hasContainer = true ; } else { docRoot = webapp . getRealPath ( "/" ) ; } /* * First we gather information about the webapp and the parameters that * were specified . */ // appName = webapp . getWebAppName ( ) ; appName = webapp . getWebAppConfig ( ) . getApplicationName ( ) ; // Get the maximum length of the files that we will only compile . . . . the rest are also classloaded _minLength = options . getPrepareJSPs ( ) * 1024 ; if ( options . getPrepareJSPsClassloadChanged ( ) != null ) { onlyCLChanged = true ; _startAt = Constants . PREPARE_JSPS_DEFAULT_STARTAT ; } else { _startAt = options . getPrepareJSPsClassload ( ) ; } _threads = options . getPrepareJSPThreadCount ( ) ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) ) { logger . logp ( Level . INFO , CLASS_NAME , "run" , "PrepareJspHelper executing on application [" + this . appName + "]" ) ; } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "run" , "PrepareJspHelper: Document Root: " + docRoot ) ; logger . logp ( Level . FINE , CLASS_NAME , "run" , "PrepareJspHelper: File size minimum (in bytes): " + _minLength ) ; logger . logp ( Level . FINE , CLASS_NAME , "run" , "PrepareJspHelper: Number of threads: " + _threads ) ; if ( onlyCLChanged ) { logger . logp ( Level . FINE , CLASS_NAME , "run" , "PrepareJspHelper: Only classloading out-of-date (changed) JSPs." ) ; } else { logger . logp ( Level . FINE , CLASS_NAME , "run" , "PrepareJspHelper: Classloading JSPs starting at JSP number " + _startAt ) ; } } if ( container != null ) { createListOfEntries ( container ) ; } // Create worker threads and let them start compiling . try { Thread [ ] threads = new Thread [ _threads ] ; int i ; for ( i = 0 ; i < _threads ; i ++ ) { PrepareJspHelperThread helper = new PrepareJspHelperThread ( this , docRoot , container ) ; threads [ i ] = new Thread ( helper , "PrepareJspHelperThread " + i ) ; threads [ i ] . setDaemon ( true ) ; threads [ i ] . start ( ) ; } // now lets wait for all the threads to die . for ( i = 0 ; i < _threads ; i ++ ) { try { threads [ i ] . join ( ) ; } catch ( Throwable th ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . WARNING ) ) { logger . logp ( Level . WARNING , CLASS_NAME , "run" , "Pretouch Thread died during execution." , th ) ; } } } } catch ( Exception ex ) { logger . logp ( Level . WARNING , CLASS_NAME , "run" , "Unexpected exception while running pretouch." , ex ) ; } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . INFO ) ) { logger . logp ( Level . INFO , CLASS_NAME , "run" , "PrepareJspHelper in group [" + appName + "]: All " + _counter + " jsp files have been processed." ) ; } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINER ) ) { logger . logp ( Level . FINER , CLASS_NAME , "run" , "< run" ) ; }
public class ConnectionMonitorsInner { /** * Query a snapshot of the most recent connection states . * @ param resourceGroupName The name of the resource group containing Network Watcher . * @ param networkWatcherName The name of the Network Watcher resource . * @ param connectionMonitorName The name given to the connection monitor . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws ErrorResponseException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the ConnectionMonitorQueryResultInner object if successful . */ public ConnectionMonitorQueryResultInner beginQuery ( String resourceGroupName , String networkWatcherName , String connectionMonitorName ) { } }
return beginQueryWithServiceResponseAsync ( resourceGroupName , networkWatcherName , connectionMonitorName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class AstaDatabaseFileReader { /** * Read a project from the current data source . * @ return ProjectFile instance * @ throws MPXJException */ public ProjectFile read ( ) throws MPXJException { } }
try { m_reader = new AstaReader ( ) ; ProjectFile project = m_reader . getProject ( ) ; project . getEventManager ( ) . addProjectListeners ( m_projectListeners ) ; processProjectProperties ( ) ; processCalendars ( ) ; processResources ( ) ; processTasks ( ) ; processPredecessors ( ) ; processAssignments ( ) ; m_reader = null ; return ( project ) ; } catch ( SQLException ex ) { throw new MPXJException ( MPXJException . READ_ERROR , ex ) ; } catch ( ParseException ex ) { throw new MPXJException ( MPXJException . READ_ERROR , ex ) ; }
public class MOAUtils { /** * Returs the commandline for the given object . If the object is not * derived from AbstractOptionHandler , then only the classname . Otherwise * the classname and the options are returned . * @ param obj the object to generate the commandline for * @ return the commandline */ public static String toCommandLine ( MOAObject obj ) { } }
String result = obj . getClass ( ) . getName ( ) ; if ( obj instanceof AbstractOptionHandler ) result += " " + ( ( AbstractOptionHandler ) obj ) . getOptions ( ) . getAsCLIString ( ) ; return result . trim ( ) ;
public class CodeModelUtils { public static String getClassName ( final JClass theClass ) { } }
return ( theClass . outer ( ) == null ? theClass . fullName ( ) : getClassName ( theClass . outer ( ) ) + "$" + theClass . name ( ) ) ;
public class AbstractAppender { /** * Handles an OK install response . */ @ SuppressWarnings ( "unused" ) protected void handleInstallResponseOk ( MemberState member , InstallRequest request , InstallResponse response ) { } }
// Reset the member failure count and update the member ' s status if necessary . succeedAttempt ( member ) ; // If the install request was completed successfully , set the member ' s snapshotIndex and reset // the next snapshot index / offset . if ( request . complete ( ) ) { member . setSnapshotIndex ( request . index ( ) ) . setNextSnapshotIndex ( 0 ) . setNextSnapshotOffset ( 0 ) ; } // If more install requests remain , increment the member ' s snapshot offset . else { member . setNextSnapshotOffset ( request . offset ( ) + 1 ) ; } // Recursively append entries to the member . appendEntries ( member ) ;
public class AccountsInner { /** * Creates the specified Data Lake Analytics account . This supplies the user with computation services for Data Lake Analytics workloads . * @ param resourceGroupName The name of the Azure resource group . * @ param accountName The name of the Data Lake Analytics account . * @ param parameters Parameters supplied to create a new Data Lake Analytics account . * @ 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 DataLakeAnalyticsAccountInner object if successful . */ public DataLakeAnalyticsAccountInner beginCreate ( String resourceGroupName , String accountName , CreateDataLakeAnalyticsAccountParameters parameters ) { } }
return beginCreateWithServiceResponseAsync ( resourceGroupName , accountName , parameters ) . toBlocking ( ) . single ( ) . body ( ) ;
public class Var2Data { /** * This method retrieves a String of the specified type , * belonging to the item with the specified unique ID . * @ param id unique ID of entity to which this data belongs * @ param type data type identifier * @ return string containing required data */ public String getUnicodeString ( Integer id , Integer type ) { } }
return ( getUnicodeString ( m_meta . getOffset ( id , type ) ) ) ;
public class Util { /** * Transforms a reader into a string . * @ param reader * the reader to be transformed * @ return the string containing the content of the reader */ public static String readerToString ( Reader reader ) { } }
try { StringBuilder sb = new StringBuilder ( ) ; char [ ] buf = new char [ 1024 ] ; int numRead = 0 ; while ( ( numRead = reader . read ( buf ) ) != - 1 ) { sb . append ( buf , 0 , numRead ) ; } return sb . toString ( ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; }
public class Seconds { /** * Subtracts this amount from the specified temporal object . * This returns a temporal object of the same observable type as the input * with this amount subtracted . * In most cases , it is clearer to reverse the calling pattern by using * { @ link Temporal # minus ( TemporalAmount ) } . * < pre > * / / these two lines are equivalent , but the second approach is recommended * dateTime = thisAmount . subtractFrom ( dateTime ) ; * dateTime = dateTime . minus ( thisAmount ) ; * < / pre > * Only non - zero amounts will be subtracted . * This instance is immutable and unaffected by this method call . * @ param temporal the temporal object to adjust , not null * @ return an object of the same type with the adjustment made , not null * @ throws DateTimeException if unable to subtract * @ throws UnsupportedTemporalTypeException if the SECONDS unit is not supported * @ throws ArithmeticException if numeric overflow occurs */ @ Override public Temporal subtractFrom ( Temporal temporal ) { } }
if ( seconds != 0 ) { temporal = temporal . minus ( seconds , SECONDS ) ; } return temporal ;
public class DefaultVOMSProxyInfoBehaviour { /** * Proxy VOMS options */ private void checkVOMSOptions ( ProxyInfoParams params , List < VOMSAttribute > attributes , X509Certificate [ ] proxyChain , File proxyFilePath ) { } }
if ( params . hasACOptions ( ) && attributes . isEmpty ( ) ) throw new VOMSError ( "No VOMS attributes found!" ) ; if ( params . containsOption ( PrintOption . ACSUBJECT ) && ! params . containsOption ( PrintOption . ALL_OPTIONS ) ) { for ( VOMSAttribute a : attributes ) logger . printMessage ( OpensslNameUtilities . getOpensslSubjectString ( a . getHolder ( ) ) ) ; } if ( params . containsOption ( PrintOption . ACTIMELEFT ) && ! params . containsOption ( PrintOption . ALL_OPTIONS ) ) { for ( VOMSAttribute a : attributes ) { long notAfterInMSec = TimeUtils . getTimeLeft ( a . getVOMSAC ( ) . getNotAfter ( ) ) ; long notAfterInSec = TimeUnit . MILLISECONDS . toSeconds ( notAfterInMSec ) ; logger . printMessage ( String . valueOf ( notAfterInSec ) ) ; } } if ( params . containsOption ( PrintOption . ACISSUER ) && ! params . containsOption ( PrintOption . ALL_OPTIONS ) ) { for ( VOMSAttribute a : attributes ) logger . printMessage ( OpensslNameUtilities . getOpensslSubjectString ( a . getAACertificates ( ) [ 0 ] . getSubjectX500Principal ( ) ) ) ; } if ( params . containsOption ( PrintOption . ACSERIAL ) && ! params . containsOption ( PrintOption . ALL_OPTIONS ) ) { for ( VOMSAttribute a : attributes ) logger . printMessage ( a . getVOMSAC ( ) . getSerialNumber ( ) . toString ( ) ) ; } if ( params . containsOption ( PrintOption . AC_EXISTS ) ) { boolean foundRequestedAC = false ; for ( VOMSAttribute a : attributes ) { if ( params . getACVO ( ) . equals ( a . getVO ( ) ) ) { foundRequestedAC = true ; break ; } } if ( ! foundRequestedAC ) throw new VOMSError ( "AC not found for VO " + params . getACVO ( ) ) ; } if ( params . containsOption ( PrintOption . VONAME ) && ! params . containsOption ( PrintOption . ALL_OPTIONS ) ) { for ( VOMSAttribute a : attributes ) logger . printMessage ( a . getVO ( ) ) ; } if ( params . containsOption ( PrintOption . FQAN ) && ! params . containsOption ( PrintOption . ALL_OPTIONS ) ) { for ( VOMSAttribute a : attributes ) { for ( String f : a . getFQANs ( ) ) logger . printMessage ( f ) ; } } if ( params . containsOption ( PrintOption . SERVER_URI ) && ! params . containsOption ( PrintOption . ALL_OPTIONS ) ) { for ( VOMSAttribute a : attributes ) { logger . formatMessage ( "%s:%s\n" , a . getHost ( ) , a . getPort ( ) ) ; } }
public class ObjectValidator { /** * Validate each content model relation . * If the content model relation doesn ' t point to an object PID , note that * and give up . Same if no object is found at that PID . * If we find an actual content model object , verify that the original * object satisfies the content model . */ private void validateAgainstContentModel ( ValidationResult result , String cm , ObjectInfo object ) { } }
String contentModelPid ; if ( cm . startsWith ( "info:fedora/" ) ) { contentModelPid = cm . substring ( 12 ) ; } else { result . addNote ( ValidationResultNotation . unrecognizedContentModelUri ( cm ) ) ; return ; } try { ContentModelInfo contentModel = objectSource . getContentModelInfo ( contentModelPid ) ; if ( contentModel == null ) { result . addNote ( ValidationResultNotation . contentModelNotFound ( contentModelPid ) ) ; } else { for ( DsTypeModel typeModel : contentModel . getTypeModels ( ) ) { confirmMatchForDsTypeModel ( result , typeModel , contentModelPid , object ) ; } } } catch ( ObjectSourceException e ) { result . addNote ( ValidationResultNotation . errorFetchingContentModel ( contentModelPid , e ) ) ; return ; } catch ( InvalidContentModelException e ) { result . addNote ( ValidationResultNotation . contentModelNotValid ( e ) ) ; }